-
Notifications
You must be signed in to change notification settings - Fork 0
/
commit.php
68 lines (49 loc) · 1.9 KB
/
commit.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
require ('/srv/marketsim/www/Controller/periodController.php');
require ("/srv/marketsim/www/Model/database.php");
session_start();
if (isset($_SESSION['login user']))
{
$email = $_SESSION['login user']; //do nothing
}
else
{
header("Location: /login.php");
}
if(isset($_POST['commitText']))
{
$comments = $_POST['commitText'];
//echo $comments;
$obj = new periodController();
$obj->commit($comments, $email);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Commit</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<?php // Here I need to increment the game period of game, and add comments to gamedecisions
//I am thinking that the best way to do this is to create a table game_comments (game, period (as primary keys) hotel, comments,
//here I should create a periodController object and call commit?>
<h1 style = "color:blue" align="left">Strategic Marketing Simulator</h1>
<p><?php echo $email ?>, please discuss your decisions with your group and explain why you made them.</p>
<form role="form" method ='post'>
<div class="form-group">
<label for="comment">Comments:</label>
<textarea class="form-control" rows="8" name = "commitText" method ='post' required id="comment"></textarea>
</div>
<div class="pull-right">
<input type="submit" name="submitCommit" value = "Commit Comments" action = "commitPeriod(<?php $comments. ", " . $email;?>)" class="btn btn-primary" />
</div>
</form>
</div>
</body>
</html>