예제 #1
0
 public function actionExport()
 {
     $checkids = EnvUtil::getRequest("checkids");
     $bgcheckArr = ResumeBgchecks::model()->fetchAll("FIND_IN_SET(checkid, '{$checkids}')");
     $fieldArr = array(Ibos::lang("Name"), Ibos::lang("Company name"), Ibos::lang("Position"), Ibos::lang("Entry time"), Ibos::lang("Departure time"), Ibos::lang("Details"));
     $str = implode(",", $fieldArr) . "\n";
     foreach ($bgcheckArr as $bgcheck) {
         $realname = ResumeDetail::model()->fetchRealnameByResumeid($bgcheck["resumeid"]);
         $company = $bgcheck["company"];
         $position = $bgcheck["position"];
         $entryTime = empty($bgcheck["entrytime"]) ? "" : date("Y-m-d", $bgcheck["entrytime"]);
         $quitTime = empty($bgcheck["quittime"]) ? "" : date("Y-m-d", $bgcheck["quittime"]);
         $detail = $bgcheck["detail"];
         $str .= $realname . "," . $company . "," . $position . "," . $entryTime . "," . $quitTime . "," . $detail . "\n";
     }
     $outputStr = iconv("utf-8", "gbk//ignore", $str);
     $filename = date("Y-m-d") . mt_rand(100, 999) . ".csv";
     FileUtil::exportCsv($filename, $outputStr);
 }
예제 #2
0
 public function actionDel()
 {
     if (Ibos::app()->request->isAjaxRequest) {
         $resumeids = EnvUtil::getRequest("resumeids");
         if (empty($resumeids)) {
             $this->error(Ibos::lang("Parameters error", "error"), $this->createUrl("resume/index"));
         }
         $pk = "";
         if (strpos($resumeids, ",")) {
             $pk = explode(",", trim($resumeids, ","));
         } else {
             $pk = $resumeids;
         }
         $delSuccess = Resume::model()->deleteByPk($pk);
         if ($delSuccess) {
             ResumeContact::model()->deleteAll("FIND_IN_SET(resumeid,'{$resumeids}') ");
             ResumeInterview::model()->deleteAll("FIND_IN_SET(resumeid,'{$resumeids}') ");
             ResumeBgchecks::model()->deleteAll("FIND_IN_SET(resumeid,'{$resumeids}') ");
             $detail = ResumeDetail::model()->fetchAll("FIND_IN_SET(resumeid,'{$resumeids}') ");
             $avataridArr = ConvertUtil::getSubByKey($detail, "avatarid");
             $attachmentidArr = ConvertUtil::getSubByKey($detail, "attachmentid");
             if (!empty($avataridArr)) {
                 foreach ($avataridArr as $avatarid) {
                     AttachUtil::delAttach($avatarid);
                 }
             }
             if (!empty($attachmentidArr)) {
                 foreach ($attachmentidArr as $attachmentid) {
                     AttachUtil::delAttach($attachmentid);
                 }
             }
             ResumeDetail::model()->deleteAll("FIND_IN_SET(resumeid,'{$resumeids}') ");
             $this->ajaxReturn(array("isSuccess" => 1, "msg" => Ibos::lang("Del succeed", "message")));
         } else {
             $this->ajaxReturn(array("isSuccess" => 0, "msg" => Ibos::lang("Del failed", "message")));
         }
     }
 }