本文整理汇总了PHP中Purchase::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Purchase::getInstance方法的具体用法?PHP Purchase::getInstance怎么用?PHP Purchase::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Purchase
的用法示例。
在下文中一共展示了Purchase::getInstance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Goods
include_once "../models/purchase.php";
include_once "../models/goods.php";
$id_purchase = Purchase::getInstance()->buy();
Purchase::getInstance()->getPurchase($id_purchase);
$good = new Goods();
$good->getGood(Purchase::getInstance()->id_good);
$GLOBALS['title'] = "Покупка";
include_once "header.php";
?>
<p><b>Покупка успешно завершена!</b></p>
<?php
if (Purchase::getInstance()->id_good != '') {
echo "<p>Ваш номер заказа:" . $id_purchase;
?>
</p>
<p>Вы заказали
<?php
echo "<b>" . $good->name . ", " . Purchase::getInstance()->count . " шт<br></b>";
echo "Сумма заказа: " . Purchase::getInstance()->cost . " руб.";
}
?>
</p>
<p>Чуть позднее с Вами свяжется наш специалист для уточнения времени доставки.</p>
<p>*по указанному Вами телефону в настройках.</p>
<a href="http://localhost/iba/cart">Вернуться к корзине</a>
<?php
include_once "footer.php";
示例2: session_start
<?php
session_start();
include_once "../core/model.php";
include_once "../models/purchase.php";
if (isset($_SESSION['id_admin'])) {
include_once "../views/admin-header.php";
?>
<h2>Покупки на сайте</h2>
<?php
$all_purchases = Purchase::getInstance()->getData();
foreach ($all_purchases as $array => $each) {
echo "<p><a href='" . PATHSITE . "/admin-purchase/" . $each['id'] . "'> #" . $each['id'] . ". " . $each['data'] . "</a></p>";
}
include_once "../views/footer.php";
} else {
header("Location:" . PATHSITE . "/user/login-admin");
}
示例3:
<label>Email покупателя:</label>
<input type="email" id="email_addr" name="email_addr" value="<?php
echo $user->email;
?>
" readonly="readonly">
<label>Мобильный номер покупателя:</label>
<input type="tel" id="mob_phone" name="mob_phone" maxlength="9" value="<?php
echo $user->phone;
?>
" readonly="readonly">
<label>Адрес:</label>
<input type="text" id="address" name="address" maxlength="50" value="<?php
echo $user->address;
?>
" readonly="readonly">
<label>Покупка оформлена?</label>
<input type="checkbox" id="is_finished" name="is_finished" <?php
if (Purchase::getInstance()) {
echo "checked='checked'";
}
?>
>
<input type="submit" value="Сохранить" />
</form>
<?php
include_once "footer.php";