[Cwispy-devel] cwispy2/admin configuration.php, 1.30, 1.31 cwispy.php, 1.65, 1.66 man_customer.php,
Status: Abandoned
Brought to you by:
cwispy
From: Martin J. G. <mor...@us...> - 2008-03-13 19:24:31
|
Update of /cvsroot/cwispy/cwispy2/admin In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv18772 Modified Files: configuration.php cwispy.php man_customer.php man_event.php man_paymenttype.php man_paypal.php man_resourcepackages.php showprofile.php Log Message: some html tidyup to fix validation Index: man_event.php =================================================================== RCS file: /cvsroot/cwispy/cwispy2/admin/man_event.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- man_event.php 30 Nov 2007 13:31:33 -0000 1.13 +++ man_event.php 13 Mar 2008 19:24:27 -0000 1.14 @@ -153,7 +153,7 @@ $type_row = $type_result->fetchRow(); echo "<option value=\"".$type_row["eventtypeid"]; if ($type_row["eventtypeid"] == $event_row["eventtypeid"]) { - echo "\" selected>".$type_row["eventtype"]."</option>"; + echo "\" selected=\"selected\">".$type_row["eventtype"]."</option>"; } else { echo "\">".$type_row["eventtype"]."</option>"; Index: man_customer.php =================================================================== RCS file: /cvsroot/cwispy/cwispy2/admin/man_customer.php,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- man_customer.php 13 Mar 2008 18:05:12 -0000 1.36 +++ man_customer.php 13 Mar 2008 19:24:27 -0000 1.37 @@ -15,7 +15,11 @@ if(isset($_POST['updater']) && ($_POST['updater'] == "customer")) { /* Clean up input */ + if (isset($_POST['billtype'])) { /* If bill types haven't been configured, this will be null */ $billtype = addslashes(strip_tags($_POST['billtype'])); + } else { + $billtype = null; + } $first = addslashes(strip_tags($_POST['first'])); $mid = addslashes(strip_tags($_POST['mid'])); $last = addslashes(strip_tags($_POST['last'])); @@ -31,7 +35,11 @@ $email = addslashes(strip_tags($_POST['email'])); $state = addslashes(strip_tags($_POST['state'])); $zip = addslashes(strip_tags($_POST['zip'])); + if (isset($_POST['taxinfoid'])) { /* If tax types haven't been configured, this will be null */ $taxinfoid = addslashes(strip_tags($_POST['taxinfoid'])); + } else { + $taxinfoid = null; + } $ccnum = addslashes(strip_tags($_POST['ccnum'])); $ccmonth = addslashes(strip_tags($_POST['ccmonth'])); $ccyear = addslashes(strip_tags($_POST['ccyear'])); @@ -137,8 +145,11 @@ echo "</table>\n"; die; } - + if (isset($_POST['billtype'])) { /* If bill types haven't been configured, this will be null */ $billtypeid = $_POST['billtypeid']; + } else { + $billtypeid= null; + } $customertype = $_POST['customertype']; $first = strip_tags(addslashes($_POST['first'])); $mid = strip_tags(addslashes($_POST['mid'])); @@ -159,6 +170,11 @@ $ccname = strip_tags(addslashes($_POST['ccname'])); $companynumber = strip_tags(addslashes($_POST['companynumber'])); $vatnumber = strip_tags(addslashes($_POST['vatnumber'])); + if (isset($_POST['taxinfoid'])) { /* If tax types haven't been configured, this will be null */ + $taxinfoid = $_POST[taxinfoid]; + } else { + $taxinfoid = null; + } /* Check if we want to use cleartext or encrypted passwords */ if (SAFEPASSWORD == 1) { @@ -178,7 +194,7 @@ if (PEAR::isError($result = $db->query("INSERT INTO customers (customerid, billtypeid, customertype, first, mid, last, company, address, city, state, zip, taxid, country, telephone, fax, mobile, email, password, ccnumber, ccmonth, ccyear, ccname, companynumber, vatnumber, closed, inv_type) VALUES ('$id', '$billtypeid', '$customertype', '$first', '$mid', '$last', '$company', - '$address', '$city', '$state', '$zip', '$_POST[taxinfoid]', '$country', '$phone', '$fax', '$mobile', '$email', + '$address', '$city', '$state', '$zip', '$taxinfoid', '$country', '$phone', '$fax', '$mobile', '$email', '$cryptedpass', '$ccnum', '$ccmonth', '$ccyear', '$ccname', '$companynumber', '$vatnumber', 'Open', '$_POST[inv_type]')"))) { echo $result->getDebugInfo(); @@ -198,10 +214,13 @@ { echo $bill_result->getDebugInfo(); } + $bill_numrows = $bill_result->numRows(); + if (PEAR::isError($taxresult = $db->query("SELECT * FROM taxinfo"))) { echo $taxresult->getDebugInfo(); } + $tax_numrows = $taxresult->numRows(); $myrow = $result->fetchRow(); @@ -255,10 +274,13 @@ <?php echo "<tr class='small'><td><span style='color: #FF0000;font-weight: bold' id='error'></span></td></tr>"; makeDropBox($lStatus, 'closed', $myrow['closed'], "Open", "Closed"); - echo "<tr class='small'> <td><b>".$lBillTypeId.":</b></td><td>\n"; makeHiddenField("updater", "customer"); makeHiddenField("custid", $myrow['customerid']); makeHiddenField('oldpassword', $myrow['password']); + + if ($bill_numrows > 0) { /* If billtype is null, it create an empty select which causes html errors */ + echo "<tr class='small'> <td><b>".$lBillTypeId.":</b></td><td>\n"; + echo "<select name='billtype'>\n"; while ($bill_row = $bill_result->fetchRow()) { print("<option Value='".$bill_row['billtypeid']."'"); @@ -269,6 +291,9 @@ } print("</select></td>"); + } + + if ($tax_numrows > 0) { /* If tax types haven't been configured, it create an empty select which causes html errors */ echo "<tr class='small'> <td><b>".$lTaxType.":</b></td><td><select name='taxinfoid'>\n"; while($tax_row = $taxresult->fetchRow()){ print("<option Value='".$tax_row['taxinfoid']."'"); @@ -278,7 +303,7 @@ print(">".$tax_row['taxtag']." (".$tax_row['description']." ".$tax_row['quantity']."%)"); } print("</select></td></tr>"); - + } if(PEAR::isError($type_result = $db->query("SELECT * from customertype"))) exit ('$lDBError :' . $type_result->getDebugInfo()); @@ -390,6 +415,9 @@ openForm("Customer", $_SERVER['PHP_SELF'], "return CheckForm(this)"); beginPrettyTable("2", $lEnterCustomer); +$bill_numrows = $bill_result->numRows(); + + if ($bill_numrows > 0) { /* If billtype is null, it create an empty select which causes html errors */ print("<tr class='small'><td><b>$lBillTypeId</b></td>"); print("<td><input type='hidden' name='action' value=\"newuser\" />\n <select name='billtypeid'>"); @@ -397,17 +425,22 @@ print("<option Value='$bill_row[billtypeid]'>$bill_row[billname]"); } print("</select></td></tr>"); - print("<tr class='small'><td><b>$lTaxType</b></td><td><select name='taxinfoid'>"); - + } + if (PEAR::isError($taxresult = $db->query("SELECT * FROM taxinfo"))) - { - echo $taxresult->getDebugInfo(); - } + { + echo $taxresult->getDebugInfo(); + } +$tax_numrows = $taxresult->numRows(); + + if ($tax_numrows > 0) { /* If tax types haven't been configured, it will display an empty select which causes html errors */ + print("<tr class='small'><td><b>$lTaxType</b></td><td><select name='taxinfoid'>"); + while($tax_row = $taxresult->fetchRow()){ print("<option Value='$tax_row[taxinfoid]'>$tax_row[taxtag] ($tax_row[description] $tax_row[quantity]%)"); } print("</select></td></tr>"); - + } if (PEAR::isError($type_result = $db->query("SELECT * from customertype"))) exit ( $lDBerror .' '. $type_result->getDebugInfo()); @@ -443,6 +476,7 @@ makeTextField($lMobile, "mobile", ""); /* Let's check this email doesn't exist in the database already */ + echo "<tr class='small'><td>\n"; ?> <script type="text/javascript">function checkemail(email) { var xmlHttp; @@ -461,8 +495,7 @@ </script> <?php - echo "<tr class='small'>\n"; - echo " <td><b>".$lEmail.":</b></td>\n"; + echo " <b>".$lEmail.":</b></td>\n"; echo " <td><input name='email' type='text' onchange=\"checkemail(this.form.email.value);\" /><span id=\"email_label\"></span></td>\n"; echo "</tr>\n"; /* makeTextField($lEmail, "email", ""); */ Index: man_paypal.php =================================================================== RCS file: /cvsroot/cwispy/cwispy2/admin/man_paypal.php,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- man_paypal.php 25 Nov 2007 12:28:44 -0000 1.15 +++ man_paypal.php 13 Mar 2008 19:24:27 -0000 1.16 @@ -105,32 +105,32 @@ makeTextField($lEmail, "email", $paypal_row['email']); echo "<tr class='small'><td><b>Currency: </b></td><td><select name='currency'>\n"; if ($paypal_row['currency'] == "GBP") { - echo "<option value='GBP' selected>$lPounds</option>\n"; + echo "<option value='GBP' selected=\"selected\">$lPounds</option>\n"; } else { echo "<option value='GBP'>$lPounds</option>\n"; } if ($paypal_row['Currency'] == "CAD") { - echo "<option value='CAD' selected>Canadian Dollars</option>\n"; + echo "<option value='CAD' selected=\"selected\">Canadian Dollars</option>\n"; } else { echo "<option value='CAD'>Canadian Dollars</option>\n"; } if ($paypal_row['currency'] == "EUR") { - echo "<option value='EUR' selected>Euros</option>\n"; + echo "<option value='EUR' selected=\"selected\">Euros</option>\n"; } else { echo "<option value='EUR'>Euros</option>\n"; } if ($paypal_row['currency'] == "JPY") { - echo "<option value='JPY' selected>Japanese Yen</option>\n"; + echo "<option value='JPY' selected=\"selected\">Japanese Yen</option>\n"; } else { echo "<option value='JPY'>Japanese Yen</option>\n"; } if ($paypal_row['currency'] == "USD") { - echo "<option value='USD' selected>US Dollars</option>\n"; + echo "<option value='USD' selected=\"selected\">US Dollars</option>\n"; } else { echo "<option value='USD'>US Dollars</option>\n"; } if ($paypal_row['currency'] == "AUD") { - echo "<option value='AUD' selected>Australian Dollars</option>\n"; + echo "<option value='AUD' selected=\"selected\">Australian Dollars</option>\n"; } else { echo "<option value='AUD'>Australian Dollars</option>\n"; } Index: configuration.php =================================================================== RCS file: /cvsroot/cwispy/cwispy2/admin/configuration.php,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- configuration.php 25 Nov 2007 12:28:42 -0000 1.30 +++ configuration.php 13 Mar 2008 19:24:27 -0000 1.31 @@ -28,12 +28,16 @@ /* We have to filter user input */ $smtpserver = strip_tags($_POST['smtpserver']); - $smtpauth = null; $smtpauth = strip_tags($_POST['smtpauth']); - $smtpuser = null; + + if ($smtpauth == "Yes") { $smtpuser = strip_tags($_POST['smtpuser']); - $smtppass = null; $smtppass = strip_tags($_POST['smtppass']); + } else { + $smtpuser = null; + $smtppass = null; + } + $state = strip_tags($_POST['state']); $country = strip_tags($_POST['country']); $ticketnotifier = strip_tags($_POST['ticketnotifier']); @@ -80,6 +84,7 @@ /* We're going to dynamically display the right options, depending on whether smtpauth is enabled * TODO: write functions for these */ + echo "<tr class='small'> <td>\n"; ?> <script type="text/javascript">function displayfields(smtpauth) { @@ -101,7 +106,7 @@ <?php - echo "<tr class='small'> <td><b>$lSmtpAuth:</b></td><td>"; + echo "<b>$lSmtpAuth:</b></td><td>"; echo "<select name='smtpauth' onchange=\"displayfields(this.form.smtpauth.value);\">\n"; echo "<option value='Yes' "; if ($myrow['smtpauth'] == "Yes") { Index: showprofile.php =================================================================== RCS file: /cvsroot/cwispy/cwispy2/admin/showprofile.php,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- showprofile.php 30 Nov 2007 13:31:33 -0000 1.56 +++ showprofile.php 13 Mar 2008 19:24:27 -0000 1.57 @@ -766,17 +766,17 @@ echo "<select name='display'>\n"; echo "<option value='open'"; if (isset($_POST['display']) && ($_POST['display'] == "open")) { - echo " selected"; + echo " selected=\"selected\""; } echo ">Open</option>\n"; echo "<option value='closed'"; if (isset($_POST['display']) && ($_POST['display'] == "closed")) { - echo " selected"; + echo " selected=\"selected\""; } echo ">Closed</option>\n"; echo "<option value='all'"; if (isset($_POST['display']) && ($_POST['display'] == "all")) { - echo " selected"; + echo " selected=\"selected\""; } echo ">All</option>\n"; echo "</select>\n"; Index: man_paymenttype.php =================================================================== RCS file: /cvsroot/cwispy/cwispy2/admin/man_paymenttype.php,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- man_paymenttype.php 25 Nov 2007 12:28:44 -0000 1.18 +++ man_paymenttype.php 13 Mar 2008 19:24:27 -0000 1.19 @@ -90,7 +90,7 @@ echo ("</tr>\n"); while ($type_row = $type_result->fetchRow()) { if( isset($class) && ($class == "odd")) { $class = "even"; } else { $class = "odd"; } - printf("<tr class=$class>\n"); + printf("<tr class=\"$class\">\n"); printf("<td>%s</td>\n", $type_row["paymenttypeid"]); printf("<td>%s</td>\n", $type_row["paymenttype"]); printf("<td>\n<form action=\"".$_SERVER['PHP_SELF']."\" method=\"post\">\n"); Index: man_resourcepackages.php =================================================================== RCS file: /cvsroot/cwispy/cwispy2/admin/man_resourcepackages.php,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- man_resourcepackages.php 25 Nov 2007 12:28:44 -0000 1.19 +++ man_resourcepackages.php 13 Mar 2008 19:24:27 -0000 1.20 @@ -136,7 +136,7 @@ $id = $itemrow['resourceitemid']; echo "<option value=\"$id\"\n"; if ($itemrow['resourceitemid'] == $rrow['resourceitemid']) { - echo " selected"; + echo " selected=\"selected\""; } printf(">$itemrow[name]\n"); } @@ -154,7 +154,7 @@ printf("<option Value='$itemrow[resourceitemid]'"); printf(">$itemrow[name]\n"); } - printf("<option Value='new' selected> "); + printf("<option Value='new' selected=\"selected\"> "); printf("</Select>\n"); makeSubmitter(); echo "</table>\n"; Index: cwispy.php =================================================================== RCS file: /cvsroot/cwispy/cwispy2/admin/cwispy.php,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- cwispy.php 30 Nov 2007 13:27:30 -0000 1.65 +++ cwispy.php 13 Mar 2008 19:24:27 -0000 1.66 @@ -66,7 +66,7 @@ echo ">"; for ($d=1; $d <= 31; $d++) { echo "<option value='$d'"; - if ($d == $day) { echo "selected"; } + if ($d == $day) { echo "selected=\"selected\""; } echo ">$d</option>\n"; } echo "</select>\n"; @@ -78,7 +78,7 @@ echo ">"; for ($m=1; $m <= 12; $m++) { echo "<option value='$m' "; - if ($m == $month) { echo "selected"; } + if ($m == $month) { echo "selected=\"selected\""; } echo ">$m</option>\n"; } echo "</select>\n"; @@ -91,7 +91,7 @@ echo ">"; for ($y=$year-10; $y <= $year+10; $y++) { echo "<option value='$y' "; - if ($y == $year) { echo "selected"; } + if ($y == $year) { echo "selected=\"selected\""; } echo ">$y</option>\n"; } echo "</select>\n"; @@ -389,7 +389,7 @@ if (($onsubmit == "") || (!isset($onsubmit))) { echo "<form method='post' name='$name' action='$action'>\n"; } else { - echo "<form method='post' onSubmit='$onsubmit' name='$name' action='$action'>\n"; + echo "<form method='post' onsubmit='$onsubmit' name='$name' action='$action'>\n"; } } # name: makeHiddenField @@ -613,7 +613,7 @@ $country_array = array( "Afghanistan", "Algeria", "Andorra", "Angola", "Anguila", "Antigua", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "The Bahamas", "Bahrain", "Bangladesh", "Barbados", "Barbuda", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bolivia", "Bosnia", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", - "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Columbia", "Congo", "DR Congo", "Cook Islands", "Costa Rica", "Cote D\'Ivoire", + "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Columbia", "Congo", "DR Congo", "Cook Islands", "Costa Rica", "Cote D´Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Dijbouti", "Dominica", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Estonia", "Ethiopia", "Faroe Islands", "Fiji Islands", "Finland", "France", "French Guiana", "French Polynesia", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Herzegovina", @@ -987,7 +987,7 @@ * Desc: displays the CSS validator link & logo */ function validcss() { - echo "<a href='http://jigsaw.w3.org/css-validator/'>"; + echo "<a href='http://jigsaw.w3.org/css-validator/check?uri=referer'>"; echo "<img src='http://jigsaw.w3.org/css-validator/images/vcss' "; echo "class='valid' alt='Valid CSS!' /></a>\n"; } /* End of validcss() */ |