<input type="hidden" id="baseurl" value="<?php echo base_url(); ?>" > 
<div class="row">
    <div class="col-md-12">
        <div class="hs_heading medium">
            <h3>General Settings</h3>
        </div>
    </div>
</div>
  
<div class="row"> 
    <div class="col-md-12">
        <!-- tab start -->
        <div class="hs_tabs">
            <ul class="nav nav-pills">
                <li class="active"><a data-toggle="pill" href="#site_setting_tab">Site Info</a></li>
                <li><a data-toggle="pill" href="#image_setting_tab">Images</a></li>
				<li><a data-toggle="pill" href="#footer_setting_tab">Footer</a></li>
				<li><a data-toggle="pill" href="#section_setting_tab">Section</a></li>
				<li><a data-toggle="pill" href="#menu_setting_tab">Menu</a></li>
				<li><a data-toggle="pill" href="#openingschedule_setting_tab">Opening Time</a></li>
				<li><a data-toggle="pill" href="#map_setting_tab">Map</a></li>
				<li><a data-toggle="pill" href="#change_password_tab">Credential</a></li>
				<li><a data-toggle="pill" href="#gdpr_massage">GDPR Cookies Massage</a></li>
			</ul>
			<div class="tab-content">
				<!-- site setting tab start -->
                <div id="site_setting_tab" class="tab-pane fade in active">			
                    <div class="row">
						<div class="col-md-12">
							<div class="hs_heading medium">
								<h3>Text Settings</h3>
							</div>
							<div class="hs_datatable_wrapper">
								<table class="hs_datatable table table-bordered">
									<thead>
										<tr>
											<th>#</th> 
											<th>Name</th>
											<th>value</th>
											<th>Status</th>
										    <th>Action</th>
										</tr>
									</thead>
									<tbody>
										<?php if(!empty($all_web_settings)){ 
											$i=0;
											foreach($all_web_settings as $websettings){ 
											$str = explode("_", strtolower( $websettings->key_text));
											foreach($str as $string){
											 if( $string == 'text'){
										?>
										<tr>
											<td> <?php echo ++$i ; ?></td>
											<td><?php echo ucwords($websettings->text_name); ?></td>
											<td><?php echo $websettings->value_text; ?></td>
											 <?php $all_text_key = str_replace("_text","",$websettings->key_text);  
											  $all_text_status = $this->hs->getsetting_uniq_id($all_text_key.'_show'); 
											 ?>
											<td>
												<label class="switch">
													<input id="textstatus_<?php echo $all_text_status['uniq_id']; ?>" onclick="update_section_status(<?php echo $all_text_status['uniq_id']; ?>);"   type="checkbox" value="" <?php if($all_text_status['value_text'] == 1){ echo "checked"; } ?> >
													<span class="slider"></span>
												</label>
											</td>
											<td width="200">
												<a  class="btn" title="Edit" data-name="Business Statistics" onclick="edit_websetting(<?php echo $websettings->uniq_id; ?>,'<?php echo $websettings->value_text; ?>')"><i class="fa fa-pencil" aria-hidden="true"></i></a>
										    </td>
										</tr>
										<?php 
										     }  
										   }
										 }
										}
										?> 
									</tbody>
								</table>
							</div>
						</div>
					</div>
				</div>
				<!-- site setting tab end -->
				<!------ image setting tab  start------------------>
				<div id="image_setting_tab" class="tab-pane fade">
					<div class="row">
					 <form id="web_image_update" method="post">
						<div class="col-md-12">
                            <div class="hs_image_viewer">
							 <label>Preloader</label>
								<div class="iv_image">
                                    <img src="<?php echo base_url().$this->hs->getwebsettings('preloader_img'); ?>" alt="">	
                                </div>
                                <p class="help-block">Preferred preloader size 260x115px</p>
                                <div class="iv_action">
                                    <div class="uploader_link">
                                        <label for="preloader_img">Upload New</label>
										 <input class="website_image" type="file"  name="preloader_img" id="preloader_img" >
                                    </div>
                                </div>
                            </div>
                        </div>
					    <div class="col-md-12">
                            <div class="hs_image_viewer">
							 <label>Favicon</label>
								<div class="iv_image">
                                    <img src="<?php echo base_url().$this->hs->getwebsettings('favicon_img'); ?>" alt="">	
                                </div>
                                <p class="help-block">Preferred favicon size 32x32px</p>
                                <div class="iv_action">
                                    <div class="uploader_link">
                                        <label for="favicon_img">Upload New</label>
										 <input class="website_image" type="file"  name="favicon_img" id="favicon_img" >
                                    </div>
                                </div>
                            </div>
                        </div>
						 <div class="col-md-12">
                            <div class="hs_image_viewer">
                                <label>Logo</label>
                                <div class="iv_image">
                                    <img src="<?php echo base_url().$this->hs->getwebsettings('logo_img'); ?>"alt="">	
                                </div>
                                <p class="help-block">Preferred image size 300x145px , but maximum it can be 311x150px</p>
                                <div class="iv_action">
                                    <div class="uploader_link">
                                        <label for="logo_img">Upload New</label>
                                        <input class="website_image" type="file" id="logo_img" name="logo_img"/>
                                    </div>  
                                </div>
                            </div>
                        </div>
                        <div class="col-md-12">
                            <div class="hs_image_viewer last">
                                <label>Booking Section Image</label>
                                <div class="iv_image">
                                 <img src="<?php echo base_url().$this->hs->getwebsettings('bookingsection_img'); ?>" alt="">	  
                                </div>
                                <p class="help-block">Preferred image size 300x422 , but maximum it can be 370x521px </p>
                                <div class="iv_action">
                                    <div class="uploader_link">
                                        <label for="booking_section_img">Upload New</label>
                                        <input class="website_image" type="file" id="booking_section_img" name="booking_section_img" />
                                    </div>   
                                </div>
                            </div>
                        </div>
						<div class="col-md-12">
                            <div class="hs_image_viewer last">
                                <label>Footer Logo Image</label>
                                <div class="iv_image">
                                    <img src="<?php echo base_url().$this->hs->getwebsettings('footerlogo_img'); ?>" alt="">	  
                                </div>
                                <p class="help-block">Preferred image size 181x55px , but maximum it can be 250x70px </p>
                                <div class="iv_action">
                                    <div class="uploader_link">
                                        <label for="footer_logo_img">Upload New</label>
                                        <input class="website_image" type="file" id="footer_logo_img" name="footer_logo_img" />
                                    </div>   
                                </div>
                            </div>
                        </div>
						<div class="col-md-12">
                            <div class="hs_image_viewer last">
                                <label>Mobile App image</label>
                                <div class="iv_image">
                                    <img src="<?php echo base_url().$this->hs->getwebsettings('mobileapp_img'); ?>" alt="">	  
                                </div>
								<p class="help-block">Preferred image size 300x422 , but maximum it can be 339x500px </p>
                                <div class="iv_action">
                                    <div class="uploader_link">
                                        <label for="mobileapp_img">Upload New</label>
                                        <input class="website_image" type="file" id="mobileapp_img" name="mobileapp_img"/>
                                    </div>   
                                </div>
                            </div>
                        </div>
						<div class="col-md-12">
                            <div class="hs_image_viewer last">
                                <label>Mobile App store image</label>
                                <div class="iv_image">
                                    <img src="<?php echo base_url().$this->hs->getwebsettings('googlestore_img'); ?>" alt="">	  
                                </div>
								<p class="help-block">Preferred image size 175x60px , but maximum it can be 250x86px </p>
                                <div class="iv_action">
                                    <div class="uploader_link">
                                        <label for="googlestore_img">Upload New</label>
                                        <input class="website_image" type="file" id="googlestore_img" name="googlestore_img" />
                                    </div>   
                                </div>
                            </div>
                        </div>
						<div class="col-md-12">
                            <div class="hs_image_viewer last">
                                <label>Mobile App Store image</label>
                                <div class="iv_image">
                                    <img src="<?php echo base_url().$this->hs->getwebsettings('iosstore_img'); ?>" alt="image">	  
                                </div>
								<p class="help-block">Preferred image size 175x60px , but maximum it can be 250x86px </p>
                                <div class="iv_action">
                                    <div class="uploader_link">
                                        <label for="iosstore_img">Upload New</label>
                                        <input class="website_image" type="file" id="iosstore_img" name="iosstore_img" />
                                    </div>   
                                </div>
                            </div>
                        </div>
						<div class="col-md-12">
                            <button type="submit" class="btn" >Update</button>
                        </div>
                       </form> 
                    </div>
                </div>
				<!------ image setting tab end------------------>
				
				<!------ Footer setting tab start------------------>
				<div id="footer_setting_tab" class="tab-pane fade">
					 <div class="row">
						<div class="col-md-12">
							<div class="hs_heading medium">
								<h3>Footer Text Settings</h3>
							</div>
							<div class="hs_datatable_wrapper">
								<table class="hs_datatable table table-bordered">
									<thead>
										<tr>
											<th>#</th> 
											<th>Name</th>
											<th>value</th>
											<th>Status</th>
											<th>Action</th>
										</tr>
									</thead>
									<tbody>
										<?php if(!empty($all_web_settings)){ 
											$i=0;
											foreach($all_web_settings as $websettings){ 
											$str = explode("_", strtolower( $websettings->key_text));
											foreach($str as $string){
											 if($string == 'foot'){
										?>
										<tr>
											<td><?php echo ++$i ; ?></td>
										    <td><?php echo ucwords($websettings->text_name); ?></td> 
											<td><?php echo $websettings->value_text; ?></td>
											 <?php $key_text_value = str_replace("_foot","",$websettings->key_text); 
								            $foot_text_status = $this->hs->getsetting_uniq_id($key_text_value.'_show');
											?>
											<td>
												<label class="switch">
													<input id="textstatus_<?php echo $foot_text_status['uniq_id']; ?>" onclick="update_section_status(<?php echo $foot_text_status['uniq_id']; ?>);"   type="checkbox" value="" <?php if($foot_text_status['value_text'] == 1){ echo "checked"; } ?> >
													<span class="slider"></span>
												</label>
											</td>
											<td width="200">
												<a  class="btn" title="Edit" data-name="Business Statistics" onclick="edit_websetting(<?php echo $websettings->uniq_id; ?>,'<?php echo $websettings->value_text; ?>')"><i class="fa fa-pencil" aria-hidden="true"></i></a>
											</td>
										</tr>
										<?php 
										     }  
											}
										 }
										}
										?> 
									</tbody>
								</table>
							</div>
						</div>
					</div>
				</div>
				<!------ Footer setting tab end------------------>
				 
				<!------page section setting tab  start------------------>
				<div id="section_setting_tab" class="tab-pane fade">
					<div class="row">
						<div class="col-md-12">
							<div class="hs_heading medium">
								<h3>Section Settings</h3>
							</div>
							<div class="hs_datatable_wrapper">
								<table class="hs_datatable table table-bordered">
									<thead>
										<tr>
											<th>#</th> 
											<th>Page Section Name</th>
											<th>Status</th>
										</tr>
									</thead>
									<tbody>
										<?php if(!empty($all_web_settings)){ 
											$i=0;
											foreach($all_web_settings as $websettings){
                                            $str = explode("_", strtolower($websettings->key_text));
											foreach($str as $string){
											     if($string == 'section'){	 			
										?>
						                <tr>
											<td><?php echo ++$i ; ?></td>
											<td><?php echo  ucwords($websettings->text_name);?></td>
											<td>
												<label class="switch">
													<input id="textstatus_<?php echo $websettings->uniq_id; ?>" onclick="update_section_status(<?php echo $websettings->uniq_id; ?>);"   type="checkbox" value="" <?php if($websettings->value_text == 1){ echo "checked"; } ?> >
													<span class="slider"></span>
												</label>
											</td>
								        </tr>
										<?php 
											 }
											}
										  }  
									     }
										?> 
									</tbody>
								</table>
							</div>
						</div>
					</div>
			     </div>
				 <!------page section setting tab end------------------>
				 
				 <!------menu setting tab  start------------------>
				<div id="menu_setting_tab" class="tab-pane fade">
					<div class="row">
						<div class="col-md-12">
							<div class="hs_heading medium">
								<h3>Menu Settings</h3>
							</div>
							<div class="hs_datatable_wrapper">
								<table class="hs_datatable table table-bordered">
									<thead>
										<tr>
											<th>#</th> 
											<th>Menu Name</th>
											<th>Status</th>
										</tr>
									</thead>
									<tbody>
										<?php if(!empty($all_web_settings)){ 
											$i=0;
											foreach($all_web_settings as $websettings){
                                            $str = explode("_", strtolower($websettings->key_text));
											foreach($str as $string){
											     if( $string == 'hmenu'){	 			
										?>
						                <tr>
											<td> <?php echo ++$i ; ?></td>
											<td><?php echo ucwords($websettings->text_name);?></td>
											<td> 
												<label class="switch">
													<input id="textstatus_<?php echo $websettings->uniq_id; ?>" onclick="update_section_status(<?php echo $websettings->uniq_id; ?>);"   type="checkbox" value="" <?php if($websettings->value_text == 1){ echo "checked"; } ?> >
													<span class="slider"></span>
												</label>
											</td>
										 </tr>
										<?php 
											 }
											}
										  }  
									     }
										?> 
									</tbody>
								</table>
							</div>
						</div>
					</div>
			     </div>
				 <!------menu setting tab end------------------>
				 
				<!------opening schedule setting tab start------------------>
				 <div id="openingschedule_setting_tab" class="tab-pane fade">
					<div class="row">
						<div class="col-md-12">
							<div class="hs_heading medium">
								<h3>Opening time Settings</h3>
							</div>
							<div class="hs_datatable_wrapper">
								<table class="hs_datatable table table-bordered">
									<thead>
										<tr>
											<th>#</th> 
											<th>opening section title</th>
											<th>Time</th>
											<th>Status</th>
											<th>Action</th>
										</tr>
									</thead>
									 <tbody>
										<?php if(!empty($opening_schedule)){ 
											$i=0;
											foreach($opening_schedule as $open_schedule){
                                        ?>
						                <tr>
											<td> <?php echo ++$i ; ?></td>
											<td><?php echo ucwords($open_schedule->schedule_name);?></td>
											<td><?php echo $open_schedule->schedule_time; ?></td>
											<td> 
												<label class="switch">
													<input id="opentimestatus_<?php echo $open_schedule->schedule_id; ?>" onclick="update_opening_status(<?php echo $open_schedule->schedule_id; ?>);"   type="checkbox" value="" <?php if($open_schedule->schedule_status == 1){ echo "checked"; } ?> >
													<span class="slider"></span>
												</label>
												
												
											</td>
											<td width="200">
												<a  class="btn" title="Edit" data-name="Business Statistics" onclick="edit_opening_hours(<?php echo $open_schedule->schedule_id; ?>,'<?php echo $open_schedule->schedule_time; ?>')"><i class="fa fa-pencil" aria-hidden="true"></i></a>
											</td>
								        </tr>
										<?php 
											}  
									     }
										?> 
									</tbody>
								</table>
							</div>
						</div>
					</div>
				  </div>
				   <!------opening schedule setting tab end------------------>
				  
				   <!-------google map location setting start------------->
				   <div id="map_setting_tab" class="tab-pane fade">
						<div class="row">
							<div class="col-md-6 margin-bottom-30">
								<div class="hs_heading medium">
									<h3>Update Map Location</h3>
								</div>
								<form method="post" id="mapaddress_form">
								 <input type="hidden" class="form-control" placeholder="Latitude" id="latitude" name="latitude">
								<input type="hidden" class="form-control" placeholder="Longitude" id="longitude" name="longitude">
								<div class="hs_input"> 
									<label>Enter Your Google Map Api Key</label>
									<input type="text" class="form-control" placeholder="Api Key" id="map_apikey" name="map_apikey" value="<?php echo $this->hs->getwebsettings('map_apikey');  ?>">
									<a href="https://developers.google.com/maps/documentation/javascript/get-api-key" target="blank">Find Google Map Api Key</a>
								</div>
								<div class="hs_input"> 
									<label>Enter Location Address</label>
									<input type="text" class="form-control" placeholder="Location Address" id="map_address" name="map_address" value="">
								</div>
								<button type="submit" class="btn">Update</button>
								</form>
							</div>
						</div>
						<div id="dvMap" style="width: 100%; height: 500px">
						</div>
					</div>
				  <!-------google map location setting end------->
				  
                  <!------change admin password start------->
				  <div id="change_password_tab" class="tab-pane fade">
						<div class="row">
							<div class="col-md-6 margin-bottom-30">
								<div class="hs_heading medium">
									<h3>Change Password</h3>
								</div>
								<form method="post" id="change_password_form"> 
									<input type="hidden" id="old_userid" name="old_userid" value="<?php if(isset($_SESSION['admin_uid'])){ echo $_SESSION['admin_uid']; } ?>" >
									<div class="hs_input">
										<label>Email</label>
										<input type="text" class="form-control" placeholder="Email" id="user_email" name="user_email" value="<?php if(isset($_SESSION['admin_uid'])){ echo $this->hs->get_userdetails('user_email',$_SESSION['admin_uid']); } ?>" >
									</div>
									<div class="hs_input">
										<label>New Password</label>
										<input type="password" class="form-control" placeholder="New Password" id="user_newpwd" name="user_newpwd">
									</div>
									<button type="submit" class="btn">Update</button>
								</form>
							</div>
						</div>
					</div>
					<!----change admin password end ----->
					
					<!----update GDPR cookie massage start------------->
					
					<div id="gdpr_massage" class="tab-pane fade">
						<div class="row">
							<div class="col-md-6 margin-bottom-30">
								<div class="hs_heading medium">
									<h3>Update GDPR Massage</h3>
								</div>
								<form method="post" id="gdpr_cookie_form"> 
										<div class="hs_input">
												<label>Cookie Title</label>
												<input type="text" class="form-control" placeholder="Title" id="gdpr_title" name="gdpr_title" value="<?php echo $this->hs->getwebsettings('gdpr_title'); ?>">
										</div>
										<div class="hs_input">
											<label>Cookiee Massage</label>
											<textarea rows="4" class="form-control" name="gdpr_msg" id="gdpr_msg"><?php echo $this->hs->getwebsettings('gdpr_msg'); ?></textarea>
											<span>Note :- Massage Should Be 60 characters long only</span>
										</div>
										<div class="hs_input">
											<label>Cookie Link Title</label>
											<input type="Title" class="form-control" placeholder="text" id="gdprlink_title" name="gdprlink_title" value="<?php echo $this->hs->getwebsettings('gdprlink_title'); ?>">
										</div>
										<div class="hs_input">
											<label>Cookie Link </label>
											<input type="text" class="form-control" placeholder="Link" id="gdpr_link" name="gdpr_link" value="<?php echo $this->hs->getwebsettings('gdpr_link'); ?>">
										</div>
										<div class="hs_input">
											<label>Cookie Botton Title </label>
											<input type="text" class="form-control" placeholder="Button Title" id="gdprbutton_title" name="gdprbutton_title" value="<?php echo $this->hs->getwebsettings('gdprbutton_title'); ?>">
										</div>
										<div class="hs_input">
											<label>Cookie Popup Image </label>
											<input type="file" class="form-control" placeholder="Button Title" id="gdpr_image" name="gdpr_image">
											<span>Note :- Preferred image size 115*115px</span>
										</div>
										<button type="submit" class="btn">Update</button>
								</form>
							</div>
						</div>
					</div>
					<!----update GDPR cookie massage end------------->
					
			</div>
		</div>
	</div>
</div>
<br>
<br>
<br>
<br>
<!-- update web setting popup start -->
<div class="modal_box">
	<div id="update_websettings" class="modal fade" role="dialog">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">&times;</button>
					<h4 class="modal-title"><span>Update</span> Web Settings</h4>
				</div>
				<div class="modal-body">
					 <form method="post" id="update_websetting">
						<div class="hs_input">
							<label>value</label>
							<input type="text" class="form-control add_cate_form" placeholder=""  name="valuetext" id="update_valuetext" value="">
						</div>
						<div class="hs_input">
						  <input type="hidden" value="" name="old_uniqid" id="old_valueid">
						  <button type="submit" id="add"  class="btn">Update</button>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</div>
<!-- update web setting popup end -->	

<!-- update opening time popup start -->
<div class="modal_box">
	<div id="update_opening_hours" class="modal fade" role="dialog">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">&times;</button>
					<h4 class="modal-title"><span>Update</span> Opening Hours</h4>
				</div>
				<div class="modal-body">
					<form method="post" id="update_opening_time">
						<div class="hs_input">
							<label>value</label>
							<input type="text" class="form-control add_cate_form" placeholder=""  name="update_open_time" id="update_open_time" value="">
						</div>
						<div class="hs_input">
							<input type="hidden" value="" name="old_openid" id="old_openid">
							<button type="submit" id="update"  class="btn">Update</button>
						</div>
					</form>
				</div>
			</div>
		</div> 
	</div>
</div>
<!-- update opening time popup end -->
