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

Rename getDisplayNameSQL & getDisplayName functions to DisplayNameSQL & DisplayName

parent 40a7936a
......@@ -7,9 +7,9 @@ Changes in 3.7-beta
- INSERT INTO case to Replace empty strings ('') with NULL values in database.inc.php
- #218 Add DISPLAY_NAME to CONFIG table in rosariosis.sql & Update.fnc.php
- Fix #221 Delete Addresses & Contacts info does not delete student in Student.php & Address.inc.php
- #218 Add getDisplayNameSQL() & getDisplayName() functions in GetStuList.fnc.php
- #218 Add DisplayNameSQL() & DisplayName() functions in GetStuList.fnc.php
- #218 Add Display Name option in Configuration.php
- #218 Use getDisplayName & getDisplayNameSQL functions programwide
- #218 Use DisplayName & DisplayNameSQL functions programwide
Changes in 3.6.1
----------------
......
......@@ -128,7 +128,7 @@ if ( isset( $_REQUEST['h'] )
{
// Select Staff where last login > now.
$staff_RET = DBGet( DBQuery( "SELECT STAFF_ID AS ID, USERNAME, PASSWORD, EMAIL,
" . getDisplayNameSQL() . " AS FULL_NAME, LAST_LOGIN, PROFILE_ID
" . DisplayNameSQL() . " AS FULL_NAME, LAST_LOGIN, PROFILE_ID
FROM STAFF
WHERE LAST_LOGIN > CURRENT_TIMESTAMP
AND SYEAR='" . Config( 'SYEAR' ) . "'" ) );
......@@ -156,7 +156,7 @@ if ( isset( $_REQUEST['h'] )
// Select Students where last login > now & enrolled.
$student_RET = DBGet( DBQuery( "SELECT s.STUDENT_ID AS ID, s.USERNAME, s.PASSWORD,
s." . $custom_field . " AS EMAIL,
" . getDisplayNameSQL( 's' ) . " AS FULL_NAME, s.LAST_LOGIN
" . DisplayNameSQL( 's' ) . " AS FULL_NAME, s.LAST_LOGIN
FROM STUDENTS s, STUDENT_ENROLLMENT se
WHERE s.LAST_LOGIN > CURRENT_TIMESTAMP
AND se.SYEAR='" . Config( 'SYEAR' ) . "'
......@@ -336,7 +336,7 @@ function _sendPasswordResetEmail( $user_id, $user_type = 'staff', $email )
{
// Get Staff email, password.
$staff_RET = DBGet( DBQuery( "SELECT USERNAME, PASSWORD,
" . getDisplayNameSQL() . " AS FULL_NAME
" . DisplayNameSQL() . " AS FULL_NAME
FROM STAFF
WHERE STAFF_ID='" . $user_id . "'
AND SYEAR='" . Config( 'SYEAR' ) . "'" ) );
......@@ -351,7 +351,7 @@ function _sendPasswordResetEmail( $user_id, $user_type = 'staff', $email )
{
// Get Student username, password, name.
$student_RET = DBGet( DBQuery( "SELECT USERNAME,PASSWORD,
" . getDisplayNameSQL( 's' ) . " AS FULL_NAME
" . DisplayNameSQL( 's' ) . " AS FULL_NAME
FROM STUDENTS s,STUDENT_ENROLLMENT ssm
WHERE s.STUDENT_ID='" . $user_id . "'
AND s.STUDENT_ID=ssm.STUDENT_ID
......@@ -508,7 +508,7 @@ function _notifyServerAdminPasswordReset( $user_id )
return false;
}
$staff_RET = DBGet( DBQuery( "SELECT USERNAME," . getDisplayNameSQL() . " AS FULL_NAME,PROFILE
$staff_RET = DBGet( DBQuery( "SELECT USERNAME," . DisplayNameSQL() . " AS FULL_NAME,PROFILE
FROM STAFF
WHERE STAFF_ID='" . $user_id . "'
AND SYEAR='" . Config( 'SYEAR' ) . "'" ) );
......
......@@ -53,7 +53,7 @@ function MailingLabel( $address_id )
$return .= $people[ $i ]['FIRST_NAME'] . ' & ';
}
$return .= getDisplayName(
$return .= DisplayName(
$people[ $i ]['FIRST_NAME'],
$people[ $i ]['LAST_NAME'],
$people[ $i ]['MIDDLE_NAME']
......
......@@ -434,7 +434,7 @@ function makePublishingVisibleTo( $profiles, $THIS_RET, $id )
<tr class="st">';
// FJ Portal Polls add students teacher.
$teachers_RET = DBGet( DBQuery( "SELECT STAFF_ID," . getDisplayNameSQL() . " AS FULL_NAME
$teachers_RET = DBGet( DBQuery( "SELECT STAFF_ID," . DisplayNameSQL() . " AS FULL_NAME
FROM STAFF
WHERE (SCHOOLS IS NULL OR STRPOS(SCHOOLS,'," . UserSchool() . ",')>0)
AND SYEAR='" . UserSyear() . "'
......
......@@ -31,7 +31,7 @@ function Update()
* Prevent DB version update if new Update.fnc.php file has NOT been uploaded YET.
* Update must be run once both new Warehouse.php & Update.fnc.php files are uploaded.
*/
if ( version_compare( '3.6.1', ROSARIO_VERSION, '<' ) )
if ( version_compare( '3.7-beta', ROSARIO_VERSION, '<' ) )
{
return false;
}
......@@ -762,7 +762,7 @@ function _update37beta()
if ( ! $display_name_added )
{
DBQuery( "INSERT INTO config VALUES (0, 'DISPLAY_NAME', 'FIRST_NAME||'' ''||LAST_NAME');" );
DBQuery( "INSERT INTO config VALUES (0, 'DISPLAY_NAME', 'FIRST_NAME||coalesce('' ''||MIDDLE_NAME||'' '','' '')||LAST_NAME');" );
}
return $return;
......
......@@ -363,7 +363,7 @@ $addJavascripts .= 'var menuStudentID = "' . UserStudentID() . '",
if ( User( 'PROFILE' ) === 'parent' ) :
$students_RET = DBGet( DBQuery( "SELECT sju.STUDENT_ID,
" . getDisplayNameSQL( 's' ) . " AS FULL_NAME,se.SCHOOL_ID
" . DisplayNameSQL( 's' ) . " AS FULL_NAME,se.SCHOOL_ID
FROM STUDENTS s,STUDENTS_JOIN_USERS sju,STUDENT_ENROLLMENT se
WHERE s.STUDENT_ID=sju.STUDENT_ID
AND sju.STAFF_ID='" . User( 'STAFF_ID' ) . "'
......@@ -659,7 +659,7 @@ $addJavascripts .= 'var menuStudentID = "' . UserStudentID() . '",
&& ( User( 'PROFILE' ) === 'admin'
|| User( 'PROFILE' ) === 'teacher' ) ) :
$current_student_RET = DBGet( DBQuery( "SELECT " . getDisplayNameSQL() . " AS FULL_NAME
$current_student_RET = DBGet( DBQuery( "SELECT " . DisplayNameSQL() . " AS FULL_NAME
FROM STUDENTS
WHERE STUDENT_ID='" . UserStudentID() . "'" ) ); ?>
......@@ -683,7 +683,7 @@ $addJavascripts .= 'var menuStudentID = "' . UserStudentID() . '",
&& ( User( 'PROFILE' ) === 'admin'
|| User( 'PROFILE' ) === 'teacher' ) ) :
$current_user_RET = DBGet( DBQuery( "SELECT " . getDisplayNameSQL() . " AS FULL_NAME
$current_user_RET = DBGet( DBQuery( "SELECT " . DisplayNameSQL() . " AS FULL_NAME
FROM STAFF
WHERE STAFF_ID='" . UserStaffID() . "'" ) ); ?>
......
......@@ -155,7 +155,7 @@ function GetStaffList( &$extra = array() )
$profiles_RET = DBGet( DBQuery( "SELECT * FROM USER_PROFILES" ), array(), array( 'ID' ) );
$sql = "SELECT " . getDisplayNameSQL( 's' ) . " AS FULL_NAME,
$sql = "SELECT " . DisplayNameSQL( 's' ) . " AS FULL_NAME,
s.PROFILE,s.PROFILE_ID,s.STAFF_ID,s.SCHOOLS " . $extra['SELECT'] .
" FROM STAFF s " . $extra['FROM'] .
" WHERE s.SYEAR='" . UserSyear() . "'";
......
......@@ -425,7 +425,7 @@ function GetStuList( &$extra = array() )
else
{
// Student Full Name.
$sql .= getDisplayNameSQL( 's' ) . " AS FULL_NAME,";
$sql .= DisplayNameSQL( 's' ) . " AS FULL_NAME,";
// Student Details.
$sql .='s.LAST_NAME,s.FIRST_NAME,s.MIDDLE_NAME,s.STUDENT_ID,ssm.SCHOOL_ID,ssm.GRADE_ID ' . $extra['SELECT'];
......@@ -707,7 +707,7 @@ function makeContactInfo( $student_id, $column )
if ( $person[1]['FIRST_NAME'] || $person[1]['LAST_NAME'] )
{
$tipmsg .= $person[1]['STUDENT_RELATION'] . ': ' .
getDisplayName(
DisplayName(
$person[1]['FIRST_NAME'],
$person[1]['LAST_NAME'],
$person[1]['MIDDLE_NAME']
......@@ -1322,14 +1322,14 @@ function makeFieldTypeFunction( $field_type, $table = 'auto' )
*
* @since 3.7
*
* @example "SELECT " . getDisplayNameSQL( 's' ) . " AS FULL_NAME"
* @example "SELECT " . DisplayNameSQL( 's' ) . " AS FULL_NAME FROM STUDENTS s"
*
* @uses Config DISPLAY_NAME option.
*
* @param string $table_alias Table alias, optional.
* @return string Display name SQL (with table alias).
*/
function getDisplayNameSQL( $table_alias = '' )
function DisplayNameSQL( $table_alias = '' )
{
$display_name = Config( 'DISPLAY_NAME' );
......@@ -1366,7 +1366,7 @@ function getDisplayNameSQL( $table_alias = '' )
*
* @since 3.7
*
* @example echo getDisplayName( 'John', 'Smith', 'Simon', 'Jr.' );
* @example echo DisplayName( 'John', 'Smith', 'Simon', 'Jr.' );
*
* @uses Config DISPLAY_NAME option.
*
......@@ -1376,7 +1376,7 @@ function getDisplayNameSQL( $table_alias = '' )
* @param string $name_suffix Suffix (optional).
* @return string Display Name.
*/
function getDisplayName( $first_name, $last_name, $middle_name = '', $name_suffix = '' )
function DisplayName( $first_name, $last_name, $middle_name = '', $name_suffix = '' )
{
$display_name = Config( 'DISPLAY_NAME' );
......
......@@ -32,7 +32,7 @@ function GetTeacher( $teacher_id, $column = 'FULL_NAME', $schools = true )
{
$teachers = DBGet( DBQuery(
"SELECT STAFF_ID,FIRST_NAME,LAST_NAME,MIDDLE_NAME,
" . getDisplayNameSQL() . " AS FULL_NAME,USERNAME,PROFILE
" . DisplayNameSQL() . " AS FULL_NAME,USERNAME,PROFILE
FROM STAFF
WHERE SYEAR='" . UserSyear() . "'" .
( $schools ? " AND (SCHOOLS IS NULL OR SCHOOLS LIKE '%," . UserSchool() . ",%')" : '' ) ),
......
......@@ -40,7 +40,7 @@ function User( $item )
if ( ! empty( $_SESSION['STAFF_ID'] )
&& $_SESSION['STAFF_ID'] !== '-1' )
{
$sql = "SELECT STAFF_ID,USERNAME," . getDisplayNameSQL() . " AS NAME,
$sql = "SELECT STAFF_ID,USERNAME," . DisplayNameSQL() . " AS NAME,
PROFILE,PROFILE_ID,SCHOOLS,CURRENT_SCHOOL_ID,EMAIL,SYEAR,LAST_LOGIN
FROM STAFF
WHERE SYEAR='" . UserSyear() . "'
......@@ -54,7 +54,7 @@ function User( $item )
// Get Student Info.
elseif ( ! empty( $_SESSION['STUDENT_ID'] ) )
{
$sql = "SELECT '0' AS STAFF_ID,s.USERNAME," . getDisplayNameSQL( 's' ) . " AS NAME,
$sql = "SELECT '0' AS STAFF_ID,s.USERNAME," . DisplayNameSQL( 's' ) . " AS NAME,
'student' AS PROFILE,'0' AS PROFILE_ID,','||se.SCHOOL_ID||',' AS SCHOOLS,se.SYEAR,se.SCHOOL_ID
FROM STUDENTS s,STUDENT_ENROLLMENT se
WHERE s.STUDENT_ID='" . $_SESSION['STUDENT_ID'] . "'
......
......@@ -1056,7 +1056,7 @@ function Widgets( $item, &$myextra = null )
break;
}
$users_RET = DBGet( DBQuery( "SELECT STAFF_ID," . getDisplayNameSQL() . " AS FULL_NAME
$users_RET = DBGet( DBQuery( "SELECT STAFF_ID," . DisplayNameSQL() . " AS FULL_NAME
FROM STAFF
WHERE SYEAR='" . UserSyear() . "'
AND (SCHOOLS IS NULL OR SCHOOLS LIKE '%," . UserSchool() . ",%')
......
......@@ -153,7 +153,7 @@ if ( ! empty( $_REQUEST['student_billing'] )
if ( isset( $_REQUEST['staff_payroll'], $_REQUEST['student_billing'] ) )
{
$name_col_sql = "," . getDisplayNameSQL() . " AS STUDENT_NAME, '' AS FULL_NAME";
$name_col_sql = "," . DisplayNameSQL() . " AS STUDENT_NAME, '' AS FULL_NAME";
}
$fees_extra['SELECT'] .= $name_col_sql.",f.AMOUNT AS DEBIT,'' AS CREDIT,f.TITLE||' '||COALESCE(f.COMMENTS,' ') AS EXPLANATION,f.ASSIGNED_DATE AS DATE,f.ID AS ID";
......
......@@ -121,7 +121,7 @@ if ( isset( $_REQUEST['search_modfunc'] )
unset($extra);
$extra['SELECT_ONLY'] .= "ap.COURSE_PERIOD_ID,s.STUDENT_ID,
" . getDisplayNameSQL( 's' ) . " AS FULL_NAME,
" . DisplayNameSQL( 's' ) . " AS FULL_NAME,
ap.SCHOOL_DATE,cp.TITLE,ap.PERIOD_ID,sc.START_DATE,sc.END_DATE ";
$extra['FROM'] .= " ,ATTENDANCE_PERIOD ap, COURSE_PERIODS cp, SCHEDULE sc ";
//$extra['WHERE'] .= " AND ssm.student_id=s.student_id AND ap.STUDENT_ID=s.STUDENT_ID AND ap.COURSE_PERIOD_ID = cp.COURSE_PERIOD_ID AND ('".DBDate()."' BETWEEN ssm.START_DATE AND ssm.END_DATE OR ssm.END_DATE IS NULL) ";
......@@ -181,7 +181,7 @@ if ( isset( $_REQUEST['search_modfunc'] )
unset($extra);
$extra['SELECT_ONLY'] .= "ap.COURSE_PERIOD_ID,s.STUDENT_ID,
" . getDisplayNameSQL( 's' ) . " AS FULL_NAME,
" . DisplayNameSQL( 's' ) . " AS FULL_NAME,
ap.SCHOOL_DATE,cp.TITLE,cp.SHORT_NAME,ap.PERIOD_ID,sc.START_DATE,sc.END_DATE ";
$extra['FROM'] .= " ,ATTENDANCE_PERIOD ap, COURSE_PERIODS cp, SCHEDULE sc ";
//$extra['WHERE'] .= " AND ssm.student_id=s.student_id AND ap.STUDENT_ID=s.STUDENT_ID AND ap.COURSE_PERIOD_ID = cp.COURSE_PERIOD_ID AND ('".DBDate()."' BETWEEN ssm.START_DATE AND ssm.END_DATE OR ssm.END_DATE IS NULL) ";
......
......@@ -140,7 +140,7 @@ Search('student_id',$extra);
if (UserStudentID())
{
$name_RET = DBGet( DBQuery( "SELECT " . getDisplayNameSQL() . " AS FULL_NAME
$name_RET = DBGet( DBQuery( "SELECT " . DisplayNameSQL() . " AS FULL_NAME
FROM STUDENTS
WHERE STUDENT_ID='" . UserStudentID() . "'" ) );
......
......@@ -48,7 +48,7 @@ echo '</form>';
//FJ multiple school periods for a course period
if ( SchoolInfo( 'NUMBER_DAYS_ROTATION' ) !== null )
{
$sql = "SELECT s.STAFF_ID," . getDisplayNameSQL( 's' ) . " AS FULL_NAME,
$sql = "SELECT s.STAFF_ID," . DisplayNameSQL( 's' ) . " AS FULL_NAME,
sp.TITLE,cpsp.PERIOD_ID,cp.TITLE AS CP_TITLE,
(SELECT 'Y'
FROM ATTENDANCE_COMPLETED ac
......@@ -86,7 +86,7 @@ if ( SchoolInfo( 'NUMBER_DAYS_ROTATION' ) !== null )
AND sp.BLOCK=acc.BLOCK)
ORDER BY FULL_NAME";
} else {
$sql = "SELECT s.STAFF_ID," . getDisplayNameSQL( 's' ) . " AS FULL_NAME,
$sql = "SELECT s.STAFF_ID," . DisplayNameSQL( 's' ) . " AS FULL_NAME,
sp.TITLE,cpsp.PERIOD_ID,cp.TITLE AS CP_TITLE,
(SELECT 'Y'
FROM ATTENDANCE_COMPLETED ac
......
......@@ -185,7 +185,7 @@ if ( $_REQUEST['modfunc'] === 'save'
// Hook.
do_action( 'Custom/CreateParents.php|create_user' );
$staff = DBGet( DBquery( "SELECT " . getDisplayNameSQL() . " AS NAME,
$staff = DBGet( DBquery( "SELECT " . DisplayNameSQL() . " AS NAME,
USERNAME,PASSWORD
FROM STAFF
WHERE STAFF_ID='" . $id . "'" ) );
......@@ -195,7 +195,7 @@ if ( $_REQUEST['modfunc'] === 'save'
$id = true;
$staff = array(
1 => array(
'NAME' => getDisplayName(
'NAME' => DisplayName(
$user['FIRST_NAME'],
$user['LAST_NAME'],
$user['MIDDLE_NAME']
......@@ -213,7 +213,7 @@ if ( $_REQUEST['modfunc'] === 'save'
{
$id = $students[1]['STAFF_ID'];
$staff = DBGet( DBquery( "SELECT " . getDisplayNameSQL() . " AS NAME,
$staff = DBGet( DBquery( "SELECT " . DisplayNameSQL() . " AS NAME,
USERNAME,PASSWORD
FROM STAFF
WHERE STAFF_ID='" . $id . "'" ) );
......@@ -407,7 +407,7 @@ function _makeContactSelect( $value, $column )
{
$return .= '<tr><td>'.($contact['PERSON_ID']?'<input type="radio" name="contact['.$value.']" value='.$contact['PERSON_ID'].$checked.' />':'&nbsp;').'</td>';
$return .= '<td>' . getDisplayName(
$return .= '<td>' . DisplayName(
$contact['FIRST_NAME'],
$contact['LAST_NAME'],
$contact['MIDDLE_NAME']
......
......@@ -39,7 +39,7 @@ if ( $_REQUEST['modfunc'] === 'save' )
{
$st_list = '\''.implode('\',\'',$_REQUEST['staff']).'\'';
$extra['SELECT'] = "," . getDisplayNameSQL( 's' ) . " AS NAME,s.USERNAME,s.PASSWORD,s.EMAIL";
$extra['SELECT'] = "," . DisplayNameSQL( 's' ) . " AS NAME,s.USERNAME,s.PASSWORD,s.EMAIL";
$extra['WHERE'] = " AND s.STAFF_ID IN (" . $st_list . ")";
$RET = GetStaffList( $extra );
......@@ -59,7 +59,7 @@ if ( $_REQUEST['modfunc'] === 'save' )
$password_encrypted = encrypt_password($password);
DBQuery("UPDATE STAFF SET PASSWORD='".$password_encrypted."' WHERE STAFF_ID='".$staff_id."'");
$students_RET = DBGet( DBQuery( "SELECT " . getDisplayNameSQL( 's' ) . " AS FULL_NAME
$students_RET = DBGet( DBQuery( "SELECT " . DisplayNameSQL( 's' ) . " AS FULL_NAME
FROM STUDENTS s,STUDENT_ENROLLMENT sse,STUDENTS_JOIN_USERS sju
WHERE sju.STAFF_ID='" . $staff_id . "'
AND s.STUDENT_ID=sju.STUDENT_ID
......
......@@ -276,7 +276,7 @@ if ( isset( $_REQUEST['values'] )
// FJ add SendEmail function.
require_once 'ProgramFunctions/SendEmail.fnc.php';
$student_RET = DBGet( DBQuery( "SELECT " . getDisplayNameSQL() . " AS FULL_NAME
$student_RET = DBGet( DBQuery( "SELECT " . DisplayNameSQL() . " AS FULL_NAME
FROM STUDENTS
WHERE STUDENT_ID='" . UserStudentID() . "'" ) );
......@@ -531,7 +531,7 @@ if ( isset( $custom_fields_RET['200000009'] )
$student_dataquery .= ', CUSTOM_200000009';
}
$student_RET = DBGet( DBQuery( "SELECT " . getDisplayNameSQL() . " AS FULL_NAME" . $student_dataquery . "
$student_RET = DBGet( DBQuery( "SELECT " . DisplayNameSQL() . " AS FULL_NAME" . $student_dataquery . "
FROM STUDENTS
WHERE STUDENT_ID='" . UserStudentID() . "'" ) );
......
......@@ -180,7 +180,7 @@ if (UserStudentID() && $_REQUEST['student_id'])
echo '<table class="width-100p">';
$student_name_RET = DBGet( DBQuery( "SELECT " . getDisplayNameSQL() . " AS FULL_NAME
$student_name_RET = DBGet( DBQuery( "SELECT " . DisplayNameSQL() . " AS FULL_NAME
FROM STUDENTS
WHERE STUDENT_ID='" . UserStudentID() . "'" ) );
......@@ -191,7 +191,7 @@ if (UserStudentID() && $_REQUEST['student_id'])
echo '<tr><td>';
$users_RET = DBGet( DBQuery( "SELECT STAFF_ID," . getDisplayNameSQL() . " AS FULL_NAME,
$users_RET = DBGet( DBQuery( "SELECT STAFF_ID," . DisplayNameSQL() . " AS FULL_NAME,
EMAIL,PROFILE
FROM STAFF
WHERE SYEAR='" . UserSyear() . "'
......
......@@ -180,7 +180,7 @@ if ( ! $_REQUEST['modfunc']
echo '<table class="width-100p">';
$student_name_RET = DBGet( DBQuery( "SELECT " . getDisplayNameSQL() . " AS FULL_NAME
$student_name_RET = DBGet( DBQuery( "SELECT " . DisplayNameSQL() . " AS FULL_NAME
FROM STUDENTS
WHERE STUDENT_ID='" . $RET['STUDENT_ID'] . "'" ) );
......@@ -189,7 +189,7 @@ if ( ! $_REQUEST['modfunc']
_( 'Student' )
) . '</td></tr>';
$users_RET = DBGet( DBQuery( "SELECT STAFF_ID," . getDisplayNameSQL() . " AS FULL_NAME,
$users_RET = DBGet( DBQuery( "SELECT STAFF_ID," . DisplayNameSQL() . " AS FULL_NAME,
EMAIL,PROFILE
FROM STAFF
WHERE SYEAR='" . UserSyear() . "'
......
......@@ -45,7 +45,7 @@ function EmailReferral( $referral_id, $emails )
{
$referral = $referral_RET[1];
$student_RET = DBGet( DBQuery( "SELECT " . getDisplayNameSQL() . " AS FULL_NAME
$student_RET = DBGet( DBQuery( "SELECT " . DisplayNameSQL() . " AS FULL_NAME
FROM STUDENTS
WHERE STUDENT_ID='" . $referral['STUDENT_ID'] . "'" ) );
......
......@@ -111,7 +111,7 @@ echo '</form>';
".(($_REQUEST['period'])?" AND cp.PERIOD_ID='".$_REQUEST['period']."'":'')."
AND NOT EXISTS (SELECT '' FROM ELIGIBILITY_COMPLETED ac WHERE ac.STAFF_ID=cp.TEACHER_ID AND ac.PERIOD_ID = sp.PERIOD_ID AND ac.SCHOOL_DATE BETWEEN '".$start_date."' AND '".$end_date."')
";*/
$sql = "SELECT " . getDisplayNameSQL( 's' ) . " AS FULL_NAME,sp.TITLE,cpsp.PERIOD_ID,
$sql = "SELECT " . DisplayNameSQL( 's' ) . " AS FULL_NAME,sp.TITLE,cpsp.PERIOD_ID,
s.STAFF_ID,cp.TITLE AS CP_TITLE
FROM STAFF s,COURSE_PERIODS cp,SCHOOL_PERIODS sp,COURSE_PERIOD_SCHOOL_PERIODS cpsp
WHERE cp.COURSE_PERIOD_ID=cpsp.COURSE_PERIOD_ID
......
......@@ -36,13 +36,13 @@ $students_RET = DBGet( DBQuery( "SELECT fst.TRANSACTION_ID,fst.ACCOUNT_ID,fst.SY
'fst.STUDENT_ID',
"''",
'NULL',
"(SELECT " . getDisplayNameSQL() . " FROM STUDENTS WHERE STUDENT_ID=fst.STUDENT_ID)"
"(SELECT " . DisplayNameSQL() . " FROM STUDENTS WHERE STUDENT_ID=fst.STUDENT_ID)"
) ) . " AS FULL_NAME,fst.ACCOUNT_ID AS STUDENTS,fst.SCHOOL_ID
FROM FOOD_SERVICE_TRANSACTIONS
fst WHERE fst.SCHOOL_ID IS NULL" ), array( 'STUDENTS' => '_students', 'SCHOOL_ID' => '_make_school' ) );
$staff_RET = DBGet( DBQuery( "SELECT fst.TRANSACTION_ID,fst.STAFF_ID,fst.SYEAR,
(SELECT " . getDisplayNameSQL() . " FROM STAFF WHERE STAFF_ID=fst.STAFF_ID) AS FULL_NAME,fst.SCHOOL_ID
(SELECT " . DisplayNameSQL() . " FROM STAFF WHERE STAFF_ID=fst.STAFF_ID) AS FULL_NAME,fst.SCHOOL_ID
FROM FOOD_SERVICE_STAFF_TRANSACTIONS fst
WHERE fst.SCHOOL_ID IS NULL" ), array( 'SCHOOL_ID' => '_make_staff_school' ) );
......
......@@ -29,7 +29,7 @@ if ( $_REQUEST['modfunc'] === 'update' )
if ( ! $_REQUEST['modfunc']
&& UserStudentID() )
{
$student = DBGet( DBQuery( "SELECT s.STUDENT_ID," . getDisplayNameSQL( 's' ) . " AS FULL_NAME,
$student = DBGet( DBQuery( "SELECT s.STUDENT_ID," . DisplayNameSQL( 's' ) . " AS FULL_NAME,
fssa.ACCOUNT_ID,fssa.STATUS,fssa.DISCOUNT,fssa.BARCODE,
(SELECT BALANCE FROM FOOD_SERVICE_ACCOUNTS WHERE ACCOUNT_ID=fssa.ACCOUNT_ID) AS BALANCE
FROM STUDENTS s,FOOD_SERVICE_STUDENT_ACCOUNTS fssa
......@@ -39,7 +39,7 @@ if ( ! $_REQUEST['modfunc']
$student = $student[1];
// Find other students associated with the same account.
$xstudents = DBGet( DBQuery( "SELECT s.STUDENT_ID," . getDisplayNameSQL( 's' ) . " AS FULL_NAME
$xstudents = DBGet( DBQuery( "SELECT s.STUDENT_ID," . DisplayNameSQL( 's' ) . " AS FULL_NAME
FROM STUDENTS s,FOOD_SERVICE_STUDENT_ACCOUNTS fssa
WHERE fssa.ACCOUNT_ID='" . $student['ACCOUNT_ID'] . "'
AND s.STUDENT_ID=fssa.STUDENT_ID
......
......@@ -14,7 +14,7 @@ if ( $_REQUEST['modfunc'] === 'update' )
$RET = DBGet(DBQuery("SELECT ACCOUNT_ID FROM FOOD_SERVICE_STUDENT_ACCOUNTS WHERE BARCODE='".trim($_REQUEST['food_service']['BARCODE'])."' AND STUDENT_ID!='".UserStudentID()."'"));
if ( $RET)
{
$student_RET = DBGet( DBQuery( "SELECT " . getDisplayNameSQL( 's' ) . " AS FULL_NAME
$student_RET = DBGet( DBQuery( "SELECT " . DisplayNameSQL( 's' ) . " AS FULL_NAME
FROM STUDENTS s,FOOD_SERVICE_STUDENT_ACCOUNTS fssa
WHERE s.STUDENT_ID=fssa.STUDENT_ID
AND fssa.ACCOUNT_ID='" . $RET[1]['ACCOUNT_ID'] . "'" ) );
......@@ -27,7 +27,7 @@ if ( $_REQUEST['modfunc'] === 'update' )
$RET = DBGet(DBQuery("SELECT STAFF_ID FROM FOOD_SERVICE_STAFF_ACCOUNTS WHERE BARCODE='".trim($_REQUEST['food_service']['BARCODE'])."'"));
if ( $RET)
{
$staff_RET = DBGet( DBQuery( "SELECT " . getDisplayNameSQL() . " AS FULL_NAME
$staff_RET = DBGet( DBQuery( "SELECT " . DisplayNameSQL() . " AS FULL_NAME
FROM STAFF
WHERE STAFF_ID='" . $RET[1]['STAFF_ID'] . "'" ) );
......@@ -93,7 +93,7 @@ echo ErrorMessage( $error );
if (UserStudentID() && ! $_REQUEST['modfunc'])
{
$student = DBGet(DBQuery("SELECT s.STUDENT_ID," . getDisplayNameSQL( 's' ) . " AS FULL_NAME,
$student = DBGet(DBQuery("SELECT s.STUDENT_ID," . DisplayNameSQL( 's' ) . " AS FULL_NAME,
fssa.ACCOUNT_ID,fssa.STATUS,fssa.DISCOUNT,fssa.BARCODE,
(SELECT BALANCE FROM FOOD_SERVICE_ACCOUNTS WHERE ACCOUNT_ID=fssa.ACCOUNT_ID) AS BALANCE
FROM STUDENTS s,FOOD_SERVICE_STUDENT_ACCOUNTS fssa
......@@ -103,7 +103,7 @@ if (UserStudentID() && ! $_REQUEST['modfunc'])
$student = $student[1];
// Find other students associated with the same account.
$xstudents = DBGet( DBQuery( "SELECT s.STUDENT_ID," . getDisplayNameSQL( 's' ) . " AS FULL_NAME
$xstudents = DBGet( DBQuery( "SELECT s.STUDENT_ID," . DisplayNameSQL( 's' ) . " AS FULL_NAME
FROM STUDENTS s,FOOD_SERVICE_STUDENT_ACCOUNTS fssa
WHERE fssa.ACCOUNT_ID='" . $student['ACCOUNT_ID'] . "'
AND s.STUDENT_ID=fssa.STUDENT_ID
......
......@@ -40,13 +40,13 @@ if ( UserStudentID()
'fst.STUDENT_ID',
"''",
'NULL',
"(SELECT " . getDisplayNameSQL() . " FROM STUDENTS WHERE STUDENT_ID=fst.STUDENT_ID)"
"(SELECT " . DisplayNameSQL() . " FROM STUDENTS WHERE STUDENT_ID=fst.STUDENT_ID)"
) ) . " AS FULL_NAME," .
db_case( array(
'fst.SELLER_ID',
"''",
'NULL',
"(SELECT " . getDisplayNameSQL() . " FROM STAFF WHERE STAFF_ID=fst.SELLER_ID)"
"(SELECT " . DisplayNameSQL() . " FROM STAFF WHERE STAFF_ID=fst.SELLER_ID)"
) ) . " AS SELLER
FROM FOOD_SERVICE_TRANSACTIONS fst
WHERE SYEAR='" . UserSyear() . "'
......@@ -109,7 +109,7 @@ if ( UserStudentID()
'fst.STUDENT_ID',
"''",
'NULL',
"(SELECT " . getDisplayNameSQL() . " FROM STUDENTS WHERE STUDENT_ID=fst.STUDENT_ID)"
"(SELECT " . DisplayNameSQL() . " FROM STUDENTS WHERE STUDENT_ID=fst.STUDENT_ID)"
) ) . " AS FULL_NAME
FROM FOOD_SERVICE_TRANSACTIONS fst
WHERE SYEAR='" . UserSyear() . "'
......@@ -138,7 +138,7 @@ if ( UserStudentID()
$type_select .= '<option value="'.$short_name.'"'.($_REQUEST['type_select']==$short_name ? ' selected' : '').'>'.$type['DESCRIPTION'].'</option>';
$type_select .= '</select></span>';
$staff_RET = DBGet( DBquery( "SELECT STAFF_ID," . getDisplayNameSQL() . " AS FULL_NAME
$staff_RET = DBGet( DBquery( "SELECT STAFF_ID," . DisplayNameSQL() . " AS FULL_NAME
FROM STAFF
WHERE SYEAR='" . UserSyear() . "'
AND SCHOOLS LIKE '%," . UserSchool() . ",%'
......
......@@ -45,7 +45,7 @@ if ( $_REQUEST['modfunc'] === 'save' )
{
if ( $homeroom )
{
$teacher = DBGet( DBQuery( "SELECT " . getDisplayNameSQL( 's' ) . " AS FULL_NAME,cs.TITLE
$teacher = DBGet( DBQuery( "SELECT " . DisplayNameSQL( 's' ) . " AS FULL_NAME,cs.TITLE
FROM STAFF s,SCHEDULE sch,COURSE_PERIODS cp,COURSES c,COURSE_SUBJECTS cs
WHERE s.STAFF_ID=cp.TEACHER_ID
AND sch.STUDENT_ID='" . $student['STUDENT_ID'] . "'
......@@ -62,7 +62,7 @@ if ( $_REQUEST['modfunc'] === 'save' )
/*$teacher = DBGet(DBQuery("SELECT s.FIRST_NAME||' '||s.LAST_NAME AS FULL_NAME,cs.TITLE
FROM STAFF s,SCHEDULE sch,COURSE_PERIODS cp,COURSES c,COURSE_SUBJECTS cs,SCHOOL_PERIODS sp
WHERE s.STAFF_ID=cp.TEACHER_ID AND sch.STUDENT_ID='".$student['STUDENT_ID']."' AND cp.COURSE_ID=sch.COURSE_ID AND c.COURSE_ID=cp.COURSE_ID AND c.SUBJECT_ID=cs.SUBJECT_ID AND sp.PERIOD_ID=cp.PERIOD_ID AND sp.ATTENDANCE='Y' AND sch.COURSE_PERIOD_ID=cp.COURSE_PERIOD_ID AND sch.SYEAR='".UserSyear()."'"));*/
$teacher = DBGet( DBQuery( "SELECT " . getDisplayNameSQL( 's' ) . " AS FULL_NAME,cs.TITLE
$teacher = DBGet( DBQuery( "SELECT " . DisplayNameSQL( 's' ) . " AS FULL_NAME,cs.TITLE
FROM STAFF s,SCHEDULE sch,COURSE_PERIODS cp,COURSES c,COURSE_SUBJECTS cs,SCHOOL_PERIODS sp,COURSE_PERIOD_SCHOOL_PERIODS cpsp
WHERE cp.COURSE_PERIOD_ID=cpsp.COURSE_PERIOD_ID
AND s.STAFF_ID=cp.TEACHER_ID
......@@ -187,7 +187,7 @@ function reminder($student,$teacher,$xstudents,$target,$last_deposit,$note)
echo '<tr><td style="width:33%;">';
echo getDisplayName(
echo DisplayName(
$student['FIRST_NAME'],
$student['LAST_NAME'],
$student['MIDDLE_NAME'],
......@@ -201,7 +201,7 @@ function reminder($student,$teacher,$xstudents,$target,$last_deposit,$note)
foreach ( (array) $xstudents as $xstudent )
{
echo '<br />&nbsp;&nbsp;' . getDisplayName(
echo '<br />&nbsp;&nbsp;' . DisplayName(
$xstudent['FIRST_NAME'],
$xstudent['LAST_NAME'],
$xstudent['MIDDLE_NAME'],
......
......@@ -75,7 +75,7 @@ if ( $_REQUEST['modfunc'] === 'submit' )
if (UserStudentID() && ! $_REQUEST['modfunc'])
{
$student = DBGet( DBQuery( "SELECT s.STUDENT_ID," . getDisplayNameSQL( 's' ) . " AS FULL_NAME,
$student = DBGet( DBQuery( "SELECT s.STUDENT_ID," . DisplayNameSQL( 's' ) . " AS FULL_NAME,
fsa.ACCOUNT_ID,fsa.STATUS,fsa.DISCOUNT,fsa.BARCODE,
(SELECT BALANCE FROM FOOD_SERVICE_ACCOUNTS WHERE ACCOUNT_ID=fsa.ACCOUNT_ID) AS BALANCE
FROM STUDENTS s,FOOD_SERVICE_STUDENT_ACCOUNTS fsa
......
......@@ -19,7 +19,7 @@ Search('student_id',$extra);
if (UserStudentID() && ! $_REQUEST['modfunc'])
{
$student = DBGet( DBQuery( "SELECT s.STUDENT_ID," . getDisplayNameSQL( 's' ) . " AS FULL_NAME,
$student = DBGet( DBQuery( "SELECT s.STUDENT_ID," . DisplayNameSQL( 's' ) . " AS FULL_NAME,
fsa.ACCOUNT_ID,fsa.STATUS,
(SELECT BALANCE FROM FOOD_SERVICE_ACCOUNTS WHERE ACCOUNT_ID=fsa.ACCOUNT_ID) AS BALANCE
FROM STUDENTS s,FOOD_SERVICE_STUDENT_ACCOUNTS fsa
......@@ -29,7 +29,7 @@ if (UserStudentID() && ! $_REQUEST['modfunc'])
$student = $student[1];
// Find other students associated with the same account.
$xstudents = DBGet(DBQuery("SELECT s.STUDENT_ID," . getDisplayNameSQL( 's' ) . " AS FULL_NAME
$xstudents = DBGet(DBQuery("SELECT s.STUDENT_ID," . DisplayNameSQL( 's' ) . " AS FULL_NAME
FROM STUDENTS s,FOOD_SERVICE_STUDENT_ACCOUNTS fssa