📄 advs_page_modi.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( 25 );
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</head>\r\n\r\n<body class=\"NormalPage\">\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=\"150\" > <img src=\"images/bar.gif\"> ";
echo $strAdvsPage;
echo "</td>\r\n <td > </td> <td width=\"100\" > </td>\r\n </tr>\r\n </table>\r\n";
$step = $_REQUEST['step'];
$id = $_REQUEST['id'];
if ( $step == "add" )
{
$hidden = $_POST['hidden'];
$title = $_POST['title'];
$border = $_POST['border'];
$width = $_POST['width'];
$height = $_POST['height'];
$url = $_POST['url'];
$target = $_POST['target'];
$pic = $_FILES['pic'];
if ( $title == "" || $width == "" || $height == "" )
{
err( $strAdvsNotice1, "", "" );
}
if ( 0 < $pic['size'] )
{
$arr = uploadimage( $pic['tmp_name'], $pic['type'], $pic['size'], "advs" );
$type = $arr[2];
$src = $arr[3];
$msql->query( "insert into {$tbl_advs_page} set\r\n\t\thidden = '{$hidden}',\r\n\t\ttitle = '{$title}',\r\n\t\tborder = '{$border}',\r\n\t\twidth = '{$width}',\r\n\t\theight = '{$height}',\r\n\t\ttype = '{$type}',\r\n\t\tsrc = '{$src}',\r\n\t\turl = '{$url}',\r\n\t\ttarget = '{$target}'\r\n\r\n\t\t" );
sayok( $strAddOk, "advs_page.php", "" );
}
else
{
err( $strAdvsNotice2, "", "" );
}
}
if ( $step == "modify" )
{
$hidden = $_POST['hidden'];
$title = $_POST['title'];
$border = $_POST['border'];
$width = $_POST['width'];
$height = $_POST['height'];
$url = $_POST['url'];
$target = $_POST['target'];
$pic = $_FILES['pic'];
if ( 0 < $pic['size'] )
{
$msql->query( "select src from {$tbl_advs_page} where id='{$id}'" );
if ( $msql->next_record( ) )
{
$src = $msql->f( "src" );
}
$fname = "../".$src;
if ( $src != "" && 9 < strlen( $src ) && file_exists( $fname ) )
{
@unlink( $fname );
}
$arr = uploadimage( $pic['tmp_name'], $pic['type'], $pic['size'], "advs" );
$msql->query( "update {$tbl_advs_page} set\r\n\t\thidden = '{$hidden}',\r\n\t\ttitle = '{$title}',\r\n\t\tborder = '{$border}',\r\n\t\twidth = '{$width}',\r\n\t\theight = '{$height}',\r\n\t\ttype = '{$arr['2']}',\r\n\t\tsrc = '{$arr['3']}',\r\n\t\turl = '{$url}',\r\n\t\ttarget = '{$target}' \r\n\t\twhere id = '{$id}'\r\n\t\t" );
sayok( $strModifyOk, "advs_page.php", "" );
}
else
{
$msql->query( "update {$tbl_advs_page} set\r\n\t\thidden = '{$hidden}',\r\n\t\ttitle = '{$title}',\r\n\t\tborder = '{$border}',\r\n\t\twidth = '{$width}',\r\n\t\theight = '{$height}',\r\n\t\turl = '{$url}',\r\n\t\ttarget = '{$target}' \r\n\t\twhere id = '{$id}' \r\n\t\t" );
sayok( $strModifyOk, "advs_page.php", "" );
}
}
if ( $id == "0" || $id == "" )
{
$title = "";
$hidden = "0";
$border = "0";
$width = "";
$height = "";
$type = "gif";
$url = "http://";
$src = "";
$target = "_self";
$nowstep = "add";
}
else
{
$nowstep = "modify";
$msql->query( "select * from {$tbl_advs_page} where id='{$id}'" );
if ( $msql->next_record( ) )
{
$id = $msql->f( "id" );
$title = $msql->f( "title" );
$hidden = $msql->f( "hidden" );
$border = $msql->f( "border" );
$width = $msql->f( "width" );
$height = $msql->f( "height" );
$type = $msql->f( "type" );
$url = $msql->f( "url" );
$src = $msql->f( "src" );
$target = $msql->f( "target" );
}
$plus = "{#Advs[".$id."][".$width."*".$height."]#}";
}
echo " \r\n<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" align=\"center\">\r\n <form name=\"advs_page_modi.php\" action=\"\" method=\"post\" enctype=\"multipart/form-data\"><tr> \r\n <td align=\"right\" class=\"title\" width=\"90\" height=\"26\">";
echo $strAdvsName;
echo "</td>\r\n <td class=\"con\"> \r\n <input type=\"text\" name=\"title\" size=\"30\" value=\"";
echo $title;
echo "\" class=input>\r\n <font color=\"#FF3300\">* </font></td>\r\n <td align=\"right\" class=\"title\" width=\"90\">";
echo $strAdvsPlus;
echo "</td>\r\n <td class=\"con\" width=\"300\">";
echo $plus;
echo " </td>\r\n </tr>\r\n <tr> \r\n <td align=\"right\" class=\"title\" width=\"90\" height=\"26\">";
echo $strAdvsWidth;
echo "</td>\r\n <td class=\"con\"> \r\n <input name=\"width\" type=\"text\" size=\"3\" value=\"";
echo $width;
echo "\" class=input>\r\n PX <font color=\"#FF3300\">* </font></td>\r\n <td align=\"right\" class=\"title\" width=\"90\">";
echo $strAdvsHeight;
echo "</td>\r\n <td class=\"con\" width=\"300\"> \r\n <input name=\"height\" type=\"text\" size=\"3\" value=\"";
echo $height;
echo "\" class=input>\r\n PX <font color=\"#FF3300\">* </font></td>\r\n </tr>\r\n \r\n <tr> \r\n <td align=\"right\" class=\"title\" width=\"90\" height=\"26\">";
echo $strUrl;
echo "</td>\r\n <td class=\"con\"> \r\n <input name=\"url\" type=\"text\" value=\"";
echo $url;
echo "\" size=\"30\" class=input>\r\n </td>\r\n <td align=\"right\" class=\"title\" width=\"90\">";
echo $strAdvsTarget;
echo "</td>\r\n <td class=\"con\" width=\"300\"> \r\n ";
echo "<s";
echo "elect name=\"target\">\r\n <option value=\"_blank\" ";
echo seld( $target, "_blank" );
echo ">";
echo $strBlank;
echo "</option>\r\n <option value=\"_self\" ";
echo seld( $target, "_self" );
echo ">";
echo $strSelf;
echo "</option>\r\n </select>\r\n </td>\r\n </tr>\r\n <tr> \r\n <td align=\"right\" class=\"title\" width=\"90\" height=\"26\">";
echo $strAdvsUpload;
echo "</td>\r\n <td class=\"con\"> \r\n <input type=\"file\" name=\"pic\" size=\"28\" class=input>\r\n <font color=\"#FF3300\">* </font> </td>\r\n <td class=\"title\" align=\"right\">";
echo $strLogoBorder;
echo "</td>\r\n <td class=\"con\" width=\"300\"> \r\n <input name=\"border\" type=\"text\" value=\"";
echo $border;
echo "\" size=\"2\" class=input>\r\n PX </td>\r\n </tr>\r\n <tr align=\"center\"> \r\n <td class=\"title\" colspan=\"4\" height=\"26\">";
echo $strAdvsNowPic;
echo "</td>\r\n </tr>\r\n <tr align=\"center\"> \r\n <td class=\"con\" colspan=\"4\" height=\"26\">";
$src = "../".$src;
echo showtypeimage( $src, $type, $width, $height, $border );
echo "</td>\r\n </tr>\r\n <tr align=\"center\"> \r\n <td colspan=\"4\" class=\"title\" height=\"26\"> \r\n <input type=\"submit\" name=\"Submit\" value=\"";
echo $strSubmit;
echo "\" class=button>\r\n <input type=\"button\" name=\"Submit2\" value=\"";
echo $strBack;
echo "\" class=button onClick=\"self.location='advs_page.php'\">\r\n <input type=\"hidden\" name=\"id\" value=\"";
echo $id;
echo "\">\r\n <input name=\"step\" type=\"hidden\" id=\"submit\" value=\"";
echo $nowstep;
echo "\">\r\n </td>\r\n </tr>\r\n </form>\r\n</table>\r\n</body>\r\n</html>\r\n";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -