<div class="row">
	<div class="col-md-4">
		<div class="row">
			<div class="col-md-12">
				<div class="box box-info">
					<div class="box-header with-border">
						<h3 class="box-title"><?= !empty(lang('profile_pic'))?lang('profile_pic'):"Profile Picture";?></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="user_profile_img">
							<form action="<?= base_url('admin/profile/upload_profile_image'); ?>" class="upload_img" method="post" enctype= "multipart/form-data"> 
							<?php $auth_info = get_auth_info(); ?>
								<input type="hidden" name="<?= $this->security->get_csrf_token_name(); ?>" value="<?= $this->security->get_csrf_hash(); ?>">

								<label title="Upload Profile Picture">
									<?php if(empty($auth_info['thumb'])): ?>
										<div class="upload_msg">
											<i class="fa fa-upload"></i>
											<p><?= !empty(lang('profile_pic'))?lang('profile_pic'):"Upload Profile Picture";?></p>
										</div>
									<?php endif ?>
									<img src="<?= !empty($auth_info['thumb'])?base_url($auth_info['thumb']):''; ?>" class="uploaded_img" alt="">
									<input type="file" name="file[]" style="display: none;" accept="image/*">
								</label>

							</form>
							<div class="img_progress">
								<div class="upload_progress" style="display: none;">
									<div class="progress">
										<div class="progress-bar progress-bar-success progress-bar-striped myprogress" role="progressbar" style="width:0%">0%</div>
									</div>
								</div>
							</div>
						</div>
					</div><!-- /.box-body -->
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				<div class="box box-info">
					<div class="box-header with-border">
						<h3 class="box-title"><?= !empty(lang('upload_cv'))?lang('upload_cv'):"Upload Cv";?></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="user_profile_pdf">
							<form action="<?= base_url('admin/profile/upload_cv'); ?>" class="upload_pdf" method="post" enctype= "multipart/form-data"> 
								<input type="hidden" name="<?= $this->security->get_csrf_token_name(); ?>" value="<?= $this->security->get_csrf_hash(); ?>">

								<label title="upload_pdf" class="upload_label">
									<?php if(empty($home[0]['document'])): ?>
										<div class="up_pdf">
											<i class="fa fa-upload"></i>
											<p><?= !empty(lang('upload_pdf'))?lang('upload_pdf'):"Upload Pdf";?></p>
										</div>
										<?php else: ?>
											<div class="uploaded_pdf">
												<i class="fa fa-file-pdf-o" aria-hidden="true"></i>
												<h4><?= !empty(lang('upload_pdf'))?lang('upload_pdf'):"Upload Pdf";?> </h4>
												<h6><?= !empty(lang('uploaded_msg'))?lang('uploaded_msg'):"Pdf already Uploaded. Click upload again";?></h6>
												<a href="<?=  base_url('admin/profile/delete_cv')?>" class="delete_cv" title="delete pdf"><i class="fa fa-trash"></i></a>
											</div>
									<?php endif ?>
									<input type="file" name="file" style="display: none;" accept="application/pdf, application/msword">
								</label>

							</form>
							<div class="img_progress" style="width: 100%;">
								<div class="pdf_upload_progress" style="display: none;">
									<div class="progress">
										<div class="progress-bar progress-bar-success progress-bar-striped myprogress" role="progressbar" style="width:0%">0%</div>
									</div>
								</div>
							</div>
						</div>
					</div><!-- /.box-body -->
				</div>
			</div>
		</div>
	</div>
	<?php if(count($home) !=1 || (isset($s_home['id']) && $s_home['id'] != 0)): ?>
		<div class="col-md-8">
			<div class="box box-primary">
				<div class="box-header with-border">
					<h3 class="box-title"><?= !empty(lang('home_menu'))?lang('home_menu'):"Home Text";?></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_home') ?>" 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";?> <span class="error">*</span></label>
								<input type="text" name="title" id="title" class="form-control" placeholder="<?=  !empty(lang('title'))?lang('title'):"title.";?> " value="<?= !empty($s_home['title'])?html_escape($s_home['title']):set_value('title'); ?>" required>
								<span class="error"><?= form_error('title'); ?></span>
							</div>
							<div class="form-group col-md-12">
								<div class="left_label">
									<label><?= !empty(lang('designation'))?lang('designation'):"Designations";?></label>
								</div>
								<input type="text" name="designations" id="name" class="form-control" placeholder="<?= !empty(lang('designation'))?lang('designation'):"Designations";?>" value="<?= !empty($s_home['designations'])?html_escape($s_home['designations']):set_value('designations'); ?>">
							</div>
							<div class="col-md-12">
								<label><?= !empty(lang('about_me_overview'))?lang('about_me_overview'):"About Me Overview";?> <span class="error">*</span></label>
								<textarea name="about_me" id="" cols="5" rows="5" class="form-control" required=""><?= !empty($s_home['about_me'])?html_escape($s_home['about_me']):set_value('about_me'); ?></textarea>
								<span class="error"><?= form_error('about_me'); ?></span>
							</div>
							
						</div>

						<div class="row mt-15">
							<div class="col-md-12">
								<label><?= !empty(lang('about_me'))?lang('about_me'):"About Me";?></label>
								<textarea name="about_me_long" id="" cols="5" rows="5" class="form-control tinymce"><?= !empty($s_home['about_me_long'])?html_escape($s_home['about_me_long']):set_value('about_me_long'); ?></textarea>
								<span class="error"><?= form_error('about_me_long'); ?></span>
							</div>
						</div>

						<div class="row mt-15">
							<div class="col-md-12">
								<div class="social_area">

									<?php foreach ($social_sites as $site): ?>
										<?php if (isset($s_home['id'])): ?>
											<?php $user_site = get_user_social_sites(html_escape($site['id'])); ?>
										<?php endif ?>
										<label class="<?= isset($user_site['site_id']) && $user_site['site_id'] == $site['id']?"label_active":""; ?>"><input type="checkbox" <?= isset($user_site['site_id']) && $user_site['site_id'] == $site['id']?"checked":""; ?> class="social_label" name="social_sites[]" value="<?= $site['id']?>"> <?= $site['icon'];?> <?= ucfirst($site['name']); ?></label>
									<?php endforeach ?>
								</div>
							</div>
							<?php $i=1; foreach ($social_sites as $site): ?>
								<?php if (isset($s_home['id'])): ?>
									<?php $user_site = get_user_social_sites($site['id']); ?>
								<?php endif ?>
							<div class="form-group col-sm-6 col-lg-6 col-xs-12 <?= isset($user_site['site_id']) && $user_site['site_id'] == $site['id']?"":"hidden"; ?>  site_field_<?= $site['id']?>" >
								<div class="social_icon_area">
									<div class="s_icon"><?= $site['icon']?></div>
									<input type="text" name="<?= $site['id']?>" class="form-control" placeholder="Your <?= ucfirst($site['name'])?>" value="<?= !empty($user_site['site_value'])?$user_site['site_value']:set_value($site['id']); ?>">
								</div>
							</div>
							<?php $i++; endforeach ?>
						</div>

						<input type="hidden" name="id" value="<?= isset($s_home['id'])?$s_home['id']:0;?>">
					</div><!-- /.box-body -->
					<div class="box-footer" >
						<?php if(isset($s_home['id']) && $s_home['id'] !=0){ ?>
							<div class="pull-left">
								<a href="<?= base_url('admin/profile'); ?>" class="btn btn-default btn-block btn-flat"><?= !empty(lang('cancel'))?lang('cancel'):"cancel";?></a>
							</div>
						<?php } ?>
						<?php if(count($home) !=1 || (isset($s_home['id']) && $s_home['id'] != 0)): ?>
						<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>
					
						<?php endif ?>
					</div>
				</form>
			</div>
		</div>
	<?php endif;?>
	<div class="col-md-8">
		<div class="box box-info">
			<div class="box-header with-border">
				<h3 class="box-title"><?= !empty(lang('home_menu'))?lang('home_menu'):"home";?></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('title'))?lang('title'):"title";?></th>
									<th><?= !empty(lang('about_me'))?lang('about_me'):"about me";?></th>
									<th><?= !empty(lang('designation'))?lang('designation'):"designations";?></th>
									<th><?= !empty(lang('username'))?lang('username'):"username";?></th>
									<th width="20%"><?= !empty(lang('social_sites'))?lang('social_sites'):"social sites";?></th>
									<th><?= !empty(lang('action'))?lang('action'):"action";?></th>
								</tr>
							</thead>
							<tbody>
								<?php $i=1; foreach ($home as $row): ?>
									<tr>
										<td><?= $i;?></td>
										<td><?= html_escape($row['title']); ?></td>
										<td><?= html_escape($row['about_me']); ?></td>
										<td><?= html_escape($row['designations']); ?></td>
										<td><?= html_escape(get_user_info_by_id($row['user_id'])['username']); ?></td>
										<td>
											<table class="table table-bordered">
												<?php foreach ($row['my_sites'] as $site): ?>
												<tr>
													<td>
														<?php if(!empty($site['id'])): ?>
															<label class="user_social_icon"> <?= $site['icon'];?></label>
														<?php endif ?>
													</td>
													<td><a href="javascript:;" data-id="<?= html_escape($site['user_site_id']);?>" data-status="<?= html_escape($site['user_site_status']);?>" data-table="user_social_sites" class="label <?= $site['user_site_status']==1?'label-success':'label-danger'?> change_status"> <i class="fa <?= $site['user_site_status']==1?'fa-check':'fa-close'?>"></i>&nbsp; <?= $site['user_site_status']==1?(!empty(lang('live'))?lang('live'):"Live"): (!empty(lang('hide'))?lang('hide'):"Hide");?> </a> &nbsp;

														<a href="<?= base_url('admin/profile/delete_about_content/'.html_escape($site['user_site_id']).'/user_social_sites'); ?>" 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_home/'.html_escape($row['id'])); ?>" class="btn btn-info"><?= !empty(lang('edit'))?lang('edit'):"edit";?></a></td>
									</tr>
								<?php $i++; endforeach ?>
							</tbody>
						</table>
					</div>
				</div>	
			</div><!-- /.box-body -->
		</div>
	</div>
</div>
<div class="row">
	
</div>
