 |
|
Code (PHP)
<?php
$photofilename=md5(time("now"));
if(isset($_POST['save'])){
$member_key = md5(addslashes($_POST['member_code']).time("now"));
if (!defined('UPLOADDIR')) define('UPLOADDIR','../resource/members/images/');
if (is_uploaded_file($_FILES["member_photo"]["tmp_name"])) {
$File_name = $_FILES["member_photo"]["name"];
$File_tmpname = $_FILES["member_photo"]["tmp_name"];
$fn=md5(date("Ymd").time("now")).".jpg";
if ($_FILES["member_photo"]["type"] == "image/jpeg"){
if (move_uploaded_file($File_tmpname, (UPLOADDIR . "/" .$fn)));
}else{
echo '<script>alert("ใช้รูปภาพนามสกุล JPG เท่านั้น !")</script>';
}
}
if(addslashes($_POST['member_name']) != NULL && addslashes($_POST['member_lastname']) != NULL){
if($File_name != NULL){
resizeMemberThumb($fn);
$getdata->my_sql_insert("member","member_key='".$member_key."',member_code='".addslashes($_POST['txt_member_code'])."',member_prefix='".addslashes($_REQUEST['member_prefix'])."',member_name='".addslashes($_POST['member_name'])."',member_lastname='".addslashes($_POST['member_lastname'])."',member_prefix_en='".addslashes($_REQUEST['member_prefix_en'])."',member_name_en='".addslashes($_POST['member_name_en'])."',member_lastname_en='".addslashes($_POST['member_lastname_en'])."',member_address='".addslashes($_POST['member_address'])."',member_subdistrict='".addslashes($_POST['member_subdistrict'])."',member_district='".addslashes($_POST['member_district'])."',member_province='".addslashes($_POST['member_province'])."',member_tel='".addslashes($_POST['member_phone'])."',member_licence_a='".addslashes($_POST['member_licence_a'])."',member_licence_b='".addslashes($_POST['member_licence_b'])."',member_licence_c='".addslashes($_POST['member_licence_c'])."',pr_member_name='".addslashes($_POST['pr_name'])."',pr_member_tel='".addslashes($_POST['pr_phone'])."',member_numcard='".addslashes($_POST['member_numcard'])."',member_numcard_start='".addslashes($_POST['member_numcard_start'])."',member_numcard_end='".addslashes($_POST['member_numcard_end'])."',member_photo='".$fn."',member_status='1'");
}else if(addslashes($_POST['h_member_photo']) != NULL){
$photo = addslashes($_POST['h_member_photo']).".jpg";
resizeMemberThumb($photo);
$getdata->my_sql_insert("member","member_key='".$member_key."',member_code='".addslashes($_POST['txt_member_code'])."',member_prefix='".addslashes($_REQUEST['member_prefix'])."',member_name='".addslashes($_POST['member_name'])."',member_lastname='".addslashes($_POST['member_lastname'])."',member_prefix_en='".addslashes($_REQUEST['member_prefix_en'])."',member_name_en='".addslashes($_POST['member_name_en'])."',member_lastname_en='".addslashes($_POST['member_lastname_en'])."',member_address='".addslashes($_POST['member_address'])."',member_subdistrict='".addslashes($_POST['member_subdistrict'])."',member_district='".addslashes($_POST['member_district'])."',member_province='".addslashes($_POST['member_province'])."',member_tel='".addslashes($_POST['member_phone'])."',member_licence_a='".addslashes($_POST['member_licence_a'])."',member_licence_b='".addslashes($_POST['member_licence_b'])."',member_licence_c='".addslashes($_POST['member_licence_c'])."',pr_member_name='".addslashes($_POST['pr_name'])."',pr_member_tel='".addslashes($_POST['pr_phone'])."',member_numcard='".addslashes($_POST['member_numcard'])."',member_numcard_start='".addslashes($_POST['member_numcard_start'])."',member_numcard_end='".addslashes($_POST['member_numcard_end'])."',member_photo='".$photo."',member_status='1'");
}else{
$getdata->my_sql_insert("member","member_key='".$member_key."',member_code='".addslashes($_POST['txt_member_code'])."',member_prefix='".addslashes($_REQUEST['member_prefix'])."',member_name='".addslashes($_POST['member_name'])."',member_lastname='".addslashes($_POST['member_lastname'])."',member_prefix_en='".addslashes($_REQUEST['member_prefix_en'])."',member_name_en='".addslashes($_POST['member_name_en'])."',member_lastname_en='".addslashes($_POST['member_lastname_en'])."',member_address='".addslashes($_POST['member_address'])."',member_subdistrict='".addslashes($_POST['member_subdistrict'])."',member_district='".addslashes($_POST['member_district'])."',member_province='".addslashes($_POST['member_province'])."',member_tel='".addslashes($_POST['member_phone'])."',member_licence_a='".addslashes($_POST['member_licence_a'])."',member_licence_b='".addslashes($_POST['member_licence_b'])."',member_licence_c='".addslashes($_POST['member_licence_c'])."',pr_member_name='".addslashes($_POST['pr_name'])."',member_numcard='".addslashes($_POST['member_numcard'])."',member_numcard_start='".addslashes($_POST['member_numcard_start'])."',member_numcard_end='".addslashes($_POST['member_numcard_end'])."',pr_member_tel='".addslashes($_POST['pr_phone'])."',member_status='1'");
$display_alert = '<div class="alert_box green"><img src="../media/icons/set/color/right1.png" width="32" height="32">เพิ่มสมาชิกวิน ฯ สำเร็จ!</div>';
}
}
}
?>

Tag : PHP, Appserv
|
ประวัติการแก้ไข 2019-04-22 15:45:34
|
 |
 |
 |
 |
Date :
2019-04-22 15:44:56 |
By :
Error 404 |
View :
731 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |