Location: PHPKode > projects > PushOk SEMA > html/web/time_track/time_track_main.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

$nIdParent = 0;
if ( isset($_GET['idparent']) && $_GET['idparent']>0 )
	$nIdParent = $_GET['idparent'];
	
class web_TimeTrack extends web_Layout 
{
	function Info()
	{
		global $nIdParent;
		$GLOBALS['LIB_DISPATCHER']->ProcessMessage("LM_CONTACT_SHORTINFO", $oIn = array('idcontact_current'=>$_SESSION['iduser']), $arContacts);
		
		$oIn = array('idcontact_current' => $_SESSION['iduser'], 'idparent'=>$nIdParent);
		$GLOBALS['LIB_DISPATCHER']->ProcessMessage("LM_TIMETRACK_SEARCH", $oIn, $arTT);
		
		$this->tableStart();
		$arHeader = array( 
			array('value'=>_LW('Parent title'), 'colspan'=>0, 'align'=>'left'),
			array('value'=>_LW('Comment'), 'colspan'=>0, 'align'=>'left'),
			array('value'=>_LW('Start'), 'colspan'=>0, 'align'=>'left'),
			array('value'=>_LW('End'), 'colspan'=>0, 'align'=>'left'),
			array('value'=>_LW('Worker'), 'colspan'=>0, 'align'=>'left'),
			array('value'=>_LW('Work volume'), 'colspan'=>0, 'align'=>'left'),
							);
		$this->tableHeader($arHeader);
		if ( count($arTT['tt']) )
		{	
			foreach ( $arTT['tt'] as $nIdTT => $arTTInfo )
			{
				$this->tableRow();
				$sSingle = "";
				if (isset($arTTInfo['idparent']) && $arTTInfo['idparent']>0) {
					$_oIn = array('idcontact'=>$_SESSION['iduser'], 'idobject'=>$arTTInfo['idparent'], 'mask'=>'R');
					$GLOBALS['LIB_DISPATCHER']->ProcessMessage("LM_CONTACT_HAS_MASK", $_oIn, $_oOut=array());
					if (isset($_oOut['result']) && $_oOut['result'])
						$sSingle = $this->singleItem("link",$arTTInfo['parent_title'], array('href'=> "?page=/web/object_view.php&id=".$arTTInfo['parent_object']));
				}
				if (!strlen($sSingle))
					$this->tableCol($this->singleItem("string",$arTTInfo['parent_title']));
				else 
					$this->tableCol($sSingle);
				$this->tableCol($this->singleItem("string",$arTTInfo['title']));
				$this->tableCol($this->singleItem("date",$arTTInfo['start']));
				$this->tableCol($this->singleItem("date",$arTTInfo['end']));
				$this->tableCol($this->singleItem("string",$arContacts['contacts'][$arTTInfo['idworker']]));
				$this->tableCol($this->singleItem("string",$arTTInfo['work_volume']));
			}
		}
		$this->tableEnd();
		?>
		<?PHP
	}
}

$oPage = new web_TimeTrack;
$oPage->m_windowHeader = _LW("Time track");
$oPage->WebStack("time_track_main.php", $oPage->m_windowHeader, $oPage->m_windowHeader, web_GetPageGetParams());

if ( !isset($_SESSION['iduser']) )
	web_RedirectRelative("sema.php");
	
$oPage->m_menuFLvl = "Time track";
$oPage->RenderPage();

?>
Return current item: PushOk SEMA