function downloadSampleFormatForRoomUpload() { global $sourceFolder, $moduleFolder; require_once $sourceFolder . "/" . $moduleFolder . "/qaos1/excel.php"; $table = <<<TABLE <table> <thead> <td><b>Hostel Name</b></td> <td><b>Room Number Starting From</b></td> <td><b>Room Number Ending Till</b></td> <td><b>Room Capacity</b></td> <td><b>Floor(Start Adding From row 2)</b></td> </thead> </table> TABLE; displayExcelForTable($table); }
function getUserDetailsTable($gotoaction, $pmcId, $eventId) { global $STARTSCRIPTS; $smarttable = smarttable::render(array('participants_table'), null); $STARTSCRIPTS .= "initSmartTable();"; $participantsTable = ""; $participantsTable .= <<<TABLE \t\t\t\t<table id='participants_table' class='display' width='100%' border='1'><thead><tr><th>Team Id</th><th>FID</th><th>Booklet ID</th><th>Name</th><th>College</th><th>Phone No.</th><th>Rank</th><th>Prize Money</th></tr></thead> TABLE; $selectTeamQuery = "SELECT `user_team_id`,COUNT(*) AS `count` FROM `events_participants` WHERE `page_moduleComponentId`='{$pmcId}' AND `event_id`='{$eventId}' GROUP BY `user_team_id`"; $selectTeamRes = mysql_query($selectTeamQuery) or displayerror(mysql_error()); while ($team = mysql_fetch_assoc($selectTeamRes)) { $participantsTable .= "<tr><td rowspan='{$team['count']}'>" . $team['user_team_id'] . "</td>"; $selectParticipantsQuery = "SELECT `user_pid` FROM `events_participants` WHERE `page_moduleComponentId`='{$pmcId}' AND `event_id`='{$eventId}' AND `user_team_id`='{$team['user_team_id']}'"; $selectParticipantsRes = mysql_query($selectParticipantsQuery) or displayerror(mysql_error()); while ($participant = mysql_fetch_assoc($selectParticipantsRes)) { $participantNameQuery = "SELECT `user_fullname` FROM `" . MYSQL_DATABASE_PREFIX . "users` WHERE `user_id`='{$participant['user_pid']}'"; $participantNameRes = mysql_query($participantNameQuery) or displayerror(mysql_error()); $getBookletIdQuery = "SELECT `booklet_id` FROM `prhospi_pr_status` WHERE `user_id`='{$participant['user_pid']}' AND `page_moduleComponentId`='1'"; $getBookletIdRes = mysql_query($getBookletIdQuery) or displayerror(mysql_error()); if (mysql_num_rows($getBookletIdRes == 0)) { $bookletId = " "; } else { $bookletId = mysql_result($getBookletIdRes, 0); } //$getBookeltIdQuery = "SELECT `booklet_id` FROM `prhospi_pr_status` WHERE `page_moduleComponentId`='{$pmcId}' and `user_id`='{$participant['user_pid']}'"; //$getBookletIdRes = mysql_query($getBookletIdQuery) or displayerror(mysql_error()); //$bookletId = mysql_result($getBookletIdRes,0); if ($participant['user_pid'] > 20000 && $participant['user_pid'] < 30000) { $rep = $participant['user_pid'] + 180000; } else { $rep = $participant['user_pid']; } $participantsTable .= "<td>" . $rep . "</td><td>" . $bookletId . "</td><td>" . mysql_result($participantNameRes, 0) . "</td>"; $phNoFormId = retPnoneNoFormId(); $collFormId = retCollFormId(); $otherCollFormId = retOtherCollFormId(); $participantsDetailsQuery = "SELECT `form_elementdata`,`form_elementid` FROM `form_elementdata` WHERE `page_moduleComponentId`='{retglobalPmcId()}' AND `user_id`='{$participant['user_pid']}' AND `form_elementid` IN ({$phNoFormId},{$collFormId})"; //2 $participantsDetailsRes = mysql_query($participantsDetailsQuery) or displayerror(mysql_error()); while ($userDetails = mysql_fetch_assoc($participantsDetailsRes)) { if ($userDetails['form_elementid'] == $phNoFormId) { $phNoId = $userDetails['form_elementid']; $phNo = $userDetails['form_elementdata']; } else { if ($userDetails['form_elementid'] == $collFormId) { $collNameId = $userDetails['form_elementid']; $collName = $userDetails['form_elementdata']; if ($collName == "Others") { $getCollNameQuery = "SELECT `form_elementdata`,`form_elementid` FROM `form_elementdata` WHERE `form_elementid`='{$otherCollFormId}' AND `page_modulecomponentid`='{retglobalPmcId()}' AND `user_id`='{$participant['user_pid']}'"; $getCollNameRes = mysql_query($getCollNameQuery) or displayerror(mysql_error()); while ($otherCollDetails = mysql_fetch_assoc($getCollNameRes)) { $collNameId = $otherCollDetails['form_elementid']; $collName = $otherCollDetails['form_elementdata']; } } } } } $participantsTable .= "<td>" . $collName . "</td><td>" . $phNo . "</td>"; $getUserRankQuery = "SELECT `user_rank` FROM `events_result` WHERE `page_moduleComponentId`='{$pmcId}' AND `event_id`='{$eventId}' AND `user_id`='{$participant['user_pid']}'"; $getUserRankRes = mysql_query($getUserRankQuery) or displayerror(mysql_error()); $userRank = mysql_result($getUserRankRes, 0); $participantsTable .= "<td>" . $userRank . "</td>"; $getPrizeMoneyQuery = "SELECT `prize_money` FROM `events_participants` WHERE `user_pid`='{$participant['user_pid']}' AND `event_id`='{$eventId}' AND `page_moduleComponentId`='{$pmcId}'"; $getPrizeMoneyRes = mysql_query($getPrizeMoneyQuery) or displayerror(mysql_error()); $prizeMoney = mysql_result($getPrizeMoneyRes, 0); $participantsTable .= "<td>" . $prizeMoney . "</td>"; $participantsTable .= "</tr>"; } } $eventNameQuery = "SELECT `event_name` FROM `events_details` WHERE `page_moduleComponentId`='{$pmcId}' AND `event_id`='{$eventId}'"; $eventNameRes = mysql_query($eventNameQuery) or displayerror(mysql_error()); $eventName = mysql_result($eventNameRes, 0); $participantsTable .= "</table>"; displayExcelForTable($participantsTable, $eventName); //return $participantsTable; }
function displayEventFormatExcel() { global $sourceFolder, $moduleFolder; require_once $sourceFolder . "/" . $moduleFolder . "/qaos1/excel.php"; $table = <<<TABLE <table> <thead> <td width="1000px"><b>Event Name(Start Adding From row 2)</b></td> </thead> </table> TABLE; displayExcelForTable($table); }
public function actionView() { global $urlRequestRoot, $sourceFolder, $templateFolder, $cmsFolder, $moduleFolder; $moduleComponentId = $this->moduleComponentId; $scriptsFolder = "{$urlRequestRoot}/{$cmsFolder}/{$templateFolder}/common/scripts"; $imagesFolder = "{$urlRequestRoot}/{$cmsFolder}/{$templateFolder}/common/images"; require_once "{$sourceFolder}/{$moduleFolder}/prhospi/prhospi_common.php"; require_once "{$sourceFolder}/{$moduleFolder}/prhospi/accommodation.php"; if (isset($_POST['subaction']) && $_POST['subaction'] == 'accoRegUser') { echo ajaxSuggestions($moduleComponentId, 0, $this->userId); exit; } if (isset($_POST['subaction']) && $_POST['subaction'] == 'accoRegUserUpdate') { echo ajaxSuggestions($moduleComponentId, 1); exit; } if (isset($_GET['subaction']) && $_GET['subaction'] == 'getsuggestions' && isset($_GET['forwhat'])) { echo getSuggestionsForIdOrEmail(escape($_GET['forwhat'])); exit; } if (isset($_POST['printthis']) && isset($_POST['printHiddenId'])) { if ($_POST['printHiddenId'] != "") { $pos = strpos($_POST['printHiddenId'], "printHostelAllotmentBill"); if ($pos == 0) { return printDisclaimer($moduleComponentId, substr(escape($_POST['printHiddenId']), 24), "hospihead"); } } } if (isset($_GET['subaction'])) { if ($_GET['subaction'] == 'AddRoom') { if (isset($_POST['addHostels'])) { $displayActions = addHostels($_POST, $moduleComponentId); } return $displayActions = displayAddNewRooms("view", $moduleComponentId); } } $displayTags = <<<TAG <script type="text/javascript" src="{$urlRequestRoot}/{$cmsFolder}/{$moduleFolder}/prhospi/accoregister.js"></script> <h2> Accommodation </h2> \t<table> <tr> <td><a href="./+view&subaction=viewRegisteredUser"> <div>View Registrants</div></a></td> <td><a href="./+view"><div>Add User</div></a></td> </tr> </table> TAG; if (isset($_GET['subaction']) && $_GET['subaction'] == 'viewRegisteredUser') { $excel = "<a href='./+view&subaction=viewRegisteredUser&saveAsExcel'>Save as Excel</a>"; if (isset($_GET['saveAsExcel'])) { require_once "{$sourceFolder}/{$moduleFolder}/qaos1/excel.php"; displayExcelForTable(displayUsersRegisteredToAcco($moduleComponentId)); } return $displayTags . $excel . displayUsersRegisteredToAcco($moduleComponentId); } $inputUser = <<<USER <h2> CHECK IN FORM </h2> <form method="POST" action="./+view"> Enter UserId or Email:<input type="text" name="txtFormUserId" id="txtFormUserId" autocomplete="off" style="width: 256px" /> <div id="suggestionsBox" style="background-color: white; width: 260px; border: 1px solid black; position: absolute; overflow-y: scroll; max-height: 180px; display: none"></div> <input type="submit" Value="Find User"/> <!-- <script type="text/javascript" language="javascript" src="{$scriptsFolder}/ajaxsuggestionbox.js"> </script> <script language="javascript"> var userBox = new SuggestionBox(document.getElementById('txtFormUserId'), document.getElementById('suggestionsBox'), "./+view&subaction=getsuggestions&forwhat=%pattern%"); userBox.loadingImageUrl = '{$imagesFolder}/ajaxloading.gif'; </script> --> </form> USER; $userDetails = ""; $displayActions = ""; if (isset($_POST['txtFormUserId']) && $_POST['txtFormUserId'] != '') { // $detailsGiven=explode("- ",escape($_POST['txtFormUserId'])); // $userDetails.=getUserDetailsForHospi($detailsGiven[1],$moduleComponentId); $userDetails .= getUserDetailsForHospi(escape($_POST['txtFormUserId']), $moduleComponentId); } if (isset($_POST['txtFormUserId1']) && $_POST['txtFormUserId1'] != '') { if (!isset($_POST['refundAmt'])) { displayerror("Refund Amount Not Defined"); } else { if (!is_numeric($_POST['refundAmt'])) { displayerror("Refund Amount is not a Valid Number"); } else { // $detailsGiven=explode("- ",escape($_POST['txtFormUserId1'])); // checkOut($detailsGiven[1],escape($_POST['refundAmt']),$moduleComponentId); checkOut(escape($_POST['txtFormUserId1']), escape($_POST['refundAmt']), $moduleComponentId); } } } if (isset($_GET['subaction']) && $_GET['subaction'] == 'accommodation' && isset($_GET['userId']) && is_numeric($_GET['userId'])) { $userDetails .= displayAccommodationForm(escape($_GET['userId']), $moduleComponentId, $this->userId); } $amtToCollect = getAmount("hospihead", $moduleComponentId); $checkOutFORM = <<<checkOut <hr/> <h2> CHECK OUT FORM </h2> <form method="POST" action="./+view"> <table border="1"> <tr> <td>Enter UserId or Email:</td> <td><input type="text" name="txtFormUserId1" id="txtFormUserId1" autocomplete="off" style="width: 256px" /> <div id="suggestionsBox1" style="background-color: white; width: 260px; border: 1px solid black; position: absolute; overflow-y: scroll; max-height: 180px; display: none"></div><br/> </td> </tr> <tr> <td>Refund Amount:</td> <td><input type="text" name="refundAmt" value="{$amtToCollect}"/></td> </tr> <tr> <td colspan="2"><input type="submit" Value="Find User"/></td> </tr> </table> <!-- <script type="text/javascript" language="javascript" src="{$scriptsFolder}/ajaxsuggestionbox.js"> </script> <script language="javascript"> var userBox = new SuggestionBox(document.getElementById('txtFormUserId1'), document.getElementById('suggestionsBox1'), "./+view&subaction=getsuggestions&forwhat=%pattern%"); userBox.loadingImageUrl = '{$imagesFolder}/ajaxloading.gif'; </script> --> </form> checkOut; return $displayTags . $inputUser . $userDetails . $checkOutFORM; }
function download_black_list($mcId) { global $sourceFolder, $moduleFolder; require_once $sourceFolder . "/" . $moduleFolder . "/qaos1/excel.php"; $tableUpdate = <<<TABLE <table> <tr> <th>NAME</th> <th>Roll Number</th> </tr> TABLE; $viewBlackListQuery = "SELECT `name`,`oc_roll_no` FROM oc_form_reg WHERE `page_moduleComponentId`={$mcId} ORDER BY oc_roll_no"; $viewBlackListQueryRes = mysql_query($viewBlackListQuery) or displayerror(mysql_error()); while ($res = mysql_fetch_assoc($viewBlackListQueryRes)) { $email = $res['oc_roll_no'] . '@nitt.edu'; $checkIfExist = "SELECT oc_valid_email FROM oc_valid_emails WHERE oc_valid_email='{$email}' AND `page_moduleComponentId`={$mcId}"; $checkIfExistRes = mysql_query($checkIfExist) or displayerror(mysql_error()); if (!mysql_num_rows($checkIfExistRes)) { $tableUpdate .= <<<TR <tr> <td>{$res['name']}</td> <td>{$res['oc_roll_no']}</td> </tr> TR; } } $tableUpdate .= "</table>"; displayExcelForTable($tableUpdate); }