<?php 
class eventclass_inf_cobros  extends eventsBase
{ 
	function eventclass_inf_cobros()
	{
	// fill list of events
		$this->events["ProcessValuesAdd"]=true;

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


//	onscreen events


	}
// Captchas functions	

//	handlers

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
				// Process record values
function ProcessValuesAdd(&$values,&$pageObject)
{

		global $conn;
$strSQLExists = "select DATE(NOW()) as fecha";
$rsExists = db_query($strSQLExists,$conn);
$data=db_fetch_array($rsExists);
$values["fecha"] = $data["fecha"];
// ===========================================================
$usuario = $_SESSION["UserName"];
$sql_usuario = "select * from usuario where nick='$usuario'";
$result_usuario = db_query($sql_usuario,$conn);
$data_usuario=db_fetch_array($result_usuario);
//=============================
$idusuario = $data_usuario['idusuario'];
$sql_movimiento = "select * from movimiento_caja where idusuario=$idusuario and estado = 'ABIERTO'";
$result = db_query($sql_movimiento,$conn);
$linea=db_fetch_array($result);
$values["idmovimiento"] = $linea['idmovimiento'];
;		
} // function ProcessValuesAdd

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		

		
		
		
		
		
				// Print page: Before process
function BeforeProcessPrint(&$conn,&$pageObject)
{

		if (@$_REQUEST["pdf_mode"] == "1") {
    // Aplicamos el filtro que viene desde generar.php
    $strWhereClause = $_REQUEST["where"];
    
    if($_REQUEST["order"]) {
        $strOrderBy = $_REQUEST["order"];
    }
}
;		
} // function BeforeProcessPrint

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
//	onscreen events

} 
?>
