function dataERP($params) { global $sugar_config, $mod_strings; require $sugar_config['path_parametros'] . "param_criterio_cotizacion.php"; require_once "custom/opalo/lib/ERP/Utils.php"; require_once "custom/opalo/lib/Utils.php"; $account_field = isset($params['account_field']) ? $params['account_field'] : "account_id"; //Campo para obtener el id del cliente $parametros = array(array('etiqueta' => 'LBL_REFERENCIA', 'html' => inputHtml('referencia', '', 'form-control')), array('etiqueta' => 'LBL_DESCRIPCION', 'html' => inputHtml('descripcion', '', 'form-control'))); $js_params = array('referencia', 'descripcion'); foreach ($criterio_cotizacion as $id_plan => $etiqueta) { $parametros[] = array('etiqueta' => $etiqueta, 'html' => html_select("criterios[{$id_plan}]", getCriterios($id_plan), '', false, 'form-control', true)); $js_params[] = "criterios\\[{$id_plan}\\]"; } $num_col = 6; $css = array("custom/opalo/Vendor/datatables/css/jquery.dataTables.css"); $html .= ""; foreach ($css as $incluir) { $html .= '<link rel="stylesheet" type="text/css" href="' . $incluir . '" />'; } $html .= "<div class='panel panel-primary'>"; $html .= "<div class='panel-heading'>\n <h3 class='panel-title'>\n Items ERP <a data-toggle='collapse' href='#wp_erp' class='btn_switch_panel'><span class='caret'></span></a> \n <button type='button' class='close' aria-hidden='true'>×</button>\n </h3>\n </div>"; $html .= "<div class='panel-body'>"; $html .= "<div id='wp_erp' class='collapse text-center'>"; $html .= "<div class='wp_filters row'>"; while (count($parametros) > 0) { for ($contador = 0; $contador < $num_col; $contador++) { $porc = 100 / ($num_col * 2); $data = array_shift($parametros); $label = $data['etiqueta']; if (isset($mod_strings[$data['etiqueta']])) { $label = $mod_strings[$data['etiqueta']]; } $html .= "<div class='col-md-3 form-group'><label>" . $label . "</label>" . $data['html'] . "</div>"; } } $html .= "</div><br/>"; $html .= "<a href='#' class='btn btn-primary btn-lg' onclick='post_to_html(" . json_encode($js_params) . ",\"resultados_items\",\"{$account_field}\",\"ajax_items_erp\"); return false;'>Filtrar</a><br/><br/>"; $html .= "<div id='resultados_items'></div>"; $html .= "</div>"; //.wp_erp $html .= "</div>"; //.content $html .= "</div>"; //.panel $html .= "<script type='text/javascript'>\n post_to_html(" . json_encode($js_params) . ",\"resultados_items\",\"{$account_field}\",\"ajax_items_erp\")\n </script>"; return $html; }
</th> </tr> <?php for ($i = 1; $i <= 3; $i++) { $label = "Etiqueta {$i}"; $name = "etq_pest{$p}" . "_{$i}"; ?> <tr> <td> <?php echo $label; ?> </td> <td> <?php echo inputHtml($name); ?> </td> <?php $label = "ID etiqueta {$i}"; $name = "id_pest{$p}" . "_{$i}"; ?> <td> <?php echo $label; ?> </td> <td> <?php $planes = getPlanesItems(); echo html_select($name, $planes);