public function getCreate()
 {
     if (Auth::check() && User::is_Admin()) {
         $data = ['categories' => Category::orderBy('name')->get(), 'title' => 'Kreye Yon Nouvo Kategori'];
         return View::make('cats.create', $data);
     }
     return Redirect::to('/login')->with('message', 'Ou dwe administratè pou ou kapap kreye kategori.');
 }
Example #2
0
 *      
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
function __autoload($class_name)
{
    require_once $class_name . '.php';
}
#first login info
$user = new User();
$page = new Webpage("Add Event", $user);
$connection = new Connection();
#only admins can add events
if (!$user->is_Admin()) {
    $page->printError("Only Admins can create new events.");
    echo "<center>";
    $page->addURL("index.php", "Return to event schedule.");
    echo "</center>";
    exit(0);
}
if (isset($_GET['action']) && count($_POST) == 15) {
    //ok we'll add the entry here.
    $name = $connection->validate_string($_POST['name']);
    $name = trim($name);
    if (str_word_count($name) == 0) {
        $page->printError("Name cannot be blank.");
        echo "<center>";
        echo "Please go back and supply one.<br /><br />";
        $page->addURL("add.php", "Try again.");
Example #3
0
    $connection->query($query);
    if ($connection->result_size() == 0) {
        $page->addURL("addUserEvent.php?event={$eventID}", "Add this event to your schedule.");
        echo "<br><br>";
        $page->addURL("userSchedule.php", "View your schedule.");
    } else {
        echo "This event is in ";
        $page->addURL("userSchedule.php", "your schedule.");
        echo "<br>";
        echo '<span style="font-size: small;">[';
        $page->addURL("deleteUserEvent.php?event={$eventID}", "Remove");
        echo "]</span>";
    }
} else {
    echo "Register or Sign In on the ";
    $page->addURL("http://www.mewcon.com/forum/index.php", "forums");
    echo " to add this event to your own custom schedule!";
}
echo "</div><br>";
$page->addURL("index.php", "Back to event schedule.");
echo "</center>";
if ($user->is_Admin() == TRUE && $user->is_User()) {
    echo "<br/ ><hr><hr><br/ >";
    $page->printAdminEdit($event, $eventID, $connection);
} else {
    if ($user->get_Username() == $event->getPanelist() && $user->is_User()) {
        //this is the panelist for this panel so give them access to the desc editing
        echo "<br><hr><hr><br>";
        $page->printPanelistEdit($event, $eventID);
    }
}
Example #4
0
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */
function __autoload($class_name)
{
    require_once $class_name . '.php';
}
$user = new User();
$page = new Webpage("Delete Event", $user);
$connection = new Connection();
$eventID = $page->_GET_checkEventID($_GET['event'], $connection, FALSE);
if (!isset($eventID)) {
    exit(0);
}
if ($user->is_Admin()) {
    if (isset($_GET['confirm'])) {
        // they want to delete it so lets delete it
        $query = "DELETE FROM events WHERE e_eventID = {$eventID};";
        $connection->query($query);
        //also remove the event from user schedules
        $query = "DELETE FROM userSchedule WHERE us_eventID = {$eventID};";
        $connection->query($query);
        $page->printError("Event successfully deleted.");
        echo "<center>";
        $page->addURL("index.php", "Return to event schedule.");
        echo "</center>";
        exit(0);
    } else {
        $query = "SELECT e_eventName FROM events WHERE e_eventID = {$eventID}";
        $connection->query($query);
Example #5
0
    echo "<center>";
    echo "Please go back and supply one.<br />";
    echo "<br />";
    $page->addURL("index.php", "Return to event schedule.");
    echo "</center>";
    exit(0);
}
$panelist = $event->getPanelist();
// variables pertinent to either admin or panelist editing
$eventID = $event->getEventID();
$name = $connection->validate_string($_POST['name']);
$desc = $connection->validate_string($_POST['desc']);
// trim of excess whitespace
$name = trim($name);
$desc = trim($desc);
if ($user->is_Admin() && $action == "admin") {
    //validate the _POST vars
    $name = $connection->validate_string($_POST['name']);
    $roomID = $connection->validate_string($_POST['room']);
    $sYear = $connection->validate_string($_POST['startYear']);
    $sMonth = $connection->validate_string($_POST['startMonth']);
    $sDay = $connection->validate_string($_POST['startDay']);
    $sHour = $connection->validate_string($_POST['startHour']);
    $sMinute = $connection->validate_string($_POST['startMinute']);
    $eYear = $connection->validate_string($_POST['endYear']);
    $eMonth = $connection->validate_string($_POST['endMonth']);
    $eDay = $connection->validate_string($_POST['endDay']);
    $eHour = $connection->validate_string($_POST['endHour']);
    $eMinute = $connection->validate_string($_POST['endMinute']);
    $start = date_create($sYear . $sMonth . $sDay . $sHour . $sMinute . "00");
    $end = date_create($eYear . $eMonth . $eDay . $eHour . $eMinute . "00");