查看文件: body_editecardfile_m.php
大小: 23.6 KB
类型: application/octet-stream
<?php require_once('../Connections/BE2.php'); ?> <?php if (!isset($_SESSION)){ session_start(); } 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; } */ $mcapture=0; // set capture true if( $_SERVER['REMOTE_ADDR']=='220.130.43.118'){$mcapture=1;} $updateSQL = sprintf("UPDATE member SET mem_logo2_ck=%s, mem_search=%s, font_color=%s, mem_logo2=%s, mem_logo3=%s,bgimg=%s,mcapture=%s 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($mcapture, "int"), GetSQLValueString($_SESSION['login_memid'], "int")); mysql_select_db($database_BE2, $BE2); $Result1 = mysql_query($updateSQL, $BE2) or die(mysql_error()); // set cap1 <?= $row_Rt2['mem_title'] ; if( $_SERVER['REMOTE_ADDR']=='220.130.43.118'){ include "../phpqrcode/qrlib.php"; //QRcode::png($_GET['qr']); $uri='http://www.skybni.com/ecard/'.$_POST['scode2']; //https://www.skybni.com/ecard/ag35882 1422X800 $backColor = 0xFFFFFF; $foreColor = 0x0e17cc ; $f= "/www2/skybni/test007/tmpimgs/".date('YmdHis').'.png' ; $savefi= "/www2/skybni/test007/tmpimgs/".date('YmdHis').'_'.$_POST['scode2'] ; QRcode::png($uri, $f, QR_ECLEVEL_L, 2, 3, false, $backColor, $foreColor); //62X62 $i=0; while ($i<50) { if(file_exists($f)){ break; } sleep(0.25); $i++; } $srcqrcode = imagecreatefrompng($f); $dest = imagecreatefrompng('/www2/skybni/test007/member_backgroud.png'); $filename=$picpath.'.'.$mem_logo2 ;// list($width, $height) = getimagesize($filename); $src = imagecreatefromjpeg($filename); //b1=440X340 . user_0000441.jpg =1422X800 $thumb = imagecreatetruecolor(440, 340); imagecopyresized($thumb, $src, 0, 0, 0, 0, 440, 340, $width, $height); imagealphablending($dest, false); imagesavealpha($dest, true); imagecopymerge($dest, $thumb, 15, 120, 0, 0, 440, 330, 100);//470X700 440X330 imagecopymerge($dest, $srcqrcode, 318, 538, 4, 4, 65, 65, 100);//470X700 440X330 $gray = 0x323232; // ImageColorAllocate($im, 200,200,200); $myfont="/www2/skybni/fonts/kaiu.ttf"; $text='MILNAS安心超市'; ImageTTFText($dest,14,0,18,495, $gray,$myfont,$text); $text='會員編號:'; ImageTTFText($dest,14,0,370,495, $gray,$myfont,$text); $text='團購經理 潘盈芝 Serena' ;//'南港路' ;//substr($authnum,$c,1); // $row_Rt2['mem_user'].' '.$row_Rt2['mem_user2']. $row_Rt2['mem_name_en'] ; ImageTTFText($dest,14,0,18,522, $gray,$myfont,$text); $text=$_POST['scode2']; ImageTTFText($dest,14,0,385,522, $gray,$myfont,$text); header('Content-Type: image/png'); imagepng($dest,$sf); imagepng($dest); imagedestroy($dest); imagedestroy($src); imagedestroy($thumb); unlink($f); } // end 220 $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"){ // ,mem_mobile2=%s $updateSQL2 = sprintf("UPDATE member SET mem_title=%s,mem_user=%s,mem_user2=%s,mem_name_en=%s,mem_line=%s,mem_google=%s,mem_mail=%s,mem_ecardaddr=%s,adkind=%s,mem_ad=%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($_POST['adkind'], "int"), GetSQLValueString($_POST['mem_ad'], "int"), 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.'");</script>'; //location.href = "'.$updateGoTo.'" } } //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); mysql_select_db($database_BE2, $BE2); $query_Rvt3 = "SELECT * FROM travel where tbc='廣告會員網' AND tb3='Y' AND tb2<>'' order by tbx,tb0" ; //default 121 $Rvt3 = mysql_query($query_Rvt3, $BE2) or die(mysql_error()); $row_Rvt3 = mysql_fetch_assoc($Rvt3); $totalRows_Rvt3 = mysql_num_rows($Rvt3); $query_Rot2 = "SELECT * FROM addrcity where 1 order by k1"; $Rot2 = mysql_query($query_Rot2, $BE2) or die(mysql_error()); $row_Rot2 = mysql_fetch_assoc($Rot2); $totalRows_Rot2 = mysql_num_rows($Rot2); ?> <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" /> <input type="hidden" name="mem_logo2_ck" id="mem_logo2_ck" value="Y"/> <input type="hidden" name="mem_search" id="mem_search" value="Y" /> <input type="hidden" name="bgimg" id="bgimg" value="3" /> <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 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'] ; ?>" /> <input name="scode2" type="hidden" id="scode2" value="<?= $row_Rt2['scode'] ; ?>" /> </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"> <select name="adkind" id="adkind" class="form-control placeholder"> <? do { ?> <option value="<?= $row_Rvt3['tb0']; ?>" <?= ($row_Rt2['adkind']==$row_Rvt3['tb0'])?'selected="selected"':""; ?>><?= $row_Rvt3['tb2']; ?></option> <? } while ($row_Rvt3 = mysql_fetch_assoc($Rvt3)); ?> </select> <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"> <select name="mem_ad" id="mem_ad" class="form-control placeholder col-xs-12 col-sm-4 mb-4" onchange="Selectcity()"> <? do { ?> <option value="<?= $row_Rot2['k1']; ?>" <?= ($row_Rot2['k1']==$row_Rt2['mem_ad'])?'selected="selected"':""; ?>> <?= $row_Rot2['county']; ?> </option> <?php } while ($row_Rot2 = mysql_fetch_assoc($Rot2)); ?> </select> <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_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_mobile'] ; ?>" size="28" readonly="readonly" /> <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); mysql_free_result($Rvt3); ?>
保存
取消
返回文件列表