}
return $numeric ? -1 : null;
}
+
//------------------------------------------------------------------------------
//
// Helper function for simple db table editor pages
'selector' - ditto with closing current popup editor window
'cancel' - cancel form entry on Escape press; dflt ICON_CANCEL
'process' - displays progress bar during call; optional icon
-
+ 'nonajax' - ditto, non-ajax submit
$atype can contain also multiply type selectors separated by space,
however make sense only combination of 'process' and one of defualt/selector/cancel
*/
case 'cancel':
if ($icon===false) $icon=ICON_ESCAPE; break;
+
+ case 'nonajax':
+ $atype = false;
}
}
}
}
//-----------------------------------------------------------------------------------
-function radio($label, $name, $value, $selected, $submit_on_change=false) {
+function radio($label, $name, $value, $selected=null, $submit_on_change=false)
+{
+ if (!isset($selected))
+ $selected = get_post($name) == $value;
if ($submit_on_change === true)
$submit_on_change =
}
}
if ($use_date_picker)
+ {
+ $calc_image = (file_exists("$path_to_root/themes/".user_theme()."/images/cal.gif")) ?
+ "$path_to_root/themes/".user_theme()."/images/cal.gif" : "$path_to_root/themes/default/images/cal.gif";
$post_label = "<a tabindex='-1' href=\"javascript:date_picker(document.getElementsByName('$name')[0]);\">"
- . " <img src='$path_to_root/themes/default/images/cal.gif' width='16' height='16' border='0' alt='"._('Click Here to Pick up the date')."'></a>\n";
+ . " <img src='$calc_image' width='16' height='16' border='0' alt='"._('Click Here to Pick up the date')."'></a>\n";
+ }
else
$post_label = "";
echo "<td>";
- $class = $submit_on_change ? 'class="searchbox"' : '';
+ $class = $submit_on_change ? 'date active' : 'date';
$aspect = $check ? 'aspect="cdate"' : '';
if ($check && (get_post($name) != Today()))
$aspect .= ' style="color:#FF0000"';
default_focus($name);
-
- echo "<input type=\"text\" name=\"$name\" $class $aspect size=\"9\" maxlength=\"12\" value=\""
+ $size = (user_date_format()>3)?11:10;
+ echo "<input type=\"text\" name=\"$name\" class=\"$class\" $aspect size=\"$size\" maxlength=\"12\" value=\""
. $_POST[$name]. "\""
.($title ? " title='$title'": '')." > $post_label";
echo "</td>\n";
get_post('Update')) && (check_value('Inactive'.$id) != $value)) {
update_record_status($id, !$value, $table, $key);
}
- echo '<td align="center">'. checkbox(null, $name, $value, true, '', "align='center'")
+ echo '<td align="center">'. checkbox(null, $name, $value, true, '')
. hidden("LInact[$id]", $value, false) . '</td>';
}
}
."</a>", $parms);
}
+function bank_balance_row($bank_acc, $parms='')
+{
+ global $path_to_root;
+
+ $to = add_days(Today(), 1);
+ $bal = get_balance_before_for_bank_account($bank_acc, $to);
+ label_row( _("Bank Balance:"),
+ "<a target='_blank' " . ($bal<0 ? 'class="redfg"' : '')
+ ."href='$path_to_root/gl/inquiry/bank_inquiry.php?bank_account=".$bank_acc."'"
+ ." onclick=\"javascript:openWindow(this.href,this.target); return false;\" > "
+ . price_format($bal)
+ ."</a>", $parms);
+}
+
?>
\ No newline at end of file