<?php require_once '../lib/user.php'; require_once '../lib/dept.php'; require_once '../lib/jobpower.php'; $user = new User(); echo '您上次登录系统时间:' . User::login('陈文辉', '1', 2) . '<br/>'; $Jobpower = new Jobpower(); $Jobpower->showJobpower(); //$dept=new Dept(); //print_r(Dept::showDept()); //Dept::updateDept(array('dept_name' => '总经办','dept_principal'=>'陈文辉'),'dept_name = "总经办"' //Dept::addDept(array('dept_name' => 'eBay销售部','dept_principal'=>'陈小霞')); //print_r(Dept::showDept()); //Dept::deleteDept('dept_id=3'); //print_r(Dept::showDept());
public static function getJobPowerNames($where = '1') { self::initDB(); $sql = 'select power_job.job_name,power_job.job_dept_id,power_job.job_company_id,power_jobpower.jobpower_id from `' . self::$power_job . '` as power_job left join ' . self::$power_jobpower . ' as power_jobpower on power_job.job_id=power_jobpower.jobpower_job_id where ' . $where; //echo $sql; if ($result = self::$dbConn->query($sql)) { $rt = array(); while ($data = self::$dbConn->fetch_assoc($result)) { $rt = array($data['jobpower_id'], $data['job_company_id'], $data['job_name'], $data['job_dept_id']); } return $rt; } self::$errCode = '1406'; self::$errMsg = "Get Job Names error"; return false; }
public static function act_getJobPowerNames($where = ' 1 ') { if (!Auth::checkAccess(__CLASS__, __FUNCTION__)) { self::$errCode = '5414'; self::$errMsg = 'You have no access to get JobPower names'; echo json_encode(array('errCode' => self::$errCode, 'errMsg' => self::$errMsg)); return false; } $data = Jobpower::getJobPowerNames($where); if (!$data) { self::$errCode = '5415'; self::$errMsg = 'No data or get JobPower names error'; echo json_encode(array('errCode' => self::$errCode, 'errMsg' => self::$errMsg)); return false; } return $data; }