function ajaxphoneconversationAction() { $this->_helper->layout->disableLayout(); if ($this->_request->getParam('uid')) { $idValue = explode('&', $this->_request->getParam('uid')); $uid = $idValue[0]; $phoneconversationModel = new PhoneConversation(); $phoneconversation = $phoneconversationModel->fetchAll('consumer_id="' . $uid . '"'); if ($phoneconversation) { $this->view->phoneconversation = $phoneconversation; } $telephonelogModel = new TelephoneLog(); $telephonelog = $telephonelogModel->fetchAll('consumer_id="' . $uid . '"'); if ($telephonelog) { $this->view->telephonelog = $telephonelog; } } }
function admindeleteAction() { $this->_helper->layout->setLayout("layout_admin"); $this->view->title = "Delete Plan"; if (!$this->_request->isPost()) { $id = (int) $this->_request->getParam('plan_id'); $type = $this->_request->getParam('type'); if ($id > 0) { //first, delete the telephone log or sms if ($type == "TELEPHONE") { $telephoneLogModel = new TelephoneLog(); $telephoneLogModel->deleteByPlan($id); } else { if ($type == "SMS") { $shortMessageModel = new ShortMessage(); $shortMessageModel->deleteByPlan($id); } else { } } //second, delete the plan $telephonePlanModel = new TelephonePlan(); $where = 'id = ' . $id; $telephonePlanModel->delete($where); } } //$this->_helper->json($type); $this->_redirect('conversation/adminindex'); }