<?php
if(!isset($_SESSION)) 
{ 
session_start(); 
} 
if(!isset($_SESSION['is_login']) ){
header("location: login.php");
?>
<script>
window.location="login.php";
</script>
<?php
}
// for Translation
include('models/translation.class.php');
?>

<!DOCTYPE html>
<html lang="en" dir="<?php echo $DIR; ?>" >
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
	<title id='index_page_title'>DashBoard</title>
	<noscript>
  		<META HTTP-EQUIV="Refresh" CONTENT="0;URL=java_disabled.html">
	</noscript>
	<!-- Global stylesheets -->
	<!-- <link href="https://fonts.googleapis.com/css?family=Roboto:400,300,100,500,700,900" rel="stylesheet" type="text/css"> -->
	<link href="assets/<?php echo $CSS; ?>/icons/icomoon/styles.css" rel="stylesheet" type="text/css">
	<link href="assets/<?php echo $CSS; ?>/icons/fontawesome/styles.min.css" rel="stylesheet" type="text/css">
	<link href="assets/<?php echo $CSS; ?>/bootstrap.css" rel="stylesheet" type="text/css">
	<link href="assets/<?php echo $CSS; ?>/core.css" rel="stylesheet" type="text/css">
	<link href="assets/<?php echo $CSS; ?>/components.css" rel="stylesheet" type="text/css">
	<link href="assets/<?php echo $CSS; ?>/colors.css" rel="stylesheet" type="text/css">
	<link href="assets/<?php echo $CSS; ?>/jquery.typeahead.min.css" rel="stylesheet" type="text/css">
	<!-- /global stylesheets -->

	<!-- Core JS files -->
	<script type="text/javascript" src="assets/js/plugins/loaders/pace.min.js"></script>
	<script type="text/javascript" src="assets/js/core/libraries/jquery.min.js"></script>
	<script type="text/javascript" src="assets/js/core/libraries/bootstrap.min.js"></script>
	<script type="text/javascript" src="assets/js/plugins/loaders/blockui.min.js"></script>
	<script type="text/javascript" src="assets/js/plugins/ui/nicescroll.min.js"></script>
	<script type="text/javascript" src="assets/js/plugins/ui/drilldown.js"></script>
	<!-- /core JS files -->

	<!-- Theme JS files -->
	<?php include('models/headerJS.php'); ?>
	<!-- /theme JS files -->
	<style >
		.page-title {
		    padding: 40px 36px 40px 0;
		}

		@font-face {
    	font-family: "Noto Kufi Arabic";
    	src: url(assets/custom_font/NotoKufiArabic-Regular.ttf) format("truetype");
		}

		html[dir="rtl"] .sweet-alert .sa-icon.sa-success .sa-line.sa-tip{
			transform: rotate(45deg);
		}

		html[dir="rtl"] .sweet-alert .sa-icon.sa-success .sa-line.sa-long{
			transform: rotate(-45deg);
		}

	</style>
</head>

<body style=" font-family: 'Noto Kufi Arabic', Times, serif;">

	
	<?php 
		// Redirecting to Pages
		$pg = 'dashboard';
		$page  = array(
						'dashboard' =>  array('pageTitle' =>'لوحة المراقبة', 'btn' =>'','btnIcon' =>''),
						'profile' =>  array('pageTitle' =>'الصفحة الشخصية', 'btn' =>'','btnIcon' =>''),
						'setting' =>  array('pageTitle' =>'اعدادات النظام', 'btn' =>'','btnIcon' =>''),
						'category' =>  array('pageTitle' =>'الفئات', 'btn' =>'اضافة صنف  جديد','btnIcon' =>'icon-tree7'),
						'city' =>  array('pageTitle' =>'City', 'btn' =>'Add New City','btnIcon' =>'icon-office'),
						'class' =>  array('pageTitle' =>'Doctor Class', 'btn' =>'Add New Class','btnIcon' =>'icon-stars'),
						'specialty' =>  array('pageTitle' =>'تخصصات الاطباء', 'btn' =>'Add New Specialty','btnIcon' =>'icon-stars'),
						'sub_class' =>  array('pageTitle' =>'Doctor Sub-Class', 'btn' =>'Add New Sub-Class','btnIcon' =>'icon-podium'),
						'zone' =>  array('pageTitle' =>'Zones', 'btn' =>'Add New Zone','btnIcon' =>'icon-office'),
						'sub_zone' =>  array('pageTitle' =>'المنطقة الفرعية', 'btn' =>'Add New Sub Zone','btnIcon' =>'icon-office'),
						'quarter' =>  array('pageTitle' =>'الحي', 'btn' =>'اضافة حي جديد','btnIcon' =>'icon-office'),
						'street' =>  array('pageTitle' =>'الشارع', 'btn' =>'Add New Street','btnIcon' =>'icon-office'),
						'languages' =>  array('pageTitle' =>'اللغات', 'btn' =>'اضافة لغة جديدة','btnIcon' =>'icon-earth'),
						'users' =>  array('pageTitle' =>'ادارة حسابات مستخدمي النظام', 'btn' =>'اضافة مستخدم جديد','btnIcon' =>' icon-user-plus'),
						'saleman' =>  array('pageTitle' =>'المندوبين', 'btn' =>'اضافة مندوب جديد','btnIcon' =>' icon-user-plus'),
						'teamleader' =>  array('pageTitle' =>'Teamleader', 'btn' =>'Add New Teamleader','btnIcon' =>' icon-user-plus'),
						'product' =>  array('pageTitle' =>'المواد', 'btn' =>'اضافة مادة جديدة','btnIcon' =>' icon-dropbox'),
						'doctor' =>  array('pageTitle' =>'Doctor Page', 'btn' =>'اضافة طبيب جديد','btnIcon' =>' icon-user-tie'),
						'doctor_duplicate' =>  array('pageTitle' =>'Doctor Page', 'btn' =>'','btnIcon' =>' icon-user-tie'),
						'pharmacy' =>  array('pageTitle' =>'Pharmacy Page', 'btn' =>'اضافة صيدلية جديد','btnIcon' =>' icon-user-tie'),
						'pharmacy_duplicate' =>  array('pageTitle' =>'Pharmacy Page', 'btn' =>'','btnIcon' =>' icon-user-tie'),
						'plan' =>  array('pageTitle' =>'Plan Page', 'btn' =>'اضافة خطة جديد','btnIcon' =>' icon-user-tie'),
						'visit' =>  array('pageTitle' =>'Visit Report', 'btn' =>'اضافة تقرير جديد','btnIcon' =>' icon-user-tie'),
						'visit_delivery' =>  array('pageTitle' =>'Visit Delivery', 'btn' =>'اضافة تقرير جديد','btnIcon' =>' icon-user-tie'),
						'translation' =>  array('pageTitle' =>'ترجمة', 'btn' =>'اضافة كلمة دلالية جديدة','btnIcon' =>'icon-ampersand2'),
						'invoice' =>  array('pageTitle' =>'Sells', 'btn' =>'انشاء وصل بيع','btnIcon' =>'icon-calculator'),
						'report' =>  array('pageTitle' =>'التقارير', 'btn' =>'','btnIcon' =>''),   
					  );

		if(isset($_GET['p'])){
			$pg = $_GET['p'];
		}

		

		
	?>
	<script >
		var CURRENT_BTN_ICON = '<?php echo $page[$pg]['btnIcon'] ; ?>';
		var CURRENT_BTN 	 = '<?php echo $page[$pg]['btn'] ; ?>';
		var PAGE_TITLE 	 	 = '<?php echo $page[$pg]['pageTitle'] ; ?>';
		var IMG_PATH 	 	 = '<?php echo $_SESSION['image_path'] ; ?>';
		var COMPANY_ADDRESS	 = '<?php echo $_SESSION['company_address'] ; ?>';
		var COMPANY_PHONE 	 = '<?php echo $_SESSION['company_phone'] ; ?>';
		var COMPANY_EMAIL 	 = '<?php echo $_SESSION['company_email'] ; ?>';
		var COMPANY_LOGO 	 = '<?php echo $_SESSION['company_logo'] ; ?>';
		var COMPANY_NAME 	 = '<?php echo $_SESSION['company_name'] ; ?>';
		var BRANCH_ID 	 	 = 0;
		var PROFILE_TYPE 	 = '<?php echo $_SESSION['profile_type'] ; ?>';
		var IS_VIEW 	 	 = '<?php echo $_SESSION['is_view'] ; ?>';
		var CITY_ID 	 	 = '<?php echo $_SESSION['city_id_fk'] ; ?>';
		var ZONE_ID 	 	 = '<?php echo $_SESSION['zone_id_fk'] ; ?>';
		var SUB_ZONE_ID 	 = '<?php echo $_SESSION['sub_zone_id_fk'] ; ?>';
		var QUARTER_ID 	 	 = '<?php echo $_SESSION['quarter_id_fk'] ; ?>';
		var STREET_ID 	 	 = '<?php echo $_SESSION['street_id_fk'] ; ?>';
		var USER_ID 	 	 = '<?php echo $_SESSION['user_id'] ; ?>';

		// change page title
		$("#index_page_title").html(Translation(PAGE_TITLE));
		var CAT_ID = 0;
	</script>
		
	<?php include('models/navbar.php'); ?>
	<!-- Page header -->
	<div class="page-header">
		<div class="page-header-content">
			<div class="page-title">
				
			</div>

			
		</div>
	</div>
	<!-- /page header -->


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

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

			<!-- Main content -->
			<div class="content-wrapper">
				<?php 
					if(!isset($page[$pg])){
				?>
						<script>
						window.location="starter.php";
						</script>
				<?php	}
					
				 include($pg.'.php'); 
				 ?>	

				 <!-- Here We will store all repeated Modal that can be used by another pages -->
				 <?php include('models/general_modal.php'); ?>		
			</div>
			<!-- /main content -->

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

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

	<script >
		Auto_Translate();
	</script>

</body>
</html>
