<?php

/**
 * 	Dear developer!
 *	Never modify events.php file, it is autogenerated.
 *  Modify PHP/EventTemplates/events.txt instead.
 *
 */

 class eventclass_spare_parts  extends eventsBase
{
	function __construct()
	{
	// fill list of events
		$this->events["BeforeProcessRowList"]=true;

		$this->events["BeforeProcessRowPrint"]=true;

		$this->events["BeforeOut"]=true;


	}

//	handlers

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
				// List page: Before record processed
function BeforeProcessRowList(&$data, &$pageObject)
{

		

// Place event code here.
// Use "Add Action" button to add code snippets.

//  HOW  TO  WRITE  INTO  TXT  FILE
//$myfile = fopen("1  log_file parts before.txt", "w") or die("Unable to open file!");
//fwrite($myfile, "name = ".$_SESSION["user_name"]." \n");
//fwrite($myfile, "parts_discount = ".$_SESSION["parts_discount"]." \n");
//fwrite($myfile, "discount = ".$_SESSION["disc"]." \n");
//fwrite($myfile, "DONE  \n");
//fclose($myfile);


if ($_SESSION["user_name"]<>"")
{
$data["PRICE"] = $data["PRICE"] * $_SESSION["parts_discount"];
}


if ($_SESSION["user_name"]=="ROOT" OR $_SESSION["user_name"]=="ADMIN")
{   $pageObject->showItem("grid_checkbox"); }
else
{   $pageObject->hideItem("grid_checkbox"); }


if ($_SESSION["user_name"]=="CLIENT")
{
   $pageObject->hideItem("changepassword_link");

}



return true;
;		
} // function BeforeProcessRowList

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
				// Print page: Before record processed
function BeforeProcessRowPrint(&$data, &$pageObject)
{

		

// Place event code here.
// Use "Add Action" button to add code snippets.

if ($_SESSION["user_name"]<>"")
{
$data["PRICE"] = $data["PRICE"] * $_SESSION["parts_discount"];
}


return true;
;		
} // function BeforeProcessRowPrint

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
				// Before Export Record
function BeforeOut(&$data, &$values, &$pageObject)
{

		

// Place event code here.
// Use "Add Action" button to add code snippets.


if ($_SESSION["user_name"]<>"")
{
$data["PRICE"] = $data["PRICE"] * $_SESSION["parts_discount"];
}


return true;
;		
} // function BeforeOut

		
		
		
		
		
		
		
		
		



}
?>
