Exemplo n.º 1
0
         $SQL_APPEND .= " AND UPPER(CONCAT(`B`.`contents`,`B`.`keyword`)) LIKE ? ";
         $v = substr($v, 1);
     } else {
         $SQL_APPEND .= " OR UPPER(CONCAT(`B`.`contents`,`B`.`keyword`)) LIKE ? ";
     }
     array_push($PA, "%{$v}%");
 }
 $SQL = "\r\n            SELECT `B`.* FROM `ppt` as `A`,`ppt_items` as `B`\r\n              WHERE\r\n                1=1\r\n                AND `A`.`id`=`B`.`ppt_id`\r\n                {$SQL_KIND}\r\n                AND \r\n                (\r\n                  0 = 1\r\n                  {$SQL_APPEND} \r\n                )\r\n                \r\n              ORDER BY \r\n                `B`.`ppt_id` DESC,\r\n                `B`.`id` ASC\r\n        ";
 #pdo
 $SQL_ROWS = "SELECT COUNT(*) AS `COUNTER` FROM ({$SQL}) a";
 $ra_counts = selectSQL_SAFE($SQL_ROWS, $PA);
 $totals_rows = $ra_counts[0]['COUNTER'];
 $SQL .= sprintf(" LIMIT %d,%d", $page * $p, $p);
 $ra = selectSQL_SAFE($SQL, $PA);
 ob_start();
 array_page($totals_rows, $page, $p, $px, $new_Link, $mode = 'normal_ajax', $spandiv = '');
 $thepage = ob_get_contents();
 ob_end_clean();
 $doc = array();
 foreach ($ra as $v) {
     if (!isset($doc[$v['ppt_id']])) {
         $doc[$v['ppt_id']] = array();
     }
     array_push($doc[$v['ppt_id']], $v);
 }
 unset($ra);
 $OUTPUT = array();
 //$OUTPUT['data']=$ra;
 $OUTPUT['Gdata'] = $doc;
 $OUTPUT['page'] = $thepage;
 $OUTPUT['debug'] = $SQL;
Exemplo n.º 2
0
</script>
</head>
<?php 
require "{$base_dir}/template/body.php";
require "{$base_dir}/template/top.php";
?>
<!--start-->
  <h2>簡報維護</h2>  
  <center>
    <form method="GET" action="?">
    搜尋:<input type="text" id="searchcode" name="searchcode" placeholder="請輸入搜尋關鍵字">
    <input type="submit" value="搜尋">
    </form>
  </center>
  <br>
  <center>
  <?php 
echo print_table($ra, "f_id,f_orin_filename,f_title,f_create_datetime,ppt,f_pdf_status,f_png_status,OTHER", "序號,檔名,標題,建檔時間,檔案,PDF,圖檔/文字,其他", "thetable");
?>
  <br>
  <?php 
$SCODE = urlencode($GETS['searchcode']);
array_page($totals_rows, $page, $p, $px, "searchcode={$SCODE}", $mode = 'normal', $spandiv = '');
?>
  </center>
<!--end-->
<?php 
require "{$base_dir}/template/footer.php";
?>
</body>
</html>