Location: PHPKode > projects > PushOk SEMA > html/web/default.php
<?PHP
// Pushok's SEMA (Small Enterprise Management Application)
//
// Copyright (C) 2004 Pushok Software http://www.pushok.com
//
// LICENSE
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License (GPL)
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// To read the license please visit http://www.gnu.org/copyleft/gpl.html

require_once('web/html_gant.pinc');

class web_Default extends web_Layout 
{
	function Info()
	{
		global $arProjectStatus, $nIdProject, $arProjectTT;
		
		$this->formStart("","multipart");
		
		// get object children (tasks)	
		$_oIn = array('idcontact_current'=>$_SESSION['iduser'], 'idobjects'=>array(0));
		$GLOBALS['LIB_DISPATCHER']->ProcessMessage("LM_OBJECT_GET_CHILD", $_oIn, $arTasksIds=array());

		$nDayInSec = 86400;
		$nDayOfWeek = date("w");
		$dtStart = 0;
		$dtEnd = 0;
		$dtNow = time();
		if ($nDayOfWeek==0) {
			$dtStart = date("Y-m-d",$dtNow+$nDayInSec);
			$dtEnd = date("Y-m-d",$dtNow+7*$nDayInSec);
		}
		elseif ($nDayOfWeek==6) {
			$dtStart = date("Y-m-d",$dtNow+2*$nDayInSec);
			$dtEnd = date("Y-m-d",$dtNow+8*$nDayInSec);
		}
		else {
			$dtStart = date("Y-m-d",$dtNow-($nDayOfWeek-1)*$nDayInSec);
			$dtEnd = date("Y-m-d",$dtNow+(7-$nDayOfWeek)*$nDayInSec);
		}
		// find necessary data
		$_oIn = array('idcontact_current'=>$_SESSION['iduser'], 'idtasks'=>$arTasksIds, 'idcontacts'=>array($_SESSION['iduser']),
		'bdate'=>$dtStart, 'edate'=>$dtEnd);
		$GLOBALS['LIB_DISPATCHER']->ProcessMessage("LM_TASK_SEARCH_DIAGRAM", $_oIn, $_oOut=array());

		if (isset($_oOut['data']) && count($_oOut['data'])) {
			$this->formSection(_LW("Tasks' calendar"), "fullspan");
			$this->formItem("", "subitem");
			$oGant = new web_Resource();
			$oGant->m_arData = $_oOut;
			$oGant->Init();
			$oGant->Show();
	        $this->formEnd();
		}
                
		$oIn = array('layout' => &$this);
		$GLOBALS['WEB_DISPATCHER']->ProcessMessage("WM_DEFAULT_VIEW_SHOW", $oIn, $oTemp=array());
		
		$this->formEnd();
		?>
		<?PHP
	}
}

$oPage = new web_Default;
$oPage->m_windowHeader = _LW("Home");
$oPage->WebStack("default.php", $oPage->m_windowHeader, $oPage->m_windowHeader, web_GetPageGetParams());

if ( !isset($_SESSION['iduser']) )
	web_RedirectRelative("sema.php");

$oPage->RenderPage();
?>
Return current item: PushOk SEMA