session_start();
include 'connect.php';
include 'functions.php';
include 'config.php';
include 'check_login_access.php';
#*************************
#
# Подключаем шапочку
include 'inc_top.php';
#
#*************************
if($users[$_SESSION['login']][$_module_name]['access']['C'])
echo '
if(!isset($_GET['showall']) AND !isset($_GET['showerrors']) AND !isset($_GET['tovar_type']) AND !isset($_GET['how_to_pay']) AND !isset($_GET['check_sum']) )
include "include/date_nav.php";
?>
№
ID
Old ID
Дата заказа
Контакты заказчика
Как оплатили
Счет
Сумма
В белую
Номенклатура
Расходы
Возврат
Комментарий
ob_start();
if(isset($_GET['showall']))
$sql = "SELECT * FROM wexcel_zakazy_new ORDER BY order_date DESC, id DESC";
elseif(isset($_GET['order_status']) AND $_GET['order_status'] != 'Статус')
{
$sql = "SELECT * FROM wexcel_zakazy_new WHERE order_status = '{$_GET['order_status']}' ORDER BY order_date DESC, id DESC";
echo $sql;
}
elseif(isset($_GET['how_to_pay']))
{
if(isset($_GET['tovar_type']))
$sql = "SELECT * FROM wexcel_zakazy_new WHERE how_to_pay = '{$_GET['how_to_pay']}' AND tovar_type = '{$_GET['tovar_type']}' ORDER BY order_date DESC, id DESC";
else
$sql = "SELECT * FROM wexcel_zakazy_new WHERE how_to_pay = '{$_GET['how_to_pay']}' ORDER BY order_date DESC, id DESC";
}
elseif(isset($_GET['tovar_type']))
$sql = "SELECT * FROM wexcel_zakazy_new WHERE tovar_type = '{$_GET['tovar_type']}' ORDER BY order_date DESC, id DESC";
elseif(isset($_GET['showerrors']))
$sql = "SELECT * FROM wexcel_zakazy_new WHERE problem = '1' ORDER BY order_date DESC, id DESC";
elseif(isset($_GET['check_sum']))
$sql = "SELECT * FROM wexcel_zakazy_new WHERE check_sum = 0 AND tovar_type = '{$cfg['zakazy_new_tovar_type'][0]}' AND how_to_pay != '{$cfg['zakazy_new_kak_oplatili'][3]}' AND how_to_pay != '{$cfg['zakazy_new_kak_oplatili'][4]}' ORDER BY order_date DESC";
else
$sql = "SELECT * FROM wexcel_zakazy_new WHERE ('".$date_start."' < order_date OR '".$date_start."' = order_date) AND order_date < '".$date_end."' ORDER BY id DESC";
$res = mysql_query($sql);
$j = 0;
while( $row = mysql_fetch_array($res) )
{
$color = "#fff";
if($users[$_SESSION['login']][$_module_name]['access']['E'])
$tr_onclick = "class='zakazyNewEditDialogLink'";
else
$tr_onclick = "";
?>
if($row['problem'] == '1')
$color = "#ffaeae";
else
$color = "";
?>