Login   Register  
PHP Classes
elePHPant
Icontem

File: doc.txt

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Renat Vafin  >  Playbill  >  doc.txt  >  Download  
File: doc.txt
Role: Documentation
Content type: text/plain
Description: Description of functions of the class
Class: Playbill
Manage database of scheduled cultural events
Author: By
Last change:
Date: 10 years ago
Size: 3,992 bytes
 

Contents

Class file image Download
/*
 I've tried to describe all of functions of my class.
 English is foreign for me, so please ask if you didn't understand something.
*/

category - name of categories (theatre, cinema, exhibition,...)
item - name of item (ex.: "National Exhibition Center")
event - name of event (ex.: "Art Exhibition")

Variables:

$Error - flag that show the error in function

Functions:

function category ($category_id)
Return name of category which "id" is $category_id

function category_add ($name)
Add new category with name=$name. Return "1" on success or "0" otherwise.

function category_list ()
Return array of names of categories. The index of array is "name".

function item_add ($category_id, $item, $desc)
Add new item into the category with id=$category_id, name=$item and description=$desc. Return "1" on success or "0" otherwise.

function item_list ($category_id)
Return array of properties of item belongs to category with id=$category_id. Array looks like: $arr[$i][index]. Where $i=0,1,2,... - numbers of items. The indexes are: "item" - name of item, "id" - id of item, "logo" - link to logo of item.

function item ($item_id)
Return array of properties of item with id=$item_id. Array looks like: $arr[index]. The indexes are: "category_id" - id of category item is belonged to, "item" - name of item, "desc" - description of item, "logo" - link to logo of item, "category" - name of of category item is belonged to.

function event_add ($item_id, $name, $day_start, $day_end, $time, $desc, $days_week)
Add new event in the item with id=$item_id, name=$name, description=$desc, date of beginning=$day_start, date of ending=$day_end, time=$time, days of week, on which event will be=$days_week. Return "1" on success or "0" otherwise.
Format of variables.
$day_start, $day_end: "dd.mm.yyyy";
$time: array looks like $time[$i]="hh:mm". $i=0,1,...

function event_list ($item_id)
Return array of future events in item with id=$item_id. Array looks like: $arr[$i][index]. Where $i=1,2,... - numbers of items. The indexes are: "id" - id of event, "name" - name of event, "day_start" - date of beginning, "day_end" - date of ending, "time" - array of times of beginning of event, "days_week" - array of days of the week on which event will be.
There are 2 more indexes: $arr["item_name"] - name of item with id=$item_id, $arr["cat_name"] - name of category item with id=$item_id is belonged to.

function event ($event_id)
Return array of properties of event with id=$event_id. Array looks like: $arr[index]. The indexes are: "item_id" - id of item event is belonged to, "name" - name of event, "desc" - description of event, "desc_mari" - description of event in mari language, "day_start" - date of beginning, "day_end" - date of ending, "time" - array of times of beginning of event.
Format of variables.
$day_start, $day_end: "dd.mm.yyyy";
$time: array looks like $time[$i]="hh:mm". $i=0,1,...

function item_title ($item)
Return name of item which "id" is $item.

function event_title ($event)
Return array which looks like $arr["index"].
The indexes are: "event" - name of event which "id" is $event, "item" - name of item event is belonged to, "category" - name of category event is belonged to.

function event_today ()
Return array of events that'll be today. Array looks like: $arr[$i][index]. Where $i=1,2,... - numbers of events. The indexes are: "id" - id of event, "name" - name of event, "date" - date of today, "time" - array of times of beginning of event.

function event_week ()
Return array of events that'll be within a week. Array looks like: $arr[$i][index]. Where $i=1,2,... - numbers of events. The indexes are: "id" - id of event, "name" - name of event, "day_start" - date of beginning, "day_end" - date of ending, "time" - array of times of beginning of event, "days_week" - array of days of the week on which event will be, "desc" - description of event, "item" - name of item event is belonged to.