File: /home/klungadmin/domains/klungbaan.com/private_html/chat-system/problem-report.php
<?php
$config = (@$_GET['lang']==''||@$_GET['lang']=='th'?'config_th.php' : 'config_en.php');
require_once('config/'.$config);
require_once('config/connect.php');
require_once('class/class_main.php');
$cls = new Main($pdo);
$utm_source = $utm_medium = $utm_campaign = '';
if(@isset($_GET["utm_source"]) && @$_GET['utm_source'] == 'facebook'){
$utm_source = 'facebook';
} else {
$utm_source = 'line';
}
if( isset($_GET["utm_medium"] ) ){
$utm_medium = $_GET['utm_medium'];
}
if( isset($_GET["utm_campaign"] ) ){
$utm_campaign = $_GET['utm_campaign'];
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>ข้อมูลลูกค้า</title>
<?php include('header.php'); ?>
<link href="<?php path_root ?>assets/sb-admin-2/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<style>
body {
background-color: #00335a;
}
.bg-login-image {
background: url(https://www.klungbaan.com/chat-system/assets/img/BG-LEAD.jpg);
background-position: center;
background-size: cover;
}
.easy-autocomplete {
width:100%;
}
.form-group {
margin-bottom: 25px;
}
.form-control {
height: 45px;
border-radius: 10px !important;
}
label {
font-weight: 100;
}
.custom-radio {
display:inline;
padding-right: 15px;
}
.custom-control-label::before {
width: 3rem;
height: 3rem;
}
.custom-control-label::after {
width: 3rem;
height: 3rem;
}
.custom-control-input:checked~.custom-control-label::before {
color:black;
border-color: #fcf500;
background-color: #fcf500;
}
.custom-radio.small label {
line-height: 3.5rem !important;
padding-left: 25px;
}
.has-error .form-control {
border-color: #fcf500 !important;
}
.has-error .radio, .has-error .radio-inline, .has-error .control-label, .has-error .help-block, .has-error .radio, .has-error .radio-inline, .has-error.radio label, .has-error.radio-inline label, .has-error.radio label, .has-error.radio-inline label {
color: #fcf500;
}
.error:after {
text-shadow: -1px 0 #fcf500;
}
.easy-autocomplete-container li{
color: black !important;
}
@media (max-width: 768px){
.custom-control-label::before {
width: 2rem;
height: 2rem;
}
.custom-control-label::after {
width: 2rem;
height: 2rem;
}
.custom-radio.small label {
line-height: 2.5rem !important;
padding-left: 10px;
}
.custom-radio {
padding-right: 5px;
}
}
</style>
</head>
<!-- <body class="bg-gradient-primary"> -->
<body class="">
<div class="container" style="width: 100%;max-width: 100%;">
<!-- <div class=""> -->
<!-- Outer Row -->
<div class="row justify-content-center">
<div class="col-xl-12 col-lg-12 col-md-9">
<!-- <div class=""> -->
<div class="card o-hidden border-0">
<div class="card-body p-0 text-white" style="background-color: #00335a;">
<!-- Nested Row within Card Body -->
<div class="row">
<!-- <div class="col-lg-6 d-none d-lg-block bg-login-image p-0"></div> -->
<div class="col-lg-3"></div>
<div class="col-lg-6">
<div id = "ajax_success_msg" class="p-5"></div>
<div class="p-3 container-form">
<div class="text-center">
<h1 class="h4 text-white-900 mb-2" style="font-size: 20px;font-weight: bold;">แจ้งปัญหาการใช้งาน</h1><br>
<!-- <p class="mb-4"></p><br> -->
</div>
<form id="problem_form" class="user" method="post" enctype="multipart/form-data">
<div class="form-group row">
<div class="col-sm-12 mb-3 mb-sm-0">
<label for="">รายละเอียด<em style="color: #fcf500;">*</em></label>
<select class="form-control" name="sel_problem" id="sel_problem" >
<option class="" value="" selected>เลือกปัญหาในการใช้งาน</option>
<option class="" value="forget" >Login/Register ไม่ได้, ลืมรหัสผ่าน/Email</option>
<option class="" value="property_post" >ลงประกาศไม่ได้</option>
<option class="" value="other" >อื่นๆ </option>
</select>
</div>
</div>
<div class="form-group row row-other-detail" style="display:none;">
<div class="col-sm-12 mb-3 mb-sm-0">
<label for="">โปรดระบุ<em style="color: #fcf500;">*</em></label>
<textarea id="other_detail" name="other_detail" class="form-control" style="height: 100px;"
placeholder=""></textarea>
</div>
</div>
<div class="form-group text-center ele_action">
<input type="hidden" id="hid_utm_source" name="hid_utm_source" value="<?php echo $utm_source; ?>">
<input type="hidden" id="hid_utm_medium" name="hid_utm_medium" value="<?php echo $utm_medium; ?>">
<input type="hidden" id="hid_line_userID" name="hid_line_userID" value="">
<input type="hidden" id="hid_line_displayName" name="hid_line_displayName" value="<?php echo $utm_campaign; ?>">
<input type="hidden" id="hid_input_source" name="hid_input_source" value="">
<input type="hidden" id="submit_form" name="submit_form" value="send">
<div><input type="submit" class="form-control btn_submit_form" name="btn_submit_form" value="แจ้งปัญหา"
style="background-color: #fcf500;color: black;font-weight: bold;max-width: 300px;display:inline-block"></div>
</div>
<img id="pictureUrl" width="25%">
<!-- <p id="userId"></p>
<p id="displayName"></p>
<p id="statusMessage"></p>
<p id="getDecodedIDToken"></p> -->
</form>
<hr>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include('footer.php'); ?>
<?php if( $utm_source == 'line'){ ?>
<script src="<?php path_root ?>assets/js/line-liff-sdk-v2.js"></script>
<script>
function runApp() {
liff.getProfile().then(profile => {
// document.getElementById("pictureUrl").src = profile.pictureUrl;
document.getElementById("hid_line_userID").value = profile.userId;
document.getElementById("hid_line_displayName").value = profile.displayName;
// document.getElementById("statusMessage").innerHTML = '<b>StatusMessage:</b> ' + profile.statusMessage;
// document.getElementById("getDecodedIDToken").innerHTML = '<b>Email:</b> ' + liff.getDecodedIDToken().email;
}).catch(err => console.error(err));
}
liff.init({ liffId: "1653855030-zEB9KYwA" }, () => {
if (liff.isLoggedIn()) {
runApp()
} else {
liff.login();
}
}, err => console.error(err.code, error.message));
function send_msg(msg_reply_admin){
liff.sendMessages([{
'type': 'text',
'text': msg_reply_admin
}]).then(function() {
//window.alert('Message sent');
}).catch(function(error) {
//window.alert('Error sending message: ' + error);
});
}
</script>
<?php } ?>
<script type="text/javascript" src="<?php path_root ?>assets/js/fn_call_ajax.js"></script>
<script type="text/javascript" src="<?php path_root ?>assets/js/jquery.validate.js"></script>
<script type="text/javascript">
// $.validator.setDefaults( {
// submitHandler: function () {
// alert( "submitted!" );
// }
// } );
$( document ).ready( function () {
var link_source = window.location.href;
$('#hid_input_source').val(link_source);
$("#sel_problem").on("change", function(e) {
var val_sel_problem = $("#sel_problem").val();
$("#other_detail").val('');
if ( val_sel_problem == 'other' ){
$(".row-other-detail").show();
} else {
$(".row-other-detail").hide();
}
});
$(".btn_submit_form").on("click", function(e) {
// if ( !$('#chk_new').prop("checked") && !$('#chk_www').prop("checked") && !$('#chk_rent').prop("checked") ){
// alert("กรุณาเลือก [โครงการใหม่],[บ้านมือสอง],[บ้านเช่า] อย่างใดอย่าง 1");
// }
// if ( !$('#accept_policy').prop("checked") ){
// alert("กรุณาเลือก กดยอมรับเงื่อนไข");
// }
});
$( "#problem_form" ).validate( {
submitHandler: function (form) {
var form_id = 'problem_form';
var url = path_root + 'controller/problem_controller.php';
saveForm(form_id, url);
},
rules: {
sel_problem: "required"
},
messages: {
sel_problem: "กรุณาเลือกปัญหา ?"
},
errorElement: "em",
errorPlacement: function ( error, element ) {
// Add the `help-block` class to the error element
error.addClass( "help-block" );
if ( element.prop( "type" ) === "checkbox" ) {
error.insertAfter( element.parent( "label" ) );
} else {
error.insertAfter( element );
}
},
highlight: function ( element, errorClass, validClass ) {
$( element ).parents( ".form-group" ).addClass( "has-error" ).removeClass( "has-success" );
},
unhighlight: function (element, errorClass, validClass) {
$( element ).parents( ".form-group" ).addClass( "has-success" ).removeClass( "has-error" );
}
} );
} );
</script>
</body>
</html>