/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $snippet = Snippet::where('id', $id)->orWhere('slug', $id)->firstOrFail(); //fetch all data associated with the snippet $data = Data::where('snippetId', $snippet->id)->accepted()->get(); return view('snippets.show', compact('snippet', 'data')); }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { $course = Course::where('id', $id)->orWhere('slug', $id)->firstOrFail(); $data = Data::where('courseId', $course->id)->where('extension', '!=', 'mp4')->accepted()->get(); $videos = Data::where('courseId', $course->id)->Where('extension', 'mp4')->accepted()->get(); $comments = Comment::where('courseId', $course->id)->get(); return view('courses.show', compact('course', 'comments', 'data', 'videos')); }
public function getRecords($fechaini, $fechafin, $fechap) { $referencia = Data::where($fechap, '>=', $fechaini)->where($fechap, '<=', $fechafin)->get()->take(2); if (count($referencia) == 0) { return false; } else { return $referencia; } }
/** * * @return Response */ public function run() { $fechaini = Input::get('fechaini'); $fechafin = Input::get('fechafin'); $origen = Input::get('entrada'); //=========================================================== $data = new Data(); //Entrada : SeceNet o Datastage $valorOrigen = $data->getDataOrigen($origen); $data = new Data(); //Pedimentos a revisar $referencias = $data->getRecords($fechaini, $fechafin, $valorOrigen['fecha']); if ($referencias != false) { foreach ($referencias as $referen) { $this->checkPedimento($referen, $valorOrigen); } return redirect()->route('results'); } else { return redirect()->back()->with('error', 'No se encontraron referencias.'); } }
public function index() { $numberOfPageViews = $this->numberOfPageVisits(); //dd($numberOfPageViews); $numberOfViewsPerCourse = $this->numberOfViewsPerCourse(); //dd($numberOfViewsPerCourse); $numberOfViewsPerSnippet = $this->numberOfViewsPerSnippet(); //Data for menu $dataForAcceptance = Data::notAccepted()->get(); $countNotAcceptedFiles = count($dataForAcceptance); return view('admin.statistics.index', compact('numberOfPageViews', 'numberOfViewsPerCourse', 'numberOfViewsPerSnippet', 'countNotAcceptedFiles')); }
public function sendMail($id) { $file = Data::findOrFail($id); $pathToFile = $file->path; Mail::raw(Input::get('body'), function ($message) use($pathToFile, $file) { $message->to(Input::get('email')); $message->subject(Input::get('subject')); $message->attach($pathToFile, ['as' => $file->name, 'mime' => 'application/pdf']); }); if ($file->courseId != null) { $course = Course::findOrFail($file->courseId); return Redirect::action('CoursesController@showParam', [$course->slug]); } if ($file->snippetId != null) { $snippet = Snippet::findOrFail($file->snippetId); return Redirect::action('CoursesController@show', [$snippet->slug]); } }
<?php use App\Data; return array("page" => ["title" => "Pages", "requiredParams" => ["subtitle" => Data::createField("text", "Subtitel", "Hier de subtitel"), "excerpt" => Data::createField("textarea", "Samenvatting", "Een korte omschrijving")]], "dienst" => ["title" => "Diensten", "requiredParams" => ["subtitle" => Data::createField("text", "Subtitel", "Hier de subtitel")]], "jobs" => ["title" => "Vacatures", "requiredParams" => ["subtitle" => Data::createField("text", "Subtitel", "Hier de subtitel")]]);
/** * ajax 删除数据 * * @param $id */ function postDel(Request $request) { Data::find($request->input('id'))->delete(); }
public function getData() { // $model = new Data(); // $data = $model->getTagsData(); // //$string_data = ''; // // foreach ($data as $item) { // // $string_data .= $item['tags'] . ','; // // } // //$array_key = explode(',', $string_data); // echo '<pre>'; // print_r($data); $model = new Data(); $data = $model->updateArtiles(); }
public function fetchAll() { return Data::all(); }
public function fileAcceptance() { $dataForAcceptance = Data::notAccepted()->get(); $countNotAcceptedFiles = count($dataForAcceptance); return view('admin.management.fileAcceptance', compact('dataForAcceptance', 'countNotAcceptedFiles')); }
function getNew($catelog) { $model = new Data(); $data = $model->getNewFirst($catelog); // echo '<pre>'; // print_r($data); // die(); return $data; }
public function acceptData($id) { $data = Data::findOrFail($id); $data->is_accepted = true; $data->save(); return Redirect::action('AdminController@fileAcceptance'); }
public function postUpdate(Request $request) { try { $id = $request->input('id'); $accountInfo = Data::find($id); if ($accountInfo) { if ($request->input('username') != "") { $accountInfo->username = $request->input('username'); } if ($request->input('password') != "") { $accountInfo->password = $request->input('password'); } $accountInfo->save(); return ['message' => 'Success!!', 'data' => $accountInfo, 'code' => '200']; } return ['message' => 'Invalid Request!!', 'data' => '', 'code' => '401']; } catch (\Exception $e) { return ['message' => 'Invalid Request!!', 'data' => $e->getMessage(), 'code' => '401']; } }
<?php use App\Data; return array("page" => ["title" => "Pages", "requiredParams" => ["subtitle" => Data::createField("text", "Subtitel", "Hier de subtitel"), "excerpt" => Data::createField("textarea", "Samenvatting", "Een korte omschrijving")]], "feature" => ["title" => "Features", "requiredParams" => ["excerpt" => Data::createField("textarea", "Samenvatting", "Een korte omschrijving"), "image" => Data::createField("text", "Afbeelding url", "Een afbeelding van google")]]);