Esempio n. 1
0
 public function actionPr()
 {
     global $urlRequestRoot, $sourceFolder, $templateFolder, $cmsFolder, $moduleFolder;
     $moduleComponentId = $this->moduleComponentId;
     $userId = $this->userId;
     require_once "{$sourceFolder}/{$moduleFolder}/events/events_common.php";
     require_once "{$sourceFolder}/{$moduleFolder}/events/events_forms.php";
     require_once "{$sourceFolder}/{$moduleFolder}/events/events.config.php";
     require_once $sourceFolder . "/" . $moduleFolder . "/qaos1/excel.php";
     if (isset($_GET['subaction'])) {
         if ($_GET['subaction'] == "viewEvent") {
             $eventId = trim(escape($_POST['eventId']));
             if (!empty($eventId)) {
                 return viewEventResult('pr', $moduleComponentId, $eventId);
             }
         } else {
             if ($_GET['subaction'] == "printCerti") {
                 if (isset($_POST['eventId'])) {
                     $eventId = escape($_POST['eventId']);
                     $action = 'event';
                 } else {
                     if (isset($_POST['workshopId'])) {
                         $eventId = escape($_POST['workshopId']);
                         $action = 'workshop';
                     }
                 }
                 return printCertificates($action, $moduleComponentId, $eventId);
             } else {
                 if ($_GET['subaction'] == "downloadExcel") {
                     //$eventId = escape($_POST['eventId']);
                     //error_log($eventId);
                     //getUserDetailsTable($moduleComponentId,$eventId);
                     return getUserDetailsTable('pr', $moduleComponentId, escape($_GET['event_id']));
                 } else {
                     if ($_GET['subaction'] == "printIndividualCerti") {
                         if (isset($_POST['eventId'])) {
                             $action = 'event';
                             $eventId = escape($_POST['eventId']);
                         } else {
                             if (isset($_POST['workshopId'])) {
                                 $eventId = $_POST['workshopId'];
                                 $action = 'workshop';
                             }
                         }
                         $userId = escape($_POST['userId']);
                         //error_log($eventId." ".$userId);
                         return printIndividualCerti('pr', $action, $moduleComponentId, $userId, $eventId);
                     } else {
                         if ($_GET['subaction'] == "userDetailForm") {
                             return searchByUserId('pr', $moduleComponentId);
                         } else {
                             if ($_GET['subaction'] == "userEventDetails") {
                                 $userBookletId = escape($_POST['userId']);
                                 return getUserDetails('pr', $moduleComponentId, $userBookletId);
                             } else {
                                 if ($_GET['subaction'] == "printUserCerti") {
                                     $userId = escape($_POST['userId']);
                                     printUserCerti($moduleComponentId, $userId);
                                 } else {
                                     if ($_GET['subaction'] == "viewEventOptions") {
                                         return displayPR('pr', $moduleComponentId);
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     } else {
         return prMain('pr', $moduleComponentId);
         //return displayPR('pr',$moduleComponentId);
     }
 }
Esempio n. 2
0
function viewEventResult($gotoaction, $pmcId, $eventId)
{
    global $cmsFolder, $moduleFolder, $urlRequestRoot, $sourceFolder;
    $scriptFolder = "{$urlRequestRoot}/{$cmsFolder}/{$moduleFolder}/events";
    $eventDetails = <<<SCRIPT
\t\t<script src="{$scriptFolder}/events.js"></script>
        <script src="{$scriptFolder}/jquery.js"></script>
SCRIPT;
    $eventDetails .= displayPR($gotoaction, $pmcId) . '<br/><br/><h2>' . getEventName($pmcId, $eventId) . '</h2>';
    $eventDetails .= <<<PRINT
\t\t<br/><br/>
\t\t<form method='POST' action='./+{$gotoaction}&subaction=printCerti'>
\t\t<input type='hidden' name='eventId' value='{$eventId}'>
\t\t<input type='submit' value='Print Certificates PDF'>
\t\t</form>
\t\t<br/>
PRINT;
    if ($gotoaction == 'prhead') {
        $eventDetails .= <<<UNLOCK
\t\t<form method='POST' action='./+{$gotoaction}&subaction=unlockEvent' onsubmit='return unlockConfirm();'>
\t\t<input type='hidden' value='{$eventId}' name='eventId'>
\t\t<input type='submit' id='lockButton' value='UNLOCK EVENT'>
\t\t</form>
\t\t<br/>
\t\t<a href='./+{$gotoaction}&subaction=downloadExcel&event_id={$eventId}'>Download Details</a><br/>
UNLOCK;
    }
    $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());
    $eventParticipants = displayParticipantRank($gotoaction, $pmcId, $eventId);
    //displayExcelForTable($eventParticipants);
    $eventDetails .= $eventParticipants;
    return $eventDetails;
}