<?php
if ( $_SERVER['REQUEST_METHOD']!='GET' && realpath(__FILE__) != realpath( $_SERVER['SCRIPT_FILENAME'] ) ) {
// Este cron faz uma varredura em cima dos pedidos para ver se tem algo para faturar ou em andamento e assim por diante


//ini_set('display_errors', '1');
//ini_set('display_startup_errors', '1');
//error_reporting(E_ALL);

//echo "INICIANDO REQUISICAO";


include_once './Functions/Orders.php';
include_once './Functions/OrderSeller.php';
include_once './Functions/ItemsOrder.php';
include_once './Functions/StockStatus.php';
include_once './Functions/OrderStatus.php';
include_once './Functions/AltStatusOrders.php';
include_once './Functions/SellerId.php';

//echo "<pre>";
//echo "CHAMANDO orders" . PHP_EOL;
orders();
//echo "FIM orders" . PHP_EOL;

//echo "CHAMANDO orderSeller" . PHP_EOL;
orderSeller();
//echo "FIM orderSeller" . PHP_EOL;

//echo "CHAMANDO itemsOrder" . PHP_EOL;
itemsOrder();
//echo "FIM itemsOrder" . PHP_EOL;

//echo "CHAMANDO stockStatus" . PHP_EOL;
stockStatus();
//echo "FIM stockStatus" . PHP_EOL;

//echo "CHAMANDO orderStatus" . PHP_EOL;
orderStatus();
//echo "FIM orderStatus" . PHP_EOL;

//echo "CHAMANDO altStatusOrders" . PHP_EOL;
altStatusOrders();
//echo "FIM altStatusOrders" . PHP_EOL;

//echo "CHAMANDO sellerId" . PHP_EOL;
sellerId();
//echo "FIM sellerId" . PHP_EOL;
//echo "</pre>";
}