$factory = new Factory($target); $time_start = _get('time_start'); $time_end = _get('time_end'); $type = _get('type'); $sort = _get('sort'); $conds = compact('time_start', 'time_end', 'type', 'sort'); switch ($argument) { case 'stone': $types = $config['st_type']; $account = $factory->stAccount(); break; case 'account': $types = $config['account_type']; $account = $factory->account(); $orders = Order::listOrder(array('factory_id' => $factory->id)); break; default: throw new Exception("arg: {$argument}", 1); break; } $per_page = 50; $total = $account->countHistory($conds); $paging = new Paginate($per_page, $total); $paging->setCurPage(_get('p') ?: 1); $history = $account->history(array_merge($conds, array('limit' => $per_page, 'offset' => $paging->offset()))); $matter = "{$view}.{$argument}"; } else { $matter = $view . ($target ? ".{$target}" : ''); } $view = 'board?master'; $page['scripts'][] = 'jquery.validate.min';
!defined('IN_PTF') && exit('ILLEGAL EXECUTION'); /** * @author ryan <*****@*****.**> */ switch ($target) { case 'gold_price': $time_start = _get('time_start'); $time_end = _get('time_end'); $type = _get('type'); $material_types = $config['material_type_map']; $p = _get('p') ?: 1; $per_page = 50; $total = Price::total($type); $paging = new Paginate($per_page, $total); $paging->setCurPage($p); $prices = Price::history(array('type' => $type, 'limit' => $per_page, 'offset' => $paging->offset())); break; case 'sale': $divide = _get('divide') ?: 'day'; // day or month $format_map = array('day' => 'Y年m月d日', 'month' => 'Y年m月'); $data = Statistics::saleRecord(compact('divide')); $date = new DateTime(); $format = $format_map[$divide]; $date->sub(DateInterval::createFromDateString("1 {$divide}")); $end = $date->format($format); $date->sub(DateInterval::createFromDateString("59 {$divide}")); $start = $date->format($format); break; default:
<?php !defined('IN_PTF') && exit('ILLEGAL EXECUTION'); /** * @file index * @author ryan <*****@*****.**> * @created Jun 27, 2012 6:24:01 PM */ if ($user_type === 'Admin') { redirect('order/all'); } if ($user_type === 'SuperAdmin') { redirect('admin'); } list($name, $no, $stone_size, $type) = _get('name', 'no', 'stone_size', 'type'); $mode = _get('mode') ?: 'list'; $cur_page = _get('p') ?: 1; $page_num_map = array('list' => 10, 'image' => 24); $per_page = $page_num_map[$mode]; $conds = compact('name', 'no', 'stone_size', 'type'); $total = Product::count($conds); $paging = new Paginate($per_page, $total); $paging->setCurPage($cur_page); $products = Product::read(array_merge($conds, array('limit' => $per_page, 'offset' => $paging->offset()))); $chosen_map = SesState::chosenProducts(); $types = Product::types(); $view .= '?master'; $page['scripts'][] = 'widget';