Exemplo n.º 1
0
 function index()
 {
     $pid = $_POST["compareid"];
     //读取所有的床垫的TID
     $mattessTid_t = fetch_array("select id from " . dbtable("product_type") . " where id='2' or upid='2'");
     $mattessType = array();
     foreach ($mattessTid_t as $row) {
         $mattessTid[] = $row["id"];
         $mattessType[$row["tid"]] = $row["tname"];
     }
     $comtype = fetch_array("select * from " . dbtable("product_compare") . " where 1 and status=1 order by  displayorder desc, id asc");
     $data["comtype"] = $comtype;
     foreach ($pid as $row) {
         $res_one = fetch_one_array("select * from " . dbtable("product") . " where id='" . $row . "' ");
         if (in_array($res_one["tid"], $mattessTid)) {
             $resimage = fetch_one_array("select imgurl from " . dbtable("product_img") . " where pid='" . $row . "' and status='1' order by  displayorder limit 1");
             $res_one["compare"] = unserialize($res_one["compare"]);
             $res_one['com_imgurl'] = $resimage['imgurl'];
             $res[] = $res_one;
         }
     }
     $data["mattessType"] = $mattessType;
     $data["reslist"] = $res;
     $this->load->view('compare', $data);
     //dump($res);
 }
Exemplo n.º 2
0
 function index()
 {
     ////面包屑导航
     //        $data['headpagemenu']=array(
     //            0=>array('name'=>'后台','link'=>"admin.php"),
     //            1=>array('name'=>'网站概况','link'=>""),
     //        );
     //        $data['headpagetitle']="网站概况";
     ////左侧菜单
     //        $data['menumod']="index";
     $product_tech = $this->config->item("product_tech");
     $res = array();
     foreach ($product_tech[4] as $key => $row) {
         $list = fetch_array("select p.* from " . dbtable("product_tech") . " t," . dbtable("product") . " p where t.pid=p.id and t.type='{$key}'");
         $res[$key] = $list;
     }
     $data["list"] = $res;
     if (checkmobile()) {
         $this->load->view('mobile/safety', $data);
     } else {
         $data['tech_type'] = "4";
         $data['type_id'] = "4_1";
         $this->load->view('safety', $data);
     }
 }
Exemplo n.º 3
0
 function index()
 {
     $per_page = getgpc("per_page");
     $per_page = $per_page ? $per_page : 0;
     $pnum = 8;
     $list = fetch_array("select * from " . dbtable("englandstyle") . " where 1  and status=1 order by displayorder desc, id desc limit {$per_page},{$pnum}");
     foreach ($list as $key => $row) {
         $res[intval($key / 4)][] = $row;
     }
     $count = fetch_one_array("select count(*) as num from " . dbtable("englandstyle") . " where 1  and status=1");
     $data['total_num'] = $count['num'];
     $data['per_page'] = $per_page + $pnum;
     $data['pnum'] = $pnum;
     $data["reslist"] = $res;
     $this->load->view('englandstyle', $data);
 }
Exemplo n.º 4
0
 function getclass()
 {
     $gradeid = getgpc("gradeid");
     $classid = getgpc("classid");
     $res = fetch_array("select * from " . dbtable("class") . " where upid='" . $gradeid . "'");
     $str = '<option value="0">全部班级</option>';
     foreach ($res as $row) {
         if ($classid == $row['id']) {
             $add = " selected";
         } else {
             $add = "";
         }
         $str .= '<option value="' . $row["id"] . '" ' . $add . '>' . $row["name"] . '</option>';
     }
     echo $str;
 }
Exemplo n.º 5
0
function prize_no($no, $table, $no_sign)
{
    $tmp_year = date("Y");
    // $tmp_year=substr($tmp_year,4);
    // $tmp_month=date("m");
    // $tmp_date=date("d");
    // $rechar2 =$no_sign . $tmp_year . $tmp_month .$tmp_date;
    $rechar2 = $no_sign . $tmp_year;
    $count = fetch_one_array("select count(*) as num from " . dbtable($table) . " where left({$no},6)='{$rechar2}' order by substring({$no},7,5)+0 desc limit 1");
    if ($count['num'] > 0) {
        $sql = "select substring({$no},7,5) as no from " . dbtable($table) . " where left({$no},6)='{$rechar2}' order by substring({$no},7,5)+0 desc limit 1";
        $res = fetch_one_array($sql);
        $no1 = vsprintf("%04s", $res['no'] + 1);
    } else {
        $no1 = "0001";
    }
    $rechar = $rechar2 . $no1;
    return $rechar;
}
Exemplo n.º 6
0
 function update_password()
 {
     $username = getgpc("username");
     $old_password = getgpc("old_password");
     $new_password = getgpc("new_password");
     $new_password1 = getgpc("new_password1");
     $data = array();
     $md5salt = $this->config->item("md5salt");
     if ($username) {
         //
         $res = fetch_one_array("select * from " . dbtable("admin_user") . " where username='******'");
         if (!$res) {
             alert("错误,找不到该用户");
         } elseif ($res["password"] != md5($md5salt . $old_password)) {
             alert("输入旧密码不正确!");
         }
     }
     if (empty($old_password)) {
         alert("请输入旧密码");
     }
     if (empty($new_password)) {
         alert("请输入新密码");
     }
     if (empty($new_password1)) {
         alert("请输入确认密码");
     }
     if ($old_password == $new_password) {
         alert("请输入旧密码与新密码一样");
     }
     if ($new_password != $new_password1) {
         alert("请输入新密码与确认密码不一致");
     } else {
         $updata['password'] = md5($md5salt . $new_password);
         dbupdate("admin_user", $updata, array('username' => $username));
         // echo" <script language='javascript'>this.close();alert('修改密码成功,请记住新密码哟!');</script>";
         alert("修改密码成功,请记住新密码哟!", "admin.php?mod=login");
     }
     // $this->db->update('admin_user', $updata);
 }
Exemplo n.º 7
0
 function chlogin()
 {
     $adminname = getgpc("adminname");
     $adminpwd = getgpc("adminpwd");
     $chres = fetch_one_array("select * from " . dbtable("admin_user") . " where username='******'");
     //dump($chres);
     if ($chres) {
         $md5salt = $this->config->item("md5salt");
         if ($chres["password"] == md5($md5salt . $adminpwd)) {
             //正常登录
             $_SESSION['chadmin'] = 1;
             $_SESSION['admin_id'] = $chres['id'];
             $_SESSION['admin_utype'] = $chres['utype'];
             $_SESSION['admin_username'] = $chres['username'];
             $ip = convertip();
             $updata = array('uid' => $chres['id'], 'username' => $chres['username'], 'time' => date("Y-m-d H:i:s"), 'ip' => $ip['ip'], 'ipaddr' => $ip['addr']);
             $this->db->insert('admin_user_loginlog', $updata);
             alert("登录成功", "admin.php");
             exit;
         }
     }
     alert("账号或者密码错误", "admin.php?mod=login");
 }
Exemplo n.º 8
0
 public function index_url()
 {
     //面包屑导航
     $menuadd = array("name" => "英伦风尚", 'link' => "?mod=englandstyle&act=index_url");
     $data['headpagemenu'] = $this->createmenu($menuadd);
     $data['headpagetitle'] = "英伦风尚";
     //左侧菜单
     $data['menumod'] = "product";
     //
     $addsql = "";
     $keyword = getgpc("keyword");
     if ($keyword) {
         $addsql = " and title like '%" . $keyword . "%'";
     }
     //数据总量
     $count = fetch_one_array("select count(*) as num from " . dbtable("englandstyle_url") . " where 1 {$addsql} and status>=1 ");
     //分页
     $per_page = getgpc("per_page");
     $per_page = $per_page ? $per_page : 0;
     $pnum = 20;
     $this->load->library('pagination');
     $config['base_url'] = 'admin.php?mod=englandstyle&act=index_url&keyword=' . $keyword;
     $config['total_rows'] = $count["num"];
     $config['per_page'] = $pnum;
     $this->pagination->initialize($config);
     $data["page"] = $this->pagination->create_links();
     $list = fetch_array("select *,date_format(gtime,'%Y-%m-%d') as import_date from " . dbtable("englandstyle_url") . " where 1 {$addsql} and status>=1 order by displayorder desc, id desc limit {$per_page},{$pnum} ");
     $data["reslist"] = $list;
     $this->load->view('englandstyle_index_url', $data);
 }
Exemplo n.º 9
0
 function shop_map()
 {
     $id = intval($_GET["id"]);
     $sql = $this->db->query("select * from " . dbtable("shop") . " where id = '" . $id . "'");
     $res = $sql->row_array();
     $data["res"] = $res;
     $this->load->view('store_map', $data);
 }
Exemplo n.º 10
0
					<div class="prev_p"></div>
					<div class="next_p"></div>
				</div>
			</li>
			<li>
				<h4>双海绵边框和海绵边框</h4>
				<p>海绵边框在床垫边缘增强了牢固的支撑,延展了有效睡眠空间,而双海绵边框提供更为牢固的支撑。</p>
				<img src="images/support/pic_support_2.jpg">
				<img src="images/support/pic_support_2_cover.jpg" class="movein_cover">
				<h4>双海绵边框和海绵边框应用产品</h4>
				<div class="re_banner">
					<div class="box">
						<ul class="relative_product">
							<?php 
foreach ($list["1_6"] as $row) {
    $resptrait = fetch_one_array("select * from " . dbtable("product_img") . " where pid='" . $row['id'] . "' and status='1'  order by  istop,displayorder,id limit 1");
    ?>
								<li><a href="index.php?c=product&m=prolist&id=<?php 
    echo $row['id'];
    ?>
"><img src="<?php 
    echo substr($resptrait['imgurl'], 0, 1) == "/" ? "." : "";
    echo $resptrait['imgurl'];
    ?>
"><p><?php 
    echo $row['entitle'];
    ?>
<br><?php 
    echo $row['stitle'];
    ?>
</p></a></li>
Exemplo n.º 11
0
                echo "<TABLE CLASS=\"mail\" BORDER=\"0\" CELLPADDING=\"1\" CELLSPACING=\"1\">\n";
                echo " <TR><TH COLSPAN=3>User Filters for " . $id . "</TH></TR>\n";
                echo " <TR><TH>Filter</TH><TH>Active</TH><TH>Actions</TH></TR>\n";
                if (mysql_num_rows($result) > 0) {
                    while ($row = mysql_fetch_object($result)) {
                        echo " <TR><TD>" . $row->filter . "</TD><TD>" . $row->active . "</TD><TD>" . $row->actions . "</TD></TR>\n";
                    }
                }
                echo " <TR><TD><INPUT TYPE=\"text\" NAME=\"filter\"></TD><TD><SELECT NAME=\"active\"><OPTION VALUE=\"Y\">Yes<OPTION VALUE=\"N\">No</SELECT></TD><TD><INPUT TYPE=\"hidden\" NAME=\"new\" VALUE=\"true\"><INPUT TYPE=\"submit\" VALUE=\"Add\"></TD></TR>\n";
                echo "</TABLE><BR>\n";
                echo "</FORM>\n";
                break;
        }
    }
    $sql = "\nSELECT\n username AS '" . mysql_real_escape_string(__('username12')) . "',\n fullname AS '" . mysql_real_escape_string(__('fullname12')) . "',\n CASE\n  WHEN type = 'A' THEN 'Administrator'\n  WHEN type = 'D' THEN 'Domain Administrator'\n  WHEN type = 'U' THEN 'User'\n  WHEN type = 'R' THEN 'User (Regexp)'\n ELSE\n  'Unknown Type'\n END AS '" . mysql_real_escape_string(__('type12')) . "',\n CASE\n  WHEN noscan = 1 THEN 'N'\n  WHEN noscan = 0 THEN 'Y'\n ELSE\n  'Y'\n END AS '" . mysql_real_escape_string(__('spamcheck12')) . "',\n  spamscore AS '" . mysql_real_escape_string(__('spamscore12')) . "',\n  highspamscore AS '" . mysql_real_escape_string(__('spamhscore12')) . "',\n CONCAT('<a href=\"?action=edit&amp;id=',username,'\">" . mysql_real_escape_string(__('edit12')) . "</a>&nbsp;&nbsp;<a href=\"javascript:delete_user(\\'',username,'\\')\">" . mysql_real_escape_string(__('delete12')) . "</a>&nbsp;&nbsp;<a href=\"?action=filters&amp;id=',username,'\">" . mysql_real_escape_string(__('filters12')) . "</a>') AS '" . mysql_real_escape_string(__('action12')) . "'\nFROM\n users\nORDER BY\n username\n";
    dbtable($sql, __('usermgnt12'));
    echo "<br>\n";
    echo "<a href=\"?action=new\">" . __('newuser12') . "</a>\n";
} else {
    if (!isset($_GET['submit'])) {
        $sql = "SELECT username, fullname, type, quarantine_report, spamscore, highspamscore, noscan, quarantine_rcpt FROM users WHERE username='******'myusername']) . "'";
        $result = dbquery($sql);
        $row = mysql_fetch_object($result);
        $quarantine_report = '';
        if ($row->quarantine_report == 1) {
            $quarantine_report = "CHECKED";
        }
        if ($row->noscan == 0) {
            $noscan = "CHECKED";
        }
        $s[$row->type] = "SELECTED";
Exemplo n.º 12
0
 function get_englandstyle()
 {
     $per_page = getgpc("per_page");
     $pnum = getgpc("pnum");
     $count = fetch_one_array("select count(*) as num from " . dbtable("englandstyle") . " where 1  and status=1");
     $list = fetch_array("select * from " . dbtable("englandstyle") . " where 1  and status=1 order by displayorder desc, id desc limit {$per_page},{$pnum}");
     foreach ($list as $key => $row) {
         $res[intval($key / 4)][] = $row;
     }
     $str = '';
     $span_id = "#like_num_";
     if ($res) {
         foreach ($res as $key => $row) {
             foreach ($row as $trow) {
                 $str .= '<ul>';
                 $str .= '<li>';
                 $str .= '<a onclick="btnlike(' . $trow['id'] . ')"><img src="' . $trow['simgurl'] . '"></a>';
                 $str .= '<a class="title" onclick="btnlike(' . $trow['id'] . ')">' . $trow['title'] . '</a>';
                 $str .= '<p>' . nl2br($trow['intr']) . '</p>';
                 $str .= '<div>';
                 $str .= '<p class="date">' . $trow['showtime'] . '<a  class="btn_like" onclick=like(' . $trow['id'] . ',"' . $span_id . '")" ><span id="like_num_' . $trow["id"] . '">' . $trow['lovenum'] . '</span></a></p>';
                 $str .= '</div>';
                 $str .= '</li>';
                 $str .= '</ul>';
             }
         }
         $next_page = $per_page + $pnum;
         $str .= '<script>';
         $str .= '$("#per_page").val(' . $next_page . ')';
         // $str .='findbranch('.$list[0]["log"].','.$list[0]['lat'].',"'.$list[0]['tname'].'","'.$addr0.'")';
         $str .= '</script>';
     }
     echo $str;
 }
Exemplo n.º 13
0
 public function contentdel()
 {
     //删除
     $id = intval(getgpc("id"));
     $ch = fetch_one_array("select * from " . dbtable("employment_content") . " where id='" . $id . "'");
     if ($ch) {
         $this->db->where('id', $id);
         $this->db->update('employment_content', array('status' => 0));
         alert("删除成功", "");
     }
     alert("删除失败", "");
 }
Exemplo n.º 14
0
 function update()
 {
     //	 	$res1=fetch_one_array("select * from ".dbtable("prize")." where prize_value='5' and tel!='' order by gtime desc limit 1");
     //		$now_date=time();
     //	 	$prize_date=strtotime($res1['gtime']);
     //		$sign1=false;
     //		if($now_date-$prize_date>86400*3)
     //		{
     //			$sign1=true;
     //	 	}
     //	$this_date=date("Y-m-d");
     // 	$prizenum5=fetch_one_array("select count(*) as num from ".dbtable("prize")." where prize_value='4' and tel!='' and prize_date='$this_date'");
     //	$sign5=false;
     // 	if($prizenum5['num']<=20)
     // 	{
     //		$sign5=true;
     // 	}
     $list = fetch_array("select * from " . dbtable("prize") . " where status='0' and prize_no='SL201410000'");
     foreach ($list as $row) {
         $id = $row['id'];
         $prize_no = prize_no("prize_no", "prize", "SL");
         dbupdate("prize", array("prize_no" => $prize_no), "id ='" . $id . "'");
         echo "ID:", $id, "中奖代码:", $prize_no, "<br>";
     }
 }
Exemplo n.º 15
0
 public function areadel()
 {
     //删除
     $id = intval(getgpc("id"));
     $ch = fetch_one_array("select * from " . dbtable("joininfo_area") . " where id='" . $id . "'");
     if ($ch) {
         $this->db->where('id', $id);
         $this->db->update('joininfo_area', array('status' => 0));
         alert("删除成功", "");
     }
     alert("删除失败", "");
 }
Exemplo n.º 16
0
function sel_product($section_value)
{
    $restype = fetch_array("select id from " . dbtable("product_type") . " where upid='2'");
    $type_id = "";
    $where = "";
    foreach ($restype as $key => $row) {
        if ($key != 0) {
            $type_id .= ",";
        }
        $type_id .= "'" . $row['id'] . "'";
    }
    $where .= " tid in ({$type_id}) ";
    $respro = fetch_array("select stitle from " . dbtable("product") . " where " . $where . " and status=1 ");
    $all_pro = array();
    foreach ($respro as $row) {
        $all_pro[] = $row['stitle'];
    }
    $result[0] = array("1" => $all_pro, "2" => array("经典A-B保背健", "经典超级保背健", "经典豪华保背健", "经典呵背", "温度智慧 I 1200", "温度智慧 I 1600", "温度智慧 II 1200", "温度智慧 II 1600", "皇家蓝宝石", "皇家红宝石", "皇家绿宝石", "皇家金钻石", "皇家皇冠", "传家宝", "帝冠"), "3" => array("满天星", "彩虹桥"), "4" => array("经典薄款保背健", "经典保背健", "经典A-B保背健", "经典超级保背健", "经典豪华保背健", "温度智慧 I 1200"));
    $result[1] = array("1" => array("满天星", "彩虹桥"), "2" => array("满天星", "彩虹桥"), "3" => array("经典超级保背健", "经典豪华保背健", "经典呵背", "温度智慧 I 1600", "温度智慧 II 1600", "皇家红宝石", "皇家金钻石"), "4" => array("经典超级保背健", "经典豪华保背健", "经典呵背", "温度智慧 I 1600", "温度智慧 II 1600", "皇家金钻石", "皇家皇冠", "传家宝", "帝冠"), "5" => array("经典A-B保背健", "经典超级保背健", "经典豪华保背健", "温度智慧 I 1200", "温度智慧 II 1200", "皇家蓝宝石", "皇家红宝石", "皇家绿宝石", "皇家皇冠", "帝冠"), "6" => array("经典薄款保背健", "经典保背健", "经典A-B保背健", "温度智慧 I 1200", "温度智慧 II 1200", "皇家蓝宝石", "皇家红宝石", "皇家绿宝石"), "7" => array("经典薄款保背健", "经典保背健", "经典A-B保背健", "温度智慧 I 1200", "温度智慧 II 1200", "皇家蓝宝石", "皇家红宝石", "皇家绿宝石"), "8" => array("经典薄款保背健", "经典保背健", "经典A-B保背健", "温度智慧 I 1200", "温度智慧 II 1200", "皇家蓝宝石", "皇家红宝石", "皇家绿宝石"));
    $result[2] = array("1" => array("经典超级保背健", "经典呵背", "温度智慧 I 1600", "温度智慧 II 1600", "皇家金钻石", "皇家皇冠", "传家宝"), "2" => $all_pro, "3" => $all_pro, "4" => array("经典A-B保背健", "经典豪华保背健", "温度智慧 I 1200", "温度智慧 II 1200", "皇家蓝宝石", "皇家红宝石", "皇家绿宝石", "帝冠"));
    $result[3] = array("1" => array("经典超级保背健", "经典呵背", "温度智慧 I 1600", "温度智慧 II 1600", "皇家金钻石", "传家宝"), "2" => array("温度智慧 II 1600", "皇家金钻石", "传家宝"), "3" => array("经典薄款保背健", "经典保背健", "经典A-B保背健", "温度智慧 I 1200", "温度智慧 II 1200", "皇家蓝宝石", "皇家绿宝石"), "4" => array("经典超级保背健", "经典呵背", "温度智慧 I 1600", "温度智慧 II 1600", "皇家皇冠", "皇家红宝石"), "5" => array("经典A-B保背健", "经典豪华保背健", "温度智慧 I 1200", "温度智慧 II 1200", "皇家红宝石", "帝冠"));
    $result[4] = array("1" => $all_pro, "2" => array("经典豪华保背健", "经典呵背", "温度智慧 I 1600", "温度智慧 II 1600", "皇家金钻石", "皇家皇冠", "传家宝"), "3" => $all_pro, "4" => array("经典呵背", "温度智慧 II 1600", "皇家皇冠", "帝冠"));
    $result[5] = array("1" => array("经典豪华保背健", "经典呵背", "温度智慧 II 1600", "皇家红宝石", "皇家皇冠", "帝冠"), "2" => array("经典A-B保背健", "经典豪华保背健", "温度智慧 II 1200", "皇家蓝宝石", "皇家红宝石", "皇家皇冠"), "3" => array("温度智慧 I 1200", "温度智慧 I 1600", "温度智慧 II 1200", "温度智慧 II 1600"), "4" => array("经典豪华保背健", "经典呵背", "温度智慧 I 1200", "温度智慧 I 1600", "温度智慧 II 1200", "温度智慧 II 1600", "皇家蓝宝石", "皇家红宝石", "皇家绿宝石", "皇家金钻石", "皇家皇冠", "传家宝", "帝冠"), "5" => array("温度智慧 I 1200", "温度智慧 I 1600", "温度智慧 II 1200", "温度智慧 II 1600", "皇家蓝宝石", "皇家红宝石", "皇家绿宝石", "皇家皇冠", "传家宝", "帝冠"));
    $sel_value = explode(",", $section_value);
    // $re_result=$all_pro;
    $re_result = array();
    for ($i = 0; $i < count($sel_value); $i++) {
        $sel_result = $sel_value[$i];
        if ($sel_value[0] == "3" or count($sel_value) > 1 and ($sel_value[1] == "1" or $sel_value[1] == "2")) {
            $re_value = array("status" => 2, "data" => '"满天星","彩虹桥"');
            return $re_value;
        } else {
            $re_result = array_merge($re_result, $result[$i][$sel_result]);
            // $re_result=arr_re($re_result,$result[$i][$sel_result]);
            //				if($result[$i][$sel_result]=="all")
            //				{
            //					$re_value=array(
            //						"status"=>1
            //					);
            //					return $re_value;
            //				}else{
            //				}
        }
    }
    $array1 = array_count_values($re_result);
    $re_sort = arr_sort($array1);
    $re_char = arr_char($re_sort);
    $re_value = array("status" => 2, "data" => $re_char);
    return $re_value;
}
Exemplo n.º 17
0
 function result()
 {
     $section_value = $_POST['section_value'];
     if (empty($section_value)) {
         alert("请选择试题!");
     }
     $re_value = sel_product($section_value);
     $if_value = $re_value['data'];
     if (empty($if_value)) {
         alert("没有找到符合你要求的床垫!");
     }
     $where = "";
     if ($re_value['status'] == "1") {
         $restype = fetch_array("select id from " . dbtable("product_type") . " where upid='2'");
         $type_id = "";
         foreach ($restype as $key => $row) {
             if ($key != 0) {
                 $type_id .= ",";
             }
             $type_id .= "'" . $row['id'] . "'";
         }
         $where .= " p.tid in ({$type_id}) ";
     } else {
         $if_value = $re_value['data'];
         $where .= " p.stitle in ({$if_value})";
     }
     //		$sel_value=explode(",",$section_value);
     //		$pro_name[1]='"经典超级保背健","经典呵背","温度智慧 I 1600","温度智慧 II 1600","皇家皇冠","皇家红宝石"';
     //		$image[1]=array("jdcjbbj.jpg","jdkb.jpg","wdzh1600.jpg","wdzh2600.jpg","hjhg.jpg","hjhbs.jpg");
     //		$pro_name[2]='"经典A-B保背健","经典豪华保背健","温度智慧 I 1200","温度智慧 II 1200","皇家红宝石","帝冠"';
     //		$image[2]=array("jdab.jpg","jdahbbj.jpg","wdzh1200.jpg","wdzh2200.jpg","hjhbs.jpg","dg.jpg");
     //		$pro_name[3]='"经典超级保背健","经典呵背","温度智慧 I 1600","温度智慧 II 1600","皇家金钻石","传家宝"';
     //		$image[3]=array("jdcjbbj.jpg","jdhb.jpg","wdzh1600.jpg","wdzh2600.jpg","hjjzs.jpg","cjb.jpg");
     //		$pro_name[4]='"温度智慧 II 1600","皇家金钻石","传家宝"';
     //		$image[3]=array("wdzh2600.jpg","hjjzs.jpg","cjb.jpg");
     //		$pro_name[5]='"经典薄款保背健","经典保背健","经典A-B保背健","温度智慧 I 1200","温度智慧 II 1200","皇家蓝宝石","皇家绿宝石"';
     //		$image[3]=array("jdpkbbj.jpg","jdbb.jpg","jdab.jpg","wdzh1200.jpg","wdzh2200.jpg","hjlbs.jpg","hjlbs.jpg",);
     ///*
     // * 搜索产品的结果只按第四题目的选择进行产品筛选
     // * 1表示羽毛,2表示棉花,3表示木头,4表示沙滩,5表示草地
     // */
     //		switch($sel_value['3'])
     //		{
     //			case "1":
     //			case "2":
     //			case "3":
     //			case "4":
     //			case "5":
     //				$key=$sel_value[3];
     //			    $res=fetch_array("select p.*,t.tname from ".dbtable("product")." p ,".dbtable("product_type")." t where p.tid=t.id and p.stitle in (".$where.") and p.status=1 order by t.displayorder");
     //				foreach($res as $key=>$row)
     //				{
     //					$pid=$row['id'];
     //					$resimage=fetch_one_array("select imgurl from ".dbtable("product_img")." where pid='".$pid."' and status='1' order by  displayorder limit 1");
     //					$res[$key]['imgurl']=$resimage['imgurl'];
     //				}
     //				$data['res']=$res;
     //			break;
     //		}
     //		$pro_data=array();
     //		$key=0;
     //		for($i=0;$i<count($if_value);$i++)
     //		{
     //			$where ="p.stitle='".$if_value[$i]."'";
     //			$res=fetch_one_array("select p.*,t.tname from ".dbtable("product")." p ,".dbtable("product_type")." t where p.tid=t.id and ".$where." and p.status=1 order by t.displayorder");
     //			if(!empty($res['id']))
     //			{
     //				$pid=$res['id'];
     //				$pro_data[$key]=$res;
     //				$resimage=fetch_one_array("select imgurl from ".dbtable("product_img")." where pid='".$pid."' and status='1' order by  displayorder limit 1");
     //				$pro_data[$key]['imgurl']=$resimage['imgurl'];
     //				$key++;
     //			}
     //		}
     $res = fetch_array("select p.*,t.tname from " . dbtable("product") . " p ," . dbtable("product_type") . " t where p.tid=t.id and (" . $where . ") and p.status=1 order by t.displayorder");
     foreach ($res as $key => $row) {
         $pid = $row['id'];
         $resimage = fetch_one_array("select imgurl from " . dbtable("product_img") . " where pid='" . $pid . "' and status='1' order by  displayorder limit 1");
         $res[$key]['imgurl'] = $resimage['imgurl'];
     }
     $data['res_list'] = $res;
     if (checkmobile()) {
         $this->load->view('mobile/selection_result', $data);
     } else {
         $this->load->view('selection_result', $data);
     }
 }
Exemplo n.º 18
0
 public function iskv()
 {
     //删除
     $id = intval(getgpc("id"));
     $istop_value = intval(getgpc("iskv_value"));
     $ch = fetch_one_array("select * from " . dbtable("news") . " where id='" . $id . "'");
     if ($ch) {
         $this->db->where('id', $id);
         $this->db->update('news', array('iskv' => $istop_value));
         // DB::update("news",array('status'=>0)," id='".$id."'");
         if ($istop_value == "1") {
             $upsql = "update " . dbtable("news") . " set iskv='0' where id!='" . $id . "'";
             $this->db->query($upsql);
             alert("KV显示成功", "");
         } else {
             alert("取消KV显示成功", "");
         }
     }
     alert("操作失败", "");
 }
Exemplo n.º 19
0
 function faq()
 {
     $list = fetch_array("select * from " . dbtable("faq") . " where status=1 and reply_sign='2' order by displayorder desc, id desc ");
     $data["reslist"] = $list;
     if (checkmobile()) {
         $this->load->view('mobile/faq', $data);
     } else {
         $this->load->view('faq', $data);
     }
 }
Exemplo n.º 20
0
 function updateuser()
 {
     $mongo = getMyMongodb();
     $list = fetch_array("select * from " . dbtable("user") . " where 1");
     foreach ($list as $row) {
         //更新用户附加信息表
         $ch = fetch_one_array("select * from " . dbtable("user_info") . " where uid='" . $row['id'] . "'");
         if (!$ch) {
             $indata = array('uid' => $row['id']);
             $this->db->insert('user_info', $indata);
         }
         $ch = fetch_one_array("select * from " . dbtable("user_set") . " where uid='" . $row['id'] . "'");
         if (!$ch) {
             $this->db->insert('user_set', array('uid' => $row['id']));
         }
         /*
                     //更新本班的讨论组
                     $chc=fetch_array("SELECT
                                 s.id AS 'sid',
                                 s.`name` AS 'sname',
                                 g.id AS 'gid',
                                 g.`name` AS 'gname',
                                 c.id AS 'cid',
                                 c.`name` AS 'cname'
                             FROM
                                 isc_school s,
                                 isc_grade g,
                                 isc_class c
                             WHERE
                                 s.id = g.upid
                             AND g.id = c.upid");
                     foreach($chc as $row){
                         $ch=fetch_one_array("select * from ".dbtable("chat_group")." where classid='".$row["cid"]."'");
                         if(!$ch){
                             $indata=array(
                                 'type'=>1,
                                 'title'=>$row['sname'].$row['gname'].$row['cname'],
                                 'pnum'=>0,
                                 'createuid'=>0,
                                 'gtime'=>date("Y-m-d H:i:s"),
                                 'schoolid'=>$row['sid'],
                                 'gradeid'=>$row["gid"],
                                 'classid'=>$row["cid"],
                                 'status'=>1
                             );
                             $this->db->insert('chat_group', $indata) ;
                             $gid=$this->db->insert_id();
                         }else{
                             $gid=$ch["id"];
                         }
                         //将全部的班级成员加入讨论组
                         $ulist=fetch_array("SELECT
                                             u.id,u.user_token
                                             FROM
                                                 isc_user u,
                                                 isc_user_info i,
                                                 isc_child_info c
                                             WHERE
                                             u.id =i.uid and
                                                 c.classid = '".$gid."'
                                             AND(i.uid = c.mid OR i.uid = c.pid)
                                             ORDER BY
                                                 i.uid ASC");
                         foreach($ulist as $u){
                             $ch=fetch_one_array("select * from ".dbtable("chat_group_member")." where gid='".$gid."' and uid='".$u['id']."'");
                             if(!$ch){
                                 $indata_m=array(
                                     'gid'=>$gid,
                                     'uid'=>$u['id'],
                                     'user_token'=>$u['user_token'],
                                     'gtime'=>date("Y-m-d H:i:s"),
                                     'status'=>1
                                 );
                                 $this->db->insert('chat_group_member', $indata_m) ;
         
                                 $this->db->query("update ".dbtable("chat_group")." set pnum=pnum+1 where id='".$gid."'");
                             }
                         }
                     }
                     //*/
         // 更新消息表
         $mongo->insert("userMessages", array("userid" => $row['id'], "user_token" => $row['user_token']));
         //*/
     }
 }
Exemplo n.º 21
0
 *
 * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
 * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
// Include of necessary functions
require_once __DIR__ . '/functions.php';
require_once __DIR__ . '/filter.inc';
// Authentication checking
session_start();
require __DIR__ . '/login.function.php';
// If the user isn't an administrator to send them back to the main page
if ($_SESSION['user_type'] != 'A') {
    header("Location: index.php");
} else {
    // add the header information such as the logo, search, menu, ....
    $filter = html_start("Audit Log", 0, false, true);
    // SQL query for the audit log
    $sql = "\n SELECT\n  DATE_FORMAT(a.timestamp,'" . DATE_FORMAT . " " . TIME_FORMAT . "') AS 'Date/Time',\n  b.fullname AS 'User',\n  a.ip_address AS 'IP Address',\n  a.action AS 'Action'\n FROM\n  audit_log a,\n  users b\n WHERE\n  a.user=b.username\n AND\n  1=1\n" . $filter->CreateMtalogSQL() . "\n ORDER BY timestamp DESC";
    echo '<table border="0" cellpadding="10" cellspacing="0" width="100%">
 <tr><td align="center"><img src="' . IMAGES_DIR . MS_LOGO . '" alt="MailScanner Logo"></td></tr>
 <tr><td>' . "\n";
    // Function to to query and display the data
    dbtable($sql, "Audit Log", true);
    // close off the table
    echo '</td></tr>
      </table>' . "\n";
    // Add footer
    html_end();
    // Close any open db connections
    dbclose();
}
Exemplo n.º 22
0
 function prolist()
 {
     $id = getGP('id');
     $res = fetch_one_array("select p.*,t.tname,t.upid from " . dbtable("product") . " p ," . dbtable("product_type") . " t where p.tid=t.id and p.id='{$id}' and p.status=1 ");
     //读取所有的床垫的TID
     $mattessTid_t = fetch_array("select id from " . dbtable("product_type") . " where id='2' or upid='2'");
     foreach ($mattessTid_t as $row) {
         $mattessTid[] = $row["id"];
     }
     $hardness = $res['hardness'] * 20 - 10;
     $hardness = $hardness < 0 ? 10 : $hardness;
     $data['hardness'] = $hardness;
     $data['res'] = $res;
     $resimage = fetch_array("select * from " . dbtable("product_img") . " where pid='" . $id . "' and status=1 and status='1'");
     $data['resimage'] = $resimage;
     $resptrait = fetch_array("select * from " . dbtable("product_ptrait") . " where pid='" . $id . "'   and status=1 order by  displayorder");
     $data['resptrait'] = $resptrait;
     $ptraitlist = array();
     foreach ($resptrait as $row) {
         $title = $row['title'];
         $ptraitlist[$title] = $row;
     }
     $data['ptraitlist'] = $ptraitlist;
     $tid = $res['tid'];
     $respro_query = $this->db->select('imgurl,title,id,entitle,stitle')->from('web_product')->where("`tid` = '{$tid}' and `id` != '{$id}'")->get();
     $respro = $respro_query->result_array();
     $respro = fetch_array("select * from " . dbtable("product") . " where tid='" . $res['tid'] . "' and status='1' and id not in ({$id}) order by  id");
     foreach ($respro as $key => $row) {
         $pid = $row['id'];
         $resimage = fetch_one_array("select imgurl from " . dbtable("product_img") . " where pid='" . $pid . "' and status='1' order by  displayorder limit 1");
         $respro[$key]['imgurl'] = $resimage['imgurl'];
     }
     $data['prodata'] = $respro;
     $data["mattessTid"] = $mattessTid;
     if (checkmobile()) {
         $indexpushres = fetch_array("select * from " . dbtable("indexpush_type") . "");
         $index_data = array();
         foreach ($indexpushres as $row) {
             $tid = $row['id'];
             $pushres = fetch_array("select * from " . dbtable("indexpush") . " where tid='" . $tid . "' and status='1' and type='2' order by istop desc ,displayorder ");
             $index_data[$tid] = $pushres;
         }
         $data['index_data'] = $index_data;
         $this->load->view('mobile/product_detail', $data);
     } else {
         $indexpushres = fetch_array("select * from " . dbtable("indexpush_type") . "");
         $index_data = array();
         foreach ($indexpushres as $row) {
             $tid = $row['id'];
             $pushres = fetch_array("select * from " . dbtable("indexpush") . " where tid='" . $tid . "' and status='1' and type='1' order by istop desc ,displayorder ");
             $index_data[$tid] = $pushres;
         }
         $data['index_data'] = $index_data;
         //产品类别
         $query_prod_type = $this->db->select('tname,id,upid,displayorder')->from('web_product_type')->order_by('displayorder', 'asc')->get();
         $query_prod = $this->db->select('id,tid,stitle,entitle')->from('web_product')->get();
         $prod_types = $query_prod_type->result_array();
         $prods = $query_prod->result_array();
         foreach ($prod_types as $key => $value) {
             foreach ($prods as $k => $v) {
                 if ($v['tid'] == $value['id']) {
                     $prod_types[$key]['child_1'][] = $prods[$k];
                 }
             }
         }
         $prod_type_list = tree($prod_types, 'upid', 'id');
         $prod_type_list = get_menu($prod_type_list, 'upid', 'id');
         $data['prod_types'] = $prod_type_list;
         $this->load->view('product', $data);
     }
 }
Exemplo n.º 23
0
 You must obey the GNU General Public License in all respects for all of the code used other than those files in the
 PEAR library that are licensed under the PHP License. If you modify this program, you may extend this exception to
 your version of the program, but you are not obligated to do so.
 If you do not wish to do so, delete this exception statement from your version.

 As a special exception, you have permission to link this program with the JpGraph library and
 distribute executables, as long as you follow the requirements of the GNU GPL in regard to all of the software
 in the executable aside from JpGraph.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
require_once './functions.php';
session_start();
include 'login.function.php';
html_start("MySQL Status", 0, false, true);
if ($_SESSION['user_type'] != 'A') {
    echo "Not Authorized";
} else {
    audit_log('Viewed MySQL Status');
    dbtable("SHOW TABLE STATUS");
    echo "<BR>\n";
    dbtable("SHOW FULL PROCESSLIST");
    echo "<BR>\n";
    dbtable("SHOW VARIABLES");
    // Add footer
    html_end();
    // Close any open db connections
    dbclose();
}
Exemplo n.º 24
0
							<?php 
    $sql = "select * from " . dbtable("product_type") . " where upid ='" . $prow['id'] . "' and status=1 order by  displayorder, id asc";
    $query = $this->db->query($sql);
    $num = $query->num_rows();
    if ($num > 0) {
        $typelist = fetch_array($sql);
        foreach ($typelist as $row) {
            ?>
								<div class="type">
									<h5><?php 
            echo $row['tname'];
            ?>
</h5>
									<?php 
            $typeid = $row['id'];
            $res = fetch_array("select * from " . dbtable("product") . " where tid ='" . $typeid . "' and status=1 order by  displayorder");
            ?>
									<ul class="list clearfix">
										<?php 
            foreach ($res as $trow) {
                ?>
										<li><a href="index.php?c=product&m=prolist&id=<?php 
                echo $trow['id'];
                ?>
"><?php 
                echo $trow['stitle'];
                ?>
<br><?php 
                echo $trow['entitle'];
                ?>
</a></li>