<?php session_start();
		if (isset($_SESSION['logged']) && $_SESSION['logged'] == 'yes') {
			$user = $_SESSION['user'];//get user	
			include ('scripts/classes.php'); 
			if ($_SESSION['lang']=="EN"){include ('lang/en.php');}elseif ($_SESSION['lang']=="GR"){include ('lang/gr.php');}else{ include ('lang/en.php');}
			$array = getGlobalSettings(); foreach ($array as $settings){extract($settings);}	
			$arrus = getUserSettings($user);foreach ($arrus  as $user_settings){extract($user_settings);}	
			$mods = getCLSModules('POS'); foreach ($mods as $cls_modules){extract($cls_modules);} if ($mod_name == "POS") $_POS = 1; //echo $_POS;		
			$mods = getCLSModules('CELEBRATIONS'); foreach ($mods as $cls_modules){extract($cls_modules);} if ($mod_name == "CELEBRATIONS") $_CELEBRATIONS = 1; //echo $_CELEBRATIONS;
            $mods = getCLSModules('SMS'); foreach ($mods as $cls_modules){extract($cls_modules);} if ($mod_name == "SMS") $_SMS = 1; //echo $_SMS				
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CLS 1</title>
<link href="cms1.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="scripts/menu.js" ></script>
</head>
<body>
<?php  if ($cls_flag==1 and $usertype!=3){ ?>
<div style="margin:5px"><a href="#" onclick="toggle_visibility('quick_menu');" class="quick">CLS</a></div>
<div style="float:left; width:200px" id="menu">
        <?php
		} #end quick menu
		?>
  <ul id="qm0" class="qmmc">
    <?php  if ($usertype!=3){?>
    <li><a class="qmparent" href="main.php" target="mainFrame"><?php echo $lbl_start ?></a>
      <?php
		}
		?>
      <?php  if ($web_flag==1 and $usertype!=3){ //ENABLE WEB MODULE
		?>
    <li><a class="qmparent" href="javascript:void(0)">Website</a> </li>
    <?php 
		}
		if ($adb_flag==1 and $usertype!=3){ //ENABLE ADDRESS BOOK MODULE
		?>
    <li><a class="qmparent" href="javascript:void(0)">Address Book</a> </li>
    <?php 
		}
		if ($som_flag==1 and $usertype!=3){ //ENABLE SALES ORDER MANGMNET MODULE
		?>
    <li><a class="qmparent" href="javascript:void(0)">Sales Orders Management</a> </li>
    <?php 
		}
		if ($cls_flag==1 and $usertype!=3){ //ENABLE CLS MODULE
		?>
    <li><a class="qmparent" href="javascript:void(0)"><?php echo $lbl_customer_loyalty_system ?></a>
      <ul>
        <li><span class="qmtitle" ><?php echo $lbl_daily_tasks ?></span></li>
        <li><a href="cls/idle.php"  target="mainFrame" >&raquo <?php echo $lbl_scan_idle ?></a></li>
        <li><a href="cls/customers.php"  target="mainFrame">&raquo <?php echo $lbl_customers_address_book ?></a></li>
        <li><a href="cls/transactions_all.php"  target="mainFrame">&raquo <?php echo $lbl_transactions_all ?></a></li>
        <li><a href="cls/idle_redeem.php"  target="mainFrame">&raquo <?php echo $lbl_idle_redeem ?></a></li>
        <li><span class="qmtitle" ><?php echo $lbl_periodic_tasks ?></span></li>
        <li><a href="cls/customer_groups.php"  target="mainFrame">&raquo <?php echo $lbl_customer_groups ?></a></li>
        <li><a href="cls/categories.php"  target="mainFrame">&raquo <?php echo $lbl_category_groups ?></a></li>
        <li><span class="qmtitle" ><?php echo $lbl_additional_modules ?></span></li>
        <?php if ($_POS ==1){ ?>
        <li><a href="main.php?pos=toggle"  target="mainFrame">&raquo <?php echo $lbl_pos_activation ?></a></li>
        <?php } ?>
        <?php if ($_CELEBRATIONS ==1){ ?>
        <li><a href="cls/modules/celebrations/celebrations_list.php?action=namedays&selected_day=<?php echo @date("d")?>&selected_month=<?php echo @date("m")?>"target="mainFrame">&raquo <?php echo $lbl_celebrations_list ?></a></li>
        <li><a href="cls/modules/celebrations/birthdays_list.php?action=birthdays&selected_day=<?php echo @date("d")?>&selected_month=<?php echo @date("m")?>"  target="mainFrame">&raquo <?php echo $lbl_birthdays_list ?></a></li>
        <?php } ?>
      </ul>
    <li><a class="qmparent" href="javascript:void(0);"><?php echo $lbl_business_analytics ?></a>
      <ul>
        <li><span class="qmtitle" ><?php echo $lbl_sales ?></span></li>
        <!-- <li><a href="cls/standard_analysis.php"  target="mainFrame">&raquo <?php //echo $lbl_reports_year ?></a></li> -->
        <li><a href="cls/reports_daily.php"  target="mainFrame">&raquo <?php echo $lbl_reports_daily ?></a></li>
        <li><a href="cls/reports_update.php?rpt=monthly"  target="mainFrame">&raquo <?php echo $lbl_reports_monhtly ?></a></li>
        <li><a href="cls/reports_update.php?rpt=annual"  target="mainFrame">&raquo <?php echo $lbl_reports_year ?></a></li>
		<li><span class="qmtitle" ><?php echo $lbl_customers ?></span></li>
		<li><a href="cls/reports_customers_analysis.php"  target="mainFrame">&raquo <?php echo $lbl_customers_analysis ?></a></li>
		<li><span class="qmtitle" ><?php echo $lbl_items_services ?></span></li>
		<li><a href="cls/reports_update.php?rpt=items_monthly"  target="mainFrame">&raquo <?php echo $lbl_items_analysis ?></a></li>
        <li><a href="cls/reports_update.php?rpt=items_annual"  target="mainFrame">&raquo <?php echo _ANNUAL_ITEMS_SALES ?></a></li>
      </ul>
     <?php 
		}
		if ($sms_flag==1 and $usertype!=3 and $_SMS == 1){ //ENABLE SMS MODULE
		?>
    <li><a class="qmparent" href="javascript:void(0)"><?php echo $lbl_short_message_service ?></a>
      <ul>
        <li><span class="qmtitle" ><?php echo $lbl_daily_tasks ?></span></li>
        <li><a href="cls/modules/sms/camp_list.php"  target="mainFrame">&raquo <?php echo $lbl_create_campaign ?></a></li>
        <li><a href="cls/modules/sms/camp_contents.php"  target="mainFrame">&raquo <?php echo _CAMPAIGN_CONTENTS ?></a></li>
        <!--<li><a href="ftp_batch_upload.php"  target="mainFrame">&raquo <?php //echo $lbl_import_file ?></a></li>-->
        <?php $sms_provider = Core::GetSmsProvider();
        if ($sms_provider == 'Clickatell') echo '<li><a href="cls/modules/sms/sms_prepare.php"  target="mainFrame">&raquo '.$lbl_send_bulk_sms.'</a></li>';
        if ($sms_provider == 'Clickatell') echo '<li><a href="cls/modules/sms/sms_outbox.php"  target="mainFrame">&raquo '.$lbl_outbox_search.'</a></li>';
        if ($sms_provider == 'SMSAPI') echo '<li><a href="cls/modules/smsapi/smsapi_prepare.php"  target="mainFrame">&raquo '.$lbl_send_bulk_sms.'</a></li>';
        if ($sms_provider == 'SMSAPI') echo '<li><a href="cls/modules/smsapi/smsapi_auto_setup.php"  target="mainFrame">&raquo '._AUTOMATED_SMS.'</a></li>';
        if ($sms_provider == 'SMSAPI') echo '<li><a href="cls/modules/smsapi/smsapi_outbox.php"  target="mainFrame">&raquo '.$lbl_outbox_search.'</a></li>';
        ?>
        
        <li><span class="qmtitle" ><?php echo $lbl_periodic_tasks ?></span></li>
        <li><a href="cls/modules/sms/camp_categories.php"  target="mainFrame">&raquo <?php echo $lbl_campaign_categories ?></a></li>
      </ul>
    </li>   
    <?php
    }
    if ($usertype!=3){
    ?> 
    <li><a class="qmparent" href="javascript:void(0);"><?php echo $lbl_parameters ?></a>
      <ul>
        <li><span class="qmtitle" ><?php echo $lbl_parameters ?></span></li>
        <li><a href="cls/branches.php"  target="mainFrame">&raquo <?php echo _BRANCHES_DEFINITION ?></a></li>
        <li><a href="cls/calibrations.php"  target="mainFrame">&raquo <?php echo $lbl_screens_calibration ?></a></li>
        <?php if ($_POS ==1){ ?>
        <li><a href="cls/modules/pos/printouts.php"  target="mainFrame">&raquo <?php echo $lbl_screens_printouts ?></a></li>
        <li><a href="cls/modules/pos/printers.php"  target="mainFrame">&raquo <?php echo $lbl_printers_setup ?></a></li>
        <?php } ?>
        <?php if ($_CELEBRATIONS ==1){ ?>
        <li><a href="cls/modules/celebrations/namedays.php"  target="mainFrame">&raquo <?php echo $lbl_celebrations ?></a></li>
        <?php } ?>
		<li><a href="core_regions.php"  target="mainFrame">&raquo <?php echo $lbl_core_regions ?></a></li>
        <li><a href="core_settings.php"  target="mainFrame">&raquo <?php echo $lbl_core_settings ?></a></li>
      </ul>
    </li>
    <?php 
		}
		?>  
    <?php  if ($usertype!=3){
				?>
    <li><a class="qmparent" href="javascript:void(0);"><?php echo $lbl_short_user_management ?></a>
      <ul>
        <li><a href="user_pass.php" target="mainFrame">&raquo <?php echo $lbl_short_pass_change ?></a></li>
        <li><a href="users.php"  target="mainFrame">&raquo <?php echo $lbl_short_users ?></a></li>
      </ul>
    </li>
    <?php
				}
				?>
	<?php  if ($usertype==1){ ?>
	    <li><a class="qmparent" href="javascript:void(0);"><?php echo $lbl_webnail_configuration ?></a>
      <ul>
      <?php if (file_exists('scripts/initialization.php')) { ?> 
	  <li><a href="scripts/initialization.php"  target="mainFrame">&raquo <?php echo $lbl_system_initialization ?></a>
	  </li> <?php } ?>
        <li><a href="logs.php"  target="mainFrame">&raquo <?php echo $lbl_log_viewer ?></a></li>
      </ul>
    </li>
	<?php } ?>
    <li class="qmclear">&nbsp;</li>
  </ul>
  <!-- Create Menu Settings: (Menu ID, Is Vertical, Show Timer, Hide Timer, On Click (options: 'all' * 'all-always-open' * 'main' * 'lev2'), Right to Left, Horizontal Subs, Flush Left, Flush Top) -->
  <script type="text/javascript">qm_create(0,true,250,250,false,false,false,false,false);</script>
  <!--[END-QM0]-->
</div>
<?php  if ($cls_flag==1 and $usertype==3){
?>
<div style="float:left; width:200px; display:block" id="quick_menu">
  <?php
	}else{	
?>
  <div style="float:left; width:200px; display:none" id="quick_menu">
    <?php	
	}
?>
    <ul class="qmmc">
      <li style="padding-left:5px">
        <input type="button" class="quick_idle" onclick="top.parent.mainFrame.location.href='cls/idle.php'" value="<?php //echo $lbl_scan_idle ?>"/>
      </li>
      <li style="padding-left:5px">
        <input type="button" class="quick_idle_redeem" onclick="top.parent.mainFrame.location.href='cls/idle_redeem.php'" value="<?php //echo $lbl_scan_idle_redeem ?>"/>
      </li>
      <li style="padding-left:5px">
        <input type="button" class="quick_new_customer" onclick="top.parent.mainFrame.location.href='cls/customers.php?cus_mode=add'" value="<?php //echo $lbl_scan_idle_redeem ?>"/>
      </li>
      <li style="padding-left:5px">
        <input type="button" class="quick_search_customer" onclick="top.parent.mainFrame.location.href='cls/customers.php'" value="<?php //echo $lbl_scan_idle_redeem ?>"/>
      </li>
      <li style="padding-left:5px">
        <input type="button" class="quick_transactions" onclick="top.parent.mainFrame.location.href='cls/transactions_all.php'" value="<?php //echo $lbl_scan_idle_redeem ?>"/>
      </li>
      <li style="padding-left:5px">
	  	<input type="button" class="quick_home" onclick="top.parent.mainFrame.location.href='main.php'" value="<?php ?>"/>
        <input type="button" class="quick_password" onclick="top.parent.mainFrame.location.href='user_pass.php'" value="<?php ?>"/>
        <?php if ($_POS ==1){ ?>
        <input type="button" class="quick_pos" onclick="top.parent.mainFrame.location.href='main.php?pos=toggle'" value="<?php ?>"/>
        <?php if ($print_receipt==1) {
		?>
		<input type="button" class="quick_printer" onclick="top.parent.mainFrame.location.href='cls/modules/pos/user_printer.php'" value="<?php ?>"/>
        <?php } }?>
      </li>
    </ul>
  </div>
  <script type="text/javascript">
<!--
    function toggle_visibility(id) {
       var e = document.getElementById(id);
	   var me = document.getElementById('menu');
       if(e.style.display == 'none'){
          e.style.display = 'block';
		  me.style.display = 'none';
	   }else{
          e.style.display = 'none';
		  me.style.display = 'block';
	   }
    }
//-->
</script>
</div>
</body>
</html>
<?php
} else {
    header('Location: login.php');
}