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

📄 indexof_month.php

📁 SetCursor CWnd LoadCursor DestroyWindow CDialog GetClientRect C Button GetStockObject CFont GetWindo
💻 PHP
字号:
<?
require_once("../include/admin_or_user.php"); 
require_once('../include/connection1.php');
require_once('../include/sqlfuns.php'); 
require_once('delete.php'); 
require_once('../include/classes.php');  
 $deptno=3;  
?>
<?
if(isset($_POST['delete']))
   {
     $p=new author("","admin",$deptno); 
     $p->check();
    delete("dept_3",$_POST['select']);
   }
     
if(isset($_POST['modefiy']))
   {
   
    $rs1=modefiy("dept_3",$_POST['select']);
   } 
if(isset($_POST['s1']))
   {
   for($j=1;$j<=$_POST['total'];$j++)
   {
   $sql = sprintf("update dept_3 set name=%s,mount=%s,prise=%s,other_prise=%s,total_prise=%s,descript=%s where id=%s",

	                   GetSQLValueString($_POST['name'.$j], "text"),

                       GetSQLValueString($_POST['mount'.$j], "double"),

                       GetSQLValueString($_POST['prise'.$j], "double"),

					   GetSQLValueString($_POST['other_prise'.$j], "double"),

					    GetSQLValueString(doubleval($_POST['prise'.$j])*

						doubleval($_POST['mount'.$j])+doubleval($_POST['other_prise'.$j]), "double"),

						  GetSQLValueString($_POST['descript'.$j], "text"),

						  GetSQLValueString($_POST['id'.$j], "int"));
 
 //echo $sql;

odbc_exec($conn,$sql);
}
   }

if(!isset($_POST['modefiy']))
{
$today=date("Y")."-".(date("m")*1);
$selectsql = "select * from dept_3 where time like '".$today."%' order by id";
$rs=odbc_exec($conn,$selectsql);
}
?>

<!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" />
<title>无标题文档</title>
<link href="../css/hotel.css" rel="stylesheet" type="text/css" />
</head>
<script>
function comfire()
    { 
	  return window.confirm('确认删除');
	  }
	  
function funk(a)
  {

  if(a.checked)
	 document.form2.selectid.value=parseInt(document.form2.selectid.value)+1;
	  else
	    document.form2.selectid.value=parseInt(document.form2.selectid.value)-1;
	}
 
function sub()
   { if(document.form2.selectid.value==0)
        {
		 alert("请选择");
		 return false;
		}
		else 
		return true;
	}    	  
</script>	  
<body>
<table width="100%" border="1">
    <tr>
      <td><? include("collectdept_top.php"); ?></td>
    </tr>
	<tr>
	<td>
	<? if(!isset($_POST['modefiy'])) {?>
	<p> 今月采购</p>
	<? if(odbc_fetch_row($rs))
	{ 
	?>
	<form action="" method="post" enctype="application/x-www-form-urlencoded" name="form2" id="form2" onsubmit="return sub()">
	<table width="100%" border="1">
	
      <tr>
	  <td width="5%"><div align="center">操作</div></td>
        <td width="13%"><div align="center">名称</div></td>
        <td width="5%"><div align="center">数量</div></td>
        <td width="6%"><div align="center">单价</div></td>
        <td width="8%"><div align="center">其它费用</div></td>
        <td width="6%"><div align="center">总费用</div></td>
        <td width="17%"><div align="center">时间</div></td>
        <td width="">&nbsp;&nbsp;说明</td>
      </tr>
	  <? do { ?>
      <tr>
        <td valign="middle">
          <div align="center">
            <input name="select[]" type="checkbox" id="select[]" value="<? echo odbc_result($rs,'id');?>" onclick="funk(this);"/>  
			
          </div>
		  <script>
        </script>
        </td>
		<td>&nbsp;<? echo odbc_result($rs,'name');?></td>
        <td>&nbsp;<? echo odbc_result($rs,'mount');?></td>
        <td>&nbsp;<span class="redclore">¥</span><? echo odbc_result($rs,'prise');?></td>
        <td>&nbsp;<span class="redclore">¥</span><? echo odbc_result($rs,'other_prise');?></td>
        <td>&nbsp;<span class="redclore">¥</span><? echo odbc_result($rs,'total_prise');?></td>
        <td>&nbsp;<? echo odbc_result($rs,'time');?></td>
        <td>&nbsp;<? echo odbc_result($rs,'descript');?></td>
      </tr>
	  <? }while(odbc_fetch_row($rs));
     echo "</table>";
	 echo "
	 <br \>
	 &nbsp;&nbsp;
	 <input name='modefiy' type='submit' value='修改' />
	 &nbsp;&nbsp;
	 <input name='delete' type='submit' value='删除' onclick='return comfire() ' />
	 <input name='selectid' type='hidden' value='0' />
	 ";
	 echo "</form>";
	 }
	  else 
	   echo "<script> alert('无记录');</script>;";
	   }
	else 
	{
	   
	   ?>
	   <form action="" method="post" enctype="application/x-www-form-urlencoded" name="modey">
	     <table width="100%" border="1" align="center">
           <tr>
             <td width="11%">名称</td>
             <td width="5%">数量</td>
             <td width="10%">单价</td>
             <td width="13%">其它费用</td>
             <td width="64%">备注</td>
           </tr>
          <? 
		  $total=0;
		 
		  while(odbc_fetch_row($rs1)) { 
		  $total++;
		 
		  ?>
           <tr>
             <td><label>
               <input name="name<? echo $total;?>" type="text" id="name<? echo $total;?>" size="13" maxlength="30" value="<? echo odbc_result($rs1,'name');?>" />
             </label></td>
             <td><label>
               <input name="mount<? echo $total;?>" type="text" id="mount<? echo $total;?>" size="6" maxlength="10" value="<? echo odbc_result($rs1,'mount');?>"/>
             </label></td>
             <td><span class="redclore">¥</span>
               <label>
               <input name="prise<? echo $total;?>" type="text" id="prise<? echo $total;?>" size="6" maxlength="10" value="<? echo odbc_result($rs1,'prise');?>" />
             </label></td>
             <td><label>
               <span class="redclore">¥</span>
               <input name="other_prise<? echo $total;?>" type="text" id="other_prise<? echo $total;?>" size="6" maxlength="10" value="<? echo odbc_result($rs1,'other_prise');?>"/>
             </label></td>
             <td><label>
               <input name="descript<? echo $total;?>" type="text" id="descript<? echo $total;?>" value="<? echo odbc_result($rs1,'descript');?>" size="63"/>
             </label></td>
			 <input name="id<? echo $total;?>" type="hidden" value="<? echo odbc_result($rs1,'id');?>" />
           </tr>
		   <? }?>
		    <tr>
             <td colspan="5"><label>
                 
                   <br />  
                     <input name="s1" type="submit" id="s1" value="修改" />   
                     <input type="reset" name="Submit2" value="重置" />
                     <input name="total" type="hidden" id="total" value="<? echo $total;?>" />
                     <br />
                     <div align="center"><a href="indexof_month.php">返回</a></div>
             </label></td>
           </tr>
         </table>
	   </form>
	   <? } ?>
	</td>
</tr>

</table>
  <p \>&nbsp;
 <script src="../copyright.inc">
 </script>
</body>
</html>

⌨️ 快捷键说明

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