Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Untitled Document</title>
- </head>
- <body>
- <?php
- $servername = "localhost";
- $username = "playground18";
- $password = "Cdz5SOVrY2p8fnWS";
- $dbname = "playground18";
- $id = $_GET['ID'];
- $curtime = date("Y-m-d");
- try
- {
- $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
- $sql = "UPDATE tanay_xcatt_absences SET review_status = 'excused' WHERE id='$id'";
- $conn->exec($sql);
- $sql = "SELECT person FROM `tanay_xcatt_absences` WHERE id = '$id'";
- $result = $conn->prepare($sql);
- $result->execute();
- $per = $result->fetchColumn();
- $sql = "SELECT excused_absences FROM tanay_xcatt_runners WHERE name='$per'";
- $result = $conn->prepare($sql);
- $result->execute();
- $EA = $result->fetchColumn();
- $EA=$EA+1;
- $sql = "UPDATE tanay_xcatt_runners SET excused_absences = $EA WHERE name='$per'";
- $conn->exec($sql);
- $sql = "UPDATE tanay_xcatt_absences SET review_date = '$curtime' WHERE id='$id'";
- $conn->exec($sql);
- }
- catch(PDOException $e)
- {
- echo "Error: " . $e->getMessage();
- }
- $conn = null;
- header('Location: coachUnreviewedAbsences.php');
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement