<link rel="stylesheet" href="<?php echo base_url();?>assets/js/validationEngine.jquery.css" type="text/css" />
<div class="" id="addPromotion">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header" align = "left">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h3 class="modal-title">Select magazine to add</h3>
            </div>
            <div class="modal-body">
                <div class="innerAll">
                    <div class="innerLR">
                        <form class="form-horizontal" role="form" id = "subscribe_magazine_campaign" action = "" method = "">
                            <?php $this->load->view('admin/flashdata_admin'); ?>
                            <?php if(count($arrDetails) > 0) {?>
                            <div id="magazine_list">
                                <div class="form-group mmar">
                                    <label  class="col-sm-3 control-label text-center">Select Magazine: </label>
                                    <div class="col-sm-9">

                                            <select class="marl-n validate[required] cust_select" id="sub_magazine_camp" name = "magazine" style="margin-left: 3px" required="required">
                                                <option value="">-- Select --</option>
                                                <?php foreach($arrDetails as $objMagezine) {?>
                                                    <option value="<?php echo $objMagezine['magazine_code'] ?>"><?php echo $objMagezine['magazine_code']; ?></option>
                                                <?php } ?>
                                            </select>
                                        </div>

                                </div>
                                <div class="form-group mmar">
                                    <label  class="col-sm-3 control-label text-left">Number Of Years subscription: </label>
                                    <div class="col-sm-9">
                                        <select name="camp_number_years" id="camp_number_years" class="form-control validate[required]">
                                            <option value="">---Select Year---</option>
                                            <?php for($intCounter=1; $intCounter <= 12; $intCounter++) {?>
                                                <option value="<?php echo $intCounter; ?>"><?php echo $intCounter; ?></option>
                                            <?php } ?>
                                        </select>
                                    </div>
                                </div>
                                <!-- <a href="javascript:void(0)" id="add_new_Magazine"><i class="fa fa-fw fa-plus"></i></a> -->
                            </div>
                            <table class="table table-white table-vertical-center margin-none table-striped footable">
                                <tr>
                                    <td>
                                        <label  class="col-sm-3 control-label text-left">Start Issue: </label>
                                        <div class="col-sm-7">
                                            <input class="form-control validate[required] text-input" type="text" id="issue1" name="start_issue" value="" />
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <label  class="col-sm-3 control-label text-left">End Issue: </label>
                                        <div class="col-sm-7">
                                            <input class="form-control validate[required] text-input" type="text" id="issue2" name="end_issue" value="" />
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <label  class="col-sm-3 control-label text-left">Start Date: </label>
                                        <div class="col-sm-7">
                                            <input class="form-control date " data-date-format="d-M-yyyy" type="text" id="camp_start_date" name="start_date" value="" required="required" />
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <label  class="col-sm-3 control-label text-left">End Date: </label>
                                        <div class="col-sm-7">
                                            <input class="form-control date " data-date-format="d-M-yyyy" type="text" id="camp_end_date" name="end_date" value="" required="required"/>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <label  class="col-sm-3 control-label text-left">Amount: </label>
                                        <div class="col-sm-7">
                                            <input class="form-control validate[required,custom[integer],min[1]] text-input" type="text" id="amount" name="amount" value="" />
                                        </div>
                                    </td>
                                </tr>

                                <tr>
                                    <td>
                                        <label  class="col-sm-3 control-label text-left">No of Issues: </label>
                                        <div class="col-sm-7">
                                            <input type="text" value="<?php echo $arrResultSet['no_of_issue'];?>" class="form-control validate[required,custom[integer],max[999], min[1]] text-input" name = "no_issues" id = "no_issues" required="required"/>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <div id="promo_issue_error" class="formErrorContent" align="center"></div><br>
                            <div id="year_error" class="formErrorContent" align="center"></div>
                            <input type="hidden" value="add_new" id="purpose" />
                            <div class="form-group">
                                <div class="col-sm-offset-4 col-sm-8">
                                    <input type="hidden" value="" id="row_id_edit" />
                                    <input type="hidden" id="system_base_url" value="<?php echo base_url();?>">
                                    <input type="hidden" id="strCampId" value="<?php echo $intCampaignId;?>">
                                    <input type="hidden" id="intNumberOfYear" value="<?php echo $intNumberOfYear;?>">
                                    <input type="hidden" id="previous_id" value="">
                                    <button type="submit" class="btn btn-primary" id="btn_submit_campaing">Submit</button>
                                </div>
                            </div>
                        </form>
                        <?php } else {?>
                            Sorry No Magazines found !!!!!!
                        <?php } ?>
                    </div>
                </div>
            </div>
            <!-- // Modal body END -->
        </div>
    </div>
</div>
<script src="<?php echo base_url();?>assets/js/main.js" type="text/javascript"></script>
<script src="<?php echo base_url();?>assets/js/subscriber.js" type="text/javascript"></script>
<script src="<?php echo base_url();?>assets/js/custom.js" type="text/javascript"></script>
<script src="<?php echo base_url();?>assets/plugins/forms_elements_multiselect/js/jquery.multi-select.js?v=v2.0.0-rc1&sv=v0.0.1.2"></script>
<script src="<?php echo base_url();?>assets/plugins/forms_elements_bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script src="<?php echo base_url();?>assets/js/jquery.validationEngine-en.js" type="text/javascript"></script>
<script src="<?php echo base_url();?>assets/js/jquery.validationEngine.js" type="text/javascript"></script>
<script>
    $(document).ready(function() {
        $('.date').datepicker();
        $("#subscribe_magazine_campaign").validationEngine();
    });
</script>
