<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.22/pdfmake.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js"></script>

<div class="row">
	<div class="col-md-6">
		<div class="box box-primary">
			<div class="box-header with-border">
				<h3 class="box-title"><?= !empty(lang('social_sites'))?lang('social_sites'):"social sites";?></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_social_sites') ?>" method="post" class="validForm">
				<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-6">
					      	<label for="title"><?= !empty(lang('name'))?lang('name'):"name";?></label>
					        <input type="text" name="name" id="title" class="form-control" placeholder="<?= !empty(lang('name'))?lang('name'):"name";?>" value="<?= isset($data['name'])?html_escape($data['name']):set_value('name'); ?>" required>
					        <span class="error"><?= form_error('name'); ?></span>
					    </div>

					    <div class="form-group col-md-6">
					      	<label for="title"><?= !empty(lang('type'))?lang('type'):"type";?></label>
					        <select name="type" class="form-control">
					        	<option value=""><?= !empty(lang('select'))?lang('select'):"select";?></option>
					        	<option value="email" <?= !empty($data['type']) && $data['type']=="email"?"selected":""; ?>> <?= !empty(lang('email'))?lang('email'):"Email";?></option>

					        	<option value="phone" <?= !empty($data['type']) && $data['type']=="phone"?"selected":""; ?>> <?= !empty(lang('phone'))?lang('phone'):"Phone";?></option>
					        	<option value="whatsapp" <?= !empty($data['type']) && $data['type']=="whatsapp"?"selected":""; ?>><?= !empty(lang('whatsapp'))?lang('whatsapp'):"Whatsapp";?></option>
					        	
					        </select>
					    </div>

					    <div class="form-group col-md-12">
					      	<label for="title"><?= !empty(lang('icon'))?lang('icon'):"icon";?> &nbsp; <a href="https://fontawesome.com/v4.7.0/icons/" target="blank"><i class="fa fa-question-circle"></i></a></label>
					      	<div class="iconPickerdiv mb-10">
					      		<button class="input-group iconGroup btn btn-default" data-icon="<?= get_icon(!empty($data['icon'])?$data['icon']:'');?>" data-iconset="fontawesome5" role="iconpicker">
					      		</button>
					      	</div>
					      <p><?= lang('or'); ?></p>
					      <div class="mt-10">
					      	  <input type="text" name="icon" id="title" class="form-control icon" placeholder='<i class"fa fa-icon"></i>' value='<?= isset($data['icon'])?$data['icon']:set_value('icon'); ?>' required>
					      </div>
					    </div>

					    <div class="form-group col-md-12">
					      	<label class="pointer custom-checkbox"> <input type="checkbox" class=""  name="is_profile" <?= !empty($data['is_profile']) && $data['is_profile']=="1"?"checked":""; ?>> &nbsp; <?= !empty(lang('is_profile'))?lang('is_profile'):"Is Profile";?>
					      		
					      	</label>

					      	
					    </div>
					   
					</div>

				    <input type="hidden" name="id" value="<?= isset($data['id']) && $data['id']!=0?$data['id']:0; ?>">
				</div><!-- /.box-body -->
				<div class="box-footer" >
					<div class="pull-left">
		          			<a href="<?= base_url('admin/dashboard/social_sites'); ?>" class="btn btn-default btn-block btn-flat"><?= !empty(lang('cancel'))?lang('cancel'):"cancel";?></a>
		          	</div>
		          	<div class="pull-right">
		          		<button type="submit" class="btn btn-primary btn-block btn-flat"><?= !empty(lang('submit'))?lang('submit'):"submit";?></button>
		          	</div>
				</div>
			</form>
		</div>
		<div class="single_alert alert alert-info alert-dismissible">
			<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
			<div class="d_flex_alert ">
				<h4><i class="fas fa-exclamation-triangle"></i> <?= !empty(lang('info'))?lang('info'):"Info!";?></h4>
				<div class="double_text">
					<div class="text-left">
						<p><b><?= lang('select_icon_from_icon_library');?></b></p>
						<p><b><?= lang('or_add_icon_in_the_icon_field'); ?></b></p>
						<p><?= lang('icon_code_can_get_from'); ?> <b><u> <a href="https://fontawesome.com/v4.7.0/icons/" target="blank" class="ml-5"><i class="fa fa-info-circle"></i> <?= lang('here'); ?></a></u></b></p>
					</div>

				</div>
			</div>
		</div>
	</div>
	<div class="col-md-6">
		<div class="single_alert alert alert-danger alert-dismissible">
			<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
			<div class="d_flex_alert ">
				<h4><i class="fas fa-exclamation-triangle"></i> <?= !empty(lang('info'))?lang('info'):"Info!";?></h4>
				<div class="double_text">
					<div class="text-left">
						<p><b><?= lang('those_icons_are_used_only_for_profile_vcard');?></b></p>
					</div>

				</div>
			</div>
		</div>
		<div class="box box-info">
			<div class="box-header with-border">
				<h3 class="box-title"><?= !empty(lang('social_sites'))?lang('social_sites'):"Social sites";?></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('name'))?lang('name'):"name";?></th>
									<th><?= !empty(lang('type'))?lang('type'):"type";?></th>
									<th><?= !empty(lang('icon'))?lang('icon'):"icon";?></th>
									<th><?= !empty(lang('icon_for'))?lang('icon_for'):"icon for";?></th>
									<th><?= !empty(lang('status'))?lang('status'):"status";?></th>
									<th><?= !empty(lang('action'))?lang('action'):"action";?></th>
								</tr>
							</thead>
							<tbody>
								<?php $i=1; foreach ($social_sites as $row): ?>
									<tr>
										<td><?= $i;?></td>
										<td><?= $row['name'] ?></td>
										<td><?= $row['type'] ?></td>
										<td><?= $row['icon'] ?></td>
										<td>
											<?php if($row['is_profile']==1): ?>
												<label class="label label-default"><?= !empty(lang('profile'))?lang('profile'):"profile";?></label>
											<?php else: ?>
												<label class="label label-primary"><?= !empty(lang('other'))?lang('other'):"others";?></label>
											<?php endif; ?>
											</td>
										<td>
											<a href="javascript:;" data-id="<?= html_escape($row['id']);?>" data-status="<?= html_escape($row['status']);?>" data-table="social_sites" 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_social/'.html_escape($row['id'])); ?>" class="btn btn-info btn-sm"> <i class="fa fa-edit"></i> <?= !empty(lang('edit'))?lang('edit'):"edit";?></a>
											<a href="<?= base_url('admin/dashboard/item_delete/'.html_escape($row['id']).'/social_sites '); ?>" class="btn btn-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 $i++; endforeach ?>
							</tbody>
						</table>
					</div>
				</div>	
			</div><!-- /.box-body -->
		</div>
	</div>
</div>

