                                                                                                                                                                                                                        
<html>
<head>
<link href="../estilos/estilos.css" type="text/css" rel="stylesheet">
</head>






<?php


 include ("conexion.php");

date_default_timezone_set('America/Costa_Rica');

$cdgusu = "EXCEL";

$fecha=date("Y-m-d");





	
$consulta ="SELECT * FROM web_1001, WEB_1002 WHERE web_1001.CDGBAR = WEB_1002.CDGBAR and cdghac =  '' ";
//$consulta ="SELECT * FROM web_1001, cade WHERE web_1001.CDGBAR = cade.CDGBAR  ";
$contador=0;
if ($resultado = $mysqli->query($consulta)) 
	$count=0;

    while ($fila2 = $resultado->fetch_assoc()) {

	
       
				$cdgcade  = $fila2["cdghac"];
				$cdgbar  = $fila2["CDGBAR"];
				$dscart  = $fila2["DSCART"];
		
			  
	
	$nuevo_saldo="UPDATE web_1001 SET  cdghac='$cdgcade' , nomusu =  '$cdgusu'  WHERE  cdgbar='$cdgbar'  ";
	$mysqli->query($nuevo_saldo);
	
	$count++;
	
	echo $count."  ".$cdgbar."  ".$dscart."  ".$cdgcade."<BR>";
		}   
		
		
		
		
		
		//////////////////////////////////////////////////////// CADE  2 //////////////////////////////////////////////////
		
		
		
	
$consulta ="SELECT * FROM web_1001, cade2 WHERE web_1001.CDGBAR = cade2.CDGBAR and cdghac =  '' ";
//$consulta ="SELECT * FROM web_1001, cade2 WHERE web_1001.CDGBAR = cade2.CDGBAR ";
$contador=0;
if ($resultado = $mysqli->query($consulta)) 
	$count=0;

    while ($fila2 = $resultado->fetch_assoc()) {

	
       
				$cdgcade  = $fila2["codigohacienda"];
				$cdgbar  = $fila2["CDGBAR"];
				$dscart  = $fila2["DSCART"];
		
			  
	
	$nuevo_saldo="UPDATE web_1001 SET  cdghac='$cdgcade' , nomusu =  '$cdgusu'  WHERE  cdgbar='$cdgbar'  ";
	$mysqli->query($nuevo_saldo);
	
	$count++;
	
	echo $count."  ".$cdgbar."  ".$dscart."  ".$cdgcade."<BR>";
		}   
		


//////////////////////////////////////////////////////// CADE florida //////////////////////////////////////////////////
		
		
		
	
$consulta ="SELECT * FROM web_1001, cadeflorida WHERE web_1001.CDGBAR = cadeflorida.CDGBAR and cdghac =  '' ";
//$consulta ="SELECT * FROM web_1001, cadeflorida WHERE web_1001.CDGBAR = cadeflorida.CDGBAR  ";
$contador=0;
if ($resultado = $mysqli->query($consulta)) 
	$count=0;

    while ($fila2 = $resultado->fetch_assoc()) {

	
       
				$cdgcade  = $fila2["codigohacienda"];
				$cdgbar  = $fila2["CDGBAR"];
				$dscart  = $fila2["DSCART"];
		
			  
	
	$nuevo_saldo="UPDATE web_1001 SET  cdghac='$cdgcade' , nomusu =  '$cdgusu'  WHERE  cdgbar='$cdgbar'  ";
	$mysqli->query($nuevo_saldo);
	
	$count++;
	
	echo $count."  ".$cdgbar."  ".$dscart."  ".$cdgcade."<BR>";
		}   
		
