查看文件: body_sharepoint.php
大小: 7.64 KB
类型: application/octet-stream
<?php require_once('../Connections/BE2.php'); ?> <?php if (!isset($_SESSION)){ session_start(); } if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $inSQL8 =sprintf("insert into order_point(eccid,emem_num,euid,e_type,e_oval,e_date,e_flag)VALUES('0',%s,%s,%s,%s,%s,'Y')", GetSQLValueString($_POST['mem_num'], "int"), //mem_auto 自己 ID GetSQLValueString($_SESSION['login_memid'], "int"), // 介紹人ID e_flag 可用 GetSQLValueString("8", "int"), // 8 雲點轉出 9 雲點轉入 Y GetSQLValueString($_POST['share_point'], "int"), // 3 點 //Rtype_pric GetSQLValueString(date('Y-m-d'), "text")); mysql_select_db($database_BE2, $BE2); mysql_query($inSQL8, $BE2) or die(mysql_error()); $inSQL9 =sprintf("insert into order_point(eccid,emem_num,euid,e_type,e_ival,e_date,e_flag)VALUES('0',%s,%s,%s,%s,%s,'Y')", GetSQLValueString($_SESSION['login_memid'], "int"), //mem_auto 自己 ID GetSQLValueString($_POST['mem_num'], "int"), // 介紹人ID e_flag 可用 GetSQLValueString("9", "int"), // 8 雲點轉出 9 雲點轉入 Y GetSQLValueString($_POST['share_point'], "int"), // 3 點 //Rtype_pric GetSQLValueString(date('Y-m-d'), "text")); mysql_select_db($database_BE2, $BE2); mysql_query($inSQL9, $BE2) or die(mysql_error()); $write='資料已更新...'; $insertGoTo = "inpoint.html" ; echo "<script>alert('".$write."');location.href='". $insertGoTo."';</script>"; } mysql_select_db($database_BE2, $BE2); $query_Rt2 = sprintf("SELECT sum(e_ival) as e_i,sum(e_oval) as e_o FROM order_point WHERE euid='%s' group by euid ",$_SESSION['login_memid']); $Rt2 = mysql_query($query_Rt2, $BE2) or die(mysql_error()); $row_Rt2 = mysql_fetch_assoc($Rt2); ?> <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-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"> <? $diff_point=$row_Rt2['e_i']-$row_Rt2['e_o']; ?> <form action="sharepoint.html" method="post" name="form1" id="form1" onsubmit="return checkForm1(this);"> <div class="form-group"> <label class="col-md-3 control-label" for="passwd1">目前累積總點數:</label> <div class="col-md-9"> <input name="e_i" id="e_i" type="hidden" value="<?= $diff_point ; ?>" class="form-control" readonly="readonly" /><?= $row_Rt2['e_i'] ; ?> <span class="help-block"> </span> </div> </div> <div class="form-group"> <label class="col-md-3 control-label" >可用點數:</label> <div class="col-md-9"> <input type="hidden" name="diff_point" id="diff_point" value="<?= $diff_point ; ?>" class="form-control" readonly="readonly" /><?= $diff_point ; ?> <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="share_point" id="share_point" value="0" class="form-control" onchange="set_diffpoint();"/> <span class="help-block">分享點數</span> </div> </div> <div class="form-group"> <label class="col-md-3 control-label" for="passwd1">分享ID碼:</label> <div class="col-md-9"> <input name="pname" id="pname" type="text" value="" class="form-control" placeholder="請輸入分享ID碼" required/> <span class="help-block">請輸入分享ID碼 </span> </div> </div> <div class="form-group"> <div class="col-md-9"> <span class="help-block"></span> <button type="button" class="label label-info" onclick="found_pmem()">尋找推薦ID</button> </div> </div> <div class="form-group form-actions"> <button type="submit" class="btn btn-primary">保存</button> </div> <input type="hidden" name="mem_num" id="mem_num" value="" /> <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" id="MM_update" value="form1" /> </form> </div> </div> </div> <!--/row--> </div> <!-- end: Content --> <br> <button type="button" class="label label-info" onclick="location.href='pointcurr.html'">回-目前可用點數</button> </div> <script type="text/javascript"> function checkForm1(my){ var a=$('#mem_num').val(''); var f=ival($('#share_point').val()); if (f<1||a==''){ alert("請選取分享ID 或是 分享值必須大於0 ..\n "); return false; }else{return true; } } function set_diffpoint(){ var d=$('#diff_point').val(); var f=ival($('#share_point').val()); if(f>d){ $('#share_point').val(0);} } function found_pmem() { $('#mem_num').val(''); 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('找到分享ID碼..');} else{ alert('找不到ID碼..'); } }); return false; }; function ival(num){ var num=parseFloat(num); if(isNaN(num)) return 0; return num; } </script> <!-- end: Content --> <?php mysql_free_result($Rt2); ?>
保存
取消
返回文件列表