示例#1
0
文件: base.php 项目: uakfdotb/oneapp
<?php

include "../include/common.php";
include "../config.php";
include "../include/db_connect.php";
include "../include/session.php";
include "../include/apply_gen.php";
include "../include/apply_submit.php";
if (isset($_SESSION['user_id'])) {
    if (isApplicationStarted($_SESSION['user_id'], 0)) {
        $categoryList = listCategories();
        get_page_advanced("base", "apply", array("categories" => $categoryList));
    } else {
        if (isset($_REQUEST['action']) && $_REQUEST['action'] == "start") {
            $result = startApplication($_SESSION['user_id'], 0);
            if ($result == 0) {
                get_page_advanced("message", "apply", array("title" => "General application started", "message" => "You have started the general application. Please <a href=\"base.php\">click here</a> to continue.", "redirect" => "base.php"));
            } else {
                get_page_advanced("message", "apply", array("title" => "Error", "message" => "There was an error while starting your general application. Please <a href=\"base.php\">click here</a> to continue."));
            }
        } else {
            get_page_advanced("base_notstarted", "apply");
        }
    }
} else {
    get_page_advanced("message", "apply", array("title" => "Not Logged In", "message" => "You cannot access the application because you are not logged in. Please <a href=\"../login.php\">login first</a>."));
}
示例#2
0
文件: clubs.php 项目: uakfdotb/oneapp
 if ($_POST['app'] == "on") {
     $out = deleteApplication($_SESSION['user_id'], $_POST['club_id']);
     if ($out == 0) {
         $inform["success"] = "Deleted application for {$club_name}!";
     } else {
         if ($out == -1) {
             $inform["warn"] = "You have not started the application for {$club_name}";
         } else {
             if ($out == -2) {
                 $inform["error"] = "This club does not exist!";
             }
         }
     }
 } else {
     if ($_POST['app'] == "off") {
         $out = startApplication($_SESSION['user_id'], $_POST['club_id']);
         if ($out == 0) {
             $inform["success"] = "Started application for {$club_name}!";
         } else {
             if ($out == -1) {
                 $inform["warn"] = "You have already started the application for {$club_name}";
             } else {
                 if ($out == -2) {
                     $inform["error"] = "This club does not exist!";
                 } else {
                     if ($out == -3) {
                         $inform["error"] = "{$club_name} is not open yet! Try again after the open date!";
                     }
                 }
             }
         }
示例#3
0
<?php

include "../include/common.php";
include "../config.php";
include "../include/db_connect.php";
include "../include/session.php";
include "../include/apply_gen.php";
include "../include/apply_submit.php";
include "../include/subscribe.php";
if (isset($_SESSION['user_id'])) {
    $inform = array();
    if (isset($_REQUEST['club']) && isset($_REQUEST['mode'])) {
        $club_data = clubInfo($_REQUEST['club']);
        $club_name = $club_data[0];
        if ($_REQUEST['mode'] == "apply") {
            $result = startApplication($_SESSION['user_id'], $_REQUEST['club']);
            if ($result == 0) {
                $inform["success"] = "Started application for {$club_name}!";
            } else {
                if ($result == -1) {
                    $inform["warn"] = "You have already started the application for {$club_name}";
                } else {
                    if ($result == -2) {
                        $inform["error"] = "This club does not exist!";
                    } else {
                        if ($result == -3) {
                            $inform["error"] = "{$club_name} is not open yet! Try again after the open date!";
                        } else {
                            $inform["error"] = "Internal error!";
                        }
                    }