Пример #1
0
 public function getIndex()
 {
     $dataConfiguration = Configuration::first();
     if (!isset($dataConfiguration)) {
         $dataConfiguration = new Configuration();
     }
     return viewc('admin.' . self::NAMEC . '.index', compact('dataConfiguration'));
 }
Пример #2
0
 public function getForm($id = null)
 {
     $admin = new Customer();
     if (!empty($id)) {
         $admin = Customer::find($id);
     }
     return viewc('client.' . self::NAMEC . '.form', compact('admin', 'id'));
 }
Пример #3
0
 public function getForm($id = null)
 {
     $msgform = !empty($id) ? 'Contraseña(dejar en blanco si no ha de cambiar' : 'Contraseña';
     $dataAdmin = User::find($id);
     if (!isset($dataAdmin)) {
         $dataAdmin = new User();
     }
     return viewc('admin.' . self::NAMEC . '.form', compact('dataAdmin', 'msgform'));
 }
Пример #4
0
 public function getForm($id = null)
 {
     $table = new Campania();
     if (!empty($id)) {
         $table = Campania::find($id);
         $table->imagen = !empty($table->imagen) ? "{$table->imagen}" : null;
     }
     return viewc('client.' . self::NAMEC . '.form', compact('table'));
 }
Пример #5
0
 public function getForm($id = null)
 {
     $dataCategory = Categories::find($id);
     if (!isset($dataCategory)) {
         $dataCategory = new Categories();
     } else {
         $dataCategory->picture = !empty($dataCategory->picture) ? "{$dataCategory->picture}" : null;
     }
     return viewc('admin.' . self::NAMEC . '.form', compact('dataCategory'));
 }
Пример #6
0
 public function getIndex()
 {
     if (Auth::customer()->check()) {
         $id = Auth::customer()->user()->id;
         $table = new Customer();
         if (!empty($id)) {
             $table = Customer::find($id);
         }
         return viewc('client.' . self::NAMEC . '.index', compact('table'));
     }
     return redirect('login')->with('messageError', 'Inicie sesion');
 }
Пример #7
0
 public function getForm($id)
 {
     if (isset($id) && $id != '') {
         $msgform = !empty($id) ? 'Contraseña(dejar en blanco si no ha de cambiar' : 'Contraseña';
         $dataUser = User::find($id);
         if (!isset($dataUser)) {
             $dataUser = new User();
         }
     } else {
         return viewc('admin.' . self::NAMEC . '.index');
     }
     return viewc('admin.' . self::NAMEC . '.form', compact('dataUser', 'msgform'));
 }
Пример #8
0
 public function getForm($id = null)
 {
     $dataAdmin = new PrProviders();
     $modelProviders = new PrTypes();
     $modelCategories = new Categories();
     $listProviders = $modelProviders->where('flagactive', PrTypes::STATE_ACTIVE)->lists('name_type', 'id')->toArray();
     $listProviders = [null => 'Select un tipo'] + $listProviders;
     $listCategories = $modelCategories->where('flagactive', Categories::STATE_ACTIVE)->lists('name_category', 'id')->toArray();
     $listCategories = [null => 'Select una categoria'] + $listCategories;
     if (!is_null($id)) {
         $dataAdmin = PrProviders::find($id);
     }
     return viewc('admin.' . self::NAMEC . '.form', compact('dataAdmin', 'listProviders'), ['listCategories' => $listCategories, 'listCategories' => $listCategories]);
 }
Пример #9
0
 public function loginUser(Request $request)
 {
     $data = $request->all();
     $validator = Validator::make($data, ['mac' => 'required|min:17|max:17', 'uamport' => 'required', 'uamip' => 'required', 'userurl' => 'required', 'res' => 'required']);
     //var_dump($data);
     if ($validator->fails()) {
         $error = (array) json_decode($validator->errors());
         dd($error);
     }
     $url = $data['userurl'];
     if ($data['res'] == "success") {
         header("Location: " . $url);
         exit;
     }
     $dateHostPots = Hostpots::whereName($data['uamport'])->get();
     if (!empty($dateHostPots->toArray())) {
         $uamip = explode(':', $data['uamip']);
         $obj = Hostpots::find($dateHostPots[0]->id);
         $obj->update(array('owner' => $uamip[0]));
         $ip = $uamip[0];
         $table = HotspotsCampania::whereHotspotsId($dateHostPots[0]->id)->whereDayId(date("N"))->get();
         if ($table->toArray()) {
             $idCampania = $table->toArray()[0]['campania_id'];
         } else {
             $datos = GroupsCampania::whereGroupsId($dateHostPots[0]->geocode)->whereDayId(date("N"))->get();
             $idCampania = $datos[0]->campania_id;
         }
         $datosCampania = \App\Models\Campania::whereId($idCampania)->get();
         $imagen = $datosCampania[0]->imagen;
         $extension = explode('.', $imagen);
         $value = $extension[1] == 'jpg' || $extension[1] == 'png' || $extension[1] == 'jpeg' || $extension[1] == 'gif' ? 'img' : 'video';
     } else {
         $msg = array('msg' => 'no existe equipo asociado');
         dd($msg);
     }
     $User = $this->getUser($data['mac']);
     // Usergroup
     $this->getUsergroup($data['mac'], $data['uamport']);
     //$href = 'http://' . $ip . '?login?user='******'username'] . '&password='******'value'] . '&dst=' . $datosCampania[0]->url;
     $href = 'http://' . $ip . '/login?user='******'username'] . '&password='******'value'] . '&dst=' . $datosCampania[0]->url;
     return viewc('home.login-user.login', compact('ip', 'href', 'imagen', 'value'));
 }
Пример #10
0
 public function getInsert($id = null)
 {
     $table = new Customer();
     if (!empty($id)) {
         $table = Customer::find($id);
     }
     return viewc('client.' . self::NAMEC . '.insert', compact('table', 'id'));
 }
Пример #11
0
 /**
  * Show the application welcome screen to the user.
  *
  * @return Response
  */
 public function index()
 {
     return viewc('client.welcome.index');
 }
Пример #12
0
 public function getIndex()
 {
     $id = Auth::customer()->user()->id;
     $admin = Customer::find($id);
     return viewc('client.' . self::NAMEC . '.index', array('admin' => $admin, 'messageSuccess' => null));
 }
Пример #13
0
 public function getComments($idPost)
 {
     $dataPost = PuAds::find($idPost);
     return viewc('admin.' . self::NAMEC . '.comments', compact('dataPost'));
 }
Пример #14
0
 public function getDetalleCampania($equipment_id = null)
 {
     return viewc('client.' . self::NAMEC . '.detalle-campania', ['equipment_id' => $equipment_id]);
 }
Пример #15
0
 public function loginUser()
 {
     echo 'dd';
     exit;
     return viewc('home.login.index');
 }