]]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']; $p_id = $_GET['product_id']; /*-------------- User Info ------------------*/ $condition="`id`=".$_GET['post_id']; $user_query=$sel_obj->display_rcd('tblusers',$condition); if(is_array($user_query) || !empty($user_query)) { foreach($user_query as $user_data) { } } /*---------- Product Info -------------*/ $where_product = "p_id=" . $p_id; $product_query = $sel_obj->display_rcd("product", $where_product); foreach($product_query as $product_data) { } /*-----------------------------------*/ ?> <?php /*-------------- Add Reply Message ------------*/ if(isset($_POST['send_mail'])) { // print_r($_POST); die(); $insertdata = array( 'user_id' => $_GET['post_id'], 'product_id' => $p_id, 'product_ids' => json_encode($_POST['product_ids']), 'templete_id' => $_POST['templete_id'], 'name' => $user_data['FullName']." ".$user_data['last_name'], 'email' => $user_data['UserEmail'], 'subject' => $_POST['subject'], 'top_content' => $_POST['top_content'], 'middle_content' => $_POST['middle_content'], 'bottom_content' => $_POST['bottom_content'], 'footer' => $_POST['footer'], 'created_at' => date("Y-m-d H:i:s") ); // print_r($insertdata); die(); $insert_query=$sel_obj->insert("reply_user_product_log",$insertdata); /*------------------- Send email ----------*/ $where_temp = "id=" . $_POST['templete_id']; $temp_query = $sel_obj->display_rcd("mail_templete", $where_temp); foreach($temp_query as $templete) { } $mail_logo = $templete['logo']; $header_background = $templete['header_background']; $footer_background = $templete['footer_background']; $mail_subject = $_POST['subject']; $mail_top_content = $_POST['top_content']; $mail_middle_content = $_POST['middle_content']; $mail_bottom_content = $_POST['bottom_content']; $mail_footer = $templete['footer']; /*------------------------*/ ob_start(); include_once("mail_templete.php"); $welcomeTemplate = ob_get_clean(); // ob_get_clean(); require '../php_mail/class.phpmailer.php'; $mail = new PHPMailer; $mail->Host = "smtp.hostinger.com"; $mail->Port = '587'; $mail->SMTPAuth = true; $mail->Username = 'sales@a4paper.in'; $mail->Password = 'Stereo@1879'; $mail->SMTPSecure = 'tls'; $mail->From = "sales@a4paper.in"; $mail->FromName = "a4paper"; $mail->Mailer = "smtp"; // don't change the quotes! // $mail->AddAddress('rohan@vdcpaper.com'); $mail->AddAddress($user_data['UserEmail']); //Adds a "To" address // $mail->AddAddress('udit8prajapati@gmail.com'); //Adds a "To" address $mail->IsHTML(true); $mail->Subject = $_POST['subject']; $mail->Body = $welcomeTemplate; $mail->Send(); /*-----------------------------------------*/ if($insert_query=='TRUE') { echo "<script> swal({ title: 'Message Sent Successfully', text: 'Redirecting...', icon: 'success', timer: 2000, buttons: false, }) </script>"; } } /*-------------- Delete Replied Msg -----------*/ if(isset($_GET['del_id']) and !empty($_GET['del_id'])) { $where = array( 'id' => $_GET["del_id"]); if($sel_obj->delete("reply_user_product_log", $where)) { echo "<script> swal({ title: 'Deleted Successfully', text: 'Redirecting...', icon: 'success', timer: 2000, buttons: false, }) </script>"; } // echo '<script>window.location.href = "contact_details.php?post_id='.$post_id.'";</script>'; } /*----------------------------------------*/ ?> <!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></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> <div class="content-wrapper pb-5"> <div class="content-header"> <div class="container-fluid"> <div class="row mb-2"> <div class="col-sm-6"> <h4 class="m-0 text-dark">Interested Product List of <b><?php echo $user_data['FullName']." ".$user_data['last_name']; ?></b></h4> </div> <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <li class="breadcrumb-item"><a class="btn btn-info" href="user_interest.php?user_id=<?php echo $post_id ?>">Back</a></li> </ol> </div> </div> </div> </div> <section class="content"> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="card card-primary card-tabs"> <div class="card-header p-2 mb-2"> Details </div> <!-- /.card-header --> <div class="card-body"> <table class="table table-bordered table-striped"> <tr> <th>User's Name</th> <td><?php echo $user_data['FullName']." ".$user_data['last_name'];?></td> </tr> <tr> <th>User's Email</th> <td><?php echo $user_data['UserEmail'];?></td> </tr> <tr> <th>Interested Product Name</th> <td><?php echo $product_data['p_name'];?></td> </tr> </table> </div> <!-- /.card-body --> </div> </div> </div> <!-- /.row (main row) --> <button class="btn btn-danger mb-4" id="reply_btn" title="Click to open mail box">Send Promotional Email <i class="fa fa-arrow-circle-right"></i></button> </div> <!-- /.container-fluid --> </section> <!-- ------------------- Mail Templete ------------------ --> <section class="content card m-2" id="mail_temp_id" style="display: none;"> <?php $query_mail=$db->select('mail_templete'); if(is_array($query_mail) || !empty($query_mail)) { $temp_no = 1; foreach($query_mail as $templete) { $mail_logo = $templete['logo']; $header_background = $templete['header_background']; $footer_background = $templete['footer_background']; $mail_subject = $templete['subject']; $mail_top_content = $templete['top_content']; $mail_middle_content = $templete['middle_content']; $mail_bottom_content = $templete['bottom_content']; $mail_footer = $templete['footer']; ?> <div class="mt-2"> <button class="btn btn-primary mb-4" title="Click to open mail box" data-toggle="collapse" data-target="#temp_id<?php echo $temp_no;?>">Select Email Template - <?php echo $temp_no;?> <i class="fa fa-arrow-circle-right"></i></button> </div> <div class="container-fluid pb-5 collapse card" id="temp_id<?php echo $temp_no;?>"> <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"> Mail Templete - <?php echo $temp_no;?> </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"> <input type="hidden" name="templete_id" value="<?php echo $templete['id']; ?>"> </div> <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" required><?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"> <div class="col-12"> <label for="subject" class="col-form-label">Select Products</label> <div id="output" class="output"></div> <select data-placeholder="Choose tags ..." name="product_ids[]" id="product_id<?php echo $temp_no;?>" class="chosen-select form-control my_choosen" multiple> <option value="0">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 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> </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> </div> <script> document.getElementById('output').innerHTML = ''; $(".chosen-select").chosen(); /*---- Product Info ------*/ // $("#product_id<?php echo $temp_no;?>").change(function(){ // var p_id = $('#product_id<?php echo $temp_no;?>').chosen.val(); // alert(p_id); // }); $(document).on("change", "#product_id<?php echo $temp_no;?>", function(){ var p_id = $(this).val(); // alert(p_id); // exit(); $.ajax({ url: "ajax.php", type: "POST", // or GET whatever but POST is usually better data: { p_id: p_id }, success: function(response) { // alert(response); document.getElementById("output_email_message_middle<?php echo $temp_no;?>").innerHTML = response; document.getElementById("middleTextarea<?php echo $temp_no;?>").innerHTML = response; // var slug_text = convertToSlug(response); // $("#middleTextarea<?php echo $temp_no;?>").val(slug_text); // $("#product_id<?php echo $temp_no;?>").keyup(function(){ // var text = $(this).val(); // var slug_text = convertToSlug(response); // $("#middleTextarea<?php echo $temp_no;?>").val(slug_text); // }); } }); }); </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); }); }); /*------- Middle -------*/ // var id_middle = 'middleTextarea<?php echo $temp_no;?>'; // CKEDITOR.replace(id_middle); // CKEDITOR.instances[id_middle].on('contentDom', function() { // this.document.on('keyup', function(event){ // var data = CKEDITOR.instances[id_middle].getData(); // //data=data.replace(/<[^>]*>?/gm, ''); // $("#output_email_message_middle<?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> <?php $temp_no++; } } ?> </section> <!-- -------------------------------------------- --> <!-- -------- Replied List ---------------- --> <section class="content"> <div class="container-fluid"> <div class="card card-primary card-tabs p-2"> <div class="card-header p-2 mb-2"> List of Sent Email </div> <table id="example1" class="table table-bordered table-striped"> <thead> <tr> <th>S.N.</th> <th>Subject</th> <th>Message</th> <th>Date</th> <th>Action</th> </tr> </thead> <tbody> <?php $con_repl="`user_id`="."'$post_id' AND `product_id`="."'$p_id'"; $query_repl=$sel_obj->display_rcd('reply_user_product_log',$con_repl); $repl_count=0; if(is_array($query_repl) || !empty($query_repl)) { foreach ($query_repl as $data_repl ) { ?> <tr> <td><?php echo $repl_count+1;?></td> <td><?php echo $data_repl['subject']; ?></td> <td> <button type="button" class="btn btn-info btn-xs" data-toggle="modal" data-target="#exampleModalLong<?php echo $repl_count;?>"> View Message </button> <!-- Modal --> <div class="modal fade" id="exampleModalLong<?php echo $repl_count;?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLongTitle">Message</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <?php $templete_id = $data_repl['templete_id']; $con_temp="`id`="."'$templete_id'"; $query_temp=$sel_obj->display_rcd('mail_templete',$con_temp); if(is_array($query_temp) || !empty($query_temp)) { foreach ($query_temp as $get_template) { } } // print_r($get_template); die(); $mail_logo = $get_template['logo']; $header_background = $get_template['header_background']; $footer_background = $get_template['footer_background']; $mail_subject = $data_repl['subject']; $mail_top_content = $data_repl['top_content']; $mail_middle_content = $data_repl['middle_content']; $mail_bottom_content = $data_repl['bottom_content']; $mail_footer = $get_template['footer']; ?> <?php include("mail_templete.php");?> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> </div> </div> </div> </div> </td> <td><?php echo $data_repl['created_at']; ?></td> <td> <a href="user_interest_details.php?post_id=<?php echo $post_id; ?>&&product_id=<?php echo $product_data['p_id']; ?>&del_id=<?php echo $data_repl['id']; ?>" class="btn btn-danger btn-xs" onclick="return confirm('Are you sure to delete?')"><i class="fa fa-trash"></i></a> </td> </tr> <?php $repl_count++; } } ?> </tbody> </table> </div> </div> </section> <!-- -------------------------------------------- --> <!-- /.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>