File manager - Edit - /home/autoph/public_html/connectv1/new_sms_service.php
Back
<?php include('cfg/db.php'); // include('api/controllers/utility.php'); if(!isset($_SESSION['user']['id'])){ header('location:signin.php'); } // $utility_class = new Utility(); $granted_company_ids = $utility_class->isNotEmpty($_SESSION['user']['company_permissions_implode']) ? $_SESSION['user']['company_permissions_implode'] : '-1' ; $title = ""; if(!(isset($global_action_permissions['6']['29']) && in_array("1", $global_action_permissions['6']['29']))){ header('location:signin.php'); } $session_id = $_SESSION['user']['id']; $session_company_id = $_SESSION['user']['company']; $session_dealer_id = $_SESSION['user']['dealer']; $session_brand_id = ""; $session_dms_id = ""; $gets_brand = "SELECT brand_id FROM source_dealer WHERE id = '$session_dealer_id'"; $get_brand = $db->sql_query($gets_brand); foreach($get_brand AS $bdata){ $session_brand_id = $bdata['brand_id']; $_SESSION['user']['brand_id'] = $bdata['brand_id']; } $gets_dms = "SELECT dms_id FROM source_company WHERE id = '$session_company_id'"; $get_dms = $db->sql_query($gets_dms); foreach($get_dms AS $ddata){ $session_dms_id = $ddata['dms_id']; $_SESSION['user']['dms_id'] = $ddata['dms_id']; } $count_query = "SELECT COUNT(1) FROM `sms_service_approver` WHERE `employee_id` = '$session_id'"; $count = $db -> select($count_query); $request_type = 1; $is_in_edit = 0; //0-not edit 1-edit mode $request_id = ""; $control_number = ""; $message_content = ""; $description = ""; $company_id = ""; $dealer_id = ""; $dealer_name = ""; $state_id = ""; $city_id = ""; $city_name = ""; $request_date = ""; $request_time = ""; $customer_type = ""; $date_of_birth = ""; $age_from = ""; $age_to = ""; $gender_id = ""; $customer_data_type = ""; $dms_id = ""; $activity_date_from = ""; $activity_date_to = ""; $insurance_company_id = ""; $insurance_type_id = ""; $finance_company_id = ""; $source_of_inquiry_id = ""; $brand_id = ""; $model_id = ""; $model_name = ""; $variant_id = ""; $variant_name = ""; $sort_by = ""; $order_by = ""; $customer_category = ""; $customer_status = ""; $is_downloadable = ""; $level = ""; // for editing request if(isset($_GET['q'])){ $is_in_edit = 1; $request_id = $db->escape($_GET['q']); $title = "Edit Request"; $edit_query = "SELECT tb.`control_number`, tb.`message_content`, tb.`request_type_id`, tb.`description`, tb.`company_id`, tb.`dealer_id`, sd.`name` AS dealer_name, tb.`state_id`, tb.`city_id`, a_city.`citymunDesc` AS city_name, tb.`request_date`, tb.`request_time`, tb.`customer_type`, tb.`date_of_birth`, tb.`age_from`, tb.`age_to`, tb.`gender_id`, tb.`customer_data_type`, tb.`dms_id`, tb.`activity_date_from`, tb.`activity_date_to`, tb.`insurance_company_id`, tb.`insurance_type_id`, tb.`finance_company_id`, tb.`source_of_inquiry_id`, tb.`brand_id`, tb.`model_id`, scm.`name` AS model_name, tb.`variant_id`, scmv.`name` AS variant_name, tb.`sort_by`, tb.`order_by`, tb.`customer_category`, tb.`customer_status`, tb.`is_downloadable` FROM `text_blast` tb INNER JOIN source_dealer sd ON sd.id = tb.dealer_id INNER JOIN source_car_model scm ON scm.id = tb.model_id INNER JOIN source_car_model_variant scmv ON scmv.id = tb.variant_id INNER JOIN all_city a_city ON a_city.id = tb.city_id WHERE tb.`id` = '$request_id'"; // echo $edit_query; exit; $fetch_query = $db->sql_query($edit_query); foreach($fetch_query AS $data){ $control_number = $data['control_number']; $message_content = $data['message_content']; $description = $data['description']; $request_type = $data['request_type_id']; $company_id = $data['company_id']; $dealer_id = $data['dealer_id']; $dealer_name = $data['dealer_name']; $state_id = $data['state_id']; $city_id = $data['city_id']; $city_name = $data['city_name']; $request_date = $data['request_date']; $request_time = $data['request_time']; $customer_type = $data['customer_type']; $date_of_birth = $data['date_of_birth']; $age_from = $data['age_from']; $age_to = $data['age_to']; $gender_id = $data['gender_id']; $customer_data_type = $data['customer_data_type']; $dms_id = $data['dms_id']; $activity_date_from = $data['activity_date_from']; $activity_date_to = $data['activity_date_to']; $insurance_company_id = $data['insurance_company_id']; $insurance_type_id = $data['insurance_type_id']; $finance_company_id = $data['finance_company_id']; $source_of_inquiry_id = $data['source_of_inquiry_id']; $brand_id = $data['brand_id']; $model_id = $data['model_id']; $model_name = $data['model_name']; $variant_id = $data['variant_id']; $variant_name = $data['variant_name']; $sort_by = $data['sort_by']; $order_by = $data['order_by']; $customer_category = $data['customer_category']; $customer_status = $data['customer_status']; $is_downloadable = $data['is_downloadable']; } } // if GET isset // CREATE if(isset($_GET['create'])){ $title = "New Request"; } ?> <!DOCTYPE html> <html lang="en"> <head> <!-- Select2 --> <link rel="stylesheet" href="plugins/select2/css/select2.min.css"> <link rel="stylesheet" href="plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css"> <?php include('include/components/sms_service/request_head.php'); ?> <style> fieldset { padding-top: 0.35em; padding-bottom: 0.625em; padding-left: 0.50em; padding-right: 0.50em; border: 1px solid gray; border-radius: 3%; } legend { font-size: 100%; font-weight: bold; color: blue; } </style> </head> <body class="hold-transition sidebar-mini text-sm layout-fixed"> <div class="wrapper"> <!-- INCLUDE HEADER --> <?php include('include/header.php'); ?> <?php include('include/sidebar.php'); ?> <!-- /.navbar --> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <div class="content-header"> <div class="container-fluid"> <div class="row mb-0"> <div class="col-sm-6"> <!-- <h1 class="m-0">Generate Report</h1> --> </div><!-- /.col --> <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <li class="breadcrumb-item"><a href="home.php">Home</a></li> <li class="breadcrumb-item active">SMS Service</li> </ol> </div><!-- /.col --> </div><!-- /.row --> </div><!-- /.container-fluid --> </div> <!-- /.content-header --> <!-- Main content --> <section class="content"> <div class="container-fluid"> <div class="row"> <!-- left column --> <div class="col-md"> <div class="card card-primary"> <div class="card-header"> <h3 class="card-title"><button class="btn btn-tool" title="Go to Customer employee list" type="button" onclick="back()"><i class="fas fa-arrow-alt-circle-left fa-2x"></i></button> <span id="title-page">Requested Information</span></h3> </div> <div class="card-body"> <form id="form-data"> <?php include('include/components/sms_service/sms_txt_blast.php'); ?> <div class="row mt-3"> <div class="col-12"> <input type="submit" name="submit" id="submit" value="Submit Request" class="btn btn-success float-right"> </div> </div> </form> <div class="row mt-3"> <div class="col-12"> <button name="edit" id="edit" class="btn btn-success float-right" hidden>Re-submit Request</button> </div> </div> </div> </div> </div> </div> </div> </section> </div> <!-- INSERT FOOTER --> <?php include('include/footer.php'); ?> <!-- Control Sidebar --> <aside class="control-sidebar control-sidebar-dark"> <!-- Control sidebar content goes here --> </aside> <!-- /.control-sidebar --> </div> <!-- ./wrapper --> <!-- Select2 --> <script src="plugins/select2/js/select2.full.min.js"></script> <?php include('include/components/sms_service/script.php'); ?> <script> var page_count = 0; var char_count = 0; var new_line = 0; var total = 0; </script> <script> var is_edit = '<?php echo $is_in_edit; ?>'; var request_id = '<?php echo $request_id; ?>'; var title = '<?php echo $title; ?>'; $(document).ready(function() { // clearFields(); var order_by = '<?php echo $order_by; ?>'; $('#title-page').text(title); if(is_edit == 1) { $('#submit').attr('hidden', true); $('#edit').attr('hidden', false); // $('#level-div').attr('hidden', true); $('#level').attr('disabled', true); $('#sort-by').val("<?php echo $sort_by; ?>"); $('#title-page').text("Edit Request"); if (order_by == 'ASC') { $("#rdo-asc").prop("checked", true); } else if (order_by == 'DESC') { $("#rdo-desc").prop("checked", true); } $('#level').val('<?php echo $request_type;?>'); var val = $('#level').val(); loadApproverList(val); $('#reg-from').val("<?php echo $activity_date_from; ?>"); $('#reg-to').val("<?php echo $activity_date_to; ?>"); $('#company').val("<?php echo $company_id; ?>").trigger('change'); // $('#dealer').html('<option value="<?php echo $dealer_id;?>" selected>' + '<?php echo $dealer_name;?>' + '</option>'); // $set_dealer = ""; if($dealer_name == "-"){$set_dealer = "All";} else {$set_dealer = $dealer_name;} var set_dealer_name = '<?php echo $dealer_name;?>'; if(set_dealer_name == "-"){set_dealer_name = "All";} var newOption = new Option(set_dealer_name, '<?php echo $dealer_id;?>', true, true); $("#dealer").append(newOption).trigger('change'); $('#type').val("<?php echo $customer_type; ?>"); $('#category').val("<?php echo $customer_category; ?>"); $('#active-status').val("<?php echo $customer_status; ?>"); $('#filter-data').val("<?php echo $customer_data_type; ?>"); $('#gender').val("<?php echo $gender_id; ?>"); $('#date-of-birth').val("<?php echo $date_of_birth; ?>"); $('#age-from').val("<?php echo $age_from; ?>"); $('#age-to').val("<?php echo $age_to; ?>"); $('#brand').val("<?php echo $brand_id; ?>").trigger('change'); var model_name = '<?php echo $model_name;?>'; if(model_name == ""){model_name = "All";} setTimeout(function() { var newOption = new Option(model_name, '<?php echo $model_id;?>', true, true); $("#model").append(newOption).trigger('change'); }, 1000); var variant_name = '<?php echo $variant_name;?>'; if(variant_name == ""){variant_name = "All";} setTimeout(function() { var newOption = new Option(variant_name, '<?php echo $variant_id;?>', true, true); $("#variant").append(newOption).trigger('change'); }, 1000); $('#insurance-company').val("<?php echo $insurance_company_id; ?>").trigger('change'); $('#insurance-type').val("<?php echo $insurance_type_id; ?>").trigger('change'); $('#finance-company').val("<?php echo $finance_company_id; ?>").trigger('change'); $('#state').val("<?php echo $state_id; ?>").trigger('change'); var city_name = '<?php echo $city_name;?>'; if(city_name == ""){city_name = "All";} setTimeout(function() { var newOption = new Option(city_name, '<?php echo $city_id;?>', true, true); $("#city").append(newOption).trigger('change'); }, 1000); $('#description').val("<?php echo $description; ?>"); $('#message-content').val("<?php echo $db->escape($message_content); ?>"); $('#filter-data').val("<?php echo $customer_data_type; ?>"); characterCount(); } else { $('#submit').attr('hidden', false); $('#edit').attr('hidden', true); $('#level-div').attr('hidden', false); } }) </script> <script> function clearFields() { $('#sort-by').val(1); $("#rdo-asc").prop("checked", true); $('#reg-from').val(""); $('#reg-to-date').val(""); } </script> <script> function loadApproverList(val){ var level_val = val; $.ajax({ url:"app/sms_service/load_approvers.php", type:"POST", data: { level_value: level_val }, beforeSend:function(){ }, success: function(result){ $('#approver-list').html(''); $('#approver-list').append("\"" + result + "\""); } }); } </script> <script> function characterCount() { page_count = 0; char_count = 0; var str = $('#message-content').val(); char_count = str.length; page_count = parseInt(char_count / 160) + 1; var line = str.split("\r"); new_line = (str.match(/\n/g) || '').length; total = parseInt(char_count) + parseInt(new_line); // $('#character-count').text(char_count); $('#character-count').text(total); $('#page-count').text(page_count); if (total < 600) { $('#max-character-warning').attr('hidden', true); $('#exceed-character-warning').attr('hidden', true); } else if (total == 600) { $('#max-character-warning').attr('hidden', false); $('#exceed-character-warning').attr('hidden', true); } else if (total > 600) { $('#exceed-character-warning').attr('hidden', false); $('#max-character-warning').attr('hidden', true); // str = str.substring(0, 640); // // alert(str); // $('#message-content').val(str); } } </script> </body> </html>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings