コード例 #1
0
ファイル: index-fx.php プロジェクト: nojimage/fxphp
$BookQuery = new FX($serverIP, $webCompanionPort, 'FMPro7');
// This line creates an instance of the FX class
// If you use version 6 pro/unlimited, modify to 'FMPro5/6' from 'FMPro7'.
$BookQuery->SetDBData("Book_List.fp7", "Detail_View");
// The '->' indicates that SetDBData is part of the FX instance we just created.
$arrayName = 'HTTP_' . $HTTP_SERVER_VARS["REQUEST_METHOD"] . '_VARS';
// Note the '$$' a couple of lines down.  I'm using a variable
// whose name is the contents of another variable.  VERY handy.
// **** Added by msyk 2004/3/23 **** To make a new record in DB.
if (${$arrayName}['currentQuery'] == 'New Record') {
    foreach ($HTTP_POST_VARS as $key => $value) {
        if ($key != 'currentQuery' && $key != 'currentSort') {
            $BookQuery->AddDBParam($key, stripslashes($value));
        }
    }
    $BookQuery->FMNew();
}
//$BookQuery->SetDBData("Book_List.fp7", "Book_List");
// The extension in the file name omited for multi version compatibility(msyk)
if (${$arrayName}['currentSort'] != '') {
    // If sorting has been requested, this adds it to the query.
    $BookQuery->AddSortParam($HTTP_GET_VARS['currentSort']);
}
if (${$arrayName}['currentQuery'] == 'Search Book List!') {
    // Check if this page is being accessed by a search
    foreach (${$arrayName} as $key => $value) {
        // 'foreach()' is a VERY handy function.  It steps
        // through an array and stores the data in temporary
        // variables as directed ($key and $value in this case)
        if ($key != 'currentSort' && $key != 'currentQuery') {
            $BookQuery->AddDBParam($key, $value);