Design and implementation code of PHP small business inventory management system_PHP tutorial

WBOY
Release: 2016-07-21 15:29:49
Original
882 people have browsed it

Design and implementation code of PHP small business inventory management system_PHP tutorial

Double major graduation thesis is a small business inventory management system, developed using a combination of PHP & mysql. This is my first time to develop something a little larger, and I also learned PHP by myself. Here I want to share it with you

check_login module

Copy code The code is as follows:


session_start();
$workid=$_GET['wid'];//Get the work ID
if($workid!=$_SESSION['$workid'] ||$workid==''){
echo "







$query="select * from storage where storage_id='$stoid'";//Locate warehouse information
$result =mysql_query($query,$id);
if(mysql_num_rows($result)<1){
echo "No warehouse".$stoid;
}else{
$info=mysql_fetch_array ($result,MYSQL_ASSOC);
echo "Warehouse number:".$stoid." Total capacity: ".$info['storage_cap']." Remaining capacity: ".$info['storage_lcap']."
Warehouse address: ".$info['storage_add']." Warehouse phone number: ".$info['storage_tele'];
if (!mysql_select_db("basicbase",$id)){
die ("Can't select_db : " . mysql_error());
}
//Establish the corresponding warehouse cargo view, inbound view and outbound view in basicbase
//Determine whether there are related views, If not, create a new view
$query="select * from ".$stoid."_inventory";
if(!mysql_query($query,$id)){
//Create inventory view
$query="create view ".$stoid."_inventory as
select inventory.goods_id,name,number from inventory,systembase.goods where storage_id=".$stoid." and inventory.goods_id=systembase.goods. goods_id";
if(!mysql_query($query,$id)){
die ("Can't create_view_inventory : " . mysql_error());
}
//Create input view
$query="create view ".$stoid."_input as
select input_id,goods_id,number,time from input where admin_id=".$workid;
if(!mysql_query($query,$id )){
die ("Can't create_view_input : " . mysql_error());
}
//Create output view
$query="create view ".$stoid."_output as
select output_id,goods_id,number,time from output where admin_id=".$workid;
if(!mysql_query($query,$id)){
die ("Can't create_view_output : " . mysql_error());
}
}
$query="select * from ".$stoid."_inventory";
$result=mysql_query($query,$id);
if(mysql_num_rows($result)<1){
echo "
The warehouse is currently empty";
}else{
$totalnum=mysql_num_rows($result);
$pagesize=7;
$page=$_GET["page"];
if(""==$page){
$page=1;
}
$begin= ($page-1)*$pagesize;
$totalpage=ceil($totalnum/$pagesize);

echo "There are ".$totalnum." kinds of goods in the warehouse. ";
echo "Each page".$pagesize." type, total ".$totalpage." pages. ";
for($j=1;$j<=$totalpage;$j++){
echo "[".$j."] ";
}
echo "
";
$query="select *from ".$stoid."_inventory order by goods_id limit $begin,$pagesize";
$result=mysql_query($query,$id);
$datanum=mysql_num_rows($result);
// echo "";
echo "";
echo "";
}

}
}
mysql_close($id);
?>
goods idgoods namegoods quantity
goods idgoods namegoods quantity";
for($i=1;$i<=$datanum;$i++){
$info=mysql_fetch_array($result,MYSQL_ASSOC);
//echo "
".$info['goods_id']."".$info['name']."".$info['number']."
".$ info['goods_id']."".$info['name']."".$info['number']."







There are too many codes to post one by one. I encountered many problems when writing it for the first time, but the program still ran anyway

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/323335.htmlTechArticleDual major graduation thesis made a small business inventory management system, using PHPlt;!--User login inspection module- - ?php session_start(); $workid=$_GET['wid'];//Get the work ID if($workid!...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!