PHP كود :
Private Sub BtnaLogen_Click(sender As Object, e As EventArgs) Handles BtnaLogen.Click
If txtUserName.Text = "" Then
MessageBox.Show("من فضلك ادخل اليوزر نيم", "تاكيد", MessageBoxButtons.OK, MessageBoxIcon.[Error])
txtUserName.Focus()
Return
End If
If txtPassword.Text = "" Then
MessageBox.Show("من فضلك ادخل الباسوورد", "تاكيد", MessageBoxButtons.OK, MessageBoxIcon.[Error])
txtPassword.Focus()
Return
End If
myconn.tbl.Clear()
If rbtnManager.Checked = True Then
myconn.tbl = myconn.readData("select * from Users where User_Name='" + txtUserName.Text + "' and User_Password='" + txtPassword.Text + "' and Type='مدير'", "")
ElseIf rbtnEmp.Checked = True Then
myconn.tbl = myconn.readData("select * from Users where User_Name='" + txtUserName.Text + "' and User_Password='" + txtPassword.Text + "' and Type='مستخدم عادى'", "")
End If
myconn.tbl = myconn.readData("Select * from Users", "")
If myconn.tbl.Rows.Count <= 0 Then
myconn.exceuteData("insert into Users values (1,'admin','admin','مدير')", "") '"?????????????????//??????????????????????????
myconn.exceuteData("insert into Users_Edit Values (1 , 1,1,1,1,1)", "") '"?????????????????//??????????????????????????
myconn.exceuteData("insert into Users_seting Values (1 , 1,1,1,1)", "") '"?????????????????//??????????????????????????
myconn.exceuteData("insert into Usres_Add Values (1 , 1,1,1,1)", "") '"?????????????????//??????????????????????????
myconn.exceuteData("insert into Usres_Prent Values (1 , 1,1,1,1,1,1)", "") '"?????????????????//??????????????????????????
myconn.exceuteData("insert into Usres_Restor Values (1 , 1,1)", "") '"?????????????????//??????????????????????????
myconn.exceuteData("insert into Usres_Sresh Values (1 , 1,1,1,1,1)", "") '"?????????????????//??????????????????????????
myconn.tbl.Clear()
End If
If rbtnManager.Checked = True Then
myconn.tbl = myconn.readData("select * from Users where User_Name='" + txtUserName.Text + "' and User_Password='" + txtPassword.Text + "' and Type='مدير'", "")
ElseIf rbtnEmp.Checked = True Then
myconn.tbl = myconn.readData("select * from Users where User_Name='" + txtUserName.Text + "' and User_Password='" + txtPassword.Text + "' and Type='مستخدم عادى'", "")
End If
If myconn.tbl.Rows.Count >= 1 Then
My.Settings.USERNAME = txtUserName.Text
My.Settings.Save()
FrmMain.Show()
Close()
Else
MessageBox.Show("كلمة السر او اسم المستخدم خطا", "تاكيد", MessageBoxButtons.OK, MessageBoxIcon.[Error])
Return
End If
End Sub
PHP كود :
If rbtnManager.Checked = True Then
myconn.tbl = myconn.readData("select * from Table_1 where usernamez='" + txtUserName.Text + "' and passwordz='" + txtPassword.Text + "' and Type='مدير'", "")
ElseIf rbtnEmp.Checked = True Then
myconn.tbl = myconn.readData("select * from Table_1 where usernamez='" + txtUserName.Text + "' and passwordz='" + txtPassword.Text + "' and Type='مستخدم عادى'", "")
End If
ايضا كرما شرح هذي السطرين