📄 ads_modify.php
字号:
<?
include_once("../adser/top.php");
if($_POST["hnsubmit"]=="1" && !empty($_POST["hn_edit_id"])){
$sql="select * from ads where username='$_SESSION[adser_username]' and own_type='1' and id='$_POST[hn_edit_id]'";
$rs=mysql_query($sql);
$row=mysql_fetch_array($rs);
if($_POST["price"]<$row["price"]){
echo "单价值不能小于".$row["price"]."元!";
fun_alert("单价值不能小于".$row["price"]."元!");
fun_back();
exit();
}
$totmoney=round($row["spare"]*($_POST["price"]-$row["price"])*((1+$row["rate"])*(1+$row["rate"])+0.1)/10)/100;
if($totmoney>$_POST["hn_balance"]){
echo "抱歉,您的当前帐户余额已不足支付提高单价所需金额!";
fun_alert("抱歉,您的当前帐户余额已不足支付提高单价所需金额!");
fun_back();
exit();
}
if(!empty($file_name)){
if($file_size>$cfg_upfilesize*1024){
echo "上传文件不能大于 $cfg_upfilesize KB!";
fun_alert("上传文件不能大于 $cfg_upfilesize KB!");
fun_back();
exit();
}
$arrf=explode(".",$file_name);
$counta=count($arrf)-1;
$f_type=$arrf[$counta];
$f_type=strtolower($f_type);
if(!($f_type=="gif" || $f_type=="jpeg" || $f_type=="jpg" || $f_type=="swf")){
echo "上传文件格式只能是GIF/JPEG/JPG/SWF!";
fun_alert("上传文件格式只能是GIF/JPEG/JPG/SWF!");
fun_back();
exit();
}
$picname=$_SESSION["adser_username"]."/".$_SESSION["adser_username"]."_".$time.".".$f_type;
$realpicurl="../ads/".$picname;
$dirname="../ads/".$_SESSION["adser_username"];
if(!(file_exists("$dirname") && is_dir("$dirname"))){
mkdir("$dirname", 0777);
}
copy($file,$realpicurl);
}else{
$picname=$row["picname"];
}
if($_POST["over_y"]=="-" || $_POST["over_m"]=="-" || $_POST["over_d"]=="-"){
$overtime="0000-00-00 00:00:00";
}else{
$overtime=$_POST["over_y"]."-".$_POST["over_m"]."-".$_POST["over_d"]." 23:59:59";
}
$alert_num=empty($_POST["alert_num"])?500:$_POST["alert_num"];
$insert="INSERT INTO `ads_s` ( `s_id` , `adser_id` ,`username` , `own_type` , `ads_type` , `ads_form_id` , `price` , `old_price` , `totpub` ,`spare` , `money`, `url` , `openurl` , `openurl2` , `openurl3` , `openurl4` , `openurl5` , `link_tit` ,`conn`, `picname` , `rate`, `time` , `overtime` ,`alert_num`, `admin_stat`)
VALUES ('$row[id]','$_SESSION[adser_userid]','$_SESSION[adser_username]','$row[own_type]','$row[ads_type]','$row[ads_form_id]','$_POST[price]','$_POST[hnprice]','$row[totpub]','$row[spare]','$totmoney','$_POST[url]','$_POST[openurl]','$_POST[openurl2]','$_POST[openurl3]','$_POST[openurl4]','$_POST[openurl5]','$_POST[link_tit]','$_POST[conn]','$picname','$row[rate]','$datetime','$overtime','$alert_num','1')";
$rsu=mysql_query($insert);
//echo "$rsu = <br> $insert";
if($rsu){
echo "修改广告成功!请等待管理员审核!";
fun_alert("修改广告成功!请等待管理员审核!");
fun_goto("../adser/ads_stat.php");
}else{
echo "修改广告失败!请联系管理员!";
fun_alert("修改广告失败!请联系管理员!");
fun_back();
}
exit();
}
$sql="select * from advertizer where username='$_SESSION[adser_username]'";
$rs=mysql_query($sql);
$row=mysql_fetch_array($rs);
$balance=$row["balance"];
$sql="select * from ads where username='$_SESSION[adser_username]' and own_type='1' and id='$_REQUEST[edit_id]'";
$rs=mysql_query($sql);
$rowe=mysql_fetch_array($rs);
$ads_stat=$rowe["ads_stat"];
$ads_type=$rowe["ads_type"];
$admin_stat=$rowe["admin_stat"];
if($ads_stat==3){
echo "不能修改!此广告已撤消!";
fun_alert("不能修改!此广告已撤消!");
fun_back();
exit();
}
$picurl=$rowe["picname"];
$overtime=$rowe["overtime"];
$oy=substr($overtime,0,4);
$om=substr($overtime,5,2);
$od=substr($overtime,8,2);
if($oy=="0000"){$oy="-";}
if($om=="00"){$oy="-";}
if($od=="00"){$oy="-";}
?>
<script>
<!--
function check_sub(){
if(check_number("单价",document.form1.price)){return false;}
var price=document.form1.price.value*1;
var hnprice=document.form1.hnprice.value*1;
if(price<hnprice || document.form1.money.value<0){
alert(document.form1.price.value+"单价值不能小于"+document.form1.hnprice.value+"元!");
document.form1.price.focus();
return false;
}
if(check_number("设定剩余提醒",document.form1.alert_num)){return false;}
if(check_null("点击链接地址",document.form1.url)){return false;}
if(check_null("默认弹窗地址",document.form1.openurl)){return false;}
document.form1.submit();
}
function counter(){
var totpub=document.form1.hnspare.value*1;
var now_price=document.form1.price.value*1;
var old_price=document.form1.hnprice.value*1;
var hn_balance=document.form1.hn_balance.value;
var rate=document.form1.hnrate.value;
var price=now_price-old_price;
var totmoney=Math.round(totpub*price*((1+rate/100)*(1+rate/100)+0.1)/10)/100;
if(totmoney>hn_balance){
alert("抱歉,您的当前帐户余额已不足支付提高单价所需金额!");
document.form1.price.value=old_price;
return false;
}else{
document.form1.hntotmoney.value=totmoney;
document.form1.money.value=totmoney;
}
}
-->
</script>
<table width="1001" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#f7f7f7">
<tr>
<td width="200" height="323" valign="top" bgcolor="#E8EEF4">
<?
include("menu.php");
?></td>
<td align="center" valign="top" class="bgconn">
<table width="98%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td height="40" class="orange_text">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" align="left" valign="middle"><img src="../image/ab16.gif" width="75" height="20"></td>
</tr>
<tr>
<td align="center" valign="middle">
<table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20" align="left" valign="middle"> 请按提示完整填写要修改的广告项目信息。广告项目图片(动画)必须提交至系统,为不影响广告美观,请严格控制广告图片(动画)尺寸。</td>
</tr>
<tr>
<td height="20" align="left" valign="middle"> 注:广告模式为全屏弹出窗口无须提交广告图片(动画)。
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="25" align="left" valign="middle">
<table width="50%" border="0" cellpadding="0" cellspacing="0">
<tr align="center" valign="middle">
<td width="5%"><img src="../image/bot14.gif" width="16" height="16"></td>
<td width="52%" align="left"><a href="message_add.php?tit=修改广告"><span class="bluetext">关于本问题给我们留言</span></a></td>
<td width="6%"><img src="../image/bot13.gif" width="16" height="16"></td>
<td width="37%" align="left"><span class="orange_text">电话:<?=$cfg_phone?></span></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="4" bgcolor="#556D85" ></td>
</tr>
<tr><td height="3"></td></tr>
</table>
<table width="98%" border="0" cellspacing="1" cellpadding="3" class="listtable">
<form action="" method="post" enctype="multipart/form-data" name="form1">
<tr align="center" class="listbody">
<td colspan="2" class="listtbhd" height="28">
<div align="center" >修改混合(弹窗/点击)广告</div></td>
</tr>
<tr class="listbody">
<td width="18%" height=28>
<div align="right">广告项目名称:</div></td>
<td width="82%">
<input name="link_tit" type="text" class="text" id="link_tit" value="<?=$rowe[link_tit]?>" size="30" maxlength="15"> 用于标识广告,请勿重名(15个字以内)
<input name="hn_edit_id" type="hidden" id="hn_edit_id" value="<?=$_REQUEST["edit_id"]?>">
</td>
</tr>
<tr class="listbody" height=28>
<td><div align="right">广 告 状 态 :</div></td>
<td><div align="left">
<?=$cfg_adsstat["$ads_stat"]?>
</div></td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -