adfd.php 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <?
  2. include("../config/conn.php");
  3. include("../config/function.php");
  4. sesCheck();
  5. $bh=$_GET[bh];
  6. $sj=date("Y-m-d H:i:s");
  7. while0("*","yjcode_adlx where bh='".$bh."' and fflx=2 and admin=1");if(!$row=mysql_fetch_array($res)){php_toheader("adlx1.php");}
  8. $id=$_GET[id];
  9. $sqluser="select * from yjcode_user where uid='".$_SESSION[SHOPUSER]."'";mysql_query("SET NAMES 'GBK'");$resuser=mysql_query($sqluser);
  10. if(!$rowuser=mysql_fetch_array($resuser)){php_toheader("../reg/");}
  11. if($_GET[control]=="add"){ //表示新增
  12. zwzr();
  13. $d1=intval($_POST[d1]);
  14. while1("*","yjcode_adlx where id=".$d1);if(!$row1=mysql_fetch_array($res1)){php_toheader("adlx1.php");}
  15. if($rowuser[money1]<$row1[money1]){Audit_alert("余额不足,请先充值!","pay.php");}
  16. $dqsj=date("Y-m-d H:i:s",strtotime("+".$row1[tianshu]." day"));
  17. $nxh=$row1[xh];
  18. $R1=sqlzhuru($_POST[R1]);
  19. $userid=$rowuser[id];
  20. $mbh=time()."adu".$userid;
  21. if($R1=="图片"){$tp=inp_tp_upload(1,"../".returnjgdw($rowcontrol[addir],"","gg")."/",$mbh);}elseif($R1=="动画"){$tp=inp_tp_upload(2,"../".returnjgdw($rowcontrol[addir],"","gg")."/",$mbh);}
  22. if($tp!=""){$b=preg_split("/\./",$tp);$tptype=$b[1];}else{$tptype="";}
  23. if($R1=="图片"){$aurl=sqlzhuru($_POST[t1]);}elseif($R1=="文字"){$aurl=sqlzhuru($_POST[t3]);}
  24. if(panduan("*","yjcode_ad where adbh='".$row[adbh]."' and zt<>99 and xh=".$nxh."")==1){$zt=1;}else{$zt=0;}
  25. intotable("yjcode_ad","bh,type1,jpggif,tit,adbh,txt,sj,aurl,xh,aw,ah,dqsj,zt,money1,userid","'".$mbh."','".$R1."','".$tptype."','".sqlzhuru($_POST[at1])."','".$row[adbh]."','".sqlzhuru($_POST[s1])."','".$sj."','".$aurl."',".$nxh.",".sqlzhuru($_POST[t2]).",".sqlzhuru($_POST[t4]).",'".$dqsj."',".$zt.",".$row1[money1].",".$userid."");
  26. PointUpdateM($userid,$row1[money1]*(-1));
  27. PointIntoM($userid,"购买自助广告位".$row[adbh],$row1[money1]*(-1));
  28. php_toheader("adlxlist.php?zt=".$zt);
  29. }
  30. ?>
  31. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  32. <html xmlns="http://www.w3.org/1999/xhtml">
  33. <head>
  34. <meta http-equiv="x-ua-compatible" content="ie=7" />
  35. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  36. <title>用户管理面板 - <?=webname?></title>
  37. <? include("cssjs.html");?>
  38. <link href="css/hudong.css" rel="stylesheet" type="text/css" />
  39. <script language="javascript">
  40. function lxsel(x){
  41. document.getElementById("adtp").style.display="none";
  42. document.getElementById("adcode").style.display="none";
  43. document.getElementById("adfont").style.display="none";
  44. document.getElementById("adflash").style.display="none";
  45. switch(x){
  46. case "图片":
  47. document.getElementById("adtp").style.display="";
  48. break;
  49. case "代码":
  50. document.getElementById("adcode").style.display="";
  51. break;
  52. case "文字":
  53. document.getElementById("adfont").style.display="";
  54. break;
  55. case "动画":
  56. document.getElementById("adflash").style.display="";
  57. break;
  58. }
  59. }
  60. function tj(x){
  61. if((document.f1.at1.value).replace(/\s/,"")==""){alert("请输入广告标题");document.f1.at1.focus();return false;}
  62. r=document.getElementsByName("R1");rr="";for(i=0;i<r.length;i++){if(r[i].checked==true){rr=r[i].value;}}if(rr==""){alert("请选择类型!");return false;}
  63. if(rr=="动画"){
  64. if((document.f1.t2.value).replace(/\s/,"")=="" || isNaN(document.f1.t2.value)){alert("请输入有效的动画宽度");document.f1.t2.focus();return false;}
  65. if((document.f1.t4.value).replace(/\s/,"")=="" || isNaN(document.f1.t4.value)){alert("请输入有效的动画高度");document.f1.t4.focus();return false;}
  66. }
  67. if(!confirm("确定提交吗?一经提交,不可修改,请核对仔细!")){return false;}
  68. layer.msg('正在提交', {icon: 16 ,time: 0,shade :0.25});
  69. tjwait();
  70. f1.action="adfd.php?control=add&bh=<?=$bh?>&id=<?=$id?>";
  71. }
  72. </script>
  73. </head>
  74. <body>
  75. <? include("../tem/top.html");?>
  76. <? include("top.php");?>
  77. <div class="yjcode">
  78. <? include("left.php");?>
  79. <!--RB-->
  80. <div class="userright">
  81. <? include("rcap14.php");?>
  82. <script language="javascript">
  83. document.getElementById("rcap1").className="l1 l2";
  84. </script>
  85. <!--白B-->
  86. <div class="rkuang">
  87. <ul class="ukad">
  88. <li class="l1">选择位置:</li>
  89. <li class="l2">
  90. <?
  91. $i=0;
  92. while1("*","yjcode_adlx where admin=2 and bh='".$bh."' GROUP by xh");while($row1=mysql_fetch_array($res1)){
  93. if(panduan("*","yjcode_ad where zt<>99 and adbh='".$row[adbh]."' and xh=".$row1[xh]."")==1){$s="s3 s31";$sy="已售可预定";}
  94. else{$s="s3";$sy="点击购买";}
  95. ?>
  96. <a class="<?=$s?>" href="adfd.php?bh=<?=$bh?>&id=<?=$row1[id]?>"><b>位置<?=$row1[xh]?></b><br><strong><?=$sy?></strong></a>
  97. <? $i++;}?>
  98. </li>
  99. </ul>
  100. <?
  101. if(!empty($id)){
  102. $sqlad="select * from yjcode_adlx where id=".$id;mysql_query("SET NAMES 'GBK'");$resad=mysql_query($sqlad);
  103. if(!$rowad=mysql_fetch_array($resad)){php_toheader("adlx1.php");}
  104. ?>
  105. <form name="f1" method="post" onsubmit="return tj()" enctype="multipart/form-data">
  106. <ul class="uk uk0">
  107. <li class="l1">广告位:</li>
  108. <li class="l21"><?=$row[adbh]?>,<?=$row[tit]?></li>
  109. <li class="l1">购买位置:</li>
  110. <li class="l21"><strong class="red" style="font-size:14px"><?=$rowad[xh]?></strong></li>
  111. <li class="l1">排队人数:</li>
  112. <li class="l21"><?=returncount("yjcode_ad where adbh='".$row[adbh]."' and zt=1 and xh=".$rowad[xh]."")?></li>
  113. <li class="l1">广告尺寸:</li>
  114. <li class="l21">宽:<?=returnjgdw($row[adw],"px","不限")?>,高:<?=returnjgdw($row[adh],"px","不限")?></li>
  115. <li class="l1">您的余额:</li>
  116. <li class="l21"><?=$rowuser[money1]?>元 [<a href="pay.php" target="_blank">充值</a>]</li>
  117. <li class="l1"><span class="red">*</span> 购买天数:</li>
  118. <li class="l2">
  119. <select name="d1" class="inp">
  120. <option value="0">选择天数</option>
  121. <? while1("*","yjcode_adlx where admin=2 and bh='".$bh."' and xh=".$rowad[xh]." order by id asc");while($row1=mysql_fetch_array($res1)){?>
  122. <option value="<?=$row1[id]?>"><?=$row1[tianshu]?>天,价格<?=$row1[money1]?>元</option>
  123. <? }?>
  124. </select>
  125. </li>
  126. <li class="l1"><span class="red">*</span> 标题:</li>
  127. <li class="l2"><input name="at1" size="40" class="inp" type="text" /></li>
  128. <li class="l1"><span class="red">*</span> 广告类型:</li>
  129. <li class="l2">
  130. <? if(strstr($row[adty],"xcf1xcf")){?><label><input name="R1" onclick="lxsel('图片')" type="radio" value="图片" /> 图片</label><? }?>
  131. <? if(strstr($row[adty],"xcf2xcf")){?><label><input name="R1" type="radio" value="代码" onclick="lxsel('代码')" /> 代码</label><? }?>
  132. <? if(strstr($row[adty],"xcf3xcf")){?><label><input name="R1" type="radio" value="文字" onclick="lxsel('文字')" /> 文字</label><? }?>
  133. <? if(strstr($row[adty],"xcf4xcf")){?><label><input name="R1" type="radio" value="动画" onclick="lxsel('动画')" /> 动画Flash</label><? }?>
  134. </li>
  135. </ul>
  136. <ul class="uk uk0" id="adtp" style="display:none;">
  137. <li class="l1"><span class="red">*</span> 链接地址:</li>
  138. <li class="l2"><input name="t1" value="http://" size="40" class="inp" type="text" /></li>
  139. <li class="l1"><span class="red">*</span> 广告图片:</li>
  140. <li class="l2"><input type="file" name="inp1" id="inp1" size="15"></li>
  141. </ul>
  142. <ul class="uk uk0" id="adcode" style="display:none;">
  143. <li class="l9"><span class="red">*</span> 代码:</li>
  144. <li class="l10"><textarea name="s1"></textarea></li>
  145. </ul>
  146. <ul class="uk uk0" id="adfont" style="display:none;">
  147. <li class="l1"><span class="red">*</span> 链接地址:</li>
  148. <li class="l2"><input name="t3" value="http://" size="40" class="inp" type="text" /></li>
  149. </ul>
  150. <ul class="uk uk0" id="adflash" style="display:none;">
  151. <li class="l1"><span class="red">*</span> 选择动画:</li>
  152. <li class="l2"><input type="file" name="inp2" id="inp2" size="15"> </li>
  153. <li class="l1"><span class="red">*</span> 宽高设置:</li>
  154. <li class="l2">
  155. <span class="fd">宽:</span><input name="t2" size="10" value="0" class="inp" type="text" />
  156. <span class="fd">高:</span><input name="t4" value="0" size="10" class="inp" type="text" />
  157. </li>
  158. </ul>
  159. <ul class="uk uk0">
  160. <li class="l3"><? tjbtnr("提交购买","adlx1.php")?></li>
  161. </ul>
  162. </form>
  163. <? }?>
  164. </div>
  165. <!--白E-->
  166. </div>
  167. <!--RE-->
  168. </div>
  169. <div class="clear clear15"></div>
  170. <? include("../tem/bottom.html");?>
  171. </body>
  172. </html>