Viewing file: searchRepRegisDoc.php (7.29 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include_once "template.php";
include_once "../link/function.php";
include_once "../class/clsDocType.php";
include_once "../class/clsDocLineConfig.php";
include_once "../class/clsDocLinePosition.php";
include_once "funct.php";
include_once "../link/keyThai.php";
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);
$oDt = new doctype($oC);
$oDlc = new DocLineConfig($oC);
$oDlp = new docLinePosition($oC);
$InputThai=$oSys->SearchByInputThai();
?>
<html>
<head>
<script language="javascript" src="../source/calendarDateInput.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<link href="../source/style.css" rel="stylesheet" type="text/css">
</head>
<style>
/*
<!--
A:link {text-decoration: none; color: #000000}
A:visited {text-decoration: none; color: #000000}
A:hover {text-decoration: none; font-weight: bold; color: #000066}
-->
*/
</style>
<body>
<table width="100%" align="center">
<tr><td ><? //echo "--".$DLCID."<br>"; ?>
<fieldset>
<legend><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="?mm=1">รายงาน</a>
<img src="../picture/ico3.gif" width="10" border="0" align="absmiddle">รายงานทะเบียนหนังสือของวิทยาลัย</font>
</legend>
<form name="ff" target="_blank">
<table width="85%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#DADADA" style="border-collapse:collapse">
<tr><td colspan="6"><font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2"><strong>
เลือกประเภทรายงาน</strong></font></td></tr>
<? //------receive
$oDt->SearchRepReceiveDoc();
while($oDt->GetRecord()){
$Dt1=$oDt->DtID."1";
$Dt2=$oDt->DtID."2";
?>
<tr><td width="1%"> </td><td width="2%" > <input name="RPType" type="radio" id="RPType<? echo $Dt1; ?>" value="<? echo $Dt1; ?>" <? if($oDt->DtID=="1"){ ?>checked<? } ?> onClick="radioSelectType('<? echo $Dt1; ?>')"></td><td colspan="4">รายงานทะเบียนรับ<? echo $oDt->DtName; ?></td></tr>
<tr><td width="1%"> </td><td width="2%" > <input name="RPType" type="radio" id="RPType<? echo $Dt2; ?>" value="<? echo $Dt2; ?>" onClick="radioSelectType('<? echo $Dt2; ?>')"></td><td colspan="4">รายงานทะเบียนส่ง<? echo $oDt->DtName; ?></td></tr>
<? } ?>
<? //-------for regis
$oDt->SearchRepRegisDoc();
while($oDt->GetRecord()){
$Dt3=$oDt->DtID."5";
?>
<tr><td width="1%"> </td><td width="2%" > <input name="RPType" type="radio" id="RPType<? echo $Dt3; ?>" value="<? echo $Dt3; ?>" onClick="radioSelectType('<? echo $Dt3; ?>')" ></td><td colspan="4">รายงานทะเบียน<? echo $oDt->DtName; ?></td></tr>
<? } ?>
<tr><td colspan="6"><hr color="#000099"></hr></td></tr>
<tr><td colspan="6"><font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2"><strong>ค้นหาหนังสือ</strong></font></td></tr>
<tr><td width="1%"> </td><td width="2%" > </td><td colspan="4">เลขทะเบียนหนังสือ จาก : <input name="DocTypeNoStart" type="text" size="5"> ถึง : <input name="DocTypeNoEnd" type="text" size="5" maxlength="23" ></td></tr>
<tr><td width="1%"> </td><td width="2%" > </td><td colspan="4">เรื่อง : <input name="DocSubject" type="text" size="30"></td></tr>
<tr><td colspan="6"><hr color="#000099"></hr></td></tr>
<tr><td colspan="6"><font color="<?php echo $GLOBALS["COLOR_FONT_2"]; ?>" size="2"><strong>เลือกปีหรือช่วงวันที่ของทะเบียนหนังสือ</strong></font></td></tr>
<tr><td width="1%"> </td><td width="2%" > <input type="radio" name="selectVal" id="selectVal1" value="1" checked onClick="radioSelectVal(1)"></td><td colspan="4">รายงานประจำปี <input name="searchY" type="text" size="5" value=<? echo a2th(Date('Y')+543); ?> onKeyPress="event.keyCode=CheckInput(event.keyCode,'<? echo $InputThai; ?>'); return event.keyCode;" ></td></tr>
<tr><td width="1%"> </td><td width="2%" > <input type="radio" name="selectVal" id="selectVal2" value="2" onClick="radioSelectVal(2)"></td><td width="19%">รายงานตั้งแต่วันที่ </td><td width="24%"><script>DateInput('DocDateCreateStart', true, 'DD/MM/YYYY','<?php echo getNowDateFw2();?>');</script></td><td width="7%" align="center">ถึง</td><td width="47%"><script>DateInput('DocDateCreateEnd', true, 'DD/MM/YYYY','<?php echo getNowDateFw2();?>');</script></td></tr>
<tr><td colspan="6"><hr color="#000099"></hr></td></tr>
<? $oDlc->SearchByKey($DLCID); $oDlc->GetRecord();
$oDlp->SearchByKey($oDlc->DlpID); $oDlp->GetRecord();
if($oDlp->DlpID!="1" && $oDlp->DlpID!="2" && $oDlp->DlpID!="9" && $oDlp->DlpID!="10" && $oDlp->DlpID!="3" && $oDlp->DlpID!="4"){ $seeDept=1; } ?>
<tr><td colspan="6" align="right"><input name="" type="button" value="ออกรายงาน" onClick = "if(chkDate()) sendPage('<? echo $seeDept; ?>','<? echo $oDlc->deptId; ?>','<? echo $DLCID; ?>'); else return false; "></td></tr>
</table>
</form></fieldset>
</td>
</tr>
</table>
</body>
</html>
<script language="javascript">
function chkDate(){
val = document.getElementById('selectVal').value;
if(val == 2){
f = document.ff;
var date1 = f.DocDateCreateStart.value.split("/");
var date2 = f.DocDateCreateEnd.value.split("/");
//Set the two dates
date1 = new Date(eval(date1[2]), eval(date1[1]-1), eval(date1[0]));
date2 = new Date(eval(date2[2]), eval(date2[1]-1), eval(date2[0])); //Month is 0-11 in JavaScript
//Set 1 day in milliseconds
var one_day = 1000*60*60*24;
//Calculate difference btw the two dates, and convert to days
var diff = Math.ceil((date2.getTime()-date1.getTime())/(one_day));
if(diff < 0){
alert("กรุณาตรวจสอบช่วง 'วันที่เริ่มต้น' ควรน้อยกว่า 'วันที่สิ้นสุด' !");
return false;
}else{
return true;
}
}else{
return true;
}
}
function sendPage(p,q,dlcid) {
var links;
var typeshow;
typeshow= document.getElementById('RPtype').value;
var DocSubject=document.ff.DocSubject.value;
var DocTypeNoStart=document.ff.DocTypeNoStart.value;
var DocTypeNoEnd=document.ff.DocTypeNoEnd.value;
if(DocTypeNoEnd==""){
DocTypeNoEnd=DocTypeNoStart;
}else if(DocTypeNoStart==""){
DocTypeNoStart=DocTypeNoEnd;
}
if(val == 1){
var yearDoc = document.ff.searchY.value;
var date1 = 0;
var date2 = 0;
}else if(val == 2){
var yearDoc = 0;
var date1 = document.ff.DocDateCreateStart.value;
var date2 = document.ff.DocDateCreateEnd.value;
}
if(p==1){
links = "./printRepRegisDocforDept.php?typeshow="+typeshow+"&dlcid="+dlcid+"&DocSubject="+DocSubject+'&start='+date1+'&end='+date2+"&yearDoc="+yearDoc+"&DocTypeNoStart="+DocTypeNoStart+"&DocTypeNoEnd="+DocTypeNoEnd+"&seeDept="+p+"&deptId="+q;
}else{
links = "./printRepRegisDoc.php?typeshow="+typeshow+"&dlcid="+dlcid+"&DocSubject="+DocSubject+'&start='+date1+'&end='+date2+"&yearDoc="+yearDoc+"&DocTypeNoStart="+DocTypeNoStart+"&DocTypeNoEnd="+DocTypeNoEnd;
}
//links="12102007_102517-17-6c5725dd418c8b980c1ffafe6be9ce18.0203.pdf";
window.open(links,'','toolbar=0, scrollbars=1, location=0, status=1, menubar=1, resizable=1, width=950, height=620, left = 150, top = 15');
}
function radioSelectType(val){
document.getElementById('RPtype').value=val;
}
function radioSelectVal(val){
document.getElementById('selectVal').value=val;
}
</script>
|