function c_busqueda($aFormValues, $order) { global $ng_nro_solicitud; global $ng_fecha; global $ng_user_id; global $ng_nombre; global $ng_monto; global $ng_max; global $ng_cantidad; if ($_SESSION["seleccionar"]) { $this->modelo->setorder($order); $result = new Rs($this->modelo->busqueda()); $str = "\n<thead><tr bgcolor='white' ><th width='5%'>#</th><th onclick=\"xajax_ctrl.c_order(xajax.getFormValues('form'),'nombre')\" >{$ng_nombre}<img id='imnombre'></th> <th onclick=\"xajax_ctrl.c_order(xajax.getFormValues('form'),'monto')\" >{$ng_monto}<img id='immonto'></th> <th onclick=\"xajax_ctrl.c_order(xajax.getFormValues('form'),'cantidad')\" >{$ng_cantidad}<img id='imcantidad'></th><th>Monto</th></tr></thead>"; $i = 0; $str .= "<tbody>"; $total_pagar = 0; $total = 0; while ($result->Registros()) { $i++; $total = $result->getCampo('monto') * $result->getCampo('cantidad'); $total_pagar += $total; $str .= "<tr ><td>" . $i . "</td> <td >" . $result->getCampo('nombre') . "</td> <td >" . to_moneda($result->getCampo('monto')) . "</td><td >" . $result->getCampo('cantidad') . "</td><td align='right'>" . to_moneda($total) . "</td><td width='5%' onclick='xajax_ctrl.c_ver(" . $result->getCampo('id') . ");' ><i class='fa fa-search'></i></td><td width='5%' onclick='xajax_ctrl.c_actualizar(" . $result->getCampo('id') . ");' ><i class='fa fa-edit'></i></td><td width='5%' onclick='el(" . $result->getCampo('id') . ");' ><i class='fa fa-trash-o'></i></td></tr>"; } $str .= "<tr><td colspan='5' align='right'><h2>Total a Pagar->" . to_moneda($total_pagar) . "</h2></td></tr>"; $str .= "</tbody>"; $this->objResponse->assign("mensaje", "innerHTML", "<div class='table-responsive'><table class='table table-striped table-bordered table-hover' border='0' width='100%' >{$str}</table></div>"); if (substr($_SESSION['order'], -3, 3) == 'asc') { $this->objResponse->assign("im" . substr($_SESSION['order'], 0, strpos($_SESSION['order'], " ")), "src", "../sis_design/img/up.jpg"); } else { $this->objResponse->assign("im" . substr($_SESSION['order'], 0, strpos($_SESSION['order'], " ")), "src", "../sis_design/img/down.jpg"); } $this->objResponse->assign("registros", "innerHTML", "Registros: " . $i); } else { $this->objResponse->assign("mensaje", "innerHTML", "Operación No \n\npermitida..."); $this->limpiarmensaje(); } return $this->objResponse; }
function to_moneda_Txt($moneda) { if (isset($moneda)) { $valor = moneda(to_moneda_bd(to_moneda($moneda))); } else { $valor = "0.00"; } return $valor; }