<div class="row">
	<?php if(count($home) !=1 || isset($data[0]['id']) && $data[0]['id'] != 0): ?>
		<div class="col-md-6">
			<div class="box box-primary">
				<div class="box-header with-border">
					<h3 class="box-title"><?= !empty(lang('about_me'))?lang('about_me'):"About Me";?></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/profile/add_about') ?>" 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="title"><?= !empty(lang('title'))?lang('title'):"title";?></label>
						        <p><?= !empty($my_info['title'])?html_escape($my_info['title']):"";?></p>
						    </div>
						    <div class="col-md-12">
								<label><?= !empty(lang('about_me'))?lang('about_me'):"About Me";?></label>
								<p><?= !empty($my_info['about_me'])? html_escape($my_info['about_me']):"";?></p>
							</div>
						</div>

						<div class="row">
						    <div class="col-md-12">
								<label><?= !empty(lang('image'))?lang('image'):"Image";?></label>
								<div class="preview_load_image about" style="display: <?= isset($data[0]['images']) && !empty($data[0]['images'])?"block":"none"?>;">
									<img src="<?= isset($data[0]['images']) && !empty($data[0]['images'])?base_url($data[0]['images']):''; ?>" id="preview_load_image" alt="">
								</div>
								<input type="file" id="load_image" name="images">
							</div>
						</div>

						<div class="mt-15">
							<div class="form-group about_me_group">
								<div class="left_label">
									<label><?= !empty(lang('full_name'))?lang('full_name'):"Full Name";?></label>
								</div>
								<input type="text" name="full_name" id="name" class="form-control" placeholder="<?= !empty(lang('full_name'))?lang('full_name'):"Full Name";?>" value="<?= isset($data[0]['full_name']) && !empty(html_escape($data[0]['full_name']))?html_escape($data[0]['full_name']):"" ?>">
							</div>
							
							<div class="form-group about_me_group">
								<div class="left_label">
									<label><?= !empty(lang('nationality'))?lang('nationality'):"Nationality";?></label>
								</div>
								<input type="text" name="nationality" id="name" class="form-control" placeholder="<?= !empty(lang('nationality'))?lang('nationality'):"Nationality";?>" value="<?= isset($data[0]['nationality']) && !empty(html_escape($data[0]['nationality']))?html_escape($data[0]['nationality']):set_value('nationality'); ?>">
							</div>
						
							<div class="form-group about_me_group">
								<div class="left_label">
									<label><?= !empty(lang('dob'))?lang('dob'):"Date of Birth";?></label>
								</div>
								<div class="input-group date">
				                   <input type="text" name="dob" id="dob" class="form-control datepicker" placeholder="yyyy-mm-dd" value="<?= isset($data[0]['dob']) && !empty(html_escape($data[0]['dob']))?html_escape($data[0]['dob']):set_value('dob'); ?>">
				                   <div class="input-group-addon">
				                    	<i class="fa fa-calendar"></i>
				                  	</div>
				                </div>
							</div>
							<!-- tes tambah tercatat
							<div class="form-group about_me_group">
								<div class="left_label">
									<label><= !empty(lang('member_since'))?lang('member_since'):"Member_since";?></label>
								</div>
								<input type="text" name="dated_on" id="name" class="form-control" placeholder="<= !empty(lang('member_since'))?lang('member_since'):"Member_since";?>" readonly value="<= isset($data[0]['member_since']) && !empty(html_escape($data[0]['member_since']))?html_escape($data[0]['member_since']):set_value('member_since'); ?>">
							</div>
						    -->
							<?php if(isset($data[0]['id'])): ?>
								<?php foreach ($data[0]['about_content'] as $value): ?>
									<div class="form-group about_me_group">
										<input type="text" name="label_ex[]" id="name" class="form-control mr-10" value="<?= html_escape($value['label']);?>" placeholder="<?= !empty(lang('label'))?lang('label'):"label";?>">
										<input type="text" name="value_ex[]" id="value" class="form-control " value="<?= html_escape($value['value']);?>" placeholder="<?= !empty(lang('value'))?lang('value'):"value";?>">
									</div>
									<input type="hidden" name="ex_id[]" value="<?= isset($value['id']) && $value['id']!=0?$value['id']:0; ?>">
								<?php endforeach ?>
							<?php else: ?>
								<div class="form-group about_me_group">
									<input type="text" name="label[]" id="name" class="form-control mr-10" placeholder="<?= !empty(lang('title'))?lang('title'):"title";?>">

									<input type="text" name="value[]" id="value" class="form-control " placeholder="<?= !empty(lang('value'))?lang('value'):"value";?>">
								</div>
							<?php endif ?>
								<div class="input_fields_wrap"></div>
								<div class="pull-right">
									<a href="javascript:;"  class="btn add_field_button"><?= !empty(lang('add_new'))?lang('add_new'):"Add New";?></a>
								</div>
						</div>
					    <input type="hidden" name="id" value="<?= isset($data[0]['id'])?$data[0]['id']:0;?>">
					</div><!-- /.box-body -->
					<div class="box-footer" >
						<?php if(isset($data[0]['id']) && $data[0]['id'] !=0){ ?>
							<div class="pull-left">
				          			<a href="<?= base_url('admin/profile/about'); ?>" 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>
	<?php endif;?>
	<div class="col-md-6">
		<div class="box box-info">
			<div class="box-header with-border">
				<h3 class="box-title"><?= !empty(lang('about_me'))?lang('about_me'):"about me";?></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('image'))?lang('image'):"image";?></th>
									<th><?= !empty(lang('name'))?lang('name'):"name";?></th>
									<th><?= !empty(lang('content'))?lang('content'):"content";?></th>
									<th><?= !empty(lang('action'))?lang('action'):"action";?></th>
								</tr>
							</thead>
							<tbody>
								<?php $i=1; foreach ($home as $row): ?>
									<tr>
										<td><?= $i;?></td>
										<td> <div class="serviceImgs"><img src="<?= base_url($row['images'])?>" alt=""></div></td>
										<td><?= html_escape($row['full_name']); ?></td>
										<td>
											<table class="table table-bordered">
												<?php foreach ($row['about_content'] as $value): ?>
												<tr>
													<td><?= $value['label']?></td>
													<td><?= $value['value']?></td>
													<td>
														<a href="javascript:;" data-id="<?= html_escape($value['id']);?>" data-status="<?= html_escape($value['status']);?>" data-table="about_content" class="label <?= $value['status']==1?'label-success':'label-danger'?> change_status"> <i class="fa <?= $value['status']==1?'fa-check':'fa-close'?>"></i>&nbsp; <?= $value['status']==1?(!empty(lang('live'))?lang('live'):"Live"): (!empty(lang('hide'))?lang('hide'):"Hide");?></a>
															<a href="<?= base_url('admin/profile/delete_about_content/'.html_escape($value['id']).'/about_content'); ?>" class="label label-danger action_btn" data-msg="<?= !empty(lang('want_to_delete'))?lang('want_to_delete'):'Want to delete?' ;?>"><i class="fa fa-trash"></i> <?= !empty(lang('delete'))?lang('delete'):"Delete";?></a>
													</td>
												</tr>
												<?php endforeach ?>
											</table>
										</td>
										<td><a href="<?= base_url('admin/profile/edit_about/'.html_escape($row['id'])); ?>" class="btn btn-info"><i class="fa fa-edit"></i> <?= !empty(lang('edit'))?lang('edit'):"edit";?></a></td>
									</tr>
								<?php $i++; endforeach ?>
							</tbody>
						</table>
					</div>
				</div>	
			</div><!-- /.box-body -->
		</div>
	</div>
</div>
