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

/*
subscription: contain necessary instruments for creating notifacation rule.
*/

class web_Contact extends web_Layout 
{
	function Info()
	{
		global $nIdContact;
		
		$this->formStart(_LW("Notifications"));
		echo "<FORM method=post>";
		echo "<INPUT type=\"hidden\" name=\"idform\" value=\"FM_CONTACT_NOTIFICATION_MODIFY\"></INPUT>\n";
		echo "<INPUT type=\"hidden\" name=\"onsuccess\" value=\"?".web_GetPageGetParams()."\"></INPUT>\n";
		echo "<INPUT type=\"hidden\" name=\"onerror\" value=\"?".web_GetPageGetParams()."\"></INPUT>\n";
		
		$GLOBALS['LIB_DISPATCHER']->ProcessMessage("LM_CONTACT_NOTIFICATION_GET", $oIn = array('idcontact_current'=>$_SESSION['iduser']), $oOut = array());
		$sDetails = "";
		$sInterest = "";
		if ( isset($oOut['notify_rule']) && count($oOut['notify_rule']) )
		{
			$sDetails = $oOut['notify_rule']['details_level'];
			$sInterest = $oOut['notify_rule']['interest_level'];
		}
		$nFieldValue = 0;
		if ( strpos($sDetails, 'w') !== FALSE )
			$nFieldValue = 1;
		$this->formInputItem(_LW("Details all warnings"), "checkbox", "details_w", $nFieldValue);
		
		$nFieldValue = 0;
		if ( strpos($sDetails, 'n') !== FALSE )
			$nFieldValue = 1;
		$this->formInputItem(_LW("Details all notifications"), "checkbox", "details_n", $nFieldValue);
		
		$nFieldValue = 0;
		if ( strpos($sInterest, 'g') !== FALSE )
			$nFieldValue = 1;
		$this->formInputItem(_LW("Interest for group"), "checkbox", "interest_g", $nFieldValue);
		
		$nFieldValue = 0;
		if ( strpos($sInterest, 'a') !== FALSE )
			$nFieldValue = 1;
		$this->formInputItem(_LW("Interest for all"), "checkbox", "interest_a", $nFieldValue);		
		
		$this->formInputItem(_LW("Modify"), "submit");
		$this->formEnd();
		echo "</FORM>";
		?>
		<?PHP
	}
}

$oPage = new web_Contact;
$oPage->m_windowHeader = _LW("Notifications");
$oPage->WebStack("contact_notifications.php", $oPage->m_windowHeader, $oPage->m_windowHeader, web_GetPageGetParams());

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

$oPage->m_menuFLvl = "Contacts";
$oPage->RenderPage();

?>
Return current item: PushOk SEMA