function showCustomerForm($data, $action, $badFields)
{
    formHeader($action, "<h1>Customer Info Form</h1>", "customerForm", "void");
    customerFields($data, $badFields);
    tableRow(array(tableData(""), tableData(""), tableData(""), tableData(""), tableData(""), tableData(submit("Enter/Edit Customer!"), "right")));
    echo getWordpressHiddenFormField();
    formFooter("customerForm");
}
function showPackageForm($data, $action, $badFields)
{
    formHeader($action, "Package Form", "packageForm", "void");
    packageFields($data, $badFields);
    tableRow(array(tableData(""), tableData(""), tableData(""), tableData(""), tableData(""), tableData(submit("Submit!"))));
    echo getWordpressHiddenFormField();
    formFooter("packageForm");
}
function showOrderEntryForm($data, $badFields = array())
{
    formHeader("", "", "orderEntry", "void");
    customerFields($data, $badFields);
    orderFields($data, $badFields);
    if (inWordPress()) {
        echo getWordpressHiddenFormField();
    }
    tableRow(array(tableData(""), tableData(""), tableData(""), tableData(""), tableData(""), tableData(submit("Enter Order!"), "right")));
    formFooter("orderEntryForm");
}
function showShippingForm($data, $action, $badFields = array())
{
    prepDatePicker();
    formHeader($action, "<h1>Shipping Info Form</h1>", "shippingForm", "void");
    shippingFields($data, $badFields);
    tableRow(array(tableData(""), tableData(""), tableData(""), tableData(""), tableData(""), tableData(submit("Enter Shipping Details!"), "right")));
    if (inWordPress()) {
        echo getWordpressHiddenFormField();
    }
    formFooter("shippingForm");
}
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 showOrderForm($data, $action, $badFields = array())
{
    global $SETTINGS;
    formHeader($action, "Order Info Form", "orderForm", "void");
    orderFields($data, $badFields);
    echo getWordpressHiddenFormField();
    tableRow(array(tableData(""), tableData(""), tableData(""), tableData(""), tableData(""), tableData(submit("Enter Order!"), "right")));
    formFooter("orderForm");
}
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>
';
}
Exemplo n.º 8
0
echo "<table width=400px border=5px cellpadding=3px>";
$amount = rand(1, 3);
if ($amount == 1) {
    for ($i = 0; $i < 1; $i++) {
        echo tableRow();
        echo tableData(theRandSentence());
    }
}
if ($amount == 2) {
    for ($i = 0; $i < 2; $i++) {
        echo tableRow();
        echo tableData(theRandSentence());
    }
}
if ($amount == 3) {
    for ($i = 0; $i < 3; $i++) {
        echo tableRow();
        echo tableData(theRandSentence());
    }
}
echo "</table>";
echo '</div>';
?>
<footer id="footer">
			<hr />
			<p> the information included on this page may not be correct, it was created in CST336 &copy; Joshua Smith 2015</p>
			
			<img class="image-with border" src="img/csumb-logo.png" alt="csumb logo" />
</footer>
</body>
</html>
Exemplo n.º 9
0
function showDataSummary($data)
{
    echo '<table class="form" style="width:70%; margin:auto">';
    echo '<tr><td style="width:30%">';
    echo '<h3 style="text-align:center">Original Input:</h3>';
    echo '<table class="form" style="border:1px solid black;">';
    //Gear Ratio
    if (!empty($data["leftSprocketTeeth#Field"]) && !empty($data["rightSprocketTeeth#Field"]) && !empty($data["gearRatioField"])) {
        tableRow(array(tableData(promptWithError("<b>Gear Ratio: </b>", true, "", "", "Gear Ratio overwritten due to both left and right sprocket teeth filled in")), tableData('-')));
    } else {
        if (empty($data["gearRatioField"])) {
            tableRow(array(tableData(prompt("<b>Gear Ratio: </b>")), tableData("(not specified)")));
        } else {
            tableRow(array(tableData(prompt("<b>Gear Ratio: </b>", false)), tableData($data["gearRatioField"], "", "", "", "width:20%")));
        }
    }
    //Center to Center
    tableRow(array(tableData(prompt("<b>Center to Center Distance (mm): </b>")), tableData($data["centerToCenterField"], "", "", "", "width:20%")));
    //Chain Size
    tableRow(array(tableData(prompt("<b>Chain Size: </b>")), tableData(substr($data["chainSizeList"], 5, 2), "width:20%")));
    //Left Sprocket Teeth
    if (empty($data["leftSprocketTeeth#Field"])) {
        tableRow(array(tableData(prompt("<b>Number of Teeth on Sprocket 1: </b>")), tableData("(not specified)")));
    } else {
        tableRow(array(tableData(prompt("<b>Number of Teeth on Sprocket 1: </b>")), tableData($data["leftSprocketTeeth#Field"], "", "", "", "width:20%")));
    }
    //Right Sprocket Teeth
    if (empty($data["rightSprocketTeeth#Field"])) {
        tableRow(array(tableData(prompt("<b>Number of Teeth on Sprocket 2: </b>")), tableData("(not specified)")));
    } else {
        tableRow(array(tableData(prompt("<b>Number of Teeth on Sprocket 2: </b>")), tableData($data["rightSprocketTeeth#Field"], "", "", "", "width:20%")));
    }
    //Desired Slack
    if ($data["desiredSlackField"] == "") {
        tableRow(array(tableData(prompt("<b>Desired Slack (%): </b>")), tableData("(default is 1)")));
    } else {
        tableRow(array(tableData(prompt("<b>Desired Slack (%): </b>")), tableData($data["desiredSlackField"], "", "", "", "width:20%")));
    }
    //Holes
    $holeString = "";
    $keys = array_keys($data);
    $phrase = "holeOption";
    foreach ($keys as $key) {
        $pos = strpos($key, $phrase);
        if ($pos !== false) {
            $holeString .= substr($key, $pos + strlen($phrase) + 1) . ", ";
        }
    }
    $holeString = substr($holeString, 0, -2);
    if (strcmp($holeString, "") == 0) {
        tableRow(array(tableData(prompt("<b>Hub Options: </b>")), tableData("(none specified)")));
    } else {
        tableRow(array(tableData(prompt("<b>Hub Options: </b>")), tableData($holeString)));
    }
    echo '</table></td>';
}