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





</script>
<?php include ("../conexion.php");  ?>
<body>
<?php

	




if (!isset($_GET["accion"])) { $accion="0"; } else  {  $accion=$_GET["accion"]; }
 
 
 if 	( $accion  > 0 ) {

					$query_update="UPDATE web_0301 SET checkunir='1'";					
					$mysqli->query($query_update);
					
					$consulta1 = "SELECT CDGCLI,DSCCLI  FROM web_0301 ";

		if ($resultado = $mysqli->query($consulta1)) 
		$contador=0;
		
		while ($fila = $resultado->fetch_assoc()) {
		$cdgcli = $fila["CDGCLI"];
		$dsccli = $fila["DSCCLI"];

		$query_insert="INSERT INTO tmp_clientes(cdgcli,dsccli) VALUES('$cdgcli','$dsccli')";					
		$mysqli->query($query_insert);	
		
		
		}
		

					
					
 }
 else {
 					$query_update="UPDATE web_0301 SET checkunir='0'";					
					$mysqli->query($query_update);
					
				$query_delete="DELETE FROM tmp_clientes ";					
				$mysqli->query($query_delete);
 }
 
 
		?>
		<script languaje="javascript">
		
		
			parent.buscar_clientes();
		</script>
		
</div>
</body>
</html>
