<?php include_once "inc/loggedin_check.php"; include_once "inc/constants.inc.php"; $pageTitle = "New Pool"; /* 11/30/13 - IF WE WANT TO INCLUDE THE ABILITY TO SET THE START/END DATES/TIMES FOR THE POOL ON THIS PAGE, THEN WE SHOULD JUST ADD THEM AS INPUTS ON THE PAGE AND THEN ADD PHP CODE TO TAKE THE POST VALUES AND RUN A METHOD IN THE POOL CLASS FOR THEM - SEE EDIT POOL.PHP PAGE */ if (isset($_GET['template_id'])) { //if a template id is specified: include_once 'inc/class.pool.inc.php'; $pool = new Pool(); //new instance of the Pool class $pool_template_info = $pool->GetBasicTemplateInfo($_GET['template_id']); if (!empty($_POST['pool_title'])) { //if the form was submitted with the pool title variable set $new_pool_result = $pool->CreateNewPool($_SESSION['Username'], $_POST['pool_title'], $pool_template_info['Overall Question'], $_POST['pool_description'], $pool_template_info['Tie Breaker Question'], $_POST['public_private'], $_GET['template_id']); header("Location: edit_pool.php?pool_id={$new_pool_result['2']}"); exit; } //if form was not submitted: $template_category_info = $pool->GetTemplateCategories($_GET['template_id']); include_once "inc/header.php"; ?> <div style="text-align:center;"> <h2><?php echo $pool_template_info['Template Name']; ?> Template </h2> <h4><?php echo $pool_template_info['Template Description'];
include_once 'inc/class.pool.inc.php'; $pool = new Pool(); //new instance of the Pool class $template_id = $_GET['template_id']; //get pool ID from URL if (isset($_GET['delete'])) { //if delete variable is set if ($_GET['delete'] == 5668) { //if delete variable is the proper value (meaning the "delete button was clicked from this page") $pool->DeleteTemplate($template_id); //delete all entries associated with the template header("Location: home.php"); //return user to the home page once pool is deleted } } else { $template_fetch_result = $pool->GetBasicTemplateInfo($template_id); $confirm_delete_url = "delete_template.php?template_id={$template_id}&delete=5668"; } } include_once "inc/header.php"; ?> <br> <div style="text-align: center"> <h1 style="color:red">WARNING</h1> <h1>Are you sure you want to delete <?php echo $template_fetch_result['Template Name']; ?> ?</h1> <br> <h3>All Template data and picks will be erased</h3> <h3>This includes categories and category choices for historical pools!</h3>