-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.php
More file actions
144 lines (110 loc) · 2.85 KB
/
function.php
File metadata and controls
144 lines (110 loc) · 2.85 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?php
session_start();
$con=mysqli_connect("localhost","phpmyadmin","Ratankumar@96","bankdb");
/*if(isset($con)){
echo "ok";
*/
if(isset($_POST['login_submit']))
{
$username=$_POST['username'];
$password=$_POST['password'];
$query="select * from adlogintb where adusername='$username' and adpassword='$password'";
$result=mysqli_query($con,$query);
if(mysqli_num_rows($result)==1)
{
$id=$data['accountno'];
$_SESSION['uid']=$id;
header("Location:admin_home.php");
}
else
{
echo "<script>alert('Enter the correct details.');</script>";
echo "<script>window.open('adminlogin.php','_self')</script>";
}
}
//backend of registration page
if(isset($_POST['account_register']))
{
$name=$_POST['name'];
$password=$_POST['password'];
$gender=$_POST['gender'];
$email=$_POST['email'];
$contact=$_POST['contact'];
//$tempimg=$_FILES['photo']['tmp_name'];
//$photo=$_POST['photo'];
$file_name=$_FILES['photo']['name'];
$file_type=$_FILES['photo']['type'];
$file_size=$_FILES['photo']['size'];
$file_temp_loc=$_FILES['photo']['tmp_name'];
$file_store="upload/".$file_name;
//$imgname=$_FILES['photo'];
//print_r($imgname);
$img_store="uploadimg/".$imgname;
/*if(move_uploaded_file($file_temp_loc,$file_store))
{
echo "file uploaded ";
}*/
$address=$_POST['address'];
$state=$_POST['state'];
$city=$_POST['city'];
$district=$_POST['district'];
$zipcode=$_POST['zip'];
$accountType=$_POST['accountType'];
$amount=$_POST['amount'];
$accountno=$_POST['accountno'];
//print_r($accountType);
//echo $accountType;
$query="INSERT INTO registration(name,password,gender,email,contact,photo,address,state,city,district,zip,accountType,amount,accountno) VALUES ('$name','$password','$gender','$email','$contact','$file_name','$address','$state','$city','$district','$zipcode','$accountType','$amount','$accountno')";
$result=mysqli_query($con,$query);
if($result)
{
echo "<script>alert('Account Registered');</script>";
//echo "<script>window.open('admin-panel.php','_self')</script>";
}
else{
echo $con->error;
}
}
//backend of user_details page
function get_user_details()
{
global $con;
$query="select * from registration";
$result=mysqli_query($con,$query);
while($row=mysqli_fetch_array($result))
{
$name=$row['name'];
$password=$row['password'];
$email=$row['email'];
$contact=$row['contact'];
$accountno=$row['accountno'];
echo "<tr>
<td>$name</td>
<td>$password</td>
<td>$email</td>
<td>$contact</td>
<td>$accountno</td>
</tr>";
}
}
//backend of Account_deatils page
function get_account_details()
{
global $con;
$query="select * from registration";
$result=mysqli_query($con,$query);
while($row=mysqli_fetch_array($result))
{
$name=$row['name'];
$accountType=$row['accountType'];
$amount=$row['amount'];
$accountno=$row['accountno'];
echo "<tr>
<td>$name</td>
<td>$accountType</td>
<td>$amount</td>
<td>$accountno</td>
</tr>";
}
}
?>