Advertisement
Guest User

Untitled

a guest
Dec 17th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.46 KB | None | 0 0
  1. <?php error_reporting(0); ?>
  2.  
  3. <!DOCTYPE html>
  4. <html>
  5.  
  6. <head>
  7. <meta charset="utf-8">
  8. <title>Web hello</title>
  9.  
  10. <link rel="stylesheet" href="php.php">
  11.  
  12. <style>
  13. table, th, td {
  14. border: 1px solid black;
  15. }
  16. </style>
  17.  
  18. </head>
  19.  
  20. <body>
  21.  
  22. <form action="index.PHP" method="post">
  23. <select name="Sheets">
  24. <option class="Sheet" value="">Select from:</option>
  25. <option class="Sheet" value="All">All</option>
  26. <option class="Sheet" value="No answer">No answer</option>
  27. <option class="sheet" value="Voice mail">Voice mail</option>
  28. </select>
  29.  
  30. <input type="submit" name="submit" value="submit"/>
  31. </form>
  32.  
  33.  
  34. <?php
  35. //<<<<<<<<<<<<<<<<<<<<<<<< Classes >>>>>>>>>>>>>>>>>>>>>>>>>
  36. class no_answer
  37. {
  38. public $Name;
  39. public $Number;
  40. public $Post_code;
  41. public $Email;
  42.  
  43. }
  44.  
  45.  
  46. $array_no[]=new no_answer;
  47.  
  48. class voice_mail
  49. {
  50. public $Name;
  51. public $Number;
  52. public $Post_code;
  53. public $Email;
  54.  
  55. }
  56.  
  57. $array_voice[]=new voice_mail;
  58.  
  59.  
  60.  
  61. ?>
  62.  
  63. <?php
  64.  
  65.  
  66.  
  67. $servername = "localhost";
  68. $username = "root";
  69. $password = "";
  70. $dbname = "testdb";
  71.  
  72. // <<<<<<<<<<<<<<<<<<<<<<<<<<Create connection>>>>>>>>>>>>>>>>>>>>>>>>>
  73.  
  74. $conn = mysqli_connect($servername, $username, $password, $dbname);
  75.  
  76.  
  77. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<Check connection>>>>>>>>>>>>>>>>>>>>>
  78. if (!$conn) {
  79. die("Connection failed: " . mysqli_connect_error());
  80. }
  81. $sql = "SELECT * FROM yousef ";
  82. $result = mysqli_query($conn, $sql);
  83.  
  84. //<<<<<<<<<<<<<<<<<<<<<<<< Agent >>>>>>>>>>>>>>>>>>>>>>
  85.  
  86. if(isset($_POST['submit'])) {
  87.  
  88. $wanted = $_POST["Sheets"];
  89. //echo $wanted;
  90. }
  91.  
  92.  
  93. if($wanted=="All")
  94. {
  95.  
  96. if (mysqli_num_rows($result) > 0)
  97. {
  98.  
  99. echo"<table><tr><th>Functions</th><th>Name</th><th>Number</th><th>Post code</th><th>Email</th><th>Submit</th></tr>";
  100. while($row = mysqli_fetch_assoc($result))
  101. {
  102.  
  103.  
  104.  
  105. echo "<tr><td>".'<form name="myForm" id="myForm" method="post">
  106. <select name="seet" onChange="He();" >
  107. <option class="sheet" value="">Select from:</option>
  108. <option class="Sheet" id="No Answer" value="No answer">No answer</option>
  109. <option class="Sheet" id="Voice Mail" value="Voice mail">Voice mail</option>
  110. </select></form>'."</td><td>".$row["Name"]."</td><td>".$row["Number"]."</td><td>".$row["Post code"]."</td><td>".$row["Email"]."</td><td>".'<input type="button" value="Submit" onclick="myFunction()" />'."</td></tr>";
  111.  
  112.  
  113. }
  114.  
  115. }
  116. }
  117. //<<<<<<<<<<<<<<<<<<<<<<<<<< No Answer >>>>>>>>>>>>>>>>>>>
  118.  
  119.  
  120.  
  121. else if($wanted=="No answer")
  122. {
  123. foreach($array_no as $k => $cur)
  124. {
  125. echo $cur['Name'];
  126. echo $cur['Number'];
  127. echo $cur['Post code'];
  128. echo $cur['Email'];
  129. }
  130.  
  131. }
  132.  
  133.  
  134.  
  135. //<<<<<<<<<<<<<<<<<<<<<<<<<<< Voice mail >>>>>>>>>>>>>>>>>>>>>>
  136.  
  137. else if($wanted=="Voice mail")
  138. {
  139. foreach($array_voice as $k => $cur)
  140. {
  141. echo $cur['Name'];
  142. echo $cur['Number'];
  143. echo $cur['Post code'];
  144. echo $cur['Email'];
  145. }
  146.  
  147. }
  148.  
  149. echo"</table>";
  150.  
  151.  
  152.  
  153. ?>
  154.  
  155. <?php //<<<<<<<<<<<<<<<<<<< JAva Script >>>>>>>>>>>>>>>> ?>
  156. <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
  157. <script src="jquery-1.7.1.min.js"></script>
  158. <script type="text/javascript"> </script>
  159. <script>
  160.  
  161. var He=function(){
  162.  
  163. alert($('Sheet').context();
  164. }
  165.  
  166. </script>
  167.  
  168.  
  169. <form action="index.PHP" method="post">
  170. <input type="submit" name="Submit" value="Submit"/>
  171. </form>
  172. <?php
  173. //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Changes >>>>>>>>>>>>>>>>>>>>>>>>
  174. /*
  175. if(isset($_POST['Submit'])) {
  176.  
  177. echo"asdasdsd";
  178.  
  179. // if (mysqli_num_rows($result) > 0)
  180. // {
  181. //while($row = mysqli_fetch_assoc($result))
  182. //{
  183. /*
  184. if($_POST["seet"]=="No answer")
  185. {
  186. array_push($array_no,$row["Name"],$row["Number"],$row["Post code"],$row["Email"]);
  187. }
  188.  
  189. if($_POST["seet"]=="Voice mail")
  190. {
  191. array_push($array_no,$row["Name"],$row["Number"],$row["Post code"],$row["Email"]);
  192. }
  193. */
  194.  
  195. // echo $_POST["seet"];
  196.  
  197.  
  198.  
  199. // }
  200. //}
  201. //}
  202.  
  203.  
  204. ?>
  205.  
  206. <?php
  207. mysqli_close($conn);
  208. ?>
  209.  
  210. </body>
  211.  
  212.  
  213.  
  214.  
  215. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement