<?php
include_once("config.php");
$disable_cb=false;
if($_GET["opcion_detalle"]==1){
$disable="disabled='disabled'";
$disable_cb=true;
}
?>
<form id="myForm" action="<?=getReferencia(getFileName());?>-opcion.php" method="post" onsubmit="return false;">
<div align="center">
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td width="50%" align="left">REQUERIMIENTO</td>
<td width="50%" align="left">
<input type="submit" class="textoBotonPU" onclick="enviarFormValidado(document.forms.item(0).id,<?=($_GET["opcion"]=="editar")?getReferencia(getFileName())."E":getReferencia(getFileName())."I"; ?>);" value="Enviar" <?=$disable?> />
<? if($_GET["opcion"]!="editar"){ ?>
<input <?php echo SDN;?> type="submit" class="textoBotonPU" onclick="enviarFormValidado2(document.forms.item(0).id,<?=($_GET["opcion"]=="editar")?getReferencia(getFileName())."E":getReferencia(getFileName())."I"; ?>);" value="Enviar y crear nuevo" <?=$disable?> />
<? } ?>
<input name="Cancelar" type="button" class="textoBotonPU" id="Cancelar" value="Cancelar" onclick="javascript:loadUrl('<?=getPhpName(getReferencia(getFileName()));?>');" /></td>
</tr>
</table>
</div>
<!--onkeypress="if(window.event.keyCode==13) loadUrl('<?=getFileName()?>?filtro='+document.getElementById('filtro').value+'&seleccionados='+document.getElementById('seleccionados').value);"-->
<div align="center">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="27" align="left" valign="middle"><input name="opcion" type="hidden" id="opcion" value="<?=$_GET["opcion"]?>" />
<input name="modo" type="hidden" id="modo" value="<?=$sentencia_modo?>" />
<input name="seleccionados" type="hidden" id="seleccionados" value="<?=$_GET["seleccionados"]?>" />
<input name="seleccionados2" type="hidden" id="seleccionados2" value="<?=implode(",",array_reverse(explode(",",$_GET["seleccionados"])))?>" />
<input name="nuevo" type="hidden" id="nuevo" value="0" /></td>
<td height="27" align="left" valign="middle"> </td>
</tr>
<tr>
<td colspan="2"><?php
$a_seleccionados=array_reverse(explode(",",$_GET["seleccionados"]));
$t_arreglo=count($a_seleccionados);
$c_arreglo=0;
foreach($a_seleccionados as $id){
if($id!=""){
$c_arreglo++;
$s_arreglo=$c_arreglo%2;
$query_data="SELECT t1.*, t2.log_usuario FROM ".getReferencia(getNombreTabla(getFileName()))." AS t1 LEFT JOIN usuario AS t2 ON t2.id_usuario = t1.id_usuario WHERE t1.id_".getReferencia(getNombreTabla(getFileName()))."=$id LIMIT 1";
$o_mysql_data=new conexionMySql();
$o_mysql_data->setSql($query_data);
foreach($o_mysql_data->getSql() as $a_mysql_data){
switch($s_arreglo){
case 1:
?>
<table width="100%" border="0" cellspacing="4" cellpadding="4">
<tr>
<td width="52%" align="left" valign="top"><fieldset>
<legend> Datos de requerimiento </legend>
<table cellpadding="1" cellspacing="7">
<tbody>
<tr >
<td width="111"><label>Titulo</label></td>
<td width="637"><input name="nom_<?=getReferencia(getFileName());?>|<?=$id?>" type="text" class="textBoxPLogin4" id="nom_<?=getReferencia(getFileName());?>|<?=$id?>" onfocus="onFocusText(this,'textBoxColorPLogin4');" onblur="onBlurText(this,'textBoxPLogin4');" value="<?=$a_mysql_data["nom_".getReferencia(getFileName())]?>" size="45" <?=$disable?> /></td>
</tr>
<!--- 1 er combo de empresa --->
<tr>
<td width="111"><label>Empresa</label></td>
<td width="637"><?php
$o_ms=new conexionMySql();
$o_ms->setSql("SELECT id_empresa, nom_empresa FROM empresa WHERE est_empresa=1 ORDER BY nom_empresa");
$comboBox=new comboBox("id_empresa|$id","combobox",$disable_cb);
$comboBox->setOptions($o_ms->getComboSql("id_empresa","nom_empresa"),$a_mysql_data["id_empresa"],"Seleccione una empresa ","0");
?>
<?=$comboBox->getCombo();?>
<label for="textfield"></label>
<input name="textfield" type="text" disabled="disabled" id="textfield" value="" onchange="enabled"/></td>
<!-- acaba -->
<tr>
<td width="111"><label>Tipo Requerimiento</label></td>
<td width="637"><?php
$o_ms=new conexionMySql();
$o_ms->setSql("SELECT id_tipo_requerimiento, nom_tipo_requerimiento FROM tipo_requerimiento ORDER BY nom_tipo_requerimiento");
$comboBox=new comboBox("id_tipo_requerimiento|$id","combobox",$disable_cb);
$comboBox->setOptions($o_ms->getComboSql("id_tipo_requerimiento","nom_tipo_requerimiento"),$a_mysql_data["id_tipo_requerimiento"],"Seleccione ","0");
?>
<?=$comboBox->getCombo();?></td>
<!-- acaba -->
<tr>
<td>Descripción</td>
<td><textarea name="des_<?=getReferencia(getFileName());?>|<?=$id?>" cols="42" rows="7" id="des_<?=getReferencia(getFileName());?>|<?=$id?>" onfocus="onFocusText(this,'textAreaColor');" onblur="onBlurText(this,'textArea');" autocomplete="off" ondblclick="popupTiny('editor.php',628,400,'no',this);" lang="<?=getReferencia(getFileName());?>" class="textArea" <?=$disable?> ><?=$a_mysql_data["des_".getReferencia(getFileName())]?></textarea></td>
</tr>
<tr >
<td width="111"><label>Fecha</label></td>
<td width="637"><input name="fec_<?=getReferencia(getFileName());?>-<?=$id?>" type="text" class="textBoxPLogin4" id="fec_<?=getReferencia(getFileName());?>-<?=$id?>" onfocus="onFocusText(this,'textBoxColorPLogin4');" onblur="onBlurText(this,'textBoxPLogin4');" value="<?=substr(getFechaNormal($a_mysql_data["fec_".getReferencia(getFileName())]),0,10)?>" size="45" maxlength="10" <?=$disable?> />
<script>
$$("#fec_<?=getReferencia(getFileName());?>-<?=$id?>").datepicker({dateFormat: 'dd/mm/yy'});
</script>