Example #1
0
function require_office()
{
    global $SHOP;
    if (!check_shop_data()) {
        return false;
    }
    if ($SHOP->retailno == 1) {
        return true;
    } else {
        return false;
    }
}
Example #2
0
<?php

require_once "../../conn/db_include.php";
include_once "po.php";
$po_action = optional_param('po_action', 'view');
$po_no = optional_param('pono', 0);
if (!check_shop_data()) {
    print_error('[!][er001] No shop data, please go sr page');
}
if (!require_login()) {
    print_error('[!][er002]Please login');
}
if (!is_number($po_no)) {
    print_error('[x][po001]Invalid PO number');
    exit;
}
switch ($po_action) {
    case 'deletepo':
        //check user permission, and this function is for office
        if (!require_office()) {
            print_error('[x][er003]Permission Deny for Retail Shop');
        }
        //get po detail
        if (!$po_no) {
            print_error('[x][po002]No PO number');
            exit;
        }
        $po = new po($po_no);
        if ($po->get_errmsg()) {
            print_error($po->get_errmsg());
            exit;