<?php

if($_REQUEST['ajax']) {
    switch($_REQUEST['code']) {
        case "transno":
            if(RetRstField("SELECT fnid FROM tscompany_info WHERE ftcompany_code='{$_REQUEST['fttrans_no']}'")) {
            ?>
                alert('Kode Tipe Document sudah dipakai... ');
            <?php
            }
            else {
            ?>
                submitbutton('Simpan','','','','');
            <?php
            }
            break;
    }       
    die("");
}

$objAxpDB->ViewName("Daftar Company Profile");
$objAxpDB->ViewSQL("select fnid,  ftcompany_code, ftcompany_name from tscompany_info");
$objAxpDB->ViewCaption("ID,  Kode Company Profile,  Nama Company Profile");

$objAxpDB->FormName("Company Profile");
$objAxpDB->FormSQL("SELECT   ftcompany_code, ftcompany_name,fttheme  from tscompany_info");
$objAxpDB->FormCaption(" Kode Company Profile, Nama Company Profile,Tema");
$objAxpDB->FormPosition("TL, TL,TL");
$objAxpDB->Lookup("fttheme", "SELECT 'default' AS A, 'Default' AS B 
                                UNION ALL SELECT 'blue' AS A,'Blue' AS B 
                                UNION ALL SELECT 'purple' AS A,'Purple' AS B ", "A", "B", "fttheme", "fttheme", -1,TRUE);

$objAxpDB->SetStatus("id");
if ($objAxpDB->GetStatus("id") == "") {
        // $objAxpDB->ButtonShow("");
} elseif ($objAxpDB->GetStatus("id") == 0) {
        $objAxpDB->FormLocked("0, 0, 0");
        $objAxpDB->ButtonShow("reset, simpan, tutup");
} elseif ($objAxpDB->GetStatus("id") != 0) {
        $objAxpDB->FormLocked("1, 0, 0");
        $objAxpDB->ButtonShow("update, tutup");
}
$objAxpDB->Process();
$objAxpDB->WriteHtmlTable();
	   
       
?>
