コード例 #1
0
ファイル: ContactController.php プロジェクト: AxelPanda/ibos
 public function actionAdd()
 {
     if (Yii::app()->request->isAjaxRequest) {
         $fullname = EnvUtil::getRequest("fullname");
         $resumeid = ResumeDetail::model()->fetchResumeidByRealname($fullname);
         if (empty($resumeid)) {
             $this->ajaxReturn(array("isSuccess" => false, "msg" => Ibos::lang("This name does not exist resume")));
         }
         $data = ICResumeContact::processAddOrEditData($_POST);
         $data["resumeid"] = $resumeid;
         $contactid = ResumeContact::model()->add($data, true);
         if ($contactid) {
             $contact = ResumeContact::model()->fetchByPk($contactid);
             $contact["inputtime"] = date("Y-m-d", $contact["inputtime"]);
             $contact["input"] = User::model()->fetchRealnameByUid($contact["input"]);
             $contact["fullname"] = $fullname;
             $status = Resume::model()->fetchStatusByResumeid($resumeid);
             if ($status == 4) {
                 Resume::model()->modify($resumeid, array("status" => 1));
             }
             $this->ajaxReturn($contact);
         } else {
             $this->ajaxReturn(array("isSuccess" => false, "msg" => Ibos::lang("Add fail")));
         }
     }
 }
コード例 #2
0
ファイル: ICResumeDetail.php プロジェクト: AxelPanda/ibos
 public static function processShowData($resumeDetail)
 {
     $position = PositionUtil::loadPosition();
     $resumeDetail["targetposition"] = isset($position[$resumeDetail["positionid"]]) ? $position[$resumeDetail["positionid"]]["posname"] : "";
     $resumeDetail["age"] = self::handleAge($resumeDetail["birthday"]);
     $resumeDetail["gender"] = self::handleGender($resumeDetail["gender"]);
     $resumeDetail["workyears"] = self::handleWorkyears($resumeDetail["workyears"]);
     $resumeDetail["education"] = self::handleEdu($resumeDetail["education"]);
     $resumeDetail["maritalstatus"] = self::handleMaritalstatus($resumeDetail["maritalstatus"]);
     $resumeDetail["status"] = Resume::model()->fetchStatusByResumeid($resumeDetail["resumeid"]);
     return $resumeDetail;
 }
コード例 #3
0
 public function getCount()
 {
     static $return = array();
     if (empty($return)) {
         $time = $this->getTimeScope();
         $resumeids = Resume::model()->fetchAllByTime($time["start"], $time["end"]);
         $genders = ResumeDetail::model()->fetchFieldByRerumeids($resumeids, "gender");
         $ac = array_count_values($genders);
         $return["male"] = array("count" => isset($ac["1"]) ? $ac["1"] : 0, "sex" => "男");
         $return["female"] = array("count" => isset($ac["2"]) ? $ac["2"] : 0, "sex" => "女");
     }
     return $return;
 }
コード例 #4
0
 public function getCount()
 {
     static $return = array();
     if (empty($return)) {
         $time = $this->getTimeScope();
         $resumeids = Resume::model()->fetchAllByTime($time["start"], $time["end"]);
         $workyears = ResumeDetail::model()->fetchFieldByRerumeids($resumeids, "workyears");
         $ac = array_count_values($workyears);
         $return["0"] = array("count" => isset($ac["0"]) ? $ac["0"] : 0, "name" => "应届生");
         $return["1"] = array("count" => isset($ac["1"]) ? $ac["1"] : 0, "name" => "一年以上");
         $return["2"] = array("count" => isset($ac["2"]) ? $ac["2"] : 0, "name" => "两年以上");
         $return["3"] = array("count" => isset($ac["3"]) ? $ac["3"] : 0, "name" => "三年以上");
         $return["5"] = array("count" => isset($ac["5"]) ? $ac["5"] : 0, "name" => "五年以上");
         $return["10"] = array("count" => isset($ac["10"]) ? $ac["10"] : 0, "name" => "十年以上");
     }
     return $return;
 }
コード例 #5
0
 public function getCount()
 {
     static $return = array();
     if (empty($return)) {
         $time = $this->getTimeScope();
         $resumeids = Resume::model()->fetchAllByTime($time["start"], $time["end"]);
         $educations = ResumeDetail::model()->fetchFieldByRerumeids($resumeids, "education");
         $ac = array_count_values($educations);
         $return["JUNIOR_HIGH"] = array("count" => isset($ac["JUNIOR_HIGH"]) ? $ac["JUNIOR_HIGH"] : 0, "name" => "初中");
         $return["SENIOR_HIGH"] = array("count" => isset($ac["SENIOR_HIGH"]) ? $ac["SENIOR_HIGH"] : 0, "name" => "高中");
         $return["TECHNICAL_SECONDARY"] = array("count" => isset($ac["TECHNICAL_SECONDARY"]) ? $ac["TECHNICAL_SECONDARY"] : 0, "name" => "中专");
         $return["COLLEGE"] = array("count" => isset($ac["COLLEGE"]) ? $ac["COLLEGE"] : 0, "name" => "大专");
         $return["BACHELOR_DEGREE"] = array("count" => isset($ac["BACHELOR_DEGREE"]) ? $ac["BACHELOR_DEGREE"] : 0, "name" => "本科");
         $return["MASTER"] = array("count" => isset($ac["MASTER"]) ? $ac["MASTER"] : 0, "name" => "硕士");
         $return["DOCTOR"] = array("count" => isset($ac["DOCTOR"]) ? $ac["DOCTOR"] : 0, "name" => "博士");
     }
     return $return;
 }
コード例 #6
0
ファイル: RecruitApi.php プロジェクト: AxelPanda/ibos
 private function loadRecruit($type = "TalentManagement", $num = 4)
 {
     $uid = Yii::app()->user->uid;
     switch ($type) {
         case "TalentManagement":
             $status = 4;
             break;
         case "InterviewManagement":
             $status = 1;
             break;
         default:
             return false;
     }
     $criteria = array("select" => "resumeid,input,suitableposition,uptime,status", "condition" => "`status`={$status}", "order" => "`uptime` DESC", "offset" => 0, "limit" => $num);
     $resume = Resume::model()->findAll($criteria);
     var_dump($resume);
     exit;
 }
コード例 #7
0
 public function getCount()
 {
     static $return = array();
     if (empty($return)) {
         $time = $this->getTimeScope();
         $resumeids = Resume::model()->fetchAllByTime($time["start"], $time["end"]);
         $birthdays = ResumeDetail::model()->fetchFieldByRerumeids($resumeids, "birthday");
         $age23 = $age24 = $age27 = $age31 = $age41 = 0;
         foreach ($birthdays as $birthday) {
             $age = ICResumeDetail::handleAge($birthday);
             if ($age <= 23) {
                 $age23++;
             } else {
                 if (24 <= $age && $age <= 26) {
                     $age24++;
                 } else {
                     if (27 <= $age && $age <= 30) {
                         $age27++;
                     } else {
                         if (31 <= $age && $age <= 40) {
                             $age31++;
                         } elseif (41 <= $age) {
                             $age41++;
                         }
                     }
                 }
             }
         }
         $return["age23"] = array("count" => $age23, "name" => "23岁以下");
         $return["age24"] = array("count" => $age24, "name" => "24-26岁");
         $return["age27"] = array("count" => $age27, "name" => "27-30岁");
         $return["age31"] = array("count" => $age31, "name" => "31-40岁");
         $return["age41"] = array("count" => $age41, "name" => "41岁以上");
     }
     return $return;
 }
コード例 #8
0
 protected function renderOverview($time)
 {
     $data = array("new" => Resume::model()->countByStatus(array(1, 2, 3, 4, 5), $time["start"], $time["end"]), "pending" => Resume::model()->countByStatus(4, $time["start"], $time["end"]), "interview" => Resume::model()->countByStatus(1, $time["start"], $time["end"]), "employ" => Resume::model()->countByStatus(array(2, 3), $time["start"], $time["end"]), "eliminate" => Resume::model()->countByStatus(5, $time["start"], $time["end"]));
     $this->render(self::VIEW, $data);
 }
コード例 #9
0
ファイル: ResumeController.php プロジェクト: AxelPanda/ibos
 private function status()
 {
     if (Ibos::app()->request->isAjaxRequest) {
         $resumeid = EnvUtil::getRequest("resumeid");
         $status = EnvUtil::getRequest("status");
         Resume::model()->updateAll(array("status" => $status, "uptime" => TIMESTAMP, "statustime" => strtotime(date("Y-m-d"))), "FIND_IN_SET(resumeid,'{$resumeid}')");
         $showStatus = ICResumeDetail::handleResumeStatus($status);
         $this->ajaxReturn(array("showStatus" => $showStatus, "isSuccess" => 1, "msg" => Ibos::lang("Operation succeed", "message")));
     }
 }
コード例 #10
0
<?php

defined("ONE_DATE_TIME") || define("ONE_DATE_TIME", 86400);
$todayTime = strtotime(date("Y-m-d"));
$stats = ResumeStats::model()->fetch(array("select" => "datetime", "order" => "datetime DESC"));
if (ONE_DATE_TIME <= $todayTime - $stats["datetime"]) {
    for ($i = $stats["datetime"] + ONE_DATE_TIME; $i < $todayTime; $i += ONE_DATE_TIME) {
        $newCount = Resume::model()->count(sprintf("`entrytime` BETWEEN %d AND %d", $i, $i + ONE_DATE_TIME));
        $resumes = Resume::model()->fetchAll(array("select" => "status", "condition" => sprintf("`statustime` = %d", $i)));
        $status = ConvertUtil::getSubByKey($resumes, "status");
        $ac = array_count_values($status);
        $data = array("new" => $newCount, "pending" => isset($ac["4"]) ? $ac["4"] : 0, "interview" => isset($ac["1"]) ? $ac["1"] : 0, "employ" => isset($ac["2"]) ? $ac["2"] : 0, "eliminate" => isset($ac["5"]) ? $ac["5"] : 0, "datetime" => $i);
        ResumeStats::model()->add($data);
    }
}
コード例 #11
0
ファイル: UserController.php プロジェクト: erick305/testing
 public function actionStudentRegister()
 {
     $model = new User();
     // uncomment the following code to enable ajax-based validation
     /*
      if(isset($_POST['ajax']) && $_POST['ajax']==='user-StudentRegister-form')
      {
     echo CActiveForm::validate($model);
     Yii::app()->end();
     }
     */
     if (isset($_POST['User'])) {
         $user = $_POST['User'];
         $email = $user['email'];
         $pathStudent = $this->actionVerifyStudentRegistration();
         if ($pathStudent == 1) {
             $this->actionStudentHelpReg($email);
             return;
         }
         if ($pathStudent != "" && $pathStudent != 1) {
             $this->render('StudentRegister');
         }
         $model->attributes = $_POST['User'];
         $model->image_url = '/JobFair/images/profileimages/user-default.png';
         $resume = Resume::model();
         //Form inputs are valid
         // save ID to resume table
         $resume->id = $model->id;
         $resume->save(false);
         //Populate user attributes
         $model->FK_usertype = 1;
         $model->registration_date = new CDbExpression('NOW()');
         $model->activation_string = $this->genRandomString(10);
         //Hash the password before storing it into the database
         $hasher = new PasswordHash(8, false);
         $model->password = $hasher->HashPassword($model->password);
         //Save user into database. Account still needs to be activated
         $model->save($runValidation = false);
         //added in order to store phone number
         $basicInfo = new BasicInfo();
         $basicInfo->attributes = $_POST['BasicInfo'];
         $basicInfo->userid = $model->id;
         if (!isset($_POST['BasicInfo']['phone'])) {
             Yii::log("checks", CLogger::LEVEL_ERROR, 'application.controller.Prof');
             $basicInfo->phone = NULL;
         }
         $basicInfo->save(false);
         $this->actionSendVerificationEmail($model->email);
         return;
     }
     $error = '';
     $this->render('StudentRegister', array('model' => $model, 'error' => $error));
 }
コード例 #12
0
 public function actionUploadResume()
 {
     $username = Yii::app()->user->name;
     $model = User::model()->find("username=:username", array(':username' => $username));
     $localresume = Resume::model()->findByAttributes(array('id' => $model->id));
     if (isset($localresume)) {
         $oldUrl = $localresume->resume;
     }
     if (isset($oldUrl)) {
         $uploadedFile = CUploadedFile::getInstance($localresume, 'resume');
         $localresume->resume = $oldUrl;
         if ($localresume->validate(array('resume'))) {
             $localresume->save(false);
             // save path in database
             if (isset($uploadedFile)) {
                 $uploadedFile->saveAs(Yii::app()->basePath . '/../..' . $oldUrl);
             }
         }
         // else insert new image
     } else {
         $localresume = new Resume();
         // code to upload image
         $rnd = $model->id;
         $uploadedFile = CUploadedFile::getInstance($localresume, 'resume');
         // image object
         $fileName = "{$rnd}-{$uploadedFile}";
         // random number + file name
         $localresume->resume = '/JobFair/resumes/' . $fileName;
         $localresume->id = $model->id;
         if ($localresume->validate(array('resume'))) {
             $localresume->save(false);
             // save path in database
             if (isset($uploadedFile)) {
                 $uploadedFile->saveAs(Yii::app()->basePath . '/../resumes/' . $fileName);
                 // upload image to server
             }
         }
     }
     $this->actionView();
 }