<?php
session_start();
include("DMMYSQLG.php");

	$cajero= $_POST['cajero'];
	$pass= $_POST['pass'];
	$elegidos = array();
	$elegidos= $_POST['ch'];
	$concate="";
	


	$sql = 'SELECT * FROM dgcatven WHERE cod_ven="' . $cajero. '" && pasw="' . $pass . '" LIMIT 1';
            if ( @$res = @mysqli_query($con ,$sql) and count($elegidos)!= 0){
                if ( @mysqli_num_rows($res) == 1 ){
                	foreach ($elegidos as $elegido) {

						$rs=mysqli_query($con ,$sq="UPDATE  dgpemema SET oper='".$cajero."' WHERE fol_ven='$elegido'");
		
					}	
                	echo 1;
                }else{
                	
                		echo 0;
                
                }
            }else{
            	
                		echo 0;
                	
            }

?>