-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeletecount.php
More file actions
49 lines (40 loc) · 1.3 KB
/
deletecount.php
File metadata and controls
49 lines (40 loc) · 1.3 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
39
40
41
42
43
44
45
46
47
48
49
<?php
session_start();
$del_id=$_GET['id'];
include 'db_conn.php';
$sql = "delete from counts where id='$del_id'";
$result = mysqli_query($conn,$sql);
if($result)
{
echo "<script>alert('counts Deleted Successfully')</script>";
header("Location: viewform_count.php");
}
{
try{
$login_tym = $_SESSION["login_tym"] ;
$emp_id = $_SESSION["empid"] ;
$sql = "select * from log_details where login_tym ='$login_tym' and emp_id ='$emp_id' ";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($result);
$action = $row['action'];
$form = $row['form'];
$t1 = $action.",deleted count";
$t2 = $form.", count form";
$sql = "update log_details set action = '$t1', form = '$t2' where login_tym ='$login_tym' and emp_id ='$emp_id'";
$result = mysqli_query($conn,$sql);
echo '<div class="alert alert-success alert-dismissable" id="flash-msg" style="margin-top:70px">
<h4>count deleted successfully</h4>
</div>';
}
catch(e)
{
echo e;
}
}
?>
<script>
const alertBox = document.getElementById("flash-msg");
setTimeout(() => {
alertBox.style.display = "none";
}, 3000);
</script>