<?php session_start();?>
<?php include('../_cfg/config.php');?>
<?php include('php_gene1.php');?>
<?php include('php_session.php');?>
<?php
$pla_sql='update  plan1 
set
fecha="'.$_POST['fecha'].'",
enti="'.$_POST['enti'].'",
valorpla="'.($_POST['valorpla']).'",
empr1="'.strtoupper($_POST['empresa']).'",
concepto="'.$_POST['concepto'].'"
where 
 docu="'.$_POST['docu'].'"
 and
idnum1="'.$_POST['idnum'].'"';
if(!msql_query($pla_sql,$link_vcrx)){echo 'ocurrio un error';}
//else{echo 'OK';}
//tfle_plan('PLA1', $_POST['numero'], 'PLAN-0000', '');

//if(!empty($_POST['enti2'])){


//tfle_plan($_POST['docu'], $_POST['numero'], $_POST['asub'], '');
/*
$pla_sql='select max(iddet) as total from plan2 where idnum2="'.$_POST['idnum'].'"';	
$pla_res=msql_query($pla_sql,$link_vcrx);
$numero2=msql_result($pla_res,0,'total');

$pla_sql='insert into pla2 (idnum2,iddet,enti2,asub,funcion, asignacion,gurpo,cant,puni,ctas,detalle)
values(
"'.$_POST['numero'].'",
"'.$numero2.'",
"'.$_POST['enti2'].'",
"'.$_POST['asub'].'",
"'.$_POST['funcion'].'",
"'.$_POST['asignacion'].'",
"'.$_POST['grupo'].'",
"'.$_POST['cant'].'",
"'.$_POST['puni'].'",
"'.$_POST['detalle'].'",
)';
*/
/*
$pla_sql='select *from plan2 where idnum2="'.$_POST['idnum'].'" order by asub, iddet';
$pla_res=msql_query($pla_sql,$link_vcrx);
if(msql_num_rows($pla_res)!=0){?>
    <table>
        <tr>
        <th>ENTI</th>
        <th>DESCRI</th>
        <th>ASUB</th>
        <th>FUNCION</th>
        <th>ASIGNACION</th>
        <th>GUPO</th>
        <th>CANT</th>
        <th>PUNI</th>
        <th>DETALLE</th>
        <th></th>
    </tr>

<?php $i=1; while($pla_r=msql_fetch_assoc($pla_res)){?>
    <tr id="tr_<?php echo $pla_r['iddet'];?>" valign="top" style="  <?php if($i%3==0){echo 'border-bottom:#000 dotted 1px;';}$i++; ?>">
    <td><input type="button" value="Elim" onClick="if(confirm('Desea eliminar?')){_borrar('<?php echo $pla_r['iddet'];?>');}"></td>
    <td><?php $pcaption='CEDULA'; $ptabla='enti'; $pidtxt='ent2_'.$pla_r['iddet']; $pobj=1; $pdefa=$pla_r['enti2']; include('vrgetcod.php'); ?> </td>
    <td><?php echo r_fiel('enti',$pla_r['enti2'],$campo="descri",$valor="");?></td>
    <td><span id="asub_<?php echo $pla_r['iddet'];?>"><?php echo $pla_r['asub'];?></span></td>
<!--    <td><?php echo $pla_r['funcion'];?></td>
    <td><?php echo $pla_r['asignacion'];?></td>
    <td><?php echo $pla_r['grupo'];?></td>-->
<!--    <td><input type="text" value="<?php echo $pla_r['cant'];?>"  id="cant_<?php echo $pla_r['iddet'];?>" /></td>-->
    <?php $pcaption='CANT.'; $pidtxt='cant_'.$pla_r['iddet']; $plong=5; $pobj=1; $pdefa=$pla_r['cant']; include('vrgetval.php'); ?>
    <td><?php echo $pla_r['puni'];?></td>
    <td><?php $pcaption='CONCEPTO'; $pidtxt='concepto_'.$pla_r['iddet']; $plong=20; $prows=2; $pdefa=$pla_r['detalle']; $pobj=1; include('vrgettxt.php'); ?></td>
    <td><input type="button"  value="Actualizar" id="btn2_<?php echo $pla_r['iddet'];?>"  onClick="_pla2('<?php echo $pla_r['iddet'];?>');" ></td>
    <td><input type="button" value="Inse" onClick="_insertar('<?php echo $pla_r['iddet'];?>');"></td>
    </tr>

    <?php } ?>
    </table>
<?php }*/?>