查看文件: body_editprofile2.php
大小: 11.28 KB
类型: application/octet-stream
<?php require_once('../Connections/BE2.php'); ?> <?php if (!isset($_SESSION)){ session_start(); } $logo_img='/www2/skybni/logo_img/'.sprintf('%07d',$_SESSION['login_memid']).".png"; //if(!file_exists($logo_img)){ include "user_logo.php"; } if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $idpath= sprintf("%07d",$_SESSION['login_memid']) ; $wwwpath='/www2/skybni'; $picpath= "/logo_img/st_".$idpath; $idpath= $_SESSION['login_memid'] ; $wwwpath='/www2/skybni'; $picpath= "/shopmap/images/userimg_".$idpath;; $m_pic1=isset($_POST['m_pic1'])?$_POST['m_pic1']:""; // 負責人身份証正面 $m_pic2=isset($_POST['m_pic2'])?$_POST['m_pic2']:""; // 營業登記證 $m_pic4=isset($_POST['m_pic4'])?$_POST['m_pic4']:""; // 匯款存摺封面照片 $tfile1="fileToUpload1"; if($_FILES[$tfile1]["name"]<>''){ $ext= explode('.',$_FILES[$tfile1]['name']) ; $imgext=strtolower($ext[count($ext)-1]); //取最後一筆 if($imgext=='jpg'){ $m_pic1="1".rand(100,999); $pic=$wwwpath.$picpath.'_'.$m_pic1.'.jpg'; //$m_pic1=$imgext; move_uploaded_file($_FILES[$tfile1]["tmp_name"],$pic); } } $tfile2="fileToUpload2"; if($_FILES[$tfile2]["name"]<>''){ $ext= explode('.',$_FILES[$tfile2]['name']) ; $imgext=strtolower($ext[count($ext)-1]); //取最後一筆' if($imgext=='jpg'){ $m_pic2="2".rand(100,999); $pic=$wwwpath.$picpath.'_'.$m_pic2.'.jpg'; move_uploaded_file($_FILES[$tfile2]["tmp_name"],$pic); } } $tfile4="fileToUpload4"; if($_FILES[$tfile4]["name"]<>''){ $ext= explode('.',$_FILES[$tfile4]['name']) ; $imgext=strtolower($ext[count($ext)-1]); //取最後一筆 if($imgext=='jpg'){ $m_pic4="4".rand(100,999); $pic=$wwwpath.$picpath.'_'.$m_pic4.'.jpg'; //$m_pic4=$imgext; move_uploaded_file($_FILES[$tfile4]["tmp_name"],$pic); } } /* $tfile="fileToUpload1"; $mem_logo=$_POST['mem_logo']; if($_FILES[$tfile]["name"]<>''){ $ext= explode('.',$_FILES[$tfile]['name']) ; $imgext=strtolower($ext[count($ext)-1]); //取最後一筆 $pic=$wwwpath.$picpath.".".$imgext; $mem_logo=$imgext; move_uploaded_file($_FILES[$tfile]["tmp_name"],$pic); } *///SELECT a.*,b.scode as bscode,b.mem_name as pname FROM member as a left join member as b on a.mem_num=b.mem_auto WHERE a.mem_auto = 262 $updateSQL = sprintf("UPDATE member SET m_bankcode=%s, m_bankname=%s,m_bank=%s,m_bank2=%s, m_pic1=%s, m_pic2=%s, m_pic4=%s WHERE mem_auto=%s", GetSQLValueString($_POST['m_bankcode'], "text"), GetSQLValueString($_POST['m_bankname'], "text"), GetSQLValueString($_POST['m_bank'], "text"), GetSQLValueString($_POST['m_bank2'], "text"), GetSQLValueString($m_pic1, "text"), GetSQLValueString($m_pic2, "text"), GetSQLValueString($m_pic4, "text"), GetSQLValueString($_SESSION['login_memid'], "int")); mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($updateSQL, $BE2) or die(mysql_error()); $msg='更新完成....' ; $updateGoTo = "editprofile.html"; echo '<script>alert("'.$msg.'");</script>'; } //update `member` set company_title=mem_name WHERE mem_auto>10 and mem_auto<26 mysql_select_db($database_BE2, $BE2); $query_Rt2 = sprintf("SELECT a.*,b.scode as bscode,b.mem_name as pname FROM member as a left join member as b on a.mem_num=b.mem_auto WHERE a.mem_auto = %s", GetSQLValueString($_SESSION['login_memid'], "int")); $Rt2 = mysql_query($query_Rt2, $BE2) or die(mysql_error()); $row_Rt2 = mysql_fetch_assoc($Rt2); $totalRows_Rt2 = mysql_num_rows($Rt2); 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); //creditcard // echo $query_Rt2; ?> <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> <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="editprofile2.html" method="post" name="form1" id="form1" enctype="multipart/form-data"> <div class="form-group"> <label class="col-md-4 control-label" for="m_bankname">匯款戶名:</label> <div class="col-md-8"> <input name="m_bankname" type="text" id="m_bankname" value="<?= $row_Rt2['m_bankname'] ; ?>" size="28" /> </div> </div> <div class="form-group"> <label class="col-md-4 control-label" for="m_bankname">匯款銀行:</label> <div class="col-md-8"> <input name="m_bank" type="text" id="m_bankname" value="<?= $row_Rt2['m_bank'] ; ?>" size="28" /> </div> </div> <div class="form-group"> <label class="col-md-4 control-label" for="m_bankname">匯款銀行代碼:</label> <div class="col-md-8"> <input name="m_bank2" type="text" id="m_bankname" value="<?= $row_Rt2['m_bank2'] ; ?>" size="28" /> </div> </div> <div class="form-group"> <label class="col-md-4 control-label" for="m_bankcode">匯款帳號:</label> <div class="col-md-8"> <input name="m_bankcode" type="text" id="m_bankcode" value="<?= $row_Rt2['m_bankcode'] ; ?>" size="28" /> <br> </div> </div> <div class="form-group"> <label class="col-md-4 control-label" for="fileToUpload1">負責人身份証正面:</label> <div class="col-md-8"> <input name="fileToUpload1" type="file" id="fileToUpload1" /> <span class="help-block"></span> <input type="hidden" id="m_pic1" name="m_pic1" value="<?= $row_Rt2['m_pic1'] ; ?>" /> </div> <div class="col-md-12"> <? if($row_Rt2['m_pic1']<>''){ ?><img src="/shopmap/images/userimg_<?= $_SESSION['login_memid'].'_'.$row_Rt2['m_pic1'] ?>.jpg" width="200px" /><? }?> </div> </div> <div class="form-group"> <label class="col-md-4 control-label" for="fileToUpload2">負責人身份証反面:</label> <div class="col-md-8"> <input name="fileToUpload2" type="file" id="fileToUpload2" /> <span class="help-block"></span> <input type="hidden" id="m_pic2" name="m_pic2" value="<?= $row_Rt2['m_pic2'] ; ?>" /> </div> <div class="col-md-12"> <? if($row_Rt2['m_pic2']<>''){ ?> <img src="/shopmap/images/userimg_<?= $_SESSION['login_memid'].'_'.$row_Rt2['m_pic2'] ?>.jpg" width="200px" /><? }?> </div> </div> <div class="form-group"> <label class="col-md-4 control-label" for="fileToUpload4">匯款存摺封面照片:</label> <div class="col-md-8"> <input name="fileToUpload4" type="file" id="fileToUpload4" /> <span class="help-block"></span> <input type="hidden" id="m_pic4" name="m_pic4" value="<?= $row_Rt2['m_pic4'] ; ?>" /> </div> <div class="col-md-12"> <? if($row_Rt2['m_pic4']<>''){ ?> <img src="/shopmap/images/userimg_<?= $_SESSION['login_memid'].'_'.$row_Rt2['m_pic4'] ?>.jpg" width="200px" /><? }?> </div> </div> <font color="blue"> </font> <div class="form-group form-actions"> <button type="submit" class="btn btn-primary">保存</button> </div> <input type="hidden" name="MM_update1" value="formpass" /> <input type="hidden" id="mem_auto" name="mem_auto" value="<?= $_SESSION['login_memid']; ?>" /> <input type="hidden" name="MM_update" value="form1" /> </form> PS: 上傳圖檔限傳 JPG 格式 </div> </div> </div> <!--/row--> </div> <!-- end: Content --> <br><br><br> </div> <script type="text/javascript"> function found_pmem() { var pname=$('#pname').val(); $.ajax({ method: "POST", url: "ajax_found_mynum.php", //data: $('#yourformid').serialize(), data: {'pname': pname} }).done(function( data ) { response = JSON.parse(data); $('#pname').val(response.name); $('#mem_num').val(response.id); if(response.id>1){ alert('找到推薦人..');} else{ alert('找不到推薦人..'); } }); return false; }; function make_logo(i){ var title=$('#company_title').val(); alert(title); $.ajax({ method: "POST", url: "ajax_make_logo.php", //data: $('#yourformid').serialize(), data: {id: i} }).done(function( data ) { if(data!="ERR"){ $('#mylogo').html('<img name="logo" src="/logo_img/'+data +'" alt="1" />'); } // $('#mylogo').html(data); }); return false; } </script> <!-- end: Content --> <?php mysql_free_result($Rt2); ?>
保存
取消
返回文件列表