<script type="text/javascript">
    function security_code_refresh() {
        $.post("<?php echo site_url('security/image_refresh'); ?>", function (data) {
            // console.log('data ' );
            $("#security_code_refresh_img").html(data);
            // security_code_refresh_img
        });
    }
</script>
<?php
$current_url = current_url();
$meta_tags = $this->common_model->getMetaTitle($current_url);
$header_image = $this->config->item('uploads') . 'header_images/' . $meta_tags['header_image'];
$background_image = $this->config->item('uploads') . 'background_images/' . $meta_tags['background_image'];
?>
<section class="page-heading" <?php if ($meta_tags['header_image'] != '') { ?> style='background-image: url("<?= $header_image ?>");' <?php } ?> >
    <div class="container">
        <h1><?= $breadcumb ?></h1>
        <ol class="breadcrumb">
            <li><a href="<?= site_url() ?>"><i class="fa fa-home"></i></a></li>
            <li class="active"><?php echo trim($breadcumb, '/') ?></li>
        </ol>
    </div>
</section>
<section class="MainContent" <?php if ($meta_tags['background_image'] != '') { ?> style='background-image: url("<?= $background_image ?>");' <?php } ?>>
    <div class="container">
        <h2 class="section-heading"><?php echo $page_heading ?>

        </h2>
        <div class="row">
            <div class="col-md-6">
                <?php echo $page_content ?>
            </div>
            <div class="col-md-6">
                <div class="well">

                    <form class="form-horizontal" method="post">
                        <?php if ($this->session->flashdata('enquirySuccessMessage')) { ?>
                            <div class="alert alert-success">
                                <strong>Success!</strong>  <?= $this->session->flashdata('enquirySuccessMessage') ?>   
                            </div>
                        <?php } ?>
                        <?php if ($this->session->flashdata('enquiryErrorMessage')) { ?>
                            <div class="alert alert-danger">
                                <strong>Error!</strong>  <?= $this->session->flashdata('enquiryErrorMessage') ?>   
                            </div>
                        <?php } ?>

                        <div class="form-group">
                            <label class="col-sm-4 control-label">Name<strong>*</strong></label>
                            <div class="col-sm-8 ">                          
                                <input name="full_name" type="text" value="<?= $full_name ?>" class="form-control">
                                <p style="color: red;"><?= strip_tags(form_error('full_name')) ?></p>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-4 control-label">Phone No. <strong>*</strong></label>
                            <div class="col-sm-8 ">
                                <input name="phone_no" type="text" value="<?= $phone_no ?>" class="form-control">
                                <p style="color: red;"><?= strip_tags(form_error('phone_no')) ?></p>
                            </div>
                        </div>                       


                        <div class="form-group">
                            <label class="col-sm-4 control-label">Email <strong>*</strong></label>
                            <div class="col-sm-8 ">
                                <input name="email_id" type="text" value="<?= $email_id ?>" class="form-control">
                                <p style="color: red;"><?= strip_tags(form_error('email_id')) ?></p>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-4 control-label">Order No.</label>
                            <div class="col-sm-8 ">
                                <input name="order_no" type="text" value="<?= $order_no ?>" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-4 control-label">Select Location <strong>*</strong></label>
                            <div class="col-sm-8 ">
                                <select name="location_id" class="form-control">
                                    <option value="0">Select Location</option>
                                    <?php foreach ($province_list as $province) { ?>
                                        <option value="<?= $province['province_id'] ?>"><?= $province['province_name'] ?></option>
                                    <?php } ?>
                                </select>
                                <p style="color: red;"><?= strip_tags(form_error('location_id')) ?></p>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-4 control-label">Comments<strong>*</strong></label>
                            <div class="col-sm-8 ">
                                <textarea rows="3" name="message" class="form-control"><?= $message ?></textarea>
                                <p style="color: red;"><?= strip_tags(form_error('message')) ?></p>	
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-4 control-label">Captcha<strong>*</strong></label>
                            <div class="col-sm-8">
                                <table class="captcha_table">
                                    <tr>
                                        <td width="150"><span id="security_code_refresh_img"><?= $captcha_image ?></span></td>
                                        <td>
                                            <div class="input-group">
                                                <span class="input-group-btn">
                                                    <div onclick="security_code_refresh();"  src="<?php echo $this->config->item('frontassets'); ?>img/refresh-2-icon.png" class="btn btn-default"><i class="fa fa-refresh"></i></div>
                                                </span>
                                                <input  id="captcha" type="text" name="captcha" value="" class="form-control <?php if (form_error('captcha') != "") { ?>error <?php } ?>" />
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                                <?php if (form_error('captcha') != "") { ?>
                                    <p style="color: red;"><?php echo strip_tags(form_error('captcha')); ?></p>
                                <?php } ?>
                            </div>
                        </div>   
                        <div class="col-xs-12 col-sm-8  pull-right">
                            <input name="Submit" type="submit" class="btn btn-primary" value="Submit">
                        </div>
                        <div class="clearfix"></div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</section>