PageRenderTime 82ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/cms/system/email/index.php

https://github.com/damanlovett/SEAHO
PHP | 192 lines | 176 code | 10 blank | 6 comment | 22 complexity | b8667d51b395ef7fe2f46a4cbde1818e MD5 | raw file
  1. <?php require_once('../../../Connections/CMS.php'); ?>
  2. <?php require_once('../../includefiles/init.php'); ?>
  3. <?php
  4. if (!function_exists("GetSQLValueString")) {
  5. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  6. {
  7. $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  8. $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  9. switch ($theType) {
  10. case "text":
  11. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  12. break;
  13. case "long":
  14. case "int":
  15. $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  16. break;
  17. case "double":
  18. $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
  19. break;
  20. case "date":
  21. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  22. break;
  23. case "defined":
  24. $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  25. break;
  26. }
  27. return $theValue;
  28. }
  29. }
  30. $currentPage = $_SERVER["PHP_SELF"];
  31. $maxRows_rsSQL = 30;
  32. $pageNum_rsSQL = 0;
  33. if (isset($_GET['pageNum_rsSQL'])) {
  34. $pageNum_rsSQL = $_GET['pageNum_rsSQL'];
  35. }
  36. $startRow_rsSQL = $pageNum_rsSQL * $maxRows_rsSQL;
  37. mysql_select_db($database_CMS, $CMS);
  38. $query_rsSQL = "SELECT *, DATE_FORMAT(email_records.sent_date,'%m/%d/%Y %r') AS new_date FROM email_records ORDER BY email_records.id DESC";
  39. $query_limit_rsSQL = sprintf("%s LIMIT %d, %d", $query_rsSQL, $startRow_rsSQL, $maxRows_rsSQL);
  40. $rsSQL = mysql_query($query_limit_rsSQL, $CMS) or die(mysql_error());
  41. $row_rsSQL = mysql_fetch_assoc($rsSQL);
  42. if (isset($_GET['totalRows_rsSQL'])) {
  43. $totalRows_rsSQL = $_GET['totalRows_rsSQL'];
  44. } else {
  45. $all_rsSQL = mysql_query($query_rsSQL);
  46. $totalRows_rsSQL = mysql_num_rows($all_rsSQL);
  47. }
  48. $totalPages_rsSQL = ceil($totalRows_rsSQL/$maxRows_rsSQL)-1;
  49. $queryString_rsSQL = "";
  50. if (!empty($_SERVER['QUERY_STRING'])) {
  51. $params = explode("&", $_SERVER['QUERY_STRING']);
  52. $newParams = array();
  53. foreach ($params as $param) {
  54. if (stristr($param, "pageNum_rsSQL") == false &&
  55. stristr($param, "totalRows_rsSQL") == false) {
  56. array_push($newParams, $param);
  57. }
  58. }
  59. if (count($newParams) != 0) {
  60. $queryString_rsSQL = "&" . htmlentities(implode("&", $newParams));
  61. }
  62. }
  63. $queryString_rsSQL = sprintf("&totalRows_rsSQL=%d%s", $totalRows_rsSQL, $queryString_rsSQL);
  64. ?>
  65. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  66. <html xmlns="http://www.w3.org/1999/xhtml">
  67. <head><link href="../../favicon.ico" rel="shortcut icon" />
  68. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  69. <title>SEAHO CMS</title>
  70. <script type="text/javascript" src="/cms/includefiles/sdmenu.js">
  71. /***********************************************
  72. * Slashdot Menu script- By DimX
  73. * Submitted to Dynamic Drive DHTML code library: http://www.dynamicdrive.com
  74. * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
  75. ***********************************************/
  76. </script>
  77. <link href="../../styles/mainStyle.css" rel="stylesheet" type="text/css" />
  78. <link href="../../styles/navLeft.css" rel="stylesheet" type="text/css" />
  79. <link href="../../styles/sdmenu.css" rel="stylesheet" type="text/css" />
  80. <link href="../../styles/table.css" rel="stylesheet" type="text/css" />
  81. <link href="../../styles/printAdmin.css" rel="stylesheet" type="text/css" media="print" />
  82. <style type="text/css">
  83. <!--
  84. #mainText h3 {
  85. font-size: 13px;
  86. color: #000000;
  87. font-weight: bold;
  88. border-width: 1px;
  89. border-style: none;
  90. background: #FFFFFF;
  91. }
  92. -->
  93. </style>
  94. </head>
  95. <body>
  96. <div id="header">
  97. <?php require_once('../../includefiles/userInfo.php'); ?>
  98. </div>
  99. <div id="sidebar">
  100. <style type="text/css">
  101. <!--
  102. .copyrightNAV {
  103. font-size: 8.5px;
  104. color: #666666;
  105. }
  106. -->
  107. </style>
  108. <?php require_once('../../includefiles/navPage.php'); ?>
  109. <br />
  110. <div class="copyright"> <img src="../../images/LCtag.jpg" alt="Lovett Creations" width="130" height="30" /> <br />
  111. <br />
  112. Copyright &copy; <?php date('Y');?><br />
  113. Lovett Creations<br />
  114. All Rights Reserved</div>
  115. </div>
  116. <div id="mainContent">
  117. <h2>System Emails</h2>
  118. <div id="mainText">
  119. <table width="100%" border="0" cellpadding="3" cellspacing="0" class="tableborder">
  120. <tr>
  121. <td class="tableTop">&nbsp;<?php echo $totalRows_rsSQL ?> Query(s)</td>
  122. <td class="tableTop">&nbsp;</td>
  123. <td class="tableTop">&nbsp;</td>
  124. <td class="tableTop">&nbsp;</td>
  125. <td class="tableTop">&nbsp;</td>
  126. <td class="tableTop">&nbsp;</td>
  127. <td class="tableTop">&nbsp;
  128. <?php if ($pageNum_rsSQL > 0) { // Show if not first page ?>
  129. <a href="<?php printf("%s?pageNum_rsSQL=%d%s", $currentPage, 0, $queryString_rsSQL); ?>"><img src="../../../images/First.gif" border="0" /></a>
  130. <?php } // Show if not first page ?>
  131. &nbsp;
  132. <?php if ($pageNum_rsSQL > 0) { // Show if not first page ?>
  133. <a href="<?php printf("%s?pageNum_rsSQL=%d%s", $currentPage, max(0, $pageNum_rsSQL - 1), $queryString_rsSQL); ?>"><img src="../../../images/Previous.gif" border="0" /></a>
  134. <?php } // Show if not first page ?>
  135. &nbsp;
  136. <?php if ($pageNum_rsSQL < $totalPages_rsSQL) { // Show if not last page ?>
  137. <a href="<?php printf("%s?pageNum_rsSQL=%d%s", $currentPage, min($totalPages_rsSQL, $pageNum_rsSQL + 1), $queryString_rsSQL); ?>"><img src="../../../images/Next.gif" border="0" /></a>
  138. <?php } // Show if not last page ?>
  139. &nbsp;
  140. <?php if ($pageNum_rsSQL < $totalPages_rsSQL) { // Show if not last page ?>
  141. <a href="<?php printf("%s?pageNum_rsSQL=%d%s", $currentPage, $totalPages_rsSQL, $queryString_rsSQL); ?>"><img src="../../../images/Last.gif" border="0" /></a>
  142. <?php } // Show if not last page ?></td>
  143. </tr>
  144. <tr>
  145. <th nowrap="nowrap">Title</th>
  146. <th>&nbsp;</th>
  147. <th>Message</th>
  148. <th nowrap="nowrap">&nbsp;</th>
  149. <th nowrap="nowrap">Sent To</th>
  150. <th nowrap="nowrap">&nbsp;</th>
  151. <th nowrap="nowrap">Date Sent</th>
  152. </tr>
  153. <?php do { ?>
  154. <tr>
  155. <td align="left" valign="top" nowrap="nowrap" class="tablerows"><?php echo $row_rsSQL['title']; ?>&nbsp;</td>
  156. <td class="tablerows">&nbsp;</td>
  157. <td align="left" valign="top" class="tablerows"><?php echo $row_rsSQL['emailmessage']; ?>&nbsp;</td>
  158. <td align="left" valign="top" nowrap="nowrap" class="tablerows">&nbsp;</td>
  159. <td align="left" valign="top" nowrap="nowrap" class="tablerows"><?php echo $row_rsSQL['sent_to']; ?>&nbsp;</td>
  160. <td align="left" valign="top" nowrap="nowrap" class="tablerows">&nbsp;</td>
  161. <td align="left" valign="top" nowrap="nowrap" class="tablerows"><?php echo $row_rsSQL['new_date']; ?>&nbsp;</td>
  162. </tr>
  163. <?php } while ($row_rsSQL = mysql_fetch_assoc($rsSQL)); ?>
  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. <td class="tableBottom">&nbsp;</td>
  172. </tr>
  173. </table>
  174. <div class="cleartable"></div>
  175. </div>
  176. </div>
  177. <div id="footer"></div>
  178. </body>
  179. </html>
  180. <?php
  181. mysql_free_result($rsSQL);
  182. ?>