1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title>
<link type="text/css" media="screen" rel="stylesheet" href="colorbox.css" /> <script src="jquery.min.js"></script> <script src="jquery.colorbox.js"></script> <script> $(document).ready(function(){ //Examples of how to assign the ColorBox event to elements $("a[rel='example1']").colorbox(); $("a[rel='example2']").colorbox({transition:"fade"}); $("a[rel='example3']").colorbox({transition:"none", width:"70%", height:"95%"}); $("a[rel='example4']").colorbox({slideshow:true}); $(".example5").colorbox(); $(".example6").colorbox({iframe:true, innerWidth:425, innerHeight:344}); $(".example7").colorbox({width:"80%", height:"80%", iframe:true}); $(".example8").colorbox({width:"50%", inline:true, href:"#inline_example1"}); $(".example9").colorbox({ onOpen:function(){ alert('onOpen: colorbox is about to open'); }, onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); }, onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); }, onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); }, onClosed:function(){ alert('onClosed: colorbox has completely closed'); } }); //Example of preserving a JavaScript event for inline calls. $("#click").click(function(){ $('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here."); return false; }); }); </script>
<script type="text/javascript"> function zoom(mysrc) { var str = mysrc var str2 = str.replace("/190/", "/300/"); //document.write(str2); document.getElementById("mainimg").src = str2;
str2 = str.replace("/190/", "/1024/"); document.getElementById("img").href = str2; } </script>
</head>
<body> <?php // get tid from temp1 if( isset($_GET['tid']) ){ $tid = $_GET['tid']; } else{ $tid = "tms10001"; }
//connect database define('DB_USER', 'onecmssa'); define('DB_PASSWORD', 'kwr20I*a'); define('DB_HOST', '192.168.171.21'); define('DB_DATABASE', 'onecmsadmin'); $link = mysql_pconnect(DB_HOST, DB_USER, DB_PASSWORD) or die('Connection errorG'.mysql_error()); mysql_select_db(DB_DATABASE) or die('Selection error'.DB_DATABASE.']G'.mysql_error()); $noPerRow = 3;
$sql = 'SELECT count(*) as count FROM tempDetail where tid = "'.$tid.'"'; $result = mysql_query($sql); $record = mysql_fetch_array($result); $noPerPage = $record[count];
$sql = 'SELECT folder FROM temp where tid = "'.$tid.'"'; $result = mysql_query($sql); $record = mysql_fetch_array($result); $folder = $record[folder];
$i = 0; $sql = 'SELECT * FROM tempDetail where tid = "'.$tid.'" order by tdid'; $result = mysql_query($sql); while($record = mysql_fetch_array($result)) { $tdid[$i] = $record[tdid]; $i++; }
echo <<<EOF <table border="0" cellpadding="0" cellspacing="0"><a name="top" id="top"></a> <tr> <td width="50"></td> <td width="370" height="410" align="left" valign="top" style="background:url(templateView/icon/table_bg2.jpg) top left no-repeat"><table width="370" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="40" height="80"></td> <td width="300"></td> <td width="30" height="80"></td> </tr> <tr> <td width="40"></td> <td width="300" height="300" align="center" valign="top"> <img name = "zoomIn" width="300" height="300" src="templateView/detail/300/$folder/$tdid[0].jpg" border = "0" style="border-style: solid;vertical-align:middle" id="mainimg"/> </td> <td width="30" height="300"></td> </tr> </table> <a href="templateView/detail/1024/$folder/$tdid[0].jpg" rel="example3" title="$tid" id="img"> <center><img width="20" height="20" src="templateView/icon/zoomin.jpg" border = "0" style="border-style: solid;vertical-align:middle"/></center> </a>' EOF;
for ($i=0; $i<$noPerPage; $i++) $slideshow .= '<a href="templateView/detail/1024/'.$folder.'/'.$tdid[$i].'.jpg" rel="example3" title="'.$tid.'"></a>';
echo <<<EOF $slideshow </td> <td width="30"></td> <td valign="top"><table border="0" cellpadding="0" cellspacing="0"> <tr> <td height="40" colspan="5"></td> </tr> <tr> <td height="35" colspan="5"></td> </tr> <tr> EOF; //show Pic for ($i=0; $i<($noPerPage/$noPerRow); $i++) { for ($j=0; $j<$noPerRow; $j++) { $value = ($j+$i*$noPerRow); if ($value < $noPerPage) echo <<<EOF <td width="150" align="center" valign="top" style="border:solid 1px #CCC"> <img onclick="zoom(this.src)" width="150" height="150" src="templateView/detail/190/$folder/$tdid[$value].jpg" /></td> <td width="10"></td> EOF; } if ($value < $noPerPage) echo <<<EOF </tr> <tr> <td height="10"></td> <td width="10" height="10"></td> <td height="10"></td> <td width="10" height="10"></td> <td height="10"></td> </tr> <tr> EOF; } echo <<<EOF </tr> <tr> <td height="25" colspan="5" align="right" valign="bottom"> <a href="javascript:history.go(-1)"> <img src="templateView/icon/back.jpg" width="55" height="17" border = "0" style="border-style: solid;vertical-align:middle" /> </a> </td> </tr> </table></td> </tr> </table> EOF; ?> </body> </html>
|