$reserve_q = $dbs->query('SELECT r.member_id, m.member_name
         FROM reserve AS r
         LEFT JOIN member AS m ON r.member_id=m.member_id
         WHERE item_code=\'' . $loan_d['item_code'] . '\' ORDER BY reserve_date DESC');
     $reserve_d = $reserve_q->fetch_row();
     $member = $reserve_d[1] . ' (' . $reserve_d[0] . ')';
     $reserve_msg = str_replace(array('{itemCode}', '{member}'), array($loan_d['item_code'], $member), __('Item {itemCode} is being reserved by member {member}'));
     //mfc
     $loan_d['title'] .= '<div>' . $reserve_msg . '</div>';
 }
 // write log
 utility::writeLogs($dbs, 'member', $loan_d['member_id'], 'circulation', $_SESSION['realname'] . ' return item (' . $_POST['quickReturnID'] . ') with title (' . $loan_d['title'] . ') with Quick Return method');
 // show loan information
 include SIMBIO_BASE_DIR . 'simbio_GUI/table/simbio_table.inc.php';
 // create table object
 $table = new simbio_table();
 $table->table_attr = 'class="border" style="width: 100%; margin-bottom: 5px;" cellpadding="5" cellspacing="0"';
 // append data to table row
 $table->appendTableRow(array('Item ' . $_POST['quickReturnID'] . __(' successfully returned on') . $return_date));
 //mfc
 $table->appendTableRow(array(__('Title'), $loan_d['title']));
 $table->appendTableRow(array(__('Member Name'), $loan_d['member_name'], __('Member ID'), $loan_d['member_id']));
 $table->appendTableRow(array(__('Loan Date'), $loan_d['loan_date'], __('Due Date'), $loan_d['due_date']));
 // set the cell attributes
 $table->setCellAttr(1, null, 'class="dataListHeader" style="color: #FFFFFF; font-weight: bold;" colspan="4"');
 $table->setCellAttr(2, 0, 'class="alterCell"');
 $table->setCellAttr(2, 1, 'class="alterCell2" colspan="3"');
 $table->setCellAttr(3, 0, 'class="alterCell" width="15%"');
 $table->setCellAttr(3, 1, 'class="alterCell2" width="35%"');
 $table->setCellAttr(3, 2, 'class="alterCell" width="15%"');
 $table->setCellAttr(3, 3, 'class="alterCell2" width="35%"');
  }
}
</script>
<?php 
if (isset($_POST['remove'])) {
    $tid = (int) $_POST['tid'];
    $vid = (int) $_POST['remove'];
    $sql_op = new simbio_dbop($dbs);
    $sql_op->delete('mst_voc_ctrl', 'topic_id=' . $tid . ' AND vocabolary_id=' . $vid);
    echo '<script type="text/javascript">';
    echo 'alert(\'' . addslashes(__('Topic succesfully removed!')) . '\');';
    echo 'location.href = \'iframe_vocabolary_control.php?itemID=' . $tid . '\';';
    echo '</script>';
}
if ($itemID) {
    $table = new simbio_table();
    $table->table_attr = 'align="center" class="detailTable" style="width: 98%;" cellpadding="2" cellspacing="0"';
    // query database
    $voc_q = $dbs->query('SELECT * FROM mst_voc_ctrl WHERE topic_id=' . $itemID);
    $row = 1;
    while ($voc_d = $voc_q->fetch_assoc()) {
        if (!is_null($voc_d['scope'])) {
            echo '<b>Scope note: </b>' . $voc_d['scope'] . '<hr>';
        }
        if (is_null($voc_d['scope'])) {
            // fallback related topic id
            $topic_q = $dbs->query('SELECT topic FROM mst_topic WHERE topic_id=' . $voc_d['related_topic_id']);
            $topic_d = $topic_q->fetch_row();
            // alternate the row color
            $row_class = $row % 2 == 0 ? 'alterCell' : 'alterCell2';
            // links
 /**
  * View kardex list
  * @return  string
  **/
 public function viewKardexes()
 {
     $_can_read = utility::havePrivilege('serial_control', 'r');
     $_can_write = utility::havePrivilege('serial_control', 'w');
     // start the output buffer
     ob_start();
     ?>
     <script type="text/javascript">
     function confirmProcess(int_serial_id, int_kardex_id)
     {
         var confirmBox = confirm('Are you sure to remove selected Kardex data?' + "\n" + 'Once deleted, it can\'t be restored!');
         if (confirmBox) {
             // set hidden element value
             document.hiddenActionForm.serialID.value = int_serial_id;
             document.hiddenActionForm.remove.value = int_kardex_id;
             // submit form
             document.hiddenActionForm.submit();
         }
     }
     </script>
     <?php 
     $_table = new simbio_table();
     $_table->table_attr = 'align="center" class="detailTable" style="width: 100%;" cellpadding="2" cellspacing="0"';
     $_table->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
     $_table->highlight_row = true;
     $_table->setHeader(array('&nbsp;', __('Date Expected'), __('Date Received'), __('Seq. Number'), __('Note')));
     if ($_can_read and $_can_write) {
         $_add_link = '<span title="Add New Kardex" class="extendLink">&nbsp;</span>';
         $_date_exp = simbio_form_element::dateField('dateExpected[0]');
         $_date_rec = simbio_form_element::dateField('dateReceived[0]');
         $_seq_num = simbio_form_element::textField('text', 'seqNumber[0]', '', 'width: 100%;');
         $_notes = simbio_form_element::textField('text', 'notes[0]', '', 'width: 100%;');
         $_table->appendTableRow(array($_add_link, $_date_exp, $_date_rec, $_seq_num, $_notes));
         $_table->setCellAttr(1, null, 'valign="top" class="alterCell2" style="font-weight: bold; width: auto;"');
         $_table->setCellAttr(1, 0, 'valign="top" class="alterCell2" style="font-weight: bold; width: 5%;"');
         $_table->setCellAttr(1, 1, 'valign="top" class="alterCell2" style="font-weight: bold; width: 25%;"');
         $_table->setCellAttr(1, 2, 'valign="top" class="alterCell2" style="font-weight: bold; width: 25%;"');
     }
     $_row = 2;
     foreach ($this->getKardexes() as $_kardex) {
         // alternate the row color
         $_row_class = $_row % 2 == 0 ? 'alterCell' : 'alterCell2';
         if ($_can_read and $_can_write) {
             // kardex removal links
             $_remove_link = '<a href="#" onclick="confirmProcess(' . $this->serial_id . ', ' . $_kardex['kardex_id'] . ')" class="trashLink notAJAX">&nbsp;</a>';
             $_date_exp = simbio_form_element::dateField('dateExpected[' . $_kardex['kardex_id'] . ']', $_kardex['date_expected']);
             $_date_rec = simbio_form_element::dateField('dateReceived[' . $_kardex['kardex_id'] . ']', $_kardex['date_received']);
             $_seq_num = simbio_form_element::textField('text', 'seqNumber[' . $_kardex['kardex_id'] . ']', $_kardex['seq_number'], 'width: 100%;');
             $_notes = simbio_form_element::textField('text', 'notes[' . $_kardex['kardex_id'] . ']', $_kardex['notes'], 'width: 100%;');
         } else {
             $_remove_link = '&nbsp;';
             $_date_exp = $_kardex['date_expected'];
             $_date_rec = $_kardex['date_received'];
             $_seq_num = $_kardex['seq_number'];
             $_notes = $_kardex['notes'];
         }
         $_table->appendTableRow(array($_remove_link, $_date_exp, $_date_rec, $_seq_num, $_notes));
         $_table->setCellAttr($_row, null, 'valign="top" class="' . $_row_class . '" style="font-weight: bold; width: auto;"');
         $_table->setCellAttr($_row, 0, 'valign="top" class="' . $_row_class . '" style="font-weight: bold; width: 5%;"');
         $_table->setCellAttr($_row, 1, 'valign="top" class="' . $_row_class . '" style="font-weight: bold; width: 25%;"');
         $_table->setCellAttr($_row, 2, 'valign="top" class="' . $_row_class . '" style="font-weight: bold; width: 25%;"');
         $_row++;
     }
     // button
     $_button_grp = '<div style="padding: 3px; background: #999999;"><input type="submit" class="button" name="saveKardexes" value="' . __('Save') . '" /></div>';
     // header
     echo '<div style="padding: 5px; background: #CCCCCC;">' . __('Kardex Detail for subscription') . ' <strong>' . $this->serial_period . '</strong></div>';
     if ($_can_read and $_can_write) {
         echo '<form method="post" name="kardexListForm" id="kardexListForm" action="' . $_SERVER['PHP_SELF'] . '">';
         echo $_button_grp;
     }
     echo $_table->printTable();
     if ($_can_read and $_can_write) {
         echo $_button_grp;
         echo simbio_form_element::hiddenField('serialID', $this->serial_id);
         echo '</form>';
         // hidden form
         echo '<form name="hiddenActionForm" method="post" action="' . $_SERVER['PHP_SELF'] . '"><input type="hidden" name="serialID" value="0" /><input type="hidden" name="remove" value="0" /></form>';
     }
     /* main content end */
     $_content = ob_get_clean();
     return $_content;
 }
 */
/* Reporting section */
// main system configuration
require '../../../sysconfig.inc.php';
// start the session
require SENAYAN_BASE_DIR . 'admin/default/session.inc.php';
require SENAYAN_BASE_DIR . 'admin/default/session_check.inc.php';
require SIMBIO_BASE_DIR . 'simbio_GUI/table/simbio_table.inc.php';
// privileges checking
$can_read = utility::havePrivilege('reporting', 'r');
$can_write = utility::havePrivilege('reporting', 'w');
if (!$can_read) {
    die('<div class="errorBox">' . lang_sys_common_no_privilage . '</div>');
}
/* loan report */
$table = new simbio_table();
$table->table_attr = 'align="center" class="border" cellpadding="5" cellspacing="0"';
// total number of member
$report_query = $dbs->query('SELECT COUNT(member_id) FROM member');
$report_data = $report_query->fetch_row();
$loan_report[lang_mod_report_member_field_registered] = $report_data[0];
// total number of active member
$report_query = $dbs->query('SELECT COUNT(member_id) FROM member
    WHERE TO_DAYS(expire_date)>TO_DAYS(\'' . date('Y-m-d') . '\')');
$report_data = $report_query->fetch_row();
$loan_report[lang_mod_report_member_field_active] = $report_data[0];
// total number of active member by membership type
$report_query = $dbs->query('SELECT member_type_name, COUNT(member_id) FROM mst_member_type AS mt
    LEFT JOIN member AS m ON mt.member_type_id=m.member_type_id
    WHERE TO_DAYS(expire_date)>TO_DAYS(\'' . date('Y-m-d') . '\')
    GROUP BY m.member_type_id ORDER BY COUNT(member_id) DESC');
        $author_year = $biblio_author_d['author_year'];
        $authority_type = $sysconf['authority_type'][$biblio_author_d['authority_type']];
        $table->appendTableRow(array($remove_link, $author, $author_year, $authority_type, $sysconf['authority_level'][$biblio_author_d['level']]));
        $table->setCellAttr($row, 0, 'valign="top" class="' . $row_class . '" style="font-weight: bold; width: 10%;"');
        $table->setCellAttr($row, 1, 'valign="top" class="' . $row_class . '" style="width: 30%;"');
        $table->setCellAttr($row, 2, 'valign="top" class="' . $row_class . '" style="width: 20%;"');
        $table->setCellAttr($row, 3, 'valign="top" class="' . $row_class . '" style="width: 20%;"');
        $table->setCellAttr($row, 4, 'valign="top" class="' . $row_class . '" style="width: 20%;"');
        $row++;
    }
    echo $table->printTable();
    // hidden form
    echo '<form name="hiddenActionForm" method="post" action="' . $_SERVER['PHP_SELF'] . '"><input type="hidden" name="bid" value="0" /><input type="hidden" name="remove" value="0" /></form>';
} else {
    if ($_SESSION['biblioAuthor']) {
        $table = new simbio_table();
        $table->table_attr = 'align="center" style="width: 100%;" cellpadding="2" cellspacing="0"';
        $row = 1;
        $row_class = 'alterCell2';
        foreach ($_SESSION['biblioAuthor'] as $biblio_session) {
            // remove link
            $remove_link = '<a href="iframe_author.php?removesess=' . $biblio_session[0] . '"
          style="color: #000000; text-decoration: underline;">Remove</a>';
            if ($biblio_session) {
                $author_q = $dbs->query("SELECT author_name, author_year, authority_type FROM mst_author\n              WHERE author_id=" . $biblio_session[0]);
                $author_d = $author_q->fetch_row();
                $author = $author_d[0];
                $author_year = $author_d[1];
                $authority_type = $author_d[2];
            }
            $table->appendTableRow(array($remove_link, $author, $author_year, $authority_type, $sysconf['authority_level'][$biblio_session[1]]));
Example #6
0
    $hol_dayname = array();
    if ($rec_q->num_rows > 0) {
        while ($rec_d = $rec_q->fetch_row()) {
            $hol_dayname[] = $rec_d[0];
        }
    }
    // small function to check the checkbox
    function isChecked($str_data)
    {
        global $hol_dayname;
        if (in_array($str_data, $hol_dayname)) {
            return 'checked';
        }
    }
    // create table object
    $table = new simbio_table();
    $table->table_attr = 'align="center" class="border fullWidth" cellpadding="5" cellspacing="0"';
    // dayname list
    $table->appendTableRow(array('<input type="checkbox" name="dayname[]" value="mon" ' . isChecked('mon') . ' /> ' . __('Monday'), '<input type="checkbox" name="dayname[]" value="tue" ' . isChecked('tue') . ' /> ' . __('Tuesday'), '<input type="checkbox" name="dayname[]" value="wed" ' . isChecked('wed') . ' /> ' . __('Wednesday')));
    $table->appendTableRow(array('<input type="checkbox" name="dayname[]" value="thu" ' . isChecked('thu') . ' /> ' . __('Thursday'), '<input type="checkbox" name="dayname[]" value="fri" ' . isChecked('fri') . ' /> ' . __('Friday'), '<input type="checkbox" name="dayname[]" value="sat" ' . isChecked('sat') . ' /> ' . __('Saturday')));
    $table->appendTableRow(array('<input type="checkbox" name="dayname[]" value="sun" ' . isChecked('sun') . ' /> ' . __('Sunday')));
    // set cell attribute
    $table->setCellAttr(3, 0, 'colspan="3"');
    // submit button
    $table->appendTableRow(array('<input type="button" name="saveDaynameData" value="' . __('Save Settings') . '" onclick="$(\'#mainContent\').simbioAJAX(\'' . $_SERVER['PHP_SELF'] . '\', { method: \'POST\', addData: $(\'#holidayForm\').serialize() } )" />'));
    // set cell attribute
    $table->setCellAttr(4, 0, 'colspan="3" class="alterCell"');
    echo '<form name="holidayForm" id="holidayForm">';
    echo $table->printTable();
    echo '</form>';
}
Example #7
0
 :
    <input type="text" name="keywords" size="30" />
    <input type="submit" value="<?php 
echo __('Search');
?>
" class="button" />
    </form>
</div>
</fieldset>
<?php 
if (isset($_POST['itemID']) and !empty($_POST['itemID'])) {
    $itemID = (int) $_POST['itemID'];
    $rec_q = $dbs->query("SELECT\r\n        stock_take_name AS '" . __('Stock Take Name') . "',\r\n        start_date AS '" . __('Start Date') . "',\r\n        end_date AS '" . __('End Date') . "',\r\n        init_user AS '" . __('Initializer') . "',\r\n        total_item_stock_taked AS '" . __('Total Item Stock Taked') . "',\r\n        total_item_lost AS '" . __('Total Item Lost') . "',\r\n        total_item_exists AS '" . __('Total Item Exists') . "',\r\n        total_item_loan AS '" . __('Total Item On Loan') . "',\r\n        stock_take_users AS '" . __('Stock Take Participants') . "',\r\n        is_active AS '" . __('Status') . "',\r\n        report_file AS '" . __('Report') . "'\r\n        FROM stock_take WHERE stock_take_id=" . $itemID);
    $rec_d = $rec_q->fetch_assoc();
    // create table object
    $table = new simbio_table();
    $table->table_attr = 'align="center" class="border" cellpadding="5" cellspacing="0"';
    // table header
    $table->setHeader(array($rec_d[__('Stock Take Name')]));
    $table->table_header_attr = 'class="dataListHeader" colspan="3"';
    // initial row count
    $row = 1;
    foreach ($rec_d as $headings => $stk_data) {
        if ($headings == 'stock_take_id') {
            continue;
        } else {
            if ($headings == __('Status')) {
                if ($stk_data == '1') {
                    $stk_data = '<b style="color: #f00;">' . __('Currently Active') . '</b>';
                } else {
                    $stk_data = 'Finished';
        echo 'location.href = \'' . $_SERVER['PHP_SELF'] . '\'' . "\n";
        echo '</script>';
    }
    exit;
}
?>
<fieldset class="menuBox">
<div class="menuBoxInner barcodeIcon">
    <?php 
echo strtoupper(lang_sys_barcodes) . ' <hr />' . lang_sys_barcodes_description . ' "' . lang_sys_conf_barcode_button_print . '".';
?>
</div>
</fieldset>
<?php 
// create table object
$table = new simbio_table();
$table->table_attr = 'align="center" class="border fullWidth" cellpadding="5" cellspacing="0"';
// initial row count
$row = 1;
$row_num = 6;
// submit button
$table->appendTableRow(array(lang_sys_conf_barcode_field_size . ' : <select name="size"><option value="1">' . lang_sys_conf_barcode_field_option_1 . '</option>
    <option value="2" selected>' . lang_sys_conf_barcode_field_option_2 . '</option>
    <option value="3">' . lang_sys_conf_barcode_field_option_3 . '</option></select>'));
// set cell attribute
$table->setCellAttr($row, 0, 'colspan="3" class="alterCell"');
$row++;
// barcode text fields
while ($row <= $row_num) {
    $table->appendTableRow(array('<input type="text" name="barcode[]" style="width: 100%;" />', '<input type="text" name="barcode[]" style="width: 100%;" />', '<input type="text" name="barcode[]" style="width: 100%;" />'));
    $row++;
        $title = $biblio_relation_d['title'];
        $publish_year = $biblio_relation_d['publish_year'];
        $edition = $biblio_relation_d['edition'];
        $table->appendTableRow(array($remove_link, $title, $publish_year, $edition));
        $table->setCellAttr($row, 0, 'valign="top" class="' . $row_class . '" style="font-weight: bold; width: 10%;"');
        $table->setCellAttr($row, 1, 'valign="top" class="' . $row_class . '" style="width: 50%;"');
        $table->setCellAttr($row, 2, 'valign="top" class="' . $row_class . '" style="width: 20%;"');
        $table->setCellAttr($row, 3, 'valign="top" class="' . $row_class . '" style="width: 20%;"');
        $row++;
    }
    echo $table->printTable();
    // hidden form
    echo '<form name="hiddenActionForm" method="post" action="' . $_SERVER['PHP_SELF'] . '"><input type="hidden" name="bid" value="0" /><input type="hidden" name="remove" value="0" /></form>';
} else {
    if ($_SESSION['biblioToBiblio']) {
        $table = new simbio_table();
        $table->table_attr = 'align="center" style="width: 100%;" cellpadding="2" cellspacing="0"';
        $row = 1;
        $row_class = 'alterCell2';
        foreach ($_SESSION['biblioToBiblio'] as $biblio_session) {
            // remove link
            $remove_link = '<a class="notAJAX btn button btn-danger btn-delete" href="iframe_biblio_rel.php?removesess=' . $biblio_session[0] . '">' . __('Remove') . '</a>';
            if ($biblio_session) {
                $title_q = $dbs->query("SELECT title, publish_year, edition FROM biblio\n              WHERE biblio_id=" . $biblio_session[0]);
                $title_d = $title_q->fetch_row();
                $title = $title_d[0];
                $publish_year = $title_d[1];
                $edition = $title_d[2];
            }
            $table->appendTableRow(array($remove_link, $title, $publish_year, $edition));
            $table->setCellAttr($row, 0, 'valign="top" class="' . $row_class . '" style="font-weight: bold; background-color: #ffc466; width: 10%;"');
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */
// start the output buffer
ob_start();
$table = new simbio_table();
$table->table_attr = 'align="center" class="detailTable" style="width: 100%;" cellpadding="2" cellspacing="0"';
$table->setHeader(array(__('Module Name'), __('Read'), __('Write')));
$table->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
// initial row count
$row = 1;
$row_class = 'alterCell2';
// database list
$module_query = $dbs->query("SELECT * FROM mst_module AS m");
while ($module_data = $module_query->fetch_assoc()) {
    // alternate the row color
    if ($row_class == 'alterCell2') {
        $row_class = 'alterCell';
    } else {
        $row_class = 'alterCell2';
    }
Example #11
0
    ?>
 :
            <input type="text" id="tempLoanID" name="tempLoanID" />
            <input type="submit" value="<?php 
    echo __('Loan');
    ?>
" class="button" />
        </form>
    </div>
    <script type="text/javascript">$('#tempLoanID').focus();</script>
    <!--item loan form end-->
    <?php 
    // make a list of temporary loan if there is any
    if (count($_SESSION['temp_loan']) > 0) {
        // create table object
        $temp_loan_list = new simbio_table();
        $temp_loan_list->table_attr = "align='center' style='width: 100%;' cellpadding='3' cellspacing='0'";
        $temp_loan_list->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
        $temp_loan_list->highlight_row = true;
        // table header
        $headers = array(__('Remove'), __('Item Code'), __('Title'), __('Loan Date'), __('Due Date'));
        $temp_loan_list->setHeader($headers);
        // row number init
        $row = 1;
        foreach ($_SESSION['temp_loan'] as $_loan_ID => $temp_loan_list_d) {
            // alternate the row color
            $row_class = $row % 2 == 0 ? 'alterCell' : 'alterCell2';
            // remove link
            $remove_link = '<a href="circulation_action.php?removeID=' . $temp_loan_list_d['item_code'] . '" title="Remove this item" class="trashLink">&nbsp;</a>';
            // check if manually changes loan and due date allowed
            if ($sysconf['allow_loan_date_change']) {
 /**
  * Method to print out form table
  *
  * @return  string
  */
 public function printOut()
 {
     // create table object
     $_table = new simbio_table();
     // set the table attr
     $_table->table_attr = $this->table_attr;
     $_buffer = '';
     // check if form tag is included
     if ($this->with_form_tag) {
         $_buffer .= $this->startForm() . "\n";
     }
     // loop the form element
     $_row_num = 0;
     foreach ($this->elements as $row) {
         $_form_element = $row['element']->out();
         if ($_form_element_info = trim($row['info'])) {
             $_form_element .= '<div class="formElementInfo">' . $_form_element_info . '</div>';
         }
         // append row
         $_table->appendTableRow(array($row['label'], ':', $_form_element));
         // set the column header attr
         $_table->setCellAttr($_row_num + 1, 0, 'width="20%" valign="top"' . $this->table_header_attr);
         $_table->setCellAttr($_row_num + 1, 1, 'width="1%" valign="top"' . $this->table_header_attr);
         // set the form element column attr
         $_table->setCellAttr($_row_num + 1, 2, 'width="79%" ' . $this->table_content_attr);
         $_row_num++;
     }
     // link and buttons
     $_edit_link = '';
     $_delete_button = '';
     $_back_button = '';
     if (defined('lang_sys_common_form_delete')) {
         $_del_value = lang_sys_common_form_delete;
     } else {
         $_del_value = 'Delete Record';
     }
     if (defined('lang_sys_common_form_cancel')) {
         $_cancel_value = lang_sys_common_form_cancel;
     } else {
         $_cancel_value = 'Cancel';
     }
     // check if we are on edit form mode
     if ($this->edit_mode) {
         $_edit_link .= '<a href="#" onclick="enableForm(\'' . $this->form_name . '\'); enableForm(\'deleteForm\');" style="font-weight: bold;" class="editFormLink">EDIT</a>';
         // delete button exists if the record_id exists
         if ($this->record_id && $this->delete_button) {
             $_delete_button = '<input type="button" value="' . $_del_value . '" class="button" onclick="confSubmit(\'deleteForm\', \'Are you sure to delete ' . addslashes($this->record_title) . '?\\nOnce Deleted it cant be restored again\')" style="color: red; font-weight: bold;" />';
         }
         // back button
         if ($this->back_button) {
             $_back_button = '<input type="button" class="cancelButton button" value="' . $_cancel_value . '" onclick="javascript: self.history.back();" />';
         }
     }
     $_buttons = '';
     if ($this->with_form_tag) {
         $_buttons = '<table cellspacing="0" cellpadding="3" style="width: 100%; background-color: #dcdcdc;">' . '<tr><td><input type="submit" ' . $this->submit_button_attr . ' /> ' . $_delete_button . ' ' . $_back_button . '</td><td align="right">' . $_edit_link . '</td>' . '</tr></table>' . "\n";
     }
     // get the table result
     $_buffer .= $_buttons;
     $_buffer .= $_table->printTable();
     $_buffer .= $_buttons;
     // extract all hidden elements here
     foreach ($this->hidden_elements as $_hidden) {
         $_buffer .= $_hidden->out();
     }
     // update ID hidden elements
     if ($this->edit_mode and $this->record_id) {
         // add hidden form element flag for detail editing purpose
         $_buffer .= '<input type="hidden" name="updateRecordID" value="' . $this->record_id . '" />';
     }
     // check if form tag is included
     if ($this->with_form_tag) {
         $_buffer .= $this->endForm() . "\n";
     }
     if ($this->edit_mode) {
         // hidden form for deleting records
         $_buffer .= '<form action="' . $this->form_action . '" id="deleteForm" method="post" style="display: inline;"><input type="hidden" name="itemID" value="' . $this->record_id . '" /><input type="hidden" name="itemAction" value="true" /></form>';
         // disabling form
         $_buffer .= '<script type="text/javascript">disableForm(\'' . $this->form_name . '\');disableForm(\'deleteForm\');</script>';
     }
     // output
     return $_buffer;
 }
     // get reservation data
     $reserve_q = $dbs->query('SELECT r.member_id, m.member_name
         FROM reserve AS r
         LEFT JOIN member AS m ON r.member_id=m.member_id
         WHERE item_code=\'' . $loan_d['item_code'] . '\' ORDER BY reserve_date DESC');
     $reserve_d = $reserve_q->fetch_row();
     $member = $reserve_d[1] . ' (' . $reserve_d[0] . ')';
     $reserve_msg = str_replace(array('{itemCode}', '{member}'), array($loan_d['item_code'], $member), lang_mod_circ_reserve_alert_after_return);
     $loan_d['title'] .= '<div>' . $reserve_msg . '</div>';
 }
 // write log
 utility::writeLogs($dbs, 'member', $loan_d['member_id'], 'circulation', $_SESSION['realname'] . ' return item (' . $_POST['quickReturnID'] . ') with title (' . $loan_d['title'] . ') with Quick Return method');
 // show loan information
 include SIMBIO_BASE_DIR . 'simbio_GUI/table/simbio_table.inc.php';
 // create table object
 $table = new simbio_table();
 $table->table_attr = 'class="border" style="width: 100%; margin-bottom: 5px;" cellpadding="5" cellspacing="0"';
 // append data to table row
 $table->appendTableRow(array('Item ' . $_POST['quickReturnID'] . lang_mod_circ_common_item_return_ok . $return_date));
 $table->appendTableRow(array(lang_mod_circ_tblheader_title, $loan_d['title']));
 $table->appendTableRow(array(lang_mod_circ_field_member_name, $loan_d['member_name'], lang_mod_circ_field_member_id, $loan_d['member_id']));
 $table->appendTableRow(array(lang_mod_circ_tblheader_loan_date, $loan_d['loan_date'], lang_mod_circ_tblheader_due_date, $loan_d['due_date']));
 // set the cell attributes
 $table->setCellAttr(1, null, 'class="dataListHeader" style="color: #FFFFFF; font-weight: bold;" colspan="4"');
 $table->setCellAttr(2, 0, 'class="alterCell"');
 $table->setCellAttr(2, 1, 'class="alterCell2" colspan="3"');
 $table->setCellAttr(3, 0, 'class="alterCell" width="15%"');
 $table->setCellAttr(3, 1, 'class="alterCell2" width="35%"');
 $table->setCellAttr(3, 2, 'class="alterCell" width="15%"');
 $table->setCellAttr(3, 3, 'class="alterCell2" width="35%"');
 $table->setCellAttr(4, 0, 'class="alterCell" width="15%"');
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */
// be sure that this file not accessed directly
if (INDEX_AUTH != 1) {
    die("can not access this file directly");
}
// start the output buffer
ob_start();
$table = new simbio_table();
$table->table_attr = 'align="center" class="detailTable" style="width: 100%;" cellpadding="2" cellspacing="0"';
$table->setHeader(array(__('Module Name'), '<a id="allRead" class="notAJAX" href="#">' . __('Read') . '</a>', '<a id="allWrite" class="notAJAX" href="#">' . __('Write') . '</a>'));
$table->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
// initial row count
$row = 1;
$row_class = 'alterCell2';
// database list
$module_query = $dbs->query("SELECT * FROM mst_module AS m");
while ($module_data = $module_query->fetch_assoc()) {
    // alternate the row color
    if ($row_class == 'alterCell2') {
        $row_class = 'alterCell';
    } else {
        $row_class = 'alterCell2';
    }
Example #15
0
        } else {
            $file = '<a href="' . SENAYAN_WEB_ROOT_DIR . 'admin/view.php?fid=' . urlencode($biblio_attach_d['file_id']) . '" target="_blank">' . $biblio_attach_d['file_title'] . '</a>';
        }
        $table->appendTableRow(array($remove_link, $edit_link, $file, $biblio_attach_d['file_desc']));
        $table->setCellAttr($row, 0, 'valign="top" class="' . $row_class . '" style="font-weight: bold; width: 5%;"');
        $table->setCellAttr($row, 1, 'valign="top" class="' . $row_class . '" style="font-weight: bold; width: 5%;"');
        $table->setCellAttr($row, 2, 'valign="top" class="' . $row_class . '" style="width: 40%;"');
        $table->setCellAttr($row, 3, 'valign="top" class="' . $row_class . '" style="width: 50%;"');
        $row++;
    }
    echo $table->printTable();
    // hidden form
    echo '<form name="hiddenActionForm" method="post" action="' . $_SERVER['PHP_SELF'] . '"><input type="hidden" name="bid" value="0" /><input type="hidden" name="remove" value="0" /><input type="hidden" name="alsoDeleteFile" value="0" /></form>';
} else {
    if ($_SESSION['biblioAttach']) {
        $table = new simbio_table();
        $table->table_attr = 'align="center" style="width: 100%;" cellpadding="2" cellspacing="0"';
        $row = 1;
        $row_class = 'alterCell2';
        foreach ($_SESSION['biblioAttach'] as $idx => $biblio_session) {
            // remove link
            $remove_link = '<a href="iframe_attach.php?removesess=' . $idx . '" style="color: #000000; text-decoration: underline;">Remove</a>';
            $table->appendTableRow(array($remove_link, $biblio_session['file_name'], $biblio_session['last_update']));
            $table->setCellAttr($row, 0, 'valign="top" class="' . $row_class . '" style="font-weight: bold; background-color: #ffc466; width: 10%;"');
            $table->setCellAttr($row, 1, 'valign="top" class="' . $row_class . '" style="background-color: #ffc466; width: 60%;"');
            $table->setCellAttr($row, 2, 'valign="top" class="' . $row_class . '" style="background-color: #ffc466; width: 30%;"');
            $row++;
        }
        echo $table->printTable();
    }
}
Example #16
0
          <form name="printForm" action="<?php 
        echo $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];
        ?>
" target="submitPrint" id="printForm" method="get" style="display: inline;">
          <input type="hidden" name="print" value="true" /><input type="submit" value="<?php 
        echo __('Download Report');
        ?>
" class="btn btn-default" />
          </form>
          <iframe name="submitPrint" style="visibility: hidden; width: 0; height: 0;"></iframe>
        </div>
      </div>
    </fieldset>
<?php 
    }
    $table = new simbio_table();
    $table->table_attr = 'align="center" id="dataList" cellpadding="3" cellspacing="0"';
    // make an array for report table row
    $report_row[__('Stock Take Name')] = $stk_data['stock_take_name'];
    $report_row[__('Total Item Stock Taked')] = $stk_data['total_item_stock_taked'];
    // stock take item lost
    $report_row[__('Total Item Lost')] = intval($stk_data['total_item_lost']);
    if ($report_row[__('Total Item Lost')] < 1) {
        $report_row[__('Total Item Lost')] = __('None');
    }
    // stock take item on loan
    if (empty($stk_data['total_item_loan'])) {
        $report_row[__('Total Item On Loan')] = __('None');
    } else {
        $report_row[__('Total Item On Loan')] = $stk_data['total_item_loan'];
    }
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */
// start the output buffer
ob_start();
$table = new simbio_table();
$table->table_attr = 'align="center" class="detailTable" style="width: 100%;" cellpadding="2" cellspacing="0"';
$table->setHeader(array(lang_sys_conf_group_privileges_modul_name, lang_sys_conf_group_privileges_modul_read, lang_sys_conf_group_privileges_modul_write));
$table->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
// initial row count
$row = 1;
$row_class = 'alterCell2';
// database list
$module_query = $dbs->query("SELECT * FROM mst_module AS m");
while ($module_data = $module_query->fetch_assoc()) {
    // alternate the row color
    if ($row_class == 'alterCell2') {
        $row_class = 'alterCell';
    } else {
        $row_class = 'alterCell2';
    }
 public function printOut()
 {
     // create table object
     $_table = new simbio_table();
     // set the table attr
     $_table->table_attr = $this->table_attr;
     if ($this->edit_mode) {
         $this->disable = true;
     }
     // initialize result buffer
     $_buffer = '';
     // check if form tag is included
     if ($this->with_form_tag) {
         $this->submit_target = 'submitExec';
         $_buffer .= $this->startForm() . "\n";
     }
     // loop the form element
     $_row_num = 0;
     foreach ($this->elements as $row) {
         $_form_element = $row['element']->out();
         if ($_form_element_info = trim($row['info'])) {
             $_form_element .= '<div class="formElementInfo">' . $_form_element_info . '</div>';
         }
         // append row
         $_table->appendTableRow(array($row['label'], ':', $_form_element));
         // set the column header attr
         $_table->setCellAttr($_row_num + 1, 0, 'width="20%" valign="top"' . $this->table_header_attr);
         $_table->setCellAttr($_row_num + 1, 1, 'width="1%" valign="top"' . $this->table_header_attr);
         // set the form element column attr
         $_table->setCellAttr($_row_num + 1, 2, 'width="79%" ' . $this->table_content_attr);
         $_row_num++;
     }
     // link and buttons
     $_edit_link = '';
     $_delete_button = '';
     $_back_button = '';
     $_del_value = __('Delete Record');
     $_cancel_value = __('Cancel');
     // check if we are on edit form mode
     if ($this->edit_mode) {
         $_edit_link .= '<a href="#" class="notAJAX editFormLink">EDIT</a>';
         // delete button exists if the record_id properties exists
         if ($this->record_id && $this->delete_button) {
             // create delete button
             $_delete_button = '<input type="button" value="' . $_del_value . '" class="button confirmSubmit" onclick="confSubmit(\'deleteForm\', \'Are you sure to delete ' . addslashes($this->record_title) . '?\\nOnce Deleted it cant be restored again\')" style="color: red; font-weight: bold;" />';
         }
         // back button
         if ($this->back_button) {
             $_back_button = '<input type="button" class="cancelButton button" value="' . $_cancel_value . '" />';
         }
     }
     $_buttons = '';
     // check if form tag is included
     if ($this->with_form_tag) {
         $_buttons = '<table cellspacing="0" cellpadding="3" style="width: 100%; background-color: #dcdcdc;">' . '<tr><td><input type="submit" ' . $this->submit_button_attr . ' /> ' . $_back_button . ' ' . $_delete_button . '</td><td align="right">' . $_edit_link . '</td>' . '</tr></table>' . "\n";
     }
     // get the table result
     $_buffer .= $_buttons;
     $_buffer .= $_table->printTable();
     $_buffer .= $_buttons;
     // extract all hidden elements here
     foreach ($this->hidden_elements as $_hidden) {
         $_buffer .= $_hidden->out();
     }
     // update ID hidden elements
     if ($this->edit_mode and $this->record_id) {
         // add hidden form element flag for detail editing purpose
         $_buffer .= '<input type="hidden" name="updateRecordID" value="' . $this->record_id . '" />';
     }
     // check if form tag is included
     if ($this->with_form_tag) {
         $_buffer .= $this->endForm() . "\n";
     }
     if ($this->edit_mode) {
         // hidden form for deleting records
         $_buffer .= '<form action="' . preg_replace('/\\?.+/i', '', $this->form_action) . '" id="deleteForm" target="submitExec" method="post" style="display: inline;">' . '<input type="hidden" name="itemID" value="' . $this->record_id . '" /><input type="hidden" name="itemAction" value="true" /></form>';
     }
     // for debugging purpose only
     // $_buffer .= '<iframe name="submitExec" style="visibility: visible; width: 100%; height: 500px;"></iframe>';
     // hidden iframe for form executing
     $_buffer .= '<iframe name="submitExec" class="noBlock" style="visibility: hidden; width: 100%; height: 0;"></iframe>';
     return $_buffer;
 }
Example #19
0
$biblio_options[] = array('0', 'Title');
echo simbio_form_element::textField('text', 'bib_search_str', '', 'style="width: 10%;" onkeyup="' . $ajax_exp . '"');
echo simbio_form_element::selectList('reserveItemID', $biblio_options, '', 'class="marginTop" style="width: 70%;"');
echo simbio_form_element::textField('submit', 'addReserve', __('Add Reserve'));
?>
    </form>
</div>
<!--item loan form end-->

<?php 
// check if there is member ID
if (isset($_SESSION['memberID'])) {
    $memberID = trim($_SESSION['memberID']);
    $reserve_list_q = $dbs->query("SELECT r.*, b.title FROM reserve AS r\r\n        LEFT JOIN biblio AS b ON r.biblio_id=b.biblio_id\r\n        WHERE r.member_id='{$memberID}'");
    // create table object
    $reserve_list = new simbio_table();
    $reserve_list->table_attr = 'align="center" style="width: 100%;" cellpadding="3" cellspacing="0"';
    $reserve_list->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
    $reserve_list->highlight_row = true;
    // table header
    $headers = array(__('Remove'), __('Title'), __('Item Code'), __('Reserve Date'));
    $reserve_list->setHeader($headers);
    // row number init
    $row = 1;
    while ($reserve_list_d = $reserve_list_q->fetch_assoc()) {
        // alternate the row color
        $row_class = $row % 2 == 0 ? 'alterCell' : 'alterCell2';
        // remove reserve link
        $remove_link = '<a href="#" onclick="confirmProcess(' . $reserve_list_d['reserve_id'] . ', \'' . $reserve_list_d['title'] . '\')" title="Remove Reservation" class="trashLink">&nbsp;</a>';
        // check if item/collection is available
        $avail_q = $dbs->query("SELECT COUNT(loan_id) FROM loan WHERE item_code='" . $reserve_list_d['item_code'] . "' AND is_lent=1 AND is_return=0");
Example #20
0
        echo 'location.href = \'' . $_SERVER['PHP_SELF'] . '\'' . "\n";
        echo '</script>';
    }
    exit;
}
?>
<fieldset class="menuBox">
<div class="menuBoxInner barcodeIcon">
    <?php 
echo __('Barcode Generator') . ' <hr />' . __('Type barcodes text to one or more text field below and click') . ' "' . __('Generate Barcodes') . '".';
?>
</div>
</fieldset>
<?php 
// create table object
$table = new simbio_table();
$table->table_attr = 'align="center" class="border fullWidth" cellpadding="5" cellspacing="0"';
// initial row count
$row = 1;
$row_num = 6;
// submit button
$table->appendTableRow(array(__('Barcode Size') . ' : <select name="size"><option value="1">' . __('Small') . '</option>
    <option value="2" selected>' . __('Medium') . '</option>
    <option value="3">' . __('Big') . '</option></select>'));
// set cell attribute
$table->setCellAttr($row, 0, 'colspan="3" class="alterCell"');
$row++;
// barcode text fields
while ($row <= $row_num) {
    $table->appendTableRow(array('<input type="text" name="barcode[]" style="width: 100%;" />', '<input type="text" name="barcode[]" style="width: 100%;" />', '<input type="text" name="barcode[]" style="width: 100%;" />'));
    $row++;
Example #21
0
if (!defined('SENAYAN_BASE_DIR')) {
    // main system configuration
    require '../../../sysconfig.inc.php';
    // start the session
    require SENAYAN_BASE_DIR . 'admin/default/session.inc.php';
}
require SENAYAN_BASE_DIR . 'admin/default/session_check.inc.php';
require SIMBIO_BASE_DIR . 'simbio_GUI/table/simbio_table.inc.php';
// privileges checking
$can_read = utility::havePrivilege('reporting', 'r');
$can_write = utility::havePrivilege('reporting', 'w');
if (!$can_read) {
    die('<div class="errorBox">' . __('You don\'t have enough privileges to access this area!') . '</div>');
}
/* collection statistic */
$table = new simbio_table();
$table->table_attr = 'align="center" class="border" cellpadding="5" cellspacing="0"';
// total number of titles
$stat_query = $dbs->query('SELECT COUNT(biblio_id) FROM biblio');
$stat_data = $stat_query->fetch_row();
$collection_stat[__('Total Titles')] = $stat_data[0];
// total number of items
$stat_query = $dbs->query('SELECT COUNT(item_id) FROM item');
$stat_data = $stat_query->fetch_row();
$collection_stat[__('Total Items/Copies')] = $stat_data[0];
// total number of checkout items
$stat_query = $dbs->query('SELECT COUNT(item_id) FROM item AS i
    LEFT JOIN loan AS l ON i.item_code=l.item_code
    WHERE is_lent=1 AND is_return=0');
$stat_data = $stat_query->fetch_row();
$collection_stat[__('Total Checkout Items')] = $stat_data[0];
Example #22
0
echo MODULES_WEB_ROOT_DIR;
?>
stock_take/index.php?' + $('search').serialize(), 'post');" value="<?php 
echo lang_sys_common_form_search;
?>
" class="button" />
    </form>
</div>
</fieldset>
<?php 
if (isset($_POST['itemID']) and !empty($_POST['itemID'])) {
    $itemID = (int) $_POST['itemID'];
    $rec_q = $dbs->query("SELECT\n        stock_take_name AS '" . lang_mod_stocktake_init_field_name . "',\n        start_date AS '" . lang_mod_stocktake_init_field_start_date . "',\n        end_date AS '" . lang_mod_stocktake_init_field_end_date . "',\n        init_user AS '" . lang_mod_stocktake_init_field_user . "',\n        total_item_stock_taked AS '" . lang_mod_stocktake_total . "',\n        total_item_lost AS '" . lang_mod_stocktake_lost_total . "',\n        total_item_exists AS '" . lang_mod_stocktake_exists_total . "',\n        total_item_loan AS '" . lang_mod_stocktake_loan_total . "',\n        stock_take_users AS '" . lang_mod_stocktake_participants . "',\n        is_active AS '" . lang_mod_stocktake_status . "',\n        report_file AS '" . lang_mod_stocktake_init_field_report_file . "'\n        FROM stock_take WHERE stock_take_id=" . $itemID);
    $rec_d = $rec_q->fetch_assoc();
    // create table object
    $table = new simbio_table();
    $table->table_attr = 'align="center" class="border" cellpadding="5" cellspacing="0"';
    // table header
    $table->setHeader(array($rec_d[lang_mod_stocktake_init_field_name]));
    $table->table_header_attr = 'class="dataListHeader" colspan="3"';
    // initial row count
    $row = 1;
    foreach ($rec_d as $headings => $stk_data) {
        if ($headings == 'stock_take_id') {
            continue;
        } else {
            if ($headings == lang_mod_stocktake_status) {
                if ($stk_data == '1') {
                    $stk_data = '<b style="color: #FF0000;">' . lang_mod_stocktake_active_status . '</b>';
                } else {
                    $stk_data = 'Finished';
 */
/* Reporting section */
// main system configuration
require '../../../sysconfig.inc.php';
// start the session
require SENAYAN_BASE_DIR . 'admin/default/session.inc.php';
require SENAYAN_BASE_DIR . 'admin/default/session_check.inc.php';
require SIMBIO_BASE_DIR . 'simbio_GUI/table/simbio_table.inc.php';
// privileges checking
$can_read = utility::havePrivilege('reporting', 'r');
$can_write = utility::havePrivilege('reporting', 'w');
if (!$can_read) {
    die('<div class="errorBox">' . __('You don\'t have enough privileges to access this area!') . '</div>');
}
/* loan report */
$table = new simbio_table();
$table->table_attr = 'align="center" class="border" cellpadding="5" cellspacing="0"';
// total number of member
$report_query = $dbs->query('SELECT COUNT(member_id) FROM member');
$report_data = $report_query->fetch_row();
$loan_report[__('Total Registered Members')] = $report_data[0];
// total number of active member
$report_query = $dbs->query('SELECT COUNT(member_id) FROM member
    WHERE TO_DAYS(expire_date)>TO_DAYS(\'' . date('Y-m-d') . '\')');
$report_data = $report_query->fetch_row();
$loan_report[__('Total Active Member')] = $report_data[0];
// total number of active member by membership type
$report_query = $dbs->query('SELECT member_type_name, COUNT(member_id) FROM mst_member_type AS mt
    LEFT JOIN member AS m ON mt.member_type_id=m.member_type_id
    WHERE TO_DAYS(expire_date)>TO_DAYS(\'' . date('Y-m-d') . '\')
    GROUP BY m.member_type_id ORDER BY COUNT(member_id) DESC');
        if ($sql_op->delete('item', 'item_id=' . $id)) {
            echo '<script type="text/javascript">';
            echo 'alert(\'' . lang_mod_biblio_item_alert_remove_success . '\');';
            echo 'self.location.href = \'iframe_item_list.php?biblioID=' . $bid . '\';';
            echo '</script>';
        } else {
            echo '<script type="text/javascript">';
            echo 'alert(\'' . lang_mod_biblio_item_alert_remove_failed . '\');';
            echo 'self.location.href = \'iframe_item_list.php?biblioID=' . $bid . '\';';
            echo '</script>';
        }
    }
}
// if biblio ID is set
if ($biblioID) {
    $table = new simbio_table();
    $table->table_attr = 'align="center" class="detailTable" style="width: 100%;" cellpadding="2" cellspacing="0"';
    // database list
    $item_q = $dbs->query('SELECT i.item_id, i.item_code, b.title, i.site, loc.location_name, ct.coll_type_name, st.item_status_name FROM item AS i
        LEFT JOIN biblio AS b ON i.biblio_id=b.biblio_id
        LEFT JOIN mst_location AS loc ON i.location_id=loc.location_id
        LEFT JOIN mst_coll_type AS ct ON i.coll_type_id=ct.coll_type_id
        LEFT JOIN mst_item_status AS st ON i.item_status_id=st.item_status_id
        WHERE i.biblio_id=' . $biblioID);
    $row = 1;
    while ($item_d = $item_q->fetch_assoc()) {
        // alternate the row color
        $row_class = $row % 2 == 0 ? 'alterCell' : 'alterCell2';
        // links
        $edit_link = '<a href="#" onclick="openWin(\'pop_item.php?inPopUp=true&action=detail&biblioID=' . $biblioID . '&itemID=' . $item_d['item_id'] . '\', \'popItem\', 600, 400, true)"
            style="text-decoration: underline;">Edit</a>';
        $remove_link = '<a href="#" class="notAJAX btn button btn-danger btn-delete" onclick="confirmProcess(' . $biblioID . ', ' . $biblio_topic_d['topic_id'] . ')">Delete</a>';
        $topic = $biblio_topic_d['topic'];
        $topic_type = $sysconf['subject_type'][$biblio_topic_d['topic_type']];
        $table->appendTableRow(array($remove_link, $topic, $topic_type, $sysconf['subject_level'][$biblio_topic_d['level']]));
        $table->setCellAttr($row, 0, 'class="' . $row_class . '" style="font-weight: bold; width: 10%;"');
        $table->setCellAttr($row, 1, 'class="' . $row_class . '" style="font-weight: bold; width: 50%;"');
        $table->setCellAttr($row, 2, 'class="' . $row_class . '" style="font-weight: bold; width: 20%;"');
        $table->setCellAttr($row, 3, 'class="' . $row_class . '" style="width: 20%;"');
        $row++;
    }
    echo $table->printTable();
    // hidden form
    echo '<form name="hiddenActionForm" method="post" action="' . $_SERVER['PHP_SELF'] . '"><input type="hidden" name="bid" value="0" /><input type="hidden" name="remove" value="0" /></form>';
} else {
    if ($_SESSION['biblioTopic']) {
        $table = new simbio_table();
        $table->table_attr = 'align="center" style="width: 100%;" cellpadding="2" cellspacing="0"';
        $row = 1;
        $row_class = 'alterCell2';
        foreach ($_SESSION['biblioTopic'] as $biblio_session) {
            // remove link
            $remove_link = '<a class="notAJAX btn button btn-danger btn-delete" href="iframe_topic.php?removesess=' . $biblio_session[0] . '">Remove</a>';
            if ($biblio_session) {
                $topic_q = $dbs->query("SELECT topic, topic_type FROM mst_topic WHERE topic_id=" . $biblio_session[0]);
                $topic_d = $topic_q->fetch_row();
                $topic = $topic_d[0];
                $topic_type = $sysconf['subject_type'][$topic_d[1]];
            }
            $table->appendTableRow(array($remove_link, $topic, $topic_type, $sysconf['subject_level'][$biblio_session[1]]));
            $table->setCellAttr($row, 0, 'class="' . $row_class . '" style="font-weight: bold; background-color: #ffc466; width: 10%;"');
            $table->setCellAttr($row, 1, 'class="' . $row_class . '" style="background-color: #ffc466; width: 50%;"');
Example #26
0
    $hol_dayname = array();
    if ($rec_q->num_rows > 0) {
        while ($rec_d = $rec_q->fetch_row()) {
            $hol_dayname[] = $rec_d[0];
        }
    }
    // small function to check the checkbox
    function isChecked($str_data)
    {
        global $hol_dayname;
        if (in_array($str_data, $hol_dayname)) {
            return 'checked';
        }
    }
    // create table object
    $table = new simbio_table();
    $table->table_attr = 'align="center" class="border fullWidth" cellpadding="5" cellspacing="0"';
    // dayname list
    $table->appendTableRow(array('<input type="checkbox" name="dayname[]" value="mon" ' . isChecked('mon') . ' /> ' . lang_sys_conf_holiday_field_day_1, '<input type="checkbox" name="dayname[]" value="tue" ' . isChecked('tue') . ' /> ' . lang_sys_conf_holiday_field_day_2, '<input type="checkbox" name="dayname[]" value="wed" ' . isChecked('wed') . ' /> ' . lang_sys_conf_holiday_field_day_3));
    $table->appendTableRow(array('<input type="checkbox" name="dayname[]" value="thu" ' . isChecked('thu') . ' /> ' . lang_sys_conf_holiday_field_day_4, '<input type="checkbox" name="dayname[]" value="fri" ' . isChecked('fri') . ' /> ' . lang_sys_conf_holiday_field_day_5, '<input type="checkbox" name="dayname[]" value="sat" ' . isChecked('sat') . ' /> ' . lang_sys_conf_holiday_field_day_6));
    $table->appendTableRow(array('<input type="checkbox" name="dayname[]" value="sun" ' . isChecked('sun') . ' /> ' . lang_sys_conf_holiday_field_day_7));
    // set cell attribute
    $table->setCellAttr(3, 0, 'colspan="3"');
    // submit button
    $table->appendTableRow(array('<input type="button" name="saveDaynameData" value="' . lang_sys_conf_holiday_form_save . '" onclick="setContent(\'mainContent\', \'' . $_SERVER['PHP_SELF'] . '\', \'post\', $(\'holidayForm\').serialize())" />'));
    // set cell attribute
    $table->setCellAttr(4, 0, 'colspan="3" class="alterCell"');
    echo '<form name="holidayForm" id="holidayForm">';
    echo $table->printTable();
    echo '</form>';
}