📄 piads_modify.php
字号:
<?
/**********************************
* 修改广告
* 建立:2005-01-18 qinsy
* 最后修改:2005-01-21 qinsy
***********************************/
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"])/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` , `link_tit` , `conn` ,`picname`, `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[link_tit]','$_POST[conn]','$picname','$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"];
$profit=(empty($row["profit"]))?0.8:$row["profit"];
$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="-";}
include_once("../ads_letter/scfile.php");
$scnum=count($arr_price);
$maxp=max($arr_price);
$minp=min($arr_price);
$sqlads="select max(price*profit) as max, min(price*profit) as min from ads where ads_stat=2 and own_type=1 and ads_type=4";
$rowads=mysql_fetch_array(mysql_query($sqlads));
$maxp=round($rowads["max"]*100)/100;
$minp=round($rowads["min"]*100)/100;
if(!empty($maxp) || !empty($minp)){
$maxprice=empty($maxp)?" ":"当前系统中最高单价:<span class=\"orange_text\">$maxp</span>元/千次";
$minprice=empty($minp)?" ":"当前系统中最低单价:<span class=\"orange_text\">$minp</span>元/千次";
$str_vprice=$maxprice." ".$minprice;
}else{
$str_vprice="$cfg_leadsrecom 元/1000次";
}
?>
<script>
<!--
function check_sub(){
if(check_null("广告项目名称",document.form1.link_tit)){return false;}
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.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_siteurl("点击链接地址",document.form1.url)){return false;}
document.form1.submit();
}
function counter(){
var spare=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 price=now_price-old_price;
var hn_profit=document.form1.hn_profit.value*1;
var totmoney=Math.round(spare*price/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;
}
var webprice=hn_profit*now_price;
document.form1.webprice.value=webprice;
}
-->
</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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -