查看文件: user_editprofile.php
大小: 11.7 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']:""; // 匯款存摺封面照片 */ /* $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 mem_num=%s, mem_mail=%s, mem_name=%s, mem_code=%s, m_bankcode=%s, m_bankname=%s,m_bank=%s,m_bank2=%s, m_pic1=%s, m_pic2=%s, m_pic4=%s,creditcard=%s,payername=%s,payermobile=%s,payermail=%s WHERE mem_auto=%s", GetSQLValueString($_POST['mem_num'], "int"), GetSQLValueString($_POST['mem_mail'], "text"), GetSQLValueString($_POST['mem_name'], "text"), GetSQLValueString($_POST['mem_code'], "text"), 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($_POST['creditcard'], "text"), GetSQLValueString($_POST['payername'], "text"), GetSQLValueString($_POST['payermobile'], "text"), GetSQLValueString($_POST['payermail'], "text"), GetSQLValueString($_SESSION['login_memid'], "int")); */ $updateSQL = sprintf("UPDATE member SET mem_num=%s, mem_mail=%s, mem_name=%s, mem_code=%s, creditcard=%s,payername=%s,payermobile=%s,payermail=%s WHERE mem_auto=%s", GetSQLValueString($_POST['mem_num'], "int"), GetSQLValueString($_POST['mem_mail'], "text"), GetSQLValueString($_POST['mem_name'], "text"), GetSQLValueString($_POST['mem_code'], "text"), GetSQLValueString($_POST['creditcard'], "text"), GetSQLValueString($_POST['payername'], "text"), GetSQLValueString($_POST['payermobile'], "text"), GetSQLValueString($_POST['payermail'], "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-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"> <h3><font color="blue"><a href="/ecard/<?= $row_Rt2['scode'] ; ?>" target="_blank">我的推薦 ID : <?= $row_Rt2['scode'] ; ?> </a></font></h3> <form action="editprofile.html" method="post" name="form1" id="form1" enctype="multipart/form-data"> <div class="form-group"> <label class="col-md-5 control-label" for="passwd1">登入帳號(手機號):</label> <div class="col-md-7 "> <input name="mem_mobile" type="text" value="<?= $row_Rt2['mem_mobile'] ; ?>" class="form-control" readonly="readonly" /> <input name="mem_code" type="hidden" value="<?= $row_Rt2['mem_code'] ; ?>" /> <span class="help-block"> </span> </div> </div> <div class="form-group"> <label class="col-md-3 control-label" for="passwd1">姓名:</label> <div class="col-md-9"> <input type="text" name="mem_name" id="mem_name" value="<?=$row_Rt2['mem_name']; ?>" class="form-control" /> <span class="help-block"> </span> </div> </div> <div class="form-group"> <label class="col-md-3 control-label" for="passwd1">E_mail:</label> <div class="col-md-9"> <input type="text" name="mem_mail" value="<?= $row_Rt2['mem_mail'] ?>" class="form-control" /> <span class="help-block"> </span> </div> </div> <div class="form-group"> <div class="col-md-12"> <span class="help-block"></span> <? if($row_Rt2['mem_num']<2){?> <button type="button" class="label label-info" onclick="found_pmem()">尋找推薦ID</button><? }?> </div> </div> <div class="col-md-12"> <h3 style="text-align:center;color:blue"><strong>信用卡分期專用資料</strong></h3> </div> <div class="form-group"> <label class="col-md-4 control-label" for="creditcard">信用卡名:</label> <div class="col-md-8"> <select name="creditcard" id="creditcard" class="form-control"> <?php do { ?> <option value="<?= $row_Rt3['pp1']; ?>" <?= ($row_Rt3['pp1']==$row_Rt2['creditcard'])?'selected="selected"':""; ?>><?= $row_Rt3['pp1']=='1'?'無信用卡(零卡分期)':$row_Rt3['pp2']; ?></option> <?php } while ($row_Rt3 = mysql_fetch_assoc($Rt3)); ?> </select> <span class="help-block"> </span> </div> </div> <div class="form-group"> <label class="col-md-4 control-label" for="payername">持卡人英文姓名:</label> <div class="col-md-8"> <input type="text" id="payername" name="payername" value="<?= $row_Rt2['payername'] ?>" class="form-control" /> <span class="help-block"> </span> </div> </div> <div class="form-group"> <label class="col-md-4 control-label" for="payermobile">持卡人電話:</label> <div class="col-md-8"> <input type="text" id="payermobile" name="payermobile" value="<?= $row_Rt2['payermobile'] ?>" class="form-control" /> <span class="help-block"> </span> </div> </div> <div class="form-group"> <label class="col-md-4 control-label" for="payermail">持卡人 mail:</label> <div class="col-md-8"> <input type="text" id="payermail" name="payermail" value="<?= $row_Rt2['payermail'] ?>" class="form-control" /> <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_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> </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); ?>
保存
取消
返回文件列表