PageRenderTime 41ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/registration/associates/registration/index.php

https://github.com/damanlovett/SEAHO
PHP | 197 lines | 188 code | 9 blank | 0 comment | 10 complexity | 65a93697c576d0666e9b9a44cdfd5dc2 MD5 | raw file
  1. <?php require_once('../../../Connections/CMS.php'); ?>
  2. <?php
  3. if (!function_exists("GetSQLValueString")) {
  4. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  5. {
  6. $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  7. $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  8. switch ($theType) {
  9. case "text":
  10. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  11. break;
  12. case "long":
  13. case "int":
  14. $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  15. break;
  16. case "double":
  17. $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
  18. break;
  19. case "date":
  20. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  21. break;
  22. case "defined":
  23. $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  24. break;
  25. }
  26. return $theValue;
  27. }
  28. }
  29. ?>
  30. <?php require_once('../../includefiles/initAssociates.php'); ?>
  31. <?php
  32. $colname_rsRegistrations = "-1";
  33. if (isset($_SESSION['userID'])) {
  34. $colname_rsRegistrations = $_SESSION['userID'];
  35. }
  36. mysql_select_db($database_CMS, $CMS);
  37. $query_rsRegistrations = sprintf("SELECT associate_registrations.registration_id, associate_registrations.conference_id, associate_registrations.associate_id, conference.conference_name, associate_transactions.transaction_amount, associate_transactions.registration_id, conference.start_date, conference.end_date, SUM(associate_transactions.transaction_amount) AS trans_sum, associate_registrations.status FROM associate_registrations, conference, associate_transactions WHERE associate_registrations.associate_id = %s AND associate_transactions.registration_id = associate_registrations.registration_id AND associate_registrations.conference_id = conference.conference_id AND associate_registrations.deleted=0 GROUP BY associate_transactions.registration_id", GetSQLValueString($colname_rsRegistrations, "text"));
  38. $rsRegistrations = mysql_query($query_rsRegistrations, $CMS) or die(mysql_error());
  39. $row_rsRegistrations = mysql_fetch_assoc($rsRegistrations);
  40. $totalRows_rsRegistrations = mysql_num_rows($rsRegistrations);
  41. $colname_rsRegNoTrans = "-1";
  42. if (isset($_SESSION['userID'])) {
  43. $colname_rsRegNoTrans = $_SESSION['userID'];
  44. }
  45. mysql_select_db($database_CMS, $CMS);
  46. $query_rsRegNoTrans = sprintf("SELECT associate_registrations.registration_id, associate_registrations.conference_id, associate_registrations.associate_id, conference.conference_name, conference.start_date, conference.end_date, associate_registrations.status FROM associate_registrations, conference WHERE ( associate_registrations.associate_id = %s ) AND associate_registrations.conference_id = conference.conference_id AND associate_registrations.deleted=0", GetSQLValueString($colname_rsRegNoTrans, "text"));
  47. $rsRegNoTrans = mysql_query($query_rsRegNoTrans, $CMS) or die(mysql_error());
  48. $row_rsRegNoTrans = mysql_fetch_assoc($rsRegNoTrans);
  49. $totalRows_rsRegNoTrans = mysql_num_rows($rsRegNoTrans);
  50. $colname_rsRegistrationsNew = "-1";
  51. if (isset($_SESSION['userID'])) {
  52. $colname_rsRegistrationsNew = (get_magic_quotes_gpc()) ? $_SESSION['userID'] : addslashes($_SESSION['userID']);
  53. }
  54. mysql_select_db($database_CMS, $CMS);
  55. $query_rsRegistrationsNew = sprintf("SELECT associate_registrations.registration_id, associate_registrations.conference_id, conference.conference_id, conference.conference_name, associate.associate_id, associate_registrations.status FROM associate_registrations, conference, associate WHERE associate.associate_id=%s AND associate_registrations.conference_id = conference.conference_id AND associate_registrations.deleted=0 GROUP BY associate.associate_id", GetSQLValueString($colname_rsRegistrationsNew, "text"));
  56. $rsRegistrationsNew = mysql_query($query_rsRegistrationsNew, $CMS) or die(mysql_error());
  57. $row_rsRegistrationsNew = mysql_fetch_assoc($rsRegistrationsNew);
  58. $totalRows_rsRegistrationsNew = mysql_num_rows($rsRegistrationsNew);
  59. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  60. <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/second.dwt.php" codeOutsideHTMLIsLocked="false" -->
  61. <head>
  62. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  63. <!-- InstanceBeginEditable name="doctitle" -->
  64. <title>SEAHO</title>
  65. <!-- InstanceEndEditable -->
  66. <link href="../../../stylesheets/mainsheet.css" rel="stylesheet" type="text/css" />
  67. <!-- InstanceBeginEditable name="head" -->
  68. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
  69. <link href="../../styles/cmsMain.css" rel="stylesheet" type="text/css" />
  70. <link href="../../styles/table.css" rel="stylesheet" type="text/css" />
  71. <!-- InstanceEndEditable -->
  72. </head>
  73. <body>
  74. <!-- DO NOT MOVE! The following AllWebMenus code must always be placed right AFTER the BODY tag-->
  75. <!-- ******** BEGIN ALLWEBMENUS CODE FOR mainnav ******** -->
  76. <span id='xawmMenuPathImg-mainnav' style='position:absolute;top:-50px;left:0px'><img name='awmMenuPathImg-mainnav' id='awmMenuPathImg-mainnav' src='../../../menu/awmmenupath.gif' alt=''></span>
  77. <script type='text/javascript'>var MenuLinkedBy='AllWebMenus [4]', awmBN='626'; awmAltUrl='';</script>
  78. <script charset='UTF-8' src='../../../menu/mainnav.js' language='JavaScript1.2' type='text/javascript'></script>
  79. <script type='text/javascript'>awmBuildMenu();</script>
  80. <!-- ******** END ALLWEBMENUS CODE FOR mainnav ******** -->
  81. <table width="760" border="0" align="center" cellpadding="0" cellspacing="0" class="textheader">
  82. <?php require_once('../../../includefiles/header.inc.php'); ?>
  83. <tr>
  84. <td colspan="2" bgcolor="#FFFFFF"><!-- InstanceBeginEditable name="pageBanner" -->
  85. <div align="center"><?php require_once('../../includefiles/headerAssociateHome.php'); ?>
  86. </div>
  87. <!-- InstanceEndEditable --></td>
  88. </tr>
  89. <tr>
  90. <td colspan="2" class="texttop">&nbsp;</td>
  91. </tr>
  92. <tr>
  93. <td width="182" valign="top" id="contentleftmain"><!-- InstanceBeginEditable name="leftNav" -->
  94. <?php require_once('../../includefiles/leftNavAssociates.php'); ?>
  95. <!-- InstanceEndEditable --><img src="../../../images/dropshadowlogo.jpg" alt="Seaho Logo" /></td>
  96. <td width="582" valign="top" id="contentmain"><!-- InstanceBeginEditable name="mainContent" -->
  97. <h1><?php echo $_SESSION['display_name'];?>'s Registrations</h1>
  98. <?php if ($totalRows_rsRegistrations > 0) { // Show if recordset not empty ?>
  99. <table width="100%" border="0" cellpadding="3" cellspacing="0" class="tableDetails">
  100. <tr>
  101. <td class="tableTop"><?php echo $totalRows_rsRegistrations ?> Registration(s)</td>
  102. <td class="tableTop">&nbsp;</td>
  103. <td class="tableTop">&nbsp;</td>
  104. <td class="tableTop">&nbsp;</td>
  105. <td class="tableTop">&nbsp;</td>
  106. <td class="tableTop">&nbsp;</td>
  107. <td class="tableTop">&nbsp;</td>
  108. </tr>
  109. <tr>
  110. <th>Conference</th>
  111. <th>&nbsp;</th>
  112. <th>Dates</th>
  113. <th>&nbsp;</th>
  114. <th>Status</th>
  115. <th>Reps</th>
  116. <th>Balance</th>
  117. </tr>
  118. <?php do { ?>
  119. <tr>
  120. <td class="tablerows"><a href="regdetails.php?recordID=<?php echo $row_rsRegistrations['registration_id']; ?>&amp;conferenceID=<?php echo $row_rsRegistrations['conference_id']; ?>"><?php echo $row_rsRegistrations['conference_name']; ?></a></td>
  121. <td class="tablerows">&nbsp;</td>
  122. <td class="tablerows"><?php echo basicDate($row_rsRegistrations['start_date']); ?> - <?php echo basicDate($row_rsRegistrations['end_date']); ?></td>
  123. <td class="tablerows">&nbsp;</td>
  124. <td class="tablerows"><?php echo $row_rsRegistrations['status']; ?></td>
  125. <td class="tablerows"><div align="center"><a href="reps.php?recordID=<?php echo $row_rsRegistrations['registration_id']; ?>"><img src="../../images/imgAdminView.gif" alt="View" width="14" height="14" /></a></div></td>
  126. <td class="tablerows"><?php echo DoFormatCurrency($row_rsRegistrations['trans_sum'], 2, '.', ',', '$'); ?></td>
  127. </tr>
  128. <?php } while ($row_rsRegistrations = mysql_fetch_assoc($rsRegistrations)); ?>
  129. <tr>
  130. <td class="tableBottom">&nbsp;</td>
  131. <td class="tableBottom">&nbsp;</td>
  132. <td class="tableBottom">&nbsp;</td>
  133. <td class="tableBottom">&nbsp;</td>
  134. <td class="tableBottom">&nbsp;</td>
  135. <td class="tableBottom">&nbsp;</td>
  136. <td class="tableBottom">&nbsp;</td>
  137. </tr>
  138. </table>
  139. <br />
  140. <br />
  141. <?php } // Show if recordset not empty ?>
  142. <?php if ($totalRows_rsRegistrations == 0) { // Show if recordset empty ?>
  143. <table width="100%" border="0" cellpadding="3" cellspacing="0" class="tableDetails">
  144. <tr>
  145. <td class="tableTop">&nbsp;</td>
  146. <td class="tableTop">&nbsp;</td>
  147. <td class="tableTop">&nbsp;</td>
  148. <td class="tableTop">&nbsp;</td>
  149. <td class="tableTop">&nbsp;</td>
  150. <td class="tableTop">&nbsp;</td>
  151. </tr>
  152. <tr>
  153. <th>Conference</th>
  154. <th>&nbsp;</th>
  155. <th>Dates</th>
  156. <th>&nbsp;</th>
  157. <th>Status</th>
  158. <th>&nbsp;</th>
  159. </tr>
  160. <?php do { ?><tr>
  161. <td colspan="6" class="tablerows">You have not registered for any conferences.</td>
  162. </tr>
  163. <?php } while ($row_rsRegNoTrans = mysql_fetch_assoc($rsRegNoTrans)); ?>
  164. <tr>
  165. <td class="tableBottom">&nbsp;</td>
  166. <td class="tableBottom">&nbsp;</td>
  167. <td class="tableBottom">&nbsp;</td>
  168. <td class="tableBottom">&nbsp;</td>
  169. <td class="tableBottom">&nbsp;</td>
  170. <td class="tableBottom">&nbsp;</td>
  171. </tr>
  172. </table>
  173. <?php } // Show if recordset empty ?>
  174. <p>&nbsp;</p>
  175. <!-- InstanceEndEditable --></td>
  176. </tr>
  177. <?php require_once('../../../includefiles/footer.inc.php'); ?>
  178. </table>
  179. </body>
  180. <!-- InstanceEnd --></html>
  181. <?php
  182. mysql_free_result($rsRegistrations);
  183. mysql_free_result($rsRegNoTrans);
  184. mysql_free_result($rsRegistrationsNew);
  185. ?>