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

📄 leads_modify.php

📁 VIP信息处理系统源码
💻 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"])/10)/100;
	if($totmoney>$_POST["hn_balance"]){
		echo "抱歉,您的当前帐户余额已不足支付提高单价所需金额!";
		fun_alert("抱歉,您的当前帐户余额已不足支付提高单价所需金额!");
		fun_back();
		exit();
	}
	
	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` , `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]','$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);

if(!empty($maxp) || !empty($minp)){
	$maxprice=empty($maxp)?"&nbsp;":"当前系统中最高单价:<span class=\"orange_text\">$maxp</span>元/千次";
	$minprice=empty($minp)?"&nbsp;":"当前系统中最低单价:<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;
	}
	var hnscnum=document.form1.hnscnum.value*1;
	var hnminp=document.form1.hnminp.value*1;
	if(hnscnum>=60 && price<hnminp){
		alert("您定制的单价小于系统中文字广告队列中最小值,您发布的广告将无法显示在文字广告中,请重新填写!");
		document.form1.price.focus();
		return false;
	}
	if(check_number("设定剩余提醒",document.form1.alert_num)){return false;}
	if(check_null("点击链接地址",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">&nbsp;&nbsp;&nbsp;&nbsp;请按提示完整填写要修改的广告项目信息。</td>
                      </tr>
					  <tr>
                        
                      <td height="20" align="left" valign="middle">&nbsp;&nbsp;&nbsp;&nbsp;注:修改广告项目后请及时联系我们为您审核。</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%"> 
              <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"><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>
		  </tr>
          <tr class="listbody" height=28> 
            <td><div align="right">审 核 状 态 :</div></td>
          <td><div align="left">
            <?=$cfg_defstat["$admin_stat"]?>
          </div></td>
		  </tr>
          <tr class="listbody" height=28> 
            <td> 
              <div align="right">广 告 规 格 :</div></td>
            <td> 
文字广告</td>
          </tr>
          <tr class="listbody"> 
            <td> 
              <div align="right">当前帐户余额:</div></td>
            <td>
<input name="balance" type="text" id="balance" size="8" maxlength="15" readonly=""  class="text" value="<? echo (empty($balance))?"0":$balance;?>" >
              <input name="hn_balance" type="hidden" id="hn_balance" value="<?=$balance?>">
            </td>
          </tr>
          <tr class="listbody" height=28> 
            <td> 
              <div align="right">投 放 数 量 :</div></td>
            <td> 
<?=$rowe["totpub"]?>
          </tr>
          <tr class="listbody" height=28> 
            <td> 
              <div align="right">剩 余 数 量 :</div></td>
            <td> 
<?=$rowe["spare"]?>
<input name="hnspare" type="hidden" id="hnspare" value="<?=$rowe["spare"]?>"></td>
          </tr>
          <tr class="listbody"> 
            <td> 
              <div align="right">单    价 :</div></td>
            <td>
<input name="price" type="text" class="text" id="price" value="<?=$rowe[price]?>" size="8" maxlength="11" onKeyUp="counter()"> 元/1000次 
<input name="hnprice" type="hidden" id="hnprice" value="<?=$rowe[price]?>">
<input name="hnminp" type="hidden" id="hnminp" value="<?=$minp?>">
<input name="hnscnum" type="hidden" id="hnscnum" value="<?=$scnum?>">
<input name="hn_profit" type="hidden" id="hn_profit" value="<?=$profit?>"></td>
          </tr>
          <tr class="listbody"> 
            <td> 
              <div align="right">发布后的单价:</div></td>
            <td>
<input name="webprice" type="text" class="text" id="webprice" size="8" maxlength="11" readonly=""> 元/1000次 
(参考单价:
 <?=$str_vprice?>
 )</td>
          </tr>
          <tr class="listbody"> 
            <td height="30"> 
              <div align="right">单 价 差 额 :</div></td>
            <td>
<input name="money" type="text" class="text" id="money"  size="8" maxlength="15" readonly="">
              <input name="hntotmoney" type="hidden" id="hntotmoney"></td>
          </tr>
          <tr class="listbody"> 
            <td> 
              <div align="right">设定剩余提醒:</div></td>
            <td>
<input name="alert_num" type="text" class="text" id="alert_num" value="<?=$rowe[alert_num]?>" size="8" maxlength="15">
              (在剩余量小于此数时系统发消息提醒,默认为500) </td>
          </tr>          
          <tr class="listbody"> 
            <td> 
              <div align="right">终 止 日 期 :</div></td>
            <td> 
              <select name="over_y" id="over_y">
                <?
				echo "<option value='-'>----</option>";
				for($y=date("Y");$y<=2008;$y++){
					echo "<option value=$y";
					if($y==$oy)echo " selected";
					echo ">$y</option>";
				}
				?>
              </select>
              <select name="over_m" id="over_m">
                <?
				echo "<option value='-'>--</option>";
				for($m=1;$m<=12;$m++){
					$mm=($m<10)?"0".$m:$m;
					echo "<option value=$mm";
					if($mm==$om)echo " selected";
					echo ">$mm</option>";
				}
				?>
              </select>
              <select name="over_d" id="over_d">
                <?
				echo "<option value='-'>--</option>";
				for($d=1;$d<=31;$d++){
					$dd=($d<10)?"0".$d:$d;
					echo "<option value=$dd";
					if($dd==$od)echo " selected";
					echo ">$dd</option>";
				}
				?>
              </select>
              日 (不填为至投放量结束时终止)</td>
          </tr>
          <tr class="listbody"> 
            <td> 
              <div align="right">点击链接地址:</div></td>
            <td>
<input name="url" type="text" id="url" size="60" maxlength="80" class="text" value=<?=$rowe["url"]?> >
            </td>
          </tr>
          <tr class="listbody"> 
            <td> 
              <div align="right">广 告 简 介 :</div></td>
            <td>
<input name="conn" type="text" class="text" id="conn" value="<? $conn=nl2br($rowe["conn"]);echo $conn;?>" size="60" maxlength="35">
              (最多35字) </td>
          </tr>
          <tr class="listbody"> 
            <td align="right"> 
              <div align="center">&nbsp; </div></td>
            <td> 
<input type="button" name="Submit" value="确认修改" class="subbt" onClick="check_sub()">
 <input type="reset" name="reset" value="清空重写" class="subbt">
<input type="button" name="reset2" value="返回上页" class="subbt" onClick="history.go(-1)">
<input name="hnsubmit" type="hidden" id="hnsubmit" value="1">
            </td>
          </tr>
        </form>
      </table>
        
      <p><br>
        <br>
        <br>
        <br>
        <br>
        <br>
      </p></td>
    </tr>
  </table>
<?
include("../adser/foot.php");
?>

⌨️ 快捷键说明

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