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

📄 link_main.php

📁 学校网站源码http://您的网址/admin/admin_login.asp 默认登录用户:admin 默认登录密码:admin
💻 PHP
字号:
<?php


include( "../config.inc.php" );
include( "../includes/SysGlobal.php" );
include( "language/".$aLan."_".$charset.".php" );
include( "../includes/version.php" );
include( "../includes/pro.php" );
include( "func/adm.inc.php" );
include( "func/common.inc.php" );
include( "func/db.inc.php" );
include( "func/nocatch.php" );
needauth( 74 );
$step = $_REQUEST['step'];
$id = $_REQUEST['id'];
echo "<html>\r\n<head >\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=";
echo $charset;
echo "\">\r\n<link id=\"style_sheet\" href=\"css/commonstyle.css\" type=\"text/css\" rel=\"stylesheet\">\r\n<title>";
echo $strAdminTitle;
echo "</title>\r\n\r\n ";
echo "<S";
echo "CRIPT>\r\nfunction cm(nn){\r\nqus=confirm(\"";
echo $strDeleteConfirm;
echo "\")\r\nif(qus!=0){\r\nwindow.location='link_main.php?step=del&id='+nn;\r\n}\r\n}\r\n\r\n</SCRIPT>\r\n</head>\r\n\r\n<body  class=\"NormalPage\">\r\n<div align=\"center\">\r\n  <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\" background=\"images/mu8.gif\" height=\"30\" >\r\n    <tr> \r\n      <td width=\"250\" >&nbsp;&nbsp;<img src=\"images/bar.gif\" >&nbsp;&nbsp;";
echo $strLinkSys;
echo "</td>\r\n      <td >&nbsp;</td>\r\n      <td width=\"100\" >&nbsp;</td>\r\n    </tr>\r\n    \r\n  </table>\r\n\r\n\r\n\r\n  \r\n  <br>\r\n";
$url = $_POST['url'];
$showtype = $_POST['showtype'];
$name = $_POST['name'];
$pic = $_FILES['suo'];
if ( $step == "add" )
{
	if ( $url == "" || $url == "http://" )
	{
		err( $strLinkNTC1, "", "" );
	}
	if ( $name == "" )
	{
		err( $strLinkNTC2, "", "" );
	}
	if ( $showtype == "img" && $pic['size'] <= 0 )
	{
		err( $strLinkNTC3, "", "" );
	}
	if ( 100000 <= $pic['size'] )
	{
		err( $strLinkNTC4, "", "" );
	}
	$url = htmlspecialchars( $url );
	$name = htmlspecialchars( $name );
	if ( 0 < $pic['size'] )
	{
		$arr = uploadimage( $pic['tmp_name'], $pic['type'], $pic['size'], "link" );
	}
	$msql->query( "insert into {$tbl_link} values(\r\n0,\r\n'{$showtype}',\r\n'{$name}',\r\n'{$url}',\r\n'0',\r\n'{$arr['2']}',\r\n'{$arr['3']}',\r\n'0'\r\n)" );
	sayok( $strLinkNTC5, "link_main.php", "" );
}
if ( $step == "modify" )
{
	if ( $url == "" || $url == "http://" )
	{
		err( $strLinkNTC1, "", "" );
	}
	if ( $name == "" )
	{
		err( $strLinkNTC2, "", "" );
	}
	$url = htmlspecialchars( $url );
	$name = htmlspecialchars( $name );
	$msql->query( "update {$tbl_link} set url='{$url}',name='{$name}',xuhao='{$xuhao}' where id='{$id}' " );
}
if ( $step == "del" )
{
	$msql->query( "select src from {$tbl_link} where id='{$id}'" );
	if ( $msql->next_record( ) )
	{
		$src = $msql->f( "src" );
	}
	$fname = "../".$src;
	if ( file_exists( $fname ) && $src != "" )
	{
		unlink( $fname );
	}
	$msql->query( "delete from {$tbl_link} where id='{$id}'" );
}
echo "<table width=\"625\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" height=\"22\">\r\n    <tr> \r\n      <td class=title align=\"left\" height=\"22\" valign=\"top\" width=\"3\"><img src=\"images/menubg16.gif\" width=\"3\" height=\"30\"></td>\r\n      <td class=title align=\"center\" height=\"22\" colspan=\"2\">";
echo $strLinkAdd;
echo "</td>\r\n      <td class=title align=\"right\" height=\"22\" width=\"3\" valign=\"top\"><img src=\"images/menubg17.gif\" width=\"3\" height=\"30\"></td>\r\n    </tr>\r\n  </table>\r\n  <table width=\"625\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" align=\"center\" height=\"22\">\r\n    <form method=\"post\" action=\"link_main.php\" enctype=\"multipart/form-data\">\r\n      <tr> \r\n\r\n        <td class=title height=\"26\" width=\"15%\" align=\"center\"";
echo "> \r\n          <div align=\"center\">";
echo $strLinkType;
echo "</div>\r\n        </td>\r\n        <td class=con height=\"24\" width=\"33%\"> \r\n          <input type=\"radio\" name=\"showtype\" value=\"text\" checked >\r\n          ";
echo $strLinkType1;
echo " \r\n          <input type=\"radio\" name=\"showtype\" value=\"img\"  >\r\n           ";
echo $strLinkType2;
echo "  </td>\r\n        <td class=title height=\"24\" width=\"15%\" align=\"center\">";
echo $strLinkName;
echo "</td>\r\n        <td class=con height=\"24\" width=\"37%\">\r\n          <input type=\"text\" name=\"name\" size=\"26\">\r\n          <font color=\"#FF3333\">*</font> </td>\r\n      </tr>\r\n      <tr> \r\n        <td class=title height=\"26\" width=\"15%\" align=\"center\">";
echo $strLinkUrl;
echo "</td>\r\n        <td class=con height=\"24\" width=\"33%\" valign=\"top\"> \r\n          <input type=\"text\" name=\"url\" value=\"http://\" size=\"25\">\r\n          <font color=\"#FF3333\">*</font> </td>\r\n        <td class=title height=\"24\" width=\"15%\" align=\"center\">";
echo $strLinkPicUp;
echo "</td>\r\n        <td class=con height=\"24\" width=\"37%\" valign=\"top\"> \r\n          <input type=\"file\" name=\"suo\" size=\"15\">\r\n        </td>\r\n      </tr>\r\n      <tr> \r\n        <td class=title height=\"31\" colspan=\"4\" align=\"center\"> \r\n          <input type=\"submit\" name=\"Submit\" value=\"";
echo $strAdd;
echo "\"  class=button>\r\n          <font color=\"#000000\"> \r\n          <input type=\"hidden\" name=\"step\" value=\"add\">\r\n          </font> </td>\r\n      </tr>\r\n    </form>\r\n  </table>\r\n  <table width=\"623\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" height=\"10\" background=\"images/mu1.jpg\">\r\n    <tr> \r\n      <td  align=\"center\" height=\"2\" colspan=\"2\"></td>\r\n    </tr>\r\n  </table>\r\n  <table width=\"625\" border=\"0";
echo "\" cellspacing=\"1\" cellpadding=\"0\" align=\"center\" height=\"22\">\r\n    <tr> \r\n      <td class=title height=\"25\"> \r\n        <div align=\"center\">";
echo $strLinkSys;
echo "</div>\r\n      </td>\r\n    </tr>\r\n  </table>\r\n  <table width=\"625\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\" align=\"center\">\r\n    <tr align=\"center\"> \r\n      <td height=\"24\"  class=\"title\" width=\"54\"> <font color=\"#FFFFFF\">";
echo $strXuhao;
echo "</font></td>\r\n      <td height=\"24\" class=\"title\" width=\"58\"> <font color=\"#FFFFFF\">";
echo $strLinkType;
echo "</font></td>\r\n      <td height=\"24\" class=\"title\" align=\"center\" width=\"137\"> <font color=\"#FFFFFF\">";
echo $strLinkUrl;
echo "</font></td>\r\n      <td width=\"118\" class=\"title\"> <font color=\"#FFFFFF\">";
echo $strLinkName;
echo "</font></td>\r\n      <td height=\"24\"  class=\"title\" width=\"100\"> <font color=\"#FFFFFF\">";
echo $strLinkPic;
echo "</font></td>\r\n      <td height=\"24\"  class=\"title\" width=\"50\"> <font color=\"#FFFFFF\">";
echo $strModify;
echo "</font></td>\r\n      <td  class=\"title\" height=\"24\" width=\"50\"> <font color=\"#FFFFFF\">";
echo $strDelete;
echo "</font></td>\r\n    </tr>\r\n    ";
$msql->query( "select * from {$tbl_link}  order by xuhao" );
while ( $msql->next_record( ) )
{
	$id = $msql->f( "id" );
	$showtype = $msql->f( "showtype" );
	$name = $msql->f( "name" );
	$url = $msql->f( "url" );
	$xuhao = $msql->f( "xuhao" );
	$src = $msql->f( "src" );
	$type = $msql->f( "type" );
	if ( $showtype == "img" )
	{
		$say = $strLinkType2;
	}
	else
	{
		$say = $strLinkType1;
	}
	echo " \r\n    <form action=\"link_main.php\" method=post>\r\n      <tr> \r\n        <td height=\"45\" align=\"center\"  class=\"con\" width=\"54\"> \r\n          <div align=\"center\"> \r\n            <input type=\"text\" name=\"xuhao\" size=\"2\" value=\"";
	echo "{$xuhao}";
	echo "\">\r\n          </div>\r\n        </td>\r\n        <td class=\"con\" height=\"45\" align=\"center\" width=\"58\"> \r\n          <div align=\"center\"><font color=\"#000000\"> ";
	echo "{$say}";
	echo " \r\n            <input type=\"hidden\" name=\"id\" value=\"";
	echo "{$id}";
	echo "\">\r\n            <input type=\"hidden\" name=\"showtype\" value=\"";
	echo "{$showtype}";
	echo "\">\r\n            </font></div>\r\n        </td>\r\n        <td class=\"con\" height=\"45\" align=\"center\" width=\"137\"> \r\n          <div align=\"center\"><font color=\"#000000\"> \r\n            <input type=\"text\" name=\"url\" size=\"16\" value=\"";
	echo "{$url}";
	echo "\" maxlength=\"200\">\r\n            </font></div>\r\n        </td>\r\n        <td class=\"con\" align=\"center\" width=\"118\">\r\n          <input type=\"text\" name=\"name\" size=\"15\" value=\"";
	echo "{$name}";
	echo "\" maxlength=\"200\">\r\n          </td>\r\n        <td height=\"45\" align=\"center\"  class=\"con\" width=\"100\"> ";
	if ( $showtype == "img" )
	{
		$src = "../".$src;
		echo showtypeimage( $src, $type, "88", "31", 0 );
	}
	else
	{
		echo " ";
	}
	echo "</td>\r\n        <td height=\"45\" align=\"center\" class=\"con\" width=\"50\"> \r\n          <div align=\"center\"> <font color=\"#000000\">\r\n            <input type=\"hidden\" name=\"step\" value=\"modify\">\r\n            </font>\r\n<input type=\"submit\" name=\"cc\" value=\"";
	echo $strModify;
	echo "\" class=button>\r\n          </div>\r\n        </td>\r\n        <td width=\"50\" class=\"con\" align=\"center\" height=\"45\"> \r\n          <div align=\"center\"> \r\n            <input type=\"button\" name=\"cc\" value=\"";
	echo $strDelete;
	echo "\" onClick=\"cm('";
	echo "{$id}";
	echo "')\"  class=button>\r\n          </div>\r\n        </td>\r\n      </tr>\r\n    </form>\r\n    ";
}
echo " \r\n  </table>\r\n  \r\n  <table width=\"623\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" height=\"10\" background=\"images/mu1.jpg\">\r\n    <tr> \r\n      <td  align=\"center\" height=\"2\" colspan=\"2\"></td>\r\n    </tr>\r\n  </table>\r\n</div>\r\n</body>\r\n</html>\r\n";
?>

⌨️ 快捷键说明

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