User Module : ps

This commit is contained in:
VE10-Sanjeev 2023-08-21 14:59:59 +05:30
parent b81ded465c
commit 4ea7812491
26 changed files with 432 additions and 260 deletions

View File

@ -29,22 +29,31 @@ $routes->set404Override();
// We get a performance increase by specifying the default
// route since we don't have to scan directories.
$routes->get('/', 'Authentication::index');
$routes->post('login/', 'Authentication::login');
# Authentication Routes
$routes->get('/', 'Authentication::index');
$routes->get('login/', 'Authentication::index');
$routes->post('authenticate/', 'Authentication::authenticate');
$routes->get('logout/', 'Authentication::logout');
# Dashboard Routes
$routes->get('dashboard/', 'Home::index');
$routes->get("user_list/", "Home::user_list");
$routes->get("add_user/", "Home::add_user");
$routes->get("edit_user/", "Home::edit_user");
$routes->get("book_list/", "Home::book_list");
$routes->get("add_book/", "Home::add_book");
$routes->get("edit_book/", "Home::edit_book");
# Users Routes
$routes->get("user_list/", "Users::index");
$routes->get("user_page/(:any)", "Users::user_page/$1");
$routes->post("user_synchronization", "Users::user_synchronization");
# Books Routes
$routes->get("book_list/", "Books::index");
$routes->get("add_book/", "Books::add_book");
$routes->get("edit_book/", "Books::edit_book");
$routes->get("subscribers_list/", "Home::subscribers_list");
$routes->get("add_subscribers/", "Home::add_subscribers");
$routes->get("edit_subscribers/", "Home::edit_subscribers");
$routes->get("business_list/", "Business::add_bussiness");
$routes->get("new_bussiness/", "Business::new_bussiness");
$routes->get('dashboard/', 'Home::auth_user');

View File

@ -1,7 +1,10 @@
<?php
namespace App\Controllers;
## Authentication Controllers only for Login,Logout,Signup,forgotpassword,confirmationpassword,resetpassword,sleepmode,session,cookie Modules
use App\Models\AuthenticationModel;
## Authentication Controllers only for Login,Logout,Signup,forgotpassword,confirmationpassword,resetpassword,session,cookie Modules
class Authentication extends BaseController
{
public function index()
@ -10,28 +13,50 @@ class Authentication extends BaseController
$data['company_name'] = 'Publishing';
$data['company_short_name'] = 'P';
$data['page_name'] = 'Login';
$data['browser_title'] = $data['company_name'].' | '.$data['company_short_name'] .' '. $data['page_name'];
$data['heading'] = $data['page_name'] == "Dashboard" ? 'Welcome to publishing.com' : "";
// $data['browser_title'] = $data['company_name'].' | '.$data['company_short_name'] .' '. $data['page_name'];
echo view('auth_login');
}
public function login()
public function authenticate()
{
// Validate form data
$validation = \Config\Services::validation();
$auth_model = new AuthenticationModel();
$rules = [
'username' => 'required',
'password' => 'required',
];
if ($this->validate($rules)) {
// Process login logic
$username = $this->request->getPost('username');
$password = $this->request->getPost('password');
$user = $auth_model->where('email', $username)->first();
if(is_null($user)) {
return redirect()->back()->with('error', 'Invalid username or password.');
}
$pwd_verify = password_verify((string)$password, $user['password']);
if(!$pwd_verify) {
return redirect()->back()->with('error', 'Invalid username or password.');
}
// You can implement your authentication logic here
// For example, check against a database, validate credentials, etc.
if ($this->authenticate($username, $password)) {
if ($username === $user['email'] && $pwd_verify) {
// Redirect to a dashboard or other protected area
$session = \Config\Services::session();
$session->set('user_id', $user['user_id']);
$session->set('user_name', $user['first_name']." ".$user['last_name']);
$session->set('user_role', $user['role']);
$session->set('business_id', $user['business_id']);
// $cookie = \Config\Services::cookie();
// $cookie->setCookie('remember_username', 'Sri Harsha', 3600); // Cookie expires in 1 hour
return redirect()->to('dashboard');
} else {
// Invalid credentials, display error message
@ -43,12 +68,75 @@ class Authentication extends BaseController
}
}
// Example authentication method, replace with your own logic
private function authenticate($username, $password)
public function logout()
{
// Implement your authentication logic here
// Return true if authentication is successful, false otherwise
// For example, you can compare against a database record
return ($username === 'admin@vbbook.com' && $password === 'test1234');
// Clear session and cookies
$session = \Config\Services::session();
$session->remove('user_id');
$session->destroy();
// $cookie = \Config\Services::cookie();
// $remembered_username = $cookie->getCookie('remember_username');
// $cookie->delete('remember_username');
// Redirect to a logout confirmation page or login page
return redirect()->to('/login'); // Replace with your login route
}
public function lockscreen()
{
// Load the session library
$session = \Config\Services::session();
// Check if the session is locked
if ($session->get('session_locked')) {
// Load the lock screen view
return view('lock_screen');
} else {
// Redirect the user to their previous page or dashboard
return redirect()->to('dashboard'); // Replace with appropriate URL
}
}
public function lock()
{
// Load the session library
$session = \Config\Services::session();
// Set the session_locked flag
$session->set('session_locked', true);
// Redirect the user to the lock screen
return redirect()->to('lockscreen'); // Replace with your lock screen URL
}
public function unlock()
{
// Load the session library
$session = \Config\Services::session();
// Check password logic
$password = $this->request->getPost('password');
if ($this->checkPassword($password)) {
// Unlock the session
$session->remove('session_locked');
return redirect()->to('dashboard'); // Redirect to dashboard
} else {
// Incorrect password, show error
return redirect()->back()->with('error', 'Incorrect password.');
}
}
// Replace with your password checking logic
private function checkPassword($password)
{
// Implement your password validation logic here
// For example, compare against a stored hash
return $password === 'correct_password';
}
}

View File

@ -8,6 +8,7 @@ use CodeIgniter\HTTP\IncomingRequest;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Models\AuthenticationModel;
/**
* Class BaseController
@ -58,16 +59,35 @@ abstract class BaseController extends Controller
public function render_page($viewpage, $data)
{
$session = \Config\Services::session();
$session_uid = $session->get('user_id');
$session_uname = $session->get('user_name');
$session_role = $session->get('user_role');
$auth_model = new AuthenticationModel();
$details = $auth_model->getheringDetailsForHeader($session_uid);
$data['company_name'] = $details[0]['site_name'];
$data['company_short_name'] = $details[0]['site_title'];
$data['loggedin_person'] = $session_uname;
$data['loggedin_person_role'] = $details[0]['role'];
$data['favicon'] = $details[0]['favicon'];
$data['profile_picture'] = $details[0]['profile_picture'];
$data['browser_title'] = $data['company_name'].' | '.$data['company_short_name'] .' '. $data['page_name'];
$data['heading'] = $data['page_name'] == "Dashboard" ? 'Welcome to '.$data['company_name'] : "";
$data['company_name'] = 'publishing';
$data['company_short_name'] = 'VBP';
$data['loggedin_person'] = 'Charles Deakin';
$data['loggedin_person_role'] = 'VBP CEO';
$data['browser_title'] = $data['company_name'].' | '.$data['company_short_name'] .' '. $data['page_name'];
$data['heading'] = $data['page_name'] == "Dashboard" ? 'Welcome to VijayabharathamPublishing.com' : "";
echo view('template/header.php', $data);
echo view('template/topbar.php', $data);
echo view($viewpage, $data);
echo view('template/footer.php', $data);
// $header = view('template/header.php', $data);
// $topbar = view('template/topbar.php', $data);
// $content = view($viewpage, $data);
// $footer = view('template/footer.php', $data);
// return $header . $topbar. $content . $footer;
}
}

25
app/Controllers/Books.php Executable file
View File

@ -0,0 +1,25 @@
<?php
namespace App\Controllers;
use App\Models\BooksModel;
class Books extends BaseController
{
public function index()
{
$session = \Config\Services::session();
$session_role = $session->get('user_role');
$session_bid = $session->get('business_id');
$where = ['books.isactive' => 1];
if (!empty($session_role) && $session_role !== "sadmin" ) {
$where = ['books.business_id' => $session_bid,'books.isactive' => 1];
}
$model = new BooksModel();
$model->setTable('books');
$book_details = $model->where($where)->orderBy('book_id', 'DESC')->findAll();
$data['page_name'] = 'Book Details';
$data['details'] = $book_details;
$this->render_page('book_list', $data);
}
}

View File

@ -15,57 +15,6 @@ class Home extends BaseController
// return view('template');
// }
public function render_page($viewpage, $data)
{
$data['company_name'] = 'publishing';
$data['company_short_name'] = 'VBP';
$data['loggedin_person'] = 'Charles Deakin';
$data['loggedin_person_role'] = 'VBP CEO';
$data['browser_title'] = $data['company_name'].' | '.$data['company_short_name'] .' '. $data['page_name'];
$data['heading'] = $data['page_name'] == "Dashboard" ? 'Welcome to VijayabharathamPublishing.com' : "";
echo view('template/header.php', $data);
echo view('template/topbar.php', $data);
echo view($viewpage, $data);
echo view('template/footer.php', $data);
}
public function user_list()
{
$data['page_name'] = 'User Details';
$this->render_page('user_list', $data);
}
public function add_user()
{
$data['page_name'] = 'Add User';
$this->render_page('user', $data);
}
public function edit_user()
{
$data['page_name'] = 'Edit User';
$this->render_page('user', $data);
}
public function book_list()
{
$data['page_name'] = 'Book Details';
$this->render_page('book_list', $data);
}
public function add_book()
{
$data['page_name'] = 'Add Book';
$this->render_page('book', $data);
}
public function edit_book()
{
$data['page_name'] = 'Edit Book';
$this->render_page('book', $data);
}
public function subscribers_list()
{
$data['page_name'] = 'Subscribers Details';

74
app/Controllers/Users.php Executable file
View File

@ -0,0 +1,74 @@
<?php
namespace App\Controllers;
use App\Models\UsersModel;
class Users extends BaseController
{
## For User Listing
public function index()
{
$session = \Config\Services::session();
$session_role = $session->get('user_role');
$session_bid = $session->get('business_id');
$where = ['users.isactive' => 1];
if (!empty($session_role) && $session_role !== "sadmin" ) {
$where = ['users.business_id' => (int)$session_bid,'users.isactive' => 1];
}
$model = new UsersModel();
$model->setTable('users');
$user_details = $model->where($where)->orderBy('user_id', 'DESC')->findAll();
$data['page_name'] = 'User Details';
$data['details'] = $user_details;
$this->render_page('user_list', $data);
}
## To Load User Add/Update page
public function user_page($id)
{
if($id === '0') {
$data['page_name'] = 'Add User';
$data['details'] = [];
}
else if($id !== '0') {
$data['page_name'] = 'Edit User';
$model = new UsersModel();
$model->setTable('users');
$edit_user_details = $model->where(['user_id'=>$id,'isactive' => 1])->first();
$data['details'] = $edit_user_details;
}
$this->render_page('user', $data);
}
## To Save/Update User Data on DB.
public function user_synchronization()
{
$session = \Config\Services::session();
$model = new UsersModel();
$model->setTable('users');
if($this->request->is('post')){
$requestData = $this->request->getVar();
}
$requestData['business_id'] = $session->get('business_id');
if($requestData['user_id']){
#edit
$requestData['updated_by'] = $session->get('user_id');
$requestData['isactive'] = isset($requestData['isactive']) && $requestData['isactive'] == 'on' ? 1 : 0;
unset($requestData['password']);
$model->saveData($requestData, $requestData['user_id']);
}else{
#add
$hash_password = password_hash($requestData['password'], PASSWORD_DEFAULT);
$requestData['password'] = $hash_password;
$requestData['created_by'] = $session->get('user_id');
$requestData['isactive'] = 1 ;
$model->saveData($requestData, null);
}
return redirect()->route('user_list');
}
}

View File

@ -0,0 +1,22 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class AuthenticationModel extends Model
{
protected $table = 'users';
protected $primaryKey = 'user_id';
protected $allowedFields = ['user_id','user_name','email','first_name','last_name','password','mobile_no','date_of_birth','address','gender','profile_picture','city','state','postal_code','country','role','isactive'];
public function getheringDetailsForHeader($user_id)
{
$builder = $this->db->table('users');
$builder->select('user_id,user_name,email,first_name,last_name,password,mobile_no,date_of_birth,address,gender,profile_picture,city,state,postal_code,users.country,role,setting_id,site_name,site_title,favicon,logo,terms_service,footer_about,admin_email,mobile,copyright,pagination_limit,site_info,about_info,mail_protocol,mail_title,mail_host,mail_port,mail_encryption,mail_username,mail_password,currency,settings.country');
$builder->join('settings', 'settings.admin_email = users.email', 'left');
$builder->where('user_id', $user_id);
//$template_mapping_details['fk_entity_id'];
$query = $builder->get();
return $query->getResultArray();
}
}

10
app/Models/BooksModel.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class BooksModel extends Model
{
protected $table = 'books';
protected $primaryKey = 'book_id';
protected $allowedFields = ['book_id','title','cover_picture','publication_date','publisher','genre','language','description','page_count','price','created_on','created_by','updated_on','updated_by','isactive','business_id'];
}

22
app/Models/UsersModel.php Normal file
View File

@ -0,0 +1,22 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class UsersModel extends Model
{
protected $table = 'users';
protected $primaryKey = 'user_id';
protected $allowedFields = ['user_id','user_name','email','first_name','last_name','password','mobile_no','date_of_birth','address','gender','profile_picture','city','state','postal_code','country','role','isactive','business_id'];
public function saveData($data, $id = null)
{
if ($id === null) {
// Insert new record
return $this->insert($data);
} else {
// Update existing record
return $this->update($id, $data);
}
}
}

View File

@ -2,13 +2,13 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<title><?= $browser_title; ?></title>
<title>BigBambooBookPublish | BBBP </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta content="A fully featured admin theme which can be used to build CRM, CMS, etc." name="description" />
<meta content="Coderthemes" name="author" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- App favicon -->
<link rel="shortcut icon" href="<?= base_url()."public/assets/images/favicon.ico" ?>">
<link rel="shortcut icon" href="<?= base_url()."public/assets/images/company/default.ico"?>">
<!-- App css -->
<link href="<?= base_url()."public/assets/css/bootstrap.min.css" ?>" rel="stylesheet" type="text/css" id="bs-default-stylesheet" />
@ -36,21 +36,21 @@
<div class="auth-logo">
<a href="javascript: void(0);" class="logo logo-dark text-center">
<span class="logo-lg">
<img src="<?= base_url()."public/assets/images/logo.png" ?>" alt="" height="80">
<img src="<?= base_url()."public/assets/images/company/default.png" ?>" alt="" height="80">
</span>
</a>
<a href="javascript: void(0);" class="logo logo-light text-center">
<span class="logo-lg">
<img src="<?= base_url()."public/assets/images/logo.png" ?>" alt="" height="80">
<img src="<?= base_url()."public/assets/images/company/default.png" ?>" alt="" height="80">
</span>
</a>
</div>
<p class="text-muted mb-4 mt-3">Enter your email address and password to access admin panel.</p>
<p class="text-muted mb-4 mt-3"><span>BigBambooBookPublish</br></br></span>Enter your email address and password to access admin panel.</p>
</div>
<!-- <form action=""> -->
<form action="<?= base_url()."login" ?>" method="post">
<form action="<?= base_url()."authenticate" ?>" method="post">
@ -105,7 +105,7 @@
<!-- end page -->
<footer class="footer footer-alt">
<p> <?= date('Y') ?> &copy; <?= $company_name; ?>.</p>
<p> <?= date('Y') ?> &copy; <?= "bigbamboobookpublish"; ?>.</p>
</footer>
<!-- Vendor js -->

View File

@ -17,45 +17,38 @@
<tr>
<th>Name</th>
<th>Author</th>
<th>Edition/Language</th>
<th>Category</th>
<th>Language</th>
<th>Year Of Release</th>
<th>State/Country</th>
<th>Price of the Book</th>
<th>Book Avaialble Count</th>
<th>Description</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php foreach ($details as $row):
if ($row['isactive']) {
$class = 'badge badge-soft-success';
$message = 'Active';
} else {
$class = 'badge badge-soft-danger';
$message = 'In-Active';
}
?>
<tr>
<td>Cyber Crime</td>
<td>Tiger Nixon</td>
<td>7th / English</td>
<td>2023</td>
<td>TamilNadu/India</td>
<td> <span data-plugin="counterup">450</span> </td>
<td> <span data-plugin="counterup">200</span> Copies </td>
<td> <span class="badge badge-soft-danger">In-Active</span> </td>
</tr>
<tr>
<td>Reinforced Concrete Design</td>
<td>Rory Dalyell</td>
<td>1st / English</td>
<td>1998 </td>
<td>Kerala/India</td>
<td> <span data-plugin="counterup">730</span> </td>
<td> <span data-plugin="counterup">20</span> Copies </td>
<td> <span class="badge badge-soft-success">Active</span> </td>
</tr>
<tr>
<td>The big bull</td>
<td>Garrett</td>
<td>2nd / Tamil</td>
<td>2002</td>
<td>TamilNadu/India</td>
<td> <span data-plugin="counterup">1000</span> </td>
<td> <span data-plugin="counterup">150</span> Copies </td>
<td> <span class="badge badge-soft-success">Active</span> </td>
<td><?php echo $row['title'] ; ?></td>
<td><?php echo $row['publisher'] ; ?></td>
<td><?php echo $row['genre'] ; ?></td>
<td><?php echo $row['language'] ; ?></td>
<td><?php echo date('Y', strtotime($row['publication_date'])); ?></td>
<td> <span data-plugin="counterup"><?php echo $row['price'] ; ?></span></td>
<td><?php echo $row['description'] ; ?></td>
<td>
<span class="<?php echo $class; ?>"><?php echo $message; ?></span>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>

View File

@ -8,7 +8,7 @@
<meta content="Coderthemes" name="author" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- App favicon -->
<link rel="shortcut icon" href="<?= base_url()."public/assets/images/favicon.ico" ?>" >
<link rel="shortcut icon" href="<?= base_url()."public/assets/images/company/".$favicon ?>" >
<!-- plugin css -->
<link href="<?= base_url()."public/assets/libs/admin-resources/jquery.vectormap/jquery-jvectormap-1.2.2.css" ?>" rel="stylesheet" type="text/css" />
@ -71,7 +71,7 @@
<!-- User box -->
<div class="user-box text-center">
<img src="<?= base_url()."public/assets/images/users/avatar-1.jpg" ?>" alt="user-img" title="Mat Helme"
<img src="<?= base_url()."public/assets/images/users/".$profile_picture; ?>" alt="user-img" title="Mat Helme"
class="rounded-circle avatar-md">
<div class="dropdown">
<a href="javascript: void(0);" class="text-reset dropdown-toggle h5 mt-2 mb-1 d-block"
@ -97,7 +97,7 @@
</a>
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item notify-item">
<a href="logout" class="dropdown-item notify-item">
<i class="fe-log-out mr-1"></i>
<span>Logout</span>
</a>

View File

@ -221,7 +221,7 @@
<li class="dropdown notification-list topbar-dropdown">
<a class="nav-link dropdown-toggle nav-user mr-0 waves-effect waves-light" data-toggle="dropdown" href="#" role="button" aria-haspopup="false" aria-expanded="false">
<img src="<?= base_url()."public/assets/images/users/avatar-1.jpg" ?>" alt="user-image" class="rounded-circle">
<img src="<?= base_url()."public/assets/images/users/".$profile_picture; ?>" alt="user-image" class="rounded-circle">
<span class="pro-user-name ml-1"><?= $loggedin_person; ?><i class="mdi mdi-chevron-down"></i>
</span>
</a>
@ -252,7 +252,7 @@
<div class="dropdown-divider"></div>
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item notify-item">
<a href="logout" class="dropdown-item notify-item">
<i class="ri-logout-box-line"></i>
<span>Logout</span>
</a>

View File

@ -4,135 +4,99 @@
<div class="card-body">
<h4 class="header-title"><?= $page_name; ?></h4>
<p class="sub-header"> </p>
<form>
<form action="<?= base_url()."user_synchronization"; ?>" method="post">
<div class="form-group">
<div class="form-row">
<div class="form-group col-md-6">
<label for="inputName" class="col-form-label">Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="inputName" placeholder="Name" required />
</div>
<div class="form-group col-md-6">
<label for="inputEmail" class="col-form-label">Email<span class="text-danger">*</span></label>
<input type="email" class="form-control" id="inputEmail" placeholder="Email" required />
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="inputDOB" class="col-form-label">Date Of Birth<span class="text-danger">*</span></label>
<input type="date" class="form-control" id="inputDOB" placeholder="DD/MM/YYYY" required data-toggle="input-mask" data-mask-format="00/00/0000" />
</div>
<div class="form-group col-md-6">
<label for="inputMobile" class="col-form-label">Mobile Number<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="inputMobile" placeholder="Enter only numbers" required data-parsley-type="number" />
</div>
</div>
<div class="form-group">
<label for="inputAddress" class="col-form-label">Address<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="inputAddress" placeholder="1234 Main St" required />
</div>
<div class="form-group">
<label for="inputAddress2" class="col-form-label">Address 2</label>
<input type="text" class="form-control" id="inputAddress2" placeholder="Apartment, studio, or floor" />
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="inputCity" class="col-form-label">City<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="inputCity" placeholder="city" required />
<div class="form-group col-md-4">
<label for="user_name" class="col-form-label">User Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="user_name" name="user_name" value="<?= isset($details['user_name']) ? $details['user_name'] : '' ?>" placeholder="User Name" required />
</div>
<div class="form-group col-md-4">
<label for="inputState" class="col-form-label">State<span class="text-danger">*</span></label>
<select id="inputState" class="form-control" required />
<option>Choose</option>
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
<label for="email" class="col-form-label">Email<span class="text-danger">*</span></label>
<input type="email" class="form-control" id="email" name="email" placeholder="Email" value="<?= isset($details['email']) ? $details['email'] : '' ?>" required />
</div>
</select>
<?php if(empty($details)){ ?>
<div class="form-group col-md-4">
<label for="password" class="col-form-label">Password<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="password" name="password" placeholder="Password" value="<?= isset($details['password']) ? $details['password'] : '' ?>" required />
</div>
<?php } ?>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="first_name" class="col-form-label">First Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="first_name" name="first_name" placeholder="First Name" value="<?= isset($details['first_name']) ? $details['first_name'] : '' ?>" required />
</div>
<div class="form-group col-md-6">
<label for="last_name" class="col-form-label">Last Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="last_name" name="last_name" placeholder="Last Name" value="<?= isset($details['last_name']) ? $details['last_name'] : '' ?>" required />
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="date_of_birth" class="col-form-label">Date Of Birth<span class="text-danger">*</span></label>
<input type="date" class="form-control" id="date_of_birth" name="date_of_birth" placeholder="Date Of birth (format : DD/MM/YYYY)" required data-toggle="input-mask" data-mask-format="00/00/0000" value="<?= isset($details['date_of_birth']) ? $details['date_of_birth'] : '' ?>" />
</div>
<div class="form-group col-md-6">
<label for="mobile_no" class="col-form-label">Mobile Number<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="mobile_no" name="mobile_no" placeholder="Mobile Number (Enter only numbers)" required data-parsley-type="number" value="<?= isset($details['mobile_no']) ? $details['mobile_no'] : '' ?>" />
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="gender" class="col-form-label">Gender</label>
<input type="text" class="form-control" id="gender" name="gender" placeholder="Gender" value="<?= isset($details['gender']) ? $details['gender'] : '' ?>" />
</div>
<div class="form-group col-md-3">
<label for="role" class="col-form-label">Role<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="role" name="role" placeholder="Role" required value="<?= isset($details['role']) ? $details['role'] : '' ?>" />
</div>
<div class="form-group col-md-3">
<label for="profile_picture" class="col-form-label">Profile Picture<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="profile_picture" name="profile_picture" placeholder="Profile picture Name" required value="<?= isset($details['profile_picture']) ? $details['profile_picture'] : '' ?>" />
</div>
</div>
<div class="form-group">
<label for="address" class="col-form-label">Address<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="address" name="address" placeholder="Address (eg : 1234 Main St)" required value="<?= isset($details['address']) ? $details['address'] : '' ?>" />
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="city" class="col-form-label">City<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="city" name="city" placeholder="City" required value="<?= isset($details['city']) ? $details['city'] : '' ?>" />
</div>
<div class="form-group col-md-4">
<label for="state" class="col-form-label">State<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="state" name="state" placeholder="State" required value="<?= isset($details['state']) ? $details['state'] : '' ?>" />
</div>
<div class="form-group col-md-2">
<label for="inputZip" class="col-form-label">Zip<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="inputZip" placeholder="Zip" required />
<label for="postal_code" class="col-form-label">Postal Code<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="postal_code" name="postal_code" placeholder="Postal Code (PIN)" required value="<?= isset($details['postal_code']) ? $details['postal_code'] : '' ?>" />
</div>
</div>
<input type="hidden" id="user_id" name="user_id" placeholder="hidden for user id" value="<?= isset($details['user_id']) ? $details['user_id'] : '' ?>" />
<input type="hidden" id="business_id" name="business_id" placeholder="hidden for business id" value="<?= isset($details['business_id']) ? $details['business_id'] : '' ?>" />
<?php if(!empty($details)){ ?>
<div class="form-group text-right m-b-0 checkbox checkbox-purple">
<input type="checkbox" id="inputCheckbox" class="form-control" checked="true">
<label for="inputCheckbox">Is Active</label>
<input type="checkbox" id="isactive" name="isactive" class="form-control" <?= isset($details) && $details['isactive'] == 1 ? 'checked' : '' ?>>
<label for="isactive"> Is Active</label>
</div>
<br>
<?php } ?>
<div class="form-group text-right m-b-0">
<button class="btn btn-primary waves-effect waves-light mr-1" type="submit">
<button class="btn btn-success waves-effect waves-light mr-1" type="submit">
Submit
</button>
<button type="reset" class="btn btn-secondary waves-effect">
Cancel
<button type="reset" class="btn btn-primary waves-effect mr-1">
Reset
</button>
<button type="button" class="btn btn-secondary waves-effect">Cancel</button>
</div>
</div>
</form>
<!-- <form class="needs-validation" novalidate>
<div class="form-group mb-3">
<label for="userName">User Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="validationCustom01" placeholder="First name" required>
<div class="<?php if ("valid-feedback") {
echo "valid-feedback";
} ?>" >Looks good!</div>
<div class="<?php if ("invalid-feedback") {
echo "invalid-feedback";
} ?>" >Please provide a valid User name.</div>
</div>
<div class="form-group mb-3">
<label for="address">Address<span class="text-danger">*</span></label>
<div><textarea required class="form-control"></textarea></div>
<div class="<?php if ("valid-feedback") {
echo "valid-feedback";
} ?>" >Looks good!</div>
<div class="<?php if ("invalid-feedback") {
echo "invalid-feedback";
} ?>" >Please provide a valid Adress.</div>
</div>
<div class="form-group mb-1">
<label for="validationCustom03">City</label>
<input type="text" class="form-control" id="validationCustom03" placeholder="City" required>
<div class="<?php if ("valid-feedback") {
echo "valid-feedback";
} ?>" >Looks good!</div>
<div class="<?php if ("invalid-feedback") {
echo "invalid-feedback";
} ?>" >Please provide a valid city.</div>
</div>
<div class="form-group mb-1">
<label for="validationCustom04">State</label>
<input type="text" class="form-control" id="validationCustom04" placeholder="State" required>
<div class="<?php if ("valid-feedback") {
echo "valid-feedback";
} ?>" >Looks good!</div>
<div class="<?php if ("invalid-feedback") {
echo "invalid-feedback";
} ?>" >Please provide a valid state.</div>
</div>
<div class="form-group mb-1">
<label for="validationCustom05">Zip</label>
<input type="text" class="form-control" id="validationCustom05" placeholder="Zip" required>
<div class="<?php if ("valid-feedback") {
echo "valid-feedback";
} ?>" >Looks good!</div>
<div class="<?php if ("invalid-feedback") {
echo "invalid-feedback";
} ?>" >Please provide a valid Zip.</div>
</div>
<div class="form-group mb-3">
</div>
<div class="form-group mb-3">
<label>E-Mail</label>
<input type="email" class="form-control" required parsley-type="email" placeholder="Enter a valid e-mail"/>
</div>
<button class="btn btn-primary" type="submit">Submit form</button>
</form> -->
</div> <!-- end card-body-->
</div> <!-- end card-->
</div> <!-- end col-->

View File

@ -2,9 +2,8 @@
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="float-right">
<a href="add_user" class="btn btn-primary"><i class="ri-user-add-line"></i> Add New </a>
<a href="user_page/0" class="btn btn-primary"><i class="ri-user-add-line"></i> Add New </a>
</div><!-- end col-->
<br>
<h4 class="header-title mb-3"><?= $page_name; ?></h4>
@ -17,44 +16,41 @@
<thead class="thead-light">
<tr>
<th>Name</th>
<th>Email</th>
<th>Role</th>
<th>Mobile Number</th>
<th>Address</th>
<th>State</th>
<th>City</th>
<th>Pincode</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php foreach ($details as $row):
if ($row['isactive']) {
$class = 'badge badge-soft-success';
$message = 'Active';
} else {
$class = 'badge badge-soft-danger';
$message = 'In-Active';
}
$edit_page_route = "user_page/".$row['user_id'];
?>
<tr>
<td>Tiger Nixon</td>
<td>New-50,Old-09 Sri K.B. Hardwares and paints 1st floor nanganallur,</td>
<td>TamilNadu</td>
<td>Chennai</td>
<td>600061</td>
<td><?php echo $row['first_name'].' '.$row['last_name'] ; ?></td>
<td><?php echo $row['email'] ; ?></td>
<td><?php echo $row['role'] ; ?></td>
<td><?php echo $row['mobile_no'] ; ?></td>
<td><?php echo $row['address'].', '.$row['city'].', '.$row['state'].'- '.$row['postal_code'].'. '.$row['country'] ; ?></td>
<td>
<span class="badge badge-soft-danger">In-Active</span>
<span class="<?php echo $class; ?>"><?php echo $message; ?></span>
</td>
<td>
<a href="edit_user" class="btn btn-xs btn-secondary"><i class="ri-pencil-line"></i></a>
<a href="<?php echo $edit_page_route; ?>" class="btn btn-xs btn-secondary"><i class="ri-pencil-line"></i></a>
</td>
</tr>
<tr>
<td>Garrett Winters</td>
<td>Door No 1/69 B3 JaiFlats Meenampakkam,</td>
<td>TamilNadu</td>
<td>Chennai</td>
<td>600041</td>
<td>
<span class="badge badge-soft-success">Active</span>
</td>
<td>
<a href="edit_user" class="btn btn-xs btn-secondary"><i class="ri-pencil-line"></i></a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
public/assets/images/favicon.ico Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 112 KiB