21,886
社区成员
发帖
与我相关
我的任务
分享
<?php
/**
index.php - 首页程序
***********************************************/
require_once "./include/base.php";
require_once "./include/depart.php";
//$treelist=display_tree_frontp($classid);
$index=1;
//======== 取首页切换图 ======================================================
$condition="where speltj=1";
$syqh=array();
$query = $db->query("SELECT * FROM $table_pic where class=1 order by id desc LIMIT 5");
$syqh= array();
$blinknum=$db->num_rows($query);
$tempj=0;
$i = 0;
while($dbq_rec = $db->fetch_array($query))
{
$i++;
$dbq_rec['viewtimes']=$i;
//$dbq_rec['subject']=wordscut($dbq_rec['subject'],20);
//echo $dbq_rec['viewtimes'];
$syqh[]=$dbq_rec;
}
unset($dbq_rec);
//*************取首页显示图******************
$condition="where indextj=1";
$yycp=array();
$query = $db->query("SELECT * from $table_products $condition ORDER BY productid desc LIMIT 9");
$rows=2;
$tempnums=0;
for ($i=0;$i<=$rows;$i++)
{
$productlist=array();
$col=3;
for ($j=1;$j<=$col;$j++)
{
$tempnums++;
//if ($tempnums>($productnum-$start_limit)) $productlist[]=$blink;
//else
//{
$dbq_rec=$db->fetch_array($query);
$dbq_rec['postyear']=date('Y',$dbq_rec['posttime']);
$dbq_rec['postdate']=date('m-d',$dbq_rec['posttime']);
$dbq_rec['posttime']=date('Y-m-d',$dbq_rec['posttime']);
$productlist[]=$dbq_rec;
//}
}
$yycp[]=$productlist;
unset($productlist);
}
//=====================取招聘信息========================================
$query = $db->query("SELECT * FROM $table_documents where class=2 order by id desc LIMIT 5");
$zxzp= array();
$blinknum=$db->num_rows($query);
$tempj=0;
while($dbq_rec = $db->fetch_array($query))
{
$dbq_rec['subject']=wordscut($dbq_rec['subject'],20);
$zxzp[]=$dbq_rec;
}
unset($dbq_rec);
//==============================促销信息==============================
$query = $db->query("SELECT * FROM $table_documents where class=1 order by id desc LIMIT 4");
$hydx= array();
$blinknum=$db->num_rows($query);
$tempj=0;
while($dbq_rec = $db->fetch_array($query))
{
$i++;
$dbq_rec['subject']=wordscut($dbq_rec['subject'],30);
$hydx[]=$dbq_rec;
}
unset($dbq_rec);
include template('index');
?>