<script type="text/javascript" src="js/bootstrapValidator.js"></script> </head> <body style="background: #ddd;"> <nav class="navbar navbar-default" role="navigation"> <div class="navbar-header"> <a class="navbar-brand" href="#">胖子 UI 后台管理</a> </div> <div> <ul class="nav navbar-nav pull-right"> <li class="active"><a href="index.php">首页</a></li> <li><a href="setup.php">设置</a></li> <li><a href="content.php">内容</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <?php echo admin_name(); ?> <b class="caret"></b> </a> <ul class="dropdown-menu"> <li><a href="setup.php">修改密码</a></li> <li class="divider"></li> <li><a href="do.php?c=logout">注销</a></li> </ul> </li> </ul> </div> </nav> <div class="row"> <div class="col-md-2" > <div class="leftnav">
/** * 插入管理员日志 * * @params str $info 信息 */ function admin_log($info) { $fields = array(); $fields['ip'] = $_SERVER['REMOTE_ADDR']; $fields['info'] = addslashes(stripslashes($info)); $fields['in_time'] = time(); $fields['admin_id'] = admin_id(); $fields['admin_name'] = addslashes(admin_name()); $fields['admin_username'] = addslashes(admin_username()); $GLOBALS['db']->insert(tname('admin_log'), $fields); }
function order_list() { $filter['status'] = empty($_REQUEST['status']) ? 0 : intval($_REQUEST['status']); $filter['otatus'] = intval($_REQUEST['otatus']); $filter['sdate'] = empty($_REQUEST['sdate']) ? '' : trim($_REQUEST['sdate']); $filter['edate'] = empty($_REQUEST['edate']) ? '' : trim($_REQUEST['edate']); $filter['order_sn'] = empty($_REQUEST['order_sn']) ? '' : trim($_REQUEST['order_sn']); $filter['turn'] = empty($_REQUEST['turn']) ? 0 : intval($_REQUEST['turn']); $filter['station'] = empty($_REQUEST['station']) ? '' : intval($_REQUEST['station']); $filter['route_id'] = empty($_REQUEST['route_s']) ? '' : intval($_REQUEST['route_s']); $filter['page'] = empty($_REQUEST['page']) || intval($_REQUEST['page']) <= 0 ? 1 : intval($_REQUEST['page']); $filter['big_goods'] = intval($_REQUEST['big_goods']); $filter['sort_by'] = empty($_REQUEST['sort_by']) ? 'best_time' : trim($_REQUEST['sort_by']); $filter['sort_order'] = empty($_REQUEST['sort_order']) ? 'ASC' : trim($_REQUEST['sort_order']); $filter['city'] = empty($_REQUEST['city']) ? '' : trim($_REQUEST['city']); $where = " where country " . $GLOBALS['city_code'] . " "; $join = ''; if ($filter['sdate']) { $where .= " and best_time > '" . $filter['sdate'] . "' "; } if ($filter['edate']) { $where .= " and best_time < '" . $filter['edate'] . " 23:30:30' "; } if ($filter['order_sn']) { $where .= " and right(a.order_id,5) ='" . $filter['order_sn'] . "' "; } if ($filter['status'] == 1) { $where .= " and status =0"; } if ($filter['status'] == 2) { $where .= " and status =1"; } if ($filter['otatus'] < 9) { $where .= " and order_status = {$filter['otatus']}"; } if ($filter['turn']) { $where .= " and turn = '" . $filter['turn'] . "' "; } if ($filter['city']) { $where .= " and country = '" . $filter['city'] . "' "; } if ($filter['station'] && $filter['station'] != 100) { $where .= " and s.station_id = '" . $filter['station'] . "' "; } if ($filter['station'] == 100) { $where .= " and c.route_id =0 "; } if ($filter['route_id']) { $where .= " and c.route_id ='" . $filter['route_id'] . "' "; } if ($filter['sort_by'] == 'shipping_station_name') { $orderby = " order by s.station_code desc "; } else { $orderby = " "; } if ($filter['big_goods']) { $join .= " left join ecs_order_goods as g on g.order_id=a.order_id "; $where .= " and g.goods_price > 1000 "; } $size = 20; $sql = "select count(1) " . "from order_genid as a " . "left join ecs_order_info as o on a.order_id=o.order_id " . "left join order_dispatch as c on a.order_id=c.order_id " . "left join ship_route as d on c.route_id=d.route_id " . $join . "left join ship_station as s on d.station_id=s.station_id " . $where; $record_count = $GLOBALS['db_read']->getOne($sql); $page_count = $record_count > 0 ? ceil($record_count / $size) : 1; $sql = "select a.order_id,o.order_sn,o.city,o.address,o.best_time,c.*,d.*,s.station_name,s.station_code " . "from order_genid as a " . "left join ecs_order_info as o on a.order_id=o.order_id " . "left join order_dispatch as c on a.order_id=c.order_id " . "left join ship_route as d on c.route_id=d.route_id " . $join . "left join ship_station as s on d.station_id=s.station_id " . $where . $orderby . " LIMIT " . ($filter['page'] - 1) * $size . ",{$size}"; $res = $GLOBALS['db_read']->GetAll($sql); foreach ($res as $key => $val) { $sql = "select count(1) from ecs_order_goods where goods_price>1000 and order_id=" . $val['order_id']; $res[$key]['big'] = $GLOBALS['db_read']->getOne($sql) ? 1 : 0; $res[$key]['address'] = region_name($val['city']) . ' ' . $val['address']; $res[$key]['i'] = $key + 1; $res[$key]['sname'] = admin_name($val['admin']); } $arr = array('orders' => $res, 'filter' => $filter, 'page_count' => $page_count, 'record_count' => $record_count); return $arr; }