<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 id="addMagezine">
			<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">Edit Magazine Details </h3>
					</div>
					<!-- // Modal heading END --> 
					<!-- Modal body -->
					<div class="modal-body">
						<div class="innerAll">
							<div class="innerLR">
								<form class="form-horizontal" role="form" id = "edit_magezine" method = "post" action = "" enctype="multipart/form-data">
								<?php $this->load->view('admin/flashdata_admin'); ?> 
									<div class="form-group mmar">
										<label  class="col-sm-3 control-label text-center">Magazine ID: </label>
										<div class="col-sm-7">
											<input type="text" class="form-control validate[required, maxSize[35], custom[onlyLetterNumber]] text-input" value="<?php echo $magezine_details['magezine_id']?>" maxlength="35" name="magezine_id" <?php if($is_subscribed > 0) {?>readonly="readonly" <?php } ?> />
										</div>

									</div>
									<div class="form-group mmar">
										<label  class="col-sm-3 control-label text-center">Upload Magazine Image: </label>
										<div class="col-sm-9">
											<input type="file" class="" name="magezine_image" />
										</div>
									</div>
									<div  class="form-group mmar">
										<label  class="col-sm-3 control-label text-center">Previous Image: </label>
										<div class="col-sm-9">
											<img src="<?php echo base_url();?>uploads/<?php echo $magezine_details['magazine_image']?>" class="img-responsive" id=""/>
											<!--<div id="preview-pane" >
												<div class="preview-container">
													<img src="<?php echo base_url();?>assets/images/avatar-large.jpg" class="img-responsive jcrop-preview" alt="Preview" />
												</div>
											</div>-->
										</div>
									</div>
									<div class="form-group mmar">
										<label  class="col-sm-3 control-label text-center">Magazine name: </label>
										<div class="col-sm-9">
											<input type="text" class="form-control validate[required, maxSize[30], custom[onlyLetterNumber]] text-input" placeholder="Magezine Name" maxlength="30" name="magezine_name" value = "<?php echo $magezine_details['name']?>" />
										</div>
									</div>
									<div class="form-group mmar">
										<label  class="col-sm-3 control-label text-center ">Category: </label>
										<div class="col-sm-9">
											<select class=" col-md-12 marl-n validate[required] cust_select" name="magezine_category">
												<option value = "">-- Select --</option>
												<?php foreach($category as $strCategory) { ?>
												<option value = "<?php echo $strCategory['id']; ?>"
												<?php if ($strCategory['id'] == $magezine_details['category']) {?> selected<?php }?>
												><?php echo $strCategory['name']; ?></option>
												<?php } ?>
											</select>
										</div>

									</div>
									<div class="form-group mmar">
										<label  class="col-sm-3 control-label text-center">Language: </label>
										<div class="col-sm-9">
											<select class="col-md-12 marl-n validate[required] cust_select" name="magezine_language">
												<option value = "">-- Select --</option>
												<?php foreach($language as $strLanguage) { ?>
												<option value = "<?php echo $strLanguage['id']; ?>"
												<?php if ($strLanguage['id'] == $magezine_details['language']) {?> selected<?php }?>
												><?php echo $strLanguage['name']; ?></option>
												<?php } ?>
											</select>
										</div>
									</div>
									<div class="form-group mmar">
										<label  class="col-sm-3 control-label text-center ">Issues per year: </label>
										<div class="col-sm-3">
											<select class=" col-md-12 marl-n validate[required] cust_select" name="magezine_issues">
												<option value= "">-- select --</option>
												<option value= "1"
												<?php if (1 == $magezine_details['issues_per_year']) {?> selected<?php }?>
												>1</option>
												<option value= "2"
												<?php if (2 == $magezine_details['issues_per_year']) {?> selected<?php }?>
												>2</option>
												<option value= "3"
												<?php if (3 == $magezine_details['issues_per_year']) {?>selected <?php }?>
												>3</option>
												<option value= "4"
												<?php if (4 == $magezine_details['issues_per_year']) {?>selected <?php }?>
												>4</option>
												<option value= "5"
												<?php if (5 == $magezine_details['issues_per_year']) {?> selected<?php }?>
												>5</option>
												<option value= "6"
												<?php if (6 == $magezine_details['issues_per_year']) {?>selected <?php }?>
												>6</option>
												<option value= "7"
												<?php if (7 == $magezine_details['issues_per_year']) {?>selected <?php }?>
												>7</option>
												<option value= "8"
												<?php if (8 == $magezine_details['issues_per_year']) {?>selected <?php }?>
												>8</option>
                                                <option value= "9"
                                                <?php if (9 == $magezine_details['issues_per_year']) {?>selected <?php }?>
                                                >9</option>
                                                <option value= "10"
                                                <?php if (10 == $magezine_details['issues_per_year']) {?>selected <?php }?>
                                                >10</option>
                                                <option value= "11"
                                                <?php if (11 == $magezine_details['issues_per_year']) {?>selected <?php }?>
                                                >11</option>
                                                <option value= "12"
                                                <?php if (12 == $magezine_details['issues_per_year']) {?>selected <?php }?>
                                                >12</option>
											</select>
										</div>
										<label  class="col-sm-3 control-label text-center">Currency: </label>
										<div class="col-sm-3">
											<select class=" col-md-12 marl-n validate[required] cust_select" name="magezine_currency" >
												<option value = "">-- Select --</option>
												<?php foreach($currency as $strCurrency) { ?>
												<option value = "<?php echo $strCurrency['id']; ?>"
												<?php if ($strCurrency['id'] == $magezine_details['currency']) {?> 
												selected <?php } ?>
												><?php echo $strCurrency['name']; ?></option>
												
												<?php } ?>
											</select>
										</div>
									</div>

									<div class="form-group">
										<label  class="col-sm-3 control-label text-center">Magazine Description: </label>
										<div class="col-sm-9">
											<textarea class="form-control validate[required] text-input"  name="magezine_desc" ><?php echo $magezine_details['description']; ?></textarea>
										</div>
									</div>
									<div class="form-group mmar">
										<!-- <label  class="col-sm-3 control-label text-center">Promotional Package: </label>
										<div class="col-sm-3">
											<select class=" col-md-12 marl-n cust_select" name="magezine_promo">
												<option value= "">-- select --</option>
												<?php //foreach($promotion as $strPromotion) { ?>
												<option value = "<?php //echo $strPromotion['id']; ?>"
												<?php //if ($strPromotion['id'] == $magezine_details['promotional_package']) {?>selected <?php //}?>
												><?php //echo $strPromotion['promo_code']; ?></option>
												<?php //} ?>
											</select>
										</div> -->
										<label  class="col-sm-3 control-label text-center">Status: </label>
										<div class="col-sm-3">
											<select class=" col-md-12 marl-n validate[required] text-input cust_select" name="magezine_status">
												<option value = "live"
												<?php if ("live" == $magezine_details['status']) {?>selected <?php }?>
												>Live</option>
												<option value = "suspended"
												<?php if ("suspended" == $magezine_details['status']) {?> selected<?php }?>
												>Suspended</option>
												<option value = "closed"
												<?php if ("closed" == $magezine_details['status']) {?>selected <?php }?>
												>Closed</option>
											</select>
										</div>
									</div>
									<div class="form-group mmar">

										<label  class="col-sm-3 control-label text-center">Subscription Amount: </label>
										<div class="col-sm-9">
											<table class="table table-white table-vertical-center margin-none table-striped footable">
												<thead>
													<tr>
														<th data-class="highlight" class="text-center">No. of Years</th>
														<th  class="text-center">Enter Amount</th>
														<th  class="text-center">Add </th>
														<th  class="text-center">Delete </th>

													</tr>
												</thead>
												<tbody>
													<?php foreach($arrSubscription as $objSubscription) {?>
													<tr>
														<td class="text-center" >
															<select class=" col-md-12 marl-n validate[required] cust_select" name="magezine_sub_no_years[]" >
																<option
																<?php if ("1" == $objSubscription['subscribe_no_years']) {?>selected <?}?>
                                                                >1</option>
																<option
																<?php if ("2" == $objSubscription['subscribe_no_years']) {?>selected <?}?>
                                                                >2</option>
																<option
																<?php if ("3" == $objSubscription['subscribe_no_years']) {?>selected <?}?>
                                                                >3</option>

															</select>
														</td>
														<td class="text-center" >
															<input type="text" class="form-control validate[required, custom[onlyNumberSp]] text-input" placeholder="Magezine Name " name="magezine_sub_amount[]" value = "<?php echo $objSubscription['amount']?>" />
														</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>
													<?php }?>
												</tbody>
											</table>
										</div>
									</div>
									<div id = "year_error" class = "year_err">
										
									</div>
									<div class="form-group">
										<div class="col-sm-offset-4 col-sm-8">
											<button type="submit" class="btn btn-primary" id ="btnSubmit">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>
		$(document).ready(function() {
			$("#edit_magezine").validationEngine();
		});
		</script>
		
