Пример #1
0
function makeOrders($config)
{
    $conn = new connection($config);
    $allegroConn = new ALLEGRO();
    $sandbox_auctions = $conn->query("SELECT auction_id FROM allegro WHERE sandbox = TRUE;");
    $production_auctions = $conn->query("SELECT auction_id FROM allegro WHERE sandbox = FALSE;");
    $sandbox_orders = GetAuctionDetails($allegroConn, CleanData($sandbox_auctions->fetchAll(), 'auction_id'), $allegroConn->sandbox);
    $production_orders = GetAuctionDetails($allegroConn, CleanData($production_auctions->fetchAll(), 'auction_id'), $allegroConn->production);
    $orders = array_merge($sandbox_orders, $production_orders);
    print "<pre>";
    //print_r($orders);
    print "</pre>";
    foreach ($orders as $order) {
        if (CheckIfRecordExist($order->order_id, $conn)) {
            /*Record already exist*/
        } else {
            $conn->query("\n                    INSERT INTO client(city , postal_code ,email , address , nick , name)\n                    VALUES(\n                        '" . $order->client->city . "',\n                        '" . $order->client->postal_code . "',\n                        '" . $order->client->email . "',\n                        '" . $order->client->address . "',\n                        '" . $order->client->nick . "',\n                        '" . $order->client->name . "');");
            $clientID = $conn->conn->lastInsertId();
            $conn->query("\n                INSERT INTO orders VALUES (\n                  '" . $order->order_id . "',\n                  1,\n                  " . $clientID . ",\n                  '" . $order->date . "',\n                  '" . $order->message . "',\n                  '" . $order->delivery . "',\n                  " . $order->amount . "\n                );\n            ");
            print $conn->error;
        }
    }
}
Пример #2
0
<?php

function CleanData($data)
{
    if (get_magic_quotes_gpc()) {
        $data = stripslashes($data);
    }
    $data = str_replace("\n", '', trim($data));
    $data = str_replace("\r", '', $data);
    return $data;
}
$name = CleanData($_POST['name']);
$email = CleanData($_POST['email']);
$feedback = CleanData($_POST['feedback']);
$toaddress = "*****@*****.**";
$subject = "Booking Inquiry";
$mailcontent = "Name: " . $name . "\n" . "E-mail: " . $email . "\n" . "Comments: " . $feedback . "\n";
$fromaddress = "From: " . $name . "<" . $email . ">";
mail($toaddress, $subject, $mailcontent, $fromaddress);
header("Location: ../thankyou.php");
die;
?>

Пример #3
0
if (isset($_SERVER["argv"][3])) {
    $optparam1 = $_SERVER["argv"][3];
} else {
    $optparam1 = NULL;
}
// Second Optional Parameter
if (isset($_SERVER["argv"][4])) {
    $optparam2 = $_SERVER["argv"][4];
} else {
    $optparam2 = NULL;
}
// Third Optional Parameter
if (isset($_SERVER["argv"][5])) {
    $optParam3 = $_SERVER["argv"][5];
} else {
    $optParam3 = NULL;
}
// fourth Optional Parameter
if (isset($_SERVER["argv"][6])) {
    $optParam4 = $_SERVER["argv"][6];
} else {
    $optParam4 = NULL;
}
// ---
// --- Operation Handling now
if ($operation == "cleandata") {
    // Run Parser only
    CleanData($optparam1, $optparam2, $optParam3, $optParam4);
}
// ---
// ---