示例#1
0
文件: list.inc.php 项目: mmr/b1n
         echo b1n_inHtmlLimit($v);
     }
     break;
 case "select":
     switch ($r['extra']['seltype']) {
         case "date":
             echo b1n_formatDateShow(b1n_formatDateFromDb($v));
             break;
         case "date_hour":
             echo b1n_formatDateHourShow(b1n_formatDateHourFromDb($v));
             break;
         case "date_check_exp":
             echo b1n_formatDateCheckExpShow(b1n_formatDateFromDb($v));
             break;
         case "date_check_dob":
             echo b1n_formatDateCheckDobShow(b1n_formatDateFromDb($v));
             break;
         case "defined":
             foreach ($r['extra']['options'] as $opt_title => $opt_value) {
                 if ($v == $opt_value) {
                     $v = $opt_title;
                     break;
                 }
             }
             echo b1n_inHtmlLimit($v);
             break;
         default:
             echo b1n_inHtmlLimit($v);
             break;
     }
     break;
示例#2
0
文件: reg.lib.php 项目: mmr/b1n
function b1n_regLoad($sql, &$ret_msgs, &$reg_data, $reg_config, $table)
{
    foreach ($reg_config as $r) {
        if ($r['db'] == 'none' || !$r['load']) {
            continue;
        }
        $fields[] = $r['db'];
    }
    $fields = implode(", ", $fields);
    $query = "SELECT " . $fields . " FROM \"" . $table . "\" WHERE " . $reg_config['ID']['db'] . " = '" . b1n_inBd($reg_data["id"]) . "'";
    $rs = $sql->singleQuery($query);
    if (is_array($rs)) {
        foreach ($reg_config as $r) {
            if ($r['db'] == 'none' || !$r['load']) {
                continue;
            }
            if ($r['type'] == 'select') {
                switch ($r['extra']['seltype']) {
                    case 'date':
                    case 'date_check_exp':
                    case 'date_check_dob':
                        $rs[$r['db']] = b1n_formatDateFromDb($rs[$r['db']]);
                        break;
                    case 'date_hour':
                        $rs[$r['db']] = b1n_formatDateHourFromDb($rs[$r['db']]);
                        break;
                }
            }
            $reg_data[$r['reg_data']] = $rs[$r['db']];
        }
        $ret = true;
    } else {
        b1n_retMsg($ret_msgs, b1n_FIZZLES, 'ID not Registered.');
        $ret = false;
    }
    return $ret;
}