<?php
$pear_path = "/home/zikay/PEAR"; 
set_include_path(get_include_path() . PATH_SEPARATOR . $pear_path); 

include_once('hdr_general.php');
/* **************************************************************************************************** */
if (!isset($_REQUEST["module"])) $_REQUEST["module"] = "general";
if (!isset($_REQUEST["task"])) $_REQUEST["task"] = "main";
$pubmodule = $_REQUEST["module"];
$pubtask = $_REQUEST["task"];
$pubitemid = $_REQUEST["itemid"];
if ($pubmodule!=$_SESSION['Xprevmodule']) {
  $_SESSION['Xprevmodule']=$pubmodule;
  $_SESSION['Xactivetab']=0;
}
/* **************************************************************************************************** */
?>

<? if (($pubuserrole>0)||($pubuserpkey!="")) { ?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="css/<?=$_SESSION['Xcssfile'];?>" type="text/css" media=all>
<title>PMS-EVO</title>
<script type="text/javascript" src="jquery-1.2.2.pack.js"></script>

<style type="text/css">

div.htmltooltip{
position: absolute; /*leave this and next 3 values alone*/
z-index: 1000;
left: -1000px;
top: -1000px;
background: #272727;
border: 3px solid black;
color: white;
padding: 3px;
width: 250px; /*width of tooltip*/
}

</style>

<script type="text/javascript" src="htmltooltip.js">

/***********************************************
* Inline HTML Tooltip script- by JavaScript Kit (http://www.javascriptkit.com)
* This notice must stay intact for usage
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
***********************************************/

</script>
</head>
<body leftmargin=5 topmargin=5 style="background: #dddddd url(gfx/background.png);">

<table border=0 cellspacing=0 cellpadding=0 width=960 align="center">
<tr valign=top>
<td valign=top colspan=2 width=960 height=60px class=banner style="color: black; text-align:left;">&nbsp;</td>
</tr>
<tr valign=top>
<td valign=top width=700 height=20px style="font-family: verdana, arial; font-size: 11px; font-weight: bold; line-height: 20px; text-align: left; vertical-align: bottom; background: #dddddd url(gfx/masthead_bottom_left.png) no-repeat left; color: black;">
<? if ($pubprojectid!="") { echo "&nbsp;PROJECT: <a href=\"".$_SERVER['PHP_SELF']."?module=project&task=view\">"."<span id='projectname' title='".$pubprojectdesc."' style='cursor: help;'>".$pubprojectid." - ".substr($pubprojectname,0,60)."</span>"; } else { echo "&nbsp;PROJECT: NONE SELECTED"; } ?>
</td>
<td valign=top width=260 height=20px style="font-family: verdana, arial; font-size: 11px; font-weight: bold; line-height: 20px; text-align: right; vertical-align: bottom; background: #dddddd url(gfx/masthead_bottom_right.png) no-repeat left; color: black;">
<? echo "<span id='username' title='".$pubgroupname."' style='cursor: help;'>".dottedstr($pubuserfullname,30)."</span>&nbsp;"; ?>
</td>
</tr>

<tr valign=top>
<td valign=top colspan=2 width=960 height=33px>
<? 
include_once('menus.php');
?>
</td>
</tr>
<tr valign=top>

<!-- left bar (login, menus, etc) -------------------------------------------------------------------- -->
<!--td valign=top width=180 class=columnleft-->
<? 
//include_once('cbox_login.php');
//include_once('cbox_menus.php');
?>
<!--/td-->

<!-- central area ------------------------------------------------------------------------------------ -->
<td valign=top colspan=2 width=960>
<?
// and the rest..
if (($pubmodule=="general")&&($pubtask=="main")) {
  if ($pubprojectid!="") {
    $pubmodule="project";
    $pubtask="dashboard";
    include_once('controllers/projectController.php');
  } else {
    $pubmodule="news";
    $pubtask="list";
    include_once('controllers/newsController.php');
    //$pubmodule="project";
    //$pubtask="dashboard";
    //include_once('controllers/projectController.php');
  }

} else if ($pubmodule=="login") {	// will be succeeded by main
    include_once('login.php');

} else if ($pubmodule=="main") {
    include_once('controllers/mainController.php');

} else if ($pubmodule=="project") {
    include_once('controllers/projectController.php');

} else if ($pubmodule=="news") {
    //include_once('news.php');
    include_once('controllers/newsController.php');

} else if ($pubmodule=="mbl") {
    include_once('controllers/mblController.php');

} else if ($pubmodule=="mro") {
    include_once('controllers/mroController.php');

} else if ($pubmodule=="itq") {
    include_once('controllers/itqController.php');

} else if ($pubmodule=="qtn") {		// might not be used
    include_once('controllers/qtnController.php');

} else if ($pubmodule=="qev") {
    include_once('controllers/qevController.php');

} else if ($pubmodule=="po") {
    include_once('controllers/poController.php');

} else if ($pubmodule=="do") {
    include_once('controllers/doController.php');

} else if ($pubmodule=="invoice") {
    include_once('controllers/invoiceController.php');

} else if ($pubmodule=="report") {
    include_once('controllers/reportController.php');

} else if ($pubmodule=="supplier") {
    include_once('controllers/supplierController.php');

} else if ($pubmodule=="trade") {
    include_once('controllers/tradeController.php');

} else if ($pubmodule=="client") {
    include_once('controllers/clientController.php');

} else if ($pubmodule=="subcon") {
    include_once('controllers/subconController.php');

} else if ($pubmodule=="access") {
    include_once('controllers/accessController.php');

} else if ($pubmodule=="user") {
    include_once('controllers/userController.php');

} else if ($pubmodule=="system") {
    include_once('controllers/systemController.php');

} else if ($pubmodule=="admin") {	// not used??
    include_once('admin.php');

} else {
    include_once('mbox_invalidmodule.php');
}
?>
</td>

</tr>
<tr>
<td valign=bottom colspan=2 class=newscontent>
<? $resettime=settings_getsetting('system_gui_logincountdate'); ?>
<? $logincount=stats_logincount($resettime); ?>
<br>
<p align=center>
KEMBANG SERANTAU SDN BHD
</p>
</td>
</tr>
</table>
</body>
</html>

<? $_SESSION['Xpreviousurl']=$_SERVER['PHP_SELF']; ?>
<? // do here instead of top of page so we get inputController.php as prev url when needed ?>

<? } else { ?>

<? include_once('login.php'); ?>

<? } ?>
