updated event adding and editing descriptions to textarea instead of regular text

Did this to allow for multiple lines of text to be added and shown
properly.
This commit is contained in:
Russ 2015-04-05 19:03:14 -04:00
parent 0d08ae04cd
commit 9c4cb93f8a
4 changed files with 11 additions and 11 deletions

View File

@ -95,7 +95,7 @@ if( $_SESSION['access'] != 1 ) {
</head> </head>
<body> <body>
<div class=header> <div class=header>
<h1> BMS Events</h1> <h1>BMS Events</h1>
<?php <?php
if(isset($_SESSION['uname'])) { if(isset($_SESSION['uname'])) {
echo "Hello, "; echo "Hello, ";
@ -106,7 +106,7 @@ if( $_SESSION['access'] != 1 ) {
</div> </div>
<?php include "includes/classes/select.class.php";?> <?php include "includes/classes/select.class.php";?>
<br /> <br />
<form id="select_form" required method="post" action="includes/insert_event.php"> <form id="select_form" required method="post" action="includes/insert_event1.php">
<table align="center"> <table align="center">
<tr> <tr>
<td> <td>
@ -161,7 +161,7 @@ if( $_SESSION['access'] != 1 ) {
Issue Description: Issue Description:
</td> </td>
<td> <td>
<input type="text" name="description" id="description" required /> <textarea name="description" id="description" cols="40" rows="5" required > </textarea>
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@ -63,7 +63,7 @@ if( $_SESSION['access'] != 1 ) {
} }
include "includes/classes/select2.class.php"; ?> include "includes/classes/select2.class.php"; ?>
<br /> <br />
<form id="select_form" required method="post" action="includes/update_event.php"> <form id="select_form" required method="post" action="includes/update_event1.php">
<table align=center> <table align=center>
<tr> <tr>
<td> <td>
@ -127,7 +127,7 @@ if( $_SESSION['access'] != 1 ) {
Issue Description: Issue Description:
</td> </td>
<td> <td>
<input type="text" name="description" id="description" required value="<?=$desc;?>" /> <textarea name="description" id="description" cols="40" rows="5" required><?=$desc?></textarea>
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@ -4,7 +4,7 @@ $conn = mysqli_connect($servername, $username, $password, $db);
$unit = mysqli_real_escape_string($conn, $_POST['unit']); $unit = mysqli_real_escape_string($conn, $_POST['unit']);
$start_date_time = mysqli_real_escape_string($conn, $_POST['start_date_time']); $start_date_time = mysqli_real_escape_string($conn, $_POST['start_date_time']);
$description = mysqli_real_escape_string($conn, $_POST['description']); $description = $_POST['description'];
$is_ongoing = mysqli_real_escape_string($conn, $_POST['is_ongoing']); $is_ongoing = mysqli_real_escape_string($conn, $_POST['is_ongoing']);
$end_date_time = mysqli_real_escape_string($conn, $_POST['end_date_time']); $end_date_time = mysqli_real_escape_string($conn, $_POST['end_date_time']);
$alert = mysqli_real_escape_string($conn, $_POST['alert']); $alert = mysqli_real_escape_string($conn, $_POST['alert']);

View File

@ -1,9 +1,9 @@
<?php <?php
include "db_config.php"; include "db_config.php";
$conn = mysqli_connect($servername, $username, $password, $db); $conn = mysqli_connect($servername, $username, $password, $db);
$event_id = mysqli_real_escape_string($conn, $_POST['event']); $event_id = mysqli_real_escape_string($conn, $_POST['event']);
$description = mysqli_real_escape_string($conn, $_POST['description']); $description = $_POST['description'];
$is_ongoing = mysqli_real_escape_string($conn, $_POST['is_ongoing']); $is_ongoing = mysqli_real_escape_string($conn, $_POST['is_ongoing']);
$end_date_time = mysqli_real_escape_string($conn, $_POST['end_date_time']); $end_date_time = mysqli_real_escape_string($conn, $_POST['end_date_time']);
$user = mysqli_real_escape_string($conn, $_POST['user']); $user = mysqli_real_escape_string($conn, $_POST['user']);
@ -36,10 +36,10 @@ if($result){
//Set Email Info //Set Email Info
$to = "TO-EMAIL@DOMAIN.COM"; $to = "TO-EMAIL@DOMAIN.COM";
$subject = "Updated BMS Alert: ".$unitname." ".$alertname.""; $subject = "Updated BMS Alert: ".$unitname." ".$alertname."";
$headers = "From: FROM-EMAIL@DOMAIN>COM"; $headers = "From: FROM-EMAIL@DOMAIN.COM";
$message = "BMS Unit: ".$unitname." \n Type of Alert: ".$alertname." \n Start Date / Time: ".$start_date_time." \n End Date / Time: ".$end_date_time." \n Description: ".$description." \n Updated by: ".$user." \n Event Link: https://DOMAIN.com/bms/viewevent.php?eventid=$event_id \n \n This message generated by https://DOMAIN.com/bms"; $message = "BMS Unit: ".$unitname." \n Type of Alert: ".$alertname." \n Start Date / Time: ".$start_date_time." \n End Date / Time: ".$end_date_time." \n Description: ".$description." \n Updated by: ".$user." \n Event Link: https://DOMAIN.com/bms/viewevent.php?eventid=$event_id \n \n This message generated by https://DOMAIN.com/bms";
//WordWrap the message //WordWrap the message
$message_wrapped = wordwrap($message, 70, "\n", true); $message_wrapped = wordwrap($message, 70, "\n", true);
//Send the email //Send the email
mail($to,$subject,$message_wrapped,$headers); mail($to,$subject,$message_wrapped,$headers);
} else{ } else{