function ExportToExcel()
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs);
    } else {
        $row = db_fetch_array($rs);
    }
    //	if(!$row)
    //		return;
    $arrLabel = array();
    $arrColumnWidth = array();
    $arrTotal = array();
    $arrTotalMessage = array();
    $totals = array();
    $arrFields = array();
    $arrTmpTotal = array();
    $arrFields = GetFieldsList($strTableName);
    $arrTmpTotal = GetTableData($strTableName, ".totalsFields", array());
    foreach ($arrFields as $value) {
        $arrLabel[$value] = label($value, $strTableName);
        $arrColumnWidth[$value] = 10;
        $totals[$value] = 0;
        $totalsType = "";
        foreach ($arrTmpTotal as $tvalue) {
            if ($tvalue["fName"] == $value) {
                $totalsType = $tvalue["totalsType"];
            }
        }
        $totalsFields[] = array('fName' => $value, 'totalsType' => $totalsType, 'viewFormat' => ViewFormat($value, $strTableName));
    }
    // write data rows
    $iNumberOfRows = 0;
    $objPHPExcel = ExportExcelInit($arrLabel, $arrColumnWidth);
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $arrData = array();
        $arrDataType = array();
        foreach ($arrFields as $value) {
            if (GetEditFormat($value, $strTableName) == EDIT_FORMAT_LOOKUP_WIZARD || GetEditFormat($value, $strTableName) == EDIT_FORMAT_RADIO) {
                $values[$value] = "";
                if (strlen($row[$value])) {
                    $values[$value] = DisplayLookupWizard($value, $row[$value], $row, "", MODE_EXPORT);
                }
            } elseif (IsBinaryType(GetFieldType($value, $strTableName))) {
                $values[$value] = $row[$value];
            } else {
                if (ViewFormat($value, $strTableName) != FORMAT_FILE_IMAGE && ViewFormat($value, $strTableName) != FORMAT_FILE && ViewFormat($value, $strTableName) != FORMAT_HYPERLINK && ViewFormat($value, $strTableName) != FORMAT_EMAILHYPERLINK && ViewFormat($value, $strTableName) != FORMAT_CHECKBOX) {
                    $format = ViewFormat($value, $strTableName);
                } else {
                    $format = FORMAT_NONE;
                }
                $values[$value] = GetData($row, $value, $format);
            }
        }
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $arrColumnWidth, $iNumberOfRows + 1, $objPHPExcel);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            $i = 0;
            foreach ($arrFields as $value) {
                if (IsBinaryType(GetFieldType($value, $strTableName))) {
                    $arrDataType[$value] = "binary";
                } elseif (ViewFormat($value, $strTableName) == FORMAT_FILE_IMAGE) {
                    $arrDataType[$value] = "file";
                } elseif (ViewFormat($value, $strTableName) == FORMAT_DATE_SHORT || ViewFormat($value, $strTableName) == FORMAT_DATE_LONG || ViewFormat($value, $strTableName) == FORMAT_DATE_TIME) {
                    $arrDataType[$value] = "date";
                } else {
                    $arrDataType[$value] = "";
                }
                $arrData[$value] = $values[$value];
            }
            ExportExcelRecord($arrData, $arrDataType, $iNumberOfRows, $objPHPExcel);
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs);
        } else {
            $row = db_fetch_array($rs);
        }
    }
    if (count($arrTmpTotal)) {
        foreach ($arrFields as $fName) {
            $value = array();
            foreach ($arrTmpTotal as $tvalue) {
                if ($tvalue["fName"] == $fName) {
                    $value = $tvalue;
                }
            }
            $total = "";
            $totalMess = "";
            if ($value["totalsType"]) {
                if ($value["totalsType"] == "COUNT") {
                    $totalMess = "Count" . ": ";
                } elseif ($value["totalsType"] == "TOTAL") {
                    $totalMess = "Total" . ": ";
                } elseif ($value["totalsType"] == "AVERAGE") {
                    $totalMess = "Average" . ": ";
                }
                $total = GetTotals($fName, $totals[$fName], $value["totalsType"], $iNumberOfRows, $value["viewFormat"]);
            }
            $arrTotal[$fName] = $total;
            $arrTotalMessage[$fName] = $totalMess;
        }
    }
    ExportExcelTotals($arrTotal, $arrTotalMessage, ++$iNumberOfRows, $objPHPExcel);
    $formatExcel = "Excel2007";
    $extExcel = ".xlsx";
    if (@$_REQUEST["type"] == "excel5") {
        $formatExcel = "Excel5";
        $extExcel = ".xls";
    }
    ExportExcelSave(GoodFieldName($strTableName) . $extExcel, $formatExcel, $objPHPExcel);
}
function WriteTableData($cipherer)
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj, $pageObject;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs, $pageObject);
    } else {
        $row = $cipherer->DecryptFetchedArray($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Konterid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Reg Date") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Customer Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Usaha Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("So") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kecamatan Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kelurahan Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Notes") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Enabled") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Create Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Customer Status Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Aktifnotes") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tmt") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Air Zona Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Air Manfaat Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Def Pajak Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Opnm") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Opalamat") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Latitude") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Longitude") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Created") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Updated") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Update Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Restojmlmeja") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Restojmlkursi") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Restojmltamu") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Filmkursi") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Filmpertunjukan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Filmtarif") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Bilyarmeja") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Bilyartarif") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Bilyarkegiatan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Diskopengunjung") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Diskotarif") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Mall Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Cash Register") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pelaporan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pembukuan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bandara") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Wajib Pajak") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Jumlah Karyawan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tanggal Tutup") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Parkir Luas") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Parkir Masuk") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Parkir Tarif Mobil") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Parkir Tambahan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Parkir Kapasitas Mobil") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Parkir Mobil Hari") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Parkir Keluar") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Parkir Motor Luas") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Parkir Motor Masuk") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Parkir Motor Keluar") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Parkir Tarif Motor") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Parkir Motor Tambahan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Parkir Kapasitas Motor") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Parkir Motor Hari") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kelompok Usaha Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Zona Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Manfaat Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Golongan Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id Old") . '</td>';
    } else {
        echo "<td>" . "Id" . "</td>";
        echo "<td>" . "Konterid" . "</td>";
        echo "<td>" . "Reg Date" . "</td>";
        echo "<td>" . "Customer Id" . "</td>";
        echo "<td>" . "Usaha Id" . "</td>";
        echo "<td>" . "So" . "</td>";
        echo "<td>" . "Kecamatan Id" . "</td>";
        echo "<td>" . "Kelurahan Id" . "</td>";
        echo "<td>" . "Notes" . "</td>";
        echo "<td>" . "Enabled" . "</td>";
        echo "<td>" . "Create Uid" . "</td>";
        echo "<td>" . "Customer Status Id" . "</td>";
        echo "<td>" . "Aktifnotes" . "</td>";
        echo "<td>" . "Tmt" . "</td>";
        echo "<td>" . "Air Zona Id" . "</td>";
        echo "<td>" . "Air Manfaat Id" . "</td>";
        echo "<td>" . "Def Pajak Id" . "</td>";
        echo "<td>" . "Opnm" . "</td>";
        echo "<td>" . "Opalamat" . "</td>";
        echo "<td>" . "Latitude" . "</td>";
        echo "<td>" . "Longitude" . "</td>";
        echo "<td>" . "Created" . "</td>";
        echo "<td>" . "Updated" . "</td>";
        echo "<td>" . "Update Uid" . "</td>";
        echo "<td>" . "Kd Restojmlmeja" . "</td>";
        echo "<td>" . "Kd Restojmlkursi" . "</td>";
        echo "<td>" . "Kd Restojmltamu" . "</td>";
        echo "<td>" . "Kd Filmkursi" . "</td>";
        echo "<td>" . "Kd Filmpertunjukan" . "</td>";
        echo "<td>" . "Kd Filmtarif" . "</td>";
        echo "<td>" . "Kd Bilyarmeja" . "</td>";
        echo "<td>" . "Kd Bilyartarif" . "</td>";
        echo "<td>" . "Kd Bilyarkegiatan" . "</td>";
        echo "<td>" . "Kd Diskopengunjung" . "</td>";
        echo "<td>" . "Kd Diskotarif" . "</td>";
        echo "<td>" . "Mall Id" . "</td>";
        echo "<td>" . "Cash Register" . "</td>";
        echo "<td>" . "Pelaporan" . "</td>";
        echo "<td>" . "Pembukuan" . "</td>";
        echo "<td>" . "Bandara" . "</td>";
        echo "<td>" . "Wajib Pajak" . "</td>";
        echo "<td>" . "Jumlah Karyawan" . "</td>";
        echo "<td>" . "Tanggal Tutup" . "</td>";
        echo "<td>" . "Parkir Luas" . "</td>";
        echo "<td>" . "Parkir Masuk" . "</td>";
        echo "<td>" . "Parkir Tarif Mobil" . "</td>";
        echo "<td>" . "Parkir Tambahan" . "</td>";
        echo "<td>" . "Parkir Kapasitas Mobil" . "</td>";
        echo "<td>" . "Parkir Mobil Hari" . "</td>";
        echo "<td>" . "Parkir Keluar" . "</td>";
        echo "<td>" . "Parkir Motor Luas" . "</td>";
        echo "<td>" . "Parkir Motor Masuk" . "</td>";
        echo "<td>" . "Parkir Motor Keluar" . "</td>";
        echo "<td>" . "Parkir Tarif Motor" . "</td>";
        echo "<td>" . "Parkir Motor Tambahan" . "</td>";
        echo "<td>" . "Parkir Kapasitas Motor" . "</td>";
        echo "<td>" . "Parkir Motor Hari" . "</td>";
        echo "<td>" . "Kelompok Usaha Id" . "</td>";
        echo "<td>" . "Zona Id" . "</td>";
        echo "<td>" . "Manfaat Id" . "</td>";
        echo "<td>" . "Golongan Id" . "</td>";
        echo "<td>" . "Id Old" . "</td>";
    }
    echo "</tr>";
    // write data rows
    $iNumberOfRows = 0;
    $pageObject->viewControls->forExport = "export";
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $values["id"] = $pageObject->getViewControl("id")->showDBValue($row, "");
        $values["konterid"] = $pageObject->getViewControl("konterid")->showDBValue($row, "");
        $values["reg_date"] = $pageObject->getViewControl("reg_date")->showDBValue($row, "");
        $values["customer_id"] = $pageObject->getViewControl("customer_id")->showDBValue($row, "");
        $values["usaha_id"] = $pageObject->getViewControl("usaha_id")->showDBValue($row, "");
        $values["so"] = $pageObject->getViewControl("so")->showDBValue($row, "");
        $values["kecamatan_id"] = $pageObject->getViewControl("kecamatan_id")->showDBValue($row, "");
        $values["kelurahan_id"] = $pageObject->getViewControl("kelurahan_id")->showDBValue($row, "");
        $values["notes"] = $pageObject->getViewControl("notes")->showDBValue($row, "");
        $values["enabled"] = $pageObject->getViewControl("enabled")->showDBValue($row, "");
        $values["create_uid"] = $pageObject->getViewControl("create_uid")->showDBValue($row, "");
        $values["customer_status_id"] = $pageObject->getViewControl("customer_status_id")->showDBValue($row, "");
        $values["aktifnotes"] = $pageObject->getViewControl("aktifnotes")->showDBValue($row, "");
        $values["tmt"] = $pageObject->getViewControl("tmt")->showDBValue($row, "");
        $values["air_zona_id"] = $pageObject->getViewControl("air_zona_id")->showDBValue($row, "");
        $values["air_manfaat_id"] = $pageObject->getViewControl("air_manfaat_id")->showDBValue($row, "");
        $values["def_pajak_id"] = $pageObject->getViewControl("def_pajak_id")->showDBValue($row, "");
        $values["opnm"] = $pageObject->getViewControl("opnm")->showDBValue($row, "");
        $values["opalamat"] = $pageObject->getViewControl("opalamat")->showDBValue($row, "");
        $values["latitude"] = $pageObject->getViewControl("latitude")->showDBValue($row, "");
        $values["longitude"] = $pageObject->getViewControl("longitude")->showDBValue($row, "");
        $values["created"] = $pageObject->getViewControl("created")->showDBValue($row, "");
        $values["updated"] = $pageObject->getViewControl("updated")->showDBValue($row, "");
        $values["update_uid"] = $pageObject->getViewControl("update_uid")->showDBValue($row, "");
        $values["kd_restojmlmeja"] = $pageObject->getViewControl("kd_restojmlmeja")->showDBValue($row, "");
        $values["kd_restojmlkursi"] = $pageObject->getViewControl("kd_restojmlkursi")->showDBValue($row, "");
        $values["kd_restojmltamu"] = $pageObject->getViewControl("kd_restojmltamu")->showDBValue($row, "");
        $values["kd_filmkursi"] = $pageObject->getViewControl("kd_filmkursi")->showDBValue($row, "");
        $values["kd_filmpertunjukan"] = $pageObject->getViewControl("kd_filmpertunjukan")->showDBValue($row, "");
        $values["kd_filmtarif"] = $pageObject->getViewControl("kd_filmtarif")->showDBValue($row, "");
        $values["kd_bilyarmeja"] = $pageObject->getViewControl("kd_bilyarmeja")->showDBValue($row, "");
        $values["kd_bilyartarif"] = $pageObject->getViewControl("kd_bilyartarif")->showDBValue($row, "");
        $values["kd_bilyarkegiatan"] = $pageObject->getViewControl("kd_bilyarkegiatan")->showDBValue($row, "");
        $values["kd_diskopengunjung"] = $pageObject->getViewControl("kd_diskopengunjung")->showDBValue($row, "");
        $values["kd_diskotarif"] = $pageObject->getViewControl("kd_diskotarif")->showDBValue($row, "");
        $values["mall_id"] = $pageObject->getViewControl("mall_id")->showDBValue($row, "");
        $values["cash_register"] = $pageObject->getViewControl("cash_register")->showDBValue($row, "");
        $values["pelaporan"] = $pageObject->getViewControl("pelaporan")->showDBValue($row, "");
        $values["pembukuan"] = $pageObject->getViewControl("pembukuan")->showDBValue($row, "");
        $values["bandara"] = $pageObject->getViewControl("bandara")->showDBValue($row, "");
        $values["wajib_pajak"] = $pageObject->getViewControl("wajib_pajak")->showDBValue($row, "");
        $values["jumlah_karyawan"] = $pageObject->getViewControl("jumlah_karyawan")->showDBValue($row, "");
        $values["tanggal_tutup"] = $pageObject->getViewControl("tanggal_tutup")->showDBValue($row, "");
        $values["parkir_luas"] = $pageObject->getViewControl("parkir_luas")->showDBValue($row, "");
        $values["parkir_masuk"] = $pageObject->getViewControl("parkir_masuk")->showDBValue($row, "");
        $values["parkir_tarif_mobil"] = $pageObject->getViewControl("parkir_tarif_mobil")->showDBValue($row, "");
        $values["parkir_tambahan"] = $pageObject->getViewControl("parkir_tambahan")->showDBValue($row, "");
        $values["parkir_kapasitas_mobil"] = $pageObject->getViewControl("parkir_kapasitas_mobil")->showDBValue($row, "");
        $values["parkir_mobil_hari"] = $pageObject->getViewControl("parkir_mobil_hari")->showDBValue($row, "");
        $values["parkir_keluar"] = $pageObject->getViewControl("parkir_keluar")->showDBValue($row, "");
        $values["parkir_motor_luas"] = $pageObject->getViewControl("parkir_motor_luas")->showDBValue($row, "");
        $values["parkir_motor_masuk"] = $pageObject->getViewControl("parkir_motor_masuk")->showDBValue($row, "");
        $values["parkir_motor_keluar"] = $pageObject->getViewControl("parkir_motor_keluar")->showDBValue($row, "");
        $values["parkir_tarif_motor"] = $pageObject->getViewControl("parkir_tarif_motor")->showDBValue($row, "");
        $values["parkir_motor_tambahan"] = $pageObject->getViewControl("parkir_motor_tambahan")->showDBValue($row, "");
        $values["parkir_kapasitas_motor"] = $pageObject->getViewControl("parkir_kapasitas_motor")->showDBValue($row, "");
        $values["parkir_motor_hari"] = $pageObject->getViewControl("parkir_motor_hari")->showDBValue($row, "");
        $values["kelompok_usaha_id"] = $pageObject->getViewControl("kelompok_usaha_id")->showDBValue($row, "");
        $values["zona_id"] = $pageObject->getViewControl("zona_id")->showDBValue($row, "");
        $values["manfaat_id"] = $pageObject->getViewControl("manfaat_id")->showDBValue($row, "");
        $values["golongan_id"] = $pageObject->getViewControl("golongan_id")->showDBValue($row, "");
        $values["id_old"] = $pageObject->getViewControl("id_old")->showDBValue($row, "");
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $pageObject);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            echo $values["id"];
            echo '</td>';
            echo '<td>';
            echo $values["konterid"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["reg_date"]);
            } else {
                echo $values["reg_date"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["customer_id"]);
            } else {
                echo $values["customer_id"];
            }
            //echo htmlspecialchars($values["customer_id"]); commented for bug #6823
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["usaha_id"]);
            } else {
                echo $values["usaha_id"];
            }
            //echo htmlspecialchars($values["usaha_id"]); commented for bug #6823
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["so"]);
            } else {
                echo $values["so"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["kecamatan_id"]);
            } else {
                echo $values["kecamatan_id"];
            }
            //echo htmlspecialchars($values["kecamatan_id"]); commented for bug #6823
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["kelurahan_id"]);
            } else {
                echo $values["kelurahan_id"];
            }
            //echo htmlspecialchars($values["kelurahan_id"]); commented for bug #6823
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["notes"]);
            } else {
                echo $values["notes"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["enabled"];
            echo '</td>';
            echo '<td>';
            echo $values["create_uid"];
            echo '</td>';
            echo '<td>';
            echo $values["customer_status_id"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["aktifnotes"]);
            } else {
                echo $values["aktifnotes"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["tmt"]);
            } else {
                echo $values["tmt"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["air_zona_id"];
            echo '</td>';
            echo '<td>';
            echo $values["air_manfaat_id"];
            echo '</td>';
            echo '<td>';
            echo $values["def_pajak_id"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["opnm"]);
            } else {
                echo $values["opnm"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["opalamat"]);
            } else {
                echo $values["opalamat"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["latitude"];
            echo '</td>';
            echo '<td>';
            echo $values["longitude"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["created"]);
            } else {
                echo $values["created"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["updated"]);
            } else {
                echo $values["updated"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["update_uid"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_restojmlmeja"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_restojmlkursi"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_restojmltamu"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_filmkursi"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_filmpertunjukan"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_filmtarif"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_bilyarmeja"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_bilyartarif"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_bilyarkegiatan"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_diskopengunjung"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_diskotarif"];
            echo '</td>';
            echo '<td>';
            echo $values["mall_id"];
            echo '</td>';
            echo '<td>';
            echo $values["cash_register"];
            echo '</td>';
            echo '<td>';
            echo $values["pelaporan"];
            echo '</td>';
            echo '<td>';
            echo $values["pembukuan"];
            echo '</td>';
            echo '<td>';
            echo $values["bandara"];
            echo '</td>';
            echo '<td>';
            echo $values["wajib_pajak"];
            echo '</td>';
            echo '<td>';
            echo $values["jumlah_karyawan"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["tanggal_tutup"]);
            } else {
                echo $values["tanggal_tutup"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["parkir_luas"];
            echo '</td>';
            echo '<td>';
            echo $values["parkir_masuk"];
            echo '</td>';
            echo '<td>';
            echo $values["parkir_tarif_mobil"];
            echo '</td>';
            echo '<td>';
            echo $values["parkir_tambahan"];
            echo '</td>';
            echo '<td>';
            echo $values["parkir_kapasitas_mobil"];
            echo '</td>';
            echo '<td>';
            echo $values["parkir_mobil_hari"];
            echo '</td>';
            echo '<td>';
            echo $values["parkir_keluar"];
            echo '</td>';
            echo '<td>';
            echo $values["parkir_motor_luas"];
            echo '</td>';
            echo '<td>';
            echo $values["parkir_motor_masuk"];
            echo '</td>';
            echo '<td>';
            echo $values["parkir_motor_keluar"];
            echo '</td>';
            echo '<td>';
            echo $values["parkir_tarif_motor"];
            echo '</td>';
            echo '<td>';
            echo $values["parkir_motor_tambahan"];
            echo '</td>';
            echo '<td>';
            echo $values["parkir_kapasitas_motor"];
            echo '</td>';
            echo '<td>';
            echo $values["parkir_motor_hari"];
            echo '</td>';
            echo '<td>';
            echo $values["kelompok_usaha_id"];
            echo '</td>';
            echo '<td>';
            echo $values["zona_id"];
            echo '</td>';
            echo '<td>';
            echo $values["manfaat_id"];
            echo '</td>';
            echo '<td>';
            echo $values["golongan_id"];
            echo '</td>';
            echo '<td>';
            echo $values["id_old"];
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs, $pageObject);
        } else {
            $row = $cipherer->DecryptFetchedArray($rs);
        }
    }
}
function WriteTableData()
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs);
    } else {
        $row = db_fetch_array($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Anomalies", "ID")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Anomalies", "Module_ID")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Anomalies", "Anomaly_Description")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Anomalies", "Anomaly_Type")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Anomalies", "Date_Time")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Anomalies", "Action_Taken")) . '</td>';
    } else {
        echo "<td>" . GetFieldLabel("dbo_Anomalies", "ID") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Anomalies", "Module_ID") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Anomalies", "Anomaly_Description") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Anomalies", "Anomaly_Type") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Anomalies", "Date_Time") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Anomalies", "Action_Taken") . "</td>";
    }
    echo "</tr>";
    $totals["ID"] = 0;
    $totalsFields[] = array('fName' => "ID", 'totalsType' => '', 'viewFormat' => "");
    $totals["Module ID"] = 0;
    $totalsFields[] = array('fName' => "Module ID", 'totalsType' => '', 'viewFormat' => "");
    $totals["Anomaly Description"] = 0;
    $totalsFields[] = array('fName' => "Anomaly Description", 'totalsType' => '', 'viewFormat' => "");
    $totals["Anomaly Type"] = 0;
    $totalsFields[] = array('fName' => "Anomaly Type", 'totalsType' => '', 'viewFormat' => "");
    $totals["Date Time"] = 0;
    $totalsFields[] = array('fName' => "Date Time", 'totalsType' => '', 'viewFormat' => "Short Date");
    $totals["Action Taken"] = 0;
    $totalsFields[] = array('fName' => "Action Taken", 'totalsType' => '', 'viewFormat' => "");
    $totals = array();
    // write data rows
    $iNumberOfRows = 0;
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $format = "";
        $values["ID"] = GetData($row, "ID", $format);
        $values["Module ID"] = "";
        if (strlen($row["Module ID"])) {
            $values["Module ID"] = DisplayLookupWizard("Module ID", $row["Module ID"], $row, "", MODE_EXPORT);
        }
        $format = "";
        $values["Anomaly Description"] = GetData($row, "Anomaly Description", $format);
        $values["Anomaly Type"] = "";
        if (strlen($row["Anomaly Type"])) {
            $values["Anomaly Type"] = DisplayLookupWizard("Anomaly Type", $row["Anomaly Type"], $row, "", MODE_EXPORT);
        }
        $format = "Short Date";
        $values["Date Time"] = GetData($row, "Date Time", $format);
        $values["Action Taken"] = "";
        if (strlen($row["Action Taken"])) {
            $values["Action Taken"] = DisplayLookupWizard("Action Taken", $row["Action Taken"], $row, "", MODE_EXPORT);
        }
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            $format = "";
            echo htmlspecialchars($values["ID"]);
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["Module ID"]);
            } else {
                echo htmlspecialchars($values["Module ID"]);
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            $format = "";
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["Anomaly Description"]);
            } else {
                echo htmlspecialchars($values["Anomaly Description"]);
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["Anomaly Type"]);
            } else {
                echo htmlspecialchars($values["Anomaly Type"]);
            }
            echo '</td>';
            echo '<td>';
            $format = "Short Date";
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["Date Time"]);
            } else {
                echo htmlspecialchars($values["Date Time"]);
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["Action Taken"]);
            } else {
                echo htmlspecialchars($values["Action Taken"]);
            }
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs);
        } else {
            $row = db_fetch_array($rs);
        }
    }
}
function WriteTableData($cipherer)
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj, $pageObject;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs, $pageObject);
    } else {
        $row = $cipherer->DecryptFetchedArray($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Daftar Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Status Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Create Date") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Create Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Keterangan") . '</td>';
    } else {
        echo "<td>" . "Id" . "</td>";
        echo "<td>" . "Daftar Id" . "</td>";
        echo "<td>" . "Status Id" . "</td>";
        echo "<td>" . "Create Date" . "</td>";
        echo "<td>" . "Create Uid" . "</td>";
        echo "<td>" . "Keterangan" . "</td>";
    }
    echo "</tr>";
    // write data rows
    $iNumberOfRows = 0;
    $pageObject->viewControls->forExport = "export";
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $values["id"] = $pageObject->getViewControl("id")->showDBValue($row, "");
        $values["daftar_id"] = $pageObject->getViewControl("daftar_id")->showDBValue($row, "");
        $values["status_id"] = $pageObject->getViewControl("status_id")->showDBValue($row, "");
        $values["create_date"] = $pageObject->getViewControl("create_date")->showDBValue($row, "");
        $values["create_uid"] = $pageObject->getViewControl("create_uid")->showDBValue($row, "");
        $values["keterangan"] = $pageObject->getViewControl("keterangan")->showDBValue($row, "");
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $pageObject);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            echo $values["id"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["daftar_id"]);
            } else {
                echo $values["daftar_id"];
            }
            //echo htmlspecialchars($values["daftar_id"]); commented for bug #6823
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["status_id"]);
            } else {
                echo $values["status_id"];
            }
            //echo htmlspecialchars($values["status_id"]); commented for bug #6823
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["create_date"]);
            } else {
                echo $values["create_date"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["create_uid"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["keterangan"]);
            } else {
                echo $values["keterangan"];
            }
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs, $pageObject);
        } else {
            $row = $cipherer->DecryptFetchedArray($rs);
        }
    }
}
function WriteTableData($cipherer)
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj, $pageObject;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs, $pageObject);
    } else {
        $row = $cipherer->DecryptFetchedArray($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pajak Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tarif") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Reklame") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Minimal Omset") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tmt") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Enabled") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Created") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Create Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Updated") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Update Uid") . '</td>';
    } else {
        echo "<td>" . "Id" . "</td>";
        echo "<td>" . "Pajak Id" . "</td>";
        echo "<td>" . "Tarif" . "</td>";
        echo "<td>" . "Reklame" . "</td>";
        echo "<td>" . "Minimal Omset" . "</td>";
        echo "<td>" . "Tmt" . "</td>";
        echo "<td>" . "Enabled" . "</td>";
        echo "<td>" . "Created" . "</td>";
        echo "<td>" . "Create Uid" . "</td>";
        echo "<td>" . "Updated" . "</td>";
        echo "<td>" . "Update Uid" . "</td>";
    }
    echo "</tr>";
    // write data rows
    $iNumberOfRows = 0;
    $pageObject->viewControls->forExport = "export";
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $values["id"] = $pageObject->getViewControl("id")->showDBValue($row, "");
        $values["pajak_id"] = $pageObject->getViewControl("pajak_id")->showDBValue($row, "");
        $values["tarif"] = $pageObject->getViewControl("tarif")->showDBValue($row, "");
        $values["reklame"] = $pageObject->getViewControl("reklame")->showDBValue($row, "");
        $values["minimal_omset"] = $pageObject->getViewControl("minimal_omset")->showDBValue($row, "");
        $values["tmt"] = $pageObject->getViewControl("tmt")->showDBValue($row, "");
        $values["enabled"] = $pageObject->getViewControl("enabled")->showDBValue($row, "");
        $values["created"] = $pageObject->getViewControl("created")->showDBValue($row, "");
        $values["create_uid"] = $pageObject->getViewControl("create_uid")->showDBValue($row, "");
        $values["updated"] = $pageObject->getViewControl("updated")->showDBValue($row, "");
        $values["update_uid"] = $pageObject->getViewControl("update_uid")->showDBValue($row, "");
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $pageObject);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            echo $values["id"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["pajak_id"]);
            } else {
                echo $values["pajak_id"];
            }
            //echo htmlspecialchars($values["pajak_id"]); commented for bug #6823
            echo '</td>';
            echo '<td>';
            echo $values["tarif"];
            echo '</td>';
            echo '<td>';
            echo $values["reklame"];
            echo '</td>';
            echo '<td>';
            echo $values["minimal_omset"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["tmt"]);
            } else {
                echo $values["tmt"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["enabled"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["created"]);
            } else {
                echo $values["created"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["create_uid"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["updated"]);
            } else {
                echo $values["updated"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["update_uid"];
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs, $pageObject);
        } else {
            $row = $cipherer->DecryptFetchedArray($rs);
        }
    }
}
Esempio n. 6
0
function WriteTableData($cipherer)
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj, $pageObject;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs, $pageObject);
    } else {
        $row = $cipherer->DecryptFetchedArray($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Sspd Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tahun") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Sspdno") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Spt Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Old Spt Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Wp") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bunga") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Denda") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bayar") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tgl") . '</td>';
    } else {
        echo "<td>" . "Id" . "</td>";
        echo "<td>" . "Sspd Id" . "</td>";
        echo "<td>" . "Tahun" . "</td>";
        echo "<td>" . "Sspdno" . "</td>";
        echo "<td>" . "Spt Id" . "</td>";
        echo "<td>" . "Old Spt Id" . "</td>";
        echo "<td>" . "Wp" . "</td>";
        echo "<td>" . "Bunga" . "</td>";
        echo "<td>" . "Denda" . "</td>";
        echo "<td>" . "Bayar" . "</td>";
        echo "<td>" . "Tgl" . "</td>";
    }
    echo "</tr>";
    // write data rows
    $iNumberOfRows = 0;
    $pageObject->viewControls->forExport = "export";
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $values["id"] = $pageObject->getViewControl("id")->showDBValue($row, "");
        $values["sspd_id"] = $pageObject->getViewControl("sspd_id")->showDBValue($row, "");
        $values["tahun"] = $pageObject->getViewControl("tahun")->showDBValue($row, "");
        $values["sspdno"] = $pageObject->getViewControl("sspdno")->showDBValue($row, "");
        $values["spt_id"] = $pageObject->getViewControl("spt_id")->showDBValue($row, "");
        $values["old_spt_id"] = $pageObject->getViewControl("old_spt_id")->showDBValue($row, "");
        $values["wp"] = $pageObject->getViewControl("wp")->showDBValue($row, "");
        $values["bunga"] = $pageObject->getViewControl("bunga")->showDBValue($row, "");
        $values["denda"] = $pageObject->getViewControl("denda")->showDBValue($row, "");
        $values["bayar"] = $pageObject->getViewControl("bayar")->showDBValue($row, "");
        $values["tgl"] = $pageObject->getViewControl("tgl")->showDBValue($row, "");
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $pageObject);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            echo $values["id"];
            echo '</td>';
            echo '<td>';
            echo $values["sspd_id"];
            echo '</td>';
            echo '<td>';
            echo $values["tahun"];
            echo '</td>';
            echo '<td>';
            echo $values["sspdno"];
            echo '</td>';
            echo '<td>';
            echo $values["spt_id"];
            echo '</td>';
            echo '<td>';
            echo $values["old_spt_id"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["wp"]);
            } else {
                echo $values["wp"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["bunga"];
            echo '</td>';
            echo '<td>';
            echo $values["denda"];
            echo '</td>';
            echo '<td>';
            echo $values["bayar"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["tgl"]);
            } else {
                echo $values["tgl"];
            }
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs, $pageObject);
        } else {
            $row = $cipherer->DecryptFetchedArray($rs);
        }
    }
}
Esempio n. 7
0
function WriteTableData($cipherer)
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj, $pageObject;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs, $pageObject);
    } else {
        $row = $cipherer->DecryptFetchedArray($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Rp") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pb") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Formno") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Reg Date") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Customernm") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kecamatan Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kelurahan Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kabupaten") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Alamat") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kodepos") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Telphone") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Wpnama") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Wpalamat") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Wpkelurahan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Wpkecamatan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Wpkabupaten") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Wptelp") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Wpkodepos") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pnama") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Palamat") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pkelurahan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pkecamatan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pkabupaten") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ptelp") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pkodepos") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin1") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin1no") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin1tgl") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin1tglakhir") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin2") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin2no") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin2tgl") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin2tglakhir") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin3") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin3no") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin3tgl") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin3tglakhir") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin4") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin4no") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin4tgl") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin4tglakhir") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Enabled") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Create Date") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Create Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Write Date") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Write Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Op Nm") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Op Alamat") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Op Usaha Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Op So") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Op Kecamatan Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Op Kelurahan Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Op Latitude") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Op Longitude") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Restojmlmeja") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Restojmlkursi") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Restojmltamu") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Filmkursi") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Filmpertunjukan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Filmtarif") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Bilyarmeja") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Bilyartarif") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Bilyarkegiatan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Diskopengunjung") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Diskotarif") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kd Waletvolume") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Email") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Op Pajak Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Npwpd") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Passwd") . '</td>';
    } else {
        echo "<td>" . "Id" . "</td>";
        echo "<td>" . "Rp" . "</td>";
        echo "<td>" . "Pb" . "</td>";
        echo "<td>" . "Formno" . "</td>";
        echo "<td>" . "Reg Date" . "</td>";
        echo "<td>" . "Customernm" . "</td>";
        echo "<td>" . "Kecamatan Id" . "</td>";
        echo "<td>" . "Kelurahan Id" . "</td>";
        echo "<td>" . "Kabupaten" . "</td>";
        echo "<td>" . "Alamat" . "</td>";
        echo "<td>" . "Kodepos" . "</td>";
        echo "<td>" . "Telphone" . "</td>";
        echo "<td>" . "Wpnama" . "</td>";
        echo "<td>" . "Wpalamat" . "</td>";
        echo "<td>" . "Wpkelurahan" . "</td>";
        echo "<td>" . "Wpkecamatan" . "</td>";
        echo "<td>" . "Wpkabupaten" . "</td>";
        echo "<td>" . "Wptelp" . "</td>";
        echo "<td>" . "Wpkodepos" . "</td>";
        echo "<td>" . "Pnama" . "</td>";
        echo "<td>" . "Palamat" . "</td>";
        echo "<td>" . "Pkelurahan" . "</td>";
        echo "<td>" . "Pkecamatan" . "</td>";
        echo "<td>" . "Pkabupaten" . "</td>";
        echo "<td>" . "Ptelp" . "</td>";
        echo "<td>" . "Pkodepos" . "</td>";
        echo "<td>" . "Ijin1" . "</td>";
        echo "<td>" . "Ijin1no" . "</td>";
        echo "<td>" . "Ijin1tgl" . "</td>";
        echo "<td>" . "Ijin1tglakhir" . "</td>";
        echo "<td>" . "Ijin2" . "</td>";
        echo "<td>" . "Ijin2no" . "</td>";
        echo "<td>" . "Ijin2tgl" . "</td>";
        echo "<td>" . "Ijin2tglakhir" . "</td>";
        echo "<td>" . "Ijin3" . "</td>";
        echo "<td>" . "Ijin3no" . "</td>";
        echo "<td>" . "Ijin3tgl" . "</td>";
        echo "<td>" . "Ijin3tglakhir" . "</td>";
        echo "<td>" . "Ijin4" . "</td>";
        echo "<td>" . "Ijin4no" . "</td>";
        echo "<td>" . "Ijin4tgl" . "</td>";
        echo "<td>" . "Ijin4tglakhir" . "</td>";
        echo "<td>" . "Enabled" . "</td>";
        echo "<td>" . "Create Date" . "</td>";
        echo "<td>" . "Create Uid" . "</td>";
        echo "<td>" . "Write Date" . "</td>";
        echo "<td>" . "Write Uid" . "</td>";
        echo "<td>" . "Op Nm" . "</td>";
        echo "<td>" . "Op Alamat" . "</td>";
        echo "<td>" . "Op Usaha Id" . "</td>";
        echo "<td>" . "Op So" . "</td>";
        echo "<td>" . "Op Kecamatan Id" . "</td>";
        echo "<td>" . "Op Kelurahan Id" . "</td>";
        echo "<td>" . "Op Latitude" . "</td>";
        echo "<td>" . "Op Longitude" . "</td>";
        echo "<td>" . "Kd Restojmlmeja" . "</td>";
        echo "<td>" . "Kd Restojmlkursi" . "</td>";
        echo "<td>" . "Kd Restojmltamu" . "</td>";
        echo "<td>" . "Kd Filmkursi" . "</td>";
        echo "<td>" . "Kd Filmpertunjukan" . "</td>";
        echo "<td>" . "Kd Filmtarif" . "</td>";
        echo "<td>" . "Kd Bilyarmeja" . "</td>";
        echo "<td>" . "Kd Bilyartarif" . "</td>";
        echo "<td>" . "Kd Bilyarkegiatan" . "</td>";
        echo "<td>" . "Kd Diskopengunjung" . "</td>";
        echo "<td>" . "Kd Diskotarif" . "</td>";
        echo "<td>" . "Kd Waletvolume" . "</td>";
        echo "<td>" . "Email" . "</td>";
        echo "<td>" . "Op Pajak Id" . "</td>";
        echo "<td>" . "Npwpd" . "</td>";
        echo "<td>" . "Passwd" . "</td>";
    }
    echo "</tr>";
    // write data rows
    $iNumberOfRows = 0;
    $pageObject->viewControls->forExport = "export";
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $values["id"] = $pageObject->getViewControl("id")->showDBValue($row, "");
        $values["rp"] = $pageObject->getViewControl("rp")->showDBValue($row, "");
        $values["pb"] = $pageObject->getViewControl("pb")->showDBValue($row, "");
        $values["formno"] = $pageObject->getViewControl("formno")->showDBValue($row, "");
        $values["reg_date"] = $pageObject->getViewControl("reg_date")->showDBValue($row, "");
        $values["customernm"] = $pageObject->getViewControl("customernm")->showDBValue($row, "");
        $values["kecamatan_id"] = $pageObject->getViewControl("kecamatan_id")->showDBValue($row, "");
        $values["kelurahan_id"] = $pageObject->getViewControl("kelurahan_id")->showDBValue($row, "");
        $values["kabupaten"] = $pageObject->getViewControl("kabupaten")->showDBValue($row, "");
        $values["alamat"] = $pageObject->getViewControl("alamat")->showDBValue($row, "");
        $values["kodepos"] = $pageObject->getViewControl("kodepos")->showDBValue($row, "");
        $values["telphone"] = $pageObject->getViewControl("telphone")->showDBValue($row, "");
        $values["wpnama"] = $pageObject->getViewControl("wpnama")->showDBValue($row, "");
        $values["wpalamat"] = $pageObject->getViewControl("wpalamat")->showDBValue($row, "");
        $values["wpkelurahan"] = $pageObject->getViewControl("wpkelurahan")->showDBValue($row, "");
        $values["wpkecamatan"] = $pageObject->getViewControl("wpkecamatan")->showDBValue($row, "");
        $values["wpkabupaten"] = $pageObject->getViewControl("wpkabupaten")->showDBValue($row, "");
        $values["wptelp"] = $pageObject->getViewControl("wptelp")->showDBValue($row, "");
        $values["wpkodepos"] = $pageObject->getViewControl("wpkodepos")->showDBValue($row, "");
        $values["pnama"] = $pageObject->getViewControl("pnama")->showDBValue($row, "");
        $values["palamat"] = $pageObject->getViewControl("palamat")->showDBValue($row, "");
        $values["pkelurahan"] = $pageObject->getViewControl("pkelurahan")->showDBValue($row, "");
        $values["pkecamatan"] = $pageObject->getViewControl("pkecamatan")->showDBValue($row, "");
        $values["pkabupaten"] = $pageObject->getViewControl("pkabupaten")->showDBValue($row, "");
        $values["ptelp"] = $pageObject->getViewControl("ptelp")->showDBValue($row, "");
        $values["pkodepos"] = $pageObject->getViewControl("pkodepos")->showDBValue($row, "");
        $values["ijin1"] = $pageObject->getViewControl("ijin1")->showDBValue($row, "");
        $values["ijin1no"] = $pageObject->getViewControl("ijin1no")->showDBValue($row, "");
        $values["ijin1tgl"] = $pageObject->getViewControl("ijin1tgl")->showDBValue($row, "");
        $values["ijin1tglakhir"] = $pageObject->getViewControl("ijin1tglakhir")->showDBValue($row, "");
        $values["ijin2"] = $pageObject->getViewControl("ijin2")->showDBValue($row, "");
        $values["ijin2no"] = $pageObject->getViewControl("ijin2no")->showDBValue($row, "");
        $values["ijin2tgl"] = $pageObject->getViewControl("ijin2tgl")->showDBValue($row, "");
        $values["ijin2tglakhir"] = $pageObject->getViewControl("ijin2tglakhir")->showDBValue($row, "");
        $values["ijin3"] = $pageObject->getViewControl("ijin3")->showDBValue($row, "");
        $values["ijin3no"] = $pageObject->getViewControl("ijin3no")->showDBValue($row, "");
        $values["ijin3tgl"] = $pageObject->getViewControl("ijin3tgl")->showDBValue($row, "");
        $values["ijin3tglakhir"] = $pageObject->getViewControl("ijin3tglakhir")->showDBValue($row, "");
        $values["ijin4"] = $pageObject->getViewControl("ijin4")->showDBValue($row, "");
        $values["ijin4no"] = $pageObject->getViewControl("ijin4no")->showDBValue($row, "");
        $values["ijin4tgl"] = $pageObject->getViewControl("ijin4tgl")->showDBValue($row, "");
        $values["ijin4tglakhir"] = $pageObject->getViewControl("ijin4tglakhir")->showDBValue($row, "");
        $values["enabled"] = $pageObject->getViewControl("enabled")->showDBValue($row, "");
        $values["create_date"] = $pageObject->getViewControl("create_date")->showDBValue($row, "");
        $values["create_uid"] = $pageObject->getViewControl("create_uid")->showDBValue($row, "");
        $values["write_date"] = $pageObject->getViewControl("write_date")->showDBValue($row, "");
        $values["write_uid"] = $pageObject->getViewControl("write_uid")->showDBValue($row, "");
        $values["op_nm"] = $pageObject->getViewControl("op_nm")->showDBValue($row, "");
        $values["op_alamat"] = $pageObject->getViewControl("op_alamat")->showDBValue($row, "");
        $values["op_usaha_id"] = $pageObject->getViewControl("op_usaha_id")->showDBValue($row, "");
        $values["op_so"] = $pageObject->getViewControl("op_so")->showDBValue($row, "");
        $values["op_kecamatan_id"] = $pageObject->getViewControl("op_kecamatan_id")->showDBValue($row, "");
        $values["op_kelurahan_id"] = $pageObject->getViewControl("op_kelurahan_id")->showDBValue($row, "");
        $values["op_latitude"] = $pageObject->getViewControl("op_latitude")->showDBValue($row, "");
        $values["op_longitude"] = $pageObject->getViewControl("op_longitude")->showDBValue($row, "");
        $values["kd_restojmlmeja"] = $pageObject->getViewControl("kd_restojmlmeja")->showDBValue($row, "");
        $values["kd_restojmlkursi"] = $pageObject->getViewControl("kd_restojmlkursi")->showDBValue($row, "");
        $values["kd_restojmltamu"] = $pageObject->getViewControl("kd_restojmltamu")->showDBValue($row, "");
        $values["kd_filmkursi"] = $pageObject->getViewControl("kd_filmkursi")->showDBValue($row, "");
        $values["kd_filmpertunjukan"] = $pageObject->getViewControl("kd_filmpertunjukan")->showDBValue($row, "");
        $values["kd_filmtarif"] = $pageObject->getViewControl("kd_filmtarif")->showDBValue($row, "");
        $values["kd_bilyarmeja"] = $pageObject->getViewControl("kd_bilyarmeja")->showDBValue($row, "");
        $values["kd_bilyartarif"] = $pageObject->getViewControl("kd_bilyartarif")->showDBValue($row, "");
        $values["kd_bilyarkegiatan"] = $pageObject->getViewControl("kd_bilyarkegiatan")->showDBValue($row, "");
        $values["kd_diskopengunjung"] = $pageObject->getViewControl("kd_diskopengunjung")->showDBValue($row, "");
        $values["kd_diskotarif"] = $pageObject->getViewControl("kd_diskotarif")->showDBValue($row, "");
        $values["kd_waletvolume"] = $pageObject->getViewControl("kd_waletvolume")->showDBValue($row, "");
        $values["email"] = $pageObject->getViewControl("email")->showDBValue($row, "");
        $values["op_pajak_id"] = $pageObject->getViewControl("op_pajak_id")->showDBValue($row, "");
        $values["npwpd"] = $pageObject->getViewControl("npwpd")->showDBValue($row, "");
        $values["passwd"] = $pageObject->getViewControl("passwd")->showDBValue($row, "");
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $pageObject);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            echo $values["id"];
            echo '</td>';
            echo '<td>';
            echo $values["rp"];
            echo '</td>';
            echo '<td>';
            echo $values["pb"];
            echo '</td>';
            echo '<td>';
            echo $values["formno"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["reg_date"]);
            } else {
                echo $values["reg_date"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["customernm"]);
            } else {
                echo $values["customernm"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["kecamatan_id"]);
            } else {
                echo $values["kecamatan_id"];
            }
            //echo htmlspecialchars($values["kecamatan_id"]); commented for bug #6823
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["kelurahan_id"]);
            } else {
                echo $values["kelurahan_id"];
            }
            //echo htmlspecialchars($values["kelurahan_id"]); commented for bug #6823
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["kabupaten"]);
            } else {
                echo $values["kabupaten"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["alamat"]);
            } else {
                echo $values["alamat"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["kodepos"]);
            } else {
                echo $values["kodepos"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["telphone"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["wpnama"]);
            } else {
                echo $values["wpnama"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["wpalamat"]);
            } else {
                echo $values["wpalamat"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["wpkelurahan"]);
            } else {
                echo $values["wpkelurahan"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["wpkecamatan"]);
            } else {
                echo $values["wpkecamatan"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["wpkabupaten"]);
            } else {
                echo $values["wpkabupaten"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["wptelp"]);
            } else {
                echo $values["wptelp"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["wpkodepos"]);
            } else {
                echo $values["wpkodepos"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["pnama"]);
            } else {
                echo $values["pnama"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["palamat"]);
            } else {
                echo $values["palamat"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["pkelurahan"]);
            } else {
                echo $values["pkelurahan"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["pkecamatan"]);
            } else {
                echo $values["pkecamatan"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["pkabupaten"]);
            } else {
                echo $values["pkabupaten"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ptelp"]);
            } else {
                echo $values["ptelp"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["pkodepos"]);
            } else {
                echo $values["pkodepos"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin1"]);
            } else {
                echo $values["ijin1"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin1no"]);
            } else {
                echo $values["ijin1no"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin1tgl"]);
            } else {
                echo $values["ijin1tgl"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin1tglakhir"]);
            } else {
                echo $values["ijin1tglakhir"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin2"]);
            } else {
                echo $values["ijin2"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin2no"]);
            } else {
                echo $values["ijin2no"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin2tgl"]);
            } else {
                echo $values["ijin2tgl"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin2tglakhir"]);
            } else {
                echo $values["ijin2tglakhir"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin3"]);
            } else {
                echo $values["ijin3"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin3no"]);
            } else {
                echo $values["ijin3no"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin3tgl"]);
            } else {
                echo $values["ijin3tgl"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin3tglakhir"]);
            } else {
                echo $values["ijin3tglakhir"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin4"]);
            } else {
                echo $values["ijin4"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin4no"]);
            } else {
                echo $values["ijin4no"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin4tgl"]);
            } else {
                echo $values["ijin4tgl"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin4tglakhir"]);
            } else {
                echo $values["ijin4tglakhir"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["enabled"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["create_date"]);
            } else {
                echo $values["create_date"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["create_uid"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["write_date"]);
            } else {
                echo $values["write_date"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["write_uid"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["op_nm"]);
            } else {
                echo $values["op_nm"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["op_alamat"]);
            } else {
                echo $values["op_alamat"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["op_usaha_id"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["op_so"]);
            } else {
                echo $values["op_so"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["op_kecamatan_id"]);
            } else {
                echo $values["op_kecamatan_id"];
            }
            //echo htmlspecialchars($values["op_kecamatan_id"]); commented for bug #6823
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["op_kelurahan_id"]);
            } else {
                echo $values["op_kelurahan_id"];
            }
            //echo htmlspecialchars($values["op_kelurahan_id"]); commented for bug #6823
            echo '</td>';
            echo '<td>';
            echo $values["op_latitude"];
            echo '</td>';
            echo '<td>';
            echo $values["op_longitude"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_restojmlmeja"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_restojmlkursi"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_restojmltamu"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_filmkursi"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_filmpertunjukan"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_filmtarif"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_bilyarmeja"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_bilyartarif"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_bilyarkegiatan"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_diskopengunjung"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_diskotarif"];
            echo '</td>';
            echo '<td>';
            echo $values["kd_waletvolume"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["email"]);
            } else {
                echo $values["email"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["op_pajak_id"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["npwpd"]);
            } else {
                echo $values["npwpd"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["passwd"]);
            } else {
                echo $values["passwd"];
            }
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs, $pageObject);
        } else {
            $row = $cipherer->DecryptFetchedArray($rs);
        }
    }
}
function WriteTableData($cipherer)
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj, $pageObject;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs, $pageObject);
    } else {
        $row = $cipherer->DecryptFetchedArray($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id2") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Nip2") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pejabatnm2") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Jabatan2") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Golongan2") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pangkat2") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tmt2") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Enabled2") . '</td>';
    } else {
        echo "<td>" . "Id2" . "</td>";
        echo "<td>" . "Nip2" . "</td>";
        echo "<td>" . "Pejabatnm2" . "</td>";
        echo "<td>" . "Jabatan2" . "</td>";
        echo "<td>" . "Golongan2" . "</td>";
        echo "<td>" . "Pangkat2" . "</td>";
        echo "<td>" . "Tmt2" . "</td>";
        echo "<td>" . "Enabled2" . "</td>";
    }
    echo "</tr>";
    // write data rows
    $iNumberOfRows = 0;
    $pageObject->viewControls->forExport = "export";
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $values["id2"] = $pageObject->getViewControl("id2")->showDBValue($row, "");
        $values["nip2"] = $pageObject->getViewControl("nip2")->showDBValue($row, "");
        $values["pejabatnm2"] = $pageObject->getViewControl("pejabatnm2")->showDBValue($row, "");
        $values["jabatan2"] = $pageObject->getViewControl("jabatan2")->showDBValue($row, "");
        $values["golongan2"] = $pageObject->getViewControl("golongan2")->showDBValue($row, "");
        $values["pangkat2"] = $pageObject->getViewControl("pangkat2")->showDBValue($row, "");
        $values["tmt2"] = $pageObject->getViewControl("tmt2")->showDBValue($row, "");
        $values["enabled2"] = $pageObject->getViewControl("enabled2")->showDBValue($row, "");
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $pageObject);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            echo $values["id2"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["nip2"]);
            } else {
                echo $values["nip2"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["pejabatnm2"]);
            } else {
                echo $values["pejabatnm2"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["jabatan2"]);
            } else {
                echo $values["jabatan2"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["golongan2"]);
            } else {
                echo $values["golongan2"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["pangkat2"]);
            } else {
                echo $values["pangkat2"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["tmt2"]);
            } else {
                echo $values["tmt2"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["enabled2"];
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs, $pageObject);
        } else {
            $row = $cipherer->DecryptFetchedArray($rs);
        }
    }
}
function WriteTableData($cipherer)
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj, $pageObject;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs, $pageObject);
    } else {
        $row = $cipherer->DecryptFetchedArray($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Parent") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Npwpd") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Rp") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pb") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Formno") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Reg Date") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Nama") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kecamatan Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kelurahan Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kabupaten") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Alamat") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kodepos") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Telphone") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Wpnama") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Wpalamat") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Wpkelurahan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Wpkecamatan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Wpkabupaten") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Wptelp") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Wpkodepos") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pnama") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Palamat") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pkelurahan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pkecamatan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pkabupaten") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ptelp") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pkodepos") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin1") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin1no") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin1tgl") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin1tglakhir") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin2") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin2no") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin2tgl") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin2tglakhir") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin3") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin3no") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin3tgl") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin3tglakhir") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin4") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin4no") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin4tgl") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin4tglakhir") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kukuhno") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kukuhnip") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kukuhtgl") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kukuh Jabat Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kukuhprinted") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Enabled") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Create Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tmt") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Customer Status Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kembalitgl") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kembalioleh") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kartuprinted") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kembalinip") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Penerimanm") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Penerimaalamat") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Penerimatgl") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Catatnip") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kirimtgl") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Batastgl") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Petugas Jabat Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pencatat Jabat Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Created") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Updated") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Update Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Npwpd Old") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id Old") . '</td>';
    } else {
        echo "<td>" . "Id" . "</td>";
        echo "<td>" . "Parent" . "</td>";
        echo "<td>" . "Npwpd" . "</td>";
        echo "<td>" . "Rp" . "</td>";
        echo "<td>" . "Pb" . "</td>";
        echo "<td>" . "Formno" . "</td>";
        echo "<td>" . "Reg Date" . "</td>";
        echo "<td>" . "Nama" . "</td>";
        echo "<td>" . "Kecamatan Id" . "</td>";
        echo "<td>" . "Kelurahan Id" . "</td>";
        echo "<td>" . "Kabupaten" . "</td>";
        echo "<td>" . "Alamat" . "</td>";
        echo "<td>" . "Kodepos" . "</td>";
        echo "<td>" . "Telphone" . "</td>";
        echo "<td>" . "Wpnama" . "</td>";
        echo "<td>" . "Wpalamat" . "</td>";
        echo "<td>" . "Wpkelurahan" . "</td>";
        echo "<td>" . "Wpkecamatan" . "</td>";
        echo "<td>" . "Wpkabupaten" . "</td>";
        echo "<td>" . "Wptelp" . "</td>";
        echo "<td>" . "Wpkodepos" . "</td>";
        echo "<td>" . "Pnama" . "</td>";
        echo "<td>" . "Palamat" . "</td>";
        echo "<td>" . "Pkelurahan" . "</td>";
        echo "<td>" . "Pkecamatan" . "</td>";
        echo "<td>" . "Pkabupaten" . "</td>";
        echo "<td>" . "Ptelp" . "</td>";
        echo "<td>" . "Pkodepos" . "</td>";
        echo "<td>" . "Ijin1" . "</td>";
        echo "<td>" . "Ijin1no" . "</td>";
        echo "<td>" . "Ijin1tgl" . "</td>";
        echo "<td>" . "Ijin1tglakhir" . "</td>";
        echo "<td>" . "Ijin2" . "</td>";
        echo "<td>" . "Ijin2no" . "</td>";
        echo "<td>" . "Ijin2tgl" . "</td>";
        echo "<td>" . "Ijin2tglakhir" . "</td>";
        echo "<td>" . "Ijin3" . "</td>";
        echo "<td>" . "Ijin3no" . "</td>";
        echo "<td>" . "Ijin3tgl" . "</td>";
        echo "<td>" . "Ijin3tglakhir" . "</td>";
        echo "<td>" . "Ijin4" . "</td>";
        echo "<td>" . "Ijin4no" . "</td>";
        echo "<td>" . "Ijin4tgl" . "</td>";
        echo "<td>" . "Ijin4tglakhir" . "</td>";
        echo "<td>" . "Kukuhno" . "</td>";
        echo "<td>" . "Kukuhnip" . "</td>";
        echo "<td>" . "Kukuhtgl" . "</td>";
        echo "<td>" . "Kukuh Jabat Id" . "</td>";
        echo "<td>" . "Kukuhprinted" . "</td>";
        echo "<td>" . "Enabled" . "</td>";
        echo "<td>" . "Create Uid" . "</td>";
        echo "<td>" . "Tmt" . "</td>";
        echo "<td>" . "Customer Status Id" . "</td>";
        echo "<td>" . "Kembalitgl" . "</td>";
        echo "<td>" . "Kembalioleh" . "</td>";
        echo "<td>" . "Kartuprinted" . "</td>";
        echo "<td>" . "Kembalinip" . "</td>";
        echo "<td>" . "Penerimanm" . "</td>";
        echo "<td>" . "Penerimaalamat" . "</td>";
        echo "<td>" . "Penerimatgl" . "</td>";
        echo "<td>" . "Catatnip" . "</td>";
        echo "<td>" . "Kirimtgl" . "</td>";
        echo "<td>" . "Batastgl" . "</td>";
        echo "<td>" . "Petugas Jabat Id" . "</td>";
        echo "<td>" . "Pencatat Jabat Id" . "</td>";
        echo "<td>" . "Created" . "</td>";
        echo "<td>" . "Updated" . "</td>";
        echo "<td>" . "Update Uid" . "</td>";
        echo "<td>" . "Npwpd Old" . "</td>";
        echo "<td>" . "Id Old" . "</td>";
    }
    echo "</tr>";
    // write data rows
    $iNumberOfRows = 0;
    $pageObject->viewControls->forExport = "export";
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $values["id"] = $pageObject->getViewControl("id")->showDBValue($row, "");
        $values["parent"] = $pageObject->getViewControl("parent")->showDBValue($row, "");
        $values["npwpd"] = $pageObject->getViewControl("npwpd")->showDBValue($row, "");
        $values["rp"] = $pageObject->getViewControl("rp")->showDBValue($row, "");
        $values["pb"] = $pageObject->getViewControl("pb")->showDBValue($row, "");
        $values["formno"] = $pageObject->getViewControl("formno")->showDBValue($row, "");
        $values["reg_date"] = $pageObject->getViewControl("reg_date")->showDBValue($row, "");
        $values["nama"] = $pageObject->getViewControl("nama")->showDBValue($row, "");
        $values["kecamatan_id"] = $pageObject->getViewControl("kecamatan_id")->showDBValue($row, "");
        $values["kelurahan_id"] = $pageObject->getViewControl("kelurahan_id")->showDBValue($row, "");
        $values["kabupaten"] = $pageObject->getViewControl("kabupaten")->showDBValue($row, "");
        $values["alamat"] = $pageObject->getViewControl("alamat")->showDBValue($row, "");
        $values["kodepos"] = $pageObject->getViewControl("kodepos")->showDBValue($row, "");
        $values["telphone"] = $pageObject->getViewControl("telphone")->showDBValue($row, "");
        $values["wpnama"] = $pageObject->getViewControl("wpnama")->showDBValue($row, "");
        $values["wpalamat"] = $pageObject->getViewControl("wpalamat")->showDBValue($row, "");
        $values["wpkelurahan"] = $pageObject->getViewControl("wpkelurahan")->showDBValue($row, "");
        $values["wpkecamatan"] = $pageObject->getViewControl("wpkecamatan")->showDBValue($row, "");
        $values["wpkabupaten"] = $pageObject->getViewControl("wpkabupaten")->showDBValue($row, "");
        $values["wptelp"] = $pageObject->getViewControl("wptelp")->showDBValue($row, "");
        $values["wpkodepos"] = $pageObject->getViewControl("wpkodepos")->showDBValue($row, "");
        $values["pnama"] = $pageObject->getViewControl("pnama")->showDBValue($row, "");
        $values["palamat"] = $pageObject->getViewControl("palamat")->showDBValue($row, "");
        $values["pkelurahan"] = $pageObject->getViewControl("pkelurahan")->showDBValue($row, "");
        $values["pkecamatan"] = $pageObject->getViewControl("pkecamatan")->showDBValue($row, "");
        $values["pkabupaten"] = $pageObject->getViewControl("pkabupaten")->showDBValue($row, "");
        $values["ptelp"] = $pageObject->getViewControl("ptelp")->showDBValue($row, "");
        $values["pkodepos"] = $pageObject->getViewControl("pkodepos")->showDBValue($row, "");
        $values["ijin1"] = $pageObject->getViewControl("ijin1")->showDBValue($row, "");
        $values["ijin1no"] = $pageObject->getViewControl("ijin1no")->showDBValue($row, "");
        $values["ijin1tgl"] = $pageObject->getViewControl("ijin1tgl")->showDBValue($row, "");
        $values["ijin1tglakhir"] = $pageObject->getViewControl("ijin1tglakhir")->showDBValue($row, "");
        $values["ijin2"] = $pageObject->getViewControl("ijin2")->showDBValue($row, "");
        $values["ijin2no"] = $pageObject->getViewControl("ijin2no")->showDBValue($row, "");
        $values["ijin2tgl"] = $pageObject->getViewControl("ijin2tgl")->showDBValue($row, "");
        $values["ijin2tglakhir"] = $pageObject->getViewControl("ijin2tglakhir")->showDBValue($row, "");
        $values["ijin3"] = $pageObject->getViewControl("ijin3")->showDBValue($row, "");
        $values["ijin3no"] = $pageObject->getViewControl("ijin3no")->showDBValue($row, "");
        $values["ijin3tgl"] = $pageObject->getViewControl("ijin3tgl")->showDBValue($row, "");
        $values["ijin3tglakhir"] = $pageObject->getViewControl("ijin3tglakhir")->showDBValue($row, "");
        $values["ijin4"] = $pageObject->getViewControl("ijin4")->showDBValue($row, "");
        $values["ijin4no"] = $pageObject->getViewControl("ijin4no")->showDBValue($row, "");
        $values["ijin4tgl"] = $pageObject->getViewControl("ijin4tgl")->showDBValue($row, "");
        $values["ijin4tglakhir"] = $pageObject->getViewControl("ijin4tglakhir")->showDBValue($row, "");
        $values["kukuhno"] = $pageObject->getViewControl("kukuhno")->showDBValue($row, "");
        $values["kukuhnip"] = $pageObject->getViewControl("kukuhnip")->showDBValue($row, "");
        $values["kukuhtgl"] = $pageObject->getViewControl("kukuhtgl")->showDBValue($row, "");
        $values["kukuh_jabat_id"] = $pageObject->getViewControl("kukuh_jabat_id")->showDBValue($row, "");
        $values["kukuhprinted"] = $pageObject->getViewControl("kukuhprinted")->showDBValue($row, "");
        $values["enabled"] = $pageObject->getViewControl("enabled")->showDBValue($row, "");
        $values["create_uid"] = $pageObject->getViewControl("create_uid")->showDBValue($row, "");
        $values["tmt"] = $pageObject->getViewControl("tmt")->showDBValue($row, "");
        $values["customer_status_id"] = $pageObject->getViewControl("customer_status_id")->showDBValue($row, "");
        $values["kembalitgl"] = $pageObject->getViewControl("kembalitgl")->showDBValue($row, "");
        $values["kembalioleh"] = $pageObject->getViewControl("kembalioleh")->showDBValue($row, "");
        $values["kartuprinted"] = $pageObject->getViewControl("kartuprinted")->showDBValue($row, "");
        $values["kembalinip"] = $pageObject->getViewControl("kembalinip")->showDBValue($row, "");
        $values["penerimanm"] = $pageObject->getViewControl("penerimanm")->showDBValue($row, "");
        $values["penerimaalamat"] = $pageObject->getViewControl("penerimaalamat")->showDBValue($row, "");
        $values["penerimatgl"] = $pageObject->getViewControl("penerimatgl")->showDBValue($row, "");
        $values["catatnip"] = $pageObject->getViewControl("catatnip")->showDBValue($row, "");
        $values["kirimtgl"] = $pageObject->getViewControl("kirimtgl")->showDBValue($row, "");
        $values["batastgl"] = $pageObject->getViewControl("batastgl")->showDBValue($row, "");
        $values["petugas_jabat_id"] = $pageObject->getViewControl("petugas_jabat_id")->showDBValue($row, "");
        $values["pencatat_jabat_id"] = $pageObject->getViewControl("pencatat_jabat_id")->showDBValue($row, "");
        $values["created"] = $pageObject->getViewControl("created")->showDBValue($row, "");
        $values["updated"] = $pageObject->getViewControl("updated")->showDBValue($row, "");
        $values["update_uid"] = $pageObject->getViewControl("update_uid")->showDBValue($row, "");
        $values["npwpd_old"] = $pageObject->getViewControl("npwpd_old")->showDBValue($row, "");
        $values["id_old"] = $pageObject->getViewControl("id_old")->showDBValue($row, "");
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $pageObject);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            echo $values["id"];
            echo '</td>';
            echo '<td>';
            echo $values["parent"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["npwpd"]);
            } else {
                echo $values["npwpd"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["rp"];
            echo '</td>';
            echo '<td>';
            echo $values["pb"];
            echo '</td>';
            echo '<td>';
            echo $values["formno"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["reg_date"]);
            } else {
                echo $values["reg_date"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["nama"]);
            } else {
                echo $values["nama"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["kecamatan_id"]);
            } else {
                echo $values["kecamatan_id"];
            }
            //echo htmlspecialchars($values["kecamatan_id"]); commented for bug #6823
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["kelurahan_id"]);
            } else {
                echo $values["kelurahan_id"];
            }
            //echo htmlspecialchars($values["kelurahan_id"]); commented for bug #6823
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["kabupaten"]);
            } else {
                echo $values["kabupaten"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["alamat"]);
            } else {
                echo $values["alamat"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["kodepos"]);
            } else {
                echo $values["kodepos"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["telphone"]);
            } else {
                echo $values["telphone"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["wpnama"]);
            } else {
                echo $values["wpnama"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["wpalamat"]);
            } else {
                echo $values["wpalamat"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["wpkelurahan"]);
            } else {
                echo $values["wpkelurahan"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["wpkecamatan"]);
            } else {
                echo $values["wpkecamatan"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["wpkabupaten"]);
            } else {
                echo $values["wpkabupaten"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["wptelp"]);
            } else {
                echo $values["wptelp"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["wpkodepos"]);
            } else {
                echo $values["wpkodepos"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["pnama"]);
            } else {
                echo $values["pnama"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["palamat"]);
            } else {
                echo $values["palamat"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["pkelurahan"]);
            } else {
                echo $values["pkelurahan"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["pkecamatan"]);
            } else {
                echo $values["pkecamatan"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["pkabupaten"]);
            } else {
                echo $values["pkabupaten"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ptelp"]);
            } else {
                echo $values["ptelp"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["pkodepos"]);
            } else {
                echo $values["pkodepos"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin1"]);
            } else {
                echo $values["ijin1"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin1no"]);
            } else {
                echo $values["ijin1no"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin1tgl"]);
            } else {
                echo $values["ijin1tgl"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin1tglakhir"]);
            } else {
                echo $values["ijin1tglakhir"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin2"]);
            } else {
                echo $values["ijin2"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin2no"]);
            } else {
                echo $values["ijin2no"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin2tgl"]);
            } else {
                echo $values["ijin2tgl"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin2tglakhir"]);
            } else {
                echo $values["ijin2tglakhir"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin3"]);
            } else {
                echo $values["ijin3"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin3no"]);
            } else {
                echo $values["ijin3no"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin3tgl"]);
            } else {
                echo $values["ijin3tgl"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin3tglakhir"]);
            } else {
                echo $values["ijin3tglakhir"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin4"]);
            } else {
                echo $values["ijin4"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin4no"]);
            } else {
                echo $values["ijin4no"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin4tgl"]);
            } else {
                echo $values["ijin4tgl"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin4tglakhir"]);
            } else {
                echo $values["ijin4tglakhir"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["kukuhno"];
            echo '</td>';
            echo '<td>';
            echo $values["kukuhnip"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["kukuhtgl"]);
            } else {
                echo $values["kukuhtgl"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["kukuh_jabat_id"];
            echo '</td>';
            echo '<td>';
            echo $values["kukuhprinted"];
            echo '</td>';
            echo '<td>';
            echo $values["enabled"];
            echo '</td>';
            echo '<td>';
            echo $values["create_uid"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["tmt"]);
            } else {
                echo $values["tmt"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["customer_status_id"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["kembalitgl"]);
            } else {
                echo $values["kembalitgl"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["kembalioleh"];
            echo '</td>';
            echo '<td>';
            echo $values["kartuprinted"];
            echo '</td>';
            echo '<td>';
            echo $values["kembalinip"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["penerimanm"]);
            } else {
                echo $values["penerimanm"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["penerimaalamat"]);
            } else {
                echo $values["penerimaalamat"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["penerimatgl"]);
            } else {
                echo $values["penerimatgl"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["catatnip"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["kirimtgl"]);
            } else {
                echo $values["kirimtgl"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["batastgl"]);
            } else {
                echo $values["batastgl"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["petugas_jabat_id"];
            echo '</td>';
            echo '<td>';
            echo $values["pencatat_jabat_id"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["created"]);
            } else {
                echo $values["created"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["updated"]);
            } else {
                echo $values["updated"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["update_uid"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["npwpd_old"]);
            } else {
                echo $values["npwpd_old"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["id_old"];
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs, $pageObject);
        } else {
            $row = $cipherer->DecryptFetchedArray($rs);
        }
    }
}
function WriteTableData()
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs);
    } else {
        $row = db_fetch_array($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Month_Billings", "Bill_ID")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Month_Billings", "Customer_ID")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Month_Billings", "Bill_Month")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Month_Billings", "Previous_Readings")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Month_Billings", "Currunt_Readings")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Month_Billings", "Unit_Consumed")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Month_Billings", "Bill_Amount")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Month_Billings", "Due_Date")) . '</td>';
    } else {
        echo "<td>" . GetFieldLabel("dbo_Month_Billings", "Bill_ID") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Month_Billings", "Customer_ID") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Month_Billings", "Bill_Month") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Month_Billings", "Previous_Readings") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Month_Billings", "Currunt_Readings") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Month_Billings", "Unit_Consumed") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Month_Billings", "Bill_Amount") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Month_Billings", "Due_Date") . "</td>";
    }
    echo "</tr>";
    $totals["Bill ID"] = 0;
    $totalsFields[] = array('fName' => "Bill ID", 'totalsType' => '', 'viewFormat' => "");
    $totals["Customer ID"] = 0;
    $totalsFields[] = array('fName' => "Customer ID", 'totalsType' => '', 'viewFormat' => "");
    $totals["Bill Month"] = 0;
    $totalsFields[] = array('fName' => "Bill Month", 'totalsType' => '', 'viewFormat' => "");
    $totals["Previous Readings"] = 0;
    $totalsFields[] = array('fName' => "Previous Readings", 'totalsType' => '', 'viewFormat' => "");
    $totals["Currunt Readings"] = 0;
    $totalsFields[] = array('fName' => "Currunt Readings", 'totalsType' => '', 'viewFormat' => "");
    $totals["Unit Consumed"] = 0;
    $totalsFields[] = array('fName' => "Unit Consumed", 'totalsType' => '', 'viewFormat' => "");
    $totals["Bill Amount"] = 0;
    $totalsFields[] = array('fName' => "Bill Amount", 'totalsType' => '', 'viewFormat' => "");
    $totals["Due Date"] = 0;
    $totalsFields[] = array('fName' => "Due Date", 'totalsType' => '', 'viewFormat' => "");
    $totals = array();
    // write data rows
    $iNumberOfRows = 0;
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $format = "";
        $values["Bill ID"] = GetData($row, "Bill ID", $format);
        $format = "";
        $values["Customer ID"] = GetData($row, "Customer ID", $format);
        $format = "";
        $values["Bill Month"] = GetData($row, "Bill Month", $format);
        $format = "";
        $values["Previous Readings"] = GetData($row, "Previous Readings", $format);
        $format = "";
        $values["Currunt Readings"] = GetData($row, "Currunt Readings", $format);
        $format = "";
        $values["Unit Consumed"] = GetData($row, "Unit Consumed", $format);
        $format = "";
        $values["Bill Amount"] = GetData($row, "Bill Amount", $format);
        $format = "";
        $values["Due Date"] = GetData($row, "Due Date", $format);
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            $format = "";
            echo htmlspecialchars($values["Bill ID"]);
            echo '</td>';
            echo '<td>';
            $format = "";
            echo htmlspecialchars($values["Customer ID"]);
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            $format = "";
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["Bill Month"]);
            } else {
                echo htmlspecialchars($values["Bill Month"]);
            }
            echo '</td>';
            echo '<td>';
            $format = "";
            echo htmlspecialchars($values["Previous Readings"]);
            echo '</td>';
            echo '<td>';
            $format = "";
            echo htmlspecialchars($values["Currunt Readings"]);
            echo '</td>';
            echo '<td>';
            $format = "";
            echo htmlspecialchars($values["Unit Consumed"]);
            echo '</td>';
            echo '<td>';
            $format = "";
            echo htmlspecialchars($values["Bill Amount"]);
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            $format = "";
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["Due Date"]);
            } else {
                echo htmlspecialchars($values["Due Date"]);
            }
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs);
        } else {
            $row = db_fetch_array($rs);
        }
    }
}
Esempio n. 11
0
function WriteTableData($cipherer)
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj, $pageObject;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs, $pageObject);
    } else {
        $row = $cipherer->DecryptFetchedArray($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Rekening Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Status Anggaran") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Target") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bulan1") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bulan2") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bulan3") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bulan4") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bulan5") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bulan6") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bulan7") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bulan8") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bulan9") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bulan10") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bulan11") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bulan12") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Jumlah") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Created") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Updated") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Create Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Update Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tahun") . '</td>';
    } else {
        echo "<td>" . "Id" . "</td>";
        echo "<td>" . "Rekening Id" . "</td>";
        echo "<td>" . "Status Anggaran" . "</td>";
        echo "<td>" . "Target" . "</td>";
        echo "<td>" . "Bulan1" . "</td>";
        echo "<td>" . "Bulan2" . "</td>";
        echo "<td>" . "Bulan3" . "</td>";
        echo "<td>" . "Bulan4" . "</td>";
        echo "<td>" . "Bulan5" . "</td>";
        echo "<td>" . "Bulan6" . "</td>";
        echo "<td>" . "Bulan7" . "</td>";
        echo "<td>" . "Bulan8" . "</td>";
        echo "<td>" . "Bulan9" . "</td>";
        echo "<td>" . "Bulan10" . "</td>";
        echo "<td>" . "Bulan11" . "</td>";
        echo "<td>" . "Bulan12" . "</td>";
        echo "<td>" . "Jumlah" . "</td>";
        echo "<td>" . "Created" . "</td>";
        echo "<td>" . "Updated" . "</td>";
        echo "<td>" . "Create Uid" . "</td>";
        echo "<td>" . "Update Uid" . "</td>";
        echo "<td>" . "Tahun" . "</td>";
    }
    echo "</tr>";
    // write data rows
    $iNumberOfRows = 0;
    $pageObject->viewControls->forExport = "export";
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $values["id"] = $pageObject->getViewControl("id")->showDBValue($row, "");
        $values["rekening_id"] = $pageObject->getViewControl("rekening_id")->showDBValue($row, "");
        $values["status_anggaran"] = $pageObject->getViewControl("status_anggaran")->showDBValue($row, "");
        $values["target"] = $pageObject->getViewControl("target")->showDBValue($row, "");
        $values["bulan1"] = $pageObject->getViewControl("bulan1")->showDBValue($row, "");
        $values["bulan2"] = $pageObject->getViewControl("bulan2")->showDBValue($row, "");
        $values["bulan3"] = $pageObject->getViewControl("bulan3")->showDBValue($row, "");
        $values["bulan4"] = $pageObject->getViewControl("bulan4")->showDBValue($row, "");
        $values["bulan5"] = $pageObject->getViewControl("bulan5")->showDBValue($row, "");
        $values["bulan6"] = $pageObject->getViewControl("bulan6")->showDBValue($row, "");
        $values["bulan7"] = $pageObject->getViewControl("bulan7")->showDBValue($row, "");
        $values["bulan8"] = $pageObject->getViewControl("bulan8")->showDBValue($row, "");
        $values["bulan9"] = $pageObject->getViewControl("bulan9")->showDBValue($row, "");
        $values["bulan10"] = $pageObject->getViewControl("bulan10")->showDBValue($row, "");
        $values["bulan11"] = $pageObject->getViewControl("bulan11")->showDBValue($row, "");
        $values["bulan12"] = $pageObject->getViewControl("bulan12")->showDBValue($row, "");
        $values["jumlah"] = $pageObject->getViewControl("jumlah")->showDBValue($row, "");
        $values["created"] = $pageObject->getViewControl("created")->showDBValue($row, "");
        $values["updated"] = $pageObject->getViewControl("updated")->showDBValue($row, "");
        $values["create_uid"] = $pageObject->getViewControl("create_uid")->showDBValue($row, "");
        $values["update_uid"] = $pageObject->getViewControl("update_uid")->showDBValue($row, "");
        $values["tahun"] = $pageObject->getViewControl("tahun")->showDBValue($row, "");
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $pageObject);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            echo $values["id"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["rekening_id"]);
            } else {
                echo $values["rekening_id"];
            }
            //echo htmlspecialchars($values["rekening_id"]); commented for bug #6823
            echo '</td>';
            echo '<td>';
            echo $values["status_anggaran"];
            echo '</td>';
            echo '<td>';
            echo $values["target"];
            echo '</td>';
            echo '<td>';
            echo $values["bulan1"];
            echo '</td>';
            echo '<td>';
            echo $values["bulan2"];
            echo '</td>';
            echo '<td>';
            echo $values["bulan3"];
            echo '</td>';
            echo '<td>';
            echo $values["bulan4"];
            echo '</td>';
            echo '<td>';
            echo $values["bulan5"];
            echo '</td>';
            echo '<td>';
            echo $values["bulan6"];
            echo '</td>';
            echo '<td>';
            echo $values["bulan7"];
            echo '</td>';
            echo '<td>';
            echo $values["bulan8"];
            echo '</td>';
            echo '<td>';
            echo $values["bulan9"];
            echo '</td>';
            echo '<td>';
            echo $values["bulan10"];
            echo '</td>';
            echo '<td>';
            echo $values["bulan11"];
            echo '</td>';
            echo '<td>';
            echo $values["bulan12"];
            echo '</td>';
            echo '<td>';
            echo $values["jumlah"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["created"]);
            } else {
                echo $values["created"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["updated"]);
            } else {
                echo $values["updated"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["create_uid"];
            echo '</td>';
            echo '<td>';
            echo $values["update_uid"];
            echo '</td>';
            echo '<td>';
            echo $values["tahun"];
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs, $pageObject);
        } else {
            $row = $cipherer->DecryptFetchedArray($rs);
        }
    }
}
function WriteTableData()
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs);
    } else {
        $row = db_fetch_array($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Readings", "Record_ID")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Readings", "Module_ID")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Readings", "Voltage_Red")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Readings", "Voltage_Blue")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Readings", "Voltage_Yellow")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Readings", "Currunt_Red")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Readings", "Currunt_Blue")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Readings", "Currunt_Yellow")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Readings", "PF_Red")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Readings", "PF_Blue")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Readings", "PF_Yellow")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Readings", "Peak_Power")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Readings", "Date_Time")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Readings", "IsSync")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_Readings", "Currunt_Readings")) . '</td>';
    } else {
        echo "<td>" . GetFieldLabel("dbo_Readings", "Record_ID") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Readings", "Module_ID") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Readings", "Voltage_Red") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Readings", "Voltage_Blue") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Readings", "Voltage_Yellow") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Readings", "Currunt_Red") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Readings", "Currunt_Blue") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Readings", "Currunt_Yellow") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Readings", "PF_Red") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Readings", "PF_Blue") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Readings", "PF_Yellow") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Readings", "Peak_Power") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Readings", "Date_Time") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Readings", "IsSync") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_Readings", "Currunt_Readings") . "</td>";
    }
    echo "</tr>";
    $totals["Record ID"] = 0;
    $totalsFields[] = array('fName' => "Record ID", 'totalsType' => '', 'viewFormat' => "");
    $totals["Module ID"] = 0;
    $totalsFields[] = array('fName' => "Module ID", 'totalsType' => '', 'viewFormat' => "");
    $totals["Voltage Red"] = 0;
    $totalsFields[] = array('fName' => "Voltage Red", 'totalsType' => '', 'viewFormat' => "");
    $totals["Voltage Blue"] = 0;
    $totalsFields[] = array('fName' => "Voltage Blue", 'totalsType' => '', 'viewFormat' => "");
    $totals["Voltage Yellow"] = 0;
    $totalsFields[] = array('fName' => "Voltage Yellow", 'totalsType' => '', 'viewFormat' => "");
    $totals["Currunt Red"] = 0;
    $totalsFields[] = array('fName' => "Currunt Red", 'totalsType' => '', 'viewFormat' => "");
    $totals["Currunt Blue"] = 0;
    $totalsFields[] = array('fName' => "Currunt Blue", 'totalsType' => '', 'viewFormat' => "");
    $totals["Currunt Yellow"] = 0;
    $totalsFields[] = array('fName' => "Currunt Yellow", 'totalsType' => '', 'viewFormat' => "");
    $totals["PF Red"] = 0;
    $totalsFields[] = array('fName' => "PF Red", 'totalsType' => '', 'viewFormat' => "");
    $totals["PF Blue"] = 0;
    $totalsFields[] = array('fName' => "PF Blue", 'totalsType' => '', 'viewFormat' => "");
    $totals["PF Yellow"] = 0;
    $totalsFields[] = array('fName' => "PF Yellow", 'totalsType' => '', 'viewFormat' => "");
    $totals["Peak Power"] = 0;
    $totalsFields[] = array('fName' => "Peak Power", 'totalsType' => '', 'viewFormat' => "");
    $totals["Date Time"] = 0;
    $totalsFields[] = array('fName' => "Date Time", 'totalsType' => '', 'viewFormat' => "Short Date");
    $totals["IsSync"] = 0;
    $totalsFields[] = array('fName' => "IsSync", 'totalsType' => '', 'viewFormat' => "Checkbox");
    $totals["Currunt Readings"] = 0;
    $totalsFields[] = array('fName' => "Currunt Readings", 'totalsType' => '', 'viewFormat' => "");
    $totals = array();
    // write data rows
    $iNumberOfRows = 0;
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $format = "";
        $values["Record ID"] = GetData($row, "Record ID", $format);
        $values["Module ID"] = "";
        if (strlen($row["Module ID"])) {
            $values["Module ID"] = DisplayLookupWizard("Module ID", $row["Module ID"], $row, "", MODE_EXPORT);
        }
        $format = "";
        $values["Voltage Red"] = GetData($row, "Voltage Red", $format);
        $format = "";
        $values["Voltage Blue"] = GetData($row, "Voltage Blue", $format);
        $format = "";
        $values["Voltage Yellow"] = GetData($row, "Voltage Yellow", $format);
        $format = "";
        $values["Currunt Red"] = GetData($row, "Currunt Red", $format);
        $format = "";
        $values["Currunt Blue"] = GetData($row, "Currunt Blue", $format);
        $format = "";
        $values["Currunt Yellow"] = GetData($row, "Currunt Yellow", $format);
        $format = "";
        $values["PF Red"] = GetData($row, "PF Red", $format);
        $format = "";
        $values["PF Blue"] = GetData($row, "PF Blue", $format);
        $format = "";
        $values["PF Yellow"] = GetData($row, "PF Yellow", $format);
        $format = "";
        $values["Peak Power"] = GetData($row, "Peak Power", $format);
        $format = "Short Date";
        $values["Date Time"] = GetData($row, "Date Time", $format);
        $format = FORMAT_NONE;
        $values["IsSync"] = GetData($row, "IsSync", $format);
        $format = "";
        $values["Currunt Readings"] = GetData($row, "Currunt Readings", $format);
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            $format = "";
            echo htmlspecialchars($values["Record ID"]);
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["Module ID"]);
            } else {
                echo htmlspecialchars($values["Module ID"]);
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            $format = "";
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["Voltage Red"]);
            } else {
                echo htmlspecialchars($values["Voltage Red"]);
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            $format = "";
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["Voltage Blue"]);
            } else {
                echo htmlspecialchars($values["Voltage Blue"]);
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            $format = "";
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["Voltage Yellow"]);
            } else {
                echo htmlspecialchars($values["Voltage Yellow"]);
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            $format = "";
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["Currunt Red"]);
            } else {
                echo htmlspecialchars($values["Currunt Red"]);
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            $format = "";
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["Currunt Blue"]);
            } else {
                echo htmlspecialchars($values["Currunt Blue"]);
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            $format = "";
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["Currunt Yellow"]);
            } else {
                echo htmlspecialchars($values["Currunt Yellow"]);
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            $format = "";
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["PF Red"]);
            } else {
                echo htmlspecialchars($values["PF Red"]);
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            $format = "";
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["PF Blue"]);
            } else {
                echo htmlspecialchars($values["PF Blue"]);
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            $format = "";
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["PF Yellow"]);
            } else {
                echo htmlspecialchars($values["PF Yellow"]);
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            $format = "";
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["Peak Power"]);
            } else {
                echo htmlspecialchars($values["Peak Power"]);
            }
            echo '</td>';
            echo '<td>';
            $format = "Short Date";
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["Date Time"]);
            } else {
                echo htmlspecialchars($values["Date Time"]);
            }
            echo '</td>';
            echo '<td>';
            $format = FORMAT_NONE;
            echo htmlspecialchars($values["IsSync"]);
            echo '</td>';
            echo '<td>';
            $format = "";
            echo htmlspecialchars($values["Currunt Readings"]);
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs);
        } else {
            $row = db_fetch_array($rs);
        }
    }
}
Esempio n. 13
0
function WriteTableData($cipherer)
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj, $pageObject;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs, $pageObject);
    } else {
        $row = $cipherer->DecryptFetchedArray($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Spt Type Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Usaha Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Sptnm") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Sknm") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Nhnm") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Sspdnm") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Stpnm") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kartudtnm") . '</td>';
    } else {
        echo "<td>" . "Id" . "</td>";
        echo "<td>" . "Spt Type Id" . "</td>";
        echo "<td>" . "Usaha Id" . "</td>";
        echo "<td>" . "Sptnm" . "</td>";
        echo "<td>" . "Sknm" . "</td>";
        echo "<td>" . "Nhnm" . "</td>";
        echo "<td>" . "Sspdnm" . "</td>";
        echo "<td>" . "Stpnm" . "</td>";
        echo "<td>" . "Kartudtnm" . "</td>";
    }
    echo "</tr>";
    // write data rows
    $iNumberOfRows = 0;
    $pageObject->viewControls->forExport = "export";
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $values["id"] = $pageObject->getViewControl("id")->showDBValue($row, "");
        $values["spt_type_id"] = $pageObject->getViewControl("spt_type_id")->showDBValue($row, "");
        $values["usaha_id"] = $pageObject->getViewControl("usaha_id")->showDBValue($row, "");
        $values["sptnm"] = $pageObject->getViewControl("sptnm")->showDBValue($row, "");
        $values["sknm"] = $pageObject->getViewControl("sknm")->showDBValue($row, "");
        $values["nhnm"] = $pageObject->getViewControl("nhnm")->showDBValue($row, "");
        $values["sspdnm"] = $pageObject->getViewControl("sspdnm")->showDBValue($row, "");
        $values["stpnm"] = $pageObject->getViewControl("stpnm")->showDBValue($row, "");
        $values["kartudtnm"] = $pageObject->getViewControl("kartudtnm")->showDBValue($row, "");
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $pageObject);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            echo $values["id"];
            echo '</td>';
            echo '<td>';
            echo $values["spt_type_id"];
            echo '</td>';
            echo '<td>';
            echo $values["usaha_id"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["sptnm"]);
            } else {
                echo $values["sptnm"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["sknm"]);
            } else {
                echo $values["sknm"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["nhnm"]);
            } else {
                echo $values["nhnm"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["sspdnm"]);
            } else {
                echo $values["sspdnm"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["stpnm"]);
            } else {
                echo $values["stpnm"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["kartudtnm"]);
            } else {
                echo $values["kartudtnm"];
            }
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs, $pageObject);
        } else {
            $row = $cipherer->DecryptFetchedArray($rs);
        }
    }
}
Esempio n. 14
0
 /**
  * @param Mixed rs
  * @param Number nPageSize
  */
 protected function WriteTableData($rs, $nPageSize)
 {
     $exportFields = $this->pSet->getExportFields();
     $totalFieldsData = $this->pSet->getTotalsFields();
     if ($this->eventsObject->exists("ListFetchArray")) {
         $row = $this->eventsObject->ListFetchArray($rs, $this);
     } else {
         $row = $this->cipherer->DecryptFetchedArray($this->connection->fetch_array($rs));
     }
     // write header
     echo "<tr>";
     if ($_REQUEST["type"] == "excel") {
         foreach ($exportFields as $field) {
             echo '<td style="width: 100" x:str>' . PrepareForExcel($this->pSet->label($field)) . '</td>';
         }
     } else {
         foreach ($exportFields as $field) {
             echo "<td>" . $this->pSet->label($field) . "</td>";
         }
     }
     echo "</tr>";
     $totals = array();
     $totalsFields = array();
     foreach ($totalFieldsData as $data) {
         if (!in_array($data["fName"], $exportFields)) {
             continue;
         }
         $totals[$data["fName"]] = array("value" => 0, "numRows" => 0);
         $totalsFields[] = array('fName' => $data["fName"], 'totalsType' => $data["totalsType"], 'viewFormat' => $this->pSet->getViewFormat($data["fName"]));
     }
     // write data rows
     $iNumberOfRows = 0;
     $this->viewControls->forExport = "export";
     while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
         countTotals($totals, $totalsFields, $row);
         $values = array();
         foreach ($exportFields as $field) {
             $fType = $this->pSet->getFieldType($field);
             if (IsBinaryType($fType)) {
                 $values[$field] = "código binario demasiado grande – no puede ser desplegado";
             } else {
                 $values[$field] = $this->getViewControl($field)->getExportValue($row, "");
             }
         }
         $eventRes = true;
         if ($this->eventsObject->exists('BeforeOut')) {
             $eventRes = $this->eventsObject->BeforeOut($row, $values, $this);
         }
         if ($eventRes) {
             $iNumberOfRows++;
             echo "<tr>";
             foreach ($exportFields as $field) {
                 $fType = $this->pSet->getFieldType($field);
                 if (IsCharType($fType)) {
                     if ($_REQUEST["type"] == "excel") {
                         echo '<td x:str>';
                     } else {
                         echo '<td>';
                     }
                 } else {
                     echo '<td>';
                 }
                 $editFormat = $this->pSet->getEditFormat($field);
                 if ($editFormat == EDIT_FORMAT_LOOKUP_WIZARD) {
                     if ($this->pSet->NeedEncode($field)) {
                         if ($_REQUEST["type"] == "excel") {
                             echo PrepareForExcel($values[$field]);
                         } else {
                             echo $values[$field];
                         }
                     } else {
                         echo $values[$field];
                     }
                 } elseif (IsBinaryType($fType)) {
                     echo $values[$field];
                 } else {
                     if ($editFormat == FORMAT_CUSTOM || $this->pSet->isUseRTE($field)) {
                         echo $values[$field];
                     } elseif (NeedQuotes($field)) {
                         if ($_REQUEST["type"] == "excel") {
                             echo PrepareForExcel($values[$field]);
                         } else {
                             echo $values[$field];
                         }
                     } else {
                         echo $values[$field];
                     }
                 }
                 echo '</td>';
             }
             echo "</tr>";
         }
         if ($this->eventsObject->exists("ListFetchArray")) {
             $row = $this->eventsObject->ListFetchArray($rs, $this);
         } else {
             $row = $this->cipherer->DecryptFetchedArray($this->connection->fetch_array($rs));
         }
     }
     if (count($totalFieldsData)) {
         echo "<tr>";
         foreach ($totalFieldsData as $data) {
             if (!in_array($data["fName"], $exportFields)) {
                 continue;
             }
             echo "<td>";
             if (strlen($data["totalsType"])) {
                 if ($data["totalsType"] == "COUNT") {
                     echo "Contar" . ": ";
                 } elseif ($data["totalsType"] == "TOTAL") {
                     echo "Total" . ": ";
                 } elseif ($data["totalsType"] == "AVERAGE") {
                     echo "Promedio" . ": ";
                 }
                 echo runner_htmlspecialchars(GetTotals($data["fName"], $totals[$data["fName"]]["value"], $data["totalsType"], $totals[$data["fName"]]["numRows"], $this->pSet->getViewFormat($data["fName"]), PAGE_EXPORT));
             }
             echo "</td>";
         }
         echo "</tr>";
     }
 }
Esempio n. 15
0
function WriteTableData($cipherer)
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj, $pageObject;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs, $pageObject);
    } else {
        $row = $cipherer->DecryptFetchedArray($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Nama Wp") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Alamat Wp") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Npwpd") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bayar") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Periode 1") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Periode 2") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Keterangan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Spt Id Old") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Judul") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Lokasi") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("J") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("P") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("L") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("T") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Sspd Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tanggal") . '</td>';
    } else {
        echo "<td>" . "Id" . "</td>";
        echo "<td>" . "Nama Wp" . "</td>";
        echo "<td>" . "Alamat Wp" . "</td>";
        echo "<td>" . "Npwpd" . "</td>";
        echo "<td>" . "Bayar" . "</td>";
        echo "<td>" . "Periode 1" . "</td>";
        echo "<td>" . "Periode 2" . "</td>";
        echo "<td>" . "Keterangan" . "</td>";
        echo "<td>" . "Spt Id Old" . "</td>";
        echo "<td>" . "Judul" . "</td>";
        echo "<td>" . "Lokasi" . "</td>";
        echo "<td>" . "J" . "</td>";
        echo "<td>" . "P" . "</td>";
        echo "<td>" . "L" . "</td>";
        echo "<td>" . "T" . "</td>";
        echo "<td>" . "Sspd Id" . "</td>";
        echo "<td>" . "Tanggal" . "</td>";
    }
    echo "</tr>";
    // write data rows
    $iNumberOfRows = 0;
    $pageObject->viewControls->forExport = "export";
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $values["id"] = $pageObject->getViewControl("id")->showDBValue($row, "");
        $values["nama_wp"] = $pageObject->getViewControl("nama_wp")->showDBValue($row, "");
        $values["alamat_wp"] = $pageObject->getViewControl("alamat_wp")->showDBValue($row, "");
        $values["npwpd"] = $pageObject->getViewControl("npwpd")->showDBValue($row, "");
        $values["bayar"] = $pageObject->getViewControl("bayar")->showDBValue($row, "");
        $values["periode_1"] = $pageObject->getViewControl("periode_1")->showDBValue($row, "");
        $values["periode_2"] = $pageObject->getViewControl("periode_2")->showDBValue($row, "");
        $values["keterangan"] = $pageObject->getViewControl("keterangan")->showDBValue($row, "");
        $values["spt_id_old"] = $pageObject->getViewControl("spt_id_old")->showDBValue($row, "");
        $values["judul"] = $pageObject->getViewControl("judul")->showDBValue($row, "");
        $values["lokasi"] = $pageObject->getViewControl("lokasi")->showDBValue($row, "");
        $values["j"] = $pageObject->getViewControl("j")->showDBValue($row, "");
        $values["p"] = $pageObject->getViewControl("p")->showDBValue($row, "");
        $values["l"] = $pageObject->getViewControl("l")->showDBValue($row, "");
        $values["t"] = $pageObject->getViewControl("t")->showDBValue($row, "");
        $values["sspd_id"] = $pageObject->getViewControl("sspd_id")->showDBValue($row, "");
        $values["tanggal"] = $pageObject->getViewControl("tanggal")->showDBValue($row, "");
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $pageObject);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            echo $values["id"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["nama_wp"]);
            } else {
                echo $values["nama_wp"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["alamat_wp"]);
            } else {
                echo $values["alamat_wp"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["npwpd"]);
            } else {
                echo $values["npwpd"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["bayar"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["periode_1"]);
            } else {
                echo $values["periode_1"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["periode_2"]);
            } else {
                echo $values["periode_2"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["keterangan"]);
            } else {
                echo $values["keterangan"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["spt_id_old"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["judul"]);
            } else {
                echo $values["judul"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["lokasi"]);
            } else {
                echo $values["lokasi"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["j"];
            echo '</td>';
            echo '<td>';
            echo $values["p"];
            echo '</td>';
            echo '<td>';
            echo $values["l"];
            echo '</td>';
            echo '<td>';
            echo $values["t"];
            echo '</td>';
            echo '<td>';
            echo $values["sspd_id"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["tanggal"]);
            } else {
                echo $values["tanggal"];
            }
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs, $pageObject);
        } else {
            $row = $cipherer->DecryptFetchedArray($rs);
        }
    }
}
function WriteTableData($cipherer)
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj, $pageObject;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs, $pageObject);
    } else {
        $row = $cipherer->DecryptFetchedArray($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Invoice Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tgl") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tagihan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Denda") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Total Bayar") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Iso Request") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Transmission") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Settlement") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Stan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ntb") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ntp") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bank Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Channel Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bank Ip") . '</td>';
    } else {
        echo "<td>" . "Id" . "</td>";
        echo "<td>" . "Invoice Id" . "</td>";
        echo "<td>" . "Tgl" . "</td>";
        echo "<td>" . "Tagihan" . "</td>";
        echo "<td>" . "Denda" . "</td>";
        echo "<td>" . "Total Bayar" . "</td>";
        echo "<td>" . "Iso Request" . "</td>";
        echo "<td>" . "Transmission" . "</td>";
        echo "<td>" . "Settlement" . "</td>";
        echo "<td>" . "Stan" . "</td>";
        echo "<td>" . "Ntb" . "</td>";
        echo "<td>" . "Ntp" . "</td>";
        echo "<td>" . "Bank Id" . "</td>";
        echo "<td>" . "Channel Id" . "</td>";
        echo "<td>" . "Bank Ip" . "</td>";
    }
    echo "</tr>";
    // write data rows
    $iNumberOfRows = 0;
    $pageObject->viewControls->forExport = "export";
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $values["id"] = $pageObject->getViewControl("id")->showDBValue($row, "");
        $values["invoice_id"] = $pageObject->getViewControl("invoice_id")->showDBValue($row, "");
        $values["tgl"] = $pageObject->getViewControl("tgl")->showDBValue($row, "");
        $values["tagihan"] = $pageObject->getViewControl("tagihan")->showDBValue($row, "");
        $values["denda"] = $pageObject->getViewControl("denda")->showDBValue($row, "");
        $values["total_bayar"] = $pageObject->getViewControl("total_bayar")->showDBValue($row, "");
        $values["iso_request"] = $pageObject->getViewControl("iso_request")->showDBValue($row, "");
        $values["transmission"] = $pageObject->getViewControl("transmission")->showDBValue($row, "");
        $values["settlement"] = $pageObject->getViewControl("settlement")->showDBValue($row, "");
        $values["stan"] = $pageObject->getViewControl("stan")->showDBValue($row, "");
        $values["ntb"] = $pageObject->getViewControl("ntb")->showDBValue($row, "");
        $values["ntp"] = $pageObject->getViewControl("ntp")->showDBValue($row, "");
        $values["bank_id"] = $pageObject->getViewControl("bank_id")->showDBValue($row, "");
        $values["channel_id"] = $pageObject->getViewControl("channel_id")->showDBValue($row, "");
        $values["bank_ip"] = $pageObject->getViewControl("bank_ip")->showDBValue($row, "");
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $pageObject);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["id"]);
            } else {
                echo $values["id"];
            }
            //echo htmlspecialchars($values["id"]); commented for bug #6823
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["invoice_id"]);
            } else {
                echo $values["invoice_id"];
            }
            //echo htmlspecialchars($values["invoice_id"]); commented for bug #6823
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["tgl"]);
            } else {
                echo $values["tgl"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["tagihan"];
            echo '</td>';
            echo '<td>';
            echo $values["denda"];
            echo '</td>';
            echo '<td>';
            echo $values["total_bayar"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["iso_request"]);
            } else {
                echo $values["iso_request"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["transmission"]);
            } else {
                echo $values["transmission"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["settlement"]);
            } else {
                echo $values["settlement"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["stan"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ntb"]);
            } else {
                echo $values["ntb"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ntp"]);
            } else {
                echo $values["ntp"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["bank_id"]);
            } else {
                echo $values["bank_id"];
            }
            //echo htmlspecialchars($values["bank_id"]); commented for bug #6823
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["channel_id"]);
            } else {
                echo $values["channel_id"];
            }
            //echo htmlspecialchars($values["channel_id"]); commented for bug #6823
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["bank_ip"]);
            } else {
                echo $values["bank_ip"];
            }
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs, $pageObject);
        } else {
            $row = $cipherer->DecryptFetchedArray($rs);
        }
    }
}
function WriteTableData($cipherer)
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj, $pageObject;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs, $pageObject);
    } else {
        $row = $cipherer->DecryptFetchedArray($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Spt Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Media Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kelas Jalan Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Panjang") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Lebar") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tinggi") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Muka") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Sisi") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Banyak") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Lama") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Nsr") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Alamat") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Update Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Create Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Updated") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Created") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Status Baliho") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tambahan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Jalan Id") . '</td>';
    } else {
        echo "<td>" . "Id" . "</td>";
        echo "<td>" . "Spt Id" . "</td>";
        echo "<td>" . "Media Id" . "</td>";
        echo "<td>" . "Kelas Jalan Id" . "</td>";
        echo "<td>" . "Panjang" . "</td>";
        echo "<td>" . "Lebar" . "</td>";
        echo "<td>" . "Tinggi" . "</td>";
        echo "<td>" . "Muka" . "</td>";
        echo "<td>" . "Sisi" . "</td>";
        echo "<td>" . "Banyak" . "</td>";
        echo "<td>" . "Lama" . "</td>";
        echo "<td>" . "Nsr" . "</td>";
        echo "<td>" . "Alamat" . "</td>";
        echo "<td>" . "Update Uid" . "</td>";
        echo "<td>" . "Create Uid" . "</td>";
        echo "<td>" . "Updated" . "</td>";
        echo "<td>" . "Created" . "</td>";
        echo "<td>" . "Status Baliho" . "</td>";
        echo "<td>" . "Tambahan" . "</td>";
        echo "<td>" . "Jalan Id" . "</td>";
    }
    echo "</tr>";
    // write data rows
    $iNumberOfRows = 0;
    $pageObject->viewControls->forExport = "export";
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $values["id"] = $pageObject->getViewControl("id")->showDBValue($row, "");
        $values["spt_id"] = $pageObject->getViewControl("spt_id")->showDBValue($row, "");
        $values["media_id"] = $pageObject->getViewControl("media_id")->showDBValue($row, "");
        $values["kelas_jalan_id"] = $pageObject->getViewControl("kelas_jalan_id")->showDBValue($row, "");
        $values["panjang"] = $pageObject->getViewControl("panjang")->showDBValue($row, "");
        $values["lebar"] = $pageObject->getViewControl("lebar")->showDBValue($row, "");
        $values["tinggi"] = $pageObject->getViewControl("tinggi")->showDBValue($row, "");
        $values["muka"] = $pageObject->getViewControl("muka")->showDBValue($row, "");
        $values["sisi"] = $pageObject->getViewControl("sisi")->showDBValue($row, "");
        $values["banyak"] = $pageObject->getViewControl("banyak")->showDBValue($row, "");
        $values["lama"] = $pageObject->getViewControl("lama")->showDBValue($row, "");
        $values["nsr"] = $pageObject->getViewControl("nsr")->showDBValue($row, "");
        $values["alamat"] = $pageObject->getViewControl("alamat")->showDBValue($row, "");
        $values["update_uid"] = $pageObject->getViewControl("update_uid")->showDBValue($row, "");
        $values["create_uid"] = $pageObject->getViewControl("create_uid")->showDBValue($row, "");
        $values["updated"] = $pageObject->getViewControl("updated")->showDBValue($row, "");
        $values["created"] = $pageObject->getViewControl("created")->showDBValue($row, "");
        $values["status_baliho"] = $pageObject->getViewControl("status_baliho")->showDBValue($row, "");
        $values["tambahan"] = $pageObject->getViewControl("tambahan")->showDBValue($row, "");
        $values["jalan_id"] = $pageObject->getViewControl("jalan_id")->showDBValue($row, "");
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $pageObject);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            echo $values["id"];
            echo '</td>';
            echo '<td>';
            echo $values["spt_id"];
            echo '</td>';
            echo '<td>';
            echo $values["media_id"];
            echo '</td>';
            echo '<td>';
            echo $values["kelas_jalan_id"];
            echo '</td>';
            echo '<td>';
            echo $values["panjang"];
            echo '</td>';
            echo '<td>';
            echo $values["lebar"];
            echo '</td>';
            echo '<td>';
            echo $values["tinggi"];
            echo '</td>';
            echo '<td>';
            echo $values["muka"];
            echo '</td>';
            echo '<td>';
            echo $values["sisi"];
            echo '</td>';
            echo '<td>';
            echo $values["banyak"];
            echo '</td>';
            echo '<td>';
            echo $values["lama"];
            echo '</td>';
            echo '<td>';
            echo $values["nsr"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["alamat"]);
            } else {
                echo $values["alamat"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["update_uid"];
            echo '</td>';
            echo '<td>';
            echo $values["create_uid"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["updated"]);
            } else {
                echo $values["updated"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["created"]);
            } else {
                echo $values["created"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["status_baliho"];
            echo '</td>';
            echo '<td>';
            echo $values["tambahan"];
            echo '</td>';
            echo '<td>';
            echo $values["jalan_id"];
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs, $pageObject);
        } else {
            $row = $cipherer->DecryptFetchedArray($rs);
        }
    }
}
function WriteTableData($cipherer)
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj, $pageObject;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs, $pageObject);
    } else {
        $row = $cipherer->DecryptFetchedArray($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Usaha Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Nama") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Rekening Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Rekening Kd Sub") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Rekdenda Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Masapajak") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Jatuhtempo") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Multiple") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Jalan Kelas Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tmt") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Enabled") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Created") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Create Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Updated") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Update Uid") . '</td>';
    } else {
        echo "<td>" . "Id" . "</td>";
        echo "<td>" . "Usaha Id" . "</td>";
        echo "<td>" . "Nama" . "</td>";
        echo "<td>" . "Rekening Id" . "</td>";
        echo "<td>" . "Rekening Kd Sub" . "</td>";
        echo "<td>" . "Rekdenda Id" . "</td>";
        echo "<td>" . "Masapajak" . "</td>";
        echo "<td>" . "Jatuhtempo" . "</td>";
        echo "<td>" . "Multiple" . "</td>";
        echo "<td>" . "Jalan Kelas Id" . "</td>";
        echo "<td>" . "Tmt" . "</td>";
        echo "<td>" . "Enabled" . "</td>";
        echo "<td>" . "Created" . "</td>";
        echo "<td>" . "Create Uid" . "</td>";
        echo "<td>" . "Updated" . "</td>";
        echo "<td>" . "Update Uid" . "</td>";
    }
    echo "</tr>";
    // write data rows
    $iNumberOfRows = 0;
    $pageObject->viewControls->forExport = "export";
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $values["id"] = $pageObject->getViewControl("id")->showDBValue($row, "");
        $values["usaha_id"] = $pageObject->getViewControl("usaha_id")->showDBValue($row, "");
        $values["nama"] = $pageObject->getViewControl("nama")->showDBValue($row, "");
        $values["rekening_id"] = $pageObject->getViewControl("rekening_id")->showDBValue($row, "");
        $values["rekening_kd_sub"] = $pageObject->getViewControl("rekening_kd_sub")->showDBValue($row, "");
        $values["rekdenda_id"] = $pageObject->getViewControl("rekdenda_id")->showDBValue($row, "");
        $values["masapajak"] = $pageObject->getViewControl("masapajak")->showDBValue($row, "");
        $values["jatuhtempo"] = $pageObject->getViewControl("jatuhtempo")->showDBValue($row, "");
        $values["multiple"] = $pageObject->getViewControl("multiple")->showDBValue($row, "");
        $values["jalan_kelas_id"] = $pageObject->getViewControl("jalan_kelas_id")->showDBValue($row, "");
        $values["tmt"] = $pageObject->getViewControl("tmt")->showDBValue($row, "");
        $values["enabled"] = $pageObject->getViewControl("enabled")->showDBValue($row, "");
        $values["created"] = $pageObject->getViewControl("created")->showDBValue($row, "");
        $values["create_uid"] = $pageObject->getViewControl("create_uid")->showDBValue($row, "");
        $values["updated"] = $pageObject->getViewControl("updated")->showDBValue($row, "");
        $values["update_uid"] = $pageObject->getViewControl("update_uid")->showDBValue($row, "");
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $pageObject);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            echo $values["id"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["usaha_id"]);
            } else {
                echo $values["usaha_id"];
            }
            //echo htmlspecialchars($values["usaha_id"]); commented for bug #6823
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["nama"]);
            } else {
                echo $values["nama"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["rekening_id"]);
            } else {
                echo $values["rekening_id"];
            }
            //echo htmlspecialchars($values["rekening_id"]); commented for bug #6823
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["rekening_kd_sub"]);
            } else {
                echo $values["rekening_kd_sub"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["rekdenda_id"];
            echo '</td>';
            echo '<td>';
            echo $values["masapajak"];
            echo '</td>';
            echo '<td>';
            echo $values["jatuhtempo"];
            echo '</td>';
            echo '<td>';
            echo $values["multiple"];
            echo '</td>';
            echo '<td>';
            echo $values["jalan_kelas_id"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["tmt"]);
            } else {
                echo $values["tmt"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["enabled"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["created"]);
            } else {
                echo $values["created"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["create_uid"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["updated"]);
            } else {
                echo $values["updated"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["update_uid"];
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs, $pageObject);
        } else {
            $row = $cipherer->DecryptFetchedArray($rs);
        }
    }
}
function WriteTableData($rs, $nPageSize, $strTableName, $eventObj, $cipherer, $pageObject)
{	
	if($eventObj->exists("ListFetchArray"))
		$row = $eventObj->ListFetchArray($rs, $pageObject);
	else
		$row = $cipherer->DecryptFetchedArray($rs);
//	if(!$row)
//		return;
// write header
	echo "<tr>";
	if($_REQUEST["type"]=="excel")
	{
		echo '<td style="width: 100" x:str>'.PrepareForExcel(GetFieldLabel("webreport_users","id")).'</td>';	
		echo '<td style="width: 100" x:str>'.PrepareForExcel(GetFieldLabel("webreport_users","username")).'</td>';	
		echo '<td style="width: 100" x:str>'.PrepareForExcel(GetFieldLabel("webreport_users","password")).'</td>';	
		echo '<td style="width: 100" x:str>'.PrepareForExcel(GetFieldLabel("webreport_users","email")).'</td>';	
	}
	else
	{
		echo "<td>".GetFieldLabel("webreport_users","id")."</td>";
		echo "<td>".GetFieldLabel("webreport_users","username")."</td>";
		echo "<td>".GetFieldLabel("webreport_users","password")."</td>";
		echo "<td>".GetFieldLabel("webreport_users","email")."</td>";
	}
	echo "</tr>";
	
// write data rows
	$iNumberOfRows = 0;
	$pageObject->viewControls->forExport = "export";
	while((!$nPageSize || $iNumberOfRows<$nPageSize) && $row)
	{
		countTotals($totals, $totalsFields, $row);
		
		$values = array();
	
					$values["id"] = $pageObject->getViewControl("id")->getExportValue($row, "");
					$values["username"] = $pageObject->getViewControl("username")->getExportValue($row, "");
					$values["password"] = $pageObject->getViewControl("password")->getExportValue($row, "");
					$values["email"] = $pageObject->getViewControl("email")->getExportValue($row, "");
		
		$eventRes = true;
		if ($eventObj->exists('BeforeOut'))
		{
			$eventRes = $eventObj->BeforeOut($row, $values, $pageObject);
		}
		if ($eventRes)
		{
			$iNumberOfRows++;
			echo "<tr>";
		
							echo '<td>';
			
									echo $values["id"];
			echo '</td>';
							if($_REQUEST["type"]=="excel")
					echo '<td x:str>';
				else
					echo '<td>';
			
									if($_REQUEST["type"]=="excel")
						echo PrepareForExcel($values["username"]);
					else
						echo $values["username"];
			echo '</td>';
							if($_REQUEST["type"]=="excel")
					echo '<td x:str>';
				else
					echo '<td>';
			
									if($_REQUEST["type"]=="excel")
						echo PrepareForExcel($values["password"]);
					else
						echo $values["password"];
			echo '</td>';
							if($_REQUEST["type"]=="excel")
					echo '<td x:str>';
				else
					echo '<td>';
			
									if($_REQUEST["type"]=="excel")
						echo PrepareForExcel($values["email"]);
					else
						echo $values["email"];
			echo '</td>';
			echo "</tr>";
		}
		
		
		if($eventObj->exists("ListFetchArray"))
			$row = $eventObj->ListFetchArray($rs, $pageObject);
		else
			$row = $cipherer->DecryptFetchedArray($rs);
	}
	
}
Esempio n. 20
0
function WriteTableData($cipherer)
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj, $pageObject;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs, $pageObject);
    } else {
        $row = $cipherer->DecryptFetchedArray($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tahun") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Terimano") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Terimatgl") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Jmlterima") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Customer Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Npwpd") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Nobukti") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Notes") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Enabled") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Create Date") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Create Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Write Date") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Write Uid") . '</td>';
    } else {
        echo "<td>" . "Id" . "</td>";
        echo "<td>" . "Tahun" . "</td>";
        echo "<td>" . "Terimano" . "</td>";
        echo "<td>" . "Terimatgl" . "</td>";
        echo "<td>" . "Jmlterima" . "</td>";
        echo "<td>" . "Customer Id" . "</td>";
        echo "<td>" . "Npwpd" . "</td>";
        echo "<td>" . "Nobukti" . "</td>";
        echo "<td>" . "Notes" . "</td>";
        echo "<td>" . "Enabled" . "</td>";
        echo "<td>" . "Create Date" . "</td>";
        echo "<td>" . "Create Uid" . "</td>";
        echo "<td>" . "Write Date" . "</td>";
        echo "<td>" . "Write Uid" . "</td>";
    }
    echo "</tr>";
    // write data rows
    $iNumberOfRows = 0;
    $pageObject->viewControls->forExport = "export";
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $values["id"] = $pageObject->getViewControl("id")->showDBValue($row, "");
        $values["tahun"] = $pageObject->getViewControl("tahun")->showDBValue($row, "");
        $values["terimano"] = $pageObject->getViewControl("terimano")->showDBValue($row, "");
        $values["terimatgl"] = $pageObject->getViewControl("terimatgl")->showDBValue($row, "");
        $values["jmlterima"] = $pageObject->getViewControl("jmlterima")->showDBValue($row, "");
        $values["customer_id"] = $pageObject->getViewControl("customer_id")->showDBValue($row, "");
        $values["npwpd"] = $pageObject->getViewControl("npwpd")->showDBValue($row, "");
        $values["nobukti"] = $pageObject->getViewControl("nobukti")->showDBValue($row, "");
        $values["notes"] = $pageObject->getViewControl("notes")->showDBValue($row, "");
        $values["enabled"] = $pageObject->getViewControl("enabled")->showDBValue($row, "");
        $values["create_date"] = $pageObject->getViewControl("create_date")->showDBValue($row, "");
        $values["create_uid"] = $pageObject->getViewControl("create_uid")->showDBValue($row, "");
        $values["write_date"] = $pageObject->getViewControl("write_date")->showDBValue($row, "");
        $values["write_uid"] = $pageObject->getViewControl("write_uid")->showDBValue($row, "");
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $pageObject);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            echo $values["id"];
            echo '</td>';
            echo '<td>';
            echo $values["tahun"];
            echo '</td>';
            echo '<td>';
            echo $values["terimano"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["terimatgl"]);
            } else {
                echo $values["terimatgl"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["jmlterima"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["customer_id"]);
            } else {
                echo $values["customer_id"];
            }
            //echo htmlspecialchars($values["customer_id"]); commented for bug #6823
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["npwpd"]);
            } else {
                echo $values["npwpd"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["nobukti"]);
            } else {
                echo $values["nobukti"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["notes"]);
            } else {
                echo $values["notes"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["enabled"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["create_date"]);
            } else {
                echo $values["create_date"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["create_uid"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["write_date"]);
            } else {
                echo $values["write_date"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["write_uid"];
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs, $pageObject);
        } else {
            $row = $cipherer->DecryptFetchedArray($rs);
        }
    }
}
Esempio n. 21
0
function WriteTableData($cipherer)
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj, $pageObject;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs, $pageObject);
    } else {
        $row = $cipherer->DecryptFetchedArray($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Type") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kepala Nama") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Alamat") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Telp") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pemda Nama") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ibukota") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tmt") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Jabatan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ppkd Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Reklame Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pendapatan Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pemda Nama Singkat") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Airtanah Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Self Dok Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Office Dok Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tgl Jatuhtempo Self") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Spt Denda") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tgl Spt") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pad Bunga") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Fax") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Website") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Email") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Daerah") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Alamat Lengkap") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ppj Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Hotel Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Walet Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Restauran Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Hiburan Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Parkir Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Enabled") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Surat No") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ijin Kd") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Hotel Kd") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Restoran Kd") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Hiburan Kd") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ppj Kd") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Parkir Kd") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Airtanah Kd") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Reklame Kd") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Restauran Kd") . '</td>';
    } else {
        echo "<td>" . "Id" . "</td>";
        echo "<td>" . "Type" . "</td>";
        echo "<td>" . "Kepala Nama" . "</td>";
        echo "<td>" . "Alamat" . "</td>";
        echo "<td>" . "Telp" . "</td>";
        echo "<td>" . "Pemda Nama" . "</td>";
        echo "<td>" . "Ibukota" . "</td>";
        echo "<td>" . "Tmt" . "</td>";
        echo "<td>" . "Jabatan" . "</td>";
        echo "<td>" . "Ppkd Id" . "</td>";
        echo "<td>" . "Reklame Id" . "</td>";
        echo "<td>" . "Pendapatan Id" . "</td>";
        echo "<td>" . "Pemda Nama Singkat" . "</td>";
        echo "<td>" . "Airtanah Id" . "</td>";
        echo "<td>" . "Self Dok Id" . "</td>";
        echo "<td>" . "Office Dok Id" . "</td>";
        echo "<td>" . "Tgl Jatuhtempo Self" . "</td>";
        echo "<td>" . "Spt Denda" . "</td>";
        echo "<td>" . "Tgl Spt" . "</td>";
        echo "<td>" . "Pad Bunga" . "</td>";
        echo "<td>" . "Fax" . "</td>";
        echo "<td>" . "Website" . "</td>";
        echo "<td>" . "Email" . "</td>";
        echo "<td>" . "Daerah" . "</td>";
        echo "<td>" . "Alamat Lengkap" . "</td>";
        echo "<td>" . "Ppj Id" . "</td>";
        echo "<td>" . "Hotel Id" . "</td>";
        echo "<td>" . "Walet Id" . "</td>";
        echo "<td>" . "Restauran Id" . "</td>";
        echo "<td>" . "Hiburan Id" . "</td>";
        echo "<td>" . "Parkir Id" . "</td>";
        echo "<td>" . "Enabled" . "</td>";
        echo "<td>" . "Surat No" . "</td>";
        echo "<td>" . "Ijin Kd" . "</td>";
        echo "<td>" . "Hotel Kd" . "</td>";
        echo "<td>" . "Restoran Kd" . "</td>";
        echo "<td>" . "Hiburan Kd" . "</td>";
        echo "<td>" . "Ppj Kd" . "</td>";
        echo "<td>" . "Parkir Kd" . "</td>";
        echo "<td>" . "Airtanah Kd" . "</td>";
        echo "<td>" . "Reklame Kd" . "</td>";
        echo "<td>" . "Restauran Kd" . "</td>";
    }
    echo "</tr>";
    // write data rows
    $iNumberOfRows = 0;
    $pageObject->viewControls->forExport = "export";
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $values["id"] = $pageObject->getViewControl("id")->showDBValue($row, "");
        $values["type"] = $pageObject->getViewControl("type")->showDBValue($row, "");
        $values["kepala_nama"] = $pageObject->getViewControl("kepala_nama")->showDBValue($row, "");
        $values["alamat"] = $pageObject->getViewControl("alamat")->showDBValue($row, "");
        $values["telp"] = $pageObject->getViewControl("telp")->showDBValue($row, "");
        $values["pemda_nama"] = $pageObject->getViewControl("pemda_nama")->showDBValue($row, "");
        $values["ibukota"] = $pageObject->getViewControl("ibukota")->showDBValue($row, "");
        $values["tmt"] = $pageObject->getViewControl("tmt")->showDBValue($row, "");
        $values["jabatan"] = $pageObject->getViewControl("jabatan")->showDBValue($row, "");
        $values["ppkd_id"] = $pageObject->getViewControl("ppkd_id")->showDBValue($row, "");
        $values["reklame_id"] = $pageObject->getViewControl("reklame_id")->showDBValue($row, "");
        $values["pendapatan_id"] = $pageObject->getViewControl("pendapatan_id")->showDBValue($row, "");
        $values["pemda_nama_singkat"] = $pageObject->getViewControl("pemda_nama_singkat")->showDBValue($row, "");
        $values["airtanah_id"] = $pageObject->getViewControl("airtanah_id")->showDBValue($row, "");
        $values["self_dok_id"] = $pageObject->getViewControl("self_dok_id")->showDBValue($row, "");
        $values["office_dok_id"] = $pageObject->getViewControl("office_dok_id")->showDBValue($row, "");
        $values["tgl_jatuhtempo_self"] = $pageObject->getViewControl("tgl_jatuhtempo_self")->showDBValue($row, "");
        $values["spt_denda"] = $pageObject->getViewControl("spt_denda")->showDBValue($row, "");
        $values["tgl_spt"] = $pageObject->getViewControl("tgl_spt")->showDBValue($row, "");
        $values["pad_bunga"] = $pageObject->getViewControl("pad_bunga")->showDBValue($row, "");
        $values["fax"] = $pageObject->getViewControl("fax")->showDBValue($row, "");
        $values["website"] = $pageObject->getViewControl("website")->showDBValue($row, "");
        $values["email"] = $pageObject->getViewControl("email")->showDBValue($row, "");
        $values["daerah"] = $pageObject->getViewControl("daerah")->showDBValue($row, "");
        $values["alamat_lengkap"] = $pageObject->getViewControl("alamat_lengkap")->showDBValue($row, "");
        $values["ppj_id"] = $pageObject->getViewControl("ppj_id")->showDBValue($row, "");
        $values["hotel_id"] = $pageObject->getViewControl("hotel_id")->showDBValue($row, "");
        $values["walet_id"] = $pageObject->getViewControl("walet_id")->showDBValue($row, "");
        $values["restauran_id"] = $pageObject->getViewControl("restauran_id")->showDBValue($row, "");
        $values["hiburan_id"] = $pageObject->getViewControl("hiburan_id")->showDBValue($row, "");
        $values["parkir_id"] = $pageObject->getViewControl("parkir_id")->showDBValue($row, "");
        $values["enabled"] = $pageObject->getViewControl("enabled")->showDBValue($row, "");
        $values["surat_no"] = $pageObject->getViewControl("surat_no")->showDBValue($row, "");
        $values["ijin_kd"] = $pageObject->getViewControl("ijin_kd")->showDBValue($row, "");
        $values["hotel_kd"] = $pageObject->getViewControl("hotel_kd")->showDBValue($row, "");
        $values["restoran_kd"] = $pageObject->getViewControl("restoran_kd")->showDBValue($row, "");
        $values["hiburan_kd"] = $pageObject->getViewControl("hiburan_kd")->showDBValue($row, "");
        $values["ppj_kd"] = $pageObject->getViewControl("ppj_kd")->showDBValue($row, "");
        $values["parkir_kd"] = $pageObject->getViewControl("parkir_kd")->showDBValue($row, "");
        $values["airtanah_kd"] = $pageObject->getViewControl("airtanah_kd")->showDBValue($row, "");
        $values["reklame_kd"] = $pageObject->getViewControl("reklame_kd")->showDBValue($row, "");
        $values["restauran_kd"] = $pageObject->getViewControl("restauran_kd")->showDBValue($row, "");
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $pageObject);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            echo $values["id"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["type"]);
            } else {
                echo $values["type"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["kepala_nama"]);
            } else {
                echo $values["kepala_nama"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["alamat"]);
            } else {
                echo $values["alamat"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["telp"]);
            } else {
                echo $values["telp"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["pemda_nama"]);
            } else {
                echo $values["pemda_nama"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ibukota"]);
            } else {
                echo $values["ibukota"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["tmt"]);
            } else {
                echo $values["tmt"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["jabatan"]);
            } else {
                echo $values["jabatan"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["ppkd_id"];
            echo '</td>';
            echo '<td>';
            echo $values["reklame_id"];
            echo '</td>';
            echo '<td>';
            echo $values["pendapatan_id"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["pemda_nama_singkat"]);
            } else {
                echo $values["pemda_nama_singkat"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["airtanah_id"];
            echo '</td>';
            echo '<td>';
            echo $values["self_dok_id"];
            echo '</td>';
            echo '<td>';
            echo $values["office_dok_id"];
            echo '</td>';
            echo '<td>';
            echo $values["tgl_jatuhtempo_self"];
            echo '</td>';
            echo '<td>';
            echo $values["spt_denda"];
            echo '</td>';
            echo '<td>';
            echo $values["tgl_spt"];
            echo '</td>';
            echo '<td>';
            echo $values["pad_bunga"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["fax"]);
            } else {
                echo $values["fax"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["website"]);
            } else {
                echo $values["website"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["email"]);
            } else {
                echo $values["email"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["daerah"]);
            } else {
                echo $values["daerah"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["alamat_lengkap"]);
            } else {
                echo $values["alamat_lengkap"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["ppj_id"];
            echo '</td>';
            echo '<td>';
            echo $values["hotel_id"];
            echo '</td>';
            echo '<td>';
            echo $values["walet_id"];
            echo '</td>';
            echo '<td>';
            echo $values["restauran_id"];
            echo '</td>';
            echo '<td>';
            echo $values["hiburan_id"];
            echo '</td>';
            echo '<td>';
            echo $values["parkir_id"];
            echo '</td>';
            echo '<td>';
            echo $values["enabled"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["surat_no"]);
            } else {
                echo $values["surat_no"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ijin_kd"]);
            } else {
                echo $values["ijin_kd"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["hotel_kd"]);
            } else {
                echo $values["hotel_kd"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["restoran_kd"]);
            } else {
                echo $values["restoran_kd"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["hiburan_kd"]);
            } else {
                echo $values["hiburan_kd"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ppj_kd"]);
            } else {
                echo $values["ppj_kd"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["parkir_kd"]);
            } else {
                echo $values["parkir_kd"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["airtanah_kd"]);
            } else {
                echo $values["airtanah_kd"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["reklame_kd"]);
            } else {
                echo $values["reklame_kd"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["restauran_kd"]);
            } else {
                echo $values["restauran_kd"];
            }
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs, $pageObject);
        } else {
            $row = $cipherer->DecryptFetchedArray($rs);
        }
    }
}
function WriteTableData()
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs);
    } else {
        $row = db_fetch_array($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_User_Roles", "Code")) . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel(GetFieldLabel("dbo_User_Roles", "Role")) . '</td>';
    } else {
        echo "<td>" . GetFieldLabel("dbo_User_Roles", "Code") . "</td>";
        echo "<td>" . GetFieldLabel("dbo_User_Roles", "Role") . "</td>";
    }
    echo "</tr>";
    $totals["Code"] = 0;
    $totalsFields[] = array('fName' => "Code", 'totalsType' => '', 'viewFormat' => "");
    $totals["Role"] = 0;
    $totalsFields[] = array('fName' => "Role", 'totalsType' => '', 'viewFormat' => "");
    $totals = array();
    // write data rows
    $iNumberOfRows = 0;
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $format = "";
        $values["Code"] = GetData($row, "Code", $format);
        $format = "";
        $values["Role"] = GetData($row, "Role", $format);
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            $format = "";
            echo htmlspecialchars($values["Code"]);
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            $format = "";
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["Role"]);
            } else {
                echo htmlspecialchars($values["Role"]);
            }
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs);
        } else {
            $row = db_fetch_array($rs);
        }
    }
}
Esempio n. 23
0
function WriteTableData($cipherer)
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj, $pageObject;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs, $pageObject);
    } else {
        $row = $cipherer->DecryptFetchedArray($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tahun") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Sspdno") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Sspdtgl") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Sspdjam") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Invoice Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Keterangan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bulan Telat") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Hitung Bunga") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Denda") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bunga") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Jml Bayar") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Sisa") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Jenis Bayar") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Printed") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tp Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Is Validated") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Is Valid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Enabled") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Created") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Create Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Updated") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Update Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Petugas Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Pejabat Id") . '</td>';
    } else {
        echo "<td>" . "Id" . "</td>";
        echo "<td>" . "Tahun" . "</td>";
        echo "<td>" . "Sspdno" . "</td>";
        echo "<td>" . "Sspdtgl" . "</td>";
        echo "<td>" . "Sspdjam" . "</td>";
        echo "<td>" . "Invoice Id" . "</td>";
        echo "<td>" . "Keterangan" . "</td>";
        echo "<td>" . "Bulan Telat" . "</td>";
        echo "<td>" . "Hitung Bunga" . "</td>";
        echo "<td>" . "Denda" . "</td>";
        echo "<td>" . "Bunga" . "</td>";
        echo "<td>" . "Jml Bayar" . "</td>";
        echo "<td>" . "Sisa" . "</td>";
        echo "<td>" . "Jenis Bayar" . "</td>";
        echo "<td>" . "Printed" . "</td>";
        echo "<td>" . "Tp Id" . "</td>";
        echo "<td>" . "Is Validated" . "</td>";
        echo "<td>" . "Is Valid" . "</td>";
        echo "<td>" . "Enabled" . "</td>";
        echo "<td>" . "Created" . "</td>";
        echo "<td>" . "Create Uid" . "</td>";
        echo "<td>" . "Updated" . "</td>";
        echo "<td>" . "Update Uid" . "</td>";
        echo "<td>" . "Petugas Id" . "</td>";
        echo "<td>" . "Pejabat Id" . "</td>";
    }
    echo "</tr>";
    // write data rows
    $iNumberOfRows = 0;
    $pageObject->viewControls->forExport = "export";
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $values["id"] = $pageObject->getViewControl("id")->showDBValue($row, "");
        $values["tahun"] = $pageObject->getViewControl("tahun")->showDBValue($row, "");
        $values["sspdno"] = $pageObject->getViewControl("sspdno")->showDBValue($row, "");
        $values["sspdtgl"] = $pageObject->getViewControl("sspdtgl")->showDBValue($row, "");
        $values["sspdjam"] = $pageObject->getViewControl("sspdjam")->showDBValue($row, "");
        $values["invoice_id"] = $pageObject->getViewControl("invoice_id")->showDBValue($row, "");
        $values["keterangan"] = $pageObject->getViewControl("keterangan")->showDBValue($row, "");
        $values["bulan_telat"] = $pageObject->getViewControl("bulan_telat")->showDBValue($row, "");
        $values["hitung_bunga"] = $pageObject->getViewControl("hitung_bunga")->showDBValue($row, "");
        $values["denda"] = $pageObject->getViewControl("denda")->showDBValue($row, "");
        $values["bunga"] = $pageObject->getViewControl("bunga")->showDBValue($row, "");
        $values["jml_bayar"] = $pageObject->getViewControl("jml_bayar")->showDBValue($row, "");
        $values["sisa"] = $pageObject->getViewControl("sisa")->showDBValue($row, "");
        $values["jenis_bayar"] = $pageObject->getViewControl("jenis_bayar")->showDBValue($row, "");
        $values["printed"] = $pageObject->getViewControl("printed")->showDBValue($row, "");
        $values["tp_id"] = $pageObject->getViewControl("tp_id")->showDBValue($row, "");
        $values["is_validated"] = $pageObject->getViewControl("is_validated")->showDBValue($row, "");
        $values["is_valid"] = $pageObject->getViewControl("is_valid")->showDBValue($row, "");
        $values["enabled"] = $pageObject->getViewControl("enabled")->showDBValue($row, "");
        $values["created"] = $pageObject->getViewControl("created")->showDBValue($row, "");
        $values["create_uid"] = $pageObject->getViewControl("create_uid")->showDBValue($row, "");
        $values["updated"] = $pageObject->getViewControl("updated")->showDBValue($row, "");
        $values["update_uid"] = $pageObject->getViewControl("update_uid")->showDBValue($row, "");
        $values["petugas_id"] = $pageObject->getViewControl("petugas_id")->showDBValue($row, "");
        $values["pejabat_id"] = $pageObject->getViewControl("pejabat_id")->showDBValue($row, "");
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $pageObject);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            echo $values["id"];
            echo '</td>';
            echo '<td>';
            echo $values["tahun"];
            echo '</td>';
            echo '<td>';
            echo $values["sspdno"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["sspdtgl"]);
            } else {
                echo $values["sspdtgl"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["sspdjam"]);
            } else {
                echo $values["sspdjam"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["invoice_id"]);
            } else {
                echo $values["invoice_id"];
            }
            //echo htmlspecialchars($values["invoice_id"]); commented for bug #6823
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["keterangan"]);
            } else {
                echo $values["keterangan"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["bulan_telat"];
            echo '</td>';
            echo '<td>';
            echo $values["hitung_bunga"];
            echo '</td>';
            echo '<td>';
            echo $values["denda"];
            echo '</td>';
            echo '<td>';
            echo $values["bunga"];
            echo '</td>';
            echo '<td>';
            echo $values["jml_bayar"];
            echo '</td>';
            echo '<td>';
            echo $values["sisa"];
            echo '</td>';
            echo '<td>';
            echo $values["jenis_bayar"];
            echo '</td>';
            echo '<td>';
            echo $values["printed"];
            echo '</td>';
            echo '<td>';
            echo $values["tp_id"];
            echo '</td>';
            echo '<td>';
            echo $values["is_validated"];
            echo '</td>';
            echo '<td>';
            echo $values["is_valid"];
            echo '</td>';
            echo '<td>';
            echo $values["enabled"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["created"]);
            } else {
                echo $values["created"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["create_uid"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["updated"]);
            } else {
                echo $values["updated"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["update_uid"];
            echo '</td>';
            echo '<td>';
            echo $values["petugas_id"];
            echo '</td>';
            echo '<td>';
            echo $values["pejabat_id"];
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs, $pageObject);
        } else {
            $row = $cipherer->DecryptFetchedArray($rs);
        }
    }
}
function WriteTableData($cipherer)
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj, $pageObject;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs, $pageObject);
    } else {
        $row = $cipherer->DecryptFetchedArray($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Nama") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Nilai") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Update Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Create Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Updated") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Created") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Singkatan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kriteria") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Enabled") . '</td>';
    } else {
        echo "<td>" . "Id" . "</td>";
        echo "<td>" . "Nama" . "</td>";
        echo "<td>" . "Nilai" . "</td>";
        echo "<td>" . "Update Uid" . "</td>";
        echo "<td>" . "Create Uid" . "</td>";
        echo "<td>" . "Updated" . "</td>";
        echo "<td>" . "Created" . "</td>";
        echo "<td>" . "Singkatan" . "</td>";
        echo "<td>" . "Kriteria" . "</td>";
        echo "<td>" . "Enabled" . "</td>";
    }
    echo "</tr>";
    // write data rows
    $iNumberOfRows = 0;
    $pageObject->viewControls->forExport = "export";
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $values["id"] = $pageObject->getViewControl("id")->showDBValue($row, "");
        $values["nama"] = $pageObject->getViewControl("nama")->showDBValue($row, "");
        $values["nilai"] = $pageObject->getViewControl("nilai")->showDBValue($row, "");
        $values["update_uid"] = $pageObject->getViewControl("update_uid")->showDBValue($row, "");
        $values["create_uid"] = $pageObject->getViewControl("create_uid")->showDBValue($row, "");
        $values["updated"] = $pageObject->getViewControl("updated")->showDBValue($row, "");
        $values["created"] = $pageObject->getViewControl("created")->showDBValue($row, "");
        $values["singkatan"] = $pageObject->getViewControl("singkatan")->showDBValue($row, "");
        $values["kriteria"] = $pageObject->getViewControl("kriteria")->showDBValue($row, "");
        $values["enabled"] = $pageObject->getViewControl("enabled")->showDBValue($row, "");
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $pageObject);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            echo $values["id"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["nama"]);
            } else {
                echo $values["nama"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["nilai"];
            echo '</td>';
            echo '<td>';
            echo $values["update_uid"];
            echo '</td>';
            echo '<td>';
            echo $values["create_uid"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["updated"]);
            } else {
                echo $values["updated"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["created"]);
            } else {
                echo $values["created"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["singkatan"]);
            } else {
                echo $values["singkatan"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["kriteria"];
            echo '</td>';
            echo '<td>';
            echo $values["enabled"];
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs, $pageObject);
        } else {
            $row = $cipherer->DecryptFetchedArray($rs);
        }
    }
}
function WriteTableData($cipherer)
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj, $pageObject;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs, $pageObject);
    } else {
        $row = $cipherer->DecryptFetchedArray($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kode") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Disabled") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Created") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Updated") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Create Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Update Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Nama") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tahun") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Amount") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ref Kode") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Ref Nama") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Tanggal") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kecamatan Kd") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kecamatan Nm") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kelurahan Kd") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Kelurahan Nm") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Is Kota") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Sumber Data") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Sumber Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Bulan") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Minggu") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Hari") . '</td>';
    } else {
        echo "<td>" . "Id" . "</td>";
        echo "<td>" . "Kode" . "</td>";
        echo "<td>" . "Disabled" . "</td>";
        echo "<td>" . "Created" . "</td>";
        echo "<td>" . "Updated" . "</td>";
        echo "<td>" . "Create Uid" . "</td>";
        echo "<td>" . "Update Uid" . "</td>";
        echo "<td>" . "Nama" . "</td>";
        echo "<td>" . "Tahun" . "</td>";
        echo "<td>" . "Amount" . "</td>";
        echo "<td>" . "Ref Kode" . "</td>";
        echo "<td>" . "Ref Nama" . "</td>";
        echo "<td>" . "Tanggal" . "</td>";
        echo "<td>" . "Kecamatan Kd" . "</td>";
        echo "<td>" . "Kecamatan Nm" . "</td>";
        echo "<td>" . "Kelurahan Kd" . "</td>";
        echo "<td>" . "Kelurahan Nm" . "</td>";
        echo "<td>" . "Is Kota" . "</td>";
        echo "<td>" . "Sumber Data" . "</td>";
        echo "<td>" . "Sumber Id" . "</td>";
        echo "<td>" . "Bulan" . "</td>";
        echo "<td>" . "Minggu" . "</td>";
        echo "<td>" . "Hari" . "</td>";
    }
    echo "</tr>";
    // write data rows
    $iNumberOfRows = 0;
    $pageObject->viewControls->forExport = "export";
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $values["id"] = $pageObject->getViewControl("id")->showDBValue($row, "");
        $values["kode"] = $pageObject->getViewControl("kode")->showDBValue($row, "");
        $values["disabled"] = $pageObject->getViewControl("disabled")->showDBValue($row, "");
        $values["created"] = $pageObject->getViewControl("created")->showDBValue($row, "");
        $values["updated"] = $pageObject->getViewControl("updated")->showDBValue($row, "");
        $values["create_uid"] = $pageObject->getViewControl("create_uid")->showDBValue($row, "");
        $values["update_uid"] = $pageObject->getViewControl("update_uid")->showDBValue($row, "");
        $values["nama"] = $pageObject->getViewControl("nama")->showDBValue($row, "");
        $values["tahun"] = $pageObject->getViewControl("tahun")->showDBValue($row, "");
        $values["amount"] = $pageObject->getViewControl("amount")->showDBValue($row, "");
        $values["ref_kode"] = $pageObject->getViewControl("ref_kode")->showDBValue($row, "");
        $values["ref_nama"] = $pageObject->getViewControl("ref_nama")->showDBValue($row, "");
        $values["tanggal"] = $pageObject->getViewControl("tanggal")->showDBValue($row, "");
        $values["kecamatan_kd"] = $pageObject->getViewControl("kecamatan_kd")->showDBValue($row, "");
        $values["kecamatan_nm"] = $pageObject->getViewControl("kecamatan_nm")->showDBValue($row, "");
        $values["kelurahan_kd"] = $pageObject->getViewControl("kelurahan_kd")->showDBValue($row, "");
        $values["kelurahan_nm"] = $pageObject->getViewControl("kelurahan_nm")->showDBValue($row, "");
        $values["is_kota"] = $pageObject->getViewControl("is_kota")->showDBValue($row, "");
        $values["sumber_data"] = $pageObject->getViewControl("sumber_data")->showDBValue($row, "");
        $values["sumber_id"] = $pageObject->getViewControl("sumber_id")->showDBValue($row, "");
        $values["bulan"] = $pageObject->getViewControl("bulan")->showDBValue($row, "");
        $values["minggu"] = $pageObject->getViewControl("minggu")->showDBValue($row, "");
        $values["hari"] = $pageObject->getViewControl("hari")->showDBValue($row, "");
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $pageObject);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            echo $values["id"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["kode"]);
            } else {
                echo $values["kode"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["disabled"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["created"]);
            } else {
                echo $values["created"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["updated"]);
            } else {
                echo $values["updated"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["create_uid"];
            echo '</td>';
            echo '<td>';
            echo $values["update_uid"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["nama"]);
            } else {
                echo $values["nama"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["tahun"];
            echo '</td>';
            echo '<td>';
            echo $values["amount"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ref_kode"]);
            } else {
                echo $values["ref_kode"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["ref_nama"]);
            } else {
                echo $values["ref_nama"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["tanggal"]);
            } else {
                echo $values["tanggal"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["kecamatan_kd"]);
            } else {
                echo $values["kecamatan_kd"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["kecamatan_nm"]);
            } else {
                echo $values["kecamatan_nm"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["kelurahan_kd"]);
            } else {
                echo $values["kelurahan_kd"];
            }
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["kelurahan_nm"]);
            } else {
                echo $values["kelurahan_nm"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["is_kota"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["sumber_data"]);
            } else {
                echo $values["sumber_data"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["sumber_id"];
            echo '</td>';
            echo '<td>';
            echo $values["bulan"];
            echo '</td>';
            echo '<td>';
            echo $values["minggu"];
            echo '</td>';
            echo '<td>';
            echo $values["hari"];
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs, $pageObject);
        } else {
            $row = $cipherer->DecryptFetchedArray($rs);
        }
    }
}
Esempio n. 26
0
function ExportToExcel($rs, $nPageSize, $eventObj, $cipherer, $pageObj)
{
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs, $pageObj);
    } else {
        $row = $cipherer->DecryptFetchedArray($pageObj->connection->fetch_array($rs));
    }
    $tmpArr = array();
    $totals = array();
    $arrLabel = array();
    $arrTotal = array();
    $arrFields = array();
    $arrTmpTotal = array();
    $arrColumnWidth = array();
    $arrTotalMessage = array();
    $tmpArr = $pageObj->pSet->getExportFields();
    foreach ($tmpArr as $value) {
        if ($pageObj->pSet->appearOnExportPage($value)) {
            $arrFields[] = $value;
        }
    }
    $arrTmpTotal = $pageObj->pSet->getTotalsFields();
    $pageObj->viewControls->forExport = "excel";
    foreach ($arrFields as $value) {
        $arrLabel[$value] = GetFieldLabel(GoodFieldName($pageObj->tName), GoodFieldName($value));
        $arrColumnWidth[$value] = 10;
        $totals[$value] = array("value" => 0, "numRows" => 0);
        $totalsType = "";
        foreach ($arrTmpTotal as $tvalue) {
            if ($tvalue["fName"] == $value) {
                $totalsType = $tvalue["totalsType"];
                $totalsFields[] = array('fName' => $value, 'totalsType' => $totalsType, 'viewFormat' => $pageObj->pSet->getViewFormat($value));
            }
        }
    }
    // write data rows
    $iNumberOfRows = 0;
    $objPHPExcel = ExportExcelInit($arrLabel, $arrColumnWidth);
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $arrData = array();
        $arrDataType = array();
        foreach ($arrFields as $field) {
            if (IsBinaryType($pageObj->pSet->getFieldType($field))) {
                $values[$field] = $row[$field];
            } else {
                $values[$field] = $pageObj->getExportValue($field, $row);
            }
        }
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $pageObj);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            $i = 0;
            foreach ($arrFields as $field) {
                if (IsBinaryType($pageObj->pSet->getFieldType($field))) {
                    $arrDataType[$field] = "binary";
                } elseif ($pageObj->pSet->getViewFormat($field) == FORMAT_DATE_SHORT || $pageObj->pSet->getViewFormat($field) == FORMAT_DATE_LONG || $pageObj->pSet->getViewFormat($field) == FORMAT_DATE_TIME) {
                    $arrDataType[$field] = "date";
                } elseif ($pageObj->pSet->getViewFormat($field) == FORMAT_FILE_IMAGE) {
                    $arrDataType[$field] = "file";
                } else {
                    $arrDataType[$field] = "";
                }
                $arrData[$field] = $values[$field];
            }
            ExportExcelRecord($arrData, $arrDataType, $iNumberOfRows, $objPHPExcel, $pageObj);
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs, $pageObj);
        } else {
            $row = $cipherer->DecryptFetchedArray($pageObj->connection->fetch_array($rs));
        }
    }
    if (count($arrTmpTotal)) {
        foreach ($arrFields as $fName) {
            $value = array();
            foreach ($arrTmpTotal as $tvalue) {
                if ($tvalue["fName"] == $fName) {
                    $value = $tvalue;
                }
            }
            $total = "";
            $totalMess = "";
            if ($value["totalsType"]) {
                if ($value["totalsType"] == "COUNT") {
                    $totalMess = "Count" . ": ";
                } elseif ($value["totalsType"] == "TOTAL") {
                    $totalMess = "Total" . ": ";
                } elseif ($value["totalsType"] == "AVERAGE") {
                    $totalMess = "Average" . ": ";
                }
                $total = GetTotals($fName, $totals[$fName]["value"], $value["totalsType"], $totals[$fName]["numRows"], $value["viewFormat"], "export");
            }
            $arrTotal[$fName] = $total;
            $arrTotalMessage[$fName] = $totalMess;
        }
    }
    ExportExcelTotals($arrTotal, $arrTotalMessage, ++$iNumberOfRows, $objPHPExcel);
    $extExcel = ".xlsx";
    $formatExcel = "Excel2007";
    if (@$_REQUEST["type"] == "excel5") {
        $formatExcel = "Excel5";
        $extExcel = ".xls";
    }
    ExportExcelSave(GoodFieldName($pageObj->tName) . $extExcel, $formatExcel, $objPHPExcel);
}
function WriteTableData($cipherer)
{
    global $rs, $nPageSize, $strTableName, $conn, $eventObj, $pageObject;
    if ($eventObj->exists("ListFetchArray")) {
        $row = $eventObj->ListFetchArray($rs, $pageObject);
    } else {
        $row = $cipherer->DecryptFetchedArray($rs);
    }
    //	if(!$row)
    //		return;
    // write header
    echo "<tr>";
    if ($_REQUEST["type"] == "excel") {
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Customer Usaha Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Sumur Ke") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Sipa No") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Max Volume") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Disabled") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Update Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Create Uid") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Updated") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Created") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Customer Id") . '</td>';
        echo '<td style="width: 100" x:str>' . PrepareForExcel("Konterid") . '</td>';
    } else {
        echo "<td>" . "Id" . "</td>";
        echo "<td>" . "Customer Usaha Id" . "</td>";
        echo "<td>" . "Sumur Ke" . "</td>";
        echo "<td>" . "Sipa No" . "</td>";
        echo "<td>" . "Max Volume" . "</td>";
        echo "<td>" . "Disabled" . "</td>";
        echo "<td>" . "Update Uid" . "</td>";
        echo "<td>" . "Create Uid" . "</td>";
        echo "<td>" . "Updated" . "</td>";
        echo "<td>" . "Created" . "</td>";
        echo "<td>" . "Customer Id" . "</td>";
        echo "<td>" . "Konterid" . "</td>";
    }
    echo "</tr>";
    // write data rows
    $iNumberOfRows = 0;
    $pageObject->viewControls->forExport = "export";
    while ((!$nPageSize || $iNumberOfRows < $nPageSize) && $row) {
        countTotals($totals, $totalsFields, $row);
        $values = array();
        $values["id"] = $pageObject->getViewControl("id")->showDBValue($row, "");
        $values["customer_usaha_id"] = $pageObject->getViewControl("customer_usaha_id")->showDBValue($row, "");
        $values["sumur_ke"] = $pageObject->getViewControl("sumur_ke")->showDBValue($row, "");
        $values["sipa_no"] = $pageObject->getViewControl("sipa_no")->showDBValue($row, "");
        $values["max_volume"] = $pageObject->getViewControl("max_volume")->showDBValue($row, "");
        $values["disabled"] = $pageObject->getViewControl("disabled")->showDBValue($row, "");
        $values["update_uid"] = $pageObject->getViewControl("update_uid")->showDBValue($row, "");
        $values["create_uid"] = $pageObject->getViewControl("create_uid")->showDBValue($row, "");
        $values["updated"] = $pageObject->getViewControl("updated")->showDBValue($row, "");
        $values["created"] = $pageObject->getViewControl("created")->showDBValue($row, "");
        $values["customer_id"] = $pageObject->getViewControl("customer_id")->showDBValue($row, "");
        $values["konterid"] = $pageObject->getViewControl("konterid")->showDBValue($row, "");
        $eventRes = true;
        if ($eventObj->exists('BeforeOut')) {
            $eventRes = $eventObj->BeforeOut($row, $values, $pageObject);
        }
        if ($eventRes) {
            $iNumberOfRows++;
            echo "<tr>";
            echo '<td>';
            echo $values["id"];
            echo '</td>';
            echo '<td>';
            echo $values["customer_usaha_id"];
            echo '</td>';
            echo '<td>';
            echo $values["sumur_ke"];
            echo '</td>';
            if ($_REQUEST["type"] == "excel") {
                echo '<td x:str>';
            } else {
                echo '<td>';
            }
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["sipa_no"]);
            } else {
                echo $values["sipa_no"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["max_volume"];
            echo '</td>';
            echo '<td>';
            echo $values["disabled"];
            echo '</td>';
            echo '<td>';
            echo $values["update_uid"];
            echo '</td>';
            echo '<td>';
            echo $values["create_uid"];
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["updated"]);
            } else {
                echo $values["updated"];
            }
            echo '</td>';
            echo '<td>';
            if ($_REQUEST["type"] == "excel") {
                echo PrepareForExcel($values["created"]);
            } else {
                echo $values["created"];
            }
            echo '</td>';
            echo '<td>';
            echo $values["customer_id"];
            echo '</td>';
            echo '<td>';
            echo $values["konterid"];
            echo '</td>';
            echo "</tr>";
        }
        if ($eventObj->exists("ListFetchArray")) {
            $row = $eventObj->ListFetchArray($rs, $pageObject);
        } else {
            $row = $cipherer->DecryptFetchedArray($rs);
        }
    }
}