Użytkownik: anonymous
Tytuł: noname
Język: PHP
Data: 7 mar 2010, 10:35
Link: http://3paste.com/s/1526/php/noname
  1. <?php require_once('connections/admin.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.  
  8. $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  9.  
  10. switch ($theType) {
  11. case "text":
  12. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  13. break;
  14. case "long":
  15. case "int":
  16. $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  17. break;
  18. case "double":
  19. $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
  20. break;
  21. case "date":
  22. $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  23. break;
  24. case "defined":
  25. $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  26. break;
  27. }
  28. return $theValue;
  29. }
  30. }
  31.  
  32. $delete = @$_GET['delete'];
  33.  
  34. $currentPage = $_SERVER["PHP_SELF"];
  35.  
  36. $maxRows_hotels = 16;
  37. $pageNum_hotels = 0;
  38. if (isset($_GET['pageNum_hotels'])) {
  39. $pageNum_hotels = $_GET['pageNum_hotels'];
  40. }
  41. $startRow_hotels = $pageNum_hotels * $maxRows_hotels;
  42.  
  43. mysql_select_db($database_admin, $admin);
  44. $query_hotels = "SELECT * FROM TV_Shows";
  45. $query_limit_hotels = sprintf("%s LIMIT %d, %d", $query_hotels, $startRow_hotels, $maxRows_hotels);
  46. $hotels = mysql_query($query_limit_hotels, $admin) or die(mysql_error());
  47. $row_hotels = mysql_fetch_assoc($hotels);
  48.  
  49. if (isset($_GET['totalRows_hotels'])) {
  50. $totalRows_hotels = $_GET['totalRows_hotels'];
  51. } else {
  52. $all_hotels = mysql_query($query_hotels);
  53. $totalRows_hotels = mysql_num_rows($all_hotels);
  54. }
  55. $totalPages_hotels = ceil($totalRows_hotels/$maxRows_hotels)-1;
  56.  
  57. $queryString_hotels = "";
  58. if (!empty($_SERVER['QUERY_STRING'])) {
  59. $params = explode("&", $_SERVER['QUERY_STRING']);
  60. $newParams = array();
  61. foreach ($params as $param) {
  62. if (stristr($param, "pageNum_hotels") == false &&
  63. stristr($param, "totalRows_hotels") == false) {
  64. array_push($newParams, $param);
  65. }
  66. }
  67. if (count($newParams) != 0) {
  68. $queryString_hotels = "&" . htmlentities(implode("&", $newParams));
  69. }
  70. }
  71. $queryString_hotels = sprintf("&totalRows_hotels=%d%s", $totalRows_hotels, $queryString_hotels);
  72. ?>
  73.  
  74.  
  75.  
  76. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  77. <html xmlns="http://www.w3.org/1999/xhtml">
  78. <head>
  79. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  80. <title>RufusFCB Code Creator</title>
  81. <link href="loginmodule.css" rel="stylesheet" type="text/css" />
  82. </head>
  83. <body>
  84.  
  85. <div id="left">
  86.  
  87. <center><font color="#ffffff">Admin Panel</font></center>
  88.  
  89. <div class="content">
  90.  
  91.  
  92. <br/>
  93. <br/>
  94. <center>
  95.  
  96.  
  97. <form name="myform" action="shows.php" method="get">
  98. <div align="center">
  99. Show:<select name="show">
  100. <?php do {
  101.  
  102.  
  103. ?> <option value="<?php echo $row_hotels['ID']; ?>"><?php echo $row_hotels['Title']; ?></option>
  104. <?php
  105. } while ($row_hotels = mysql_fetch_assoc($hotels)); ?>
  106.  
  107. </select>
  108. <br/><br/>
  109. Series:<select name="series">
  110.  
  111. <option value="1">1</option>
  112. <option value="2">2</option>
  113. <option value="3">3</option>
  114. <option value="4">4</option>
  115. <option value="5">5</option>
  116. <option value="6">6</option>
  117. <option value="7">7</option>
  118. <option value="8">8</option>
  119. <option value="9">9</option>
  120. <option value="10">10</option>
  121.  
  122. </select>
  123. <br/><br/>
  124. <input type="submit" value="Go!">
  125.  
  126. </div>
  127. </form>
  128.  
  129.  
  130. </center>
  131. <br/>
  132.  
  133.  
  134.  
  135. </div>
  136.  
  137. </div>
  138. <div id="main">
  139.  
  140. <center><font color="#ffffff">Main</font></center>
  141.  
  142.  
  143. <div class="content">
  144.  
  145.  
  146.  
  147. <center><p>Please select a TV Show from the drop down box on the left hand side.</p></center>
  148.  
  149. </div>
  150.  
  151. </div>
  152.  
  153.  
  154. </body>
  155. </html>
© 2008 3paste.com Pytania i odpowiedzi | Kontakt | Zmiany 3paste_Poland 3paste_England