/extremedating/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/extremedating/trunk
65 by Gustav Hatvigsson
made it possible to decline and accept dates
1
<?php
2
include "./php/db.php";
3
session_start();
4
if($_SESSION['userName']) {
5
  if (isset($_POST['user']) && isset($_POST['otherUser']) && isset($_POST['AcceptLunch'])
6
    && $_SESSION['userName'] == $_POST['user'] ) {
7
    $luncharray = $db->query("SELECT accepted from planLunch WHERE(user2='$user' AND user1='{$_POST['user1']}')");
8
    $lunchinfo = $luncharray->fetchAll();
9
    $lunchquery = $lunchinfo[0];
10
    $db->exec("UPDATE planLunch SET accepted='true'
11
    WHERE(user2='{$_POST['user']}' 
12
    AND user1='{$_POST['otherUser']}')");
13
    header("Location:profile.php?uid=" . $_POST['otherUser']);
14
  }
15
}
16
?>