]]jkjjgdjffksdkdxdsghfghdfghfgdfsdsdfsdfsfdsbcxvxcbccwewqeqwewqskfgj
במ12[cxvbcxvbxcvbcxvcxvbcvxcvbsdfsdfsdfsdfsdfsdfxcvbxcvxbbxqwqewqewv;'
/
home
/
u506006416
/
domains
/
crystalmiracle.co.in
/
public_html
/
admin
/
Upload FileeE
HOME
<?php include("header.php"); $sel_obj= new config(); ?> <?php include("sidebar.php");?> <?php $post_id = $_GET['post_id']; if(isset($_POST['update'])) { /*---------- Get Template ----*/ $temp_tem="`id`=".$_POST['templete_id']; $query_tem=$sel_obj->display_rcd('mail_templete',$temp_tem); if(is_array($query_tem) || !empty($query_tem)) { foreach($query_tem as $data_temp) { } } /*---------------------------------*/ $updatedata = array( 'user_ids' => json_encode($_POST['user_ids']), 'product_ids' => json_encode($_POST['product_ids']), 'recipient' => $_POST['recipient'], 'top_content' => $_POST['top_content'], 'middle_content' => $_POST['middle_content'], 'bottom_content' => $_POST['bottom_content'], 'templete_id' => $_POST['templete_id'], 'subject' => $_POST['subject'], 'logo' => $data_temp['logo'], 'header_background' => $data_temp['header_background'], 'footer_background' => $data_temp['footer_background'], 'footer' => $data_temp['footer'] ); // print_r($updatedata); die(); $where_condition=array('id'=> $post_id); $update_query=$sel_obj->update("auto_email_control",$updatedata,$where_condition); if($update_query=='TRUE') { echo "<script> swal({ title: 'Updated Successfully', text: 'Redirecting...', icon: 'success', timer: 2000, buttons: false, }) </script>"; } } /*----------------------------------------*/ ?> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.min.css" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <script src="https://cdn.ckeditor.com/4.19.1/standard/ckeditor.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.jquery.js" ></script> <style> .note-editable{width: 100%; min-height:100px!important;} .chosen-container {width: 100%!important} </style> <?php /*------------- Get Auto Email Template Data ---------*/ $temp_con="`id`=".$_GET['post_id']; $query_auto=$sel_obj->display_rcd('auto_email_control',$temp_con); if(is_array($query_auto) || !empty($query_auto)) { $temp_no = 1; foreach($query_auto as $auto_email_data) { } } /*------------- Get Template ---------*/ $mail_logo = $auto_email_data['logo']; $header_background = $auto_email_data['header_background']; $footer_background = $auto_email_data['footer_background']; $mail_subject = $auto_email_data['subject']; $mail_top_content = $auto_email_data['top_content']; $mail_middle_content = $auto_email_data['middle_content']; $mail_bottom_content = $auto_email_data['bottom_content']; $mail_footer = $auto_email_data['footer']; $recipient = $auto_email_data['recipient']; $user_ids = $auto_email_data['user_ids']; $product_ids = $auto_email_data['product_ids']; ?> <!-- ------------------- Mail auto_email_data ------------------ --> <div class="content-wrapper pb-5"> <div class="content-header"> <div class="container-fluid"> <div class="row mb-2"> <div class="col-sm-6"> <h2 class="m-0 text-dark">Auto Email Setup for <b><?php echo $auto_email_data['email_type']; ?></b></h2> </div> <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <!-- <li class="breadcrumb-item"><a class="btn btn-info" href="contact.php">Back</a></li> --> </ol> </div> </div> </div> </div> <section class="content card m-2"> <form class="form-horizontal" action="" method="post" enctype="multipart/form-data"> <div class="container-fluid"> <div class="row"> <div class="col-md-6"> <div class="card card-primary card-tabs"> <div class="card-header p-2 pt-1"> Setup </div> <div class="tab-content" id="custom-tabs-five-tabContent"> <div class="tab-pane fade active show" id="general"> <div class="card-body"> <div class="form-group row"> <label>Select Template</label> <select class="form-control" name="templete_id"> <?php $query_teml=$db->select('mail_templete');?> <?php $tn = 1 ; foreach($query_teml as $data_templ){ ?> <option value="<?php echo $data_templ['id'];?>" <?php if($auto_email_data['templete_id']==$data_templ['id']){echo " selected";} ?>>Template - <?php echo $tn; ?></option> <?php $tn++; } ?> </select> </div> <!-- ---------------- To Email ------------ --> <div class="form-group row"> <div class="col-12"> <label>Recipients</label> <div class="pl-4"> <label> <input type="radio" id="rec_1" name="recipient" value="all_users" <?php if($recipient=='all_users'){echo " checked";} ?>>All Users </label> <br> <label> <input type="radio" id="rec_2" name="recipient" value="selected_users" <?php if($recipient=='selected_users'){echo " checked";} ?>>Selected Users </label> </div> </div> <div class="col-12" id="recipient_div"> <label for="subject" class="col-form-label">Select Users to send email</label> <div id="output_email" class="output_email"></div> <select data-placeholder="Choose user ..." name="user_ids[]" class="chosen-select form-control my_choosen" multiple> <option value="0">Select User </option> <?php $query=$sel_obj->select('tblusers'); if(is_array($query) || !empty($query)) { foreach($query as $data): ?> <option value="<?php echo $data['id']; ?>" <?php if(in_array($data['id'], json_decode($user_ids))){echo " selected";} ?>><?php echo $data['UserEmail']; ?></option> <?php endforeach; ?> <?php } ?> </select> </div> </div> <script> $(document).ready(function() { if ($("#rec_2").is(':checked')) { $("#recipient_div").show(); } else { $("#recipient_div").hide(); } $("#rec_2").click(function() { $("#recipient_div").show(); }); $("#rec_1").click(function() { $("#recipient_div").hide(); }); }); </script> <!-- -------------------------------------- --> <div class="form-group row"> <div class="col-12"> <label for="subject" class="col-form-label">Subject</label> <textarea id="subject" name="subject" class="form-control"><?php echo $mail_subject; ?></textarea> </div> </div> <div class="form-group row"> <div class="col-12"> <label for="topTextarea<?php echo $temp_no;?>" class="col-form-label">Top Content</label> <textarea id="topTextarea<?php echo $temp_no;?>" name="top_content"><?php echo $mail_top_content; ?></textarea> </div> </div> <div class="form-group row" style="display: <?php if($post_id==3){echo "block";}else{echo "none";} ?>;"> <div class="col-12"> <label for="subject" class="col-form-label">Select Products</label> <div id="output" class="output"></div> <select data-placeholder="Choose Product ..." name="product_ids[]" id="product_id<?php echo $temp_no;?>" class="chosen-select form-control my_choosen" multiple> <option value="">Select Products </option> <?php $query=$sel_obj->select('product'); if(is_array($query) || !empty($query)) { foreach($query as $data): ?> <option value="<?php echo $data['p_id']; ?>" <?php if(in_array($data['p_id'], json_decode($product_ids))){echo " selected";} ?>><?php echo $data['p_name']; ?></option> <?php endforeach; ?> <?php } ?> </select> </div> </div> <div class="form-group row" style="display: none;"> <div class="col-12"> <label for="middleTextarea<?php echo $temp_no;?>" class="col-form-label">Middle Content</label> <textarea id="middleTextarea<?php echo $temp_no;?>" name="middle_content"><?php echo $mail_middle_content; ?></textarea> </div> </div> <div class="form-group row"> <div class="col-12"> <label for="bottomTextarea<?php echo $temp_no;?>" class="col-form-label">Bottom Content</label> <textarea id="bottomTextarea<?php echo $temp_no;?>" name="bottom_content"><?php echo $mail_bottom_content; ?></textarea> </div> </div> <div class="form-group row"> <div class="col-12 text-right"> <button type="submit" name="update" class="btn btn-primary">Update</button> </div> </div> </div> </div> </div> </div> </div> <div class="col-md-6"> <?php include("mail_templete.php");?> <div class="card-footer"> <!-- <button type="submit" name="send_mail" class="btn btn-primary">Send Mail</button> --> </div> </div> </div> <!-- /.row (main row) --> </div> <!-- /.container-fluid --> </form> <script> document.getElementById('output').innerHTML = ''; $(".chosen-select").chosen(); /*---- Product Info ------*/ $(document).on("change", "#product_id<?php echo $temp_no;?>", function(){ var p_id = $(this).val(); $.ajax({ url: "ajax.php", type: "POST", data: { p_id: p_id }, success: function(response) { document.getElementById("output_email_message_middle<?php echo $temp_no;?>").innerHTML = response; document.getElementById("middleTextarea<?php echo $temp_no;?>").innerHTML = response; } }); }); </script> <script> $(document).ready(function(){ /*---- Top -------*/ var id_top = 'topTextarea<?php echo $temp_no;?>'; CKEDITOR.replace(id_top); CKEDITOR.instances[id_top].on('contentDom', function() { this.document.on('keyup', function(event){ var data = CKEDITOR.instances[id_top].getData(); //data=data.replace(/<[^>]*>?/gm, ''); $("#output_email_message_top<?php echo $temp_no;?>").html(data); }); }); /*-------- Bottom -------*/ var id_bottom = 'bottomTextarea<?php echo $temp_no;?>'; CKEDITOR.replace(id_bottom); CKEDITOR.instances[id_bottom].on('contentDom', function() { this.document.on('keyup', function(event){ var data = CKEDITOR.instances[id_bottom].getData(); //data=data.replace(/<[^>]*>?/gm, ''); $("#output_email_message_bottom<?php echo $temp_no;?>").html(data); }); }); /*--------------*/ }); </script> </section> <!-- -------------------------------------------- --> <!-- -------- Replied List ---------------- --> <!-- -------------------------------------------- --> <!-- /.content --> </div> <!-- /.content-wrapper --> <?php include("footer.php");?> <script> window.setTimeout(function() { $(".alert").fadeTo(1000, 0).slideUp(100, function(){ $(this).remove(); }); }, 1000); </script> <!-- <script> $(document).ready(function () { $("#reply_btn").click(function () { $("#mail_temp_id").toggle('slow'); }); }); </script> -->