root/trunk/actions/communities/editEvent.action.php

Revision 1, 2.2 KB (checked in by anonymous, 7 years ago)

initial import

Line 
1<?php
2/****************************************************** Open .node ***
3 * Description:   
4 * Status:        Stable.
5 * Author:        Alexandre Dath <alexandre@dotnode.com>
6 * $Id$
7 *
8 * Copyright (C) 2005 Alexandre Dath <alexandre@dotnode.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 ******************** http://opensource.ikse.net/projects/dotnode ***/
24
25/*header('Content-type: text/plain');
26print_r($_POST)
27exit();*/
28if(is_numeric($token[3]) )
29{
30    $title = stripslashes($_POST['title']);
31    $details = stripslashes($_POST['details']);
32    $country = stripslashes($_POST['country']);
33    $city = stripslashes($_POST['city']);
34    $location = stripslashes($_POST['location']);
35    $date_event = mktime($_POST['date']['Time_Hour'], $_POST['date']['Time_Minute'], 0, $_POST['date']['Date_Month'], $_POST['date']['Date_Day'], $_POST['date']['Date_Year'] );
36
37    if(strlen($_POST['title']) < 1 || strlen($_POST['details']) < 1 || $_POST['country']=='(null)' )
38    {
39        header('Location: /error/event_incorrect');
40        exit();
41    }
42
43    $event_values = array(
44                'author'  => $_SESSION['my_fname'],
45                'title'   => $title,
46        'details' => $details,
47        'location' => $location,
48        'city'    => $city,
49        'country' => $country,
50                'date_event'=> $date_event);
51        $result = $db->autoExecute('community_event', $event_values, DB_AUTOQUERY_UPDATE, "id_event='".$token[3]."' AND id='".$_SESSION['my_id']."'");
52    if (DB::isError($result))
53            error_log($_SERVER['HTTP_HOST'].' | '.__FILE__.' '.$result->getUserInfo());
54
55}
56
57header('Location: /communities/viewEvent/'.$token[3]);
58?>
Note: See TracBrowser for help on using the browser.