<?php if(isset($_GET['p']) && $_GET['p']==2): ?>
<div class="row">
	<div class="col-lg-8">
		<?php include 'vcard_info.php'; ?>
	</div>
</div>
<div class="row">
	<div class="col-lg-8">
		<form action="<?= base_url("admin/vcards/step_2"); ?>" method="POST" class="submitForm validForm">
			<!-- csrf token -->
			<input type="hidden" name="<?= $this->security->get_csrf_token_name(); ?>" value="<?= $this->security->get_csrf_hash(); ?>">
			<div class="card">
				<div class="card-body">
					<div class="row">
						<div class="form-group col-md-6">
							<label><?= lang('name'); ?> <span class="error">*</span></label>
							<input type="text" name="name"  class="form-control" placeholder="<?= lang('name'); ?>" value="<?= !empty($data['name'])?$data['name']:set_value('name'); ?>" required>
						</div>

						<div class="form-group col-md-6">
							<label><?= !empty(lang('designation'))?lang('designation'):"Designation";?> <span class="error">*</span></label>
							<input type="text" name="designation" class="form-control"  placeholder="<?= !empty(lang('designation'))?lang('designation'):"Designation";?>" value="<?= !empty($data['designation'])?$data['designation']:set_value('designation'); ?>" required>
						</div>

						<div class="form-group col-md-6">
							<label><?= lang('country');?> <span class="error">*</span></label>
							<select name="country" class="form-control select2" id="" required>
								<?php foreach ($countries as $key => $con): ?>
									<option value="<?= $con['id'];?>" <?= isset($data['country']) && $data['country']==$con['id']?"selected":"";?>><?= $con['name'];?></option>
								<?php endforeach ?>
							</select>
						</div>

						<div class="form-group col-md-6">
							<label><?= lang('dial_code'); ?> <span class="error">*</span></label>
							<input type="text" name="dial_code" class="form-control"  placeholder="Ex: +xxx" value="<?= !empty($data['dial_code'])?$data['dial_code']:set_value('dial_code'); ?>" required>
						</div>
					</div>
					<div class="row">
						<div class="form-group col-md-6">
							<label><?= lang('phone'); ?> <span class="error">*</span></label>
							<input type="text" name="phone"  class="form-control" placeholder="<?= lang('phone'); ?>" value="<?= !empty($data['phone'])?$data['phone']:set_value('phone'); ?>" required>
						</div>
						<div class="form-group col-md-6">
							<label><?= lang('whatsapp_number'); ?> <span class="error">*</span></label>
							<input type="text" name="whatsapp"  class="form-control" placeholder="<?= lang('whatsapp_number'); ?>" value="<?= !empty($data['whatsapp'])?$data['whatsapp']:set_value('whatsapp'); ?>" required>
						</div>

						<div class="form-group col-md-6">
							<label><?= lang('email');?> <span class="error">*</span></label>
							<input type="text" name="email" class="form-control"  placeholder="<?= lang("email");?>" value="<?= !empty($data['email'])?$data['email']:set_value('email'); ?>" required>
						</div>

					</div>
					<div class="row">
						<div class="form-group col-md-12">
							<label for=""><?= lang('about_me_overview'); ?> <?= lang('max'); ?> 200 <span class="error">*</span></label>
							<textarea name="about_me_short" class="form-control" cols="5" rows="5" maxlength="200" required><?= !empty($data['about_me_short'])?$data['about_me_short']:set_value('about_me_short'); ?></textarea>
						</div>

						<div class="form-group col-md-12">
							<label for=""><?= lang('about_me_long'); ?></label>
							<textarea name="about_me_long" class="form-control tinymce" cols="5" rows="5"><?= !empty($data['about_me_long'])?$data['about_me_long']:set_value('about_me_long'); ?></textarea>

						</div>
					</div>
				</div>
				<?php if(!isset($_GET['utyp']) && $data['ref_id']!=0): ?>
					<div class="card-footer d-flex space-between text-right">
						<input type="hidden" name="id" value="<?= isset($data['id'])?$data['id']:0 ;?>">

						<a href="<?= base_url("admin/vcards/?_user_token=".md5($data['id'])."&p=1"); ?>" class="btn btn-default"><i class="icofont-double-left"></i> <?= lang('previous'); ?></a>
						<button name="submit" type="submit" class="btn btn-secondary submitBtn"><?= lang('next'); ?> <i class="icofont-double-right"></i></button>
					</div>
				<?php else: ?>
				<div class="card-footer  text-right">
					<input type="hidden" name="id" value="<?= isset($data['id'])?$data['id']:0 ;?>">
					<button name="submit" type="submit" class="btn btn-secondary submitBtn"><?= lang('next'); ?> <i class="icofont-double-right"></i></button>
				</div>
				<?php endif;?>
			</div>
		</form>
	</div><!-- col-8 -->
</div>
<?php endif;?>