<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">Update magazine details</h3>
            </div>
            <div class="modal-body">
                <div class="innerAll">
                    <div class="innerLR">
                        <form class="form-horizontal" role="form" id = "addCampaign_promo1" action = "<?php echo base_url(); ?>index.php/promotion/add_promotion" method = "post">
                            <?php $this->load->view('admin/flashdata_admin'); ?>
                            <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">
                                        <input type="text" name="magazine" value="<?php echo $magezine['magazine_code']?>" required="required" id="addCampaignmagazine" class="form-control validate[required] cust_select" readonly>
                                    </div>

                                </div>
                                <div class="form-group mmar">
                                    <label  class="col-sm-3 control-label text-center">No. Of years: </label>
                                    <div class="col-sm-9">
                                        <select name="campaign_no_years" id="addCampaignnumber_of_year" class="form-control date validate[required]">
                                            <option value="">---Select Year---</option>
                                            <?php for($intCounter=1; $intCounter <= 12; $intCounter++) {?>
                                                <option value="<?php echo $intCounter; ?>"
                                                        <?php if($magezine['no_of_year'] == $intCounter){?>selected="selected" <?php }?>
                                                    ><?php echo $intCounter; ?></option>
                                            <?php } ?>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group mmar" style="margin-top: 10px">
                                    <label  class="col-sm-3 control-label text-center">Amount: </label>
                                    <div class="col-sm-9">
                                        <input type="text" value="<?php echo $magezine['amount']?>" class="form-control validate[required,custom[integer],min[1]] text-input" name = "amount" id = "addCampaigncamp_amount" required="required"/>
                                    </div>
                                </div>
                                <div class="form-group mmar">
                                    <label  class="col-sm-3 control-label text-center">Start Issue Number: </label>
                                    <div class="col-sm-9">
                                        <input type="text" value="<?php echo $magezine['start_issue']?>" class="form-control validate[required,custom[integer],max[999], min[1]] text-input" name = "start_issue" id = "addCampaignissue1" required="required"/>
                                    </div>
                                </div>
                                <div class="form-group mmar">
                                    <label  class="col-sm-3 control-label text-center">End Issue Number: </label>
                                    <div class="col-sm-9">
                                        <input type="text" value="<?php echo $magezine['end_issue']?>" class="form-control validate[required,custom[integer],max[999], min[1]] text-input" name = "end_issue" id = "addCampaignissue2" required="required"/>
                                    </div>
                                </div>
                                <div class="form-group mmar">
                                    <label  class="col-sm-3 control-label text-center">Subscription Start Date: </label>
                                    <div class="col-sm-9">
                                        <input type="text" data-date-format="d-M-yyyy" value="<?php echo date("d-M-Y", strtotime($magezine['start_date'])); ?>" class="form-control date validate[required]" name = "start_date" id = "addCampaigndate1" readonly/>
                                    </div>
                                </div>
                                <div class="form-group mmar">
                                    <label  class="col-sm-3 control-label text-center">Subscription End Date: </label>
                                    <div class="col-sm-9">
                                        <input type="text" data-date-format="d-M-yyyy" value="<?php echo date("d-M-Y", strtotime($magezine['end_date'])); ?>" class="form-control date validate[required]" name = "end_date" id = "addCampaigndate2" readonly/>
                                    </div>
                                </div>
                                <div class="form-group mmar">
                                    <label  class="col-sm-3 control-label text-left">Total Issue: </label>
                                    <div class="col-sm-9">
                                        <input class="form-control validate[required,custom[integer],min[1]] text-input" type="text" id="edit_no_issues" name="camp_total_issue" value="<?php echo $magezine['no_of_issue'];?>"/>
                                    </div>
                                </div>
                                <!-- <a href="javascript:void(0)" id="add_new_Magazine"><i class="fa fa-fw fa-plus"></i></a> -->
                            </div>
                            <input type="hidden" id="used_row" value="<?php echo $row_id;?>" />
                            <input type="hidden" id="used_camp_id" value="<?php echo $magezine['id'];?>" />
                            <input type="hidden" id="used_code" value="5" />
                            <input type="hidden" value="edit" id="purpose" />
                            <div id="promo_issue_error" class="formErrorContent" align="center"></div><br>
                            <div id="year_error" class="formErrorContent" align="center"></div>
                            <div class="form-group">
                                <div class="col-sm-offset-4 col-sm-8">
                                    <input type="hidden" id="system_base_url" value="<?php echo base_url();?>">
                                    <input type="hidden" id="previous_id" value="">
                                    <button type="submit" class="btn btn-primary" id="btnSubmit">Submit</button>
                                    <a class="btn" href="<?php echo base_url(); ?>index.php/promotion/promotion_list"> <button type="button" class="btn btn-primary">Cancel</button></a>
                                </div>
                            </div>
                        </form>
                    </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/promotion.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() {
        $("#addCampaign_promo1").validationEngine();
        /*$("#add_promo1").submit(function(){

         });*/




    });
</script>