当前位置: 首页>>代码示例>>PHP>>正文


PHP daterange函数代码示例

本文整理汇总了PHP中daterange函数的典型用法代码示例。如果您正苦于以下问题:PHP daterange函数的具体用法?PHP daterange怎么用?PHP daterange使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了daterange函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: tpl_function_qishi_curriculum_show

function tpl_function_qishi_curriculum_show($params, &$smarty)
{
    global $db, $timestamp, $_CFG;
    $arr = explode(',', $params['set']);
    foreach ($arr as $str) {
        $a = explode(':', $str);
        switch ($a[0]) {
            case "¿Î³ÌID":
                $aset['id'] = $a[1];
                break;
            case "ÁбíÃû":
                $aset['listname'] = $a[1];
                break;
            case "ÃèÊö³¤¶È":
                $aset['brieflylen'] = $a[1];
                break;
            case "Ìî²¹×Ö·û":
                $aset['dot'] = $a[1];
                break;
        }
    }
    $aset = array_map("get_smarty_request", $aset);
    $aset['id'] = $aset['id'] ? intval($aset['id']) : 0;
    $aset['brieflylen'] = isset($aset['brieflylen']) ? intval($aset['brieflylen']) : 0;
    $aset['listname'] = $aset['listname'] ? $aset['listname'] : "list";
    $wheresql = " WHERE id={$aset['id']} ";
    $sql = "select id,subsite_id,uid,setmeal_deadline,add_mode,train_id,contents,refreshtime,teacher_id,teacher_cn,trainname,course_name,addtime,click,favour_expenses,train_expenses,classhour,category_cn,starttime,classtype_cn,district_cn,train_object,train_certificate from " . table('course') . $wheresql . " LIMIT 1";
    $val = $db->getone($sql);
    if (empty($val)) {
        header("HTTP/1.1 404 Not Found");
        $smarty->display("404.htm");
        exit;
    } else {
        check_url($val['subsite_id'], $smarty, $_CFG['train_url']);
        if ($val['setmeal_deadline'] < time() && $val['setmeal_deadline'] != "0" && $val['add_mode'] == "2") {
            $val['deadline'] = $val['setmeal_deadline'];
        }
        $val['course_url'] = url_rewrite('QS_courseshow', array('id' => $val['id']), 1, $val['subsite_id']);
        $profile = GetTainProfile($val['train_id']);
        $val['train'] = $profile;
        $val['expire'] = sub_day($val['deadline'], time());
        $val['countapply'] = $db->get_total("SELECT COUNT(*) AS num FROM " . table('personal_course_apply') . " WHERE course_id= '{$val['id']}'");
        if ($aset['brieflylen'] > 0) {
            $val['briefly'] = cut_str(strip_tags($val['contents']), $aset['brieflylen'], 0, $aset['dot']);
        } else {
            $val['briefly'] = strip_tags($val['contents']);
        }
        $val['refreshtime_cn'] = daterange(time(), $val['refreshtime'], 'Y-m-d', "#FF3300");
        $val['train_url'] = url_rewrite('QS_train_agencyshow', array('id' => $val['train_id']));
        $val['teacher_url'] = url_rewrite('QS_train_lecturershow', array('id' => $val['teacher_id']));
        if ($val['train']['logo']) {
            $val['train']['logo'] = $_CFG['site_dir'] . "data/train_logo/" . $val['train']['logo'];
        } else {
            $val['train']['logo'] = $_CFG['site_dir'] . "data/train_logo/no_logo.gif";
        }
    }
    $smarty->assign($aset['listname'], $val);
}
开发者ID:winiceo,项目名称:fenzhan,代码行数:58,代码来源:function.qishi_curriculum_show.php

示例2: tpl_function_qishi_train_lecturer_show

function tpl_function_qishi_train_lecturer_show($params, &$smarty)
{
    global $db, $timestamp, $_CFG;
    $arr = explode(',', $params['set']);
    foreach ($arr as $str) {
        $a = explode(':', $str);
        switch ($a[0]) {
            case "½²Ê¦ID":
                $aset['id'] = $a[1];
                break;
            case "ÁбíÃû":
                $aset['listname'] = $a[1];
                break;
            case "ÃèÊö³¤¶È":
                $aset['brieflylen'] = $a[1];
                break;
            case "Ìî²¹×Ö·û":
                $aset['dot'] = $a[1];
                break;
        }
    }
    $aset = array_map("get_smarty_request", $aset);
    $aset['id'] = $aset['id'] ? intval($aset['id']) : 0;
    $aset['brieflylen'] = isset($aset['brieflylen']) ? intval($aset['brieflylen']) : 0;
    $aset['listname'] = $aset['listname'] ? $aset['listname'] : "list";
    $wheresql = " WHERE id={$aset['id']} ";
    $sql = "select id,train_id,contents,birthdate,refreshtime,photo,photo_img,teachername,education_cn,graduated_school,speciality,work_unit,positionaltitles,district_cn,achievements from " . table('train_teachers') . $wheresql . " LIMIT 1";
    $val = $db->getone($sql);
    if (empty($val)) {
        header("HTTP/1.1 404 Not Found");
        $smarty->display("404.htm");
        exit;
    } else {
        $profile = GetTainProfile($val['train_id']);
        $val['train'] = $profile;
        if ($aset['brieflylen'] > 0) {
            $val['briefly'] = cut_str(strip_tags($val['contents']), $aset['brieflylen'], 0, $aset['dot']);
        } else {
            $val['briefly'] = strip_tags($val['contents']);
        }
        $val['age'] = date('Y') + 1 - $val['birthdate'];
        $val['refreshtime_cn'] = daterange(time(), $val['refreshtime'], 'Y-m-d', "#FF3300");
        $val['train_url'] = url_rewrite('QS_train_agencyshow', array('id' => $val['train_id']));
        $val['teacher_url'] = url_rewrite('QS_train_lecturer', array('id' => $val['id']));
        if ($val['photo'] == "1") {
            $val['photosrc'] = $_CFG['teacher_photo_dir'] . $val['photo_img'];
        } else {
            $val['photosrc'] = $_CFG['teacher_photo_dir'] . "no_photo.gif";
        }
    }
    $smarty->assign($aset['listname'], $val);
}
开发者ID:winiceo,项目名称:job,代码行数:52,代码来源:function.qishi_train_lecturer_show.php

示例3: tpl_function_qishi_resume_show


//.........这里部分代码省略.........
                }
            } else {
                $val['fullname_'] = $val['fullname'];
                $val['fullname'] = $val['fullname'];
            }
        }
        $val['education_list'] = get_this_education($val['uid'], $val['id']);
        $val['work_list'] = get_this_work($val['uid'], $val['id']);
        $val['training_list'] = get_this_training($val['uid'], $val['id']);
        $val['language_list'] = get_this_language($val['uid'], $val['id']);
        $val['credent_list'] = get_this_credent($val['uid'], $val['id']);
        $val['img_list'] = get_this_img($val['uid'], $val['id']);
        $val['age'] = date("Y") - $val['birthdate'];
        if ($val['photo'] == "1") {
            $download = $db->getone("select did from " . table("company_down_resume") . " where resume_id={$val['id']} and company_uid=" . intval($_SESSION['uid']) . " ");
            if (empty($download)) {
                if ($val['photo_display'] == "1") {
                    $val['photosrc'] = $_CFG['resume_photo_dir'] . $val['photo_img'];
                } else {
                    $val['photosrc'] = $_CFG['resume_photo_dir_thumb'] . "no_photo_display.gif";
                }
            } else {
                $val['photosrc'] = $_CFG['resume_photo_dir'] . $val['photo_img'];
            }
        } else {
            $val['photosrc'] = $_CFG['resume_photo_dir_thumb'] . "no_photo.gif";
        }
        if ($val['tag_cn']) {
            $tag_cn = explode(',', $val['tag_cn']);
            $val['tag_cn'] = $tag_cn;
        } else {
            $val['tag_cn'] = array();
        }
        $apply = $db->getone("select * from " . table('personal_jobs_apply') . " where `resume_id`=" . $val['id']);
        $val['jobs_name'] = $apply['jobs_name'];
        $val['apply_addtime'] = $apply['apply_addtime'];
        $val['jobs_url'] = url_rewrite('QS_jobsshow', array('id' => $apply['jobs_id']));
        if ($val['jobs_name']) {
            $val['apply'] = 1;
        } else {
            $val['apply'] = 0;
        }
        /* 简历活跃度  更新时间 主动申请职位数  浏览职位数 */
        $vitality = 0;
        $val['refreshtime_cn'] = daterange(time(), $val['refreshtime'], 'Y-m-d', "#FF3300");
        $timestr = time() - $val['refreshtime'];
        $day = intval($timestr / 86400);
        if ($day < 3) {
            $vitality += 2;
        } else {
            $vitality += 1;
        }
        $time = time() - 15 * 86400;
        $val['apply_jobs'] = $db->get_total("select count(*) num from " . table("personal_jobs_apply") . " where resume_id={$val['id']} and apply_addtime>{$time} and is_apply=1 ");
        if ($val['apply_jobs'] > 0 && $val['apply_jobs'] < 10) {
            $vitality += 1;
        } elseif ($val['apply_jobs'] >= 10) {
            $vitality += 2;
        }
        $val['view_jobs'] = $db->get_total("select count(*) num from " . table("view_jobs") . " where uid={$val['uid']} and addtime>{$time} ");
        if ($val['view_jobs'] >= 10) {
            $vitality += 1;
        }
        $val['vitality'] = $vitality;
        /*企业关注度 start */
        $attention = 0;
        $val['com_down'] = $db->get_total("select count(*) num from " . table("company_down_resume") . " where resume_id={$val['id']} and down_addtime>{$time} ");
        if ($val['com_down'] >= 0 && $val['com_down'] < 10) {
            $attention += 1;
        } elseif ($val['com_down'] >= 10) {
            $attention += 2;
        }
        $val['com_invite'] = $db->get_total("select count(*) num from " . table("company_interview") . " where resume_id={$val['id']} and interview_addtime>{$time} ");
        if ($val['com_invite'] > 0 && $val['com_invite'] < 10) {
            $attention += 1;
        } elseif ($val['com_invite'] >= 10) {
            $attention += 2;
        }
        $val['com_view'] = $db->get_total("select count(*) num from " . table("view_resume") . " where resumeid={$val['id']} and addtime>{$time} ");
        if ($val['com_view'] >= 10) {
            $attention += 1;
        }
        $val['attention'] = $attention;
        /*企业关注度 end */
        //判断手机、微信、邮箱是否验证
        $is_audit_phone = $db->getone("SELECT mobile_audit,email_audit,weixin_openid FROM " . table('members') . " WHERE uid={$val['uid']}  LIMIT 1 ");
        $val['is_audit_mobile'] = $is_audit_phone['mobile_audit'];
        $val['is_audit_email'] = $is_audit_phone['email_audit'];
        $val['is_audit_weixin'] = $is_audit_phone['weixin_openid'];
        //个人自己预览
        if ($_SESSION['utype'] == '2' && $_SESSION['uid'] == $val['uid']) {
            $val['isminesee'] = '1';
        }
    } else {
        header("HTTP/1.1 404 Not Found");
        $smarty->display("404.htm");
        exit;
    }
    $smarty->assign($aset['listname'], $val);
}
开发者ID:winiceo,项目名称:job,代码行数:101,代码来源:function.qishi_resume_show.php

示例4: tpl_function_qishi_companyjobs_list


//.........这里部分代码省略.........
        $wheresql .= " AND recommend=" . intval($aset['recommend']);
    }
    if (isset($aset['emergency'])) {
        $wheresql .= " AND emergency=" . intval($aset['emergency']);
    }
    if (isset($aset['settr']) && $aset['settr'] != '') {
        $settr = intval($aset['settr']);
        if ($settr > 0) {
            $settr_val = intval(strtotime("-" . $aset['settr'] . " day"));
            $wheresql .= " AND refreshtime>" . $settr_val;
        }
    }
    if (isset($aset['trade'])) {
        $wheresql .= " AND trade=" . intval($aset['trade']);
    }
    if (isset($aset['district']) && $aset['district'] != '') {
        if (strpos($aset['district'], "-")) {
            $or = $orsql = "";
            $arr = explode("-", $aset['district']);
            foreach ($arr as $sid) {
                $orsql .= $or . " district=" . intval($sid);
                $or = " OR ";
            }
            $wheresql .= " AND  (" . $orsql . ") ";
        } else {
            $wheresql .= " AND district=" . intval($aset['district']) . " ";
        }
    }
    //楼层 职位
    if (isset($aset['jobscategory']) && $aset['jobscategory'] != '') {
        $jobscategory = trim($aset['jobscategory']);
        $jobscategory = str_replace("_", ",", $jobscategory);
        $wheresql .= " AND category in (" . $jobscategory . ") ";
    }
    $limit = " LIMIT {$aset['start']},{$aset['row']}";
    if (!empty($wheresql)) {
        $wheresql = " WHERE " . ltrim(ltrim($wheresql), 'AND');
    }
    $uidlimit = " LIMIT {$aset['start']}," . $aset['row'] * 15;
    $sql1 = "SELECT id,uid FROM " . $jobstable . $wheresql . $orderbysql . $uidlimit;
    //echo $sql1;
    $result1 = $db->query($sql1);
    $uidarr = array();
    while ($row = $db->fetch_array($result1)) {
        if (count($uidarr) >= $aset['row']) {
            break;
        }
        $uidarr[$row['uid']] = $row['uid'];
    }
    if (!empty($uidarr)) {
        $uidarr = implode(",", $uidarr);
        $wheresql = $wheresql ? $wheresql . " AND uid IN ({$uidarr}) " : " WHERE uid IN ({$uidarr}) ";
        $sql2 = "SELECT subsite_id,company_id,companyname,nature_cn,wage_cn,amount,sex_cn,district_cn,education_cn,experience_cn,contents,company_addtime,refreshtime,id,jobs_name,addtime,uid,click,highlight,highlight,setmeal_id,setmeal_name FROM " . table('jobs') . $wheresql . $orderbysql;
        //echo $sql2;
        $result2 = $db->query($sql2);
        $countuid = array();
        while ($row = $db->fetch_array($result2)) {
            $countuid[$row['uid']][] = $row['uid'];
            if (count($countuid[$row['uid']]) > $aset['jobsrow']) {
                continue;
            }
            $companyarray[$row['uid']]['companyname_'] = $row['companyname'];
            $companyarray[$row['uid']]['companyname'] = cut_str($row['companyname'], $aset['companynamelen'], 0, $aset['dot']);
            $companyarray[$row['uid']]['company_url'] = url_rewrite($aset['companyshow'], array('id' => $row['company_id']));
            $companyarray[$row['uid']]['company_addtime'] = $row['company_addtime'];
            $companyarray[$row['uid']]['company_id'] = $row['company_id'];
            $companyarray[$row['uid']]['nature_cn'] = $row['nature_cn'];
            $companyarray[$row['uid']]['wage_cn'] = $row['wage_cn'];
            $companyarray[$row['uid']]['sex_cn'] = $row['sex_cn'];
            $companyarray[$row['uid']]['amount'] = $row['amount'];
            $companyarray[$row['uid']]['district_cn'] = $row['district_cn'];
            $companyarray[$row['uid']]['education_cn'] = $row['education_cn'];
            $companyarray[$row['uid']]['experience_cn'] = $row['experience_cn'];
            $companyarray[$row['uid']]['briefly'] = strip_tags($row['contents']);
            $companyarray[$row['uid']]['refreshtime'] = $companyarray[$row['uid']]['refreshtime'] > $row['refreshtime'] ? $companyarray[$row['uid']]['refreshtime'] : $row['refreshtime'];
            $companyarray[$row['uid']]['refreshtime_cn'] = daterange(time(), $companyarray[$row['uid']]['refreshtime'], 'm-d', "#FF3300");
            $companyarray[$row['uid']]['setmeal_id'] = $row['setmeal_id'];
            $companyarray[$row['uid']]['setmeal_name'] = $row['setmeal_name'];
            $companyarray[$row['uid']]['uid'] = $row['uid'];
            $companyarray[$row['uid']]['jobs'][$row['id']]['jobs_addtime'] = $row['addtime'];
            $companyarray[$row['uid']]['jobs'][$row['id']]['jobs_refreshtime'] = $row['refreshtime'];
            $companyarray[$row['uid']]['jobs'][$row['id']]['jobs_click'] = $row['click'];
            $companyarray[$row['uid']]['jobs'][$row['id']]['jobs_name'] = cut_str($row['jobs_name'], $aset['jobslen'], 0, $aset['dot']);
            if (!empty($row['highlight'])) {
                $companyarray[$row['uid']]['jobs'][$row['id']]['jobs_name'] = "<span style=\"color:{$row['highlight']}\">{$companyarray[$row['uid']]['jobs'][$row['id']]['jobs_name']}</span>";
            }
            $companyarray[$row['uid']]['jobs'][$row['id']]['jobs_url'] = url_rewrite($aset['jobsshow'], array('id' => $row['id']), 1, $row['subsite_id']);
            $companyarray[$row['uid']]['jobs'][$row['id']]['id'] = $row['id'];
            if (intval($aset['countjobs']) == 1) {
                if (intval($_CFG['subsite_id']) > 0) {
                    $count_wheresql = ' and subsite_id=' . intval($_CFG['subsite_id']) . ' ';
                } else {
                    $count_wheresql = '';
                }
                $companyarray[$row['uid']]['jobs_num'] = $db->get_total("SELECT count(*) as num from " . table("jobs") . " where uid={$row['uid']} " . $count_wheresql);
            }
        }
    }
    $smarty->assign($aset['listname'], $companyarray);
}
开发者ID:winiceo,项目名称:fenzhan,代码行数:101,代码来源:function.qishi_companyjobs_list.php

示例5: interest_jobs

function interest_jobs($topclass, $category, $subclass, $id)
{
    global $db;
    $wheresql = " WHERE id !=" . intval($id);
    if (intval($subclass) != 0) {
        $wheresql .= " and subclass =" . $subclass;
    } elseif (intval($category) != 0) {
        $wheresql .= " and  category =" . $category;
    } elseif (intval($topclass) != 0) {
        $wheresql .= " and  topclass =" . $topclass;
    }
    $list = array();
    $orderbysql = " ORDER BY  refreshtime  desc ";
    $limit = " LIMIT 5 ";
    $result = $db->query("SELECT id,subsite_id,jobs_name,companyname,wage_cn,district_cn,refreshtime FROM " . table('jobs') . $wheresql . $orderbysql . $limit);
    while ($row = $db->fetch_array($result)) {
        //刷新时间
        $row['refreshtime_cn'] = daterange(time(), $row['refreshtime'], 'Y-m-d', "#FF3300");
        $row['url'] = wap_url_rewrite("jobs-show", array("id" => $row['id']), 1, $row['subsite_id']);
        $list[] = $row;
    }
    return $list;
}
开发者ID:winiceo,项目名称:fenzhan,代码行数:23,代码来源:fun_wap.php

示例6: tpl_function_qishi_jobs_show

function tpl_function_qishi_jobs_show($params, &$smarty)
{
    global $db, $timestamp, $_CFG;
    $arr = explode(',', $params['set']);
    foreach ($arr as $str) {
        $a = explode(':', $str);
        switch ($a[0]) {
            case "职位ID":
                $aset['id'] = $a[1];
                break;
            case "列表名":
                $aset['listname'] = $a[1];
                break;
            case "描述长度":
                $aset['brieflylen'] = $a[1];
                break;
            case "填补字符":
                $aset['dot'] = $a[1];
                break;
        }
    }
    $aset = array_map("get_smarty_request", $aset);
    $aset['id'] = $aset['id'] ? intval($aset['id']) : 0;
    $aset['brieflylen'] = isset($aset['brieflylen']) ? intval($aset['brieflylen']) : 0;
    $aset['listname'] = $aset['listname'] ? $aset['listname'] : "list";
    $wheresql = " WHERE id={$aset['id']} ";
    $sql = "select id,uid,setmeal_deadline,add_mode,amount,company_id,district_cn,contents,refreshtime,tag_cn,category,subclass,sdistrict,jobs_name,companyname,wage_cn,nature_cn,category_cn,sex_cn,age,education_cn,experience_cn,graduate from " . table('jobs') . $wheresql . " LIMIT 1";
    $val = $db->getone($sql);
    if (empty($val)) {
        $sql_tmp = "select id,uid,setmeal_deadline,add_mode,amount,company_id,district_cn,contents,refreshtime,tag_cn,category,subclass,sdistrict,jobs_name,companyname,wage_cn,nature_cn,category_cn,sex_cn,age,education_cn,experience_cn from " . table('jobs_tmp') . $wheresql . " LIMIT 1";
        $val = $db->getone($sql_tmp);
        if (empty($val)) {
            header("HTTP/1.1 404 Not Found");
            $smarty->display("404.htm");
            exit;
        } elseif ($val['deadline'] < time()) {
            $val['jobs_gq'] = 1;
        } else {
            $val['jobs_gq'] = 2;
        }
        $val['contents'] = htmlspecialchars_decode($val['contents'], ENT_QUOTES);
    } else {
        if (intval($_SESSION['uid']) > 0 && intval($_SESSION['utype']) == 2) {
            //检查该职位是否对此会员发起面试邀请,并且此会员没看
            $check_int = check_interview(intval($_SESSION['uid']), $val['id']);
            if ($check_int) {
                update_interview(intval($_SESSION['uid']), $val['id']);
            }
            //检查该职位是否被此会员收藏过
            $check_fav = check_favorites(intval($_SESSION['uid']), $val['id']);
            if ($check_fav) {
                $val['check_fav'] = 1;
            }
        }
        if ($val['setmeal_deadline'] < time() && $val['setmeal_deadline'] != "0" && $val['add_mode'] == "2") {
            $val['deadline'] = $val['setmeal_deadline'];
        }
        $val['amount'] = $val['amount'] == "0" ? '若干' : $val['amount'];
        $val['jobs_url'] = url_rewrite('QS_jobsshow', array('id' => $val['id']));
        $profile = GetJobsCompanyProfile($val['company_id']);
        $val['company'] = $profile;
        $val['contact'] = GetJobsContact($val['id']);
        $district_cn = $val['district_cn'];
        $d_arr = explode("/", $district_cn);
        $val['district_ch'] = $d_arr[0];
        $val['sdistrict_ch'] = $d_arr[1];
        $val['expire'] = sub_day($val['deadline'], time());
        $val['countresume'] = $db->get_total("SELECT COUNT(*) AS num FROM " . table('personal_jobs_apply') . " WHERE jobs_id= '{$val['id']}'");
        if ($aset['brieflylen'] > 0) {
            $val['briefly'] = cut_str(strip_tags($val['contents']), $aset['brieflylen'], 0, $aset['dot']);
        } else {
            $val['briefly'] = strip_tags($val['contents']);
        }
        $val['contents'] = htmlspecialchars_decode($val['contents'], ENT_QUOTES);
        $val['refreshtime_cn'] = daterange(time(), $val['refreshtime'], 'Y-m-d', "#FF3300");
        $val['company_url'] = url_rewrite('QS_companyshow', array('id' => $val['company_id']));
        if ($val['company']['logo']) {
            $val['company']['logo'] = $_CFG['site_dir'] . "data/logo/" . $val['company']['logo'];
        } else {
            $val['company']['logo'] = $_CFG['site_dir'] . "data/logo/no_logo.gif";
        }
        if ($val['company']['website']) {
            if (strstr($val['company']['website'], "http://") === false) {
                $val['company']['website'] = "http://" . $val['company']['website'];
            }
        }
        if (intval($_SESSION['utype']) == 2) {
            $interest_id = get_interest_jobs_id(intval($_SESSION['uid']));
        }
        if ($val['tag_cn']) {
            $tag_cn = explode(',', $val['tag_cn']);
            $val['tag_cn'] = $tag_cn;
        } else {
            $val['tag_cn'] = array();
        }
    }
    $user = get_jobs_username($val['uid']);
    $hashstr = substr(md5($user['username']), 8, 16);
    $smarty->assign('hashstr', $hashstr);
    $smarty->assign($aset['listname'], $val);
//.........这里部分代码省略.........
开发者ID:source-hunter,项目名称:74cms,代码行数:101,代码来源:function.qishi_jobs_show.php

示例7: tpl_function_qishi_simple_resume_list


//.........这里部分代码省略.........
        $aset['key'] = help::addslashes_deep(trim($aset['key']));
        if ($aset['keytype'] == "1" || $aset['keytype'] == "") {
            $wheresql .= " AND  likekey like '%{$aset['key']}%'";
            $orderbysql = "";
        } elseif ($aset['keytype'] == "2") {
            $wheresql .= " AND  MATCH (`key`) AGAINST ('" . fulltextpad($aset['key']) . "') ";
            $orderbysql = "";
        }
    }
    if (!empty($aset['citycategory'])) {
        $dsql = $xsql = "";
        $arr = explode("_", $aset['citycategory']);
        $arr = array_unique($arr);
        if (count($arr) > 10) {
            exit;
        }
        foreach ($arr as $sid) {
            $cat = explode(".", $sid);
            if (intval($cat[1]) === 0) {
                $dsql .= " OR district =" . intval($cat[0]);
            } else {
                $xsql .= " OR sdistrict =" . intval($cat[1]);
            }
        }
        $wheresql .= " AND  (" . ltrim(ltrim($dsql . $xsql), 'OR') . ") ";
    } else {
        if (isset($aset['district']) && $aset['district'] != '') {
            if (strpos($aset['district'], "-")) {
                $or = $orsql = "";
                $arr = explode("-", $aset['district']);
                $arr = array_unique($arr);
                if (count($arr) > 20) {
                    exit;
                }
                $sqlin = implode(",", $arr);
                if (preg_match("/^(\\d{1,10},)*(\\d{1,10})\$/", $sqlin)) {
                    $wheresql .= " AND district IN  ({$sqlin}) ";
                }
            } else {
                $wheresql .= " AND district =" . intval($aset['district']);
            }
        }
        if (isset($aset['sdistrict']) && $aset['sdistrict'] != '') {
            if (strpos($aset['sdistrict'], "-")) {
                $or = $orsql = "";
                $arr = explode("-", $aset['sdistrict']);
                $arr = array_unique($arr);
                if (count($arr) > 10) {
                    exit;
                }
                $sqlin = implode(",", $arr);
                if (preg_match("/^(\\d{1,10},)*(\\d{1,10})\$/", $sqlin)) {
                    $wheresql .= " AND sdistrict IN  ({$sqlin}) ";
                }
            } else {
                $wheresql .= " AND sdistrict =" . intval($aset['sdistrict']);
            }
        }
    }
    if (!empty($wheresql)) {
        $wheresql = " WHERE " . ltrim(ltrim($wheresql), 'AND');
    }
    if (isset($aset['page'])) {
        require_once QISHI_ROOT_PATH . 'include/page.class.php';
        $total_sql = "SELECT COUNT(*) AS num FROM " . table('simple_resume') . $wheresql;
        //echo $total_sql;
        $total_count = $db->get_total($total_sql);
        $page = new page(array('total' => $total_count, 'perpage' => $aset['row'], 'alias' => 'QS_simpleresumelist', 'getarray' => $_GET));
        $currenpage = $page->nowindex;
        $aset['start'] = ($currenpage - 1) * $aset['row'];
        $smarty->assign('page', $page->show(3));
        $smarty->assign('total', $total_count);
    }
    $limit = " LIMIT " . abs($aset['start']) . ',' . $aset['row'];
    $result = $db->query("SELECT id,subsite_id,uname,detailed,refreshtime,category,is_hot,sex,age,experience_cn,deadline,district_cn,sdistrict_cn FROM " . table('simple_resume') . " " . $wheresql . $orderbysql . $limit);
    $list = array();
    //echo "SELECT * FROM ".table('jobs')." ".$wheresql.$orderbysql.$limit;
    while ($row = $db->fetch_array($result)) {
        $row['uname_'] = $row['uname'];
        $row['uname'] = cut_str($row['uname'], $aset['unamelen'], 0, $aset['dot']);
        $row['detailed_'] = strip_tags($row['detailed']);
        if ($aset['brieflylen'] > 0) {
            $row['detailed'] = cut_str($row['detailed_'], $aset['brieflylen'], 0, $aset['dot']);
        } else {
            $row['detailed'] = $row['detailed_'];
        }
        if (strlen($row['detailed_']) > $aset['brieflylen'] * 2) {
            $row['show_detail'] = true;
        } else {
            $row['show_detail'] = false;
        }
        // $row['comname_']=$row['comname'];
        $row['refreshtime_cn'] = daterange(time(), $row['refreshtime'], 'Y-m-d', "#FF3300");
        // $row['comname']=cut_str($row['comname'],$aset['companynamelen'],0,$aset['dot']);
        $row['simple_url'] = url_rewrite($aset['simpleresumeshow'], array('id' => $row['id']), 1, $row['subsite_id']);
        $row['intention_jobs'] = $row['category'];
        $list[] = $row;
    }
    $smarty->assign($aset['listname'], $list);
}
开发者ID:winiceo,项目名称:fenzhan,代码行数:101,代码来源:function.qishi_simple_resume_list.php

示例8: define

<?php

/*
 * 74cms WAP
 * ============================================================================
 * 版权所有: 骑士网络,并保留所有权利。
 * 网站地址: http://www.74cms.com;
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用;不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
*/
define('IN_QISHI', true);
require_once dirname(__FILE__) . '/../include/common.inc.php';
require_once QISHI_ROOT_PATH . 'include/fun_wap.php';
require_once QISHI_ROOT_PATH . 'include/mysql.class.php';
$smarty->cache = false;
$db = new mysql($dbhost, $dbuser, $dbpass, $dbname);
require_once dirname(__FILE__) . '/weixin_share.php';
$show = news_one($_GET['id']);
if ($show) {
    $show['addtime'] = daterange(time(), $show['addtime'], 'Y-m-d', "#FF3300");
    $show['bimg'] = $_CFG['upfiles_dir'] . $show['Small_img'];
    $type_cn = $db->getone(" SELECT * FROM " . table('article_category') . " WHERE id=" . $show['type_id']);
    $show['type_cn'] = $type_cn['categoryname'];
    $smarty->assign('show', $show);
}
$smarty->assign('goback', $_SERVER["HTTP_REFERER"]);
$smarty->display("m/news-show.html");
开发者ID:winiceo,项目名称:job,代码行数:29,代码来源:news-show.php

示例9: tpl_function_qishi_jobs_show

function tpl_function_qishi_jobs_show($params, &$smarty)
{
    global $db, $timestamp, $_CFG;
    $arr = explode(',', $params['set']);
    foreach ($arr as $str) {
        $a = explode(':', $str);
        switch ($a[0]) {
            case "职位ID":
                $aset['id'] = $a[1];
                break;
            case "列表名":
                $aset['listname'] = $a[1];
                break;
            case "描述长度":
                $aset['brieflylen'] = $a[1];
                break;
            case "填补字符":
                $aset['dot'] = $a[1];
                break;
        }
    }
    $aset = array_map("get_smarty_request", $aset);
    $aset['id'] = $aset['id'] ? intval($aset['id']) : 0;
    $aset['brieflylen'] = isset($aset['brieflylen']) ? intval($aset['brieflylen']) : 0;
    $aset['listname'] = $aset['listname'] ? $aset['listname'] : "list";
    $wheresql = " WHERE id={$aset['id']} ";
    $sql = "select * from " . table('jobs') . $wheresql . " LIMIT 1";
    $val = $db->getone($sql);
    if (empty($val)) {
        $sql_tmp = "select * from " . table('jobs_tmp') . $wheresql . " LIMIT 1";
        $val_tmp = $db->getone($sql_tmp);
        if ((intval($_SESSION['admin_id']) > 0 || intval($_SESSION['uid']) == $val_tmp['uid']) && !empty($val_tmp)) {
            $val = $val_tmp;
        }
    }
    if (empty($val)) {
        header("HTTP/1.1 404 Not Found");
        $smarty->display("404.htm");
        exit;
    } else {
        if (intval($_SESSION['uid']) > 0 && intval($_SESSION['utype']) == 2) {
            //检查该职位是否对此会员发起面试邀请,并且此会员没看
            $check_int = check_interview(intval($_SESSION['uid']), $val['id']);
            if ($check_int) {
                update_interview(intval($_SESSION['uid']), $val['id']);
            }
        }
        if ($val['setmeal_deadline'] < time() && $val['setmeal_deadline'] != "0" && $val['add_mode'] == "2") {
            $val['deadline'] = $val['setmeal_deadline'];
        }
        $val['amount'] = $val['amount'] == "0" ? '若干' : $val['amount'];
        $val['jobs_url'] = url_rewrite('QS_jobsshow', array('id' => $val['id']), false);
        $profile = GetJobsCompanyProfile($val['company_id']);
        $val['company'] = $profile;
        $val['contact'] = GetJobsContact($val['id']);
        $district_cn = $val['district_cn'];
        $d_arr = explode("/", $district_cn);
        $val['district_ch'] = $d_arr[0];
        $val['sdistrict_ch'] = $d_arr[1];
        $val['expire'] = sub_day($val['deadline'], time());
        $wheresql = " WHERE company_uid='{$row['uid']}' AND jobs_id= '{$row['id']}'";
        $val['countresume'] = $db->get_total("SELECT COUNT(*) AS num FROM " . table('personal_jobs_apply') . " WHERE jobs_id= '{$val['id']}'");
        if ($aset['brieflylen'] > 0) {
            $val['briefly'] = cut_str(strip_tags($val['contents']), $aset['brieflylen'], 0, $val['dot']);
        } else {
            $val['briefly'] = strip_tags($val['contents']);
        }
        $val['refreshtime_cn'] = daterange(time(), $val['refreshtime'], 'Y-m-d', "#FF3300");
        $val['company_url'] = url_rewrite('QS_companyshow', array('id' => $val['company_id']));
        if ($val['company']['logo']) {
            $val['company']['logo'] = $_CFG['main_domain'] . "data/logo/" . $val['company']['logo'];
        } else {
            $val['company']['logo'] = $_CFG['main_domain'] . "data/logo/no_logo.gif";
        }
        if ($val['company']['website']) {
            if (strstr($val['company']['website'], "http://") === false) {
                $val['company']['website'] = "http://" . $val['company']['website'];
            }
        }
        if (intval($_SESSION['utype']) == 2) {
            $interest_id = get_interest_jobs_id(intval($_SESSION['uid']));
        }
        if ($val['tag']) {
            $tag = explode('|', $val['tag']);
            $taglist = array();
            if (!empty($tag) && is_array($tag)) {
                foreach ($tag as $t) {
                    $tli = explode(',', $t);
                    $taglist[] = array($tli[0], $tli[1]);
                }
            }
            $val['tag'] = $taglist;
        } else {
            $val['tag'] = array();
        }
    }
    $smarty->assign($aset['listname'], $val);
}
开发者ID:dalinhuang,项目名称:yy,代码行数:98,代码来源:function.qishi_jobs_show.php

示例10: daterange

 }
 if (array_key_exists($input->g['department_id'], $departments) && in_array($input->g['department_id'], $staff_departments)) {
     $search_query .= "department_id='" . $db->real_escape_string($input->g['department_id']) . "' AND ";
 }
 if (array_key_exists($input->g['priority_id'], $priority)) {
     $search_query .= "priority_id='" . $db->real_escape_string($input->g['priority_id']) . "' AND ";
 }
 if (!empty($input->g['date_from'])) {
     $daterange = daterange($input->g['date_from']);
     if ($daterange != '') {
         $date_from = $daterange[0];
         $search_query .= "date>='{$date_from}' AND ";
     }
 }
 if (!empty($input->g['date_to'])) {
     $daterange = daterange($input->g['date_to']);
     if ($daterange != '') {
         $date_to = $daterange[1];
         $search_query .= "date<='{$date_to}' AND ";
     }
 }
 if (!empty($input->g['criteria_value'])) {
     switch ($input->g['criteria']) {
         case 'code':
             $search_query .= "code='" . $db->real_escape_string($input->g['criteria_value']) . "' AND ";
             break;
         case 'subject':
             $search_query .= "subject LIKE '%" . $db->real_escape_string($input->g['criteria_value']) . "%' AND ";
             break;
         case 'name':
             $search_query .= "fullname LIKE '%" . $db->real_escape_string($input->g['criteria_value']) . "%' AND ";
开发者ID:anteknik,项目名称:helpdesk,代码行数:31,代码来源:tickets_action.php

示例11: tpl_function_qishi_hunter_jobs_list


//.........这里部分代码省略.........
                if (preg_match("/^(\\d{1,10},)*(\\d{1,10})\$/", $sqlin)) {
                    $wheresql .= " AND district IN  ({$sqlin}) ";
                }
            } else {
                $wheresql .= " AND district =" . intval($aset['district']);
            }
        }
        if (isset($aset['sdistrict']) && $aset['sdistrict'] != '') {
            if (strpos($aset['sdistrict'], "-")) {
                $or = $orsql = "";
                $arr = explode("-", $aset['sdistrict']);
                $arr = array_unique($arr);
                if (count($arr) > 10) {
                    exit;
                }
                $sqlin = implode(",", $arr);
                if (preg_match("/^(\\d{1,10},)*(\\d{1,10})\$/", $sqlin)) {
                    $wheresql .= " AND sdistrict IN  ({$sqlin}) ";
                }
            } else {
                $wheresql .= " AND sdistrict =" . intval($aset['sdistrict']);
            }
        }
    }
    if (isset($aset['key']) && !empty($aset['key'])) {
        if ($_CFG['hunterjobsearch_purview'] == '2') {
            if ($_SESSION['username'] == '') {
                header("Location: " . url_rewrite('QS_login') . "?url=" . urlencode($_SERVER["REQUEST_URI"]));
            }
        }
        $key = help::addslashes_deep(trim($aset['key']));
        if ($_CFG['hunterjobsearch_type'] == '1') {
            $akey = explode(' ', $key);
            if (count($akey) > 1) {
                $akey = array_filter($akey);
                $akey = array_slice($akey, 0, 2);
                $akey = array_map("fulltextpad", $akey);
                $key = '+' . implode(' +', $akey);
                $mode = ' IN BOOLEAN MODE';
            } else {
                $key = fulltextpad($key);
                $mode = ' ';
            }
            $wheresql .= " AND  MATCH (`key`) AGAINST ('{$key}'{$mode}) ";
        } else {
            $wheresql .= " AND likekey LIKE '%{$key}%' ";
        }
        $jobstable = table('jobs_search_key');
    }
    if ($_CFG['operation_hunter_mode'] == '1') {
        $wheresql .= "  AND audit=1  AND display=1 ";
    } elseif ($_CFG['operation_hunter_mode'] == '2') {
        $wheresql .= "  AND audit=1 AND display=1 AND setmeal_id>0 AND (setmeal_deadline>{$timenow} OR setmeal_deadline=0)";
    }
    if (!empty($wheresql)) {
        $wheresql = " WHERE " . ltrim(ltrim($wheresql), 'AND');
    }
    //echo "SELECT * FROM ".table('hunter_jobs')." ".$wheresql.$orderbysql.$limit;
    if (isset($aset['page'])) {
        require_once QISHI_ROOT_PATH . 'include/page.class.php';
        $total_sql = "SELECT COUNT(*) AS num FROM " . table('hunter_jobs') . " {$wheresql}";
        //echo $total_sql;
        //echo "<br>";
        $total_count = $db->get_total($total_sql);
        if ($_CFG['hunter_list_max'] > 0) {
            $total_count > intval($_CFG['hunter_list_max']) && ($total_count = intval($_CFG['hunter_list_max']));
        }
        $page = new page(array('total' => $total_count, 'perpage' => $aset['row'], 'alias' => $aset['listpage'], 'getarray' => $_GET));
        $currenpage = $page->nowindex;
        $aset['start'] = abs($currenpage - 1) * $aset['row'];
        if ($total_count > $aset['row']) {
            $smarty->assign('page', $page->show(8));
            $smarty->assign('pagemin', $page->show(7));
        }
        $smarty->assign('total', $total_count);
    }
    $limit = " LIMIT {$aset['start']} , {$aset['row']}";
    $list = $id = array();
    $result = $db->query("SELECT id,subsite_id,jobs_name,contents,jobs_qualified,companyname,refreshtime,district_cn,wage_cn FROM " . table('hunter_jobs') . $wheresql . $orderbysql . $limit);
    while ($row = $db->fetch_array($result)) {
        $row['jobs_name_'] = $row['jobs_name'];
        $row['jobs_name'] = cut_str($row['jobs_name'], $aset['jobslen'], 0, $aset['dot']);
        if ($aset['brieflylen'] > 0) {
            $row['briefly'] = cut_str(strip_tags($row['contents']), $aset['brieflylen'], 0, $aset['dot']);
            $row['jobs_qualified'] = cut_str(strip_tags($row['jobs_qualified']), $aset['brieflylen'], 0, $aset['dot']);
        } else {
            $row['briefly'] = strip_tags($row['contents']);
            $row['jobs_qualified'] = strip_tags($row['jobs_qualified']);
        }
        $row['amount'] = $row['amount'] == "0" ? '若干' : $row['amount'];
        $row['briefly_'] = strip_tags($row['contents']);
        $row['companyname_'] = $row['companyname'];
        $row['companyname'] = cut_str($row['companyname'], $aset['companynamelen'], 0, $aset['dot']);
        $row['jobs_url'] = url_rewrite($aset['jobsshow'], array('id' => $row['id']), 1, $row['subsite_id']);
        $row['company_url'] = url_rewrite($aset['companyshow'], array('id' => $row['company_id']));
        $row['refreshtime_cn'] = daterange(time(), $row['refreshtime'], 'Y-m-d', "#FF3300");
        $list[] = $row;
    }
    $smarty->assign($aset['listname'], $list);
}
开发者ID:winiceo,项目名称:fenzhan,代码行数:101,代码来源:function.qishi_hunter_jobs_list.php

示例12: tpl_function_qishi_jobs_show

function tpl_function_qishi_jobs_show($params, &$smarty)
{
    global $db, $timestamp, $_CFG;
    $arr = explode(',', $params['set']);
    foreach ($arr as $str) {
        $a = explode(':', $str);
        switch ($a[0]) {
            case "职位ID":
                $aset['id'] = $a[1];
                break;
            case "列表名":
                $aset['listname'] = $a[1];
                break;
            case "描述长度":
                $aset['brieflylen'] = $a[1];
                break;
            case "填补字符":
                $aset['dot'] = $a[1];
                break;
        }
    }
    $aset = array_map("get_smarty_request", $aset);
    $aset['id'] = $aset['id'] ? intval($aset['id']) : 0;
    $aset['brieflylen'] = isset($aset['brieflylen']) ? intval($aset['brieflylen']) : 0;
    $aset['listname'] = $aset['listname'] ? $aset['listname'] : "list";
    $smarty->assign("is_reward", get_jobs_is_reward($_SESSION["uid"], $aset['id']));
    $wheresql = " WHERE id={$aset['id']} ";
    $sql = "select id,uid,audit,display,setmeal_deadline,add_mode,amount,company_id,district_cn,contents,refreshtime,tag_cn,category,subclass,sdistrict,jobs_name,companyname,wage_cn,nature_cn,category_cn,sex_cn,age,education_cn,experience_cn,deadline,graduate from " . table('jobs') . $wheresql . " LIMIT 1";
    $val = $db->getone($sql);
    if (empty($val)) {
        $sql_tmp = "select id,uid,audit,display,setmeal_deadline,add_mode,amount,company_id,district_cn,contents,refreshtime,tag_cn,category,subclass,sdistrict,jobs_name,companyname,wage_cn,nature_cn,category_cn,sex_cn,age,education_cn,deadline,experience_cn from " . table('jobs_tmp') . $wheresql . " LIMIT 1";
        $val = $db->getone($sql_tmp);
    }
    if (empty($val)) {
        header("HTTP/1.1 404 Not Found");
        $smarty->display("404.htm");
        exit;
    }
    if ($val['deadline'] < time()) {
        $val['jobs_gq'] = 1;
    } elseif ($val['audit'] != '1' || $val['display'] != '1' || $val['setmeal_deadline'] != '0' && $val['setmeal_deadline'] < time()) {
        $val['jobs_gq'] = 2;
    }
    setcookie('QS[view_jobs_log][' . $val['id'] . ']', $val['id'], 0, $QS_cookiepath, $QS_cookiedomain);
    if (intval($_SESSION['uid']) > 0 && intval($_SESSION['utype']) == 2) {
        //检查是否看过该职位
        $check = check_view_log(intval($_SESSION['uid']), $val['id']);
        if (!$check) {
            add_view_log(intval($_SESSION['uid']), $val['id']);
        }
        //检查该职位是否对此会员发起面试邀请,并且此会员没看
        $check_int = check_interview(intval($_SESSION['uid']), $val['id']);
        if ($check_int) {
            update_interview(intval($_SESSION['uid']), $val['id']);
        }
        //检查该职位是否被此会员收藏过
        $check_fav = check_favorites(intval($_SESSION['uid']), $val['id']);
        if ($check_fav) {
            $val['check_fav'] = 1;
        }
    }
    if ($val['setmeal_deadline'] < time() && $val['setmeal_deadline'] != "0" && $val['add_mode'] == "2") {
        $val['deadline'] = $val['setmeal_deadline'];
    }
    $val['amount'] = $val['amount'] == "0" ? '若干' : $val['amount'];
    $val['jobs_url'] = url_rewrite('QS_jobsshow', array('id' => $val['id']));
    $profile = GetJobsCompanyProfile($val['company_id']);
    $val['company'] = $profile;
    $val['contact'] = GetJobsContact($val['id']);
    $district_cn = $val['district_cn'];
    $d_arr = explode("/", $district_cn);
    $val['district_ch'] = $d_arr[0];
    $val['sdistrict_ch'] = $d_arr[1];
    $val['expire'] = sub_day($val['deadline'], time());
    $val['countresume'] = $db->get_total("SELECT COUNT(*) AS num FROM " . table('personal_jobs_apply') . " WHERE jobs_id= '{$val['id']}'");
    if ($aset['brieflylen'] > 0) {
        $val['briefly'] = cut_str(strip_tags($val['contents']), $aset['brieflylen'], 0, $aset['dot']);
    } else {
        $val['briefly'] = strip_tags($val['contents']);
    }
    $val['contents'] = htmlspecialchars_decode($val['contents'], ENT_QUOTES);
    $val['refreshtime_cn'] = daterange(time(), $val['refreshtime'], 'Y-m-d', "#FF3300");
    $val['company_url'] = url_rewrite('QS_companyshow', array('id' => $val['company_id']));
    if ($val['company']['logo']) {
        $val['company']['logo'] = $_CFG['site_dir'] . "data/logo/" . $val['company']['logo'];
    } else {
        $val['company']['logo'] = $_CFG['site_dir'] . "data/logo/no_logo.gif";
    }
    if ($val['company']['website']) {
        if (strstr($val['company']['website'], "http://") === false) {
            $val['company']['website'] = "http://" . $val['company']['website'];
        }
    }
    if (intval($_SESSION['utype']) == 2) {
        $view_log = get_view_log(intval($_SESSION['uid']));
        foreach ($view_log as $key => $value) {
            $jobs_info = $db->getone("select id,company_id,jobs_name,companyname from " . table('jobs') . " where id=" . $value['jobsid']);
            $val['view_log'][$key]['jobsid'] = $jobs_info['id'];
            $val['view_log'][$key]['jobs_name'] = $jobs_info['jobs_name'];
            $val['view_log'][$key]['jobs_url'] = url_rewrite('QS_jobsshow', array('id' => $jobs_info['id']));
//.........这里部分代码省略.........
开发者ID:winiceo,项目名称:job,代码行数:101,代码来源:function.qishi_jobs_show.php

示例13: tpl_function_qishi_hunter_jobs_show

function tpl_function_qishi_hunter_jobs_show($params, &$smarty)
{
    global $db, $timestamp, $_CFG;
    $arr = explode(',', $params['set']);
    foreach ($arr as $str) {
        $a = explode(':', $str);
        switch ($a[0]) {
            case "职位ID":
                $aset['id'] = $a[1];
                break;
            case "列表名":
                $aset['listname'] = $a[1];
                break;
            case "描述长度":
                $aset['brieflylen'] = $a[1];
                break;
            case "填补字符":
                $aset['dot'] = $a[1];
                break;
        }
    }
    $aset = array_map("get_smarty_request", $aset);
    $aset['id'] = $aset['id'] ? intval($aset['id']) : 0;
    $aset['brieflylen'] = isset($aset['brieflylen']) ? intval($aset['brieflylen']) : 0;
    $aset['listname'] = $aset['listname'] ? $aset['listname'] : "list";
    $wheresql = " WHERE id={$aset['id']} ";
    $sql = "select id,uid,utype,setmeal_deadline,add_mode,contents,jobs_qualified,refreshtime,language,wage_structure,jobs_name,companyname,addtime,click,wage_cn,trade_cn,scale_cn,department,reporter,nature_cn,district_cn,category_cn,age_cn,education_cn,sex_cn,experience_cn from " . table('hunter_jobs') . $wheresql . " LIMIT 1";
    $val = $db->getone($sql);
    if (empty($val)) {
        header("HTTP/1.1 404 Not Found");
        $smarty->display("404.htm");
        exit;
    } else {
        if (intval($_SESSION['uid']) > 0 && intval($_SESSION['utype']) == 2) {
            //检查该职位是否对此会员发起面试邀请,并且此会员没看
            $check_int = check_interview(intval($_SESSION['uid']), $val['id']);
            if ($check_int) {
                update_interview(intval($_SESSION['uid']), $val['id']);
            }
        }
        if ($val['setmeal_deadline'] < time() && $val['setmeal_deadline'] != "0" && $val['add_mode'] == "2") {
            $val['deadline'] = $val['setmeal_deadline'];
        }
        $val['jobs_url'] = url_rewrite('QS_hunter_jobsshow', array('id' => $val['id']));
        $val['expire'] = sub_day($val['deadline'], time());
        if ($aset['brieflylen'] > 0) {
            $val['briefly'] = cut_str(strip_tags($val['contents']), $aset['brieflylen'], 0, $aset['dot']);
            $val['jobs_qualified'] = cut_str(strip_tags($val['jobs_qualified']), $aset['brieflylen'], 0, $aset['dot']);
        } else {
            $val['briefly'] = strip_tags($val['contents']);
            $val['jobs_qualified'] = strip_tags($val['jobs_qualified']);
        }
        $val['refreshtime_cn'] = daterange(time(), $val['refreshtime'], 'Y-m-d', "#FF3300");
        $val['company_url'] = url_rewrite('QS_companyshow', array('id' => $val['company_id']));
        $val['languagecn'] = preg_replace("/\\d+/", '', $val['language']);
        $val['languagecn'] = preg_replace('/\\,/', '', $val['languagecn']);
        $val['languagecn'] = preg_replace('/\\|/', '&nbsp;&nbsp;&nbsp;', $val['languagecn']);
        $wage_structure = explode("|", $val['wage_structure']);
        foreach ($wage_structure as $key => $value) {
            $wage = explode(",", $value);
            $val['structure'][$key]['value'] = $wage[1];
        }
        if ($val['utype'] == '1') {
            $company = GetJobsCompanyProfile($val['uid']);
            $val['company_id'] = $company['id'];
        }
        $wheresql = " WHERE huntet_uid='{$val['uid']}' AND jobs_id= '{$val['id']}' AND personal_look=1 ";
        $val['countresume'] = $db->get_total("SELECT COUNT(*) AS num FROM " . table('personal_hunter_jobs_apply') . $wheresql);
    }
    $smarty->assign($aset['listname'], $val);
}
开发者ID:winiceo,项目名称:job,代码行数:71,代码来源:function.qishi_hunter_jobs_show.php

示例14: wap_url_rewrite

    $emergency_jobs[$key]['url'] = wap_url_rewrite("jobs-show", array("id" => $value['id']), 1, $value['subsite_id']);
    $emergency_jobs[$key]['r_time'] = daterange(time(), $value['refreshtime'], 'Y-m-d', "#FF3300");
}
$smarty->assign('emergency_jobs', $emergency_jobs);
//推荐职位
$recommend_jobs = $db->getall("SELECT id,subsite_id,jobs_name,district_cn,companyname,wage_cn,refreshtime FROM " . table('jobs') . " WHERE recommend=1 and " . $subsite_wheresql . " ORDER BY `refreshtime` DESC,`id` DESC LIMIT 5");
foreach ($recommend_jobs as $key => $value) {
    $recommend_jobs[$key]['url'] = wap_url_rewrite("jobs-show", array("id" => $value['id']), 1, $value['subsite_id']);
    $recommend_jobs[$key]['r_time'] = daterange(time(), $value['refreshtime'], 'Y-m-d', "#FF3300");
}
$smarty->assign('recommend_jobs', $recommend_jobs);
//最新职位
$new_jobs = $db->getall("SELECT id,subsite_id,jobs_name,district_cn,companyname,wage_cn,refreshtime FROM " . table('jobs') . " where " . $subsite_wheresql . "  ORDER BY `refreshtime` DESC,`id` DESC LIMIT 5");
foreach ($new_jobs as $key => $value) {
    $new_jobs[$key]['url'] = wap_url_rewrite("jobs-show", array("id" => $value['id']), 1, $value['subsite_id']);
    $new_jobs[$key]['r_time'] = daterange(time(), $value['refreshtime'], 'Y-m-d', "#FF3300");
}
$smarty->assign('new_jobs', $new_jobs);
//名企推荐广告位
$ad_list = $db->getall("SELECT id,img_path,img_url FROM " . table('ad') . " WHERE alias='QS_yellowpage'  ORDER BY `show_order` DESC,`id` DESC LIMIT 6");
$smarty->assign('ad_list', $ad_list);
//热门关键字
$sql = "select w_word,w_hot from " . table("hotword") . " order by w_hot desc limit 15 ";
$hotword_list = $db->getall($sql);
$smarty->assign('hotword', $hotword_list);
//分站
$subsite = get_cache('subsite');
$subsitelist = array();
foreach ($subsite as $key => $value) {
    $subsitelist[] = $value;
}
开发者ID:winiceo,项目名称:fenzhan,代码行数:31,代码来源:index.php

示例15: str_pad

            $value['fullname'] = "N" . str_pad($value['id'], 7, "0", STR_PAD_LEFT);
            $value['fullname_'] = $value['fullname'];
        } elseif ($value['display_name'] == "3") {
            if ($value['sex'] == 1) {
                $value['fullname'] = cut_str($value['fullname'], 1, 0, "先生");
            } elseif ($value['sex'] == 2) {
                $value['fullname'] = cut_str($value['fullname'], 1, 0, "女士");
            }
            $value['fullname_'] = $value['fullname'];
        } else {
            $value['fullname_'] = $value['fullname'];
            $value['fullname'] = $value['fullname'];
        }
        $resume[$key]['url'] = wap_url_rewrite("resume-show", array("id" => $value["id"]));
        $resume[$key]['fullname_'] = $value['fullname_'];
        $resume[$key]['fullname'] = $value['fullname'];
        $resume[$key]['refreshtime_cn'] = daterange(time(), $value['refreshtime'], 'Y-m-d', "#FF3300");
        //检测该会员的手机认证状态
        $user_info = $db->getone("SELECT mobile_audit FROM " . table('members') . " WHERE uid=" . $value['uid']);
        $resume[$key]['mobile_audit'] = $user_info['mobile_audit'];
    }
} else {
    $resume = array();
}
$smarty->assign('resume', $resume);
$smarty->assign('pagehtml', wapmulti($count, $perpage, $page, $theurl));
//热门关键字
$sql = "select w_word,w_hot from " . table("hotword") . " order by w_hot desc limit 15 ";
$hotword_list = $db->getall($sql);
$smarty->assign('hotword', $hotword_list);
$smarty->display("m/m-resume-list.html");
开发者ID:winiceo,项目名称:job,代码行数:31,代码来源:resume-list.php


注:本文中的daterange函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。