deleteperson.blade.php
1.88 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
50
51
52
53
54
55
56
57
58
59
60
61
<?php
$empid=Input::get("deleteid");
$person=$wakka->getPerson($empid);
if($person&&$wakka->IsAdmin())
{
//backup record
$wakka->Query("insert into records_bk set id='$empid',created=now(),modified=now(),peopledata='".serialize($person['peopledata'])."',modifylog='".serialize($person['modifylog'])."',dirty='".serialize($person['dirty'])."',hrstatus='DELETED',accountstatus='DELETED'");
$wakka->Query("delete from records where id='$empid' limit 1;");
}
?>
<div class="layout-app"><!-- row-app -->
<div class="row row-app">
<div class="col-md-12">
<div class="col-separator col-separator-first col-unscrollable box">
<div class=innerAll>
<fieldset>
<input type=hidden name=_token value='<?php echo csrf_token(); ?>'>
<p><label class='label-small_new' style='width:15%'>Enter Employee ID</label><input class='form_new' type=text name=deleteid id=deleteid></p>
<p><label></label><input type=button class='btn btn-denim' value="Delete Employee" onclick='hrmsDelEmp();return false;'></p>
</fieldset>
<?php
if(isset($_POST['deleteid']))
{
if(!$person)echo "<h1>No Record Found!!</h1>";
else if(!($wakka->IsAdmin()))echo "<h1>You Dont Have Delete Rights</h1>";
else
{
echo "<h1>Deleted Record :-</h1>";
echo "<table id=mytasktab class=fullwidth cellpadding=0 cellspacing=0 border=0><thead><tr><td><b>Name</b></td><td><b>AssignedTo</b></td></tr></thead>";
foreach($person['peopledata'] as $key=>$val)
{
if($val!='')echo "<tr><td>$key</td><td>$val</td></tr>";
}
echo "</table>";
}
}
?>
<script>
function hrmsDelEmp()
{
doAjax("hr?action=DeletePerson","deleteid="+$("#deleteid").val(),"content","ajaxDelEmp","varajax","POST");
}
</script>
</div>
</div>
</div>
</div>
</div><!-- // END row-app -->