<?php

require_once(dirname(dirname(__FILE__)) . '/app.php');
need_manager();

if($_POST){  
    if($_POST['item_number']){
        $item_number = explode(',',$_POST['item_number']);
        $condition['item_number'] = $item_number;
    }
    if($_POST['size']){
        $size = explode(',',$_POST['size']);
        $condition['size'] = $size;
    }
    if($_POST['season']){
        $season = explode(',',$_POST['season']);
        $condition['itemseasonnumber'] = $season;
    }
}

$count = Table::Count('item', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);
$item = DB::LimitQuery('item', array(
	'condition' => $condition,
	'order' => 'ORDER BY id ASC',
	'size' => $pagesize,
	'offset' => $offset,
));
if(count($item)==0){
    Session::Set('error','没有查询到符合条件的产品，请检查查询条件，重新查询！');
}else{
    if($_POST)Session::Set('success','查询完成！');
}

include template('manage_item');?>
