Ejemplo n.º 1
0
function cc_check_banlist($transInfo, $banInfo = "")
{
    //(SELECT group_concat(`bl_type`,'=',`bl_data` SEPARATOR  '&') as ban FROM `cs_banlist` where `bl_group` is not null group by bl_group) union (SELECT concat(`bl_type`,'=',`bl_data`) as ban FROM `cs_banlist` where `bl_group` is null)
    $bl_type = func_get_enum_data('cs_banlist', 'bl_type');
    $ban_sql = " 0 ";
    foreach ($bl_type as $key) {
        $ban_sql .= " OR (bl_type='{$key}' AND '" . $transInfo[$key] . "' LIKE bl_data) \n";
    }
    // select sum(ban) as bansfound from (SELECT count(bl_ID) = sum((bl_type='name' AND bl_data = 'sebastian') OR (bl_type='address' AND bl_data = 'mancini')) as ban FROM `cs_banlist` group by `bl_group`) as bans
    $sql = "select sum(ban) as bansfound , group_concat(if(ban,banInfo,NULL)) as banInfo from (\n\t\t\t\tSELECT count(bl_ID) = sum({$ban_sql}) as ban, concat('bl_group=',`bl_group`,'&',group_concat(`bl_type`,'=',`bl_data` SEPARATOR  '&')) as banInfo\n\t\t\t\tFROM `cs_banlist` group by `bl_group`\n\t\t\t\t) as bans";
    $result = mysql_query($sql) or dieLog(mysql_errno() . ": " . mysql_error() . "<BR>~{$sql}");
    $bans = mysql_fetch_assoc($result);
    $banInfo = $bans['bansfound'] . " Ban(s) Found: \n";
    $banarray = explode(",", $bans['banInfo']);
    foreach ($banarray as $data) {
        if (!$data) {
            break;
        }
        parse_str($data, $data);
        $banInfo .= "  Group " . $data['bl_group'] . " found ";
        unset($data['bl_group']);
        foreach ($data as $bl_type => $bl_data) {
            $banInfo .= $bl_type . "='" . $bl_data . "' and ";
        }
        $banInfo = substr($banInfo, 0, -5);
        $banInfo .= "\n";
    }
    return $bans['bansfound'] > 0;
}
Ejemplo n.º 2
0
function smart_getChargeTypes($params)
{
    $types = func_get_enum_data('cs_transactiondetails', 'cardtype');
    $pairs = array();
    //$pairs[] = array("value"=>"","display"=>"Any Type");
    foreach ($types as $key => $type) {
        $pairs[] = array("value" => $type, "display" => $type);
    }
    return $pairs;
}
Ejemplo n.º 3
0
function func_get_enum_radio($table, $field, $name = '', $selectedVal = false)
{
    $enum_list = func_get_enum_data($table, $field);
    if (!$name) {
        $name = $field;
    }
    foreach ($enum_list as $enum) {
        $options .= ucfirst($enum) . ": <input type='radio' value='{$enum}' name='{$name}' " . ($selectedVal == $enum ? "checked" : "") . " >\n ";
    }
    return $options;
}