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

Add space after control structures keywords: foreach

Replace "foreach($" with "foreach ( (array)$"
Replace "foreach( " with "foreach ( "
Replace "foreach(array" with "foreach( array"
Replace "foreach(explode" with "foreach ( explode"
parent b5f2b5ee
......@@ -52,7 +52,7 @@ elseif ( isset( $_REQUEST['modfunc'] ) &&
//FJ add help for non-core modules
$not_core_modules = array_diff( array_keys( $RosarioModules ), $RosarioCoreModules );
foreach( $not_core_modules as $not_core_module )
foreach ( (array)$not_core_modules as $not_core_module )
{
$not_core_dir = 'modules/' . $not_core_module . '/';
......@@ -67,7 +67,7 @@ elseif ( isset( $_REQUEST['modfunc'] ) &&
if ( !empty( $_REQUEST['modname'] ) )
{
foreach( $help as $program => $help_txt )
foreach ( (array)$help as $program => $help_txt )
{
//FJ fix bug URL Modules.php?modfunc=help&modname=Student_Billing/Statements.php&_ROSARIO_PDF
if ( $_REQUEST['modname'] === $program ||
......
......@@ -14,7 +14,7 @@ else
//FJ add help for non-core modules
$not_core_modules = array_diff( array_keys( $RosarioModules ), $RosarioCoreModules );
foreach( $not_core_modules as $not_core_module )
foreach ( (array)$not_core_modules as $not_core_module )
{
$not_core_dir = 'modules/' . $not_core_module . '/';
......@@ -60,7 +60,7 @@ $handle = PDFStart();
<HR />
<?php
foreach( $help as $program => $value )
foreach ( (array)$help as $program => $value )
{
$_REQUEST['modname'] = $program;
......
......@@ -95,9 +95,9 @@ else
{
include( 'Menu.php' );
foreach( $_ROSARIO['Menu'] as $modcat => $programs )
foreach ( (array)$_ROSARIO['Menu'] as $modcat => $programs )
{
foreach( $programs as $program => $title )
foreach ( (array)$programs as $program => $title )
{
//FJ fix bug URL Modules.php?modname=Student_Billing/Statements.php&_ROSARIO_PDF
if ( $modname == $program
......
......@@ -84,7 +84,7 @@ function jqPlotChart( $type, $data, $title, $save_image = true )
$seriesLabels = array_keys( $data );
foreach( (array)$seriesLabels as $key => $seriesLabel )
foreach ( (array)$seriesLabels as $key => $seriesLabel )
{
$seriesLabels[$key] = "{label:" . json_encode( $seriesLabel ) . "}";
}
......
......@@ -14,7 +14,7 @@ function MailingLabel($address_id)
if (count($people_RET))
{
foreach($people_RET as $people)
foreach ( (array)$people_RET as $people)
{
$people_total = count($people);
for($i=1;$i<$people_total;$i++)
......
......@@ -359,12 +359,12 @@ function makePublishingVisibleTo($profiles, $THIS_RET, $id)
if (count($teachers_RET))
{
foreach($teachers_RET as $teacher)
foreach ( (array)$teachers_RET as $teacher)
$teachers[$teacher['STAFF_ID']] = $teacher['LAST_NAME'].', '.$teacher['FIRST_NAME'];
}
$i=0;
foreach($profiles as $profile)
foreach ( (array)$profiles as $profile)
{
$i++;
$checked = mb_strpos($THIS_RET['PUBLISHED_PROFILES'],','.$profile['ID'].',')!==false;
......
......@@ -147,7 +147,7 @@ function _makeSelectInput( $column, $name, $request )
if ( $field['SELECT_OPTIONS'] )
$select_options = explode( '<br />', nl2br( $field['SELECT_OPTIONS'] ) );
foreach( (array)$select_options as $option )
foreach ( (array)$select_options as $option )
{
if ( $field['TYPE'] === 'codeds' )
{
......@@ -222,7 +222,7 @@ function _makeAutoSelectInput( $column, $name, $request )
if ( $field['SELECT_OPTIONS'] )
$select_options = explode( '<br />', nl2br( $field['SELECT_OPTIONS'] ) );
foreach( (array)$select_options as $option )
foreach ( (array)$select_options as $option )
{
if ( $option != '' )
$options[$option] = $option;
......@@ -278,7 +278,7 @@ function _makeAutoSelectInput( $column, $name, $request )
$options_RET = DBGet( DBQuery( $options_SQL ) );
foreach( (array)$options_RET as $option )
foreach ( (array)$options_RET as $option )
{
if ( $option['CUSTOM_' . $field['ID']] != ''
&& !$options[$option['CUSTOM_' . $field['ID']]] )
......@@ -423,7 +423,7 @@ function _makeMultipleInput( $column, $name, $request )
if ( $field['SELECT_OPTIONS'] )
$select_options = explode( '<br />', nl2br( $field['SELECT_OPTIONS'] ) );
foreach( (array)$select_options as $option )
foreach ( (array)$select_options as $option )
{
$options[$option] = $option;
}
......@@ -448,7 +448,7 @@ function _makeMultipleInput( $column, $name, $request )
$i = 0;
foreach( (array)$options as $option )
foreach ( (array)$options as $option )
{
if ( $i%2 === 0 )
$table .= '</TR><TR>';
......@@ -646,7 +646,7 @@ function _makeStartInput( $value, $column )
AND TYPE='Add'
ORDER BY SORT_ORDER" ) );
foreach( (array)$options_RET as $option )
foreach ( (array)$options_RET as $option )
{
$add_codes[$option['ID']] = $option['TITLE'];
}
......@@ -704,7 +704,7 @@ function _makeEndInput( $value, $column )
AND TYPE='Drop'
ORDER BY SORT_ORDER" ) );
foreach( (array)$options_RET as $option )
foreach ( (array)$options_RET as $option )
{
$drop_codes[$option['ID']] = $option['TITLE'];
}
......@@ -754,7 +754,7 @@ function _makeSchoolInput( $value, $column )
WHERE SYEAR='" . UserSyear() . "'" ), array(), array( 'ID' ) );
}
foreach( (array)$schools as $sid => $school )
foreach ( (array)$schools as $sid => $school )
{
$options[$sid] = $school[1]['TITLE'];
}
......
......@@ -107,13 +107,13 @@ function _update29()
$SQL_updt_coms = '';
foreach( $comments_RET as $comment )
foreach ( $comments_RET as $comment )
{
$coms = explode( '||', $comment['COMMENT'] );
$ser_coms = array();
$i = 0;
foreach( (array)$coms as $com )
foreach ( (array)$coms as $com )
{
if ( is_array( list( $date, $staff_id ) = explode( '|', $com ) )
&& (int)$staff_id > 0 )
......
......@@ -12,7 +12,7 @@ function _makePercentGrade($grade_id,$course_period_id=0,$staff_id=0)
{
$config_RET = DBGet(DBQuery("SELECT TITLE,VALUE FROM PROGRAM_USER_CONFIG WHERE USER_ID='".$staff_id."' AND PROGRAM='Gradebook'"),array(),array('TITLE'));
if (count($config_RET))
foreach($config_RET as $title=>$value)
foreach ( (array)$config_RET as $title=>$value)
$programconfig[$staff_id][$title] = $value[1]['VALUE'];
else
$programconfig[$staff_id] = true;
......@@ -26,7 +26,7 @@ function _makePercentGrade($grade_id,$course_period_id=0,$staff_id=0)
$_ROSARIO['_makeLetterGrade']['grades'][$grade_scale_id] = DBGet(DBQuery("SELECT TITLE,ID,BREAK_OFF FROM REPORT_CARD_GRADES WHERE SYEAR='".UserSyear()."' AND SCHOOL_ID='".UserSchool()."' AND GRADE_SCALE_ID='".$grade_scale_id."' ORDER BY BREAK_OFF IS NOT NULL DESC,BREAK_OFF DESC,SORT_ORDER"));
//$grades = array('A+','A','A-','B+','B','B-','C+','C','C-','D+','D','D-','F');
foreach($_ROSARIO['_makeLetterGrade']['grades'][$grade_scale_id] as $grade)
foreach ( (array)$_ROSARIO['_makeLetterGrade']['grades'][$grade_scale_id] as $grade)
{
$prev = $crnt;
$crnt = ($does_breakoff=='Y' ? $programconfig[$staff_id][$course_period_id.'-'.$grade['ID']] : $grade['BREAK_OFF']);
......
......@@ -29,7 +29,7 @@ function _makeCalendar($value,$column)
function _makeTeachers($value,$column)
{
foreach(explode('","',mb_substr($value,2,-2)) as $row)
foreach ( explode('","',mb_substr($value,2,-2)) as $row)
$return .= $row.'<BR />';
return mb_substr($return,0,-4);
}
......@@ -318,7 +318,7 @@ $addJavascripts .= 'var menuStudentID = "' . UserStudentID() . '",
<span class="br-after">
<SELECT name="school" onChange="ajaxPostForm(this.form,true);">
<?php foreach( $RET as $school ) : ?>
<?php foreach ( (array)$RET as $school ) : ?>
<OPTION value="<?php echo $school['ID']; ?>"<?php echo ( ( UserSchool() == $school['ID'] ) ? ' SELECTED' : '' ); ?>><?php
echo ( $school['SHORT_NAME'] ? $school['SHORT_NAME'] : $school['TITLE'] );
?></OPTION>
......@@ -349,7 +349,7 @@ $addJavascripts .= 'var menuStudentID = "' . UserStudentID() . '",
<span class="br-after">
<SELECT name="student_id" onChange="ajaxPostForm(this.form,true);">
<?php foreach( (array)$RET as $student ) : ?>
<?php foreach ( (array)$RET as $student ) : ?>
<OPTION value="<?php echo $student['STUDENT_ID']; ?>"<?php echo ( ( UserStudentID() == $student['STUDENT_ID'] ) ? ' SELECTED' : '' ); ?>><?php
echo $student['FULL_NAME'];
?></OPTION>
......@@ -403,9 +403,9 @@ $addJavascripts .= 'var menuStudentID = "' . UserStudentID() . '",
<span class="br-after">
<SELECT name="syear" onChange="ajaxPostForm(this.form,true);">
<?php foreach( $years_RET as $year ) : ?>
<?php foreach ( (array)$years_RET as $year ) : ?>
<OPTION value="<?php echo $year['SYEAR']; ?>"<?php echo ( ( UserSyear() == $year['SYEAR'] ) ? ' SELECTED' : '' ); ?>><?php
echo FormatSyear( $year['SYEAR'], Config('SCHOOL_SYEAR_OVER_2_YEARS') );
echo FormatSyear( $year['SYEAR'], Config( 'SCHOOL_SYEAR_OVER_2_YEARS' ) );
?></OPTION>
<?php endforeach; ?>
</SELECT>
......
<?php
if( !defined( 'WAREHOUSE_PHP' ) )
if ( !defined( 'WAREHOUSE_PHP' ) )
{
define( 'WAREHOUSE_PHP', 1 );
......@@ -73,7 +73,7 @@ if( !defined( 'WAREHOUSE_PHP' ) )
session_start();
// Logout if no Staff or Student session ID
if( empty( $_SESSION['STAFF_ID'] )
if ( empty( $_SESSION['STAFF_ID'] )
&& empty( $_SESSION['STUDENT_ID'] )
&& basename( $_SERVER['SCRIPT_NAME'] ) !== 'index.php' )
{
......@@ -189,7 +189,7 @@ if( !defined( 'WAREHOUSE_PHP' ) )
$RosarioPlugins = unserialize( Config( 'PLUGINS' ) );
// Load plugins functions.
foreach( (array)$RosarioPlugins as $plugin => $activated )
foreach ( (array)$RosarioPlugins as $plugin => $activated )
{
if ( $activated )
include( 'plugins/' . $plugin . '/functions.php' );
......@@ -223,15 +223,15 @@ if( !defined( 'WAREHOUSE_PHP' ) )
|| ( $not_core_plugins = array_diff( array_keys( $RosarioPlugins ), $RosarioCorePlugins ) ) )
{
// load module locale
foreach( $not_core_modules as $not_core_module )
foreach ( (array)$not_core_modules as $not_core_module )
//if module activated
if( $RosarioModules[$not_core_module] )
if ( $RosarioModules[$not_core_module] )
_LoadAddonLocale( $not_core_module, 'modules/' );
// load plugin locale
foreach( $not_core_plugins as $not_core_plugin )
foreach ( (array)$not_core_plugins as $not_core_plugin )
//if plugin activated
if( $RosarioPlugins[$not_core_plugin] )
if ( $RosarioPlugins[$not_core_plugin] )
_LoadAddonLocale( $not_core_plugin, 'plugins/' );
}
......
......@@ -110,7 +110,7 @@ function db_fetch_row( $result )
if ( is_int( $key[$i] ) )
unset( $return[$key[$i]] );
/*foreach($return as $key => $value)
/*foreach ( (array)$return as $key => $value )
{
if (is_int($key))
unset($return[$key]);
......
......@@ -154,7 +154,7 @@ function _ErrorMessage( $errors, $code = 'error' )
$return .= '<ul>';
foreach( $errors as $value )
foreach ( (array)$errors as $value )
$return .= '<LI>' . $value . '</LI>';
$return .= '</ul>';
......
......@@ -80,7 +80,7 @@ function CustomFields( $location, $type = 'student', $extra = array() )
$fields = ParseMLArray( DBGet( DBQuery( "SELECT TITLE,ID,TYPE,SELECT_OPTIONS
FROM " . ( $type === 'staff' ? 'STAFF' : 'CUSTOM' ) . "_FIELDS" ), array(), array( 'ID' ) ), 'TITLE' );
foreach( (array)$cust as $field_name => $value )
foreach ( (array)$cust as $field_name => $value )
{
$field_id = mb_substr( $field_name, 7 );
......@@ -134,7 +134,7 @@ function CustomFields( $location, $type = 'student', $extra = array() )
{
$select_options = explode( '<br />', nl2br( $fields[$field_id][1]['SELECT_OPTIONS'] ) );
foreach( (array)$select_options as $option )
foreach ( (array)$select_options as $option )
{
$option = explode( '|', $option );
......@@ -238,7 +238,7 @@ function CustomFields( $location, $type = 'student', $extra = array() )
}
// Begin Dates / Number
foreach( (array)$cust_begin as $field_name => $value )
foreach ( (array)$cust_begin as $field_name => $value )
{
$field_id = mb_substr( $field_name, 7 );
......@@ -267,7 +267,7 @@ function CustomFields( $location, $type = 'student', $extra = array() )
}
// End Dates / Number
foreach( (array)$cust_end as $field_name => $value )
foreach ( (array)$cust_end as $field_name => $value )
{
$field_id = mb_substr( $field_name, 7 );
......@@ -296,7 +296,7 @@ function CustomFields( $location, $type = 'student', $extra = array() )
}
// No Value for Dates & Number
foreach( (array)$_REQUEST['custn'] as $field_name => $y )
foreach ( (array)$_REQUEST['custn'] as $field_name => $y )
{
$field_id = mb_substr( $field_name, 7 );
......
......@@ -53,7 +53,7 @@ function DBGet( $QI, $functions = array(), $index = array() )
{
$ind = '';
foreach( (array)$index as $col )
foreach ( (array)$index as $col )
{
$ind .= "['" . str_replace( "'", "\'", $THIS_RET[$col] ) . "']";
}
......@@ -72,7 +72,7 @@ function DBGet( $QI, $functions = array(), $index = array() )
else
$s++; // 1-based if no index specified
foreach( (array)$RET as $key => $value )
foreach ( (array)$RET as $key => $value )
{
if ( array_key_exists( $key, $functions )
&& function_exists( $functions[$key] ) )
......
......@@ -182,7 +182,7 @@ function PrepareDate( $date, $name_attr = '', $allow_na = true, $options = array
// Add year / month / day parameters to href
$add_args_js = array();
foreach( (array)$URL_args as $URL_arg )
foreach ( (array)$URL_args as $URL_arg )
{
$add_args_js[] = '(this.form.' . $URL_arg . ' ? \'&' . $URL_arg . '=\' + this.form.' . $URL_arg . '.value : \'\')';
}
......@@ -247,7 +247,7 @@ function PrepareDate( $date, $name_attr = '', $allow_na = true, $options = array
$month_char = MonthNWSwitch( $date_exploded['month'], 'tochar' );
foreach( $months_locale as $key => $name )
foreach ( $months_locale as $key => $name )
$return .= '<option value="' . $key . '"' . ( $month_char == $key ? ' selected' : '' ) . '>' . $name;
$return .= '</select>';
......
......@@ -55,7 +55,7 @@ function ErrorMessage( $errors, $code = 'error' )
{
$return .= '</p><ul>';
foreach( (array)$errors as $error )
foreach ( (array)$errors as $error )
{
$return .= '<LI>' . $error . '</LI>';
}
......
......@@ -114,7 +114,7 @@ function GetAllMP( $mp, $marking_period_id = '0' )
{
case 'PRO':
foreach( (array)$qtr_RET as $qtr )
foreach ( (array)$qtr_RET as $qtr )
{
$qtr_id = $qtr['MARKING_PERIOD_ID'];
......@@ -130,7 +130,7 @@ function GetAllMP( $mp, $marking_period_id = '0' )
case 'QTR':
foreach( (array)$qtr_RET as $qtr )
foreach ( (array)$qtr_RET as $qtr )
{
$qtr_id = $qtr['MARKING_PERIOD_ID'];
......@@ -141,11 +141,11 @@ function GetAllMP( $mp, $marking_period_id = '0' )
case 'SEM':
foreach( (array)$qtr_RET as $sem => $qtrs )
foreach ( (array)$qtr_RET as $sem => $qtrs )
{
$all_mp[$mp][$sem] = "'" . $fy . "','" . $sem . "'";
foreach( (array)$qtrs as $qtr )
foreach ( (array)$qtrs as $qtr )
{
$all_mp[$mp][$sem] .= ",'" . $qtr['MARKING_PERIOD_ID'] . "'";
}
......@@ -153,7 +153,7 @@ function GetAllMP( $mp, $marking_period_id = '0' )
$sem_RET = DBGet( DBQuery( $sem_SQL ) );
foreach( (array)$sem_RET as $sem )
foreach ( (array)$sem_RET as $sem )
{
$sem_id = $sem['MARKING_PERIOD_ID'];
......@@ -167,11 +167,11 @@ function GetAllMP( $mp, $marking_period_id = '0' )
// there should be exactly one fy marking period which better be $marking_period_id
$all_mp[$mp][$marking_period_id] = "'" . $marking_period_id . "'";
foreach( $qtr_RET as $sem => $qtrs )
foreach ( $qtr_RET as $sem => $qtrs )
{
$all_mp[$mp][$marking_period_id] .= ",'" . $sem . "'";
foreach( (array)$qtrs as $qtr )
foreach ( (array)$qtrs as $qtr )
{
$all_mp[$mp][$marking_period_id] .= ",'" . $qtr['MARKING_PERIOD_ID'] . "'";
}
......@@ -179,7 +179,7 @@ function GetAllMP( $mp, $marking_period_id = '0' )
$sem_RET = DBGet( DBQuery( $sem_SQL ) );
foreach( (array)$sem_RET as $sem )
foreach ( (array)$sem_RET as $sem )
{
$all_mp[$mp][$marking_period_id] .= ",'" . $sem['MARKING_PERIOD_ID'] . "'";
}
......@@ -283,11 +283,11 @@ function GetChildrenMP( $mp, $marking_period_id = '0' )
$qtr_RET = DBGet( DBQuery( $qtr_SQL ), array(), array( 'PARENT_ID' ) );
foreach( (array)$qtr_RET as $sem => $qtrs )
foreach ( (array)$qtr_RET as $sem => $qtrs )
{
$children_mp[$mp]['0'] .= ",'" . $sem . "'";
foreach( (array)$qtrs as $qtr )
foreach ( (array)$qtrs as $qtr )
{
$children_mp[$mp]['0'] .= ",'" . $qtr['MARKING_PERIOD_ID'] . "'";
}
......@@ -303,9 +303,9 @@ function GetChildrenMP( $mp, $marking_period_id = '0' )
$qtr_RET = DBGet( DBQuery( $qtr_SQL ), array(), array( 'PARENT_ID' ) );
foreach( (array)$qtr_RET as $sem => $qtrs )
foreach ( (array)$qtr_RET as $sem => $qtrs )
{
foreach( (array)$qtrs as $qtr )
foreach ( (array)$qtrs as $qtr )
{
$children_mp[$mp][$sem] .= ",'" . $qtr['MARKING_PERIOD_ID'] . "'";
}
......@@ -329,9 +329,9 @@ function GetChildrenMP( $mp, $marking_period_id = '0' )
AND SYEAR='" . UserSyear() . "'
AND SCHOOL_ID='" . UserSchool() . "'"), array(), array( 'PARENT_ID' ) );
foreach( (array)$pro_RET as $qtr => $pros )
foreach ( (array)$pro_RET as $qtr => $pros )
{
foreach( (array)$pros as $pro )
foreach ( (array)$pros as $pro )
{
$children_mp[$mp][$qtr] .= ",'" . $pro['MARKING_PERIOD_ID'] . "'";
}
......
......@@ -24,7 +24,7 @@ function GetStaffList(& $extra)
WHERE ((SELECT VALUE FROM PROGRAM_USER_CONFIG WHERE TITLE=cast(cf.ID AS TEXT) AND PROGRAM='StaffFieldsView' AND USER_ID='".User('STAFF_ID')."')='Y'".($extra['staff_fields']['view']?" OR cf.ID IN (".$extra['staff_fields']['view'].")":'').")
ORDER BY cf.SORT_ORDER,cf.TITLE"));
foreach($view_fields_RET as $field)
foreach ( (array)$view_fields_RET as $field)
{
$extra['columns_after']['CUSTOM_'.$field['ID']] = $field['TITLE'];
if ($field['TYPE']=='date')
......@@ -47,7 +47,7 @@ function GetStaffList(& $extra)
if ($extra['staff_fields']['view'])
{
$view_fields_RET = DBGet(DBQuery("SELECT cf.ID,cf.TYPE,cf.TITLE FROM STAFF_FIELDS cf WHERE cf.ID IN (".$extra['staff_fields']['view'].") ORDER BY cf.SORT_ORDER,cf.TITLE"));
foreach($view_fields_RET as $field)
foreach ( (array)$view_fields_RET as $field)
{
$extra['columns_after']['CUSTOM_'.$field['ID']] = $field['TITLE'];
if ($field['TYPE']=='date')
......
......@@ -42,7 +42,7 @@ function GetStuList(&$extra=array())
$extra['columns_after'] = array('ADDRESS'=>_('Mailing Address'),'CITY'=>_('City'),'STATE'=>_('State'),'ZIPCODE'=>_('Zipcode')) + $extra['columns_after'];
$custom_fields_RET = DBGet(DBQuery("SELECT ID,TITLE,TYPE FROM CUSTOM_FIELDS WHERE ID IN (200000000, 200000001)"));
$select = '';
foreach($custom_fields_RET as $field)
foreach ( (array)$custom_fields_RET as $field)
{
$extra['columns_after'] = array('CUSTOM_'.$field['ID']=>ParseMLField($field['TITLE'])) + $extra['columns_after'];
// if gender and ethnicity are converted to codeds or exports type
......@@ -107,7 +107,7 @@ function GetStuList(&$extra=array())
$_REQUEST['expanded_view'] = $expanded_view;
$_REQUEST['addr'] = $addr;
}
foreach($view_fields_RET as $field)
foreach ( (array)$view_fields_RET as $field)
{
$extra['columns_after']['CUSTOM_'.$field['ID']] = $field['TITLE'];
if ($field['TYPE']=='date')
......@@ -161,7 +161,7 @@ function GetStuList(&$extra=array())
$extra['columns_after'] = array();
$view_fields_RET = DBGet(DBQuery("SELECT cf.ID,cf.TYPE,cf.TITLE FROM CUSTOM_FIELDS cf WHERE cf.ID IN (".$extra['student_fields']['view'].") ORDER BY cf.SORT_ORDER,cf.TITLE"));
foreach($view_fields_RET as $field)
foreach ( (array)$view_fields_RET as $field)
{
$extra['columns_after']['CUSTOM_'.$field['ID']] = $field['TITLE'];
if ($field['TYPE']=='date')
......@@ -328,7 +328,7 @@ function makeContactInfo($student_id,$column)
if (count($contacts_RET[$student_id]))
{
foreach($contacts_RET[$student_id] as $person)
foreach ( (array)$contacts_RET[$student_id] as $person)
{
if ($person[1]['FIRST_NAME'] || $person[1]['LAST_NAME'])
$tipmessage .= $person[1]['STUDENT_RELATION'].': '.$person[1]['FIRST_NAME'].' '.$person[1]['LAST_NAME'].'<BR />';
......@@ -337,7 +337,7 @@ function makeContactInfo($student_id,$column)
if ($person[1]['PHONE'])
$tipmessage .= '<TR><TD><span class="legend-gray">'._('Home Phone').'</span> </TD><TD>'.$person[1]['PHONE'].'</TD></TR>';
foreach($person as $info)
foreach ( (array)$person as $info)
{
if ($info['TITLE'] || $info['VALUE'])
$tipmessage .= '<TR><TD><span class="legend-gray">'.$info['TITLE'].'</span></TD><TD>'.$info['VALUE'].'</TD></TR>';
......@@ -409,7 +409,7 @@ function makeParents($student_id,$column)
if (count($people_RET))
{
$THIS_RET['PARENTS'] .= '<TABLE class="cellspacing-0">';
foreach($people_RET as $person)
foreach ( (array)$people_RET as $person)
{
//FJ PrintClassLists with all contacts
if ($person['CUSTODY']=='Y')
......@@ -491,7 +491,7 @@ function appendSQL($sql,$extra=array())
$_ROSARIO['SearchTerms'] .= '<b>'.ngettext('Grade','Grades',sizeof($_REQUEST['grades'])).': </b>'.($_REQUEST['grades_not']=='Y'?_('Excluded').' ':'');
$list = $sep = '';
foreach($_REQUEST['grades'] as $id=>$y)
foreach ( (array)$_REQUEST['grades'] as $id=>$y)
{
$list .= $sep."'".$id."'";
......
......@@ -339,7 +339,7 @@ function SelectInput($value,$name,$title='',$options=array(),$allow_na='N/A',$ex
}
if (count($options))
{