<?php
	defined( "_VALID_PAGE_MONITOR" ) or die (_NODIRECTACCESS);
	
	DEFINE('_PARAM_DATE', "date");
	DEFINE('_PARAM_PROD', "prod");
	DEFINE('_PARAM_PAGE', "page");
	DEFINE('_PARAM_SHOWPAGEHISTORY', "showPageHistory");	
	DEFINE('_PARAM_SCALE', "scale");
	DEFINE('_PARAM_ONLY_READY_PAGES', "onlyreadypages");
	
	class Params{
		public $selectedDate;
		public $selectedProduct;
		public $selectedPage;
		public $showPageHistory;
		public $onlyReadyPages;
		public $scale;
		
		function Params(){
			$this->selectedDate = $_GET[_PARAM_DATE];
			$this->selectedProduct = $_GET[_PARAM_PROD];
			$this->selectedPage = $_GET[_PARAM_PAGE];
			$this->showPageHistory = NULL != $_GET[_PARAM_SHOWPAGEHISTORY] ? true : false;
			$this->onlyReadyPages = NULL != $_GET[_PARAM_ONLY_READY_PAGES] ? true : false;
			$this->scale = $_GET[_PARAM_SCALE] != NULL?$_GET[_PARAM_SCALE]:1;
		}
		
		public function stringOfParametersFromGet($get){
			$ret = "";
			$a = array( _PARAM_DATE, _PARAM_PROD, _PARAM_PAGE, _PARAM_SHOWPAGEHISTORY, _PARAM_ONLY_READY_PAGES );
			foreach( $get as $key => $value ){
				if( in_array($key, $a) )
					$ret .= '&amp;' . $key . '=' . $value;
			}
			return $ret;
		}
	}
?>