public static function show()
 {
     $type_id = wbRequest::getVarClean('type_id', 'int', 0);
     $tahun = wbRequest::getVarClean('tahun', 'str', '');
     //timestamp
     $t = wbRequest::getVarClean('t', 'str', '');
     if (empty($type_id) or empty($tahun)) {
         exit;
     }
     try {
         $ws_client = self::getNusoap();
         $params = array('search' => '', 'getParams' => json_encode($_GET), 'controller' => json_encode(array('module' => 'bds', 'class' => 'statistik_pertanian', 'method' => 'show', 'type' => '')), 'postParams' => json_encode($_POST), 'jsonItems' => '', 'start' => $start, 'limit' => $limit);
         $ws_data = self::getResultData($ws_client, $params);
         $data['items'] = $ws_data['data'];
         $data['total'] = $ws_data['total'];
         $data['message'] = $ws_data['message'];
         $data['success'] = $ws_data['success'];
     } catch (Exception $e) {
         $data['message'] = $e->getMessage();
     }
     $items = $data['items']['items'];
     $itemParameter = $data['items']['itemParameter'];
     $print = wbRequest::getVarClean('print', 'int', 0);
     if (!empty($print)) {
         wbUtil::startExcel('rumah_sakit.xls');
     }
     echo '<div class="body-wrap">';
     echo '<div style="float:left;margin:5 5 0 5;">';
     echo '<div><h3>PRODUKSI PERTANIAN ' . $itemParameter['param_name'] . ' - TAHUN ' . $tahun . '</h3></div>';
     if (!empty($print)) {
         echo '<table border="1" width ="100%">';
     } else {
         echo '<table border="0" class="table-data" width ="100%">';
     }
     echo '<tr>
             <th width="15">No</th>
             <th width="200">Jenis Komoditas</th>
             <th width="160">Luas Tanaman(Ha)</th>
             <th width="160">Luas Panen(Ha) </th>
             <th width="160">Produktivitas(Ku/Ha)</th>
             <th width="160">Produksi(Ton)</th>
           </tr>';
     $i = 1;
     foreach ($items as $item) {
         $params = array('controller' => json_encode(array('module' => 'bds', 'class' => 'statistik_pertanian', 'method' => 'getProduksiKomoditas', 'type' => '')), 'jsonItems' => json_encode(array('tahun' => $tahun, 'd_agr_komiditas_id' => $item['d_agr_komiditas_id'])));
         $ws_data = self::getResultData($ws_client, $params);
         $itemProduksi = $ws_data['data'];
         //if (empty($itemProduksi))continue;
         echo '<tr>';
         echo '<td>' . $i++ . '</td>';
         echo '<td>' . $item['komoditas_name'] . '</td>';
         echo '<td align="right">' . wbUtil::numberFormat($itemProduksi['luas_tanam'], 0) . '</td>';
         echo '<td align="right">' . wbUtil::numberFormat($itemProduksi['luas_panen'], 0) . '</td>';
         echo '<td align="right">' . wbUtil::numberFormat($itemProduksi['productivity'], 0) . '</td>';
         echo '<td align="right">' . wbUtil::numberFormat($itemProduksi['produksi'], 0) . '</td>';
         echo '</tr>';
     }
     echo '</table>';
     exit;
 }
 public static function tampil()
 {
     try {
         $ws_client = self::getNusoap();
         $params = array('search' => '', 'getParams' => json_encode($_GET), 'controller' => json_encode(array('module' => 'bds', 'class' => 'statistik_pbb', 'method' => 'tampil', 'type' => '')), 'postParams' => json_encode($_POST), 'jsonItems' => '', 'start' => $start, 'limit' => $limit);
         $ws_data = self::getResultData($ws_client, $params);
         $data['items'] = $ws_data['data'];
         $data['total'] = $ws_data['total'];
         $data['message'] = $ws_data['message'];
         $data['success'] = $ws_data['success'];
     } catch (Exception $e) {
         $data['message'] = $e->getMessage();
     }
     $items = $data['items'];
     $tahun = wbRequest::getVarClean('tahun', 'int', 0);
     $print = wbRequest::getVarClean('print', 'int', 0);
     if (!empty($print)) {
         wbUtil::startExcel('pbb.xls');
     }
     echo '<div class="body-wrap">';
     echo '<div align="center"><h3>DAFTAR JUMLAH SPPT DAN POKOK KETETAPAN PBB MENURUT KECAMATAN DI KOTA BANDUNG TAHUN ' . $tahun . '</h3></div><br>';
     if (!empty($print)) {
         echo '<table border="1" width ="100%">';
     } else {
         echo '<table border="0" width ="100%">';
     }
     $output = "<tr>";
     $output .= "<th rowspan=2 style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>NO</th>";
     $output .= "<th rowspan=2 style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>Kecamatan</br><div style='font-style: italic;'>District</div></th>";
     $output .= "<th colspan=2 style='text-align:center;background-color: rgb(224, 224, 224);border-top: 1px solid black;'>" . $tahun . "</br></th>";
     $output .= "</tr>";
     $output .= "<tr>";
     $output .= "<th style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>PBB</br>(buah)</th>";
     $output .= "<th style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>PBB Terhutang</th>";
     $output .= "</tr>";
     $title = "";
     $no = 1;
     $t_buah = 0;
     $t_terhutang = 0;
     foreach ($items as $item) {
         $output .= "<tr>";
         $output .= "<td width=50 align=center>" . $no . "</td>";
         $output .= "<td>" . $item['wilayah_nama'] . "</td>";
         $output .= "<td align='center'>" . number_format($item['sppt_pbb_buah'], 0, ',', '.') . "</td>";
         $output .= "<td align='center'>" . number_format($item['sppt_pbb_terhutang'], 0, ',', '.') . "</td>";
         $output .= "</tr>";
         $t_buah += $item['sppt_pbb_buah'];
         $t_terhutang += $item['sppt_pbb_terhutang'];
         $no++;
     }
     $output .= "<tr>";
     $output .= "<th colspan=2 style='text-align:center;border-bottom: 1px solid black;border-top: 1px solid black;'>Kota Bandung</br><div style='font-style: italic;'>Bandung City</div></th>";
     $output .= "<th style='text-align:center;border-bottom: 1px solid black;border-top: 1px solid black;'>" . number_format($t_buah, 0, ',', '.') . "</th>";
     $output .= "<th style='text-align:center;border-bottom: 1px solid black;border-top: 1px solid black;'>" . number_format($t_terhutang, 0, ',', '.') . "</th>";
     $output .= "</tr>";
     $output .= "</table>";
     echo $output;
     exit;
 }
 public static function show()
 {
     try {
         $ws_client = self::getNusoap();
         $params = array('search' => '', 'getParams' => json_encode($_GET), 'controller' => json_encode(array('module' => 'bds', 'class' => 'statistik_rute_angkutan', 'method' => 'show', 'type' => '')), 'postParams' => json_encode($_POST), 'jsonItems' => '', 'start' => $start, 'limit' => $limit);
         $ws_data = self::getResultData($ws_client, $params);
         $data['items'] = $ws_data['data'];
         $data['total'] = $ws_data['total'];
         $data['message'] = $ws_data['message'];
         $data['success'] = $ws_data['success'];
     } catch (Exception $e) {
         $data['message'] = $e->getMessage();
     }
     $itemsTrayek = $data['items'];
     //timestamp
     $tahun = wbRequest::getVarClean('tahun', 'int', '');
     $print = wbRequest::getVarClean('print', 'int', 0);
     if (!empty($print)) {
         wbUtil::startExcel('rute_angkutan.xls');
     }
     echo '<div class="body-wrap">';
     echo '<div align="center"><h3>JUMLAH ARMADA ANGKUTAN KOTA DI KOTA BANDUNG TAHUN ' . $tahun . '</h3></div><br/>';
     if (!empty($print)) {
         echo '<table border="1" width ="90%">';
     } else {
         echo '<table border="0" class="table-data" width ="90%">';
     }
     echo '<tr>';
     echo '<th>No</th>';
     echo '<th>Kode Trayek</th>';
     echo '<th>Lintasan Trayek(Route)</th>';
     echo '<th>Jarak(Km)</th>';
     echo '<th>Jumlah Armada</th>';
     echo '<th>Jumlah Angkot</th>';
     echo '</tr>';
     $no = 1;
     foreach ($itemsTrayek as $item) {
         $params = array('controller' => json_encode(array('module' => 'bds', 'class' => 'statistik_rute_angkutan', 'method' => 'getItem', 'type' => '')), 'jsonItems' => json_encode(array('tahun' => $tahun, 'trayek_id' => $item['trayek_id'])));
         $ws_data = self::getResultData($ws_client, $params);
         $itemArmada = $ws_data['data'];
         if (empty($itemArmada)) {
             continue;
         }
         echo '<tr>';
         echo '<td align=center>' . $no++ . '</td>';
         echo '<td>' . $item['trayek_code'] . '</td>';
         echo '<td>' . $item['trayek_name'] . '</td>';
         echo '<td>' . $item['trayek_panjang'] . '</td>';
         echo '<td align="right">' . wbUtil::numberFormat($itemArmada['armada_jml'], 0) . '</td>';
         echo '<td align="right">' . wbUtil::numberFormat($itemArmada['armada_jml_angkot'], 0) . '</td>';
         echo '</tr>';
     }
     echo '</table>';
     echo '</div>';
     echo '</div>';
     exit;
 }
 public static function tampil()
 {
     try {
         $ws_client = self::getNusoap();
         $params = array('search' => '', 'getParams' => json_encode($_GET), 'controller' => json_encode(array('module' => 'bds', 'class' => 'statistik_pajak_daerah', 'method' => 'tampil', 'type' => '')), 'postParams' => json_encode($_POST), 'jsonItems' => '', 'start' => $start, 'limit' => $limit);
         $ws_data = self::getResultData($ws_client, $params);
         $data['items'] = $ws_data['data'];
         $data['total'] = $ws_data['total'];
         $data['message'] = $ws_data['message'];
         $data['success'] = $ws_data['success'];
     } catch (Exception $e) {
         $data['message'] = $e->getMessage();
     }
     $items = $data['items'];
     $tahun = wbRequest::getVarClean('tahun', 'int', 0);
     $print = wbRequest::getVarClean('print', 'int', 0);
     if (!empty($print)) {
         wbUtil::startExcel('pajak_daerah.xls');
     }
     echo '<div class="body-wrap">';
     echo '<div align="center"><h3>JUMLAH PENERIMAAN PAJAK DAERAH MENURUT JENIS PAJAK DAN PERSENTASE TARGET YANG DICAPAI KOTA BANDUNG </br>TAHUN ANGGARAN ' . $tahun . '</h3></div><br>';
     if (!empty($print)) {
         echo '<table border="1" width ="100%">';
     } else {
         echo '<table border="0" width ="100%">';
     }
     $output = "<tr>";
     $output .= "<th style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>NO</th>";
     $output .= "<th style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>JENIS PENERIMAAN</br><div style='font-style: italic;'>TYPE OF RECEIPTS</div></th>";
     $output .= "<th style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>TARGET</br><div style='font-style: italic;'>TARGET</div>(Rp 000)&nbsp</th>";
     $output .= "<th style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>REALISASI</br><div style='font-style: italic;'>REALISATION</div>(Rp 000)&nbsp</th>";
     $output .= "<th style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>PERSENTASE</br><div style='font-style: italic;'>PERCENTAGE</div>(%)</th>";
     $output .= "</tr>";
     $title = "";
     $no = 1;
     $t_persen = 0;
     $t_real = 0;
     $t_target = 0;
     foreach ($items as $item) {
         $output .= "<tr>";
         $output .= "<td width=50 align=center>" . $no . "</td>";
         $output .= "<td>" . $item['param_name'] . "</td>";
         $output .= "<td align='center'>" . number_format($item['pjk_daerah_target'], 0, ',', '.') . "</td>";
         $output .= "<td align='center'>" . number_format($item['pjk_daerah_realisasi'], 0, ',', '.') . "</td>";
         $jumlah = !empty($item['pjk_daerah_target']) ? $item['pjk_daerah_realisasi'] / $item['pjk_daerah_target'] * 100 : 0;
         $output .= "<td align='center'>" . number_format($jumlah, 2, ',', '.') . "</td>";
         $output .= "</tr>";
         $t_persen += $jumlah;
         $t_real += $item['pjk_daerah_realisasi'];
         $t_target += $item['pjk_daerah_target'];
         $no++;
     }
     $output .= "</table>";
     echo $output;
     exit;
 }
 public static function show()
 {
     try {
         $ws_client = self::getNusoap();
         $params = array('search' => '', 'getParams' => json_encode($_GET), 'controller' => json_encode(array('module' => 'bds', 'class' => 'dashboard_puskesmas', 'method' => 'show', 'type' => '')), 'postParams' => json_encode($_POST), 'jsonItems' => '', 'start' => $start, 'limit' => $limit);
         $ws_data = self::getResultData($ws_client, $params);
         $data['items'] = $ws_data['data'];
         $data['total'] = $ws_data['total'];
         $data['message'] = $ws_data['message'];
         $data['success'] = $ws_data['success'];
     } catch (Exception $e) {
         $data['message'] = $e->getMessage();
     }
     $itemsWilayah = $data['items'];
     $print = wbRequest::getVarClean('print', 'int', 0);
     if (!empty($print)) {
         wbUtil::startExcel('puskesmas.xls');
     }
     echo '<div class="body-wrap">';
     echo '<div style="float:left;margin:5 5 0 5;">';
     echo '<div><h3>JUMLAH PUSKESMAS BERDASARKAN KECAMATAN</h3></div>';
     if (!empty($print)) {
         echo '<table border="1" width ="100%">';
     } else {
         echo '<table border="0" width ="100%">';
     }
     echo '<tr>
             <th width="30">No</th>
             <th width="200">Kode Wilayah</th>
             <th width="200">Kecamatan</th>
             <th width="100">Jumlah</th>
           </tr>';
     $i = 1;
     $total = 0;
     $jumlahPuskesmas = 0;
     foreach ($itemsWilayah as $item) {
         $params = array('controller' => json_encode(array('module' => 'bds', 'class' => 'dashboard_puskesmas', 'method' => 'getJumlahPerKecamatan', 'type' => '')), 'jsonItems' => json_encode(array('wilayah_id' => $item['wilayah_id'])));
         $ws_data = self::getResultData($ws_client, $params);
         $jumlahPuskesmas = $ws_data['data'];
         $total += $jumlahPuskesmas;
         echo '<tr>';
         echo '<td>' . $i++ . '</td>';
         echo '<td>' . $item['wilayah_kode'] . '</td>';
         echo '<td>' . $item['wilayah_nama'] . '</td>';
         echo '<td align="right">' . wbUtil::numberFormat($jumlahPuskesmas, 0) . '</td>';
         echo '</tr>';
     }
     echo '<tr>';
     echo '<td colspan="3" align="center"> <b>TOTAL PUSKESMAS</b> </td>';
     echo '<td align="right"> <b>' . wbUtil::numberFormat($total, 0) . '</b> </td>';
     echo '</tr>';
     echo '</table>';
     echo '</div>';
     echo '</div>';
     exit;
 }
 public static function getJumlahPerKecamatan()
 {
     $jsonItems = wbRequest::getVarClean('jsonItems', 'str', '');
     $item = wbUtil::jsonDecode($jsonItems);
     $tPuskesmas =& wbModule::getModel('bds', 'd_puskesmas');
     $jumlah = $tPuskesmas->getJumlahPerKecamatan($item['wilayah_id']);
     $data = array('items' => array(), 'total' => 0, 'success' => true, 'message' => '');
     $data['items'] = $jumlah;
     return $data;
 }
 public static function getItem()
 {
     $jsonItems = wbRequest::getVarClean('jsonItems', 'str', '');
     $item = wbUtil::jsonDecode($jsonItems);
     $tArmada =& wbModule::getModel('bds', 't_armada');
     $itemArmada = $tArmada->getItem($item['tahun'], $item['trayek_id']);
     $data = array('items' => array(), 'total' => 0, 'success' => true, 'message' => '');
     $data['items'] = $itemArmada;
     return $data;
 }
 public static function getProduksiKomoditas()
 {
     $jsonItems = wbRequest::getVarClean('jsonItems', 'str', '');
     $item = wbUtil::jsonDecode($jsonItems);
     $tProduksi =& wbModule::getModel('bds', 't_agr_komod_prod');
     $itemProduksi = $tProduksi->getProduksiKomoditas($item['tahun'], $item['d_agr_komiditas_id']);
     $data = array('items' => array(), 'total' => 0, 'success' => true, 'message' => '');
     $data['items'] = $itemProduksi;
     return $data;
 }
 public static function getItem()
 {
     $jsonItems = wbRequest::getVarClean('jsonItems', 'str', '');
     $item = wbUtil::jsonDecode($jsonItems);
     $tTernak =& wbModule::getModel('bds', 't_ternak');
     $itemTernak = $tTernak->getItem($item['tahun'], $item['param_id']);
     $data = array('items' => array(), 'total' => 0, 'success' => true, 'message' => '');
     $data['items'] = $itemTernak;
     return $data;
 }
 public static function getJumlahPerJenis()
 {
     $jsonItems = wbRequest::getVarClean('jsonItems', 'str', '');
     $item = wbUtil::jsonDecode($jsonItems);
     $tRumahSakit =& wbModule::getModel('bds', 'd_rumahsakit');
     $jumlah = $tRumahSakit->getJumlahPerJenis($item['param_id']);
     $data = array('items' => array(), 'total' => 0, 'success' => true, 'message' => '');
     $data['items'] = $jumlah;
     return $data;
 }
function ws_proccess($search, $getParams, $controller, $postParams, $jsonItems, $start, $limit)
{
    $GLOBALS["Webi_PageTime"] = microtime(true);
    include 'lib/bootstrap.php';
    /* Load Webi Core */
    sys::import('webi.core');
    wbCore::init();
    $_GET['jsonItems'] = $jsonItems;
    if (!empty($getParams)) {
        $getParams =& wbUtil::jsonDecode($getParams);
    } else {
        $getParams = array();
    }
    if (json_decode($postParams) > 0) {
        $postParams = json_decode($postParams);
    } else {
        $postParams = array();
    }
    $controller =& wbUtil::jsonDecode($controller);
    $type = $controller['type'];
    if (!empty($getParams)) {
        foreach ($getParams as $key => $value) {
            $_GET[$key] = $value;
        }
    }
    if (!empty($postParams)) {
        foreach ($postParams as $key => $value) {
            $_POST[$key] = $value;
        }
    }
    $_GET['module'] = $controller['module'];
    $_GET['class'] = $controller['class'];
    $_GET['method'] = $controller['method'];
    list($module, $class, $method) = wbRequest::getController();
    $callback = wbRequest::getVarClean('callback');
    if (!wbModule::isAvailable($module, $class, $type)) {
        header("HTTP/1.1 400 Bad Request");
        return;
    }
    try {
        $result = wbModule::call($module, $class, $method, array(), $type);
    } catch (Exception $e) {
        $result = array('items' => array(), 'total' => 0, 'success' => false, 'message' => $e->getMessage());
    }
    $return = array();
    $return['success'] = $result['success'];
    $return['message'] = $result['message'];
    $return['total'] = (int) $result['total'];
    $return['data'] = $result['items'];
    $return['current'] = (int) $result['current'];
    $return['rowCount'] = (int) $result['rowCount'];
    $return = base64_encode(serialize($return));
    return $return;
}
 public static function show()
 {
     try {
         $ws_client = self::getNusoap();
         $params = array('search' => '', 'getParams' => json_encode($_GET), 'controller' => json_encode(array('module' => 'bds', 'class' => 'statistik_peternakan', 'method' => 'show', 'type' => '')), 'postParams' => json_encode($_POST), 'jsonItems' => '', 'start' => $start, 'limit' => $limit);
         $ws_data = self::getResultData($ws_client, $params);
         $data['items'] = $ws_data['data'];
         $data['total'] = $ws_data['total'];
         $data['message'] = $ws_data['message'];
         $data['success'] = $ws_data['success'];
     } catch (Exception $e) {
         $data['message'] = $e->getMessage();
     }
     $itemsJenis = $data['items'];
     //timestamp
     $tahun = wbRequest::getVarClean('tahun', 'int', '');
     $print = wbRequest::getVarClean('print', 'int', 0);
     if (!empty($print)) {
         wbUtil::startExcel('rumah_sakit.xls');
     }
     echo '<div class="body-wrap">';
     echo '<div align="center"><h3>POPULASI TERNAK KOTA BANDUNG TAHUN ' . $tahun . '</h3></div><br/>';
     if (!empty($print)) {
         echo '<table border="1" width ="90%">';
     } else {
         echo '<table border="0" class="table-data" width ="90%">';
     }
     echo '<tr>';
     echo '<th>No</th>';
     echo '<th>Jenis Ternak</th>';
     echo '<th>Populasi</th>';
     echo '<th>Jumlah Potong</th>';
     echo '<th>Produksi Daging</th>';
     echo '</tr>';
     $no = 1;
     foreach ($itemsJenis as $item) {
         $params = array('controller' => json_encode(array('module' => 'bds', 'class' => 'statistik_peternakan', 'method' => 'getItem', 'type' => '')), 'jsonItems' => json_encode(array('tahun' => $tahun, 'wilayah_id' => $item['wilayah_id'])));
         $ws_data = self::getResultData($ws_client, $params);
         $itemTernak = $ws_data['data'];
         //if (empty($itemTernak))continue;
         echo '<tr>';
         echo '<td>' . $no++ . '</td>';
         echo '<td>' . $item['param_name'] . '</td>';
         echo '<td align="right">' . wbUtil::numberFormat($itemTernak['ternak_populasi'], 0) . '</td>';
         echo '<td align="right">' . wbUtil::numberFormat($itemTernak['ternak_jml_potong'], 0) . '</td>';
         echo '<td align="right">' . wbUtil::numberFormat($itemTernak['ternak_produksi_daging'], 0) . '</td>';
         echo '</tr>';
     }
     echo '</table>';
     echo '</div>';
     echo '</div>';
     exit;
 }
 public static function pendidikan()
 {
     $data = array('items' => array(), 'total' => 0, 'success' => false, 'message' => '');
     try {
         $ws_client = self::getNusoap();
         $params = array('search' => '', 'getParams' => json_encode($_GET), 'controller' => json_encode(array('module' => 'bds', 'class' => 'statistik_penduduk', 'method' => 'pendidikan', 'type' => '')), 'postParams' => json_encode($_POST), 'jsonItems' => '', 'start' => $start, 'limit' => $limit);
         $ws_data = self::getResultData($ws_client, $params);
         $data['items'] = $ws_data['data'];
         $data['total'] = $ws_data['total'];
         $data['message'] = $ws_data['message'];
         $data['success'] = $ws_data['success'];
     } catch (Exception $e) {
         $data['message'] = $e->getMessage();
         print_r("Error:" . $data['message']);
         exit;
     }
     $items = $data['items'];
     $print = wbRequest::getVarClean('print', 'int', 0);
     if (!empty($print)) {
         wbUtil::startExcel('pendidikan_penduduk.xls');
     }
     echo '<div class="body-wrap">';
     echo '<div><h3>JUMLAH PENDUDUK MENURUT KELOMPOK PENDIDIKAN</h3></div>';
     if (!empty($print)) {
         echo '<table border=1 class="table-data">';
     } else {
         echo '<table class="table-data">';
     }
     echo '<tr>
             <th width="30">No</th>
             <th width="150">Pendidikan</th>
             <th width="150">Jumlah Laki-laki</th>
             <th width="150">Jumlah Perempuan</th>
             <th width="150">Jumlah Total</th>
           </tr>';
     $i = 1;
     foreach ($items as $item) {
         $params = array('controller' => json_encode(array('module' => 'bds', 'class' => 'statistik_penduduk', 'method' => 'getCountByPendidikanID', 'type' => '')), 'jsonItems' => json_encode(array('param_id' => $item['param_id'])));
         $ws_data = self::getResultData($ws_client, $params);
         $itemJumlah = $ws_data['data'];
         echo '<tr>';
         echo '<td>' . $i++ . '</td>';
         echo '<td>' . $item['param_name'] . '</td>';
         echo '<td align="right">&nbsp;' . $itemJumlah['jumlah_l'] . '</td>';
         echo '<td align="right">&nbsp;' . $itemJumlah['jumlah_p'] . '</td>';
         echo '<td align="right">&nbsp;' . $itemJumlah['jumlah'] . '</td>';
         echo '</tr>';
     }
     echo '</table>';
     exit;
 }
 public static function tampil()
 {
     try {
         $ws_client = self::getNusoap();
         $params = array('search' => '', 'getParams' => json_encode($_GET), 'controller' => json_encode(array('module' => 'bds', 'class' => 'statistik_industri', 'method' => 'tampil', 'type' => '')), 'postParams' => json_encode($_POST), 'jsonItems' => '', 'start' => $start, 'limit' => $limit);
         $ws_data = self::getResultData($ws_client, $params);
         $data['items'] = $ws_data['data'];
         $data['total'] = $ws_data['total'];
         $data['message'] = $ws_data['message'];
         $data['success'] = $ws_data['success'];
     } catch (Exception $e) {
         $data['message'] = $e->getMessage();
     }
     $items = $data['items'];
     $tahun = wbRequest::getVarClean('tahun', 'int', 0);
     $print = wbRequest::getVarClean('print', 'int', 0);
     if (!empty($print)) {
         wbUtil::startExcel('industri.xls');
     }
     echo '<div class="body-wrap">';
     if ($tahun != $tahun_akhir) {
         echo '<div align="center"><h3>BANYAKNYA PERUSAHAAN INDUSTRI BESAR DAN SEDANG DAN TENAGA KERJA YANG DAPAT DISERAP DI KOTA BANDUNG TAHUN ' . $tahun . ' - ' . $tahun_akhir . '</h3></div><br>';
     } else {
         echo '<div align="center"><h3>BANYAKNYA PERUSAHAAN INDUSTRI BESAR DAN SEDANG DAN TENAGA KERJA YANG DAPAT DISERAP DI KOTA BANDUNG TAHUN ' . $tahun . '</h3></div><br>';
     }
     if (!empty($print)) {
         echo '<table border="1" width ="100%">';
     } else {
         echo '<table border="0" width ="100%">';
     }
     $output = "<tr>";
     $output .= "<th style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>No</th>";
     $output .= "<th style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>Tahun<div style='font-style: italic;'>Year</div></th></th>";
     $output .= "<th style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>Banyaknya Usaha</br><div style='font-style: italic;'>Number Of Establishment</div></th>";
     $output .= "<th style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>Tenaga Kerja</br><div style='font-style: italic;'>Man Power</div></th>";
     $output .= "</tr>";
     $no = 1;
     foreach ($items as $item) {
         $output .= "<tr>";
         $output .= "<td>" . $no . "</td>";
         $output .= "<td>" . $item['industri_tahun'] . "</td>";
         $output .= "<td align='center'>" . number_format($item['tot_industri'], 0, ',', '.') . "</td>";
         $output .= "<td align='center'>" . number_format($item['tot_pekerja'], 0, ',', '.') . "</td>";
         $output .= "</tr>";
         $no++;
     }
     $output .= "</table>";
     echo $output;
     exit;
 }
 public static function tampil()
 {
     $tahun = wbRequest::getVarClean('tahun', 'int', 0);
     $jenis = wbRequest::getVarClean('jenis', 'int', 0);
     $kelompok = array('1' => 'Usia', '2' => 'Pendidikan');
     try {
         $ws_client = self::getNusoap();
         $params = array('search' => '', 'getParams' => json_encode($_GET), 'controller' => json_encode(array('module' => 'bds', 'class' => 'statistik_rekap_penduduk', 'method' => 'tampil', 'type' => '')), 'postParams' => json_encode($_POST), 'jsonItems' => '', 'start' => $start, 'limit' => $limit);
         $ws_data = self::getResultData($ws_client, $params);
         $data['items'] = $ws_data['data'];
         $data['total'] = $ws_data['total'];
         $data['message'] = $ws_data['message'];
         $data['success'] = $ws_data['success'];
     } catch (Exception $e) {
         $data['message'] = $e->getMessage();
     }
     $items = $data['items'];
     //timestamp
     $print = wbRequest::getVarClean('print', 'int', 0);
     if (!empty($print)) {
         wbUtil::startExcel('rekap_penduduk.xls');
     }
     echo '<div class="body-wrap">';
     echo '<div><h3>JUMLAH PENDUDUK MENURUT KELOMPOK ' . strtoupper($kelompok[$jenis]) . '</h3></div>';
     if (!empty($print)) {
         echo '<table border=1 class="table-data">';
     } else {
         echo '<table class="table-data">';
     }
     echo '<tr>
             <th width="30" style="text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;">No</th>
             <th width="150" style="text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;">' . $kelompok[$jenis] . '</th>
             <th width="150" style="text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;">Jumlah Laki-laki</th>
             <th width="150" style="text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;">Jumlah Perempuan</th>
             <th width="150" style="text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;">Jumlah Total</th>
           </tr>';
     $i = 1;
     foreach ($items as $item) {
         echo '<tr>';
         echo '<td>' . $i++ . '</td>';
         echo '<td align="center"><b>' . $item['kelompok'] . '</b></td>';
         echo '<td align="right">' . $item['laki'] . '</td>';
         echo '<td align="right">' . $item['perempuan'] . '</td>';
         echo '<td align="right">' . ($item['laki'] + $item['perempuan']) . '</td>';
         echo '</tr>';
     }
     echo '</table>';
     exit;
 }
 public static function tampil()
 {
     try {
         $ws_client = self::getNusoap();
         $params = array('search' => '', 'getParams' => json_encode($_GET), 'controller' => json_encode(array('module' => 'bds', 'class' => 'statistik_pasar_modern', 'method' => 'tampil', 'type' => '')), 'postParams' => json_encode($_POST), 'jsonItems' => '', 'start' => $start, 'limit' => $limit);
         $ws_data = self::getResultData($ws_client, $params);
         $data['items'] = $ws_data['data'];
         $data['total'] = $ws_data['total'];
         $data['message'] = $ws_data['message'];
         $data['success'] = $ws_data['success'];
     } catch (Exception $e) {
         $data['message'] = $e->getMessage();
     }
     $items = $data['items'];
     $tahun = wbRequest::getVarClean('tahun', 'int', 0);
     $print = wbRequest::getVarClean('print', 'int', 0);
     if (!empty($print)) {
         wbUtil::startExcel('pasar_modern.xls');
     }
     echo '<div class="body-wrap">';
     echo '<div align="center"><h3>PASAR MODERN DI KOTA BANDUNG MENURUT JENIS DAN LUAS GERAI TAHUN ' . $tahun . '</h3></div><br>';
     if (!empty($print)) {
         echo '<table border="1" width ="100%">';
     } else {
         echo '<table border="0" width ="100%">';
     }
     $output = "<tr>";
     $output .= "<th rowspan='2' style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>No</th>";
     $output .= "<th rowspan='2' style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>JENIS PASAR / <div style='font-style: italic;display: inline;'>MARKET TYPE</div></th></th>";
     $output .= "<th colspan='2' style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>Jumlah / <div style='font-style: italic;display: inline;'>NUMBER</div></th>";
     $output .= "</tr>";
     $output .= "<tr>";
     $output .= "<th style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'> &gt; 2000 M2 </th>";
     $output .= "<th style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'> &lt; 2000 M2 </th>";
     $output .= "</tr>";
     $no = 1;
     foreach ($items as $item) {
         $output .= "<tr>";
         $output .= "<td align='center'>" . $no . "</td>";
         $output .= "<td>" . $item['param_name'] . "</td>";
         $output .= "<td align='center'>" . number_format($item['mmart_luas_gt_2000'], 0, ',', '.') . "</td>";
         $output .= "<td align='center'>" . number_format($item['mmart_luas_lt_2000'], 0, ',', '.') . "</td>";
         $output .= "</tr>";
         $no++;
     }
     $output .= "</table>";
     echo $output;
     exit;
 }
 public static function getCountByPendidikanID()
 {
     $tWarga =& wbModule::getModel('bds', 'd_warga');
     $jsonItems = wbRequest::getVarClean('jsonItems', 'str', '');
     $item = wbUtil::jsonDecode($jsonItems);
     $jumlah = $tWarga->getCountByAge($item['param_id']);
     $jumlah_l = $tWarga->getCountByAge($item['param_id'], 6);
     $jumlah_p = $tWarga->getCountByAge($item['param_id'], 7);
     $itemJumlah = array();
     $itemJumlah['jumlah'] = $jumlah;
     $itemJumlah['jumlah_l'] = $jumlah_l;
     $itemJumlah['jumlah_p'] = $jumlah_p;
     $data = array('items' => array(), 'total' => 0, 'success' => true, 'message' => '');
     $data['items'] = $itemJumlah;
     return $data;
 }
 public static function tampil()
 {
     try {
         $ws_client = self::getNusoap();
         $params = array('search' => '', 'getParams' => json_encode($_GET), 'controller' => json_encode(array('module' => 'bds', 'class' => 'statistik_pasar_daerah', 'method' => 'tampil', 'type' => '')), 'postParams' => json_encode($_POST), 'jsonItems' => '', 'start' => $start, 'limit' => $limit);
         $ws_data = self::getResultData($ws_client, $params);
         $data['items'] = $ws_data['data'];
         $data['total'] = $ws_data['total'];
         $data['message'] = $ws_data['message'];
         $data['success'] = $ws_data['success'];
     } catch (Exception $e) {
         $data['message'] = $e->getMessage();
     }
     $items = $data['items'];
     $tahun = wbRequest::getVarClean('tahun', 'int', 0);
     $print = wbRequest::getVarClean('print', 'int', 0);
     if (!empty($print)) {
         wbUtil::startExcel('pasar_daerah.xls');
     }
     echo '<div class="body-wrap">';
     echo '<div align="center"><h3>PASAR TRADISIONAL DI KOTA BANDUNG TAHUN ' . $tahun . '</h3></div><br>';
     if (!empty($print)) {
         echo '<table border="1" width ="100%">';
     } else {
         echo '<table border="0" width ="100%">';
     }
     echo "<tr>";
     echo "<th style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>No</th>";
     echo "<th style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>Nama Pasar</th>";
     echo "<th style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>Jumlah Ruang</th>";
     echo "<th style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>Pedagang Aktif</th>";
     echo "<th style='text-align:center;background-color: rgb(224, 224, 224);border-bottom: 1px solid black;border-top: 1px solid black;'>Pedagang Pasif</th>";
     echo "</tr>";
     $no = 1;
     foreach ($items as $item) {
         echo "<tr>";
         echo "<td align='center'>" . $no . "</td>";
         echo "<td>" . $item['pasar_name'] . "</td>";
         echo "<td align='right'>" . number_format(!empty($item['jum_ruang']) ? $item['jum_ruang'] : 0, 0, ',', '.') . "</td>";
         echo "<td align='right'>" . number_format(!empty($item['aktif']) ? $item['aktif'] : 0, 0, ',', '.') . "</td>";
         echo "<td align='right'>" . number_format(!empty($item['pasif']) ? $item['pasif'] : 0, 0, ',', '.') . "</td>";
         echo "</tr>";
         $no++;
     }
     echo "</table>";
     exit;
 }
 public static function submitRegistration($args = array())
 {
     // Security check
     //if (!wbSecurity::check('DHotel')) return;
     // Get arguments from argument array
     $jsonItems = wbRequest::getVarClean('items', 'str', '');
     $items =& wbUtil::jsonDecode($jsonItems);
     $data = array('items' => array(), 'total' => 0, 'success' => false, 'message' => '');
     try {
         $ws_client = self::getNusoap();
         $params = array('search' => '', 'getParams' => json_encode($_GET), 'controller' => json_encode(array('module' => 'bds', 'class' => 't_vat_registration', 'method' => 'destroy', 'type' => 'json')), 'postParams' => json_encode($_POST), 'jsonItems' => '', 'start' => $start, 'limit' => $limit);
         $ws_data = self::getResultData($ws_client, $params);
         $data['items'] = $ws_data['data'];
         $data['total'] = $ws_data['total'];
         $data['message'] = $ws_data['message'];
         $data['success'] = $ws_data['success'];
     } catch (Exception $e) {
         $data['message'] = $e->getMessage();
     }
     return $data;
 }
 public static function submitSptpd($args = array())
 {
     $jsonItems = wbRequest::getVarClean('items', 'str', '');
     $items = wbUtil::jsonDecode($jsonItems);
     $table =& wbModule::getModel('bds', 't_vat_settlement');
     $table->actionType = 'CREATE';
     //$items = $item['items'];
     $data = array('items' => array(), 'total' => 0, 'success' => true, 'message' => '');
     try {
         $user_name = wbSession::getVar('user_name');
         foreach ($items as $item) {
             $sql = "select sikp.f_first_submit_engine(501," . $item['t_customer_order_id'] . ",'" . $user_name . "')";
             $message = $table->dbconn->GetOne("{$sql}");
         }
         $data['success'] = true;
         $data['message'] = $message;
         return $data;
     } catch (Exception $e) {
         $data['success'] = false;
         $data['message'] = $e->getMessage();
         return $data;
     }
 }
 public static function upload_excel($args = array())
 {
     include 'lib/excel/reader.php';
     $data = array('items' => array(), 'total' => 0, 'success' => false, 'message' => '');
     global $_FILES;
     try {
         if (empty($_FILES['excel_file']['name'])) {
             throw new Exception('File tidak boleh kosong');
         }
     } catch (Exception $e) {
         $data['message'] = $e->getMessage();
         echo json_encode($data);
         session_write_close();
         exit;
     }
     $jsonItems = wbRequest::getVarClean('items', 'str', '');
     $items =& wbUtil::jsonDecode($jsonItems);
     if (!is_array($items)) {
         $data['message'] = 'Invalid items parameter';
         return $data;
     }
     $file_name = $_FILES['excel_file']['name'];
     $file_location = 'var/uploadexcel/' . $file_name;
     if (!move_uploaded_file($_FILES['excel_file']['tmp_name'], $file_location)) {
         throw new Exception("Upload file gagal");
     }
     $xl_reader =& new Spreadsheet_Excel_Reader();
     $res = $xl_reader->_ole->read($file_location);
     if ($res === false) {
         if ($xl_reader->_ole->error == 1) {
             $data['message'] = 'Harus File Excel';
             echo json_encode($data);
             session_write_close();
             exit;
         }
     }
     try {
         $xl_reader->read($file_location);
         $firstColumn = $xl_reader->sheets[0]['cells'][1][1];
         if ($firstColumn != 'Kode Hotel') {
             throw new Exception('Format Table Salah');
         }
         /* pengecekkan semua data */
         for ($i = 2; $i <= $xl_reader->sheets[0]['numRows']; $i++) {
             $kode_hotel = $xl_reader->sheets[0]['cells'][$i][1];
             $nama_hotel = $xl_reader->sheets[0]['cells'][$i][2];
             if (empty($kode_hotel) or $kode_hotel == 'Keterangan') {
                 break;
             }
             if (empty($nama_hotel)) {
                 throw new Exception('Nama Hotel (Kolom 2) pada baris ' . ($i - 1) . ' Tidak boleh kosong');
             }
         }
     } catch (Exception $e) {
         $data['message'] = $e->getMessage();
         echo json_encode($data);
         session_write_close();
         exit;
     }
     /* insert data */
     $recInsert = array();
     $items = array();
     try {
         for ($i = 2; $i <= $xl_reader->sheets[0]['numRows']; $i++) {
             $kode_hotel = $xl_reader->sheets[0]['cells'][$i][1];
             $nama_hotel = $xl_reader->sheets[0]['cells'][$i][2];
             $kelas = $xl_reader->sheets[0]['cells'][$i][3];
             $jumlah_kamar = $xl_reader->sheets[0]['cells'][$i][4];
             $alamat = $xl_reader->sheets[0]['cells'][$i][5];
             $kota = $xl_reader->sheets[0]['cells'][$i][6];
             $kode_pos = $xl_reader->sheets[0]['cells'][$i][7];
             $telepon = $xl_reader->sheets[0]['cells'][$i][8];
             $website = $xl_reader->sheets[0]['cells'][$i][9];
             if (empty($kode_hotel) or $kode_hotel == 'Keterangan') {
                 break;
             }
             $recInsert['code'] = $kode_hotel;
             $recInsert['hotel_name'] = $nama_hotel;
             $recInsert['kelas_id'] = $kelas;
             $recInsert['jml_kamar'] = $jumlah_kamar;
             $recInsert['address_1'] = $alamat;
             $recInsert['kota'] = $kota;
             $recInsert['kode_pos'] = $kode_pos;
             $recInsert['phone_no'] = $telepon;
             $recInsert['website'] = $website;
             //$table->setRecord($recInsert);
             //$table->create();
             $items[] = $recInsert;
         }
         $ws_client = self::getNusoap();
         $params = array('search' => '', 'controller' => json_encode(array('module' => 'bds', 'class' => 'cust_acc_trans', 'method' => 'upload_excel', 'type' => 'json')), 'jsonItems' => json_encode(array('items' => $items)));
         $ws_data = self::getResultData($ws_client, $params);
         $data['success'] = true;
         $data['message'] = 'Data berhasil disimpan';
         $data['items'] = $items;
     } catch (Exception $e) {
         $data['message'] = $e->getMessage();
         echo json_encode($data);
         session_write_close();
         exit;
     }
     echo json_encode($data);
     session_write_close();
     exit;
 }
Exemple #22
0
 public static function upload_excel($args = array())
 {
     $jsonItems = wbRequest::getVarClean('jsonItems', 'str', '');
     $item = wbUtil::jsonDecode($jsonItems);
     $table =& wbModule::getModel('bds', 'smp_detail');
     $table->actionType = 'CREATE';
     $items = $item['items'];
     $data = array('items' => array(), 'total' => 0, 'success' => true, 'message' => '');
     try {
         $errorMessage = '';
         /* cek data sd */
         $tahunAjaranSMPExist = $table->isExistTahunAjaran($items[0]['smp_id'], $items[0]['smp_det_thn_ajaran']);
         if (!$tahunAjaranSMPExist) {
             $items[0][$table->pkey] = $table->GenID();
             $table->setRecord($items[0]);
             $table->create();
         } else {
             $errorMessage .= '- Data SMP Tahun Ajaran ' . $items[0]['smp_det_thn_ajaran'] . ' tidak dapat diinput karena sudah ada <br>';
         }
         /* cek data mi */
         $tahunAjaranMTSExist = $table->isExistTahunAjaran($items[1]['smp_id'], $items[1]['smp_det_thn_ajaran']);
         if (!$tahunAjaranMTSExist) {
             $items[1][$table->pkey] = $table->GenID();
             $table->setRecord($items[1]);
             $table->create();
         } else {
             $errorMessage .= '- Data MTS Tahun Ajaran ' . $items[1]['smp_det_thn_ajaran'] . ' tidak dapat diinput karena sudah ada <br>';
         }
         if (empty($errorMessage)) {
             return $data;
         } else {
             throw new Exception($errorMessage);
         }
     } catch (Exception $e) {
         $data['success'] = false;
         $data['message'] = $e->getMessage();
         return $data;
     }
 }
 /**
  * update
  * controler for remove item
  */
 public static function destroy($args = array())
 {
     // Security check
     //if (!wbSecurity::check('DHotel')) return;
     // Get arguments from argument array
     $jsonItems = wbRequest::getVarClean('items', 'str', '');
     $items =& wbUtil::jsonDecode($jsonItems);
     $data = array('items' => array(), 'total' => 0, 'success' => false, 'message' => '');
     try {
         $ws_client = self::getNusoap();
         $params = array('search' => '', 'getParams' => json_encode($_GET), 'controller' => json_encode(array('module' => 'bds', 'class' => 't_cust_order_legal_doc', 'method' => 'destroy', 'type' => 'json')), 'postParams' => json_encode($_POST), 'jsonItems' => '', 'start' => $start, 'limit' => $limit);
         $ws_data = self::getResultData($ws_client, $params);
         if ($ws_data['data']['single']) {
             if ($ws_data['success']) {
                 $r = $ws_data['data']['old_row'];
                 if (!empty($r['origin_file_name']) && is_file(self::imurl() . $ws_data['data']['deleted']['t_cust_order_legal_doc_id'] . '_' . $r['origin_file_name'])) {
                     @unlink(self::imurl() . $ws_data['data']['deleted']['t_cust_order_legal_doc_id'] . '_' . $r['origin_file_name']);
                     if (is_file(self::imurl() . 'th_' . $ws_data['data']['deleted']['t_cust_order_legal_doc_id'] . '_' . $r['origin_file_name'])) {
                         @unlink(self::imurl() . 'th_' . $ws_data['data']['deleted']['t_cust_order_legal_doc_id'] . '_' . $r['origin_file_name']);
                     }
                     if (is_file(self::imurl() . 'view_' . $ws_data['data']['deleted']['t_cust_order_legal_doc_id'] . '_' . $r['origin_file_name'])) {
                         @unlink(self::imurl() . 'view_' . $ws_data['data']['deleted']['t_cust_order_legal_doc_id'] . '_' . $r['origin_file_name']);
                     }
                 }
             }
         } else {
             if ($ws_data['success']) {
                 foreach ($ws_data['data'] as $item) {
                     $r = $item['old_row'];
                     if (!empty($r['origin_file_name']) && is_file(self::imurl() . $item['deleted']['t_cust_order_legal_doc_id'] . '_' . $r['origin_file_name'])) {
                         @unlink(self::imurl() . $item['deleted']['t_cust_order_legal_doc_id'] . '_' . $r['origin_file_name']);
                         if (is_file(self::imurl() . 'th_' . $item['deleted']['t_cust_order_legal_doc_id'] . '_' . $r['origin_file_name'])) {
                             @unlink(self::imurl() . 'th_' . $item['deleted']['t_cust_order_legal_doc_id'] . '_' . $r['origin_file_name']);
                         }
                         if (is_file(self::imurl() . 'view_' . $item['deleted']['t_cust_order_legal_doc_id'] . '_' . $r['origin_file_name'])) {
                             @unlink(self::imurl() . 'view_' . $item['deleted']['t_cust_order_legal_doc_id'] . '_' . $r['origin_file_name']);
                         }
                     }
                 }
             }
         }
         $data['items'] = $ws_data['data'];
         $data['total'] = $ws_data['total'];
         $data['message'] = $ws_data['message'];
         $data['success'] = $ws_data['success'];
     } catch (Exception $e) {
         $data['message'] = $e->getMessage();
     }
     return $data;
 }
 public static function upload_excel($args = array())
 {
     $jsonItems = wbRequest::getVarClean('jsonItems', 'str', '');
     $item = wbUtil::jsonDecode($jsonItems);
     $table =& wbModule::getModel('bds', 't_modern_mart');
     $table->actionType = 'CREATE';
     $parameter =& wbModule::getModel('bds', 'p_parameter');
     $items = $item['items'];
     $data = array('items' => array(), 'total' => 0, 'success' => true, 'message' => '');
     try {
         $errorMessage = '';
         /* cek data */
         foreach ($items as $rec) {
             $errorMessage .= $table->cekValid(trim($rec['param_name']), $rec['mmart_tahun']);
         }
         if (!empty($errorMessage)) {
             throw new Exception('Input data gagal, dikarenakan : <br>' . $errorMessage);
         }
         foreach ($items as $rec) {
             $rec[$table->pkey] = $table->GenID();
             $rec['type_id'] = $parameter->getIDbyName(trim($rec['param_name']));
             $table->setRecord($rec);
             $table->create();
         }
         return $data;
     } catch (Exception $e) {
         $data['success'] = false;
         $data['message'] = $e->getMessage();
         return $data;
     }
 }
 /**
  * update
  * controler for remove item
  */
 public static function destroy($args = array())
 {
     // Security check
     wbSecurity::check('PRoleMenu', ACCESS_DELETE);
     // Get arguments from argument array
     extract($args);
     $jsonItems = wbRequest::getVarClean('items', 'str', '');
     $items =& wbUtil::jsonDecode($jsonItems);
     $data = array('items' => array(), 'total' => 0, 'success' => false, 'message' => '');
     $table =& wbModule::getModel('bds', 'p_role_menu');
     try {
         $table->dbconn->BeginTrans();
         if (is_array($items)) {
             foreach ($items as $key => $value) {
                 if (empty($value)) {
                     throw new Exception('Empty parameter');
                 }
                 $keys = explode('.', $value);
                 if (empty($keys[0]) || empty($keys[1])) {
                     throw new Exception('Invalid Role Permission ID');
                 }
                 $table->remove($keys[0], $keys[1]);
                 $data['items'][] = array('p_role_menu_id' => $value);
                 $data['total']++;
             }
         } else {
             if (empty($items)) {
                 throw new Exception('Empty parameter');
             }
             $keys = explode('.', $items);
             if (empty($keys[0]) || empty($keys[1])) {
                 throw new Exception('Invalid Role Permission ID');
             }
             $table->remove($keys[0], $keys[1]);
             $data['items'][] = array('p_role_menu_id' => $items);
             $data['total'] = 1;
         }
         $data['success'] = true;
         $data['message'] = $data['total'] . ' Data berhasil dihapus';
         $table->dbconn->CommitTrans();
     } catch (Exception $e) {
         $table->dbconn->RollbackTrans();
         $data['message'] = $e->getMessage();
         $data['items'] = array();
         $data['total'] = 0;
     }
     return $data;
 }
 public static function upload_excel($args = array())
 {
     $jsonItems = wbRequest::getVarClean('jsonItems', 'str', '');
     $item = wbUtil::jsonDecode($jsonItems);
     $table =& wbModule::getModel('bds', 'p_vat_type_dtl');
     $table->actionType = 'CREATE';
     $items = $item['items'];
     $data = array('items' => array(), 'total' => 0, 'success' => true, 'message' => '');
     try {
         foreach ($items as $rec) {
             $rec[$table->pkey] = $table->GenID();
             $table->setRecord($rec);
             $table->create();
         }
         return $data;
     } catch (Exception $e) {
         $data['success'] = false;
         $data['message'] = $e->getMessage();
         return $data;
     }
 }
function debugvar($var)
{
    wbUtil::debugvar($var);
}
 /**
  * update
  * controler for remove item
  */
 public static function destroy($args = array())
 {
     // Security check
     //wbSecurity::check('RolePermission', ACCESS_DELETE);
     // Get arguments from argument array
     //extract($args);
     $jsonItems = wbRequest::getVarClean('items', 'str', '');
     $items =& wbUtil::jsonDecode($jsonItems);
     $data = array('items' => array(), 'total' => 0, 'success' => false, 'message' => '');
     try {
         $ws_client = self::getNusoap();
         $params = array('search' => '', 'getParams' => json_encode($_GET), 'controller' => json_encode(array('module' => 'base', 'class' => 'roles.role_permission', 'method' => 'destroy', 'type' => 'json')), 'postParams' => json_encode($_POST), 'jsonItems' => '', 'start' => $start, 'limit' => $limit);
         $ws_data = self::getResultData($ws_client, $params);
         $data['items'] = $ws_data['data'];
         $data['total'] = $ws_data['total'];
         $data['message'] = $ws_data['message'];
         $data['success'] = $ws_data['success'];
     } catch (Exception $e) {
         $data['message'] = $e->getMessage();
     }
     return $data;
 }
 /**
  * update
  * controler for remove item
  */
 public static function destroy($args = array())
 {
     // Security check
     if (!wbSecurity::check('PWilayahPerson')) {
         return;
     }
     // Get arguments from argument array
     extract($args);
     $jsonItems = wbRequest::getVarClean('items', 'str', '');
     $items =& wbUtil::jsonDecode($jsonItems);
     $data = array('items' => array(), 'total' => 0, 'success' => false, 'message' => '');
     $table =& wbModule::getModel('bds', 'p_wilayah_person');
     try {
         $table->dbconn->BeginTrans();
         if (is_array($items)) {
             foreach ($items as $key => $value) {
                 if (empty($value)) {
                     throw new Exception('Empty parameter');
                 }
                 $table->remove($value);
                 $data['items'][] = array($table->pkey => $value);
                 $data['total']++;
             }
         } else {
             $items = (int) $items;
             if (empty($items)) {
                 throw new Exception('Empty parameter');
             }
             $table->remove($items);
             $data['items'][] = array($table->pkey => $items);
             $data['total'] = 1;
         }
         $data['success'] = true;
         $data['message'] = $data['total'] . ' Data berhasil dihapus';
         $table->dbconn->CommitTrans();
     } catch (Exception $e) {
         $table->dbconn->RollbackTrans();
         $data['message'] = $e->getMessage();
         $data['items'] = array();
         $data['total'] = 0;
     }
     return $data;
 }
 public static function show_per_jenis()
 {
     try {
         $ws_client = self::getNusoap();
         $params = array('search' => '', 'getParams' => json_encode($_GET), 'controller' => json_encode(array('module' => 'bds', 'class' => 'dashboard_rumahsakit', 'method' => 'show_per_jenis', 'type' => '')), 'postParams' => json_encode($_POST), 'jsonItems' => '', 'start' => $start, 'limit' => $limit);
         $ws_data = self::getResultData($ws_client, $params);
         $data['items'] = $ws_data['data'];
         $data['total'] = $ws_data['total'];
         $data['message'] = $ws_data['message'];
         $data['success'] = $ws_data['success'];
     } catch (Exception $e) {
         $data['message'] = $e->getMessage();
     }
     $itemsJenis = $data['items'];
     $print = wbRequest::getVarClean('print', 'int', 0);
     $t = wbRequest::getVarClean('t', 'str', '');
     //timestamp
     if (!empty($print)) {
         wbUtil::startExcel('rumah_sakit.xls');
     }
     echo '<div class="body-wrap">';
     echo '<div style="float:left;margin:5 5 0 5;">';
     echo '<div><h3>JUMLAH RUMAH SAKIT BERDASARKAN JENISNYA</h3></div>';
     if (!empty($print)) {
         echo '<table border="1" width ="100%">';
     } else {
         echo '<table border="0" width ="100%">';
     }
     echo '<tr>
             <th width="30">No</th>
             <th width="200">Jenis Rumah Sakit</th>
             <th width="100">Jumlah</th>
           </tr>';
     $i = 1;
     $total = 0;
     foreach ($itemsJenis as $item) {
         $params = array('controller' => json_encode(array('module' => 'bds', 'class' => 'dashboard_rumahsakit', 'method' => 'getJumlahPerJenis', 'type' => '')), 'jsonItems' => json_encode(array('param_id' => $item['param_id'])));
         $ws_data = self::getResultData($ws_client, $params);
         $jumlahRS = $ws_data['data'];
         $total += $jumlahRS;
         echo '<tr>';
         echo '<td>' . $i++ . '</td>';
         echo '<td>' . $item['param_name'] . '</td>';
         echo '<td align="right">' . wbUtil::numberFormat($jumlahRS, 0) . '</td>';
         echo '</tr>';
     }
     echo '<tr>';
     echo '<td colspan="2" align="center"> <b>TOTAL RUMAH SAKIT</b> </td>';
     echo '<td align="right"> <b>' . wbUtil::numberFormat($total, 0) . '</b> </td>';
     echo '</tr>';
     echo '</table>';
     echo '</div>';
     echo '</div>';
     exit;
 }