Example #1
0
 public static function autoscroll($query, $param, $key, $sort = '', $isloadold = true, $minl = null, $maxl = null)
 {
     setifnn($minl, $param["minl"]);
     setifnn($maxl, $param["maxl"]);
     if ($key != null) {
         if ($isloadold) {
             $querylimit = "select * from (" . gtable($query, false) . ") outpquery where ({$key}<{min} OR {min}=-1) " . ($param["minl"] == -1 ? '' : "limit {minl} ");
         } else {
             $querylimit = "select * from (" . gtable($query, false) . ") outpquery where {$key}>{max} " . ($param["maxl"] == -1 ? '' : "limit {maxl} ");
         }
     } else {
         //max,maxl must be +ve int
         $querylimit = "select * from (" . $query . ") outpquery limit {maxl} offset {max} ";
     }
     if ($key != null) {
         $querysort = "select * from (" . $querylimit . ") sortquery " . $sort;
     } else {
         $querysort = $querylimit;
     }
     $qresult = Sqle::getA($querysort, $param);
     $outp["qresult"] = $qresult;
     $outp["maxl"] = $maxl;
     $outp["minl"] = $minl;
     $outp["qresultlen"] = count($qresult);
     if ($key == null) {
         $outp["max"] = $param["max"] + $param["maxl"];
     } else {
         if (count($qresult) == 0) {
             $outp["min"] = $param["min"];
             $outp["max"] = $param["max"];
         } else {
             $e1 = $qresult[0][$key];
             $e2 = $qresult[count($qresult) - 1][$key];
             $s = new Special();
             $outp["min"] = $s->min($e1, $e2, $param["min"]);
             $outp["max"] = $s->max($e1, $e2, $param["max"]);
         }
     }
     return $outp;
 }
Example #2
0
 public static function strtotime_t3($date, $format = null)
 {
     if ($date == '') {
         return 0;
     }
     setifnn($format, gi("dateformat"));
     $temp = DateTime::createFromFormat($format, $date);
     return strtotime($temp->format("M d Y h:i a"));
 }
Example #3
0
<?php

setifnn($width, count($rows) == 0 ? 0 : count($rows[0]));
setifnn($height, count($rows));
if ($height > 0) {
    ?>
					<table class=" responsive-table">
						<thead>
							<tr>
								<?php 
    for ($i = 0; $i < $width; $i++) {
        ?>
									<th><?php 
        if ($func == null || $func(0, $i) == null) {
            echo convchars(getval($i, getval(0, $rows)));
        }
        ?>
</th>
								<?php 
    }
    ?>
							</tr>
						</thead>
						<tbody>
							<?php 
    for ($j = 1; $j < $height; $j++) {
        ?>
							<tr>
								<?php 
        for ($i = 0; $i < $width; $i++) {
            ?>