wangtengyu
2018-12-07 f459412e0dac4ed94106da043b4c6f8576bfe496
commit | author | age
3e083b 1 <?php
B 2 /**
3  *  商家入驻
4  */
5
6 define('IN_ECS', true);
7
8 require(dirname(__FILE__) . '/includes/init.php');
9
10  assign_template();
11
12 $action  = isset($_REQUEST['act']) ? trim($_REQUEST['act']) : 'default';
13 $smarty->assign('action',     $action);
14
15 if ($action == 'default')
16 {
17     $smarty->display('supplier_reg.dwt');
18 }
19
20 if ($action == 'reg')
21 {
22     /* 检查用户是否已经登录 */
23     if ( $_SESSION['user_id'] == 0)
24     {
25          ecs_header("Location: user.php?back_act=supplier_reg.php?act=reg\n");
26          exit;
27     }
28     
29     $sql = "select supplier_id, status from ". $ecs->table('supplier') ." where user_id='". $_SESSION['user_id'] ."' ";
30     
31     $supplier_row = $db->getRow($sql);
32     if ($supplier_row['supplier_id'])
33     {
34         if ($supplier_row['status'] =='0')
35         {
36             $status = "审核中";
37         }
38         elseif ($supplier_row['status'] =='-1')
39         {
40             $status = "审核未通过";
41         }
42         elseif ($supplier_row['status'] =='1')
43         {
44             $status = '审核已通过!';
45         }
46
47         $smarty->assign('supplier', $supplier_row);
48         $smarty->assign('status', $status);
49     }
50     else
51     {
52         ecs_header("Location: user.php?act=supplier_reg\n");
53         exit;
54     }
55
56     $smarty->display('supplier_reg.dwt');
57 }
58
59
60 ?>