| Server IP : 180.180.241.3 / Your IP : 216.73.216.25 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/AppServ/www/umedia3/inc/ |
Upload File : |
<?
function member_showhold($useradminid2) {
global $thaimonstrbrief;
global $isatcirculation;
global $Level;
global $dcrURL;
global $loginadmin;
$sql="select * from checkout where hold='$useradminid2' and allow='yes' and returned='no' order by id asc";
$result=tmq($sql);
$Num=tmq_num_rows($result);
?><BR><?
pagesection("รายการยืม::l::Holding item","narrow");
$count=1;
$allfine=0;
echo "<table border=1 cellspacing=0 width=780 align='center' class=table_border>";
echo "<tr bgcolor=f2f2f2>
<td width=10 align=center class=table_head><nobr> ".getlang("ลำดับที่::l::No.")." </td>
<td align=center class=table_head><nobr> ".getlang("รายละเอียด::l::Detail")." </td>
<td align=center class=table_head width=10%><nobr> ".getlang("ประเภท::l::Type")." </td>
<td align=center class=table_head> ".getlang("วันยืม::l::Hold date")." </td>
<td align=center class=table_head>".getlang("วันส่ง::l::Return date")."</td>
<td align=center class=table_head>".getlang("ค่าปรับ::l::Fine")."</td>
</tr>";
while ($row2=tmq_fetch_array($result)) {
$idhandler = $row2[id];
$mediaId=$row2[mediaId];
$mediapid=$row2[pid];
$RESOURCE_TYPE=$row2[RESOURCE_TYPE];
$sdat=$row2[sdat];
$smon=$row2[smon];
$syea=$row2[syea];
$edat=$row2[edat];
$emon=$row2[emon];
$eyea=$row2[eyea];
//echo "[[[end=$eyea start=$syea]]]";
$xfine=$row2[fine];
echo "<tr>";
echo "<td class=table_td align=center>$count</td>";
echo "<td align=center class=table_td>
<a href='$dcrURL"."dublin.php?ID=$mediapid&item=$mediaId' target=_blank><!-- $mediaId -->".substr(marc_gettitle($mediapid),0,40)."...</td>";
echo "<td align=center class=table_td><font color='$colsr' >";
echo get_media_type($RESOURCE_TYPE);
echo "</td>";
echo "<td align=center class=table_td><font color='$colsr' >$sdat " . $thaimonstrbrief[$smon] . " $syea</td>";
echo "<td align=center class=table_td><font color='$colsr' >";
$tmpdecis=getduedecis($mediaId, date("j"), date("n"), date("Y"));//xxxxx
//echo date("Y");
$daydiff=ddx(date("j"),date("n"),date("Y"),$edat,$emon,$eyea-543);
$daydiff=round($daydiff);
if ($tmpdecis < 0) {
$tmpdeci2=-($tmpdecis);
} else {
$tmpdeci2=$tmpdecis;
}
echo "$edat " . $thaimonstrbrief[$emon] . " $eyea ";
$decis=member_isoverduing($useradminid2);
if ($decis=="PASS"&&$daydiff<=floor(getval("config","daydiff-torenew")) && $Level=="Member") {
echo "<BR><A HREF=\"renew.php?mid=$mediaId\"><B>".getlang("ยืมต่อ::l::Renew")."</B></A>";
}
echo "</td>";
if ($tmpdecis >= 0) {
echo "<td align=center class=table_td>";
$tmpfine=($tmpdecis * $xfine);
$allfine+=$tmpfine;
if (floor($tmpfine)>0) {
echo "<font color=red><B>";
}
echo number_format($tmpfine);
echo "</b></font></td>";
} else {
echo "<td align=center class=table_td>";
echo "-";
echo "</td>";
}
echo "</tr>";
if ($isatcirculation=="yes") {
echo "<TR>
<TD colspan=1></TD>
<TD colspan=4 align=right class=smaller>".
getlang("บาร์โค้ด::l::Barcode")." $row2[mediaId]";
echo " <B><A HREF=\"$dcrURL/circulation/main.checkin.php?mediabarcode=$row2[mediaId]\" target=main class='smaller a_btn'>". getlang("คลิกเพื่อคืน::l::Click to Checkin")."</A></B>";
echo " <B><A HREF=\"$dcrURL/circulation/working.lost2.php?damagebarcode=$row2[mediaId]\" target=working class='smaller a_btn'>". getlang("หาย/ชำรุด::l::Lost/damage")."</A></B>";
echo "</TD>
</TR>";
}
$count++;
}
if ($count == 1) {
echo "<tr><td align=center colspan=20>".getlang("ไม่มีรายการยืม::l::No holding item.")."</td></tr>";
} else {
$decis=member_isoverduing($useradminid2);
if ($decis!="PASS" && loginchk_lib("return")) {
echo "<TR>
<TD colspan=6 align=right>".
getlang("มีหนังสือค้างส่ง หากต้องการพิมพ์ใบทวงถาม::l::Some item(s) overdue to print notification")."
<A HREF=\"$dcrURL/library.download/_notification.php?id=$useradminid2\" target=_blank>".
getlang("กรุณาคลิกที่นี่::l::click here")."</A>
</TD>
</TR>";
}
}
//ยืมได้กี่รายการ
$s=tmq("select * from member where UserAdminID='$useradminid2' ");
if (tmq_num_rows($s)!=1) {
die("member where UserAdminID='$useradminid2'");
//error will display in display iframe
}
$s=tmq_fetch_array($s);
$tmpmbtype="SELECT * FROM member_type where type ='$s[type]' ";
$tmpmbtype=tmq($tmpmbtype);
if (tmq_num_rows($tmpmbtype) == 0) {
html_dialog("","ไม่พบ ประเภทสมาชิก $mbtype ::l:: member type not found $mbtype");
die;
}
$tmpmbtype=tmq_fetch_array($tmpmbtype);
$limithold=$tmpmbtype[limithold];
//ดูว่ายืมไปกี่รายการแล้ว
$sql3="SELECT * FROM checkout where hold ='$useradminid2' and allow='yes' and returned='no' ";
$result3=tmq($sql3);
$row3=tmq_fetch_array($result3);
$holded=tmq_num_rows($result3);
if ($limithold > $holded) {
$holdmsg= getlang("ยืมได้อีก " . ($limithold - $holded) . " รายการ::l::Can checkout " . ($limithold - $holded) . " item more");
} else {
$holdmsg=getlang("ไม่สามารถยืมวัสดุสารสนเทศเพิ่มได้::l::Cannot checkout more items");
}
echo "
<tr><td colspan=6 align=right class=table_td><b>$holdmsg</b></td></tr>
";
echo "</table>";
}
?>