
<div class="row">
	<?php include 'inc/leftsidebar.php'; ?>
	<div class="col-md-6">
		<form class="setting_form validForm" action="<?= base_url('admin/dashboard/add_settings') ?>" method="post" enctype= "multipart/form-data">
			<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="col-md-2">
							<div class="form-group">
								<label><?= !empty(lang('favicon'))?lang('favicon'):"Favicon";?></label>
								<div class="">
									<label class="fav_icon image_upload_box">
										<img src="<?= !empty($setting['favicon'])?base_url($setting['favicon']):base_url('assets/images/logo-example.png') ?>" class="fav_icon_preview" alt="">
										<input type="file" name="favicon" class="load_img" id="favicon">
									</label>
									<p class="error img_error-2"><?= form_error('favicon'); ?></p>
								</div>
							</div>
						</div>
						<div class="col-md-6">
							<div class="form-group ">
								<label for=""><?= !empty(lang('site_logo'))?lang('site_logo'):"Site Logo";?></label>
								<div class="">
									<label class="image_upload_box logo">
										<img src="<?= !empty($setting['logo'])?base_url($setting['logo']):base_url('assets/images/logo-example.png'); ?>" class="service_icon_preview" alt="">
										<input type="file" name="images" class="service_img" data-height="200" data-width="400">
									</label>
								</div>

								<span class="img_error"></span>
							</div>
						</div>
					</div><!-- row -->
					<div class="row">
						<div class="col-md-12">
							<div class="form-group">
								<label for="inputName"><?= !empty(lang('languages'))?lang('languages'):"Site Language";?></label>

								<div class="language_select">

									<?php foreach ($languages as $lang): ?>
										<label class="mr-5 pointer custom-radio"><input type="radio" name="language" class="" value="<?= $lang['slug']?>" <?=!empty($setting['language']) && $setting['language'] == $lang['slug']?"checked":""; ?>> <?= $lang['lang_name'];?></label>
									<?php endforeach ?>
								</div>
							</div>
						</div>
					</div><!-- row -->
					<div class="row">
						<div class="col-md-6">
							<div class="form-group">
								<label for="inputName"><?= !empty(lang('currency'))?lang('currency'):"Currency";?> </label>
								<select name="currency" class="form-control select2" id="">
									<?php foreach ($currencies as $currency): ?>
										<option <?=!empty($setting['currency']) && $setting['currency'] == $currency['id']?"selected":""; ?> value="<?= $currency['id']; ?>"><?= $currency['name'] ;?> <?= $currency['currency_code'].' ('.$currency['currency_symbol'].' )'; ?></option>
									<?php endforeach ?>
									
								</select>
							</div>
						</div>


						<div class="col-md-6">
							<div class="form-group">
								<label for="inputName"><?= !empty(lang('time_zone'))?lang('time_zone'):"Time Zone";?></label>
								<select name="time_zone" id="time_zone" class="form-control select2">
									<?php foreach (timezone_identifiers_list() as $key => $time_zone): ?>
										<option value="<?= $time_zone ;?>" <?= $setting['time_zone']==$time_zone?"selected":"" ;?>><?=  $time_zone;?></option>
									<?php endforeach ?>
								</select>
							</div>
						</div>

						

						<div class="col-md-6">
							<div class="form-group">
								<label for="inputName"><?= !empty(lang('title'))?lang('title'):"Title";?></label>
								<div class="">
									<input type="text" name="title" placeholder="<?= !empty(lang('title'))?lang('title'):"Title";?>" class="form-control" value="<?= !empty($setting['title'])?html_escape($setting['title']):"";  ?>">
									<span class="error"><?= form_error('title'); ?></span>
								</div>
							</div>
						</div>

						<div class="col-md-6">
							<div class="form-group">
								<label for="inputName"><?= !empty(lang('site_name'))?lang('site_name'):"Site Name";?></label>
								<input type="text" name="site_name" placeholder="<?= !empty(lang('site_name'))?lang('site_name'):"Site Name";?>" class="form-control" value="<?= !empty($setting['site_name']) ?html_escape($setting['site_name']):"";  ?>" required>
								<span class="error"><?= form_error('site_name'); ?></span>
							</div>
						</div>


						<div class="col-md-6">
							<div class="form-group">
								<label class=""><?= !empty(lang('copyright'))?lang('copyright'):"Copyright";?></label>
								<div class="">
									<input type="text" name="copyright" placeholder="<?= !empty(lang('copyright'))?lang('copyright'):"Copyright";?>" class="form-control" value="<?= !empty($setting['copyright'])?html_escape($setting['copyright']):'';  ?>">
									<span class="error"><?= form_error('copyright'); ?></span>
								</div>
							</div>
						</div>

						<div class="col-md-6">
							<div class="form-group">
								<label class=""><?= !empty(lang('phone'))?lang('phone'):"phone";?></label>
								<div class="">
									<input type="text" name="phone" placeholder="<?= !empty(lang('phone'))?lang('phone'):"phone";?>" class="form-control" value="<?= !empty($setting['phone'])?html_escape($setting['phone']):'';  ?>">
									<span class="error"><?= form_error('phone'); ?></span>
								</div>
							</div>
						</div>
						<div class="form-group col-md-6">
					    	<label for=""><?= lang('demo_user_name'); ?></label>
					    	<div class="input-group">
					    		<span class="input-group-addon" title="demo_user_name"><i class="fa fa-user-circle-o"></i> <?= base_url(); ?></span>
					    		<input type="text" class="form-control" name="demo_username" autocomplete="off" placeholder="<?= lang('demo_user_name'); ?>" value="<?= !empty($setting['demo_username'])?html_escape($setting['demo_username']):'';  ?>">
					    	</div>
					    </div>
						<div class="col-md-12">
							<div class="form-group">
								<label><?= !empty(lang('overview'))?lang('overview'):"overview";?></label>
								<div class="">
									<textarea name="description" id="" placeholder="<?= !empty(lang('details'))?lang('details'):"Description";?>" class="form-control" cols="5" rows="5" maxlength="300"><?= !empty($setting['description'])?html_escape($setting['description']):'';  ?></textarea>
									<span class="error"><?= form_error('description'); ?></span>
								</div>
							</div>
						</div>

						<div class="col-md-12">
							<div class="form-group">
								<label><?= lang('details');?></label>
								<div class="">
									<textarea name="about_us" id="" placeholder="<?= !empty(lang('details'))?lang('details'):"Description";?>" class="form-control tinymce" cols="5" rows="5"><?= !empty($setting['about_us'])?html_escape($setting['about_us']):'';  ?></textarea>
									<span class="error"><?= form_error('about_us'); ?></span>
								</div>
							</div>
						</div>

						

						<div class="col-md-12">
							<div class="form-group">
								<label class=""><?= !empty(lang('google_analytics'))?lang('google_analytics'):"Google Analytics";?></label>
								<div class="">
									<textarea name="analytics" id="" placeholder="<?= !empty(lang('google_analytics'))?lang('google_analytics'):"Google Analytics";?>" class="form-control" cols="5" rows="5"><?= !empty($setting['analytics'])?base64_decode($setting['analytics']):'';  ?></textarea>
									<span class="error"><?= form_error('analytics'); ?></span>
								</div>
							</div>
						</div>

						<div class="col-md-12">
							<div class="form-group">
								<label class=""><?= !empty(lang('pricing_layout'))?lang('pricing_layout'):"Pricing layouts";?></label>
								<div class="pricingLayouts">
									<?php for ($i=1; $i <=4 ; $i++) { ?>
										<label class="custom-radio pricingLayoutsImg">
												<img src="<?= base_url("assets/images/vcard/p_{$i}.png");?>" alt="">
											<input type="radio" name="pricing_layout"  <?= $setting['pricing_layout']==$i?'checked':'';;?> class="" value="<?=  $i;?>"> 
										</label> &nbsp;  &nbsp; &nbsp; &nbsp;
									<?php  }?>
								</div>
							</div>
						</div>
					</div> <!-- row -->
				</div><!-- card-body -->
				<div class="card-footer">
					<div class="">
						<input type="hidden" name="id" value="<?= isset($setting['id'])?html_escape($setting['id']):0; ?>">
						<button type="submit" class="btn btn-primary btn-block btn-lg"><i class="fa fa-save"></i> &nbsp;<?= !empty(lang('save_change'))?lang('save_change'):"Save change";?></button>
					</div>
				</div>
			</div><!-- card -->
		</form>
	</div>
</div>
