"; echo "
กรุณาทำการ Login ก่อน
execQuery($query); $numrows = $dbObj->_numrows; /** Paging */ $display = ( !isset ($_GET['page']) ) ? 1 : $_GET['page']; $start = ( ($display * $limit) - $limit ); /** Paging */ if( isset($_GET['OrderBy']) ) { if( $keyword != "" ) { // ใส่ Keyword $query = " SELECT * FROM research_tb rt, researchform_tb rf , research_public_tb rb WHERE rt.ReFormId = rf.ReFormId and rt.Research_code = rb.Research_code and rb.ReTyId='1' and rt.ReFormId='$ReFormId' and fiscal_year_finish='$fiscal_year_finish' ORDER BY $OrderBy $ASCDESC "; } else { $query = " SELECT * FROM research_tb rt, researchform_tb rf , research_public_tb rb WHERE rt.ReFormId = rf.ReFormId and rt.Research_code = rb.Research_code and rb.ReTyId='1' and rt.ReFormId='$ReFormId' and fiscal_year_finish='$fiscal_year_finish' ORDER BY $OrderBy $ASCDESC "; } } elseif( !isset($_GET['OrderBy']) ) { if( $keyword != "" ) { // ใส่ Keyword $query = " SELECT *FROM research_tb rt, researchform_tb rf , research_public_tb rb WHERE rt.ReFormId = rf.ReFormId and rt.Research_code = rb.Research_code and rb.ReTyId='1' and rt.ReFormId='$ReFormId' and fiscal_year_finish='$fiscal_year_finish' ORDER BY $OrderBy $ASCDESC "; } else { $query = " SELECT * FROM research_tb rt, researchform_tb rf , research_public_tb rb WHERE rt.ReFormId = rf.ReFormId and rt.Research_code = rb.Research_code and rb.ReTyId='1' and rt.ReFormId='$ReFormId' and fiscal_year_finish='$fiscal_year_finish' ORDER BY $OrderBy $ASCDESC "; } } $query .= " LIMIT $start, $limit "; $result = $dbObj->execQuery($query); ?> |