<!doctype html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<?php 
helper('form');
$this->session = session();
$this->common_model = model('CommonModel');
$this->db = db_connect();
$this->form_validation = \Config\Services::validation();
echo view('user/common_style1');?>
</head>

<style type="text/css">
.form-logo img, svg {
vertical-align: middle;
min-height: 106px;
}
.small, small {
font-size: 11px;
color: red;
font-weight: 600;
</style>

<body>
<?php echo view('user/common_header');?>
<section class="bg-white form-page">

  <div class="container">
    <div class="row">
      <div class="col-lg-10 offset-lg-1">
        <div class="icon-square inner-box form-bg bg-white">
          <div class="row">
            <div class="col-lg-6">

              <div class="form-logo form-logo02 bg-primary text-center">

            <?php 
            $logo_img = site_info('site_logo');
            if($logo_img) {
            ?>
        <a  href="<?php echo base_url();?>"><img  src="content/site/<?php echo site_info('site_logo');?>" alt="<?php echo site_info('site_logo');?>"></a> 
            <?php } else { ?>
            <a href="<?php echo base_url();?>"><img src="<?php echo base_url();?>/styles/new_style/images/form-logo.png" class="img-fluid"></a> 
            <?php } ?> </a>

             </div>
             </div>

            <div class="col-lg-6">
            <div class="form-reg">
            <div class="row">
            <div class="form-container mb-10">       

<div class="form-title">
<h4 class="text-black mont"><?php echo lang('language_lang.contact_sendmsg'); ?></h4>
</div>
<div class="row">  
<div class="col-sm-12">
<div class="form-page">
<?php if($this->session->getFlashData('success_message')) {?>
<p class="frgtpwd frgtpwd1"><i class="fa fa-thumbs-up"></i><?php echo $this->session->getFlashData('success_message');?></p>
<?php } elseif ($this->session->getFlashData('error_message')) { ?>
<p class="frgtpwd frgtpwd1 frgtpwdred"><i class="fa fa-thumbs-down"></i><?php echo $this->session->getFlashData('error_message');?></p>
<?php } else { }?>
<div class="col-sm-12">
<form class="dark-form" action="<?=site_url($action); ?>" method="post">

<div class="col-lg-12 col-md-6">
<div class="form-block mb-3">
<input class="form-control" type="text" placeholder="<?php echo lang('language_lang.contact_Your_name'); ?>" name="username" value="<?php echo set_value('username');?>">
<?php echo $this->form_validation->getError('username');?>
</div>
</div>
<div class="col-lg-12 col-md-6">
<div class="form-block mb-3">
<input class="form-control" type="text" placeholder="<?php echo lang('language_lang.contact_email_address'); ?>" name="email_address" value="<?php echo set_value('email_address');?>">
<?php echo $this->form_validation->getError('email_address');?>
</div> 
</div>
<div class="col-lg-12 col-md-6">
<div class="form-block mb-3">
<input class="form-control" type="text" placeholder="<?php echo lang('language_lang.contact_subject'); ?>" name="subject" value="<?php echo set_value('subject');?>">
<?php echo $this->form_validation->getError('subject');?>
</div> 
</div>
<div class="col-lg-12 col-md-6">
<div class="form-block mb-3">  
<textarea class="form-control" placeholder="<?php echo lang('language_lang.contact_message'); ?>" name="messages"><?php echo set_value('messages');?></textarea>
<?php echo $this->form_validation->getError('messages');?>
</div>
</div>
<div class="col-lg-12 col-md-6">
<div class="form-block mb-3">
<div class="row">
<div class="col-md-7">
<div style="margin-bottom: 0;" class="form-group has-feedback has-feedback-left">
<?php
$sitekey = $this->db->query("select * from site_controls where site_key='captcha_key'");
$site_kval=$sitekey->getResult();
?>
<div class="center-div">
<div class="g-recaptcha" data-callback="recaptchaCallback" data-sitekey="<?php echo $site_kval[0]->site_value;?>"></div>
<div style='color:red'><?php echo $this->form_validation->getError('g-recaptcha-response');?></div>
</div>
<?php echo $this->form_validation->getError('math_captcha');?>
</div>

</div>
</div>
</div>
</div>

<div class="col-lg-12">
<div class="form-btn text-center ">
<button class="btn btn-primary" type="submit"><?php echo lang('language_lang.contact_submit'); ?></button>
</div>
</div>


</form>
</div>
<div class="col-sm-6">
<?php 
$languageid = ($this->session->get('user_langid')) ? $this->session->get('user_langid'): '1';
$content= $this->common_model->Getpageinfo('contact',$languageid);
if($content)
{
echo $content->page_content;
}
?>

</div>

            </div>
            </div>
            </div> <!-- row end -->

                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</section>
<?php echo view('user/common_script');?>
<?php echo view('user/footer1');?>
</body>

       <script src="http://maps.googleapis.com/maps/api/js"></script>
        <script>
            var myCenter=new google.maps.LatLng(51.4939928, -0.1486641);
            
            function initialize()
            {
                var mapProp = {
                    center:myCenter,
                    scrollwheel: false,
                    zoom:14,
                    styles: [{"featureType":"landscape","stylers":[{"saturation":-100},{"lightness":65},{"visibility":"on"}]},{"featureType":"poi","stylers":[{"saturation":-100},{"lightness":51},{"visibility":"simplified"}]},{"featureType":"road.highway","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"road.arterial","stylers":[{"saturation":-100},{"lightness":30},{"visibility":"on"}]},{"featureType":"road.local","stylers":[{"saturation":-100},{"lightness":40},{"visibility":"on"}]},{"featureType":"transit","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"administrative.province","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels","stylers":[{"visibility":"on"},{"lightness":-25},{"saturation":-100}]},{"featureType":"water","elementType":"geometry","stylers":[{"hue":"#ffff00"},{"lightness":-25},{"saturation":-97}]}],
                    mapTypeId:google.maps.MapTypeId.ROADMAP,
                };
                
                var map=new google.maps.Map(document.getElementById("my_location"),mapProp);
                
                var marker=new google.maps.Marker({
                    position:myCenter,
                    icon:'img/map_maker.png',
                });
                marker.setMap(map);
            }
            
            google.maps.event.addDomListener(window, 'load', initialize);
        </script>

        <!-- parallax 
        <script src="<?php echo base_url();?>styles/js/jquery-parallax.js"></script>-->
        <!-- Bootsrap form validation JS files -->
        <script src="<?php echo base_url('styles/js/jquery-1.12.2.min.js');?>"></script>   
        <script type="text/javascript" src="<?php echo base_url('assets/js/formValidation.js');?>"></script>
        <script type="text/javascript" src="<?php echo base_url('assets/js/bootstrap.js');?>"></script>

        <script type="text/javascript">
        jQuery.noConflict();
        (function( $ ) {
        $(function() {

            $(document).ready(function() {

                $("#refresh").on('click', function(e) {
                    $.ajax({
                        type: 'post',
                        url : '<?php echo base_url("user/login/refersh"); ?>',
                        data : { },
                        success : function(msg)
                        {
                            $("#capt").attr('src',msg);
                        }
                    });
                    
                });

                $('.dark-form').formValidation({
                    framework: 'bootstrap',
                    excluded: [':disabled'],
                    
                    fields: {
                        username: {
                            message: '<?php echo lang("language_lang.contact_your_name_valid");?>',
                            validators: {
                                notEmpty: {
                                    message: '<?php echo lang("language_lang.contact_your_name_required");?>'
                                },
                                stringLength: {
                                    min: 3,
                                    message: '<?php echo lang("language_lang.contact_your_name_exceed");?>'
                                },
                                regexp: {
                                    regexp: /^[A-Za-z ]+$/,
                                    message: '<?php echo lang("language_lang.contact_your_name_alpha");?>'
                                }
                            }
                        },
                         subject: {
                            message: '<?php echo lang("language_lang.contact_subject_valid");?>',
                            validators: {
                                notEmpty: {
                                    message: '<?php echo lang("language_lang.contact_subject_required");?>'
                                },
                                stringLength: {
                                    min: 5,
                                    message: '<?php echo lang("language_lang.contact_subject_exceed");?>'
                                },
                                regexp: {
                                    regexp: /^[A-Za-z ]+$/,
                                    message: '<?php echo lang("language_lang.contact_subject_alpha");?>'
                                }
                            }
                        },
                        email_address: {
                            validators: {
                                notEmpty: {
                                    message: '<?php echo lang("language_lang.contact_email_required");?>'
                                },
                                regexp: {
                                    regexp: /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/,
                                    message: '<?php echo lang("language_lang.contact_email_valid"); ?>'
                                }
                            }
                        },
                        messages: {
                            message: '<?php echo lang("language_lang.contact_message_valid");?>',
                            validators: {
                                notEmpty: {
                                    message: '<?php echo lang("language_lang.contact_message_required");?>'
                                },
                                stringLength: {
                                    min: 10,
                                    message: '<?php echo lang("language_lang.contact_message_exceed");?>'
                                }

                            }
                        }
                        
                    }
                })
               
            });
            
           

        });
        })(jQuery);

    
    </script>
</html>
