= DATE_SUB(NOW(), INTERVAL 1 $tempo) "; $query2 = " SELECT MIN(proxy_dati_storico.data_destroy) AS first, MAX(proxy_dati_storico.data_destroy) AS last, SUM(proxy_dati_storico.inviati) AS inviati, SUM(proxy_dati_storico.ricevuti) AS ricevuti FROM proxy_dati_storico WHERE ip = '".$pool['ip']."' AND proxy_dati_storico.data_destroy >= DATE_SUB(NOW(), INTERVAL 1 $tempo) "; $res1 = mysql_query( $query1, $DB_ID ); $data1 = mysql_fetch_array ( $res1 ); $res2 = mysql_query( $query2, $DB_ID ); $data2 = mysql_fetch_array ( $res2 ); if (is_null ($data1['first'])) { $first = $data2['first']; } elseif (is_null ($data2['first'])) { $first = $data1['first']; } else { $first = min ($data1['first'], $data2['first']); } if (is_null ($data1['last'])) { $last = $data2['last']; } elseif (is_null ($data2['last'])) { $last = $data1['last']; } else { $last = max ($data1['last'], $data2['last']); } ?> riga(); $tabella->intestazione (array("", "IP", "", "Nome", "", "", "Inizio dati", "", "Fine Dati", "", "Inviati", "", "Ricevuti", "")); ?> Utente limitato Utente non limitato riga(); ?> riga(); } else { if (isset($_POST['ip'])) { $ip = $_POST['ip']; $nome = $_POST['nome']; if (isset($_POST['attivo'])) { $attivo = $_POST['attivo']; } else { $attivo = 0; } $query = " INSERT INTO proxy_pool SET ip = '$ip', nome = '$nome', pool = 1, attivo = $attivo, ins = NOW() "; $res = mysql_query( $query, $DB_ID ); if (!$res) { $error_code = mysql_errno(); if ($error_code == 1062) { ?>
Indirizzo IP gia' esistente
intestazione (array("", "IP", "", "Nome", "", "Limitazione", "")); ?> riga(); ?>     close(); ?>