$this->OrderDate = $row->OrderDate;
            $this->ReceptionDate = $row->ReceptionDate;
            $this->ProcessedDate = $row->ProcessedDate;
            $this->PaymentDate = $row->PaymentDate;
            $this->FinishedDate = $row->FinishedDate;
            break;
        }
        closeDB($connection);
    }
    public function save()
    {
        $connection = connectDB();
        $query = "UPDATE Transactions\n\t\t\t\tSET FirstName = '{$this->fname}',\n\t\t\t\tLastName = '{$this->lname}',\n\t\t\t\tEmail = '{$this->email}',\n\t\t\t\tPayment = '{$this->payment}',\n\t\t\t\tFinalToPay = '{$this->finalToPay}',\n\t\t\t\tPaypalMail = '{$this->PaypalMail}',\n\t\t\t\tBankNr = '{$this->BankNr}',\n\t\t\t\tAccountNr = '{$this->AccountNr}',\n\t\t\t\tStatusDate = '{$this->StatusDate}',\n\t\t\t\tRejectOption = '{$this->RejectOption}',\n\t\t\t\tOrderDate = '{$this->OrderDate}',\n\t\t\t\tReceptionDate = '{$this->ReceptionDate}',\n\t\t\t\tProcessedDate = '{$this->ProcessedDate}',\n\t\t\t\tPaymentDate = '{$this->PaymentDate}',\n\t\t\t\tFinishedDate = '{$this->FinishedDate}'\n\t\t\t\tWHERE id={$this->id}";
        echo $query;
        mysql_query($query);
        closeDB($connection);
    }
}
$myTrans = new Transaction();
$myTrans->loadById(8);
echo $myTrans->id;
echo $myTrans->fname;
echo $myTrans->lname;
echo $myTrans->email;
$myTrans->email = "*****@*****.**";
$myTrans->save();
$myTrans->loadById(8);
echo $myTrans->id;
echo $myTrans->fname;
echo $myTrans->lname;
echo $myTrans->email;
Exemple #2
0
} else {
    $ppMail = "";
}
if (isset($_POST['paypalMailadress'])) {
    $ppMailadress = $_POST['paypalMailadress'];
} else {
    $ppMailadress = "";
}
if ($ppMail == "different") {
    $paypalEmail = $ppMailadress;
} else {
    $paypalEmail = $email;
}
require_once "Transaction.php";
$t = new Transaction();
$t->loadById($transaction);
//print_r($t);
$t->fname = $fn;
$t->lname = $ln;
$t->email = $email;
$t->payment = $payment;
$t->BankNr = $blz;
$t->AccountNr = $kto;
$t->PaypalMail = $paypalEmail;
$t->save();
echo "<table>";
echo "\t<tr><td>{$confirm_label1}</td><td>" . $t->fname . "</td></tr>\n\t\t  \t<tr><td>{$confirm_label2}</td><td>" . $t->lname . "</td></tr>\n\t\t\t<tr><td>{$confirm_label3}</td><td>" . $t->email . "</td></tr>\n\t\t\t<tr><td>{$confirm_label4}</td><td>" . $t->payment . "</td></tr>";
if (strtolower($t->payment) == "paypal") {
    echo "\t<tr><td>{$confirm_label5}</td><td>" . $t->PaypalMail . "</td></tr>";
} else {
    echo "\t<tr><td>{$confirm_label6}</td><td>" . $t->BankNr . "</td></tr>\n\t\t\t  \t<tr><td>{$confirm_label7}</td><td>" . $t->getAccountNr() . "</td></tr>";
<?php

require_once "DhlRetoure.php";
require_once "Transaction.php";
$surname = $_POST["fname"];
$familyname = $_POST["lname"];
$street = $_POST["street"];
$streetNumber = $_POST["streetNr"];
$zip = $_POST["plz"];
$city = $_POST["city"];
$id = $_POST["id"];
// store information
if ($id > 0) {
    $t = new Transaction();
    $t->loadById($id);
    $t->fname = $surname;
    $t->lname = $familyname;
    $t->street = $street;
    $t->streetNr = $streetNumber;
    $t->plz = $zip;
    $t->city = $city;
    $t->save();
}
$dhlRetoure = new DhlRetoure();
$pdf = $dhlRetoure->getBase64Pdf($surname, $familyname, $street, $streetNumber, $zip, $city, $id);
if ($pdf) {
    //$dhlRetoure->displayPdf($pdf);$
    echo $pdf;
}
<?php

require_once "Transaction.php";
//print_r($_POST);
// Read POST data
if (isset($_POST["id"])) {
    $id = $_POST["id"];
    // Create new Transaction and load it by ID
    $t = new Transaction();
    $result = $t->loadById($id);
    echo $result;
    if ($t->loadResult == "error") {
        echo "error";
        return;
    }
    $json = json_encode($t);
    echo $json;
} else {
    echo "post error";
}
Exemple #5
0
<?php

//###############################
// Database Credentials
//###############################
require_once 'Transaction.php';
$db_server = "";
$db_name = "DB1401681";
$db_user = "******";
$db_password = "******";
$mysqli = new mysqli($db_server, $db_user, $db_password, $db_name);
//$mysqli = new mysqli($db_server,$db_user, $db_password, $db_name);
if ($mysqli->connect_errno) {
    echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}
// QUERY - Transaction
$query = "SELECT * FROM Transactions";
$result = $mysqli->query($query) or die($mysqli->error . __LINE__);
print_r($result);
$transactions;
// GOING THROUGH THE DATA
if ($result->num_rows > 0) {
    while ($row = $result->fetch_assoc()) {
        print_r($row);
        $transaction = new Transaction();
        $transaction->loadById($row['id']);
        $transactions[] = $transaction;
    }
}
<?php

require_once "Transaction.php";
require_once "post.php";
//print_r($_POST);
// Read POST data
if (isset($_POST["id"]) && isset($_POST["status"])) {
    $id = $_POST["id"];
    $statusName = $_POST["status"];
    $lang = $_POST['language'];
    // Create new Transaction and load it by ID
    $transaction = new Transaction();
    $transaction->loadById($id);
    // Check valid change?
    if ($transaction->statusNumber >= 1 && $statusName == "Confirmed") {
        echo "allready confirmed or later status";
        return;
    }
    // Change status
    $transaction->status = $statusName;
    $transaction->StatusDate = date("Y-m-d H:i:s");
    switch ($statusName) {
        case "InCart":
            break;
        case "Confirmed":
            $transaction->OrderDate = date("Y-m-d H:i:s");
            $transaction->language = $lang;
            break;
        case "Received":
            $transaction->ReceptionDate = date("Y-m-d H:i:s");
            break;
$mysqli = connectDB();
//$mysqli = new mysqli($db_server,$db_user, $db_password, $db_name);
if ($mysqli->connect_errno) {
    echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}
// QUERY - Transaction
$query = "SELECT * FROM Transactions WHERE Status NOT LIKE 'InCart' OR LastName NOT LIKE '' ORDER BY id DESC";
$result = $mysqli->query($query) or die($mysqli->error . __LINE__);
//print_r($result);
$transactions;
// GOING THROUGH THE DATA
if ($result->num_rows > 0) {
    while ($row = $result->fetch_object()) {
        //print_r($row);
        $transaction = new Transaction();
        $transaction->loadById($row->id);
        $transactions[] = $transaction;
    }
} else {
    echo 'NO RESULTS - No Transactions at all';
}
?>
    
    <table id="fullTable">
    <thead>
	<tr>
        <th>Id</th>
        <th>Status</th>
        <th>StatusDate</th>
        <th>OrderDate</th>
        <th>Reception Date</th>