public function new_book() { $input = \Request::all(); $img_file = \Request::file('upload_img'); $img_save_path = real_imgs_dir . "projects/pdf_book_imgs"; $pdf_file = \Request::file('upload_file'); $pdf_save_path = public_path() . "/pdf/books"; $pdf_name = $this->upload_file($pdf_file, $pdf_save_path); $img_name = $this->upload_file($img_file, $img_save_path); // $this->upload_file($img_file,real_imgs_dir."../pdf/books/imgs"); $create_data = ['name_in_server' => $pdf_name, 'img' => $img_name, 'email' => $input['email'], 'book_name' => $input['book_name'], 'cate' => $input['cate']]; $out = \book_model::create($create_data); return redirect()->back()->with('s-msg', 'Success! New Book Has been Added.'); }
</span><br> <span style="color:gray;"><span style="color:blue;font-weight:bold;">Edition:</span> <?php echo $value['edition']; ?> </span> </div> <div class="col-md-3" > <span style="color:gray;"><span style="color:orange;"><b>Available copies: </b></span> <?php echo book_model::countbookavailable($value['bid']) - book_model::countbookborrow($value['bid']); ?> </span><br> <span style="color:gray;"> <span style="color:orange;"><b>Lost copies: </b></span> <?php echo $value['available']; ?> </span><br> <span style="color:gray;"><span style="color:orange;"><b>Borrowed copies: </b> </span><?php echo $value['available']; ?> </span>