本文整理汇总了PHP中Transaction::setDate方法的典型用法代码示例。如果您正苦于以下问题:PHP Transaction::setDate方法的具体用法?PHP Transaction::setDate怎么用?PHP Transaction::setDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transaction
的用法示例。
在下文中一共展示了Transaction::setDate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: readTransaction
public static function readTransaction($str_xml)
{
// Parser
$parser = new xmlParser($str_xml);
// <transaction>
$data = $parser->getResult('transaction');
$transaction = new Transaction();
// <transaction> <lastEventDate>
if (isset($data["lastEventDate"])) {
$transaction->setLastEventDate($data["lastEventDate"]);
}
// <transaction> <date>
if (isset($data["date"])) {
$transaction->setDate($data["date"]);
}
// <transaction> <code>
if (isset($data["code"])) {
$transaction->setCode($data["code"]);
}
// <transaction> <reference>
if (isset($data["reference"])) {
$transaction->setReference($data["reference"]);
}
// <transaction> <type>
if (isset($data["type"])) {
$transaction->setType(new TransactionType($data["type"]));
}
// <transaction> <status>
if (isset($data["status"])) {
$transaction->setStatus(new TransactionStatus($data["status"]));
}
if (isset($data["paymentMethod"]) && is_array($data["paymentMethod"])) {
// <transaction> <paymentMethod>
$paymentMethod = new PaymentMethod();
// <transaction> <paymentMethod> <type>
if (isset($data["paymentMethod"]['type'])) {
$paymentMethod->setType(new PaymentMethodType($data["paymentMethod"]['type']));
}
// <transaction> <paymentMethod> <code>
if (isset($data["paymentMethod"]['code'])) {
$paymentMethod->setCode(new PaymentMethodCode($data["paymentMethod"]['code']));
}
$transaction->setPaymentMethod($paymentMethod);
}
// <transaction> <grossAmount>
if (isset($data["grossAmount"])) {
$transaction->setGrossAmount($data["grossAmount"]);
}
// <transaction> <discountAmount>
if (isset($data["discountAmount"])) {
$transaction->setDiscountAmount($data["discountAmount"]);
}
// <transaction> <feeAmount>
if (isset($data["feeAmount"])) {
$transaction->setFeeAmount($data["feeAmount"]);
}
// <transaction> <netAmount>
if (isset($data["netAmount"])) {
$transaction->setNetAmount($data["netAmount"]);
}
// <transaction> <extraAmount>
if (isset($data["extraAmount"])) {
$transaction->setExtraAmount($data["extraAmount"]);
}
// <transaction> <installmentCount>
if (isset($data["installmentCount"])) {
$transaction->setInstallmentCount($data["installmentCount"]);
}
if (isset($data["items"]['item']) && is_array($data["items"]['item'])) {
$items = array();
$i = 0;
if (isset($data["items"]['item'][0])) {
foreach ($data["items"]['item'] as $key => $value) {
$item = self::parseTransactionItem($value);
$items[$i] = $item;
$i++;
}
} else {
$items[0] = self::parseTransactionItem($data["items"]['item']);
}
// <transaction> <items>
$transaction->setItems($items);
}
if (isset($data["sender"])) {
// <transaction> <sender>
$sender = new Sender();
// <transaction> <sender> <name>
if (isset($data["sender"]["name"])) {
$sender->setName($data["sender"]["name"]);
}
// <transaction> <sender> <email>
if (isset($data["sender"]["email"])) {
$sender->setEmail($data["sender"]["email"]);
}
if (isset($data["sender"]["phone"])) {
// <transaction> <sender> <phone>
$phone = new Phone();
// <transaction> <sender> <phone> <areaCode>
if (isset($data["sender"]["phone"]["areaCode"])) {
$phone->setAreaCode($data["sender"]["phone"]["areaCode"]);
//.........这里部分代码省略.........
示例2: header
<?php
require_once __DIR__ . "/../autoload/session.autoload.php";
require_once __DIR__ . "/../autoload/checkconnected.autoload.php";
require_once __DIR__ . "/../class/Network.class.php";
require_once __DIR__ . "/../class/Transaction.class.php";
require_once __DIR__ . "/../autoload/produitType.autoload.php";
if (!isset($_GET['date']) || !isset($_GET['magasin'])) {
header("location:/");
}
$Transaction = new Transaction();
$Transaction->setDate($_GET['date']);
$Transaction->setMagasin($_GET['magasin']);
$global = $Transaction->getGlobalWithDATE();
?>
<legend>Fiche Comptable du <?php
echo $_GET['date'];
?>
sur <?php
echo $_GET['magasin'];
?>
</legend>
<h3>Chiffre d'affaires : <?php
echo $global['chiffre_journee'];
?>
€</h3>
<h4 class="margin-top-1">Entrées / sorties de valeur</h4>
示例3: Transaction
<?php
require_once __DIR__ . "/../class/Transaction.class.php";
if (isset($_POST)) {
$Transaction = new Transaction();
$Transaction->setNoTransaction($_POST['id']);
$Transaction->setMagasin($_POST['magasin']);
$Transaction->setDate($_POST['date']);
echo $Transaction->getPrintedDetailledContainer();
}