list.php
资源名称:minierp.rar [点击查看]
上传用户:yantgcom
上传日期:2013-07-19
资源大小:478k
文件大小:1k
源码类别:
MySQL数据库
开发平台:
PHP
- <?php
- include ("../inc/db.php");
- include ("../inc/phpmkrfn.php");
- include ('../inc/xtpl.php');
- include ("../inc/pageft.php");
- $t_LEI=$_GET[LEI];
- if(empty($t_LEI)){$t_WHERE="";}else
- {$t_WHERE="WHERE PROD02='$t_LEI'";}
- $xtpl=new XTemplate ("listview.html");
- $m_tablename="kuchen";
- $conn = phpmkr_db_connect(HOST, USER, PASS, DB, PORT);
- //总页数
- $sSql ="select $m_tablename.AUTOID ,PROD02 from kuchen LEFT JOIN products ON kuchen.KUC01 = products.ID $t_WHERE group by kuchen.KUC01";
- $result=phpmkr_query($sSql,$conn) or die("Failed to execute query: " . phpmkr_error() . '<br>SQL: ' . $sSql);
- $total=phpmkr_num_rows($result);
- //调用pageft(),每页显示10条信息(使用默认的20时,可以省略此参数),使用本页URL(默认,所以省略掉)。
- pageft($total,15);
- $sSql ="select kuchen.*,ID,SUM(KUC02) AS KUCTOL,PROD01,PROD02,PROD04,PROD05 from kuchen LEFT JOIN products ON kuchen.KUC01 = products.ID $t_WHERE group by kuchen.KUC01 limit $firstcount,$displaypg";
- $rs = phpmkr_query($sSql,$conn) or die("Failed to execute query: " . phpmkr_error() . '<br>SQL: ' . $sSql);
- while ($row = mysql_fetch_array($rs, MYSQL_ASSOC)) {
- $xtpl->assign("DATA",$row); /* assign array data */
- $xtpl->parse("main.table.row"); /* parse a row */
- }
- $xtpl->parse("main.table"); /* parse the table */
- $xtpl->assign("PAGEINFO",$pagenav); //分页
- $xtpl->parse("main");
- $xtpl->out("main");
- ?>