⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 productmanage.php

📁 一个PHP的购物系统源代码
💻 PHP
字号:
<?
  include "pfuncs.php";
  session_start();
  //检查是否是授权的管理者
  if(!session_is_registered("manager"))
  {
      Header("HTTP/1.0 401 Unauthorized");
      exit();
  }
  //如果JOB参数为delete,执行删除的操作
  if($job=='delete')
  {
      $connect=mysql_connect("127.0.0.1","root","root");
      mysql_select_db('ebusiness');
      $cmd='delete from Product where ProductID='.$id;
      if($result=mysql_query($cmd));
      $message='成功删除!';
      mysql_close($connect);
  }
?>

<html>
<head>
<title>商品管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.css1{font-family:"宋体"; font-size:9pt; font-style: normal; line-height:normal;
font-weight:normal; color:#000000}
-->
</style>
</head>
<body bgcolor="#ffffff">
<table widht="760" border="0" cellspacing="0" cellpadding="0" class="css1">
  <tr>
    <td width="100"><img src="pic/logo.gif" width="100" height="60"></td>
    <td width="468"><img src="pic/banner.gif" width="469" height="60"
    border="0"></td>
    <td width="192">&nasp;</td>
  </tr>
  <tr>
    <td colspan="2" bgcolor="#66ccff">你现在的位置是:商品管理模式!</td>
    <td width="192">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3" height="24">下表列出了商品Product数据库中的商品
    <?
        echo $message;
        //检查需要的信息是否已输入
        $startpage=$startpage?$startpage:1;
        $productcount=getrownumber();
        $pagesize=10;
        
        if($startpage>$productcount/10)
        {
            $pagesize=thelastnumber($productcount);
        }
        //得到返回值
        $msgs=GetMessages($startpage*10-10,$pagesize);
    ?>
    
     </td>
    </tr>
    <tr>
      <td colspan="3" height="13">
        <table width="700" border="1" cellspacing="2" cellpadding="0" class="css1"
        bordercolorlight="#ccccff" bordercolordark="#6666ff">
          <tr align="center">
          <td width="95" height="12">商品名</td>
          <td width="94" height="12">编号</td>
          <td width="96" height="12">价格</td>
          <td width="95" height="12">颜色</td>
          <td width="95" height="12">规格</td>
          <td width="95" height="12">详细</td>
          <td width="98" height="12">删除</td>
    </tr>
  </tr>
  
<?
  //按格式输出
  for($count=1;$count<=$msgs[0];$count++)
  {
      echo'<tr align="center">';
      echo'<td width="95">'.$msgs[$count]->ProductName.'</td>';
      echo'<td width="94">'.$msgs[$count]->ProductID.'</td>';
      echo'<td width="96">'.$msgs[$count]->Price.'</td>';
      echo'<td width="95">'.$msgs[$count]->Color.'</td>';
      echo'<td width="95">'.$msgs[$count]->Size.'</td>';
      echo'<td width="95"><a href="psdetail.php?id='.$msgs[$count]->ProductID.'" target="blank">详细</a></td>';
      echo'<td width="98"><a href="productmanage.php?job=delete&id='.$msgs[$count]->ProductID.'">删除</a></td>';
      echo'</tr>';
  }
?>
     </table>
    </td>
   </tr>
   <tr>
     <td colspan="3" height="13">
     <?
         //输出页面的选择超链接
         
         if($productcount>10)
         {
             echo'<p>';
             for($i=1;$i<=$productcount/10+1;$i++)
             {
                 echo'&nbsp;&nbsp;<a href=productmanage.php?starpage=';
                 echo $i;
                 echo '>';
                 echo $i;
                 echo '</a>';
             }
             echo'</p>';
         }
     ?>
     </td>
   </tr>
   <tr>
     <td colspan="3" height="13"><a href="addproduct.php">添加薪商品</a></td>
   </tr>
   <tr>
     <td colspan="3" bgcolor="#0000ff">&nbsp;</td>
   </tr>
   
   </table>
   </body>
   </html>
   

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -