查看文件: body_editcompanyfile.php
大小: 22.47 KB
类型: application/octet-stream
<?php require_once('../Connections/BE2.php'); ?> <?php if (!isset($_SESSION)){ session_start(); } $updateSQL =''; $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; // $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); } */ $company_pic1=isset($_POST['company_pic1'])?$_POST['company_pic1']:""; // 負責人身份証正面 $company_pic2=isset($_POST['company_pic2'])?$_POST['company_pic2']:""; // 營業登記證 $company_pic3=isset($_POST['company_pic3'])?$_POST['company_pic3']:""; // 負責人身份証反面 $company_pic4=isset($_POST['company_pic4'])?$_POST['company_pic4']:""; // 匯款存摺封面照片 $tfile2="fileToUpload1"; if($_FILES[$tfile2]["name"]<>''){ $ext= explode('.',$_FILES[$tfile2]['name']) ; $imgext=strtolower($ext[count($ext)-1]); //取最後一筆 $pic=$wwwpath.$picpath."_1.".$imgext; $company_pic1=$imgext; move_uploaded_file($_FILES[$tfile2]["tmp_name"],$pic); } $tfile2="fileToUpload2"; if($_FILES[$tfile2]["name"]<>''){ $ext= explode('.',$_FILES[$tfile2]['name']) ; $imgext=strtolower($ext[count($ext)-1]); //取最後一筆 $pic=$wwwpath.$picpath."_2.".$imgext; $company_pic2=$imgext; move_uploaded_file($_FILES[$tfile2]["tmp_name"],$pic); } $tfile3="fileToUpload3"; if($_FILES[$tfile3]["name"]<>''){ $ext= explode('.',$_FILES[$tfile3]['name']) ; $imgext=strtolower($ext[count($ext)-1]); //取最後一筆 $pic=$wwwpath.$picpath."_3.".$imgext; $company_pic3=$imgext; move_uploaded_file($_FILES[$tfile3]["tmp_name"],$pic); } $tfile4="fileToUpload4"; if($_FILES[$tfile4]["name"]<>''){ $ext= explode('.',$_FILES[$tfile4]['name']) ; $imgext=strtolower($ext[count($ext)-1]); //取最後一筆 $pic=$wwwpath.$picpath."_4.".$imgext; $company_pic4=$imgext; move_uploaded_file($_FILES[$tfile4]["tmp_name"],$pic); } $updateSQL = sprintf("UPDATE company SET mem_user=%s, company_seo=%s, company_name=%s, company_title=%s,co_address=%s,co_address2=%s,co_address3=%s,company_bankname=%s,company_bankcode=%s,company_bank=%s,company_bank2=%s,company_pic1=%s,company_pic2=%s,company_pic3=%s ,company_pic4=%s,company_code=%s,company_code2=%s,company_card=%s,company_tel=%s,company_address=%s,company_line=%s,company_mail=%s,company_netad=%s WHERE mid=%s", GetSQLValueString($_POST['mem_user'], "text"), GetSQLValueString($_POST['company_seo'], "text"), GetSQLValueString($_POST['company_name'], "text"), GetSQLValueString($_POST['company_title'], "text"), GetSQLValueString($_POST['street'], "int"), GetSQLValueString($_POST['mem_address2'], "text"), GetSQLValueString($_POST['mem_address3'], "text"), GetSQLValueString($_POST['company_bankname'], "text"), GetSQLValueString($_POST['company_bankcode'], "text"), GetSQLValueString($_POST['company_bank'], "text"), GetSQLValueString($_POST['company_bank2'], "text"), GetSQLValueString($company_pic1, "text"), GetSQLValueString($company_pic2, "text"), GetSQLValueString($company_pic3, "text"), GetSQLValueString($company_pic4, "text"), GetSQLValueString($_POST['company_code'], "text"), GetSQLValueString($_POST['company_code2'], "text"), GetSQLValueString($_POST['company_card'], "text"), GetSQLValueString($_POST['company_tel'], "text"), GetSQLValueString($_POST['company_address'], "text"), GetSQLValueString($_POST['company_line'], "text"), GetSQLValueString($_POST['company_mail'], "text"), GetSQLValueString(1, "int"), //$_POST['company_netad'] GetSQLValueString($_SESSION['login_memid'], "int")); mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($updateSQL, $BE2) or die(mysql_error()); $msg='更新完成....' ; $updateGoTo = "editcompanyfile.html"; echo '<script>alert("'.$msg.'");</script>'; } // echo $updateSQL; //update `member` set company_title=mem_name WHERE mem_auto>10 and mem_auto<26 // address_id img_id county district street mysql_select_db($database_BE2, $BE2); $query_Rt2 = sprintf("SELECT a.*,b.mem_auto,b.scode,c.* FROM company as a, member as b ,address as c WHERE a.mid=b.mem_auto AND a.co_address=c.address_id AND b.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); if($totalRows_Rt2==0){ $t=date('Y-m-d H:i:s'); mysql_select_db($database_BE2, $BE2); $Ins_01 = sprintf("INSERT INTO company(mid,co_time)VALUES('%s','%s')",$_SESSION['login_memid'],$t); mysql_query($Ins_01, $BE2) or die(mysql_error()); mysql_select_db($database_BE2, $BE2); $query_Rt2 = sprintf("SELECT a.*,b.mem_auto,b.scode,c.* FROM company as a, member as b ,address as c WHERE a.mid=b.mem_auto AND a.co_address=c.address_id AND b.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_Rt2 = sprintf("SELECT a.*,c.* FROM member as a ,address as c WHERE a.mem_address=c.address_id AND 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); */ // check ck_company 審核進度 1; 等待資料 2 等待核可 3 已核可 if($row_Rt2['ck_company']==1){ mysql_select_db($database_BE2, $BE2); $up_Rt2 = sprintf("UPDATE company Set ck_company=2 WHERE mid = '%s'",$_SESSION['login_memid']); mysql_query($up_Rt2, $BE2) or die(mysql_error()); $msg="歡迎新會員加入 SKYBNI \r\n 請盡快上傳企業資料,以完成資料審核 ,\r\n SKYBNI 敬上"; echo '<script>alert("'.$msg.'");</script>'; }else if($row_Rt2['ck_company']==2){ $ck=1; if($row_Rt2['mem_user']==''){ $ck=0;} if($row_Rt2['company_card']==''){ $ck=0;} if($row_Rt2['company_tel']==''){ $ck=0;} if($row_Rt2['company_code']==''){ $ck=0;} if($row_Rt2['company_code2']==''){ $ck=0;} if($row_Rt2['company_name']==''){ $ck=0;} if($row_Rt2['company_pic1']==''){ $ck=0;} if($row_Rt2['company_pic2']==''){ $ck=0;} if($row_Rt2['company_pic3']==''){ $ck=0;} if($row_Rt2['company_pic4']==''){ $ck=0;} if($ck==1){ mysql_select_db($database_BE2, $BE2); $up_Rt2 = sprintf("UPDATE company Set ck_company=3 WHERE mid = '%s'",$_SESSION['login_memid']); mysql_query($up_Rt2, $BE2) or die(mysql_error()); $doc='等待系統審核中 , SKYBNI 敬上.'; $Ins_guestdoc = sprintf("INSERT INTO guestdoc(guid,gdate,gsource,gdoc)VALUES('%s','%s','%s','%s')",$_SESSION['login_memid'],date('Y-m-d'),1,$doc); mysql_query($Ins_guestdoc, $BE2) or die(mysql_error()); } } mysql_select_db($database_BE2, $BE2); // address_id county district street $query_Rot2 = "SELECT distinct(county) FROM address where 1 order by county"; $Rot2 = mysql_query($query_Rot2, $BE2) or die(mysql_error()); $row_Rot2 = mysql_fetch_assoc($Rot2); $totalRows_Rot2 = mysql_num_rows($Rot2); mysql_select_db($database_BE2, $BE2); // address_id county district street $query_Rat2 = sprintf("SELECT distinct(district) FROM address where county='%s' order by district",$row_Rt2['county']); $Rat2 = mysql_query($query_Rat2, $BE2) or die(mysql_error()); $row_Rat2 = mysql_fetch_assoc($Rat2); $totalRows_Rat2 = mysql_num_rows($Rat2); $district=$row_Rt2['district']; mysql_select_db($database_BE2, $BE2); // address_id county district street $query_Rbt2 = sprintf("SELECT address_id,street FROM address where county='%s' AND district='%s' order by street",$row_Rt2['county'], $district); $Rbt2 = mysql_query($query_Rbt2, $BE2) or die(mysql_error()); $row_Rbt2 = mysql_fetch_assoc($Rbt2); $totalRows_Rbt2 = mysql_num_rows($Rbt2); /* mysql_select_db($database_BE2, $BE2); $query_Rvt3 = "SELECT * FROM travel where tbc='廣告分類網' order by tbx,tb0" ; //default 110 $Rvt3 = mysql_query($query_Rvt3, $BE2) or die(mysql_error()); $row_Rvt3 = mysql_fetch_assoc($Rvt3); $totalRows_Rvt3 = mysql_num_rows($Rvt3); */ ?> <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-lg-12"> <div class="panel panel-default"> <div class="panel-heading"> <h2><i class="fa fa-list red"></i><span class="break"></span><strong>企業資料上傳</strong></h2> </div> <form action="editcompanyfile.html" method="post" name="form1" id="form1" enctype="multipart/form-data"> <table class="table table-bordered table-striped table-condensed table-hover" style="min-width:500px;"> <tr valign="baseline"> <td colspan="2" align="center" valign="top" nowrap="nowrap"> <h3><font color="blue">我的會員ID: <?= $row_Rt2['scode'] ; ?> / <?= $row_Rt2['mem_check']=='Y'?'已審核':'未審核'?> </font> </h3></td> <td width="540"> </td> </tr> <tr valign="baseline"> <td width="192" align="right" nowrap="nowrap">負責人姓名:</td> <td width="530"> <input type="text" name="mem_user" value="<?=$row_Rt2['mem_user']; ?>" class="form-control" /> <input id="company_title" name="company_title" type="hidden" value="<?= $row_Rt2['company_title'] ; ?>" class="form-control" /> <input name="company_seo" type="hidden" class="form-control" id="company_seo" value="<?=$row_Rt2['company_seo'] ; ?> " size="40" /> <input name="mem_check" type="hidden" value="<?= $row_Rt2['mem_check'] ?>" class="form-control" readonly="readonly" /> </td> <td> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">營業項目</td> <td><input name="company_card" type="text" class="form-control" id="company_card" value="<?= $row_Rt2['company_card'] ?>" /></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">聯繫電話</td> <td><input name="company_tel" type="text" class="form-control" id="company_tel" value="<?= $row_Rt2['company_tel'] ?>" /></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">統一編號</td> <td><input id="company_code" name="company_code" type="text" value="<?= $row_Rt2['company_code'] ?>" class="form-control" /></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">匯款戶名</td> <td><input name="company_bankname" type="text" class="form-control" id="company_bankname" value="<?= $row_Rt2['company_bankname'] ?>" <? if($row_Rt2['check_bank']=='Y'){ echo 'readonly="readonly"'; }?> /></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">匯款銀行</td> <td><input id="company_bank" name="company_bank" type="text" value="<?= $row_Rt2['company_bank'] ?>" class="form-control" <? if($row_Rt2['check_bank']=='Y'){ echo 'readonly="readonly"';} ?>/></td> <td>匯款帳號(國泰世華銀行),其他銀行帳號匯款另加手續費15元</td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">匯款銀行代碼</td> <td><input id="company_bank2" name="company_bank2" type="text" value="<?= $row_Rt2['company_bank2'] ?>" class="form-control" <? if($row_Rt2['check_bank']=='Y'){ echo 'readonly="readonly"'; }?> /></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">匯款帳號</td> <td><input id="company_bankcode" name="company_bankcode" type="text" value="<?= $row_Rt2['company_bankcode'] ?>" class="form-control" <? if($row_Rt2['check_bank']=='Y'){ echo 'readonly="readonly"';} ?> /></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">公司名稱:</td> <td><input id="company_name" name="company_name" type="text" value="<?= $row_Rt2['company_name'] ; ?>" class="form-control" <? if($row_Rt2['check_bank']=='Y'){ echo 'readonly="readonly"';} ?>/></td> <td> </td> </tr> <tr valign="baseline"> <td align="right" valign="middle" nowrap="nowrap">公司地址:</td> <td > <table width="100%" border="0"> <tr> <td width="35%"><select name="city" id="city" class="form-control placeholder col-xs-12 col-sm-4 mb-4" onchange="Selectcity()"> <? do { ?> <option value="<?= $row_Rot2['county']; ?>" <?= ($row_Rot2['county']==$row_Rt2['county'])?'selected="selected"':""; ?>><?= $row_Rot2['county']; ?></option> <?php } while ($row_Rot2 = mysql_fetch_assoc($Rot2)); ?> </select> </td> <td width="35%"><select name="district" id="district" class="form-control placeholder col-xs-12 col-sm-4 mb-4" onchange="Selectstreet();"> <? do { ?> <option value="<?= $row_Rat2['district']; ?>" <?= ($row_Rat2['district']==$row_Rt2['district'])?'selected="selected"':""; ?>><?= $row_Rat2['district']; ?></option> <?php } while ($row_Rat2 = mysql_fetch_assoc($Rat2)); ?> </select></td> <td colspan="2" width="35%"><select name="street" id="street" class="form-control placeholder col-xs-12 col-sm-4 mb-4"> <? do { ?> <option value="<?= $row_Rbt2['address_id']; ?>" <?= ($row_Rbt2['street']==$row_Rt2['street'])?'selected="selected"':""; ?>><?= $row_Rbt2['street']; ?></option> <?php } while ($row_Rbt2 = mysql_fetch_assoc($Rbt2)); ?> </select></td> </tr> <tr> <td><input name="mem_address2" type="text" required class="form-control g-color-black g-bg-white g-bg-white--focus g-brd-gray-light-v4 g-brd-primary--hover rounded g-py-10 g-px-15" id="mem_address2" placeholder="請輸入路號" value="<?= $row_Rt2['co_address2'] ?>" size="6" maxlength="6" /></td> <td>號</td> <td width="24%"><input name="mem_address3" type="text" class="form-control g-color-black g-bg-white g-bg-white--focus g-brd-gray-light-v4 g-brd-primary--hover rounded g-py-10 g-px-15" id="mem_address3" placeholder="請輸入之樓號" value="<?= $row_Rt2['co_address3'] ?>" size="6" maxlength="6" /></td> <td width="17%">樓</td> </tr> </table> </td> <td > <? /* </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">廣告分類選項:</td> <td> <select name="company_netad" id="company_netad" class="form-control placeholder col-xs-12 col-sm-4 mb-4"> <? do { ?> <option value="<?= $row_Rvt3['tb0']; ?>" <?= ($row_Rt2['company_netad']==$row_Rvt3['tb0'])?'selected="selected"':""; ?>><?= $row_Rvt3['tb2']; ?></option> <? } while ($row_Rvt3 = mysql_fetch_assoc($Rvt3)); ?> </select> </td> <td> </td> </tr> */ ?> <tr valign="baseline"> <td nowrap="nowrap" align="right">Google 地圖</td> <td><span class="col-md-9"> <input name="company_address" type="text" id="company_address" value="<?= $row_Rt2['company_address'] ; ?>" size="28" /> <span class="form-group"> (輸入公司地址即可) </span></span></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">Line行動條碼</td> <td><span class="col-md-9"> <input name="company_line" type="text" id="company_line" value="<?= $row_Rt2['company_line'] ; ?>" size="28" /> </span></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">公司_Email</td> <td><span class="col-md-9"> <input name="company_mail" type="text" id="company_mail" value="<?= $row_Rt2['company_mail'] ; ?>" size="28" /> </span></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">負責人身份証正面</td> <td><input name="fileToUpload1" type="file" id="fileToUpload1" /> <input type="hidden" id="company_pic1" name="company_pic1" value="<?= $row_Rt2['company_pic1'] ; ?>" /></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">負責人身份証反面</td> <td><input name="fileToUpload3" type="file" id="fileToUpload3" /> <input type="hidden" id="company_pic3" name="company_pic3" value="<?= $row_Rt2['company_pic3'] ; ?>" /></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">營業登記證</td> <td><input name="fileToUpload2" type="file" id="fileToUpload2" /> <input type="hidden" id="company_pic2" name="company_pic2" value="<?= $row_Rt2['company_pic2'] ; ?>" /></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">匯款存摺封面照片</td> <td><input name="fileToUpload4" type="file" id="fileToUpload4" /> <input type="hidden" id="company_pic4" name="company_pic4" value="<?= $row_Rt2['company_pic4'] ; ?>" /></td> <td> </td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"> </td> <td><input type="submit" value="更新記錄" class="btn btn-3d btn-black btn-md"/></td> <td> </td> </tr> </table> <input type="hidden" name="MM_update" value="form1" /> <input type="hidden" id="mem_auto" name="mem_auto" value="<?= $_SESSION['login_memid']; ?>" /> </form> </div> </div> </div> <div class="row"> <div style="border-width:3px;border-style:dashed;border-color:#FFAC55;padding:5px;"> <? if($row_Rt2['company_pic1']<>''){ ?> <img name="img1" src="/logo_img/st_<?= sprintf('%07d',$_SESSION['login_memid']).'_1.'.$row_Rt2['company_pic1'] ?>" width="100%" title="負責人身份証正面" /> <? } ?> <div style="text-align:center;">負責人身份証正面</div> </div> <div style="border-width:3px;border-style:dashed;border-color:#FFAC55;padding:5px;"> <? if($row_Rt2['company_pic3']<>''){ ?> <img name="img4" src="/logo_img/st_<?= sprintf('%07d',$_SESSION['login_memid']).'_3.'.$row_Rt2['company_pic3'] ?>" width="100%" title="負責人身份証反面" /> <? } ?> <div style="text-align:center;">負責人身份証反面</div> </div> <div style="border-width:3px;border-style:dashed;border-color:#FFAC55;padding:5px;"> <? if($row_Rt2['company_pic4']<>''){ ?> <img name="img4" src="/logo_img/st_<?= sprintf('%07d',$_SESSION['login_memid']).'_4.'.$row_Rt2['company_pic4'] ?>" width="100%" title="匯款存摺封面照片" /> <? } ?> <div style="text-align:center;">匯款存摺封面照片</div> </div> <div style="border-width:3px;border-style:dashed;border-color:#FFAC55;padding:5px;"> <? if($row_Rt2['company_pic2']<>''){ ?> <img name="img4" src="/logo_img/st_<?= sprintf('%07d',$_SESSION['login_memid']).'_2.'.$row_Rt2['company_pic2'] ?>" width="100%" title="營業登記證" /> <? } ?> <div style="text-align:center;">營業登記證</div> </div> </div> </div> <script type="text/javascript"> function found_pmem() { var pname=$('#pname').val(); var p_name=$('#p_name').val(); $.ajax({ method: "POST", url: "ajax_found_mynum.php", //data: $('#yourformid').serialize(), data: {pname: $('#pname').val()} }).done(function( data ) { response = JSON.parse(data); $('#pname').val(response.id); $('#mem_num').val(response.id); $('#p_name').val( response.name); }); 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; } function Selectstreet() { var county= $("#city").val(); // $(city).find(':selected')[0].id; var district = $("#district").val(); //.find(':selected')[0].id; $.ajax({ type: 'POST', url: 'SelectstreetApi.php', data: { 'county': county,'district':district }, success: function (data) { // the next thing you want to do var $street = $('#street'); $street.empty(); $("select#street").html(data); } }); } function Selectcity() { var county= $("#city").val(); // $(city).find(':selected')[0].id; $.ajax({ type: 'POST', url: 'SelectcityApi.php', data: {'county': county}, success: function (data) { // the next thing you want to do var $street = $('#street'); $street.empty(); var $district = $('#district'); $district.empty(); $("select#district").html(data); Selectstreet(); } }); } </script> <!-- end: Content --> <?php // mysql_free_result($Rvt3); mysql_free_result($Rt2); mysql_free_result($Rot2); mysql_free_result($Rat2); mysql_free_result($Rbt2); ?>
保存
取消
返回文件列表