include("includes/db.php");
if(isset($_REQUEST["gref"]))
{
// echo "<pre>";
// print_r($_REQUEST);
// die;
$date=date('d-m-Y');
$time=date('H:i:s');
$gref=$_REQUEST["gref"];
$gip=$_REQUEST["gip"];
$gport=$_REQUEST["gport"];
$staff=$_REQUEST["staff"];
$mgw=$_REQUEST["mgw"];
$mussd=$_REQUEST["mussd"];
$prob=$_REQUEST["problem"];
$action=$_REQUEST["action"];
echo
//echo 1;
mysql_query("insert into minutes(date,time,g_ref,g_ip,g_port,staff,m_gw,m_ussd,problem,action,comment)values('$date','$time','$gref','$gip','$gport','$staff','$mgw','$mussd','$prob','$action','$comment')");
echo 1;
die;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="main.css" />
<script src="main.js"></script>
</head>
<body>
<form method="post" id="frm1">
Gateway Ref:
<select name="gref">
<option>Select Any One</option>
<option value="Ish-01-Qmr">Ish-01-Qmr</option>
</select><br><br>
Gateway IP:<Input type="radio"name="gip"value="192.168.101.101" required>192.168.101.101<Input type="radio"name="gip"value="192.168.101.102" required>192.168.101.102
</select><br><br>
Gateway Port:
<select name="gport" required>
<option value="">Select Any One</option>
<option value="Port00">Port00</option>
<option value="Port01">Port01</option>
<option value="Port02">Port02</option>
<option value="Port03">Port03</option>
<option value="Port04">Port04</option>
<option value="Port05">Port05</option>
<option value="Port06">Port06</option>
<option value="Port07">Port07</option>
<option value="Port08">Port08</option>
<option value="Port09">Port09</option>
<option value="Port10">Port10</option>
<option value="Port11">Port11</option>
<option value="Port12">Port12</option>
<option value="Port13">Port13</option>
<option value="Port14">Port14</option>
<option value="Port15">Port15</option>
</select><br><br>
Staff:<Input type="text" name="staff"><br><br>
Minutes On Gateway:<Input type="text" name="mgw"><br><br>
Minutes On USSD:<Input type="text" name="mussd"><br><br>
Problem:
<select name="problem">
<option>Select Any One</option>
<option value="Package minutes consumed.">Package minutes consumed.</option>
<option value="Not showing USSD response.">Not showing USSD response.</option>
<option value="Sim Blocked.">Sim Blocked.</option>
<option value="Port Status showing Power Off.">Port Status showing Power Off.</option>
<option value="Port Status showing No SIM Card.">Port Status showing No SIM Card.</option>
</select><br><br>
Action:
<select name="action">
<option>Select Any One</option>
<option value="Minutes in overview are set as USSD.">Minutes in overview are set as USSD.</option>
</select><br><br>
Comments:<Input type="text" name="comment" required><br><br>
<br><br>
<Input type="submit" value="insert" name="submit">
</form>
</body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> <!-- load jquery via CDN -->
<script>
$(document).ready(function(){
$('form').submit(function(event) {
event.preventDefault();
// get the form data
// there are many ways to get this data using jQuery (you can use the class or id also)
var formData = $(this).serializeArray()
// process the form
$.ajax({
type : 'POST', // define the type of HTTP verb we want to use (POST for our form)
// url : '', // the url where we want to POST
data : formData, // our data object
dataType : 'json', // what type of data do we expect back from the server
encode : true
})
// using the done promise callback
.done(function(data) {
// reset the form data
document.getElementById('frm1').reset();
// log data to the console so we can see
alert('done');
// here we will handle errors and validation messages
});
// stop the form from submitting the normal way and refreshing the page
});
})
</script>
</html>