<!DOCTYPE html>
<html lang="en">
<head>
	<!-- header -->
		<?php 
		$session = session();
		helper('form');
		echo view('admin/common_header'); ?>
	<!-- /header -->


	<!-- file upload JS files -->
	<script type="text/javascript" src="<?php echo base_url('assets/js/plugins/uploaders/fileinput.min.js');?>"></script>
	<!-- date picker JS files -->
	<script type="text/javascript" src="<?php echo base_url('assets/js/core/libraries/jquery_ui/interactions.min.js');?>"></script>
	<script type="text/javascript" src="<?php echo base_url('assets/js/core/libraries/jquery_ui/widgets.min.js');?>"></script>
	<script type="text/javascript" src="<?php echo base_url('assets/js/core/libraries/jquery_ui/effects.min.js');?>"></script>
	<script type="text/javascript" src="<?php echo base_url('assets/js/plugins/extensions/mousewheel.min.js');?>"></script>
	<script type="text/javascript" src="<?php echo base_url('assets/js/core/libraries/jquery_ui/globalize/globalize.js');?>"></script>

	<!-- Bootsrap swith and validation css files -->	
	<link href="<?php echo base_url('assets/boots/css/bootstrap-switch.css');?>" rel="stylesheet" type="text/css">
	<link href="<?php echo base_url('assets/boots/css/formValidation.min.css');?>" rel="stylesheet" type="text/css">
	
	<!-- Bootsrap form validation JS files -->
	<script type="text/javascript" src="<?php echo base_url('assets/js/formValidation.js');?>"></script>
	<script type="text/javascript" src="<?php echo base_url('assets/js/bootstrap.js');?>"></script>
	

	<!-- Theme JS files -->
	<script type="text/javascript" src="<?php echo base_url('assets/js/core/app.js');?>"></script>
	<!-- /theme JS files -->

	<!-- date picker JS files 
	<script type="text/javascript" src="<?php echo base_url();?>assets/js/pages/jqueryui_forms.js"></script>-->

	<!-- file upload JS files -->
	<script type="text/javascript" src="<?php echo base_url('assets/boots/js/fileinput.min.js');?>"></script>
	
	<!-- bootsrap switch checkbox JS files -->
    <script src="<?php echo base_url('assets/boots/js/bootstrap-switch.js');?>"></script>

    <!-- notify JS files -->
    <script type="text/javascript" src="<?php echo base_url('assets/js/plugins/notifications/jgrowl.min.js');?>"></script>

    <!-- ckeditor JS files -->
    <script src="https://cdn.ckeditor.com/4.4.3/basic/ckeditor.js"></script>
	<script src="<?php echo base_url('assets/boots/js/jquery.js');?>"></script>

	<style>
	/*.kv-file-content img.file-preview-image {
    	width: 150px !important;
    }*/
	</style>


</head>

<body class="navbar-top-md-md">
	<!-- <div class="pre_loader"></div> -->
	<!-- Fixed navbars wrapper -->
	<div class="navbar-fixed-top">

		<!-- Main navbar -->
		<?php echo view('admin/mainnav'); ?>
		<!-- /main navbar -->


		<!-- Second navbar -->
		<?php echo view('admin/secondnav'); ?>
		<!-- /second navbar -->

	</div>
	<!-- /fixed navbars wrapper -->


	<!-- Page header -->
	<div class="page-header">
		<div class="page-header-content">
			<div class="page-title">
				<h4><i id="icon-bck" class="icon-arrow-left52 position-left"></i> <span class="text-semibold"><?php echo lang('language_lang.site_page_title'); ?></span></h4>

				<ul class="breadcrumb breadcrumb-caret position-right">
					<?php foreach ($breadcrumbs as $breadcrumb) { if(isset($breadcrumb['href'])){?>
					    <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>
					<?php } else { ?> <li><?php echo $breadcrumb['text']; ?></li><?php } } ?>
				</ul>
			</div>
			<?php echo view('admin/'.$module_name.'_header'); ?>
		</div>
	</div>
	<!-- /page header -->
<style>
    
    .file-preview-image
    {
        height:200px !important;
    }
</style>

	<!-- Page container -->
	<div class="page-container">

		<!-- Page content -->
		<div class="page-content">

			<!-- Main content -->
			<div class="content-wrapper">

				<!-- Horizontal form -->
				<div class="panel panel-flat">
					<div class="panel-heading">
						<h5 class="panel-title"><?php echo lang('language_lang.site_page_title'); ?></h5>
						<div class="heading-elements">
							<ul class="icons-list">
		                		<li><a data-action="collapse"></a></li>
		                		<li><a data-action="close"></a></li>
		                	</ul>
	                	</div>
                	</div>
                	
					<div class="panel-body">
						<form class="form-horizontal sitesetting" action="<?php echo site_url($action);?>" method="post" enctype="multipart/form-data">
							<?php 
							$validation = \Config\Services::validation();
								if($validation->listErrors()) { 
									$form_err_data = str_ireplace('<p>', '', $validation->listErrors());
									$form_err_data = str_ireplace('</p>', '', $form_err_data);
									$form_err_data = str_ireplace('.', '', $form_err_data);
								}
							?>
							
							<div class="form-group  <?php if($validation->getError('name')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.label_sitename'); ?> <span class="text-danger">*</span></label>
								<div class="col-lg-6">
									<div class="input-group">
										<span class="input-group-addon"><i class="icon-graduation"></i></span>
										<input type="text" name="name" id="name" class="form-control" placeholder="<?php echo lang('language_lang.place_site_name'); ?>" value="<?php echo set_value('name',isset($this->data['site_name']) ? $this->data['site_name'] : ''); ?>">
									</div>
									<?php echo $validation->getError('name', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
								</div>
							</div>

							<div class="form-group   <?php if($validation->getError('url')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.label_siteurl'); ?> <span class="text-danger">*</span></label>
								<div class="col-lg-6">
									<div class="input-group">
										<span class="input-group-addon"><i class="icon-hyperlink"></i></span>
										<input type="text" name="url" class="form-control"  placeholder="<?php echo lang('language_lang.place_site_url'); ?>" value="<?php echo set_value('url',isset($this->data['site_url']) ? $this->data['site_url'] : ''); ?>">
									</div>
									<?php echo $validation->getError('url', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
								</div>
							</div>

							<div class="form-group  <?php if($validation->getError('logo')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.label_sitelogo'); ?> <span class="text-danger">*</span></label>
								
								<div class="col-lg-6">
									<div>
										<input type="file" name="logo" class="file-input-extensions" value="<?php echo set_value('logo', isset($this->data['site_logo']) ? $this->data['site_logo'] : '' ); ?>">
									</div>
									<span class="help-block"><?php echo lang('language_lang.site_logo_extension');?></span>
									<?php echo $validation->getError('logo', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
								</div>
							</div>

							<div class="form-group  <?php if($validation->getError('start_date')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.label_start_date'); ?> <span class="text-danger">*</span></label>
								<div class="col-lg-6">
									<div class="input-group">
										<span class="input-group-addon"><i class="icon-calendar22"></i></span>
										<input type="text" class="form-control datepicker" placeholder="<?php echo lang('language_lang.label_start_date'); ?>" name="start_date" value="<?php echo set_value('start_date',isset($this->data['site_start_date']) ? date('Y-m-d', strtotime($this->data['site_start_date'])) : ''); ?>">
									</div>
								</div>
								<?php echo $validation->getError('start_date', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
							</div>

							<div class="form-group  <?php if($validation->getError('meta_title')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.label_meta_title'); ?> <span class="text-danger">*</span></label>
								<div class="col-lg-6">
									<div class="input-group">
										<span class="input-group-addon"><i class="icon-graduation"></i></span>
										<input type="text" name="meta_title" class="form-control"  placeholder="<?php echo lang('language_lang.label_meta_title'); ?>" value="<?php echo set_value('meta_title',isset($this->data['site_meta_title']) ? $this->data['site_meta_title'] : ''); ?>">
									</div>
								</div>
								<?php echo $validation->getError('meta_title', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
							</div>

	                        <!-- Text Area -->
							<div class="form-group <?php if($validation->getError('meta_key')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.label_meta_key'); ?> <span class="text-danger">*</span></label>
								<div class="col-lg-6">
									<textarea rows="5" name="meta_key" cols="5" class="form-control" placeholder="<?php echo lang('language_lang.label_meta_key'); ?>"><?php echo set_value('meta_key',isset($this->data['site_meta_key']) ? $this->data['site_meta_key'] : ''); ?></textarea>
									<?php echo $validation->getError('meta_key', '<span class="help-block">', '</span>'); ?>
								</div>
							</div>
							<!-- /Text Area -->

							<!-- Text Area -->
							<div class="form-group <?php if($validation->getError('meta_description')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.label_meta_decription'); ?> <span class="text-danger">*</span></label>
								<div class="col-lg-6">
									
										<textarea rows="5" name="meta_description" cols="5" class="form-control" placeholder="<?php echo lang('language_lang.label_meta_decription'); ?>"><?php echo set_value('meta_description',isset($this->data['site_meta_description']) ? $this->data['site_meta_description'] : ''); ?></textarea>
									
									<?php echo $validation->getError('meta_description', '<span class="help-block">', '</span>'); ?>
								</div>
							</div>
							<!-- /Text Area -->

							<!-- Text Area -->
							<div class="form-group <?php if($validation->getError('analytical_code')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.label_analytical_code'); ?> <span class="text-danger">*</span></label>
								<div class="col-lg-6">
									
										<textarea rows="5" name="analytical_code" cols="5" class="form-control" placeholder="<?php echo lang('language_lang.label_analytical_code'); ?>"><?php echo set_value('analytical_code',isset($this->data['site_analytical_code']) ? $this->data['site_analytical_code'] : ''); ?></textarea>
									
									<?php echo $validation->getError('analytical_code', '<span class="help-block">', '</span>'); ?>
									<span style="color:red;"> (Note: Don't include script tag . Only add inner content)</span>
								</div>
							</div>

							<!-- /Text Area -->

							<!-- Text Area -->
							<div class="form-group <?php if($validation->getError('live_chat_code')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.label_live_chat_code'); ?> <span class="text-danger">*</span></label>
								<div class="col-lg-6">
									<textarea rows="5" name="live_chat_code" cols="5" class="form-control" placeholder="<?php echo lang('language_lang.label_live_chat_code'); ?>"><?php echo set_value('live_chat_code',isset($this->data['site_live_chat_code']) ? $this->data['site_live_chat_code'] : ''); ?></textarea>
									<?php echo $validation->getError('live_chat_code', '<span class="help-block">', '</span>'); ?>
									<span style="color:red;"> (Note: Don't include script tag . Only add inner content)</span>
								</div>
							</div>
							<!-- /Text Area -->

							<?php 
								if(isset($site_status)) {
									// echo $site_status;
									$status = $site_status;
								} else {
									$status = '';
								}
							?>
							<!-- Switch single -->
							<div class="form-group <?php if($validation->getError('status')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.label_site_status'); ?> </label>
								<div class="col-lg-6">
									<div class="checkbox checkbox-switch">
										<label>
											<input type="checkbox" <?php if($status=='on'){echo 'checked="checked"';}?> name="status" data-on-color="success" data-off-color="danger" data-on-text="<?php echo lang('language_lang.Online');?>" data-off-text="<?php echo lang('language_lang.Offline');?>" class="switchery">
										</label>
									</div>
									<?php echo $validation->getError('status', '<label class="validation-error-label">', '</label>'); ?>
								</div>
							</div>
							<!-- /switch single -->

							<!-- <input id="TheCheckBox2" name="status" class="switchery" type="radio" data-on-text="Online" <?php if($site_status==='on'){ echo 'checked="checked"'; } else { echo 'style="display:none"'; } ?> >
							<input id="TheCheckBox3" name="status" class="switchery" type="radio" data-off-text="Offline" <?php if($site_status==='off'){ echo 'checked="checked"'; } else { echo 'style="display:none"'; }?> > -->

							<!-- Text Area -->
							<div class="form-group <?php if($validation->getError('offline_msg')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.label_offline_msg'); ?> <span class="text-danger">*</span></label>
								<div class="col-lg-6">
									
										<!-- <textarea rows="5" name="offline_msg" cols="5" class="form-control" placeholder="<?php echo $lbl_offline_msg; ?>"><?php echo set_value('offline_msg',isset($this->data['site_offline_msg']) ? $this->data['site_offline_msg'] : ''); ?></textarea> -->
										<textarea name="offline_msg" rows="2" cols="5" class="form-control" placeholder="<?php echo lang('language_lang.label_offline_msg'); ?>"><?php echo set_value('offline_msg',isset($this->data['site_offline_msg']) ? $this->data['site_offline_msg'] : ''); ?></textarea>
									
									<?php echo $validation->getError('offline_msg', '<span class="help-block">', '</span>'); ?>	
								</div>

							</div>
							<!-- /Text Area -->

							<div class="form-group  <?php if($validation->getError('favicon')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.site_fav_icon_lbl'); ?> <span class="text-danger">*</span></label>
								
								<div class="col-lg-6">
									<div>
										<input type="file" name="favicon" class="file-input-extensions1" value="<?php echo set_value('favicon', isset($this->data['site_favicon']) ? $this->data['site_favicon'] : '' ); ?>">
									</div>
									<span class="help-block"><?php echo lang('language_lang.fav_pic_extension');?></span>
									<?php echo $validation->getError('favicon', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
								</div>
							</div>

							<div class="form-group  <?php if($validation->getError('sitecoin')) echo "has-error";?>" style='display:none;'>
								<label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.site_coin_icon_lbl'); ?> <span class="text-danger">*</span></label>
								
								<div class="col-lg-6">
									<div>
										<input type="file" name="sitecoin" class="file-input-extensions3" value="<?php echo set_value('sitecoin', isset($this->data['site_coin']) ? $this->data['site_coin'] : '' ); ?>">
									</div>
									<span class="help-block"><?php echo lang('language_lang.site_coin_extension');?></span>
									<?php echo $validation->getError('sitecoin', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
								</div>
							</div>

							<div class="form-group  has-feedback <?php if($validation->getError('interest_type')) echo "has-error";?>" style="display:none;">
                                <label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.interest_type'); ?>  </label>
								<div class="col-lg-4">
									<select id="interest_type" name="site_interest_type" class="bootstrap-select form-control">
										<option value="simple" <?php echo ($site_interest_type == 'simple') ?  "selected" : "" ;  ?>><?php echo lang('language_lang.label_simple_interest'); ?></option>
										<option value="variable" <?php echo ($site_interest_type == 'variable') ?  "selected" : "" ;  ?>><?php echo lang('language_lang.label_variable_interest'); ?></option>
									</select>
									<?php echo $validation->getError('interest_type', '<div style="right:20px;" class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
								</div>
							</div>

							<div class="form-group  <?php if($validation->getError('white')) echo "has-error";?>" style='display:none;'>
								<label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.site_white_pap_lbl'); ?> <span class="text-danger">*</span></label>
								
								<div class="col-lg-6">
									<div>
										<input type="file" name="white" class="file-input-extensions2" value="<?php echo set_value('white', isset($this->data['whitepaper']) ? $this->data['whitepaper'] : '' ); ?>">
									</div>

									<span class="help-block"><?php echo lang('language_lang.site_white_extension');?></span>
									<?php echo $validation->getError('white', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
								</div>

								<?php 
								if(isset($this->data['whitepaper']))
								{
									?>
									<a href="<?php echo base_url();?>content/site/<?php echo $this->data['whitepaper'];?>" target="_blank">(<?php echo lang('language_lang.site_white_view'); ?>)</a>
									<?php
									
								}

								?>

							</div>

							<div class="form-group  <?php if($validation->getError('captcha_key')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.label_siteckey'); ?> <span class="text-danger">*</span></label>
								<div class="col-lg-6">
									<div class="input-group">
										<span class="input-group-addon"><i class="icon-key"></i></span>
										<input type="text" class="form-control" placeholder="<?php echo lang('language_lang.label_siteckey'); ?>" name="captcha_key" value="<?php echo set_value('captcha_key',isset($this->data['captcha_key']) ? $this->data['captcha_key'] : ''); ?>">
									</div>
								</div>
								<?php echo $validation->getError('captcha_key', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
							</div>


							<div class="form-group  <?php if($validation->getError('captcha_secret')) echo "has-error";?>">
								<label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.label_sitecsec'); ?> <span class="text-danger">*</span></label>
								<div class="col-lg-6">
									<div class="input-group">
										<span class="input-group-addon"><i class="icon-key"></i></span>
										<input type="text" class="form-control " placeholder="<?php echo lang('language_lang.label_sitecsec'); ?>" name="captcha_secret" value="<?php echo set_value('captcha_secret',isset($this->data['captcha_secret']) ? $this->data['captcha_secret'] : ''); ?>">
									</div>
								</div>
								<?php echo $validation->getError('captcha_secret', '<div class="form-control-feedback"><i class="icon-cancel-circle2"></i></div><span class="help-block">', '</span>'); ?>
							</div>
							<?php 
								if(isset($auto_status)) {
									// echo $auto_status;
									$statuss = $auto_status;
								} else {
									$statuss = '';
								}
							?>
							<div class="form-group <?php if($validation->getError('auto_status')) echo "has-error";?>" style="display: none;">
								<label class="control-label col-lg-3 text-semibold"><?php echo lang('language_lang.label_auto_status'); ?> </label>
								<div class="col-lg-6">
									<div class="checkbox checkbox-switch">
										<label>
											<input type="checkbox" <?php if($statuss=='on'){echo 'checked="checked"';}?> name="auto_status" data-on-color="success" data-off-color="danger" data-on-text="<?php echo lang('language_lang.On');?>" data-off-text="<?php echo lang('language_lang.Off');?>" class="switchery">
										</label>
									</div>
									<?php echo $validation->getError('auto_status', '<label class="validation-error-label">', '</label>'); ?>
								</div>
							</div>


							<div class="text-right col-lg-9">
								<button type="submit" class="btn btn-primary"><?php echo lang('language_lang.button_update'); ?> <i class="icon-arrow-right14 position-right"></i></button>
							</div>
						</form>
					</div>
				</div>
				<!-- /horizotal form -->

			</div>
			<!-- /main content -->

		</div>
		<!-- /page content -->
		

		<!-- Footer -->
		<div class="footer text-muted">
			<?php echo site_footer();?>
		</div>
		<!-- /footer -->

	</div>
	<!-- /page container -->

	<script type="text/javascript">
	jQuery.noConflict();
	(function( $ ) {
	$(function() {

		$(document).ready(function() {

			$.jGrowl.defaults.closer = false;

			/*  Return form errors */
			<?php if(isset($form_err_data)) { ?>
				// $.jGrowl('<?php echo trim($form_err_data);?>', {
		  //           header: '<?php echo lang("language_lang.error");?>',
		  //           theme: 'bg-danger'
		  //       });
			<?php } ?>

			<?php if($session->getFlashData('error_message')) { ?>
				$.jGrowl("<?php echo $session->getFlashData('error_message');?>", {
		            header: '<?php echo lang("language_lang.error");?>',
		            theme: 'bg-danger'
		        });
            <?php } ?>
                    
            <?php if($session->getFlashData('success_message')) { ?>
                $.jGrowl("<?php echo $session->getFlashData('success_message');?>", {
		            header: '<?php echo lang("language_lang.success");?>',
		            theme: 'bg-success'
		        });
            <?php } ?>

            $(".datepicker").datepicker({
            	format: 'mm-dd-yyyy',
            	maxDate:0
            }).on('change', function(e) {
            	$('.sitesetting').formValidation('revalidateField','start_date');
            });

		    $('.sitesetting').formValidation({
		    	framework: 'bootstrap',
		    	excluded: [':disabled'],
		        icon: {
		            // valid: 'glyphicon glyphicon-ok',
		            // invalid: 'glyphicon glyphicon-remove',
		            validating: 'glyphicon glyphicon-refresh'
		        },
		        row: {
				    // valid: 'has-success1',
				    invalid: 'has-error'
				},
		        fields: {
		            name: {
		                message: '<?php echo lang("language_lang.site_name_valid");?>',
		                validators: {
		                    notEmpty: {
		                        message: '<?php echo lang("language_lang.site_name_empty");?>'
		                    },
		                    stringLength: {
		                        min: 4,
		                        message: '<?php echo lang("language_lang.site_name_min");?>'
		                    },
		                    regexp: {
		                        regexp: /^[a-z\d\-\s]+$/i,
		                        message: '<?php echo lang("language_lang.site_name_must");?>'
		                    }
		                }
		            },
		            url: {
		                validators: {
		                	notEmpty: {
		                        message: '<?php echo lang("language_lang.site_url_empty");?>'
		                    },
		                    refexp: {
		                    	regexp: /^[`~,.<>;':"\/\[\]\|{}()=_+-]/,
		                    	message: '<?php echo lang("language_lang.site_name_must");?>'
		                    },
		                    uri: {
		                        message: '<?php echo lang("language_lang.site_url_valid");?>'
		                    },

		                }
		            },
		            logo: {
			            validators: {
			                file: {
			                    extension: 'jpg,jpeg,png,gif',
			                    type: 'image/jpg,image/jpeg,image/png, image/png',
			                    message: '<?php echo lang("language_lang.site_log_must");?>'
			                }
			            }
			        },
		            start_date: {
		                message: '<?php echo lang("language_lang.site_date_valid");?>',
		                validators: {
		                    notEmpty: {
		                        message: '<?php echo lang("language_lang.site_start_date_empty");?>'
		                    }
		                }
		            },
		            meta_title: {
		                message: '<?php echo lang("language_lang.site_meta_title_valid");?>',
		                validators: {
		                    notEmpty: {
		                        message: '<?php echo lang("language_lang.site_meta_title_empty");?>'
		                    },
		                    stringLength: {
		                        min: 6,
		                        message: '<?php echo lang("language_lang.site_meta_title_min");?>'
		                    }
		                }
		            },
		            meta_key: {
		                message: '<?php echo lang("language_lang.site_meta_key_valid");?>',
		                validators: {
		                    notEmpty: {
		                        message: '<?php echo lang("language_lang.site_meta_key_empty");?>'
		                    },
		                    stringLength: {
		                        min: 6,
		                        message: '<?php echo lang("language_lang.site_meta_key_min");?>'
		                    }
		                }
		            },
		            meta_description: {
		                message: '<?php echo lang("language_lang.site_met_desc_valid");?>',
		                validators: {
		                    notEmpty: {
		                        message: '<?php echo lang("language_lang.site_meta_desc_empty");?>'
		                    },
		                    stringLength: {
		                        min: 5,
		                        message: '<?php echo lang("language_lang.site_meta_desc_min");?>'
		                    }
		                }
		            },
		            analytical_code: {
		                message: '<?php echo lang("language_lang.site_analytical_valid");?>',
		                validators: {
		                    notEmpty: {
		                        message: '<?php echo lang("language_lang.site_analytical_empty");?>'
		                    },
		                    stringLength: {
		                        min: 10,
		                        message: '<?php echo lang("language_lang.site_analytical_min");?>'
		                    }
		                }
		            },
		            offline_msg: {
		                message: '<?php echo lang("language_lang.site_off_msg_valid");?>',
		                validators: {
		                    notEmpty: {
		                        message: '<?php echo lang("language_lang.site_off_msg_empty");?>'
		                    },
		                    stringLength: {
		                        min: 10,
		                        message: '<?php echo lang("language_lang.site_off_msg_min");?>'
		                    }
		                }
		            },favicon: {
			            validators: {
			                file: {
			                    extension: 'jpg,jpeg,png,gif,ico',
			                    message: '<?php echo lang("language_lang.fav_icon_must");?>'
			                }
			            }
			        },sitecoin: {
			            validators: {
			                file: {
			                    extension: 'jpg,jpeg,png,gif,ico',
			                    message: '<?php echo lang("language_lang.site_icon_must");?>'
			                }
			            }
			        },
			        white: {
			            validators: {
			                file: {
			                    extension: 'pdf',
			                    message: '<?php echo lang("language_lang.site_white_must");?>'
			                }
			            }
			        }

		        }
		    })
			.find('[name="offline_msg"]')
		            .ckeditor()
		            .editor
		                .on('change', function() {
		                    $('.sitesetting').formValidation('revalidateField', 'offline_msg');
		                });
		});
	    
	    $(".file-input-extensions").fileinput({
		    uploadUrl: "http://localhost/file-upload-single/1", // server upload action
		    uploadAsync: false,
		    minFileCount: 1,
		    maxFileCount: 1,
		    overwriteInitial: false,
		    showUpload: false,
		    <?php if(isset($this->data['site_logo'])) { ?>
		    	initialPreview: ["../content/site/<?php echo $this->data['site_logo'];  ?>"],
		    	initialPreviewAsData: true, // identify if you are sending preview data only and not the raw markup
		    	initialPreviewFileType: 'image', // image is the default and can be overridden in config below
		    <?php } ?>
		    allowedFileExtensions: false,
		    uploadExtraData: {
		        img_key: "1000"
		    }
		});

		 $(".file-input-extensions1").fileinput({
		    uploadUrl: "http://localhost/file-upload-single/1", // server upload action
		    uploadAsync: false,
		    minFileCount: 1,
		    maxFileCount: 1,
		    overwriteInitial: false,
		    showUpload: false,
		    <?php if(isset($this->data['site_favicon'])) { ?>
		    	initialPreview: ["../content/favicon/<?php echo $this->data['site_favicon'];  ?>"],
		    	initialPreviewAsData: true, // identify if you are sending preview data only and not the raw markup
		    	initialPreviewFileType: 'image', // image is the default and can be overridden in config below
		    <?php } ?>
		    allowedFileExtensions: false,
		    uploadExtraData: {
		        img_key: "1000"
		    }
		});


		  $(".file-input-extensions3").fileinput({
		    uploadUrl: "http://localhost/file-upload-single/1", // server upload action
		    uploadAsync: false,
		    minFileCount: 1,
		    maxFileCount: 1,
		    overwriteInitial: false,
		    showUpload: false,
		    <?php if(isset($this->data['site_coin'])) { ?>
		    	initialPreview: ["../content/site/<?php echo $this->data['site_coin'];  ?>"],
		    	initialPreviewAsData: true, // identify if you are sending preview data only and not the raw markup
		    	initialPreviewFileType: 'image', // image is the default and can be overridden in config below
		    <?php } ?>
		    allowedFileExtensions: false,
		    uploadExtraData: {
		        img_key: "1000"
		    }
		});



		  $(".file-input-extensions2").fileinput({
		    uploadUrl: "http://localhost/file-upload-single/1", // server upload action
		    uploadAsync: false,
		    minFileCount: 1,
		    maxFileCount: 1,
		    overwriteInitial: false,
		    showUpload: false,
		    <?php if(isset($this->data['whitepaper'])) { ?>
		    	initialPreview: ["../content/sire/<?php echo $this->data['whitepaper'];  ?>"],
		    	initialPreviewAsData: true, // identify if you are sending preview data only and not the raw markup
		    	initialPreviewFileType: 'image', // image is the default and can be overridden in config below
		    <?php } ?>
		    allowedFileExtensions: ["pdf"],
		    uploadExtraData: {
		        img_key: "1000"
		    }
		});
		
	    $(".switchery").bootstrapSwitch();

	    $('#icon-bck').on('click',function() {
			window.history.back();
		});

		$(window).load(function() {
			$(".pre_loader").fadeOut("slow");;
		});

	});
	})(jQuery);

	
	</script>

</body>
</html>
