<?php $message = ''; $lab = ''; $station = ''; $id = intval($_GET['id']); $get_sitin = get_sitinDetails($id); //check if button submit is clicked $message = ''; if (isset($_POST['submit'])) { $lab = trim($_POST['lab']); $station = trim($_POST['station']); // sit-in record if ($get_sitin['TOTALSITIN'] <= 29) { $get_sitin['TOTALSITIN'] = $get_sitin['TOTALSITIN'] + 1; $get_sitin['AVAILABLESITIN'] = $get_sitin['AVAILABLESITIN'] - 1; $message = "<div class = 'alert alert-success' style = 'width: 265px;'>Successfully added.</div>"; update_SitIn($get_sitin['TOTALSITIN'], $get_sitin['AVAILABLESITIN'], $id); add_SitIn(time, date("y-m-d"), $station, $lab, $id); } else { $message = "<div class = 'alert alert-warning' style = 'width: 265px;'>Reached maximum number of sit-ins.</div>"; } echo "<script>"; //go back to viewPhotos page after 3 seconds. echo "setTimeout(function(){ document.location = '?p=viewProfile&id={$id}'; }, 2000);"; echo "</script>"; } ?> <html> <body> <div class="container">
<?php $id = intval($_GET['id']); $get_info = get_photo($id); $student = find_student($id); $get_detail = get_sitinDetails($id); $id = intval($_GET['id']); $viewSitin = view_Sitin($id); ?> <html> <body> <div class="container"> <div class="row"> <div class="col-md-6"> <h3>Profile</h3> <h4> <?php echo htmlentities($student['STUDLNAME']) . ' , ' . htmlentities($student['STUDFNAME']) . ' ' . htmlentities($student['STUDMNAME']); ?> <a href="?p=addSitIn&id=<?php echo htmlentities($id); ?> "><i class="glyphicon glyphicon-plus"></i>Add Sit-in </a> </h4> <img src="photo.php?id=<?php echo htmlentities($id); ?> " height="300" width="300" style="border:2px black solid;padding:10px 10px;"/> <?php if ($get_info['stat'] == 1) { echo "<div class='alert alert-success text-center' style='max-width:300px'>Status: ACTIVE</div>";