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 getAllleaveHistory() { $objDbOperation = new DbOperation(); $this->check = 0; $columnsName = "lLeaveFromDate,lLeaveToDate,lTotalLeaveDays"; //database column name $tablesName = "employeeleaveapplicationdetails"; //database table name $conditions = "WHERE lEmployeeCodeNumberWhoApply = '" . $_SESSION['officeUserName'] . "' AND lIsApproved = 1"; $result = $objDbOperation->dbJoinSingleSelect($columnsName, $tablesName, $conditions); return $result; }
function forNewLeaveDaysRemain($livUserCode, $livUserLeaveType) { $objDbOperation = new DbOperation(); $this->check = 0; $columnsName = "lTotalLeaveDaysRemain"; //database column name $tablesName = "employeeleaveapplicationdetails"; //database table name $conditions = "WHERE lEmployeeCodeNumberWhoApply = '" . $livUserCode . "' AND lLeaveId = " . $livUserLeaveType . " AND lIsApproved = 1 ORDER BY lId DESC LIMIT 1"; // conditions, what we want to apply $result = $objDbOperation->dbJoinSingleSelect($columnsName, $tablesName, $conditions); //var_dump($result); return $result; }
function empLastApplicationInfo($empId) { $objDbOperation = new DbOperation(); $this->check = 0; $columnsName = "emp.eFirstName,emp.eLastName,dpt.dptName,desi.desiDesignationName,ld.lType,eld.lEmployeeCodeNumberWhoApply,eld.lApplyDate,eld.lLeaveId,eld.lEmployeeImargencyAddress,eld.lAlternativeEmployeeCardNumber,eld.lTotalLeaveDays,eld.lLeaveFromDate,eld.lLeaveToDate,\teld.lLeaveReason, emp.ePhoneNumberPersonal, emp.ePhoneNumberOffice"; //database column name $tablesName = "employeeleaveapplicationdetails eld INNER JOIN employeeinfo emp ON eld.lEmployeeCodeNumberWhoApply = emp.eEmployeeCodeNumber INNER JOIN employeedepartment dpt ON dpt.dptId = emp.eDptId INNER JOIN employeedesignation desi ON desi.desiId = emp.eDesignationId INNER JOIN leavedetails ld ON ld.lId = eld.lLeaveId "; //database table name $conditions = " WHERE eld.lId = " . $empId; // conditions, what we want to apply $result = $objDbOperation->dbJoinSingleSelect($columnsName, $tablesName, $conditions); return $result; }