<?php
$this->load->view('top_header');
$compDets = comp_settings();
$compContact = comp_contact();
$city = "";
$state = "";
$locality = "";
if (is_array($compContact) && !empty($compContact)) {
  $city = get_db_field_value("wps_cities_list", "city", "WHERE id = '" . $compContact['city'] . "'");
  $state = get_db_field_value("wps_states_list", "name", "WHERE id = '" . $compContact['state'] . "'");
  $locality = $compContact['locality'];
}
$location = $location1 = "";
if ($state || $city) {
  $location .= '<i class="fa fa-map-marker"></i> ';
}
if ($state)
  $location .= $state;
$location1 .= $state;
if ($city) {
  if ($state)
    $location .= ', ';
  $location1 .= ', ';
  $location .= $city;
  $location1 .= $city;
}
//trace($compDets);
?>
<!-- Heading Banner--->
<section class="heading_banner" style="background-image: url(<?php echo theme_url(); ?>designer/images/contact/contact.jpg)">
  <div class="container">
    <div class="row">
      <div class="col-lg-12 text-center">
        <div class="cat_title">Contact Us</div>
        <div class="clearfix"></div>
        <div class="cat_title2">We Are Available For You</div>
      </div>
    </div>
  </div>
</section>
<!-- Breadcrumb--->
<section class="inner_breadcrumb hidden-xs">
  <div class="container">
    <div class="row">
      <div class="col-lg-12">
        <ul class="breadcrumb">
          <li><a href="<?php echo comp_url(); ?>" title="Home">Home</a></li>
          <li class="active">Contact Us</li>
        </ul>
      </div>
    </div>
  </div>
</section>
<!-- Home About--->
<section class="contact_page">
  <div class="container">
    <div class="row">
      <div class="contact_form_grid1">
        <div class="col-lg-5 contact_details">
          <h4>Contact Information</h4>
          <p>Write to us or call us, get quick response powered by our advanced coustomer support team .</p>
          <ul class="address_list">
            <li><a href="javascript:void()"><span class="fa fa-map-marker"></span> <?php echo $compContact['address'] . ', ' . $compContact['locality'] . ', Near ' . $compContact['landmark']; ?>, <?php echo $state; ?>, <?php echo $city; ?></a></li>
            <li><a href="javascript:void()"><span class="fa fa-phone"></span> Call: +91-11-47015888, +91-99112-44888</a></li>
            <!--<li><a href="javascript:void()"><span class="fa fa-whatsapp"></span> Fax: +91-99112-44888</a></li>
            <li><a href="javascript:void()"><span class="fa fa-globe"></span> www.yourwebsite.com</a></li>-->
          </ul>
          <?php if(is_array($compDets) && !empty($compDets)){?>
          <h4>Get in Touch</h4>
          <ul class="social_list">
            <li><a href="<?php echo ($compDets['facebook_link']) ? $compDets['facebook_link'] : 'javascript:void()'; ?>" target="_blank"><i class="fa fa-facebook"></i></a></li>
            <li><a href="<?php echo ($compDets['twitter_link']) ? $compDets['twitter_link'] : 'javascript:void()'; ?>" target="_blank"><i class="fa fa-twitter"></i></a></li>
            <li><a href="<?php echo ($compDets['youtube_link']) ? $compDets['youtube_link'] : 'javascript:void()'; ?>" target="_blank"><i class="fa fa-youtube"></i></a></li>
            <li><a href="<?php echo ($compDets['linkedin_link']) ? $compDets['linkedin_link'] : 'javascript:void()'; ?>" target="_blank"><i class="fa fa-linkedin"></i></a></li>
          </ul>
          <?php } ?>
        </div>
        <div class="col-lg-7 form_grid">
          <h4>We want to hear form you!</h4>
          <?php
          error_message();
          ?>
          <form role="form" name="contact-form" method="post" id="contact_form" action="" >
            <div class="row">
              <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                <div class="form-group">
                  <input tabindex="1" class="form-control" type="text" value="<?php echo set_value('name'); ?>" name="name" placeholder="Your Name*" />
                  <?php echo form_error('names'); ?>
                </div>
              </div>
              <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                <div class="form-group">
                  <input tabindex="2" class="form-control" type="email" value="<?php echo set_value('email'); ?>" name="email" placeholder="Your Email ID*" />
                  <?php echo form_error('email'); ?>
                </div>
              </div>
              <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                <div class="form-group">
                  <input tabindex="3" class="form-control" type="text"  value="<?php echo set_value('phone'); ?>" name="phone" placeholder="Your Phone No*" />
                  <?php echo form_error('phone'); ?>
                </div>
              </div>
              <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                <div class="form-group">
                  <input tabindex="4" class="form-control" type="text" value="<?php echo set_value('location'); ?>" name="location" placeholder="Your Location*" id="autocomplete" onFocus="geolocate()" />
                  <?php echo form_error('location'); ?>
                </div>
              </div>
              <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="form-group">
                  <textarea tabindex="5" class="form-control" rows="5" placeholder="Your Comments Here*" name="message"><?php echo set_value('message'); ?></textarea><?php echo form_error('message'); ?>
                </div>
              </div>
              <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <div class="form-group">
                  <button tabindex="7" class="modal_btn" type="submit" name="submit" value="Submit" data-submit="...Sending">Submit</button>
                </div>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
</section>
<?php
if (@$compDets['webiste_map']) {
  ?>
  <iframe class="contact_map" src="<?php echo $compDets['webiste_map']; ?>" allowfullscreen></iframe>
  <?php
}
?>
<!-- Home Clients -->  
<?php //if($this->uri->rsegment(2)!="contactus"){echo comp_clients();} ?>
<!-- Footer -->
<?php $this->load->view('bottom_footer'); ?>
<script>
  jQuery(document).ready(function ($) {
    $("#contact_form").validate({
      rules: {
        name: "required",
        message: "required",
        location: "required",
        email: {
          required: true,
          email: true
        },
        phone: {
          required: true,
          number: true,
          minlength: 10,
        }
      },
      messages: {
        name: "Please enter your name",
        message: "Please enter message",
        email: {
          required: "Please enter your email address"
        },
        location: "Please enter your location",
        phone: {
          required: "Please enter your mobile no.",
          number: "Mobile No. contains only numbers",
          minlength: "Your Mobile No. must be at least 10 characters long",
        }
      },
    })
  });

</script>
</body> 
</html>