喜悦国际村 
» 游客:  注册 | 登录 | 搜索 | 统计 | 帮助

RSS 订阅当前论坛  

喜悦证交所已经关闭

上一主题 下一主题
     
标题: u_开头的变量是怎能来的啊??  
 
clyde_mz (clyde_mz)
注册会员
Rank: 2
一般会员



UID 34544
精华 0
积分 53
帖子 53
金钱 53 喜悦币
威望 0
人脉 0
阅读权限 20
注册 2004-10-16
状态 离线
u_开头的变量是怎能来的啊??

里面的变量u_开头的我不知道是怎么来的~~~~我现在想在编辑页面里增加几个输入框(成为一个变量插入到新记录中)

但是现在我不知道u_开头的是怎么来的~~~因为编辑页面中的表单对象的name都是m_开头的啊~~~

为什么到传递过去都成了u_开头的

帮我看看啊~~~我急用~~~~先谢谢啦~~~主要部分用红色标注出来了

还有你有没有窗体编辑的教程啊~~就是如何选择某条记录来编辑删除
**********************************这个是主页面**********************

<? Session_start();
//判断是否正常登录
include("valid.php");
//加载配置文件
require("../inc/config.inc");
//加载包含分页函数的文件
require("../inc/db.func");;
if (!isset(
$txtregion)) 
  
$txtregion=$onlineRegionID."%";
if (!isset(
$txtchecked))
  
$txtchecked=0;
?>
<?
//新增客户维护完工数据
if (isset($seltype) && $seltype==1) {
     
$strSQL="Update newmaintainlog Set endFlag=1 Where applyID='$u_ID'";
     
$result=GetRows($ServerName,$databasename,$strSQL,$DBname,$DBpassword);
     
mysql_close();
     if (!
$result) {
        echo 
"<script language='javascript'>alert('客户维护完工记录失败,请重试!')</script>";}
     else {
        
$strSQL="Insert Into maintainlog(netUnitID,maintainDate,maintainType,maintainer,content,applyID) Values('$u_netID','$u_date','$u_type','$u_checked','$u_content','$u_ID')";
        
$result=GetRows($ServerName,$databasename,$strSQL,$DBname,$DBpassword);
        
mysql_close();
        if (!
$result) {
           echo 
"<script language='javascript'>alert('客户维护完工记录失败,请重试!')</script>";
           
$strSQL="Update newmaintainlog Set endFlag=0 Where applyID=$u_ID";
           
$result=GetRows($ServerName,$databasename,$strSQL,$DBname,$DBpassword);
           
mysql_close();}
        else {
           echo 
"<script language='javascript'>alert('客户维护完工记录成功!')</script>";}
     echo 
"<script language='javascript'>document.location.href='$PHP_SELF?Page=".$oPage."'</script>";
     }
//exit;
}


//修改所选数据
if (isset($seltype) && $seltype==2) {
  
$strSQL="UPDATE newmaintainlog SET applyDate='$u_date',applyType='$u_type',failcause='$u_content',shoulier='$onlineName' WHERE applyID=$u_ID";
  
$result=GetRows($ServerName,$databasename,$strSQL,$DBname,$DBpassword);
  
mysql_close();
  if (!
$result)
     echo 
"<script language='javascript'>alert('网吧申请维护记录更新失败,请重试!')</script>";
  else 
     echo 
"<script language='javascript'>alert('网吧申请维护记录更新成功!')</script>";
  echo 
"<script language='javascript'>document.location.href='$PHP_SELF?Page=".$oPage."'</script>";
//exit;
}


//删除所选数据
if (isset($seltype) && $seltype==3) {
  
$strSQL="DELETE FROM newmaintainlog WHERE applyID=$barID";
  
$result=GetRows($ServerName,$databasename,$strSQL,$DBname,$DBpassword);
  
mysql_close();
  if (!
$result)
    echo 
"<script language='javascript'>alert('客户申请维护记录注销失败,请重试!')</script>";
  else 
    echo 
"<script language='javascript'>alert('客户申请维护记录注销成功!')</script>";
echo 
"<script language='javascript'>document.location.href='$PHP_SELF'</script>";
//exit;
}
?>
<?
function ShowOnePage($rows,$No) {
  global 
$pageRecord,$TypeArray,$fieldname;
  echo 
"<TABLE width=100% align=center Border=0  onclick='highLight()' style=\"table-layout:fixed;word-wrap:break-word;word-break:break-all\">";
  echo 
"<TR class=ColHeading>";
  for (
$I=0;$I<count($fieldname);$I++) {
    echo 
"<TD    align=center>$fieldname[$I]</TD>";
  }
  echo 
"</TR>";
  if (
$rows!=0) {
  
mysql_data_seek$rows$No );
  for (
$I=1;$I<=$pageRecord;$I++) {
     if (
$row=mysql_fetch_row($rows)) {
        if (
$I == 0)
           echo 
"<TR class=MouseOutWhite value=".$row[0].">";
        else
           echo 
"<TR class=MouseOutHui value=".$row[0].">";
        for (
$K=0;$K<(count($row));$K++) {
             switch(
$K) {
            case 
1:
              echo 
"<TD Align=center   >".$row[2]."</TD>";
              break;
            case 
8:
              echo 
"<TD Align=center   >".$row[$K]."</TD>";
              break;              
            case 
9:
              echo 
"<TD Align=left>".$row[$K]."</TD>";
              break;
            default:
              echo 
"<TD Align=center   >".$row[$K]."</TD>";
           }
        }
        echo 
"</TR>";
     }
  }
  }
  echo 
"</TABLE>";
mysql_close();
unset(
$repage);
}
?>
<HTML>
<HEAD>
<TITLE>申请维护信息</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<META content=no-cache http-equiv=Pragma>
<LINK href="css/style.css" rel=stylesheet title="主页样式表" type=text/css>
<SCRIPT src="js/functions.js"></SCRIPT>
<?php require_once('js/leftmenu.js'); //左半边菜单教本?>
<script src="js/error.js"></script>
<script src="js/windows.js"></script>
<BODY background="<? echo $netbarPagebackImg?>" leftMargin="0" topMargin="0" align="center" onbeforeunload="ExitWindow()">
<Script Language="javascript">
var h=null
var k=null

function highLight(){
var e=event.srcElement;
if(e.tagName!="TD")return;
e=e.parentElement
k=e.value
if(!k)return;
if(!h)h=e;
h.className='MouseOutWhite ';
h=e;
h.className='MouseOverClick';
}

window.onload= init;
function init()

  var frm = document.forms("form1");
  document.all("txtname").focus();
}

function finish(inputpage) {
  if(!k)return;
  window.showModalDialog("newmaintainend.php?iPage="+inputpage+"&barID="+k,window,"dialogHeight:390px;dialogWidth:380px;scroll:no;status:no;center:yes");
}

function modify(inputpage) {
  if(!k)return;
  window.showModalDialog("newmaintainchange.php?iPage="+inputpage+"&barID="+k,window,"dialogHeight:280px;dialogWidth:380px;scroll:no;status:no;center:yes");
}

function unreg()
{
if(!k)return;
if(window.confirm("确认要注销维护记录吗?")) {
h_type=3;
document.location.href="newmaintain.php?seltype="+h_type+"&barID="+k;

}

function update(h_page,h_type,h_date,h_maintaintype,h_content,h_checked,h_netID,h_ID)
{
   document.location.href="newmaintain.php?oPage="+h_page+"&seltype="+h_type+"&u_netID="+h_netID+"&u_date="+h_date+"&u_type="+h_maintaintype+"&u_content="+h_content+"&u_checked="+h_checked+"&u_ID="+h_ID;
}
</Script>
<?require("../inc/header.inc");?>
<TABLE width="<? echo $pagewidth?>" height="<? echo $pageheight?>" border=0 align=center cellPadding=0 
            cellSpacing=0 bgColor=#ffffff>
  <TBODY>
    <TR>
      <TD width="100%" height=1 align=middle background="images/tdbg.gif"></TD>
    </TR>
    <TR>
      <TD height="16" valign="top" bgColor=#ffffff>
        <TABLE width=<? echo $pagewidth?> height="100%" border=0 align=center cellPadding=0 cellSpacing=0>
          <TBODY>
            <TR>
              <TD width=165 vAlign=top bgColor=#FFFFFF>
                <?require("inc/menu.inc");?></TD>
              <TD width=1 background="images/tdbg1.gif"></TD>
              <TD width="553" align=middle valign="top" bgColor=#FFFFFF><table width="100%"  border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" >
                      <form name="form1" method="post" action="<?echo $PHP_SELF;?>">
                        <tr>
                          <td height="20" colspan="5" > <b>请输入查询条件</b> </td>
                        </tr>
                        <tr>
                          <td height="20" nowrap> <div align="center">客户名称:
                                <input name="txtname" size=10 maxLength=40>
          最近:
          <input name="txtcode" size=5 maxLength=3>
          天&nbsp;&nbsp; 已派单:
          <select name="txtchecked" class="input1" >
              <?
                 $CheckedArray
=array("否","是");
                 for (
$K=0;$K<(count($CheckedArray));$K++)
                   if (
$K==$txtchecked)
                     echo 
"<Option value=".$K." selected>".$CheckedArray[$K]."</Option>";
                   else
                     echo 
"<Option value=".$K.">".$CheckedArray[$K]."</Option>";
                
?>
          </select>
&nbsp;&nbsp;
          <input type="submit" name="search" value="查询" style="WIDTH: 80px; HEIGHT: 20px">
                          </div></td>
                        </tr>
                      </form>
                    </table></td>
                  </tr>
                  <tr>
                    <td><TABLE width=100% border="0" align="center" cellpadding="0" cellspacing="0">
                      <TR valign="top">
                        <TD>
                          <?
  $urlvar
="&txtchecked=$txtchecked";
  
$fieldname=Array("申请单编号","客户名称","联系地址","技术负责","联系方式","申请维护日期","服务项目","问题简述");
  
$strQuery="Select applyID,name,address,applyowner,applytel,applyDate,applyType,applyContent From newmaintainlog,netunit,bar where newmaintainlog.netUnitID=netunit.netUnitID and netunit.netUnitID=bar.netUnitID and endFlag=0 ";
  
$strSort="select maintainID,name from maintaintype";
  
$result=GetRows($ServerName,$databasename,$strSort,$DBname,$DBpassword);
  while (
$row=mysql_fetch_row($result)) {
     for (
$K=0;$K<(count($row));$K++) {
        
$TypeArray[$row[0]]=$row[1];
     }
  }
  
mysql_close();    
  if (isset(
$txtname) && $txtname!="") {
    
$namevalue="%".trim(strval($txtname))."%";
    
$strQuery=$strQuery." and name like '$namevalue'";
  }
  if (isset(
$txtcode) && $txtcode!="") {
    
$codevalue=trim(strval($txtcode));
    
$strQuery=$strQuery." and DATE_ADD(newmaintainlog.applyDate,INTERVAL $codevalue DAY)>=NOW()";
  }
  if (isset(
$txtchecked)) {
     
$strQuery=$strQuery." and checked=$txtchecked";
  }  
  
$strQuery=$strQuery." Order By applyDate DESC";
  
$rows=GetRows($ServerName,$databasename,$strQuery,$DBname,$DBpassword);
  
$num=mysql_num_rows($rows);
  if (
$num==0) {
   
$rows 0;
  }
  
$Pages=intval(($num-1)/$pageRecord)+1;

  if (!isset(
$Page) or $Page<1$Page 1;
  if (
$Page $Pages$Page $Pages;
  if (!empty(
$repage)) {
     
$Page=intval($repage/$pageRecord)+1;
     
ShowOnePage($rows,($Page-1)*$pageRecord);
     }
    else
     
ShowOnePage($rows,($Page-1)*$pageRecord);
?>
                          <?
echo "<TABLE border=0 align=center width =90%>";
echo 
"<TR>";
echo 
"<TD nowrap>页次:<FONT color=#ff0000>$Page/$Pages</FONT>&nbsp;每页$pageRecord &nbsp;总数<FONT color=#ff0000>$num</FONT></TD>";
echo 
"<TD nowrap align='center'>";
if (
$Page<>1)
   echo 
"<A HREF=$PHP_SELF?Page=1$urlvar title=最前页>最前页</A>&nbsp;";
else
   echo 
"最前页&nbsp;";

if (
$Page>1)
   echo 
"<A HREF=$PHP_SELF?Page=".($Page-1)."$urlvar title=上一页>上一页</A>&nbsp;";
else
   echo 
"上一页&nbsp;";

if (
$Page<$Pages)
    echo 
"<A HREF=$PHP_SELF?Page=".($Page+1)."$urlvar title=下一页>下一页</A>&nbsp;";
else
    echo 
"下一页&nbsp;";

if (
$Page<>$Pages)  //   如果不是位于最后一页
   
echo "<A HREF=$PHP_SELF?Page=$Pages$urlvar title=最后页>最后页</A>";
else
   echo 
"最后页&nbsp;";
?></TD>
                        <TD nowrap>
                          <FORM Action="<?echo $PHP_SELF;?>" Method="POST">
                            <Input type="hidden" name="txtregion"  value="<?echo $txtregion;?>">
                            <TABLE border=0 align=right cellpadding=0 cellspacing=0>
                              <TR>
                                <TD> 页次
                                  <Select Name="Page" class="input1" OnChange="javascript:submit()" >
                                      <?
if ($Pages>0) {
   for ( 
$I=1$I<=$Pages$I++ ) {
      if ( 
$I==$Page)
        echo 
"<option value=$I selected>$I</option>";
      else
        echo 
"<option value=$I>$I</option>";
   }
}
?>
                                    </Select>
&nbsp; </TD>
                              </TR>
                            </TABLE>
                        </FORM></TD>
                        <?
switch ($onlineRoleID) {case (3):  echo "<TD nowrap>";
    echo 
"<table border=0 align=right cellpadding=0 cellspacing=0>";
 echo 
"<tr>";
   echo 
"<td nowrap>";
     echo 
"<div align=right>";
            echo 
"<input type='image' onclick='finish($Page)' border='0' name='imageadd' src='images/wangong.gif'>";                
     echo 
"<input type='image' onclick='modify($Page)' border='0' name='imagemodfiy' src='images/edit.gif'>";
     echo 
"<input type='image' onclick='unreg()' border='0' name='imagedelete' src='images/unreg.gif'>";
     echo 
"</div>";
          echo 
"</td>";
       echo 
"</tr>";
    echo 
"</table>";
   echo 
"</TD>";
break;
case (
2):echo "<TD nowrap>";
    echo 
"<table border=0 align=right cellpadding=0 cellspacing=0>";
 echo 
"<tr>";
   echo 
"<td nowrap>";
     echo 
"<div align=right>";
         echo 
"<input type='image' onclick='finish($Page)' border='0' name='imageadd' src='images/wangong.gif'>";
     echo 
"</div>";
          echo 
"</td>";
       echo 
"</tr>";
    echo 
"</table>";
   echo 
"</TD>"
break;
}
?>
                      </TR>
                    </TABLE></td>
                  </tr>
                  <tr>
                    <td>                      <?require("inc/returntop.inc");?>
                    </td>
                  </tr>
              </table></TD>
            </TR>
          </TBODY>
      </TABLE></TD>
    </TR>
  </TBODY>
</TABLE>
</TD>
</TR> </TABLE> 
<?require("../inc/footer.inc");?>




*************这个是编辑页面******************
<?
Session_start
();
include(
"valid.php");
//加载配置文件
require("../inc/config.inc");
//加载包含分页函数的文件
require("../inc/db.func");
if ((isset(
$barID)) && ($barID!="")) {
  
$strSQL="Select newmaintainlog.netUnitID,name,barCode,applyDate,applyType,applyContent,checked,failcause From newmaintainlog,netunit,bar where newmaintainlog.netUnitID=netunit.netUnitID and netunit.netUnitID=bar.netUnitID and applyID=$barID";
  
$result=GetRows($ServerName,$databasename,$strSQL,$DBname,$DBpassword);
  while (
$row=mysql_fetch_row($result)) {
      for (
$K=0;$K<(count($row));$K++) {
         
$ValueArray[$K]=$row[$K];
      }
  }
  
mysql_close();
}
?>
<HTML>
<HEAD>
<TITLE>最新维护归档变更</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<META content=no-cache http-equiv=Pragma>
<LINK href="css/style.css" rel=stylesheet title="主页样式表" type=text/css>
<style type="text/css">
<!--
body {
 background-color: #FFFFFF;
}
-->
</style>
<SCRIPT src="js/functions.js"></SCRIPT>
</HEAD>
<BODY>
<script language="javascript">

function getUpdate()
{
 var newmaintainWindow = dialogArguments;
        if (m_date.value=="") alert("维护日期不能为空!");
        if (m_content.value=="") alert("维护内容不能为空!");
        if (m_date.calue!=""&&m_netID.value!=""&&m_date.value!=""&&m_maintainer.value!="")
 {
    newmaintainWindow.update(hiddenpage.value,"2",m_date.value,m_type.value,m_content.value,m_maintainer.value,m_checked.options[m_checked.selectedIndex].value,m_netID.value,hiddenID.value);
    window.close();
 }
}
</Script>
<br>
  <Input type="hidden" name="hiddenpage"  value="<?echo $iPage;?>">
  <Input type="hidden" name="m_netID" value="<?echo $ValueArray[0];?>">
  <Input type="hidden" name="hiddenID"  value="<?echo $barID;?>">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td>申请单编号</td>
      <td>
        <div align="left">
          <input name="r_name" type="text" class=input1 value="<?echo $barID;?>" size="10" readonly>
      </div></td>
    </tr>
    <tr> 
      <td class="ColHeading">客户名称</td>
      <td> 
        <div align="left"> 
          <input type="text" name="r_name" value="<?echo $ValueArray[1];?>" readonly class=input2>
        </div>
      </td>
    </tr>
    <tr> 
      <td class="ColHeading">客户编号</td>
      <td> 
        <div align="left"> 
          <input type="text" name="r_code" value="<?echo $ValueArray[2];?>" readonly class=input2>
        </div>
      </td>
    </tr>
    <tr>
    <td class="ColHeading">申请维护日期</td>
      <td> 
        <div align="left"> 
          <input type="text" name="m_date" value="<?echo $ValueArray[3];?>" readonly class="input2">
          <button id="btnBorthDateFrom"  onclick="getDateFromDialog(m_date)" class="Button" >...</button> 
        </div>
      </td>
    </tr>
    <tr> 
      <td class="ColHeading"> 所属项目</td>
      <td>
        <div align="left">
          <input name="m_type" type="text" class="input2" value="<?echo $ValueArray[4];?>" readonly> 
    
      </div></td>
    </tr>
    <tr>
      <td >问题简述</td>
      <td>
        <div align="left">
          <textarea name="r_content" readonly class="input2" type="text" alt="问题简述"><?echo $ValueArray[5];?></textarea>
      </div></td>
    </tr>
    <tr> 
      <td >受理信息</td>
      <td> 
        <div align="left"> 
  <textarea name="m_content" wrap="physical" class="input2" id="m_content"  type="text" alt="问题简述"><?echo $ValueArray[7];?></textarea>
        </div>
      </td>
    </tr>
    <tr>
      <td class="ColHeading">是否派单</td>
      <td>
        <div align="left">
          <select name="m_checked" class="input1">
            <?
             $CheckedArray
=array("否","是");
             for (
$K=0;$K<(count($CheckedArray));$K++)
               if (
$K==$ValueArray[6])
                 echo 
"<Option value=".$K." selected>".$CheckedArray[$K]."</Option>";
               else
                 echo 
"<Option value=".$K.">".$CheckedArray[$K]."</Option>";
           
?>
          </select>
      </div></td>
    </tr>
    <tr>
      <td class="ColHeading">受理人</td>
      <td>
        <div align="left">
          <input name="m_maintainer" type="text"class="input1" value="<?echo $onlineName;?>" size="10" alt="维护人">
      </div></td>
    </tr>
    <tr>
      <td colspan="2" class="ColHeading"><table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td>
            <div align="center">
              <input type="image" onclick="getUpdate()" border="0" name="imageUpdate" src="images/confirm.gif">
              <input type="image" onclick="window.close()" border="0" name="imageClose" src="images/close.gif">
          </div></td>
        </tr>
      </table></td>
    </tr>
</table>
</BODY>
</HTML>
2005-1-11 12:44 PM#1
查看资料  访问主页  发短消息  顶部
     


  可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题 | 开通个人空间  


 




Powered by Discuz! 6.1.0  © 2001-2010 Comsenz Inc.
Processed in 0.078603 second(s), 6 queries

(冀ICP备05009913号) 管理员:sadly 邮箱/MSN: sadly@phpx.com QQ:824008(长隐) 清除 Cookies - - Archiver - WAP