public function listAction() { $this->view->disable(); $model = new Planpagos(); $resul = $model->listapagospendientes(); $customers = array(); foreach ($resul as $v) { //echo 'ver =>'.$v->id; $customers[] = array('id' => $v->id, 'razon_social' => $v->razon_social, 'correo' => $v->correo, 'representante_legal' => $v->representante_legal, 'correo_representante_legal' => $v->correo_representante_legal, 'nombre_ref' => $v->nombre_ref, 'correo_ref' => $v->correo_ref, 'nit' => $v->nit, 'grupo' => $v->grupo, 'linea' => $v->linea, 'estacion' => $v->estacion, 'contrato' => $v->contrato, 'producto' => $v->producto, 'fecha_programado' => $v->fecha_programado . ' 00:00:00', 'monto_reprogramado' => $v->monto_reprogramado, 'monto_depositado' => $v->monto_depositado, 'diferencia_dias' => $v->diferencia_dias, 'accion' => '<a href="/planpagos/controlpago/' . $v->contratoproducto_id . '" class="btn btn-xs btn-primary" title="Ver Plan Pago"><i class="fa fa-share-square-o"></i></a>'); } echo json_encode($customers); }
public function htmldepositosAction() { $resul = Planpagos::findFirstById($_POST['planpago_id']); $pp_deposito = Planpagodepositos::find(array("planpago_id=" . $_POST['planpago_id'] . " and baja_logica = 1 and tipo_deposito =1", "order" => "fecha_deposito ASC")); $pp_deposito_mora = Planpagodepositos::find(array("planpago_id=" . $_POST['planpago_id'] . " and baja_logica = 1 and tipo_deposito =2", "order" => "fecha_deposito ASC")); $html = '<div class="table-responsive"> <table class="table table-vcenter table-striped"> <thead> <tr> <td colspan="2"><strong>Fecha Programada: </strong>' . $resul->fecha_programado . ' </td> <td colspan="2"><strong>Monto Programada Bs.: </strong> ' . $resul->monto_reprogramado . '</td> </tr> <tr> <th>Nro Deposito</th> <th>Fecha Deposito</th> <th>Monto Deposito</th> <th></th> </tr> </thead> <tbody>'; foreach ($pp_deposito as $v) { $html .= '<tr> <td>' . $v->nro_deposito . '</td> <td>' . $v->fecha_deposito . '</td> <td>' . $v->monto_deposito . '</td> <td class="text-center"> <div class="btn-group btn-group-xs"> <a href="javascript:void(0)" data-toggle="tooltip" title="Eliminar Deposito" class="btn btn-danger eliminar_deposito" planpagodeposito_id ="' . $v->id . '"><i class="fa fa-trash-o"></i></a> </div> </td> </tr>'; } $html .= '<tr> <td colspan="2"><strong>Dias Atraso: </strong> ' . $resul->dias_atraso . '</td> <td colspan="2"><strong>Mora: </strong> ' . $resul->mora . '</td> </tr>'; foreach ($pp_deposito_mora as $v) { $html .= '<tr> <td>' . $v->nro_deposito . '</td> <td>' . $v->fecha_deposito . '</td> <td>' . $v->monto_deposito . '</td> <td class="text-center"> <div class="btn-group btn-group-xs"> <a href="javascript:void(0)" data-toggle="tooltip" title="Eliminar Deposito" class="btn btn-danger eliminar_deposito" planpagodeposito_id ="' . $v->id . '"><i class="fa fa-trash-o"></i></a> </div> </td> </tr>'; } $html .= '</tbody> </table> </div>'; $this->view->disable(); echo $html; }
public function reporteAction() { $this->view->disable(); $model = new Planpagos(); $resul = $model->lista(); include_once 'tbs_us/tbs_class.php'; // Load the TinyButStrong template engine include_once 'tbs_us/tbs_plugin_opentbs/tbs_plugin_opentbs.php'; // Load the OpenTBS plugin $TBS = new clsTinyButStrong(); // new instance of TBS $TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN); // load the OpenTBS plugin $TBS->VarRef['usuario'] = $this->_user->nombre . ' ' . $this->_user->paterno; $data = array(); $c = 1; foreach ($resul as $v) { $data[] = array('rank' => 'A', 'nro' => $c, 'grupo' => $v->grupo, 'linea' => $v->linea, 'estacion' => $v->estacion, 'razon_social' => $v->razon_social, 'contrato' => $v->contrato, 'fecha_contrato' => $v->fecha_contrato, 'producto' => $v->producto, 'fecha_inicio' => $v->fecha_inicio, 'fecha_fin' => $v->fecha_fin, 'total' => $v->total, 'deposito' => $v->deposito, 'cobrar' => $v->total - $v->deposito, 'mora' => number_format($v->mora, 2, '.', ',')); $c++; } $template = 'file/template/temp_reporte_contratos.xlsx'; $TBS->LoadTemplate($template, OPENTBS_ALREADY_UTF8); // Also merge some [onload] automatic fields (depends of the type of document). // ---------------------- // Debug mode of the demo // ---------------------- // if (isset($_POST['debug']) && ($_POST['debug']=='current')) $TBS->Plugin(OPENTBS_DEBUG_XML_CURRENT, true); // Display the intented XML of the current sub-file, and exit. // if (isset($_POST['debug']) && ($_POST['debug']=='info')) $TBS->Plugin(OPENTBS_DEBUG_INFO, true); // Display information about the document, and exit. // if (isset($_POST['debug']) && ($_POST['debug']=='show')) $TBS->Plugin(OPENTBS_DEBUG_XML_SHOW); // Tells TBS to display information when the document is merged. No exit. // Merge data in the first sheet $TBS->MergeBlock('a,b', $data); // ----------------- // Output the result // ----------------- // $output_file_name = str_replace('.', '_'.date('Y-m-d').'.', $template); $output_file_name = date('Y-m-d') . ' ' . 'reporte.xlsx'; $TBS->Show(OPENTBS_DOWNLOAD, $output_file_name); // Also merges all [onshow] automatic fields. exit; }