/var/www/vhosts/ihelp.ro/httpdocs/src/Controller/Admin
NameSizeModeActions
AdminController.php57720644editdlrm
BankAccountsController.php31440644editdlrm
BannersController.php45400644editdlrm
CategoriesController.php44980644editdlrm
CauseNewsController.php21450644editdlrm
CausesController.php87590644editdlrm
CronsController.php18000644editdlrm
DashboardController.php10620644editdlrm
DocumentsController.php36490644editdlrm
DonationsController.php5590644editdlrm
GalleryImagesController.php32460644editdlrm
OrdersController.php44760644editdlrm
ProductsController.php56420644editdlrm
ProposedCausesController.php33390644editdlrm
SettingsController.php31570644editdlrm
SponsorsActivitiesController.php40030644editdlrm
SponsorsController.php36470644editdlrm
TagsController.php26520644editdlrm
UsersController.php82440644editdlrm
Edit: /var/www/vhosts/ihelp.ro/httpdocs/src/Controller/Admin/ProposedCausesController.php (3339B)
paginate($this->ProposedCauses); $this->set(compact('proposedCauses')); } /** * View method */ public function view($id = null) { $proposedCause = $this->ProposedCauses->get($id, [ 'contain' => [], ]); $this->set(compact('proposedCause')); } /** * Edit method */ public function edit($id = null) { $this->loadModel('Causes'); if ($this->request->is(['patch', 'post', 'put'])) { $proposedCause = $this->ProposedCauses->find() ->where(['id' => $id]) ->first(); $satusProposedCause = $proposedCause->is_contacted; $proposedCause->is_contacted = ($satusProposedCause) ? false : true; $proposedCause = $this->ProposedCauses->patchEntity($proposedCause, $this->request->getData()); if ($this->ProposedCauses->save($proposedCause)) { $this->Flash->success(__('The proposed cause has been saved.')); $cause = $this->Causes->find() ->where(['Causes.uuid' => $proposedCause->uuid]) ->first(); if (empty($cause)) { $newCause = $this->Causes->newEmptyEntity(); $newCause->name = $proposedCause->cause_name; $newCause->donation_amount = $proposedCause->donation_amount; $newCause->description = $proposedCause->description; $newCause->user_id = $this->request->getSession()->read('Auth.id'); if ($this->Causes->save($newCause, ['validate' => false])) { $newCause->uuid = $proposedCause->uuid; $this->Causes->save($newCause); $this->Flash->success(__('The new cause has been saved.')); return $this->redirect(['prefix' => 'Admin', 'controller' => 'Causes', 'action' => 'edit', $newCause->id]); } else { $this->Flash->error(__('The new cause could not be saved. Please, try again.')); } } return $this->redirect(['prefix' => 'Admin', 'controller' => 'ProposedCauses', 'action' => 'index']); } $this->Flash->error(__('The proposed cause could not be saved. Please, try again.')); } } /** * Delete method */ public function delete($id = null) { $this->request->allowMethod(['post', 'delete']); $proposedCause = $this->ProposedCauses->get($id); if ($this->ProposedCauses->delete($proposedCause)) { $this->Flash->success(__('The proposed cause has been deleted.')); } else { $this->Flash->error(__('The proposed cause could not be deleted. Please, try again.')); } return $this->redirect(['prefix' => 'Admin', 'controller' => 'ProposedCauses', 'action' => 'index']); } }