<div class="row">
	<div class="col-md-5">
		<div class="box box-primary">
			<div class="box-header with-border">
				<h3 class="box-title"><?= !empty(lang('package_pricing'))?lang('package_pricing'):"packages";?></h3>
				<div class="box-tools pull-right">
					<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
					<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button>
				</div>
			</div>
			<!-- /.box-header -->
			<form action="<?= base_url('admin/dashboard/add_pricing') ?>" method="post" class="skill_form" enctype= "multipart/form-data">
				<div class="box-body">

					<!-- csrf token -->
					<input type="hidden" name="<?= $this->security->get_csrf_token_name(); ?>" value="<?= $this->security->get_csrf_hash(); ?>">
					<div class="row">
						<div class="form-group col-md-12">
					      	<label for="type_name"><?= !empty(lang('pricing_tag'))?lang('pricing_tag'):"Features /Pricing Type";?></label>
					        <select name="type_id" class="form-control" id="">
					        	<option value=""><?= !empty(lang('select'))?lang('select'):"Select Pricing";?></option>
					        	<?php foreach ($features_type as $type): ?>
					        		<option <?= isset($data['id']) && $data['id']==$type['id']?'selected':'';?>  value="<?= html_escape($type['id']);?>"><?= html_escape($type['type_name']);?></option>
					        	<?php endforeach ?>
					        </select>
					    </div>

					    <div class="form-group col-md-12">
					      	<label for="price"><?= !empty(lang('features'))?lang('features'):"Features";?></label>
					        <div class="features">
					        	<?php $i=1; foreach($features as $row): ?>
					        		<?php if(isset($data['id'])): ?>
					        			<?php $feature_id = get_price_feature_id($row['id'],$data['id']); ?>
					        		<?php endif; ?>	
					        		<label><span><?= $i;?></span><input type="checkbox" <?= isset($feature_id['feature_id']) && $feature_id['feature_id']==$row['id']?"checked":'' ;?>  name="feature_id[]" value="<?= $row['id']?>"> <?= html_escape($row['features']); ?> </label>
					        	<?php $i++;  endforeach ?>
					        	
					        </div>
					    </div>
					</div>
				    <input type="hidden" name="id" value="<?= isset($data['id']) !=0?$data['id']:0 ?>">
				</div><!-- /.box-body -->
				<div class="box-footer">
					<?php if(isset($data['id']) && $data['id'] !=0){ ?>
						<div class="pull-left">
			          		<a href="<?= base_url('admin/dashboard/pricing'); ?>" class="btn btn-default btn-block btn-flat"><?= !empty(lang('cancel'))?lang('cancel'):"Cancel";?></a>
			          	</div>
		          <?php } ?>
		          	<div class="pull-right">
		          		<button type="submit" name="register" class="btn btn-primary btn-block btn-flat"><?= !empty(lang('submit'))?lang('submit'):"Submit";?></button>
		          	</div>
				</div>
			</form>
		</div>
	</div>
	<div class="col-md-7">
		<div class="box box-info">
			<div class="box-header with-border">
				<h3 class="box-title"><?= !empty(lang('package_pricing'))?lang('package_pricing'):"packages";?></h3>
				<div class="box-tools pull-right">
					<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
					<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button>
				</div>
			</div>
			<!-- /.box-header -->
			<div class="box-body">
				<div class="upcoming_events">
					<div class="table-responsive">
						<table class="table table-bordered">
							<thead>
								<tr>
									<th><?= !empty(lang('sl'))?lang('sl'):"Sl";?></th>
									<th><?= !empty(lang('package_pricing'))?lang('package_pricing'):"pricing";?></th>
									<th><?= !empty(lang('price'))?lang('price'):"price";?></th>
									<th><?= !empty(lang('limit'))?lang('limit'):"limit";?></th>
									<th><?= !empty(lang('type'))?lang('type'):"type";?></th>
									<th><?= !empty(lang('status'))?lang('status'):"status";?></th>
									<th><?= !empty(lang('action'))?lang('action'):"action";?></th>
								</tr>
							</thead>
							<tbody>
								<?php $i=1; foreach ($pricing as $row): ?>
									<?php if(count($row['features']) > 0): ?>
										<tr>
											<td><?= $i;?></td>
											<td><?= html_escape($row['type_name']); ?></td>
											<td><?= get_currency('icon');?> <?= html_escape($row['price']); ?></td>
											<td><?= html_escape($row['type_limit'])==0?"<span class='fz-20'>&#8734</span>":$row['type_limit']; ?></td>
											<td><?= !empty(lang($row['type']))?lang($row['type']):$row['type'];?></td>
											<td>
												<table class="table table-bordered">
													<?php foreach ($row['features'] as $value): ?>
													<tr>
														<td><?= html_escape($value['features']);?></td>
													</tr>
													<?php endforeach ?>
												</table>
											</td>
											<td>
												<a href="javascript:;" data-id="<?= html_escape($row['id']);?>" data-status="<?= html_escape($row['status']);?>" data-table="features_type" class="label <?= $row['status']==1?'label-success':'label-danger'?> change_status"> <i class="fa <?= $row['status']==1?'fa-check':'fa-close'?>"></i>&nbsp; <?= $row['status']==1?(!empty(lang('live'))?lang('live'):"Live"): (!empty(lang('hide'))?lang('hide'):"Hide");?></a>
											</td>
											<td><a href="<?= base_url('admin/dashboard/edit_pricing/'.html_escape($row['id'])); ?>" class="btn btn-info"><?= !empty(lang('edit'))?lang('edit'):"edit";?></a></td>
										</tr>
									<?php endif ?>
								<?php $i++; endforeach ?>
							</tbody>
						</table>
					</div>
				</div>	
			</div><!-- /.box-body -->
		</div>
	</div>
</div>

