-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPitchtype.php
More file actions
117 lines (94 loc) · 2.3 KB
/
Pitchtype.php
File metadata and controls
117 lines (94 loc) · 2.3 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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
session_start();
include('Connect.php');
if (isset($_SESSION['AID']))
{
if (isset($_POST['btnptype']))
{
$ptname=$_POST['txtptname'];
$checkemail = "SELECT * from PitchType Where PitchTypeName='$ptname'";
$result=mysqli_query($connect,$checkemail);
$count=mysqli_num_rows($result);
if ($count>0)
{
echo "<script>window.alert('Pitch type already existed')</script>";
echo "<script>window.location='Dashboard.php'</script>";
}
else
{
$insert="INSERT INTO PitchType (PitchTypeName)
VALUES ('$ptname')";
$finalResult=mysqli_query($connect,$insert);
if ($finalResult) {
echo "<script>window.alert('Pitch Type submited Successfully!')</script>";
echo "<script>window.location='PitchType.php'</script>";
}
}
}
}
else
{
echo "<script>window.alert('Login Failed')</script>";
echo "<script>window.location='Sites.php'</script>";
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="Style4.css">
<title></title>
</head>
<body>
<header>
<div class="logo">
<img src="Images/mainlogo.jpg" alt="image" width="100px">
</div>
</header>
<div class="admlog">
<div class="innerRG">
<form action="Pitchtype.php" method="POST">
<label>Pitch Type Name</label>
<input type="text" name="txtptname"
placeholder="Enter Pitch Type Name" class="control">
<input type="submit" name="btnptype" value="Submit" class="btnar">
</form>
</div>
</div>
<legend>Pitch Type List</legend>
<?php
$select = "SELECT * FROM PitchType";
$query= mysqli_query($connect, $select);
$count=mysqli_num_rows($query);
if ($count==0)
{
echo "<p>No record for Pitch Type</p>";
}
?>
<table class="innerRG">
<tr>
<th>ID</th>
<th>Pitch Type Name</th>
<th>Action</th>
</tr>
<?php
for ($i=0; $i <$count; $i++)
{
$data=mysqli_fetch_array($query);
$ptid=$data['PitchTypeID'];
$ptnm=$data['PitchTypeName'];
echo "<tr>";
echo "<td>$ptid</td>";
echo "<td>$ptnm</td>";
echo "<td>
<a href='PitchTypeUpdt.php?PtID=$ptid'>Update</a>|
<a href='PitchTypeDel.php?PtID=$ptid'>Delete</a>
</td>
";
echo "</tr>";
}
?>
</table>
</body>
</html>