Advertisement
Guest User

Untitled

a guest
Dec 20th, 2017
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.85 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.  
  47.  
  48. class voice_mail
  49. {
  50. public $Name;
  51. public $Number;
  52. public $Post_code;
  53. public $Email;
  54.  
  55. }
  56.  
  57.  
  58. class Customer
  59. {
  60. var $price;
  61. var $name;
  62. var $photo;
  63.  
  64.  
  65. public function print_game()
  66. {
  67. echo $this->name;
  68. echo $this->price;
  69.  
  70. echo $this->photo;
  71.  
  72.  
  73.  
  74.  
  75. }
  76. }
  77.  
  78. $game= new Customer;
  79. $game->name='asdsadsad';
  80. $game->price=35453;
  81. $game->photo='asdsad';
  82.  
  83.  
  84.  
  85.  
  86. ?>
  87.  
  88. <?php
  89.  
  90.  
  91.  
  92. $servername = "localhost";
  93. $username = "root";
  94. $password = "";
  95. $dbname = "testdb";
  96.  
  97. // <<<<<<<<<<<<<<<<<<<<<<<<<<Create connection>>>>>>>>>>>>>>>>>>>>>>>>>
  98.  
  99. $conn = mysqli_connect($servername, $username, $password, $dbname);
  100.  
  101.  
  102. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<Check connection>>>>>>>>>>>>>>>>>>>>>
  103. if (!$conn) {
  104. die("Connection failed: " . mysqli_connect_error());
  105. }
  106. $sql = "SELECT * FROM yousef ";
  107. $result = mysqli_query($conn, $sql);
  108.  
  109. //<<<<<<<<<<<<<<<<<<<<<<<< Agent >>>>>>>>>>>>>>>>>>>>>>
  110.  
  111. if(isset($_POST['submit'])) {
  112.  
  113. $wanted = $_POST["Sheets"];
  114. //echo $wanted;
  115. }
  116.  
  117.  
  118. if($wanted=="All")
  119. {
  120.  
  121. if (mysqli_num_rows($result) > 0)
  122. {
  123.  
  124. echo"<table><tr><th>Functions</th><th>Name</th><th>Number</th><th>Post code</th><th>Email</th><th>Submit</th></tr>";
  125. while($row = mysqli_fetch_assoc($result))
  126. {
  127.  
  128.  
  129.  
  130. echo "<tr><td>".'<form name="myForm" method="post">
  131. <select name="seet" onChange="myfunction(this.value)" >
  132. <option class="sheet" value="">Select from:</option>
  133. <option class="Sheet" id="No Answer" value="No answer">No answer</option>
  134. <option class="Sheet" id="Voice Mail" value="Voice mail">Voice mail</option>
  135. </select></form>'."</td><td>".$row["Name"]."</td><td>".$row["Number"]."</td><td>".$row["Post code"]."</td><td>".$row["Email"]."</td><td>"."</td></tr>";
  136.  
  137.  
  138.  
  139. }
  140.  
  141. }
  142. }
  143. //<<<<<<<<<<<<<<<<<<<<<<<<<< No Answer >>>>>>>>>>>>>>>>>>>
  144.  
  145.  
  146.  
  147. else if($wanted=="No answer")
  148. {
  149. foreach($array_no as $k => $cur)
  150. {
  151. echo $cur['Name'];
  152. echo $cur['Number'];
  153. echo $cur['Post code'];
  154. echo $cur['Email'];
  155. }
  156.  
  157. }
  158.  
  159.  
  160.  
  161. //<<<<<<<<<<<<<<<<<<<<<<<<<<< Voice mail >>>>>>>>>>>>>>>>>>>>>>
  162.  
  163. else if($wanted=="Voice mail")
  164. {
  165. $game->print_game();
  166.  
  167. }
  168.  
  169.  
  170. echo"</table>";
  171.  
  172.  
  173.  
  174. ?>
  175.  
  176. <?php //<<<<<<<<<<<<<<<<<<< JAva Script >>>>>>>>>>>>>>>> ?>
  177. <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
  178. <script src="jquery-1.7.1.min.js"></script>
  179. <script type="text/javascript"> </script>
  180. <script>
  181.  
  182. function myfunction(val)
  183. {
  184. if(val=="Voice mail")
  185. {
  186.  
  187.  
  188. alert("Items has succeful submitted");
  189. }
  190. else
  191. {
  192.  
  193. alert("asdasdsadsadsadsads");
  194. }
  195.  
  196. }
  197.  
  198. </script>
  199.  
  200.  
  201. <form action="index.PHP" method="post">
  202. <input type="submit" name="Submit" value="Submit"/>
  203. </form>
  204. <?php
  205. //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Changes >>>>>>>>>>>>>>>>>>>>>>>>
  206. /*
  207. if(isset($_POST['Submit'])) {
  208.  
  209. echo"asdasdsd";
  210.  
  211. // if (mysqli_num_rows($result) > 0)
  212. // {
  213. //while($row = mysqli_fetch_assoc($result))
  214. //{
  215. /*
  216. if($_POST["seet"]=="No answer")
  217. {
  218. array_push($array_no,$row["Name"],$row["Number"],$row["Post code"],$row["Email"]);
  219. }
  220.  
  221. if($_POST["seet"]=="Voice mail")
  222. {
  223. array_push($array_no,$row["Name"],$row["Number"],$row["Post code"],$row["Email"]);
  224. }
  225. */
  226.  
  227. // echo $_POST["seet"];
  228.  
  229.  
  230.  
  231. // }
  232. //}
  233. //}
  234.  
  235.  
  236. ?>
  237.  
  238. <?php
  239. mysqli_close($conn);
  240. ?>
  241.  
  242. </body>
  243.  
  244.  
  245.  
  246.  
  247. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement