Example #1
0
function displayEventOptions($gotoaction, $pmcId, $eventId)
{
    global $cmsFolder, $moduleFolder, $urlRequestRoot, $sourceFolder;
    $scriptFolder = "{$urlRequestRoot}/{$cmsFolder}/{$moduleFolder}/events";
    $eventDetails = <<<SCRIPT
    <script src="{$scriptFolder}/events.js"></script>
    <script src="{$scriptFolder}/jquery.js"></script>
SCRIPT;
    if (isset($_FILES['fileUploadFieldPart']['name'])) {
        displaywarning("Query Here");
        syncExcelFile($pmcId, $eventId, $_FILES['fileUploadFieldPart']['tmp_name'][0]);
    }
    if (isset($_FILES['fileUploadField']['name'])) {
        syncExcelFile($pmcId, $eventId, $_FILES['fileUploadField']['tmp_name'][0]);
    }
    if ($gotoaction == 'qa') {
        $eventDetails .= displayQa($pmcId) . '<br/><br/><h2>' . getEventName($pmcId, $eventId) . '</h2>';
        $eventDetails .= searchParticipant($gotoaction, $pmcId, $eventId);
    } else {
        if ($gotoaction == 'qahead') {
            $eventDetails .= qaHeadOptions($pmcId) . '<br/><br/>asdasdasd<h2>' . getEventName($pmcId, $eventId) . '</h2>';
            $checkLockedQuery = "SELECT `event_id` FROM `events_locked` WHERE `page_moduleComponentId`='{$pmcId}' AND `event_id`='{$eventId}'";
            $checkLockedRes = mysql_query($checkLockedQuery) or displayerror(mysql_error());
            if (mysql_num_rows($checkLockedRes) > 0) {
                $eventDetails .= <<<FORM
            <br/><p>Event Locked</p>
            <table><tr><td>
            <a href='./+{$gotoaction}&subaction=downloadExcel&event_id={$eventId}'>Download Details</a></td><td>
            <form method='POST' action='./+qahead&subaction=unlockEvent' onsubmit='return unlockConfirm();'>
            <input type='hidden' value='{$eventId}' name='eventId'>
            <input type='submit' id='lockButton' value='UNLOCK EVENT'>
            </form></td></tr></table>
FORM;
                return $eventDetails;
            }
        }
    }
    /*if(isset($_FILES['fileUploadField']['name'])){
      syncExcelFile($pmcId,$eventId,$_FILES['fileUploadField']['tmp_name'][0]);
    }*/
    $checkParticipantsQuery = "SELECT `user_pid` FROM `events_participants` WHERE `page_moduleComponentId`='{$pmcId}' AND `event_id`='{$eventId}' LIMIT 1";
    $checkParticipantsRes = mysql_query($checkParticipantsQuery) or displayerror(mysql_error());
    if (mysql_num_rows($checkParticipantsRes) == 0) {
        //Show FileUpload Details
        $fileUploadableField = getFileUploadField('fileUploadField', "events");
        $eventDetails .= <<<ADDROOMFORM
       <!--<br/><br/>
       <form action="./+{$gotoaction}&subaction=viewEvent" method="post">
            <input type="submit" name="downloadSampleFormat" value="Download Sample Form"><br/>
       </form>-->
       <p>Upload Event Excel File:</p>
       <form action="./+{$gotoaction}&subaction=viewEvent" method="post" enctype='multipart/form-data'>
       {$fileUploadableField}
       <input type='hidden' name='eventId' value='{$eventId}'>
       <input type='submit' name='submit' value='Upload'>
       </form>
ADDROOMFORM;
    } else {
        $eventDetails .= <<<PRINTTABLE
    <table><tr><td>
    <a href='./+{$gotoaction}&subaction=downloadExcel&event_id={$eventId}'>Download Details</a>
    </td><td>
    <form method="POST" action='./+{$gotoaction}&subaction=lockEvent' onsubmit='return lockConfirm();'>
    <input type='hidden' value='{$eventId}' name='eventId'>
    <input type='submit' id='lockButton' value='LOCK EVENT'>
    </form></td></tr>
    <!--<button onclick="downloadDetails('{$gotoaction}',{$eventId})" value='Download Details'>Download Details</button>-->
PRINTTABLE;
        //$downloadTable = getUserDetailsTable($pmcId,$eventId);
        //$eventDetails.=displayExcelForTable($downloadTable);
        if ($gotoaction == 'qahead' && mysql_num_rows($checkLockedRes) == 0) {
            $eventDetails .= deleteEventForm($pmcID, $eventId);
            $eventDetails .= addParticipant($gotoaction, $pmcId, $eventId);
            $eventDetails .= searchParticipant($gotoaction, $pmcId, $eventId);
        }
        if ($gotoaction == 'qa' && mysql_num_rows($checkLockedRes) == 0) {
            $eventDetails .= addParticipant($gotoaction, $pmcId, $eventId);
        }
        $eventParticipants = displayEventParticipants($gotoaction, $pmcId, $eventId);
        //displayExcelForTable($eventParticipants);
        $eventDetails .= $eventParticipants;
    }
    return $eventDetails;
}
Example #2
0
        $prec = 0;
        $next = 3;
        $commentaires = recupCommentaires(5, 0, $news->idnews);
    }
}
if (isset($_GET['rejoindre'])) {
    if (!isset($_SESSION['iduser'])) {
        $_SESSION['msg'][0] = 'error';
        $_SESSION['msg'][1] = "Vous devez être connecté pour rejoindre une section !";
        header('Location : index.php?page=login');
    }
    addJoueur($jeu->idjeux, $_SESSION['iduser']);
    header('Location : index.php?page=section&jeu=' . $jeu->idjeux);
}
if (isset($_GET['participer'])) {
    if (!addParticipant($_GET['id'])) {
        echo '<div class=error>Vous etes déjà inscrit !</div>';
    } else {
        header('Location : index.php?page=section&jeu=' . $jeu->idjeux . '&id=' . $_GET['id']);
    }
}
if (isset($_POST['creerCom'])) {
    addCom($_POST['com'], $news->idnews);
    header('Location : index.php?page=section&jeu=' . $jeu->idjeux . '&post=' . $_GET['post']);
}
if (isset($_GET['delete'])) {
    removeParticipant($event->idevent, $_GET['delete']);
    header('Location : index.php?page=section&jeu=' . $jeu->idjeux . '&id=' . $_GET['id']);
}
require_once Config::$path['views'] . 'HTML.class.php';
if (isset($_GET['post'])) {