Book and site setting : ps
This commit is contained in:
parent
8962ee5ad4
commit
3b8ddca8fe
@ -41,14 +41,18 @@ $routes->get('dashboard/', 'Home::index');
|
||||
|
||||
# Users Routes
|
||||
$routes->get("user_list/", "Users::index");
|
||||
// $routes->get('user-list/', 'Users::index', ['as' => 'user_list']);
|
||||
$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("book_page/(:any)", "Books::book_page/$1");
|
||||
$routes->post("book_synchronization", "Books::book_synchronization");
|
||||
|
||||
# Site-Setting Routes
|
||||
$routes->get("sitesetting_list/", "Settings::index");
|
||||
$routes->get("sitesetting_page/(:any)", "Settings::sitesetting_page/$1");
|
||||
$routes->post("sitesetting_synchronization", "Settings::sitesetting_synchronization");
|
||||
|
||||
# Business Routes
|
||||
$routes->get("business_list/", "Business::index");
|
||||
|
||||
@ -23,4 +23,47 @@ class Books extends BaseController
|
||||
$data['details'] = $book_details;
|
||||
$this->render_page('book_list', $data);
|
||||
}
|
||||
|
||||
## To Load Book Add/Update page
|
||||
public function book_page($id)
|
||||
{
|
||||
if ($id === '0') {
|
||||
$data['page_name'] = 'Add Book';
|
||||
$data['details'] = [];
|
||||
} else if ($id !== '0') {
|
||||
$data['page_name'] = 'Edit Book';
|
||||
$model = new BooksModel();
|
||||
$model->setTable('books');
|
||||
$details = $model->where(['book_id' => $id, 'isactive' => 1])->first();
|
||||
$data['details'] = $details;
|
||||
}
|
||||
$this->render_page('book_form', $data);
|
||||
}
|
||||
|
||||
|
||||
## To Save/Update Book Data on DB.
|
||||
public function book_synchronization()
|
||||
{
|
||||
$session = \Config\Services::session();
|
||||
$model = new BooksModel();
|
||||
$model->setTable('books');
|
||||
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('book_id');
|
||||
$requestData['isactive'] = isset($requestData['isactive']) && $requestData['isactive'] == 'on' ? 1 : 0;
|
||||
$model->saveData($requestData, $requestData['user_id']);
|
||||
$alert_message = "Book details successfully updated.";
|
||||
} else {
|
||||
#add
|
||||
$requestData['created_by'] = $session->get('user_id');
|
||||
$requestData['isactive'] = 1;
|
||||
$model->saveData($requestData, null);
|
||||
$alert_message = "Book details successfully created.";
|
||||
}
|
||||
return redirect()->route('user_list')->with('success', $alert_message);
|
||||
}
|
||||
}
|
||||
|
||||
70
app/Controllers/Settings.php
Executable file
70
app/Controllers/Settings.php
Executable file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Models\SettingsModel;
|
||||
|
||||
class Settings extends BaseController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$session = \Config\Services::session();
|
||||
$session_role = $session->get('user_role');
|
||||
$session_bid = $session->get('business_id');
|
||||
$where = ['settings.isactive' => 1];
|
||||
if (!empty($session_role) && $session_role !== "sadmin") {
|
||||
$where = ['settings.business_id' => $session_bid, 'settings.isactive' => 1];
|
||||
}
|
||||
|
||||
$model = new SettingsModel();
|
||||
$model->setTable('settings');
|
||||
$sitesetting_details = $model->where($where)->orderBy('setting_id', 'DESC')->findAll();
|
||||
$data['page_name'] = 'Site Settings Details';
|
||||
$data['details'] = $sitesetting_details;
|
||||
$data['session_role'] = $session_role;
|
||||
$this->render_page('setting_list', $data);
|
||||
}
|
||||
|
||||
## To Load Settings Add/Update page
|
||||
public function sitesetting_page($id)
|
||||
{
|
||||
if ($id === '0') {
|
||||
$data['page_name'] = 'Add Site Settings';
|
||||
$data['details'] = [];
|
||||
} else if ($id !== '0') {
|
||||
$data['page_name'] = 'Edit Site Settings';
|
||||
$model = new SettingsModel();
|
||||
$model->setTable('settings');
|
||||
$details = $model->where(['setting_id' => $id, 'isactive' => 1])->first();
|
||||
$data['details'] = $details;
|
||||
}
|
||||
$this->render_page('setting_form', $data);
|
||||
}
|
||||
|
||||
|
||||
## To Save/Update Setting Data on DB.
|
||||
public function sitesetting_synchronization()
|
||||
{
|
||||
$session = \Config\Services::session();
|
||||
$model = new SettingsModel();
|
||||
$model->setTable('settings');
|
||||
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('book_id');
|
||||
$requestData['isactive'] = isset($requestData['isactive']) && $requestData['isactive'] == 'on' ? 1 : 0;
|
||||
$model->saveData($requestData, $requestData['user_id']);
|
||||
$alert_message = "Site Settings details successfully updated.";
|
||||
} else {
|
||||
#add
|
||||
$requestData['created_by'] = $session->get('user_id');
|
||||
$requestData['isactive'] = 1;
|
||||
$model->saveData($requestData, null);
|
||||
$alert_message = "Site Settings details successfully created.";
|
||||
}
|
||||
return redirect()->route('setting_list')->with('success', $alert_message);
|
||||
}
|
||||
}
|
||||
@ -38,7 +38,7 @@ class Users extends BaseController
|
||||
$edit_user_details = $model->where(['user_id' => $id, 'isactive' => 1])->first();
|
||||
$data['details'] = $edit_user_details;
|
||||
}
|
||||
$this->render_page('user', $data);
|
||||
$this->render_page('user_form', $data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
22
app/Models/SettingsModel.php
Normal file
22
app/Models/SettingsModel.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
use CodeIgniter\Model;
|
||||
class SettingsModel extends Model
|
||||
{
|
||||
protected $table = 'settings';
|
||||
protected $primaryKey = 'setting_id';
|
||||
protected $allowedFields = ['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','country','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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
82
app/Views/book_form.php
Normal file
82
app/Views/book_form.php
Normal file
@ -0,0 +1,82 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="header-title"><?= $page_name; ?></h4>
|
||||
<p class="sub-header"> </p>
|
||||
<?php if (session()->getFlashdata('success')): ?>
|
||||
<div class="alert alert-success"><?= session()->getFlashdata('success') ?></div>
|
||||
<?php endif; ?>
|
||||
<form action="<?= base_url()."book_synchronization"; ?>" method="post">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="title" class="col-form-label">Book Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="title" name="title" value="<?= isset($details['title']) ? $details['title'] : '' ?>" placeholder="Title" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="publisher" class="col-form-label">Book Publisher Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="publisher" name="publisher" placeholder="Book Publisher (Authors)" value="<?= isset($details['publisher']) ? $details['publisher'] : '' ?>" required />
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="language" class="col-form-label">Language<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="language" name="language" placeholder="Language" value="<?= isset($details['language']) ? $details['language'] : '' ?>" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="publication_date" class="col-form-label">Publication Date<span class="text-danger">*</span></label>
|
||||
<input type="date" class="form-control" id="publication_date" name="publication_date" placeholder="Publication Date (format : DD/MM/YYYY)" required data-toggle="input-mask" data-mask-format="00/00/0000" value="<?= isset($details['publication_date']) ? $details['publication_date'] : '' ?>" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="genre" class="col-form-label">Genre</label>
|
||||
<input type="text" class="form-control" id="genre" name="genre" placeholder="Genre" value="<?= isset($details['genre']) ? $details['genre'] : '' ?>" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="cover_picture" class="col-form-label">Book Cover Picture<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="cover_picture" name="cover_picture" placeholder="Book Cover picture Name" required value="<?= isset($details['cover_picture']) ? $details['cover_picture'] : '' ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="description" class="col-form-label">Description<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="description" name="description" placeholder="Description" required value="<?= isset($details['description']) ? $details['description'] : '' ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="price" class="col-form-label">Book Price<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="price" name="price" placeholder="Book Price" required value="<?= isset($details['price']) ? $details['price'] : '' ?>" />
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="page_count" class="col-form-label">Page Count<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="page_count" name="page_count" placeholder="Page Count" required value="<?= isset($details['page_count']) ? $details['page_count'] : '' ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="book_id" name="book_id" placeholder="hidden for book id" value="<?= isset($details['book_id']) ? $details['book_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="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-success waves-effect waves-light mr-1" type="submit">
|
||||
Submit
|
||||
</button>
|
||||
<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>
|
||||
</div> <!-- end card-body-->
|
||||
</div> <!-- end card-->
|
||||
</div> <!-- end col-->
|
||||
</div>
|
||||
<!-- end row -->
|
||||
@ -2,9 +2,9 @@
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<!-- <div class="float-right">
|
||||
<a href="add_book" class="btn btn-primary"><i class="ri-book-3-line"></i> Add New </a>
|
||||
</div><!- end col -->
|
||||
<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>
|
||||
</div>
|
||||
<br>
|
||||
<h4 class="header-title mb-3"><?= $page_name; ?></h4>
|
||||
<div class="table-responsive">
|
||||
@ -23,6 +23,7 @@
|
||||
<th>Price of the Book</th>
|
||||
<th>Description</th>
|
||||
<th>Status</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -34,6 +35,7 @@
|
||||
$class = 'badge badge-soft-danger';
|
||||
$message = 'In-Active';
|
||||
}
|
||||
$edit_page_route = base_url()."book_page/".$row['book_id'];
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $row['title'] ; ?></td>
|
||||
@ -46,6 +48,13 @@
|
||||
<td>
|
||||
<span class="<?php echo $class; ?>"><?php echo $message; ?></span>
|
||||
</td>
|
||||
<td>
|
||||
<ul class="list-inline table-action m-0">
|
||||
<li class="list-inline-item">
|
||||
<a href="<?php echo $edit_page_route; ?>" class="action-icon px-1"> <i class="ri ri-edit-box-fill"></i></a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
||||
139
app/Views/setting_form.php
Normal file
139
app/Views/setting_form.php
Normal file
@ -0,0 +1,139 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="header-title"><?= $page_name; ?></h4>
|
||||
<p class="sub-header"> </p>
|
||||
|
||||
<?php if (session()->getFlashdata('success')): ?>
|
||||
<div class="alert alert-success"><?= session()->getFlashdata('success') ?></div>
|
||||
<?php endif; ?>
|
||||
<form action="<?= base_url()."setting_synchronization"; ?>" method="post">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="site_name" class="col-form-label">Site Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="site_name" name="site_name" value="<?= isset($details['site_name']) ? $details['site_name'] : '' ?>" placeholder="Site Name" required />
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="site_title" class="col-form-label">Site Title<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="site_title" name="site_title" placeholder="Site Title" value="<?= isset($details['site_title']) ? $details['site_title'] : '' ?>" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="terms_service" class="col-form-label">Terms Service<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="terms_service" name="terms_service" placeholder="Terms Service" value="<?= isset($details['terms_service']) ? $details['terms_service'] : '' ?>" required />
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="footer_about" class="col-form-label">Footer about<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="footer_about" name="footer_about" placeholder="Footer about" value="<?= isset($details['footer_about']) ? $details['footer_about'] : '' ?>" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="site_info" class="col-form-label">Site Information<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="site_info" name="site_info" placeholder="Site Information" value="<?= isset($details['site_info']) ? $details['site_info'] : '' ?>" required />
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="about_info" class="col-form-label">About Information<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="about_info" name="about_info" placeholder="About info" value="<?= isset($details['about_info']) ? $details['about_info'] : '' ?>" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="admin_email" class="col-form-label">Admin Email<span class="text-danger">*</span></label>
|
||||
<input type="email" class="form-control" id="admin_email" name="admin_email" placeholder="Admin Email" value="<?= isset($details['admin_email']) ? $details['admin_email'] : '' ?>" required />
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="mobile" class="col-form-label">Mobile Number<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="mobile" name="mobile" placeholder="Mobile Number (Enter only numbers)" required data-parsley-type="number" value="<?= isset($details['mobile']) ? $details['mobile'] : '' ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="copyright" class="col-form-label">Copyright</label>
|
||||
<input type="text" class="form-control" id="copyright" name="copyright" placeholder="Copy Right" value="<?= isset($details['copyright']) ? $details['copyright'] : '' ?>" />
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="pagination_limit" class="col-form-label">Pagination Limit<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="pagination_limit" name="pagination_limit" placeholder="Pagination Limit" required value="<?= isset($details['pagination_limit']) ? $details['pagination_limit'] : '' ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="favicon" class="col-form-label">Favicon<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="favicon" name="favicon" placeholder="Fav-icon Name" required value="<?= isset($details['favicon']) ? $details['favicon'] : '' ?>" />
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="logo" class="col-form-label">logo name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="logo" name="logo" placeholder="Logo Name" required value="<?= isset($details['logo']) ? $details['logo'] : '' ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="currency" class="col-form-label">Currency<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="currency" name="currency" placeholder="currency (eg : Rupees,Dollar,Euro)" required value="<?= isset($details['currency']) ? $details['currency'] : '' ?>" />
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="country" class="col-form-label">Country<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="country" name="country" placeholder="Country" required value="<?= isset($details['country']) ? $details['country'] : '' ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="mail_protocol" class="col-form-label">Mail Protocol<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="mail_protocol" name="mail_protocol" placeholder="Mail Protocol (eg : zoho,gmail)" required value="<?= isset($details['mail_protocol']) ? $details['mail_protocol'] : '' ?>" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="mail_title" class="col-form-label">Mail Title<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="mail_title" name="mail_title" placeholder="Mail Title" required value="<?= isset($details['mail_title']) ? $details['mail_title'] : '' ?>" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="mail_host" class="col-form-label">Mail Host<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="mail_host" name="mail_host" placeholder="Mail Host" required value="<?= isset($details['mail_host']) ? $details['mail_host'] : '' ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mail_port" class="col-form-label">Mail Port<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="mail_port" name="mail_port" placeholder="Mail Port" required value="<?= isset($details['mail_port']) ? $details['mail_port'] : '' ?>" />
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mail_encryption" class="col-form-label">Mail Encryption<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="mail_encryption" name="mail_encryption" placeholder="Mail Encryption" required value="<?= isset($details['mail_encryption']) ? $details['mail_encryption'] : '' ?>" />
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mail_username" class="col-form-label">Mail Username<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="mail_username" name="mail_username" placeholder="Mail Username" required value="<?= isset($details['mail_username']) ? $details['mail_username'] : '' ?>" />
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="mail_password" class="col-form-label">Mail Password<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="mail_password" name="mail_password" placeholder="Mail Password" required value="<?= isset($details['mail_password']) ? $details['mail_password'] : '' ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="setting_id" name="setting_id" placeholder="hidden for setting id" value="<?= isset($details['setting_id']) ? $details['setting_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="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-success waves-effect waves-light mr-1" type="submit">
|
||||
Submit
|
||||
</button>
|
||||
<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>
|
||||
</div> <!-- end card-body-->
|
||||
</div> <!-- end card-->
|
||||
</div> <!-- end col-->
|
||||
</div>
|
||||
<!-- end row -->
|
||||
62
app/Views/setting_list.php
Normal file
62
app/Views/setting_list.php
Normal file
@ -0,0 +1,62 @@
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="float-right">
|
||||
<a href="<?= base_url()."sitesetting_page/0"; ?>" class="btn btn-primary"><i class="mdi mdi-playlist-plus"></i> Add New </a>
|
||||
</div><!-- end col-->
|
||||
<br>
|
||||
<h4 class="header-title mb-3"><?= $page_name; ?></h4>
|
||||
<?php if (session()->getFlashdata('success')): ?>
|
||||
<div class="alert alert-success"><?= session()->getFlashdata('success') ?></div>
|
||||
<?php endif; ?>
|
||||
<div class="table-responsive">
|
||||
<table id="datatable-buttons" class="table dt-responsive w-100">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>Site Name</th>
|
||||
<th>Site Title</th>
|
||||
<th>Admin email</th>
|
||||
<th>Mobile Number</th>
|
||||
<th>Copyright</th>
|
||||
<th>Status</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?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 = base_url()."sitesetting_page/".$row['setting_id'];
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $row['site_name'] ; ?></td>
|
||||
<td><?php echo $row['site_title'] ; ?></td>
|
||||
<td><?php echo $row['admin_email'] ; ?></td>
|
||||
<td><?php echo $row['mobile'] ; ?></td>
|
||||
<td><?php echo $row['copyright'] ; ?></td>
|
||||
<td>
|
||||
<span class="<?php echo $class; ?>"><?php echo $message; ?></span>
|
||||
</td>
|
||||
<td>
|
||||
<ul class="list-inline table-action m-0">
|
||||
<li class="list-inline-item">
|
||||
<a href="<?php echo $edit_page_route; ?>" class="action-icon px-1"> <i class="ri ri-edit-box-fill"></i></a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!-- end card body-->
|
||||
</div> <!-- end card -->
|
||||
</div><!-- end col-->
|
||||
</div>
|
||||
<!-- end row-->
|
||||
@ -130,6 +130,12 @@
|
||||
<span> Books </span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url()."sitesetting_list"; ?>">
|
||||
<i class="ri-list-settings-line"></i>
|
||||
<span> Site Setting </span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= base_url()."business_list"; ?>">
|
||||
<i class="fa fa-industry"></i>
|
||||
|
||||
@ -51,7 +51,11 @@
|
||||
<span class="<?php echo $class; ?>"><?php echo $message; ?></span>
|
||||
</td>
|
||||
<td>
|
||||
<a href="<?php echo $edit_page_route; ?>" class="btn btn-xs btn-secondary"><i class="ri-pencil-line"></i></a>
|
||||
<ul class="list-inline table-action m-0">
|
||||
<li class="list-inline-item">
|
||||
<a href="<?php echo $edit_page_route; ?>" class="action-icon px-1"> <i class="ri ri-edit-box-fill"></i></a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user