📄 new.php
字号:
<?
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 CheckForm()
{
if(document.form1.FLOW_TITLE.value=="")
{ alert("考核任务标题不能空!!");
form1.FLOW_TITLE.focus()
return (false);
}
if(document.form1.TO_ID.value=="")
{ alert("被考核人不能空!!");
return (false);
}
if(document.form1.SECRET_TO_ID.value=="")
{ alert("考核人不能空!!");
return (false);
}
if(document.form1.GROUP_ID.value=="")
{ alert("考核指标集不能空!!");
return (false);
}
if(document.form1.BEGIN_DATE.value!="" & document.form1.END_DATE.value!="")
{
if (DateCompare(document.form1.BEGIN_DATE.value,document.form1.END_DATE.value)=="0")
{
alert("终止日期不能小于生效日期!!");
return (false);
}
}
document.form1.submit();
}
function DateCompare(datestr1,datestr2){
var miStart = Date.parse(datestr1.replace(/-/g,'/'));
var miEnd = Date.parse(datestr2.replace(/-/g,'/'));
if((miEnd-miStart)<=0) return 0;
return 1;
}
function clear_dept()
{
document.form1.TO_NAME.value="";
document.form1.TO_ID.value="";
}
function clear_dept1()
{
document.form1.SECRET_TO_NAME.value="";
document.form1.SECRET_TO_ID.value="";
}
function LoadWindow()
{
URL="/module/user_select?MANAGE_FLAG=1";
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:1;status:0;help:0;resizable:1;dialogWidth:400px;dialogHeight:330px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
function LoadWindow1()
{
URL="/module/user_select?ID=1";
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: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");
}
</script>
</head>
<body class="bodycolor" topmargin="5">
<?
if($FLOW_ID!="")
{
$query = "SELECT * from SCORE_FLOW where FLOW_ID=$FLOW_ID";
$cursor= exequery($connection,$query);
if($ROW=mysql_fetch_array($cursor))
{
$GROUP_ID=$ROW["GROUP_ID"];
$FLOW_TITLE=$ROW["FLOW_TITLE"];
$FLOW_DESC=$ROW["FLOW_DESC"];
$FLOW_FLAG=$ROW["FLOW_FLAG"];
$BEGIN_DATE=$ROW["BEGIN_DATE"];
$END_DATE=$ROW["END_DATE"];
$RANKMAN=$ROW["RANKMAN"];
$PARTICIPANT=$ROW["PARTICIPANT"];
$ANONYMITY=$ROW["ANONYMITY"];
if($BEGIN_DATE=="0000-00-00")
$BEGIN_DATE="";
if($END_DATE=="0000-00-00")
$END_DATE="";
$RAN_NAME="";
$TOK=strtok($RANKMAN,",");
while($TOK!="")
{
$query1="select * from USER where USER_ID='$TOK'";
$cursor1= exequery($connection,$query1);
if($ROW=mysql_fetch_array($cursor1))
$RAN_NAME.=$ROW["USER_NAME"].",";
$TOK=strtok(",");
}
$PARTI_NAME="";
$TOK=strtok($PARTICIPANT,",");
while($TOK!="")
{
$query1="select * from USER where USER_ID='$TOK'";
$cursor1= exequery($connection,$query1);
if($ROW=mysql_fetch_array($cursor1))
$PARTI_NAME.=$ROW["USER_NAME"].",";
$TOK=strtok(",");
}
}
}
?>
<table border="0" width="90%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/notify_new.gif" align="absmiddle"><span class="big3"> <?if($FLOW_ID=="")echo "新建";else echo "编辑";?>考核任务</span>
</td>
</tr>
</table>
<table border="0" width="70%" cellpadding="2" cellspacing="1" align="center" bgcolor="#000000" class="small">
<form enctype="multipart/form-data" action="add.php" method="post" name="form1">
<tr>
<td nowrap class="TableData">考核任务标题:</td>
<td class="TableData">
<input type="text" name="FLOW_TITLE" size="40" maxlength="40" class="BigInput" value="<?=$FLOW_TITLE?>">
</td>
</tr>
<tr>
<td nowrap class="TableData">考核人:</td>
<td class="TableData">
<input type="hidden" name="SECRET_TO_ID" value="<?=$RANKMAN?>">
<textarea cols=40 name="SECRET_TO_NAME" rows="3" class="BigStatic" wrap="yes" readonly><?=$RAN_NAME?></textarea>
<input type="button" value="添 加" class="SmallButton" onClick="LoadWindow1()" title="添加" name="button">
<input type="button" value="清 空" class="SmallButton" onClick="clear_dept1()" title="清空" name="button">
</td>
</tr>
<tr>
<td nowrap class="TableData">被考核人:</td>
<td class="TableData">
<input type="hidden" name="TO_ID" value="<?=$PARTICIPANT?>">
<textarea cols=40 name=TO_NAME rows=5 class="BigStatic" wrap="yes" readonly><?=$PARTI_NAME?></textarea>
<input type="button" value="添 加" class="SmallButton" onClick="LoadWindow()" title="添加" name="button">
<input type="button" value="清 空" class="SmallButton" onClick="clear_dept()" title="清空" name="button">
</td>
</tr>
<tr>
<td nowrap class="TableData">按照管理范围:</td>
<td class="TableData">
<input type="checkbox" name="FLOW_FLAG" id="Id_FLOWFLAG" <?if($FLOW_FLAG=="1") echo "checked";?> ><label for="Id_FLOWFLAG">按照管理范围</label>
</td>
</tr>
<tr>
<td nowrap class="TableData">考核指标集:</td>
<td class="TableData">
<select name="GROUP_ID" class="BigSelect">
<?
$query = "SELECT * from SCORE_GROUP";
$connection=OpenConnection();
$cursor= exequery($connection,$query);
while($ROW=mysql_fetch_array($cursor))
{
$GROUPID=$ROW["GROUP_ID"];
$GROUPNAME=$ROW["GROUP_NAME"];
?>
<option value="<?=$GROUPID?>" <?if($GROUPID==$GROUP_ID) echo "selected";?>><?=$GROUPNAME?></option>
<?
}
?>
</select>
</td>
</tr>
<tr>
<td nowrap class="TableData"> 匿名:</td>
<td class="TableData">
<input type="checkbox" name="ANONYMITY" id="Id_ANONYMITY" <?if($ANONYMITY=="1") echo "checked";?>><label for="Id_ANONYMITY">允许匿名</label>
</td>
</tr>
<tr>
<td nowrap class="TableData"> 有效期:</td>
<td class="TableData">
生效日期:<input type="text" name="BEGIN_DATE" size="10" maxlength="10" class="BigInput" value="<?=$BEGIN_DATE?>">
<img src="/images/menu/calendar.gif" border="0" style="cursor:hand" onclick="td_calendar('form1.BEGIN_DATE');">
为空为立即生效<br>
终止日期:<input type="text" name="END_DATE" size="10" maxlength="10" class="BigInput" value="<?=$END_DATE?>">
<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 class="TableData">
<input type="checkbox" name="SMS_REMIND" id="SMS" checked><label for="SMS">使用内部短消息提醒</label>
<?
$query = "select * from SMS2_PRIV";
$cursor=exequery($connection,$query);
if($ROW=mysql_fetch_array($cursor))
$TYPE_PRIV=$ROW["TYPE_PRIV"];
if(find_id($TYPE_PRIV,15)) //检查该模块是否允许手机提醒
{
?>
<input type="checkbox" name="SMS2_REMIND" id="SMS2_REMIND" <?if($SMS2_REMIND=="1") echo "checked";?>><label for="SMS2_REMIND">使用手机短信提醒</label>
<?
}
?>
</td>
</tr>
<tr>
<td nowrap class="TableData">描述:</td>
<td class="TableData">
<textarea name="FLOW_DESC" cols="45" rows="5" class="BigInput"><?=$FLOW_DESC?></textarea>
</td>
</tr>
<tr align="center" class="TableControl">
<td colspan="2" nowrap>
<input type="hidden" name="FLOW_ID" value="<?=$FLOW_ID?>">
<input type="button" value="发布" class="BigButton" onclick="CheckForm();">
<?
if($FLOW_ID=="")
{
?>
<input type="reset" value="重填" class="BigButton">
<?
}
if($FLOW_ID!="")
{
?>
<input type="button" value="返回" class="BigButton" onclick="location='index1.php?CUR_PAGE=$CUR_PAGE'">
<?
}
?>
</td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -