Ver Mensaje Individual
  #5  
Antiguo 08-03-2012
novato_erick novato_erick is offline
Miembro
 
Registrado: ago 2010
Ubicación: Panamá
Posts: 396
Reputación: 14
novato_erick Va por buen camino
Hola Gracias por responder

Este es mi condicion:

Código PHP:
//Lectura de Parametros
//  CODIGO ARTICULO
  
if (isset ($_POST['p_carticulo']))
   
///Prepara parametro de consulta para recuperar datos del articulo conforme al codigo
   
$v_carticulo$_POST['p_carticulo'];
   
$v_varconsulta=$v_carticulo;
   
/////Prepara variable de consulta
   
$v_wheret="c.FK_CODARTICULO='".$v_varconsulta."'";
   if (
$v_varconsulta<>'') { {$v_valida='S';
      }
//Si hay valor carga
  
if ($v_varconsulta<>'') {
   
$v_consulta=$v_consulta.$v_varconsulta.'.';
   
$v_valida='S';
   if (
$v_where<>'')  {  $v_where=$v_where." AND ".$v_wheret; }
   else    { 
$v_where=$v_wheret; }
  }
 } 
Me equivoco en algo?

Código PHP:
<?PHP
echo '<TABLE border="0" width= "100%" ALIGN=CENTER bgcolor="#dddddd" cellspacing="0" cellpadding="0">';
$v_user=$_SESSION['usuario'];
//////////////CONSULTA PARA CODIGO ARTICULO/////////////////////////////////////////////
echo '<tr><td class="titulotabla">Transaccion para : '.$v_carticulo;
echo 
'</td></tr>';
/////Se activa si se valida que entraron datos por el usuario.
  
if ($v_valida=='S')
  {
/////Carga consulta para conocer su existencia
  
$stmt=select_qconteo_inv($v_where);
///Actualizacion de datos en tabla CONTEO_INV
 
$dbh =conectarINV();
 
$stmt="UPDATE CONTEO_INV SET INV_BODEGA = ".$v_cantidadbdg.",
  FK_CODUSUARIO = '
$v_user' WHERE FK_CODARTICULO = '".$v_carticulo."'";
  
$q=ibase_query($stmt);
 
$q=ibase_prepare($stmt);
 
ibase_free_query($q);
  }
//<?PHP
else
{
//SI EL DATO NO SE ENCUENTRA
///Ingreso de datos en tabla CONTEO_INV
 
$dbh =conectarINV();
 
$stmt="INSERT INTO CONTEO_INV (
   FK_CODARTICULO,INV_AGREGADO,FK_CODUSUARIO
   )
   VALUES (
   '"
.$v_carticulo."',
      "
.$v_cantidad.",
   '
$v_user'
   )"
;
 
$q=ibase_query($stmt);
 
$q=ibase_prepare($stmt);
 
ibase_free_query($q);
}
Responder Con Cita