<?php use_helper('UrlFunctions'); ?>
<script>

acutalizarEspecialidad = function(destino,elm){
  $(destino).options.length = 1;
  var url = '<?=buildUrl('ajax/request')?>';
  var pars = 'type=getEspecialidad&nombreElm='+destino+'&value='+elm.value;
  
	var myAjax = new Ajax.Request(
                            		url, 
                            		{
                            			method: 'get', 
                            			parameters: pars, 
                            			onComplete: actualizaJSON
                            		});
}

</script>
<script>
actualizaJSON = function(request, json){
  var numeroElementos = json.length;
  for (var i = 0; i < numeroElementos; i++){
    if($(json[i][0])){
  	  switch ($(json[i][0]).tagName){
  	    case 'TD'      : Element.update(json[i][0], json[i][1]); break;
  	    case 'INPUT'   : $(json[i][0]).value=json[i][1]; break;
  	    case 'SELECT'  : 
  	      var objDDL = $(json[i][0]);
  	      if(typeof(cont) == 'undefined'){
  	        var cont = 0;
  	        objDDL.options.length = 1;
  	      }
  	      var a_contentValues = json[i][1].split("_;_");
      		var value	= a_contentValues[0];
      		var text	= a_contentValues[1];
  	      var option	= new Option(text,value);
      		try{
      			objDDL.add(option,null);
      		}catch (e){
      			objDDL.add(option,-1);
      		}
  	      cont++;
  	    break;
  	  }
    }else{
      if(json[i][0].indexOf("function") > -1){
        eval("scriptEval = "+json[i][0]);
        scriptEval();
      }
    }
  }
}
</script>
<?php


$o_IngresoDiversosSystemClass = new IngresoDiversosSystemClass(new SucursalBean());
$a_Sucursal = $o_IngresoDiversosSystemClass->getSucursal();

$o_IngresoDiversosBean = new IngresoDiversosBean();
$o_IngresoDiversosBean->setIdIngreso($id);
$o_class = new IngresoDiversosBL();
$o_ObjectBean = $o_class->busquedaIngresoDiversos($o_IngresoDiversosBean);


 ?>
 
<img src="/images/common/spacer.gif" width="10">
<table class="cuerpo" width="98%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="0">
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
          <td class="titleBody">
            <li>Ingresos</li>
            <span class="subtitle"><I>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:::&nbsp;Mostrar Ingresos Diversos</I></span></td>
          <td align="right" valign="baseline">&nbsp;</td>
        </tr>
      </table>
    </td>
  </tr>
      <script type="text/javascript">
        validatePass = function(){
          
            valid.onSubmit = false;
          
        }
      </script>
  <tr>
    <td valign="top">
      <form id="form1" name="form1" method="POST">
      <input type="hidden" name="control" value="1">
        <table hspace="20px" class="marco" width="99%">
          <tr>
            <td valign="top">
             <table width="100%" border="0" cellpadding="5" cellspacing="0" style="background: #E3E9E2">
               
          	  <tr>
    		     <td height="0">
    			   <fieldset>
    				<legend class="fielsettex"><I>Datos Generales</I></legend>
    			  <table width="100%" border="0" cellspacing="6" cellpadding="0">
				 <tr>
                  <td nowrap="nowrap" width="10%" class="cabecera"><label class="label req" for="txtAdministrador" >Sucursal</label></td>
  				    <td nowrap="nowrap"><label class="label1" for="txtEspecialidadIdD">
                    	<?php foreach ($a_Sucursal as $iKey => $o_SucursalBean){ 
                         if($o_SucursalBean->getIdSucursal() == $o_ObjectBean->getIdSucursal()){
                           echo $o_SucursalBean->getDescripcion();
                           }
                          }
                   	 ?></label>
                   				</td>
                <td nowrap="nowrap" width="8%" colspan="2" class="cabecera">&nbsp;</td>
                </tr>
                <tr>
					<td nowrap="nowrap" width="10%" class="cabecera"><label class="label req" for="txtEstado" >Fecha Ingreso</label></td>
					<td width="38%" nowrap="nowrap"><label class="label1" for="DocumentoReferencia"><?=$o_ObjectBean->getFechaIngreso() ?></label></td>
				</tr>
                <tr>
	                <td nowrap="nowrap" width="10%" class="cabecera"><label class="label req" for="txtDescripcion" >Descripcion</label></td>
	  				<td nowrap="nowrap" width="38%"><label class="label1" for="txtDescripcion" ><?=$o_ObjectBean->getDescripcion() ?></label></td>
				</tr>
				<tr>
	                <td nowrap="nowrap" width="10%" class="cabecera"><label class="label req" for="txtDocumento" >Documento Ref.</label></td>
	  				<td width="38%" nowrap="nowrap"><label class="label1" for="DocumentoReferencia"><?=$o_ObjectBean->getDocumentoReferencia() ?></label></td>
				</tr>
				<tr>
	                 <td nowrap="nowrap" width="10%" class="cabecera"><label class="label req" for="txtMonto" >Monto</label></td>
	  				 <td width="38%" nowrap="nowrap"><label class="label1" for="Monto"><?=$o_ObjectBean->getMonto() ?></label></td>
	  		  </tr>
	  		  <tr>
	  				 <td nowrap="nowrap" width="10%" class="cabecera"><label class="label req" for="txtEstado" >Estado</label></td>
					<td width="38%" nowrap="nowrap"><label class="label1" for="cboEstado"><? if ($o_ObjectBean->getEstado()=='A'){ echo "Activo";} else { echo "Inactivo";}?></label></td>
			  </tr>
			  
				</table>
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td><img src="/images/common/spacer.gif" width="10"></td>
					</tr>
					<tr>
					 <td align="center">
						<input type="hidden" name="typeSubmit" id="typeSubmit">								 
						
						<input class="button" type="button" value="Cancelar" onclick="parent.objMainTab.windowsCloseAll();"/>
					  </td>
					 </tr>
					  <tr>
						<td height="10">&nbsp;</td>
						</tr>
					 </table>
    					</fieldset>				
    				</td>
                </tr>
      </table>
      </form>
			<script type="text/javascript">
				var valid = new Validation('form1', {immediate : true});
			</script>
    </td>
  </tr>
</table>
