<!DOCTYPE html>
<html lang="en">
<head>
	<?php $this->load->view("includes/header");?>
</head>

<body>
	<?php $this->load->view("includes/menu");?>
	
	<section class="content">
		<?php $this->load->view("includes/nav");?>
		
		<div class="wraper container-fluid xs_container-fluid">
<!--			<div class="page-title"> -->
<!--				<h3 class="title">Panels</h3> -->
<!--			</div>-->
			
			<div class="row">
				<div class="col-md-offset-2 col-md-8">
					<?php $this->load->view("includes/success_msg");?>
					
					<div class="panel panel-default xs_panel" style="padding-left: 10px; padding-right: 10px;">
						<div class="panel-heading">
							<center>
								<h3 class="panel-title">
									<i class="fa fa-envelope-o fa-fw"></i>
									Email Setting
								</h3> 
							</center>
						</div>
						<div class="panel-body">
							<div id="ajax_container"><!-- AJAX --></div>
						</div>
					</div>
				</div>
			</div>
		</div>
		
		<?php $this->load->view("includes/footer");?>
	</section>
	
	<script type="text/javascript">
		$(document).ready(function(){
//			if(! Modernizr.touch || ! Modernizr.inputtypes.date){
//				$(".datepicker").datepicker({
//					format: "yyyy-mm-dd",
//					autoclose: true,
//					todayHighlight: true,
//				});
//			}

			json_resource(function(){
				load_data();
			});
		});

		//Global Variables---
		var timer_check_unique;
		var checking_unique;
		//-------------------
		
		function load_data(callback){
			//Loader---
			$("#ajax_container").html("<?php echo $this->text_ajax_loader;?>");
			//---------
			
			var params = "";
			
			$.ajax({
				type: "POST",
				url: "<?php echo base_url($this->router->fetch_class()."/load_data?".$_SERVER['QUERY_STRING']);?>",
				data: params,
				success: function(result, status, xhr){
					$("#ajax_container").html(result);
				},
				error: function(xhr,status,error){
					$("#ajax_container").html("<?php echo $this->text_ajax_fail;?>");
				},
				complete: function(xhr,status){
					if(callback != undefined) callback();
				},
			});
		}
	</script>
</body>
</html>
