<?php
$edit_student='';
foreach($students as $student){
	if($student->user_ID == $subscription->user_ID) {
		$edit_student = $student;
	}
}

$subscription_pack_options = array();
foreach($subscription_packs as $pack){
	$subscription_pack_options[$pack->subscription_pack_ID] = $pack->subscription_pack_name.' - Rs.'.$pack->subscription_amount;
}

?>
<br>
<div class="row">
	<div class="col-md-offset-2 col-md-6">
		<div class="panel panel-default">
			<div class="panel-heading">
				Edit Subscription
			</div>
			<div class="panel-body">
				<fieldset>
					<legend>Student:</legend>
					<div class="row">
						<div class="col-sm-3">
							<img src="<?= base_url('uploads/'.$edit_student->profile_img); ?>" class="img-responsive img-thumbnail">
						</div>
						<div class="col-sm-9">
							<p><strong>Name : </strong> <?= $edit_student->f_name.' '.$edit_student->l_name; ?></p>
							<p><strong>Username : </strong> <?= $edit_student->username; ?></p>
							<p><strong>E-mail : </strong> <?= $edit_student->email; ?></p>
							<p><strong>Phone No. : </strong> <?= $edit_student->phone_no; ?></p>
						</div>
					</div>
				</fieldset>
				<br><br>
				<?= form_open('subscription/update'); ?>
				<?= hidden_input(array('name'=>'subscription_id', 'value'=>$subscription->subscription_ID)); ?>
				<?= form_dropdown(array(
					'name'			=>'subscription_pack',
					'label'			=>'Select Subscription Pack :',
					'options'		=> $subscription_pack_options,
					'class'			=> array('form-control'=>'select2'),
					'placeholder'	=> 'Select a Subscription Pack',
					'selected'		=> $subscription->subscription_pack_ID
				)); ?>
				<?= form_submit(array('class'=>'btn-success','value'=>'Update')); ?>
				<?= form_close(); ?>
			</div>
		</div>
	</div>
</div>
