$ /inventory/manage/sales_kits.php
# Cleaned warnings in errorlog.
$ /sales/includes/sales_db.inc
+! Default 0 on empty amount fields
+$ /includes/data_checks.inc
+! Empty numeric input fields globaly defaulted to 0.
+$ /includes/data_checks.inc
+ /includes/ui/ui_input.inc
15-Jan-2010 Joe Hunt
# [0000190] Back link on confirmation only pages removed.
//
// Numeric input check.
// Return 1 if number has proper form and is within <min, max> range
+// Empty/not defined fields are defaulted to $dflt value.
//
-function check_num($postname, $min=null, $max=null) {
+function check_num($postname, $min=null, $max=null, $dflt=0) {
if(!isset($_POST[$postname]))
return 0;
- $num = input_num($postname);
+ $num = input_num($postname, $dflt);
if ($num === false || $num === null)
return 0;
if (isset($min) && ($num<$min))
//
// Read numeric value from user formatted input
//
-function input_num($postname=null, $dflt=null)
+function input_num($postname=null, $dflt=0)
{
if (!isset($_POST[$postname]) || $_POST[$postname] == "")
return $dflt;