Ejemplo n.º 1
0
function encrypt_text($cleartext)
{
    $newString = $cleartext;
    //Break down into html characters twice
    $newString = str_replace("", "", htmlentities($newString));
    $newString = strrev($newString);
    $newString = str_replace("", "", htmlentities($newString));
    $newString = strrev($newString);
    //encode 4 times with base64, reverse, and converted to hex
    for ($i = 0; $i < 3; $i++) {
        $newString = base64_encode($newString);
        $newString = strrev($newString);
        $newString = ascii2hex($newString);
    }
    //and encode with base 64 (reversed) one more time
    $newString = base64_encode($newString);
    $newString = strrev($newString);
    //send it back
    return $newString;
}
Ejemplo n.º 2
0
function prodottiscontati($idcoupon)
{
    //include config
    include "configcar.php";
    //connessione al database
    $db = mysql_connect($host, $user, $psw) or die("Errore nella connessione.");
    //selezione del database
    mysql_select_db($database) or die("Non riesco a selezionare il database");
    //Controllo se ci sono prodotti per questo id-coupon
    $codice = mysql_real_escape_string(ascii2hex(strtolower($idcoupon)));
    //Controllo se ci sono prodotti per questo id-coupon
    $query = mysql_query("SELECT prodotticoupon.idprodotto,prodotticoupon.prezzoscontato FROM coupon JOIN prodotticoupon ON coupon.id=prodotticoupon.idcoupon JOIN prodotticarrello ON prodotticarrello.id=prodotticoupon.idprodotto WHERE coupon.codicecoupon='" . $codice . "' AND CURRENT_DATE()<=coupon.datafine and ((attivati+1)<=quantita or quantita=-1)") or die("Query prodotti coupon non eseguita!");
    $cont = 0;
    $arrayprodotti = array();
    while ($data = mysql_fetch_array($query)) {
        $arrayprodotti[] = array($data[0], $data[1]);
        if (cercaprodotto($data[0]) == false) {
            return array();
        }
    }
    mysql_close($db);
    return $arrayprodotti;
}
Ejemplo n.º 3
0
<?php

// Generate a compressed file
$year_list = array(2012, 2013, 2014);
$strlen = strlen($charset) - 1;
foreach ($year_list as $year) {
    $year = sprintf("%02s", $year - 2000);
    $strings = "";
    foreach (range(1, 53) as $week) {
        for ($i = 0; $i <= $strlen; $i++) {
            for ($i2 = 0; $i2 <= $strlen; $i2++) {
                for ($i3 = 0; $i3 <= $strlen; $i3++) {
                    $char = $charset[$i];
                    $char2 = $charset[$i2];
                    $char3 = $charset[$i3];
                    $serial = sprintf('CP%02d%02d%s%s%s', $year, $week, ascii2hex($char), ascii2hex($char2), ascii2hex($char3));
                    $sha1sum = strtoupper(sha1($serial));
                    $ssid = substr($sha1sum, -6);
                    $strings .= $ssid . "\n";
                }
            }
        }
    }
    $strings = gzcompress($strings, 9);
    $file = '20' . $year . '.dat';
    file_put_contents($file, $strings, LOCK_EX);
}
Ejemplo n.º 4
0
    $control1 = explode("-", $_POST['datafine']);
    if (count($control1) != 3) {
        $msg .= "data fine, ";
        $errore = true;
    }
}
if (isset($_POST['quantita']) and strlen($_POST['quantita']) == 0) {
    $errore = true;
    $msg .= "quantita, ";
}
if (count($_POST['scelto']) == 0) {
    $errore = true;
    $msg .= "prodotti scontati. ";
}
if ($errore == false) {
    $codicehex = ascii2hex(strtolower($_POST['codice']));
    //Controllo se esiste già un id coupon con questo codice
    $queryctrl = mysql_query("SELECT * FROM coupon WHERE codicecoupon='" . $codicehex . "'") or die("Query id coupon non eseguita!");
    if (strlen(@mysql_result($queryctrl, 0, 0)) > 0) {
        $msg = "Questo ID-Coupon esiste gia' ";
        $errore = true;
    } else {
        //Sistemo l'array dei prezzi dei prodotti
        $listafiltrata = array_filter($_POST['prodscontato'], 'strlen');
        $listaprezzoscont = array_merge(array(), $listafiltrata);
        //Sistemo l'array degli id dei prodotti
        $listaidprezzo = array_merge(array(), $_POST['scelto']);
        //Sistemo la data di inizio
        $datainiziopost = explode("-", $_POST['datainizio']);
        $datainizio = $datainiziopost[2] . "-" . $datainiziopost[1] . "-" . $datainiziopost[0];
        //Sistemo la data di fine
Ejemplo n.º 5
0
<?php

// include config
include "configcar.php";
//connessione al database
$db = mysql_connect($host, $user, $psw) or die("Errore nella connessione.");
//selezione del database
mysql_select_db($database) or die("Non riesco a selezionare il database");
//se c'è l'id-coupon controllo quali prodotti corrispondono e li aggiungo al carrello
if (isset($_GET['idcoupon']) and strlen($_GET['idcoupon']) > 0) {
    //Controllo se ci sono prodotti per questo id-coupon
    $codice = mysql_real_escape_string(ascii2hex(strtolower($_GET['idcoupon'])));
    unset($_SESSION['carrello']);
    $queryc = mysql_query("SELECT idprodotto,iconaprodotto,nomeprodotto,sistemaoperativo,duratalicenza,prezzo,peso FROM coupon JOIN prodotticoupon ON coupon.id=prodotticoupon.idcoupon JOIN prodotticarrello ON prodotticarrello.id=prodotticoupon.idprodotto WHERE coupon.codicecoupon='" . $codice . "' AND CURRENT_DATE()<=coupon.datafine") or die("Query coupon non eseguita!");
    while ($datac = mysql_fetch_array($queryc)) {
        //Array(ID,IMMAGINE PRODOTTO,NOME PRODOTTO,SISTEMA OPERATIVO,QUANTITA' INIZIALE,DURATA PRODOTTO,PREZZO SENZA IVA,KG DEL PRODOTTO
        $prodotticoupon[] = array($datac[0], $datac[1], $datac[2], $datac[3], "1", $datac[4] . " anno", $datac[5], $datac[6]);
    }
    $_SESSION['carrello'] = $prodotticoupon;
}
mysql_close($db);
?>
	
Ejemplo n.º 6
0
 foreach ($files as $year => $file) {
     $file = gzuncompress(file_get_contents($path . $file));
     preg_match_all("/" . $findme . "/", $file, $matches[$year], PREG_OFFSET_CAPTURE);
 }
 $keys = array(0);
 $i = 0;
 $get_years = array_keys($matches);
 foreach ($get_years as $get_year) {
     foreach ($matches[$get_year][0] as $found) {
         $found = $found[1] / 7;
         $prodidnum = $found % (36 * 36 * 36);
         $prodweek = ceil($found / (36 * 36 * 36));
         $prodid1 = floor($prodidnum / (36 * 36));
         $prodid2 = floor($prodidnum / 36 % 36);
         $prodid3 = floor($prodidnum % 36);
         $serial = sprintf('CP%02d%02d%s%s%s', $get_year - 2000, $prodweek, ascii2hex(substr($charset, $prodid1, 1)), ascii2hex(substr($charset, $prodid2, 1)), ascii2hex(substr($charset, $prodid3, 1)));
         $sha1sum = strtoupper(sha1($serial));
         $ssid = strtoupper(substr($sha1sum, -6));
         $wep = strtoupper(substr($sha1sum, 0, 10));
         if ($findme == $ssid && $wep != 0) {
             $keys[$i] = $wep;
             $i++;
         }
     }
 }
 if (count($keys) == 0 || $i == 0) {
     echo "<ul>\n";
     echo "   <li class=\"header\">Possible WEP keys for: {$ssid}</li>\n";
     echo "   <li class=\"item\">No WEP keys were found!</li>\n";
     echo "   <a href=\"http://ssid.haukurh.is/\" title=\"Try agian\" target=\"_self\"><li class=\"item link\">try again</li></a>\n";
     echo "</ul>";
Ejemplo n.º 7
0
         $set = array("referrals" => $ref['referrals'] + 1, "myrefs1" => $ref['myrefs1'] + 1);
         $upd = $db->update("members", $set, "id=" . $ref['id']);
         $referrer = $ref['id'];
         /*here start referal_constant*/
         $verificar = $db->fetchOne("SELECT COUNT(*) AS NUM FROM addon WHERE name='referal_constant' ; ");
         if ($verifcar == 0) {
             mis_referidos($ref["id"]);
         }
         /*here end referal_constant*/
     } else {
         $referrer = "0";
     }
 }
 include "includes/encrypt.php";
 $signupdate = time();
 $computerid = ascii2hex(substr(md5($username . $signupdate), 0, 10));
 $account_balance = "0";
 $purchase_balance = "0";
 $membership_bonus = 1;
 $membership_expires = 0;
 if ($settings['signup_bonus'] == "yes") {
     $bonus_pass = 1;
     if ($settings['bonus_start'] == 1 && TIMENOW < $settings['bonus_date']) {
         $bonus_pass = 0;
     } else {
         if ($settings['bonus_ends'] == 2 && $settings['bonus_date_ends'] < TIMENOW) {
             $bonus_pass = 0;
         } else {
             $totalmembers = $db->fetchOne("SELECT value FROM statistics WHERE field='members'");
             if ($settings['bonus_ends'] == 1 && $settings['bonus_totalmembers'] <= $totalmembers) {
                 $bonus_pass = 0;
Ejemplo n.º 8
0
function GetCRC32($cont)
{
    $size = strlen($cont);
    $crc32 = substr($cont, $size - 4, 4);
    $crc32i = ascii2hex($crc32);
    $crc32 = substr($crc32i, 6, 2) . substr($crc32i, 4, 2) . substr($crc32i, 2, 2) . substr($crc32i, 0, 2);
    return $crc32;
}
Ejemplo n.º 9
0
				72026 San Pancrazio Sal.no(Br)<br />
				Tel: 0831.1815236<br />
				Tel/Fax: 0831.1815238<br />
				E-mail: info@arkosoft.it<br />
			</div>
		</div>	
<?php 
    if ($_SESSION['invio'] == "0" and strlen($_SESSION['email']) > 0) {
        //include config
        include "configcar.php";
        //connessione al database
        $db = mysql_connect($host, $user, $psw) or die("Errore nella connessione.");
        //selezione del database
        mysql_select_db($database) or die("Non riesco a selezionare il database");
        //Controllo se ci sono prodotti per questo id-coupon
        $codice = mysql_real_escape_string(ascii2hex($_POST['idcoupon']));
        //Controllo se questo id-coupon è valido
        $querycou = mysql_query("SELECT id,attivati FROM coupon WHERE codicecoupon='" . $codice . "' AND CURRENT_DATE()<=datafine") or die("Query id coupon non eseguita!");
        $coupondb = mysql_real_escape_string(mysql_result($querycou, 0, 0));
        $attivatidb = mysql_result($querycou, 0, 1);
        if (strlen($coupondb) > 0) {
            mysql_query("UPDATE coupon SET attivati='" . ($attivatidb + 1) . "' WHERE id=" . $coupondb . "");
        }
        mysql_close($db);
        //contenuto email per venditore e acquirente
        include "contenutoemail.php";
        $_SESSION['invio'] = "1";
        session_unset();
    } else {
        ?>
			<script>