This repository has been archived by the owner on Mar 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
insertslide.php
59 lines (50 loc) · 2.23 KB
/
insertslide.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
<?php
include "conn.php";
include "functions.php";
$username = $_POST['username'];
$screenid = $_POST['screenid'];
$screenTable = 'screen' . $screenid;
$template = $_POST['template'];
$orderNumber = $_POST['orderNumber'];
$title = $_POST['title'];
$picture = $_POST['picture'];
$message = $_POST['message'];
$theWhere = $_POST['theWhere'];
$theWhen = $_POST['theWhen'];
$theWho = $_POST['theWho'];
$theWhy = $_POST['theWhy'];
$fontSize = $_POST['fontSize'];
$lineHeight = $_POST['lineHeight'];
$startDate = dateTomysql($_POST['startDate']);
$endDate = dateTomysql($_POST['endDate']);
$stmt = $PDO->prepare("INSERT INTO $screenTable (template, orderNumber, title, picture, message, theWhere, theWhen, theWho, theWhy, fontSize, lineHeight, startDate, endDate) VALUES (:template, :orderNumber, :title, :picture, :message, :theWhere, :theWhen, :theWho, :theWhy, :fontSize, :lineHeight, :startDate, :endDate)");
$PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt->bindParam(':template', $template);
$stmt->bindParam(':orderNumber', $orderNumber);
$stmt->bindParam(':title', $title);
$stmt->bindParam(':picture', $picture);
$stmt->bindParam(':message', $message);
$stmt->bindParam(':theWhere', $theWhere);
$stmt->bindParam(':theWhen', $theWhen);
$stmt->bindParam(':theWho', $theWho);
$stmt->bindParam(':theWhy', $theWhy);
$stmt->bindParam(':fontSize', $fontSize);
$stmt->bindParam(':lineHeight', $lineHeight);
$stmt->bindParam(':startDate', $startDate);
$stmt->bindParam(':endDate', $endDate);
$PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
try {
$stmt->execute();
}catch(PDOException $e){
print 'Error!: Failed' . $e;
die();
}
/* LOG INFO */
date_default_timezone_set('Europe/London');
$date = date('Y-m-d H:i:s');
$action = $username . ' Created a New Slide on the ' . $screenTable . ' table - Slide Info - Title = ' . $title . ' / Message = ' . $message . ' / theWhere = ' . $theWhere . ' / theWhen = ' . $theWhen . ' / theWho = ' . $theWho . ' / theWhy = ' . $theWhy . ' / FontSize = ' . $fontSize . ' / lineHeight = ' . $lineHeight . ' / startDate= ' . $startDate . ' / endDate= ' . $endDate;
$userName = $username;
fnaddtolog($PDO, $action, $userName, $date);
/* END OF LOG INFO */
header("Location:screenmanager.php?id=$screenid")
?>