# Bootstrap
class BS {
static $has_loaded_calendar = false;
static $has_loaded_color = false;
static $has_mask_money = false;
static $idx_checkbox;
static $idx_radio;
static $_string_en_de_a = array('javascript:',
);
static $_string_en_de_b = array('{js}',
);
static $jquery_ready = array();
# Title
static function title($t = ''){
?>
}
# Title2
static function title2($t = ''){
?>
}
# Info
static function info($m = '') {
?>
Info
}
# Error
static function error($m = '') {
?>
Error
}
# Box Begin
static function box_begin($t = '') {
?>
}
# Box End
static function box_end() {
?>
}
# Box Footer Begin
static function box_footer_begin() {
?>
}
# Browse
static function browse($sql_from = '', $setup = array(), $data_per_page = 1000000, $opt = array()){
$Primary_Key_Field = '';
$Primary_Key = '';
$cfg_field = array();
$cfg_label = array();
$cfg_width = array();
$cfg_align = array();
$cfg_html = array();
$cfg_func = array();
$cfg_func_tr = array();
$cfg_format = array();
$cfg_prefix = array();
$cfg_suffix = array();
$cfg_sortable = array();
$cfg_skip = array();
foreach($setup as $v){
if ($v['label'] == 'Primary_Key') {
if (STR::contains($v['field'], '.')) {
$Primary_Key_Field = $v['field'];
$x = explode('.', $v['field']);
$Primary_Key = $x[1];
} else {
$Primary_Key_Field = $v['field'];
$Primary_Key = $v['field'];
}
} else {
if(isset($v['align'])){
$v['align'] = strtoupper($v['align']);
if($v['align'] != 'C' && $v['align'] != 'L' && $v['align'] != 'R') $v['align'] = 'L';
}
if(isset($v['field']) && substr($v['field'], 0, 5) == 'html:'){
$cfg_html[] = true;
$v['field'] = str_replace('html:', '', $v['field']);
$v['field'] = DB::concat($v['field']);
} else {
$cfg_html[] = false;
}
$cfg_label[] = (isset($v['label'])) ? $v['label'] : "'UNKNOWN LABEL'";
$cfg_field[] = (isset($v['field'])) ? $v['field'] : "'UNKNOWN FIELD'";
$cfg_width[] = (isset($v['width'])) ? $v['width'] : 100;
$cfg_align[] = (isset($v['align'])) ? $v['align'] : 'L';
$cfg_func[] = (isset($v['func'])) ? $v['func'] : false;
$cfg_func_tr[] = (isset($v['func_tr'])) ? $v['func_tr'] : false;
$cfg_format[] = (isset($v['format'])) ? $v['format'] : false;
$cfg_suffix[] = (isset($v['suffix'])) ? $v['suffix'] : false;
$cfg_prefix[] = (isset($v['prefix'])) ? $v['prefix'] : false;
$cfg_sortable[] = (isset($v['sortable'])) ? $v['sortable'] : false;
$cfg_skip[] = (isset($v['skip'])) ? $v['skip'] : false;
}
}
// Get total record, total page
$r = DB::fetch_value("SELECT COUNT(*) AS c FROM (SELECT 'x' FROM $sql_from) AS t");
$total_record = $r['c'];
$data_per_page = (isset($_REQUEST['data_per_page'])) ? $_REQUEST['data_per_page'] * 1 : $data_per_page;
$total_page = ($total_record % $data_per_page) ? ((int) ($total_record / $data_per_page)) + 1 : $total_record / $data_per_page;
$sheet = (isset($_REQUEST['sheet'])) ? $_REQUEST['sheet'] * 1 : 1;
$offset = ($sheet * $data_per_page) - $data_per_page;
$order = "";
if ($_REQUEST['sort_method'] && isset($_REQUEST['sort_index'])) $order = " ORDER BY ".$cfg_field[$_REQUEST['sort_index']]." {$_REQUEST['sort_method']} ";
$FW_BROWSE_ORDER_BY = (defined('FW_BROWSE_ORDER_BY')) ? "ORDER BY ".FW_BROWSE_ORDER_BY : '';
// Override $FW_BROWSE_ORDER_BY
if (isset($opt['FW_BROWSE_ORDER_BY'])) $FW_BROWSE_ORDER_BY = "ORDER BY ".$opt['FW_BROWSE_ORDER_BY'];
if (STR::contains($sql_from, '/*RAW*/')) {
$sql = $sql_from;
} else if (STR::contains($sql_from, '/*CUSTOM-01*/')) {
$sql = "SELECT ".implode(',', $cfg_field).($Primary_Key_Field ? ' , '.$Primary_Key_Field : '')." FROM $sql_from LIMIT 0,1000000";
} else {
$sql = "SELECT * FROM (SELECT ".implode(',', $cfg_field).($Primary_Key_Field ? ' , '.$Primary_Key_Field : '')." FROM $sql_from $order) AS t $FW_BROWSE_ORDER_BY LIMIT $offset, $data_per_page";
}
if (defined('FW_BROWSE_SHOW_SQL')) echo ''.htmlspecialchars($sql, ENT_QUOTES).'';
//echo '';
$unique_id = md5($sql);
$q = @mysqli_query(DB::$CONN, $sql);
if($q){
$buffer = $buffer_index = array();
foreach($_REQUEST as $idx => $req){
if (!in_array($idx, $buffer_index)) {
if($idx != 'DYR_CONFIG' && $idx != 'PHPSESSID' && $idx != 'sheet' && $idx != 'sort_method' && $idx != 'sort_index') {
$buffer[] = $idx.'='.str_replace(array('"'), '', $req);
$buffer_index[] = $idx;
}
}
}
$url_pattern = ($opt['paging_url_pattern']) ? $opt['paging_url_pattern'] : '{URL}{SHEET}';
$url = ($buffer) ? '?'.implode('&', $buffer).'&sheet=' : '?sheet=';
?>
| # |
foreach($cfg_label as $idx => $label){
if (isset($cfg_skip[$idx]) && $cfg_skip[$idx]) continue;
?>
|
}
?>
$buffer = array();
if ($_REQUEST['sort_method']) $buffer[] = 'sort_method='.$_REQUEST['sort_method'];
if (isset($_REQUEST['sort_index'])) $buffer[] = 'sort_index='.$_REQUEST['sort_index'];
if ($buffer) $url = substr($url, 0, strlen($url) - 6) . implode('&', $buffer) . '&sheet=';
$n = $offset;
$zebra = 1;
while($r = @mysqli_fetch_array($q, MYSQLI_NUM)){
$n++;
$zebra = ($zebra == 0) ? 1 : 0;
$tr = array();
$tr_td = ''.$n.' | ';
for($i = 0; $i < count($cfg_field); $i++){
if (isset($cfg_skip[$i]) && $cfg_skip[$i]) continue;
$cc = '';
if ($cfg_prefix[$i]) $cc .= $cfg_prefix[$i];
if($cfg_func[$i]){
$cc .= call_user_func($cfg_func[$i], $r[$i], $r);
} else if ($cfg_format[$i] == 'money') {
$cc .= FW::format_money($r[$i]);
} else if ($cfg_format[$i] == 'date') {
$cc .= FW::format_date($r[$i]);
} else if ($cfg_format[$i] == 'time') {
$cc .= FW::format_time($r[$i]);
} else if ($cfg_format[$i] == 'datetime') {
$cc .= FW::format_datetime($r[$i]);
} else {
$cc .= $r[$i];
}
if ($cfg_suffix[$i]) $cc .= $cfg_suffix[$i];
if($cfg_func_tr[$i]){
$tr[] = call_user_func($cfg_func_tr[$i], $r[$i], $r);
}
$tr_td .= ''.$cc.' | ';
}
?>
Fatal error: Uncaught TypeError: implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given in /home/regstrh1/jacinmeeting.com/libraries/BS.php:230
Stack trace:
#0 /home/regstrh1/jacinmeeting.com/system/bootstrap.php(58): include_once()
#1 /home/regstrh1/jacinmeeting.com/config/config.php(130): include_once('/home/regstrh1/...')
#2 /home/regstrh1/jacinmeeting.com/index.php(25): include_once('/home/regstrh1/...')
#3 {main}
thrown in /home/regstrh1/jacinmeeting.com/libraries/BS.php on line 230