/var/www/vhosts/ihelp.ro/httpdocs/src/Controller
NameSizeModeActions
Admin/-0755rm
Api/-0755rm
Async/-0755rm
Component/-0755rm
Dashboard/-0755rm
AjaxController.php9040644editdlrm
AppController.php60900644editdlrm
CartsController.bk.php302280644editdlrm
CartsController.php182420644editdlrm
CategoriesController.php48970644editdlrm
CausesController.php110500644editdlrm
DonationsController.php29690644editdlrm
ErrorController.php17710644editdlrm
OrdersController.php203170644editdlrm
PagesController.php23170644editdlrm
PaymentsController.php90470644editdlrm
ProductFavoritesController.php65950644editdlrm
ProductsController.php71350644editdlrm
ProposedCausesController.php11920644editdlrm
SearchController.php30430644editdlrm
ShowcaseController.php6690644editdlrm
UserAddressesController.php14820644editdlrm
UsersController.php228460644editdlrm
Edit: /var/www/vhosts/ihelp.ro/httpdocs/src/Controller/DonationsController.php (2969B)
paginate = [ 'contain' => ['Users', 'Causes', 'Orders'], ]; $donations = $this->paginate($this->Donations); $this->set(compact('donations')); } /** * View method */ public function view($id = null) { $donation = $this->Donations->get($id, [ 'contain' => ['Users', 'Causes', 'Orders', 'PaymentLogs'], ]); $this->set(compact('donation')); } /** * Add method */ public function add() { $donation = $this->Donations->newEmptyEntity(); if ($this->request->is('post')) { $donation = $this->Donations->patchEntity($donation, $this->request->getData()); if ($this->Donations->save($donation)) { $this->Flash->success(__('The donation has been saved.')); return $this->redirect(['action' => 'index']); } $this->Flash->error(__('The donation could not be saved. Please, try again.')); } $users = $this->Donations->Users->find('list', ['limit' => 200]); $causes = $this->Donations->Causes->find('list', ['limit' => 200]); $orders = $this->Donations->Orders->find('list', ['limit' => 200]); $this->set(compact('donation', 'users', 'causes', 'orders')); } /** * Edit method */ public function edit($id = null) { $donation = $this->Donations->get($id, [ 'contain' => [], ]); if ($this->request->is(['patch', 'post', 'put'])) { $donation = $this->Donations->patchEntity($donation, $this->request->getData()); if ($this->Donations->save($donation)) { $this->Flash->success(__('The donation has been saved.')); return $this->redirect(['action' => 'index']); } $this->Flash->error(__('The donation could not be saved. Please, try again.')); } $users = $this->Donations->Users->find('list', ['limit' => 200]); $causes = $this->Donations->Causes->find('list', ['limit' => 200]); $orders = $this->Donations->Orders->find('list', ['limit' => 200]); $this->set(compact('donation', 'users', 'causes', 'orders')); } /** * Delete method */ public function delete($id = null) { $this->request->allowMethod(['post', 'delete']); $donation = $this->Donations->get($id); if ($this->Donations->delete($donation)) { $this->Flash->success(__('The donation has been deleted.')); } else { $this->Flash->error(__('The donation could not be deleted. Please, try again.')); } return $this->redirect(['action' => 'index']); } }