new.php
来自「通达OA2007SE源代码 非常好的」· PHP 代码 · 共 215 行
PHP
215 行
<?
function gettime ($d)
{
if (is_numeric ($d))
{
return $d;
}
else
{
if (!is_string ($d))
{
return 0;
}
if (ereg (':', $d))
{
$buf = split (' +', $d);
$year = split ('[-/]', $buf[0]);
$hour = split (':', $buf[1]);
if (eregi ('pm', $buf[2]))
{
($hour[0] += 12);
}
return mktime ($hour[0], $hour[1], $hour[2], $year[1], $year[2], $year[0]);
}
else
{
$year = split ('[-/]', $d);
return mktime (0, 0, 0, $year[1], $year[2], $year[0]);
}
}
}
function dateadd ($interval, $number, $date)
{
$date = gettime ($date);
$date_time_array = getdate ($date);
$hours = $date_time_array['hours'];
$minutes = $date_time_array['minutes'];
$seconds = $date_time_array['seconds'];
$month = $date_time_array['mon'];
$day = $date_time_array['mday'];
$year = $date_time_array['year'];
switch ($interval)
{
case 'yyyy':
{
($year += $number);
break;
}
case 'q':
{
($month += ($number * 3));
break;
}
case 'm':
{
($month += $number);
break;
}
case 'y':
{
}
case 'd':
{
}
case 'w':
{
($day += $number);
break;
}
case 'ww':
{
($day += ($number * 7));
break;
}
case 'h':
{
($hours += $number);
break;
}
case 'n':
{
($minutes += $number);
break;
}
case 's':
{
($seconds += $number);
break;
}
}
$timestamp = mktime ($hours, $minutes, $seconds, $month, $day, $year);
return $timestamp;
}
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 CheckForm()
{
if(document.form1.TO_ID.value=="")
{ alert("借书人不能为空!");
return (false);
}
if(document.form1.BOOK_NO.value=="")
{ alert("编号不能为空!");
return (false);
}
}
function td_calendar(fieldname)
{
myleft=document.body.scrollLeft+event.clientX-event.offsetX-80;
mytop=document.body.scrollTop+';
echo '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 LoadWindow()
{
URL="/module/user_select_single";
loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;
loc_y=document.body.s';
echo 'crollTop+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 LoadWindow2()
{
temp=document.form1.TO_ID.value;
URL="bookno_select?USER_ID=" + temp +"&LEND_FLAG=" +1;
loc_x=document.body.scrollLeft+event.clientX-event.offsetX-1';
echo '00;
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");
}
</script>
</head>
<body class="bodycolor" topmargin="5">
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="';
echo 'Big"><img src="/images/notify_new.gif" align="absmiddle">';
echo '<s';
echo 'pan class="big3"> 借书登记</span>
</td>
</tr>
</table>
<br>
<br>
<table border="0" cellspacing="1" width="400" class="small" bgcolor="#000000" cellpadding="3" align="center" >
<form action="add.php" method="post" name="form1" onsubmit="return CheckForm();">
<tr>
<td nowrap class="TableData" width="120">借书人:</td>
<td nowrap class="TableData">
<input type="hidden" name=';
echo '"TO_ID" value="">
<input type="text" name="TO_NAME" size="13" class="BigStatic" value="" readonly>
<input type="button" value="指 定" class="SmallButton" onClick="LoadWindow()" title="指定借书人" name="button"><br>
</td>
</tr>
<tr>
<td nowrap class="TableData" width="120">图书编号:</td>
<td class="TableData">
<input type="text" name="BOOK_NO" class="BigS';
echo 'tatic" size="13" maxlength="100" readonly value="';
echo $BOOK_NO;
echo '">
<input type="button" value="选 择" class="SmallButton" onClick="LoadWindow2()" title="选择图书编号" name="button">
</td>
</tr>
';
$CUR_DATE = date ('Y-m-d', time ());
$END_DATE = date ('Y-m-d', dateadd ('d', 30, $CUR_DATE));
echo ' <tr>
<td nowrap class="TableData">借书日期:</td>
<td nowrap class="TableData">
<input type="text" name="BORROW_DATE" size="9" maxlength="19" class="BigInput" value="';
echo $CUR_DATE;
echo '">
<img src="/images/menu/calendar.gif" border="0" align="absMiddle" style="cursor:hand" onclick="td_calendar(\'form1.BORROW_DATE\');"> 为空为当前日期
</td>
</tr>
<tr>
<td nowrap class="TableData" width="120">归还日期:</td>
<td nowrap class="TableData">
<input type="text" name="RETURN_DATE" size="9" maxlength="19" class="BigInput" value="';
echo $END_DATE;
echo '">
<img src="/images/menu/calendar.gif" border="0" align="absMiddle" style="cursor:hand" onclick="td_calendar(\'form1.RETURN_DATE\');"> 为空为从借书之日起30天的日期
</td>
</tr>
<tr>
<td nowrap class="TableData" width="120">备注:</td>
<td nowrap class="TableData">
<textarea name="BORROW_REMARK" class="BigInput" cols="35" rows="3">';
echo $BORROW_REMARK;
echo '</textarea>
</td>
</tr>
<tr>
<td nowrap class="TableControl" colspan="2" align="center">
<input type="submit" value="确定" class="BigButton" title="保存借书信息" name="button">
<input type="button" value="返回" class="BigButton" onclick="location=\'index.php\'">
</td>
</tr>
</form>
</table>
</body>
</html>
';
?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?