⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 global.php

📁 Audio-visual system an online simulation of the film, when operations can be used by the
💻 PHP
字号:
<?php
function list_pages($type,$setpage,$setid){
global $dbhost,$dbuser,$dbpasswd,$dbname,$down_table;
global $list_num,$list_page_num;

if (empty($type) || $type==0):
$type = 0;
$istype = "";
else:
$istype = "WHERE sort2id=".$type;
endif;

mysql_pconnect($dbhost,$dbuser,$dbpasswd);

$sql = "SELECT COUNT(*) AS rcnt FROM $down_table $istype ORDER BY id DESC";
$result = mysql_db_query($dbname, $sql);
$row = mysql_fetch_array($result);

$num = $row[rcnt];


if (empty($setid)):
$setid = 0;
endif;

$sql = "SELECT * FROM $down_table $istype ORDER BY id DESC LIMIT $setid, $list_num";
$result = mysql_db_query($dbname, $sql);


$pages = ceil($num/$list_num);
$page = ceil($pages/$list_page_num);

if ($setid > 0):
$setpage1 = ceil($setid/$list_num);
$setpage = ceil(($setpage1+1)/$list_page_num);
else:
$setpage = 1;
endif;

if ($pages > $list_page_num):
$pagenum = $list_page_num;
else:
$pagenum = $pages;
endif;

$issetid = ceil(($setid+1)/$list_num);
$issetpage = $issetid % $list_page_num;


if ($setpage > 1):
echo "<a title='first page' href='list.php?type=".$type."&setpage=1&setid=0'>1</a>...\n";
endif;

if ($setpage>1):
$lastpage = $setpage-1;
$lastsetid = ($setpage-2)*$list_page_num*$list_num;
echo "<a title='previous column' href='list.php?type=".$type."&setpage=".$lastpage."&setid=".$lastsetid."'><<</a> - \n";
endif;

if ($setid > 0):

if ($issetpage == 1):
$newsetpage = $setpage-1;
else:
$newsetpage = $setpage;
endif;

$presetid = $setid-$list_num;
echo "<a title='Previous' href='list.php?type=".$type."&setpage=".$newsetpage."&setid=".$presetid."'>Previous</a> \n";
endif;

$i1 = ($setpage-1)*$list_page_num;
for ($i=$i1; $i<($i1+$pagenum) && $i<$pages; $i++)
{
$newsetid=$list_num*$i;

if (($setid/$list_num) == $i):
echo "<b><font color=red>".($i+1)."</font></b> \n";
else:
echo "<a href='list.php?type=".$type."&setpage=".$setpage."&setid=".$newsetid."'>".($i+1)."</a> \n";
endif;

}

if ($pages!=0 && ($setid/$list_num+1)!=$pages && ($setid/$list_num+1)<=$pages||$setid==1):

if ($list_page_num-$issetpage == 0 || $issetpage == 0):
$newsetpage = $setpage+1;
else:
$newsetpage = $setpage;
endif;

$newsetid = $setid+$list_num;
echo "<a title='next page layout' href='list.php?type=".$type."&setpage=".$newsetpage."&setid=".$newsetid."'>next page layout </a> \n";
endif;

if ($pages!=0 && $pages>$list_page_num && $setpage<$page):
$nextpage = $setpage+1;
$nextsetid = $setpage*$list_page_num*$list_num;
echo "- <a title='next column' href='list.php?type=".$type."&setpage=".$nextpage."&setid=".$nextsetid."'>>></a>\n";
endif;

if ($pages>$list_page_num && $setpage<$page):
$lastpage = $list_num*($pages-1);
echo "...<a title='last page layout' href='list.php?type=".$type."&setpage=".$page."&setid=".$lastpage."'>".$pages."</a>\n";
endif;

} // end list_pages

function list_program($type,$setid){
global $dbhost,$dbuser,$dbpasswd,$dbname,$down_table,$down_sort1_table,$down_sort2_table;
global $list_num,$list_brief_num;

if (empty($type) || $type==0):
$type = 0;
$istype = "";
else:
$istype = "WHERE sort2id=".$type;
endif;

mysql_pconnect($dbhost,$dbuser,$dbpasswd);

$sql = "SELECT COUNT(*) AS rcnt FROM $down_table $istype ORDER BY id DESC";
$result = mysql_db_query($dbname, $sql);
$row = mysql_fetch_array($result);
$num = $row[rcnt];


$num = $row[rcnt];
if ($num <= 0):
echo "<center>sorry,It waitting for you add....<br><br>";
endif;


if (empty($setid)):
$setid = 0;
endif;

$sql = "SELECT * FROM $down_table $istype ORDER BY id DESC LIMIT $setid, $list_num";
$result = mysql_db_query($dbname, $sql);

while ($row=mysql_fetch_array($result))
{ 

$sort2_sql = "SELECT * FROM $down_sort2_table WHERE id='$row[sort2id]'";
$sort2_result = mysql_db_query($dbname, $sort2_sql);
$objresult = mysql_fetch_object($sort2_result);
$type2 = $objresult->sort2;
$sort1id = $objresult->sort1id;

$sort1_sql = "SELECT * FROM $down_sort1_table WHERE id='$sort1id'";
$sort1_result = mysql_db_query($dbname, $sort1_sql);
$objresult = mysql_fetch_object($sort1_result);
$type1 = $objresult->sort1;


$brief_len = strlen($row[brief]);
if ($brief_len <= $list_brief_num):

$brief = $row[brief];

else:

$brief = substr($row[brief],"0","$list_brief_num"); 
$parity= 0;
for($i=0;$i<$list_brief_num;$i++){ 
$temp_str=substr($brief,$i,1); 
if(Ord($temp_str)>127) $parity+=1; 
} 
if($parity%2==1) $brief=substr($brief,0,($list_brief_num-1))."..."; 
else $brief=substr($brief,0,$list_brief_num)."..."; 

endif;


echo "<table border=0 cellpadding=0 cellspacing=0>\n";  
echo "<tr>\n";  
echo "<td width=120 height=80 valign=middle align=center>\n";
echo "<img border=1 src='".$row[pic]."' width=100 height=75></td>\n";  
echo "<td width=440>\n";  
echo "<div align=center>\n";  
echo "<table border=0 cellpadding=0 cellspacing=0>\n";  
echo "<tr>\n";  
echo "<td bgcolor=#000000>\n";  
echo "<div align=center>\n";  
echo "<table border=0 cellspacing=1 cellpadding=0>\n";  
echo "<tr>\n";  
echo "<td bgcolor=#888888 width=210 height=22>&nbsp;name:&nbsp;".$row[name]."</td>\n";  
echo "<td bgcolor=#888888 width=210 height=22>&nbsp;type:&nbsp;".$type2."</td>\n";  
echo "</tr>\n";  
echo "<tr>\n";  
echo "<td bgcolor=#888888 width=380 height=22 colspan=2>&nbsp;introduction:&nbsp;".$brief."</td>\n";  
echo "</tr>\n";  
echo "<tr>\n";  
echo "<td bgcolor=#888888 width=190 height=22>&nbsp;option:&nbsp;\n";
if (!empty($row[rm])):
echo "<a class=shadow1 href='./rm.php?id=".$row[id]."' onClick='return js_callpage(this.href);'><font color=#cccccc>View Online</font></a>\n";
endif;
if (!empty($row[asf])):
echo "<a class=shadow1 href='./asf.php?id=".$row[id]."' onClick='return js_callpage(this.href);'><font color=#cccccc>View Online</font></a>\n";
endif;
if (!empty($row[flash])):
echo "<a class=shadow1 href='./flash.php?id=".$row[id]."' onClick='return js_callpage(this.href);'><font color=#cccccc>View Online</font></a>\n";
endif;
echo "</td>\n";  
echo "<td bgcolor=#888888 width=190 height=22>&nbsp;Popularity:&nbsp;".$row[viewnum]."</td>\n";  
echo "</tr>\n";  
echo "</table>\n";  
echo "</div>\n";  
echo "</td>\n"; 
echo "</tr>\n";  
echo "</table>\n";  
echo "</div>\n";  
echo "</td>\n";  
echo "</tr>\n";  
echo "</table><br>\n";  

} // while

} // end list_program


function goto($type){
global $dbhost,$dbuser,$dbpasswd,$dbname,$down_sort2_table;
global $img_path;

mysql_pconnect($dbhost,$dbuser,$dbpasswd);
$typesql = "SELECT COUNT(*) AS rcnt FROM $down_sort2_table ORDER BY id";
$typeresult = mysql_db_query($dbname, $typesql);
$typerow = mysql_fetch_array($typeresult);


$typesql = "SELECT * FROM $down_sort2_table ORDER BY id";
$typeresult = mysql_db_query($dbname, $typesql);


while ($typerow=mysql_fetch_array($typeresult)) {
if ($type == $typerow[id]):
echo "<a href='list.php?type=".$typerow[id]."'>".$typerow[sort2]."</a>&nbsp;&nbsp;\n";
else:
echo "<a href='list.php?type=".$typerow[id]."'>".$typerow[sort2]."</a>&nbsp;&nbsp;\n";
endif;
}

}


function search($keyword,$type,$name,$brief){
global $dbhost,$dbuser,$dbpasswd,$dbname,$down_table,$down_sort1_table,$down_sort2_table;
global $list_brief_num;


if (empty($type)):
$type = 0;
endif;

if (!$name == 0):
$name = 1;
endif;

if (!$brief == 0):
$brief = 1;
endif;


if (empty($keyword)):
echo "<center><br>Here can not be empty!<br><br>";
echo "<a href=javascript:history.back(1)>Click here to return</a>";
exit;
endif;


if ($name == 1 && $brief == 1):
exit;
endif;

if ($type == 0):
$istype = "";
else:
$istype = "sort2id=$type &&";
endif;

if ($brief == 1):
$issearch = "WHERE $istype name LIKE '%$keyword%'";
elseif ($name == 1):
$issearch = "WHERE $istype brief LIKE '%$keyword%'";
else:
$issearch = "WHERE $istype name LIKE '%$keyword%' || brief LIKE '%$keyword%'";
endif;


mysql_pconnect($dbhost,$dbuser,$dbpasswd);

$sql = "SELECT COUNT(*) AS rcnt FROM $down_table $issearch ORDER BY id DESC";
$result = mysql_db_query($dbname, $sql);
$row = mysql_fetch_array($result);
$num = $row[rcnt];

if (empty($setid)):
$setid = 0;
endif;

$sql = "SELECT * FROM $down_table $issearch ORDER BY id DESC";
$result = mysql_db_query($dbname, $sql);

if ($num <=0):
echo "<center><br><a href=./list.php>sorry,there are no records you need</a><br><br>";
echo "<a href=javascript:history.back(1)>Click here to return</a><br><br>";
echo "<a href=http://tt78.wayall.com/ly>Click here to tell me the songs you want, I will try my best to help you find</a>";
endif;

while ($row=mysql_fetch_array($result)){

$sort2_sql = "SELECT * FROM $down_sort2_table WHERE id='$row[sort2id]'";
$sort2_result = mysql_db_query($dbname, $sort2_sql);
$objresult = mysql_fetch_object($sort2_result);
$type2 = $objresult->sort2;
$sort1id = $objresult->sort1id;

$sort1_sql = "SELECT * FROM $down_sort1_table WHERE id='$sort1id'";
$sort1_result = mysql_db_query($dbname, $sort1_sql);
$objresult = mysql_fetch_object($sort1_result);
$type1 = $objresult->sort1;


$brief_len = strlen($row[brief]);
if ($brief_len <= $list_brief_num):
 $brief = $row[brief];
else:
 $brief = substr($row[brief],"0","$list_brief_num")."..."; 
endif;


echo "<table border=0 cellpadding=0 cellspacing=0>\n";  
echo "<tr>\n";  
echo "<td width=120 height=80 valign=middle align=center>\n";
echo "<img border=1 src='".$row[pic]."' width=100 height=75></td>\n";  
echo "<td width=440>\n";  
echo "<div align=center>\n";  
echo "<table border=0 cellpadding=0 cellspacing=0>\n";  
echo "<tr>\n";  
echo "<td bgcolor=#000000>\n";  
echo "<div align=center>\n";  
echo "<table border=0 cellspacing=1 cellpadding=0>\n";  
echo "<tr>\n";  
echo "<td bgcolor=#888888 width=210 height=22>&nbsp;name:&nbsp;".$row[name]."</td>\n";  
echo "<td bgcolor=#888888 width=210 height=22>&nbsp;type:&nbsp;".$type2."</td>\n";  
echo "</tr>\n";  
echo "<tr>\n";  
echo "<td bgcolor=#888888 width=380 height=22 colspan=2>&nbsp;introduction:&nbsp;".$brief."</td>\n";  
echo "</tr>\n";  
echo "<tr>\n";  
echo "<td bgcolor=#888888 width=190 height=22>&nbsp;option:&nbsp;\n";
if (!empty($row[rm])):
echo "<a class=shadow1 href='./rm.php?id=".$row[id]."' onClick='return js_callpage(this.href);'><font color=#cccccc>view online</font></a>\n";
endif;
if (!empty($row[asf])):
echo "<a class=shadow1 href='./asf.php?id=".$row[id]."' onClick='return js_callpage(this.href);'><font color=#cccccc>view online</font></a>\n";
endif;
if (!empty($row[flash])):
echo "<a class=shadow1 href='./flash.php?id=".$row[id]."' onClick='return js_callpage(this.href);'><font color=#cccccc>view online</font></a>\n";
endif;
echo "</td>\n";  
echo "<td bgcolor=#888888 width=190 height=22>&nbsp;Popularity:&nbsp;".$row[viewnum]."</td>\n";  
echo "</tr>\n";  
echo "</table>\n";  
echo "</div>\n";  
echo "</td>\n"; 
echo "</tr>\n";  
echo "</table>\n";  
echo "</div>\n";  
echo "</td>\n";  
echo "</tr>\n";  
echo "</table><br>\n";   

} // while


} // end search


function rm($id){
global $dbhost,$dbuser,$dbpasswd,$dbname,$down_table,$down_sort1_table,$down_sort2_table;

mysql_pconnect($dbhost,$dbuser,$dbpasswd);

$sql = "SELECT * FROM $down_table WHERE id=$id";
$result = mysql_db_query($dbname, $sql);
$row = mysql_fetch_array($result);



$sort2_sql = "SELECT * FROM $down_sort2_table WHERE id='$row[sort2id]'";
$sort2_result = mysql_db_query($dbname, $sort2_sql);
$objresult = mysql_fetch_object($sort2_result);
$type2 = $objresult->sort2;
$sort1id = $objresult->sort1id;

$sort1_sql = "SELECT * FROM $down_sort1_table WHERE id='$sort1id'";
$sort1_result = mysql_db_query($dbname, $sort1_sql);
$objresult = mysql_fetch_object($sort1_result);
$type1 = $objresult->sort1;




echo "".$row[rm]."\n";


} // end rm


function asf($id){
global $dbhost,$dbuser,$dbpasswd,$dbname,$down_table,$down_sort1_table,$down_sort2_table;

mysql_pconnect($dbhost,$dbuser,$dbpasswd);

$sql = "SELECT * FROM $down_table WHERE id=$id";
$result = mysql_db_query($dbname, $sql);
$row = mysql_fetch_array($result);



$sort2_sql = "SELECT * FROM $down_sort2_table WHERE id='$row[sort2id]'";
$sort2_result = mysql_db_query($dbname, $sort2_sql);
$objresult = mysql_fetch_object($sort2_result);
$type2 = $objresult->sort2;
$sort1id = $objresult->sort1id;

$sort1_sql = "SELECT * FROM $down_sort1_table WHERE id='$sort1id'";
$sort1_result = mysql_db_query($dbname, $sort1_sql);
$objresult = mysql_fetch_object($sort1_result);
$type1 = $objresult->sort1;




echo "".$row[asf]."\n";


} // end asf


function flash($id){
global $dbhost,$dbuser,$dbpasswd,$dbname,$down_table,$down_sort1_table,$down_sort2_table;

mysql_pconnect($dbhost,$dbuser,$dbpasswd);

$sql = "SELECT * FROM $down_table WHERE id=$id";
$result = mysql_db_query($dbname, $sql);
$row = mysql_fetch_array($result);



$sort2_sql = "SELECT * FROM $down_sort2_table WHERE id='$row[sort2id]'";
$sort2_result = mysql_db_query($dbname, $sort2_sql);
$objresult = mysql_fetch_object($sort2_result);
$type2 = $objresult->sort2;
$sort1id = $objresult->sort1id;

$sort1_sql = "SELECT * FROM $down_sort1_table WHERE id='$sort1id'";
$sort1_result = mysql_db_query($dbname, $sort1_sql);
$objresult = mysql_fetch_object($sort1_result);
$type1 = $objresult->sort1;




echo "".$row[flash]."\n";


} // end asf

?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -