<link rel="stylesheet" href="<?php echo base_url();?>assets/js/validationEngine.jquery.css" type="text/css" />
<link rel="stylesheet" href="<?php echo base_url();?>assets/css/cust_paginition.css" type="text/css" />
<div class="" id="addSub">
			<div class="modal-dialog">
				<div class="modal-content"> 
					<!-- Modal heading -->
					<div class="modal-header">
						<!-- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> -->
						<h3 class="modal-title" align = "center">Add Product to Subscribe</h3>
					</div>
					<!-- // Modal heading END --> 
					<!-- Modal body -->
					<div class="modal-body">
						<div class="innerAll">
							<div class="innerLR">
								
									
									 <div class="form-group mmar">
										<div class="col-sm-12">
											<form class="form-horizontal" role="form" id = "add_promo" action = "" method = "post">
											<table class="table table-white table-vertical-center margin-none table-striped footable" id = "this_table">
												<thead>
													<tr>
														<th data-class="highlight" class="text-center"> Magazine</th>
														<th data-class="highlight" class="text-center">Period</th>
														<!-- <th  class="text-center">Status</th> -->
														<th  class="text-center">Add </th>
														<th class="text-center">Delete </th>
													</tr>
												</thead>
												<tbody>
													<tr>
														<td class="text-center" >
															<select class="cust_select col-md-12 marl-n" id = "sub_magazine">
																<option>--select--</option>
																<?php foreach ($magazine_details as $details) { ?>
																	<option value = "<?php echo $details['id'] ?>"><?php echo $details['magezine_id'] ?></option>
																<?php } ?>
															</select>
														</td>
														<td class="text-center" id = "sub_years">
															<select class="selectpicker col-md-12 marl-n">
																<option>--select--</option>
															</select>
														</td>

														<!-- <td class="text-center" >
															<select class="selectpicker col-md-12 marl-n">
																<option>Paid</option>
																<option>Unpaid</option>
																<option>Processing</option>
															</select>
														</td> -->
														<td class="text-center">
															<a href="javascript:void(0)" id="aAddRow"><i class="fa fa-fw fa-plus"></i></a> 
														</td>
														<td class="text-center">
															<a href="javascript:void(0)" id="aDeleteRow"><i class="fa fa-fw fa-minus"></i></a> 
														</td>

													</tr>
												</tbody>
											</table>
										</div>
									</div> 

									<div style = "clear:both">
										
									</div>
									<div class="modal-header" style = "margin-bottom:1em !important">
										
									</div>
									<div class="form-group" style = "margin-bottom:2em !important">
										<div class="col-sm-offset-4 col-sm-8">
											<button type="submit" class="btn btn-primary">Submit</button>
											<button type="submit" class="btn btn-primary">Cancel</button>
										</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/jquery.validationEngine-en.js" type="text/javascript"></script>
		<script src="<?php echo base_url();?>assets/js/jquery.validationEngine.js" type="text/javascript"></script>
		<script src="<?php echo base_url(); ?>assets/js/subscriber.js"></script>
		
		
		<script>
		$(document).ready(function() {
			$("#add_subscriber").validationEngine();
			$(".cust_select").change(function() {
		
				var intSelectedId = $("#sub_magazine").val();
				var urlToSend = "<?php echo base_url(); ?>index.php/subscriber/generate_years";
				$.ajax({
				  url: urlToSend,
				  type: 'GET',
				  data: {'intId' : intSelectedId },
				  success: function(data) {
					$("#sub_years").html(data);
				  },
				  error: function(e) {
					//called when there is an error
					//console.log(e.message);
				  }
				});
			});
		});
		</script>
