-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwelcome.php
More file actions
202 lines (163 loc) · 7.8 KB
/
welcome.php
File metadata and controls
202 lines (163 loc) · 7.8 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<?php
session_start();
include 'siteConfig.php';
include 'dbConfig.php';
if(!isset($_SESSION['username']) || empty($_SESSION['username']))
{
header("location: ".HOME_URL."");
}
else
{
$username = $_SESSION['username'];
$q = "SELECT owner_name, username FROM owner where username = '$username';";
$result = $conn->query($q);
$row = $result->fetch_assoc();
$name = $row['owner_name'];
$username = $row['username'];
$q1 = "SELECT business_name FROM business INNER JOIN owner ON business.business_owner = owner.username where owner.username = '$username';";
$result_business_name = $conn->query($q1);
$div ='';
while($row_business_name = $result_business_name->fetch_assoc())
{
$div.='<div class="row" style="margin-bottom:10px!important;">
<div class="col-lg-4 offset-lg-4 col-sm-6 offset-sm-3 col-md-4 offset-md-4 text-center" >
<div class="card" >
<div class="card-body" style="padding: 5 10 5 10;">
<h5 class="card-title">'.$row_business_name['business_name'].'</h5>
<a href="#" style=" display:\"\";" class="btn btn-default btn-radius " id="login-button-'.trim( $row_business_name['business_name']).'" onClick="showLogin(\'login-button-'.trim( $row_business_name['business_name']).'\', \'business-login-form-'.trim($row_business_name['business_name']).'\');">LOGIN</a>
<div class="row" id="business-login-form-'.trim($row_business_name['business_name']).'" style="display: none;">
<form class="form" method ="post" action="businessHome.php" >
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 offset-lg-1 offset-md-1 offset-sm-1 form-group">
<label for="password">Password</label>
<input type="hidden" value="'.trim($row_business_name['business_name']).'" name="business_name"></input>
<input type="password" placeholder="Enter Password....." name="business_password" class="form-group form-control"></input>
</div>
<div class="col-lg-2 col-md-2 col-sm-2 text-center form-group" style="top: 30px;">
<button type="submit" name="business_login" class="btn btn-circle btn-submit "><i class="fa fa-check"></i></button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
';
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=yes">
<meta name="description" content="">
<meta name="author" content="">
<title>Welcome to ERP Lite</title>
<!-- Bootstrap core CSS -->
<link href="<?php echo HOME_URL.'/vendor/bootstrap/css/bootstrap.min.css'?>" rel="stylesheet">
<!-- Custom fonts for this template -->
<link href="<?php echo HOME_URL.'/vendor/font-awesome/css/font-awesome.min.css'?>" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Cabin:700' rel='stylesheet' type='text/css'>
<!-- Custom styles for this template -->
<link href="<?php echo HOME_URL.'/css/grayscale.min.css'?>" rel="stylesheet">
</head>
<body id="page-top">
<div class="row" style="margin-top: 15px;">
<div class="col-lg-1 col-md-3 col-sm-4 col-xs-6 offset-lg-10 offset-md-9 offset-sm-8 offset-xs-6 text-center">
<div class="logout-button text-center">
<a type = "button" href="<?php echo HOME_URL; ?>/logout.php" class="btn btn-default btn-radius">Log Out</a>
</div>
</div>
</div>
<!-- Intro Header -->
<div class="bgclass">
</div>
<header class="masthead">
<div class="intro-body">
<div class="container">
<div class="row ">
<div class="col-lg-6 offset-lg-3 col-md-8 offset-md-2 ">
<h2 >Welcome,</h2><h2 class="brand-heading business-owner"> <?php if(isset($name) && !empty($name)) echo $name; ?></h2>
</div>
</div>
<?php if(isset($div)) echo $div; ?>
<div class="row">
<div class="col-md-4 offset-md-4 ">
<div class="text-center">
<a type="button" class="btn btn-default btn-radius" id="addbusiness" data-toggle="modal" data-target="#businessModal">ADD NEW BUSINESS</a>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- Modal -->
<div id="businessModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" style="color: black">ADD NEW BUSINESS</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
<form action="addbusiness.php" method="post">
<div class="form-group">
<label class="sr-only" for="business_name">Business Name</label>
<input type="text" name="business_name" placeholder="Enter Business Name..." class="form-control">
</div>
<div class="form-group">
<label class="sr-only" for="business_address">Business Address</label>
<input type="text" name="business_address" placeholder="Enter Business Address..." class="form-control">
</div>
<div class="form-group">
<label class="sr-only" for="business_owner">Business Owner</label>
<input type="hidden" name="business_owner" value="<?php echo $username; ?>" class="form-control">
</div>
<div class="form-group">
<label class="sr-only" for="business_password">Passwords</label>
<input type="text" name="business_password" placeholder="Enter Business Password..." class="form-control">
</div>
<div class="form-group">
<label class="sr-only" for="GSTIN">GSTIN</label>
<input type="text" name="GSTIN" placeholder="Enter GST Registration Number..." class="form-control">
</div>
<div class="form-group">
<label class="sr-only" for="business_pan">PAN</label>
<input type="text" name="business_PAN" placeholder="Enter Business PAN..." class="form-control">
</div>
<div class="form-group">
<label class="sr-only" for="business_mobile">Mobile</label>
<input type="text" name="business_mobile" placeholder="Enter Business contact..." class="form-control">
</div>
<button type="submit" class="btn btn-black btn-radius" name = "addbusiness">ADD</button>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-radius" data-dismiss="modal" >Close</button>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function showLogin(id1, id2){
console.log(id1);
console.log(id2);
document.getElementById(id1).style.display = "none";
document.getElementById(id2).style.display = "block";
}
</script>
<!-- Bootstrap core JavaScript -->
<script src="<?php echo HOME_URL.'/vendor/jquery/jquery.min.js'?>"></script>
<script src="<?php echo HOME_URL.'/vendor/bootstrap/js/bootstrap.min.js'?>"></script>
<!-- Plugin JavaScript -->
<script src="<?php echo HOME_URL.'/vendor/jquery-easing/jquery.easing.min.js'?>"></script>
<!-- Custom scripts for this template -->
<script src="<?php echo HOME_URL.'/js/grayscale.min.js'?>"></script>
</body>
</html>