<?php
$this->load->view('top_application');
//trace($res);
$mediaRes = $media_res;
$messurement = $this->config->item('unit_measurement');
$businessNature = $this->config->item('businessNatureAll');
$employeeCount = $this->config->item('employeeCount');
$firmStatus = $this->config->item('firmStatus');
$turnover = $this->config->item('turnover');
$parent_categories = get_parent_categories($res['category_id']);
$pCat = "";
foreach ($parent_categories as $parCat) {
  $pCat = $parCat;
}

//Address
$city = $location = "";
$state = "";
if (is_array($company) && !empty($company)) {
  $city = get_db_field_value("wps_cities_list", "city", "WHERE id = '" . $company['city'] . "'");
  $state = get_db_field_value("wps_states_list", "name", "WHERE id = '" . $company['state'] . "'");
}

if ($state)
  $location .= $state;
if ($city) {
  if ($state)
    $location .= ', ';
  $location .= $city;
}
?>
<section class="dir-alp dir-pa-sp-top">
  <div class="container">
    <div class="row">
      <div class="dir-alp-tit">
        <!--<h1><?php //echo $res['product_name']; ?></h1>-->
        <ol class="breadcrumb">
          <li><a href="<?php echo site_url(); ?>">Home</a> </li>
          <?php
          if (isset($pCat['friendly_url'])) {
            ?>
            <li><a href="<?php echo site_url($pCat['friendly_url']); ?>"><?php echo $pCat['category_name']; ?></a></li>
            <?php
          }
          ?>
          <li class="active"><?php echo $res['product_name']; ?></li>
        </ol>
      </div>
    </div>
    <div class="row">
      <div class="dir-alp-con details_page01">
        <div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">
          <div class="full_details01">
            <div class="row">
              <div class="col-lg-5 col-md-5">
                <div class="zoom-gallery">
                  <div data-slide-id="zoom" class="zoom-gallery-slide active">
                    <a id="zoom-v" class="MagicZoom" title="<?php echo $res['product_name']; ?>" href="<?php echo get_image('product_images', $res['media'], '', '', 'R'); ?>"><img src="<?php echo get_image('product_images', $res['media'], '355', '355', 'R'); ?>" class="img-responsive" alt="<?php echo $res['product_name']; ?>" /> </a>
                  </div>
                  <a class="mark_favourite" href="javascript:void()" title="Mark as Favourite"><i class="fa fa-heart"></i></a>
                  <?php
                  if ($res['youtube_id'] != '') {
                    ?>
                    <div data-slide-id="video-1" class="zoom-gallery-slide video-slide">
                      <iframe width="180" height="180" src="https://www.youtube.com/embed/<?php echo $res['youtube_id']; ?>" frameborder="0" allow="accelerometer; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
                    </div>
                    <?php
                  }
                  ?>
                  <div class="selectors">
                    <?php
                    $cnt = 1;
                    foreach ($mediaRes as $mkey => $mval) {
                      ?>
                      <a data-slide-id="zoom" <?php echo ($cnt == 1) ? 'class="active"' : ''; ?> href="<?php echo get_image('product_images', $mval['media'], '', '', 'R'); ?>" data-image="<?php echo get_image('product_images', $mval['media'], '355', '355', 'R'); ?>" data-zoom-id="zoom-v"><img src="<?php echo get_image('product_images', $mval['media'], '75', '75', 'R'); ?>" /></a>
                      <?php
                      $cnt++;
                    }
                    if ($res['youtube_id'] != '') {
                      ?>
                      <a data-slide-id="video-1" href="#">
                        <span class="fa fa-youtube-play"></span>
                        <img src="<?php echo theme_url(); ?>images/video1.jpg"/>
                      </a>
                      <?php
                    }
                    ?>
                  </div>
                </div>
              </div>
              <div class="col-lg-7 col-md-7">
                <div class="details_page_content">
                  <h1><?php echo $res['product_name']; ?></h1>
                  <?php
                  if ($res['product_code']) {
                    ?>
                    <span class="productCode"><strong>Product Code : </strong><?php echo $res['product_code']; ?></span>
                    <?php
                  }
                  ?>                      
                  <div class="price01">
                    <?php if($res['product_price']>0){ ?>
                    <strong><?php echo display_price($res['product_price']); ?></strong>/ <?php echo $messurement[$res['unit_measurement']]; } if($res['moq']>0){ ?>

                    <strong> <?php echo $res['moq']; ?> <?php echo $messurement[$res['unit_measurement']]; ?></strong> (Min Order) <?php } ?>
                  </div>
                  <p><?php echo char_limiter($res['products_description'], 550) ?></p>
                  <div class="listing_li">
                    <ul>
                      <?php
                      if ($res['attribute_name']) {
                        $atrribute = explode(',', $res['attribute_name']);
                        $atrributeVal = explode(',', $res['attribute_value']);
                        $attcnt = 1;
                        foreach ($atrribute as $ak => $av) {
                          ?>
                          <li><strong><?php echo $av; ?></strong>: <span><?php echo $atrributeVal[$ak]; ?></span></li>
                          <?php
                          $attcnt++;
                          if ($attcnt == 7)
                            break;
                        }
                      }
                      ?>
                    </ul>
                  </div>
                  <div class="list-enqu-btn scroll_btn">
                    <ul>
                      <li><a href="#full_details" class="getQuote">View Complete Details</a> </li>
                      <li><a href="javascript:void()" class="getQuotes" data-friendly_url="<?php echo site_url().$res['friendly_url']; ?>" data-productType="<?php echo $res['productType']; ?>" data-productID="<?php echo $res['products_id']; ?>" data-companyID="<?php echo $res['customers_id']; ?>" data-productName="<?php echo $res['product_name'] . ' <br> ' . $company['company_name'] . ' ' . $location; ?>" data-companyName="<?php echo $company['company_name']; ?>" data-productImage="<?php echo get_image('product_images', $res['media'], '400', '600', 'R'); ?>" data-unit="<?php echo $messurement[$res['unit_measurement']]; ?>" data-dismiss="modal" data-toggle="modal" data-target="#list-quo"><i class="fa fa-rupee"></i> Get a Quote</a>
                      </li>
                    </ul>
                  </div>
                  <div class="clearfix"></div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">
          <div class="pglist-p3 pglist-bg pglist-p-com right_sec01">
            <div class="pg-list-user-pro details_img"> <img src="<?php echo get_image('user', $company['profile_picture'], '40', '40', 'R'); ?>" alt=""> </div>
            <div class="list-pg-inn-sp">
              <div class="list-pg-upro">
                <h5><?php echo $company['company_name']; ?></h5>
                <p><?php echo $company['address'];
                 echo ($company['locality']!='')?', '.$company['locality']:'';  echo ' '.$city; ?>, <?php echo $state; ?> - <?php echo $company['country']; ?></p>
                <?php
                if ($res['youtube_id'] != '' && $res['youtube_id'] != '0') {
                  ?>
                  <a href="javascript:void(0);" data-youtubeId="<?php echo $res['youtube_id']; ?>" data-companyFacName="<?php echo $company['company_name']; ?>" title="Factory Video" class="youtube_btn" data-dismiss="modal" data-toggle="modal" data-target="#facVideo"><i class="fa fa-youtube-play"></i> Factory Video</a>
                  <?php
                }
                ?>
                <a href="javascript:void(0);" data-companyID="<?php echo $res['customers_id']; ?>" class="view_contact_number <?php echo ($this->session->userdata('user_id') <= 0) ? 'getContactNo' : 'viewContactNo'; ?>" <?php echo ($this->session->userdata('user_id') <= 0) ? 'data-dismiss="modal" data-toggle="modal" data-target="#login-ter"' : ''; ?>>View Contact Number</a>
                
                <a href="javascript:void()" class="get_quotes_btn getQuotes" data-friendly_url="<?php echo site_url().$res['friendly_url']; ?>" data-productType="<?php echo $res['productType']; ?>" data-productID="<?php echo $res['products_id']; ?>" data-companyID="<?php echo $res['customers_id']; ?>" data-productName="<?php echo $res['product_name'] . ' <br> ' . $company['company_name'] . ' ' . $location; ?>" data-companyName="<?php echo $company['company_name']; ?>" data-productImage="<?php echo get_image('product_images', $res['media'], '400', '600', 'R'); ?>" data-unit="<?php echo $messurement[$res['unit_measurement']]; ?>" data-dismiss="modal" data-toggle="modal" data-target="#list-quo"> Get a Quote</a>
              </div>
            </div>
          </div>
        </div>
        <div class="clearfix"></div>
        <?php
        if (is_array($related)) {
          ?>
          <section>
            <div class="">
              <div class="col-lg-12 col-md-12"><h3>You may also like</h3></div>
              <?php
              foreach ($related as $rVal) {
                $userDets = get_db_single_row("wps_customers", "customers_id, website, company_name, state, city, locality", "customers_id = '" . $rVal['customers_id'] . "'");
                $link = site_url() . $rVal['friendly_url'];
                $city = "";
                $state = "";
                if (is_array($userDets) && !empty($userDets)) {
                  $city = get_db_field_value("wps_cities_list", "city", "WHERE id = '" . $userDets['city'] . "'");
                  $state = get_db_field_value("wps_states_list", "name", "WHERE id = '" . $userDets['state'] . "'");
                }
                $location1 = "";
                if ($state)
                  $location1 .= $state;
                if ($city) {
                  if ($state)
                    $location1 .= ', ';
                  $location1 .= $city;
                }
                ?>
                <div class="col-lg-3 col-md-3">
                  <div class="related_product01">
                    <div class="product_01_image">
                      <a href="<?php echo $link; ?>" title="<?php echo $rVal['product_name']; ?>">
                        <img src="<?php echo get_image('product_images', $rVal['media'], '271', '270', 'R'); ?>" alt="<?php echo $rVal['product_name']; ?>" /> 
                        </a>
                    </div>
                    <div class="clearfix"></div>
                    <h4><a href="<?php echo $link; ?>" title="<?php echo $rVal['product_name']; ?>"><span><?php echo $rVal['product_name']; ?></span></a></h4>
                    <h5><?php echo $userDets['company_name']; ?></h5>
                    <div class="price">
                      <?php if($rVal['product_price']>0){ ?>
                      <strong><?php echo display_price($rVal['product_price']); ?></strong> / <?php echo $messurement[$rVal['unit_measurement']]; ?>
                    <?php } ?>
                    </div>
                    <?php if($rVal['moq']>0){ ?>
                    <h6><strong><?php echo $rVal['moq']; ?> <?php echo $messurement[$rVal['unit_measurement']]; ?></strong> (Min Order)</h6>
                    <?php } ?>
                    <a href="javascript:void()" class="view_contact_number getQuotes" data-friendly_url="<?php echo site_url().$rVal['friendly_url']; ?>" data-productType="<?php echo $rVal['productType']; ?>" data-productID="<?php echo $rVal['products_id']; ?>" data-companyID="<?php echo $rVal['customers_id']; ?>" data-productName="<?php echo $rVal['product_name'] . ' <br> ' . $userDets['company_name'] . ' ' . $location1; ?>" data-companyName="<?php echo $userDets['company_name']; ?>" data-productImage="<?php echo get_image('product_images', $rVal['media'], '400', '600', 'R'); ?>" data-unit="<?php echo $messurement[$rVal['unit_measurement']]; ?>" data-dismiss="modal" data-toggle="modal" data-target="#list-quo"> Get a Quote</a>
                    <a class="mark_favourite" href="javascript:void()" title="Mark as Favourite"><i class="fa fa-heart"></i></a>
                  </div>
                </div>
                <?php
              }
              ?>
            </div>
          </section>
          <?php
        }
        ?>
        <div class = "col-lg-8">
          <div id = "full_details" class = "pg-elem">
            <div class = "pg-elem-inn ele-btn">
              <div>
                <ul class = "tabs pg-ele-tab">
                  <li class = "tab"><a href = "#test1" class = "active">Product Details</a> </li>
                  <li class = "tab"><a href = "#test2">Company Details</a> </li>
                </ul>
              </div>
              <div id = "test1" class = "col s12 active">
                <div class = "dtlsec1">
                  <h4>Product Specification</h4>
                  <div class = "listing_li">
                    <ul>
                      <?php 
                      if ($res['attribute_name']) {
                        $atrribute = explode(',', $res['attribute_name']);
                        $atrributeVal = explode(',', $res['attribute_value']);
                        foreach ($atrribute as $ak => $av) {
                          ?>
                          <li><strong><?php echo $av; ?></strong>: <span><?php echo $atrributeVal[$ak]; ?></span></li>
                          <?php
                        }
                      }
                      ?>
                    </ul>
                  </div>
                  <?php if($res['products_description']!=''){ ?>
                  <h4>Product Description</h4>
                  <div><?php echo $res['products_description']; ?></div>
                  <?php } ?>
                  <?php
                  if ($res['youtube_id'] != '' && $res['youtube_id'] != 0) {
                    ?>
                    <div class="text-center mb10 full_video">
                      <iframe width="650" height="300" src="https://www.youtube.com/embed/<?php echo $res['youtube_id']; ?>" frameborder="0" allow="accelerometer; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
                    </div>
                    <?php
                  }
                  $cnt = 1;
                  foreach ($mediaRes as $mkey => $mval) {
                    ?>
                    <div class=" text-center mb10 full_image01">
                      <img class = "img-responsive" src="<?php echo get_image('product_images', $mval['media'], '800', '500', 'R'); ?>" />
                    </div>
                    <?php
                    $cnt++;
                  }
                  ?>
                  <div class="col-lg-12 col-md-12">&nbsp;</div>
                </div>
              </div>
              <div id = "test2" class = "col s12">
                <?php if(@$factsheet['about_company']!=''){ ?>
                <h4>About Company</h4>
                <p><?php echo @$factsheet['about_company']; ?></p>
                <?php } ?>
                <h4 class="mb10">Company Factsheet</h4>
                <div class="row">
                  <div class = "col-xs-12 col-sm-6 col-lg-4">
                    <div class = "wps-factsheet">
                      <div class = "icon">
                        <img alt = "Nature of Business" src = "<?php echo theme_url(); ?>images/factsheet/nature-of-business.png">
                      </div>
                      <div class = "info01">
                        <h4>Nature of Business</h4>
                        <p><?php echo @$businessNature[$factsheet['business_nature']]; ?></p>
                      </div>
                    </div>
                  </div>
                  <?php if(@$factsheet['establishment_year']!='' && @$factsheet['establishment_year']>0){ ?>
                  <div class = "col-xs-12 col-sm-6 col-lg-4">
                    <div class = "wps-factsheet">
                      <div class = "icon">
                        <img alt = "Year of Establishment" src = "<?php echo theme_url(); ?>images/factsheet/year-of-establishment.png">
                      </div>
                      <div class = "info01">
                        <h4>Year of Establishment</h4>
                        <p><?php echo @$factsheet['establishment_year']; ?></p>
                      </div>
                    </div>
                  </div>
                <?php } ?>
                 <?php if(@$employeeCount[$factsheet['employee_count']]!='' && @$employeeCount[$factsheet['employee_count']]>0){ ?>
                  <div class = "col-xs-12 col-sm-6 col-lg-4">
                    <div class = "wps-factsheet">
                      <div class = "icon">
                        <img alt = "Total Number of Employees" src = "<?php echo theme_url(); ?>images/factsheet/employees.png">
                      </div>
                      <div class = "info01">
                        <h4>Total Number of Employees</h4>
                        <p><?php echo @$employeeCount[$factsheet['employee_count']]; ?></p>
                      </div>
                    </div>
                  </div>
                  <?php } ?>
                  <?php if(@$firmStatus[$factsheet['legal_firm_status']]!=''){ ?>
                  <div class = "col-xs-12 col-sm-6 col-lg-4">
                    <div class = "wps-factsheet">
                      <div class = "icon">
                        <img alt = "Legal Status of Firm" src = "<?php echo theme_url(); ?>images/factsheet/Legal-Status-of-Firm.png">
                      </div>
                      <div class = "info01">
                        <h4>Legal Status of Firm</h4>
                        <p><?php echo @$firmStatus[$factsheet['legal_firm_status']]; ?></p>
                      </div>
                    </div>
                  </div>
                  <?php } ?>
                  <?php if(@$turnover[$factsheet['legal_firm_status']]!='' && @$turnover[$factsheet['legal_firm_status']]>0){ ?>
                  <div class = "col-xs-12 col-sm-6 col-lg-4">
                    <div class = "wps-factsheet">
                      <div class = "icon">
                        <img alt = "Annual Turnover" src = "<?php echo theme_url(); ?>images/factsheet/annual-turnover.png">
                      </div>
                      <div class = "info01">
                        <h4>Annual Turnover</h4>
                        <p><?php echo @$turnover[$factsheet['legal_firm_status']]; ?></p>
                      </div>
                    </div>
                  </div>
                  <?php } ?>
                  <?php if(@$factsheet['gst_no']!='' && @$factsheet['gst_no']>0){ ?>
                  <div class = "col-xs-12 col-sm-6 col-lg-4">
                    <div class = "wps-factsheet">
                      <div class = "icon">
                        <img alt = "GST Number" src = "<?php echo theme_url(); ?>images/factsheet/gst.png">
                      </div>
                      <div class = "info01">
                        <h4>GST Number</h4>
                        <p><?php echo @$factsheet['gst_no']; ?></p>
                      </div>
                    </div>
                  </div>
                  <?php } ?>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class = "col-lg-4 col-md-4">
          <div class = "pglist-p3 pglist-bg pglist-p-com">
            <div class = "pglist-p-com-ti-right">
              <h3>Send your enquiry to this supplier</h3>
            </div>
            <div class = "list-pg-inn-sp">
              <div class = "clearfix"></div>
              <div class = "list-pg-guar">
                <form id="getQuoteFormInner">
                  <div class="alert alert-warning EmessageBox" style="display: none;">
                    <span class="Emessage"></span>
                  </div>
                  <div class="alert alert-success SmessageBox" style="display: none;">
                    <span class="Smessage"></span>
                  </div>
                  <div class = "form-group">
                    <label class = "left_to">To</label>
                    <input type="text" name="" value="<?php echo $company['company_name']; ?>" class="be-input" placeholder = "Company name" readonly = "readonly" disabled = "disabled">
                  </div>

                  <div class = "form-group">
                    <input type="text" name="name" id="fullNameInner" class="form-control" placeholder="Your Name*" required>
                  </div>
                  <div class = "form-group">
                    <input type="text" name="emailAddressInner" id="emailAddressInner" class="form-control" placeholder="Your Email*" required>
                  </div>
                  <div class = "form-group">
                    <input type="text" name="mobileNumberInner" id="mobileNumberInner" class="form-control" placeholder="Your Mobile No*" required>
                  </div>

                  <div class = "form-group">
                    <input type="text" name="productLocationInner" id="productLocationInner" class="form-control" placeholder="Your Location*" required>
                  </div>
                  <?php if($res['productType']==1){ //1 = Services ?>
                    <input type="hidden" value="1" name="productQuantityInner" id="productQuantityInner" />
                  <?php }else{?>
                  <div class = "form-group">
                    
                    <input type="text" name="productQuantityInner" id="productQuantityInner" class="form-control" placeholder="Quantity in <?php echo $messurement[$res['unit_measurement']]; ?>*" required onkeyup="if (/\D/g.test(this.value))
                          this.value = this.value.replace(/\D/g, '')" />
                  </div>
                  <?php } ?>

                  <div class = "row">
                    <div class = "form-group">
                      <div class = "row">
                        <div class = "col-lg-4 col-md-4">
                          <div class = "image_input">
                            <img class = "img-responsive" src = "<?php echo get_image('product_images', $res['media'], '85', '85', 'R'); ?>">
                            <span><?php echo $res['product_code']; ?></span>
                          </div>
                        </div>
                        <div class = "col-lg-8 col-md-8">
                          <textarea type="text" name="enquiryMessageInner" id="enquiryMessageInner" class="form-control" placeholder="Type your message here..." required></textarea>
                        </div>
                      </div>
                    </div>
                  </div>
                  <div class = "form-group agree">
                    <input type = "checkbox" required> I agree to the <a href = "<?php echo site_url(); ?>terms-conditions" target = "_blank">terms</a> and <a href = "<?php echo site_url(); ?>privacy-policy" class = "betrmt" target="_blank">privacy policy</a></div>
                  <div class = "form-group">
                    <input type="hidden" value="<?php echo $res['customers_id']; ?>" id="productCompIDInner" />
                    <input type="hidden" value="<?php echo $res['products_id']; ?>" id="productQuoteIDInner" />
                    <input type="hidden" value="<?php echo current_url(); ?>" id="post_urlInner" />
                    <input type = "submit" class = "submit_requirement" value = "Submit Requirement">
                  </div>
                </form>
              </div>
            </div>
          </div>
          <div class = "clearfix"></div>
          <div class = "pglist-p3 pglist-bg pglist-p-com">
            <div class = "pglist-p-com-ti-right">
              <h3>Get in Touch with us</h3>
            </div>
            <div class = "clearfix"></div>
            <div class = "list-pg-inn-sp get_touch">
              <h4><?php echo $company['company_name']; ?></h4>
              <p><i class = "fa fa-user"></i> <?php echo $company['first_name'] . ' ' . $company['last_name']; ?></p>
              <p><i class = "fa fa-map-marker"></i> <?php echo $company['address'];
              echo ($company['locality']!='')?', '.$company['locality']:''; ?>, <?php echo $city; ?>, <?php echo $state; ?> - <?php echo $company['country']; ?></p>
              <p><a href = "<?php echo $company['website']; ?>" target="_blank"><i class = "fa fa-globe"></i> Visit Website</a></p>
              <div class = "contact_info01">
                <div class = "row">
                  <div class = "col-lg-6">
                    
                    <a href="javascript:void(0);" data-companyID="<?php echo $res['customers_id']; ?>" class="view_contact_number <?php echo ($this->session->userdata('user_id') <= 0) ? 'getContactNo' : 'viewContactNo'; ?>" <?php echo ($this->session->userdata('user_id') <= 0) ? 'data-dismiss="modal" data-toggle="modal" data-target="#login-ter"' : ''; ?>>
                      <i class = "fa fa-phone"></i><br>
                      View Contact Number
                    </a>
                  </div>
                  <!--<div class = "col-lg-6">
                    <a href = ""><i class = "fa fa-envelope"></i><br>
                      Send Email</a>
                  </div>-->
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class = "clearfix"></div>
      </div>
    </div>
  </div>
</section>
<!--MOBILE APP-->
<?php $this->load->view("bottom_application"); ?>
<link href="<?php echo theme_url(); ?>/css/magiczoomplus.css" rel="stylesheet" type="text/css" />
<script src="<?php echo theme_url(); ?>/js/magiczoomplus.js" type="text/javascript"></script>
<script>
                      jQuery('.zoom-gallery .selectors a').on('click touch', function (e) {
                        var iframe = jQuery('.active iframe[src*="youtube"],.active iframe[src*="vimeo"]');
                        if (iframe.length) {
                          iframe.attr('src', iframe.attr('src'));
                        }
                        jQuery('.zoom-gallery .zoom-gallery-slide').removeClass('active');
                        jQuery('.zoom-gallery .selectors a').removeClass('active');
                        jQuery('.zoom-gallery .zoom-gallery-slide[data-slide-id="' + jQuery(this).attr('data-slide-id') + '"]').addClass('active');
                        jQuery(this).addClass('active');
                        e.preventDefault();
                      });

                      //get quote
                      $('.getQuotes').click(function () {
                        var productType = $(this).attr('data-productType');
                        var productID = $(this).attr('data-ProductID');
                        var companyID = $(this).attr('data-companyID');
                        var companyName = $(this).attr('data-companyName');
                        var productName = $(this).attr('data-ProductName');
                        var productImage = $(this).attr('data-ProductImage');
                        var friendly_url = $(this).attr('data-friendly_url');
                        if(productType==1){
                          $('#productQuantity').val(1);
                          $('.qhide').hide();
                        }
                        $('#productQuoteImage').attr('src', productImage);
                        $('#productQuoteImage').css({"border": "3px solid #CCC"});
                        $('#companyProDetails').html('');
                        $('#companyProDetails').html(productName);
                        $('#companyProName').html(companyName);
                        $('#productQuoteID').val(productID);
                        $('#productCompID').val(companyID);
                        $('#post_url').val(friendly_url);
                        $('.unitSize').html('/' + $(this).attr('data-unit'));
                      });

                      //post enquiry
                      $('#getQuoteFormInner').submit(function (e) {
                        e.preventDefault();
                        var fullName = $('#fullNameInner').val();
                        var mobileNumber = $('#mobileNumberInner').val();
                        var emailAddress = $('#emailAddressInner').val();
                        var productQuantity = $('#productQuantityInner').val();
                        var enquiryMessage = $('#enquiryMessageInner').val();
                        var productID = $('#productQuoteIDInner').val();
                        var companyID = $('#productCompIDInner').val();
                        var location = $('.productLocationInner').val();
                        var post_url = $('#post_urlInner').val();
                        var type = '4';

                        $.post('<?php echo site_url(); ?>products/postEnquiry', {fullName: fullName, mobileNumber: mobileNumber, emailAddress: emailAddress, productQuantity: productQuantity, enquiryMessage: enquiryMessage, productID: productID, companyID: companyID, post_url: post_url, location: location,type:type}, function (response) {
                          //alert(response);
                          obj = JSON.parse(response);
                          if (obj.success == 'true') {
                            $('.SmessageBox').show(0);
                            $('.EmessageBox').hide(0);
                            $('.Emessage').html('');
                            $('.Smessage').html('');
                            $('.Smessage').html(obj.message);
                            $('#getQuoteForm')[0].reset();
                          } else {
                            $('.EmessageBox').show();
                            $('.SmessageBox').hide();
                            $('.Smessage').html('');
                            $('.Emessage').html('');
                            $('.Emessage').html(obj.error);
                          }
                        });

                      });
</script>