Ejemplo n.º 1
0
        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']);
    }
    return $measurements;
});
Route::get('/uploadMeasureManSelect', function () {
    return MeasureMan::all();
});
Ejemplo n.º 2
0
 /**
  * Save the measurements to our db
  * and create an array of measurements to sent to the radical API
  *
  * @param $observation_id
  * @return array
  */
 private function getMeasurements($observation_id)
 {
     $type = 'test';
     $value = 'test';
     $unit = 'test';
     if ($this->mission != null) {
         $type = $this->mission->type->name;
     }
     $radicalMeasurements = [];
     foreach (\Request::get('measurements') as $measurement) {
         $meas = new Measurement(['type' => $type, 'value' => $value, 'unit' => $unit, 'latitude' => $measurement['latitude'], 'longitude' => $measurement['longitude'], 'observation_id' => $observation_id, 'observation_date' => $measurement['observation_date']]);
         $meas->save();
         array_push($radicalMeasurements, ['Latitude' => $meas->latitude, 'Longitude' => $meas->longitude, 'Type' => $meas->type, 'Value' => $meas->value, 'Unit' => $meas->unit, 'Observation_Date' => $meas->observation_date]);
     }
     return $radicalMeasurements;
 }