Merge branch 'uat' of bitbucket.org:venbainformationtechnology/vb_book into uat

This commit is contained in:
heama 2023-08-31 14:22:02 +05:30
commit 892d142f43
15 changed files with 708 additions and 179 deletions

1
.env
View File

@ -141,3 +141,4 @@ CI_ENVIRONMENT = development
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# curlrequest.shareOptions = true # curlrequest.shareOptions = true
APP_TIMEZONE = 'Asia/Kolkata'

View File

@ -7,6 +7,7 @@ use CodeIgniter\Session\Handlers\FileHandler;
class App extends BaseConfig class App extends BaseConfig
{ {
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Base Site URL * Base Site URL
@ -115,7 +116,18 @@ class App extends BaseConfig
* *
* @see https://www.php.net/manual/en/timezones.php for list of timezones supported by PHP. * @see https://www.php.net/manual/en/timezones.php for list of timezones supported by PHP.
*/ */
public string $appTimezone = 'UTC'; // public string $appTimezone = 'UTC';
public $appTimezone = 'UTC'; // Set default timezone
public function __construct()
{
parent::__construct();
// Read APP_TIMEZONE from environment and update appTimezone if available
$envTimezone = $_ENV['APP_TIMEZONE'] ?? null;
if ($envTimezone) {
$this->appTimezone = $envTimezone;
}
}
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------

View File

@ -94,11 +94,6 @@ define('EVENT_PRIORITY_NORMAL', 100);
define('EVENT_PRIORITY_HIGH', 10); define('EVENT_PRIORITY_HIGH', 10);
/** /**
* Dummy Constants For Api Integration. * Constants For Api Integration.
*/ */
define('WPBOOK_DETAILS', 'https://reqres.in/api/users?page=2'); define('VPB_BOOK', 'https://vbp.venbait.in/wp-json/wc/v3/products');
define('WPBOOK_DETAILS_GET_PARAMETER', 'https://reqres.in/api/users?page=2');
define('WPBOOK_DETAILS_GET_STRAIGHTFORWARD', 'https://reqres.in/api/users');
define('WPBOOK_DETAILS_GET_SEGMENT', 'https://reqres.in/api/users/2');
define('WPBOOK_DETAILS_POST', 'https://reqres.in/api/users');
define('WPBOOK_DETAILS_PUT', 'https://reqres.in/api/users/707');

View File

@ -18,7 +18,7 @@ class Email extends BaseConfig
/** /**
* The mail sending protocol: mail, sendmail, smtp * The mail sending protocol: mail, sendmail, smtp
*/ */
public string $protocol = 'mail'; public string $protocol = 'smtp';
/** /**
* The server path to Sendmail. * The server path to Sendmail.
@ -28,27 +28,29 @@ class Email extends BaseConfig
/** /**
* SMTP Server Address * SMTP Server Address
*/ */
public string $SMTPHost = ''; public string $SMTPHost = 'bh-in-11.webhostbox.net';
/** /**
* SMTP Username * SMTP Username
*/ */
public string $SMTPUser = ''; public string $SMTPUser = 'devbook@mprkv.co.in';
//public string $SMTPUser = 'venbalap08@gmail.com';
/** /**
* SMTP Password * SMTP Password
*/ */
public string $SMTPPass = ''; public string $SMTPPass = 'DevBook@2023';
//public string $SMTPPass = 'sganobynfyouaxgs';
/** /**
* SMTP Port * SMTP Port
*/ */
public int $SMTPPort = 25; public int $SMTPPort = 465;
/** /**
* SMTP Timeout (in seconds) * SMTP Timeout (in seconds)
*/ */
public int $SMTPTimeout = 5; public int $SMTPTimeout = 20;
/** /**
* Enable persistent SMTP connections * Enable persistent SMTP connections
@ -58,7 +60,7 @@ class Email extends BaseConfig
/** /**
* SMTP Encryption. Either tls or ssl * SMTP Encryption. Either tls or ssl
*/ */
public string $SMTPCrypto = 'tls'; public string $SMTPCrypto = 'ssl';
/** /**
* Enable word-wrap * Enable word-wrap
@ -73,7 +75,7 @@ class Email extends BaseConfig
/** /**
* Type of mail, either 'text' or 'html' * Type of mail, either 'text' or 'html'
*/ */
public string $mailType = 'text'; public string $mailType = 'html';
/** /**
* Character set (utf-8, iso-8859-1, etc.) * Character set (utf-8, iso-8859-1, etc.)

View File

@ -33,8 +33,11 @@ $routes->set404Override();
# Authentication Routes # Authentication Routes
$routes->get('/', 'Authentication::index'); $routes->get('/', 'Authentication::index');
$routes->get('login/', 'Authentication::index'); $routes->get('login/', 'Authentication::index');
$routes->post('authenticate/', 'Authentication::authenticate'); $routes->post('authenticate/', 'Authentication::authenticate');//Routes For Authentication.
$routes->get('logout/', 'Authentication::logout'); $routes->get('logout/', 'Authentication::logout');
$routes->get('auth_confirm_mail/', 'Authentication::auth_confirm_mail');//Routes For Confirmation Mail alert page.
$routes->get('auth_reset_password/', 'Authentication::auth_reset_password');//Routes For Load Reset password Page.
$routes->post('auth_reset_password_save/', 'Authentication::auth_reset_password_save');//Routes For update the Resetted password.
# Dashboard Routes # Dashboard Routes
$routes->get('dashboard/', 'Home::index'); $routes->get('dashboard/', 'Home::index');

View File

@ -4,23 +4,28 @@ namespace App\Controllers;
use App\Models\AuthenticationModel; use App\Models\AuthenticationModel;
## Authentication Controllers only for Login,Logout,Signup,forgotpassword,confirmationpassword,resetpassword,session,cookie Modules ## Authentication Controllers only for Login,Logout,forgotpassword,confirmationpassword,resetpassword,session,cookie,lock-screen Modules
class Authentication extends BaseController class Authentication extends BaseController
{ {
## Load Login Page
public function index() public function index()
{ {
// Load the view // Retrieve flashed session data
$data['company_name'] = 'Publishing'; $successMessage = session()->getFlashdata('success');
$data['company_short_name'] = 'P'; $validationErrors = session()->getFlashdata('error');
$data['page_name'] = 'Login';
// $data['browser_title'] = $data['company_name'].' | '.$data['company_short_name'] .' '. $data['page_name']; // Load and display the form view with the above data
echo view('auth_login'); // Here, we'll use the default View class for demonstration purposes
$alerts = [
'successMessage' => $successMessage,
'validationErrors' => $validationErrors,
];
return view('auth_login', $alerts);
} }
## Authenticate the users and Redirect to Dashboard
public function authenticate() public function authenticate()
{ {
$validation = \Config\Services::validation();
$auth_model = new AuthenticationModel(); $auth_model = new AuthenticationModel();
$rules = [ $rules = [
'username' => 'required', 'username' => 'required',
@ -32,17 +37,18 @@ class Authentication extends BaseController
$password = $this->request->getPost('password'); $password = $this->request->getPost('password');
$user = $auth_model->where('email', $username)->first(); $user = $auth_model->where('email', $username)->first();
// print_r($user);die; // $this->logger->info("Authenticate: Function Called.");
if (is_null($user)) { if (is_null($user)) {
return redirect()->back()->with('error', 'Invalid username or password.'); $this->logger->error('User does not exist');
// return redirect()->back()->withInput()->with('error', 'Invalid username or password.'); return redirect()->back()->withInput()->with('error', 'User does not exist');
} }
$pwd_verify = password_verify((string)$password, $user['password']); $pwd_verify = password_verify((string)$password, $user['password']);
if (!$pwd_verify) { if (!$pwd_verify) {
// return redirect()->back()->with('error', 'Invalid username or password.'); $this->logger->error('Invalid Password');
return redirect()->back()->withInput()->with('error', 'Invalid username or password.'); return redirect()->back()->withInput()->with('error', 'Invalid Password.');
} }
// You can implement your authentication logic here // You can implement your authentication logic here
@ -63,15 +69,165 @@ class Authentication extends BaseController
} else { } else {
// Invalid credentials, display error message // Invalid credentials, display error message
// return redirect()->back()->with('error', 'Invalid username or password.'); // return redirect()->back()->with('error', 'Invalid username or password.');
$this->logger->error('Invalid username or password.');
return redirect()->back()->withInput()->with('error', 'Invalid username or password.'); return redirect()->back()->withInput()->with('error', 'Invalid username or password.');
} }
} else { } else {
// Validation failed, display errors // Validation failed, display errors
// return redirect()->back()->withInput()->with('validation', $validation); // return redirect()->back()->withInput()->with('validation', $validation);
return redirect()->back()->withInput()->with('error', 'Invalid username or password.'); $this->logger->error('Username or password Required.');
return redirect()->back()->withInput()->with('error', 'Username or password Required.');
} }
} }
## Load Forgot password Confirmation Alert
public function auth_confirm_mail()
{
// Get the email address from the request
$email = $this->request->getGet('email');
$url_domain = base_url();
// Validate the email address
$validation_rules = [
'email' => 'required|valid_email',
];
if (!$this->validate($validation_rules)) {
$this->logger->error('enter correct mail to reset your Password');
return redirect()->back()->withInput()->with('error', 'Enter correct E-mail to reset your password');
}
// Check if the email exists in the database
$auth_model = new AuthenticationModel();
// $user = $auth_model->where('email', $email)->first();
$where = ['email' => $email, 'isactive' => 1];
$user = $auth_model->where($where)->first();
if (!$user) {
$this->logger->error('There is no user enteries against given mail');
return redirect()->back()->withInput()->with('error', 'There is no user enteries against given mail');
} else {
$data['email'] = $email;
// Generate a unique token for password reset
$token = bin2hex(random_bytes(32));
$content = "Click the link below to reset your password : " . $url_domain . "reset_password?email=" . $email . "&token=" . $token;
// $email = \Config\Services::email();
// $email->setTo('sanjeev.p@venbainfotech.com');
// $email->setFrom('venbalap08@gmail.com', 'BB-VBP');
// $email->setSubject('BB-VBP Password Reset');
// $email->setMessage($content);
// $email->setTo('venbalap08@gmail.com');
// $email->setFrom('venbalap08@gmail.com');
// $email->setSubject('Password Reset Testing');
// $email->setMessage('ZXER');
// if ($email->send()) {
// // Email sent successfully
// return view('auth_confirm_mail', $data);
// } else {
// $this->logger->error('Email Not Sended,Try Again');
// return redirect()->back()->withInput()->with('error', 'Email Not Sended,Try Again');
// }
$update_token['reset_link'] = $token;
$auth_model->update($user['user_id'], $update_token);
$data['link'] = $url_domain . "auth_reset_password?email=" . $email . "&token=" . $token;
// Retrieve flashed session data
$successMessage = session()->getFlashdata('success');
$validationErrors = session()->getFlashdata('error');
// Load and display the form view with the above data
// Here, we'll use the default View class for demonstration purposes
$data['successMessage'] = $successMessage;
$data['validationErrors'] = $validationErrors;
return view('auth_confirm_mail', $data);
}
}
## Load Reset password Page
public function auth_reset_password()
{
$email = $this->request->getGet('email');
$token = $this->request->getGet('token');
$auth_model = new AuthenticationModel();
$where = ['email' => $email, 'reset_link' => $token, 'isactive' => 1];
$user = $auth_model->where($where)->first();
if (!$user) {
$this->logger->error('Invaild link for this Email');
return redirect()->back()->withInput()->with('error', 'Invaild link for this Email');
//return back page is auth_login
} else {
$update_token['reset_link'] = NULL;
$auth_model->update($user['user_id'], $update_token);
$data['email'] = $email;
// Retrieve flashed session data
$successMessage = session()->getFlashdata('success');
$validationErrors = session()->getFlashdata('error');
// Load and display the form view with the above data
// Here, we'll use the default View class for demonstration purposes
$data['successMessage'] = $successMessage;
$data['validationErrors'] = $validationErrors;
return view('auth_reset_password', $data);
}
}
## Save Resetted password. and Redirect to login
public function auth_reset_password_save()
{
$auth_model = new AuthenticationModel();
$rules = [
'password1' => 'required',
'password2' => 'required',
];
if ($this->validate($rules)) {
$email = $this->request->getVar('email');
$password = $this->request->getVar('password1');
$confirmation = $this->request->getVar('password2');
$hash_password = password_hash($password, PASSWORD_DEFAULT);
try {
// code for password confirmation
if ($password === $confirmation) {
$auth_model = new AuthenticationModel();
$user_details = $auth_model->where(['email' => $email, 'isactive' => 1])->first();
if ($user_details) {
$update_user_details = ['email' => $email, 'password' => $hash_password];
$auth_model->update($update_user_details['user_id'], $update_user_details);
}
// Retrieve flashed session data
$successMessage = session()->getFlashdata('success');
$validationErrors = session()->getFlashdata('error');
// Load and display the form view with the above data
// Here, we'll use the default View class for demonstration purposes
$data['successMessage'] = $successMessage;
$data['validationErrors'] = $validationErrors;
return view('auth_login', $data);
} else {
// Password confirmation failed
$this->logger->error('Password confirmation failed');
return redirect()->back()->withInput()->with('error', 'Password confirmation failed');
}
} catch (\Exception $e) {
$error = "Exception Errno returned" . $e->getCode() . " <br/>";
$error_msg = $e->getMessage();
$this->logger->error($error . '(' . $error_msg . ')');
return redirect()->back()->withInput()->with('error', $error . '(' . $error_msg . ')');
}
} else {
// Validation failed, display errors
$this->logger->error('Password And Confirmation Password are Required.');
return redirect()->back()->withInput()->with('error', 'Password And Confirmation Password are Required.');
}
}
## Logout With destory Session Details
public function logout() public function logout()
{ {
@ -96,6 +252,7 @@ class Authentication extends BaseController
return redirect()->to('/login'); // return redirect()->to('/login'); //
} }
## Lock Screen - holded
public function lockscreen() public function lockscreen()
{ {
// Load the session library // Load the session library
@ -111,6 +268,7 @@ class Authentication extends BaseController
} }
} }
## Lock Screen - holded
public function lock() public function lock()
{ {
// Load the session library // Load the session library
@ -123,6 +281,7 @@ class Authentication extends BaseController
return redirect()->to('lockscreen'); // Replace with your lock screen URL return redirect()->to('lockscreen'); // Replace with your lock screen URL
} }
## Unlock Screen - holded
public function unlock() public function unlock()
{ {
// Load the session library // Load the session library
@ -141,7 +300,7 @@ class Authentication extends BaseController
} }
} }
// Replace with your password checking logic ## Unlock Screen - Replace with your password checking logic - holded
private function checkPassword($password) private function checkPassword($password)
{ {
// Implement your password validation logic here // Implement your password validation logic here

View File

@ -1,6 +1,8 @@
<?php <?php
namespace App\Controllers; namespace App\Controllers;
use App\Models\BooksModel;
## Home Controllers only for Dashboards,Report Modules ## Home Controllers only for Dashboards,Report Modules
class Home extends BaseController class Home extends BaseController
{ {
@ -12,27 +14,73 @@ class Home extends BaseController
} }
## ApiIntegration. Dummy ## ApiIntegration.
public function apiintegration() { public function apiintegration() {
helper('apiIntegration'); helper('apiIntegration');
helper('session');
// GET - list of books $session_role = get_user_role();
$response_1 = perform_http_request('GET', WPBOOK_DETAILS,false); $session_uid = get_logged_user_id();
$data['books'] = $response_1; $response = perform_http_request('GET', VPB_BOOK);
$response_2 = perform_http_request('GET', WPBOOK_DETAILS_GET_STRAIGHTFORWARD,false); $message = "";
$data['books_ps'] = $response_2; if(count($response['response'])>0){
$response_3 = perform_http_request('GET', WPBOOK_DETAILS_GET_SEGMENT,false); //$message = "Reponse Count : ".count($response['response'])." <br/>";
$data['book'] = $response_3; echo "Reponse Count : ".count($response['response'])." <br/>";
//POST - create new book $BooksModel = new BooksModel();
$request_data = json_encode(array("name" => "Soumitra", "job" => "Blog Author", "avatar" => "https://roytuts.com/about/")); foreach($response['response'] as $row){
$response_4 = perform_http_request('POST', WPBOOK_DETAILS_POST, $request_data); if($row->status == "publish"){
$data['new_book'] = $response_4; $publisher = '';
//PUT - update book $language = '';
$request_data = json_encode(array("name" => "Soumitra", "job" => "Roy Tutorials Author", "avatar" => "https://roytuts.com/about/")); $attributes = $row->attributes;
$response_5 = perform_http_request('PUT', WPBOOK_DETAILS_PUT, $request_data); if(count($attributes)>0){
$data['update_book'] = $response_5; foreach ($attributes as $att){
//View if($att->name == "Publisher"){ $publisher = implode(", ",$att->options); }
// print_r($data); if($att->name == "Book Author"){ $publisher .= implode(", ",$att->options)."(Book Author)"; }
return view('api_list', $data); if($att->name == "Book Language"){ $language = implode(", ",$att->options); }
}
}
// echo $row->permalink ;
$insertion_data['title'] = $row->name ;
$insertion_data['publication_date'] = $row->date_created;
$insertion_data['publisher'] = $publisher;
$insertion_data['genre'] = $row->description;
$insertion_data['language'] = $language;
$insertion_data['description'] = $row->short_description;
$insertion_data['page_count']='';
$insertion_data['price'] = $row->sale_price != '' ? $row->sale_price : $row->regular_price;
$insertion_data['created_by'] = $session_uid;
$insertion_data['isactive'] = 1;
$insertion_data['business_id'] = 1;
$images = $row->images;
$i = 0;
$BooksModel->insert($insertion_data);
$lastInsertId = $BooksModel->insertID();
$insertion_img_data = [];
// $message .= "book ID : ".$lastInsertId." have Imgs".count($images)." <br/>";
echo "book ID : ".$lastInsertId." have Imgs".count($images)." <br/>";
if(count($images)>0){
foreach ($images as $img){
$insertion_img_data[$i]['img_name'] = $img->src;
$insertion_img_data[$i]['is_cover'] = 0;
$insertion_img_data[$i]['type'] = 2;
$insertion_img_data[$i]['book_id'] = $lastInsertId;
$insertion_img_data[$i]['created_by'] = $session_uid;
$insertion_img_data[$i]['isactive'] = 1;
$i++;
} // image loop closed
$BooksModel->insertImagesBatch($insertion_img_data);
//$message .= "book ID : ".$lastInsertId." Img. Batch Inserted Done <br/>";
echo "book ID : ".$lastInsertId." Img. Batch Inserted Done <br/>";
}//image count closed
}//if cond. closed
}//reponse foreach closed
}//reponse count if closed
if(!empty($response['error'])){
echo $response['error'];
echo $response['error_msg'];
$message .= $response['error'].$response['error_msg'];
echo $response['error'].$response['error_msg'];
}
//return $message;
echo "Done";
} }
} }

View File

@ -125,7 +125,6 @@ class Users extends BaseController
'role' => $this->request->getPost('role'), 'role' => $this->request->getPost('role'),
'first_name' => $this->request->getPost('first_name'), 'first_name' => $this->request->getPost('first_name'),
'last_name' => $this->request->getPost('last_name'), 'last_name' => $this->request->getPost('last_name'),
'password' => $this->request->getPost('password'),
'mobile_no' => $this->request->getPost('mobile_no'), 'mobile_no' => $this->request->getPost('mobile_no'),
'date_of_birth' => $this->request->getPost('date_of_birth'), 'date_of_birth' => $this->request->getPost('date_of_birth'),
'address' => $this->request->getPost('address'), 'address' => $this->request->getPost('address'),
@ -136,7 +135,10 @@ class Users extends BaseController
if (empty($user_id)) { if (empty($user_id)) {
// It's an insert operation // It's an insert operation
$password = $this->request->getVar('password');
$hash_password = password_hash($password, PASSWORD_DEFAULT);
$data['isactive'] = 1; $data['isactive'] = 1;
$data['password'] = $hash_password;
$data['created_by'] = $session_uid; $data['created_by'] = $session_uid;
//print_r($data);die; //print_r($data);die;
$UsersModel->insert($data); $UsersModel->insert($data);

View File

@ -1,10 +1,15 @@
<?php <?php
function perform_http_request($method, $url, $data = false) { function perform_http_request($method, $url, $data = false) {
$username = "ck_935889d13267b63c2341168e42ffafe3c1ee831a";
$password = "cs_6ce1321c3f08049dfb3c8098ea21137796446bc4";
$encodekey = base64_encode($username.':'.$password);
$headers = array(
'Content-Type:application/json',
'Authorization: Basic '. $encodekey
);
try{
$curl = curl_init(); $curl = curl_init();
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
// $headers = array('Content-Type: application/json');
// curl_setopt( $curl,CURLOPT_HTTPHEADER, $headers );
switch ($method) { switch ($method) {
case "POST": case "POST":
@ -25,12 +30,31 @@ function perform_http_request($method, $url, $data = false) {
curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); //If SSL Certificate Not Available, for example, I am calling from http://localhost URL // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); //If SSL Certificate Not Available, for example, I am calling from http://localhost URL
// curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, true ); curl_setopt( $curl,CURLOPT_SSL_VERIFYPEER, true );
curl_setopt($curl, CURLOPT_FAILONERROR, true);
$result = curl_exec($curl); $result = curl_exec($curl);
$http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
$curl_errno= curl_errno($curl);
if($curl_errno){
if ($http_status==503){
$error = "HTTP Status == 503 <br/> Curl Errno returned $curl_errno <br/>";
}
else{ $error = "Curl Errno returned $curl_errno <br/>"; }
$error_msg = curl_error($curl);
}else{
$error = "";
$error_msg = "";
}
curl_close($curl); curl_close($curl);
// print_r(json_decode($result)); $response = (array) json_decode($result);
return $result; }catch (Exception $e) {
} $error = "Exception Errno returned".$e->getCode()." <br/>";
$error_msg = $e->getMessage();
$response = array();
}
$final = array( "response"=>$response,"error"=>$error,"error_msg"=>$error_msg);
return $final;
}
?> ?>

View File

@ -5,7 +5,7 @@ class AuthenticationModel extends Model
{ {
protected $table = 'users'; protected $table = 'users';
protected $primaryKey = 'user_id'; 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']; 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','reset_link'];
public function getheringDetailsForHeader($user_id) public function getheringDetailsForHeader($user_id)
{ {

View File

@ -18,4 +18,13 @@ class BooksModel extends Model
} }
} }
public function insertImages($imgData) {
$this->db->table('book_images')->insert($imgData);
return $this->db->insertID(); // Return the last inserted ID
}
public function insertImagesBatch($imgDataArray) {
$this->db->table('book_images')->insertBatch($imgDataArray);
return $this->db->insertID(); // Note: insertID() might not be applicable for batch inserts
}
} }

View File

@ -0,0 +1,135 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Confirm Email Alert</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/company/default.ico" ?>">
<!-- App css -->
<link href="<?= base_url() . "public/assets/css/bootstrap.min.css" ?>" rel="stylesheet" type="text/css" id="bs-default-stylesheet" />
<link href="<?= base_url() . "public/assets/css/app.min.css" ?>" rel="stylesheet" type="text/css" id="app-default-stylesheet" />
<link href="<?= base_url() . "public/assets/css/bootstrap-dark.min.css" ?>" rel="stylesheet" type="text/css" id="bs-dark-stylesheet" />
<link href="<?= base_url() . "public/assets/css/app-dark.min.css" ?>" rel="stylesheet" type="text/css" id="app-dark-stylesheet" />
<!-- icons -->
<link href="<?= base_url() . "public/assets/css/icons.min.css" ?>" rel="stylesheet" type="text/css" />
</head>
<body class="loading">
<div class="account-pages mt-5 mb-5">
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8 col-lg-6 col-xl-5">
<div class="card">
<div class="card-body p-4">
<!-- <div class="text-center w-75 m-auto">
<div class="auth-logo">
<a href="index.html" class="logo logo-dark text-center">
<span class="logo-lg">
<img src="<?= base_url() . "public/assets/images/company/default.png" ?>" alt="" height="22">
</span>
</a>
<a href="index.html" class="logo logo-light text-center">
<span class="logo-lg">
<img src="<?= base_url() . "public/assets/images/company/default.png" ?>" alt="" height="22">
</span>
</a>
</div>
</div> -->
<div class="mt-3 text-center">
<svg version="1.1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 98 98" style="height: 120px;" xml:space="preserve">
<style type="text/css">
.st0 {
fill: #FFFFFF;
}
.st1 {
fill: #1abc9c;
}
.st2 {
fill: #FFFFFF;
stroke: #1abc9c;
stroke-width: 2;
stroke-miterlimit: 10;
}
.st3 {
fill: none;
stroke: #FFFFFF;
stroke-width: 2;
stroke-linecap: round;
stroke-miterlimit: 10;
}
</style>
<g i:extraneous="self">
<circle id="XMLID_50_" class="st0" cx="49" cy="49" r="49" />
<g id="XMLID_4_">
<path id="XMLID_49_" class="st1" d="M77.3,42.7V77c0,0.6-0.4,1-1,1H21.7c-0.5,0-1-0.5-1-1V42.7c0-0.3,0.1-0.6,0.4-0.8l27.3-21.7
c0.3-0.3,0.8-0.3,1.2,0l27.3,21.7C77.1,42.1,77.3,42.4,77.3,42.7z" />
<path id="XMLID_48_" class="st2" d="M66.5,69.5h-35c-1.1,0-2-0.9-2-2V26.8c0-1.1,0.9-2,2-2h35c1.1,0,2,0.9,2,2v40.7
C68.5,68.6,67.6,69.5,66.5,69.5z" />
<path id="XMLID_47_" class="st1" d="M62.9,33.4H47.2c-0.5,0-0.9-0.4-0.9-0.9v-0.2c0-0.5,0.4-0.9,0.9-0.9h15.7
c0.5,0,0.9,0.4,0.9,0.9v0.2C63.8,33,63.4,33.4,62.9,33.4z" />
<path id="XMLID_46_" class="st1" d="M62.9,40.3H47.2c-0.5,0-0.9-0.4-0.9-0.9v-0.2c0-0.5,0.4-0.9,0.9-0.9h15.7
c0.5,0,0.9,0.4,0.9,0.9v0.2C63.8,39.9,63.4,40.3,62.9,40.3z" />
<path id="XMLID_45_" class="st1" d="M62.9,47.2H47.2c-0.5,0-0.9-0.4-0.9-0.9v-0.2c0-0.5,0.4-0.9,0.9-0.9h15.7
c0.5,0,0.9,0.4,0.9,0.9v0.2C63.8,46.8,63.4,47.2,62.9,47.2z" />
<path id="XMLID_44_" class="st1" d="M62.9,54.1H47.2c-0.5,0-0.9-0.4-0.9-0.9v-0.2c0-0.5,0.4-0.9,0.9-0.9h15.7
c0.5,0,0.9,0.4,0.9,0.9v0.2C63.8,53.7,63.4,54.1,62.9,54.1z" />
<path id="XMLID_43_" class="st2" d="M41.6,40.1h-5.8c-0.6,0-1-0.4-1-1v-6.7c0-0.6,0.4-1,1-1h5.8c0.6,0,1,0.4,1,1v6.7
C42.6,39.7,42.2,40.1,41.6,40.1z" />
<path id="XMLID_42_" class="st2" d="M41.6,54.2h-5.8c-0.6,0-1-0.4-1-1v-6.7c0-0.6,0.4-1,1-1h5.8c0.6,0,1,0.4,1,1v6.7
C42.6,53.8,42.2,54.2,41.6,54.2z" />
<path id="XMLID_41_" class="st1" d="M23.4,46.2l25,17.8c0.3,0.2,0.7,0.2,1.1,0l26.8-19.8l-3.3,30.9H27.7L23.4,46.2z" />
<path id="XMLID_40_" class="st3" d="M74.9,45.2L49.5,63.5c-0.3,0.2-0.7,0.2-1.1,0L23.2,45.2" />
</g>
</g>
</svg>
<h3>Success !</h3>
<!-- <p class="text-muted mt-2"> A email has been send to <span class="font-weight-medium"><?= $email; ?></span>.
Please check for an email from company and click on the included link to
reset your password. </p>
<a href="<?= base_url(); ?>" class="btn btn-block btn-primary waves-effect waves-light mt-3">Back to Home</a> -->
<a href="<?= $link; ?>" class="btn btn-block btn-primary waves-effect waves-light mt-3" target="_blank">Alternative So Click here</a>
</div>
</div> <!-- end card-body -->
</div>
<!-- end card -->
</div> <!-- end col -->
</div>
<!-- end row -->
</div>
<!-- end container -->
</div>
<!-- end page -->
<footer class="footer footer-alt">
<p> <?= date('Y') ?> &copy; <?= "bigbamboobookpublish"; ?>.</p>
</footer>
<!-- Vendor js -->
<script src="<?= base_url() . "public/assets/js/vendor.min.js" ?>"></script>
<!-- App js -->
<script src="<?= base_url() . "public/assets/js/app.min.js" ?>"></script>
</body>
</html>

View File

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>BigBambooBookPublish | BBBP </title> <title>BigBambooBookPublish | BBBP </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
@ -8,21 +9,20 @@
<meta content="Coderthemes" name="author" /> <meta content="Coderthemes" name="author" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- App favicon --> <!-- App favicon -->
<link rel="shortcut icon" href="<?= base_url()."public/assets/images/company/default.ico"?>"> <link rel="shortcut icon" href="<?= base_url() . "public/assets/images/company/default.ico" ?>">
<!-- App css --> <!-- App css -->
<link href="<?= base_url()."public/assets/css/bootstrap.min.css" ?>" rel="stylesheet" type="text/css" id="bs-default-stylesheet" /> <link href="<?= base_url() . "public/assets/css/bootstrap.min.css" ?>" rel="stylesheet" type="text/css" id="bs-default-stylesheet" />
<link href="<?= base_url()."public/assets/css/app.min.css" ?>" rel="stylesheet" type="text/css" id="app-default-stylesheet" /> <link href="<?= base_url() . "public/assets/css/app.min.css" ?>" rel="stylesheet" type="text/css" id="app-default-stylesheet" />
<link href="<?= base_url() . "public/assets/css/bootstrap-dark.min.css" ?>" rel="stylesheet" type="text/css" id="bs-dark-stylesheet" />
<link href="<?= base_url()."public/assets/css/bootstrap-dark.min.css" ?>" rel="stylesheet" type="text/css" id="bs-dark-stylesheet" /> <link href="<?= base_url() . "public/assets/css/app-dark.min.css" ?>" rel="stylesheet" type="text/css" id="app-dark-stylesheet" />
<link href="<?= base_url()."public/assets/css/app-dark.min.css" ?>" rel="stylesheet" type="text/css" id="app-dark-stylesheet" />
<!-- icons --> <!-- icons -->
<link href="<?= base_url()."public/assets/css/icons.min.css" ?>" rel="stylesheet" type="text/css" /> <link href="<?= base_url() . "public/assets/css/icons.min.css" ?>" rel="stylesheet" type="text/css" />
</head> </head>
<body class="loading"> <body class="loading">
<div class="account-pages mt-5 mb-5"> <div class="account-pages mt-5 mb-5">
<div class="container"> <div class="container">
@ -36,34 +36,32 @@
<div class="auth-logo"> <div class="auth-logo">
<a href="javascript: void(0);" class="logo logo-dark text-center"> <a href="javascript: void(0);" class="logo logo-dark text-center">
<span class="logo-lg"> <span class="logo-lg">
<img src="<?= base_url()."public/assets/images/company/default.png" ?>" alt="" height="80"> <img src="<?= base_url() . "public/assets/images/company/default.png" ?>" alt="" height="80">
</span> </span>
</a> </a>
<a href="javascript: void(0);" class="logo logo-light text-center"> <a href="javascript: void(0);" class="logo logo-light text-center">
<span class="logo-lg"> <span class="logo-lg">
<img src="<?= base_url()."public/assets/images/company/default.png" ?>" alt="" height="80"> <img src="<?= base_url() . "public/assets/images/company/default.png" ?>" alt="" height="80">
</span> </span>
</a> </a>
</div> </div>
<p class="text-muted mb-4 mt-3"><span>BigBambooBookPublish</br></br></span>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> </div>
<!-- <form action=""> --> <!-- <form action=""> -->
<form action="<?= base_url()."authenticate" ?>" method="post"> <form action="<?= base_url() . "authenticate" ?>" method="post">
<div class="form-group mb-3"> <div class="form-group mb-3">
<label for="emailaddress">Email address</label> <label for="emailaddress">Email address</label>
<input class="form-control" type="email" name="username" id="emailaddress" required="" placeholder="Enter your email"> <input class="form-control" type="email" name="username" id="emailaddress" required placeholder="Enter your email" autocomplete="off">
</div> </div>
<div class="form-group mb-3"> <div class="form-group mb-3">
<!-- <a href="auth-recoverpw-2.html" class="text-muted float-right"><small>Forgot your password?</small></a> -->
<!-- <a href="<?= base_url()."auth_confirm_mail"; ?>" class="text-muted float-right"><small>Forgot your password?</small></a> -->
<a href="#" id="resetLink" class="text-muted float-right"><small>Forgot your password?</small></a>
<label for="password">Password</label> <label for="password">Password</label>
<div class="input-group input-group-merge"> <div class="input-group input-group-merge">
<input type="password" name="password" id="password" class="form-control" placeholder="Enter your password"> <input class="form-control" type="password" name="password" id="password" required placeholder="Enter your password" autocomplete="off">
<div class="input-group-append" data-password="false"> <div class="input-group-append" data-password="false">
<div class="input-group-text"> <div class="input-group-text">
<span class="password-eye"></span> <span class="password-eye"></span>
@ -72,17 +70,24 @@
</div> </div>
</div> </div>
<div class="form-group mb-3"> <!-- <div class="form-group mb-3">
<div class="custom-control custom-checkbox"> <div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="checkbox-signin" checked> <input type="checkbox" class="custom-control-input" id="checkbox-signin" checked>
<label class="custom-control-label" for="checkbox-signin">Remember me</label> <label class="custom-control-label" for="checkbox-signin">Remember me</label>
</div> </div>
</div> -->
<?php if (isset($validationErrors)) : ?>
<span class="widget-simple text-center">
<div class="media-body align-self-center font-24 avatar-title">
<p style="color: #f1556c!important;" class="mt-0" style><?= $validationErrors; ?></p>
</div> </div>
</span>
<?php endif; ?>
<div class="form-group mb-0 text-center"> <div class="form-group mb-0 text-center">
<button class="btn btn-primary btn-block" type="submit"> Log In </button> <button class="btn btn-primary btn-block" type="submit"> Log In </button>
</div> </div>
</form> </form>
</div> <!-- end card-body --> </div> <!-- end card-body -->
</div> </div>
@ -90,8 +95,8 @@
<div class="row mt-3"> <div class="row mt-3">
<div class="col-12 text-center"> <div class="col-12 text-center">
<p> <a href="auth-recoverpw.html" class="text-muted ml-1">Forgot your password?</a></p> <!-- <p> <a href="auth-recoverpw.html" class="text-muted ml-1">Forgot your password?</a></p> -->
<p class="text-muted">Don't have an account? <a href="auth-register.html" class="text-primary font-weight-medium ml-1">Sign Up</a></p> <!-- <p class="text-muted">Don't have an account? <a href="auth-register.html" class="text-primary font-weight-medium ml-1">Sign Up</a></p> -->
</div> <!-- end col --> </div> <!-- end col -->
</div> </div>
<!-- end row --> <!-- end row -->
@ -109,10 +114,21 @@
</footer> </footer>
<!-- Vendor js --> <!-- Vendor js -->
<script src="<?= base_url()."public/assets/js/vendor.min.js" ?>"></script> <script src="<?= base_url() . "public/assets/js/vendor.min.js" ?>"></script>
<!-- App js --> <!-- App js -->
<script src="<?= base_url()."public/assets/js/app.min.js" ?>"></script> <script src="<?= base_url() . "public/assets/js/app.min.js" ?>"></script>
<script>
$(document).ready(function() {
// Fetch email value and set it as href for the reset link
$('#emailaddress').on('input', function() {
var emailValue = $(this).val();
$('#resetLink').attr('href', 'auth_confirm_mail?email='+emailValue);
});
});
</script>
</body>
</body>
</html> </html>

View File

@ -0,0 +1,123 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Reset password</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/company/default.ico" ?>">
<!-- App css -->
<link href="<?= base_url() . "public/assets/css/bootstrap-creative.min.css" ?>" rel="stylesheet" type="text/css" id="bs-default-stylesheet" />
<link href="<?= base_url() . "public/assets/css/app-creative.min.css" ?>" rel="stylesheet" type="text/css" id="app-default-stylesheet" />
<link href="<?= base_url() . "public/assets/css/bootstrap-creative-dark.min.css" ?>" rel="stylesheet" type="text/css" id="bs-dark-stylesheet" />
<link href="<?= base_url() . "public/assets/css/app-creative-dark.min.css" ?>" rel="stylesheet" type="text/css" id="app-dark-stylesheet" />
<!-- icons -->
<link href="<?= base_url() . "public/assets/css/icons.min.css" ?>" rel="stylesheet" type="text/css" />
</head>
<body class="loading">
<div class="account-pages mt-5 mb-5">
<div class="container">
<div class="row justify-content-center">
<!-- <div class="col-md-8 col-lg-6 col-xl-5"> -->
<div class="col-md-8 col-lg-7 col-xl-5">
<div class="card">
<div class="card-body p-3">
<div class="text-center w-75 m-auto">
<p class="text-muted mb-4 mt-3">Enter your email address and we'll send you an email with instructions to reset your password.</p>
</div>
<form action="<?= base_url() . "auth_reset_password_save" ?>" method="post" role="form" class="parsley-examples">
<div class="form-group row">
<label class="col-sm-2 col-form-label" for="emailaddress">Email : </label>
<div class="col-sm-10">
<input type="text" readonly class="form-control-plaintext" id="emailaddress" name="email" value="<?= $email ?>">
</div>
</div>
<div class="form-group">
<div class="form-row">
<div class="form-group col-md-6">
<label for="hori-pass1">Password<span class="text-danger">*</span></label>
<div class="input-group input-group-merge">
<input id="hori-pass1" name="password1" type="password" placeholder="Password" required class="form-control">
<!-- <div class="input-group-append" data-password="false">
<div class="input-group-text">
<span class="password-eye"></span>
</div>
</div> -->
</div>
</div>
<div class="form-group col-md-6">
<label for="hori-pass2">Confirm Password<span class="text-danger">*</span></label>
<div class="input-group input-group-merge">
<input data-parsley-equalto="#hori-pass1" type="password" required placeholder="Confirm Password" class="form-control" id="hori-pass2" name="password2">
<!-- <div class="input-group-append" data-password="false">
<div class="input-group-text">
<span class="password-eye"></span>
</div>
</div> -->
</div>
</div>
</div>
<?php if (isset($validationErrors)) : ?>
<span class="widget-simple text-center">
<div class="media-body align-self-center font-24 avatar-title">
<p style="color: #f1556c!important;" class="mt-0" style><?= $validationErrors; ?></p>
</div>
</span>
<?php endif; ?>
<div class="form-group mb-0 text-center">
<button class="btn btn-primary btn-block" type="submit"> Reset Password </button>
</div>
</div>
</form>
</div> <!-- end card-body -->
</div>
<!-- end card -->
<div class="row mt-3">
<div class="col-12 text-center">
<p class="text-muted">Back to <a href="<?= base_url(); ?>" class="text-primary font-weight-medium ml-1">Log in</a></p>
</div> <!-- end col -->
</div>
<!-- end row -->
</div> <!-- end col -->
</div>
<!-- end row -->
</div>
<!-- end container -->
</div>
<!-- end page -->
<footer class="footer footer-alt">
<p> <?= date('Y') ?> &copy; <?= "bigbamboobookpublish"; ?>.</p>
</footer>
<!-- Vendor js -->
<script src="<?= base_url() . "public/assets/js/vendor.min.js" ?>"></script>
<!-- Plugin js-->
<script src="<?= base_url() . "public/assets/libs/parsleyjs/parsley.min.js" ?>"></script>
<!-- Validation init js-->
<script src="<?= base_url() . "public/assets/js/pages/form-validation.init.js" ?>"></script>
<!-- App js -->
<script src="<?= base_url() . "public/assets/js/app.min.js" ?>"></script>
</body>
</html>

View File

@ -4,7 +4,7 @@
<div class="card-body"> <div class="card-body">
<div class="float-right"> <div class="float-right">
<a href="<?= base_url() . "book_page/0"; ?>" class="btn btn-primary waves-effect"> <span> <i class="mdi mdi-book-plus"></i></span> Add New </a> <a href="<?= base_url() . "book_page/0"; ?>" class="btn btn-primary waves-effect"> <span> <i class="mdi mdi-book-plus"></i></span> Add New </a>
<a href="<?= base_url() . "apiintegration"; ?>" class="btn btn-primary waves-effect"> <span> <i class="mdi mdi-gesture-swipe-down"></i></span> Api integration </a> <a href="<?= base_url()."apiintegration"; ?>" class="btn btn-success waves-effect"> <span> <i class="mdi mdi-gesture-swipe-down"></i></span> Api integration </a>
</div> </div>
<br> <br>
<h4 class="header-title mb-3"><?= $page_name; ?></h4> <h4 class="header-title mb-3"><?= $page_name; ?></h4>