public function getclientsdetailsbyidajaxAction() { try { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $request = $this->getRequest(); if ($this->getRequest()->isPost()) { $mapper = new Gyuser_Model_UserDataMapper(); $Obj = new Gyuser_Model_User(); $Obj->setId($request->client_id); //$result = $mapper->findClient($Obj); $result = $mapper->ClientDetailsById($Obj); if ($result) { $strRes = str_replace('\\u0000*\\u0000_', "", json_encode((array) $result)); $jsonRes = $strRes; echo $jsonRes; } else { echo "f"; } } } catch (Exception $e) { echo $e; } }
public function clientinfoAction() { $this->_helper->layout()->disableLayout(); $this->_helper->ViewRenderer->setScriptAction('client-info'); //_event_id, _operator_id,_item_id if (false === ($client_id = $this->_getParam('param1', false))) { throw new Exception('Tampered URI'); } //echo $client_id; $client = new Gyuser_Model_User(); $client->setId($client_id); $mapper = new Gyuser_Model_UserDataMapper(); $this->view->clientInfo = $mapper->ClientDetailsById($client); $model = new Gyuser_Model_CRMTasks(); $this->view->clientId = $client_id; $this->view->clientHistory = $model->getClientHistory($client_id); }
public function CreatePDF(Gyuser_Model_User $obj, $typeid, $status, $operationid) { $clietid = $obj->getId(); $param = array(); if ($status) { $param = array('compress' => 0, 'Attachment' => 0); } switch ($typeid) { case 1: $mapper = new Gyuser_Model_UserDataMapper(); $result = $mapper->ClientDetailsById($obj); $fn = $result->getFirst_name(); $ln = $result->getLast_name(); $dni = $result->GetDNI(); $html = '<html><body>' . '<table style="font-size:30px;font-weight:bold;font-family:Helvetica,Arial;">' . '<tr>' . '<td>Nombre</td>' . '<td>: </td>' . "<td>{$fn}</td>" . '</tr>' . '<tr>' . '<td>Apellido</td>' . '<td>: </td>' . "<td>{$ln}</td>" . '</tr>' . '<tr>' . '<td>DNI</td>' . '<td>: </td>' . "<td>{$dni}</td>" . '</tr>' . '</table>' . '</body></html>'; $dompdf = new DOMPDF(); $dompdf->load_html($html); $dompdf->render(); $dompdf->stream("Mutuo-1.pdf", $param); break; case 2: $mapper = new Gyuser_Model_UserDataMapper(); $result = $mapper->ClientDetailsById($obj); $fn = $result->getFirst_name(); $ln = $result->getLast_name(); $dni = $result->GetDNI(); $chequeObj = new Gyuser_Model_Cheques(); $chequeObj->setOperation_id($operationid); $chequeMapper = new Gyuser_Model_ChequesDataMapper(); $chequesList = $chequeMapper->GetChequeDetailsByUserId($chequeObj); $html = '<html> <style> .cheques{ width:100%; border:1px solid #ccc; } .cheques td,.cheques th{ border:2px solid #ccc; font-family:Helvetica,Arial; padding:10px; } .cheques th{ font-size:20px; font-weight:bold; } .h1Txt{ text-decoration:underline; font-family:Helvetica,Arial; } </style> <body>' . '<table style="font-size:30px;font-weight:bold;font-family:Helvetica,Arial;">' . '<tr>' . '<td>Nombre</td>' . '<td>: </td>' . "<td>{$fn}</td>" . '</tr>' . '<tr>' . '<td>Apellido</td>' . '<td>: </td>' . "<td>{$ln}</td>" . '</tr>' . '<tr>' . '<td>DNI</td>' . '<td>: </td>' . "<td>{$dni}</td>" . '</tr>' . '</table><br/><br/>'; if ($chequesList) { $html .= '<table class="cheques"><tr><th>Fecha</th><th>Numero De Cheque</th><th>Importe</th></tr>'; foreach ($chequesList as $cheque) { $html .= '<tr>'; $html .= '<td >' . $cheque['date'] . '</td>'; $html .= '<td >' . $cheque['check_n'] . '</td>'; $html .= '<td >' . $cheque['amount'] . '</td>'; $html .= '</tr>'; } $html .= '</table>'; } $html .= '</body></html>'; $dompdf = new DOMPDF(); $dompdf->load_html($html); $dompdf->render(); $dompdf->stream("Mutuo-2.pdf", $param); break; case 3: $mapper = new Gyuser_Model_UserDataMapper(); $result = $mapper->ClientDetailsById($obj); $fn = $result->getFirst_name(); $ln = $result->getLast_name(); $dni = $result->GetDNI(); $telc = $result->getTel_cell_code() . ' ' . $result->getTel_cell(); $tell = $result->getTel_lab_code() . ' ' . $result->getTel_lab(); $telo = $result->getTel_otro_code() . ' ' . $result->getTel_otro(); $telp = $result->getTel_part_code() . ' ' . $result->getTel_part(); $chequeObj = new Gyuser_Model_Cheques(); $chequeObj->setOperation_id($operationid); $chequeMapper = new Gyuser_Model_ChequesDataMapper(); $chequesList = $chequeMapper->GetChequeDetailsByUserId($chequeObj); $addressMapper = new Gyuser_Model_AddressDataMapper(); $addressObj = new Gyuser_Model_Address(); $addressObj->setClient_id($clietid); $address = $addressMapper->GetDeliveryAddressByClientId($addressObj); $html = '<html> <style> .cheques{ width:100%; border:1px solid #ccc; } .cheques td,.cheques th{ border:2px solid #ccc; font-family:Helvetica,Arial; padding:10px; } .cheques th{ font-size:20px; font-weight:bold; } .address td{ font-family:Helvetica,Arial; padding:10px; font-size:20px; } </style> <body>' . '<table style="font-size:30px;font-weight:bold;font-family:Helvetica,Arial;">' . '<tr>' . '<td>Nombre</td>' . '<td>: </td>' . "<td>{$fn}</td>" . '</tr>' . '<tr>' . '<td>Apellido</td>' . '<td>: </td>' . "<td>{$ln}</td>" . '</tr>' . '<tr>' . '<td>DNI</td>' . '<td>: </td>' . "<td>{$dni}</td>" . '</tr>' . '</table><br/><br/><h1 class="h1Txt">Cheques</h1>'; if ($chequesList) { $html .= '<table class="cheques"><tr><th>Fecha</th><th>Numero De Cheque</th><th>Importe</th></tr>'; foreach ($chequesList as $cheque) { $html .= '<tr>'; $html .= '<td >' . $cheque['date'] . '</td>'; $html .= '<td >' . $cheque['check_n'] . '</td>'; $html .= '<td >' . $cheque['amount'] . '</td>'; $html .= '</tr>'; } $html .= '</table>'; } $html .= '<br/><br/><h1 class="h1Txt">Domicilios</h1>'; if ($address) { $str = ''; $jsonData = $address; $id = $jsonData['id']; $street = $jsonData['street']; $city = $jsonData['city']; $state = $jsonData['state']; $state_name = $jsonData['state_name']; $country = $jsonData['country']; $html .= '<table class="address">' . '<tr>' . '<td width="100">Domicilio</td><td> : </td><td>' . $street . '</td>' . '</tr>' . '<tr>' . '<td>Barrio / Ciudad</td><td> : </td><td>' . $city . '</td>' . '</tr>' . '<tr>' . '<td>Provincia</td><td> : </td><td>' . $state_name . '</td>' . '</tr>' . '<tr>' . '<td>Tel�fono</td><td> : </td><td>' . $telc . '<br/>' . $tell . '<br/>' . $telo . '<br/>' . $telp . '<br/></td>' . '</tr>' . '</table>'; } $html .= '</body></html>'; $dompdf = new DOMPDF(); $dompdf->load_html($html); $dompdf->render(); $dompdf->stream("Mutuo-3.pdf", $param); break; default: break; } }