查看文件: index_categoryDetail.php
大小: 16.61 KB
类型: application/octet-stream
<? require_once('./Connections/BE2.php'); if ((isset($_POST["state"])) && ($_POST["state"] == "addCart")) { //p_sess 1=add cart 2, 3= 完成購物 if($_SESSION['login_memid']<>""){ $p_size=$_POST['p_size']=='請選擇'?'':$_POST['p_size']; $p_percent31=$_POST['p_percent31'] ; // 推廣獎金 $p_percent32=$_POST['p_percent32'] ; // 開發獎金 == > 網店經銷獎金 20250110; ,經銷商經銷獎金 2025-01-10 開發商銷售獎金:1000元 $p_percent33=$_POST['p_percent33']; // 開發商首推獎金 單次 首次開店獎金 = 銷售獎金 $p_percent34=$_POST['p_percent34'] ; // 推廣雲點 $p_percent35=$_POST['p_percent35'] ; // 開發雲點 $p_percent36=$_POST['p_percent36'] ; // 開發商續推獎金 $p_percent37=$_POST['p_percent37'] ; // 經銷獎金 $p_percent38=$_POST['p_percent38'] ; // 分享獎金 new 241209 $p_percent39=$_POST['p_percent39'] ; // 推薦獎金 new 241209 to sql tablename pptname $p_percent39=$_POST['p_percent40'] ; // 銷售獎金 new 250110 $p_demoney=$_POST['p_demoney'] ; // 魏繳金額 /* 開發商銷售獎金:1000元 經銷商經銷獎金:500元 刷卡一次付清:3000元 */ // 1 2 3 4 5 6 // $pp1=array("",'推廣獎金','開發獎金','開發商首推獎金','商品未付餘額','開發商續推獎金','經銷獎金'); //$puser=$_SESSION['login_puser'] ;//$_POST['mem_num']; // par id // 檢查 特別開發費 單次 p_percent33 /* //select b.mem_auto from order_datam as a, order_datas as b where a.dcode=b.dcode AND a.duser=16 AND a.dflag='Y' and b.mem_auto=4139 */ mysql_select_db($database_BE2, $BE2); //$qra1 =sprintf("select b.mem_auto from order_datam as a, order_datas as b where a.dcode=b.dcode AND a.duser='%s' AND a.dflag='Y' and b.mem_auto='%s'",$_SESSION['login_memid'],$_POST['mem_auto']); $qra1 =sprintf("select * from member where mem_auto='%s'",$_SESSION['login_memid']); $Rqra1 = mysql_query($qra1, $BE2) or die(mysql_error()); $row_Rqra1 = mysql_fetch_assoc($Rqra1); $totalRows_Rqr2 = mysql_num_rows($Rqra1); if($row_Rqra1['mem_check']=='N'){ $p_percent36=0; ; //開發商續推獎金 =0 // $_POST['p_percent33'] ; // 保留 開發商直銷獎金 } else{ $p_percent31= 0; // 1,保留 開發商續推獎金 開發商直銷獎金=0 } mysql_free_result($Rqra1); $qr_buyonce = sprintf("select b.mem_auto as ct1 from order_datam as a,order_datas as b where a.did=b.ccid AND b.mem_auto='%s' AND a.duser='%s'",$_POST['mem_auto'],$_SESSION['login_memid']); mysql_select_db($database_BE2, $BE2); $Rbuyonce = mysql_query($qr_buyonce, $BE2) or die(mysql_error()); $row_b = mysql_fetch_assoc($Rbuyonce); $totalRows_buyonce = mysql_num_rows($Rbuyonce); $p_buyonce=0; if($totalRows_buyonce>0){$p_buyonce=1;} //$buynow=isset() //$buynow $buynow=(isset($_POST['buynow']))?1:0; $InsertSQL = sprintf("insert into order_tmp (coid,mem_auto,p_count,p_money,member_id,p_sess,p_date,p_size,p_percent,p_percent2,p_percent3,p_percent4,p_percent5,p_percent6,p_percent7,p_percent8,p_percent9,p_demoney,p_express,p_once,p_buynow)VALUES('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s' ,'%s' ,'%s','%s' ,'%s','%s','%s','%s','%s','%s' ,'%s')", $_POST['company_num'], $_POST['mem_auto'],$_POST['p_count'],$_POST['p_money'],$_SESSION['login_memid'],1,date('Y-m-d'),$p_size,$p_percent31,$p_percent32,$p_percent33,$p_percent34,$p_percent35,$p_percent36,$p_percent37,$p_percent38,$p_percent39,$p_demoney,$_POST['p_express'],$p_buyonce,$buynow); mysql_select_db($database_BE2, $BE2); mysql_query($InsertSQL, $BE2) or die(mysql_error()); if($buynow>0){ mysql_select_db($database_BE2, $BE2); //cexpdiff_ $empt1= sprintf("delete from tmporder1 where sess='%s'",session_id()); mysql_query($empt1, $BE2) or die(mysql_error()); mysql_select_db($database_BE2, $BE2); //cexpdiff_ $inst1= sprintf("INSERT INTO tmporder1(coid,mid,mexp,mexpkid,sess) select coid,ccid,'%s','%s','%s' from order_tmp where p_buynow=1 order by ccid desc limit 1",'0','1',session_id()); //$inst1= sprintf("INSERT INTO tmporder1(coid,mid,mexp,mexpkid,sess)VALUES('%s','%s','%s','%s','%s')",$_POST['ccidm_'.$i],$value,0,'1',session_id()); mysql_query($inst1, $BE2) or die(mysql_error()); echo '<script>window.location.href="/orderinfo.html";</script>'; } else{ $write='資料已新增...'; echo "<script>alert('".$write."');</script>"; } } else{ echo "<script>alert('請先登入再購買...');</script>"; } } $menu1=isset($_GET['menu'])?$_GET['menu']:'index'; $exmenu=explode("-",htmlspecialchars($menu1)); $mem_auto=$exmenu[1]; mysql_select_db($database_BE2, $BE2); $qr1 =sprintf("SELECT * FROM product_data WHERE mem_auto='%s' ",$mem_auto); $Rqr1 = mysql_query($qr1, $BE2) or die(mysql_error()); $row_Rqr1 = mysql_fetch_assoc($Rqr1); $totalRows_Rqr1 = mysql_num_rows($Rqr1); mysql_select_db($database_BE2, $BE2); $qr2 =sprintf("SELECT * FROM product_img WHERE fck='Y' AND mid='%s' ",$mem_auto); $Rqr2 = mysql_query($qr2, $BE2) or die(mysql_error()); $row_Rqr2 = mysql_fetch_assoc($Rqr2); $totalRows_Rqr2 = mysql_num_rows($Rqr2); mysql_select_db($database_BE2, $BE2); //$row_Rt2 b.p_title $query_Rc2 = sprintf("SELECT * FROM order_tmp WHERE p_sess= '1' AND member_id='%s' ",$_SESSION['login_memid']); $Rc2 = mysql_query($query_Rc2, $BE2) or die(mysql_error()); $row_Rc2 = mysql_fetch_assoc($Rc2); $totalRows_Rc2 = mysql_num_rows($Rc2); $product_count=$totalRows_Rc2; mysql_free_result($Rc2); mysql_select_db($database_BE2, $BE2); $query_Rt3 = "SELECT * FROM creditcard order by pp1" ; $Rt3 = mysql_query($query_Rt3, $BE2) or die(mysql_error()); $row_Rt3 = mysql_fetch_assoc($Rt3); $totalRows_Rt3 = mysql_num_rows($Rt3); ?> <style type="text/css"> #Ly { width:100%; width:screen.width; cursor:auto; left:0px; position: fixed; height:70px; bottom:0; z-index:3; color: #fff; background-color: #0033FF; font-size:25px; font-weight: bold; } </style> <!-- Blog Minimal Blocks --> <? // echo $row_Rqr1['p_check_time2']; //商品已過期 if($row_Rqr1['p_check_time2']> date('Y-m-d')){ ?> <section class="container"> <div class="row justify-content-md-center g-mb-50"> <div class="col-xl-5 col-md-5 col-lg-5"> <h3></h3> <? $imagepath = "/admin/upload_image/".$row_Rqr1['meta_img']; if($row_Rqr1['p_new']==1){ $imagepath = "/admin/upload2_image/".sprintf("%07d",$row_Rqr1['company_num']).'/'.$row_Rqr1['meta_img'].'.'.$row_Rqr1['p_tag']; } $sp_id=array(4178,4179); // 首付 $bubo_money=1; if( in_array($row_Rqr1['mem_auto'],$sp_id)){ $bubo_money=3; } ?> <img class="img-fluid w-100" src="<?= $imagepath ?>" alt="<?= $row_Rqr1['p_title']; ?>"> <? /* <img class="img-fluid w-100" src="/admin/upload_image/2019726155819_7841.jpg" alt="skybni"> */ ?> </div> <div class="col-xl-7 col-lg-7"> <h3></h3> <p class="lead mb-10"><font color="#FF0000"><?= $row_Rqr1['p_num'] ;?></font></p> <h2 class="h2 g-color-black g-font-weight-600 mb-2"><?= $row_Rqr1['p_title']; ?></h2> <p class="mb-10"><?= nl2br($row_Rqr1['p_explan']); ?> <!-- Price --> <div class="g-mb-10"> <br /> <label class="g-font-size-14">商品價格:</label> <span class="g-color-black g-font-weight-500 g-font-size-30"><?= $row_Rqr1['p_money']; ?></span> <span class="g-color-black g-font-weight-500 g-font-size-16">元</span> </div> <? //經銷商經銷獎金 // $doc1=array("","會員推廣獎金","開發商開發獎金","開發商首推獎金","推廣雲點","開發雲點","開發商續推獎金","銷售獎金"); $doc1=array("","會員推廣獎金","經銷商經銷獎金","開發商首推獎金","推廣雲點","開發雲點","開發商續推獎金","銷售獎金"); $vv=0; $show1=0; for($i=1;$i<8;$i++){ if($row_Rqr1['p_percent3'.$i]>0){ $show1=1; } } if($show1>0){ echo " 此商品提供: <br>" ;} ?> <? for($i=1;$i<8;$i++){ $vv += $row_Rqr1['p_percent3'.$i]; if($row_Rqr1['p_percent3'.$i]>0){?> <div class="g-mb-10"> <span class="g-color-black g-font-weight-400 g-font-size-14"> <?=$doc1[$i] ?>:<?= $row_Rqr1['p_percent3'.$i]; ?>元 </span><br> </div> <? } } if($vv==0){?> <div class="g-mb-10"> <span class="g-color-black g-font-weight-400 g-font-size-14"> 此商品提供會員雲點 :<br> 2%回饋:<?= round(($row_Rqr1['p_money']*0.02),0 ); ?>點<br> 3%抽成:<?= round(($row_Rqr1['p_money']*0.03),0 ); ?>點 </span><br> </div> <? } ?> <div class="g-mb-10"> <span class="g-font-size-14"> <?= ($bubo_money==1)?'刷卡一次付清:':'首次付款: '; ?><?= $row_Rqr1['p_money'] ?>元</span><br> </div> <div class="g-mb-10"> <label class="g-font-size-14">商品分類:</label> <span class="g-color-black g-font-weight-400 g-font-size-16"><?= $row_Rqr1['p_hot2']; ?></span> </div> <!-- End Price --> <form name="form5" method="post" action="/categoryDetail-<?= $row_Rqr1['mem_auto']; ?>.html"> <input name="state" id="state" type="hidden" value="addCart"> <input name="url" id="url" type="hidden" value="/categoryDetail-<?= $row_Rqr1['mem_auto']; ?>.html"> <input name="p_title" id="p_title" type="hidden" value="<?= $row_Rqr1['p_title']; ?>"> <input name="p_img" id="p_img" type="hidden" value="2019726155819_7841.jpg"> <input name="mem_auto" id="mem_auto" type="hidden" value="<?= $row_Rqr1['mem_auto']; ?>"> <input name="company_num" id="company_num" type="hidden" value="<?= $row_Rqr1['company_num']; ?>"> <input name="p_num" id="p_num" type="hidden" value="<?= $row_Rqr1['p_num']; ?>"> <input name="p_percent" id="p_percent" type="hidden" value="<?= ($row_Rqr1['p_percent31']==0)?round(($row_Rqr1['p_money']*0.03),0 ):"0"; ?>"> <input name="p_percent2" id="p_percent2" type="hidden" value="<?= ($row_Rqr1['p_percent31']==0)?round(($row_Rqr1['p_money']*0.02),0 ):"0"; ?>"> <input name="p_percent3" id="p_percent3" type="hidden" value="0"> <input name="p_percent31" id="p_percent31" type="hidden" value="<?= $row_Rqr1['p_percent31']; ?>"> <input name="p_percent32" id="p_percent32" type="hidden" value="<?= $row_Rqr1['p_percent32']; ?>"> <input name="p_percent33" id="p_percent33" type="hidden" value="<?= $row_Rqr1['p_percent33']; ?>"> <input name="p_percent34" id="p_percent34" type="hidden" value="<?= $row_Rqr1['p_percent34']; ?>"> <input name="p_percent35" id="p_percent35" type="hidden" value="<?= $row_Rqr1['p_percent35']; ?>"> <input name="p_percent36" id="p_percent36" type="hidden" value="<?= $row_Rqr1['p_percent36']; ?>"> <input name="p_percent37" id="p_percent37" type="hidden" value="<?= $row_Rqr1['p_percent37']; ?>"> <input name="p_percent38" id="p_percent38" type="hidden" value="<?= $row_Rqr1['p_percent38']; ?>"> <input name="p_percent39" id="p_percent39" type="hidden" value="<?= $row_Rqr1['p_percent39']; ?>"> <input name="p_demoney" id="p_demoney" type="hidden" value="<?= $row_Rqr1['p_demoney']; ?>"> <input name="p_hot2" id="p_hot2" type="hidden" value="<?= $row_Rqr1['p_hot2']; ?>"> <input name="mem_code" id="mem_code" type="hidden" value=""> <input name="p_money" id="p_money" type="hidden" value="<?= $row_Rqr1['p_money'] ?>"> <input name="p_express" id="p_express" type="hidden" value="<?= $row_Rqr1['p_express']; ?>"> <div class="row"> <div class="col-lg-8 g-mb-20"> <label class="g-font-size-14">選擇商品規格:</label> <select class="custom-select mr-sm-3 mb-3 mb-lg-0" name="p_size" id="p_size" <? ($row_Rqr1['p_kind']<>'')?'required':''?> > <option value="">請選擇</option> <? //洗衣機 3.5KG 、洗衣機 6.5KG、洗衣機 7.5KG $p=explode('、',$row_Rqr1['p_kind']); for($i=0;$i<count($p)-1;$i++){ ?> <option value="<?= $p[$i] ;?>"><?= $p[$i] ;?></option> <? }?> </select> </div> </div> <div class="row"> <div class="col-lg-12 g-mb-20"> <label class="g-font-size-14">購買數量:</label> <select class="custom-select mr-sm-3 mb-3 mb-lg-0" name="p_count" id="p_count"> <? for($i=1;$i<101;$i++){ ?> <option value="<?= $i ;?>"><?= $i ;?></option> <? } ?> </select> </div> </div> <? // if ( $_SERVER['REMOTE_ADDR']=='220.130.43.118'){?> <? // } ?> <!-- Buttons --> <div class="row g-mx-minus-5 g-mb-20"> <div class="col g-px-5 g-mb-10"> <? if($row_Rqr1['p_check']<>'上架'){?> <button class="btn btn-block u-btn-red g-font-size-16 g-py-15 g-px-25 g-color-white" type="button">商品補貨中</button> <? }?> </div> <div class="col g-px-5 g-mb-10"> <input name="p_moneyKind" id="p_moneyKind" type="hidden" value="0" /> <? if($row_Rqr1['p_check']=='上架'){ if($_SESSION['login_memid']==''){?> <input type="button" name="b1" value="加入購物車" onclick="run_login()" /> <? }else{ ?> <input type="submit" name="submit" value="加入購物車" /> <input type="submit" name="buynow" id="buynow" value="直接購買" /> <? } } ?> </div> </div> <!-- End Buttons --> </form> </div> </div> </section> <div class="container g-pt-100 g-pb-20"> <div class="row justify-content-between"> <div class="col-lg-12 order-lg-2 g-mb-80" style="background-color: #FCFCFC"> <!-- Gallery #08 --> <!-- End Gallery #08 --> <? if($totalRows_Rqr2>0){ $imagepath = "/admin/upload2_image/".sprintf("%07d",$row_Rqr1['company_num']).'/'.$row_Rqr1['meta_img']; do { $img = $imagepath.$row_Rqr2['imgname'].'.'.$row_Rqr2['imgext']; ?> <img class="img-fluid" src="<?= $img ?>" title="skybni <?= $row_Rqr1['p_title'] ?>"> <? } while ($row_Rqr2 = mysql_fetch_assoc($Rqr2)); } ?> <? /* <img class="img-fluid" src="/images/28bank.jpg" alt="skybni"> */ ?> <p style="line-height:30px"> <br> <div style="text-align:center; background-color:#D8D8D8;"><h2>商品詳情</h2> </div> <?= nl2br($row_Rqr1['p_content']); ?> </div> </div> <div id="Ly" > <div class="col-12"><div id="buy_obj">已選商品 <?= $product_count ;?>件</div></div> <div class="col-12" style="font-size:14px; color:#000; text-align:center;"><? if($product_count>0){?> <input type="button" value="我要結帳" onclick="window.location.href='/shoppingcar.html'"> <? }?></div> </div> </div> <? } else { echo '商品已過期...' ;} ?> <!-- End Blog Minimal Blocks --> <script> function run_login(){ alert('請先登入再購買...'); document.cookie = 'loginpage=categoryDetail-<?= $mem_auto; ?>.html;path=/;'; location.href='/login.html?loginpage=categoryDetail-<?= $mem_auto; ?>.html'; } function showbank(){ //var conceptName = $('#p_channel').find(":selected").val(); //var conceptName=$("select#p_channel option").filter(":selected").val(); var section = document.getElementById('bankselect'); var selectval=$('#p_channel').val(); if(selectval=='0'){ section.style.display = "none";} else{ section.style.display = "block"; } } </script> <?php mysql_free_result($Rqr1); mysql_free_result($Rqr2); ?>
保存
取消
返回文件列表