53 lines
1.7 KiB
PHP
53 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
use Illuminate\Http\Request;
|
|
use App\Http\Requests\LambdaRequest;
|
|
use DB;
|
|
|
|
use League\Csv\Reader;
|
|
use Auth;
|
|
|
|
class RcpaproductController extends Controller
|
|
{
|
|
public function __construct()
|
|
{
|
|
$this->middleware('auth');
|
|
$this->_service = 'rcpa';
|
|
$this->_module = 'product';
|
|
$this->_viewname = 'rcpaproduct';
|
|
$this->_title = 'RCPA Product';
|
|
$this->_base_url = '/rcpaproduct';
|
|
}
|
|
|
|
protected function get_list_fields(){
|
|
return [
|
|
'actions' => ['title' => 'Actions', 'buttons' => [ 'edit', 'delete', 'skus' => ['icon' => 'progress-question', 'querystring' => 'id={ID}'] ] ],
|
|
'title' => ['title' => 'Title', 'type' => 'text'],
|
|
'status' => ['title' => 'Status', 'type' => 'select'],
|
|
|
|
];
|
|
}
|
|
|
|
protected function get_form_fields($type, $values){
|
|
|
|
return [
|
|
'title' => ['title' => 'Title', 'type' => 'text', 'required' => true],
|
|
'status' => ['title' => 'Status', 'type' => 'select', 'required' => true, 'values' => ['active' => 'Active', 'disabled' => 'Disabled'] ],
|
|
|
|
'description' => ['title' => 'Description', 'type' => 'textarea', 'required' => true, 'fullwidth' => true],
|
|
'sort_order' => ['title' => 'Sort Order', 'type' => 'number', 'required' => true],
|
|
];
|
|
}
|
|
|
|
public function skus(Request $request) {
|
|
$entity_id = $request->input('id', 0);
|
|
if($entity_id === 0) {
|
|
return redirect('/rcpaproducts')->withError('Product not found!');
|
|
} else {
|
|
$request->session()->put('product_id', $entity_id);
|
|
return redirect('/rcpaskus');
|
|
}
|
|
}
|
|
}
|