001.
<style type=
"text/css"
>
002.
@import url(
"css.css"
);
003.
</style>
004.
<?php
005.
$y
=
$_GET
[
"year"
];
006.
$y2
=
$_GET
[
"year2"
];
007.
$m
=
$_GET
[
"month"
];
008.
?>
009.
010.
<?php
require_once
(
'Connections/library.php'
); ?>
011.
<?php
012.
if
(!function_exists(
"GetSQLValueString"
)) {
013.
function
GetSQLValueString(
$theValue
,
$theType
,
$theDefinedValue
=
""
,
$theNotDefinedValue
=
""
)
014.
{
015.
$theValue
= get_magic_quotes_gpc() ?
stripslashes
(
$theValue
) :
$theValue
;
016.
017.
$theValue
= function_exists(
"mysql_real_escape_string"
) ? mysql_real_escape_string(
$theValue
) : mysql_escape_string(
$theValue
);
018.
019.
switch
(
$theType
) {
020.
case
"text"
:
021.
$theValue
= (
$theValue
!=
""
) ?
"'"
.
$theValue
.
"'"
:
"NULL"
;
022.
break
;
023.
case
"long"
:
024.
case
"int"
:
025.
$theValue
= (
$theValue
!=
""
) ?
intval
(
$theValue
) :
"NULL"
;
026.
break
;
027.
case
"double"
:
028.
$theValue
= (
$theValue
!=
""
) ?
"'"
. doubleval(
$theValue
) .
"'"
:
"NULL"
;
029.
break
;
030.
case
"date"
:
031.
$theValue
= (
$theValue
!=
""
) ?
"'"
.
$theValue
.
"'"
:
"NULL"
;
032.
break
;
033.
case
"defined"
:
034.
$theValue
= (
$theValue
!=
""
) ?
$theDefinedValue
:
$theNotDefinedValue
;
035.
break
;
036.
}
037.
return
$theValue
;
038.
}
039.
}
040.
041.
mysql_select_db(
$database_library
,
$library
);
042.
043.
if
(
$_POST
[
"r1"
] ==
"r1"
)
044.
{
045.
$query_january
=
"SELECT book_name,book_isbn , count(borrow_isbn) as maxid FROM member_borrow INNER JOIN book ON member_borrow.borrow_isbn = book.book_isbn WHERE member_borrow.day_show like '%-$m-$y' GROUP BY borrow_isbn ORDER BY maxid desc limit 15 "
;
046.
$january
= mysql_query(
$query_january
,
$library
)
or
die
(mysql_error());
047.
$row_january
= mysql_fetch_assoc(
$january
);
048.
$totalRows_january
= mysql_num_rows(
$january
);
049.
}
050.
else
051.
{
052.
$query_january
=
"SELECT book_name,book_isbn , count(borrow_isbn) as maxid FROM member_borrow INNER JOIN book ON member_borrow.borrow_isbn = book.book_isbn WHERE member_borrow.day_show like '%-%-$y2' GROUP BY borrow_isbn ORDER BY maxid desc limit 15 "
;
053.
$january
= mysql_query(
$query_january
,
$library
)
or
die
(mysql_error());
054.
$row_january
= mysql_fetch_assoc(
$january
);
055.
$totalRows_january
= mysql_num_rows(
$january
);
056.
}
057.
?>
058.
<script type=
"text/javascript"
>
059.
<!--
060.
function
MM_goToURL() {
061.
var
i, args=MM_goToURL.arguments; document.MM_returnValue = false;
062.
for
(i=0; i<(args.length-1); i+=2)
eval
(args[i]+
".location='"
+args[i+1]+
"'"
);
063.
}
064.
065.
</script>
066.
067.
<p align=
"center"
><span
class
=
"style15"
>สถิติหนังสือถูกยืมสูงสุด 15 รายการ</span></p>
068.
<p align=
"center"
class
=
"style15"
>เดือน <?
echo
$_GET
[
'months'
] ?> ปี <?
echo
$_GET
[
'years'
] ?></p>
069.
070.
<?php
if
(
$totalRows_january
> 0) {
071.
<table width=
"40%"
border=
"0"
align=
"center"
>
072.
<tr>
073.
<td width=
"65%"
><div align=
"center"
class
=
"style14"
>ชื่อหนังสือ</div></td>
074.
<td width=
"35%"
><div align=
"center"
class
=
"style14"
>เลขISBN</div></td>
075.
</tr>
076.
<?php
do
{ ?>
077.
<tr>
078.
<td
class
=
"style14"
><div align=
"left"
><?php
echo
$row_january
[
'book_name'
]; ?></div></td>
079.
<td
class
=
"style14"
><div align=
"center"
><?php
echo
$row_january
[
'book_isbn'
]; ?></div></td>
080.
</tr>
081.
<?php }
while
(
$row_january
= mysql_fetch_assoc(
$january
)); ?>
082.
</table>
083.
<div align=
"center"
><br />
084.
<label>
085.
<input name=
"button"
type=
"button"
id=
"button"
onClick=
"MM_goToURL('parent','administrator_report_book_year.php');return document.MM_returnValue"
value=
"กลับ"
/>
086.
</label>
087.
<br />
088.
</div>
089.
<?php }
090.
<p> </p>
091.
<?php
if
(
$totalRows_january
== 0) {
092.
<p align=
"center"
><br />
093.
<br />
094.
<br />
095.
<span
class
=
"style14"
>ไม่มีข้อมูลหนังสือ</span>
096.
<p align=
"center"
>
097.
<p align=
"center"
>
098.
<label>
099.
<input name=
"button2"
type=
"button"
id=
"button2"
onClick=
"MM_goToURL('parent','administrator_report_book_year.php');return document.MM_returnValue"
value=
"กลับ"
/>
100.
</label>
101.
<p align=
"center"
>
102.
<?php }
103.
</p>
104.
105.
<?php
106.
mysql_free_result(
$january
);
107.
?>