function dbUserInfoUpdate($officeUserCode, $userPersonalPhoneNumber, $userPresentAddress, $userPassword) { $objDbOperation = new DbOperation(); $this->check = 0; $columnsName = "ePhoneNumberPersonal = " . $userPersonalPhoneNumber . ", ePresentAddress = '" . $userPresentAddress . "', ePassword = '******'"; //database column name $tablesName = "employeeinfo"; //database table name $conditions = "eEmployeeCodeNumber = '" . $officeUserCode . "'"; // conditions, what we want to apply $result = $objDbOperation->dbUpdate($columnsName, $tablesName, $conditions); //var_dump($result); if ($result) { $this->CreatedOrNot = 1; $this->check = 1; } //This if statement will execute For not creation Employee if ($this->check == 0) { $this->CreatedOrNot = 0; } }
function dbUserQuery($officeUserName, $officeUserPass) { $objDbOperation = new DbOperation(); $this->check = 0; //$this means current object, here current class object is Login class object $columnsName = "*"; //database column name $tablesName = "`employeeinfo`"; //database table name $conditions = "`eEmployeeCodeNumber`='" . $officeUserName . "' and `ePassword`='" . $officeUserPass . "' and `eEmployeeVerification` = 1"; // conditions, what we want to apply $result = $objDbOperation->dbSelect($columnsName, $tablesName, $conditions); //var_dump($result); if ($row = mysqli_fetch_array($result)) { $_SESSION['empType'] = $row['eEmpType']; $objDbOperation = new DbOperation(); $this->check = 0; //$this means current object, here current class object is Login class object $tablesName = "`employeeinfo`"; //database table name $columnsName = "eLastLogin = NOW()"; //database column name $conditions = "`eEmployeeCodeNumber`='" . $officeUserName . "'"; // conditions, what we want to apply $result = $objDbOperation->dbUpdate($columnsName, $tablesName, $conditions); $this->officeUserIsFound = 1; $_SESSION['officeUserName'] = $row['eEmployeeCodeNumber']; $_SESSION['officeUserPass'] = $row['ePassword']; $_SESSION['isLogin'] = 1; $this->check = 1; } //This if statement will execute For invalid officeUserName or officeUserPass if ($this->check == 0) { $this->officeUserIsFound = 0; } }
function dbEmpTypeUpdate($empWhoVerifytheEmployee, $empUserId, $empType) { $objDbOperation = new DbOperation(); $this->check = 0; $columnsName = "eEmpType = " . $empType . ", eWhoVerifytheEmployee = '" . $empWhoVerifytheEmployee . "'"; //database column name $tablesName = "employeeinfo"; //database table name $conditions = "eId = " . $empUserId; // conditions, what we want to apply $result = $objDbOperation->dbUpdate($columnsName, $tablesName, $conditions); //var_dump($result); if ($result) { $this->CreatedOrNot = 1; $this->check = 1; } //This if statement will execute For not creation Employee if ($this->check == 0) { $this->CreatedOrNot = 0; } }
function updateOnesApplicattion($livUserId, $livUserLeaveFrom, $livUserLeaveTo, $livUserLeaveType, $lTotalLeaveDays, $lTotalLeaveDaysRemain, $livApplicationUpdateBy) { $objDbOperation = new DbOperation(); $this->check = 0; $columnsName = "lLeaveFromDate = '" . $livUserLeaveFrom . "', lLeaveToDate = '" . $livUserLeaveTo . "',lLeaveId = '" . $livUserLeaveType . "', lTotalLeaveDays = '" . $lTotalLeaveDays . "', lTotalLeaveDaysRemain = '" . $lTotalLeaveDaysRemain . "', lWhoEdit = '" . $livApplicationUpdateBy . "'"; //database column name $tablesName = "employeeleaveapplicationdetails"; //database table name $conditions = "lId = " . $livUserId; // conditions, what we want to apply $result = $objDbOperation->dbUpdate($columnsName, $tablesName, $conditions); //var_dump($result); if ($result) { $this->CreatedOrNot = 1; $this->check = 1; } if ($this->check == 0) { $this->CreatedOrNot = 0; } }