<?php

/**
 * Automatically order depot refill for products offered (active) in Zalando
 *
 * @author IT TEAM BONOFACTUM
 * @created Jul 19, 2013 4:54:57 PM
 */
global $db;
require_once '../confy.php';
require_once '../functions.php';
require_once '../functions-2.php';
tep_db_connect();
use_class('depot_orders');
$class_do = new depot_orders();
$class_do->queryZalandoNeedRefill(true);
echo 'Done!';
tep_db_close();
<?php

/**
 * Show list of current Zalando out of stock products to be refilled
 *
 * @author IT TEAM BONOFACTUM
 * @created Jul 22, 2013 11:28:43 PM
 */
use_class('depot_orders');
$class_do = new depot_orders();
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'LOADTABLE') {
        $show_zeroqty = $_POST['showzero'] == '1';
        $articles = $class_do->queryZalandoNeedRefill();
        $table = array();
        $row = array();
        $row['c1 w080 tac'] = 'No';
        $row['c3 w080 tac'] = 'Product';
        $row['c4 w080 tac'] = 'Length';
        $row['c5 w080 tac'] = 'EAN';
        $row['c6 w080 tac'] = 'Active Age';
        $row['c7 w080 tac'] = 'Stock Available';
        $row['c8 w080 tac'] = 'Current Refill';
        $row['c9 w080 tac'] = 'Qty Needed';
        $table[] = $row;
        $rowcounter = 0;
        $products = array();
        $families = array();
        $total_qty_tobe_created = 0;
        foreach ($articles as $a) {
            $rowcounter++;