Advertisement
Guest User

Untitled

a guest
Oct 7th, 2013
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. survey.php
  2. <?php
  3.  
  4. ini_set('display_errors',1);
  5. ini_set('display_startup_errors',1);
  6. error_reporting(-1);
  7. include_once('includes/connect.php');
  8.  
  9. $q = $db->prepare("SELECT COUNT(id) as records FROM tracker WHERE que_id = ?");
  10. $q->execute($id);
  11. $records = (int) $q->fetch(PDO::FETCH_OBJ)->records;
  12.  
  13. $query = $db->query("SELECT `id`, `votNumber`, `first_last`, `phone`, `city`, `active`, `gender`, `birth_year`, `registration_date` FROM `members` WHERE `id` = $records");
  14.  
  15.  
  16. while($rows = $query->fetch(PDO::FETCH_ASSOC)){
  17.  
  18. echo $rows['id'] . '<br/>';
  19. echo $rows['votNumber'].'<br/>';
  20. echo $rows['first_last'].'<br/>';
  21. echo $rows['phone'].'<br/>';
  22. echo $rows['city'] . '<br/>';
  23. echo $rows['active'].'<br/>';
  24. echo $rows['gender'].'<br/>';
  25. echo $rows['birth_year'].'<br/>';
  26. echo $rows['registration_date'].'<br/>';
  27.  
  28. }
  29. ?>
  30.  
  31. html
  32. <h4><center>Select Result</center></h4>
  33. <div name></div>
  34. <form action="includes/operation.php" method='post'>
  35. <select name="call">
  36. <option value="noans">Did't Answer</option>
  37. <option value="mess">Left Message</option>
  38. <option value="contact">Contacted</option>
  39.  
  40. </select><br/>
  41. <input type ="submit" Id = "submit" >
  42. </form><br/>
  43. </html>
  44. operation.php
  45.  
  46. <?php
  47. session_start();
  48. ini_set('display_errors',1);
  49. ini_set('display_startup_errors',1);
  50. error_reporting(-1);
  51.  
  52. include_once ('connect.php');
  53. if(isset($_POST['call'])){
  54. $c = preg_replace('#[^a-z ]#i', '', $_POST['call']);
  55. echo $c;
  56.  
  57. // do stuff for no answer or contacted
  58.  
  59.  
  60. $stmt = $db->prepare("UPDATE tracker SET id = :value ");
  61. $stmt->bindParam(':value', $que_id);
  62.  
  63. // insert one row
  64. $id++;
  65.  
  66. $stmt->execute();
  67. //$que_id = mysql_insert_id();
  68.  
  69.  
  70. }
  71.  
  72. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement