simple_page_mode(true);
//-------------------------------------------------------------------------------------------------
-function can_process()
+function can_process($new)
{
if (strlen($_POST['user_id']) < 4)
return false;
}
- if ($_POST['password'] != "")
+ if (!$new && ($_POST['password'] != ""))
{
if (strlen($_POST['password']) < 4)
{
if (($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM') && check_csrf_token())
{
- if (can_process())
+ if (can_process($Mode == 'ADD_ITEM'))
{
if ($selected_id != -1)
{
}
if ($where) $where = " WHERE ($where)";
- if ($count) {
- $group = $group == '' ? "*" : "DISTINCT $group";
-
- return "SELECT COUNT(*) FROM (SELECT $group FROM $from $where) tmp_count";
- }
+ if ($count)
+ return "SELECT COUNT(*) FROM ($this->sql) tmp_count";
$sql = "$select FROM $from $where";
if ($group) $sql.= " GROUP BY $group";
if(isset($col['ord_priority'])) {
$columns[$col['ord_priority']] = $col;
}
- }
- krsort($columns);
+ }
+ krsort($columns);
foreach ($columns as $col) {
if (isset($col['ord'])) {
}
}
}
-
+
if (count($ord)) {
$ord = array_map(function_exists('mysql_real_escape_string') ?
'mysql_real_escape_string': 'mysql_escape_string', $ord);
function _format_fiscalyears($row)
{
return sql2date($row[1]) . " - " . sql2date($row[2])
- . " " . ($row[3] ? _('Closed') : _('Active')) . "</option>\n";
+ . " " . ($row[3] ? _('Closed') : _('Active'));
}
function fiscalyears_list_cells($label, $name, $selected_id=null)