| Server IP : 210.245.233.93 / Your IP : 216.73.216.226 Web Server : Apache/2.2.15 (CentOS) System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64 User : apache ( 48) PHP Version : 5.3.3 Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/onecms.hk/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body align="center">
<table border="0" cellpadding="0" cellspacing="0" aglin = "center" style = "padding-left:2px; padding-right:2px;">
<tr style = "padding-left:2px; padding-right:2px;">
<td></td>
<?php
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());
$sql = "SELECT count(*) as count FROM temp";
$result = mysql_query($sql);
$record = mysql_fetch_array($result);
$count = $record[count];
$noPerPage = 20;
$noPerRow = 4;
$max = $count / $noPerPage;
//select folder , tid
$i = 0;
$sql = "SELECT * FROM temp order by tid";
//$sql = "SELECT * FROM temp order by rand()";
$result = mysql_query($sql);
while($record = mysql_fetch_array($result))
{
$tid[$i] = $record[tid];
$folder[$i] = $record[folder];
$i++;
}
//select first pic
for ($n=0; $n<$count; $n++)
{
$i = 0;
$sql = 'SELECT * FROM tempDetail where tid = "'.$tid[$n].'" order by "'.$tid[$n].'"';
$result = mysql_query($sql);
while($record = mysql_fetch_array($result))
{
$tdid[$n][$i] = $record[tdid];
$i++;
}
}
// get page number
if( isset($_GET['page']) ){
$page = intval( $_GET['page'] );
}
else{
$page = 1;
}
$page_string = '';
//previous
if( $page == 1 ){
$page_string .= '<img src="../templateView/icon/previous.jpg" height="15" border = "0" style="vertical-align:middle"/> ';
}
else{
$page_string .= '<a href=?page='.($page-1).' style="text-decoration: none"><img src="../templateView/icon/previous.jpg" height="15" border = "0" style="border-style: solid;vertical-align:middle" /></a> ';
}
//number
for ($i=1; $i<($max+1); $i++)
if ($page == $i ) $page_string .= '<b style="text-decoration: none; font-size:15px "> '.$i.' </b>';
else $page_string .= '<a href=?page='.$i.' style="text-decoration: none; font-size:15px "><b> '.$i.' </b></a>';
//next
if( ($page == $max)){
$page_string .= ' <img src="../templateView/icon/next.jpg" height="15" style="vertical-align:middle"/>';
}
else{
$page_string .= ' <a href=?page='.($page+1).' style="text-decoration: none"><img src="../templateView/icon/next.jpg" height="15" border = "0" style="border-style: solid;vertical-align:middle" /></a>';
}
//show Pic
for ($i=0; $i<($noPerPage/$noPerRow); $i++)
{
echo '</tr><tr><td></td><td height="30" colspan="7"></td></tr><tr>';
for ($j=0; $j<$noPerRow; $j++)
{
$value = ($j+($i+($page-1)*2)*$noPerRow);
if ($value < $count)
{
$picName = $tdid[$value][0];
echo <<<EOF
<td width="246" height="233" align="left" valign="top" style="background:url(../templateView/icon/table_bg.jpg) top left no-repeat"><table width="226" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="12"></td>
<td height="12"></td>
<td height="12"></td>
</tr>
<tr>
<td width="56"></td>
<td width="180" height="20" align="center"><b>No. $tid[$value]</b></td>
<td width="10"></td>
</tr>
<tr>
<td width="56" height="7"></td>
<td width="180" height="7"></td>
<td width="10" height="7"></td>
</tr>
<tr>
<td width="56"></td>
<td width="180" height="180" align="center" valign="top">
<a href=temp2.php?tid=$tid[$value]#top style="text-decoration: none">
<img src="../templateView/detail/190/$folder[$value]/$picName.jpg" width="190" border = "0" style="border-style: solid" />
</a>
</td>
<td width="10"></td>
</tr>
</table></td>
EOF;
}
}
}
?>
</tr>
<tr>
<tr>
<td></td>
<td height="0" colspan="7"></td>
</tr>
<tr>
<td width="20"></td>
<td height="30" colspan="7"></td>
</tr>
<tr><td align="center" colspan=4>
<?php
echo $page_string;
?>
</td></tr>
</table>
</body>
</html>