Example #1
0
            }
        } else {
            if ($question == "firsttimeuser") {
                $sql = "select COUNT(id) from action ";
                $where1 .= " and isfirst = 'T' ";
                $where2 .= " and isfirst = 'T' ";
                if (hasCondition($sex, $state, $country)) {
                    $where1 = setFirstCondition($where1, $sex, $state, $country);
                }
                if (hasUser($user)) {
                    $where1 = setUser($where1, $user);
                }
                if (setInsertTime1($fromTime, $toTime)) {
                    $where1 = getInsertTime1($where1, $fromTime, $toTime);
                }
                if (hasCondition($dump_sex, $dump_state, $dump_country)) {
                    $where2 = setFirstCondition($where2, $dump_sex, $dump_state, $dump_country);
                }
                if (hasUser($dump_user)) {
                    $where2 = setUser($where2, $dump_user);
                }
                if (setInsertTime1($fromTime, $toTime)) {
                    $where2 = getInsertTime1($where2, $fromTime, $toTime);
                }
            }
        }
    }
} else {
    echo "something wrong happens";
    exit;
}
Example #2
0
        $where .= " GROUP BY insertmonth";
    } else {
        if ($question == "confirmed") {
            $sql = "select left(confirmtime,7), count(left(confirmtime,7)) from userinfo";
            if (hasCondition($sex, $state, $country)) {
                $where = setCondition($where, $sex, $state, $country);
            }
            if (hasTime($startMonth, $endMonth, $beforeMonth, $afterMonth, $onMonth)) {
                $where = setconfirmedTime($where, $startMonth, $endMonth, $beforeMonth, $afterMonth, $onMonth);
            }
            $where .= " GROUP BY left(confirmtime,7)";
        } else {
            if ($question == "firsttimeuser") {
                $sql = "select insertmonth, COUNT(insertmonth) from action ";
                $where .= " and isfirst = 'T' ";
                if (hasCondition($sex, $state, $country)) {
                    $where = setFirstCondition($where, $sex, $state, $country);
                }
                if (hasTime($startMonth, $endMonth, $beforeMonth, $afterMonth, $onMonth)) {
                    $where = setInsertTime($where, $startMonth, $endMonth, $beforeMonth, $afterMonth, $onMonth);
                }
                if (hasUser($user)) {
                    $where = setUser($where, $user);
                }
                $where .= " GROUP BY insertmonth";
            }
        }
    }
} else {
    echo "something wrong happens";
    exit;