<?session_start();
require('../valtiempoinact.php');
require("../conectar.php");	
$palabra=$_POST["idobra"];
$val=$_GET['val'];
if($val==1){
$palabra=$_GET['palabra'];
}
$link=$_POST['link'];
$usuario=$_SESSION["usuario_login"];
$css="<style type='text/css'>.tabla{font-family:arial;color:#000000;font-size:12px;}.sbtitulo{font-size:15px;color:#A4A4A4;-moz-box-shadow:inset 0 0 20px #BDBDBD;-webkit-box-shadow:inset 0 0 20px #BDBDBD;box-shadow:inset 0 0 20px #BDBDBD;padding-top:3px;padding-bottom:3px;padding-left:15px;font-weight:bold;text-align:left;}.dato{padding-left:0px;}</style>";
?>
<link rel="stylesheet" href="css/estilos.css" type="text/css">
<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="js/scroll.js"></script>
<script type="text/javascript" src="js/aplicaciones.js"></script>
<style>
.inputsa{height:20px;width:50px;border:solid 1px #A4A4A4;font-family:arial;font-size:14px;}
.inputprov{height:20px;width:140px;border:solid 1px #A4A4A4;font-family:arial;font-size:14px;padding-left:15px;}
#verreq {
     /*width:628px;*/
     height:600px;
     overflow:auto;
}
option.cursiva
{
    font-style: italic;
}
</style>
<script type="text/javascript">
	     window.onload = function(){
		 new JsDatePick({
			useMode:2,
			target:"fi",
			dateFormat:"%Y-%m-%d"
		    });
			new JsDatePick({
			useMode:2,
			target:"ff",
			dateFormat:"%Y-%m-%d"
		    });
	    };

function valida(){
  	if (document.datosregistro.operacion.selectedIndex==0){ 
      	alert("Debe seleccionar una operacion.") 
      	document.datosregistro.operacion.focus() 
      	return false; 
   	}else{
	 return true;
	}
}				
function cargareq(f,n){
   var uni=document.getElementById('unidadreq'+n).value;
   var mat=document.getElementById('std'+n).value;
   //uni.length=0;
   <?
    $sqlm="SELECT idmaterial,unidad FROM material";
	$rdm=mysql_query($sqlm);
	while($ldm=mysql_fetch_object ($rdm)){
  ?>
       if(mat=='<?echo$ldm->idmaterial;?>'){
			document.getElementById('unidadreq'+n).value="<?echo$ldm->unidad;?>";		 
		}
  <?}?>
}
function depas(id,n){
var origen=document.getElementById(id);
var sel=origen.selectedIndex;
var tx=origen[sel].text;
var v=origen[sel].value;
var destino=document.getElementById("departamento"+n);
 if(v==""){destino.disabled=true;destino.length=1;}else{
  destino.disabled=false;
  destino.length=1;
  var indice=1; 
  <?
  $sql="SELECT id_departamento,clave,id_complejo,no_depto FROM departamentos";
  $con=mysql_query($sql);
  while($ls=mysql_fetch_array($con)){
     $idcategoria=$ls["id_departamento"];
     $iddirectorio=$ls["id_complejo"];
     $categoria=$ls["clave"]."(".$ls["no_depto"].")";
	 ?>
	 if(v==0){destino.options[indice]=new Option("GENERAL","0");}
	 if(v=="<?echo $iddirectorio?>"){
	   destino.options[indice]=new Option("<?echo $categoria?>","<?echo $idcategoria?>");
	   indice++;
	 }
	 <?
  }
  ?>
  if(destino.length==2){
	 destino.options[1].selected=true;
   }
 }
}
function prov(p,pos){
   document.getElementById("idprov"+pos).value=p;
}

n=0;function materialreq(id){
     n++;
     fi = document.getElementById('material');
     contenedor = document.createElement('tr');
	 contenedor.setAttribute('class', "tr");
	 contenedor.id = 'div'+n; 

	 td2 = document.createElement('td');
	 td3 = document.createElement('td');
	 td4 = document.createElement('td');
	 td5 = document.createElement('td');
	 td6 = document.createElement('td');
	 td7 = document.createElement('td');
	 td8 = document.createElement('td');	 
	 td9 = document.createElement('td');
	 td10 = document.createElement('td');
	 td11 = document.createElement('td');
	 td12 = document.createElement('td');
	 td13= document.createElement('td');
	 td14= document.createElement('td');
	 td15= document.createElement('td');
	 td16= document.createElement('td');
	 ele1 = document.createElement('input'); 
	 ele2 = document.createElement('input'); 
     ele3 = document.createElement('input'); 
     ele4 = document.createElement('input');
	 ele5 = document.createElement('input');
	 ele7 = document.createElement('input');	 
	 ele8 = document.createElement('input');
	 ele9 = document.createElement('input');
	 ele10 = document.createElement('input');
	 ele11 = document.createElement('input');
	 ele12=document.createElement('input');
	 ele13=document.createElement('input');
	 ele14=document.createElement('input');
	 ele15=document.createElement('input');
	 
	 <?
	   $sql="select idmaterial,descripcion from material order by descripcion asc";
	   $eje=mysql_query($sql);
	 ?>
	 td2.name="status[]";
	 td2.innerHTML="<select name='std[]' id='std"+n+"' class='selectsa' onchange='cargareq(this.form,"+n+")'><option selected></option><?while($dat=mysql_fetch_array($eje)){?><option value='<?echo htmlentities($dat[idmaterial]);?>'><?echo htmlentities($dat[descripcion]);?></option> <?}?></select>";

	 ele3.name="unidad[]";
	 ele3.id="unidadreq"+n;
	 ele3.type="text";
	 ele3.setAttribute("readonly","readonly");
	 ele3.setAttribute("class","inputsa");
	 ele3.setAttribute("onkeyup","this.value=this.value.toUpperCase()");
	 td3.appendChild(ele3);
	 
	 td14.innerHTML="<select name='comprobante[]' id='comprobante"+n+"' onchange='operacion("+n+")'><option></option><option value='FACTURA'>FACTURA</option><option value='NOTA'>NOTA</option><option value='RECIBO'>RECIBO</option></select>";
	 
	 ele4.name="cantidad[]";
	 ele4.id="cantidad"+n;
	 ele4.type="text";
	 ele4.value=0;
	 ele4.setAttribute("class","inputsa");
	 ele4.setAttribute("onkeyup","this.value=this.value.toUpperCase()");
	 td4.appendChild(ele4);	 
	 <?
	   $sql2="select id_complejo,nombre from complejo";
	   $eje2=mysql_query($sql2);
	   
	   $sqlP="select idproveedor,nomcomercial from proveedormat";
	   $ejeP=mysql_query($sqlP);
	 ?>
	 td5.name="propiedad[]";
	 td5.innerHTML="<select name='prop[]' id='propiedad"+n+"' class='selectsa' onchange='depas(this.id,"+n+")'><option selected></option><?while($dat2=mysql_fetch_array($eje2)){?><option value='<?echo htmlentities($dat2[id_complejo]);?>'><?echo htmlentities($dat2[nombre]);?></option> <?}?></select>";
	 
	 td6.name="departamento[]";
	 td6.innerHTML="<select name='departamento[]' id='departamento"+n+"' class='selectsa'><option selected></option></select>";
	 
	/* ele7.name="proveedor[]";	 
	 ele7.id="proveedor"+n;	*/
	 td7.innerHTML="<select name='proveedor[]' id='proveedor"+n+"' class='selectsa' onchange='prov(this.value,"+n+")'><option selected></option><?while($datP=mysql_fetch_array($ejeP)){?><option value='<?echo $datP[idproveedor];?>'><?echo htmlentities($datP[nomcomercial]);?></option> <?}?></select>";	 
	 /*ele7.type="text";	 
	 ele7.setAttribute("class","inputprov");	 
	 ele7.setAttribute("onClick","abrir('searchproveedor.php?idmat=' + document.getElementById('std"+n+"').value + '&cant=' + document.getElementById('cantidad"+n+"').value + '&campo="+n+"','busca')");	 
	 td7.appendChild(ele7);	 */
	 
	 ele8.name="costou[]";	 
	 ele8.id="costou"+n;	 
	 ele8.type="text";	
	 ele8.value=0;
     ele8.setAttribute("readonly","readonly");	 
	 ele8.setAttribute("class","inputprov");	 	 
	 td8.appendChild(ele8);	 
	 
	 ele14.name="subtotalc[]";	 
	 ele14.id="subtotalc"+n;	 
	 ele14.type="text";	
	 ele14.value=0;
     //ele9.setAttribute("readonly","readonly");	 
	 ele14.setAttribute("class","inputprov");	
     ele14.setAttribute("onkeyup","m('"+n+"','')"); 
	 td15.appendChild(ele14); 
	 
	 ele15.name="ivac[]";	 
	 ele15.id="ivac"+n;	 
	 ele15.type="text";
	 ele15.value=0;	 
     ele15.setAttribute("readonly","readonly");	 
	 ele15.setAttribute("class","inputprov");	
     //ele15.setAttribute("onkeyup","m('"+n+"')"); 	 
	 td16.appendChild(ele15);	 
	 
	 ele9.name="total[]";	 
	 ele9.id="total"+n;	 
	 ele9.type="text";	
	 ele9.value=0;
     //ele9.setAttribute("readonly","readonly");	 
	 ele9.setAttribute("class","inputprov");	
     ele9.setAttribute("onkeyup","calculo('"+n+"','')"); 	 
	 td9.appendChild(ele9);	 
	 
	 ele10.name="idmatpro[]";
	 ele10.id="idmatpro"+n;
	 ele10.type="hidden";
	 td10.appendChild(ele10);
	 
	 ele11.name="obs[]";
	 ele11.type="text";
	 ele11.setAttribute("class","inputprov");
	 ele11.setAttribute("onkeyup","this.value=this.value.toUpperCase()");
	 td11.appendChild(ele11);

	 ele12.name="idprov[]";
	 ele12.id="idprov"+n;
	 ele12.type="hidden";
	 td12.appendChild(ele12);
	 
	 ele13.type = 'button';
     ele13.value = 'Borrar';
     ele13.name = 'div'+n;
     ele13.id = n;
     ele13.setAttribute('onclick', "borrar(this.name, '"+n+"');");
	 td13.appendChild(ele13);

	  contenedor.appendChild(td2);
	  contenedor.appendChild(td3);
	  contenedor.appendChild(td14);
	  contenedor.appendChild(td4);
	  contenedor.appendChild(td5);
	  contenedor.appendChild(td6);
	  contenedor.appendChild(td7);
	  contenedor.appendChild(td8);
	  contenedor.appendChild(td15);
	  contenedor.appendChild(td16);
	  contenedor.appendChild(td9);
	  contenedor.appendChild(td10);
	  contenedor.appendChild(td11);
	  contenedor.appendChild(td12);
	  contenedor.appendChild(td13);
	  	  
	  fi.appendChild(contenedor); 
	 document.getElementById("total").value=n;
}
function borrar(obj,tr){
    fi = document.getElementById('material'); // 1 
    fi.removeChild(document.getElementById(obj));
	calculo(n);
}
function operacion(nc){
	 document.getElementById("costou"+nc).value=0;
	 document.getElementById("total"+nc).value=0;
	 document.getElementById("subtotalc"+nc).value=0;
	 document.getElementById("ivac"+nc).value=0;
     calculo(nc);
}
function m(nc){
     var gtotal=0.00;
	 var subtotal=0.00;
	 var iva=0.00;
	 var g=document.getElementById("gtotal");
	 var s=document.getElementById("subtotal");
	 var iv=document.getElementById("iva");
	 var tc=document.getElementById("comprobante"+nc);
	 
	 if(tc.value==""){alert("Indica el tipo de comprobante");tc.focus();document.getElementById("subtotalc"+nc).value=0;}else{
	 var conta=0;
	 for(i=1;i<=n;i++){
	 if(document.getElementById("subtotalc"+i)){
	 conta++;
	 var c=document.getElementById("cantidad"+i).value;
	 var p=document.getElementById("costou"+i).value;
	 var t=document.getElementById("total"+i).value;
	 var sc=document.getElementById("subtotalc"+i).value;
	 var ivc=document.getElementById("ivac"+i).value;
	 var tipocomprobante=document.getElementById("comprobante"+i).value;
	
	 if(tipocomprobante=="FACTURA"){
	 //iva x concepto
	 var ivaxconcepto=parseFloat(sc*(.16));
	 document.getElementById("ivac"+i).value=ivaxconcepto.toFixed(2);
	 iva=parseFloat(iva+ivaxconcepto);
	 //total x concepto
	 var subxconcepto=parseFloat(sc);
	 var totalxconcepto=parseFloat(ivaxconcepto+subxconcepto);
	 document.getElementById("total"+i).value=totalxconcepto.toFixed(2);
	 gtotal=parseFloat((gtotal+totalxconcepto),2);
	 //costo unitario
	 var costounitarioxconcept=parseFloat(subxconcepto/document.getElementById("cantidad"+i).value);
	 if(isNaN(costounitarioxconcept)){costounitarioxconcepto=0.00;}else{costounitarioxconcepto=costounitarioxconcept;}
	 document.getElementById("costou"+i).value=costounitarioxconcepto.toFixed(2);
	 }else{
	 //iva x concepto
	 var ivaxconcepto=0;
	 document.getElementById("ivac"+i).value=ivaxconcepto.toFixed(2);
	 iva=parseFloat(iva+ivaxconcepto);
	 //total x concepto
	 var subxconcepto=parseFloat(sc);
	 var totalxconcepto=parseFloat(ivaxconcepto+subxconcepto);
	 document.getElementById("total"+i).value=totalxconcepto.toFixed(2);
	 gtotal=parseFloat((gtotal+totalxconcepto),2);
	 //costo unitario
	 var costounitarioxconcept=parseFloat(subxconcepto/document.getElementById("cantidad"+i).value);
	 if(isNaN(costounitarioxconcept)){costounitarioxconcepto=0.00;}else{costounitarioxconcepto=costounitarioxconcept;}
	 document.getElementById("costou"+i).value=costounitarioxconcepto.toFixed(2);
	 }
	 subtotalF=parseFloat(sc);
	 var precio=subtotalF;
	 //alert(precio);
	 subtotal=parseFloat((subtotal+precio),2);
	 }
	 g.value=gtotal.toFixed(2);
	 s.value=subtotal.toFixed(2);
	 iv.value=iva.toFixed(2);
	 if(conta!=0){
	 }else{
	 }
   }
  }
}
function calculo(nc){
     var gtotal=0.00;
	 var subtotal=0.00;
	 var iva=0.00;
	 var g=document.getElementById("gtotal");
	 var s=document.getElementById("subtotal");
	 var iv=document.getElementById("iva");
	 var tcc=document.getElementById("comprobante"+nc);
	 //alert(tcc);
	 //if(tcc.value==""){alert("Indica el tipo de comprobante");tcc.focus();document.getElementById("total"+nc).value=0;}
	 //if(tcc!=""){
	 var conta=0;
	 for(i=1;i<=n;i++){
	 if(document.getElementById("cantidad"+i)){
	 conta++;
	 var c=document.getElementById("cantidad"+i).value;
	 var p=document.getElementById("costou"+i).value;
	 var t=document.getElementById("total"+i).value;
	 var sc=document.getElementById("subtotalc"+i).value;
	 var ivc=document.getElementById("ivac"+i).value;
	 var tipocomprobante=document.getElementById("comprobante"+i).value;
	 	 
	 if(tipocomprobante=="FACTURA"){
	 //subtotal x concepto
	 var subxconcepto=parseFloat(t/1.16);
	 document.getElementById("subtotalc"+i).value=subxconcepto.toFixed(2);
	 subtotal=parseFloat((subtotal+subxconcepto),2);
	 //iva x concepto
	 var ivaxconcepto=parseFloat(subxconcepto*.16);
	 document.getElementById("ivac"+i).value=ivaxconcepto.toFixed(2);
	 iva=parseFloat(iva+ivaxconcepto);
	 //costo unitario
	 var costounitarioxconcept=parseFloat(subxconcepto/document.getElementById("cantidad"+i).value);
	 if(isNaN(costounitarioxconcept)){costounitarioxconcepto=0.00;}else{costounitarioxconcepto=costounitarioxconcept;}
	 document.getElementById("costou"+i).value=costounitarioxconcepto.toFixed(2);
	 }else{
	 //subtotal x concepto
	 var subxconcepto=parseFloat(t);
	 document.getElementById("subtotalc"+i).value=subxconcepto.toFixed(2);
	 subtotal=parseFloat((subtotal+subxconcepto),2);
	 //iva x concepto
	 var ivaxconcepto=0;
	 document.getElementById("ivac"+i).value=ivaxconcepto.toFixed(2);
	 iva=parseFloat(iva+ivaxconcepto);
	 //costo unitario
	 var costounitarioxconcept=parseFloat(subxconcepto/document.getElementById("cantidad"+i).value);
	 if(isNaN(costounitarioxconcept)){costounitarioxconcepto=0.00;}else{costounitarioxconcepto=costounitarioxconcept;}
	 document.getElementById("costou"+i).value=costounitarioxconcepto.toFixed(2);
	 }
	 totalF=parseFloat(t);
	 var precio=totalF;
	 //alert(precio);
	 gtotal=parseFloat((gtotal+precio),2);
	 }
	 g.value=gtotal.toFixed(2);
	 s.value=subtotal.toFixed(2);
	 iv.value=iva.toFixed(2);
	 if(conta!=0){
	 }else{
	 }
   }
   //}
}
</script>
					<?
					 $sqlsol="select CONCAT(nombre,' ',a_pat,' ',a_mat) as nombre,id_empleado,nivel_acceso,area from empleados where usuario='$usuario'";
					 $ejesol=mysql_query($sqlsol);
					 $sol=mysql_fetch_array($ejesol);
					 $nombresol=$sol['nombre'];
					 $idemp=$sol['id_empleado'];
					 $nivel_acceso=$sol['nivel_acceso'];
					 $areasol=$sol['area'];
					 $nomdia=array("DO","LU","MA","MI","JU","VI","SA");
					 $nd=Date("w");
					 $nod=Date("d");
					 $nm=Date("m");
					 $na=Date("y");
					 $h=Date("H");
					 $m=Date("i");
					 $s=Date("s");
					 $al=rand(1,$s);
					 $cod_=$nomdia[$nd].$nod.$nm.$na.$h.$m.$s.$usuario.$al;
					?>
					<!--<div id="opcionesreq">
					  <table class="tabla" style="width:100%;" border="0">
						<tr>
						<td><a href="#" class="btntarea2" id="vreq" onclick="javascript:openForm2('verreq',this.id);"><img src="img/contratoIcon.png" style="position:absolute;margin-top:-1px;margin-left:-27px;width:20px;height:20px;">Registrar</a>
						<a href="#" class="btntarea2"  id="consreq" onclick="javascript:openForm2('consultarreq',this.id);"><img src="img/buscar.png" style="position:absolute;margin-top:-1px;margin-left:-27px;width:20px;height:20px;">Ver requisiones</a><a href="#" onclicK="javascript:$('.formHide2').slideUp();$('.btntarAct3').removeClass('btntarAct3');" class="btnclose">x</a></td>
						</tr>
					 </table>
					</div>-->
					<div id="verreq" class="" style="overflow: auto">
					<form name="datosregistro" id="datosregistro" action="solrequisicion2.php" method="POST" onsubmit="return valida();"><!--onsubmit="return valida();"-->
					 <input type="hidden" name="idempleado" value="<?echo $idemp;?>">
					 <input type="hidden" name="folio" value="<?echo $cod_;?>">
				     <table class="tabla" style="width:100%;" border="0">
					 <tr>
					   <td colspan="5" class="titulo">Registro</td>
					  </tr>
					<tr>
					   <td colspan="5" class="sbtitulo">Requisicion</td>
					</tr>
					<tr>
					   <td class="dato">Fecha Solicitud: </td>
					   <td><input type="text" name="fi" id="fi" class="inputs" value="<?echo date('Y-m-d');?>" readonly></td>
					</tr>
					<tr><td class="dato">Solicita: </td>						
					<td><input type="text" name="nomsol" id="nomsol" class="inputs" onChange="javascript:this.value=this.value.toUpperCase();" autocomplete=off value="<?echo$nombresol;?>" readonly></td>
					</tr>
					<tr><td class="dato">Area que solicita</td><td><input type="text" name="areasol" id="areasol" class="inputs" onChange="javascript:this.value=this.value.toUpperCase();" autocomplete=off value="<?echo $areasol;?>" readonly></td></tr>
				    <tr>					    
					<td class="dato">Observaciones: </td>
					<td><input type="text" name="observ" id="observ" class="inputs" onChange="javascript:this.value=this.value.toUpperCase();" ></td>
					</tr>
					
					<tr>
					  <td class="dato">Operacion:</td>
					  <td>
						<select name="operacion" id="operacion">
						     <option></option>
						    <?
							  $sqlcuenta="select operacion,num,numdet2 from catalogocuentas where num<>'' and numdet='' and numdet2='' and numdet3='' and numdet4='' and numdet5='' and numdet6=''";
							  $ejecuta=mysql_query($sqlcuenta);
							  while($cuenta=mysql_fetch_array($ejecuta))
							      {
							?>
								<option value="<?echo $cuenta['operacion'];?>" style="color: #746F7C;" disabled><?echo $cuenta['operacion'];?></option>
									 <?
									  $sqlsubcuenta="select operacion,numdet from catalogocuentas where num='$cuenta[num]' and numdet<>'' AND numdet2='' and numdet3='' and numdet4='' and numdet5='' and numdet6=''";
									  $ejecutasub=mysql_query($sqlsubcuenta);
									   while($subcuenta=mysql_fetch_array($ejecutasub))
									       {
									 ?>
											<option value="<?echo $subcuenta['operacion'];?>" style="color: #000084;" disabled>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?echo $subcuenta['operacion'];?></option>
													 <?
													  $sqlsubsubcuenta="select operacion,numdet2 from catalogocuentas where num='$cuenta[num]' and numdet='$subcuenta[numdet]' and numdet2<>'' and numdet3='' and numdet4='' and numdet5='' and numdet6='' and operacion<>'LABORATORIO DE ARTE'";
													  $ejecutasubsub=mysql_query($sqlsubsubcuenta);
													   while($subsubcuenta=mysql_fetch_array($ejecutasubsub))
													        {?>
																<option value="<?echo $subsubcuenta['operacion'];?>" style="color:#a9a9D9">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?echo $subsubcuenta['operacion'];?></option><?
																
																			$sqln3="select operacion,numdet3 from catalogocuentas where num='$cuenta[num]' and numdet='$subcuenta[numdet]' and numdet2='$subsubcuenta[numdet2]' and numdet3<>'' and numdet4='' and numdet5='' and numdet6=''";
																			$ejen3=mysql_query($sqln3);
																			while($n3=mysql_fetch_array($ejen3))
																			    {?>
																			<option value="<?echo $n3['operacion'];?>" style="color:#C1620F">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?echo $n3['operacion'];?></option><?
																			
																			      $sqln4="select operacion from catalogocuentas where num='$cuenta[num]' and numdet='$subcuenta[numdet]' and numdet2='$subsubcuenta[numdet2]' and numdet3='$n3[numdet3]' and numdet4<>'' and numdet5='' and numdet6=''";
																				  $ejen4=mysql_query($sqln4);
																				  while($n4=mysql_fetch_array($ejen4))
																				      {?>
																				  <option value="<?echo $n4['operacion'];?>" color="red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?echo $n4['operacion'];?></option>
																
																
									                                                  <?}
																				}
																}
													}
										}?>
						</select>
					  </td>
					</tr>
					<tr>
						<td colspan="12" class="sbtitulo">Materiales</td>
					</tr>
					<tr id="prov">
					     <td colspan="12">
						      <table id="material" width="100%">
									<tr>						
										<td  align="left" colspan="12">Concepto <a href="javascript:materialreq(this)"><img src="img/mas.png" width="15"  height="15"></a></td>
										<input type="hidden" id="totus">
									</tr>
									 <tr>
										 <td align="center"><b>Concepto</b></td>
										 <td align="center"><b>Unidad</b></td>
										 <td align="center"><b>Comp.</b></td>
										 <td align="center"><b>Cantidad</b></td>
										 <td align="center"><b>Propiedad</b></td>
										 <td align="center"><b>Suite</b></td>										 
										 <td align="center"><b>Proveedor</b></td>
										 <td align="center"><b>Costo U.</b></td>
										 <td align="center"><b>SubTotal</b></td>
										 <td align="center"><b>IVA</b></td>
										 <td align="center"><b>Total</b></td>
										 <td align="center"></td>
										 <td align="center"><b>descripci&oacute;n</b></td>
										 <td></td>
									 </tr>
								 </table>						 
							 </td>
						 </tr>
						<tr>
							<td align="right" colspan="4"><b>SUBTOTAL</b></td>
							<td align="right">
							$<input type="text" name="subtotal" id="subtotal" value="0.00" class="inph" style="text-align:right;width:100px;" readonly >  
							</td>
						 </tr>
						<tr>
							<td align="right" colspan="4"><b>IVA</b></td>
							<td align="right">
							$<input type="text" name="iva" id="iva" value="0.00" class="inph" style="text-align:right;width:100px;" readonly >  
							</td>
						 </tr>
						<tr>
							<td align="right" colspan="4"><b>TOTAL</b></td>
							<td align="right">
							$<input type="text" name="gtotal" id="gtotal" value="0.00" class="inph" style="text-align:right;width:100px;" readonly >  
							</td>
						 </tr>
						<tr>
							 <td colspan="5" align="center"><br><input type="submit" name="registrarpre" id="registrarpre" value="Registrar" class="submit"></td>
					    </tr>						
					</table>		
				</form>	
			</div>

		