| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | /*************************************************************************** |
|---|
| 4 | * Dolphin Smart Community Builder |
|---|
| 5 | * ----------------- |
|---|
| 6 | * begin : Mon Mar 23 2006 |
|---|
| 7 | * copyright : (C) 2006 BoonEx Group |
|---|
| 8 | * website : http://www.boonex.com/ |
|---|
| 9 | * This file is part of Dolphin - Smart Community Builder |
|---|
| 10 | * |
|---|
| 11 | * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License. |
|---|
| 12 | * http://creativecommons.org/licenses/by/3.0/ |
|---|
| 13 | * |
|---|
| 14 | * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
|---|
| 15 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|---|
| 16 | * See the Creative Commons Attribution 3.0 License for more details. |
|---|
| 17 | * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin, |
|---|
| 18 | * see license.txt file; if not, write to marketing@boonex.com |
|---|
| 19 | ***************************************************************************/ |
|---|
| 20 | |
|---|
| 21 | require_once( 'inc/header.inc.php' ); |
|---|
| 22 | require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' ); |
|---|
| 23 | require_once( BX_DIRECTORY_PATH_INC . 'prof.inc.php' ); |
|---|
| 24 | require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' ); |
|---|
| 25 | require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' ); |
|---|
| 26 | require_once( BX_DIRECTORY_PATH_INC . 'sdating.inc.php' ); |
|---|
| 27 | require_once( BX_DIRECTORY_PATH_INC . 'images.inc.php' ); |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolEvents.php' ); |
|---|
| 31 | |
|---|
| 32 | // --------------- page variables and login |
|---|
| 33 | |
|---|
| 34 | $_page['name_index'] = 55; |
|---|
| 35 | $_page['css_name'] = 'sdating.css'; |
|---|
| 36 | $_page['extra_css'] = $oTemplConfig -> sCalendarCss; |
|---|
| 37 | $_page['extra_js'] = $oTemplConfig -> sTinyMceEditorJS; |
|---|
| 38 | |
|---|
| 39 | check_logged(); |
|---|
| 40 | |
|---|
| 41 | $_page['header'] = _t("_sdating_h"); |
|---|
| 42 | $_page['header_text'] = _t("_sdating_h"); |
|---|
| 43 | |
|---|
| 44 | $oEvents = new BxDolEvents(); |
|---|
| 45 | if ($logged['admin']) |
|---|
| 46 | $oEvents->bAdminMode = TRUE; |
|---|
| 47 | |
|---|
| 48 | $_ni = $_page['name_index']; |
|---|
| 49 | $_page_cont[$_ni]['page_main_code'] = PageCompPageMainCode(); |
|---|
| 50 | |
|---|
| 51 | function PageCompPageMainCode() { |
|---|
| 52 | global $oEvents; |
|---|
| 53 | $bEventCreating = (getParam('enable_event_creating') == 'on'); |
|---|
| 54 | $sRetHtml = ''; |
|---|
| 55 | $sRetHtml .= $oEvents -> PrintCommandForms(); |
|---|
| 56 | |
|---|
| 57 | switch ( $_REQUEST['action'] ) { |
|---|
| 58 | //print functions |
|---|
| 59 | case 'show': |
|---|
| 60 | $sRetHtml .= $oEvents->PageSDatingShowEvents(); |
|---|
| 61 | break; |
|---|
| 62 | case 'show_info': |
|---|
| 63 | $sRetHtml .= $oEvents->PageSDatingShowInfo(); |
|---|
| 64 | break; |
|---|
| 65 | case 'show_part': |
|---|
| 66 | $sRetHtml .= $oEvents->PageSDatingShowParticipants(); |
|---|
| 67 | break; |
|---|
| 68 | case 'search': |
|---|
| 69 | $sRetHtml .= $oEvents->PageSDatingShowForm(); |
|---|
| 70 | $sRetHtml .= $oEvents->PageSDatingShowEvents(); |
|---|
| 71 | break; |
|---|
| 72 | case 'search_by_tag': |
|---|
| 73 | $sRetHtml .= $oEvents->ShowSearchResult(); |
|---|
| 74 | break; |
|---|
| 75 | case 'calendar': |
|---|
| 76 | $sRetHtml .= $oEvents->PageSDatingCalendar(); |
|---|
| 77 | break; |
|---|
| 78 | |
|---|
| 79 | /*case 'select_match': |
|---|
| 80 | $sRetHtml .= $oEvents->PageSDatingSelectMatches(); |
|---|
| 81 | break;*/ |
|---|
| 82 | |
|---|
| 83 | //forms of editing |
|---|
| 84 | case 'new': |
|---|
| 85 | if ($bEventCreating) { |
|---|
| 86 | if (isset($_POST['event_save'])) { |
|---|
| 87 | $aPostAdv = $oEvents -> FillPostEventArrByPostValues(); |
|---|
| 88 | $aErr = $oEvents -> CheckEventErrors( $aPostAdv ); |
|---|
| 89 | if( empty( $aErr ) ) { |
|---|
| 90 | $add_res = $oEvents->SDAddEvent(); |
|---|
| 91 | $_REQUEST['event_id'] = mysql_insert_id($GLOBALS['MySQL']->link); |
|---|
| 92 | $sRetHtml .= $oEvents->PageSDatingShowInfo(); |
|---|
| 93 | } else { |
|---|
| 94 | $sRetHtml .= $oEvents->PageSDatingNewEventForm(-1, $aErr); |
|---|
| 95 | } |
|---|
| 96 | } else { |
|---|
| 97 | $sRetHtml .= $oEvents->PageSDatingNewEventForm(-1); |
|---|
| 98 | } |
|---|
| 99 | } else |
|---|
| 100 | $sRetHtml .= ''; |
|---|
| 101 | break; |
|---|
| 102 | case 'edit_event': |
|---|
| 103 | $iEventID = (int)($_POST['EditEventID']); |
|---|
| 104 | $sRetHtml .= $oEvents->PageSDatingNewEventForm($iEventID); |
|---|
| 105 | break; |
|---|
| 106 | |
|---|
| 107 | //non safe functions |
|---|
| 108 | case 'event_save': |
|---|
| 109 | $iEventID = (int)($_POST['EditedEventID']); |
|---|
| 110 | $aPostAdv = $oEvents -> FillPostEventArrByPostValues(); |
|---|
| 111 | $aErr = $oEvents -> CheckEventErrors( $aPostAdv ); |
|---|
| 112 | if( empty( $aErr ) ) { |
|---|
| 113 | $add_res = $oEvents->SDAddEvent($iEventID);//like update |
|---|
| 114 | $_REQUEST['event_id'] = $iEventID; |
|---|
| 115 | $sRetHtml .= $oEvents->PageSDatingShowInfo(); |
|---|
| 116 | } else { |
|---|
| 117 | $sRetHtml .= $oEvents->PageSDatingNewEventForm($iEventID, $aErr); |
|---|
| 118 | } |
|---|
| 119 | break; |
|---|
| 120 | case 'delete_event': |
|---|
| 121 | $sRetHtml .= $oEvents->PageSDatingDeleteEvent(); |
|---|
| 122 | $sRetHtml .= $oEvents->PageSDatingShowEvents(); |
|---|
| 123 | break; |
|---|
| 124 | default: |
|---|
| 125 | $sRetHtml .= $oEvents->PageSDatingShowEvents(); |
|---|
| 126 | } |
|---|
| 127 | return $sRetHtml; |
|---|
| 128 | } |
|---|
| 129 | |
|---|
| 130 | PageCode(); |
|---|
| 131 | |
|---|
| 132 | ?> |
|---|