function getAllDpt($DescOrAsc) { $objDbOperation = new DbOperation(); $this->check = 0; $columnsName = "*"; //database column name $tablesName = "`employeedepartment`"; //database table name $conditions = "1 ORDER BY `dptId`" . $DescOrAsc; // conditions, what we want to apply $result = $objDbOperation->dbSelect($columnsName, $tablesName, $conditions); return $result; }
function getSingleEmpDptInfo($cat) { $objDbOperation = new DbOperation(); $this->check = 0; $columnsName = "employeedesignation.desiId,\temployeedepartment.dptName, employeedesignation.desiDesignationName"; //database column name $tablesName = "employeedepartment INNER JOIN employeedesignation ON employeedepartment.dptId = employeedesignation.desiDptId"; //database table name $conditions = "employeedepartment.dptId=" . $cat; // conditions, what we want to apply $result = $objDbOperation->dbSelect($columnsName, $tablesName, $conditions); //var_dump($result); return $result; }
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 dbEmpCoordinetorType($empUserId) { $objDbOperation = new DbOperation(); $this->check = 0; $columnsName = "eEmpType"; //database column name $tablesName = "employeeinfo"; //database table name $conditions = "eId = " . $empUserId; // conditions, what we want to apply $result = $objDbOperation->dbSelect($columnsName, $tablesName, $conditions); //var_dump($result); return $result; }
function getUserCodeName($applicantUserId) { $objDbOperation = new DbOperation(); $this->check = 0; $columnsName = "lEmployeeCodeNumberWhoApply"; //database column name $tablesName = "employeeleaveapplicationdetails"; //database table name $conditions = "lId = " . $applicantUserId; // conditions, what we want to apply $result = $objDbOperation->dbSelect($columnsName, $tablesName, $conditions); //var_dump($result); while ($row = mysqli_fetch_array($result)) { $userCodeNumber = $row['lEmployeeCodeNumberWhoApply']; } return $userCodeNumber; }