function page_moyo($sql = '') { global $__T_Page_Moyo_HTML; if ($sql == '') { $css = ui('loader')->css('@moyo.pager'); return $css.$__T_Page_Moyo_HTML; } if (isset($_GET[EXPORT_GENEALL_FLAG]) && $_GET[EXPORT_GENEALL_FLAG] == EXPORT_GENEALL_VALUE) { return $sql; } $max = page_moyo_max_selector(); $flag = 'page'; $sql_count = preg_replace('/select.*?from/is', 'sELECt COUNT(1) aS MCNT fROm', $sql); $result = dbc(DBCMax)->query($sql_count)->done(); if (stripos($sql_count, 'group')) { $total = count($result); }else{ $total = $result['0']['MCNT']; } if ($total <= $max) { return $sql; } $pn = isset($_GET[$flag]) ? (int)$_GET[$flag] : (isset($_POST[$flag]) ? $_POST[$flag] : 1); if ($pn <= 0) $pn = 1; $sql = $sql . ' LIMIT '.($pn-1)*$max.','.$max; $url = page_moyo_request_uri($flag); $pa = ceil($total/$max); page_moyo_summary(array('total' => (int)$total, 'perpage' => (int)$max, 'pageall' => (int)$pa, 'pagenow' => (int)$pn)); $pre = ''; if ($pn > 1) { $pre = '<a href="'.$url.'&'.$flag.'='.($pn-1).'"><font class="page_up">上一页</font></a>'; } $nxt = ''; if ($pn < $pa) { $nxt = '<a href="'.$url.'&'.$flag.'='.($pn+1).'"><font class="page_down">下一页</font></a>'; } $pfirst = '<a href="'.$url.' " style="margin-left:0;"><font class="page_first">首页</font></a>'; $plast = '<a href="'.$url.'&'.$flag.'='.$pa.'"><font class="page_last">尾页</font></a>'; $plist = ''; $al = 10; if ($pn - $al/2 <= 0) $pfrom = 1; else $pfrom = $pn - $al/2 + 1; $pend = $pfrom + $al - 1; for ($pi = $pfrom; $pi < $pend; $pi++) { if ($pi > $pa) break; if ($pi != $pn) $plist .= '<a href="'.$url.'&'.$flag.'='.$pi.'"><font class="page_number">'.$pi.'</font></a>'; else $plist .= '<font class="page_current">'.$pi.'</font> '; } $html = $pfirst.''.$pre.''.$plist.''.$nxt.''.$plast; $html .= '<div class="page_count">共 '.$total.' 条记录,分为 '.$pa.' 页,每页 '.page_moyo_max_selector($max).' 条</div>'; $__T_Page_Moyo_HTML = page_moyo_rewrite($html); return $sql; }
function Batch() { $this->CheckAdminPrivs('ordermanage'); $searchWhere = get('ssrc') ? ini('isearcher.map.'.get('ssrc').'.name') : '任意'; $searchValue = get('sstr') ? get('sstr') : '任意'; $ordSTA = get('ordsta', 'number'); is_numeric($ordSTA) || $ordSTA = ORD_STA_ANY; $searchSTA = logic('order')->STA_Name($ordSTA); $ordPROC = get('ordproc', 'string'); $ordSPROC = $ordPROC ? $ordPROC : '*'; $ordPROC = $ordPROC ? ('process="'.$ordPROC.'"') : '1'; $searchPROC = logic('order')->PROC_Name($ordSPROC); $_GET[EXPORT_GENEALL_FLAG] = EXPORT_GENEALL_VALUE; $_GET['code'] = 'vlist'; if(MEMBER_ROLE_TYPE == 'seller'){ $pids = logic('product')->GetUserSellerProduct(MEMBER_ID); $asql = 0; if($pids){ $asql = implode(',',$pids); } $ordPROC .= ' AND productid IN('.$asql.')'; } $list = logic('order')->GetList(0, $ordSTA, ORD_PAID_ANY, $ordPROC); $allCount = $list ? count($list) : 0; $_GET['code'] = 'batch'; $ccURL = str_replace('code=batch', 'code=batch&op=done', page_moyo_request_uri()); include handler('template')->file('@admin/order_process_batch'); }