Location: PHPKode > projects > PHP_CON - PHP Design Framework > PHP_CON_OS/exchange/myexchange.php
<?PHP
	$rootpath=$_SERVER['DOCUMENT_ROOT'] . "/";
	include_once($rootpath . "common.php");


	$ttem->set_filenames(array("header"=>$rootpath."html_template/header.html"));
	$ttem->set_filenames(array("top_menu"=>$rootpath."html_template/exchange/exchange_menu.html"));
	$ttem->set_filenames(array("body"=>$rootpath."html_template/exchange/exchange_myexchange.html"));

	if (NSession::check_login()==true)
	{
		$ttem->set_filenames(array("pageleft"=>$rootpath."html_template/left_logined.html"));
	}
	else
	{
		$ttem->set_filenames(array("pageleft"=>$rootpath."html_template/left_login.html"));
	}
	$ttem->set_filenames(array("footer"=>$rootpath."html_template/footer.html"));

	$ttem->assign_var("APP_ROOT", $webappcfg['APPPATH']);


	//echo("<PRE>");
	//print_r($response);
	//echo("</PRE>");
	$ttem->assign_var("VAR_USERID", NSession::getuid());
	$ttem->assign_var("VAR_STATUS_COMPLETE", COMPLETED);
	$ttem->assign_var("VAR_STATUS_ACTIVE", ACTIVE);

	if ((isset($response['sqldata']) && isset($response['sqldata']['exchangeactivelist']))
		&& isset($response['sqldata']['exchangeactivelist']['exchangeitemdb']))
	{
		for ($i_exchangeitem = 0; ($i_exchangeitem < count($response['sqldata']['exchangeactivelist']['exchangeitemdb'])) && ($i_exchangeitem<5); $i_exchangeitem++)
		{
			$tempitem = $response['sqldata']['exchangeactivelist']['exchangeitemdb'][$i_exchangeitem];

			$ttem->assign_block_vars("exchangeactivelist", array(
					"ID" => $tempitem->getid(),
					"ITEMNAME" => $tempitem->getitemname(),
					"POSTTIME" => $tempitem->getposttime(),
					"VIEWTIMES" => ($tempitem->getviewtimes()=="" ? "---" : $tempitem->getviewtimes()),
					"EXCHANGETO" => "---"
				));
		}
	}

	if ((isset($response['sqldata']) && isset($response['sqldata']['exchangecompletelist']))
		&& isset($response['sqldata']['exchangecompletelist']['exchangeitemdb']))
	{
		for ($i_exchangeitem = 0; ($i_exchangeitem < count($response['sqldata']['exchangecompletelist']['exchangeitemdb'])) && ($i_exchangeitem<5); $i_exchangeitem++)
		{
			$tempitem = $response['sqldata']['exchangecompletelist']['exchangeitemdb'][$i_exchangeitem];
			$tempuser = $response['sqldata']['exchangecompletelist']['userdb'][$i_exchangeitem];

			$ttem->assign_block_vars("exchangecompletelist", array(
					"ID" => $tempitem->getid(),
					"ITEMNAME" => $tempitem->getitemname(),
					"POSTTIME" => $tempitem->getposttime(),
					"VIEWTIMES" => ($tempitem->getviewtimes()=="" ? "---" : $tempitem->getviewtimes()),
					"EXCHANGETO" => write_username($tempuser->getusername())
				));
		}
	}
	
	if ((isset($response['sqldata']) && isset($response['sqldata']['exchangemonitorlist']))
		&& isset($response['sqldata']['exchangemonitorlist']['exchangeitemdb']))
	{
		for ($i_exchangeitem = 0; ($i_exchangeitem < count($response['sqldata']['exchangemonitorlist']['exchangeitemdb'])) && ($i_exchangeitem<5); $i_exchangeitem++)
		{
			$tempitem = $response['sqldata']['exchangemonitorlist']['exchangeitemdb'][$i_exchangeitem];
			$tempuser = $response['sqldata']['exchangemonitorlist']['userdb'][$i_exchangeitem];
			$temp = $response['sqldata']['exchangemonitorlist']['exchange_monitorlistdb'][$i_exchangeitem];

			$ttem->assign_block_vars("exchangemonitorlist", array(
					"ID" => $tempitem->getid(),
					"ITEMNAME" => $tempitem->getitemname(),
					"POSTTIME" => $tempitem->getposttime(),
					"VIEWTIMES" => ($tempitem->getviewtimes()=="" ? "---" : $tempitem->getviewtimes()),
					"POSTUSER" => write_username($tempuser->getusername()),
					"MONITORID" => $temp->getid(),
				));
		}
	}	

	assignlang($ttem);

	$ttem->assign_var_from_handle("PAGE_LEFT_MENU", "pageleft");
	$ttem->assign_var_from_handle("PAGE_EXCHANGE_MENU", "top_menu");

	$ttem->pparse("header");
	$ttem->pparse("body");
	$ttem->pparse("footer");
?>
Return current item: PHP_CON - PHP Design Framework