예제 #1
0
파일: excel_add.php 프로젝트: winiceo/job
for ($j = 65; $j > 32; $j--) {
    //列循环 65为A对应ASCII码 32是根据excel表列数,根据第一列是A[65]计算而得
    $selcolumn = ord('A') - $j;
    //列数
    $value = Leven::utf8_gbk(trim($currentSheet->getCellByColumnAndRow($selcolumn, 1)->getValue()));
    if ($value) {
        $colinfo = \ORM::for_table(table('relation_title'))->where_equal("name", $value)->find_one()->as_array();
        if ($colinfo) {
            $cols[$selcolumn] = $colinfo;
        }
    }
}
for ($currentRow = 2; $currentRow <= $allRow; $currentRow++) {
    //行循环 && $allRow 行数
    $obj = \ORM::for_table(table('resume_temp'))->create();
    for ($j = 65; $j > 32; $j--) {
        //列循环 65为A对应ASCII码 32是根据excel表列数,根据第一列是A[65]计算而得
        $selcolumn = ord('A') - $j;
        //列数
        $col = $cols[$selcolumn]["value"];
        // dump($col);
        $regfunc = $cols[$selcolumn]["regfunc"] == "" ? "trim" : $cols[$selcolumn]["regfunc"];
        if ($col) {
            $colvalue = Leven::utf8_gbk($currentSheet->getCellByColumnAndRow($selcolumn, $currentRow)->getValue());
            $obj[$col] = call_user_func_array(array("Leven", $regfunc), array($colvalue));
            dump($obj[$col]);
        }
    }
    $obj->save();
}
exit;
예제 #2
0
파일: test.php 프로젝트: winiceo/job
<?php

/**
 * Created by PhpStorm.
 * User: leven
 * Date: 16/1/13
 * Time: ионГ10:18
 */
define('IN_QISHI', true);
$alias = "QS_leven_list";
require_once dirname(__FILE__) . '/../include/common.inc.php';
require_once 'Classes/PHPExcel.php';
require_once 'Classes/PHPExcel/IOFactory.php';
require_once 'Classes/PHPExcel/Reader/Excel5.php';
require_once "lib.php";
$str = "23╧гм╥";
dump(strtotime("1999-12"));
echo Leven::old_year($str);
예제 #3
0
파일: leven.php 프로젝트: winiceo/job
function createResume($obj)
{
    unset($obj["id"]);
    if (!$obj["title"]) {
        $obj["title"] = $obj["fullname"] . "的简历";
    }
    //dump($obj);
    $obj["sex"] = $obj["sex_cn"] == "男" ? 1 : 2;
    $nature = getId($obj["nature_cn"], "QS_jobs_nature");
    if ($nature) {
        $obj["nature"] = $nature["c_id"];
    } else {
        $obj["nature"] = 62;
        $obj["nature_cn"] = "全职";
    }
    $obj["trade_cn"] = "其他行业";
    $obj["trade"] = 45;
    $obj["height"] = 0;
    $obj["height"] = 0;
    $obj['marriage'] = 0;
    $obj['marriage_cn'] = "未婚";
    $experience_cn = get_reg($obj["experience_cn"]);
    if ($experience_cn) {
        $obj['experience_cn'] = $experience_cn;
        $obj['experience'] = getId($experience_cn, "QS_experience")["c_id"];
    } else {
        $obj['experience_cn'] = "无经验";
        $obj['experience'] = 74;
    }
    $wage_cn = get_reg($obj["wage_cn"]);
    if ($wage_cn) {
        $obj['wage_cn'] = $wage_cn;
        $obj['wage'] = getId($wage_cn, "QS_wage")["c_id"];
    } else {
        $obj['wage_cn'] = "面议";
        $obj['wage'] = 294;
    }
    $education_cn = get_reg($obj["education_cn"]);
    if ($education_cn) {
        $obj['education_cn'] = $education_cn;
        $obj['education'] = getId($education_cn, "QS_education")["c_id"];
    } else {
        $obj['education_cn'] = "初中";
        $obj['education'] = 65;
    }
    $major_cn = get_reg($obj["major_cn"]);
    if ($major_cn) {
        $obj['major_cn'] = $major_cn;
        $obj['major'] = getId($major_cn, "QS_major")["c_id"];
    } else {
        $obj['major_cn'] = "其他专业";
        $obj['major'] = 290;
    }
    $obj['tag_cn'] = "";
    $obj['tag'] = "";
    $obj['specialty'] = "";
    $obj['photo_img'] = "";
    $obj['addtime'] = time();
    $obj['refreshtime'] = time();
    $obj['level'] = 1;
    $obj["current_cn"] = "观望有好的机会再考虑";
    $obj["current"] = 243;
    $obj["word_resume"] = "";
    $obj["key"] = "";
    $obj["tpl"] = "";
    $obj["status"] = 0;
    //  dump($obj);
    //exit;
    $new = \ORM::for_table(table('resume'))->create($obj);
    $a = $new->save();
    $searchtab['id'] = $new->id;
    $searchtab['uid'] = $obj['uid'];
    $db = Leven::db();
    require_once ROOT . 'include/fun_personal.php';
    $db->inserttable(table('resume_search_key'), $searchtab);
    $db->inserttable(table('resume_search_rtime'), $searchtab);
    check_resume($obj["uid"], $new->id);
    //      dump($a);
}