<?php 



  include('libraryPHP/site_config.php');

 include('libraryPHP/session_check_url.php');





?>
<!DOCTYPE html>

<html lang="en">



<head>

    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">

    <title><?php echo $appName?>| <?php echo $pageTitle?></title>

        

         <!-- App favicon -->



    <?php echo $appFaviconHtml?> 


    <!-- theme css start -->

    <?php include("theme_css.php"); ?>

    <!-- theme css end -->



</head>



<body>



    <!-- Main Wrapper -->

    <div class="main-wrapper">



        <!-- Header start  -->

        <?php include("header.php"); ?>

        <!-- /Header end -->



        <!-- Sidebar -->

        <?php include("sidebar.php"); ?>

        <!-- /Sidebar -->



        <!-- Page Wrapper -->

        <div class="page-wrapper">



            <div class="content container-fluid">



                <!-- Page Header -->

                <div class="page-header">

                    <div class="row">

                        <div class="col">

                            <h3 class="page-title">Send Reply</h3>

                            <ul class="breadcrumb">

                                <li class="breadcrumb-item"><a href="dashboard.php">Dashboard</a></li>

                                <li class="breadcrumb-item"><a href="manage_contact_us.php">Manage Contact Us</a></li>

                                <li class="breadcrumb-item active">Send Reply</li>

                            </ul>

                        </div>

                    </div>

                </div>

                <!-- /Page Header -->



                <!-- start write start -->

                <div class="row">

                    <div class="col-md-12">

                        <div class="card">

                            <div class="card-body">



                               <form  method="POST" id="sendreply_form" class="form-horizontal" enctype="multipart/form-data">

                      

                    <input type="hidden" id="action" name="action" value="send_reply">

                    <input type="hidden" id="contact_id" name="contact_id" value="<?php echo $_GET['id'];?>">

                    <input type="hidden" id="email" name="email" value="<?php echo $getEditData['email']?>">

                    <input type="hidden" id="name" name="name" value="<?php echo $getEditData['name']; ?>"> 




                                    <div class="form-group">

                                        <label for="subject">Subject</label>

                                        <input type="text" class="form-control" id="title" name="subject" placeholder="Enter Subject">

                                    </div>

                                    <div class="form-group">

                                        <label for="massage">Message</label>

                                        <textarea class="form-control" id="message" name="message" placeholder="Enter Message" rows="3"></textarea>

                                    </div>

                                    <input type="submit" name="Send" value="Send" class="btn btn-primary">

                                </form>



                            </div>

                        </div>

                    </div>

                </div>





                <!-- start write end -->

            </div>

        </div>

        <!-- /Page Wrapper -->

        <!-- footer start -->

        <?php include("footer.php"); ?>

        <!-- footer end -->



    </div>

    <!-- /Main Wrapper -->



    <!-- sctipt start  -->
<?php include('commonjs.php')?>

        <?php include('extrajs.php') ?>

  <script>
        $(document).ready(function(){
        $('#sendreply_form').validate({
           rules:{
               subject:{
                required:true,
                 // minlength:3,
                   maxlength: 50, 
              },
              'message':{
                required:true,
                 // minlength:3,
                   maxlength: 250,
              }, 
           },
           messages:{
                   subject:{

                    required:msgValidation.emptySubject[language],
                        // minlength: "Subject  must be at least 3 characters",
                            maxlength: " Maximum 50  characters  allowed in subject", 
                   
                   },            

                   'message':{

                    required:msgValidation.emptyMessage[language],
                     // minlength: "Message  must be at least 3 characters",
                            maxlength: " Maximum 250  characters  allowed in message", 

              },                
           },
           submitHandler:function(form){
             // e.preventDefault();
            var link=URLAPI+'common_controller.php';

            var data = new FormData($(form)[0]);
           // alert(data);
            var message = msgLoading.blankMessage[language];    

            apiRequest.postFile(link,data,message).then(function(obj){
            if(obj.success === true){
              
              var title = msgTitleOperation.blankMessage[language];
              var message = obj.msg[language];
              swal_alert(title,message,"manage_contact_us.php","success");
              
              return false;

            }else{

              var title = msgTitleOperation.blankMessage[language];
              var message = obj.msg[language];
              swal_alert(title,message,'#','error');
               return false;
            }
          },function(err){

            consoleProvider.log('err',err);
            var title    = msgTitleOperation.errorOnServer[language];
            var messsage = msgOperations.errorOnServer[language];
            swal_alert(title,message,"#","warning");
            return false;

          });

        }//end of submit handler

      });//end of editprofile  

});
</script>



</body>



</html>