forked from theadityachoudhury/75-Attendence
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprinty.php
More file actions
38 lines (31 loc) · 1.61 KB
/
printy.php
File metadata and controls
38 lines (31 loc) · 1.61 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
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
<link rel="icon" type="image/png" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/icon-font.min.css">
<span class="login100-form-title p-b-32">
75 Attendance
</span>
<?php
$totpercent = ($present/$total)*100;
$totpercent = number_format((float)$totpercent, 2, '.', '');
if ($present<0 || $total<0 || $present>$total){
echo "<h5>Please enter correct values!!</h5>";
}
elseif ($present/$total >= $percent/100){
$db = intval((100*$present-$percent*$total)/$percent);
$new_tot = $total+$db;
echo "<h4>Current Attendance : <strong>$present/$total</strong> = <strong>$totpercent</strong>%</h4><br>";
echo "<h4>You can bunk for <strong>$db days</strong></h4><br>";
echo "<h4>Attendance After $db Bunks : $present/$new_tot = $percent%</h4><br>";
}
else{
$reqattendence = intval(($percent*$total-100*$present)/(100-$percent));
echo "<h4>You have to attend $reqattendence more days to have $percent% attendence</h4><br>";
echo "<h4>Current Attendance : $present/$total = $totpercent%</h4><br>";
echo "<h4>Total Attendence Required (Present/Total) : ",$reqattendence+$present,"/",$reqattendence+$total,"</h4><br>";
}
?>
<div class="container-login100-form-btn" style= "padding-top:20px; align-items:center;">
<button onclick="history.back()" class="login100-form-btn" style="text-align:center">
Go Back
</button></div>