<?php session_start(); include '../class-db.php'; include '../objects/class-league.php'; $ez_league = new ezLeague_League(); if (isset($_POST['form'])) { $form = $_POST['form']; switch ($form) { case 'update-match-details': $match_id = $_POST['id']; $date = $_POST['date']; $time = $_POST['time']; $zone = $_POST['zone']; $stream_url = $_POST['stream_url']; $ez_league->update_match_details($match_id, $date, $time, $zone, $stream_url); break; case 'update-match-information': $match_id = $_POST['id']; $ip = $_POST['ip']; $password = $_POST['password']; $moderator = $_POST['moderator']; $ez_league->update_match_information($match_id, $ip, $password, $moderator); break; case 'accept-match-details': $match_id = $_POST['id']; $match_side = $_POST['side']; $ez_league->toggle_match_details($match_id, $match_side, 'accept'); break; case 'reject-match-details': $match_id = $_POST['id'];
<?php session_start(); include '../class-db.php'; include '../objects/class-league.php'; include '../objects/class-user.php'; $ez_league = new ezLeague_League(); $ez_user = new ezLeague_User(); if (isset($_SESSION['ez_username'])) { $profile = $ez_user->get_user($_SESSION['ez_username']); $rand = rand('100', '5000'); $now = strtotime('now'); $new_file = $now . '-' . $rand; $allowedExts = array("jpg", "png", "gif", "bmp", "jpeg", "PNG", "JPG", "JPEG", "GIF", "BMP"); $temp = explode(".", $_FILES["file"]["name"]); $extension = end($temp); $match_id = $_POST['match-id']; $uploader = $_POST['match-uploader']; if (($_FILES["file"]["type"] == "image/gif" || $_FILES["file"]["type"] == "image/jpeg" || $_FILES["file"]["type"] == "image/jpg" || $_FILES["file"]["type"] == "image/pjpeg" || $_FILES["file"]["type"] == "image/x-png" || $_FILES["file"]["type"] == "image/png") && $_FILES["file"]["size"] < 1000000 && in_array($extension, $allowedExts)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br>"; } else { if (file_exists("../../screenshots/" . $now . "-" . $_FILES["file"]["name"])) { echo $now . "-" . $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "../../screenshots/" . $now . "-" . $_FILES["file"]["name"]); $filename = $now . "-" . $_FILES["file"]["name"]; $ez_league->add_match_screenshot($match_id, $uploader, $filename); header('Location: ../../settings-guild.php?page=match&view=details&mid=' . $match_id); } }