Пример #1
0
 public function measurement()
 {
     //echo "<pre>".print_r(MeasureMan::all(),1)."</pre>";
     $this->data['bids'] = Bid::getAllBids();
     foreach ($this->data['bids'] as $key => $value) {
         $this->data['bids'][$key]['source'] = $value->sourcesList['name'];
         $this->data['bids'][$key]['fio'] = $value->client['fio'];
     }
     $this->data['services'] = ServicesList::getServicesList();
     $this->data['sources'] = SourcesList::getSourcesList();
     $this->data['rejections'] = Rejection::getRejections();
     $this->data['scriptSales'] = ScriptSale::getScriptSales();
     return view('measurement', $this->data);
     //получим список замерщиков и вызовем метод index
 }
Пример #2
0
use App\Models\MeasureMan;
Route::get('/', array('uses' => 'IndexController@index'));
Route::get('/measurement', array('uses' => 'IndexController@measurement'));
Route::filter('csrf', function () {
    if (Request::ajax()) {
        if (Session::token() !== Request::header('csrftoken')) {
            // Change this to return something your JavaScript can read...
            throw new Illuminate\Session\TokenMismatchException();
        }
    } elseif (Session::token() !== Input::get('_token')) {
        throw new Illuminate\Session\TokenMismatchException();
    }
});
Route::get('/select-service', function () {
    $option = Input::get('option');
    return ServicesList::find($option)->promotionlist;
});
Route::get('/createBid', array('uses' => 'BidController@createBid'));
Route::get('/createService', array('uses' => 'AdminController@createService'));
Route::get('/createPromo', array('uses' => 'AdminController@createPromo'));
Route::get('/createSource', array('uses' => 'AdminController@createSource'));
Route::get('/uploadScriptSale', array('uses' => 'AdminController@uploadScriptSale'));
Route::get('/changeScriptSale', array('uses' => 'AdminController@changeScriptSale'));
Route::get('/createRejection', array('uses' => 'AdminController@createRejection'));
Route::get('/uploadMeasureMents', function () {
    //выбрать все заявки от сегодняшнего дня и + 7 дней
    $measurements = Measurement::where('date', '>=', date(" Y-j-n"))->get(array('date', 'time', 'measure_men_id'));
    foreach ($measurements as $key => $value) {
        $measurements[$key]['measure_man'] = MeasureMan::find(array('measure_men_id' => $value['measure_men_id']))->pluck('fio')->get(0);
        unset($measurements[$key]['measure_men_id']);
    }
Пример #3
0
 public function createService(Request $request)
 {
     $service = new ServicesList();
     $service->name = $request['serviceName'];
     $service->save();
 }