-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchkOfficerdetail.php
71 lines (62 loc) · 2.1 KB
/
chkOfficerdetail.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
<?php
error_reporting(0);
//session_start();
include("config.php");
$firstname = $_POST['fname'];
$middlename = $_POST['mname'];
$lastname = $_POST['lname'];
$gender = $_POST['gender'];
$address =$_POST['address'];
$pincode = $_POST['pincode'];
$contactno = $_POST['contactno'];
$emailid= $_POST['emailid'];
$city =$_POST['city'];
$pincode = $_POST['pincode'];
$jdate = $_POST['jdate'];
$m = substr($jdate,0,2);
$d = substr($jdate,3,2);
$y = substr($jdate,6,4);
$jdate = $y."-".$m."-".$d;
$ldate= $_POST['ldate'];
$m = substr($ldate,0,2);
$d = substr($ldate,3,2);
$y = substr($ldate,6,4);
$ldate = $y."-".$m."-".$d;
$pstationname =$_POST['psname'];
$designation = $_POST['designation'];
$username=$_POST['loginname'];
$password=$_POST['password'];
$rpassword=$_POST['rpassword'];
if($password == $rpassword)
{
$insertloginQuery = "insert into mstr_login(username,password,type)
values ('".$username."','".$password."','Police Officer')";
$insertQuery = "insert into mstr_profile(first_name,middle_name,last_name,gender,address,
contact_no,emailid,username,city_id,pincode)
values ('".$firstname."','".$middlename."','".$lastname."',
'".$gender."','".$address."','".$contactno."',
'".$emailid."','".$username."',
'".$city."','".$pincode."' )";
$insertOfficer = "insert into mstr_officer(username,Jdate,Ldate,desi_id,poilcestation_id)
values('".$username."','".$jdate."','".$ldate."',
'".$designation."','".$pstationname."')";
$msg = base64_encode("Registered Successfully");
//echo "$insertloginQuery";
//echo "$insertQuery";
//echo "$insertOfficer";
mysql_query($insertloginQuery) or die("Error in login entry values");
mysql_query($insertQuery) or die("error in insert record");
if(mysql_query($insertOfficer))
{
header("location:home.php?msg=$msg");
}
else
{
header("location:officerdetail.php?msg=Not Registered");
}
}
else
{
echo "Error:Password missmatch";
}
?>