Advertisement
Guest User

Untitled

a guest
Dec 23rd, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.86 KB | None | 0 0
  1. <?php error_reporting(0); ?>
  2. <?php session_start(); ?>
  3.  
  4.  
  5. <!DOCTYPE html>
  6. <html>
  7.  
  8. <head>
  9. <meta charset="utf-8">
  10. <title>Web hello</title>
  11. <link rel="stylesheet" type="text/css" href="NEW.css">
  12. <script>
  13.  
  14. function testJS(x) {
  15. var b =$(x).text(),
  16. url = 'Client.php?name=' + encodeURIComponent(b);
  17.  
  18. window.open(url);
  19. }
  20.  
  21. </script>
  22.  
  23.  
  24.  
  25. <style>
  26. table, th, td {
  27. border: 1px solid black;
  28. }
  29. </style>
  30.  
  31. </head>
  32.  
  33. <body>
  34.  
  35. <form action="index.PHP" method="post">
  36. <select name="Sheets">
  37. <option class="Sheet" value="">Select from:</option>
  38. <option class="Sheet" value="All">All</option>
  39. <option class="Sheet" value="No answer">No answer</option>
  40. <option class="sheet" value="Voice mail">Voice mail</option>
  41. </select>
  42.  
  43. <input type="submit" name="submit" value="submit"/>
  44. </form>
  45.  
  46.  
  47. <?php
  48.  
  49.  
  50.  
  51. //<<<<<<<<<<<<<<<<<<<<<<<< Classes >>>>>>>>>>>>>>>>>>>>>>>>>
  52. class no_answer
  53. {
  54. public $Name;
  55. public $Number;
  56. public $Post_code;
  57. public $Email;
  58.  
  59. }
  60.  
  61.  
  62.  
  63.  
  64. class voice_mail
  65. {
  66. public $Name;
  67. public $Number;
  68. public $Post_code;
  69. public $Email;
  70.  
  71. }
  72.  
  73.  
  74. class Customer
  75. {
  76. var $price;
  77. var $name;
  78. var $photo;
  79.  
  80.  
  81. public function print_game()
  82. {
  83. echo $this->name;
  84. echo $this->price;
  85.  
  86. echo $this->photo;
  87.  
  88.  
  89.  
  90.  
  91. }
  92. }
  93.  
  94. $game= new Customer;
  95. $game->name='asdsadsad';
  96. $game->price=35453;
  97. $game->photo='asdsad';
  98.  
  99.  
  100.  
  101.  
  102. ?>
  103.  
  104.  
  105. <?php
  106.  
  107.  
  108.  
  109. $servername = "localhost";
  110. $username = "root";
  111. $password = "";
  112. $dbname = "testdb";
  113.  
  114. // <<<<<<<<<<<<<<<<<<<<<<<<<<Create connection>>>>>>>>>>>>>>>>>>>>>>>>>
  115.  
  116. $conn = mysqli_connect($servername, $username, $password, $dbname);
  117.  
  118.  
  119. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<Check connection>>>>>>>>>>>>>>>>>>>>>
  120. if (!$conn) {
  121. die("Connection failed: " . mysqli_connect_error());
  122. }
  123. $sql = "SELECT * FROM yousef ";
  124. $result = mysqli_query($conn, $sql);
  125.  
  126. //<<<<<<<<<<<<<<<<<<<<<<<< Agent >>>>>>>>>>>>>>>>>>>>>>
  127.  
  128. if(isset($_POST['submit'])) {
  129.  
  130. $wanted = $_POST["Sheets"];
  131. //echo $wanted;
  132. }
  133.  
  134.  
  135. if($wanted=="All")
  136. {
  137.  
  138. if (mysqli_num_rows($result) > 0)
  139. {
  140. echo"<table><tr><th>Functions</th><th>Name</th><th>Number</th><th>Post code</th><th>Email</th><th>Submit</th></tr>";
  141. while($row = mysqli_fetch_assoc($result))
  142. {
  143.  
  144.  
  145. echo "<tr><td>".'
  146. <form name="myForm" method="post">
  147. <select name="seet" onChange="myfunction(this.value)" >
  148. <option class="sheet" value="">Select from:</option>
  149. <option class="Sheet" id="No Answer" value="No answer">No answer</option>
  150. <option class="Sheet" id="Voice Mail" value="Voice mail">Voice mail</option>
  151. </select>
  152. </form>'."</td>
  153. <td>".'
  154. <div class="AgentLink" >
  155. <a id="name" herf="#ERR" onclick="testJS(this);" target="_blank"> '.$row["Name"].' </a>
  156. </div>'."</td>
  157. <td>".$row["Number"]."</td><td>".$row["Post code"]."</td><td>".$row["Email"]."</td><td>"."</td></tr>";
  158.  
  159.  
  160. }
  161. // $selected_user = SELECT * FROM yousef where email = $$row["Email"]
  162. //
  163. // insert (email, .. ,.. ) into (table) values
  164. }
  165. }
  166. //<<<<<<<<<<<<<<<<<<<<<<<<<< No Answer >>>>>>>>>>>>>>>>>>>
  167.  
  168.  
  169.  
  170. else if($wanted=="No answer")
  171. {
  172. foreach($array_no as $k => $cur)
  173. {
  174. echo $cur['Name'];
  175. echo $cur['Number'];
  176. echo $cur['Post code'];
  177. echo $cur['Email'];
  178. }
  179.  
  180. }
  181.  
  182.  
  183.  
  184. //<<<<<<<<<<<<<<<<<<<<<<<<<<< Voice mail >>>>>>>>>>>>>>>>>>>>>>
  185.  
  186. else if($wanted=="Voice mail")
  187. {
  188. $game->print_game();
  189.  
  190. }
  191.  
  192.  
  193. echo"</table>";
  194.  
  195.  
  196.  
  197. ?>
  198.  
  199.  
  200. <?php //<<<<<<<<<<<<<<<<<<< JAva Script >>>>>>>>>>>>>>>> ?>
  201. <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
  202.  
  203. <script type="text/javascript" src="Login.js"> </script>
  204. <script>
  205.  
  206. //<<<<<<<<<<<<<<<<<<<<<<<<<<<< Select Box >>>>>>>>>>>>>>>>>>>>>
  207. function myfunction(val)
  208. {
  209. if(val=="Voice mail")
  210. {
  211. <?php
  212.  
  213. echo "asdsadsadsadsadsadsadsadsadsad";
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222. ?>
  223.  
  224. alert("Voice Mail");
  225. }
  226. else if(val=="No answer")
  227. {
  228.  
  229. alert("No Answer");
  230. }
  231.  
  232. }
  233.  
  234.  
  235. //<<<<<<<<<<<<<<<<<<<<<<<<< Select Links >>>>>>>>>>>>>>>>>>>>>>>>>>>>
  236.  
  237.  
  238. </script>
  239.  
  240.  
  241. <form action="index.PHP" method="post">
  242. <input type="submit" name="Submit" value="Submit"/>
  243. </form>
  244. <?php
  245. //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Changes >>>>>>>>>>>>>>>>>>>>>>>>
  246. /*
  247. if(isset($_POST['Submit'])) {
  248.  
  249. echo"asdasdsd";
  250.  
  251. // if (mysqli_num_rows($result) > 0)
  252. // {
  253. //while($row = mysqli_fetch_assoc($result))
  254. //{
  255. /*
  256. if($_POST["seet"]=="No answer")
  257. {
  258. array_push($array_no,$row["Name"],$row["Number"],$row["Post code"],$row["Email"]);
  259. }
  260.  
  261. if($_POST["seet"]=="Voice mail")
  262. {
  263. array_push($array_no,$row["Name"],$row["Number"],$row["Post code"],$row["Email"]);
  264. }
  265. */
  266.  
  267. // echo $_POST["seet"];
  268.  
  269.  
  270.  
  271. // }
  272. //}
  273. //}
  274.  
  275.  
  276. ?>
  277.  
  278. <?php
  279. mysqli_close($conn);
  280. ?>
  281.  
  282. </body>
  283.  
  284.  
  285.  
  286.  
  287. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement