1
+ <style>
2
+ .bar{ height:30px; width:853px; margin-left:38px; margin-top:10px;}
3
+ #getresult{ float:left;}
4
+ .sy{ float:left; font-size:15px; font-family:Verdana, Geneva, sans-serif; margin-top:10px;}
5
+ </style>
6
+ <script type="text/javascript" src="js/ajax.js"></script>
7
+ <script>
8
+ function printDiv(divID) {
9
+ //Get the HTML of div
10
+ var divElements = document.getElementById(divID).innerHTML;
11
+ //Get the HTML of whole page
12
+ var oldPage = document.body.innerHTML;
13
+
14
+ //Reset the page's HTML with div's HTML only
15
+ document.body.innerHTML =
16
+ "<nav>" +
17
+ divElements + "</nav>";
18
+
19
+ //Print Page
20
+ window.print();
21
+
22
+ //Restore orignal HTML
23
+ document.body.innerHTML = oldPage;
24
+ window.location='index.php?Booklist';
25
+ }
26
+ </script>
27
+ <div class="bar">
28
+
29
+ <select name="classID" style=" font-size:15px; padding:3px; width:200px; float:left;" class="com" onChange="getbooks(this.value)">
30
+ <option ></option>
31
+ <?php
32
+ include ('config.php ' );
33
+ $ sql ="SELECT * FROM sy " ;
34
+ $ rs =mysql_query ($ sql );
35
+ $ class =0 ;
36
+
37
+ while ($ row =mysql_fetch_array ($ rs )){
38
+ $ class ++;
39
+ ?>
40
+ <option value="<?php echo $ row ['year ' ];?> ">
41
+ <?php
42
+
43
+ echo $ row ['year ' ];
44
+
45
+ }
46
+ ?>
47
+ </option>
48
+ </select>
49
+
50
+ <?php
51
+ if (isset ($ _REQUEST ['classid ' ])){
52
+
53
+ echo "res " ;
54
+
55
+ }
56
+ ?>
57
+ <input type="button" value="Print" onClick="javascript:printDiv('printablediv')" />
58
+ </div>
59
+ <div id="printablediv">
60
+ <table width="360" border="0" align="center" style="margin-top:40px;">
61
+ <tr>
62
+ <td align="center" style="font-size:20px; font-weight:bold;font-family:Arial, 'Arial Black', 'Arial Narrow';">St. Mary's Academy of San Nicolas</td>
63
+
64
+ </tr>
65
+ <tr>
66
+ <td style="font-size:17px; font-weight:bold; font-family:Arial, 'Arial Black', 'Arial Narrow';" align="center">T. Abella St., Cebu City</td>
67
+ </tr>
68
+ <tr height="10"><td></td>
69
+ </tr>
70
+ <tr>
71
+ <td style=" margin-top:20px;font-size:19px; font-weight:bold; font-family:Arial, 'Arial Black', 'Arial Narrow';" align="center">HIGH SCHOOL LIBRARY</td>
72
+ </tr>
73
+
74
+ <tr align="center" >
75
+ <td style="font-size:15px; font-family:Verdana, Geneva, sans-serif; font-weight:bold;">List of Acquisitions
76
+ </td>
77
+ </tr>
78
+
79
+ </table>
80
+ <div id="getresult">
81
+
82
+ <table width="853" border="0" cellspacing="1" style=" margin-bottom:30px; margin-left:38px;font-size:12px; margin-top:20px; font-family:Verdana, Geneva, sans-serif;">
83
+ <thead>
84
+
85
+ <tr style="font-size:15px; font-weight:bold; font-family:Verdana, Geneva, sans-serif;" height="30" align="center" >
86
+ <td width="100">Acc No</td>
87
+ <td width="400">Title</td>
88
+ <td width="200">Author</td>
89
+ <td width="70">Copies</td>
90
+ </tr>
91
+ <tr>
92
+ <td colspan="4" style="border-bottom:#000 solid 1px;"></td>
93
+ </tr>
94
+ </thead>
95
+
96
+ <?php
97
+ include ('config.php ' );
98
+ $ q ="select * from books where status='1' " ;
99
+ $ rs =mysql_query ($ q );
100
+ while ($ row =mysql_fetch_array ($ rs )){
101
+ ?>
102
+
103
+ <tr align="center" class="hr" height="25">
104
+ <td bgcolor="" width="100">
105
+ <?php echo $ row ['accNo ' ];?>
106
+ </td>
107
+ <td width="400"><?php echo $ row ['booktitle ' ]; ?> </td>
108
+ <td width="200"><?php echo $ row ['author1 ' ]; ?> </td>
109
+ <td width="70" ><?php echo $ row ['bookcopies ' ];?> </td>
110
+
111
+
112
+ </tr>
113
+ <?php }
114
+
115
+ ?>
116
+
117
+ </table>
118
+ </div>
119
+ </div>
0 commit comments