<?php
//include "clase.conexion.php";
class clsListaAsignacionVenta extends clsConexion{
	public $varTitulo = "LISTADO DE ASIGNACION DE REPARTO";
	function FormuBusqueda() {
		$varTabla=array("id"=>"tabla", "name"=>"table", "tamano"=>"430", "clase"=>"FormTitulo", "titulo"=>$this->varTitulo,
						"formu"=>array("id"=>"form", "name"=>"form", "metodo"=>"POST", "onsubmit"=>"return false;"),						
						"ocult"=>array(array("tipo"=>"oculto", "id"=>"titu", "name"=>"titu", "valor"=>$this->varTitulo),
									   array("tipo"=>"oculto", "id"=>"opt", "name"=>"opt", "valor"=>$Opcion),
									   array("tipo"=>"oculto", "id"=>"acod", "name"=>"acod", "valor"=>$_GET["acod"]),
									   array("tipo"=>"oculto", "id"=>"anom", "name"=>"anom", "valor"=>$_GET["anom"])
									  ),
						"conte"=>array(array("titulo"=>"Codigo :", "clase1"=>"FormCampo1", "clase2"=>"interior",
											 "campo"=>array("tipo"=>"varios",
															"contenido"=>array(array("tipo"=>"texto", "id"=>"cod", "name"=>"cod", 
																					 "alinear"=>"center", "ancho"=>"80"),
																			   array("tipo"=>"simple", "valor"=>"Nro. Asignacion"))
														 	)
											 ),									   
									   array("titulo"=>"Vehiculo :", "clase1"=>"FormCampo1", "clase2"=>"interior",
											 "campo"=>array("tipo"=>"varios",
															"contenido"=>array(array("tipo"=>"text", "id"=>"vcod1", "name"=>"vcod1", "valor"=>NULL, 
																					 "ancho"=>"50", "alinear"=>"center", 
																					 "blur"=>"xajax_seleccionar_vehiculo(this.value,'vcod1','vnom1')", 
																					 "dclick"=>"fn_cargar_listado_vehiculo('vcod1', 'vnom1')"),
																			   array("tipo"=>"text", "id"=>"vnom1", "name"=>"vnom1", "valor"=>NULL, 
																					 "ancho"=>"250", "clase"=>"inputDisable", "locked"=>"SI")
																			   )
															)
											 ),	
									   array("titulo"=>"Conductor :", "clase1"=>"FormCampo1", "clase2"=>"interior",
											"campo"=>array("tipo"=>"varios",
														   "contenido"=>array(array("tipo"=>"text", "id"=>"ccod1", "name"=>"ccod1", "valor"=>NULL, 
																					"ancho"=>"50",  "alinear"=>"center", 
																					"blur"=>"xajax_seleccionar_conductor(this.value, 'ccod1', 'cnom1')", 
																					"dclick"=>"fn_cargar_listado_conductor('ccod1', 'cnom1')"),
																			  array("tipo"=>"text", "id"=>"cnom1", "name"=>"cnom1", 
																					"ancho"=>"250", "clase"=>"inputDisable", "locked"=>"SI")
																			  )
														   )
										   ),
									 array("titulo"=>"F.Inicial :", "clase1"=>"FormCampo1", "clase2"=>"interior",
											 "campo"=>array("tipo"=>"varios",
															"contenido"=>array(array("tipo"=>"texto", "id"=>"fini", "name"=>"fini", "alinear"=>"center"))
														 	)
											 ),
									   array("titulo"=>"F.Final :", "clase1"=>"FormCampo1", "clase2"=>"interior",
											 "campo"=>array("tipo"=>"varios",
															"contenido"=>array(array("tipo"=>"texto", "id"=>"ffin", "name"=>"ffin", "alinear"=>"center"))
														 	)
											 ),					   
								   ),
					  "boton"=>array(array("tipo"=>"submit", "id"=>"bcon", "name"=>"bcon", "ancho"=>"100", "texto"=>"Buscar",
					  					   "clase"=>"boton_buscar", "click"=>"javascript:xBuscarJS()")
									 )
					);
		return $this->setTablaForm($varTabla);
		}
	function GridDatos($varForm  = NULL, 
					   $varField = NULL, 
					   $varOrder = NULL
					   )  {
						  
		$varFie = (isset($varField) && $varField<>'')? "'$varField'":"NULL";
		$varOrd = (isset($varOrder) && $varOrder<>'')? "'$varOrder'":"NULL";
		$varCod = (isset($varForm["cod"]) && $varForm["cod"]<>'')?$varForm["cod"]:"NULL";
		$varVeh = (isset($varForm["vcod1"]) && $varForm["vcod1"]<>'')?$varForm["vcod1"]:"NULL";
		$varCon = (isset($varForm["ccod1"]) && $varForm["ccod1"]<>'')?$varForm["ccod1"]:"NULL";
		$varIni = (isset($varForm["fini"]) && $varForm["fini"]<>'')?"'".FechaMySql($varForm["fini"])."'":"NULL";
		$varFin = (isset($varForm["ffin"]) && $varForm["ffin"]<>'')?"'".FechaMySql($varForm["ffin"])."'":"NULL";
		
		$sql = "call spQuery_Asignacion($varCod, $varVeh, $varCon, $varIni, $varFin, $varFie, $varOrd);";
		$varTabla=array("id"=>"theTable", "name"=>"theTable", "tamano"=>"800", "sql_cab"=>$sql,	"pages"=>20,
					    "conte"=>array(array("titulo"=>"IDE",   "ancho"=>"30", "alinear"=>"center"), 
									   array("titulo"=>"FECHA", "ancho"=>"30", "alinear"=>"center", "fijo"  =>"SI"),
									   array("titulo"=>"CVEH",  "ancho"=>"30", "alinear"=>"center", "oculto"=>"SI"),
									   array("titulo"=>"PLACA", "ancho"=>"30", "alinear"=>"center", "fijo"=>"SI"),
									   array("titulo"=>"VEHICULO", "ancho"=>"100", "fijo"=>"SI", "funcion"=>array("contar")),
									   array("titulo"=>"CCON", "ancho"=>"30", "alinear"=>"center", "oculto"=>"SI"),
									   array("titulo"=>"CONDUCTOR","ancho"=>"100", "fijo"=>"SI"),
									   array("titulo"=>"DOC'S", "ancho"=>"50", "alinear"=>"right", "decimal"=>"2"),
									   array("titulo"=>"MONTO", "ancho"=>"50", "alinear"=>"right", "decimal"=>"2", "funcion"=>array("autosuma")),
									   array("titulo"=>"FCREADO", "ancho"=>"100", "oculto"=>"SI"),
									   array("titulo"=>"FUPDATE", "ancho"=>"100", "oculto"=>"SI"),
									   array("titulo"=>"UCREADO", "ancho"=>"100", "alinear"=>"center", "oculto"=>"SI"),
									   array("titulo"=>"UUPDATE", "ancho"=>"100", "alinear"=>"center", "oculto"=>"SI")
									   ), 
						"boton"=>array(array("tipo"=>"img", "img"=>"images/16x16/add.png", 
											 "toltip"=>array(array("valor"=>"HAGA CLICK PARA <b>SELECCIONAR</b>"),
															 array("valor"=>"<br><b>Nro. Asignacion :</b> "),
															 array("valor"=>0, "tipo"=>"INDEX"),
															 array("valor"=>"<br><b>Fecha : </b>"),
															 array("valor"=>1, "tipo"=>"INDEX"),
															 array("valor"=>"<br><b>Monto : </b>"),
															 array("valor"=>8, "tipo"=>"INDEX"),
															 ),
											 "click"=>array("funcion"=>"seleccionar",
															"param"=>array(array("valor"=>0, "tipo"=>"INDEX"),
																		   array("valor"=>1, "tipo"=>"INDEX"),
																		   array("valor"=>3, "tipo"=>"INDEX"),
																		   array("valor"=>$_GET["acod"], "tipo"=>"TEXTO"),
																		   array("valor"=>$_GET["anom"], "tipo"=>"TEXTO")
																		   )
															)
											),
										)
							);
		return $this->SetGridTabla2($varTabla);
		}
	}
?>