public function deleteAction() { $this->view->disable(); if ($this->request->hasPost('d_id') && $this->request->isAjax()) { $dialog_ids = $this->request->getPost('d_id'); foreach (Message::find(array("dialogs_id = {$dialog_ids}")) as $mes) { $mes->delete(); } foreach (DialogsHasUser::find(array("dialogs_id = {$dialog_ids}")) as $ds) { $ds->delete(); } Dialogs::findFirst($dialog_ids)->delete(); echo 1; } }
public function contactAction() { $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW); if ($this->session->has('auth') && $this->request->hasPost('offer_id')) { $offer = Offers::findFirst($this->request->getPost('offer_id')); $user = $offer->user; $this->view->setVars(array('user_id' => $id = $user->id, 'first_name' => $name = isset($user->first_name) ? $user->first_name : false, 'organization' => $org = isset($user->organization) ? $user->organization : false, 'profession' => $profession = isset($user->profession) ? $user->profession : false, 'phone' => $phone = isset($user->phone) ? $user->phone : false, 'email' => $email = isset($user->email) ? $user->email : false, 'country' => $country = isset($user->country) ? $user->country : false, 'adress' => $adress = isset($user->adress) ? $user->adress : false)); } if ($this->session->has('auth') && $this->request->hasPost('order_id')) { $prop = Proposal::findFirst($this->request->getPost('order_id')); $user = $prop->user; $this->view->setVars(array('user_id' => $id = $user->id, 'first_name' => $name = isset($user->first_name) ? $user->first_name : false, 'organization' => $org = isset($user->organization) ? $user->organization : false, 'profession' => $profession = isset($user->profession) ? $user->profession : false, 'phone' => $phone = isset($user->phone) ? $user->phone : false, 'email' => $email = isset($user->email) ? $user->email : false, 'country' => $country = isset($user->country) ? $user->country : false, 'adress' => $adress = isset($user->adress) ? $user->adress : false)); } if ($this->session->has('auth') && $this->request->hasPost('di_id')) { $dial = Dialogs::findFirst($this->request->getPost('di_id')); foreach ($dial->user as $users) { if ($users->id != $this->session->get('user_id')) { $user = User::findFirst($users->id); } } $this->view->setVars(array('user_id' => $id = $user->id, 'first_name' => $name = isset($user->first_name) ? $user->first_name : false, 'organization' => $org = isset($user->organization) ? $user->organization : false, 'profession' => $profession = isset($user->profession) ? $user->profession : false, 'phone' => $phone = isset($user->phone) ? $user->phone : false, 'email' => $email = isset($user->email) ? $user->email : false, 'country' => $country = isset($user->country) ? $user->country : false, 'adress' => $adress = isset($user->adress) ? $user->adress : false)); } if ($this->session->has('auth') && $this->request->hasPost('user_id')) { $user = User::findFirst($this->request->getPost('user_id')); $this->view->setVars(array('user_id' => $id = $user->id, 'first_name' => $name = isset($user->first_name) ? $user->first_name : false, 'organization' => $org = isset($user->organization) ? $user->organization : false, 'profession' => $profession = isset($user->profession) ? $user->profession : false, 'phone' => $phone = isset($user->phone) ? $user->phone : false, 'email' => $email = isset($user->email) ? $user->email : false, 'country' => $country = isset($user->country) ? $user->country : false, 'adress' => $adress = isset($user->adress) ? $user->adress : false)); } }