/** * <Create By Jason> * <TO show list of tenancies detail in tenant user> */ public function actionTenancies_Detail() { try { $this->pageTitle = 'Tenancies Details - ' . Yii::app()->params['title']; $this->layout = 'application.views.layouts.layout_user'; if (!isset(Yii::app()->user->id)) { $this->redirect(Yii::app()->createAbsoluteUrl('/')); } if (!isset($_GET['transaction_id'])) { $_GET['transaction_id'] = 0; } //HTram add: to load call log by role users $role_id = ''; if (isset(Yii::app()->user->id)) { $role_id = Yii::app()->user->roleid; } $calllog = ProCallLog::getListCallLog($_GET['transaction_id'], $role_id); // $document = ProTransactionsPropertyDocument::getListDocument($_GET['transaction_id']); $transaction = ProTransactions::getByPk($_GET['transaction_id']); $report = ProReportDefect::getListReport($_GET['transaction_id']); $landlordInformation = ProTransactionsVendorPurchaserDetail::getTenancyInformation($_GET['transaction_id'], TYPE_LANDLORD); $mAirconService = new ProAirconService(); $mAirconService->transaction_id = $_GET['transaction_id']; MyFormat::CheckValidRequest($transaction); $this->render('tenancies_detail', array('report' => $report, 'transaction' => $transaction, 'document' => $document, 'calllog' => $calllog, 'landlordInformation' => $landlordInformation, 'mAirconService' => $mAirconService)); } catch (Exception $exc) { throw new CHttpException('404', $exc->getMessage()); } }
public static function ShowCallsLogList($transaction_id) { $re = ''; $callslog = ProCallLog::getCallsLogByTransaction($transaction_id); $re .= '<table style="width:100%;">'; $re .= '<thead>'; $re .= '<th class="th-small">S/N</th>'; $re .= '<th class="th-normal">Date Time</th>'; $re .= '<th class="th-normal">Received By</th>'; $re .= '<th class="th-big">Description</th>'; $re .= '<th class="th-normal">Person Call Type</th>'; $re .= '<th class="th-normal">Name</th>'; $re .= '<th class="th-normal">Mobile</th>'; $re .= '</thead>'; if ($callslog) { foreach ($callslog as $key => $item) { $re .= '<tr>'; $re .= '<td>' . ($key + 1) . '</td>'; $re .= '<td>' . $item->date . '</td>'; $re .= '<td>' . $item->received_by . '</td>'; $re .= '<td>' . MyFormat::replaceNewLineTextArea($item->description) . '</td>'; $re .= '<td>'; $re .= isset(ProCallLog::$ARR_PERSON_CALL_TYPE[$item->person_call_type]) ? ProCallLog::$ARR_PERSON_CALL_TYPE[$item->person_call_type] : ""; $re .= '</td>'; $re .= '<td>' . $item->person_called . '</td>'; $re .= '<td>' . $item->phone . '</td>'; $re .= '</tr>'; } } else { $re .= '<tr><td colspan="7"><span class="empty">No results found.</span></td></tr>'; } $re .= '</table>'; return $re; }
public function actionCallsLog($transaction_id) { $this->pageTitle = "CallsLog - " . Yii::app()->params['title']; $this->layout = "application.views.layouts.layout_callslog"; try { $model = new ProCallLog(); $model->unsetAttributes(); // clear any default values if (isset($_GET['ProCallLog'])) { $model->attributes = $_GET['ProCallLog']; } $model->transaction_id = $transaction_id; $this->render('callslog/list', array('model' => $model)); } catch (Exception $ex) { Yii::log("Exception " . print_r($e, true), 'error'); throw new CHttpException(400, $e->getMessage()); } }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer the ID of the model to be loaded */ public function loadModel($id) { try { $model = ProCallLog::model()->findByPk($id); if ($model === null) { Yii::log("The requested page does not exist."); throw new CHttpException(404, 'The requested page does not exist.'); } return $model; } catch (Exception $e) { Yii::log("Exception " . print_r($e, true), 'error'); throw new CHttpException("Exception " . print_r($e, true)); } }