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

📄 index.php

📁 极限网络智能办公系统 Office Automation V3.0官方100%源代码.
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?
include_once("inc/auth.php");
include_once("inc/utility_all.php");
?>

<html>
<head>
<title>新建合同</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<script Language="JavaScript">
function delete_attach(ATTACHMENT_ID,ATTACHMENT_NAME)
{
  msg="确定要删除文件 '"+ ATTACHMENT_NAME +"' 吗?";
  if(window.confirm(msg))
  {
    URL="delete_attach.php?CONTRACT_ID=<?=$CONTRACT_ID?>&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("合同名称不能为空!");
     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.lastIndexOf("\\");
     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-event.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.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="";
  	  }

  	 }
  	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="codedefine.php?kname="+kname+"&codeid="+codeid;
  myleft=(screen.availWidth-650)/2;
  window.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 LoadWindow2()
{
  URL="/general/sale_manage/crm/linkman/customer_select";
  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;help:0;resizable:1;dialogWidth:320px;dialogHeight:245px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}

function Load_Do()
{
  EDIT_HTML.SetHtml(document.form1.CONTRACT_CONTENT.value);
}

</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"];
?>

<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"><span 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>
   </tr>
   <tr>
   	<td nowrap class="TableData">客户名称: </td>
    <td class="TableData">
      <input type="hidden" name="CUSTOMER_ID" value="<?=$CUSTOMER_ID?>">
      <input type="text" name="CUSTOMER_NAME" class="BigStatic" size="15" maxlength="100" readonly value="<?=$CUSTOMER_NAME?>">&nbsp;
      <input type="button" value="选 择" class="SmallButton" onClick="LoadWindow2()" title="选择客户" name="button">
    </td>
    <td nowrap class="TableData">合同编号: </td>
    <td nowrap class="TableData">
        <input type="text" name="CONTRACT_NO" class="BigInput" size="15" maxlength="100" value="<?=$CONTRACT_NO?>">
    </td>
   </tr>

   <tr>
   <td nowrap class="TableData">合同类型: </td>
    <td nowrap class="TableData">
        <select name="CONTRACT_TYPE" class="BigSelect">
<?
        GETALLDATE("CONTRACT_TYPE",$CONTRACT_TYPE);
?>
        </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">
    <select 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="CONTRACT_NAME" class="BigInput" size="50" maxlength="100" value="<?=$CONTRACT_NAME?>">
    </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"><?=$CONTRACT_MEMO?></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"><?=$CONTRACT_ARTICLE?></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="<?=$CONTRACT_CONTENT?>">
    </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="<?=$BEGIN_DATE?>">
        <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="<?=$END_DATE?>">
        <img src="/images/menu/calendar.gif" border="0" style="cursor:hand" onclick="td_calendar('form1.END_DATE');">

⌨️ 快捷键说明

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