查看文件: user_editecardfile.php
大小: 23.85 KB
类型: application/octet-stream
<?php require_once('../Connections/BE2.php'); ?> <?php if (!isset($_SESSION)){ session_start(); } /* function correctImageOrientation($filename) { if (function_exists('exif_read_data')) { $exif = exif_read_data($filename); if($exif && isset($exif['Orientation'])) { $orientation = $exif['Orientation']; if($orientation != 1){ $img = imagecreatefromjpeg($filename); $deg = 0; switch ($orientation) { case 3: $deg = 180; break; case 6: $deg = 270; break; case 8: $deg = 90; break; } if ($deg) { $img = imagerotate($img, $deg, 0); } // then rewrite the rotated image back to the disk as $filename imagejpeg($img, $filename, 95); } // if there is some rotation necessary } // if have the exif orientation info } // if function exists } */ if (isset($_POST["MM_update"])) { $idpath= sprintf("%07d",$_SESSION['login_memid']) ; $wwwpath='/www2/skybni'; $spicpath= "/ecard/simg/user_".$idpath; $picpath= "/ecard/img/user_".$idpath; //$syscall_3b="/usr/local/bin/convert $pic -thumbnail \"450x800^\" $repic3b"; if($_POST["MM_update"] == "fp1"){ $tfile1="fileToUpload1"; $mem_logo2=$_POST['mem_logo2']; $bgimg =$_POST['bgimg']; $tfile2="fileToUpload2"; $mem_logo3=$_POST['mem_logo3']; $img_ext_array=array("jpg","jpeg","bmp","png","gif"); if($_FILES[$tfile1]["name"]<>''){ $ext= explode('.',$_FILES[$tfile1]['name']) ; $imgext=strtolower($ext[count($ext)-1]); //取最後一筆 if(in_array($imgext,$img_ext_array)){ $spic=$wwwpath.$spicpath.".".$imgext; $pic=$wwwpath.$picpath.".".$imgext; $mem_logo2=$imgext; move_uploaded_file($_FILES[$tfile1]["tmp_name"],$spic); // move_uploaded_file($uploadedFile, $destinationFilename); // correctImageOrientation($spic); $chk_file=true; while($chk_file) { if (file_exists($spic)){ $chk_file=false; } } $syscall_3a="/usr/local/bin/convert $spic -thumbnail \"800x800^\" $pic"; $output1=`$syscall_3a`; $chk_file=true; while($chk_file) { if (file_exists($pic)){ $chk_file=false; } } $repic ='/www2/skybni/ecard/reimg/user_'.$idpath.".".$imgext; $syscall_3b="/usr/local/bin/convert $pic -resize 300x300 -size 300x300 xc:white +swap -gravity center -composite $repic"; $output2=`$syscall_3b`; } } if($_FILES[$tfile2]["name"]<>''){ $ext2= explode('.',$_FILES[$tfile2]['name']) ; $imgext2=strtolower($ext2[count($ext2)-1]); //取最後一筆 $pic2=$wwwpath.$picpath."b.".$imgext2; $mem_logo3=$imgext2; move_uploaded_file($_FILES[$tfile2]["tmp_name"],$pic2); $bgimg =2; } $updateSQL = sprintf("UPDATE member SET mem_logo2_ck=%s, mem_search=%s, font_color=%s, mem_logo2=%s, mem_logo3=%s,bgimg=%s,mcapture=0 WHERE mem_auto=%s", GetSQLValueString($_POST['mem_logo2_ck'], "text"), GetSQLValueString($_POST['mem_search'], "text"), GetSQLValueString($_POST['font_color'], "text"), GetSQLValueString($mem_logo2, "text"), GetSQLValueString($mem_logo3, "text"), GetSQLValueString($bgimg, "int"), GetSQLValueString($_SESSION['login_memid'], "int")); mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($updateSQL, $BE2) or die(mysql_error()); $msg='更新完成....' ; $updateGoTo = "editecardfile.html"; // $updateSQL = sprintf("UPDATE member SET mem_logo2_ck=%s, ck_search=%s, font_color=%s, mem_logo2=%s, company_name=%s, company_title=%s,mem_logo=%s WHERE mem_auto=%s", echo '<script>alert("'.$msg.'");</script>'; } else if($_POST["MM_update"] == "fp2"){ $updateSQL2 = sprintf("UPDATE member SET mem_title=%s,mem_user=%s,mem_user2=%s,mem_name_en=%s ,mem_mobile2=%s,mem_line=%s,mem_google=%s,mem_mail=%s,mem_ecardaddr=%s WHERE mem_auto=%s", GetSQLValueString($_POST['mem_title'], "text"), GetSQLValueString($_POST['mem_user'], "text"), GetSQLValueString($_POST['mem_user2'], "text"), GetSQLValueString($_POST['mem_name_en'], "text"), GetSQLValueString($_POST['mem_mobile2'], "text"), GetSQLValueString($_POST['mem_line'], "text"), GetSQLValueString($_POST['mem_google'], "text"), GetSQLValueString($_POST['mem_mail'], "text"), GetSQLValueString($_POST['mem_ecardaddr'], "text"), GetSQLValueString($_SESSION['login_memid'], "int")); /* nameS_ckS in /www2/skybni/guest/body_editecardfile.php on line 153 Notice: Undefined index: mem_name_ck in /www2/skybni/guest/body_editecardfile.php on line 155 Notice: Undefined index: mem_name_en_ck in /www2/skybni/guest/body_editecardfile.php on line 157 */ mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($updateSQL2, $BE2) or die(mysql_error()); $msg='更新完成....' ; $updateGoTo = '/ecard/'.$_POST['scode'];//"/editecardfile.html"; echo '<script>alert("'.$msg.'");location.href = "'.$updateGoTo.'";</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.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); ?> <style type="text/css"> <!-- #Ly { position: fixed; left: 0; top: 0; height:1px; z-index:3; background-color: #666666; filter:alpha(opacity=80); --> </style> <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-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>1.雲名片資料管理</strong></h2> </div> <div class="panel-body"> <h3> 雲名片網址 : <font color="blue"><a href="/ecard/<?= $row_Rt2['scode'] ; ?>" target="_blank">https://skybni.com/ecard/<?= $row_Rt2['scode'] ; ?></a></font></h3> <? /* <img name="" width="100" height="100" src="../qrcode.php?qr=https://skybni.com/ecard/<?= $row_Rt2['scode'] ; ?>"/> */ ?> <table width="245" border="2" cellpadding="2"> <tr> <td width="114"><img name="" width="200" src="/ecard/img/<?= "user_".sprintf("%07d",$row_Rt2['mem_auto']).'.'.$row_Rt2['mem_logo2']; ?>"/></td> <td width="109" align="center" valign="middle"><img src="../icon/refresh.png" width="36" height="32" alt="旋轉" onclick="imgrotate()" /> <h3 onclick="imgrotate()">旋轉90度</h3> </td> </tr> </table> <form action="editecardfile.html" method="post" name="fop1" id="fop1" enctype="multipart/form-data"> <div class="form-group"> <label class="col-md-4 control-label" for="passwd1"> 上傳雲名片頭像</label> <div class="col-md-8"> <input name="fileToUpload1" type="file" id="fileToUpload1" /> <input type="hidden" name="MM_update" value="fp1" /> <span class="help-block"> </span> </div> </div> <div class="form-group"> <label class="col-md-4 control-label" >上傳後是否呈現:</label> <div class="col-md-8"> <label> <input type="radio" name="mem_logo2_ck" id="mem_logo2_ck" value="Y" <?= ($row_Rt2['mem_logo2_ck']=='Y')?'checked="checked"':''; ?> style="WIDTH: 22px; HEIGHT: 22px" /> <i></i> 顯示</label> <label> <input type="radio" name="mem_logo2_ck" id="mem_logo2_ck" value="N" <?= ($row_Rt2['mem_logo2_ck']=='N')?'checked="checked"':''; ?> style="WIDTH: 22px; HEIGHT: 22px"/> <i></i> 隱藏</label> <span class="help-block"> </span> </div> </div> <div class="form-group"> <label class="col-md-4 control-label" for="passwd1">開放搜尋</label> <div class="col-md-8"> <label> <input type="radio" name="mem_search" value="Y" style="WIDTH: 22px; HEIGHT: 22px" <?= ($row_Rt2['mem_search']=='Y')?'checked="checked"':''; ?>/> <i></i> 開放搜尋</label> <label> <input type="radio" name="mem_search" value="N" style="WIDTH: 22px; HEIGHT: 22px" <?= ($row_Rt2['mem_search']=='N')?'checked="checked"':''; ?>/> <i></i> 不開放搜尋</label> <span class="help-block"> </span> </div> </div> <div class="form-group"> <label class="col-md-4 control-label" for="passwd1">文字顏色:</label> <div class="col-md-8"> <label> <? // g-color-white g-color-blue ?> <input type="radio" name="font_color" value="W" style="WIDTH: 22px; HEIGHT: 22px" <?= ($row_Rt2['font_color']=='W')?'checked="checked"':''; ?> /> <i></i> 白色</label> <label> <input type="radio" name="font_color" value="B" style="WIDTH: 22px; HEIGHT: 22px" <?= ($row_Rt2['font_color']=='B')?'checked="checked"':''; ?>/> <i></i> 藍色</label> <span class="help-block"> </span> </div> </div> <div class="form-group"> <label class="col-md-4 control-label" for="passwd1">使用預設背景:</label> <div class="col-md-8"> <label> <? // g-color-white g-color-blue ?> <input type="radio" name="bgimg" value="0" style="WIDTH: 22px; HEIGHT: 22px" <?= ($row_Rt2['bgimg']=='0')?'checked="checked"':''; ?> /> <i></i> 預設星空</label><div><img name="m01" src="/ecard/img/backgroud01.jpg" width="32" height="32" alt="" /></div> <label> <input type="radio" name="bgimg" value="1" style="WIDTH: 22px; HEIGHT: 22px" <?= ($row_Rt2['bgimg']=='1')?'checked="checked"':''; ?>/> <i></i> 預設天空</label><div><img name="m02" width="32" height="32" src="/ecard/img/backgroud02.jpg" alt="" /></div> <input type="radio" name="bgimg" value="2" style="WIDTH: 22px; HEIGHT: 22px" <?= ($row_Rt2['bgimg']=='2')?'checked="checked"':''; ?>/> <? if ($row_Rt2['mem_logo3']==''){ $background_image =""; }else{ $background_image ="/ecard/img/user_".sprintf("%07d",$row_Rt2['mem_auto']).'b.'.$row_Rt2['mem_logo3'] ; } ?> <i></i> 會員上傳</label><div><img name="m02" width="32" height="32" src="<?=$background_image ?>" alt="" /></div> <label> <? // g-color-white g-color-blue ?> <input type="radio" name="bgimg" value="3" style="WIDTH: 22px; HEIGHT: 22px" <?= ($row_Rt2['bgimg']=='3')?'checked="checked"':''; ?> /> <i></i> 不使用背景圖</label><div></div> <span class="help-block"> </span> </div> </div> <div class="form-group"> <label class="col-md-4 control-label" for="passwd1"> 上傳雲名片背景圖像</label> <div class="col-md-8"> <input name="fileToUpload2" type="file" id="fileToUpload2" /> <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_update" value="fp1" /> <input type="hidden" name="mem_logo2" value="<?= $row_Rt2['mem_logo2'] ; ?>" /> <input type="hidden" name="mem_logo3" value="<?= $row_Rt2['mem_logo3'] ; ?>" /> </form> PS: 圖檔支援格式 "jpg","jpeg","bmp","png","gif" </div> </div> </div> </div> <!-- end: Content --> <br><br><br> <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>2.雲名片個資</strong></h2> </div> <div class="panel-body"> <form action="editecardfile.html" method="post" name="fop2" id="fop2" > <div class="form-group"> <label class="col-md-3 control-label" for="passwd1"> 公司名稱</label> <div class="col-md-9"> <input name="mem_title" type="text" id="mem_title" value="<?= $row_Rt2['mem_title'] ; ?>" size="28" /> <input type="hidden" name="MM_update" value="fp2" /> <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_user" id="mem_user" value="<?= $row_Rt2['mem_user'] ; ?>" size="28" /> <span class="help-block"> </span> <input name="scode" type="hidden" id="scode" value="<?= $row_Rt2['scode'] ; ?>" /> </div> </div> <div class="form-group"> <label class="col-md-3 control-label" for="passwd1"><font color="#FF0000">*</font><b>中文姓名</b></label> <div class="col-md-9"> <input name="mem_user2" type="text" required="required" id="mem_user2" value="<?= $row_Rt2['mem_user2'] ; ?>" size="28" /> <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 name="mem_name_en" type="text" id="mem_name_en" value="<?= $row_Rt2['mem_name_en'] ; ?>" size="28" /> <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 name="mem_mobile2" type="text" id="mem_mobile2" value="<?= $row_Rt2['mem_mobile2'] ; ?>" size="28" /> <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 name="mem_ecardaddr" type="text" id="mem_ecardaddr" value="<?= $row_Rt2['mem_ecardaddr'] ; ?>" size="28" /> <span class="help-block"></span> </div> </div> <div class="form-group"> <label class="col-md-3 control-label" for="passwd1">Line行動條碼</label> <div class="col-md-9"> <input name="mem_line" type="text" id="mem_line" value="<?= $row_Rt2['mem_line'] ; ?>" size="28" /> <span class="help-block"><img name="" src="images/line.png" width="32" height="32" alt="line" />LINE網址<a href="#" onclick="showproce()" >(取得流程)</a> 例: https://line.me/ti/p/7TfJGOaMHj</span> </div> </div> <div class="form-group"> <label class="col-md-3 control-label" for="passwd1">Google 地圖</label> <div class="col-md-9"> <input name="mem_google" type="text" id="mem_google" value="<?= $row_Rt2['mem_google'] ; ?>" size="28" /> <span class="help-block"> </span>Google 地圖例:台北市復興北路342號7樓</div> </div> <div class="form-group"> <label class="col-md-3 control-label" for="passwd1">Email</label> <div class="col-md-9"> <input name="mem_mail" type="text" id="mem_mail" value="<?= $row_Rt2['mem_mail'] ; ?>" size="28" /> <span class="help-block"></span> </div> </div> <div class="form-group"> <div class="col-md-9"> <span class="help-block"></span> </div> </div> <div class="form-group form-actions"> <button type="submit" class="btn btn-primary">保存</button> </div> </form> </div> </div> </div> </div> </div> <div id="Ly" style="top:250;left:450;width:720px;height:550px;overflow:auto;justify-content:center;<?= "display:none;" ?> onClick="showhide()" > </div> <script type="text/javascript"> function showhide(){ // style="width:300px;height:250px;overflow:auto;" $('#Ly').toggle(1000); // $('#Ly').height("500px").css({width:"720px",overflow:"auto",background-color:"gray"}); //$('#Ly').height(screen.height).css({width:screen.width,cursor:"auto", "background-color":"gray"}); // $('#Ly').fadeTo(0, 0.5); } function lyhide(){ $('#Ly').hide(); } function showproce(){ var generator=window.open('','name','height=800,width=720, scrollbars=yes'); generator.document.write('<html><head><title>取得 LINE網址 流程</title>'); generator.document.write('<table width="100" border="0" cellpadding="0">'); generator.document.write('<tr><td colspan="2"><h2>取得 LINE網址 流程</h2>'); generator.document.write('1.點加入好友</br>'); generator.document.write('2.點上方的「邀請」→「簡訊」→選任一個使用者送出邀請之後就能看到你的LINE專屬網址囉<br>'); generator.document.write('3.請複製網址貼到line的欄位<br>'); generator.document.write('</td></tr><tr><td><img src="images/line1.jpg" width="350"/></td>'); generator.document.write('<td><img src="images/line2.jpg" width="350"/></td>'); generator.document.write('</tr><tr><td><img src="images/line3.jpg" width="350"/></td>'); generator.document.write('<td><img src="images/line4.jpg" width="350"/></td></tr></table>'); generator.document.write('</body></html>'); generator.document.close(); } function imgrotate(){ //var pname=$('#pname').val(); var answer = confirm('旋轉90度嗎?'); var imgid='<?= $row_Rt2['mem_auto']; ?>'; var imgxt='<?= $row_Rt2['mem_logo2'] ; ?>'; if(answer){ $.ajax({ type: 'POST', url: 'ajax_img_rotate.php', data: { 'imgid': imgid,'imgxt':imgxt }, success: function (data) { // the next thing you want to do alert(data); location.reload(); } }); } // else{ alert('N'); } } 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); ?>
保存
取消
返回文件列表