Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //FULL DISPLAY SCRIPT TEST
- $list_form = "";
- $frame = "Frame1";
- $query = mysql_query("SELECT * FROM jobs ORDER BY id ASC");
- $productCount = mysql_num_rows($query); // count the output amount
- if ($productCount > 0) {
- while($row = mysql_fetch_array($query)){
- $iName_id = $row["id"];
- $iName = $row["jobs"];
- $date_sched = "date_sched_" . $iName;
- $to_do = "to_do_" . $iName;
- $cost = "cost_" . $iName;
- //gather to_do list for display
- $to_do_list = "";
- $to_do_query = mysql_query("SELECT * FROM to_do ORDER BY id ASC");
- $to_do_productCount = mysql_num_rows($to_do_query); // count the output amount
- if ($to_do_productCount > 0) {
- while($to_do_row = mysql_fetch_array($to_do_query)){
- $to_do_id = $to_do_row["id"];
- $to_do_name = $to_do_row["to_do"];
- $to_do_list .= '<td> ' . $to_do_name . '<input name="' . $to_do . '" type="radio" id="' . $to_do . '" value="' . $to_do_id . '" size="40" ' . ' />' . ' ' . '</td>';
- }
- } else {
- $to_do_list = "You have no to_do s listed in your database table";
- }
- //gather technicien list for display
- $tech_list = "";
- $tech_query = mysql_query("SELECT * FROM users ORDER BY first_name ASC");
- $tech_productCount = mysql_num_rows($tech_query); // count the output amount
- if ($tech_productCount > 0) {
- while($tech_row = mysql_fetch_array($tech_query)){
- $tech_id = $tech_row["id"];
- $tech_first_name = $tech_row["first_name"];
- $tech_last_name = $tech_row["last_name"];
- $tech_list = "$tech_first_name $tech_last_name";
- echo $tech_productCount;
- echo "<option value=$tech_id>$tech_list</option>";
- }
- } else {
- $tech_list = "Nothing to display";
- }
- if ($frame == "Frame2") {$frame = "Frame1";} else {$frame = "Frame2";}
- $list_form .= '<tr> <td align="right" valign="top" id="' . $frame . '"><strong>' . $iName . '</strong>:</td>' . '<td id="' . $frame . '" ><p>
- <label>
- Yes<input name="' . $iName . '" type="radio" id="' . $iName . '" value=1 size="12" />
- No
- <input name="' . $iName . '" type="radio" id="glass" value=0 size="12" checked />
- Scheduled date: </label>
- <input id="' . $date_sched . '" name="' . $date_sched . '" type="text" size="8">
- <a href="javascript:NewCal(\'' . $date_sched . '\',\'ddmmyyyy\')"><img src="../scripts/calendar/cal.gif" width="16" height="16" border="0" alt="Pick a date"></a>
- <label>
- <br />
- </label>
- </p>
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td>' . $to_do_list . '</td>
- </tr>
- </table>
- <p>Cost $:
- <input name="' . $cost . '" type="text" onKeyDown="limitText(this.form.limitedtextfield,this.form.countdown,12);"
- onKeyUp="limitText(this.form.limitedtextfield,this.form.countdown,12);" maxlength="12" id="' . $cost . '" size="10" />
- </p>
- <p>Technicien <select name="' . $iName . '" id="' . $iName . '">"<option value=' . $tech_id . '>' . $tech_list . '</option>"
- </select> ';
- }
- } else {
- $list_form = "You have no FORMS in your list yet";
- }
- ?>
Add Comment
Please, Sign In to add comment