n="justify"> $ query.=«ORDER BY events.edate»;
$ result=mysql_query ($ query, $ link); (! $ result) («getIDevents fatal error:». mysql_error ());
$ ret=array (); ($ row=mysql_fetch_array ($ result)) _push ($ ret, $ row); $ ret;
} getClubs ($ frcountry="")
{$ link;
$ query=«SELECT clubs. *, frcountrys.frcountry as frcountryname»;
$ query.=«FROM clubs, frcountrys WHERE»;
$ query.=«clubs.frcountry=frcountrys.id»; ($ frcountry!=«ANY» &&! empty ($ frcountry))
$ query.=«AND clubs.frcountry =« $ frcountry » »;
$ query.=«ORDER BY clubs.frcountry, clubs.name»;
$ result=mysql_query ($ query, $ link); (! $ result) («getIDevents fatal error:». mysql_error ());
$ ret=array (); ($ row=mysql_fetch_array ($ result)) _push ($ ret, $ row); $ ret;
} getClubJoined ($ id)
{$ link;
$ query=«SELECT clubs. *, frcountrys.frcountry as frcountryname»;
$ query.=«FROM clubs, frcountrys WHERE»;
$ query.=«clubs.frcountry=frcountrys.id AND clubs.id='$ id»;
$ result=mysql_query ($ query, $ link); (! $ result) («getClubJoined fatal error:». mysql_error ()); mysql_fetch_array ($ result);
} getEvent ($ event_id)
{$ link;
$ query=«SELECT clubs.name as clubname, events. *, gorts.gort as gortname, frcountrys.frcountry as frcountryname,. tocountry as tocountryname»;
$ query.=«FROM clubs, events, gorts, frcountrys, tocountrys WHERE»;
$ query.=«clubs.id=events.eclubevents.gort=gorts.idevents.frcountry=frcountrys.idevents.tocountry=tocountrys.idevents.id=«$event_id»»;
$ result=mysql_query ($ query, $ link); (! $ result) («getEvent fatal error:». mysql_error ()); mysql_fetch_array ($ result);
}
?>
Додаток 2
Файл clublib.inc
php_start (); _register («session»); cleanMemberSession ($ id, $ login, $ pass)
{$ session;
$ session [id]=$ id;
$ session [login]=$ login;
$ session [password]=$ pass;
$ session [logged_in]=true;
} checkUser ()
{$ session, $ logged_in;
$ session [logged]=false;
$ club_row=getRow («clubs», «id», $ session [id]); (! club_row | | $ club_row [login]!=$ session [login] | | $ club_row [password]!=$ session [password])
{(«Location: login.php»); ();
}
$ session [logged_in]=true; $ club_row;
} checkClubData ($ clubarray)
{(! isset ($ clubarray [name]))
{(«Location: updateclub.php?». SID);;
}
}
html ($ str)