本文整理汇总了PHP中Transaction::loadById方法的典型用法代码示例。如果您正苦于以下问题:PHP Transaction::loadById方法的具体用法?PHP Transaction::loadById怎么用?PHP Transaction::loadById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transaction
的用法示例。
在下文中一共展示了Transaction::loadById方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
$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 = "testmail@ole.de";
$myTrans->save();
$myTrans->loadById(8);
echo $myTrans->id;
echo $myTrans->fname;
echo $myTrans->lname;
echo $myTrans->email;
示例2: Transaction
} 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>";
示例3: Transaction
<?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;
}
示例4: Transaction
<?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";
}
示例5: mysqli
<?php
//###############################
// Database Credentials
//###############################
require_once 'Transaction.php';
$db_server = "";
$db_name = "DB1401681";
$db_user = "kkdbuser1";
$db_password = "22qmuh22";
$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;
}
}
示例6: 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;
示例7: connectDB
$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>