function showLoanHist($num_recs_show = 1000000)
 {
     global $dbs;
     require SIMBIO . 'simbio_GUI/table/simbio_table.inc.php';
     require SIMBIO . 'simbio_DB/datagrid/simbio_dbgrid.inc.php';
     require SIMBIO . 'simbio_GUI/paging/simbio_paging.inc.php';
     require SIMBIO . 'simbio_UTILS/simbio_date.inc.php';
     // table spec
     $_table_spec = 'loan AS l
         LEFT JOIN member AS m ON l.member_id=m.member_id
         LEFT JOIN item AS i ON l.item_code=i.item_code
         LEFT JOIN biblio AS b ON i.biblio_id=b.biblio_id';
     // create datagrid
     $_loan_hist = new simbio_datagrid();
     $_loan_hist->disable_paging = true;
     $_loan_hist->table_ID = 'loanhist';
     $_loan_hist->setSQLColumn('l.item_code AS \'' . __('Item Code') . '\'', 'b.title AS \'' . __('Title') . '\'', 'l.loan_date AS \'' . __('Loan Date') . '\'', 'l.return_date AS \'' . __('Return Date') . '\'');
     $_loan_hist->setSQLorder('l.loan_date DESC');
     $_criteria = sprintf('m.member_id=\'%s\' AND l.is_lent=1 AND is_return=1 ', $_SESSION['mid']);
     $_loan_hist->setSQLCriteria($_criteria);
     /* callback function to show overdue */
     function showOverdue($obj_db, $array_data)
     {
         $_curr_date = date('Y-m-d');
         if (simbio_date::compareDates($array_data[3], $_curr_date) == $_curr_date) {
             #return '<strong style="color: #f00;">'.$array_data[3].' '.__('OVERDUED').'</strong>';
         } else {
             return $array_data[3];
         }
     }
     // modify column value
     #$_loan_hist->modifyColumnContent(3, 'callback{showOverdue}');
     // set table and table header attributes
     $_loan_hist->table_attr = 'align="center" class="memberLoanList" cellpadding="5" cellspacing="0"';
     $_loan_hist->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
     $_loan_hist->using_AJAX = false;
     // return the result
     $_result = $_loan_hist->createDataGrid($dbs, $_table_spec, $num_recs_show);
     $_result = '<div class="memberLoanHistInfo">' . $_loan_hist->num_rows . ' ' . __('item(s) loan history') . '</div>' . "\n" . $_result;
     return $_result;
 }
 /**
  * Modified method to make HTML output more friendly to printer
  *
  * @param   object  $obj_db
  * @param   integer $int_num2show
  * @return  string
  */
 protected function makeOutput($int_num2show = 30)
 {
     // remove invisible field
     parent::removeInvisibleField();
     // disable row highlight
     $this->highlight_row = false;
     // get fields array and set the table header
     $this->setHeader($this->grid_result_fields);
     $_record_row = 1;
     // data loop
     foreach ($this->grid_result_rows as $_data) {
         // alternate the row color
         $_row_class = $_record_row % 2 == 0 ? 'alterCellPrinted' : 'alterCellPrinted2';
         // append array to table
         $this->appendTableRow($_data);
         // field style modification
         foreach ($this->grid_result_fields as $_idx => $_fld) {
             // checking for special field width value set by column_width property array
             $_row_attr = 'valign="top"';
             $_classes = $_row_class;
             if (isset($this->column_width[$_idx])) {
                 $_row_attr .= ' style="width: ' . $this->column_width[$_idx] . ';"';
             }
             $this->setCellAttr($_record_row, $_idx, $_row_attr . ' class="' . $_classes . '"');
         }
         $_record_row++;
     }
     // init buffer return var
     $_buffer = '';
     // create paging
     if ($this->num_rows > $int_num2show) {
         $this->paging_set = simbio_paging::paging($this->num_rows, $int_num2show, 10, '', 'reportView');
     } else {
         $this->paging_set = '&nbsp;';
     }
     $_buffer .= '<div class="printPageInfo"><strong>' . $this->num_rows . '</strong> ' . __('record(s) found. Currently displaying page') . ' ' . $this->current_page . ' (' . $int_num2show . ' ' . __('record each page') . ')</div>' . "\n";
     //mfc
     $_buffer .= $this->printTable();
     return $_buffer;
 }
}
echo ' ' . __('in queue waiting to be printed.');
//mfc
?>
    </div>
</div>
</fieldset>
<?php 
/* search form end */
/* ITEM LIST */
require SIMBIO_BASE_DIR . 'simbio_UTILS/simbio_tokenizecql.inc.php';
require LIB_DIR . 'biblio_list.inc.php';
// table spec
$table_spec = 'item LEFT JOIN biblio ON item.biblio_id=biblio.biblio_id';
// create datagrid
$datagrid = new simbio_datagrid();
$datagrid->setSQLColumn('item.item_code', 'item.item_code AS \'' . __('Item Code') . '\'', 'biblio.title AS \'' . __('Title') . '\'');
$datagrid->setSQLorder('item.last_update DESC');
// is there any search
if (isset($_GET['keywords']) and $_GET['keywords']) {
    $keywords = $dbs->escape_string(trim($_GET['keywords']));
    $searchable_fields = array('title', 'author', 'subject', 'itemcode');
    $search_str = '';
    // if no qualifier in fields
    if (!preg_match('@[a-z]+\\s*=\\s*@i', $keywords)) {
        foreach ($searchable_fields as $search_field) {
            $search_str .= $search_field . '=' . $keywords . ' OR ';
        }
    } else {
        $search_str = $keywords;
    }
Exemplo n.º 4
0
    }
    // print out the form object
    echo $form->printOut();
} else {
    /* TOPIC LIST */
    // table spec
    $sql_criteria = 't.topic_id > 1';
    if (isset($_GET['type']) && $_GET['type'] == 'orphaned') {
        $table_spec = 'mst_topic AS t LEFT JOIN biblio_topic AS bt ON t.topic_id=bt.topic_id';
        $sql_criteria = 'bt.biblio_id IS NULL OR bt.topic_id IS NULL';
    } else {
        $table_spec = 'mst_topic AS t';
    }
    $subj_type_fld = 1;
    // create datagrid
    $datagrid = new simbio_datagrid();
    if ($can_read and $can_write) {
        $subj_type_fld = 2;
        $datagrid->setSQLColumn('t.topic_id', 't.topic AS \'' . __('Subject') . '\'', 't.topic_type AS \'' . __('Subject Type') . '\'', 't.auth_list AS \'' . __('Authority Files') . '\'', 't.last_update AS \'' . __('Last Update') . '\'');
    } else {
        $datagrid->setSQLColumn('t.topic AS \'' . __('Subject') . '\'', 't.topic_type AS \'' . __('Subject Type') . '\'', 't.auth_list AS \'' . __('Authority Files') . '\'', 't.last_update AS \'' . __('Last Update') . '\'');
    }
    $datagrid->setSQLorder('topic ASC');
    // is there any search
    if (isset($_GET['keywords']) and $_GET['keywords']) {
        $keyword = $dbs->escape_string(trim($_GET['keywords']));
        $words = explode(' ', $keyword);
        if (count($words) > 1) {
            $concat_sql = ' AND (';
            foreach ($words as $word) {
                $concat_sql .= " t.topic LIKE '%{$word}%' AND";
Exemplo n.º 5
0
        mode : "exact", elements : "contentDesc", theme : "advanced",
        plugins : "safari,style,table,media,searchreplace,directionality,visualchars,xhtmlxtras,compat2x",
        skin : "o2k7", skin_variant : "silver",
        // Theme options
        theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,fontsizeselect,|,bullist,numlist,|,link,unlink,anchor,image,cleanup,code,forecolor",
        theme_advanced_buttons2 : "undo,redo,|,tablecontrols,|,hr,removeformat,visualaid,|,charmap,media,|,ltr,rtl,|,search,replace",
        theme_advanced_buttons3 : null, theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "center", theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : false, content_css : "' . (SENAYAN_WEB_ROOT_DIR . 'admin/' . $sysconf['admin_template']['css']) . '",
        });</script>';
    echo $form->printOut();
} else {
    /* USER LIST */
    // table spec
    $table_spec = 'content AS c';
    // create datagrid
    $datagrid = new simbio_datagrid();
    if ($can_read and $can_write) {
        $datagrid->setSQLColumn('c.content_id', 'c.content_title AS \'' . __('Content Title') . '\'', 'c.content_path AS \'' . __('Path (Must be unique)') . '\'', 'c.last_update AS \'' . __('Last Updated') . '\'');
    } else {
        $datagrid->setSQLColumn('c.content_title AS \'' . __('Content Title') . '\'', 'c.content_path AS \'' . __('Path (Must be unique)') . '\'', 'c.last_update AS \'' . __('Last Updated') . '\'');
    }
    $datagrid->setSQLorder('c.last_update DESC');
    // is there any search
    $criteria = 'c.content_id IS NOT NULL ';
    if (isset($_GET['keywords']) and $_GET['keywords']) {
        $keywords = $dbs->escape_string($_GET['keywords']);
        $criteria .= " AND MATCH(content_title, content_desc) AGAINST('{$keywords}')";
    }
    $datagrid->setSQLCriteria($criteria);
    // set table and table header attributes
    $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"';
Exemplo n.º 6
0
        $rules[] = SKIP_STOCK_TAKE;
    }
    $form->addCheckbox('rules', __('Rules'), $rules_option, $rules);
    // edit mode messagge
    if ($form->edit_mode) {
        echo '<div class="infoBox">' . __('You are going to edit Item Status data') . ' : <b>' . $rec_d['item_status_name'] . '</b>  <br />' . __('Last Update') . $rec_d['last_update'] . '</div>';
        //mfc
    }
    // print out the form object
    echo $form->printOut();
} else {
    /* ITEM STATUS LIST */
    // table spec
    $table_spec = 'mst_item_status AS ist';
    // create datagrid
    $datagrid = new simbio_datagrid();
    if ($can_read and $can_write) {
        $datagrid->setSQLColumn('ist.item_status_id', 'ist.item_status_id AS \'' . __('Item Status Code') . '\'', 'ist.item_status_name AS \'' . __('Item Status Name') . '\'', 'ist.last_update AS \'' . __('Last Update') . '\'');
    } else {
        $datagrid->setSQLColumn('ist.item_status_id AS \'' . __('Item Status Code') . '\'', 'ist.item_status_name AS \'' . __('Item Status Name') . '\'', 'ist.last_update AS \'' . __('Last Update') . '\'');
    }
    $datagrid->setSQLorder('item_status_name ASC');
    // change the record order
    if (isset($_GET['fld']) and isset($_GET['dir'])) {
        $datagrid->setSQLorder("'" . urldecode($_GET['fld']) . "' " . $dbs->escape_string($_GET['dir']));
    }
    // is there any search
    if (isset($_GET['keywords']) and $_GET['keywords']) {
        $keywords = $dbs->escape_string($_GET['keywords']);
        $datagrid->setSQLCriteria("ist.item_status_name LIKE '%{$keywords}%'");
    }
Exemplo n.º 7
0
    }
    /* Form Element(s) */
    // language ID
    $form->addTextField('text', 'langID', __('Language Code') . '*', $rec_d['language_id'], 'style="width: 20%;" maxlength="5"');
    // language_name
    $form->addTextField('text', 'langName', __('Language') . '*', $rec_d['language_name'], 'style="width: 60%;"');
    // print out the form object
    echo '<div class="infoBox">' . __('You are going to edit language data') . ' : <b>' . $rec_d['language_name'] . '</b>  <br />' . __('Last Update') . $rec_d['last_update'] . '</div>';
    //mfc
    echo $form->printOut();
} else {
    /* DOCUMENT LANGUAGE LIST */
    // table spec
    $table_spec = 'mst_language AS l';
    // create datagrid
    $datagrid = new simbio_datagrid();
    if ($can_read and $can_write) {
        $datagrid->setSQLColumn('l.language_id', 'l.language_name AS \'' . __('Language') . '\'', 'l.last_update AS \'' . __('Last Update') . '\'');
    } else {
        $datagrid->setSQLColumn('l.language_name AS \'' . __('Language') . '\'', 'l.last_update AS \'' . __('Last Update') . '\'');
    }
    $datagrid->setSQLorder('language_name ASC');
    // is there any search
    if (isset($_GET['keywords']) and $_GET['keywords']) {
        $keywords = $dbs->escape_string($_GET['keywords']);
        $datagrid->setSQLCriteria("l.language_name LIKE '%{$keywords}%'");
    }
    // set table and table header attributes
    $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"';
    $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
    // set delete proccess URL
require SIMBIO_BASE_DIR . 'simbio_GUI/paging/simbio_paging.inc.php';
require SIMBIO_BASE_DIR . 'simbio_DB/datagrid/simbio_dbgrid.inc.php';
// page title
$page_title = 'Member Loan List';
// start the output buffering
ob_start();
// check if there is member ID
if (isset($_SESSION['memberID']) and !empty($_SESSION['memberID'])) {
    /* LOAN HISTORY LIST */
    $memberID = trim($_SESSION['memberID']);
    // table spec
    $table_spec = 'loan AS l
        LEFT JOIN item AS i ON l.item_code=i.item_code
        LEFT JOIN biblio AS b ON i.biblio_id=b.biblio_id';
    // create datagrid
    $datagrid = new simbio_datagrid();
    $datagrid->setSQLColumn('l.item_code AS \'' . __('Item Code') . '\'', 'b.title AS \'' . __('Title') . '\'', 'l.loan_date AS \'' . __('Loan Date') . '\'', 'IF(return_date IS NULL, \'<i>' . __('Not Returned Yet') . '</i>\', return_date) AS \'' . __('Returned Date') . '\'');
    $datagrid->setSQLorder("l.loan_date DESC");
    $criteria = 'l.member_id=\'' . $dbs->escape_string($memberID) . '\' ';
    // is there any search
    if (isset($_GET['keywords']) and $_GET['keywords']) {
        $keyword = $dbs->escape_string($_GET['keywords']);
        $criteria .= " AND (l.item_code LIKE '%{$keyword}%' OR b.title LIKE '%{$keyword}%')";
    }
    $datagrid->setSQLCriteria($criteria);
    // set table and table header attributes
    $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"';
    $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
    $datagrid->icon_edit = SENAYAN_WEB_ROOT_DIR . 'admin/' . $sysconf['admin_template']['dir'] . '/' . $sysconf['admin_template']['theme'] . '/edit.gif';
    // special properties
    $datagrid->using_AJAX = false;
Exemplo n.º 9
0
    if ($form->edit_mode) {
        echo '<div class="infoBox">' . __('You are going to edit user profile'), ' : <b>' . $rec_d['realname'] . '</b> <br />' . __('Last Update') . $rec_d['last_update'] . ' //mfc
            <br />' . __('Leave Password field blank if you don\'t want to change the password') . '</div>';
    }
    // print out the form object
    echo $form->printOut();
} else {
    // only administrator have privileges to view user list
    if (!($can_read and $can_write) or $_SESSION['uid'] != 1) {
        die('<div class="errorBox">' . __('You don\'t have enough privileges to view this section') . '</div>');
    }
    /* USER LIST */
    // table spec
    $table_spec = 'user AS u';
    // create datagrid
    $datagrid = new simbio_datagrid();
    if ($can_read and $can_write) {
        $datagrid->setSQLColumn('u.user_id', 'u.realname AS \'' . __('Real Name') . '\'', 'u.username AS \'' . __('Login Username') . '\'', 'u.last_login AS \'' . __('Last Login') . '\'', 'u.last_update AS \'' . __('Last Update') . '\'');
    } else {
        $datagrid->setSQLColumn('u.realname AS \'' . __('Real Name') . '\'', 'u.username AS \'' . __('Real Name') . '\'', 'u.last_login AS \'' . __('Last Login') . '\'', 'u.last_update AS \'' . __('Last Update') . '\'');
    }
    $datagrid->setSQLorder('username ASC');
    // is there any search
    $criteria = 'u.user_id != 1 ';
    if (isset($_GET['keywords']) and $_GET['keywords']) {
        $keywords = $dbs->escape_string($_GET['keywords']);
        $criteria .= " AND (u.username LIKE '%{$keywords}%' OR u.realname LIKE '%{$keywords}%')";
    }
    $datagrid->setSQLCriteria($criteria);
    // set table and table header attributes
    $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"';
Exemplo n.º 10
0
 #var_dump($unpaid_fines);
 if (!empty($unpaid_fines)) {
     foreach ($unpaid_fines as $key => $value) {
         $total_unpaid_fines = $total_unpaid_fines + $value['3'] - $value['4'];
     }
 }
 if ($total_unpaid_fines > 0) {
     $fines_alert = TRUE;
 }
 echo '<div style="color:red; font-weight:bold;">Total of unpaid fines: ' . $total_unpaid_fines . '</div>';
 /* FINES LIST */
 $memberID = trim($_SESSION['memberID']);
 // table spec
 $table_spec = 'fines AS f';
 // create datagrid
 $datagrid = new simbio_datagrid();
 $datagrid->setSQLColumn('f.fines_id AS \'EDIT\'', 'f.description AS \'' . __('Description/Name') . '\'', 'f.fines_date AS \'' . __('Fines Date') . '\'', 'f.debet AS \'' . __('Debit') . '\'', 'f.credit AS \'' . __('Credit') . '\'');
 $datagrid->setSQLorder("f.fines_date DESC");
 $criteria = 'f.member_id=\'' . $dbs->escape_string($memberID) . '\' ';
 // view balanced overdue
 if (isset($_GET['balance'])) {
     $criteria .= ' AND (f.debet=f.credit) ';
 } else {
     $criteria .= ' AND (f.debet!=f.credit) ';
 }
 // is there any search
 if (isset($_GET['keywords']) and $_GET['keywords']) {
     $keyword = $dbs->escape_string($_GET['keywords']);
     $criteria .= " AND (f.description LIKE '%{$keyword}%' OR f.fines_date LIKE '%{$keyword}%')";
 }
 $datagrid->setSQLCriteria($criteria);
Exemplo n.º 11
0
    ?>
system/sys_log.php" id="saveLogsForm" target="blindSubmit" method="post" style="display: inline;"><input type="hidden" name="saveLogs" value="true" /></form>
    <?php 
}
?>
    <!-- LOG CLEARANCE FORM END -->
  </div>
</div>
</fieldset>
<?php 
/* search form end */
/* SYSTEM LOGS LIST */
// table spec
$table_spec = 'system_log AS sl';
// create datagrid
$datagrid = new simbio_datagrid();
$datagrid->setSQLColumn('sl.log_date AS \'' . __('Time') . '\'', 'sl.log_location AS \'' . __('Location') . '\'', 'sl.log_msg AS \'' . __('Message') . '\'');
$datagrid->setSQLorder('sl.log_date DESC');
// is there any search
if (isset($_GET['keywords']) and $_GET['keywords']) {
    $keyword = $dbs->escape_string(trim($_GET['keywords']));
    $words = explode(' ', $keyword);
    if (count($words) > 1) {
        $concat_sql = ' (';
        foreach ($words as $word) {
            $concat_sql .= " (sl.log_date LIKE '%{$word}%' OR sl.log_msg LIKE '%{$word}%') AND";
        }
        // remove the last AND
        $concat_sql = substr_replace($concat_sql, '', -3);
        $concat_sql .= ') ';
        $datagrid->setSQLCriteria($concat_sql);
Exemplo n.º 12
0
     while ($_biblio_d = $_biblio_q->fetch_row()) {
         $_title = $_biblio_d[0];
         $_authors .= $_biblio_d[1] . ' - ';
     }
     $_authors = substr_replace($_authors, '', -3);
     $_output = '<div style="float: left;"><b>' . $_title . '</b><br /><i>' . $_authors . '</i></div>';
     return $_output;
 }
 // callback function to show node name
 function showNodeName($obj_db, $array_data)
 {
     global $sysconf;
     return $sysconf['node'][$array_data[4]]['name'];
 }
 // create datagrid
 $datagrid = new simbio_datagrid();
 if ($can_read and $can_write) {
     $datagrid->setSQLColumn('biblio.biblio_id', 'biblio.biblio_id AS bid', 'biblio.title AS \'' . __('Title') . '\'', 'biblio.isbn_issn AS \'' . __('ISBN/ISSN') . '\'', 'biblio.node_id AS \'' . __('Node') . '\'', 'biblio.last_update AS \'' . __('Last Update') . '\'');
     $datagrid->modifyColumnContent(2, 'callback{showTitleAuthors}');
     $datagrid->modifyColumnContent(4, 'callback{showNodeName}');
 } else {
     $datagrid->setSQLColumn('biblio.biblio_id AS bid', 'biblio.title AS \'' . __('Title') . '\'', 'biblio.isbn_issn AS \'' . __('ISBN/ISSN') . '\'', 'biblio.node_id AS \'' . __('Node') . '\'', 'biblio.last_update AS \'' . __('Last Update') . '\'');
     // modify column value
     $datagrid->modifyColumnContent(1, 'callback{showTitleAuthors}');
     $datagrid->modifyColumnContent(3, 'callback{showNodeName}');
 }
 $datagrid->invisible_fields = array(0);
 $datagrid->setSQLorder('biblio.input_date DESC');
 // is there any search
 if (isset($_GET['keywords']) and $_GET['keywords']) {
     $keywords = $dbs->escape_string(trim($_GET['keywords']));
    echo '<font id="queueCount" style="color: #f00">0</font>';
}
echo ' ' . __('in queue waiting to be printed.');
//mfc
?>
    </div>
</div>
</fieldset>
<?php 
/* search form end */
/* ITEM LIST */
// table spec
$table_spec = 'member AS m
    LEFT JOIN mst_member_type AS mt ON m.member_type_id=mt.member_type_id';
// create datagrid
$datagrid = new simbio_datagrid();
$datagrid->setSQLColumn('m.member_id', 'm.member_id AS \'' . __('Member ID') . '\'', 'm.member_name AS \'' . __('Member Name') . '\'', 'mt.member_type_name AS \'' . __('Membership Type') . '\'');
$datagrid->setSQLorder('m.last_update DESC');
// is there any search
if (isset($_GET['keywords']) and $_GET['keywords']) {
    $keyword = $dbs->escape_string(trim($_GET['keywords']));
    $words = explode(' ', $keyword);
    if (count($words) > 1) {
        $concat_sql = ' (';
        foreach ($words as $word) {
            $concat_sql .= " (m.member_id LIKE '%{$word}%' OR m.member_name LIKE '%{$word}%'";
        }
        // remove the last AND
        $concat_sql = substr_replace($concat_sql, '', -3);
        $concat_sql .= ') ';
        $datagrid->setSQLCriteria($concat_sql);
Exemplo n.º 14
0
    $form->addTextField('text', 'supplierFax', __('Fax Number'), $rec_d['fax'], 'style="width: 60%;"');
    // supplier account number
    $form->addTextField('text', 'supplierAccount', __('Account Number'), $rec_d['account'], 'style="width: 60%;"');
    // edit mode messagge
    if ($form->edit_mode) {
        echo '<div class="infoBox">' . __('You are going to edit Supplier data') . ' : <b>' . $rec_d['supplier_name'] . '</b> <br />' . __('Last Update') . $rec_d['last_update'] . '</div>';
        //mfc
    }
    // print out the form object
    echo $form->printOut();
} else {
    /* SUPPLIER LIST */
    // table spec
    $table_spec = 'mst_supplier AS sp';
    // create datagrid
    $datagrid = new simbio_datagrid();
    if ($can_read and $can_write) {
        $datagrid->setSQLColumn('sp.supplier_id', 'sp.supplier_name AS \'' . __('Supplier Name') . '\'', 'sp.contact AS \'' . __('Contact') . '\'', 'sp.phone AS \'' . __('Phone Number') . '\'', 'sp.fax AS \'' . __('Fax Number') . '\'', 'sp.last_update AS \'' . __('Last Update') . '\'');
    } else {
        $datagrid->setSQLColumn('sp.supplier_name AS \'' . __('Supplier Name') . '\'', 'sp.contact AS \'' . __('Contact') . '\'', 'sp.phone AS \'' . __('Phone Number') . '\'', 'sp.fax AS \'' . __('Fax Number') . '\'', 'sp.last_update AS \'' . __('Last Update') . '\'');
    }
    $datagrid->setSQLorder('supplier_name ASC');
    // is there any search
    if (isset($_GET['keywords']) and $_GET['keywords']) {
        $keywords = $dbs->escape_string($_GET['keywords']);
        $datagrid->setSQLCriteria("sp.supplier_name LIKE '%{$keywords}%' OR sp.supplier_id LIKE '%{$keywords}%'\n            OR sp.contact LIKE '%{$keywords}%' OR sp.address LIKE '%{$keywords}%'");
    }
    // set table and table header attributes
    $datagrid->table_attr = 'align="center" class="dataList" cellpadding="5" cellspacing="0"';
    $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
    // set delete proccess URL
Exemplo n.º 15
0
    $unit_options[] = array('month', lang_sys_common_month);
    $unit_options[] = array('year', lang_sys_common_year);
    $form->addSelectList('timeUnit', lang_mod_masterfile_frequency_form_field_frequency_unit, $unit_options, $rec_d['time_unit']);
    // edit mode messagge
    if ($form->edit_mode) {
        echo '<div class="infoBox">' . lang_mod_masterfile_frequency_common_edit_info . ' : <b>' . $rec_d['frequency'] . '</b>  <br />' . lang_mod_masterfile_frequency_common_last_update . $rec_d['last_update'] . '</div>';
    }
    // print out the form object
    echo $form->printOut();
} else {
    /* GMD LIST */
    // table spec
    $table_spec = 'mst_frequency AS f
        LEFT JOIN mst_language AS l ON f.language_prefix=l.language_id';
    // create datagrid
    $datagrid = new simbio_datagrid();
    if ($can_read and $can_write) {
        $datagrid->setSQLColumn('f.frequency_id', 'f.frequency AS \'' . lang_mod_masterfile_frequency_form_field_frequency_name . '\'', 'l.language_name AS \'' . lang_mod_masterfile_lang_form_field_name . '\'', 'f.time_increment AS \'' . lang_mod_masterfile_frequency_form_field_frequency_time_increment . '\'', 'f.time_unit AS \'' . lang_mod_masterfile_frequency_form_field_frequency_unit . '\'', 'f.last_update AS \'' . lang_mod_masterfile_frequency_common_last_update . '\'');
    } else {
        $datagrid->setSQLColumn('f.frequency AS \'' . lang_mod_masterfile_frequency_form_field_frequency_name . '\'', 'l.language_name AS \'' . lang_mod_masterfile_lang_form_field_name . '\'', 'f.time_increment AS \'' . lang_mod_masterfile_frequency_form_field_frequency_time_increment . '\'', 'f.time_unit AS \'' . lang_mod_masterfile_frequency_form_field_frequency_unit . '\'', 'f.last_update AS \'' . lang_mod_masterfile_frequency_common_last_update . '\'');
    }
    $datagrid->setSQLorder('frequency ASC');
    // is there any search
    if (isset($_GET['keywords']) and $_GET['keywords']) {
        $keywords = $dbs->escape_string($_GET['keywords']);
        $datagrid->setSQLCriteria("g.frequency_name LIKE '%{$keywords}%'");
    }
    // set table and table header attributes
    $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"';
    $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
    // set delete proccess URL
Exemplo n.º 16
0
    // print out the form object
    echo $form->printOut();
} else {
    /* AUTHOR LIST */
    // table spec
    $sql_criteria = 'a.author_id > 1';
    if (isset($_GET['type']) && $_GET['type'] == 'orphaned') {
        $table_spec = 'mst_author AS a LEFT JOIN biblio_author AS ba ON a.author_id=ba.author_id';
        $sql_criteria = 'ba.biblio_id IS NULL OR ba.author_id IS NULL';
    } else {
        $table_spec = 'mst_author AS a';
    }
    // authority field num
    $auth_type_fld = 2;
    // create datagrid
    $datagrid = new simbio_datagrid();
    if ($can_read and $can_write) {
        $auth_type_fld = 3;
        $datagrid->setSQLColumn('a.author_id', 'a.author_name AS \'' . __('Author Name') . '\'', 'a.author_year AS \'' . __('Author Year') . '\'', 'a.authority_type AS \'' . __('Authority Type') . '\'', 'a.auth_list AS \'' . __('Authority Files') . '\'', 'a.last_update AS \'' . __('Last Update') . '\'');
    } else {
        $datagrid->setSQLColumn('a.author_name AS \'' . __('Author Name') . '\'', 'a.author_year AS \'' . __('Author Year') . '\'', 'a.authority_type AS \'' . __('Authority Type') . '\'', 'a.auth_list AS \'' . __('Authority Files') . '\'', 'a.last_update AS \'' . __('Last Update') . '\'');
    }
    $datagrid->setSQLorder('author_name ASC');
    // change the record order
    if (isset($_GET['fld']) and isset($_GET['dir'])) {
        $datagrid->setSQLorder("'" . urldecode($_GET['fld']) . "' " . $dbs->escape_string($_GET['dir']));
    }
    // is there any search
    if (isset($_GET['keywords']) and $_GET['keywords']) {
        $keywords = $dbs->escape_string($_GET['keywords']);
        $sql_criteria .= " AND a.author_name LIKE '%{$keywords}%'";
Exemplo n.º 17
0
    // edit mode messagge
    if ($form->edit_mode) {
        echo '<div class="infoBox">' . __('You are going to edit loan rules') . ' : <br />' . __('Last Update') . $rec_d['last_update'] . '</div>' . "\n";
        //mfc
    }
    // print out the form object
    echo $form->printOut();
} else {
    /* LOAN RULES LIST */
    // table spec
    $table_spec = 'mst_loan_rules AS lr
        LEFT JOIN mst_member_type AS mt ON lr.member_type_id=mt.member_type_id
        LEFT JOIN mst_coll_type AS ct ON lr.coll_type_id=ct.coll_type_id
        LEFT JOIN mst_gmd AS g ON lr.gmd_id=g.gmd_id';
    // create datagrid
    $datagrid = new simbio_datagrid();
    if ($can_read and $can_write) {
        $datagrid->setSQLColumn('lr.loan_rules_id', 'mt.member_type_name AS \'' . __('Member Type') . '\'', 'ct.coll_type_name AS \'' . __('Collection Type') . '\'', 'g.gmd_name AS \'' . __('GMD') . '\'', 'lr.loan_limit AS \'' . __('Loan Limit') . '\'', 'lr.loan_periode AS \'' . __('Loan Period') . '\'', 'lr.last_update AS \'' . __('Last Update') . '\'');
    } else {
        $datagrid->setSQLColumn('mt.member_type_name AS \'' . __('Member Type') . '\'', 'ct.coll_type_name AS \'' . __('Collection Type') . '\'', 'g.gmd_name AS \'' . __('GMD') . '\'', 'lr.loan_limit AS \'' . __('Loan Limit') . '\'', 'lr.loan_periode AS \'' . __('Loan Period') . '\'', 'lr.last_update AS \'' . __('Last Update') . '\'');
    }
    $datagrid->setSQLorder('mt.member_type_name ASC');
    // is there any search
    if (isset($_GET['keywords']) and $_GET['keywords']) {
        $keywords = $dbs->escape_string($_GET['keywords']);
        $datagrid->setSQLCriteria("mt.member_type_name LIKE '%{$keywords}%'");
    }
    // set table and table header attributes
    $datagrid->icon_edit = $sysconf['admin_template']['dir'] . '/' . $sysconf['admin_template']['theme'] . '/edit.gif';
    $datagrid->table_attr = 'align="center" class="dataList" cellpadding="5" cellspacing="0"';
    $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
Exemplo n.º 18
0
    $form->addTextField('text', 'modulePath', __('Module Path') . '*', $rec_d['module_path'], 'style="width: 100%;"');
    // module desc
    $form->addTextField('text', 'moduleDesc', __('Module Description'), $rec_d['module_desc'], 'style="width: 100%;"');
    // edit mode messagge
    if ($form->edit_mode) {
        echo '<div class="infoBox">' . __('You are going to edit data') . ' : <b>' . $rec_d['module_name'] . '</b></div>';
        //mfc
    }
    // print out the form object
    echo $form->printOut();
} else {
    /* MODULE LIST */
    // table spec
    $table_spec = 'mst_module AS mdl';
    // create datagrid
    $datagrid = new simbio_datagrid();
    $datagrid->setSQLColumn('mdl.module_id', 'mdl.module_name AS \'' . __('Module Name') . '\'', 'mdl.module_desc AS \'' . __('Module Description') . '\'');
    $datagrid->setSQLorder('module_name ASC');
    // is there any search
    if (isset($_GET['keywords']) and $_GET['keywords']) {
        $keywords = $dbs->escape_string($_GET['keywords']);
        $datagrid->setSQLCriteria("mdl.module_name LIKE '%{$keywords}%'");
    }
    // set table and table header attributes
    $datagrid->icon_edit = $sysconf['admin_template']['dir'] . '/' . $sysconf['admin_template']['theme'] . '/edit.gif';
    $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"';
    $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
    // set delete proccess URL
    $datagrid->chbox_form_URL = $_SERVER['PHP_SELF'];
    // put the result into variables
    $datagrid_result = $datagrid->createDataGrid($dbs, $table_spec, 20, true);
Exemplo n.º 19
0
    // authority list
    $form->addTextField('text', 'authList', lang_mod_masterfile_authority_files, $rec_d['auth_list'], 'style="width: 30%;"');
    // edit mode messagge
    if ($form->edit_mode) {
        echo '<div class="infoBox">' . lang_mod_masterfile_author_common_edit_info . '<b>' . $rec_d['author_name'] . '</b> <br />' . lang_mod_masterfile_author_common_last_update . $rec_d['last_update'] . '</div>';
    }
    // 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;
    // create datagrid
    $datagrid = new simbio_datagrid();
    if ($can_read and $can_write) {
        $auth_type_fld = 2;
        $datagrid->setSQLColumn('a.author_id', 'a.author_name AS \'' . lang_mod_masterfile_author_form_field_name . '\'', 'a.authority_type AS \'' . lang_mod_masterfile_author_form_field_authority . '\'', 'a.auth_list AS \'' . lang_mod_masterfile_authority_files . '\'', 'a.last_update AS \'' . lang_mod_masterfile_author_common_last_update . '\'');
    } else {
        $datagrid->setSQLColumn('a.author_name AS \'' . lang_mod_masterfile_author_form_field_name . '\'', 'a.authority_type AS \'' . lang_mod_masterfile_author_form_field_authority . '\'', 'a.auth_list AS \'' . lang_mod_masterfile_authority_files . '\'', 'a.last_update AS \'' . lang_mod_masterfile_author_common_last_update . '\'');
    }
    $datagrid->setSQLorder('author_name ASC');
    // change the record order
    if (isset($_GET['fld']) and isset($_GET['dir'])) {
        $datagrid->setSQLorder("'" . urldecode($_GET['fld']) . "' " . $dbs->escape_string($_GET['dir']));
    }
    // is there any search
    if (isset($_GET['keywords']) and $_GET['keywords']) {
        $keywords = $dbs->escape_string($_GET['keywords']);
        $datagrid->setSQLCriteria("a.author_name LIKE '%{$keywords}%'");
Exemplo n.º 20
0
        <div style="margin-top: 3px;"><div style="width: 90px; float: left;"><?php echo __('Search'); ?> : </div><input type="text" name="keywords" size="30" /> <input type="hidden" name="view" value="<?php echo $view; ?>" /> <input type="submit" id="doSearch" value="<?php echo __('Search'); ?>" class="button" /></div>
        </form>
    </div>
    </fieldset>
    <!-- give focus to itemCode text field -->
    <script type="text/javascript">
    Form.Element.focus('itemCode');
    </script>
    <div id="stError" class="errorBox" style="display: none;">&nbsp;</div>
<?php
    /* CURRENT STOCK TAKE ITEM LIST */
    // table spec
    $table_spec = 'stock_take_item AS sti';

    // create datagrid
    $datagrid = new simbio_datagrid();
    $datagrid->setSQLColumn('item_code AS \''.__('Item Code').'\'',
        'title AS \''.__('Title').'\'',
        'coll_type_name AS \''.__('Collection Type').'\'',
        'classification AS \''.__('Classification').'\'',
        'IF(sti.status=\'e\', \''.__('Exists').'\', IF(sti.status=\'l\', \''.__('On Loan').'\', \''.__('Missing').'\')) AS \'Status\'');
    $datagrid->setSQLorder("last_update DESC");

    $criteria = 'item_id <> 0 ';
    // is there any search
    if (isset($_GET['keywords']) AND $_GET['keywords']) {
        $keyword = $dbs->escape_string(trim($_GET['keywords']));
        $words = explode(' ', $keyword);
        if (count($words) > 1) {
            $concat_sql = ' (';
            foreach ($words as $word) {
Exemplo n.º 21
0
         $_promoted = (int) $_biblio_d[3];
     }
     $_authors = substr_replace($_authors, '', -3);
     $_output = '<div style="float: left;"><b>' . $_title . '</b><br /><i>' . $_authors . '</i></div>';
     // check for opac hide flag
     if ($_opac_hide) {
         $_output .= '<div style="float: right; width: 20px; height: 20px;" class="lockFlagIcon" title="Hidden in OPAC">&nbsp;</div>';
     }
     // check for promoted flag
     if ($_promoted) {
         $_output .= '<div style="float: right; width: 20px; height: 20px;" class="homeFlagIcon" title="Promoted To Homepage">&nbsp;</div>';
     }
     return $_output;
 }
 // create datagrid
 $datagrid = new simbio_datagrid();
 if ($can_read and $can_write) {
     $datagrid->setSQLColumn('biblio.biblio_id', 'biblio.biblio_id AS bid', 'biblio.title AS \'' . __('Title') . '\'', 'biblio.isbn_issn AS \'' . __('ISBN/ISSN') . '\'', 'IF(COUNT(item.item_id)>0, COUNT(item.item_id), \'<strong style="color: #f00;">' . __('None') . '</strong>\') AS \'' . __('Copies') . '\'', 'biblio.last_update AS \'' . __('Last Update') . '\'');
     $datagrid->modifyColumnContent(2, 'callback{showTitleAuthors}');
 } else {
     $datagrid->setSQLColumn('biblio.biblio_id AS bid', 'biblio.title AS \'' . __('Title') . '\'', 'biblio.isbn_issn AS \'' . __('ISBN/ISSN') . '\'', 'IF(COUNT(item.item_id)>0, COUNT(item.item_id), \'<strong style="color: #f00;">' . __('None') . '</strong>\') AS \'' . __('Copies') . '\'', 'biblio.last_update AS \'' . __('Last Update') . '\'');
     // modify column value
     $datagrid->modifyColumnContent(1, 'callback{showTitleAuthors}');
 }
 $datagrid->invisible_fields = array(0);
 $datagrid->setSQLorder('biblio.last_update DESC');
 // is there any search
 if (isset($_GET['keywords']) and $_GET['keywords']) {
     $keywords = $dbs->escape_string(trim($_GET['keywords']));
     $searchable_fields = array('title', 'author', 'subject', 'isbn', 'publisher');
     if ($_GET['field'] != '0' and in_array($_GET['field'], $searchable_fields)) {
Exemplo n.º 22
0
     }
     // holiday description
     $form->addTextField('text', 'holDesc', __('Holiday Description') . '*', $rec_d['description'], 'style="width: 100%;"');
     // edit mode messagge
     if ($form->edit_mode) {
         echo '<div class="infoBox">' . __('You are going to edit holiday data') . ' : <b>' . $rec_d['description'] . '</b></div>';
         //mfc
     }
     // print out the form object
     echo $form->printOut();
 } else {
     /* HOLIDAY LIST */
     // table spec
     $table_spec = 'holiday';
     // create datagrid
     $datagrid = new simbio_datagrid();
     if ($can_read and $can_write) {
         $datagrid->setSQLColumn('holiday_id', "holiday_dayname AS '" . __('Day name') . "'", "holiday_date AS '" . __('Holiday Date Start') . "'", "description AS '" . __('Holiday Description') . "'");
     } else {
         $datagrid->setSQLColumn("holiday_dayname AS '" . __('Day name') . "'", "holiday_date AS '" . __('Holiday Date Start') . "'", "description AS '" . __('Holiday Description') . "'");
     }
     $datagrid->setSQLorder('holiday_date DESC');
     // is there any search
     if (isset($_GET['keywords']) and $_GET['keywords']) {
         $keywords = $dbs->escape_string($_GET['keywords']);
         $datagrid->setSQLCriteria("holiday_description LIKE '%{$keywords}%' OR holiday_date LIKE '%{$keywords}%'");
     } else {
         $datagrid->setSQLCriteria('holiday_date IS NOT NULL');
     }
     // set table and table header attributes
     $datagrid->icon_edit = SWB . 'admin/' . $sysconf['admin_template']['dir'] . '/' . $sysconf['admin_template']['theme'] . '/edit.gif';
Exemplo n.º 23
0
system/backup_proc.php" method="post" style="display: inline; visibility: hidden;">
    <input type="hidden" name="start" value="true" />
    <input type="hidden" name="tkn" value="<?php 
echo $_SESSION['token'];
?>
" />
    </form>
  </div>
</div>
</fieldset>
<?php 
/* BACKUP LOG LIST */
// table spec
$table_spec = 'backup_log AS bl LEFT JOIN user AS u ON bl.user_id=u.user_id';
// create datagrid
$datagrid = new simbio_datagrid();
$datagrid->setSQLColumn('u.realname AS \'Backup Executor\'', 'bl.backup_time AS \'Backup Time\'', 'bl.backup_file AS \'Backup File Location\'');
$datagrid->setSQLorder('backup_time DESC');
// is there any search
if (isset($_GET['keywords']) and $_GET['keywords']) {
    $keywords = $dbs->escape_string($_GET['keywords']);
    $datagrid->setSQLCriteria("bl.backup_time LIKE '%{$keywords}%' OR bl.backup_file LIKE '%{$keywords}%'");
}
// set table and table header attributes
$datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"';
$datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
// set delete proccess URL
$datagrid->delete_URL = $_SERVER['PHP_SELF'];
// put the result into variables
$datagrid_result = $datagrid->createDataGrid($dbs, $table_spec, 20, false);
if (isset($_GET['keywords']) and $_GET['keywords']) {
Exemplo n.º 24
0
    $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();
} else {
    /* GMD LIST */
    // table spec
    $table_spec = 'mst_frequency AS f
        LEFT JOIN mst_language AS l ON f.language_prefix=l.language_id';
    // create datagrid
    $datagrid = new simbio_datagrid();
    if ($can_read and $can_write) {
        $datagrid->setSQLColumn('f.frequency_id', 'f.frequency AS \'' . __('Frequency') . '\'', 'l.language_name AS \'' . __('Language') . '\'', 'f.time_increment AS \'' . __('Time Increment') . '\'', 'f.time_unit AS \'' . __('Time Unit') . '\'', 'f.last_update AS \'' . __('Last Update') . '\'');
    } else {
        $datagrid->setSQLColumn('f.frequency AS \'' . __('Frequency') . '\'', 'l.language_name AS \'' . __('Language') . '\'', 'f.time_increment AS \'' . __('Time Increment') . '\'', 'f.time_unit AS \'' . __('Time Unit') . '\'', 'f.last_update AS \'' . __('Last Update') . '\'');
    }
    $datagrid->setSQLorder('frequency ASC');
    // is there any search
    if (isset($_GET['keywords']) and $_GET['keywords']) {
        $keywords = $dbs->escape_string($_GET['keywords']);
        $datagrid->setSQLCriteria("g.frequency_name LIKE '%{$keywords}%'");
    }
    // set table and table header attributes
    $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"';
    $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
    // set delete proccess URL
Exemplo n.º 25
0
    $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();
    $datagrid->setSQLColumn('ug.group_id', 'ug.group_name AS \'' . __('Group Name') . '\'', 'ug.last_update AS \'' . __('Last Update') . '\'');
    $datagrid->setSQLorder('group_name ASC');
    // is there any search
    $criteria = 'ug.group_id != 1';
    if (isset($_GET['keywords']) and $_GET['keywords']) {
        $keywords = $dbs->escape_string($_GET['keywords']);
        $criteria .= " AND ug.group_name LIKE '%{$keywords}%'";
    }
    $datagrid->setSQLCriteria($criteria);
    // set table and table header attributes
    $datagrid->icon_edit = SENAYAN_WEB_ROOT_DIR . 'admin/' . $sysconf['admin_template']['dir'] . '/' . $sysconf['admin_template']['theme'] . '/edit.gif';
    $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"';
    $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
    // set delete proccess URL
    $datagrid->chbox_form_URL = $_SERVER['PHP_SELF'];
Exemplo n.º 26
0
        //mfc
    }
    // print out the form object
    echo $form->printOut();
} else {
    /* PLACE LIST */
    // table spec
    $sql_criteria = 'pl.place_id > 1';
    if (isset($_GET['type']) && $_GET['type'] == 'orphaned') {
        $table_spec = 'mst_place AS pl LEFT JOIN biblio AS b ON pl.place_id = b.publish_place_id';
        $sql_criteria = 'b.publish_place_id IS NULL';
    } else {
        $table_spec = 'mst_place AS pl';
    }
    // create datagrid
    $datagrid = new simbio_datagrid();
    if ($can_read and $can_write) {
        $datagrid->setSQLColumn('pl.place_id', 'pl.place_name AS \'' . __('Place Name') . '\'', 'pl.last_update AS \'' . __('Last Update') . '\'');
    } else {
        $datagrid->setSQLColumn('pl.place_name AS \'' . __('Place Name') . '\'', 'pl.last_update AS \'' . __('Last Update') . '\'');
    }
    $datagrid->setSQLorder('place_name ASC');
    // is there any search
    if (isset($_GET['keywords']) and $_GET['keywords']) {
        $keywords = $dbs->escape_string($_GET['keywords']);
        $sql_criteria .= " AND pl.place_name LIKE '%{$keywords}%'";
    }
    $datagrid->setSQLCriteria($sql_criteria);
    // set table and table header attributes
    $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"';
    $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
Exemplo n.º 27
0
        if ($rec_d['member_image']) {
            if (file_exists(IMAGES_BASE_DIR . 'persons/' . $rec_d['member_image'])) {
                echo '<div style="float: right;"><img src="../lib/phpthumb/phpThumb.php?src=../../images/persons/' . urlencode($rec_d['member_image']) . '&w=53" style="border: 1px solid #999999" /></div>';
            }
        }
        echo '</div>' . "\n";
    }
    // print out the form object
    echo $form->printOut();
} else {
    /* MEMBERSHIP LIST */
    // table spec
    $table_spec = 'member AS m
        LEFT JOIN mst_member_type AS mt ON m.member_type_id=mt.member_type_id';
    // create datagrid
    $datagrid = new simbio_datagrid();
    if ($can_read and $can_write) {
        $datagrid->setSQLColumn('m.member_id', 'm.member_id AS \'' . __('Member ID') . '\'', 'm.member_name AS \'' . __('Member Name') . '\'', 'mt.member_type_name AS \'' . __('Membership Type') . '\'', 'm.member_email AS \'' . __('E-mail') . '\'', 'm.last_update AS \'' . __('Last Updated') . '\'');
    } else {
        $datagrid->setSQLColumn('m.member_id AS \'' . __('Member ID') . '\'', 'm.member_name AS \'' . __('Member Name') . '\'', 'mt.member_type_name AS \'' . __('Membership Type') . '\'', 'm.member_email AS \'' . __('E-mail') . '\'', 'm.last_update AS \'' . __('Last Updated') . '\'');
    }
    $datagrid->setSQLorder('member_name ASC');
    // is there any search
    $criteria = 'm.member_id IS NOT NULL ';
    if (isset($_GET['keywords']) and $_GET['keywords']) {
        $keywords = $dbs->escape_string($_GET['keywords']);
        $criteria .= " AND (m.member_name LIKE '%{$keywords}%' OR m.member_id LIKE '%{$keywords}%') ";
    }
    if (isset($_GET['expire'])) {
        $criteria .= " AND TO_DAYS('" . date('Y-m-d') . "')>TO_DAYS(m.expire_date)";
    }
Exemplo n.º 28
0
        $table->appendTableRow(array($headings, ':', $stk_data));
        // set cell attribute
        $table->setCellAttr($row, 0, 'class="alterCell" valign="top" style="width: 170px;"');
        $table->setCellAttr($row, 1, 'class="alterCell" valign="top" style="width: 1%;"');
        $table->setCellAttr($row, 2, 'class="alterCell2" valign="top" style="width: auto;"');
        // add row count
        $row++;
    }
    // print out table
    echo $table->printTable();
} else {
    /* STOCK TAKE HISTORY LIST */
    // table spec
    $table_spec = 'stock_take AS st';
    // create datagrid
    $datagrid = new simbio_datagrid();
    $datagrid->setSQLColumn('st.stock_take_id', 'st.stock_take_name AS \'' . __('Stock Take Name') . '\'', 'st.start_date AS \'' . __('Start Date') . '\'', 'st.end_date AS \'' . __('End Date') . '\'', 'CONCAT(\'<a class="notAJAX" href="' . SENAYAN_WEB_ROOT_DIR . FILES_DIR . '/' . REPORT_DIR . '/\', st.report_file, \'" target="_blank">\', st.report_file, \'</a>\') AS \'' . __('Report') . '\'');
    $datagrid->setSQLorder('st.start_date DESC');
    $datagrid->disableSort('Report');
    // is there any search
    if (isset($_GET['keywords']) and $_GET['keywords']) {
        $keyword = $dbs->escape_string(trim($_GET['keywords']));
        $words = explode(' ', $keyword);
        if (count($words) > 1) {
            $concat_sql = ' (';
            foreach ($words as $word) {
                $concat_sql .= " (stock_take_name LIKE '%{$word}%' OR init_user LIKE '%{$word}%') AND";
            }
            // remove the last AND
            $concat_sql = substr_replace($concat_sql, '', -3);
            $concat_sql .= ') ';
Exemplo n.º 29
0
    $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']);
        $datagrid->setSQLCriteria("g.gmd_name LIKE '%{$keywords}%' OR g.gmd_code LIKE '%{$keywords}%'");
    }
    // set table and table header attributes
    $datagrid->table_attr = 'align="center" id="dataList" cellpadding="5" cellspacing="0"';
    $datagrid->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
    // set delete proccess URL
Exemplo n.º 30
0
 function showLoanHist($num_recs_show = 20)
 {
     global $dbs;
     // table spec
     $_table_spec = 'loan AS l
         LEFT JOIN member AS m ON l.member_id=m.member_id
         LEFT JOIN item AS i ON l.item_code=i.item_code
         LEFT JOIN biblio AS b ON i.biblio_id=b.biblio_id';
     // create datagrid
     $_loan_hist = new simbio_datagrid();
     $_loan_hist->disable_paging = true;
     $_loan_hist->table_ID = 'loanhist';
     $_loan_hist->setSQLColumn('l.item_code AS \'' . __('Item Code') . '\'', 'b.title AS \'' . __('Title') . '\'', 'l.loan_date AS \'' . __('Loan Date') . '\'', 'l.return_date AS \'' . __('Return Date') . '\'');
     $_loan_hist->setSQLorder('l.loan_date DESC');
     $_criteria = sprintf('m.member_id=\'%s\' AND l.is_lent=1 AND is_return=1 ', $_SESSION['mid']);
     $_loan_hist->setSQLCriteria($_criteria);
     // modify column value
     #$_loan_hist->modifyColumnContent(3, 'callback{showOverdue}');
     // set table and table header attributes
     $_loan_hist->table_attr = 'align="center" class="memberLoanList" cellpadding="5" cellspacing="0"';
     $_loan_hist->table_header_attr = 'class="dataListHeader" style="font-weight: bold;"';
     $_loan_hist->using_AJAX = false;
     // return the result
     $_result = $_loan_hist->createDataGrid($dbs, $_table_spec, $num_recs_show);
     $_result = '<div class="memberLoanHistInfo"> &nbsp;' . $_loan_hist->num_rows . ' ' . __('item(s) loan history') . ' | <a href="?p=download_loan_history">Download All Loan History</a></div>' . "\n" . $_result;
     return $_result;
 }