function tpl_modifier_qishi_url($string) { global $_CFG; if (strpos($string, ",")) { $val = explode(",", $string); if ($val[0] == "QS_user") { return get_member_url($val[1], true); } else { if (strpos($val[1], "-")) { $g = explode("-", $val[1]); if (!empty($g)) { foreach ($g as $v) { $vs = explode(":", $v); $getarray[$vs[0]] = $vs[1]; } } } else { $g = explode(":", $val[1]); $getarray[$g[0]] = $g[1]; } return url_rewrite($val[0], $getarray); } } else { return url_rewrite($string); } }
function tpl_function_qishi_news_show($params, &$smarty) { global $db, $_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; } } $aset = array_map("get_smarty_request", $aset); $aset['id'] = $aset['id'] ? intval($aset['id']) : 0; $aset['listname'] = $aset['listname'] ? $aset['listname'] : "list"; unset($arr, $str, $a, $params); $sql = "select id,subsite_id,content,title,seo_keywords,seo_description,type_id,addtime from " . table('article') . " WHERE id=" . intval($aset['id']) . " AND is_display=1 LIMIT 1"; $val = $db->getone($sql); if (empty($val)) { header("HTTP/1.1 404 Not Found"); $smarty->display("404.htm"); exit; } check_url($val['subsite_id'], $smarty, $_CFG['news_url']); $val['content'] = htmlspecialchars_decode($val['content'], ENT_QUOTES); if ($val['seo_keywords'] == "") { $val['keywords'] = $val['title']; } else { $val['keywords'] = $val['seo_keywords']; } if ($val['seo_description'] == "") { $val['description'] = cut_str(strip_tags($val['content']), 60, 0, ""); } else { $val['description'] = $val['seo_description']; } if (intval($_CFG['subsite_id']) > 0) { $other_wheresql = " AND subsite_id=" . intval($_CFG['subsite_id']) . " "; } $prev = $db->getone("select id,subsite_id,title from " . table('article') . " where id<" . $val['id'] . " and type_id=" . $val['type_id'] . $other_wheresql . " order by id desc limit 1"); if (!$prev) { $val['prev'] = 0; } else { $val['prev'] = 1; $val['prev_title'] = $prev['title']; $val['prev_url'] = url_rewrite("QS_newsshow", array('id' => $prev['id']), 1, $prev['subsite_id']); } $next = $db->getone("select id,subsite_id,title from " . table('article') . " where id>" . $val['id'] . " and type_id=" . $val['type_id'] . $other_wheresql . " limit 1"); if (!$next) { $val['next'] = "没有了"; } else { $val['next'] = 1; $val['next_title'] = $next['title']; $val['next_url'] = url_rewrite("QS_newsshow", array('id' => $next['id']), 1, $next['subsite_id']); } $smarty->assign($aset['listname'], $val); }
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); }
function get_resume_list($offset, $perpage, $get_sql = '') { global $db; $limit = " LIMIT " . $offset . ',' . $perpage; $result = $db->query($get_sql . $limit); while ($row = $db->fetch_array($result)) { $row['resume_url'] = url_rewrite('QS_resumeshow', array('id' => $row['id'])); $row_arr[] = $row; } return $row_arr; }
function tpl_function_qishi_company_show($params, &$smarty) { global $db, $_CFG; $arr = explode(',', $params['set']); foreach ($arr as $str) { $a = explode(':', $str); switch ($a[0]) { case "企业ID": $aset['id'] = $a[1]; break; case "企业介绍长度": $aset['companynamelen'] = $a[1]; break; case "列表名": $aset['listname'] = $a[1]; break; } } $aset = array_map("get_smarty_request", $aset); $aset['id'] = $aset['id'] ? intval($aset['id']) : 0; $aset['listname'] = $aset['listname'] ? $aset['listname'] : "list"; $aset['companynamelen'] = isset($aset['companynamelen']) ? intval($aset['companynamelen']) : 50; $wheresql .= " AND user_status=1 "; $sql = "select id,uid,contents,website,logo,companyname,audit,address,map_open,map_x,map_y,map_zoom,resume_processing,nature_cn,trade_cn,scale_cn,district_cn from " . table('company_profile') . " WHERE id='{$aset['id']}' {$wheresql} LIMIT 1"; $profile = $db->getone($sql); if (empty($profile)) { header("HTTP/1.1 404 Not Found"); $smarty->display("404.htm"); exit; } else { $profile['company_url'] = url_rewrite('QS_companyshow', array('id' => $profile['id'])); $profile['company_profile'] = htmlspecialchars_decode($profile['contents'], ENT_QUOTES); // 在招职位 $profile['jobs_num'] = $db->get_total("SELECT COUNT(*) AS num FROM " . table('jobs') . " WHERE uid='{$profile['uid']}' "); // 感兴趣简历 $profile['resume_num'] = $db->get_total("SELECT COUNT(*) AS num FROM " . table('company_favorites') . " WHERE company_uid='{$profile['uid']}' "); if ($profile['website']) { if (strstr($profile['website'], "http://") === false) { $profile['website'] = "http://" . $profile['website']; } } if ($profile['logo']) { $profile['logo'] = $_CFG['site_dir'] . "data/logo/" . $profile['logo']; } else { $profile['logo'] = $_CFG['site_dir'] . "data/logo/no_logo.gif"; } $row = $db->getone("select * from " . table("members_setmeal") . " where uid = " . $profile['uid']); $profile['pay_user'] = $row['setmeal_id']; $profile['pay_setmeal_name'] = $row['setmeal_name']; require_once QISHI_ROOT_PATH . 'include/fun_user.php'; $profile['loginlog'] = get_loginlog_one($profile['uid'], '1001'); } $smarty->assign($aset['listname'], $profile); }
function get_evaluation_paper($offset, $perpage, $sql = '') { global $db, $_CFG; $limit = " LIMIT " . $offset . ',' . $perpage; $rows = $db->getall("SELECT * FROM " . table('evaluation_paper') . $sql . $limit); foreach ($rows as $key => $value) { $value['url'] = url_rewrite('QS_paper_answer', array('id' => $value['id'])); $list[$key] = $value; } return $list; }
function tpl_function_qishi_train_show($params, &$smarty) { global $db, $_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; } } $aset = array_map("get_smarty_request", $aset); $aset['id'] = $aset['id'] ? intval($aset['id']) : 0; $aset['listname'] = $aset['listname'] ? $aset['listname'] : "list"; $wheresql .= " AND user_status=1 "; $sql = "select id,uid,contents,website,logo,trainname,address,nature_cn,district_cn,founddate from " . table('train_profile') . " WHERE id='{$aset['id']}' {$wheresql} LIMIT 1"; $profile = $db->getone($sql); if (empty($profile)) { header("HTTP/1.1 404 Not Found"); $smarty->display("404.htm"); exit; } else { $profile['train_url'] = url_rewrite('QS_train_agencyshow', array('id' => $profile['id'])); $profile['train_profile'] = $profile['contents']; $profile['description'] = cut_str(strip_tags($profile['contents']), 50, 0, "..."); $wheresql = " WHERE train_id='{$profile['id']}' and audit='1' "; $profile['countresume'] = $db->get_total("SELECT COUNT(*) AS num FROM " . table('train_news') . $wheresql); $profile['countjob'] = $db->get_total("SELECT COUNT(*) AS num FROM " . table('course') . $wheresql); /* 机构 风采图片 start */ $profile['train_img_num'] = $db->get_total("SELECT COUNT(*) AS num FROM " . table('train_img') . " WHERE uid='{$profile['uid']}' and audit=1 "); $train_img = $db->getall("select img from " . table("train_img") . " WHERE uid='{$profile['uid']}' and audit=1 order by addtime desc "); $profile['train_img'] = $train_img[0]['img']; foreach ($train_img as $key => $value) { $train_img[$key] = $_CFG['site_domain'] . $_CFG['site_dir'] . "data/train_img/original/" . $value['img']; } $profile['train_img_big'] = $train_img; /* 机构 风采图片 end */ if ($profile['website']) { if (strstr($profile['website'], "http://") === false) { $profile['website'] = "http://" . $profile['website']; } } if ($profile['logo']) { $profile['logo'] = $_CFG['site_dir'] . "data/train_logo/" . $profile['logo']; } else { $profile['logo'] = $_CFG['site_dir'] . "data/train_logo/no_logo.gif"; } } $smarty->assign($aset['listname'], $profile); }
function get_help($offset, $perpage, $sql = '') { global $db; $row_arr = array(); $limit = " LIMIT " . $offset . ',' . $perpage; $result = $db->query("SELECT a.*,c.id as cid,c.categoryname as c_categoryname FROM " . table('help') . " AS a {$sql} {$limit}"); while ($row = $db->fetch_array($result)) { $row['url'] = url_rewrite('QS_helpshow', array('id' => $row['id'])); $row_arr[] = $row; } return $row_arr; }
function get_nav_one($id) { global $db; $id = intval($id); $sql = "select * from " . table('navigation') . " where id=" . $id; $category_one = $db->getone($sql); if ($category_one['systemclass'] == "1") { $category_one['url'] = url_rewrite($category_one['module'], $category_one['module_page']); } $category_one['url_str'] = cut_str($category_one['url'], 12, 0); return $category_one; }
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); }
function reading_list_news() { global $db, $enrolled_courses, $system_courses; $news = array(); $sql = "SELECT * FROM " . TABLE_PREFIX . "reading_list R INNER JOIN " . TABLE_PREFIX . "external_resources E ON E.resource_id = R.resource_id WHERE R.course_id in " . $enrolled_courses . " ORDER BY R.reading_id DESC"; $result = mysql_query($sql, $db); if (@mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { $news[] = array('time' => $row['date_end'], 'object' => $row, 'alt' => _AT('reading_list'), 'course' => $system_courses[$row['course_id']]['title'], 'thumb' => 'images/home-reading_list_sm.png', 'link' => '<a href="' . url_rewrite('mods/_standard/reading_list/display_resource.php?id=' . $row['resource_id'], AT_PRETTY_URL_IS_HEADER) . '"' . (strlen($row['title']) > SUBLINK_TEXT_LEN ? ' title="' . $row['title'] . '"' : '') . '>' . validate_length($row['title'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) . '</a>'); } } return $news; }
function tpl_function_qishi_company_show($params, &$smarty) { global $db, $_CFG; $arr = explode(',', $params['set']); foreach ($arr as $str) { $a = explode(':', $str); switch ($a[0]) { case "企业ID": $aset['id'] = $a[1]; break; case "企业介绍长度": $aset['companynamelen'] = $a[1]; break; case "列表名": $aset['listname'] = $a[1]; break; } } $aset = array_map("get_smarty_request", $aset); $aset['id'] = $aset['id'] ? intval($aset['id']) : 0; $aset['listname'] = $aset['listname'] ? $aset['listname'] : "list"; $aset['companynamelen'] = isset($aset['companynamelen']) ? intval($aset['companynamelen']) : 50; $wheresql .= " AND user_status=1 "; $sql = "select * from " . table('company_profile') . " WHERE id='{$aset['id']}' {$wheresql} LIMIT 1"; $profile = $db->getone($sql); if (empty($profile)) { header("HTTP/1.1 404 Not Found"); $smarty->display("404.htm"); exit; } else { $profile['company_url'] = url_rewrite('QS_companyshow', array('id' => $profile['id'])); $profile['company_profile'] = $profile['contents']; $profile['description'] = cut_str(strip_tags($profile['contents']), $aset['companynamelen'], 0, "..."); $deslength = strlen($profile['description']); $conlength = strlen($profile['contents']); if ($deslength < $conlength) { $profile['ishow'] = 1; } if ($profile['website']) { if (strstr($profile['website'], "http://") === false) { $profile['website'] = "http://" . $profile['website']; } } if ($profile['logo']) { $profile['logo'] = $_CFG['main_domain'] . "data/logo/" . $profile['logo']; } else { $profile['logo'] = $_CFG['main_domain'] . "data/logo/no_logo.gif"; } } $smarty->assign($aset['listname'], $profile); }
/** * 根据条件获到评论列表 * 当limit与offset都为0时,表示不行限制 * 当is_attachment为真时,需要查寻评论的图片列表,以及评论会员基本信息 */ public function getSimpleList($limit = 0, $offset = 0, $order_by = '') { if (empty($order_by)) { $order_by = "ca.id desc"; } $where = "c.status=1 and c.has_image=1 and c.delete_flg=0 and c.type='PRODUCT'"; $group = 'c.relation_id'; $comment_list = $this->db->table("Comment as c")->join('Comment_attachment as ca ON ca.cid=c.id', 'LEFT')->where($where)->group($group)->limit($offset . ',' . $limit)->field("c.*,ca.file,ca.width,ca.height,c.relation_id")->select(); foreach ($comment_list as $k => $tmp) { $comment_list[$k]['file'] = getAttachmentUrl($tmp['file']); $comment_list[$k]['ilink'] = url_rewrite('goods:index', array('id' => $tmp['relation_id'])) . "#product_comment_image"; } return $comment_list; }
function get_notice($offset, $perpage, $get_explain_sql = '') { global $db; $row_arr = array(); $limit = " LIMIT " . $offset . ',' . $perpage; $result = $db->query("SELECT n.*,c.categoryname FROM " . table('notice') . " AS n" . $get_explain_sql . $limit); while ($row = $db->fetch_array($result)) { $tit_color = $row['tit_color'] ? "color:" . $row['tit_color'] . ";" : ''; $tit_b = $row['tit_b'] > 0 ? "font-weight:bold;" : ''; $tit_style = $tit_color || $tit_b ? "style=\"" . $tit_color . $tit_b . "\"" : ''; $url = $row['is_url'] == "http://" ? url_rewrite('QS_noticeshow', array('id' => $row['id'])) : $row['is_url']; $row['url_title'] = "<a href=\"" . $url . "\" target=\"_blank\" " . $tit_style . ">" . $row['title'] . "</a> "; $row_arr[] = $row; } return $row_arr; }
/** * 根据优惠券商品 查找对应产品信息列表 * @param $where is string * @param $orderbyfield 排序字段 * @param $orderbymethod 排序方式 ASC DESC * @param $offset * @param $limit * @return array */ public function getSellingCouponProduct($where, $order_by_field, $order_by_method, $offset, $limit) { if (!empty($order_by_field) && !empty($order_by_method)) { $order = $order_by_field . ' ' . strtoupper($order_by_method); } else { //默认排序 $order = 'p.sort DESC, p.product_id DESC'; } $where = $where . " and p.status=1"; $products = $this->db->table("Coupon_to_product as cp")->join('Product as p ON cp.product_id=p.product_id', 'LEFT')->where($where)->order($order)->limit($offset . ',' . $limit)->field("p.*,cp.coupon_id")->select(); foreach ($products as &$tmp) { $tmp['image'] = getAttachmentUrl($tmp['image']); $tmp['link'] = url_rewrite('goods:index', array('id' => $tmp['product_id'])); } return $products; }
/** * @param $where * @param $orderbyfield 排序字段 * @param $orderbymethod 排序方式 ASC DESC * @param $offset * @param $limit * @return array */ public function getbrandList($where, $order_by_field, $order_by_method, $offset, $limit) { if (!empty($order_by_field) && !empty($order_by_method)) { $order = $order_by_field . ' ' . strtoupper($order_by_method); } else { //默认排序 $order = 'order_by asc, brand_id asc'; } $brand = $this->db->where($where)->where($where)->limit($limit)->select(); if (!empty($brand)) { foreach ($brand as &$tmp) { $tmp['pic'] = getAttachmentUrl($tmp['pic']); $tmp['link'] = url_rewrite('store:index', array('id' => $tmp['store_id'])); } } return $brand; }
function tpl_function_qishi_company_news_show($params, &$smarty) { global $db; $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; } } $aset = array_map("get_smarty_request", $aset); $aset['id'] = $aset['id'] ? intval($aset['id']) : 0; $aset['listname'] = $aset['listname'] ? $aset['listname'] : "list"; unset($arr, $str, $a, $params); $sql = "select id,title,content,company_id,addtime from " . table('company_news') . " WHERE id=" . intval($aset['id']) . " LIMIT 1"; $val = $db->getone($sql); if (empty($val)) { header("HTTP/1.1 404 Not Found"); $smarty->display("404.htm"); exit; } $val['keywords'] = $val['title']; $val['description'] = cut_str(strip_tags($val['content']), 60, 0, ""); $prev = $db->getone("select id,title from " . table('company_news') . " where id<" . $val['id'] . " and company_id=" . $val['company_id'] . " and audit=1 order by id desc limit 1"); if (!$prev) { $val['prev'] = 0; } else { $val['prev'] = 1; $val['prev_title'] = $prev['title']; $val['prev_url'] = url_rewrite("QS_companynewsshow", array('id' => $prev['id'])); } $next = $db->getone("select id,title from " . table('company_news') . " where id>" . $val['id'] . " and company_id=" . $val['company_id'] . " and audit=1 order by id desc limit 1"); if (!$next) { $val['next'] = "没有了"; } else { $val['next'] = 1; $val['next_title'] = $next['title']; $val['next_url'] = url_rewrite("QS_companynewsshow", array('id' => $next['id'])); } $smarty->assign($aset['listname'], $val); }
function nearshops($long, $lat, $limit = "") { $limit = $limit ? $limit : '12'; $near_store_list = D('')->table(array('Store_contact' => 'sc', 'Store' => 's'))->field("`s`.`store_id`, `s`.`name`, `s`.`logo`, `s`.`intro`, ROUND(6378.138 * 2 * ASIN(SQRT(POW(SIN(({$lat}*PI()/180-`sc`.`lat`*PI()/180)/2),2)+COS({$lat}*PI()/180)*COS(`sc`.`lat`*PI()/180)*POW(SIN(({$long}*PI()/180-`sc`.`long`*PI()/180)/2),2)))*1000) AS juli")->where("`sc`.`store_id`=`s`.`store_id` AND `s`.`status`='1' ")->order("`juli` ASC")->limit($limit)->select(); foreach ($near_store_list as $key => $value) { $value['url'] = option('config.wap_site_url') . '/home.php?id=' . $value['store_id'] . '&platform=1'; $value['pcurl'] = url_rewrite('store:index', array('id' => $value['store_id'])); if (empty($value['logo'])) { $value['logo'] = getAttachmentUrl('images/default_shop_2.jpg', false); } else { $value['logo'] = getAttachmentUrl($value['logo']); } $near_store_list[$key]['logo'] = $value['logo']; $near_store_list[$key]['url'] = $value['url']; $near_store_list[$key]['pcurl'] = $value['pcurl']; } return $near_store_list; }
function get_report_list($offset, $perpage, $get_sql = '', $type) { global $db; $limit = " LIMIT " . $offset . ',' . $perpage; if ($type == 1) { $result = $db->query("SELECT r.*,m.username FROM " . table('report') . " AS r " . $get_sql . $limit); while ($row = $db->fetch_array($result)) { $row['jobs_url'] = url_rewrite('QS_jobsshow', array('id' => $row['jobs_id']), false); $row_arr[] = $row; } } else { $result = $db->query("SELECT r.*,m.username FROM " . table('report_resume') . " AS r " . $get_sql . $limit); while ($row = $db->fetch_array($result)) { $row['resume_url'] = url_rewrite('QS_resumeshow', array('id' => $row['resume_id']), false); $row_arr[] = $row; } } return $row_arr; }
function get_explain($offset, $perpage, $sql = '') { global $db; $limit = " LIMIT " . $offset . ',' . $perpage; $result = $db->query("SELECT e.*,c.categoryname FROM " . table('explain') . " AS e " . $sql . $limit); while ($row = $db->fetch_array($result)) { $tit_color = $row['tit_color'] ? "color:" . $row['tit_color'] . ";" : ''; $tit_b = $row['tit_b'] > 0 ? "font-weight:bold;" : ''; $tit_style = $tit_color || $tit_b ? "style=\"" . $tit_color . $tit_b . "\"" : ''; if (!empty($row['is_url']) && $row['is_url'] != 'http://') { $row['url'] = $row['is_url']; } else { $row['url'] = url_rewrite('QS_explainshow', array('id' => $row['id'])); } $row['url_title'] = "<a href=\"" . $row['url'] . "\" target=\"_blank\" " . $tit_style . ">" . $row['title'] . "</a> "; $row_arr[] = $row; } return $row_arr; }
function get_additions($sql, $sqlParams, $module, $module_name, $group_id) { global $_base_path; $record_limit = 3; $str = ''; $rows = queryDB($sql, $sqlParams); if (count($rows) > 0) { echo "<h4 class = 'page-title'>" . $module->getName() . "</h4>"; $str .= '<ol id = "tools"><li class = "top-tool">'; foreach ($rows as $row) { switch ($module_name) { case _AT('forums'): $str .= '<a href="' . $_base_path . url_rewrite('mods/_standard/forums/forum/view.php?fid=' . $row[forum_id] . SEP . 'pid=' . $row['post_id']) . '" title="' . AT_print($full_subject, 'forums_threads.subject') . '">' . $row['subject'] . '</a></br>'; break; case _AT('file_storage'): if ($row['description'] != "") { $filetext = $row['description']; } else { $filetext = $row['file_name']; } $str .= '<a href="' . $_base_path . url_rewrite('mods/_standard/file_storage/index.php?download=1' . SEP . 'files[]=' . $row['file_id']) . '"' . (strlen($filetext) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($filetext, 'input.text') . '"' : '') . '>' . AT_print(validate_length($filetext, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'input.text') . '</a><br/>'; break; case _AT('blogs'): $link_title = $row['title']; $str .= '<a href="' . $_base_path . url_rewrite('mods/_standard/blogs/post.php?ot=' . BLOGS_GROUP . SEP . 'oid=' . $group_id . SEP . 'id=' . $row['post_id']) . '"' . (strlen($link_title) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($link_title, 'blog_posts.title') . '"' : '') . '>' . AT_print(validate_length($link_title, SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'blog_posts.title') . '</a><br/>'; break; case _AT('links'): $str .= '<a href="' . $_base_path . url_rewrite('mods/_standard/links/index.php?view=' . $row['link_id']) . '"' . (strlen($row['LinkName']) > SUBLINK_TEXT_LEN ? ' title="' . $row['LinkName'] . '"' : '') . '>' . validate_length($row['LinkName'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) . '</a><br/>'; break; default: return 0; break; } } $str .= "</li></ol>"; echo $str; return 1; } else { return 0; } }
function get_news($offset, $perpage, $sql = '') { global $db; $row_arr = array(); $limit = " LIMIT " . $offset . ',' . $perpage; $result = $db->query("SELECT a.*,c.id as cid,c.categoryname as c_categoryname,p.id as pid,p.categoryname as p_categoryname FROM " . table('article') . " AS a " . $sql . " " . $limit); while ($row = $db->fetch_array($result)) { $tit_color = $row['tit_color'] ? "color:" . $row['tit_color'] . ";" : ''; $tit_b = $row['tit_b'] > 0 ? "font-weight:bold;" : ''; $tit_style = $tit_color || $tit_b ? "style=\"" . $tit_color . $tit_b . "\"" : ''; $Small_img = $row['Small_img'] ? "<span style=\"color:#009900\">(图)</span>" : ''; if (!empty($row['is_url']) && $row['is_url'] != 'http://') { $row['url'] = $row['is_url']; } else { $row['url'] = url_rewrite('QS_newsshow', array('id' => $row['id'])); } $row['url_title'] = "<a href=\"" . $row['url'] . "\" target=\"_blank\" " . $tit_style . ">" . $row['title'] . "</a> " . $Small_img . ""; $row_arr[] = $row; } return $row_arr; }
function tpl_function_qishi_hrtools_category($params, &$smarty) { global $db; $arr = explode(',', $params['set']); foreach ($arr as $str) { $a = explode(':', $str); switch ($a[0]) { case "列表名": $aset['listname'] = $a[1]; break; case "名称长度": $aset['titlelen'] = $a[1]; break; case "填补字符": $aset['dot'] = $a[1]; break; case "分类ID": $aset['ID'] = $a[1]; break; } } if (is_array($aset)) { $aset = array_map("get_smarty_request", $aset); } $aset['listname'] = $aset['listname'] ? $aset['listname'] : "list"; $aset['titlelen'] = $aset['titlelen'] ? intval($aset['titlelen']) : 8; if ($aset['ID']) { $wheresql = " WHERE c_id='" . intval($aset['ID']) . "' "; } $result = $db->query("SELECT c_id,c_name,c_order,c_adminset FROM " . table('hrtools_category') . " " . $wheresql . " ORDER BY c_order DESC,c_id ASC"); while ($row = $db->fetch_array($result)) { $row['url'] = url_rewrite('QS_hrtoolslist', array('id' => $row['c_id'])); $list[] = $row; } $smarty->assign($aset['listname'], $list); }
foreach ($this->activities as $id => $array) { ?> <li class="activity"><?php echo $array['created_date'] . ' - ' . printSocialName($array['member_id']) . ' ' . $array['title']; ?> </li> <?php } ?> </ul> <?php //little hack, show_all will only be displayed when the flag is used. if (sizeof($this->activities) == SOCIAL_FRIEND_ACTIVITIES_MAX) { ?> <a href="<?php echo url_rewrite(AT_SOCIAL_BASENAME . 'activities.php', AT_PRETTY_URL_IS_HEADER); ?> "><?php echo _AT('show_all'); ?> </a> <?php } ?> <?php } else { ?> <?php echo _AT('no_activities'); ?>
<?php if (!defined('AT_INCLUDE_PATH')) { exit; } $polls_limit = 3; //Numero massimo dei possibili sottocontenuti visualizzabili nella home-page $sql = "SELECT poll_id, question FROM %spolls WHERE course_id=%d ORDER BY created_date DESC LIMIT %d"; $rows_polls = queryDB($sql, array(TABLE_PREFIX, $_SESSION['course_id'], $polls_limit)); if (count($rows_polls) > 0) { foreach ($rows_polls as $row) { $list[] = '<a href="' . url_rewrite('mods/_standard/polls/index.php#' . $row['poll_id'], AT_PRETTY_URL_IS_HEADER) . '"' . (strlen($row['question']) > SUBLINK_TEXT_LEN ? ' title="' . AT_print($row['question'], 'polls.question') . '"' : '') . '>' . AT_print(validate_length($row['question'], SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY), 'polls.question') . '</a>'; } return $list; } else { return 0; }
if ($points > 0) { report_deal($_SESSION['uid'], $ptype, $points); $user_points = get_user_points($_SESSION['uid']); $operator = $ptype == "1" ? "+" : "-"; if ($resumeshow['talent'] == '2') { write_memberslog($_SESSION['uid'], 1, 9001, $_SESSION['username'], "下载了 {$ruser['username']} 发布的简历({$operator}{$points}),(剩余:{$user_points})", 1, 1005, "下载高级简历", "{$operator}{$points}", "{$user_points}"); } elseif ($resumeshow['talent'] == '1') { write_memberslog($_SESSION['uid'], 1, 9001, $_SESSION['username'], "下载了 {$ruser['username']} 发布的简历({$operator}{$points}),(剩余:{$user_points})", 1, 1004, "下载普通简历", "{$operator}{$points}", "{$user_points}"); } write_memberslog($_SESSION['uid'], 1, 4001, $_SESSION['username'], "下载了 {$ruser['username']} 发布的简历"); //站内信 if ($pms_notice == '1') { $company = $db->getone("select id,companyname from " . table('company_profile') . " where uid ={$_SESSION['uid']} limit 1"); // $user=$db->getone("select username from ".table('members')." where uid ={$resumeshow['uid']} limit 1"); $resume_url = url_rewrite('QS_resumeshow', array('id' => $id)); $company_url = url_rewrite('QS_companyshow', array('id' => $company['id'])); $message = $_SESSION['username'] . "下载了您发布的简历:<a href=\"{$resume_url}\" target=\"_blank\">{$resumeshow['resume_name']}</a>,<a href=\"{$company_url}\" target=\"_blank\">点击查看公司详情</a>"; write_pmsnotice($resumeshow['uid'], $ruser['username'], $message); } } exit("ok"); } } } function get_resume_basic_one($id) { global $db; $id = intval($id); $info = $db->getone("select * from " . table('resume') . " where id='{$id}' LIMIT 1 "); if (empty($info)) { return false;
function tpl_function_qishi_company_news_list($params, &$smarty) { global $db, $_CFG; $arrset = explode(',', $params['set']); foreach ($arrset as $str) { $a = explode(':', $str); switch ($a[0]) { case "列表名": $aset['listname'] = $a[1]; break; case "企业ID": $aset['company_id'] = $a[1]; break; case "显示数目": $aset['row'] = $a[1]; break; case "标题长度": $aset['titlelen'] = $a[1]; break; case "摘要长度": $aset['infolen'] = $a[1]; break; case "开始位置": $aset['start'] = $a[1]; break; case "填补字符": $aset['dot'] = $a[1]; break; case "排序": $aset['displayorder'] = $a[1]; break; case "分页显示": $aset['paged'] = $a[1]; break; case "页面": $aset['showname'] = $a[1]; break; case "列表页": $aset['listpage'] = $a[1]; break; case "风格模板": $aset['tpl_compnay'] = $a[1]; break; } } if (is_array($aset)) { $aset = array_map("get_smarty_request", $aset); } $aset['listname'] = isset($aset['listname']) ? $aset['listname'] : "list"; $aset['listpage'] = isset($aset['listpage']) ? $aset['listpage'] : "QS_companynews"; $aset['row'] = isset($aset['row']) ? intval($aset['row']) : 30; $aset['start'] = isset($aset['start']) ? intval($aset['start']) : 0; $aset['titlelen'] = isset($aset['titlelen']) ? intval($aset['titlelen']) : 15; $aset['infolen'] = isset($aset['infolen']) ? intval($aset['infolen']) : 0; $aset['showname'] = isset($aset['showname']) ? $aset['showname'] : 'QS_companynewsshow'; if ($aset['displayorder']) { if (strpos($aset['displayorder'], '>')) { $arr = explode('>', $aset['displayorder']); // 排序字段 if ($arr[0] == 'click') { $arr[0] = "click"; } elseif ($arr[0] == "id") { $arr[0] = "id"; } elseif ($arr[0] == "order") { $arr[0] == "order"; } else { $arr[0] == ""; } // 排序方式 if ($arr[1] == 'desc') { $arr[1] = "desc"; } elseif ($arr[1] == "asc") { $arr[1] = "asc"; } else { $arr[1] = ""; } if ($arr[0] && $arr[1]) { $orderbysql = " ORDER BY `" . $arr[0] . "` " . $arr[1]; } if ($arr[0] == "order") { $orderbysql .= " ,id DESC "; } } } $wheresql = " WHERE company_id='" . intval($aset['company_id']) . "' AND audit=1"; if (isset($aset['paged'])) { require_once QISHI_ROOT_PATH . 'include/page.class.php'; $total_sql = "SELECT COUNT(*) AS num FROM " . table('company_news') . $wheresql; $total_count = $db->get_total($total_sql); $pagelist = new page(array('total' => $total_count, 'perpage' => $aset['row'], 'alias' => $aset['listpage'], 'getarray' => $_GET)); $currenpage = $pagelist->nowindex; $aset['start'] = ($currenpage - 1) * $aset['row']; if ($total_count > $aset['row']) { $smarty->assign('page', $pagelist->show(3)); } $smarty->assign('total', $total_count); } $limit = " LIMIT " . abs($aset['start']) . ',' . $aset['row']; $result = $db->query("SELECT id,title,content,addtime,click FROM " . table('company_news') . " " . $wheresql . $orderbysql . $limit); $list = array(); while ($row = $db->fetch_array($result)) { $row['title_'] = $row['title']; $row['title'] = cut_str($row['title'], $aset['titlelen'], 0, $aset['dot']); $row['url'] = url_rewrite($aset['showname'], array('id' => $row['id'], 'style' => $aset['tpl_compnay'])); $row['content'] = str_replace(' ', '', $row['content']); $row['briefly_'] = strip_tags($row['content']); if ($aset['infolen'] > 0) { $row['briefly'] = cut_str(strip_tags($row['content']), $aset['infolen'], 0, $aset['dot']); } $list[] = $row; } $smarty->assign($aset['listname'], $list); }
/* * 74cms 支付响应页面 * ============================================================================ * 版权所有: 骑士网络,并保留所有权利。 * 网站地址: http://www.74cms.com; * ---------------------------------------------------------------------------- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和 * 使用;不允许对程序代码以任何形式任何目的的再发布。 * ============================================================================ */ define('IN_QISHI', true); require_once dirname(__FILE__) . '/../common.inc.php'; require_once QISHI_ROOT_PATH . 'include/mysql.class.php'; $db = new mysql($dbhost, $dbuser, $dbpass, $dbname); $funtype = array('1' => 'include/fun_company.php'); require_once QISHI_ROOT_PATH . $funtype[$_SESSION['utype']]; require_once QISHI_ROOT_PATH . "include/payment/alipay.php"; if (respond()) { $orderurl = array('1' => 'company_service.php?act=order_list'); $link[0]['text'] = "查看订单"; $link[0]['href'] = get_member_url($_SESSION['utype'], true) . $orderurl[$_SESSION['utype']]; $link[1]['text'] = "会员中心"; $link[1]['href'] = url_rewrite('QS_login'); $link[2]['text'] = "网站首页"; $link[2]['href'] = $_CFG['site_dir']; showmsg("付款成功!", 2, $link, false); } else { $link[0]['text'] = "会员中心"; $link[0]['href'] = get_member_url($_SESSION['utype']); showmsg("付款失败!请联系网站管理员", 0, $link); }
$setsqlarr['sdistrict_cn'] = trim($_POST['sdistrict_cn']); $setsqlarr['detailed'] = trim($_POST['detailed']); $setsqlarr['refreshtime'] = time(); $days = intval($_POST['days']); if ($days > 0) { $time = $info['deadline'] > time() ? $info['deadline'] : time(); $setsqlarr['deadline'] = strtotime("{$days} day", $time); } $setsqlarr['likekey'] = $setsqlarr['jobname'] . "," . $setsqlarr['comname'] . "," . $setsqlarr['address'] . "," . $setsqlarr['detailed']; require_once QISHI_ROOT_PATH . 'include/splitword.class.php'; $sp = new SPWord(); $setsqlarr['key'] = $setsqlarr['jobname'] . $setsqlarr['comname'] . $setsqlarr['address'] . $setsqlarr['detailed']; $setsqlarr['key'] = "{$setsqlarr['jobname']} {$setsqlarr['comname']} " . $sp->extracttag($setsqlarr['key']); $setsqlarr['key'] = $sp->pad($setsqlarr['key']); $link[0]['text'] = "返回微招聘列表"; $link[0]['href'] = url_rewrite('QS_simplelist'); if ($db->updatetable(table('simple'), $setsqlarr, " id='{$id}' ")) { if ($_CFG['simple_edit_audit'] > 1) { $str = ",请等待管理员审核"; } showmsg("修改成功{$str}!", 2, $link); } else { showmsg("修改失败!", 0); } } elseif ($act == 'check_tel') { $tel = $_GET['tel']; $id = intval($_GET['id']); if (preg_match("/^\\d*\$/", $tel)) { if ($id > 0) { $wheresql = " AND id<>'{$id}'"; }
$sql = "UPDATE " . TABLE_PREFIX . "tests_results SET status=1, date_taken=date_taken, end_time=NOW() WHERE result_id={$result_id}"; $result = mysql_query($sql, $db); $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY'); if (!$_SESSION['enroll'] && !isset($cid) || $test_row['result_release'] == AT_RELEASE_IMMEDIATE) { header('Location: ' . url_rewrite('mods/_standard/tests/view_results.php?tid=' . $tid . SEP . 'rid=' . $result_id . $cid_url, AT_PRETTY_URL_IS_HEADER)); exit; } if (isset($cid)) { header('Location: ' . url_rewrite('content.php?cid=' . $cid, AT_PRETTY_URL_IS_HEADER)); } else { header('Location: ' . url_rewrite('mods/_standard/tests/my_tests.php', AT_PRETTY_URL_IS_HEADER)); } exit; } // else: header('Location: ' . url_rewrite('mods/_standard/tests/take_test_q.php?tid=' . $tid . SEP . 'pos=' . $pos . SEP . 'efs=' . $_REQUEST['efs'] . $cid_url, AT_PRETTY_URL_IS_HEADER)); exit; } } if (defined('AT_FORCE_GET_FILE') && AT_FORCE_GET_FILE) { $content_base_href = 'get.php/'; } else { $course_base_href = 'content/' . $_SESSION['course_id'] . '/'; } require AT_INCLUDE_PATH . 'header.inc.php'; /* Retrieve the content_id of this test */ $num_questions = $test_row['num_questions']; $content_id = $test_row['content_id']; $anonymous = $test_row['anonymous']; $instructions = $test_row['instructions']; $title = $test_row['title'];