查看文件: cuser_edit.php
大小: 10.45 KB
类型: application/octet-stream
<?php require('system/login.php'); ?> <?php require_once('../Connections/BE2.php'); ?> <?php if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $updateSQL = sprintf("UPDATE `cuser` SET name=%s,name2=%s,webname=%s ,webaddr=%s ,passwd=%s, tel1=%s, tel2=%s, fax=%s, addr=%s, addr_2=%s, addr_4=%s, addr_5=%s, addr_6=%s , addr_7=%s , addr_8=%s, lineid=%s, lineid2=%s, email=%s, weblen=%s, webmemo=%s, flag=%s WHERE cuid=%s", GetSQLValueString($_POST['name'], "text"), GetSQLValueString($_POST['name2'], "text"), GetSQLValueString($_POST['webname'], "text"), GetSQLValueString($_POST['webaddr'], "text"), GetSQLValueString($_POST['passwd'], "text"), GetSQLValueString($_POST['tel1'], "text"), GetSQLValueString($_POST['tel2'], "text"), GetSQLValueString($_POST['fax'], "text"), GetSQLValueString($_POST['addr'], "text"), GetSQLValueString($_POST['addr_2'], "int"), GetSQLValueString($_POST['addr_4'], "int"), GetSQLValueString($_POST['addr_5'], "text"), GetSQLValueString($_POST['addr_6'], "text"), GetSQLValueString($_POST['addr_7'], "text"), GetSQLValueString($_POST['addr_8'], "text"), GetSQLValueString($_POST['lineid'], "text"), GetSQLValueString($_POST['lineid2'], "text"), GetSQLValueString($_POST['email'], "text"), GetSQLValueString($_POST['weblen'], "int"), GetSQLValueString($_POST['webmemo'], "text"), GetSQLValueString($_POST['flag'], "text"), GetSQLValueString($_POST['cuid'], "int")); mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($updateSQL, $BE2) or die(mysql_error()); if(isset($_POST['qrcode']) &&($_POST['qrcode']=='Y')){ require_once('./tcpdf/tcpdf_barcodes_2d.php'); //$code='北投遊覽車有限公司'; $code=$_POST['webname']; $id=$_POST['cuid']; $pngurl='http://www.bus104.com/'.$code; $barcodeobj = new TCPDF2DBarcode($pngurl, 'QRCODE,H'); // output the barcode as PNG image $filepng2='/www/bus104/shoppic/'.$id.'/'.$code.'.png'; if (file_exists($filepng2)){ unlink($filepng2); } $hex = $color1[$contentcolor] ; $r = hexdec(substr($hex,0,2)); $g = hexdec(substr($hex,2,2)); $b = hexdec(substr($hex,4,2)); $barcodeobj->getBarcodePNG(8, 8, array($r,$g,$b),$filepng2); $chk_file=true; // while($chk_file) { // if (file_exists($filepng2)){ $chk_file=false; } // } } $write='資料已更新...'; echo "<script>alert('".$write."');</script>"; $updateGoTo =$_POST['url'];// "main.php?act=user"; header(sprintf("Location: %s", $updateGoTo)); } $colname_Rt2 = "-1"; if (isset($_GET['id'])) { $colname_Rt2 = $_GET['id']; } mysql_select_db($database_BE2, $BE2); $query_Rt2 = sprintf("SELECT * FROM `cuser` WHERE cuid = %s", GetSQLValueString($colname_Rt2, "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_Rt1 = "SELECT * FROM city1 ORDER BY zpa0 ASC"; $Rt1 = mysql_query($query_Rt1, $BE2) or die(mysql_error()); $row_Rt1 = mysql_fetch_assoc($Rt1); $totalRows_Rt1 = mysql_num_rows($Rt1); /* 租車業者內頁 基本資料: 縣巿/區 地址 電話 訂車聯絡人 訂車專線 傳真 E-mail */ ?> <div align="center"> <span class="ti2"><a href="http://www.bus104.com/<?= $row_Rt2['webname']?>" target="_blank">http://www.bus104.com/<?= $row_Rt2['webname']?></a></span><br><br> </div> <form action="" method="POST" name="form1" id="form1"> <table width="44%" align="center"> <tr valign="baseline"> <th width="20%" height="22" align="right" valign="top" nowrap="nowrap" class="font2">帳 號:</th> <td width="80%" valign="baseline"><input name="name" type="text" id="name" value="<?php echo $row_Rt2['name']; ?>" size="20"/> <input name="addrfield" type="hidden" id="addrfield" value="addr" /></td> </tr> <tr valign="baseline"> <th height="22" align="right" valign="top" nowrap="nowrap" class="font2">公司抬頭:</th> <td valign="baseline"><input name="webname" type="text" id="webname" value="<?php echo $row_Rt2['webname']; ?>" size="32"/> <input name="addr_2" type="hidden" id="addr_2" value="<?php echo $row_Rt2['addr_2']; ?>" /> <input name="addr_4" type="hidden" id="addr_4" value="<?php echo $row_Rt2['addr_4']; ?>" /> <input name="addr_5" type="hidden" id="addr_5" value="<?php echo $row_Rt2['addr_5']; ?>" /> <input name="addr_6" type="hidden" id="addr_6" value="<?php echo $row_Rt2['addr_6']; ?>" /> <input name="addr_7" type="hidden" id="addr_7" value="<?php echo $row_Rt2['addr_7']; ?>" /> <input name="addr_8" type="hidden" id="addr_8" value="<?php echo $row_Rt2['addr_8']; ?>" /> <input name="addr_9" type="hidden" id="addr_9" value="<?php echo $row_Rt2['addr_9']; ?>" /></td> </tr> <tr valign="baseline"> <th height="22" align="right" valign="middle" nowrap="nowrap" class="font2">密 碼:</th> <td height="22" align="left" valign="middle" nowrap="nowrap"><input name="passwd" type="text" id="passwd" value="<?php echo $row_Rt2['passwd']; ?>" size="32" /></td> </tr> <tr valign="baseline"> <th height="22" align="right" valign="middle" nowrap="nowrap" class="font2">聯絡處:</th> <td height="22" align="left" valign="middle" nowrap="nowrap"><input type="text" name="addr" id="addr" value="<?php echo $row_Rt2['addr']; ?>" size="32" class="addr" readonly="" /></td> </tr> <tr valign="baseline"> <th height="22" align="right" valign="middle" nowrap="nowrap" class="font2">聯絡人:</th> <td height="22" align="left" valign="middle" nowrap="nowrap"><input name="name2" type="text" id="name2" value="<?php echo $row_Rt2['name2']; ?>" size="32" /></td> </tr> <tr valign="baseline"> <th height="22" align="right" valign="middle" nowrap="nowrap" class="font2">聯絡專線1:</th> <td height="22" align="left" valign="middle" nowrap="nowrap"><input name="tel1" type="text" id="tel1" value="<?php echo $row_Rt2['tel1']; ?>" size="32" maxlength="12" /></td> </tr> <tr valign="baseline"> <th height="22" align="right" valign="middle" nowrap="nowrap" class="font2">聯絡專線2:</th> <td height="22" align="left" valign="middle" nowrap="nowrap"><input name="tel2" type="text" id="tel2" value="<?php echo $row_Rt2['tel2']; ?>" size="32" maxlength="12" /></td> </tr> <tr valign="baseline"> <th height="22" align="right" valign="middle" nowrap="nowrap" class="font2">傳真專線:</th> <td height="22" align="left" valign="middle" nowrap="nowrap"><label for="stat"> <input name="fax" type="text" id="fax" value="<?php echo $row_Rt2['fax']; ?>" size="32" /> </label></td> </tr> <tr valign="baseline"> <th height="22" align="right" valign="middle" nowrap="nowrap" class="font2">Line ID :</th> <td height="22" align="left" valign="middle" nowrap="nowrap"><input name="lineid" type="text" id="lineid" value="<?php echo $row_Rt2['lineid']; ?>" size="32" maxlength="80" /></td> </tr> <tr valign="baseline"> <th height="22" align="right" valign="middle" nowrap="nowrap" class="font2">Line 行動ID :</th> <td height="22" align="left" valign="middle" nowrap="nowrap"><input name="lineid2" type="text" id="lineid2" value="<?php echo $row_Rt2['lineid2']; ?>" size="32" maxlength="80" /></td> </tr> <tr valign="baseline"> <th height="22" align="right" valign="middle" nowrap="nowrap" class="font2">E-mail :</th> <td height="22" align="left" valign="middle" nowrap="nowrap"><label for="radio"> <input name="email" type="text" id="email" value="<?php echo $row_Rt2['email']; ?>" size="32" maxlength="80" /> </label></td> </tr> <tr valign="baseline"> <th height="22" align="right" valign="middle" nowrap="nowrap" class="font2">資料啟用 :</th> <td height="22" align="left" valign="middle" nowrap="nowrap"> <select name="flag" id="flag" > <option value="Y" <? if($row_Rt2['flag']=='Y'){?> selected="selected"<? }?>>Y</option> <option value="N" <? if($row_Rt2['flag']=='N'){?> selected="selected"<? }?>>N</option> </select> 開啟子網站模組</td> </tr> <tr valign="baseline"> <th height="22" align="center" valign="middle" nowrap="nowrap" class="font2">其他網址 :</th> <td height="22" align="left" valign="middle" nowrap="nowrap"><input name="webaddr" type="text" id="webaddr" value="<?php echo $row_Rt2['webaddr']; ?>" size="32" maxlength="80" /> 如無自訂網址保持空白</td> </tr> <tr valign="baseline"> <th height="22" align="center" valign="middle" nowrap="nowrap" class="font2">簡短顯示字元 :</th> <td height="22" align="left" valign="middle" nowrap="nowrap"><input name="weblen" type="text" id="weblen" value="<?php echo $row_Rt2['weblen']; ?>" size="12" maxlength="8" /></td> </tr> <tr valign="baseline"> <th height="40" align="center" valign="middle" nowrap="nowrap" class="font2">備註欄 :</th> <td height="40" align="left" valign="middle" nowrap="nowrap"><textarea name="webmemo" cols="40" rows="6" id="webmemo"><?php echo $row_Rt2['webmemo']; ?></textarea></td> </tr> <tr valign="baseline"> <td height="24" align="center" valign="middle" nowrap="nowrap" class="font2"> </td> <td height="24" align="left" valign="middle" nowrap="nowrap"><input name="qrcode" type="checkbox" id="qrcode" value="Y" /> <label for="qrcode"></label> <font color="#FF0000">重建抬頭QRCODE</font></td> </tr> <tr valign="baseline"> <td height="40" colspan="2" align="center" valign="middle" nowrap="nowrap"><input type="submit" value="修改資料" /></td> </tr> </table> <input name="cuid" type="hidden" id="cuid" value="<?php echo $row_Rt2['cuid']; ?>" /> <input type="hidden" name="MM_update" value="form1" /> <input name="url" type="hidden" id="url" value="<?= $_SERVER['HTTP_REFERER']; ?>" /> </form> <div id="addrdiv" style="display:none"><? include "addr.php" ;?></div> <?php mysql_free_result($Rt2); mysql_free_result($Rt1); ?>
保存
取消
返回文件列表