index.php

来自「通达OA2007SE源代码 非常好的」· PHP 代码 · 共 435 行

PHP
435
字号
<?
  function getalldate ($CODE, $GETVALUE)
  {
    global $connection;
    $query = (((''.'SELECT * from SYS_CODE where PARENT_NO=\'').$CODE).'\'');
    $cursor = exequery ($connection, $query);
    while ($ROW = mysql_fetch_array ($cursor))
    {
      $CODE_NO = $ROW['CODE_NO'];
      $CODE_NAME = $ROW['CODE_NAME'];
      if (($CODE_NO == $GETVALUE))
      {
        echo (((('<option value='.$CODE_NO).'  selected>').$CODE_NAME).'</option>');
        continue;
      }
      else
      {
        echo (((('<option value='.$CODE_NO).' >').$CODE_NAME).'</option>');
        continue;
      }
    }
  }
  include_once 'inc/auth.php';
  include_once 'inc/utility_all.php';
  echo '<html>
<head>
<title>新建合同</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
';
  echo '<s';
  echo 'cript Language="JavaScript">
function delete_attach(ATTACHMENT_ID,ATTACHMENT_NAME)
{
  msg="确定要删除文件 \'"+ ATTACHMENT_NAME +"\' 吗?";
  if(window.confirm(msg))
  {
    URL="delete_attach.php?CONTRACT_ID=';
  echo $CONTRACT_ID;
  echo '&ATTACHMENT_ID="+ATTACHMENT_ID+"&ATTACHMENT_NAME="+ATTACHMENT_NAME;
    window.location=URL;
  }
}
function upload_attach()
{
  if (document.form1.ATTACHMENT.value=="")
      return;
  if(CheckForm())
  {
   document.form1.OP.value="1";
   document.form1.submit();
  }
}
function CheckForm()
{
  if(document.form1.CONTRACT_NAME.value=="")
  { 
  	 alert("合同名称不能为空!");
    ';
  echo ' return (false);
  }
  if(document.form1.BEGIN_DATE.value=="")
  { 
  	 alert("生效日期不能为空!");
     return (false);
  }
  if(document.form1.END_DATE.value=="")
  {  
  	 alert("终止日期不能为空!");
     return (false);
  }
  if (document.form1.ATTACHMENT.value!="")
  {
     var file_temp=document.form1.ATTACHMENT.value;
     var file_name;
     var Pos;
     Pos=file_temp.l';
  echo 'astIndexOf("\\\\");
     file_name=file_temp.substring(Pos+1,file_temp.length);
     document.form1.ATTACHMENT_NAME.value=file_name;
  }
  document.form1.CONTRACT_CONTENT.value=EDIT_HTML.GetHtml();
  return (true);
}
function LoadWindow()
{
  URL="/module/user_select_single";
  loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;
  loc_y=document.body.scrollTop+event.clientY-ev';
  echo 'ent.offsetY+200;
  window.showModalDialog(URL,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:350px;dialogHeight:350px;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.';
  echo 'php?FIELDNAME="+fieldname,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:280px;dialogHeight:215px;dialogTop:"+mytop+"px;dialogLeft:"+myleft+"px");
}
function chk(input,KC,KT,count)
{
  var lstr="";
  if(count==1)
  {
   if(document.all(KC).checked)
   {
  	document.all(KT).value=document.all(KC).value;
   }
   else
   {
  	 document.all(KT).value="";
   }
   }
 ';
  echo '  else
   {
  	 for(i=0;i<document.all(KC).length;i++)
     {
        el=document.all(KC).item(i);
        if(el.checked)
        {
        	 val=el.value;
           lstr+=val+",";
        }
     }
  	document.all(KT).value=lstr;
    }
}
function LoadWindow1(kname,codeid)
{
  URL="/module/crm/codedefine.php?kname="+kname+"&codeid="+codeid;
  myleft=(screen.availWidth-650)/2;
  wi';
  echo 'ndow.open(URL,"formul_edit","height=300,width=550,status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left="+myleft+",resizable=yes");
}
function Load_Do()
{
  EDIT_HTML.SetHtml(document.form1.CONTRACT_CONTENT.value);
}
function sel_attach(div_id,dir_field,name_field,disk_id)
{
   var URL="/module/sel_file?EXT_FILTER=&MULTI_SELECT=1&DIV_ID=" + div_id + "&DIR_FIELD=" + dir_fie';
  echo 'ld + "&NAME_FIELD=" + name_field + "&TYPE_FIELD=" + disk_id;
   window.open(URL,null,"height=300,width=500,status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top=200,left=300,resizable=yes");
}
</script>
</head>
';
  $CREATE_DATE = date ('Y-m-d', time ());
  if (($CONTRACT_ID != ''))
  {
    $query = (((''.'select * from CONTRACT where CONTRACT_ID=\'').$CONTRACT_ID).'\'');
    $cursor = exequery ($connection, $query);
    if ($ROW = mysql_fetch_array ($cursor))
    {
      $EMAIL_ID = $ROW['CONTRACT_ID'];
      $CONTRACT_NO = $ROW['CONTRACT_NO'];
      $CONTRACT_NAME = $ROW['CONTRACT_NAME'];
      $CONTRACT_TYPE = $ROW['CONTRACT_TYPE'];
      $CONTRACT_ARTICLE = $ROW['CONTRACT_ARTICLE'];
      $CONTRACT_CONTENT = $ROW['CONTRACT_CONTENT'];
      $ATTACHMENT_ID = $ROW['ATTACHMENT_ID'];
      $ATTACHMENT_NAME = $ROW['ATTACHMENT_NAME'];
      $CONTRACT_PRINT = $ROW['CONTRACT_PRINT'];
      $CONTRACT_MEMO = $ROW['CONTRACT_MEMO'];
      $CUSTOMER_ID = $ROW['CUSTOMER_ID'];
      $CONTRACT_LINKMAN1 = $ROW['CONTRACT_LINKMAN1'];
      $CONTRACT_LINKMAN2 = $ROW['CONTRACT_LINKMAN2'];
      $SELLER = $ROW['SELLER'];
      $CREATE_DATE = $ROW['CREATE_DATE'];
      $BEGIN_DATE = $ROW['BEGIN_DATE'];
      $END_DATE = $ROW['END_DATE'];
      if (($END_DATE == '0000-00-00'))
      {
        $END_DATE = '';
      }
      if (($BEGIN_DATE == '0000-00-00'))
      {
        $BEGIN_DATE = '';
      }
      if (($CREATE_DATE == '0000-00-00'))
      {
        $CREATE_DATE = '';
      }
      $MEMO = $ROW['MEMO'];
      $MEMO1 = $ROW['MEMO1'];
      $USERDEF11 = $ROW['USERDEF1'];
      $USERDEF21 = $ROW['USERDEF2'];
      $USERDEF31 = $ROW['USERDEF3'];
      $USERDEF41 = $ROW['USERDEF4'];
      $USERDEF51 = $ROW['USERDEF5'];
    }
  }
  $query2 = (((''.'select CUSTOMER_NAME from CUSTOMER where CUSTOMER_ID=\'').$CUSTOMER_ID).'\'');
  $cursor2 = exequery ($connection, $query2);
  if ($ROW = mysql_fetch_array ($cursor2))
  {
    $CUSTOMER_NAME = $ROW['CUSTOMER_NAME'];
  }
  echo '<body class="bodycolor" topmargin="5" onload="Load_Do();">
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
  <tr>
    <td class="Big"><img src="/images/notify_new.gif" align="absmiddle">';
  echo '<s';
  echo 'pan class="big3"> 新建合同</span>
    </td>
  </tr>
</table>
<br>
<table border="0" cellspacing="1" width="450"  class="small"  bgcolor="#000000" cellpadding="3" align="center" >
  <form action="add.php" enctype="multipart/form-data"  method="post" name="form1" onsubmit="return CheckForm();">
   <tr>
    <td nowrap  class="TableHeader" colspan="4" align="left">
     合同基本信息:
    </td>
   </t';
  echo 'r>
   <tr>
   	<td nowrap class="TableData">客户名称: </td>
    <td class="TableData">
      <input type="hidden" name="CUSTOMER_ID" value="';
  echo $CUSTOMER_ID;
  echo '">
      <input type="text" name="CUSTOMER_NAME" class="BigStatic" size="15" maxlength="100" readonly value="';
  echo $CUSTOMER_NAME;
  echo '">&nbsp;
    </td>
    <td nowrap class="TableData">合同编号: </td>
    <td nowrap class="TableData">
        <input type="text" name="CONTRACT_NO" class="BigInput" size="15" maxlength="100" value="';
  echo $CONTRACT_NO;
  echo '">
    </td>
   </tr>
   <tr>
   <td nowrap class="TableData">合同类型: </td>
    <td nowrap class="TableData">
        ';
  echo '<s';
  echo 'elect name="CONTRACT_TYPE" class="BigSelect">
';
  getalldate ('CONTRACT_TYPE', $CONTRACT_TYPE);
  echo '        </select>
         &nbsp;<a href="javascript:LoadWindow1(\'CONTRACT_TYPE\',\'CONTRACT_TYPE\');"><img src="/images/edit1.gif" align="absmiddle" border=0 title="客户来源定义"></a>
   </td>
    <td nowrap class="TableData">合同打印样式: </td>
    <td nowrap class="TableData">
    ';
  echo '<s';
  echo 'elect name="CONTRACT_PRINT" class="BigSelect">
     <option value=01>产品销售合同</option>
     <option value=02>售后服务合同</option>
     <option value=03>产品升级合同</option>
     <option value=04>产品二次开发合同</option>
     </select>
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">合同名称: </td>
    <td nowrap class="TableData" colspan="3">
        <input type="text" name="CONTRAC';
  echo 'T_NAME" class="BigInput" size="50" maxlength="100" value="';
  echo $CONTRACT_NAME;
  echo '">
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">合同描述: </td>
    <td nowrap class="TableData" colspan="3">
    	 <textarea cols=57 rows=3 name="CONTRACT_MEMO" class="BigInput" wrap="yes">';
  echo $CONTRACT_MEMO;
  echo '</textarea>
    </td>
   </tr>
    <tr>
    <td nowrap class="TableData">合同条款: </td>
    <td nowrap class="TableData" colspan="3">
    	 <textarea cols=57 rows=6 name="CONTRACT_ARTICLE" class="BigInput" wrap="yes">';
  echo $CONTRACT_ARTICLE;
  echo '</textarea>
    </td>
   </tr>
   <tr>
    <td nowrap class="TableData">合同内容: </td>
    <td nowrap class="TableData" colspan="3">
    	 <iframe name="EDIT_HTML" width="100%" height=260 src="/module/editor" viewastext type="text/x-scriptlet"></iframe>
       <input type="hidden" name="CONTRACT_CONTENT"  value="';
  echo $CONTRACT_CONTENT;
  echo '">
    </td>
   </tr>
  <tr>
    <td nowrap class="TableData">生效日期: </td>
    <td nowrap class="TableData">
        <input type="text" name="BEGIN_DATE" size="10" maxlength="10" class="BigStatic" readonly value="';
  echo $BEGIN_DATE;
  echo '">
        <img src="/images/menu/calendar.gif" border="0" style="cursor:hand" onclick="td_calendar(\'form1.BEGIN_DATE\');">       
    </td>
     <td nowrap class="TableData">终止日期: </td>
    <td nowrap class="TableData">
        <input type="text" name="END_DATE" size="10" maxlength="10" class="BigStatic" readonly  value="';
  echo $END_DATE;
  echo '">
        <img src="/images/menu/calendar.gif" border="0" style="cursor:hand" onclick="td_calendar(\'form1.END_DATE\');">        
    </td>
  </tr>
  <tr>
    <td nowrap class="TableData">签约人(买方): </td>
    <td nowrap class="TableData">
        <input type="text" name="CONTRACT_LINKMAN1" class="BigInput" size="15" maxlength="100" value="';
  echo $CONTRACT_LINKMAN1;
  echo '">
    </td>
     <td nowrap class="TableData">签约人(卖方): </td>
    <td nowrap class="TableData">
        <input type="hidden" name="TO_ID" value="';
  echo $CONTRACT_LINKMAN2;
  echo '">
';
  $query2 = (((''.'select USER_NAME from USER where USER_ID=\'').$CONTRACT_LINKMAN2).'\'');
  $cursor2 = exequery ($connection, $query2);
  if ($ROW = mysql_fetch_array ($cursor2))
  {
    $LINKMAN2_NAME = $ROW['USER_NAME'];
  }
  echo '        <input type="text" name="TO_NAME" class="BigStatic" readonly size="15" maxlength="100"  value="';
  echo $LINKMAN2_NAME;
  echo '">
        <input type="button" value="选择" class="SmallButton" onClick="LoadWindow()" title="指定签约人" name="button">
    </td>
   </tr>
  <tr>
    <td nowrap class="TableData">创建日期: </td>
    <td nowrap class="TableData">
        <input type="text" name="CREATE_DATE" class="BigStatic" readonly size="15" maxlength="100" value="';
  echo $CREATE_DATE;
  echo '">
        <img src="/images/menu/calendar.gif" border="0" style="cursor:hand" onclick="td_calendar(\'form1.CREATE_DATE\');">
    </td>
     <td nowrap class="TableData">创建人: </td>
    <td nowrap class="TableData">
    	  <input type="hidden" name="SELLER" value="';
  echo $LOGIN_USER_ID;
  echo '" >
';
  $query2 = (((''.'select USER_NAME from USER where USER_ID=\'').$LOGIN_USER_ID).'\'');
  $cursor2 = exequery ($connection, $query2);
  if ($ROW = mysql_fetch_array ($cursor2))
  {
    $SELLER1_NAME = $ROW['USER_NAME'];
  }
  echo '        <input type="text" name="SELLER_NAME" class="BigStatic" readonly size="15" maxlength="100" value="';
  echo $SELLER1_NAME;
  echo '">
    </td>
   </tr>
    <tr>
    <td nowrap class="TableData">合同附件: </td>
    <td nowrap class="TableData" colspan="3">
';
  echo attach_link ($ATTACHMENT_ID, $ATTACHMENT_NAME, 1, 1, 1, 1, 1, 1, 0, 0);
  echo '    </td>
   </tr>
    <tr height="25">
      <td nowrap class="TableData">附件选择:</td>
      <td class="TableData" colspan="3">
         <div id="SelFileDiv" class="TextColor2"></div>
         <a href="javascript:sel_attach(\'SelFileDiv\',\'ATTACH_DIR\',\'ATTACH_NAME\',\'DISK_ID\');">从文件柜和网络硬盘选择附件</a>
         <input type="hidden" value="" name="ATTACH_NAME">
         <input type="hidden" val';
  echo 'ue="" name="ATTACH_DIR">
         <input type="hidden" value="" name="DISK_ID">
      </td>
    </tr>
  <tr>
      <td nowrap class="TableData">附件上传:</td>
      <td class="TableData" colspan="3">
        <input type="file" name="ATTACHMENT" size="30" class="BigInput" title="选择附件文件">
        <input type="button" value="上传附件" class="BigButton" onclick="upload_attach();" title="上传附件';
  echo '">
        <input type="hidden" name="ATTACHMENT_ID_OLD" value="';
  echo $ATTACHMENT_ID;
  echo '">
        <input type="hidden" name="ATTACHMENT_NAME_OLD" value="';
  echo $ATTACHMENT_NAME;
  echo '">
      </td>
    </tr>
<tr>
 <td nowrap  class="TableHeader" colspan="4" align="left">
     备注:
 </td>
</tr>
<tr>
 <td nowrap class="TableData">备注1: </td>
    <td nowrap class="TableData" colspan="3">
        <textarea cols=55 rows=3 name="MEMO" class="BigInput" wrap="yes">';
  echo $MEMO;
  echo '</textarea>
    </td>
</tr>
<tr>
 <td nowrap class="TableData">备注2: </td>
    <td nowrap class="TableData" colspan="3">
        <textarea cols=55 rows=3 name="MEMO1" class="BigInput" wrap="yes">';
  echo $MEMO1;
  echo '</textarea>
    </td>
</tr>
<tr>
  <td class="TableData" colspan="4">
       ';
  echo get_field_table (get_field_html ('CONTRACT', $CONTRACT_ID));
  echo '  </td>
</tr>
<tr>
    <td nowrap  class="TableControl" colspan="4" align="center">
        <input type="hidden" name="OP" value="">
        <input type="hidden" name="CONTRACT_ID" value="';
  echo $CONTRACT_ID;
  echo '">
        <input type="hidden" name="ATTACHMENT_NAME">
        <input type="submit" value="确定" class="BigButton" title="新建合同" name="button">&nbsp;
        <input type="button" value="返回" class="BigButton" onclick="location=\'../showdetail.php?CUSTOMER_ID=';
  echo $CUSTOMER_ID;
  echo '\'">
    </td>
   </tr>
  </form>
</table>
</body>
</html>
';
?>

⌨️ 快捷键说明

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