add payments.phtml
This commit is contained in:
@@ -131,3 +131,41 @@ function mybooks_kuri($page = 1){
|
||||
|
||||
|
||||
|
||||
//все покупки
|
||||
function payments_kuri(){
|
||||
|
||||
$login = check_login_kuri();
|
||||
|
||||
if (!isset($login['client_id'])){
|
||||
header('Location: '.SITE.'login');
|
||||
exit;
|
||||
}
|
||||
|
||||
$paysql = "
|
||||
SELECT
|
||||
date, anbuy.price AS price, buy_status, pricename, category_id, pricehash
|
||||
FROM
|
||||
anbuy
|
||||
LEFT JOIN price ON
|
||||
anbuy.number_id = price.price_id
|
||||
WHERE
|
||||
client_id = {$login['client_id']}
|
||||
ORDER BY
|
||||
buy_id DESC
|
||||
";
|
||||
|
||||
$payments = db_get($paysql);
|
||||
|
||||
$title = 'Мои покупки';
|
||||
|
||||
$tempcontent = VIEWPATH.'payments.phtml';
|
||||
include VIEWPATH.'layout.phtml';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
27
app/views/payments.phtml
Normal file
27
app/views/payments.phtml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?if (is_array($payments)):?>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><strong>Дата</strong></td>
|
||||
<td><strong>Продукт</strong></td>
|
||||
<td><strong>Статус</strong></td>
|
||||
</tr>
|
||||
<?foreach ($payments as $payment):?>
|
||||
<tr>
|
||||
<td><?=$payment['date']?></td>
|
||||
<?if ($payment['category_id'] <> 2 && $payment['buy_status'] == 1):?>
|
||||
<td><strong><a href="<?=SITE?>read/<?=$payment['pricehash']?>"><?=$payment['pricename']?></a></strong></td>
|
||||
<?else:?>
|
||||
<td><?=$payment['pricename']?></td>
|
||||
<?endif?>
|
||||
<?if ($payment['buy_status'] == 1):?>
|
||||
<td>-<?=$payment['price']?> руб.</td>
|
||||
<?else:?>
|
||||
<td><em>неоплачен</em></td>
|
||||
<?endif?>
|
||||
</tr>
|
||||
|
||||
<?endforeach?>
|
||||
</table>
|
||||
|
||||
<?endif?>
|
||||
Reference in New Issue
Block a user