$file_attach_q = $dbs->query("SELECT fl.*, batt.* FROM files AS fl\r\n LEFT JOIN biblio_attachment AS batt ON fl.file_id=batt.file_id\r\n WHERE batt.biblio_id={$biblioID} AND batt.file_id={$fileID}"); $file_attach_d = $file_attach_q->fetch_assoc(); // edit mode if ($file_attach_d['biblio_id'] and $file_attach_d['file_id']) { $form->addHidden('updateBiblioID', $file_attach_d['biblio_id']); $form->addHidden('updateFileID', $file_attach_d['file_id']); } else { if ($biblioID) { $form->addHidden('updateBiblioID', $biblioID); } } // file title $form->addTextField('text', 'fileTitle', __('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); $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
} $biblio_q = $dbs->query('SELECT biblio_id, title, call_number FROM biblio WHERE biblio_id=' . $biblioID); $biblio_d = $biblio_q->fetch_assoc(); $b_title = $biblio_d['title']; $b_id = $biblio_d['biblio_id']; $def_call_number = $biblio_d['call_number']; } /* Form Element(s) */ // title if (!$in_pop_up) { $str_input = $b_title; $str_input .= '<div class="makeHidden"><a title="Edit Bibliographic Data" style="font-weight: bold; color: #ff9900;" href="javascript: openWin(\'' . MODULES_WEB_ROOT_DIR . 'bibliography/pop_biblio.php?inPopUp=true&action=detail&itemID=' . $rec_d['biblio_id'] . '&itemCollID=' . $rec_d['item_id'] . '\', \'popBiblio\', 600, 400, true)">Edit Biblographic data</a></div>'; } else { $str_input = $b_title; } $form->addAnything(__('Title'), $str_input); $form->addHidden('biblioTitle', $b_title); $form->addHidden('biblioID', $b_id); // 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 .= ' <span id="msgBox"> </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()) {
$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->addSelectList('location', __('Location'), $location_options); // item site $form->addTextField('text', 'itemSite', __('Shelf Location'), '', 'style="width: 20%;"'); // classification; $str_input = simbio_form_element::textField('text', 'classification', '', 'style="width: 60%;"'); $str_input .= '<br />' . __('Separate each class comma sign. Use * for wildcard'); $form->addAnything(__('Classification'), $str_input); // print out the object echo $form->printOut(); }
$file_attach_q = $dbs->query("SELECT fl.*, batt.* FROM files AS fl\n LEFT JOIN biblio_attachment AS batt ON fl.file_id=batt.file_id\n WHERE batt.biblio_id={$biblioID} AND batt.file_id={$fileID}"); $file_attach_d = $file_attach_q->fetch_assoc(); // edit mode if ($file_attach_d['biblio_id'] and $file_attach_d['file_id']) { $form->addHidden('updateBiblioID', $file_attach_d['biblio_id']); $form->addHidden('updateFileID', $file_attach_d['file_id']); } else { if ($biblioID) { $form->addHidden('updateBiblioID', $biblioID); } } // file title $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->edit_mode = true; // record ID for delete process $form->record_id = $itemID; // form record title $form->record_title = str_ireplace('label-', '', $rec_d['label_name']); // submit button attribute $form->submit_button_attr = 'name="saveData" value="' . __('Update') . '" class="button"'; } /* Form Element(s) */ // label name $form->addTextField('text', 'labelName', __('Label Name') . '*', $rec_d['label_name'], 'style="width: 60%;" maxlength="20"'); // label image if (empty($rec_d['label_image'])) { $str_input = simbio_form_element::textField('file', 'labelImage'); $str_input .= ' Maximum ' . $sysconf['max_image_upload'] . ' KB. All image will be automatically resized.'; $form->addAnything(__('File Attachment'), $str_input); } else { $str_input = '<div><img src="' . SENAYAN_WEB_ROOT_DIR . IMAGES_DIR . '/labels/' . $rec_d['label_image'] . '" align="middle" /> <strong>' . $rec_d['label_image'] . '</strong></div>'; $str_input .= simbio_form_element::textField('file', 'labelImage'); $str_input .= ' Maximum ' . $sysconf['max_image_upload'] . ' KB. All image will be automatically resized.'; $form->addAnything(__('File Attachment'), $str_input); } // label desc $form->addTextField('text', 'labelDesc', __('Label Description'), $rec_d['label_desc'], 'style="width: 100%;" maxlength="50"'); // edit mode messagge if ($form->edit_mode) { echo '<div class="infoBox">' . __('You are going to edit Label data') . ' : <b>' . $rec_d['label_name'] . ' - ' . $rec_d['label_desc'] . '</b> <br />' . __('Last Update') . $rec_d['last_update'] . '</div>'; //mfc } // print out the form object echo $form->printOut();
?> <hr /> <?php echo __('Import for bibliographics data from CSV file. For guide on CVS fields order and format please refer to documentation or visit <a href="http://senayan.diknas.go.id" target="_blank">Official Website</a>'); ?> </div> </fieldset> <div id="importInfo" class="infoBox" style="display: none;"> </div><div id="importError" class="errorBox" style="display: none;"> </div> <?php // create new instance $form = new simbio_form_table('mainForm', $_SERVER['PHP_SELF'], 'post'); $form->submit_button_attr = 'name="doImport" value="' . __('Import 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) */ // csv files $str_input = simbio_form_element::textField('file', 'importFile'); $str_input .= ' Maximum ' . $sysconf['max_upload'] . ' KB'; $form->addAnything(__('File To Import'), $str_input); // field separator $form->addTextField('text', 'fieldSep', __('Field Separator') . '*', '' . htmlentities(',') . '', 'style="width: 10%;" maxlength="3"'); // field enclosed $form->addTextField('text', 'fieldEnc', __('Field Enclosed With') . '*', '' . htmlentities('"') . '', 'style="width: 10%;"'); // number of records to import $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->submit_button_attr = 'name="saveData" value="' . __('Update') . '" class="button"'; } /* Form Element(s) */ // group $form->addTextField('text', 'groupName', __('Group Name') . '*', $rec_d['group_name'], 'style="width: 60%;"'); // privileges // get group access data $priv_data = array(); $rec_q = $dbs->query('SELECT * FROM group_access WHERE group_id=' . (!empty($rec_d['group_id']) ? $rec_d['group_id'] : 0)); while ($access_data = $rec_q->fetch_assoc()) { $priv_data[$access_data['module_id']]['r'] = $access_data['r']; $priv_data[$access_data['module_id']]['w'] = $access_data['w']; } $priv_table = ''; include 'module_priv_form.inc.php'; $form->addAnything(__('Privileges'), $priv_table); // edit mode messagge if ($form->edit_mode) { // print out the object echo '<div class="infoBox">' . __('You are going to edit Group data') . ' : <b>' . $rec_d['group_name'] . '</b> <br />' . __('Last Update') . $rec_d['last_update'] . '</div>'; //mfc } echo $form->printOut(); } else { /* GROUP LIST */ // table spec $table_spec = 'user_group AS ug'; // create datagrid $datagrid = new simbio_datagrid(); if ($can_read and $can_write) { $datagrid->setSQLColumn('ug.group_id', 'ug.group_name AS \'' . __('Group Name') . '\'', 'ug.last_update AS \'' . __('Last Update') . '\'');
$form->submit_button_attr = 'name="saveData" value="' . __('Update') . '" class="button"'; // element visibility class toogle $visibility = 'makeHidden'; } /* Form Element(s) */ // biblio title $form->addTextField('textarea', 'title', __('Title') . '*', $rec_d['title'], 'rows="1" style="width: 100%; overflow: auto;"'); // biblio edition $form->addTextField('text', 'edition', __('Edition'), $rec_d['edition'], 'style="width: 40%;"'); // biblio specific detail info/area $form->addTextField('textarea', 'specDetailInfo', __('Specific Detail Info'), $rec_d['spec_detail_info'], 'rows="2" style="width: 100%"'); // biblio item add if (!$in_pop_up and $form->edit_mode) { $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