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

📄 edit.php

📁 通达OA2007SE源代码 非常好的
💻 PHP
字号:
<?
  include_once 'inc/auth.php';
  echo '
<html>
<head>
<title>车辆使用申请</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
';
  echo '<s';
  echo 'cript Language="JavaScript">
function IsNumber(str)
{
   return str.match(/^[0-9]*$/)!=null;
}
function CheckForm()
{
   if(document.form1.V_ID.value=="")
   { alert("请指车辆!");
     return (false);
   }
   if(document.form1.VU_START.value=="")
   { alert("起始时间不能为空!");
     return (false);
   }
   if (document.form1.VU_MILEAGE.value!=""&&!IsNumber(document.form1.VU';
  echo '_MILEAGE.value))
   { alert("里程应为数字!");
     return (false);
   }
   if(document.form1.VU_OPERATOR.value=="")
   { alert("请指定调度人员!");
     return (false);
   }
   form1.submit();
}
function showDetail()
{
   var tem1 =form1.V_ID.value.indexOf("*");
   var tem2 =form1.V_ID.value.substr(0,tem1);
   var tem3 =form1.V_ID.value.substr(tem1+1); 
   form1.VU_DRIVER.v';
  echo 'alue=tem3;
   document.all("vehicle_detail").src="../show_detail.php?V_ID="+tem2;
}
function LoadWindow(field_id,id,desc)
{
  URL="/ikernel/select?FIELD_ID="+field_id+"&ID="+id+"&DESC="+desc;
  loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;
  loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;
  window.showModalDialog(URL,self,"edge:raised;scroll:0;status:0;he';
  echo 'lp:0;resizable:1;dialogWidth:300px;dialogHeight:250px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
function td_calendar(fieldname)
{
  myleft=document.body.scrollLeft+event.clientX-event.offsetX-80;
  mytop=document.body.scrollTop+event.clientY-event.offsetY+140;
  window.showModalDialog("/inc/calendar.php?FIELDNAME="+fieldname,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;di';
  echo 'alogWidth:280px;dialogHeight:215px;dialogTop:"+mytop+"px;dialogLeft:"+myleft+"px");
}
function td_clock(fieldname)
{
  myleft=document.body.scrollLeft+event.clientX-event.offsetX-80;
  mytop=document.body.scrollTop+event.clientY-event.offsetY+140;
  window.showModalDialog("/inc/clock.php?FIELDNAME="+fieldname,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:280px;dialog';
  echo 'Height:120px;dialogTop:"+mytop+"px;dialogLeft:"+myleft+"px");
}
</script>
</head>
<body class="bodycolor" topmargin="5">
';
  $CUR_TIME = date ('Y-m-d H:i:s', time ());
  if (($VU_ID != ''))
  {
    $query = ((''.'SELECT * from VEHICLE_USAGE  where VU_ID=').$VU_ID);
    $cursor = exequery ($connection, $query);
    if ($ROW = mysql_fetch_array ($cursor))
    {
      $V_ID = $ROW['V_ID'];
      $VU_PROPOSER = $ROW['VU_PROPOSER'];
      $VU_REQUEST_DATE = $ROW['VU_REQUEST_DATE'];
      $VU_USER = $ROW['VU_USER'];
      $VU_REASON = $ROW['VU_REASON'];
      $VU_START = $ROW['VU_START'];
      $VU_END = $ROW['VU_END'];
      $VU_MILEAGE = $ROW['VU_MILEAGE'];
      $VU_DEPT = $ROW['VU_DEPT'];
      $VU_STATUS = $ROW['VU_STATUS'];
      $VU_REMARK = $ROW['VU_REMARK'];
      $VU_DESTINATION = $ROW['VU_DESTINATION'];
      $VU_OPERATOR = $ROW['VU_OPERATOR'];
      $VU_DRIVER = $ROW['VU_DRIVER'];
      if (($VU_START == '0000-00-00 00:00:00'))
      {
        $VU_START = '';
      }
      if (($VU_END == '0000-00-00 00:00:00'))
      {
        $VU_END = '';
      }
    }
  }
  if ((($VU_REQUEST_DATE == '0000-00-00 00:00:00') OR ($VU_REQUEST_DATE == '')))
  {
    $VU_REQUEST_DATE = $CUR_TIME;
  }
  if (($VU_PROPOSER == ''))
  {
    $VU_PROPOSER = $LOGIN_USER_ID;
  }
  $query = (((''.'SELECT * from USER  where USER_ID=\'').$VU_PROPOSER).'\'');
  $cursor = exequery ($connection, $query);
  if ($ROW = mysql_fetch_array ($cursor))
  {
    $VU_PROPOSER_NAME = $ROW['USER_NAME'];
  }
  if (($VU_DEPT != ''))
  {
    $query = ((''.'SELECT * from DEPARTMENT  where DEPT_ID=').$VU_DEPT);
    $cursor = exequery ($connection, $query);
    if ($ROW = mysql_fetch_array ($cursor))
    {
      $VU_DEPT_FIELD_DESC = $ROW['DEPT_NAME'];
    }
  }
  echo '
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
  <tr>
    <td class="Big"><img src="/images/notify_new.gif" HEIGHT="20">';
  echo '<s';
  echo 'pan class="big3"> 车辆使用申请</span>
    </td>
  </tr>
</table>
<table align="center" border="0" width="620" cellpadding="2" cellspacing="1" align="center" bgcolor="#000000" class="small">
<form enctype="multipart/form-data" action="update.php" method="post" name="form1">
    <tr>
      <td nowrap class="TableContent" width="80"> 车 牌 号:</td>
      <td class="TableData" width="230">
        ';
  echo '<s';
  echo 'elect name="V_ID" class="BigSelect" onchange="showDetail();">
';
  $query = 'SELECT * from VEHICLE order by V_NUM';
  $cursor1 = exequery ($connection, $query);
  while ($ROW1 = mysql_fetch_array ($cursor1))
  {
    $V_ID1 = $ROW1['V_ID'];
    $V_NUM = $ROW1['V_NUM'];
    $V_DRIVER = $ROW1['V_DRIVER'];
    echo '          <option value="';
    echo $V_ID1;
    echo '*';
    echo $V_DRIVER;
    echo '" ';
    if (($V_ID == $V_ID1))
    {
      echo 'selected';
    }
    echo '>';
    echo $V_NUM;
    echo '</option>
';
  }
  echo '        </select>
      </td>
      <td nowrap class="TableContent" width="80"> 司  机:</td>
      <td class="TableData" width="230">
        <input type="text" name="VU_DRIVER" size="11" class="BigInput" value="';
  echo $VU_DRIVER;
  echo '"> 
      </td>
    </tr>
    <tr>
      <td nowrap class="TableContent" width="80"> 用 车 人:</td>
      <td class="TableData">
        <input type="text" name="VU_USER" size="20" maxlength="100" class="BigStatic" value="';
  echo $VU_USER;
  echo '" readonly>
      </td>
      <td nowrap class="TableContent" width="80"> 用车部门:</td>
      <td class="TableData">
        <input type="hidden" name="VU_DEPT" value="';
  echo $VU_DEPT;
  echo '">
        <input type="text" name="VU_DEPT_FIELD_DESC" value="';
  echo $VU_DEPT_FIELD_DESC;
  echo '" class=BigStatic size=20 maxlength=100 readonly>
      </td>
    </tr>
    <tr>
      <td nowrap class="TableContent" width="80"> 起始时间:</td>
      <td class="TableData">
        <input type="text" name="VU_START" size="20" maxlength="19" class="BigInput" value="';
  echo $VU_START;
  echo '">
        <img src="/images/menu/calendar.gif" border="0" align="absMiddle" style="cursor:hand" onclick="td_calendar(\'form1.VU_START\');">
        <img src="/images/menu/clock.gif" border="0" align="absMiddle" style="cursor:hand" onclick="td_clock(\'form1.VU_START\');">
      </td>
      <td nowrap class="TableContent" width="80"> 结束时间:</td>
      <td class="TableData">
        <input type="text';
  echo '" name="VU_END" size="20" maxlength="19" class="BigInput" value="';
  echo $VU_END;
  echo '">
        <img src="/images/menu/calendar.gif" border="0" align="absMiddle" style="cursor:hand" onclick="td_calendar(\'form1.VU_END\');">
        <img src="/images/menu/clock.gif" border="0" align="absMiddle" style="cursor:hand" onclick="td_clock(\'form1.VU_END\');">
      </td>
    </tr>
    <tr>
      <td nowrap class="TableContent" width="80"> 目 的 地:</td>
      <td class="TableData">
        <i';
  echo 'nput type="text" name="VU_DESTINATION" size="20" maxlength="100" class="BigInput" value="';
  echo $VU_DESTINATION;
  echo '">
      </td>
      <td nowrap class="TableContent" width="80"> 里  程:</td>
      <td class="TableData">
        <input type="text" name="VU_MILEAGE" size="20" maxlength="14" class="BigInput" value="';
  echo $VU_MILEAGE;
  echo '">
      </td>
    </tr>
    <tr>
      <td nowrap class="TableContent" width="80"> 申 请 人:</td>
      <td class="TableData">
        <input type="text" name="VU_PROPOSER_NAME" size="10" maxlength="100" class="BigStatic" value="';
  echo $VU_PROPOSER_NAME;
  echo '" readonly>
        <input type="hidden" name="VU_PROPOSER" value="';
  echo $VU_PROPOSER;
  echo '">
      </td>
      <td nowrap class="TableContent" width="80"> 调 度 员:</td>
      <td class="TableData">
        ';
  echo '<s';
  echo 'elect name="VU_OPERATOR" class="BigStatic">
';
  $query = (((''.'SELECT * from USER where USER_ID=\'').$VU_OPERATOR).'\'');
  $cursor = exequery ($connection, $query);
  if ($ROW = mysql_fetch_array ($cursor))
  {
    $USER_ID = $ROW['USER_ID'];
    $USER_NAME = $ROW['USER_NAME'];
    echo '          <option value="';
    echo $USER_ID;
    echo '" selected>';
    echo $USER_NAME;
    echo '</option>
';
  }
  echo '        </select> (注:负责审批)
      </td>
    </tr>
    <tr>
      <td nowrap class="TableContent" width="80"> 事  由:</td>
      <td class="TableData" colspan="3">
        <textarea name="VU_REASON" class="BigInput" cols="74" rows="2">';
  echo $VU_REASON;
  echo '</textarea>
      </td>
    </tr>
    <tr>
      <td nowrap class="TableContent" width="80"> 备  注:</td>
      <td class="TableData" colspan="3">
        <textarea name="VU_REMARK" class="BigInput" cols="74" rows="2">';
  echo $VU_REMARK;
  echo '</textarea>
      </td>
    </tr>
    <tr class="TableControl">
      <td nowrap colspan="4" align="center">
        <input type="hidden" value="';
  echo $VU_ID;
  echo '" name="VU_ID">
        <input type="hidden" value="';
  echo $VU_STATUS;
  echo '" name="VU_STATUS">
        <input type="hidden" value="';
  echo $VU_REQUEST_DATE;
  echo '" name="VU_REQUEST_DATE">
        <input type="button" value="保存" class="BigButton" onclick="CheckForm();">&nbsp;&nbsp;
        <input type="reset" value="重填" class="BigButton">&nbsp;&nbsp;
';
  if (($VU_ID != ''))
  {
    echo '        <input type="button" value="返回" class="BigButton" onclick="location=\'query.php?VU_STATUS=';
    echo $VU_STATUS;
    echo '\'">
';
  }
  echo '      </td>
    </tr>
    </table>
</form>
<iframe id="vehicle_detail" width="626" height="200" src="../show_detail.php" frameBorder="0" frameSpacing="0" scrolling="yes" align="center"></iframe>
';
  echo '<s';
  echo 'cript>
   var tem1 =form1.V_ID.value.indexOf("*");
   var tem2 =form1.V_ID.value.substr(0,tem1);
   document.all("vehicle_detail").src="../show_detail.php?V_ID="+tem2;
</script>
</body>
</html>';
?>

⌨️ 快捷键说明

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