/**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $golongan = Golongan::find($id);
     if ($golongan->update(Input::All())) {
         return Response::json(array('success' => TRUE));
     }
 }
 public function directConsume()
 {
     if (!$this->validation->passes(ConsumeValidator::$directConsumeRule)) {
         throw new PayException(ErrCode::ERR_PARAM);
     }
     return ConsumeBiz::getInstance()->directConsume(\Input::All());
 }
Example #3
0
 protected function populateForm($model = false)
 {
     //dd($model);
     if ($model) {
         $address = $model->address;
         $venues = $model->venues;
         $companies = $model->companies;
         Former::populate($model);
         Former::populate($model, $model->address);
     } else {
         $address = [];
         $input = Input::All();
         Former::populate($input);
         Former::populateField('address.email', $input['address']['email']);
         Former::populateField('address.phone', $input['address']['phone']);
         Former::populateField('address.country.name', $input['country']);
         Former::populateField('address.address', $input['address']['address']);
         Former::populateField('address.postal_code', $input['address']['postal_code']);
         Former::populateField('address.city', $input['address']['city']);
         Former::populateField('address.state_province', $input['address']['state_province']);
         Former::populateField('address.fax', $input['address']['fax']);
         Former::populateField('address.website', $input['address']['website']);
         //Former::populate( $input, $input );
     }
 }
Example #4
0
 /**
  * Remove the specified company from storage.
  *
  * @param $company
  * @return Response
  */
 public function postDelete($model)
 {
     // Declare the rules for the form validation
     $rules = array('id' => 'required|integer');
     // Validate the inputs
     $validator = Validator::make(Input::All(), $rules);
     // Check if the form validates with success
     if ($validator->passes()) {
         $id = $model->id;
         $model->delete();
         $file_path = public_path() . '/uploads/' . $model->filename;
         $file_ok = true;
         if (File::exists($file_path)) {
             $file_ok = false;
             File::delete($file_path);
             if (!File::exists($file_path)) {
                 $file_ok = true;
             }
         }
         // Was the blog post deleted?
         $Model = $this->modelName;
         $model = $Model::find($id);
         if (empty($model) && $file_ok) {
             // Redirect to the blog posts management page
             return Response::json(['success' => 'success', 'reload' => true]);
         }
     }
     // There was a problem deleting the blog post
     return Response::json(['error' => 'error', 'reload' => false]);
 }
Example #5
0
 public function refundStore()
 {
     $input = Input::all();
     $v = Validator::make(Input::All(), array('houseID' => 'required', 'tenant' => 'required', 'type' => 'required', 'rentD' => 'required', 'waterD' => 'required', 'electricityD' => 'required', 'grepairs' => 'required', 'Obills' => 'required', 'Tcost' => 'required', 'Sfees' => 'required', 'duedate' => 'required'));
     if ($v->passes()) {
         $balance = Input::get('rentD') + Input::get('waterD') + Input::get('grepairs') + Input::get('Obills') + Input::get('Tcost') + Input::get('Sfees') + Input::get('electricityD');
         $invoice = new Invoice();
         $invoice->type = Input::get('type');
         $invoice->houseID = Input::get('houseID');
         $invoice->recipient = Input::get('tenant');
         $invoice->balance = $balance;
         $invoice->duedate = Input::get('duedate');
         $invoice->save();
         $invoicedetail = new Invoicedetail();
         $invoicedetail->rentD = Input::get('rentD');
         $invoicedetail->waterD = Input::get('waterD');
         $invoicedetail->g_repairs = Input::get('grepairs');
         $invoicedetail->o_bills = Input::get('Obills');
         $invoicedetail->transport_cost = Input::get('Tcost');
         $invoicedetail->storage_fees = Input::get('Sfees');
         $invoicedetail->electricityD = Input::get('electricityD');
         $invoice->invoicedetail()->save($invoicedetail);
         return Redirect::intended('admin/invoice');
     }
     return Redirect::back()->withInput()->withErrors($v)->with('message', 'There were validation errors');
 }
 public function NuevaTarea()
 {
     $enviado = Input::get('enviado');
     if (isset($enviado)) {
         $rules = $this->getRulesNuevaTarea();
         $messages = $this->getMensajesNuevaTarea();
         $validator = Validator::make(Input::All(), $rules, $messages);
         if ($validator->passes()) {
             $insert = $this->InsertarTarea(Input::all());
             if ($insert === 1) {
                 $mensaje = 'Tarea Creada con Éxito';
                 $visible = false;
             } else {
             }
             return Redirect::route('listatareas')->withInput(Input::flash());
         } else {
             Session::flash('visibleNuevo', TRUE);
             return Redirect::route('listatareas')->withInput(Input::flash())->withErrors($validator);
         }
     } else {
         Session::flash('mensajeError', $mensajeError);
         Session::flash('visibleNuevo', TRUE);
         return Redirect::route('listatareas');
     }
 }
Example #7
0
 public function recommendationsUpload()
 {
     $recommendation = new Recommendation();
     $active_principle = new ActivePrinciple();
     $columns = $recommendation->columns();
     $foreign_key = array_pop($columns);
     // retrieve FK column
     $input = Input::All();
     $header = array_shift($input);
     // retrieve header row
     if (!$this->checkHeader($header, $columns)) {
         return Response::json(array("success" => false, "info" => "Cabeceras del Excel no coincide con la base de datos.\n                    No se procederá a modificar la base de datos."));
     }
     DB::table($recommendation->getTableName())->delete();
     try {
         $errors = "";
         foreach ($input as $row) {
             $row = $this->readRow($row, $header);
             $recommendation = new Recommendation($row);
             $active_principle_found = DB::table($active_principle->getTableName())->select("id", "principio_activo")->where("principio_activo", "=", $recommendation->principio_activo)->first();
             if ($active_principle_found != NULL) {
                 $recommendation->active_principle_id = $active_principle_found->id;
                 $recommendation->save();
             } else {
                 $errors .= "\nRecomendación para un principio activo: " . $active_principle->principio_activo . " inexistente";
             }
         }
     } catch (Exception $ex) {
         return Response::json(array("success" => false, "info" => "Ha habido algún problema cargando el Excel en la base de datos." . "\n" . $ex->getMessage()));
     }
     return Response::json(array("success" => true, "info" => "Se ha cargado el excel en la base de datos correctamente.", "errors" => $errors));
 }
Example #8
0
 public function postModificar()
 {
     $input = Input::All();
     $validacion = Validator::make(Input::All(), array('razon_social' => 'required', 'nombre_fantasia' => 'required', 'domicilio' => 'required'));
     if (!$validacion->fails()) {
         $agente = Agente::find($input['id']);
         if ($agente != null) {
             $agente->estado_logico = $input['estado'];
             $agente->razon_social = $input['razon_social'];
             $agente->nombre_fantasia = $input['nombre_fantasia'];
             $agente->domicilio = $input['domicilio'];
             $agente->id_localidad = $input['localidad'];
             $agente->save();
             $usuario = $agente->usuario();
             $usuario->email = $input['email'];
             if ($input['password'] != '' && $input['password'] == $input['repassword']) {
                 $usuario->password = $input['password'];
             }
             $usuario->save();
             return Redirect::to('panel_administrador/abm_agente');
         } else {
             return Redirect::action('AbmAgenteController@getIndex');
         }
     } else {
         return Redirect::back()->withErrors($validacion);
     }
 }
 public function save($title)
 {
     if ($title == "siteSettings") {
         $settingsData = Input::All();
         while (list($key, $value) = each($settingsData)) {
             $settings = settings::where('fieldName', $key)->first();
             if ($key == "activatedModules") {
                 $settings->fieldValue = json_encode($value);
             } elseif ($key == "officialVacationDay") {
                 $settings->fieldValue = json_encode($value);
             } elseif ($key == "daysWeekOff") {
                 $settings->fieldValue = json_encode($value);
             } elseif ($key == "smsProvider") {
                 $settings->fieldValue = json_encode($value);
             } elseif ($key == "mailProvider") {
                 $settings->fieldValue = json_encode($value);
             } else {
                 $settings->fieldValue = $value;
             }
             $settings->save();
         }
         return $this->panelInit->apiOutput(true, $this->panelInit->language['editSettings'], $this->panelInit->language['settSaved']);
     }
     if ($title == "terms") {
         $settings = settings::where('fieldName', 'schoolTerms')->first();
         $settings->fieldValue = htmlspecialchars(Input::get('fieldValue'), ENT_QUOTES);
         $settings->save();
         return $this->panelInit->apiOutput(true, $this->panelInit->language['editSettings'], $this->panelInit->language['settSaved']);
     }
 }
Example #10
0
 public function postConsulta()
 {
     $input = Input::All();
     $incidencias = Incidencia::Where('id_estado', '=', 3)->Where('codigo', 'like', $input['nro_incidencia'] . '%')->WhereHas('agente', function ($agente) use($input) {
         $agente->where('nombre_fantasia', 'like', $input['nombre_fantasia'] . '%');
     })->get();
     return $this->layout->content = View::make('operador.Incidencia_consulta', compact('incidencias'));
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     //
     $jabatan = Jabatan::find($id);
     if ($jabatan->update(Input::All())) {
         return Response::json(array('success' => TRUE));
     }
 }
Example #12
0
 public function postBoxagente()
 {
     $input = Input::All();
     $idAgente = $input['idAgente'];
     $agente = Agente::find($idAgente);
     $agente->localidad->provincia;
     return $agente->toJson();
 }
 public function checkSign()
 {
     $fields = \Input::All();
     if (!\Input::has('sign') || true !== SignUtil::checkSign($fields)) {
         $this->ret['err_code'] = ErrCode::ERR_SIGN_ERROR;
         return $this->render();
     }
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     //
     $ppk = Ppk::find($id);
     if ($ppk->update(Input::All())) {
         return Response::json(array('success' => TRUE));
     }
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     //
     $satuankerja = SatuanKerja::find($id);
     if ($satuankerja->update(Input::All())) {
         return Response::json(array('success' => TRUE));
     }
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     //
     $unitkerja = Eselon::find($id);
     if ($unitkerja->update(Input::All())) {
         return Response::json(array('success' => TRUE));
     }
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     //
     $data = Input::All();
     $keluarga = Keluarga::find($id);
     if ($keluarga->update($data)) {
         return Response::json(array('success' => TRUE));
     }
 }
Example #18
0
 public function populateForm($model = false)
 {
     if ($model) {
         Former::populate($model);
     } else {
         $input = Input::All();
         Former::populate($input);
     }
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     //
     $data = Input::All();
     $riwayat = RiwayatJabatan::find($id);
     if ($riwayat->update($data)) {
         return Response::json(array('success' => TRUE));
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     //
     $data = Input::All();
     $riwayat = Seminar::find($id);
     if ($riwayat->delete()) {
         return Response::json(array('success' => TRUE));
     }
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $validator = Validator::make(Input::All());
     if ($validator->fails()) {
         //dd('validator failed');
         return Redirect::back()->withInput()->withErrors($validator);
     }
     //dd(Input::all());
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     //
     $data = Input::All();
     $pendidikan = Pendidikan::find($id);
     if ($pendidikan->update($data)) {
         return Response::json(array('success' => TRUE));
     }
 }
 public function DeleteCat()
 {
     $cat_obj = new Category();
     $id = Input::All();
     if ($cat_obj->DeleteCategory($id)) {
         return Redirect::to('admin/listcat')->with('bao_thanh_cong', 'Xóa Thành Công');
     } else {
         return Redirect::back()->with('bao_loi', 'Xóa Thất Bại');
     }
 }
Example #24
0
 public function postAgentes()
 {
     $input = Input::All();
     //Ver de validar los privilegios
     $agentes = Agente::Where('codigo', 'like', $input['codigo'] . '%')->Where('nombre_fantasia', 'like', $input['nombre_fantasia'] . '%')->Where('razon_social', 'like', $input['razon_social'] . '%')->WhereHas('localidad', function ($localidad) use($input) {
         $localidad->Where('id_provincia', '=', $input['provincia']);
     })->get();
     $provincias = Provincia::All()->Lists('descripcion', 'id');
     return $this->layout->content = View::make('operador.Listado_agentes', compact('agentes', 'provincias'));
 }
Example #25
0
 public function authUser()
 {
     $data = \Input::All();
     try {
         Auth::attempt(array('email' => $data['email'], 'password' => $data['password']));
         return redirect()->back();
     } catch (Exception $e) {
         return redirect()->back()->with('message', $e->getMessage());
     }
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     //
     $data = Input::All();
     $riwayat = Dp3::find($id);
     $data['rata_rata'] = strval(($data['kesetiaan'] + $data['prestasi'] + $data['tanggung_jawab'] + $data['ketaatan'] + $data['kejujuran'] + $data['kerjasama'] + $data['prakarsa'] + $data['kepemimpinan']) / 8);
     if ($riwayat->update($data)) {
         return Response::json(array('success' => TRUE));
     }
 }
 /**
  * Update the specified resource in storage.
  * PUT /accountreceivables/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $input = array_except(Input::all(), '_method');
     $v = Validator::make(Input::All(), array('name' => 'required|max:50|', 'description' => 'required|max:400|min:10'));
     if ($v->passes()) {
         $receivables = Receivable::find($id);
         $receivables->update($input);
         return Redirect::route('backend.code.receivable.show', $id);
     }
     return Redirect::route('backend.code.receivable.edit')->withInput()->withErrors($v)->with('message', 'There were validation errors');
 }
Example #28
0
 /**
  * Update the specified resource in storage.
  * PUT /owners/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $input = array_except(Input::all(), '_method');
     $v = Validator::make(Input::All(), array('name' => 'required', 'lname' => 'required', 'phone' => 'required|max:16|min:10', 'email' => 'required|email|max:400|min:10'));
     if ($v->passes()) {
         $owners = Owner::find($id);
         $owners->update($input);
         return Redirect::route('admin.owner.show', $id);
     }
     return Redirect::route('code.owner.edit')->withInput()->withErrors($v)->with('message', 'There were validation errors');
 }
 /**
  * Update the specified resource in storage.
  * PUT /houses/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $input = array_except(Input::all(), '_method');
     $v = Validator::make(Input::All(), array('name' => 'required|max:50|', 'description' => 'required|max:400|min:10', 'propertyID' => 'required'));
     if ($v->passes()) {
         $paymenttypes = Paymenttype::find($id);
         $paymenttypes->update($input);
         return Redirect::route('admin.paymenttype.show', $id)->withFlashMessage('Payment type updated successfully');
     }
     return Redirect::route('admin.paymenttype.edit')->withInput()->withErrors($v)->with('message', 'There were validation errors');
 }
Example #30
0
 public function populateForm($model = false)
 {
     if ($model) {
         //$venues = $model->venues;
         //$tickets = $model->tickets;
         Former::populate($model);
     } else {
         $input = Input::All();
         Former::populate($input);
     }
 }