function customerFields($data, $badFields) { global $states; global $COUNTRIES; if (userLoggedIn() && array_key_exists("CID", $data) && $data["CID"] != "") { tableRow(array(tableData(prompt("<b>CID:</b>"), "right", "top"), tableData(prompt($data["CID"]), "left", "top"))); prepDatePicker(); tableRow(array(tableData(prompt("<b>Met Date:</b>"), "right", "top"), tableData(text($data, "metDate", "", "", "datepicker"), "left", "middle"))); } tableRow(array(tableData(prompt("<b>First name*:</b>", in_array("fname", $badFields)), "right"), tableData(text($data, "fname"), "left", "middle"), tableData(prompt("<b>Last name*:</b>", in_array("lname", $badFields)), "right"), tableData(text($data, "lname"), "left", "middle"))); tableRow(array(tableData(prompt("<b>Email*:</b>", in_array("email", $badFields)), "right"), tableData(text($data, "email"), "left", "middle"), tableData(prompt("<b>Phone Number:</b>", in_array("phoneNum", $badFields)), "right"), tableData(text($data, "phoneNum"), "left", "middle"))); tableRow(array(tableData(prompt("<b>Title:</b>", in_array("title", $badFields)), "right"), tableData(radioButton($data, "title", "Mr.", false, "Mr."), "center", "middle"), tableData(radioButton($data, "title", "Ms.", false, "Ms."), "center", "middle"), tableData(radioButton($data, "title", "Mrs.", false, "Mrs."), "center", "middle"), tableData(radioButton($data, "title", "Dr.", false, "Dr."), "center", "middle"))); if (!userLoggedIn()) { if ($data["charity"] == true) { tableRow(array(tableData(prompt("Tell us about your situtation, your team and why you need a ChapR. The more information the better!"), "middle", "top", 6))); } else { tableRow(array(tableData(prompt("Write anything else you would like us to know about you below: <br> team info (type, name, number), how you heard about us (where, from who?) etc."), "middle", "top", 6))); } } tableRow(array(tableData(prompt("<b>Comments:</b>", in_array("customerCNotes", $badFields), ""), "right", "top"), tableData(textArea($data, "customerCNotes", 3), "center", "", 5))); tableRow(array(tableData(prompt("<b>Street1*:</b>", in_array("street1", $badFields)), "right"), tableData(text($data, "street1"), "left", "middle", 3))); tableRow(array(tableData(prompt("<b>Street2:</b>", in_array("street2", $badFields)), "right"), tableData(text($data, "street2"), "left", "middle", 3))); $stateDirections = 'only applicable for domestic teams'; tableRow(array(tableData(prompt("<b>City*:</b>", in_array("city", $badFields)), "right"), tableData(text($data, "city"), "left", "middle"), tableData(prompt("<b>State*:</b>", in_array("state", $badFields), "", $stateDirections), "right"), tableData(dropDown($data, "state", $states, "--------Choose Your State-------"), "left", "middle"))); tableRow(array(tableData(prompt("<b>Zip*:</b>", in_array("zip", $badFields)), "right"), tableData(text($data, "zip"), "left", "middle"), tableData(prompt("<b>Country:</b>", in_array("country", $badFields)), "right"), tableData(dropDown($data, "country", $COUNTRIES), "left", "middle"))); if (userLoggedIn()) { tableRow(array(tableData(prompt("<b>Admin Comments:</b>", in_array("adminCNotes", $badFields), "", $commentDirections), "right", "top"), tableData(textArea($data, "adminCNotes", 3), "center", "", 5))); } tableRow(array(tableData(hiddenField("CID", $data["CID"])), tableData(hiddenField("OID", $data["OID"])))); }
function showForm($err_msgs = null) { // generate error messages if ($err_msgs != null) { foreach ($err_msgs as $emsg) { echo '<i>'; echo "{$emsg}"; echo ' </h4>'; } } echo '<form action="file2.php" method="get"> <table class="table2" frame="border">'; tableRow(array(tableData("right", prompt("<h1>Title!</h1>")))); tableRow(array(tableData("right", prompt("First name:")), tableData("right", text("fname")), tableData("right", prompt("Last name:")), tableData("right", text("lname")))); tableRow(array(tableData("right", prompt("City:")), tableData("right", text("city")), tableData("right", prompt("State:")), tableData("right", text("state")))); tableRow(array(tableData("right", prompt("<b>Gender:</b>")), tableData("center", radioButton("gender", "male", false, "Male")), tableData("center", radioButton("gender", "female", false, "Female")), tableData("center", radioButton("gender", "other", true, "Other")))); tableRow(array(tableData("right", prompt("<b>Grade:</b>")), tableData("center", radioButton("grade", "freshman", false, "9<sup>th</sup>")), tableData("center", radioButton("grade", "sohpomore", false, "10<sup>th</sup>")), tableData("center", radioButton("grade", "junior", false, "11<sup>th</sup>")), tableData("center", radioButton("grade", "senior", false, "12<sup>th</sup>")))); tableRow(array(tableData("right", prompt("<b>Product:</b>")), tableData("center", checkBox("product", "ChapR", false, "ChapR")), tableData("center", checkBox("product", "Kit", false, "Kit")), tableData("center", checkBox("product", "USB", false, "USB")), tableData("center", checkBox("product", "Programmer", false, "Programmer")))); echo '</table> <input type="hidden" name="filled" value="true"> </form>'; /* echo ' <tr> <td align="right"><b>Product:</b></td> p <td colspan="3"> <table style="width:100%"> <tr> <td align="center"><input type="checkbox" name="product" value="ChapR">ChapR</td> <td align="center"><input type="checkbox" name="product" value="Programmer">Programmer</td> <td align="center"><input type="checkbox" name="product" value="Kit">Kit</td> <td align="center"><input type="checkbox" name="product" value="USB">USB</td> </tr> </table> </td> </tr> <tr> <td valign="top" align="right"><b>Comments:</b></td> <td colspan="3"><textarea rows="4" style="width:100%" name="comments">'; echo $_GET["comments"]; echo '</textarea></td> </tr> <tr> <td></td> <td></td> <td></td> <td align="right"><input type="submit" value="Submit!"></td> </tr> </table> <input type="hidden" name="filled" value="true"> </form>';*/ }
function createPhase2Form() { echo '<h3 style="text-align:center">Select Parameter by Which to Vary New Options:</h3>'; echo "<fieldset style=\"border: 1px solid black; margin: auto; width: 50%\">"; centeredFormHeader("", "void", "100%", "0px"); tableRow(array(tableData(radioButton($_GET, "option", "numTeeth", true, " # of Teeth")), tableData(radioButton($_GET, "option", "ratio", "", " Ratio")), tableData(radioButton($_GET, "option", "c2c", "", " Center to Center")), tableData("<input type=\"submit\" class=\"sprocketrButton\" value=\"Submit!\">", "center", "", "2"))); echo hiddenField("page_id", $_GET["page_id"]); formFooter("tuningOptions"); echo "</fieldset>"; echo '<table class="form" style="width: 50%; margin: auto; margin-top: 10px; text-align:center"><tr><td>'; echo '<form action="" method="get">'; echo hiddenField("page_id", $_GET["page_id"]); echo hiddenField("output_type", "png"); echo "<input type=\"submit\" class=\"sprocketrButton\" value=\"Preview\">"; echo '</form></td>'; echo '<td style="text-align:center">'; echo '<form action="" method="get">'; echo hiddenField("page_id", $_GET["page_id"]); echo hiddenField("output_type", "stl"); echo "<input type=\"submit\" class=\"sprocketrButton\" value=\"Download\">"; echo '</form></td>'; echo '<td style="text-align:center">'; echo '<form action="" method="get">'; echo hiddenField("page_id", $_GET["page_id"]); echo hiddenField("cmd", "reset"); echo "<input type=\"submit\" class=\"sprocketrButton\" value=\"Reset to Original Options\">"; echo '</form></td>'; echo '<td style="text-align:center;width=40%">'; if ($_GET["page_id"] == PAGE_2) { // on original page 2 echo '<a href="?page_id=' . PAGE_1 . '"><button class="sprocketrButton">Edit Original Input</button></a>'; } else { if ($_GET["page_id"] == PAGE_2_ALT) { // on alternate page 2 echo '<a href="?page_id=' . PAGE_1_ALT . '"><button class="sprocketrButton">Edit Original Input</button></a>'; } } echo '</td>'; echo '<table>'; }
radioButton('bar', 'bar'); ?> <?php radioButton('poi', 'point of interest'); ?> <?php radioButton('market', 'market'); ?> <?php radioButton('croquet', 'croquet'); ?> <?php radioButton('restaurant', 'restaurant'); ?> <?php radioButton('sport', 'sport'); ?> </div> <div class="col-md-6"> <label>Visible to</label> <div class="radio"> <label for="everyone">everyone</label> <input type="radio" name="who" id="everyone" value="everyone"> </div> <div class="radio" id="everyone_and_me_radio"> <label for="everyone_and_me">everyone and me</label> <input type="radio" name="who" id="everyone_and_me" value="everyone_and_me"> </div> <div class="radio" id="just_me_radio"> <label for="just_me">just me</label> <input type="radio" name="who" id="just_me" value="just_me">
function showForm($errormsg = null) { echo '<head> <style> i {color: red;} </style> </head> <body> '; if ($errormsg != null) { foreach ($errormsg as $emsg) { echo "<i> {$emsg} </i><br>"; } } echo ' <form action="file1.php" class="form1"> <input type="hidden" name="filled" value="true"> <table frame="box"> <tr> <td><h1>Title</h1></td> </tr> <tr> <td align="right"> <b>First Name:</b> </td> <td> <input type="text" value="'; echo formFilter($_GET['firstname']); echo '" name="firstname"></td> <td align="right"> <b>Last Name:</b> </td> <td> <input type="text" value="'; echo formFilter($_GET['lastname']); echo '" name="lastname"></td> </tr> <tr> <td align="right"> <b>City:</b> </td> <td> <input type="text" value="'; echo formFilter($_GET['city']); echo '" name="city"></td> <td align="right"> <b>State:</b> </td> <td> <input type="text" value="'; echo formFilter($_GET['state']); echo '" name="state"></td> </tr> <tr> <td align="right"> <b>Gender:</b> </td> <td colspan="3"> <table align="center" width="100%"> <tr>'; tableData(radioButton("group1", "Male", $_GET["group1"] == "Male", "Male")); tableData(radioButton("group1", "Female", $_GET["group1"] == "Female", "Female")); tableData(radioButton("group1", "Other", $_GET["group1"] == "Other", "Other")); echo ' </tr> </table> </td> </tr> <tr> <td align="right"> <b>Grade:</b> </td> <td colspan="3"> <table align="center" width="100%"> <tr>'; tableData(radioButton("group2", "Nine", $_GET["group2"] == "Nine", "9<sup>th</sup>")); tableData(radioButton("group2", "Ten", $_GET["group2"] == "Ten", "10<sup>th</sup>")); tableData(radioButton("group2", "Eleven", $_GET["group2"] == "Eleven", "11<sup>th</sup>")); tableData(radioButton("group2", "Twelve", $_GET["group2"] == "Twelve", "12<sup>th</sup>")); echo ' </tr> </table> </td> </tr> <tr> <td align="right"> <b>Products:</b> </td> <td colspan="3"> <table align="center" width="100%"> <tr> <td> <input type="checkbox" name="chapr" value="$100"> Chapr </td> <td> <input type="checkbox" name="prog" value="$50"> Programmer </td> <td> <input type="checkbox" name="kit" value="$75"> Kit </td> <td> <input type="checkbox" name="cat" value="$100000"> Cat </td> </tr> </table> </td> </tr> <tr> <td align="right" valign="top"> <b>Comments:</b> </td> <td colspan="3"> <textarea name="comments" style="width: 100%;" rows="4" cols="50">'; echo formFilter($_GET['comments']); echo '</textarea></td> </tr> <tr> <td></td> <td></td> <td></td> <td align="right"><input type="submit" value="Submit"></td> </tr> </table> </form> </body> '; }
echo "active"; } ?> "> <!-- Bill --> <h2>How affordable do you find your electricity?<small></br>Select the statement which best describes the affordability of your electricity.</small> </h2> <?php echo radioButton('1', 'af', 'Not affordable', 'I struggle to pay'); ?> <?php echo radioButton('2', 'af', 'High ', 'I must budget'); ?> <?php echo radioButton('3', 'af', 'Affordable', 'I can pay'); ?> <?php echo radioButton('4', 'af', 'Very affordable', 'I can pay easily'); ?> </div> <div class="item <?php if ($_GET['pp'] == 14) { echo "active"; } ?> "> <!-- Bill --> <h2>Which days would suit you for this trial?<small></br>Pick any days that allow you to install the electricity recorder the day before. Don't worry whether this is a 'typical' day for you.</small> </h2> <?php $date1 = '29 Jan'; ?> <?php $date2 = '1 Feb';