-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinvoice1.php
More file actions
41 lines (34 loc) · 1.13 KB
/
invoice1.php
File metadata and controls
41 lines (34 loc) · 1.13 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
<?php
$server="localhost";
//$username="root";
$pass="";
// $id=$_GET['id'];
// $ow=$_GET['ow'];
// $service=$_GET['service'];
// $date=$_GET['date'];
$on=$_POST['sid'];
$cat=$_POST['name'];
$st=$_POST['service'];
$dates=$_POST['dt'];
$un=$_POST['amt'];
$conn=mysqli_connect($server,"root",$pass,'vcs');
$sql="Select username from service where id=$on";
$result = $conn->query($sql);
$rr='';
while($row=$result->fetch_assoc())
{
$rr=$row['username'];
}
if(!$conn){
die('Error:cant connect');
}
else{
//$query="SELECT name from "
$stmt = $conn->prepare("insert into invoice(sid,username,name,service,date,amount,status) values(?,?,?,?,?,?,'unpaid')");
$stmt->bind_param("issssi",$on,$rr,$cat,$st,$dates,$un);
$stmt->execute();
echo "New Service Registered Successfully";
header("location: http://localhost/vsc/admin.html");
exit;
}
?>