查看文件: body_editnetinshop3.php
大小: 10.64 KB
类型: application/octet-stream
<?php require_once('../Connections/BE2.php'); ?> <?php if (!isset($_SESSION)){ session_start(); } if($_SESSION['login_companyck']<>"Y"){ return -1 ;} if( isset($_POST["MM_update"]) && ($_POST["MM_update"] == "fp1")){ if($_POST['wid']==0){ $updateSQL = sprintf("INSERT INTO ecardext (wtitle,wlink,wimg,wimgext,windex,wflag,wkid,wuid)VALUES (%s,%s,%s,%s,%s,%s,%s,%s)", GetSQLValueString($_POST['wtitle'], "text"), GetSQLValueString($_POST['wlink'], "text"), GetSQLValueString($_POST['wimg'], "text"), GetSQLValueString($_POST['wimgext'], "text"), GetSQLValueString($_POST['windex'], "int"), GetSQLValueString($_POST['wflag'], "int"), GetSQLValueString($_POST['wkid'], "int"), GetSQLValueString($_SESSION['login_coid'], "int")); //$_SESSION['login_memid'] } else{ $updateSQL = sprintf("UPDATE ecardext SET wtitle=%s,wlink=%s,wimg=%s,wimgext=%s,wflag=%s WHERE wkid=3 AND wid=%s AND wuid=%s", GetSQLValueString($_POST['wtitle'], "text"), GetSQLValueString($_POST['wlink'], "text"), GetSQLValueString($_POST['wimg'], "text"), GetSQLValueString($_POST['wimgext'], "text"), GetSQLValueString($_POST['wflag'], "int"), GetSQLValueString($_POST['wid'], "int"), GetSQLValueString($_SESSION['login_coid'], "int")); //$_SESSION['login_memid'] } mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($updateSQL, $BE2) or die(mysql_error()); $msg='更新完成....' ; $updateGoTo = "netinshop3.html"; echo "<script>alert('".$msg."');location.href='".$updateGoTo."';</script>"; } //update `member` set company_title=mem_name WHERE mem_auto>10 and mem_auto<26 $id=-1; $id= (isset($_GET["id"]))?$_GET["id"]:-1; $canedit=true; if($id>15){ $id=15;} // <img name="" src="/shopmap/images/logo_7.jpg" title="禾昌國際家用電器"> mysql_select_db($database_BE2, $BE2); $query_Rtc = sprintf("SELECT a.ccid,a.duid,max(a.pdate),d.coid,d.company_name,d.company_title from order_percent as a, order_datas as b,devshop as c,company as d where a.ccid=b.ccid AND b.mem_auto=c.pid AND a.duid=d.mid AND a.puid='%s' group by a.duid",$_SESSION['login_coid']); // $query_Rt3 = sprintf("SELECT * FROM webshop WHERE wid= '%s' ",$id); $Rtc = mysql_query($query_Rtc, $BE2) or die(mysql_error()); $row_Rtc = mysql_fetch_assoc($Rtc); $totalRows_Rtc = mysql_num_rows($Rtc); mysql_select_db($database_BE2, $BE2); $query_Rt3 = sprintf("SELECT * FROM ecardext WHERE wkid=3 AND wuid= '%s' AND windex='%s' " ,$_SESSION['login_coid'],$id); // $query_Rt3 = sprintf("SELECT * FROM webshop WHERE wid= '%s' ",$id); $Rt3 = mysql_query($query_Rt3, $BE2) or die(mysql_error()); $row_Rt3 = mysql_fetch_assoc($Rt3); $totalRows_Rt3 = mysql_num_rows($Rt3); ?> <style> .box2{ border-width:3px; border-style:dashed; border-color:#FFAC55; padding:5px; } img{ max-width: 100%; max-height: 100%; display: block; /* remove extra space below image */ } .box{ width: 250px; border: 5px solid black; } .box.large{ height: 300px; } .box.small{ height: 100px; } </style> <div class="main "> <div class="row"> <div class="col-lg-12"> <h3 class="page-header"><i class="fa fa-indent"></i>九宮格店中店區塊</h3> <ol class="breadcrumb"> <li><i class="fa fa-home"></i><a href="index.html">首頁</a></li> <li><i class="fa fa-list-alt"></i><a href="#">企業資料</a></li> <li><i class="fa fa-indent"></i>九宮格店中店區塊</li> </ol> </div> </div> <? if($canedit){ ?> <div class="row"> <div class="col-sm-6"> <div class="panel panel-default"> <div class="panel-heading"> <h2><i class="fa fa-indent red"></i><strong>九宮格店中店區塊</strong></h2> </div> <div class="panel-body"> <form action="" method="post" name="fop1" id="fop1" enctype="multipart/form-data"> <div class="form-group"> <label class="col-md-3 control-label" for="wtitle"> 店中店選取: </label> <div class="col-md-9"> <select class="form-control select" name="pname" id="pname" onchange="found_shop()"> <option value="0" >無</option> <? $wimg=''; if($row_Rt3['wimg']<>''){ $wimg=$row_Rt3['wimg'].'.'.$row_Rt3['wimgext']; } $adoc=''; $alink=''; if($totalRows_Rtc>0){ do { $adoc .= '"'.$row_Rtc['company_title'].'",' ; $alink .= $row_Rtc['coid'].',' ; // duid ?> <option value="<?=$row_Rtc['coid']?>" <?= $row_Rtc['coid']==$row_Rt3['wlink']?'selected="selected"':''; ?> ><?=$row_Rtc['company_title']?></option> <?php } while ($row_Rtc = mysql_fetch_assoc($Rtc)); } ?> </select> <input type="hidden" name="wid" id="wid" value="<?= isset($row_Rt3['wid'])?$row_Rt3['wid']:0; ?>" /> <input type="hidden" name="wimg" id="wimg" value="<?= isset($row_Rt3['wimg'])?$row_Rt3['wimg']:"" ?>" /> <input type="hidden" name="wimgext" id="wimgext" value="<?= isset($row_Rt3['wimgext'])?$row_Rt3['wimgext']:""; ?>" /> <input type="hidden" name="wkid" id="wkid" value="3" /> <input type="hidden" name="windex" id="windex" value="<?= $id ?>" /> <input type="hidden" name="wuid" id="wuid" value="<?= $_SESSION['login_coid'] ?>" /> <span class="help-block"> </span> </div> </div> <br><br><br> <div class="form-group"> <label class="col-md-3 control-label" for="wlink">標題說明:</label> <div class="col-md-9"> <input type="text" name="wtitle" id="wtitle" placeholder="請填寫標題說明" value="<?= isset($row_Rt3['wtitle'])?$row_Rt3['wtitle']:""; ?>" maxlength="200" size="40"/> <span class="help-block"> </span> </div> </div> <br><br> <div class="form-group"> <label class="col-md-3 control-label" for="wlink">連結:</label> <div class="col-md-9"> <? // https://www.skybni.com/shopid/7 ?> <input name="wlink" type="text" id="wlink" placeholder="請填寫要連結的網址" value="<?= $row_Rt3['wlink'] ; ?>" maxlength="200" size="40" readonly="readonly" /> <span class="help-block"> </span> </div> </div> <div class="form-group"> <label class="col-md-3 control-label" for="wlink">啟用:</label> <div class="col-md-9"> <? $ss= isset($row_Rt3['wflag'])?$row_Rt3['wflag']:"1"; ?> 啟用<input name="wflag" type="radio" id="wflag" value="1" <?= ($ss==1)?'checked="checked"':'' ?> /> 不啟用<input type="radio" name="wflag" id="wflag" value="0" <?= ($ss==0)?'checked="checked"':'' ?>/> <span class="help-block"> </span> </div> </div> <div class="form-group"> <div class="col-md-9"> <div id="imgtmp"><img name="" src="/shopmap/images/<?= $wimg ?>" title="" /></div> <span class="help-block"> 圖檔 Size 350 x 350 dpi </span> </div> </div> <div class="form-group"> <div class="col-md-9"> <span class="help-block"> </span> </div> </div> <div class="form-group"> <div class="col-md-9"> <span class="help-block"></span> </div> </div> <div class="form-group form-actions"> <button type="submit" class="btn btn-primary">保存</button> </div> <input type="hidden" name="MM_update" value="fp1" /> <input type="hidden" id="wuid" name="wuid" value="<?= $row_Rt3['wuid'] ; ?>" /> </form> </div> </div> </div> </div> <!-- end: Content --> <? } ?> <!-- end: Content --> <div class="clearfix"> </div> <button onclick="window.location.href='netinshop3.html';" >回上頁</button> <script type="text/javascript"> function found_shop() { var v=$('#pname').val(); $('#wtitle').val($("#pname").find(':selected').text()); $('#wlink').val(v); $('#wimg').val('logo_'+v); $('#wimgext').val('jpg'); $('#imgtmp').html('<img name="img2" src="/shopmap/images/logo_'+v+'.jpg" title="國際" >'); }; </script> <?php mysql_free_result($Rt3); ?>
保存
取消
返回文件列表