Example #1
0
<?php

require_once "../../../class/Utils.php";
require_once "../../../class/DBWork.php";
require_once "../../../acct_class/DBAcctReportWork.php";
$acctWork = new DBAcctReportWork(true);
try {
    $acctWork->createWork($_POST, true);
    $res = $acctWork->requestCustomerList();
    $data = array();
    while ($item = $acctWork->fetchMixedRow()) {
        $searchData['customer_id'] = $item['customer_id'];
        $searchData['customer_id'] = sprintf("%05d", $searchData['customer_id']);
        array_push($data, $searchData);
    }
    $result['CODE'] = '00';
    $result['DATA'] = $data;
    echo json_encode($result);
    $acctWork->destoryWork();
} catch (Exception $e) {
    $acctWork->destoryWork();
    $err = $e->getMessage();
    Util::serverLog($e);
    echo "{ CODE: '99' , DATA : '{$err}'}";
    exit;
}
<?php

require_once "../../../class/Utils.php";
require_once "../../../class/DBWork.php";
require_once "../../../acct_class/DBAcctReportWork.php";
$acctWork = new DBAcctReportWork(true);
try {
    $acctWork->createWork($_GET, true);
    $res = $acctWork->requestAcctReportMonthList();
    $item = $acctWork->fetchMixedRow();
    $type1 = array('gycode' => '자산', 'balance_am' => '', 'type' => -1, 'r_credit' => '', 'r_debit' => '', 'balance' => '');
    $type1['children'] = array();
    $type2 = array('gycode' => '부채', 'balance_am' => '', 'type' => -1, 'r_credit' => '', 'r_debit' => '', 'balance' => '');
    $type2['children'] = array();
    $type3 = array('gycode' => '수익', 'balance_am' => '', 'type' => -1, 'r_credit' => '', 'r_debit' => '', 'balance' => '');
    $type3['children'] = array();
    $type4 = array('gycode' => '비용', 'balance_am' => '', 'type' => -1, 'r_credit' => '', 'r_debit' => '', 'balance' => '');
    $type4['children'] = array();
    $c_debit = $res['c_debit'];
    $c_credit = $res['c_credit'];
    if (count($acctWork->result) > 0) {
        while (true) {
            $gycode = (int) $item['gycode'];
            $gicho_debit = $item['gicho_debit'];
            $gicho_credit = $item['gicho_credit'];
            $sum_credit = $item['sum_credit'];
            $sum_debit = $item['sum_debit'];
            $r_debit = $item['r_debit'];
            $r_credit = $item['r_credit'];
            $sum = 0;
            if ($gycode == 101) {