Class ScriptController

Description

Controller class for automated script logic and all other actions/methods that are needed to make this portal function.

  • author: Margus Sellin <margus@bitweb.ee>
  • copyright: Copyright (C) 2011. All rights reserved. Margus Sellin

Located in /controllers/ScriptController.php (line 12)

Zend_Controller_Action
   |
   --ScriptController
Method Summary
void addFileAction ()
void addTableAction ()
boolean checkLahtineExistance (int $dateID, int $personID, int $schoolID, int $classID)
boolean checkLoppExistance (int $dateID, int $personID, int $schoolID, int $classID)
boolean checkPiirkondExistance (int $dateID, int $personID, int $schoolID, int $classID)
boolean checkValikExistance (int $dateID, int $personID, int $schoolID, int $classID)
string classByID (int $classID)
void editPageAction ()
int fetchAreaID (string $data)
int fetchClassID (string $url)
int fetchClassIDByString (string $data)
int fetchGroupID (string $url)
int fetchPersonID (string $data)
int fetchSchoolID (string $data, int $areaID)
int fetchSchoolIDByString (string $data)
mixed fetchTableRows (string $url)
int getDateIDByDateID (int $date)
int getDateIDByDateString (string $date)
void init ()
void menuAction ()
void pagesAction ()
void saveLahtine (int $date, string $url)
void saveLahtineOverall (int $personID, int $dateID, int $pointsID, int $classID, int $groupID, int $schoolID)
void saveLopp (int $date, string $url)
void saveLoppOverall (int $personID, int $dateID, int $pointsID, int $classID, int $schoolID)
void savePiirk (int $date, string $url)
void savePiirkondOverall (int $personID, int $dateID, int $pointsID, int $classID, int $schoolID)
void saveValik (int $date, string $url)
void saveValikOverall (int $personID, int $dateID, int $pointsID, int $classID, int $schoolID)
Methods
addFileAction (line 90)

Add file action.

User inserts a file with result table URL's. The file is read line by line and data from tables given by the URL's in the file is being inserted into database.

Used to insert many tables at the same time.

  • access: public
void addFileAction ()
addResultsAction (line 78)

Add results action.

Used to display a view where user can choose between two adding options.

  • access: public
void addResultsAction ()
addTableAction (line 131)

Add table action.

User inserts a table URL with HTML table and a date.

Used to insert single tables.

  • access: public
void addTableAction ()
checkLahtineExistance (line 883)

Method for checking 'Lahtised võistlused' competition record existance.

Database is being checked if there already is a record with given parameters or not. Based on the result boolean is returned.

  • access: private
boolean checkLahtineExistance (int $dateID, int $personID, int $schoolID, int $classID)
  • int $dateID: Date ID
  • int $personID: Participant ID
  • int $schoolID: School ID
  • int $classID: Class ID
checkLoppExistance (line 841)

Method for checking 'Lõppvoorud' competition record existance.

Database is being checked if there already is a record with given parameters or not. Based on the result boolean is returned.

  • access: private
boolean checkLoppExistance (int $dateID, int $personID, int $schoolID, int $classID)
  • int $dateID: Date ID
  • int $personID: Participant ID
  • int $schoolID: School ID
  • int $classID: Class ID
checkPiirkondExistance (line 820)

Method for checking 'Piirkonnavoorud' competition record existance.

Database is being checked if there already is a record with given parameters or not. Based on the result boolean is returned.

  • access: private
boolean checkPiirkondExistance (int $dateID, int $personID, int $schoolID, int $classID)
  • int $dateID: Date ID
  • int $personID: Participant ID
  • int $schoolID: School ID
  • int $classID: Class ID
checkValikExistance (line 862)

Method for checking 'Valikvõistlused' competition record existance.

Database is being checked if there already is a record with given parameters or not. Based on the result boolean is returned.

  • access: private
boolean checkValikExistance (int $dateID, int $personID, int $schoolID, int $classID)
  • int $dateID: Date ID
  • int $personID: Participant ID
  • int $schoolID: School ID
  • int $classID: Class ID
classByID (line 801)

Method for fetching class number.

Class number is being fetched from database by class ID.

  • return: Class number
  • access: private
string classByID (int $classID)
  • int $classID: Class ID
editPageAction (line 51)

Edit page action.

Action that is used to edit static pages' content.

  • access: public
void editPageAction ()
fetchAreaID (line 613)

Method for fetching area ID.

Area ID is being fetched from database by area name.

  • return: Area ID
  • access: private
int fetchAreaID (string $data)
  • string $data: Area name
fetchClassID (line 542)

Method for fetching participant's class ID.

Class is being fetched from database by result table URL, which contains information about the class.

  • return: Class ID
  • access: private
int fetchClassID (string $url)
  • string $url: Result table URL
fetchClassIDByString (line 565)

Method for fetching participant's class ID.

Class ID is being fetched from database by its string presentation.

  • return: Class ID
  • access: private
int fetchClassIDByString (string $data)
  • string $data: Class number
fetchGroupID (line 526)

Method for fetching competition group ID.

Group is being fetched from database by result table URL, which contains information about the group.

  • return: Group ID
  • access: private
int fetchGroupID (string $url)
  • string $url: Result table URL
fetchPersonID (line 585)

Method for fetching participant's ID.

Participant is being fetched from database by his/her name.

  • return: Participant ID
  • access: private
int fetchPersonID (string $data)
  • string $data: Participant name
fetchSchoolID (line 639)

Method for fetching school ID and editing its area ID.

School ID is being fetched from database by school name. In case school's area ID is empty, it is being replaced with given area ID;

  • return: School ID
  • access: private
int fetchSchoolID (string $data, int $areaID)
  • string $data: School name
  • int $areaID: Area ID
fetchSchoolIDByString (line 662)

Method for fetching school ID.

School ID is being fetched from database by school name.

  • return: School ID
  • access: private
int fetchSchoolIDByString (string $data)
  • string $data: School name
fetchTableRows (line 786)

Method for getting URL table rows..

Table rows are fetched from given URL and returned as DOM elements.

  • return: Table rows
  • access: private
mixed fetchTableRows (string $url)
  • string $url: Result table URL
getDateIDByDateID (line 503)

Method for fetching competition date ID.

Competition date is being fetched from database by its ID.

  • return: Competition date ID
  • access: private
int getDateIDByDateID (int $date)
  • int $date: Competition date
getDateIDByDateString (line 481)

Method for fetching competition date ID.

Competition date is being fetched from database by its string presentation.

  • return: Competition date ID
  • access: private
int getDateIDByDateString (string $date)
  • string $date: Competition date
init (line 23)

Init method.

Built-in method in Zend Framework that applies to all actions in given controller. In this very controller it restricts common user who are not logged in to access administrative actions and functions of this portal.

If user is not logged in and tries to access actions/methods that are meant for administrators only, he/she is redirected to login page.

  • access: public
void init ()
menuAction (line 34)

Menu action.

Action that is used to display admin menu on the right. This action is called only when user is logged in as administrator.

  • access: public
void menuAction ()
pagesAction (line 41)

Pages action.

Action that is used to display static pages' management page.

  • access: public
void pagesAction ()
saveLahtine (line 259)

Method for saving 'Lahtised võistlused' competition results.

All data from given table URL is being inserted into database.

  • access: private
void saveLahtine (int $date, string $url)
  • int $date: Competition date
  • string $url: HTML table URL
saveLahtineOverall (line 737)

Method for saving 'Lahtised võistlused' competition.

A row is inserted to aggregate table with all the necessary ID fields.

  • access: private
void saveLahtineOverall (int $personID, int $dateID, int $pointsID, int $classID, int $groupID, int $schoolID)
  • int $personID: Participant ID
  • int $dateID: Date ID
  • int $pointsID: Points ID
  • int $classID: Class ID
  • int $groupID: Group ID
  • int $schoolID: School ID
saveLopp (line 332)

Method for saving 'Lõppvoorud' competition results.

All data from given table URL is being inserted into database.

  • access: private
void saveLopp (int $date, string $url)
  • int $date: Competition date
  • string $url: HTML table URL
saveLoppOverall (line 760)

Method for saving 'Lõppvoorud' competition.

A row is inserted to aggregate table with all the necessary ID fields.

  • access: private
void saveLoppOverall (int $personID, int $dateID, int $pointsID, int $classID, int $schoolID)
  • int $personID: Participant ID
  • int $dateID: Date ID
  • int $pointsID: Points ID
  • int $classID: Class ID
  • int $schoolID: School ID
savePiirk (line 402)

Method for saving 'Piirkonnavoorud' competition results.

All data from given table URL is being inserted into database.

  • access: private
void savePiirk (int $date, string $url)
  • int $date: Competition date
  • string $url: HTML table URL
savePiirkondOverall (line 685)

Method for saving 'Piirkonnavoorud' competition.

A row is inserted to aggregate table with all the necessary ID fields.

  • access: private
void savePiirkondOverall (int $personID, int $dateID, int $pointsID, int $classID, int $schoolID)
  • int $personID: Participant ID
  • int $dateID: Date ID
  • int $pointsID: Points ID
  • int $classID: Class ID
  • int $schoolID: School ID
saveValik (line 190)

Method for saving 'Valikvõistlused' competition results.

All data from given table URL is being inserted into database.

  • access: private
void saveValik (int $date, string $url)
  • int $date: Competition date
  • string $url: HTML table URL
saveValikOverall (line 714)

Method for saving 'Valikvõistlused' competition.

A row is inserted to aggregate table with all the necessary ID fields.

  • access: private
void saveValikOverall (int $personID, int $dateID, int $pointsID, int $classID, int $schoolID)
  • int $personID: Participant ID
  • int $dateID: Date ID
  • int $pointsID: Points ID
  • int $classID: Class ID
  • int $schoolID: School ID

Documentation generated on Mon, 20 Jun 2011 05:43:09 +0300 by phpDocumentor 1.4.1