public function actionPrhead() { 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"; require_once $sourceFolder . "/upload.lib.php"; if (isset($_GET['subaction'])) { if ($_GET['subaction'] == 'viewEventList') { return displayPr('prhead', $moduleComponentId); } if ($_GET['subaction'] == "viewEvent") { $eventId = trim(escape($_POST['eventId'])); if (!empty($eventId)) { return viewEventResult('prhead', $moduleComponentId, $eventId); } } else { if ($_GET['subaction'] == "downloadExcel") { //$eventId = escape($_POST['eventId']); //error_log($eventId); //getUserDetailsTable($moduleComponentId,$eventId); return getUserDetailsTable('prhead', $moduleComponentId, escape($_GET['event_id'])); } else { if ($_GET['subaction'] == 'unlockEvent') { $eventId = trim(escape($_POST['eventId'])); if (!empty($eventId)) { return unlockEvent($moduleComponentId, $eventId); } } else { if ($_GET['subaction'] == 'viewWorkshopList') { return getWorkshopsList($moduleComponentId); } else { if ($_GET['subaction'] == 'viewWorkshopDetails') { $workshopId = escape($_POST['workshopId']); return viewWorkshopDetails($workshopId, $moduleComponentId); } else { if ($_GET['subaction'] == "downloadExcel") { //$eventId = escape($_POST['eventId']); //error_log($eventId); //getUserDetailsTable($moduleComponentId,$eventId); return getWorkshopDetailsTable($moduleComponentId, escape($_GET['workshop_id'])); } else { if ($_GET['subaction'] == "editParticipant") { $editFormId = escape($_POST['formId']); $editUserId = escape($_POST['userId']); $rowValue = escape($_POST['rowValue']); $teamId = escape($_POST['teamId']); $rowId = escape($_POST['rowId']); $workshopId = escape($_POST['eventId']); if (!empty($userId)) { //return $rowId; echo editWorkshopParticipant('prhead', $moduleComponentId, $workshopId, $editFormId, $editUserId, $teamId, $rowValue, $rowId); die; } } else { if ($_GET['subaction'] == "printCerti") { if (isset($_POST['eventId'])) { $eventAction = 'event'; $eventId = trim(escape($_POST['eventId'])); } else { if (isset($_POST['workshopId'])) { $eventAction = 'workshop'; $eventId = trim(escape($_POST['workshopId'])); } } return printCertificates($eventAction, $moduleComponentId, $eventId); } else { if ($_GET['subaction'] == "printIndividualCerti") { if (isset($_POST['eventId'])) { $action = 'event'; $eventId = escape($_POST['eventId']); } else { if (isset($_POST['workshopId'])) { if (isset($_POST['workshopId'])) { //return "sadasd"; $eventId = $_POST['workshopId']; } $action = 'workshop'; } } $userId = escape($_POST['userId']); //error_log($eventId." ".$userId); return printIndividualCerti('prhead', $action, $moduleComponentId, $userId, $eventId); } else { if ($_GET['subaction'] == "userDetailForm") { return searchByUserId('prhead', $moduleComponentId); } else { if ($_GET['subaction'] == "userEventDetails") { $userBookletId = escape($_POST['userId']); return getUserDetails('prhead', $moduleComponentId, $userBookletId); } else { if ($_GET['subaction'] == "printUserCerti") { $userId = escape($_POST['userId']); printUserCerti($moduleComponentId, $userId); } else { if ($_GET['subaction'] == "viewEventOptions") { return getPrHeadOptions($moduleComponentId); } } } } } } } } } } } } } /*else if($_GET['subaction'] == "viewEvent"){ $eventId = trim(escape($_POST['eventId'])); if(!empty($eventId)){ return viewEventResult($moduleComponentId,$eventId); } } else if($_GET['subaction'] == "printCerti"){ $eventId = trim(escape($_POST['eventId'])); return printCertificates($moduleComponentId,$eventId); } else if($_GET['subaction'] == 'unlockEvent'){ $eventId = trim(escape($_POST['eventId'])); if(!empty($eventId)){ return unlockEvent($moduleComponentId,$eventId); } }*/ } else { return prMain('prhead', $moduleComponentId); } }
function viewWorkshopDetails($workshopId, $pmcId) { global $cmsFolder, $moduleFolder, $urlRequestRoot, $sourceFolder; $scriptFolder = "{$urlRequestRoot}/{$cmsFolder}/{$moduleFolder}/events"; $workshopDetails = <<<SCRIPT \t\t<script src="{$scriptFolder}/events.js"></script> <script src="{$scriptFolder}/jquery.js"></script> SCRIPT; $workshopDetails .= getWorkshopsList($pmcId); if (isset($_FILES['fileUploadField']['name'])) { syncExcelFileWorkshop($pmcId, $workshopId, $_FILES['fileUploadField']['tmp_name'][0]); } $checkParticipantsQuery = "SELECT `user_id` FROM `events_workshop_participants` WHERE `page_moduleComponentId`='{$pmcId}' AND `workshop_id`='{$workshopId}' LIMIT 1"; $checkParticipantsRes = mysql_query($checkParticipantsQuery) or displayerror(mysql_error()); if (mysql_num_rows($checkParticipantsRes) == 0) { //Show FileUpload Details $fileUploadableField = getFileUploadField('fileUploadField', "events"); $workshopDetails .= <<<ADDROOMFORM <br/><br/> <form action="./+prhead&subaction=viewWorkshopDetails" method="post"> \t<input type="submit" name="downloadSampleFormat" value="Download Sample Form"><br/> </form> <form action="./+prhead&subaction=viewWorkshopDetails" method="post" enctype='multipart/form-data'> \t {$fileUploadableField} \t <input type='hidden' name='workshopId' value='{$workshopId}'> \t <input type='submit' name='submit' value='Upload'> \t </form> ADDROOMFORM; } else { $workshopDetails .= <<<PRINTTABLE \t\t<table><tr><td> \t\t<a href='./+prhead&subaction=downloadExcel&workshop_id={$workshopId}'>Download Details</a> \t\t</td><td> \t\t<form method='POST' action='./+prhead&subaction=printCerti'> \t\t<input type='hidden' name='workshopId' value='{$workshopId}'> \t\t<input type='submit' value='Print Certificates PDF'> \t\t</form></td></tr></table> \t PRINTTABLE; //$downloadTable = getUserDetailsTable($pmcId,$eventId); //$eventDetails.=displayExcelForTable($downloadTable); $workshopParticipants = displayWorkshopParticipants($pmcId, $workshopId); //displayExcelForTable($eventParticipants); $workshopDetails .= $workshopParticipants; } return $workshopDetails; }