├── LICENSE
├── README.md
├── account.php
├── activeusers.php
├── adduser.php
├── app
├── ajax-classes
│ ├── chart.php
│ ├── client_budget.php
│ ├── email-allow.php
│ ├── facebook-allow.php
│ ├── github-allow.php
│ ├── google-allow.php
│ ├── index.html
│ ├── register-user.php
│ ├── reset-password.php
│ ├── twitter-allow.php
│ └── user-login.php
├── classes
│ ├── App.php
│ ├── AppAutho.php
│ ├── Changepassword.php
│ ├── ClientMsg.php
│ ├── Frontend.php
│ ├── Permissions.php
│ ├── Roles.php
│ ├── Users.php
│ └── index.html
├── config
│ ├── config.php
│ └── index.html
├── helpers
│ ├── Format.php
│ └── index.html
├── inc
│ ├── breadcrumb.php
│ ├── footer.php
│ ├── header.php
│ ├── index.html
│ └── sidebar.php
├── index.html
├── lib
│ ├── Database.php
│ ├── Session.php
│ └── index.html
└── uploads
│ ├── index.html
│ ├── logo
│ ├── 00dad79ae1ac0f2.png
│ ├── 00dad79ae1ac0f260196.png
│ └── index.html
│ └── userAvatar
│ ├── 1204e2351a.jpg
│ ├── 1848b2f52b.jpg
│ ├── 25d37110db.png
│ ├── 369187ff7a.png
│ ├── 479e72eaca.jpg
│ ├── 5b270dd3d9.png
│ ├── 72050401f6.jpg
│ ├── 8d3e608256.jpg
│ ├── c362c75f91.jpg
│ ├── c7e375639e.jpg
│ ├── d656ca8a78.png
│ ├── db5433f879.jpg
│ ├── dev.jpg
│ ├── ec6120cc76.png
│ └── edb274937c.png
├── assets
├── css
│ ├── Chart.min.css
│ ├── animate.css
│ ├── authotication.css
│ ├── bootstrap-datetimepicker.min.css
│ ├── bootstrap-toggle.min.css
│ ├── bootstrap.min.css
│ ├── dataTables.bootstrap4.min.css
│ ├── index.html
│ ├── normalize.css
│ ├── responsive.css
│ ├── select2-bootstrap.min.css
│ ├── select2.min.css
│ └── style.css
├── icofont
│ ├── demo.html
│ ├── fonts
│ │ ├── icofont.eot
│ │ ├── icofont.svg
│ │ ├── icofont.ttf
│ │ ├── icofont.woff
│ │ └── icofont.woff2
│ ├── icofont.css
│ ├── icofont.min.css
│ └── index.html
├── iconfont
│ ├── MaterialIcons-Regular.eot
│ ├── MaterialIcons-Regular.ijmap
│ ├── MaterialIcons-Regular.svg
│ ├── MaterialIcons-Regular.ttf
│ ├── MaterialIcons-Regular.woff
│ ├── MaterialIcons-Regular.woff2
│ ├── README.md
│ ├── codepoints
│ ├── index.html
│ └── material-icons.css
├── images
│ ├── icons
│ │ ├── avatar_user.jpg
│ │ └── favicon.png
│ └── index.html
├── index.html
└── js
│ ├── Chart.bundle.min.js
│ ├── bootstrap-datetimepicker.min.js
│ ├── bootstrap-toggle.min.js
│ ├── bootstrap.min.js
│ ├── dataTables.bootstrap4.min.js
│ ├── index.html
│ ├── jquery.dataTables.min.js
│ ├── jquery.min.js
│ ├── moment-with-locales.min.js
│ ├── plugins.js
│ ├── popper.min.js
│ ├── script.js
│ ├── select2.min.js
│ └── wow.min.js
├── bandusers.php
├── changepass.php
├── createrole.php
├── dashboard.php
├── editprofile.php
├── editrole.php
├── index.php
├── login.php
├── newusers.php
├── permissions.php
├── pro_usermanagent.sql
├── register.php
├── reset-password.php
├── role.php
├── settings.php
├── users.php
└── viewuser.php
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Nababur Rahaman
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | # Pro User Management System with PHP MySQL and Ajax
3 |
4 |
Pro User Management System is a powerful PHP Ajax script that offers a secure user management system. The application is a great way to build your website, allowing your users to register an account and build restricted access to certain users. We offer great support and it’s very easy to install. It’s powered by MYSQL and PHP, Ajax.
5 |
6 |
7 |
8 |
Script Features::-
9 |
10 |
User Login and Registration features:
11 |
12 |
13 | - User registration with email
14 | - User Login with remember password(SHA1()).
15 | - Change password.
16 | - User profile.
17 | - User profile edit & save.
18 |
19 |
20 |
Admin Panel features:
21 |
22 |
23 | - Dashboard (Total Users, Deleted Users, Band Users, Active Users, Monthly total register users,)
24 | - Sign Up user
25 | - User disable/Enable feature
26 | - User email support
27 | - Mail confirmation
28 | - Admin password Chane password.
29 | - Admin profile.
30 | - Users list.
31 | - Add new user with role.
32 | - Edit & save user.
33 | - Delete user.
34 | - Many more features, you can have a look in live video link
35 |
36 |
37 |
38 | Script Thumbnails::-
39 |
40 |
41 | 
42 | 
43 | 
44 | 
45 | 
46 | 
47 | 
48 | 
49 |
50 |
51 |
52 |
How to Install
53 |
54 |
55 | - Create a database name (pro_usermanagent)
56 | - Import database file (pro_usermanagent.sql)
57 | - Admin:Info
58 | - Admin username: nababurdev@gmail.com
59 | - Admin pass: An123456
60 | - Live video a Youtube
61 |
62 |
63 |
64 |
65 |
Author
66 |
Nababur Rahaman
67 |
72 |
Buy me a coffee :)
73 |
74 |
75 |
76 |
77 |
78 |
79 |
Happy Open Source....
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/account.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | location.href='dashboard.php';";
10 | exit();
11 |
12 | }else{
13 | $myid = preg_replace('/[^a-zA-Z0-9-]/', '', $myid);
14 | $myprofile = $usr->getUserById($myid);
15 | }
16 |
17 |
18 |
19 | ?>
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | fetch_assoc()) {
34 |
35 | ?>
36 |
37 |
38 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
89 |
96 |
97 |
103 |
104 |
110 |
111 |
117 |
118 |
125 |
132 |
133 |
140 |
141 |
148 |
158 |
168 |
177 |
178 |
179 |
180 |
181 |
182 |
187 |

188 |
189 |

191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 | window.location='dashboard.php';";
209 | }
210 | ?>
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
--------------------------------------------------------------------------------
/activeusers.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | deleteUserById($delid);
12 | }
13 | ?>
14 |
15 | DisableUserById($disid);
21 | }
22 |
23 |
24 | // Id Enable method
25 | $enid = isset($_GET['enid']) ? $_GET['enid'] : '';
26 | if(isset($_GET['enid'])){
27 | $enid = preg_replace('/[^a-zA-Z0-9-]/', '', $_GET['enid']);
28 | $enableId = $usr->EnableUserById($enid);
29 | }
30 |
31 |
32 |
33 | ?>
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
59 |
60 |
61 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 | SL |
87 | Avatar |
88 | Name |
89 | Email |
90 | Role |
91 | Status |
92 | Action |
93 |
94 |
95 |
96 |
97 | onlyActiveUsers();
100 | if ($userlist) {
101 | $i = 0;
102 | while ($result = $userlist->fetch_assoc()) {
103 | $i++;
104 |
105 |
106 | ?>
107 |
108 |
109 |
110 | style='color:red'
111 | >
112 |
113 | |
114 |
115 |
120 |
121 |  |
122 |
123 |
124 |  |
125 |
126 |
127 |
128 |
129 | |
130 | |
131 | |
132 |
133 |
134 | Active
135 |
136 | Deactive
137 |
138 |
139 | |
140 |
141 |
142 |  View user 
143 |  Delete  |
144 |
145 |
146 |
147 |
148 |
149 | No active users yet ! |
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 |
--------------------------------------------------------------------------------
/app/ajax-classes/chart.php:
--------------------------------------------------------------------------------
1 |
2 | getMonthlyNewUser();
14 |
15 | //loop through the returned data
16 |
17 | if ($result) {
18 | $count = mysqli_num_rows($result);
19 | if ($count > 0) {
20 | $data= $count;
21 | }
22 | }
23 |
24 |
25 | //now print the data
26 | print json_encode($data);
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/app/ajax-classes/client_budget.php:
--------------------------------------------------------------------------------
1 | clientProposalMethod($_POST);
12 | exit();
13 | }
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/ajax-classes/email-allow.php:
--------------------------------------------------------------------------------
1 | addEmailValuse($allow_email, $id_autho);
13 | }
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/ajax-classes/facebook-allow.php:
--------------------------------------------------------------------------------
1 | addFacebookAutho($fb_autho, $id_autho);
13 | }
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/ajax-classes/github-allow.php:
--------------------------------------------------------------------------------
1 | addGithubValuse($git_autho, $id_autho);
13 | }
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/ajax-classes/google-allow.php:
--------------------------------------------------------------------------------
1 | addGoogleValuse($gle_autho, $id_autho);
13 | }
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/ajax-classes/index.html:
--------------------------------------------------------------------------------
1 | Deny from all
--------------------------------------------------------------------------------
/app/ajax-classes/register-user.php:
--------------------------------------------------------------------------------
1 | newUserRegistration($_POST);
12 | exit();
13 | }
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/ajax-classes/reset-password.php:
--------------------------------------------------------------------------------
1 | userResetPassword($_POST);
12 |
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/app/ajax-classes/twitter-allow.php:
--------------------------------------------------------------------------------
1 | addTwitterAutho($tw_autho, $id_autho);
13 | }
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/ajax-classes/user-login.php:
--------------------------------------------------------------------------------
1 | userLoginAuthotication($_POST);
12 |
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/app/classes/App.php:
--------------------------------------------------------------------------------
1 | db = new Database();
20 | $this->fm = new Format();
21 | }
22 |
23 |
24 |
25 |
26 |
27 |
28 | // Select update settings
29 | public function selectAllAppSettings(){
30 | $query = "SELECT * FROM $this->table";
31 | $result = $this->db->select($query);
32 | return $result;
33 | }
34 |
35 |
36 |
37 |
38 | // App Update Settings Method
39 | public function updateAppSettings($data, $file, $app_id){
40 | $app_id = $this->fm->validation($data['app_id']);
41 | $app_name = $this->fm->validation($data['app_name']);
42 | $title = $this->fm->validation($data['title']);
43 | $front_name = $this->fm->validation($data['front_name']);
44 | $app_id = mysqli_real_escape_string($this->db->link, $app_id);
45 | $app_name = mysqli_real_escape_string($this->db->link, $app_name);
46 | $title = mysqli_real_escape_string($this->db->link, $title);
47 | $front_name = mysqli_real_escape_string($this->db->link, $front_name);
48 |
49 | $permited = array('jpg', 'jpeg', 'png', 'gif');
50 | $file_name = $file['favicon']['name'];
51 | $file_size = $file['favicon']['size'];
52 | $file_temp = $file['favicon']['tmp_name'];
53 |
54 | $div = explode('.', $file_name);
55 | $file_ext = strtolower(end($div));
56 | $unique_image = substr(md5(time()), 0, 15).'.'.$file_ext;
57 | $uploaded_image = "app/uploads/logo/".$unique_image;
58 |
59 |
60 | // Logo Upload method
61 | $file_logo_name = $file['logo']['name'];
62 | $file_logo_size = $file['logo']['size'];
63 | $file_logo_temp = $file['logo']['tmp_name'];
64 |
65 | $div = explode('.', $file_logo_name);
66 | $file_logo_ext = strtolower(end($div));
67 | $unique_logo_image = substr(md5(time()), 0, 20).'.'.$file_logo_ext;
68 | $uploaded_logo_image = "app/uploads/logo/".$unique_logo_image;
69 |
70 | if ($app_name == "" ) {
71 |
72 | $msg = '
73 |
×
74 |
Error ! Input & Upload fields must not be Empty!
';
75 | return $msg;
76 | exit();
77 | }else{
78 |
79 | if (!empty($file_name) OR !empty($file_logo_name)) {
80 |
81 | if($file_size >1048567 OR $file_logo_size >1048567) {
82 | $msg = '
83 |
×
84 |
Error ! Image Size should be less then 1MB!
';
85 | return $msg;
86 | } elseif (in_array($file_ext, $permited) === false OR in_array($file_logo_ext, $permited) === false) {
87 | $msg = '
88 |
×
89 |
Error ! You can upload only:-'.implode(', ', $permited).'
';
90 | return $msg;
91 | }else{
92 |
93 | // Unlink Image
94 | $unlinkfavicon = "SELECT favicon FROM $this->table WHERE app_id = '$app_id' ";
95 | $unlink_favicon = $this->db->select($unlinkfavicon);
96 |
97 | if ($unlink_favicon == TRUE) {
98 | while ($delimg = $unlink_favicon->fetch_assoc()) {
99 | $favicon = $delimg['favicon'];
100 |
101 | if(is_file($favicon)){
102 |
103 | unlink($favicon);
104 | }
105 |
106 |
107 |
108 | }
109 | }
110 |
111 | // Unlink Logo Image
112 | $unlinklogo = "SELECT logo FROM $this->table WHERE app_id = '$app_id' ";
113 | $unlink_Logo = $this->db->select($unlinklogo);
114 |
115 | if ($unlink_Logo == TRUE) {
116 | while ($delimg = $unlink_Logo->fetch_assoc()) {
117 | $logo = $delimg['logo'];
118 | if(is_file($logo)){
119 |
120 | unlink($logo);
121 | }
122 |
123 | }
124 | }
125 |
126 |
127 | // Move Favicon Uploaded file
128 | move_uploaded_file($file_temp, $uploaded_image);
129 |
130 | // Move Logo Uploaded file
131 | move_uploaded_file($file_logo_temp, $uploaded_logo_image);
132 |
133 |
134 | // Update query
135 | $query = "UPDATE $this->table
136 | SET
137 | app_name = '$app_name',
138 | title = '$title',
139 | front_name = '$front_name',
140 | favicon = '$uploaded_image',
141 | logo = '$uploaded_logo_image'
142 | WHERE app_id = '$app_id'
143 | ";
144 | $updated_row = $this->db->update($query);
145 | if ($updated_row) {
146 | $msg = '
147 |
×
148 |
Success! App Settings Contents Updated Successfully !
';
149 | return $msg;
150 | }else {
151 | $msg = '
152 |
×
153 |
Error ! Settings not Updated!
';
154 | return $msg;
155 | }
156 | }}else{
157 |
158 | $query = "UPDATE $this->table
159 | SET
160 | app_name = '$app_name',
161 | title = '$title',
162 | front_name = '$front_name'
163 | WHERE app_id = '$app_id'
164 | ";
165 | $updated_row = $this->db->update($query);
166 | if ($updated_row) {
167 | $msg = '
168 |
×
169 |
Success! App Settings Contents Updated Successfully !
';
170 | return $msg;
171 |
172 | }else {
173 | $msg = '
174 |
×
175 |
Error ! Settings Data not Updated!
';
176 | return $msg;
177 | }
178 | }
179 | }
180 | }
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 | }
--------------------------------------------------------------------------------
/app/classes/AppAutho.php:
--------------------------------------------------------------------------------
1 | db = new Database();
19 | $this->fm = new Format();
20 | }
21 |
22 |
23 |
24 |
25 |
26 | // Select only User ID
27 | public function selectOnlyAppId(){
28 | $query = "SELECT * FROM $this->table ";
29 | $result = $this->db->select($query);
30 | return $result;
31 | }
32 |
33 |
34 |
35 |
36 | // Add email switch values
37 | public function addEmailValuse($allow_email, $id_autho){
38 | $id_autho = $this->fm->validation($id_autho);
39 | $allow_email = $this->fm->validation($allow_email);
40 | $allow_email = mysqli_real_escape_string($this->db->link ,$allow_email);
41 |
42 | $query = "UPDATE $this->table
43 | SET
44 | allow_email = '$allow_email'
45 | WHERE id_autho = '$id_autho'
46 | ";
47 | $updated_row = $this->db->update($query);
48 | if ($updated_row) {
49 | echo $msg = '
50 |
×
51 |
Success! Allow Registration Changed Save Successfully !
';
52 |
53 | exit();
54 | }else{
55 | echo $msg = '
56 |
×
57 |
Error! Something went wrong !
';
58 | exit();
59 | }
60 |
61 |
62 | }
63 |
64 |
65 | // Add Facebook switch values
66 | public function addFacebookAutho($fb_autho, $id_autho){
67 | $id_autho = $this->fm->validation($id_autho);
68 | $fb_autho = $this->fm->validation($fb_autho);
69 | $fb_autho = mysqli_real_escape_string($this->db->link ,$fb_autho);
70 |
71 | $query = "UPDATE $this->table
72 | SET
73 | fb_autho = '$fb_autho'
74 | WHERE id_autho = '$id_autho'
75 | ";
76 | $updated_row = $this->db->update($query);
77 | if ($updated_row) {
78 | echo $msg = '
79 |
×
80 |
Success! Allow Registration Changed Save Successfully !
';
81 |
82 | exit();
83 | }else{
84 | echo $msg = '
85 |
×
86 |
Error! Something went wrong !
';
87 | exit();
88 | }
89 |
90 |
91 | }
92 |
93 |
94 | // Add Twitter switch values
95 | public function addTwitterAutho($tw_autho, $id_autho){
96 | $id_autho = $this->fm->validation($id_autho);
97 | $tw_autho = $this->fm->validation($tw_autho);
98 | $tw_autho = mysqli_real_escape_string($this->db->link ,$tw_autho);
99 |
100 | $query = "UPDATE $this->table
101 | SET
102 | tw_autho = '$tw_autho'
103 | WHERE id_autho = '$id_autho'
104 | ";
105 | $updated_row = $this->db->update($query);
106 | if ($updated_row) {
107 | echo $msg = '
108 |
×
109 |
Success! Allow Registration Changed Save Successfully !
';
110 |
111 | exit();
112 | }else{
113 | echo $msg = '
114 |
×
115 |
Error! Something went wrong !
';
116 | exit();
117 | }
118 |
119 |
120 |
121 | }
122 |
123 |
124 |
125 |
126 |
127 | // Add Google switch values
128 | public function addGoogleValuse($gle_autho, $id_autho){
129 | $id_autho = $this->fm->validation($id_autho);
130 | $gle_autho = $this->fm->validation($gle_autho);
131 | $gle_autho = mysqli_real_escape_string($this->db->link ,$gle_autho);
132 |
133 | $query = "UPDATE $this->table
134 | SET
135 | gle_autho = '$gle_autho'
136 | WHERE id_autho = '$id_autho'
137 | ";
138 | $updated_row = $this->db->update($query);
139 | if ($updated_row) {
140 | echo $msg = '
141 |
×
142 |
Success! Allow Registration Changed Save Successfully !
';
143 |
144 | exit();
145 | }else{
146 | echo $msg = '
147 |
×
148 |
Error! Something went wrong !
';
149 | exit();
150 | }
151 |
152 |
153 |
154 | }
155 |
156 |
157 |
158 |
159 |
160 |
161 | // Add Github switch values
162 | public function addGithubValuse($git_autho, $id_autho){
163 | $id_autho = $this->fm->validation($id_autho);
164 | $git_autho = $this->fm->validation($git_autho);
165 | $git_autho = mysqli_real_escape_string($this->db->link ,$git_autho);
166 |
167 | $query = "UPDATE $this->table
168 | SET
169 | git_autho = '$git_autho'
170 | WHERE id_autho = '$id_autho'
171 | ";
172 | $updated_row = $this->db->update($query);
173 | if ($updated_row) {
174 | echo $msg = '
175 |
×
176 |
Success! Allow Registration Changed Save Successfully !
';
177 |
178 | exit();
179 | }else{
180 | echo $msg = '
181 |
×
182 |
Error! Something went wrong !
';
183 | exit();
184 | }
185 |
186 |
187 |
188 | }
189 |
190 |
191 |
192 |
193 |
194 | }
--------------------------------------------------------------------------------
/app/classes/Changepassword.php:
--------------------------------------------------------------------------------
1 | db = new Database();
19 | $this->fm = new Format();
20 | }
21 |
22 |
23 |
24 |
25 |
26 | // User Password Change method
27 | public function updatePassword($userid, $data){
28 | $old_password = $this->fm->validation($data['old_password']);
29 | $new_password = $this->fm->validation($data['new_password']);
30 | $confirm_password = $this->fm->validation($data['confirm_password']);
31 |
32 | $old_password = mysqli_real_escape_string($this->db->link, $old_password);
33 | $new_password = mysqli_real_escape_string($this->db->link, $new_password);
34 | $confirm_password = mysqli_real_escape_string($this->db->link, $confirm_password);
35 |
36 |
37 | if (empty($old_password) OR empty($new_password) OR empty($confirm_password)) {
38 | $msg = "Error ! Password field must not be Empty!
";
39 | return $msg;
40 | exit();
41 |
42 | }elseif (strlen($new_password) <= '6') {
43 | $msg = '
44 | Error ! Your Password Must Contain At Least 6 Characters !
';
45 | return $msg;
46 | exit();
47 | }elseif(!preg_match("#[0-9]+#",$new_password)) {
48 | $msg = '
49 | Error ! Your Password Must Contain At Least 1 Number !
';
50 | return $msg;
51 | exit();
52 | }elseif(!preg_match("#[a-z]+#",$new_password)) {
53 | $msg = '
54 | Error ! Your Password Must be Contain At Least 1 Lowercase Letter !
';
55 | return $msg;
56 | exit();
57 | }elseif($new_password != $confirm_password) {
58 | $msg = '
59 | Error ! Password did not matched, please try agian and use same password two fields.
';
60 | return $msg;
61 | exit();
62 | }elseif($old_password == $confirm_password) {
63 | $msg = '
64 | Hey ! You have entered your old password, please re-type again for new Password !
';
65 | return $msg;
66 | exit();
67 | }else{
68 |
69 | $chKOldPassword = "SELECT * FROM $this->table WHERE userid = '$userid' LIMIT 1";
70 | $result = $this->db->select($chKOldPassword);
71 | if ($result != false) {
72 | $value = $result->fetch_assoc();
73 |
74 | if (password_verify($old_password, $value['password'] )) {
75 |
76 |
77 | // Has password Generator
78 | $has_pass = password_hash($new_password, PASSWORD_DEFAULT);
79 | // Update query
80 | $query = "UPDATE $this->table
81 | SET
82 | password = '$has_pass'
83 | WHERE userid = '$userid'
84 | ";
85 | $updated_pass = $this->db->update($query);
86 | if ($updated_pass) {
87 |
88 | //User Password changed thanks giving message
89 | $Date = new DateTime();
90 | $Date = date_format($Date, 'Y-m-d H:i:s');
91 | $email = $value['email'];
92 | $name = $value['name'];
93 | $form = 'nababurdev@gmail.com';
94 | $to = "$email";
95 | $subject = 'You have been changed your password Successfully.';
96 | $headers = "From: " . strip_tags($form) . "\r\n";
97 | $headers .= "Reply-To: ". strip_tags($form) . "\r\n";
98 | $headers .= "CC: nababurdev@gmail.com\r\n";
99 | $headers .= 'MIME-Version: 1.0';
100 | $headers .= 'Content-type: text/html; charset=iso-8859-1';
101 |
102 |
103 | $message = "Your name is : " . strip_tags($name) . "\r\n";
104 | $message .= "Your E-mail is : " . strip_tags($email) . "\r\n";
105 | $message .= "Your New generate password is: " . strip_tags($new_password) . "\r\n";
106 | $message .= "Password changed date is: " . strip_tags($Date) . "\r\n";
107 | $message .= "Message : Please visit our website to login.";
108 | $sendmail = mail($to, $subject, $message);
109 | if ($sendmail) {
110 | $msg = '
111 |
×
112 |
Wow ! Your Password has been Successfully Changed !
';
113 | return $msg;
114 | }else{
115 | $msg = '
116 |
×
117 |
Error ! Something went wrong !
';
118 | return $msg;
119 | }
120 |
121 |
122 |
123 | }else {
124 | $msg = '
125 |
×
126 |
Error ! Something went wrong !
';
127 | return $msg;
128 | }
129 |
130 | }else {
131 | $msg = 'Error ! Your old password did not Matched, Please try again !
';
132 | return $msg;
133 | exit();
134 | }
135 |
136 |
137 |
138 |
139 | }else{
140 | $msg = "Error ! Something went wrong, try again please !
";
141 | return $msg;
142 | exit();
143 |
144 | }
145 |
146 |
147 | }
148 |
149 |
150 | }
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 | }
--------------------------------------------------------------------------------
/app/classes/ClientMsg.php:
--------------------------------------------------------------------------------
1 | db = new Database();
16 | $this->fm = new Format();
17 | }
18 |
19 |
20 |
21 |
22 | // clientProposalMethod
23 | public function clientProposalMethod($data){
24 | $name = $this->fm->validation($data['name']);
25 | $email = $this->fm->validation($data['email']);
26 | $budget = $this->fm->validation($data['budget']);
27 | $frameworks = $this->fm->validation($data['frameworks']);
28 |
29 |
30 |
31 | $name = mysqli_real_escape_string($this->db->link, $name);
32 | $email = mysqli_real_escape_string($this->db->link, $email);
33 | $budget = mysqli_real_escape_string($this->db->link, $budget);
34 | $frameworks = mysqli_real_escape_string($this->db->link, $frameworks);
35 |
36 |
37 |
38 | $pregExp = "/^[a-z0-9_-]+(\.[a-z0-9_-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/";
39 | if ($name == "" || $email == "" || $budget == "" || $frameworks == "") {
40 |
41 | $msg = '
42 | Error ! Input fields must not be Empty!
';
43 | echo $msg;
44 | exit();
45 | }elseif(!filter_var($email, FILTER_VALIDATE_EMAIL)) {
46 | $msg = '
47 | Error ! Please fill up Valid Email !
';
48 | echo $msg;
49 | }elseif(!preg_match($pregExp, $email)) {
50 | $msg = '
51 | Error ! Please fill up Valid Email !
';
52 | echo $msg;
53 |
54 | }else{
55 | //Client Proposal Message
56 |
57 | date_default_timezone_set("Asia/Dhaka");
58 | $Date = new DateTime();
59 | $Date = date_format($Date, 'Y-m-d H:i:s');
60 | $form = $email;
61 | $to = "nababurdev@gmail.com";
62 | $subject = 'New Job proposal from Benzi Admin Dashboard !';
63 | $headers = "From: " . strip_tags($form) . "\r\n";
64 | $headers .= "Reply-To: ". strip_tags($form) . "\r\n";
65 | $headers .= "CC: nababurdev@gmail.com\r\n";
66 | $headers .= 'MIME-Version: 1.0';
67 | $headers .= 'Content-type: text/html; charset=iso-8859-1';
68 | $message = "Client name : " . strip_tags($name) . "\r\n";
69 | $message .= "Client E-mail : " . strip_tags($email) . "\r\n";
70 | $message .= "Client Budget : " . strip_tags($budget) . "\r\n";
71 | $message .= "Client framework choice : " . strip_tags($frameworks) . "\r\n";
72 | $message .= "Proposal Email Date : " . strip_tags($Date) . "\r\n";
73 | $message .= "This Email come from your Benzi Admin Dashboard Client proposal Pannel.";
74 | $sendmail = mail($to, $subject, $message);
75 |
76 |
77 | if ($sendmail) {
78 | $msg = '
79 | Success! Your Proposal has been send Successfully, We will reply as soon as possible. Thanks !
';
80 | echo $msg;
81 | }else{
82 | $msg = '
83 | Error ! Something went wrong!
';
84 | echo $msg;
85 | }
86 |
87 |
88 | }
89 | }
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 | }
--------------------------------------------------------------------------------
/app/classes/Frontend.php:
--------------------------------------------------------------------------------
1 | db = new Database();
19 | $this->fm = new Format();
20 | }
21 |
22 |
23 |
24 |
25 |
26 | // Select All contents form this Table
27 | public function selectfrontendpart(){
28 | $query = "SELECT * FROM $this->table";
29 | $result = $this->db->select($query);
30 | return $result;
31 | }
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | }
--------------------------------------------------------------------------------
/app/classes/Permissions.php:
--------------------------------------------------------------------------------
1 | db = new Database();
19 | $this->fm = new Format();
20 | }
21 |
22 |
23 |
24 |
25 |
26 | // Select Role Method
27 | public function selectAllPermissions(){
28 | $query = "SELECT * FROM $this->table ORDER BY perid DESC";
29 | $result = $this->db->select($query);
30 | return $result;
31 | }
32 |
33 |
34 |
35 |
36 |
37 |
38 | }
--------------------------------------------------------------------------------
/app/classes/Roles.php:
--------------------------------------------------------------------------------
1 | db = new Database();
19 | $this->fm = new Format();
20 | }
21 |
22 |
23 |
24 | // Add new Role Insert Method
25 | public function addNewRole($data){
26 | $rolename = $this->fm->validation($data['rolename']);
27 | $roledname = $this->fm->validation($data['roledname']);
28 | //$permission_items = $data['permission_items'];
29 |
30 | $rolename = mysqli_real_escape_string($this->db->link, $rolename);
31 | $roledname = mysqli_real_escape_string($this->db->link, $roledname);
32 | //$permission_items = mysqli_real_escape_string($this->db->link, $permission_items);
33 |
34 | if (empty($rolename) OR empty($roledname) ) {
35 | $msg = '
36 |
×
37 |
Error ! Role Name and Display Name field must not be Empty!
';
38 | return $msg;
39 | exit();
40 |
41 | }else{
42 |
43 | $checkName = "SELECT * FROM $this->table WHERE rolename = '$rolename' LIMIT 1 ";
44 | $CheckColumn = $this->db->select($checkName);
45 | if($CheckColumn == TRUE){
46 | $msg = '
47 |
×
48 |
Error ! Role is already added in Database !
';
49 | return $msg;
50 | exit();
51 | }else{
52 |
53 | $permission = array();
54 | $permission = $data['permission_items'];
55 |
56 |
57 | foreach ($permission as $value) {
58 | if(is_array($value)) {
59 | foreach($value as $val){
60 | $arr[] = $val;
61 | }
62 | } else {
63 | $arr[] = $value;
64 | }
65 | }
66 | $run = implode(",", $arr);
67 |
68 |
69 | $query = "INSERT INTO $this->table(rolename, roledname, permission_items) VALUES('$rolename', '$roledname', '$run') ";
70 | $result = $this->db->insert($query);
71 | if ($result) {
72 | $msg = '
73 |
×
74 |
Success! New user Role added Successfully !
';
75 | return $msg;
76 | exit();
77 | }else{
78 | $msg = '
79 |
×
80 |
Error ! Something went wrong , Data not inserted.
';
81 | return $msg;
82 | exit();
83 |
84 | }
85 | }
86 | }
87 |
88 | }
89 |
90 |
91 |
92 |
93 | // Select Role Method
94 | public function selectAllRole(){
95 | $query = "SELECT * FROM $this->table ORDER BY roledname";
96 | $result = $this->db->select($query);
97 | return $result;
98 | }
99 |
100 |
101 |
102 |
103 | // Edit Role By Id Method
104 | public function editRoleById($roleid){
105 | $roleid = preg_replace('/[^a-zA-Z0-9-]/', '', $roleid);
106 | $query = "SELECT * FROM $this->table WHERE roleid = '$roleid'";
107 | $result = $this->db->select($query);
108 | return $result;
109 | }
110 |
111 |
112 | // Update Role By Id Method
113 | public function updateUserRole($data, $roleid){
114 | $roleid = preg_replace('/[^a-zA-Z0-9-]/', '', $roleid);
115 | $roledname = $this->fm->validation($data['roledname']);
116 | $roledname = mysqli_real_escape_string($this->db->link, $roledname);
117 |
118 | if (empty($roledname)) {
119 | $msg = '
120 |
×
121 |
Error ! Display Name field must not be Empty!
';
122 | return $msg;
123 | exit();
124 |
125 | }else{
126 |
127 |
128 | $query = "UPDATE $this->table
129 | SET
130 | roledname = '$roledname'
131 | WHERE roleid = '$roleid'
132 |
133 | ";
134 | $updated_row = $this->db->update($query);
135 | if ($updated_row) {
136 | $msg = '
137 |
×
138 |
Success! User Role Updated Successfully !
';
139 | return $msg;
140 | exit();
141 | }else{
142 | $msg = '
143 |
×
144 |
Error ! Something went wrong , Data not updated.
';
145 | return $msg;
146 | exit();
147 |
148 | }
149 | }
150 | }
151 |
152 |
153 | // Delete Role By Id Method
154 | public function deleteRoleById($roleid){
155 | $roleid = preg_replace('/[^a-zA-Z0-9-]/', '', $roleid);
156 | $query = "DELETE FROM $this->table WHERE roleid = '$roleid'";
157 | $delete_row = $this->db->delete($query);
158 | if ($delete_row) {
159 | $msg = '
160 |
×
161 |
Success! User Role Deleted Successfully !
';
162 | return $msg;
163 | exit();
164 | }else{
165 | $msg = '
166 |
×
167 |
Error ! Something went wrong , Data not Deleted.
';
168 | return $msg;
169 | exit();
170 |
171 | }
172 | }
173 |
174 | // Select Permission list
175 | public function selectPermissionItem($data){
176 | $query = "SELECT * FROM $this->table where rolename = '$data'";
177 | return $result = $this->db->select($query);
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 |
203 |
204 |
205 | }
--------------------------------------------------------------------------------
/app/classes/index.html:
--------------------------------------------------------------------------------
1 | Deny from all
--------------------------------------------------------------------------------
/app/config/config.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/helpers/index.html:
--------------------------------------------------------------------------------
1 | Deny from all
--------------------------------------------------------------------------------
/app/inc/breadcrumb.php:
--------------------------------------------------------------------------------
1 |
2 |
11 |
--------------------------------------------------------------------------------
/app/inc/footer.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 |
40 |
41 |
42 |
43 |
44 |
45 |