-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsendRecruitMessage.php
More file actions
50 lines (42 loc) · 1.39 KB
/
Copy pathsendRecruitMessage.php
File metadata and controls
50 lines (42 loc) · 1.39 KB
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
<?php
/*
** sendRecruitMessage.php
** Author: Peter DiSalvo
** Date: 12/21/2012
** Send a recruitment message.
*/
require_once 'config.inc.php';
require_once 'AccountSession.inc.php';
$messageSubmitted = !empty($_POST['messageSubmitted']) ? $_POST['messageSubmitted'] : NULL;
$currentSession = new AccountSession();
if(empty($messageSubmitted))
{
$currentSession->openProfilePage();
}
else
{
$team = !empty($_POST['team']) ? $_POST['team'] : NULL;
$player = !empty($_POST['player']) ? $_POST['player'] : NULL;
$position = !empty($_POST['position']) && $_POST['position'] != '--' ? $_POST['position'] : "NULL";
$note = !empty($_POST['note']) ? $_POST['note'] : "NULL";
$mysqliConnection = new mysqli(Config::DB_CONN, Config::DB_USER, Config::DB_PASS, Config::DB_NAME);
if (mysqli_connect_error())
{
die(Config::DB_ERROR_TEXT . mysqli_connect_errno() . ' ' . mysqli_connect_error());
}
if($_SESSION[AccountSession::SESS_ACCT_TYPE_FLD] == 'M')
{
$messageType = 'TP';
}
elseif($_SESSION[AccountSession::SESS_ACCT_TYPE_FLD] == 'P')
{
$messageType = 'TT';
}
$queryString = <<<SQL
INSERT INTO recruitmessage (TeamID, PositionID, PlayerAccountNumber, MessageTypeID, Note)
VALUES ({$team}, {$position}, {$player}, '{$messageType}', '{$note}');
SQL;
$mysqliConnection->query($queryString) or die($mysqliConnection->error);
$mysqliConnection->close();
}
?>