?? system_kc.php
字號:
<?php
require(dirname(__FILE__)."/include/config_base.php");
require(dirname(__FILE__)."/include/config_rglobals.php");
require(dirname(__FILE__)."/include/page.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="style/main.css" rel="stylesheet" type="text/css" />
<title><?php echo $cfg_softname;?>系統(tǒng)庫存</title>
<script language = "JavaScript">
var onecount;
onecount = 0;
subcat = new Array();
<?php
$count=0;
$rsql=New Dedesql(false);
$rsql->SetQuery("select * from #@__categories where reid!=0");
$rsql->Execute();
while($rs=$rsql->GetArray()){
?>
subcat[<?php echo $count;?>] = new Array("<?php echo $rs['categories'];?>","<?php echo $rs['reid'];?>","<?php echo $rs['id'];?>");
<?php
$count++;
}
$rsql->close();
?>
onecount=<?php echo $count?>;
function getCity(locationid)
{
document.form1.cp_categories_down.length = 0;
var locationid=locationid;
var i;
document.form1.cp_categories_down.options[0] = new Option('==所選分類的子分類==','');
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.form1.cp_categories_down.options[document.form1.cp_categories_down.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
</head>
<body>
<table width="100%" border="0" id="table_style_all" cellpadding="0" cellspacing="0">
<tr>
<td id="table_style" class="l_t"> </td>
<td> </td>
<td id="table_style" class="r_t"> </td>
</tr>
<tr>
<td> </td>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="2">
<tr>
<td>
<table width="100%" border="0" cellspacing="0">
<tr><form action="system_kc.php?action=seek" name="form1" method="post">
<td>
<strong> 系統(tǒng)庫存管理</strong>
</td>
<td align="right">所在分類:
<?php
if ($action=='seek')
getcategories($cp_categories,$cp_categories_down);
else
getcategories(0,'');
?>
<select name="sort">
<option value="1">按貨號查詢</option>
<option value="2">按條碼查詢</option>
<option value="3" selected>按名稱查詢</option>
<option value="4">按助記詞查詢</option>
</select>
<input type="text" name="stext" size="15" VALUE="<?PHP ECHO $stext ?>"><input type="submit" value="開始檢索">
</td>
</tr></form>
</table>
</td>
</tr>
<form method="post" name="sel">
<tr>
<td bgcolor="#FFFFFF">
<?php
echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" id=\"table_border\">";
if($action=='seek'){
if($cp_categories_down=='')echo "<script>alert('請選擇小分類');history.go(-1);</script>";
switch($sort){
case "1"://按貨號
$query="select * from #@__mainkc,#@__basic where #@__basic.cp_number='$stext' and #@__basic.cp_categories='$cp_categories' and #@__basic.cp_categories_down='$cp_categories_down' and #@__mainkc.p_id=#@__basic.cp_number";
break;
case "2"://按條碼
$query="select * from #@__mainkc,#@__basic where #@__basic.cp_tm='$stext' and #@__basic.cp_categories='$cp_categories' and #@__basic.cp_categories_down='$cp_categories_down' and #@__mainkc.p_id=#@__basic.cp_number";
break;
case "3"://按名稱
$query="select * from #@__mainkc,#@__basic where #@__basic.cp_name LIKE '%".$stext."%' and #@__basic.cp_categories='$cp_categories' and #@__basic.cp_categories_down='$cp_categories_down' and #@__mainkc.p_id=#@__basic.cp_number";
break;
case "4"://按肋記詞
$query="select * from #@__mainkc,#@__basic where #@__basic.cp_helpword LIKE '%".$stext."%' and #@__basic.cp_categories='$cp_categories' and #@__basic.cp_categories_down='$cp_categories_down' and #@__mainkc.p_id=#@__basic.cp_number";
break;
}
}
else
$query="select * from #@__mainkc,#@__basic where #@__mainkc.p_id=#@__basic.cp_number";
//echo $query;
//exit();
$csql=New Dedesql(false);
$dlist = new DataList();
$dlist->pageSize = $cfg_record;
//設(shè)置GET參數(shù)表
if($action=='seek'){
$dlist->SetParameter("action",$action);
$dlist->SetParameter("cp_categories",$cp_categories);
$dlist->SetParameter("cp_categories_down",$cp_categories_down);
$dlist->SetParameter("sort",$sort);
$dlist->SetParameter("stext",$stext);
}
$dlist->SetSource($query);
echo "<tr class='row_color_head'><td>貨號</td><td>名稱</td><td>規(guī)格</td><td>分類</td><td>單位</td><td>進價</td><td>供應(yīng)商</td><td>所在倉庫</td><td>庫存</td><td>選擇</td></tr>";
$mylist = $dlist->GetDataList();
while($row = $mylist->GetArray('dm')){
echo "<tr onMouseMove=\"javascript:this.bgColor='#EBF1F6';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\">\r\n<td>".$row['p_id']."</td><td> ".$row['cp_name']."</td><td>".$row['cp_gg']."</td><td>".get_name($row['cp_categories'],'categories').">".get_name($row['cp_categories_down'],'categories')."</td><td>".get_name($row['cp_dwname'],'dw')."</td><td>¥".$row['cp_jj']."</td><td><a href='' title='查看與該供應(yīng)商的數(shù)據(jù)'>".get_name($row['p_id'],'gys')."</a></td><td><a href='' title='查看此倉庫所有產(chǎn)品'>".get_name($row['l_id'],'lab')."</a></td><td><font color=red>".$row['number']."</font></td><td><a href='system_kc_edit.php?pid=".$row['cp_number']."&lid=".$row['l_id']."&n=".$row['number']."'>修改</a>|<a href='system_kc_del.php?action=del&id=".$row['cp_number']."'>刪除</a><input type='checkbox' name='sel_pro".$row['id']."' value='".$row['id']."'></td>\r\n</tr>";
}
echo "<tr><td colspan='8'> ".$dlist->GetPageList($cfg_record)."</td></tr>";
echo "</table>";
$csql->close();
?>
</td>
</tr></form>
</table>
</td>
<td> </td>
</tr>
<tr>
<td id="table_style" class="l_b"> </td>
<td> </td>
<td id="table_style" class="r_b"> </td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -