Location: PHPKode > projects > Katyshop > katyshop_ro_0.3.2.1/web/orders_list.php
<?php
/**
 * Product: Katyshop
 * @version 0.3.2.1
 * @author Catalin Hulea - hide@address.com
 * @copyright Copyright (C) 2007 Catalin Hulea
 * @license GNU General Public License version 3
 * 			You can find a copy of GNU GPL v3 at this path: /docs/LICENSE
 * @link https://sourceforge.net/projects/katyshop
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
require_once(dirname(__FILE__) . "/init.php");
require_once(WEB_DIR . "/includes/req_person_company.php");
?>
<html>
<head>
<title><?php echo APP_NAME; ?></title>
<?php require_once(WEB_DIR . "/includes/html_head.php"); ?>
</head>

<body>
<div id="container">
<?php require_once(WEB_DIR . "/includes/header.php"); ?>
<div id="middle">
<div id="left_vertical_line">
<?php require_once(WEB_DIR . "/includes/left.php"); ?>
<div id="content">
<h1>Istoric comenzi</h1>
<?php require_once(WEB_DIR . "/includes/print_messages.php"); ?>

<dl>
<dt class="title"><b>Comenzile mele</b></dt>
<dd>

<p>
Selectati dupa status:
<a href="orders_list.php">Toate</a>
<?php
$list = Order::getPossibleStatuses();
for($i = 0; $i < count($list); $i++)
{
	if($list[$i] != "in cos")
	{
		?>
		| <a href="orders_list.php?status=<?php echo Escape::url($list[$i]); ?>"><?php echo Escape::html($list[$i]); ?></a>
		<?php
	}
}
?>
</p>
<?php

$db = Application::getDb();
$user = Application::getUser();
//array("id_category" => intval($category->id), "active" => 1), @$_GET["start"], @$_GET["rowsPerPage"], @$_GET["order_by"]["products"], @$_GET["order_direction"]["products"]
//$arr = array("id_user" => $user->id, "status" => @$_GET["status"]);
$arr = Compat::array_clone(@$_GET);
$arr["id_user"] = $user->id;
$list = $db->tbOrder->search($arr, @$_GET["start"], @$_GET["rowsPerPage"], @$_GET["order_by"], @$_GET["order_direction"]);
$ordersCount = $db->tbOrder->getCount($arr, @$_GET["start"], @$_GET["rowsPerPage"], @$_GET["order_by"], @$_GET["order_direction"]);
if($ordersCount > 0)
{
	?>
	<form action="orders_list.php" method="get">
	<?php echo Tools::http_build_hidden_inputs($_GET, array("title")); ?>
	<table style="text-align: right; ">
	<tr>
	<td>Titlu: <input type="text" name="title" value="<?php echo Escape::htmlValue(@$_GET["title"]); ?>"></td>
	<td>Cod: <input type="text" name="code" value="<?php echo Escape::htmlValue(@$_GET["code"]); ?>"></td>
	</tr>
	<tr>
	<td>Status: <input type="text" name="status" value="<?php echo Escape::htmlValue(@$_GET["status"]); ?>"></td>
	<td><input type="submit" value="Cautati" class="button"></td>
	</tr>
	</table>
	</form>

	<table class="cuborder" cellspacing="0">
	<tr>
	<th nowrap><?php echo pagination_columnHead("ID", "id"); ?></th>
	<th nowrap><?php echo pagination_columnHead("Titlu", "title"); ?></th>
	<th nowrap><?php echo pagination_columnHead("Status", "status"); ?></th>
	<th nowrap><?php echo pagination_columnHead("Data emiterii", "date_ordered"); ?></th>
	<th nowrap><?php echo pagination_columnHead("Valoare totala", "value_total"); ?></th>
	</tr>
	<?php
	for($i = 0; $i < count($list); $i++)
	{
		$o = $list[$i];
		?>
		<tr onmouseover="this.style.backgroundColor='#ddeeff'; " onmouseout="this.style.backgroundColor='#ffffff'; ">
		<td><?php echo Escape::html($o->id); ?></td>
		<td onclick="redirect('order.php?id=<?php echo Escape::htmlValue($o->id); ?>'); ">
			<a href="order.php?id=<?php echo Escape::htmlValue($o->id); ?>"><?php echo Escape::html($o->title); ?></a>
			&nbsp;
		</td>
		<td><?php echo Escape::html($o->status); ?></td>
		<td><?php echo Escape::html($o->date_ordered); ?></td>
		<td align="right" style="font-weight: bold; "><?php echo Escape::html(displayPrice($o->value_total)); ?></td>
		</tr>
		<?php
	}
	?>
	<tr>
	<td colspan="5" align="right">
	<?php
	echo pagination_listPages($ordersCount);
	echo pagination_rowsPerPage();
	?>
	</td>
	</tr>
	</table>
	<?php
}
else
{
	?>
	Nu am putut gasi nici o comanda pe baza criteriilor de cautare.
	<?php
}
?>
</dd>
</dl>

</div>
<?php require_once(WEB_DIR . "/includes/right.php"); ?>
<?php require_once(WEB_DIR . "/includes/footer.php"); ?>
</div>
</div>
</div>
</body>
</html>
Return current item: Katyshop