if ($conn->connect_error) {
        die("connection failed" . $conn->connect_error);
    }
    $first_name = $_POST['first_name'];
    $last_name = $_POST['last_name'];
    $password = $_POST['password'];
    $email = $_POST['email'];
    $sql = "INSERT INTO users (first_name, last_name, password, email) VALUES (" . $first_name . "," . $last_name . "," . $password . "," . $email . ")";
    if ($conn->query($sql) === TRUE) {
        echo "it worked";
    } else {
        echo "sorry it didn't";
    }
}
if (!empty($_POST["first_name"])) {
    addInfo();
}
?>
<!DOCTYPE html>
<html>
<head>
    <title>iApple - iPad's</title>
    <link rel="stylesheet" type="text/css" href="homestyle.css">
    <link href='https://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'>
    <script src="jquery copy.js"></script>
    <script src="java.js"></script>
</head>

<body>
<form name="form" method="post">
Beispiel #2
0
$data = $_POST;
$log_path = $data['log_file'];
$label = $data['label'];
if ($log_path == null or !file_exists($log_path)) {
    echo json_encode(array("code" => 100, 'data' => '请指定文件'));
    exit;
}
//$label = ['AllIndicator'];
$analysis = new LogAnalysis($log_path);
$analysis->process();
$PV = $analysis->calPv();
$UV = $analysis->calUv();
// 调用下面几个函数前需要先调用process函数
$NumberOfVisit = $analysis->getNumberOfVisit();
$AvPagesOfVisit = $analysis->getAvPagesOfVisit();
$AvDurationOfVisit = $analysis->getAvDurationOfVisit();
$BounceRate = $analysis->getBounceRate();
$PercentNewVisit = $analysis->newVisitPercent();
$res = array("PV" => $PV, 'UV' => $UV, 'NumberOfVisit' => $NumberOfVisit, 'AvPagesOfVisit' => $AvPagesOfVisit, 'AvDurationOfVisit' => $AvDurationOfVisit, 'BounceRate' => $BounceRate, 'PercentNewVisit' => $PercentNewVisit);
// insert into db
$data = array('file_name' => '', 'page_view' => $PV, 'unique_visitor' => $UV, 'num_of_visitor' => $NumberOfVisit, 'pages_per_visit' => $AvPagesOfVisit, 'av_visit_duration' => $AvDurationOfVisit, 'bounce_rate' => $BounceRate, 'per_of_new_visit' => $PercentNewVisit, 'add_time' => date("Y-m-d H:i:s"));
addInfo($data);
if (in_array('AllIndicator', $label)) {
    echo json_encode(array("code" => 200, 'data' => $res));
} else {
    $temp = array();
    foreach ($label as $val) {
        $temp[$val] = $res[$val];
    }
    echo json_encode(array("code" => 200, 'data' => $temp));
}
Beispiel #3
0
 addInfo('', 0);
 addInfo('Kills remaining to be fetched.', $mdb->count('crestmails', ['processed' => false]));
 $killsLastHour = new RedisTtlCounter('killsLastHour', 3600);
 addInfo('Kills last hour', $killsLastHour->count());
 addInfo('Total Kills', $redis->get('zkb:totalKills'));
 addInfo('Top killID', $mdb->findField('killmails', 'killID', [], ['killID' => -1]));
 addInfo('', 0);
 addInfo('Api KillLogs to check', $redis->zCount('tqApiChars', 0, time()));
 addInfo("Api KeyInfos to check", $redis->zCount('tqApis', 0, time()));
 addInfo('Char/Corp Apis', $redis->zCard('tqApiChars'));
 addInfo('Valid Apis', $redis->zCard('tqApis'));
 addInfo('', 0);
 $visitors = new RedisTtlCounter('ttlc:visitors', 300);
 addInfo('Unique IPs in last 5 minutes', $visitors->count());
 $requests = new RedisTtlCounter('ttlc:requests', 300);
 addInfo('Requests in last 5 minutes', $requests->count());
 $info = $redis->info();
 $mem = $info['used_memory_human'];
 $stats = $mdb->getDb()->command(['dbstats' => 1]);
 $dataSize = number_format($stats['dataSize'] / (1024 * 1024 * 1024), 2);
 $storageSize = number_format($stats['storageSize'] / (1024 * 1024 * 1024), 2);
 $memory = getSystemMemInfo();
 $memTotal = number_format($memory['MemTotal'] / (1024 * 1024), 2);
 $memUsed = number_format(($memory['MemTotal'] - $memory['MemFree'] - $memory['Cached']) / (1024 * 1024), 2);
 $maxLen = 0;
 foreach ($infoArray as $i) {
     foreach ($i as $key => $value) {
         $maxLen = max($maxLen, strlen("{$value}"));
     }
 }
 echo exec('date') . '  Load: ' . getLoad() . "  Memory: {$memUsed}G/{$memTotal}G  Redis: {$mem}  TokuDB: {$storageSize}G / {$dataSize}G\n";
Beispiel #4
0
            $msg .= " {$dup[0]} ({$dup[1]})";
        }
        addInfo($date, $msg);
    }
    // Check that there is an artist
    $artist = WotdArtist::getByDate($date);
    if (!$artist) {
        addError($date, 'Niciun artist nu este asignat; verificați conținutul fișierului docs/imageCredits/wotd.desc');
    }
    // Check that there is an image
    if (!$wotd->image) {
        $assignedImage = assignImageByName($wotd, $def);
        if ($assignedImage) {
            $wotd->image = $assignedImage;
            $wotd->save();
            addInfo($date, "Am asociat definiția '{$def->lexicon}' cu imaginea {$assignedImage}");
        } else {
            addError($date, sprintf("Definiția '%s' nu are o imagine asociată (motivul alegerii: %s)", $def->lexicon, $wotd->description));
            if ($artist && !in_array($artist->email, $rcptError)) {
                $rcptError[] = $artist->email;
            }
            continue;
        }
    }
    // Check that the image file exists
    if (!$wotd->imageExists()) {
        addError($date, sprintf("Definiția '%s' are imaginea asociată '%s', dar fișierul nu există", $def->lexicon, $wotd->image));
        continue;
    }
}
log_scriptLog("checkWotd: collected " . count($messages) . " messages");
Beispiel #5
0
            $wotds[0]->image = $assignedImage;
            $wotds[0]->save();
            addInfo($date, "Am asociat definiția '{$def->lexicon}' cu imaginea {$assignedImage}");
        } else {
            addError($date, sprintf("Definiția '%s' nu are o imagine asociată (motivul alegerii: %s)", $def->lexicon, $wotds[0]->description));
            continue;
        }
    }
    // Check that the image file exists
    if (!$wotds[0]->imageExists()) {
        addError($date, sprintf("Definiția '%s' are imaginea asociată '%s', dar fișierul nu există", $def->lexicon, $wotds[0]->image));
        continue;
    }
    // Warn if the image has no credits
    if (!$wotds[0]->getImageCredits()) {
        addInfo($date, "Imaginea {$wotds[0]->image} nu are credite; verificați conținutul fișierului docs/imageCredits/wotd.desc");
    }
}
log_scriptLog("checkWotd: collected " . count($messages) . " messages");
if (count($messages)) {
    if ($firstErrorDate) {
        $today = date("Y-m-d", strtotime("today"));
        $days = daysBetween($today, $firstErrorDate);
        switch ($days) {
            case 0:
            case 1:
                $subject = 'ACUM';
                break;
            case 2:
                $subject = 'ASTĂZI';
                break;
 *
 *
 *
 * This software is furnished under a license and may be used and copied
 * only  in  accordance  with  the  terms  of such  license and with the
 * inclusion of the above copyright notice.  This software  or any other
 * copies thereof may not be provided or otherwise made available to any
 * other person.  No title to and  ownership of the  software is  hereby
 * transferred.
 *
 *
 * ******************************************************************** */
/**
 * @author Maciej Husak <*****@*****.**>
 */
if (!defined("WHMCS")) {
    die("This file cannot be accessed directly");
}
if (isset($_POST['action']) && $_POST['action'] == 'addProduct') {
    if (mysql_num_rows(mysql_query_safe("SELECT `id` FROM tblproductgroups WHERE `name`='SpamExperts'")) == 0) {
        mysql_safequery("INSERT INTO tblproductgroups (`name`) VALUES(?)", array('SpamExperts'));
    }
    $group = mysql_fetch_assoc(mysql_query("SELECT `id` FROM tblproductgroups WHERE `name`='SpamExperts'"));
    $api = getWHMCSconfig('kwspamexperts_api');
    $data = unserialize($api);
    if (mysql_safequery("INSERT INTO tblproducts \n        (\n            `type`,\n            `name`,\n            `gid`,\n            `configoption1`,\n            `configoption2`,\n            `configoption3`,\n            `configoption4`,\n            `configoption5`,\n            `configoption6`,\n            `servertype`,\n            `showdomainoptions`,\n            `paytype`\n        ) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)", array('hostingaccount', $_POST['product']['name'], $group['id'], $_POST['product']['type'], $data['url'], $data['user'], $data['password'], $data['disable_manage_routes'], $data['disable_edit_contact'], 'kwspamexperts', 'on', 'free'))) {
        addInfo('Product has been added');
    } else {
        addError(mysql_error());
    }
}
Beispiel #7
0
<?php

if (!defined("WHMCS")) {
    die("This file cannot be accessed directly");
}
if (isset($_POST['action']) && $_POST['action'] == 'savechanges') {
    if (saveWHMCSconfig2('kwspamexperts_api', serialize($_POST['conf']))) {
        updateProductsConfig(serialize($_POST['conf']));
        if (mysql_error()) {
            addError("Products configuration update failed: " . mysql_error());
        }
        addInfo('Configuration has been saved.');
    } else {
        addError(mysql_error());
    }
}
$api = getWHMCSconfig('kwspamexperts_api');
$data = unserialize($api);
Beispiel #8
0
<?php

require_once 'include.php';
$act = $_REQUEST['act'];
@($id = $_REQUEST['id']);
@($id_guest = $_REQUEST['id_guest']);
@($id_host = $_REQUEST['id_host']);
@($album_id = $_REQUEST['album_id']);
@($img_path = $_REQUEST['img_path']);
if ($act == "register") {
    $mes = register();
} elseif ($act == "addInfo") {
    $mes = addInfo();
} elseif ($act == "addLanguage") {
    $mes = addLanguage();
} elseif ($act == "addAcco") {
    $mes = addAcco();
} elseif ($act == "addAllAcco") {
    $mes = addAllAcco();
} elseif ($act == "addLocation") {
    $mes = addLocation();
} elseif ($act == "addCalendar") {
    $mes = addCalendar();
} elseif ($act == "addFromDate") {
    $mes = addFromDate();
} elseif ($act == "addMinDays") {
    $mes = addMinDays();
} elseif ($act == "addPrice") {
    $mes = addPrice();
} elseif ($act == "addPhotos") {
    $mes = addPhotos();