Commit 85e554b2 authored by François Jacquet's avatar François Jacquet
Browse files

Bugifx Invalid argument supplied for foreach()

parent 6dc08998
......@@ -68,11 +68,14 @@ if($_REQUEST['modfunc']=='create')
{
$fields = 'STAFF_ID,BALANCE,TRANSACTION_ID,';
$values = "'".UserStaffID()."','0.00','0',";
foreach($_REQUEST['food_service'] as $column_name=>$value)
{
$fields .= $column_name.',';
$values .= "'".trim($value)."',";
}
if (is_array($_REQUEST['food_service']))
foreach($_REQUEST['food_service'] as $column_name=>$value)
{
$fields .= $column_name.',';
$values .= "'".trim($value)."',";
}
$sql = 'INSERT INTO FOOD_SERVICE_STAFF_ACCOUNTS ('.mb_substr($fields,0,-1).') values ('.mb_substr($values,0,-1).')';
DBQuery($sql);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment