function countCityInfo($schStr, $mode) { $tableName = 'HS_HR_CITY'; $arrFieldList[0] = 'ID'; $arrFieldList[1] = 'NAME'; $sql_builder = new SQLQBuilder(); $sql_builder->table_name = $tableName; $sql_builder->flg_select = 'true'; $sql_builder->arr_select = $arrFieldList; $sqlQString = $sql_builder->countResultset($schStr, $mode); //echo $sqlQString; $dbConnection = new DMLFunctions(); $message2 = $dbConnection->executeQuery($sqlQString); //Calling the addData() function $line = mysql_fetch_array($message2, MYSQL_NUM); return $line[0]; }
function countMembershipInfo($schStr, $mode) { $tableName = 'HS_HR_MEMBERSHIP a LEFT JOIN HS_HR_MEMBERSHIP_TYPE b ON (a.membtype_code = b.membtype_code)'; $arrFieldList[0] = 'a.MEMBSHIP_CODE'; $arrFieldList[1] = 'a.MEMBSHIP_NAME'; $arrFieldList[2] = 'b.MEMBTYPE_NAME'; $sql_builder = new SQLQBuilder(); $sql_builder->table_name = $tableName; $sql_builder->flg_select = 'true'; $sql_builder->arr_select = $arrFieldList; $sqlQString = $sql_builder->countResultset($schStr, $mode); //echo $sqlQString; $dbConnection = new DMLFunctions(); $message2 = $dbConnection->executeQuery($sqlQString); //Calling the addData() function $line = mysql_fetch_array($message2, MYSQL_NUM); return $line[0]; }
function countJobTitles($schStr, $mode) { $tableName = 'HS_HR_JOB_TITLE'; $arrFieldList[0] = 'JOBTIT_CODE'; $arrFieldList[1] = 'JOBTIT_NAME'; $arrFieldList[2] = 'IS_ACTIVE'; $sql_builder = new SQLQBuilder(); $sql_builder->table_name = $tableName; $sql_builder->flg_select = 'true'; $sql_builder->arr_select = $arrFieldList; if (is_array($schStr)) { $schStr[] = 1; // To get only the active job titles } $sqlQString = $sql_builder->countResultset($schStr, $mode); //echo $sqlQString; $dbConnection = new DMLFunctions(); $message2 = $dbConnection->executeQuery($sqlQString); //Calling the addData() function $line = mysql_fetch_array($message2, MYSQL_NUM); return $line[0]; }
function countEducation($schStr, $mode) { $tableName = 'HS_HR_EDUCATION'; $arrFieldList[0] = 'EDU_CODE'; $arrFieldList[1] = 'EDU_DEG'; $arrFieldList[2] = 'EDU_UNI'; $sql_builder = new SQLQBuilder(); $sql_builder->table_name = $tableName; $sql_builder->flg_select = 'true'; $sql_builder->arr_select = $arrFieldList; $sqlQString = $sql_builder->countResultset($schStr, $mode); $dbConnection = new DMLFunctions(); $message2 = $dbConnection->executeQuery($sqlQString); //Calling the addData() function $line = mysql_fetch_array($message2, MYSQL_NUM); return $line[0]; }
/** * To get the number of projects */ public function countprojectID($schStr, $schField) { $tableName = self::PROJECT_DB_TABLE; $arrFieldList[0] = self::PROJECT_DB_FIELD_PROJECT_ID; $arrFieldList[1] = self::PROJECT_DB_FIELD_DELETED; $arrFieldList[2] = self::PROJECT_DB_FIELD_CUSTOMER_ID; $arrFieldList[3] = self::PROJECT_DB_FIELD_NAME; $arrFieldList[4] = self::PROJECT_DB_FIELD_DESCRIPTION; $schField = 1; $schStr = 0; $sql_builder = new SQLQBuilder(); $sql_builder->table_name = $tableName; $sql_builder->flg_select = 'true'; $sql_builder->arr_select = $arrFieldList; $sqlQString = $sql_builder->countResultset($schStr, $schField); //echo $sqlQString; $dbConnection = new DMLFunctions(); $message2 = $dbConnection->executeQuery($sqlQString); //Calling the addData() function $line = mysql_fetch_array($message2, MYSQL_NUM); return $line[0]; }
/** * Count job specs with given search conditions * @param string $schStr Search string * @param string $mode Integer giving which field to search on */ public static function getCount($schStr = '', $mode = -1) { $count = 0; $arrFieldList[0] = self::DB_FIELD_ID; $arrFieldList[1] = self::DB_FIELD_NAME; $arrFieldList[2] = self::DB_FIELD_DESC; $sql_builder = new SQLQBuilder(); $sql_builder->table_name = self::TABLE_NAME; $sql_builder->flg_select = 'true'; $sql_builder->arr_select = $arrFieldList; $sqlQString = $sql_builder->countResultset($schStr, $mode); $dbConnection = new DMLFunctions(); $result = $dbConnection->executeQuery($sqlQString); if ($result) { $line = mysql_fetch_array($result, MYSQL_NUM); $count = $line[0]; } return $count; }
public function countSalaryGrades($schStr, $mode) { $tableName = 'HS_PR_SALARY_GRADE'; $arrFieldList[0] = 'SAL_GRD_CODE'; $arrFieldList[1] = 'SAL_GRD_NAME'; $sql_builder = new SQLQBuilder(); $sql_builder->table_name = $tableName; $sql_builder->flg_select = 'true'; $sql_builder->arr_select = $arrFieldList; $sqlQString = $sql_builder->countResultset($schStr, $mode); $dbConnection = new DMLFunctions(); $message2 = $dbConnection->executeQuery($sqlQString); //Calling the addData() function $line = mysql_fetch_array($message2, MYSQL_NUM); return $line[0]; }
function countUsers($schStr, $mode, $isAdmin) { $arrFieldList[0] = 'id'; $arrFieldList[1] = 'user_name'; $arrFieldList[2] = 'is_admin'; $sql_builder = new SQLQBuilder(); $sql_builder->table_name = $this->tableName; $sql_builder->flg_select = 'true'; $sql_builder->arr_select = $arrFieldList; if ($isAdmin) { $isAdmin = 'Yes'; } else { $isAdmin = 'No'; } $schStr = array($schStr, $isAdmin); $mode = array($mode, 2); $sqlQString = $sql_builder->countResultset($schStr, $mode, true); //echo $sqlQString; $dbConnection = new DMLFunctions(); $message2 = $dbConnection->executeQuery($sqlQString); //Calling the addData() function $line = mysql_fetch_array($message2, MYSQL_NUM); return $line[0]; }