查看文件: ad_browseedit.php
大小: 7.24 KB
类型: application/octet-stream
<?php require('system/login.php'); ?> <?php require_once('../Connections/BE2.php'); ?> <?php $picpath= "/products/"; $write=''; if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $img=$_POST['img']; $imgext=$_POST['imgext']; $tfile="fileToUpload1"; if($_POST['webpicname']<>''){ $ext= explode('.',$_POST['webpicname']) ; $imgext=strtolower($ext[count($ext)-1]); //取最後一筆 $pic=$wwwpath.$picpath.$img.".".$imgext; copy("../webpic/".$_POST['webpicname'],$pic); } else if($_FILES[$tfile]["name"]<>''){ $ext= explode('.',$_FILES[$tfile]['name']) ; $imgext=strtolower($ext[count($ext)-1]); //取最後一筆 $pic=$wwwpath.$picpath.$img.".".$imgext; move_uploaded_file($_FILES[$tfile]["tmp_name"],$pic); } $updateSQL = sprintf("update adpic set flag='%s',doc='%s',link='%s',ind='%s',img='%s',imgext='%s' ,imgtxt='%s',linktag='%s',sdate='%s',edate='%s',bman='%s',bmm1='%s',bmm2='%s' WHERE id='%s'",$_POST['flag'],$_POST['doc'],$_POST['link'],$_POST['ind'],$img,$imgext,$_POST['imgtxt'],$_POST['linktag'],$_POST['sdate'],$_POST['edate'],$_POST['bussman'],$_POST['bmm1'],$_POST['bmm2'],$_POST['id']); mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($updateSQL, $BE2) or die(mysql_error()); $write='資料已更新...'; $insertGoTo = $_POST['url']; // header(sprintf("Location: %s", $insertGoTo)); echo "<script>alert('".$write."');location.href='".$_POST['url']."';</script>"; } $bid=-1; if(isset($_GET['id'])){ $bid=$_GET['id']; } mysql_select_db($database_BE2, $BE2); //$query_Rt2 = sprintf("SELECT a.*,b.* FROM ap1 as a ,adpic as b WHERE a.raid=b.bid AND b.id='%s'",$bid); $query_Rt2 = sprintf("SELECT a.*,b.*,d.* FROM ap1 as a ,adpic as b,ap2 as c,adpage as d WHERE a.raid=b.bid AND b.xid=c.adid AND c.webid=d.pid AND b.id='%s'",$bid); $Rt2 = mysql_query($query_Rt2, $BE2) or die(mysql_error()); $row_Rt2 = mysql_fetch_assoc($Rt2); $totalRows_Rt2 = mysql_num_rows($Rt2); // if($myadmin){ echo $query_Rt2; } mysql_select_db($database_BE2, $BE2); $query_Rtm = "SELECT * FROM buser WHERE flag = 'Y' ORDER BY id ASC"; $Rtm = mysql_query($query_Rtm, $BE2) or die(mysql_error()); $row_Rtm = mysql_fetch_assoc($Rtm); $totalRows_Rtm = mysql_num_rows($Rtm); ?> <form id="form1" name="form1" method="POST" enctype="multipart/form-data" action=""> <table border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <th nowrap="nowrap" class="font2" > </th> <th colspan="5" nowrap="nowrap" class="font2" ><? echo $row_Rt2['pdoc']."-".$row_Rt2['ra2'];?></th> </tr> <tr> <th nowrap="nowrap" class="font2" > </th> <th nowrap="nowrap" class="font2" >圖片說明</th> <th nowrap="nowrap" class="font2" >連結</th> <th nowrap="nowrap" class="font2" >連結模式</th> <th nowrap="nowrap" class="font2" >排序 </th> <th nowrap="nowrap" class="font2" >開啟使用</th> </tr> <tr > <td> </td> <td><input name="doc" type="text" id="doc" value="<? echo $row_Rt2['doc'];?>" /> <input name="bid" type="hidden" id="bid" value="<? echo $row_Rt2['c0'];?>" /> <input name="id" type="hidden" id="id" value="<? echo $row_Rt2['id'];?>" /> <input name="img" type="hidden" id="img" value="<? echo $row_Rt2['img'];?>" /> <input name="imgext" type="hidden" id="imgext" value="<? echo $row_Rt2['imgext'];?>" /></td> <td><input name="link" type="text" id="link" value="<? echo $row_Rt2['link'];?>" size="40" /></td> <td><label for="select"></label> <select name="linktag" id="linktag"> <option value="_blank" <?php if (!(strcmp("_blank", $row_Rt2['linktag']))) {echo "selected=\"selected\"";} ?>>開新視窗</option> <option value="_self" <?php if (!(strcmp("_self", $row_Rt2['linktag']))) {echo "selected=\"selected\"";} ?>>無</option> </select></td> <td><input name="ind" type="text" id="ind" value="<? echo $row_Rt2['ind'];?>" size="5" maxlength="5" /></td> <td><select name="flag"> <option value="Y" <? if($row_Rt2['flag']=='Y'){ ?> selected="selected" <? } ?>>Y</option> <option value="N" <? if($row_Rt2['flag']=='N'){ ?> selected="selected" <? } ?>>N</option> </select></td> </tr> <tr> <td> </td> <th align="right">啟用日期</th> <td><input name="sdate" type="text" id="sdate" value="<? echo $row_Rt2['sdate'];?>" /></td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <th align="right">截止日期</th> <td><input name="edate" type="text" id="edate" value="<? echo $row_Rt2['edate'];?>" /></td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <th align="right">其它說明</th> <td><textarea name="imgtxt" cols="40" rows="4" id="imgtxt"><? echo $row_Rt2['imgtxt'];?></textarea></td> <td> </td> <td colspan="2"><img src="" alt="" id="webpicid"/></td> </tr> <tr> <td> </td> <th align="right">業務</th> <td><select name="bussman" id="bussman"> <?php do { ?> <option value="<?php echo $row_Rtm['id']?>"<?php if (!(strcmp($row_Rtm['id'], $row_Rt2['bman']))) {echo "selected=\"selected\"";} ?>><?php echo $row_Rtm['aname']?></option> <?php } while ($row_Rtm = mysql_fetch_assoc($Rtm)); ?> </select></td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <th align="right">商品金額</th> <td><input name="bmm1" type="text" id="bmm1" value="" size="12" maxlength="6" /></td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <th align="right">業務獎金</th> <td><input name="bmm2" type="text" id="bmm2" value="" size="12" maxlength="6" /> <input name="url" type="hidden" id="url" value="<? echo $_SERVER['HTTP_REFERER']; ?>" /></td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td colspan="2"><input name="fileToUpload1" type="file" id="fileToUpload1" /> (<? echo $row_Rt2['ra2'];?>) </td> <td><input type="button" name="selwebpic" value="瀏覽主機端" onclick="show_webpic();"/></td> <td><input name="webpicname" type="hidden" id="webpicname" value="" /></td> <td> </td> </tr> <tr> <td> </td> <td colspan="2"> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td colspan="2"><? if($row_Rt2['raid']==14){?>YOUTUBE影片 請直接輸入紅色連結字串即可<br> 例 https://www.youtube.com/watch?v=<font color="#FF0000">kTAv4HCCnw0</font><? }?></td> <td> </td> <td><input type="submit" name="Submit" value="送出" /></td> <td> </td> </tr> </table> <input name="MM_insert" type="hidden" id="MM_insert" value="form1"> <input name="MM_bannerfile" type="hidden" id="MM_bannerfile" value="bannerfile" /> </form> <?php mysql_free_result($Rt2); mysql_free_result($Rtm); ?>
保存
取消
返回文件列表