Beispiel #1
0
<?php

include "../../fn/motor.php";
$x = coneccion();
$elimProduc = mysql_real_escape_string($_GET['id']);
$sql = "DELETE FROM producto WHERE id ='" . $elimProduc . "'";
$insert = mysql_query($sql);
if ($insert) {
    header("location: " . $_SERVER['HTTP_REFERER']);
}
echo "<div class='alert-error'>Hay problemas <br />" . mysql_error() . "</div>";
<?php

// Extrae proyecto del senado (http://sil.senado.cl)
include 'simple_html_dom.php';
include 'log.php';
require "class/cnx.php";
require "class/controlador.php";
$coneccion = coneccion();
$o = new Controlador();
$log = new Logging();
$arrayMeses = array("", "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
$debug = true;
$write = false;
$sil_url = 'http://sil.senado.cl/cgi-bin/';
$fechas_url = $sil_url . 'sil_ultproy.pl';
$proyectos_url = $sil_url . 'sil_proyectos.pl?';
$autores_url = $sil_url . 'sil_autores.pl?';
$desde = "30/04/2010";
$hasta = "09/05/2010";
$log->lwrite_ln();
$log->lwrite("Periodo: " . $desde . "-" . $hasta);
$log->lwrite_ln();
if ($debug) {
    echo "<br>----------------Periodo: " . $desde . "-" . $hasta . "-------------------<br>";
}
$fechas_post = file_get_contents_curl($fechas_url, $desde, $hasta);
$fechas_html = str_get_html($fechas_post);
$num = 0;
foreach ($fechas_html->find('td[class="TEXTpais"]') as $nro) {
    $nro_boletin = trim(str_replace("&nbsp;", "", $nro->plaintext));
    if ($debug) {