Busquedas/Por Cliente
Busqueda de consultas por cliente
if ( !empty($_POST['cliente']) ) {
$id_cliente=$_POST['cliente'];
//echo $cliente;
$busqueda=mysql_query("select * from consulta where id_cliente='$id_cliente' order by fecha");
//echo " $busqueda";
$n_busqueda=mysql_num_rows($busqueda);
$clie=mysql_query("select * from cliente where id_cliente='$id_cliente'");
$cliente=mysql_fetch_array($clie);
if( $n_busqueda == 0){
echo "El cliente ". $cliente['nombre'] . " con CIF ". $cliente['cif'] ." no ha realizado ninguna consulta.";
}else {
?>
Las especificaciones del cliente para la búsqueda son:
Fecha |
Nº Cons. |
Espesor |
Ancho |
Largo |
Recubr. |
Dureza |
Acabado |
Producto |
Recocido |
Ver |
Formulario |
while($cli=mysql_fetch_array($busqueda)){ ?>
|
|
|
|
|
|
|
|
|
|
$id_consulta=$cli['id_consulta'];
echo "";
?>
|
|
}
?>
}
}
if ( !empty($_GET['id_c']) && !empty($_GET['cliente'])) {
$id_con=$_GET['id_c'];
$cliente=$_GET['cliente'];
$busqueda=mysql_query("select * from consulta where id_cliente='$cliente' AND id_consulta='$id_con'");
//echo " $busqueda";
$n_busqueda=mysql_num_rows($busqueda);
$bus=mysql_fetch_array($busqueda);
if( $n_busqueda == 0){
echo "Este cliente ". $cliente['nombre'] . " con CIF ". $cliente['cif'] ." no ha realizado ninguna consulta.";
}else {
?>
Las especificaciones del cliente para la búsqueda son:
Fecha consulta |
Nº Consulta |
Espesor |
Ancho |
Largo |
Recubr. |
Dureza |
Acabado |
Producto |
Recocido |
//while($bus){ ?>
|
|
|
|
|
|
|
|
|
|
//}
?>
}
if($bus['formulario']=='Si'){
$datos_formulario=mysql_query("select * from valido_formulario where id_cliente='$cliente' AND id_consulta='$id_con'"); // ORDER BY precio_tn limit 0,1
//$n_d_form=mysql_num_rows($datos_formulario);
//echo "$n_d_form";
//$d_form=;
$n_d_form=mysql_num_rows($datos_formulario);
if($n_d_form!=0){
?>
Los resultados son:
Cod.Serie |
% |
C.Corte |
C.Corte Tnf |
C. Reb |
C. Reb Tnf |
C. Cla |
C. Cla Tnf |
M.Cal. |
M.Cal. Tnf |
M.Reb. |
M.Reb. Tnf |
R. Cal |
R. Cal Tnf |
R. Reb |
R. Reb Tnf |
Coste |
Coste Tnf |
Coste M. P. |
Coste M. P. Tnf |
€ Tn |
Tn |
while($d_form=mysql_fetch_array($datos_formulario)){
?>
|
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
} ?>
}else{
?>
No hay existencias para esta especificacion. |
}
}else{
$datos_formulario=mysql_query("select * from valido_especificacion where id_cliente='$cliente' AND id_consulta='$id_con'"); // ORDER BY precio_tn limit 0,1
//$n_d_form=mysql_num_rows($datos_formulario);
//echo "$n_d_form";
$n_d_form=mysql_num_rows($datos_formulario);
if($n_d_form!=0){
?>
Los resultados son:
Cod.Serie |
% |
C.Corte |
C.Corte Tnf |
C. Reb |
C. Reb Tnf |
C. Cla |
C. Cla Tnf |
M.Cal. |
M.Cal. Tnf |
M.Reb. |
M.Reb. Tnf |
R. Cal |
R. Cal Tnf |
R. Reb |
R. Reb Tnf |
Coste |
Coste Tnf |
Coste M. P. |
Coste M. P. Tnf |
€ Tn |
Tn |
while($d_form=mysql_fetch_array($datos_formulario)){
?>
|
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
} ?>
}else{
?>
No hay existencias optimas para esta especificacion. |
}
}
}
?>