<!--begin::Card-->
<div class="card card-custom gutter-b example example-compact">
	<div class="card-header">
		<h3 class="card-title"><?=$form_heading?></h3>
	</div>
	<?=form_open_multipart('',['class'=>'form','onsubmit'=>'blockPage()'])?>
		<div class="card-body">
			<div class="form-group row">
				<label class="col-lg-1 col-form-label text-lg-right">Name</label>
				<div class="col-lg-5">
					<input type="text" name="name" id="name" value="<?=set_value('name',$update_data['name'] ?? '')?>" class="form-control" placeholder="Name" required />					
					<?=$validation->showError('name')?>
				</div>
				<label class="col-lg-1 col-form-label text-lg-right">Image</label>
				<div class="col-lg-2">
					<div class="custom-file">
						<input type="file" class="custom-file-input" id="image" name="image" accept=".png,.jpg,.gif,jpeg" value="<?=set_value('image',$update_data['image'] ?? '')?>"/>
						<label class="custom-file-label" for="image">Choose file</label>
					</div>
					<?=$validation->showError('image')?>
			      
			  <?php $uploaded_image = set_value('uploaded_image',$update_data['image'] ?? ''); ?>
					<input type="hidden" name="uploaded_image" id="uploaded_image" value="<?=set_value('uploaded_image',$uploaded_image)?>" />
					<?php if($uploaded_image!=""){ ?>
						<div class="text-primary"><a href="<?=base_url('public/uploads/'.$uploaded_image)?>"  target="_blank">View uploaded</a></div>					
					<?php } ?>
				</div>
				<label class="col-lg-1 col-form-label text-lg-right">Status</label>
				<div class="col-lg-2">
					<select name="status" id="status" class="form-control" required>
						<?=$cmObj->get_status_type(set_value('status',($update_data['status'] ?? 'Active')))?>
					</select>
					<?=$validation->showError('status')?>
				</div>								
			</div>
			<div class="form-group row">
				<label class="col-lg-1 col-form-label text-lg-right">Occupation</label>
				<div class="col-lg-5">
					<input type="text" name="occupation" id="occupation" value="<?=set_value('occupation',$update_data['occupation'] ?? '')?>" class="form-control" placeholder="Occupation" />					
					<?=$validation->showError('occupation')?>
				</div>
			    <label class="col-lg-1 col-form-label text-lg-right">Review</label>
				<div class="col-lg-2">
					<select name="review" id="review" class="form-control" required>
						<?=$cmObj->get_review_type_options(set_value('review',($update_data['review'] ?? '')))?>
					</select>
					<?=$validation->showError('review')?>
				</div>
				<label class="col-lg-1 col-form-label text-lg-right">Star Rating</label>
				<div class="col-lg-2">
					<input type="number" step="0.5" name="star_rating" id="star_rating" value="<?=set_value('star_rating',$update_data['star_rating'] ?? '0')?>" class="form-control" placeholder="Star Rating out of 5" required />					
					<?=$validation->showError('star_rating')?>
				</div>				
			</div>
			<div class="form-group row">
				<label class="col-lg-1 col-form-label text-lg-right">Description</label>
				<div class="col-lg-11">
					<textarea name="description" id="description" class="form-control" placeholder="Description"><?=set_value('description',$update_data['description'] ?? '')?></textarea>					
					<?=$validation->showError('description')?>
				</div>
			</div>			
		</div>
		<div class="card-footer">
			<div class="row">
				<div class="col-lg-12 text-center">
					<button type="submit" name="save" value="Save" class="btn btn-primary mr-2">Save</button>
				</div>
			</div>
		</div>
	</form>
</div>