Guest User

Bug Issue

a guest
Oct 29th, 2015
122
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. // first thing to do when loading page is compile list of projects
  3. $projects = searchProject($project);
  4.  
  5.  
  6.  
  7. function searchProject($project) {
  8. // query ClrHome database
  9. $xml = new SimpleXMLElement("../productsposts.xml", 0, true);
  10. foreach( $xml->channel->item as $item ) {
  11. $emailauthor = explode("(", $item->author);
  12. $author = $emailauthor[1];
  13. $email = $emailauthor[0];
  14. $projects[] = array(
  15. "title" => $item->title,
  16. "author" => substr( $author, 0, strlen($author)-1 ),
  17. "email" => substr($email, 0, strlen($email)-1 ),
  18. "link" => $item->guid
  19. );
  20. }
  21. return $projects;
  22. }
  23.  
  24. ?>
  25. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  26. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  27. <html xmlns="http://www.w3.org/1999/xhtml">
  28. <head>
  29. <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
  30. <title>ClrHome Bug Reporting</title>
  31. <style type="text/css">
  32. html,body {width:100%; height:100%; overflow:hidden; padding:0px; margin:0px;}
  33. body {background-color:silver;}
  34. #banner {width:100%; height:5%; font-size:20px; font-weight:bold; text-align:center; background-color:#1c1c1c; color:white; font-family:monospace; }
  35. #content {width:100%; height:90%; overflow:auto;}
  36. table, tr {width:100%;}
  37. th {background-color:gray; font-size:110%;}
  38. th, td {font-family:monospace;}
  39. tr {border-bottom:1px solid gray;}
  40. #bugsubmit {
  41. display:none;
  42. border:2px outset black;
  43. background-color:darkgray;
  44. position:absolute;
  45. top:10%;
  46. width:60%;
  47. margin-left:20%;
  48. height:80%;
  49. border-radius:5px;
  50. -moz-border-radius:5px;
  51. -webkit-border-radius:5px;
  52. box-shadow:2px 2px 4px black;
  53. padding:10px;
  54. }
  55. #closeform {float:right; border-radius:50%; -moz-border-radius:50%; -webkit-border-radius:50%; font-family:monospace; font-size:24px; padding:0px; margin:0px; cursor:pointer; cursor:hand; text-align:center;}
  56. input[name=title] {width:90%; margin:auto; height:30px; border:1px solid gray; display:block; background-color:inherit; font-weight:bold; font-size:120%;}
  57. input:focus {border:1px solid gray !important; box-shadow: 0 !important; outline: 0;}
  58. </style>
  59. <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  60. <script type="text/javascript" src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script>
  61. <script src="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.js"></script>
  62. <script type="text/javascript">
  63. $(document).ready(function() {
  64. $("#openform").on("tap", function(){
  65. $("#bugsubmit").show();
  66. });
  67. $("#closeform").on("tap", function(){
  68. $("#bugsubmit").hide();
  69. });
  70. });
  71. </script>
  72. </head>
  73. <body>
  74. <div id="banner">Bug Reporting for ClrHome Productions</div>
  75. <div id="content">
  76. <?php
  77. $xmlDoc = new SimpleXMLElement("bugs.xml", 0, true);
  78. echo "<table><tr><th>#</th><th>Posting Date</th><th>Project</th><th>VN</th><th>Title</th><th>Status</th></tr>";
  79. foreach( $xmlDoc->bug as $bug ) {
  80. echo "<tr>";
  81. echo "<td style=\"width:5%;\">" . $bug->id . "</td>";
  82. echo "<td style=\"width:10%;\">" . $bug->date . "</td>";
  83. echo "<td style=\"width:15%;\">" . $bug->project . "</td>";
  84. echo "<td style=\"width:5%;\">" . $bug->version . "</td>";
  85. echo "<td>" . $bug->title . "</td>";
  86. echo "<td style=\"width:10%;\">" . $bug->status . "</td></tr>";
  87. }
  88. echo "</table>";
  89. ?>
  90. <span id="openform" style="font-family:monospace; color:blue; margin-left:1%; cursor:pointer; cursor:hand;">Post a Bug</span>
  91. <form id="bugsubmit" method="post" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>">
  92. <span id="closeform">X</span>
  93. <input name="title" value="<?php echo $title; ?>" />
  94. <hr />
  95. Project: <select name="project">
  96. <option selected disabled hidden value="">select one</option>
  97. <?php
  98. $cnt = 0;
  99. foreach( $projects as $proj ) {
  100. echo "<option value=\"" . (string)$cnt . "\">";
  101. echo (string)$proj['title'] . ", by " . (string)$proj['author'];
  102. echo "</option>";
  103. ++$cnt;
  104. }
  105. ?>
  106. </select>
  107. <input name="email" value="<?php echo $email; ?>" />
  108. </form>
  109. </div>
  110.  
  111.  
  112. </body>
  113. </html>
RAW Paste Data