ultimix
stat_access.php
Go to the documentation of this file.
1 <?php
2 
3  /*
4  * This source code is a part of the Ultimix Project.
5  * It is distributed under BSD license. All other third side source code (like tinyMCE) is distributed under
6  * it's own license wich could be found from the corresponding files or sources.
7  * This source code is provided "as is" without any warranties or garanties.
8  *
9  * Have a nice day!
10  *
11  * @url http://ultimix.sorceforge.net
12  *
13  * @author Alexey "gdever" Dodonov
14  */
15 
27 
38  var $NativeTable = '`umx_stat`';
39 
50  var $Database = false;
51  var $Security = false;
52 
63  function __construct()
64  {
65  try
66  {
67  $this->Database = get_package( 'database' , 'last' , __FILE__ );
68  $this->Security = get_package( 'security' , 'last' , __FILE__ );
69  }
70  catch( Exception $e )
71  {
72  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
73  }
74  }
75 
98  function add_stat( $Key , $Value )
99  {
100  try
101  {
102  if( is_array( $Key ) )
103  {
104  $Key = implode( '#' , $Key );
105  }
106 
107  $Key = $this->Security->get( $Key , 'string' );
108  $Key = str_replace( '[sharp]' , '#' , $Key );
109  $Value = $this->Security->get( $Value , 'string' );
110 
111  $this->Database->insert(
112  $this->NativeTable , '`key` , `value` , creation_date' , "\"$Key\" , \"$Value\" , NOW()"
113  );
114 
115  $this->Database->commit();
116  }
117  catch( Exception $e )
118  {
119  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
120  }
121  }
122 
149  function get_stat( $Fields , $Condition )
150  {
151  try
152  {
153  return(
154  $this->Database->select( $Fields , $this->NativeTable , $Condition )
155  );
156  }
157  catch( Exception $e )
158  {
159  $a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
160  }
161  }
162  }
163 
164 ?>