public function edit($id) { $placement = Ad_Web::find($id); $ads = Ad::orderby('nombre')->lists('nombre', 'id'); $webs = Web::orderBy('url')->lists('url', 'id'); return view('admin.publisher.edit', compact('placement', 'ads', 'webs')); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { die; $paises = Pais::all(); $provincias = Provincia::all(); $departamentos = Departamento::all(); $localidades = Localidad::all(); $calles = Calle::all(); $domicilios = Domicilio::all(); $telefonos = Telefono::all(); $emails = Email::all(); $webs = Web::all(); }
public function ReportsDate(Request $request) { if ($request->ajax()) { $date = date('Y-m-d', strtotime($request->input('date'))); $todate = date('Y-m-d', strtotime($request->input('todate'))); $idad = $request->input('ad'); $idweb = $request->input('web'); if ($idad == 0) { if ($idweb == 'all') { if ($request->ajax()) { $reports = Report::TimeReport($date, $todate); return response()->json(["web" => $reports]); } } else { if ($request->ajax()) { if ($idad == 'all') { if ($request->ajax()) { $reports = Report::TimeReport($date, $todate); return response()->json(["web" => $reports]); } } else { $ad = Web::find($idweb); $reports = Report::ReportTime($date, $todate, $ad->id); return response()->json(["web" => $reports]); } } } } else { if ($idad == 'all' || $idweb == 'all') { if ($request->ajax()) { $reports = Report::TimeReport($date, $todate); return response()->json(["web" => $reports]); } } else { if ($request->ajax()) { $ad = Ad::find($idad); $web = Web::find($idweb); $reports = Report::TimeReportComplete($date, $todate, $ad->id, $web->id); return response()->json(["web" => $reports]); } } } } }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $web = Web::find($id); $delete = $web->delete(); if ($delete) { notify()->flash('Web delte correctly', 'success', ['timer' => 3000, 'text' => '']); } else { notify()->flash('There was a problem creating the advert', 'error', ['timer' => 3000, 'text' => '']); } return redirect()->to('admin/web'); }
public function updWebs($persona_id, $request) { if ($request->get('url') != '') { // Al permitir varios emails, esto tiene que cambiar $webpage = Web::firstOrNew(['persona_id' => $persona_id]); $webpage->fill($request->all()); $webpage->persona_id = $persona_id; $webpage->save(); } else { $webpage = Web::where('persona_id', $persona_id)->first(); if (!is_null($webpage)) { $webpage->delete(); } } }