예제 #1
0
파일: jdo.php 프로젝트: xuding/gMIS
     # json, xml, Tue Nov 24 21:31:23 CST 2015
 } else {
     # html
     $navi = new PageNavi();
     $orderfield = $navi->getOrder();
     if ($orderfield == '') {
         $orderfield = $gtbl->getOrderBy();
         $navi->set('isasc', $orderfield == 'id' ? 1 : 0);
     }
     $gtbl->set("pagesize", $navi->get('pnps'));
     $gtbl->set("pagenum", $navi->get('pnpn'));
     $gtbl->set("orderby", $orderfield . " " . ($navi->getAsc() == 0 ? "asc" : "desc"));
     if ($_REQUEST['pntc'] == '' || $_REQUEST['pntc'] == '0' || $navi->get('neednewpntc') == 1) {
         $pagenum = $gtbl->get('pagenum');
         $gtbl->set('pagenum', 1);
         $hm = $gtbl->getBy("count(*) as totalcount", $navi->getCondition($gtbl, $user));
         #print "get pntc:";
         #print_r($hm);
         if ($hm[0]) {
             $hm = $hm[1][0];
             $navi->set('totalcount', $hm['totalcount']);
         }
         $gtbl->set('pagenum', $pagenum);
     }
     # list start
     $listid = array();
     $out .= "<table align=\"center\" width=\"98%\" cellspacing=\"0\" cellpadding=\"0\" style=\"\" class=\"mainlist\"><tr height=\"35px\"><td colspan=\"" . ($hmsize + 2) . "\">";
     $out .= "<button name=\"selectallbtn\" type=\"button\" onclick=\"checkAll();\" value=\"\">全选</button> &nbsp;";
     $out .= "<button name=\"reversebtn\" type=\"button\" onclick=\"uncheckAll();\" value=\"\">反选</button>";
     $out .= "&nbsp; " . $navi->getNavi() . " &nbsp;<button name=\"searchor\" onclick=\"javascript:searchBy('" . $url . "&act=list&pnsm=or');\" title=\"满足其中一个条件即可\">或搜</button>&nbsp;<button name=\"searchand\" href=\"javascript:searchBy('" . $url . "&act=list&pnsm=and');\" title=\"同时满足所有检索条件\">与搜</button> </td></tr>";
     ## list-sort start
예제 #2
0
파일: readfield.php 프로젝트: xuding/gMIS
#require("../class/gtbl.class.php");
#require("../class/pagenavi.class.php");
# read table config, refer to /jdo.php
require "../comm/tblconf.php";
$navi = new PageNavi();
$orderfield = $navi->getOrder();
if ($orderfield == '' && $hasid) {
    $orderfield = $gtbl->getOrderBy();
    $navi->set('isasc', $orderfield == 'id' ? 1 : 0);
}
$gtbl->set("pagesize", 0);
# all records
$gtbl->set("pagenum", $navi->get('pnpn'));
$gtbl->set("orderby", $orderfield . " " . ($navi->getAsc() == 0 ? "asc" : "desc"));
$fieldlist = $_REQUEST['fieldlist'];
$hm = $gtbl->getBy("{$fieldlist}", $navi->getCondition($gtbl, $user));
$tblwidth = "800px";
$intbl = 0;
if ($_REQUEST['mode'] == 'intbl') {
    $tblwidth = "500px";
    $intbl = 1;
}
# view mode
//$out .= "<table align=\"center\" style=\"background:#fff\" width=\"".$tblwidth."\" cellspacing=\"0\" cellpadding=\"0\" border=\"".($intbl==1?"0":"1")."px\">";
$out .= "<table align=\"center\" style=\"background:#fff\" width=\"" . $tblwidth . "\" cellspacing=\"0\" cellpadding=\"0\" class=\"printtbl\">";
if ($hm[0]) {
    $hm = $hm[1];
} else {
    $out .= "No Record.";
    $hm = array();
}