<div class="row">
	<div class="col-md-8">
		<div class="reg_msg"></div>
		<div class="nav-tabs-custom">
			<ul class="nav nav-tabs">
				<li class="active"><a href="#activity" data-toggle="tab"><i class="fa fa-user-circle"></i>  <?= !empty(lang('profile'))?lang('profile'):"Profile";?></a></li>
				<li><a href="#settings" data-toggle="tab"><i class="fa fa-key"></i> &nbsp;<?= !empty(lang('change_pass'))?lang('change_pass'):"Change password";?></a></li>
			</ul>
			<div class="tab-content">
				<div class="active tab-pane" id="activity">
					<!-- Post -->
					<div class="post">
						<form class="" action="<?= base_url('admin/dashboard/update_profile') ?>" method="post">

							<input type="hidden" name="<?= $this->security->get_csrf_token_name(); ?>" value="<?= $this->security->get_csrf_hash(); ?>">
							<div class="row">

								<div class="form-group col-sm-6">
									<label  class="control-label"><?= !empty(lang('username'))?lang('username'):"username";?> <span class="cross">*<?= !empty(lang('in_english'))?lang('in_english'):"Must be in English" ;?></span></label>

									<div class="">
										<input type="text" name="username" class="form-control"  placeholder="<?= !empty(lang('username'))?lang('username'):"Username";?>" value="<?= !empty($u_info->username)?$u_info->username:set_value('username'); ?>">
									</div>
								</div>

								<div class="form-group col-sm-6">
									<label  class="control-label"><?= !empty(lang('name'))?lang('name'):"name";?></label>

									<div class="">
										<input type="text" name="name" class="form-control"  placeholder="<?= !empty(lang('name'))?lang('name'):"name";?>" value="<?= !empty($u_info->name)?$u_info->name:set_value('name'); ?>">
									</div>
								</div>



								<div class="form-group col-sm-6">
									<label class=" control-label"><?= lang('country'); ?></label>

									<div class="">
										<select name="country" class="form-control select2" id="">
											<?php foreach ($countries as $key => $con): ?>
												<option value="<?= $con['id'];?>" <?= isset($u_info->country) && $u_info->country==$con['id']?"selected":"";?>><?= $con['name'];?></option>
											<?php endforeach ?>
										</select>
									
									</div>
								</div>

								<div class="form-group col-sm-6">
									<label  class="control-label"><?= !empty(lang('dial_code'))?lang('dial_code'):"dial_code";?> <span class="cross">*</span></label>

									<div class="">
										<input type="text" name="dial_code" class="form-control"  placeholder="Ex: +xxx" value="<?= !empty($u_info->dial_code)?$u_info->dial_code:set_value('dial_code'); ?>">
									</div>
								</div>
								
							</div>
							


							<div class="row">
								<div class="form-group col-sm-6">
									<label  class=" control-label"><?= !empty(lang('gender'))?lang('gender'):"gender";?></label>

									<div class="">
										<select name="gender" id="gender" class="select2 form-control">
											<option value=""><?= !empty(lang('select'))?lang('select'):"Select";?></option>
											<option <?= ($u_info->gender !='') && $u_info->gender=="Male"?$m="selected":$m=""; ?> value="Male"><?= !empty(lang('male'))?lang('male'):"Male";?></option>
											<option <?= ($u_info->gender !='') && $u_info->gender=="Female"?$m="Female":$m=""; ?> value="Female"><?= !empty(lang('female'))?lang('female'):"Female";?></option>
										</select>
									</div>
								</div>
								
							</div>
						<div class="row">
							<?php if($u_info->user_type==1):  ?>
								<div class="form-group col-sm-6">
									<label class="control-label"><?= !empty(lang('email'))?lang('email'):"email";?> <span class="cross">*</span></label>

									<div class="">
										<input type="email" class="form-control"  name="email" placeholder="<?= !empty(lang('email'))?lang('email'):"email";?>" value="<?= !empty($u_info->email)?$u_info->email:set_value('email'); ?>">

									</div>
								</div>
								<div class="form-group col-sm-6">
									<label  class="control-label"><?= !empty(lang('phone'))?lang('phone'):"phone";?> <span class="cross">*</span></label>

									<div class="">
										<input type="text" name="phone" class="form-control"  placeholder="<?= !empty(lang('phone'))?lang('phone'):"phone";?>	" value="<?= !empty($u_info->phone)?$u_info->phone:set_value('phone'); ?>">
									</div>
								</div>

								<div class="form-group col-sm-6">
									<label for="" class=" control-label"><?= !empty(lang('designation'))?lang('designation'):"Designation";?></label>

									<div class="">
										<input type="text" name="designation" class="form-control"  placeholder="<?= !empty(lang('designation'))?lang('designation'):"Designation";?>" value="<?= !empty($u_info->designation)?$u_info->designation:set_value('designation'); ?>">
									</div>
								</div>
							<?php else: ?>
								<?php if(file_exists(APPPATH.'controllers/admin/Vcard.php')): ?>
									<div class="vcfSection"  style="background: #eee; padding:0 15px 15px;">
										<h4 class="vcfHeading"><?= !empty(lang('vcf_information'))?lang('vcf_information'):"VCF (Virtual Contact File) Information"; ?></h4>
										<div class="row">
											<div class="form-group col-sm-6">
												<label for="" class=" control-label"><?= !empty(lang('display_name'))?lang('display_name'):"Display Name";?></label>

												<div class="">
													<input type="text" name="full_name" class="form-control"  placeholder="<?= !empty(lang('display_name'))?lang('display_name'):"Display Name";?>" value="<?= !empty($u_info->full_name)?$u_info->full_name:set_value('full_name'); ?>">
												</div>
											</div>
											<div class="form-group col-sm-6">
												<label for="" class=" control-label"><?= !empty(lang('designation'))?lang('designation'):"Designation";?></label>

												<div class="">
													<input type="text" name="designation" class="form-control"  placeholder="<?= !empty(lang('designation'))?lang('designation'):"Designation";?>" value="<?= !empty($u_info->designation)?$u_info->designation:set_value('designation'); ?>">
												</div>
											</div>
										</div>
										<div class="row">

											<div class="form-group col-sm-6">
												<label  class="control-label"><?= !empty(lang('phone'))?lang('phone'):"phone";?> <span class="cross">*</span></label>

												<div class="">
													<input type="text" name="phone" class="form-control"  placeholder="<?= !empty(lang('phone'))?lang('phone'):"phone";?>	" value="<?= !empty($u_info->phone)?$u_info->phone:set_value('phone'); ?>" required>
												</div>
											</div>

											<div class="form-group col-sm-6">
												<label class="control-label"><?= !empty(lang('whatsapp_number'))?lang('whatsapp_number'):"Whatsapp Number";?> <span class="cross">*</span></label>

												<div class="">
													<input type="text" class="form-control"  name="whatsapp" placeholder="<?= !empty(lang('whatsapp'))?lang('whatsapp'):"whatsapp";?>" value="<?= !empty($u_info->whatsapp)?$u_info->whatsapp:set_value('whatsapp'); ?>" required>
													
												</div>
											</div>

											<div class="form-group col-sm-6">
												<label class="control-label"><?= !empty(lang('email'))?lang('email'):"email";?> <span class="cross">*</span></label>

												<div class="">
													<input type="email" class="form-control"  name="email" placeholder="<?= !empty(lang('email'))?lang('email'):"email";?>" value="<?= !empty($u_info->email)?$u_info->email:set_value('email'); ?>" required>
													
												</div>
											</div>

											<div class="form-group col-sm-6">
												<label class=" control-label"><?= lang('website'); ?></label>

												<div class="">
													<input type="text" name="website" class="form-control" placeholder="<?= lang('website'); ?>" value="<?= !empty($u_info->website)?$u_info->website:set_value('website'); ?>">
												</div>
											</div>
										</div>
										<div class="row">
											<div class="form-group col-sm-12">
												<label  class="control-label"><?= !empty(lang('address'))?lang('address'):"address";?></label>

												<div class="">
													<textarea class="form-control"  placeholder="Address" name="address"><?= html_escape($u_info->address);?></textarea>
												</div>
											</div>
										</div>
									</div>
								<?php else: ?>
										<div class="form-group col-sm-6">
											<label class="control-label"><?= !empty(lang('email'))?lang('email'):"email";?> <span class="cross">*</span></label>

											<div class="">
												<input type="email" class="form-control"  name="email" placeholder="<?= !empty(lang('email'))?lang('email'):"email";?>" value="<?= !empty($u_info->email)?$u_info->email:set_value('email'); ?>">

											</div>
										</div>
										<div class="form-group col-sm-6">
											<label  class="control-label"><?= !empty(lang('phone'))?lang('phone'):"phone";?> <span class="cross">*</span></label>

											<div class="">
												<input type="text" name="phone" class="form-control"  placeholder="<?= !empty(lang('phone'))?lang('phone'):"phone";?>	" value="<?= !empty($u_info->phone)?$u_info->phone:set_value('phone'); ?>">
											</div>
										</div>

										<div class="form-group col-sm-6">
											<label for="" class=" control-label"><?= !empty(lang('designation'))?lang('designation'):"Designation";?></label>

											<div class="">
												<input type="text" name="designation" class="form-control"  placeholder="<?= !empty(lang('designation'))?lang('designation'):"Designation";?>" value="<?= !empty($u_info->designation)?$u_info->designation:set_value('designation'); ?>">
											</div>
										</div>
										<div class="form-group col-sm-12">
											<label  class="control-label"><?= !empty(lang('address'))?lang('address'):"address";?></label>

											<div class="">
												<textarea class="form-control"  placeholder="Address" name="address"><?= html_escape($u_info->address);?></textarea>
											</div>
										</div>
									<?php endif;?>
							<?php endif;?>
						</div>
							<div class="row mt-15">
								<div class="form-group">
									<div class="col-md-12">
										<a href="<?= base_url('admin/dashboard/profile') ?>" class="btn btn-default btn-flat"><?= !empty(lang('cancel'))?lang('cancel'):"Cancel";?></a> &nbsp;&nbsp;&nbsp;&nbsp;
										<div class="pull-right">
											<button type="submit" class="btn btn-primary btn-flat"><i class="fa fa-save"></i> &nbsp;<?= !empty(lang('save_change'))?lang('save_change'):"save change";?></button>
										</div>
									</div>
								</div>
							</div>
						</form>
					</div>
					<!-- /.post -->
				</div>

				<div class="tab-pane" id="settings">
					<form class="form-horizontal " action="<?= base_url('admin/dashboard/change_pass') ?>" method="post" id="change_pass_form">

						<input type="hidden" name="<?= $this->security->get_csrf_token_name(); ?>" value="<?= $this->security->get_csrf_hash(); ?>">


						<div class="form-group">
							<label  class="col-sm-3  control-label"><?= !empty(lang('old_pass'))?lang('old_pass'):"Old Password";?></label>
							<div class="col-sm-9">
								<input type="password" class="form-control"  name="old_pass" placeholder="<?= !empty(lang('old_pass'))?lang('old_pass'):"Old Password";?>">
							</div>
						</div>

						<div class="form-group">
							<label  class="col-sm-3 control-label"><?= !empty(lang('new_pass'))?lang('new_pass'):"New Password";?></label>
							<div class="col-sm-9">
								<input type="password" class="form-control"  name="new_pass" placeholder="<?= !empty(lang('new_pass'))?lang('new_pass'):"New Password";?>">
							</div>
						</div>

						<div class="form-group">
							<label  class="col-sm-3 control-label"><?= !empty(lang('confirm_password'))?lang('confirm_password'):"Confirm Password";?></label>
							<div class="col-sm-9">
								<input type="password" class="form-control"  name="c_pass" placeholder="<?= !empty(lang('confirm_password'))?lang('confirm_password'):"Confirm Password";?>">
							</div>
						</div>
						<div class="form-group">
							<div class="col-md-10 col-md-offset-2">
								<a href="<?= base_url('admin/dashboard/profile') ?>" class="btn btn-default btn-flat"><?= !empty(lang('cancel'))?lang('cancel'):"Cancel";?></a>
								<div class="pull-right">
									<button type="submit" class="btn btn-primary btn-flat"><i class="fa fa-save"></i> &nbsp;<?= !empty(lang('save_change'))?lang('save_change'):"Save Change";?></button>
								</div>
							</div>
						</div>
					</form>
				</div>
				<!-- /.tab-pane -->
			</div>
			<!-- /.tab-content -->
		</div>
		<!-- /.nav-tabs-custom -->
	</div>
	<div class="col-md-4">
		<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/home/upload_profile_image'); ?>" class="upload_img" 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 Profile Picture">
							<?php if(empty($u_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($u_info->thumb)?base_url($u_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>

