<?php
    function RetRstFieldm($ssql) {
        $rs=mysql_query($ssql) or die( "RetRstField :".$ssql);
        $r= mysql_fetch_array($rs, MYSQL_NUM) ;
        if(isset($r[0]))
            return  $r[0];
        else return '';
    }

    include "include_custom/config_setting.php";
        
    //define('_APP_PATH',"D:/wamp/www/isnet-abr/");
    //define('_FOLDER_PATH',"isnet-abr");
    //define('_SERVER_DB',"localhost");
    //define('_USER_DB',"root");
    //define('_PASS_DB',"");
    //define('_NAME_DB',"isnet-abr");
    
    
    //define('_REPORT_TYPE',"html");
    //define('_REPORT_TYPE',"jasper");

    //define('LIMIT_PAGE_REPORT',5);
     
    define('_REPORT_PATH',_APP_PATH);
    define('_REPORT_LIPS',"C:/Program Files (x86)/Java/ireport_lib/lib");
    // define('_CONNECTION_STRING',"jdbc:mysql://localhost/isnet-abr");
    define('_CONNECTION_STRING',"jdbc:mysql://"._SERVER_DB."/"._FOLDER_PATH);
    
    mysql_connect(_SERVER_DB,_USER_DB,_PASS_DB) or die("Could not connect");
    mysql_select_db(_NAME_DB) or die("Could not select database");

    // $_REQUEST['DIRECT_EXECUTE_SQL']=0;

    // $DEBUGSQL=1;
    // $GARR_SQL=array();
    // $SHOW_DAFTAR=0;
    
    // session variables
    $_SESSION["fdstart_period"] = RetRstFieldm("SELECT fdstart_period FROM tscompany_info");
    $_SESSION["sys_multi_currency"] = RetRstFieldm("SELECT IFNULL(ftvalue,0) FROM tssys_setting WHERE ftsys_code = 'ACC01'");
                
    // Internal Setting
    $_SESSION["SOAutoDOPrint"] = RetRstFieldm("SELECT ftvalue FROM tssys_setting WHERE ftsys_code = 'SLS02'");
    $_SESSION["SOAutoDOSave"] = RetRstFieldm("SELECT ftvalue FROM tssys_setting WHERE ftsys_code = 'SLS03'");
    $_SESSION["SIAutoDO"] = RetRstFieldm("SELECT ftvalue FROM tssys_setting WHERE ftsys_code = 'SLS04'");
    $_SESSION["SOManual"] = RetRstFieldm("SELECT ftvalue FROM tssys_setting WHERE ftsys_code = 'SLS05'");
    $_SESSION["QtyMinus"] = RetRstFieldm("SELECT ftvalue FROM tssys_setting WHERE ftsys_code = 'SLS15'");
?>
