books,scheme,invoice
This commit is contained in:
parent
69a7ff7e4a
commit
7c67794ccf
@ -38,16 +38,25 @@ class Books extends BaseController
|
|||||||
{
|
{
|
||||||
helper('session');
|
helper('session');
|
||||||
$data['session_bid'] = get_business_id();
|
$data['session_bid'] = get_business_id();
|
||||||
|
|
||||||
|
// Fetch categories from the model
|
||||||
|
$model = new BooksModel();
|
||||||
|
$categories = $model->getCategories();
|
||||||
|
|
||||||
if ($id === '0') {
|
if ($id === '0') {
|
||||||
$data['page_name'] = 'Add Book';
|
$data['page_name'] = 'Add Book';
|
||||||
$data['details'] = [];
|
$data['details'] = [];
|
||||||
} elseif ($id !== '0') {
|
} elseif ($id !== '0') {
|
||||||
$data['page_name'] = 'Edit Book';
|
$data['page_name'] = 'Edit Book';
|
||||||
$model = new BooksModel();
|
|
||||||
$model->setTable('books');
|
$imageData = $model->getBooksAndImagesByBookId($id);
|
||||||
$details = $model->where(['book_id' => $id, 'isactive' => 1])->first();
|
|
||||||
$data['details'] = $details;
|
$data['details'] = $imageData[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data['categories'] = $categories; // Pass the categories to the view
|
||||||
|
|
||||||
$this->render_page('book_form', $data);
|
$this->render_page('book_form', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,51 +67,11 @@ class Books extends BaseController
|
|||||||
$session_uid = get_logged_user_id();
|
$session_uid = get_logged_user_id();
|
||||||
$session_bid = get_business_id();
|
$session_bid = get_business_id();
|
||||||
|
|
||||||
// $validationRule = [
|
|
||||||
// 'userfile' => [
|
|
||||||
// 'label' => 'Image File',
|
|
||||||
// 'rules' => [
|
|
||||||
// 'uploaded[coverpicture]',
|
|
||||||
// 'is_image[coverpicture]',
|
|
||||||
// 'mime_in[coverpicture,image/jpg,image/jpeg,image/gif,image/png,image/webp]',
|
|
||||||
|
|
||||||
// ],
|
|
||||||
// ],
|
|
||||||
// ];
|
|
||||||
|
|
||||||
// if (!$this->validate($validationRule) && $this->request->getPost('coverpicture') === '') {
|
|
||||||
// $data = ['errors' => $this->validator->getErrors()];
|
|
||||||
// print_r($data);
|
|
||||||
// return 'hello';
|
|
||||||
// }
|
|
||||||
// $img = $this->request->getFile('coverpicture');
|
|
||||||
// $book_id = $this->request->getPost('book_id');
|
|
||||||
$business_id = $this->request->getPost('business_id');
|
|
||||||
// $filePath = 'public/uploads/' . $this->request->getPost('coverpicture');
|
|
||||||
|
|
||||||
// ## File Already Existing or not
|
|
||||||
// if ($img->isValid() && !$img->hasMoved()) {
|
|
||||||
// $fileName = $img->getName();
|
|
||||||
// $img->move('public/uploads/', $fileName);
|
|
||||||
|
|
||||||
|
|
||||||
// // Delete the previous image file if it exists
|
|
||||||
// if ($book_id) {
|
|
||||||
// $previousFileName = $this->request->getPost('previous_file');
|
|
||||||
// if ($previousFileName && is_file('public/uploads/' . $previousFileName)) {
|
|
||||||
// link('public/uploads/' . $previousFileName);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// $fileName = $this->request->getPost('previous_file', ''); // Use the previous filename if no new image is provided
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
$BooksModel = new BooksModel();
|
$BooksModel = new BooksModel();
|
||||||
$data = [
|
$data = [
|
||||||
|
|
||||||
'title' => $this->request->getPost('title'),
|
'title' => $this->request->getPost('title'),
|
||||||
// 'cover_picture' => $fileName,
|
|
||||||
'publication_date' => $this->request->getPost('publication_date'),
|
'publication_date' => $this->request->getPost('publication_date'),
|
||||||
'publisher' => $this->request->getPost('publisher'),
|
'publisher' => $this->request->getPost('publisher'),
|
||||||
'genre' => $this->request->getPost('genre'),
|
'genre' => $this->request->getPost('genre'),
|
||||||
@ -112,23 +81,69 @@ class Books extends BaseController
|
|||||||
'price' => $this->request->getPost('price'),
|
'price' => $this->request->getPost('price'),
|
||||||
'isbn_code' => $this->request->getPost('isbn_code'),
|
'isbn_code' => $this->request->getPost('isbn_code'),
|
||||||
'tax'=>$this->request->getPost('tax'),
|
'tax'=>$this->request->getPost('tax'),
|
||||||
'business_id' => $business_id
|
'business_id'=>$session_bid
|
||||||
|
|
||||||
];
|
];
|
||||||
$book_id = $this->request->getPost('book_id'); // Get the book ID for update purpose
|
$book_id = $this->request->getPost('book_id'); // Get the book ID for update purpose
|
||||||
|
|
||||||
if (empty($book_id)) {
|
if (empty($book_id)) {
|
||||||
// It's an insert operation
|
// It's an insert operation
|
||||||
$data['isactive'] = 1;
|
$data['isactive'] = 1;
|
||||||
$data['category'] = 1;
|
|
||||||
$data['created_by'] = $session_uid;
|
$data['created_by'] = $session_uid;
|
||||||
$BooksModel->insert($data);
|
$bookId = $BooksModel->insert($data);
|
||||||
|
|
||||||
|
|
||||||
|
// Retrieve the selected category ID from the form
|
||||||
|
$category_id = $this->request->getPost('category_id');
|
||||||
|
|
||||||
|
if ($category_id) {
|
||||||
|
// Insert the book-category association into the book_categories table
|
||||||
|
$BooksModel->db->table('book_categories')->insert(['book_id' => $bookId, 'category_id' => $category_id]);
|
||||||
|
}
|
||||||
|
if (!empty($_FILES['img_name']['name'])) {
|
||||||
|
// A new image has been uploaded
|
||||||
|
|
||||||
|
// First, delete the previous image file if it exists
|
||||||
|
if (!empty($imageData) && file_exists(WRITEPATH . 'public/uploads/' . $imageData[0]->img_name)) {
|
||||||
|
unlink(WRITEPATH . 'public/uploads/' . $imageData[0]->img_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$imageData = [
|
||||||
|
'book_id' => $bookId, // Assuming $last_inserted_id contains the ID of the inserted scheme
|
||||||
|
'img_name' => $_FILES['img_name']['name'],
|
||||||
|
'is_cover' => 1, // Set this based on your requirements
|
||||||
|
'type' => $_FILES['img_name']['type']
|
||||||
|
];
|
||||||
|
|
||||||
|
// Move the uploaded image to a desired location
|
||||||
|
$imagePath = 'public/uploads/' . $_FILES['img_name']['name'];
|
||||||
|
move_uploaded_file($_FILES['img_name']['tmp_name'], $imagePath);
|
||||||
|
|
||||||
|
// Update image data in the 'book_images' table
|
||||||
|
$BooksModel->insertImage($imageData);
|
||||||
|
}
|
||||||
|
// print_r($bookId); print_r($imageData); print_r($category_id);die;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// It's an update operation
|
// It's an update operation
|
||||||
$isactive = $this->request->getPost('isactive');
|
$isactive = $this->request->getPost('isactive');
|
||||||
$data['isactive'] = ($isactive == 'on') ? 1 : 0;
|
$data['isactive'] = ($isactive == 'on') ? 1 : 0;
|
||||||
$data['updated_by'] = $session_uid;
|
$data['updated_by'] = $session_uid;
|
||||||
$BooksModel->update($book_id, $data);
|
$BooksModel->update($book_id, $data);
|
||||||
|
|
||||||
|
// Retrieve the selected category ID from the form
|
||||||
|
$category_id = $this->request->getPost('category_id');
|
||||||
|
|
||||||
|
// Remove existing category associations
|
||||||
|
$BooksModel->db->table('book_categories')->where('book_id', $book_id)->delete();
|
||||||
|
|
||||||
|
if ($category_id) {
|
||||||
|
// Insert the book-category association into the book_categories table
|
||||||
|
$BooksModel->db->table('book_categories')->insert(['book_id' => $book_id, 'category_id' => $category_id]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return redirect()->route('book_list');
|
return redirect()->route('book_list');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -44,10 +44,13 @@ class Scheme extends BaseController
|
|||||||
} else if ($id !== '0') {
|
} else if ($id !== '0') {
|
||||||
$data['page_name'] = 'Edit Scheme';
|
$data['page_name'] = 'Edit Scheme';
|
||||||
$model = new SchemeModel();
|
$model = new SchemeModel();
|
||||||
$model->setTable('books');
|
|
||||||
$edit_user_details = $model->where(['book_id' => $id])->first();
|
|
||||||
|
|
||||||
$data['scheme'] = $edit_user_details;
|
|
||||||
|
$imageData = $model->getBooksAndImagesByBookId($id);
|
||||||
|
|
||||||
|
$data['scheme'] = $imageData[0];
|
||||||
|
|
||||||
|
// print_r($data);die();
|
||||||
}
|
}
|
||||||
|
|
||||||
$data['session_bid'] = $session_bid;
|
$data['session_bid'] = $session_bid;
|
||||||
@ -101,12 +104,35 @@ class Scheme extends BaseController
|
|||||||
'category_id' => $category->id
|
'category_id' => $category->id
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
if (!empty($_FILES['img_name']['name'])) {
|
||||||
|
// A new image has been uploaded
|
||||||
|
|
||||||
|
// First, delete the previous image file if it exists
|
||||||
|
if (!empty($imageData) && file_exists(WRITEPATH . 'public/uploads/' . $imageData[0]->img_name)) {
|
||||||
|
unlink(WRITEPATH . 'public/uploads/' . $imageData[0]->img_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
$imageData = [
|
||||||
|
'book_id' => $last_inserted_id, // Assuming $last_inserted_id contains the ID of the inserted scheme
|
||||||
|
'img_name' => $_FILES['img_name']['name'],
|
||||||
|
'is_cover' => 1, // Set this based on your requirements
|
||||||
|
'type' => $_FILES['img_name']['type']
|
||||||
|
];
|
||||||
|
|
||||||
|
// Move the uploaded image to a desired location
|
||||||
|
$imagePath = 'public/uploads/' . $_FILES['img_name']['name'];
|
||||||
|
move_uploaded_file($_FILES['img_name']['tmp_name'], $imagePath);
|
||||||
|
|
||||||
|
// Update image data in the 'book_images' table
|
||||||
|
$SchemeModel->insertImage($imageData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// It's an update operation
|
// It's an update operation
|
||||||
$isactive = $this->request->getPost('isactive');
|
$isactive = $this->request->getPost('isactive');
|
||||||
$data['isactive'] = ($isactive == 'on') ? 1 : 0;
|
$data['isactive'] = ($isactive == 'on') ? 1 : 0;
|
||||||
$data['updated_by'] = $session_uid;
|
$data['updated_by'] = $session_uid;
|
||||||
|
|
||||||
$SchemeModel->update($scheme_id, $data);
|
$SchemeModel->update($scheme_id, $data);
|
||||||
}
|
}
|
||||||
return redirect()->route('scheme_list');
|
return redirect()->route('scheme_list');
|
||||||
|
|||||||
@ -57,5 +57,39 @@ class BooksModel extends Model
|
|||||||
|
|
||||||
return $books;
|
return $books;
|
||||||
}
|
}
|
||||||
|
public function insertBooksCategory($book_id, $category_id)
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'book_id' => $book_id,
|
||||||
|
'category_id' => $category_id,
|
||||||
|
];
|
||||||
|
|
||||||
|
$db = \Config\Database::connect();
|
||||||
|
$builder = $db->table('book_categories');
|
||||||
|
$builder->insert($data);
|
||||||
|
}
|
||||||
|
public function getCategories()
|
||||||
|
{
|
||||||
|
// Use the Query Builder to retrieve categories from the 'categories' table
|
||||||
|
$categories = $this->db->table('category')->get()->getResultArray();
|
||||||
|
|
||||||
|
return $categories;
|
||||||
|
}
|
||||||
|
public function getBooksAndImagesByBookId($id)
|
||||||
|
{
|
||||||
|
$builder = $this->db->table('books');
|
||||||
|
$builder->select('books.*, book_images.img_name, book_images.is_cover, book_images.type');
|
||||||
|
$builder->join('book_images', 'book_images.book_id = books.book_id', 'left');
|
||||||
|
$builder->where('books.book_id', $id);
|
||||||
|
|
||||||
|
$query = $builder->get();
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
public function insertImage($imageData)
|
||||||
|
{
|
||||||
|
return $this->db->table('book_images')->insert($imageData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,11 +9,7 @@ class CustomerModel extends Model
|
|||||||
{
|
{
|
||||||
protected $table = 'customers';
|
protected $table = 'customers';
|
||||||
protected $primaryKey = 'customer_id ';
|
protected $primaryKey = 'customer_id ';
|
||||||
<<<<<<< HEAD
|
|
||||||
protected $allowedFields = ['customer_id ','first_name','city','last_name','email','mobile_no','country','state','postal_code' ,'address','profile_picture','date_of_birth','gender','mode','isactive','business_id'];
|
|
||||||
=======
|
|
||||||
protected $allowedFields = ['customer_id ','first_name','city','last_name','email','mobile_no','country','state','postal_code' ,'address','profile_picture','date_of_birth','gender','mode','type','isactive','business_id','created_by','updated_by'];
|
protected $allowedFields = ['customer_id ','first_name','city','last_name','email','mobile_no','country','state','postal_code' ,'address','profile_picture','date_of_birth','gender','mode','type','isactive','business_id','created_by','updated_by'];
|
||||||
>>>>>>> caaaaa0ffd2a11af5f49570cb1fadb521e89b52f
|
|
||||||
|
|
||||||
public function insertCustomer($data)
|
public function insertCustomer($data)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -42,6 +42,24 @@ class SchemeModel extends Model
|
|||||||
|
|
||||||
return $schemes;
|
return $schemes;
|
||||||
}
|
}
|
||||||
|
public function getBooksAndImagesByBookId($id)
|
||||||
|
{
|
||||||
|
$builder = $this->db->table('books');
|
||||||
|
$builder->select('books.*, book_images.img_name, book_images.is_cover, book_images.type');
|
||||||
|
$builder->join('book_images', 'book_images.book_id = books.book_id', 'left');
|
||||||
|
$builder->where('books.book_id', $id);
|
||||||
|
|
||||||
|
$query = $builder->get();
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function insertImage($imageData)
|
||||||
|
{
|
||||||
|
return $this->db->table('book_images')->insert($imageData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// public function getSchemeDuration($schemeId)
|
// public function getSchemeDuration($schemeId)
|
||||||
@ -109,6 +127,15 @@ public function getAllSchemes()
|
|||||||
{
|
{
|
||||||
return $this->findAll();
|
return $this->findAll();
|
||||||
}
|
}
|
||||||
|
public function updateImage($schemeId, $imageData)
|
||||||
|
{
|
||||||
|
$builder = $this->db->table('book_images');
|
||||||
|
$builder->set($imageData);
|
||||||
|
$builder->where('book_id', $schemeId);
|
||||||
|
$builder->update();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -29,61 +29,93 @@
|
|||||||
<?php if (session()->getFlashdata('success')) : ?>
|
<?php if (session()->getFlashdata('success')) : ?>
|
||||||
<div class="alert alert-success"><?= session()->getFlashdata('success') ?></div>
|
<div class="alert alert-success"><?= session()->getFlashdata('success') ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<form class="needs-validation" novalidate method="post" enctype="multipart/form-data" action="<?= base_url() . "insert_books"; ?>">
|
<form class="needs-validation" novalidate method="post" enctype="multipart/form-data"
|
||||||
|
action="<?= base_url() . "insert_books"; ?>">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="title" class="col-form-label">Book Name<span class="text-danger">*</span></label>
|
<label for="title" class="col-form-label">Book Name<span
|
||||||
<input type="text" class="form-control" id="title" name="title" value="<?= isset($details['title']) ? $details['title'] : '' ?>" placeholder="Title" required />
|
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 class="invalid-feedback"> Please provide. </div>
|
<div class="invalid-feedback"> Please provide. </div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="publisher" class="col-form-label">Book Publisher Name<span class="text-danger">*</span></label>
|
<label for="publisher" class="col-form-label">Book Publisher Name<span
|
||||||
<input type="text" class="form-control" id="publisher" name="publisher" placeholder="Book Publisher (Authors)" value="<?= isset($details['publisher']) ? $details['publisher'] : '' ?>" required />
|
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 class="invalid-feedback"> Please provide. </div>
|
<div class="invalid-feedback"> Please provide. </div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="price" class="col-form-label">Book Price<span class="text-danger">*</span></label>
|
<label for="price" class="col-form-label">Book Price<span
|
||||||
<input type="number" class="form-control" id="price" name="price" placeholder="Book Price" required value="<?= isset($details['price']) ? $details['price'] : '' ?>" />
|
class="text-danger">*</span></label>
|
||||||
|
<input type="number" class="form-control" id="price" name="price"
|
||||||
|
placeholder="Book Price" required
|
||||||
|
value="<?= isset($details['price']) ? $details['price'] : '' ?>" />
|
||||||
<div class="invalid-feedback"> Please provide. </div>
|
<div class="invalid-feedback"> Please provide. </div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="isbn_code" class="col-form-label">ISBN CODE<span class="text-danger">*</span></label>
|
<label for="isbn_code" class="col-form-label">ISBN CODE<span
|
||||||
<input type="text" class="form-control" id="isbn_code" name="isbn_code" value="<?= isset($details['publication_date']) ? $details['publication_date'] : '' ?>"required />
|
class="text-danger">*</span></label>
|
||||||
|
<input type="text" class="form-control" id="isbn_code" name="isbn_code"
|
||||||
|
value="<?= isset($details['publication_date']) ? $details['publication_date'] : '' ?>"
|
||||||
|
required />
|
||||||
<div class="invalid-feedback"> Please provide. </div>
|
<div class="invalid-feedback"> Please provide. </div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="page_count" class="col-form-label">Page Count<span class="text-danger"></span></label>
|
<label for="page_count" class="col-form-label">Page Count<span
|
||||||
<input type="number" class="form-control" id="page_count" name="page_count" placeholder="Page Count" value="<?= isset($details['page_count']) ? $details['page_count'] : '' ?>" />
|
class="text-danger"></span></label>
|
||||||
|
<input type="number" class="form-control" id="page_count" name="page_count"
|
||||||
|
placeholder="Page Count"
|
||||||
|
value="<?= isset($details['page_count']) ? $details['page_count'] : '' ?>" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="genre" class="col-form-label">Genre</label>
|
|
||||||
<input type="text" class="form-control" id="genre" name="genre" placeholder="Genre" rows="5"><?= isset($details['genre']) ? $details['genre'] : '' ?></textarea>
|
<label for="category_id" class="col-form-label">Category</label>
|
||||||
<!-- <input type="text" class="form-control" id="genre" name="genre" placeholder="Genre" value="<?= isset($details['genre']) ? $details['genre'] : '' ?>" /> -->
|
<select class="form-control" id="category_id" name="category_id">
|
||||||
|
<option>Select the Category of the Book</option>
|
||||||
|
<?php foreach ($categories as $category): ?>
|
||||||
|
|
||||||
|
<option value="<?= $category['id'] ?>">
|
||||||
|
<?= $category['name'] ?>
|
||||||
|
</option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="language" class="col-form-label">Language<span class="text-danger"></span></label>
|
<label for="language" class="col-form-label">Language<span
|
||||||
<input type="text" class="form-control" id="language" name="language" placeholder="Language" value="<?= isset($details['language']) ? $details['language'] : '' ?>" />
|
class="text-danger"></span></label>
|
||||||
|
<input type="text" class="form-control" id="language" name="language"
|
||||||
|
placeholder="Language"
|
||||||
|
value="<?= isset($details['language']) ? $details['language'] : '' ?>" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="publication_date" class="col-form-label">Publication Date<span class="text-danger"></span></label>
|
<label for="publication_date" class="col-form-label">Publication Date<span
|
||||||
<input type="date" class="form-control" id="publication_date" name="publication_date" placeholder="Publication Date (format : DD/MM/YYYY)" data-toggle="input-mask" data-mask-format="00/00/0000" value="<?= isset($details['publication_date']) ? $details['publication_date'] : '' ?>" />
|
class="text-danger"></span></label>
|
||||||
|
<input type="date" class="form-control" id="publication_date" name="publication_date"
|
||||||
|
placeholder="Publication Date (format : DD/MM/YYYY)" data-toggle="input-mask"
|
||||||
|
|
||||||
|
value="<?= isset($details['publication_date']) ? $details['publication_date'] : '' ?>" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -93,42 +125,46 @@
|
|||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="tax" class="col-form-label">TAX<span class="text-danger"></span></label>
|
<label for="tax" class="col-form-label">TAX<span class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="tax" name="tax" placeholder="tax" value="<?= isset($details['tax']) ? $details['tax'] : '' ?>" />
|
<input type="text" class="form-control" id="tax" name="tax" placeholder="tax"
|
||||||
|
value="<?= isset($details['tax']) ? $details['tax'] : '' ?>" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="description" class="col-form-label">Description<span class="text-danger"></span></label>
|
<label for="description" class="col-form-label">Description<span
|
||||||
<textarea class="form-control" id="description" name="description" placeholder="Description" rows="5" ><?= isset($details['description']) ? $details['description'] : '' ?></textarea>
|
class="text-danger"></span></label>
|
||||||
|
<textarea class="form-control" id="description" name="description"
|
||||||
|
placeholder="Description"
|
||||||
|
rows="5"><?= isset($details['description']) ? $details['description'] : '' ?></textarea>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="form-group col-md-4">
|
||||||
<div class="col-lg-12">
|
<label for="img_name" class="col-form-label">Picture</label>
|
||||||
<div class="card">
|
<input type="file" name="img_name" accept="image/*" />
|
||||||
<div class="card-body">
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-group col-md-4">
|
||||||
<div class="form-group col-md-6">
|
<?php if (isset($details) && !empty($details)): ?>
|
||||||
<div class="image-previews mt-4"></div>
|
<img id="imagePreview" src="<?= base_url('public/uploads/' . $details['img_name']) ?>" alt="Image Preview" style="max-width: 200px; display: block" />
|
||||||
<label for="coverpicture" class="col-form-label">Book Cover Picture<span class="text-danger"></span></label>
|
<?php else: ?>
|
||||||
<br />
|
<img id="imagePreview" src="" alt="Image Preview" style="max-width: 200px; display: none" />
|
||||||
<input type="file" id="cover_picture" name="coverpicture[]" />
|
<?php endif; ?>
|
||||||
<!-- <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>
|
</div>
|
||||||
</div>
|
<input type="hidden" id="book_id" name="book_id" placeholder="hidden for book id"
|
||||||
</div>
|
value="<?= isset($details['book_id']) ? $details['book_id'] : '' ?>" />
|
||||||
</div></div>
|
<input type="hidden" id="business_id" name="business_id" placeholder="hidden for business id"
|
||||||
<input type="hidden" id="book_id" name="book_id" placeholder="hidden for book id" value="<?= isset($details['book_id']) ? $details['book_id'] : '' ?>" />
|
value="<?= $session_bid ?>" />
|
||||||
<input type="hidden" id="business_id" name="business_id" placeholder="hidden for business id" value="<?= $session_bid ?>" />
|
|
||||||
<?php if (!empty($details)) { ?>
|
<?php if (!empty($details)) { ?>
|
||||||
<div class="form-group text-right m-b-0 checkbox checkbox-purple">
|
<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' : '' ?>>
|
<input type="checkbox" id="isactive" name="isactive" class="form-control"
|
||||||
|
<?= isset($details) && $details['isactive'] == 1 ? 'checked' : '' ?>>
|
||||||
<label for="isactive"> Is Active</label>
|
<label for="isactive"> Is Active</label>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
@ -182,5 +218,3 @@
|
|||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -62,16 +62,15 @@
|
|||||||
<th>Invoice Number</th>
|
<th>Invoice Number</th>
|
||||||
<th>Invoice Date</th>
|
<th>Invoice Date</th>
|
||||||
<th>Customer Name</th>
|
<th>Customer Name</th>
|
||||||
|
|
||||||
<!-- <th>Book Name</th>
|
<!-- <th>Book Name</th>
|
||||||
<th>Quantity</th>
|
<th>Quantity</th>
|
||||||
<th>Price</th>
|
<th>Price</th>
|
||||||
<th>Discount</th>
|
<th>Discount</th>
|
||||||
<th>Tax</th> -->
|
<th>Tax</th> -->
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Approve INV</th>
|
<th>Total</th>
|
||||||
<th>Action</th>
|
<th align="center">Action</th>
|
||||||
<th>view</th>
|
|
||||||
<th>Print</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -82,16 +81,17 @@
|
|||||||
<td><?= $row['invoice_date']; ?></td>
|
<td><?= $row['invoice_date']; ?></td>
|
||||||
<td><?= $row['customer_name']; ?></td>
|
<td><?= $row['customer_name']; ?></td>
|
||||||
<td><?= $row['status']; ?></td>
|
<td><?= $row['status']; ?></td>
|
||||||
<td style align="center"><a href="<?= "approve_invoice/" . $row['invoice_id']; ?>" class="approve-button"><i class="ri-checkbox-circle-fill"></i></a></td>
|
<td>₹ <span data-plugin="counterup"><?= $row['total_amount']; ?></span></td>
|
||||||
<td>
|
<td><a href="<?= "approve_invoice/" . $row['invoice_id']; ?>" class="approve-button" title="Approve the Invoice"><i class="ri-checkbox-circle-fill"></i></a>
|
||||||
|
|
||||||
<?php if ($row['invoice_type'] == 1): ?>
|
<?php if ($row['invoice_type'] == 1): ?>
|
||||||
<a href="<?= "new_subscription_invoice/" . $row['invoice_id']; ?>" class="edit-button"><i class="ri-pencil-line"></i></a>
|
<a href="<?= "new_subscription_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>
|
||||||
<?php elseif ($row['invoice_type'] == 2): ?>
|
<?php elseif ($row['invoice_type'] == 2): ?>
|
||||||
<a href="<?= "new_book_invoice/" . $row['invoice_id']; ?>" class="edit-button"><i class="ri-pencil-line"></i></a>
|
<a href="<?= "new_book_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</td>
|
|
||||||
<td><a href="<?= base_url("generate_invoice_pdf/{$row['invoice_id']}") ?>" class="download-pdf-button"><i class="ri-file-download-line"></i></a></td>
|
<a href="<?= base_url("generate_invoice_pdf/{$row['invoice_id']}") ?>" class="download-pdf-button" title="Download the Invoice"><i class="ri-file-download-line"></i></a>
|
||||||
<td><a href="<?= base_url("print_address/{$row['invoice_id']}") ?>" class="print-address-button"><i class="ri-printer-line"></i></a></td>
|
<a href="<?= base_url("print_address/{$row['invoice_id']}") ?>" class="print-address-button" title="Print Address"><i class="ri-printer-line"></i></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="sduration" class="col-form-label">Duration<span class="text-danger">*</span></label>
|
<label for="sduration" class="col-form-label">Duration<span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" name="sduration" value="<?= isset($scheme['duration']) ? $scheme['duration'] : '' ?>" placeholder="Duration In Months" required />
|
<input type="text" class="form-control" name="sduration" value="<?= isset($scheme['duration']) ? $scheme['duration'] : '' ?>" placeholder="Duration In Months(ex 1)" required />
|
||||||
<div class="invalid-feedback"> Please provide. </div>
|
<div class="invalid-feedback"> Please provide. </div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
@ -32,12 +32,29 @@
|
|||||||
<div class="invalid-feedback"> Please provide. </div>
|
<div class="invalid-feedback"> Please provide. </div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="sdescription" class="col-form-label">Description<span class="text-danger"></span></label>
|
<label for="sdescription" class="col-form-label">Description<span class="text-danger"></span></label>
|
||||||
<textarea class="form-control" name="sdescription" placeholder="Description" ><?= isset($scheme['description']) ? $scheme['description'] : '' ?></textarea>
|
<textarea class="form-control" name="sdescription" placeholder="Description" ><?= isset($scheme['description']) ? $scheme['description'] : '' ?></textarea>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group col-md-4">
|
||||||
|
<label for="img_name" class="col-form-label">Scheme Picture</label>
|
||||||
|
<input type="file" name="img_name" accept="image/*" />
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group col-md-4">
|
||||||
|
<?php if (isset($scheme) && !empty($scheme)): ?>
|
||||||
|
<img id="imagePreview" src="<?= base_url('public/uploads/' . $scheme['img_name']) ?>" alt="Image Preview" style="max-width: 200px; display: block" />
|
||||||
|
<?php else: ?>
|
||||||
|
<img id="imagePreview" src="" alt="Image Preview" style="max-width: 200px; display: none" />
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<input type="hidden" id="book_id" name="book_id" placeholder="hidden for scheme id" value="<?= isset($scheme['book_id']) ? $scheme['book_id'] : '' ?>" />
|
<input type="hidden" id="book_id" name="book_id" placeholder="hidden for scheme id" value="<?= isset($scheme['book_id']) ? $scheme['book_id'] : '' ?>" />
|
||||||
<input type="hidden" id="business_id" name="business_id" placeholder="hidden for business id" value="<?= $session_bid ?>" />
|
<input type="hidden" id="business_id" name="business_id" placeholder="hidden for business id" value="<?= $session_bid ?>" />
|
||||||
<?php if (!empty($scheme)) { ?>
|
<?php if (!empty($scheme)) { ?>
|
||||||
@ -65,4 +82,5 @@
|
|||||||
</div> <!-- end col-->
|
</div> <!-- end col-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- end row -->
|
<!-- end row -->
|
||||||
Loading…
Reference in New Issue
Block a user