$datos) { foreach ($datos as $key => $detalles) { $idx = $detalles['Id']; $model = $detalles['Model']; $serie = $detalles['codSerie']; $categoria = $detalles['catId']; $imagen = $accesoPortal->compara($model,$idx,$serie,$categoria); } } ?>

Comparar ventiladores


buscarInfo($url); } // Extraer la tabla de modelos if (isset($_POST['table'])) { $url = $_POST['table']; extraerTabla($url); } function extraerTabla($url){ require_once 'shared/conexionBD.php'; //hacemos una consulta para obtener los modelos de hábitat mysqli_query($conexion, "SET NAMES utf8"); $idProducto = $_POST['id']; $queryConsulta = "SELECT IDPROD, DATATABLE, FECHAMOD FROM ITT_ASW_EASYVENT WHERE IDPROD = '" . trim($idProducto) . "'"; $resultado = mysqli_query($conexion, $queryConsulta) or die("Algo ha ido mal en la consulta a la base de datos"); $arrTabla = array(); while ($columna = mysqli_fetch_assoc($resultado)) { $arrTabla[] = $columna; } if(!empty($arrTabla)){ echo $arrTabla[0]['DATATABLE']; }/* else{ $exito = false; $errorDescripcion = ''; // Los servidores se obtuvieron de la página https://www.proxyscan.io/ ** Todos son de México $arrProxies = array(); // Lista de Proxies para realizar las peticiones //$arrProxies[0]['proxyAndPuerto'] = '187.188.168.57:9991'; // No funciona (puede servir para realizar pruebas del ciclo) //$arrProxies[0]['tipoProxy'] = CURLPROXY_SOCKS4; // $arrProxies[0]['proxyAndPuerto'] = '190.9.54.24:5678'; // $arrProxies[0]['tipoProxy'] = CURLPROXY_SOCKS4; // $arrProxies[1]['proxyAndPuerto'] = '187.216.90.46:5678'; // $arrProxies[1]['tipoProxy'] = CURLPROXY_SOCKS4; // $arrProxies[2]['proxyAndPuerto'] = '201.148.28.17:5678'; // $arrProxies[2]['tipoProxy'] = CURLPROXY_SOCKS4; // $arrProxies[3]['proxyAndPuerto'] = '187.189.81.246:4153'; // $arrProxies[3]['tipoProxy'] = CURLPROXY_SOCKS4; // $arrProxies[4]['proxyAndPuerto'] = '187.217.39.66:5678'; // $arrProxies[4]['tipoProxy'] = CURLPROXY_SOCKS4; // $arrProxies[5]['proxyAndPuerto'] = '177.242.150.6:5678'; // $arrProxies[5]['tipoProxy'] = CURLPROXY_SOCKS4; // Proxy No Disponible // $arrProxies[0]['proxyAndPuerto'] = '169.57.64.4:3128'; // $arrProxies[0]['tipoProxy'] = CURLPROXY_HTTP; // Los servidores se obtuvieron de la página http://proxydb.net/?country=MX ** Todos son de México $arrProxies[0]['proxyAndPuerto'] = '201.159.22.164:46809'; $arrProxies[0]['tipoProxy'] = CURLPROXY_SOCKS4; $arrProxies[1]['proxyAndPuerto'] = '201.144.20.231:5678'; $arrProxies[1]['tipoProxy'] = CURLPROXY_SOCKS4; $arrProxies[2]['proxyAndPuerto'] = '45.167.253.129:999'; $arrProxies[2]['tipoProxy'] = CURLPROXY_HTTPS; $totalProxies = count($arrProxies) - 1; for ($i = 0; $i <= $totalProxies; $i++) { //echo $arrProxies[$i]['proxyAndPuerto'].'
'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); // Dirección URL a capturar curl_setopt($ch, CURLOPT_PROXY, $arrProxies[$i]['proxyAndPuerto']); // El proxy HTTP para enviar peticiones a través de tunel. curl_setopt($ch, CURLOPT_PROXYTYPE, $arrProxies[$i]['tipoProxy']); // Puede ser CURLPROXY_HTTP (por defecto), CURLPROXY_SOCKS4, CURLPROXY_SOCKS5, CURLPROXY_SOCKS4A o CURLPROXY_SOCKS5_HOSTNAME curl_setopt($ch, CURLOPT_TIMEOUT, 60); // Número máximo de segundos permitido para ejectuar funciones cURL curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60); // Número de segundos a esperar cuando se está intentado conectar. Use 0 para esperar indefinidamente curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // "true" para seguir cualquier encabezado "Location: " que el servidor envíe como parte del encabezado HTTP (observe la recursividad, PHP seguirá tantos header "Location: " como se envíen, a no ser que la opción CURLOPT_MAXREDIRS esté establecida) //curl_setopt($ch, CURLOPT_MAXREDIRS, 10); // Número máximo de redirecciones HTTP a seguir. Use esta opción con CURLOPT_FOLLOWLOCATION curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // "true" para devolver el resultado de la transferencia como string del valor de curl_exec() en lugar de mostrarlo directamente $data = curl_exec($ch); // Ejecuta la sesión cURL que se le pasa como parámetro $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); // Obtener información sobre una transferencia específica -> El último código de respuesta. A partir de PHP 5.5.0 y cURL 7.10.8, este es un alias heredado de CURLINFO_RESPONSE_CODE curl_close($ch); // Cierra la sesión cURL if (($httpcode >= 200) && ($httpcode < 300)) { $contenido = $data; if ($contenido) { $tablaHTML = "
"; $seccionGris = strstr($contenido, "section section-grey"); $removeFooter = strstr($seccionGris, "section cookie-warning", true); $tablaHTML .= ("
"); $tablaHTML .= "
"; $tablaHTML = str_replace("'", '"', $tablaHTML); $exito = true; $idProducto = $_POST['id']; $fechaMod = date("Y-m-d H:i:s"); // $queryUpdate = "UPDATE ITT_ASW_EASYVENT SET DATATABLE = '" . trim($tablaHTML) . "', FECHAMOD = '" . trim($fechaMod) . "' WHERE (IDPROD = '" . trim($idProducto) . "');"; $queryInsert = "INSERT INTO ITT_ASW_EASYVENT (IDPROD, DATATABLE, FECHAMOD) VALUES ('" . trim($idProducto) . "', '" . trim($tablaHTML) . "', '" . trim($fechaMod) . "');"; if (mysqli_query($conexion, $queryInsert)) { var_dump('TEST REGISTRO'); } echo $queryInsert; } else { $exito = false; } goto fin_extraerTabla; }else{ $exito = false; } } // Fin del ciclo fin_extraerTabla : if($exito == false){ if(empty($errorDescripcion)){ echo "

Los servidores proxy dejarón de funcionar. Por favor contacte con al administrador del sistema si el problema continua.

"; }else{ echo $errorDescripcion; } } } */ } ?>