-
Notifications
You must be signed in to change notification settings - Fork 1
/
finance.php
70 lines (65 loc) · 2.2 KB
/
finance.php
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
62
63
64
65
66
67
68
69
70
<?php if(!isset($conn)){ include 'db_connect.php'; } ?>
<div class="col-lg-12">
<div class="card card-outline card-primary">
<div class="card-body">
<form action="" id="manage-project">
<input type="hidden" name="id" value="<?php echo isset($id) ? $id : '' ?>">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="" class="control-label">Name</label>
<input type="text" class="form-control form-control-sm" name="name" value="<?php echo isset($name) ? $name : '' ?>" required>
</div>
</div>
</div>
<div class="row">
<div class="col-md-10">
<div class="form-group">
<label for="" class="control-label">Description</label>
<textarea name="description" id="" cols="30" rows="10" class="summernote form-control" required>
<?php echo isset($description) ? $description : '' ?>
</textarea>
</div>
</div>
</div>
<div class="row">
<div class="col-md-10">
<div class="form-group">
<label for="amount" class="">Amount:</label>
<input type="number" id="amount" required>
</div>
</div>
</div>
</form>
</div>
<div class="card-footer border-top border-info">
<div class="d-flex w-100 justify-content-center align-items-center">
<button class="btn btn-flat bg-gradient-primary mx-2" form="manage-project">Save</button>
<button class="btn btn-flat bg-gradient-secondary mx-2" type="button" onclick="location.href='index.php?page=financial_list'">Cancel</button>
</div>
</div>
</div>
</div>
<script>
$('#manage-project').submit(function(e){
e.preventDefault()
start_load()
$.ajax({
url:'ajax.php?action=save_project',
data: new FormData($(this)[0]),
cache: false,
contentType: false,
processData: false,
method: 'POST',
type: 'POST',
success:function(resp){
if(resp == 1){
alert_toast('Data successfully saved',"success");
setTimeout(function(){
location.href = 'index.php?page=financial_list'
},2000)
}
}
})
})
</script>