// form record id
     $form->record_id = $itemID;
     // form record title
     $form->record_title = 'Loan Rules';
     // submit button attribute
     $form->submit_button_attr = 'name="saveData" value="' . __('Update') . '" class="button"';
 }
 /* Form Element(s) */
 // member type
 // get mtype data related to this record from database
 $mtype_query = $dbs->query('SELECT member_type_id, member_type_name FROM mst_member_type');
 $mtype_options = array();
 while ($mtype_data = $mtype_query->fetch_row()) {
     $mtype_options[] = array($mtype_data[0], $mtype_data[1]);
 }
 $form->addSelectList('memberTypeID', __('Member Type'), $mtype_options, $rec_d['member_type_id'], 'style="width: 50%;"');
 // collection type
 // get collection type data related to this record from database
 $ctype_query = $dbs->query('SELECT coll_type_id, coll_type_name FROM mst_coll_type');
 $ctype_options = array();
 while ($ctype_data = $ctype_query->fetch_row()) {
     $ctype_options[] = array($ctype_data[0], $ctype_data[1]);
 }
 $ctype_options[] = array('0', __('ALL'));
 $form->addSelectList('collTypeID', __('Collection Type'), $ctype_options, $rec_d['coll_type_id'], 'style="width: 50%;"');
 // gmd
 // get gmd data related to this record from database
 $gmd_query = $dbs->query('SELECT gmd_id, gmd_name FROM mst_gmd');
 $gmd_options[] = array(0, __('ALL'));
 while ($gmd_data = $gmd_query->fetch_row()) {
     $gmd_options[] = array($gmd_data[0], $gmd_data[1]);
Exemple #2
0
} else {
    // file upload dir
    // create simbio directory object
    $repo = new simbio_directory(REPO_BASE_DIR);
    $repo_dir_tree = $repo->getDirectoryTree(5);
    $repodir_options[] = array('', __('Repository ROOT'));
    if (is_array($repo_dir_tree)) {
        // sort array by index
        ksort($repo_dir_tree);
        // loop array
        foreach ($repo_dir_tree as $dir) {
            $repodir_options[] = array($dir, $dir);
        }
    }
    // add repo directory options to select list
    $form->addSelectList('fileDir', __('Repo. Directory'), $repodir_options);
    // file upload
    $str_input = simbio_form_element::textField('file', 'file2attach');
    $str_input .= ' Maximum ' . $sysconf['max_upload'] . ' KB';
    $form->addAnything(__('File To Attach'), $str_input);
}
// file url
$form->addTextField('textarea', 'fileURL', __('URL'), $file_attach_d['file_url'], 'rows="1" style="width: 100%; overflow: auto;"');
// file description
$form->addTextField('textarea', 'fileDesc', __('Description'), $file_attach_d['file_desc'], 'rows="2" style="width: 100%; overflow: auto;"');
// file access
$acctype_options[] = array('public', __('Public'));
$acctype_options[] = array('private', __('Private'));
$form->addSelectList('accessType', __('Access'), $acctype_options, $file_attach_d['access_type']);
// file access limit if set to public
$group_query = $dbs->query('SELECT member_type_id, member_type_name FROM mst_member_type');
    if (!$form->edit_mode) {
        // serial exemplar
        $form->addTextField('text', 'exemplar', __('Total Exemplar Expected') . '*', '1');
    }
    // serial periode name
    $form->addTextField('text', 'period', __('Period Name') . '*', $rec_d['period'], 'style="width: 100%;"');
    // serial notes
    $form->addTextField('textarea', 'notes', __('Subscription Notes'), $rec_d['notes'], 'style="width: 100%;" rows="3"');
    // serial gmd
    // get gmd data related to this record from database
    $gmd_q = $dbs->query('SELECT gmd_id, gmd_name FROM mst_gmd');
    $gmd_options = array();
    while ($gmd_d = $gmd_q->fetch_row()) {
        $gmd_options[] = array($gmd_d[0], $gmd_d[1]);
    }
    $form->addSelectList('gmdID', __('GMD'), $gmd_options, $rec_d['gmd_id']);
    // serial biblio ID
    $form->addHidden('biblioID', $biblioID);
    // edit mode messagge
    if ($form->edit_mode) {
        echo '<div class="infoBox">' . __('You are going to edit Subscription data') . ' : <b>' . $rec_d['period'] . '</b><div><i>' . $rec_d['notes'] . '</i></div></div>';
        //mfc
    }
    // print out the form object
    echo $form->printOut();
} else {
    /* SUBSCRIPTION LIST */
    function serialTitle($obj_db, $array_data)
    {
        $_output = '';
        $_output .= '<div style="font-weight: bold; font-size: 110%;">' . $array_data[1] . '</div>';
 $form->submit_button_attr = 'name="saveData" value="' . __('Initialize Stock Take') . '" class="button"';
 // form table attributes
 $form->table_attr = 'align="center" class="dataList" cellpadding="5" cellspacing="0"';
 $form->table_header_attr = 'class="alterCell" style="font-weight: bold;"';
 $form->table_content_attr = 'class="alterCell2"';
 /* Form Element(s) */
 // stock take name
 $form->addTextField('text', 'name', __('Stock Take Name') . '*', '', 'style="width: 60%;"');
 // gmd
 // get gmd data related to this record from database
 $gmd_q = $dbs->query('SELECT gmd_id, gmd_name FROM mst_gmd');
 $gmd_options[] = array('0', __('ALL'));
 while ($gmd_d = $gmd_q->fetch_row()) {
     $gmd_options[] = array($gmd_d[0], $gmd_d[1]);
 }
 $form->addSelectList('gmdID', __('GMD'), $gmd_options);
 // collection type
 // get coll_type data related to this record from database
 $coll_type_q = $dbs->query('SELECT coll_type_id, coll_type_name FROM mst_coll_type');
 $coll_type_options[] = array('0', __('ALL'));
 while ($coll_type_d = $coll_type_q->fetch_row()) {
     $coll_type_options[] = array($coll_type_d[0], $coll_type_d[1]);
 }
 $form->addSelectList('collTypeID', __('Collection Type'), $coll_type_options);
 // location
 // get language data related to this record from database
 $location_q = $dbs->query("SELECT location_id, location_name FROM mst_location");
 $location_options[] = array('0', __('ALL'));
 while ($location_d = $location_q->fetch_row()) {
     $location_options[] = array($location_d[0], $location_d[1]);
 }
        $form->edit_mode = true;
        // record ID for delete process
        $form->record_id = $itemID;
        // form record title
        $form->record_title = $rec_d['author_name'];
        // submit button attribute
        $form->submit_button_attr = 'name="saveData" value="' . __('Update') . '" class="button"';
    }
    /* Form Element(s) */
    // author name
    $form->addTextField('text', 'authorName', __('Author Name') . '*', $rec_d['author_name'], 'style="width: 60%;"');
    // authority type
    foreach ($sysconf['authority_type'] as $auth_type_id => $auth_type) {
        $auth_type_options[] = array($auth_type_id, $auth_type);
    }
    $form->addSelectList('authorityType', __('Authority Type'), $auth_type_options, $rec_d['authority_type']);
    // authority list
    $form->addTextField('text', 'authList', __('Authority Files'), $rec_d['auth_list'], 'style="width: 30%;"');
    // edit mode messagge
    if ($form->edit_mode) {
        echo '<div class="infoBox">' . __('You are going to edit author data') . ' : <b>' . $rec_d['author_name'] . '</b> <br />' . __('Last Update') . $rec_d['last_update'] . '</div>';
        //mfc
    }
    // print out the form object
    echo $form->printOut();
} else {
    /* AUTHOR LIST */
    // table spec
    $table_spec = 'mst_author AS a';
    // authority field num
    $auth_type_fld = 1;
 // item code
 $str_input = simbio_form_element::textField('text', 'itemCode', $rec_d['item_code'], 'onblur="ajaxCheckID(\'' . SENAYAN_WEB_ROOT_DIR . 'admin/AJAX_check_id.php\', \'item\', \'item_code\', \'msgBox\', \'itemCode\')" style="width: 40%;"');
 $str_input .= ' &nbsp; <span id="msgBox">&nbsp;</span>';
 $form->addAnything(__('Item Code'), $str_input);
 // call number
 $form->addTextField('text', 'callNumber', __('Call Number'), isset($rec_d['call_number']) ? $rec_d['call_number'] : $def_call_number, 'style="width: 40%;"');
 // inventory code
 $form->addTextField('text', 'inventoryCode', __('Inventory Code'), $rec_d['inventory_code'], 'style="width: 100%;"');
 // item location
 // get location data related to this record from database
 $location_q = $dbs->query("SELECT location_id, location_name FROM mst_location");
 $location_options = array();
 while ($location_d = $location_q->fetch_row()) {
     $location_options[] = array($location_d[0], $location_d[1]);
 }
 $form->addSelectList('locationID', __('Location'), $location_options, $rec_d['location_id']);
 // item site
 $form->addTextField('text', 'itemSite', __('Shelf Location'), $rec_d['site'], 'style="width: 40%;"');
 // collection type
 // get collection type data related to this record from database
 $coll_type_q = $dbs->query("SELECT coll_type_id, coll_type_name FROM mst_coll_type");
 $coll_type_options = array();
 while ($coll_type_d = $coll_type_q->fetch_row()) {
     $coll_type_options[] = array($coll_type_d[0], $coll_type_d[1]);
 }
 $form->addSelectList('collTypeID', __('Collection Type'), $coll_type_options, $rec_d['coll_type_id']);
 // item status
 // get item status data from database
 $item_status_q = $dbs->query("SELECT item_status_id, item_status_name FROM mst_item_status");
 $item_status_options[] = array('0', __('Available'));
 while ($item_status_d = $item_status_q->fetch_row()) {
?>
<fieldset class="menuBox">
<div class="menuBoxInner exportIcon">
    <?php 
echo strtoupper(__('Export Data')) . '<hr />' . __('Export member(s) data to CSV file');
?>
</div>
</fieldset>
<?php 
// create new instance
$form = new simbio_form_table('mainForm', $_SERVER['PHP_SELF'] . '', 'post');
$form->submit_button_attr = 'name="doExport" value="' . __('Export Now') . '" class="button"';
// form table attributes
$form->table_attr = 'align="center" class="dataList" cellpadding="5" cellspacing="0"';
$form->table_header_attr = 'class="alterCell" style="font-weight: bold;"';
$form->table_content_attr = 'class="alterCell2"';
/* Form Element(s) */
// field separator
$form->addTextField('text', 'fieldSep', __('Field Separator') . '*', '' . htmlentities(',') . '', 'style="width: 10%;"');
//  field enclosed
$form->addTextField('text', 'fieldEnc', __('Field Enclosed With'), '' . htmlentities('"') . '', 'style="width: 10%;"');
// record separator
$rec_sep_options[] = array('NEWLINE', 'NEWLINE');
$rec_sep_options[] = array('RETURN', 'CARRIAGE RETURN');
$form->addSelectList('recordSep', __('Record Separator'), $rec_sep_options);
// number of records to export
$form->addTextField('text', 'recordNum', __('Number of Records To Export (0 for all records)'), '0', 'style="width: 10%;"');
// records offset
$form->addTextField('text', 'recordOffset', __('Start From Record'), '1', 'style="width: 10%;"');
// output the form
echo $form->printOut();
     // form record title
     $form->record_title = $rec_d['frequency'];
     // submit button attribute
     $form->submit_button_attr = 'name="saveData" value="' . __('Update') . '" class="button"';
 }
 /* Form Element(s) */
 // frequency name
 $form->addTextField('text', 'frequencyName', __('Frequency') . '*', $rec_d['frequency'], 'style="width: 60%;"');
 // frequency language
 // get language data related to this record from database
 $lang_q = $dbs->query('SELECT language_id, language_name FROM mst_language');
 $lang_options = array();
 while ($lang_d = $lang_q->fetch_row()) {
     $lang_options[] = array($lang_d[0], $lang_d[1]);
 }
 $form->addSelectList('languagePrefix', __('Language'), $lang_options, $rec_d['language_prefix']);
 // frequency time increment
 $form->addTextField('text', 'timeIncrement', __('Time Increment') . '*', $rec_d['time_increment'], 'style="width: 10%;"');
 // frequency time unit
 $unit_options[] = array('day', __('Day'));
 $unit_options[] = array('week', __('Week'));
 $unit_options[] = array('month', __('Month'));
 $unit_options[] = array('year', __('Year'));
 $form->addSelectList('timeUnit', __('Time Unit'), $unit_options, $rec_d['time_unit']);
 // edit mode messagge
 if ($form->edit_mode) {
     echo '<div class="infoBox">' . __('You are going to edit Frequency data') . ' : <b>' . $rec_d['frequency'] . '</b>  <br />' . __('Last Update') . $rec_d['last_update'] . '</div>';
     //mfc
 }
 // print out the form object
 echo $form->printOut();
$form->addTextField('text', 'fileTitle', lang_mod_biblio_attach_form_field_title, $file_attach_d['file_title'], 'style="width: 100%; overflow: auto;"');
// file attachment
if ($file_attach_d['file_name']) {
    $form->addAnything('Attachment', $file_attach_d['file_dir'] . '/' . $file_attach_d['file_name']);
} else {
    // file upload dir
    // create simbio directory object
    $repo = new simbio_directory(REPO_BASE_DIR);
    $repo_dir_tree = $repo->getDirectoryTree(5);
    // sort array by index
    ksort($repo_dir_tree);
    // loop array
    foreach ($repo_dir_tree as $dir) {
        $repodir_options[] = array($dir, $dir);
    }
    $form->addSelectList('fileDir', lang_mod_biblio_attach_form_field_filedir, $repodir_options);
    // file upload
    $str_input = simbio_form_element::textField('file', 'file2attach');
    $str_input .= ' Maximum ' . $sysconf['max_upload'] . ' KB';
    $form->addAnything(lang_mod_biblio_attach_form_field_browse, $str_input);
}
// file url
$form->addTextField('textarea', 'fileURL', lang_mod_biblio_attach_form_field_url, $file_attach_d['file_url'], 'rows="1" style="width: 100%; overflow: auto;"');
// file description
$form->addTextField('textarea', 'fileDesc', lang_mod_biblio_attach_form_field_description, $file_attach_d['file_desc'], 'rows="2" style="width: 100%; overflow: auto;"');
// file access
$acctype_options[] = array('public', lang_mod_biblio_attach_form_opt_public);
$acctype_options[] = array('private', lang_mod_biblio_attach_form_opt_private);
$form->addSelectList('accessType', lang_mod_biblio_attach_form_field_access, $acctype_options, $file_attach_d['access_type']);
// print out the object
echo $form->printOut();
    if (!$form->edit_mode) {
        // serial exemplar
        $form->addTextField('text', 'exemplar', lang_mod_serial_field_exemplar . '*', '1');
    }
    // serial periode name
    $form->addTextField('text', 'period', lang_mod_serial_field_period . '*', $rec_d['period'], 'style="width: 100%;"');
    // serial notes
    $form->addTextField('textarea', 'notes', lang_mod_serial_field_notes, $rec_d['notes'], 'style="width: 100%;" rows="3"');
    // serial gmd
    // get gmd data related to this record from database
    $gmd_q = $dbs->query('SELECT gmd_id, gmd_name FROM mst_gmd');
    $gmd_options = array();
    while ($gmd_d = $gmd_q->fetch_row()) {
        $gmd_options[] = array($gmd_d[0], $gmd_d[1]);
    }
    $form->addSelectList('gmdID', lang_mod_biblio_field_gmd, $gmd_options, $rec_d['gmd_id']);
    // serial biblio ID
    $form->addHidden('biblioID', $biblioID);
    // edit mode messagge
    if ($form->edit_mode) {
        echo '<div class="infoBox">' . lang_mod_serial_common_info . '<b>' . $rec_d['period'] . '</b><div><i>' . $rec_d['notes'] . '</i></div></div>';
    }
    // print out the form object
    echo $form->printOut();
} else {
    /* SUBSCRIPTION LIST */
    function serialTitle($obj_db, $array_data)
    {
        $_output = '';
        $_output .= '<div style="font-weight: bold; font-size: 110%;">' . $array_data[1] . '</div>';
        $_output .= '<div style="font-weight: bold; font-size: 90%;"><a href="' . MODULES_WEB_ROOT_DIR . 'serial_control/kardex.php?serialID=' . $array_data[0] . '" title="' . lang_mod_serial_subscription_kardex . '">' . lang_mod_serial_subscription_kardex . '</a></div>';
     $str_input = '<div class="makeHidden"><a href="javascript: openWin(\'' . MODULES_WEB_ROOT_DIR . 'bibliography/pop_item.php?inPopUp=true&action=detail&biblioID=' . $rec_d['biblio_id'] . '\', \'popItem\', 600, 400, true)">' . __('Add New Items') . '</a></div>';
     $str_input .= '<iframe name="itemIframe" id="itemIframe" class="borderAll" style="width: 100%; height: 70px;" src="' . MODULES_WEB_ROOT_DIR . 'bibliography/iframe_item_list.php?biblioID=' . $rec_d['biblio_id'] . '"></iframe>' . "\n";
     $form->addAnything('Item(s) Data', $str_input);
 }
 // biblio authors
 $str_input = '<div class="' . $visibility . '"><a href="javascript: openWin(\'' . MODULES_WEB_ROOT_DIR . 'bibliography/pop_author.php?biblioID=' . $rec_d['biblio_id'] . '\', \'popAuthor\', 500, 200, true)">' . __('Add Author(s)') . '</a></div>';
 $str_input .= '<iframe name="authorIframe" id="authorIframe" class="borderAll" style="width: 100%; height: 70px;" src="' . MODULES_WEB_ROOT_DIR . 'bibliography/iframe_author.php?biblioID=' . $rec_d['biblio_id'] . '"></iframe>';
 $form->addAnything(__('Author(s)'), $str_input);
 // biblio gmd
 // get gmd data related to this record from database
 $gmd_q = $dbs->query('SELECT gmd_id, gmd_name FROM mst_gmd');
 $gmd_options = array();
 while ($gmd_d = $gmd_q->fetch_row()) {
     $gmd_options[] = array($gmd_d[0], $gmd_d[1]);
 }
 $form->addSelectList('gmdID', __('GMD'), $gmd_options, $rec_d['gmd_id']);
 // biblio publish frequencies
 // get frequency data related to this record from database
 $freq_q = $dbs->query('SELECT frequency_id, frequency FROM mst_frequency');
 $freq_options[] = array('0', strtoupper(__('Not Applicable')));
 while ($freq_d = $freq_q->fetch_row()) {
     $freq_options[] = array($freq_d[0], $freq_d[1]);
 }
 $str_input = simbio_form_element::selectList('frequencyID', $freq_options, $rec_d['frequency_id']);
 $str_input .= '&nbsp;';
 $str_input .= ' ' . __('Use this for Serial publication');
 $form->addAnything(__('Frequency'), $str_input);
 // biblio ISBN/ISSN
 $form->addTextField('text', 'isbn_issn', __('ISBN/ISSN'), $rec_d['isbn_issn'], 'style="width: 40%;"');
 // biblio classification
 $form->addTextField('text', 'class', __('Classification'), $rec_d['classification'], 'style="width: 40%;"');