wangtengyu
2018-12-07 f459412e0dac4ed94106da043b4c6f8576bfe496
commit | author | age
3e083b 1 <?php
B 2
3 /**
4  * 店铺的控制器文件
5 */
6
7 define('IN_ECS', true);
8
9
10 require(dirname(__FILE__) . '/includes/init_supplier.php');
11
12 $_GET['suppId'] = intval($_GET['suppId']);
13
14 if($_GET['suppId']<=0){
15     
16     ecs_header("Location: index.php");
17     exit;
18 }
19 $sql="SELECT s.*,sr.rank_name FROM ". $ecs->table("supplier") . " as s left join ". $ecs->table("supplier_rank") ." as sr ON s.rank_id=sr.rank_id
20  WHERE s.supplier_id=".$_GET['suppId']." AND s.status=1";
21 $suppinfo=$db->getRow($sql);
22 if(empty($suppinfo['supplier_id']) || $_GET['suppId'] != $suppinfo['supplier_id'])
23 {
24      ecs_header("Location: index.php");
25      exit;
26 }
27
28 if($_CFG['shop_closed'] == '1'){
29
30     echo "对不起!,此店铺因为".$_CFG['close_comment']."临时关闭!";
31
32     exit;
33 }
34
35 if ((DEBUG_MODE & 2) != 2)
36 {
37     $smarty->caching = true;
38 }
39
40 $typeinfo = array('index','category','search','article','other');
41 $go = (isset($_GET['go']) && !empty($_GET['go'])) ? $_GET['go'] : 'index';
42
43 if(!in_array($go,$typeinfo)){
44     ecs_header("Location: index.php");
45     exit;
46 }else{
47     $index_price = '';
48     if(!empty($GLOBALS['_CFG']['shop_search_price'])){
49         $index_price = array_values(array_filter(explode("\r\n",$GLOBALS['_CFG']['shop_search_price'])));
50     }
51     require(dirname(__FILE__) . '/supplier_'.$go.'.php');
52 }
53
54 ?>