<?php

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

if($_POST){
    if(isset($_POST['id']) && !empty($_POST['id'])){
        OFare::modi();
    }else{
        OFare::add();
    }
}



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

include template('manage_fare');?>
