<?
session_start();                        

$cPath		= $config->siteURL.'';
$pageName	= $page->parts[0];
$_SESSION['select_tab'] = $page->topCategory;
?>
<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">   
	
	<!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
   
	<!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" href="<?=$config->siteURL;?>/admin/bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">-->
	<link rel="stylesheet" href="<?=$config->siteURL;?>/admin/css/font-awesome.min.css">
    <!-- Ionicons -->
    <!--<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">-->
	<link rel="stylesheet" href="<?=$config->siteURL;?>/admin/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="<?=$config->siteURL;?>/admin/dist/css/AdminLTE.min.css">
    <link rel="stylesheet" href="<?=$config->siteURL;?>/admin/dist/css/cloudaccounting.css">
    <link rel="stylesheet" href="<?=$config->siteURL;?>/admin/plugins/datepicker/datepicker3.css">
	<!-- iCheck for checkboxes and radio inputs -->
    <link rel="stylesheet" href="<?=$config->siteURL;?>/admin/plugins/iCheck/all.css">
	    <!-- DataTables -->
    <link rel="stylesheet" href="<?=$config->siteURL;?>/admin/plugins/datatables/dataTables.bootstrap.css">
	
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="<?=$config->siteURL;?>/admin/dist/css/skins/_all-skins.min.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<!-- jQuery 2.1.4 -->
    <script src="<?=$config->siteURL;?>/admin/plugins/jQuery/jQuery-2.1.4.min.js"></script>
	
    <!-- Bootstrap 3.3.5 -->
    <script src="<?=$config->siteURL;?>/admin/bootstrap/js/bootstrap.min.js"></script>
    <!-- SlimScroll -->
    <script src="<?=$config->siteURL;?>/admin/plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <script src="<?=$config->siteURL;?>/admin/plugins/datepicker/bootstrap-datepicker.js"></script>
    <!-- FastClick -->
    <script src="<?=$config->siteURL;?>/admin/plugins/fastclick/fastclick.min.js"></script>
	<!-- DataTables -->
    <script src="<?=$config->siteURL;?>/admin/plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="<?=$config->siteURL;?>/admin/plugins/datatables/dataTables.bootstrap.min.js"></script>
    <!-- AdminLTE App -->
    <script src="<?=$config->siteURL;?>/admin/dist/js/app.min.js"></script>
    <!-- AdminLTE for demo purposes -->
    <script src="<?=$config->siteURL;?>/admin/dist/js/demo.js"></script>
	<!-- iCheck 1.0.1 -->
    <script src="<?=$config->siteURL;?>/admin/plugins/iCheck/icheck.min.js"></script>
	
    <meta name="msvalidate.01" content="8418D29A126D6F2374CECB619E7E3769" />
	<meta name="keywords" content="<?php echo $keywords;?>"/>
	<meta name="description" content="<?php echo $description;?>"/> 
	<meta http-equiv="content-type" content="text/html; charset=windows-1250">

    <title><?php echo $title; ?></title>
</head>

<!-- ADD THE CLASS layout-top-nav TO REMOVE THE SIDEBAR. -->

	<? 
			echo "<body class='hold-transition skin-green sidebar-mini'>";
			echo "<div class='container'>";
				//include('header.php');
				if(file_exists($page->topCategory.'.inc.php')){
					include($page->topCategory.'.inc.php');
				}else{
					include('page-nahi-mila.inc.php');
				}
				//include('footer.php');
			echo "</div>";
	?>
</body>
</html>
<script type="text/javascript">		
$(document).ready(function() {
	$('.datepicker').datepicker({
			format: "dd-mm-yyyy",
			todayHighlight: true,
			autoclose: true

		});
    $('.glyphicon-calendar').on('click',function(){
	  $(this).parent().parent().find('.datepicker').focus();
	});		

	$("#contact-form").submit(function() {
	   
		var is_error =false;
		$("#contact-form .required").each(function(index) {
				
				if($(this).val() == ''){
				var field_name = $(this).attr("id");
				alert("Please enter "+field_name);				
				$(this).focus();
				is_error = true;
				return false;		
			}			
			var form_data ='';
			
			if($(this).attr("id") == 'security_code'){
				if($(this).val !=''){	
					
					var form_data 	= {'security_code' : $(this).val() };
					$.ajax({
						async: false,
						type: "POST",
						url: frontEndURL+"/ajax_actions.php?action=check_captch_session",
						data: form_data,
						success: function(result){
							var resultObj = jQuery.parseJSON(result);
							if(resultObj.status == "failure"){
								alert(resultObj.message);		    								
								$(this).focus();
								is_error = true;
								return false;								
							}
						}
					}); 					
				}
				
			}
			if($(this).attr("id") == 'email_id'){			
				var email=$(this).val();
				if (!isValidEmail(email)){					
					alert('Please enter valid Email Id');
					$(this).focus();
					is_error = true;
					return false;		
				}				
			}					
		});
		if(is_error){
			return false;
		}
		
	});	
});


function isValidEmail(email) {
    var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);
    return pattern.test(email);
};

</script>
<script type="text/javascript">		
$(document).ready(function() {
	$("#contact_form").submit(function() {
		var is_error =false;
		$("#contact_form .required").each(function(index) {
			if($(this).val() == ''){
				var field_name = $(this).attr("id");
				alert("Please enter "+field_name);				
				$(this).focus();
				is_error = true;
				return false;		
			}			
			var form_data ='';
			if($(this).attr("id") == 'security_code'){
				if($(this).val !=''){					
					var form_data 	= {'security_code' : $(this).val() };
					$.ajax({
						async: false,
						type: "POST",
						url: frontEndURL+"/ajax_actions.php?action=check_captch_session",
						data: form_data,
						success: function(result){
							var resultObj = jQuery.parseJSON(result);
							if(resultObj.status == "failure"){
								alert(resultObj.message);		    								
								$(this).focus();
								is_error = true;
								return false;								
							}
						}
					}); 					
				}
				
			}
			if($(this).attr("id") == 'email_id'){			
				var email=$(this).val();
				if (!isValidEmail(email)){					
					alert('Please enter valid Email Id');
					$(this).focus();
					is_error = true;
					return false;		
				}				
			}					
		});
		if(is_error){
			return false;
		}
		
	});	
});

function isValidEmail(email) {
    var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);
    return pattern.test(email);
};

</script>

<script type="text/javascript">		
$(document).ready(function(){     
  
  $('#subscribe_newsletter').click(function(){
 
  	var name		= $("#email_text_box").val();	
    var email		= name//$("#subs_email").val();         
  	
	function is_email(emailid) {
		var pattern = new RegExp(/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]+$/);
		return pattern.test(emailid);
	}
	if (!is_email(email)){
		alert('Please enter valid Email Id');
		$('#email_text_box').focus();
		return false;
	}

	
    if(email == "" || email == "enter email"){
      alert("Please enter email");
      return false;
    }
    var form_data = {'name':name,'email':email};      
   // alert(frontend_url);
    $.ajax({
    	async: false,
    	type: "POST",
    	url: frontend_url+"/ajax_actions.php?action=newsletter_subscription",
      data: form_data,      	
    	success: function(result){
      	var resultObj = jQuery.parseJSON(result);
        alert(resultObj.message);      	
      } 
  	});
  });
  

	$('.popup_chat').click(function(event) {
		event.preventDefault();
		window.open($(this).attr("href"), "popupWindow", "width=600,height=600,scrollbars=yes");
	});
	
	//Flat red color scheme for iCheck
        $('input[type="checkbox"].flat-red, input[type="radio"].flat-red').iCheck({
          checkboxClass: 'icheckbox_flat-green',
          radioClass: 'iradio_flat-green'
        });
		
});
</script>
<? $db->free(); ?>