Пример #1
0
<?php

//Error reporting
ini_set('display_errors', 1);
error_reporting(E_ALL);
require_once 'std.table.class.inc';
require_once 'db.inc';
require_once 'error.inc';
include 'PaInvoice.class.inc';
$dbobject = new PaInvoice();
// if $where is null then all rows will be retrieved
//$where = "column='value'";
$where = "";
// user may specify a particular page to be displayed
/*
if (isset($_GET['pageno'])) {
   $dbobject->setPageno($_GET['pageno']);
} // if
*/
$data = $dbobject->getData($where);
$errors = $dbobject->getErrors();
if (!empty($errors)) {
    // deal with error message(s)
}
// if
foreach ($data as $row) {
    var_dump($row);
    //echo array_keys($data);
    foreach ($row as $field => $value) {
        //var_dump($value);
        //var_dump($field);
<?php

//Error reporting
ini_set('display_errors', 1);
error_reporting(E_ALL);
//load Mage
require_once "/var/www/html/magento/app/Mage.php";
Mage::app();
$config_info = parse_ini_file('/var/www/html/magento/paGateway/paGateway.ini', true);
require_once 'classes/std.table.class.inc';
require_once 'classes/db.inc';
require_once 'classes/error.inc';
include 'classes/PaInvoice.class.inc';
$dbobject = new PaInvoice();
$data = $dbobject->getData($where, $orderby);
$errors = $dbobject->getErrors();
if (!empty($errors)) {
    // deal with error message(s)
}
        $day = "0" . $day;
    }
    $formatted_date = $year . "-" . $month . "-" . $day;
    return $formatted_date;
}
$pagename = $_SERVER['REQUEST_URI'];
$where = "";
$groupby = "xourpo, xinv ";
$orderby = "xdate, xourpo, xinv";
$oInvoiceList = new PaInvoiceByPOandInv();
$data = $oInvoiceList->getData($where, $groupby, $orderby);
$errors = $oInvoiceList->getErrors();
if (!empty($errors)) {
    // deal with error message(s)
}
$oInvoiceParts = new PaInvoice();
if ($_POST) {
    $date_from = makeDate($_POST['date-from']);
    $date_to = makeDate($_POST['date-to']);
    $orderId = $_POST['orderId'];
    //TODO: make sure to is not before from - can be jquery validation
    $where = "xdate between '" . $date_from . "' AND '" . $date_to . "'";
    //header("Location: http://localhost/var/etl/bin/categories/tool/assign1.html");
    //echo "submitted.";
    $data = $oInvoiceList->getData($where, $groupby, $orderby);
    $errors = $oInvoiceList->getErrors();
    if (!empty($errors)) {
        // deal with error message(s)
    }
}
if ($_GET) {
Пример #4
0
<?php

//Error reporting
ini_set('display_errors', 1);
error_reporting(E_ALL);
include "/var/etl/bin/includes/conn.php";
include "/var/etl/bin/includes/logging.php";
include "/var/etl/bin/includes/database_functions.php";
include "/var/etl/bin/includes/functions.php";
require_once 'std.table.class.inc';
require_once 'db.inc';
require_once 'error.inc';
include 'PaInvoice.class.inc';
$dbobject = new PaInvoice();
//load paAPI
require_once '/var/www/html/magento/paGateway/reportAPI/invoiceReport.php';
//load Mage
require_once "/var/www/html/magento/app/Mage.php";
Mage::app();
$config_info = parse_ini_file('/var/www/html/magento/paGateway/paGateway.ini', true);
$uid = $config_info['login']['uid'];
$pass = $config_info['login']['pass'];
$nw = new invoiceReport();
$nw->setUser($uid, $pass);
$nw->setAction('getInvoiceInRange');
//only supported function
$nw->setStartDate('20120101');
//start date
$nw->setEndDate('20120515');
//end date
$obj = $nw->sendRequest();