Пример #1
1
    //создаем второй массив 2го уровня вложености в первый
    $orderinfo = array();
    //перебираем массив с данными из файла и этими данными заполняем массив 2го уровня вложености
    foreach ($info_from_file as $item) {
        //каждую строку разделяем на переменные
        list($n, $e, $t, $a, $c, $dt) = explode('|', $item);
        //и каждую переменную вкладываем в отдельную ячейку 2го массива
        $orderinfo['name'] = $n;
        $orderinfo['mail'] = $e;
        $orderinfo['tel'] = $t;
        $orderinfo['addr'] = $a;
        $orderinfo['cust'] = $c;
        $orderinfo['datetime'] = $dt;
        $sql = "SELECT * FROM orders WHERE datetime = '{$orderinfo['datetime']}' AND customer = '{$orderinfo['cust']}'";
        $res = mysql_query($sql) or die(mysql_error());
        $orderinfo['tovari_v_zakaze'] = convertData($res);
        //после заполнения массива orderinfo данными покупателя из файла -
        //вкладываем масиив $orderinfo в ячейку $allorders[] и идем перебирать следующую строку из файла
        $allorders[] = $orderinfo;
    }
    return $allorders;
}
$test = getOrders();
echo '<pre>';
print_r($test);
echo '</pre>';
/*
foreach ($test as $v){
	echo $v.'<br>';
}
*/
Пример #2
0
        <thead>
            <tr>
                <th class="text-center">Empresa</th>
                <th class="text-center">Pedido</th>
                <th class="text-center">Descrição</th>
                <th class="text-center">Qtd.</th>
                <th class="text-center">Preço</th>
                <th class="text-center">Status</th>
                <th class="text-center">Avaliação</th>
                <th class="text-center">Endereço de entrega</th>
                <th class="text-center">Opções</th>
            </tr>
        </thead>
        <tbody>
            <?php 
getOrders($_SESSION['id']);
?>
        </tbody>
    </table>
</div>
<?php 
function getOrders($userID)
{
    global $conn;
    if ($stmtOrders = $conn->prepare("SELECT o.`orde_id`, o.`Companies_comp_id`, o.`orde_price`, o.`orde_status`, o.`orde_stars`, o.`orde_address`, ohp.`Products_prod_id`, p.`prod_description`, p.`prod_price`, c.`comp_name` FROM orders o, orders_has_products ohp, products p, companies c WHERE o.`Users_user_id`=? AND ohp.`Orders_orde_id`=o.`orde_id` AND p.`prod_id`=ohp.`Products_prod_id` AND c.`comp_id`=o.`Companies_comp_id` ORDER BY o.`orde_id` DESC")) {
        $stmtOrders->bind_param("i", $userID);
        $stmtOrders->execute();
        $stmtOrders->bind_result($orderID, $orderCompanyID, $orderPrice, $orderStatus, $orderStars, $orderAddress, $productID, $productDescription, $productPrice, $compName);
        $stmtOrders->store_result();
        while ($stmtOrders->fetch()) {
            $showReceiveOption = $orderStatus;
Пример #3
0
<?php

_e("<h1>Chi Tiết Hóa Đơn</h1>");
$ordersDetail = getOrdersDetails($orderID);
$order = getOrders($orderID);
foreach ($order as $info) {
    $user_info = get_userdata($info->userID);
    $total = get_total_from_db($info->ID);
    $infor_user = explode('-', $info->name);
    _e('Hóa đơn lập lúc: ' . date('h:i d-m-Y', $info->datetime) . "<br/>");
    _e('Khách hàng: <strong>' . $infor_user[0] . "</strong><br/>");
    _e('Email: <strong>' . $user_info->user_email . "</strong><br/>");
    _e('Điện Thoai: <strong>' . $infor_user[1] . "</strong><br/>");
    _e('Địa Chỉ: <strong>' . $infor_user[2] . "</strong>");
}
$num = 0;
?>
	<table id="insured_list" class="tablesorter center"> 
	<thead>
	  <tr class="center">
	    <th> STT </th>
	    <th> Tên Sản phẩm </th>
	    <th style="width: 150px;"> Đơn giá (VND)</th>
	    <th style="width: 100px;"> Giảm giá (%)</th>
	    <th style="width: 150px;"> Số lượng (cái)</th>
	    <th style="width: 150px;"> Thành tiền (VND) </th>
	  </tr>
	  </thead>
	  <tbody>
	  <?php 
foreach ($ordersDetail as $detail) {
Пример #4
0
<?php

ini_set('display_errors', 1);
include 'connection.php';
if ($_POST['method'] == "getOrders") {
    getOrders($_POST['json']);
    //call getOrders method
} elseif ($_POST['method'] == "addOrder") {
    addOrder($_POST['json']);
} elseif ($_POST['method'] == "searchItems") {
    searchItems($_POST['json']);
}
function getOrders($json)
{
    global $mysqli;
    //get params from json object
    $jsonObj = json_decode($json);
    $date = $jsonObj->{'date'};
    $style = $jsonObj->{'style'};
    $undate = strtotime($date);
    $year = date('Y', $undate);
    $month = date('m', $undate);
    $day = date('d', $undate);
    if ($style === "YEAR") {
        $strQuery = "SELECT * FROM orders WHERE (DATE Like '" . $year . "-%')";
        getSalesByQuery($strQuery);
    } elseif ($style === "MONTH") {
        $strQuery = "SELECT * FROM orders WHERE (DATE Like '" . $year . "-" . $month . "-%')";
        getSalesByQuery($strQuery);
    } elseif ($style === "DAY") {
        $strQuery = "SELECT * FROM orders WHERE (DATE = '" . $date . "' )";
Пример #5
0
<?php

set_time_limit(1500);
//increase time-out to 25 mins as downloading and parsing the tree may take a while
//SiteID must also be set in the Request's XML
//SiteID = 0  (US) - UK = 3, Canada = 2, Australia = 15, ....
//SiteID Indicates the eBay site to associate the call with
$siteID = 77;
//Get the online version number
$responseXml = getOrders($devID, $appID, $certID, $compatabilityLevel, $siteID, $userToken, $serverUrl);
//Xml string is parsed and creates a DOM Document object
$responseDoc = new DomDocument();
$responseDoc->loadXML($responseXml);
$Orders = $responseDoc->getElementsByTagName('Order');
//print_r($responseXml);
function getOrders($devID, $appID, $certID, $compatabilityLevel, $siteID, $userToken, $serverUrl)
{
    //Build the request Xml string
    $requestXmlBody = '<?xml version="1.0" encoding="utf-8" ?>';
    $requestXmlBody .= '<GetOrdersRequest xmlns="urn:ebay:apis:eBLBaseComponents">';
    $requestXmlBody .= "<RequesterCredentials><eBayAuthToken>{$userToken}</eBayAuthToken></RequesterCredentials>";
    $requestXmlBody .= "<CreateTimeFrom>2011-12-19T20:34:44.000Z</CreateTimeFrom>";
    $requestXmlBody .= "<CreateTimeTo>2012-01-01T20:34:44.000Z</CreateTimeTo>";
    $requestXmlBody .= '<OrderRole>Seller</OrderRole>';
    $requestXmlBody .= '<OrderStatus>All</OrderStatus>';
    $requestXmlBody .= '</GetOrdersRequest>';
    //Create a new eBay session with all details pulled in from included keys.php
    $session = new eBaySession($userToken, $devID, $appID, $certID, $serverUrl, $compatabilityLevel, $siteID, 'GetOrders');
    //send the request
    $responseXml = $session->sendHttpRequest($requestXmlBody);
    if (stristr($responseXml, 'HTTP 404') || $responseXml == '') {
Пример #6
0
<?php

/*
 * Order listing page. We rely on the local database
 * to retrieve the order history of this buyer. 
 */
require_once __DIR__ . '/../bootstrap.php';
if (!isset($_SESSION)) {
    session_start();
}
if (!isSignedIn()) {
    header('Location: ../user/sign_in.php');
    exit;
}
try {
    $orders = getOrders(getSignedInUser());
} catch (Exception $ex) {
    // Don't overwrite any message that was already set
    if (!isset($message)) {
        $message = $ex->getMessage();
        $messageType = "error";
    }
    $orders = array();
}
?>
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<meta content='IE=Edge,chrome=1' http-equiv='X-UA-Compatible'>
<meta content='width=device-width, initial-scale=1.0' name='viewport'>
Пример #7
0
                    </th>
                    <th>
                        Пользователь
                    </th>
                    <th>
                        Компания
                    </th>
                    <th>
                        Комментарий
                    </th>
                    <th width="200">
                        Сумма
                    </th>
                </tr>
                <?php 
$users = getOrders();
while ($do = mysql_fetch_array($users)) {
    ?>
                <tr orderID="<?php 
    echo $do["id"];
    ?>
">
                    <td align="right">
                        <?php 
    echo $do['id'];
    ?>
                    </td>
                    <td align="right">
                        <?php 
    echo $do['orderdate'];
    ?>
Пример #8
0
//header ('Content-type: text/html; charset=utf-8');
// запуск сессии
session_start();
// подключение библиотек
require "eshop_db.inc.php";
require "eshop_lib.inc.php";
?>
<html>
<head>
	<meta charset="utf-8">
	<title>Поступившие заказы</title>
</head>
<body>
<h2>Поступившие заказы:</h2>
<?php 
$allorders = getOrders();
foreach ($allorders as $item) {
    ?>
<hr>
<p><b>Заказчик</b>: <?php 
    echo $item['name'];
    ?>
</p>
<p><b>Email</b>: <?php 
    echo $item['mail'];
    ?>
</p>
<p><b>Телефон</b>: <?php 
    echo $item['tel'];
    ?>
</p>
Пример #9
0
<?php

include 'connectToDatabase.php';
include 'eshopLib.php';
$result = getOrders($connection, $userId);
$cartCountNumber = cartCount($userId, $connection);
?>
<!DOCTYPE html>
<html>
	<head>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Get Your Cover | Orders</title>
		<script src="includes/jquery-2.2.0.min.js"></script>
		<link rel="stylesheet" type="text/css" href="includes/style.css">
		<link href='https://fonts.googleapis.com/css?family=Amaranth' rel='stylesheet' type='text/css'>
		<link href='https://fonts.googleapis.com/css?family=Arimo' rel='stylesheet' type='text/css'>
		<script src="includes/script.js"></script>
	</head>
	<body>
		<header>
			<section id="DevicesNav">
				<a id="burger"></a>
				<ul id="mobileNav">
					<li><a href="eshop.php">eShop</a></li>
					<li><a href="#">Logoff</a></li>
				</ul> 
			</section>
			<a id="logo" href="eshop.php"></a>
				<section id="mobileUser"><span></span><span>Maya Lis</span></section>
		</header>
		<div id="wrapper">
Пример #10
0
    }
}
// ###########################################################################
function order_product_from_bbcw($product_id, $amount, $address_book_entry)
{
    $generator = new BBCW_OrderGenerator();
    if (!$generator->login()) {
        print "Login failed";
        exit;
    }
    if (!$generator->add_product_to_cart($product_id, $amount)) {
        print "Adding product to cart failed";
        exit;
    }
    if (!$generator->checkout_product($address_book_entry)) {
        print "Adding product to cart failed";
        exit;
    }
    if (!$generator->place_order()) {
        print "Placing order failed";
        exit;
    }
}
$address_book_entry = ['usertype' => 'C', 'anonymous' => '', 'email' => '*****@*****.**', 'ship2diff' => 'Y', 'existing_address' => ['S' => '2170'], 'address_book' => ['S' => ['id' => '2170', 'firstname' => 'Ibis1', 'lastname' => 'Arrastia', 'address' => '7625 Parkview Way', 'address_2' => '', 'city' => 'Coral Springs', 'state' => 'FL', 'country' => 'US', 'zipcode' => '33065', 'phone' => '9542052615', 'fax' => '', 'no_address' => '']], 'firstname' => 'Ibis', 'lastname' => 'Arrastia', 'company' => 'Avila Stores LLC', 'additional_values' => ['2' => 'Residential']];
$product_id = "26194";
$amount = 1;
// Order product once
//order_product_from_bbcw($product_id, $amount, $address_book_entry);
//syslog(LOG_INFO, "hello world");
getOrders();
Пример #11
0
<?php

session_start();
require 'controller/define.php';
require "controller/indexControl.php";
$login = false;
if (isset($_COOKIE['user']) || isset($_SESSION['user'])) {
    if (!isset($_SESSION['user'])) {
        $_SESSION['user'] = $_COOKIE['user'];
    }
    $login = true;
    $orderID = $_GET['order'];
    $login = true;
    $row = getOrders($orderID);
} elseif (!$login) {
    header('Location: ' . SERVER . '/404');
}
?>
<!DOCTYPE HTML>
<html>
<head>
    <?php 
require_once 'includes/head.php';
?>
    <link href="<?php 
echo SERVER;
?>
/assets/css/bootstrap-3.3.5-dist/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="<?php 
echo SERVER;
?>
<?php

$order_id = decrypt($_GET['orderID']);
$ordersDetail = getOrdersDetails($order_id);
$order = getOrders($order_id);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Hóa Đơn</title>
<style type="text/css">
*{
	margin:0;
	padding:0;
	font-size:12px;
	font-family:Arial, Helvetica, sans-serif;	
}

ul {
	list-style:none;
}

#container {
	width:593px;
	height:840px;
	margin:0px auto;
	border:1px solid #000;
}
#header {
	overflow:hidden;
Пример #13
0
<?php

// Get list of all users or one in particualr if the id is given
include_once '../include/headers.php';
include_once '../include/dbutils.php';
include_once '../include/main.php';
include_once 'domain/orders.php';
db_connect();
$expand = isset($_GET['expand']) ? $_GET['expand'] : null;
$status = isset($_GET['status']) ? $_GET['status'] : null;
if (isset($_GET['id'])) {
    $value = getOrder($_GET['id']);
} else {
    $value = getOrders($status, $_GET['providerId'], $expand);
}
//return JSON array
exit(json_encode($value));
Пример #14
0
// This will produce a fatel error if there is an error on products.php or database crashes
require 'orders.php';
/**
* A Resoruce List for Products to include HTTP Verbs
* Switch Statement used for HTTP Verbs (GET, POST, DELETE, and PATCH)
* Server Request_Method is an array which contains information of paths and locations
* Routing for Products Starts Here
*/
// Remove white space (trim) and check if variable is set and not empty(isset)
$pathParts = trim(isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '/', '/');
$pathParts = explode('/', $pathParts);
switch ($_SERVER['REQUEST_METHOD']) {
    // Gets List of all products or single product using GET Method
    case 'GET':
        if (empty($pathParts[1])) {
            echo getOrders();
        } else {
            echo getOrder($pathParts[1]);
        }
        break;
        // Create product on database using POST and view it using GET Method
    // Create product on database using POST and view it using GET Method
    case 'POST':
        postOrders(json_decode(file_get_contents('php://input')));
        break;
        // Delete requrested product from database using DELETE Method
    // Delete requrested product from database using DELETE Method
    case 'DELETE':
        if (empty($pathParts[1])) {
            echo "you can delete everthing!!";
        } else {
Пример #15
0
function printOrders()
{
    $orders = getOrders();
    $result = '<table class="table table-hover">
							<tr>
								<th>No.</th>
								<th>Nama Pemesan</th>
								
								<th>Email</th>
								
								<th>Tanggal Pemesanan</th>
								<th>Jumlah Barang</th>
								<th>Total Harga</th>
								<th colspan="3">&nbsp;</th>
							</tr>';
    $index = 1;
    foreach ($orders as $order) {
        $datearray = strtotime($order->date);
        $date = date('d F Y', $datearray);
        $result .= '<tr>';
        $result .= '<td>' . (string) $index . '</td>';
        $result .= '<td>' . $order->custname . '</td>';
        $result .= '<td>' . $order->email . '</td>';
        $result .= '<td>' . $date . '</td>';
        $result .= '<td>' . $order->orderedproducts . '</td>';
        $result .= '<td>' . money_format('%i', $order->totalprice) . '</td>';
        $result .= "<td><button type=\"button\" class=\"btn btn-primary\" onclick=\"detailOrder(" . (string) $order->id . ")\">Detail</button></td>";
        if ($order->isprocessed === true) {
            $result .= "<td><button type=\"button\" class=\"btn btn-primary\" disabled><span class=\"glyphicon glyphicon-ok\">&nbsp;</span>Sudah Selesai</button></td>";
        } else {
            $result .= "<td><button type=\"button\" onclick=\"markFinished(" . (string) $order->id . ")\" class=\"btn btn-success\"><span class=\"glyphicon glyphicon-ok\">&nbsp;</span>Tandai Selesai</button></td>";
        }
        $result .= "<td><button onclick=\"removeOrder(" . (string) $order->id . ",'" . $order->custname . "')\" type=\"button\" class=\"btn btn-danger\">X</button></td>";
        $result .= '</tr>';
        $index++;
    }
    $result .= '</table>';
    return $result;
}
Пример #16
0
    echo $_SERVER['PHP_SELF'];
    ?>
" method="post">

<!--<input type="submit" name="update" value="Update" /><input type="submit" name="delete" value="Delete" />-->
<table id="tablesorter-demo" class="tablesorter" border="0" cellpadding="0" cellspacing="1">
<thead>
<tr class="table-header">
<th>Room_no</th>
<th>Date </th>
<th>Amount </th>
<th>Actions</th></tr>
</thead>
<tbody>
<?php 
    $numrows = count(getOrders());
    // number of rows to show per page
    // find out total pages
    $totalpages = ceil($numrows / $rowsperpage);
    // get the current page or set a default
    if (isset($_GET['currentpage']) && is_numeric($_GET['currentpage'])) {
        // cast var as int
        $currentpage = (int) $_GET['currentpage'];
    } else {
        // default page num
        $currentpage = 1;
    }
    // end if
    // if current page is greater than total pages...
    if ($currentpage > $totalpages) {
        // set current page to last page
Пример #17
0
}
/*############ START ############*/
/*Switch between each query allowed and sent by NetReviews*/
$to_reply = '';
switch ($post_data['query']) {
    case 'isActiveModule':
        $to_reply = isActiveModule($post_data);
        break;
    case 'setModuleConfiguration':
        $to_reply = setModuleConfiguration($post_data);
        break;
    case 'getModuleAndSiteConfiguration':
        $to_reply = getModuleAndSiteConfiguration($post_data);
        break;
    case 'getOrders':
        $to_reply = getOrders($post_data);
        break;
    case 'setProductsReviews':
        $to_reply = setProductsReviews($post_data);
        break;
    case 'truncateTables':
        $to_reply = truncateTables($post_data);
        break;
    case 'getUrlProducts':
        $to_reply = getUrlProducts($post_data);
        break;
    case 'getOrderHistoryOn':
        $to_reply = getOrderHistoryOn($post_data);
        break;
    case 'getCountOrder':
        $to_reply = getCountOrder($post_data);
Пример #18
0
<?php
	require "secure/session.inc.php";
	require "../inc/lib.inc.php";
	require "../inc/db.inc.php";
?>
<html>
<head>
	<title>Поступившие заказы</title>
</head>
<body>
<h1>Поступившие заказы:</h1>
<?php
	$orders = getOrders();
	foreach($orders as $order){


?>
<hr>
<h2>Заказ номер:<?=$order['orderid'] ?></h2>
<p><b>Заказчик</b>:<?=$order['name'] ?> </p>
<p><b>Email</b>:<?=$order['email'] ?> </p>
<p><b>Телефон</b>:<?=$order['phone'] ?> </p>
<p><b>Адрес доставки</b>:<?=$order['address'] ?> </p>
<p><b>Дата размещения заказа</b>:<?=date('d-m-Y H:i:s' , $order['dt']) ?></p>

<h3>Купленные товары:</h3>
<table border="1" cellpadding="5" cellspacing="0" width="90%">
<tr>
	<th>N п/п</th>
	<th>Название</th>
	<th>Автор</th>
Пример #19
0
            $where[] = "oed.express_delivery_id>0";
            break;
        case -2:
            $where[] = "oed.express_delivery_id IS NULL";
            break;
        default:
            $where[] = "oed.express_delivery_id=" . (int) $_POST['express_id'];
            break;
    }
}
if (isset($_POST['export'])) {
    require DIR_FS_ADMIN . 'includes/phpexcel/PHPExcel.php';
    set_time_limit(0);
    $is_doc = $_POST['export'] == '导出筛选结果' ? false : true;
    $i = 0;
    $orders = getOrders(implode(' AND ', $where));
    if (count($orders) == 0) {
        exit('没有订单');
    }
    switch ($_POST['export']) {
        case '导出筛选结果':
            $excel = new PHPExcel();
            $excel->getProperties()->setCreated('订单')->setLastModifiedBy('Jun QQ46231996')->setTitle(sprintf('%s Orders', date('Y-m-d')))->setDescription('Creater by QQ46231996');
            $excel->setActiveSheetIndex(0);
            $sheet = $excel->getActiveSheet();
            $sheet->setTitle(date('Y-m-d'));
            setExcelHeader1($sheet);
            $row = 2;
            $offset_x = 0;
            $offset_y = 0;
            $width = 40;