Guest User

Untitled

a guest
Apr 24th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.30 KB | None | 0 0
  1. <?php
  2. //FULL DISPLAY SCRIPT TEST
  3. $list_form = "";
  4. $frame = "Frame1";
  5. $query = mysql_query("SELECT * FROM jobs ORDER BY id ASC");
  6. $productCount = mysql_num_rows($query); // count the output amount
  7. if ($productCount > 0) {
  8. while($row = mysql_fetch_array($query)){
  9. $iName_id = $row["id"];
  10. $iName = $row["jobs"];
  11. $date_sched = "date_sched_" . $iName;
  12. $to_do = "to_do_" . $iName;
  13. $cost = "cost_" . $iName;
  14. //gather to_do list for display
  15. $to_do_list = "";
  16. $to_do_query = mysql_query("SELECT * FROM to_do ORDER BY id ASC");
  17. $to_do_productCount = mysql_num_rows($to_do_query); // count the output amount
  18. if ($to_do_productCount > 0) {
  19. while($to_do_row = mysql_fetch_array($to_do_query)){
  20. $to_do_id = $to_do_row["id"];
  21. $to_do_name = $to_do_row["to_do"];
  22. $to_do_list .= '<td> ' . $to_do_name . '<input name="' . $to_do . '" type="radio" id="' . $to_do . '" value="' . $to_do_id . '" size="40" ' . ' />' . ' ' . '</td>';
  23. }
  24. } else {
  25. $to_do_list = "You have no to_do s listed in your database table";
  26. }
  27. //gather technicien list for display
  28. $tech_list = "";
  29. $tech_query = mysql_query("SELECT * FROM users ORDER BY first_name ASC");
  30. $tech_productCount = mysql_num_rows($tech_query); // count the output amount
  31. if ($tech_productCount > 0) {
  32. while($tech_row = mysql_fetch_array($tech_query)){
  33. $tech_id = $tech_row["id"];
  34. $tech_first_name = $tech_row["first_name"];
  35. $tech_last_name = $tech_row["last_name"];
  36. $tech_list = "$tech_first_name $tech_last_name";
  37. echo $tech_productCount;
  38. echo "<option value=$tech_id>$tech_list</option>";
  39. }
  40.  
  41. } else {
  42. $tech_list = "Nothing to display";
  43. }
  44. if ($frame == "Frame2") {$frame = "Frame1";} else {$frame = "Frame2";}
  45. $list_form .= '<tr> <td align="right" valign="top" id="' . $frame . '"><strong>' . $iName . '</strong>:</td>' . '<td id="' . $frame . '" ><p>
  46. <label>
  47. Yes<input name="' . $iName . '" type="radio" id="' . $iName . '" value=1 size="12" />
  48. No
  49. <input name="' . $iName . '" type="radio" id="glass" value=0 size="12" checked />
  50. Scheduled date: </label>
  51. <input id="' . $date_sched . '" name="' . $date_sched . '" type="text" size="8">
  52. <a href="javascript:NewCal(\'' . $date_sched . '\',\'ddmmyyyy\')"><img src="../scripts/calendar/cal.gif" width="16" height="16" border="0" alt="Pick a date"></a>
  53.  
  54. <label>
  55. <br />
  56. </label>
  57. </p>
  58. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  59. <tr>
  60. <td>' . $to_do_list . '</td>
  61. </tr>
  62. </table>
  63. <p>Cost $:
  64. <input name="' . $cost . '" type="text" onKeyDown="limitText(this.form.limitedtextfield,this.form.countdown,12);"
  65. onKeyUp="limitText(this.form.limitedtextfield,this.form.countdown,12);" maxlength="12" id="' . $cost . '" size="10" />
  66. </p>
  67. <p>Technicien <select name="' . $iName . '" id="' . $iName . '">"<option value=' . $tech_id . '>' . $tech_list . '</option>"
  68. </select> ';
  69. }
  70. } else {
  71. $list_form = "You have no FORMS in your list yet";
  72. }
  73. ?>
Add Comment
Please, Sign In to add comment