-
Notifications
You must be signed in to change notification settings - Fork 0
/
rolls_pages_group_add.php
92 lines (75 loc) · 2.49 KB
/
rolls_pages_group_add.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php include ('inc_php_funtions.php'); ?>
<?php
//if (isset($_POST['HEADING']))
if($_POST) {
if(isset($_POST['STATUS']) && $_POST['STATUS'] == '1')
{
$STATUS = 1;
}
else {
$STATUS = 0;
}
$GROUPNAME = normalize_str($_POST['GROUPNAME']);
$sql="INSERT INTO `rolls_ms_pages_group` (GROUPNAME, STATUS)
VALUES ('$GROUPNAME', '$STATUS')";
if(!mysqli_query($link, $sql)){
echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
}
/*echo ("<script>location='comp-pg_edit.php?id=$MXID&preID=$preID&page=$page&added=y'</script>");*/
}
?>
<div class="alert alert-success" role="alert">
<strong>Success!</strong> Product Successfully Added!
</div>
<div id="form-content">
<form method="post" id="product_add" name="productAdd" autocomplete="off">
<div class="modal-body">
<div class="container">
<div class="row sml-padding">
<div class="col-lg-3"><label class="control-label">Group Name</label></div>
<div class="col-lg-9">
<input name="GROUPNAME" class="form-control" type="text" required>
</div>
</div>
<div class="row sml-padding">
<div class="col-lg-3"><label class="control-label">Status</label></div>
<div class="col-lg-9"><label><input type="checkbox" name="STATUS" value="1" checked="checked" /> Active</label></div>
</div>
</div>
</div>
<div class="modal-footer">
<input type="reset" class="btn btn-default pull-left" value="Clear">
<input type="submit" class="btn btn-primary" name="ProductAddSbmt" value="Submit">
</div>
</form>
</div>
<script type="text/javascript">
/*autohide alert*/
$(document).ready(function () {
window.setTimeout(function() {
$(".alert").fadeTo(1500, 0).slideUp(500, function(){
$(this).remove();
});
}, 6000);
});
/*autohide alert*/
$(document).ready(function() {
// submit form using $.ajax() method
$('#product_add').submit(function(e){
e.preventDefault(); // Prevent Default Submission
$.ajax({
url: 'rolls_pages_group_add.php',
type: 'POST',
data: $(this).serialize() // it will serialize the form data
})
.done(function(data){
$('#form-content').fadeOut('slow', function(){
$('#form-content').fadeIn('slow').html(data);
});
})
.fail(function(){
alert('Ajax Submit Failed ...');
});
});
});
</script>