Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php error_reporting(0); ?>
- <?php session_start(); ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Web hello</title>
- <link rel="stylesheet" type="text/css" href="NEW.css">
- <script>
- function testJS(x) {
- var b =$(x).text(),
- url = 'Client.php?name=' + encodeURIComponent(b);
- window.open(url);
- }
- </script>
- <style>
- table, th, td {
- border: 1px solid black;
- }
- </style>
- </head>
- <body>
- <form action="index.PHP" method="post">
- <select name="Sheets">
- <option class="Sheet" value="">Select from:</option>
- <option class="Sheet" value="All">All</option>
- <option class="Sheet" value="No answer">No answer</option>
- <option class="sheet" value="Voice mail">Voice mail</option>
- </select>
- <input type="submit" name="submit" value="submit"/>
- </form>
- <?php
- //<<<<<<<<<<<<<<<<<<<<<<<< Classes >>>>>>>>>>>>>>>>>>>>>>>>>
- class no_answer
- {
- public $Name;
- public $Number;
- public $Post_code;
- public $Email;
- }
- class voice_mail
- {
- public $Name;
- public $Number;
- public $Post_code;
- public $Email;
- }
- class Customer
- {
- var $price;
- var $name;
- var $photo;
- public function print_game()
- {
- echo $this->name;
- echo $this->price;
- echo $this->photo;
- }
- }
- $game= new Customer;
- $game->name='asdsadsad';
- $game->price=35453;
- $game->photo='asdsad';
- ?>
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "testdb";
- // <<<<<<<<<<<<<<<<<<<<<<<<<<Create connection>>>>>>>>>>>>>>>>>>>>>>>>>
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<Check connection>>>>>>>>>>>>>>>>>>>>>
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
- $sql = "SELECT * FROM yousef ";
- $result = mysqli_query($conn, $sql);
- //<<<<<<<<<<<<<<<<<<<<<<<< Agent >>>>>>>>>>>>>>>>>>>>>>
- if(isset($_POST['submit'])) {
- $wanted = $_POST["Sheets"];
- //echo $wanted;
- }
- if($wanted=="All")
- {
- if (mysqli_num_rows($result) > 0)
- {
- echo"<table><tr><th>Functions</th><th>Name</th><th>Number</th><th>Post code</th><th>Email</th><th>Submit</th></tr>";
- while($row = mysqli_fetch_assoc($result))
- {
- echo "<tr><td>".'
- <form name="myForm" method="post">
- <select name="seet" onChange="myfunction(this.value)" >
- <option class="sheet" value="">Select from:</option>
- <option class="Sheet" id="No Answer" value="No answer">No answer</option>
- <option class="Sheet" id="Voice Mail" value="Voice mail">Voice mail</option>
- </select>
- </form>'."</td>
- <td>".'
- <div class="AgentLink" >
- <a id="name" herf="#ERR" onclick="testJS(this);" target="_blank"> '.$row["Name"].' </a>
- </div>'."</td>
- <td>".$row["Number"]."</td><td>".$row["Post code"]."</td><td>".$row["Email"]."</td><td>"."</td></tr>";
- }
- // $selected_user = SELECT * FROM yousef where email = $$row["Email"]
- //
- // insert (email, .. ,.. ) into (table) values
- }
- }
- //<<<<<<<<<<<<<<<<<<<<<<<<<< No Answer >>>>>>>>>>>>>>>>>>>
- else if($wanted=="No answer")
- {
- foreach($array_no as $k => $cur)
- {
- echo $cur['Name'];
- echo $cur['Number'];
- echo $cur['Post code'];
- echo $cur['Email'];
- }
- }
- //<<<<<<<<<<<<<<<<<<<<<<<<<<< Voice mail >>>>>>>>>>>>>>>>>>>>>>
- else if($wanted=="Voice mail")
- {
- $game->print_game();
- }
- echo"</table>";
- ?>
- <?php //<<<<<<<<<<<<<<<<<<< JAva Script >>>>>>>>>>>>>>>> ?>
- <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
- <script type="text/javascript" src="Login.js"> </script>
- <script>
- //<<<<<<<<<<<<<<<<<<<<<<<<<<<< Select Box >>>>>>>>>>>>>>>>>>>>>
- function myfunction(val)
- {
- if(val=="Voice mail")
- {
- <?php
- echo "asdsadsadsadsadsadsadsadsadsad";
- ?>
- alert("Voice Mail");
- }
- else if(val=="No answer")
- {
- alert("No Answer");
- }
- }
- //<<<<<<<<<<<<<<<<<<<<<<<<< Select Links >>>>>>>>>>>>>>>>>>>>>>>>>>>>
- </script>
- <form action="index.PHP" method="post">
- <input type="submit" name="Submit" value="Submit"/>
- </form>
- <?php
- //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Changes >>>>>>>>>>>>>>>>>>>>>>>>
- /*
- if(isset($_POST['Submit'])) {
- echo"asdasdsd";
- // if (mysqli_num_rows($result) > 0)
- // {
- //while($row = mysqli_fetch_assoc($result))
- //{
- /*
- if($_POST["seet"]=="No answer")
- {
- array_push($array_no,$row["Name"],$row["Number"],$row["Post code"],$row["Email"]);
- }
- if($_POST["seet"]=="Voice mail")
- {
- array_push($array_no,$row["Name"],$row["Number"],$row["Post code"],$row["Email"]);
- }
- */
- // echo $_POST["seet"];
- // }
- //}
- //}
- ?>
- <?php
- mysqli_close($conn);
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement