Ejemplo n.º 1
0
        $form->record_title = $rec_d['gmd_name'];
        // submit button attribute
        $form->submit_button_attr = 'name="saveData" value="' . __('Update') . '" class="button"';
    }
    /* Form Element(s) */
    // gmd code
    $form->addTextField('text', 'gmdCode', __('GMD Code') . '*', $rec_d['gmd_code'], 'style="width: 20%;" maxlength="3"');
    // gmd name
    $form->addTextField('text', 'gmdName', __('GMD Name') . '*', $rec_d['gmd_name'], 'style="width: 60%;"');
    // edit mode messagge
    if ($form->edit_mode) {
        echo '<div class="infoBox">' . __('You are going to edit gmd data') . ' : <b>' . $rec_d['gmd_name'] . '</b>  <br />' . __('Last Update') . $rec_d['last_update'] . '</div>';
        //mfc
    }
    // print out the form object
    echo $form->printOut();
} else {
    /* GMD LIST */
    // table spec
    $table_spec = 'mst_gmd AS g';
    // create datagrid
    $datagrid = new simbio_datagrid();
    if ($can_read and $can_write) {
        $datagrid->setSQLColumn('g.gmd_id', 'g.gmd_code AS \'' . __('GMD Code') . '\'', 'g.gmd_name AS \'' . __('GMD Name') . '\'', 'g.last_update AS \'' . __('Last Update') . '\'');
    } else {
        $datagrid->setSQLColumn('g.gmd_code AS \'' . __('GMD Code') . '\'', 'g.gmd_name AS \'' . __('GMD Name') . '\'', 'g.last_update AS \'' . __('Last Update') . '\'');
    }
    $datagrid->setSQLorder('gmd_name ASC');
    // is there any search
    if (isset($_GET['keywords']) and $_GET['keywords']) {
        $keywords = $dbs->escape_string($_GET['keywords']);