public function buildDashboard() { $this->setDashboardTitle("Stock Dashboard"); $this->setActionPath("/static/transfer/build/tour/motherboard_stock_action.php"); $kpi = new KPIGroupComponent('kpi'); $kpi->setDimensions(12, 2); $kpi->setCaption('Units stock by Category'); $Units = $this->get_units(true); foreach ($Units as $key => $value) { $kpi->addKPI($value['id'], array('caption' => $value['CategoryName'], 'value' => $value['Quantity'], 'numberSuffix' => ' units', 'numberHumanize' => true)); } $this->addComponent($kpi); $table = new TableComponent('table'); $table->setCaption("List of Item in Stock"); $table->setDimensions(6, 5); $stock = $this->get_stock(); $table->addColumn('id', 'Product Id'); $table->addColumn('name', 'Product Name'); $table->addColumn('category', 'Category'); $table->addColumn('price', 'Price', array("numberPrefix" => "\$", "dataType" => "number")); $table->addColumn('stock', 'Stock'); $table->addMultipleRows($this->PolulateData($stock)); $this->addComponent($table); $c12 = new FormComponent('filter'); $c12->setDimensions(6, 5); $c12->setCaption('Filter items in stock'); $category = $this->get_category(); $c12->addSelectField('category', 'Select Category', array_merge(['no selection'], ArrayUtils::pluck($category, 'CategoryName'))); $c12->addTextField('contains', 'Product Name Contains'); $c12->addNumericRangeField('stock', 'Units In Stock', array(0, 100)); $this->addComponent($c12); $c12->onApplyClick(array($table), 'handleApply', $this); }
public function buildDashboard() { $table = new TableComponent("table1"); $table->setCaption("List of items in stock"); $table->setDimensions(12, 6); $table->addColumn('ProductID', 'Product ID'); $table->addColumn('ProductName', 'Product Name'); $table->addColumn('CategoryName', 'Category'); $table->addColumn('UnitPrice', 'Price', array('dataType' => 'number', 'numberPrefix' => '$', 'numberForceDecimals' => true, 'numberDecimalPoints' => 2)); $table->addColumn('UnitsInStock', 'Stock'); $table->addColumn('Discounted', 'Discounted?'); $this->addComponent($table); }
public function buildDashboard() { $table = new TableComponent('table1'); $table->setCaption("Table 1"); $table->setDimensions(6, 3); $table->setRowsPerPage(8); $table->addColumn('colA', "Column A"); $table->addColumn('colB', "Column B"); $table->setRowDataSource('paginate', $this); $table->setNumberOfRows(40); $table->setRowsPerPage(7); $this->addComponent($table); }
public function buildDashboard() { $table = new TableComponent('table1'); $table->setCaption("Regional Sales"); $table->setDimensions(4, 4); $table->setRowsPerPage(8); $table->addColumn('zone', "Zone"); $table->addColumn('name', "Store Name"); $table->addColumn('sale', "Sales Amount"); $table->addSparkColumn('customer', "Customers"); $data = array(array("zone" => "North", "name" => "Northern Stores", "sale" => 4000, "customer" => array(5, 3, 4, 8)), array("zone" => "South", "name" => "Southern Stores", "sale" => 4500, "customer" => array(10, 6, 15, 8))); $table->addMultipleRows($data); $this->addComponent($table); }
public function buildDashboard() { $table = new TableComponent('table1'); $table->setCaption("Regional Sales"); $table->setDimensions(4, 4); $table->setRowsPerPage(8); $table->addColumn('zone', "Zone"); $table->addColumn('name', "Store Name"); $table->addColumn('sale', "Sales Amount", array("dataType" => "number", "numberPrefix" => "\$ ", "textAlign" => "center")); $data = array(array("zone" => "North", "name" => "Northern Stores", "sale" => 4000), array("zone" => "South", "name" => "Southern Stores", "sale" => 4500)); $table->addMultipleRows($data); $this->addComponent($table); }
public function buildDashboard() { $kpi = new KPIComponent("kpi1"); $kpi->setCaption("Hello world"); $kpi->setValue(42); $kpi->setDimensions(4, 4); $kpi->setSparkValues(array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'), array(20, 32, 34, 12, 4, 16)); $this->addComponent($kpi); $table = new TableComponent('table1'); $table->setCaption("Table 1"); $table->setDimensions(6, 6); $table->addColumn('colA', "Column A"); $table->addColumn('colB', "Column B"); for ($i = 0; $i < 2; $i++) { $table->addRow(array('colA' => $i * 2, 'colB' => $i * 2 + 1)); } $this->addComponent($table); $kpi2 = new KPIComponent("kpi2"); $kpi2->setCaption("KPI 2"); $kpi2->setValue(45); $kpi2->setDimensions(4, 4); $this->addComponent($kpi2); // $chart = new ChartComponent('my_chart'); // $chart->setCaption("Chart 1"); // $chart->setDimensions(4,4); // $chart->setLabels(['January', 'February', 'March', 'April', 'May']); // $chart->addSeries("seriesA", "Series A", [1, 3, 5, 1, 9], null); // $chart->addSeries("seriesB", "Series B", [3, 1, 9, 2, 3], null); // $this->addComponent ($chart); $kpi->bindToEvent("kpiClick", array($kpi2, $table), "handleKPIClick", $this); }
public function buildDashboard() { $table = new TableComponent('table1'); $table->setCaption("Table 1"); $table->setDimensions(6, 6); $table->setRowsPerPage(8); $table->addColumn('colA', "Column A"); $table->addColumn('colB', "Column B"); for ($i = 0; $i < 10; $i++) { // Single Row $table->addRow(array('colA' => $i * 2, 'colB' => $i * 2 + 1)); } $table->cellConditionalFormat("colA", "value>300", array("cellBackgroundColor" => "#000", "cellTextColor" => "#fff")); $this->addComponent($table); }
public function buildDashboard() { $table = new TableComponent('table1'); $table->setCaption("List of Employees"); $table->setDimensions(6, 6); $employees = $this->getEmployees(); $table->addColumn('FirstName', "First Name"); $table->addColumn('LastName', "Last Name"); $table->addColumn('City', "City"); $table->addColumn('State', "State", array('textItalicFlag' => true)); $table->addColumn('Country', "Country"); $table->addMultipleRows($this->populateData($employees)); $this->addComponent($table); $form = new FormComponent('form1'); $form->setCaption("Form Employees"); $form->setDimensions(4, 4); $form->addTextField("contains", "City Contains"); $form->onApplyClick(array($table), "handleEmployeesSubmit", $this); $this->addComponent($form); }
public function buildDashboard() { $table = new TableComponent('table1'); $table->setCaption("Table 1"); $table->setDimensions(6, 6); $table->setRowsPerPage(8); $table->addColumn('colA', "Column A"); $table->addColumn('colB', "Column B"); for ($i = 0; $i < 10; $i++) { // Single Row $table->addRow(array('colA' => $i * 2, 'colB' => $i * 2 + 1)); } // Multiple Rows $rows = array(array('colA' => 111, 'colB' => 22), array('colA' => 222, 'colB' => 33), array('colA' => 333, 'colB' => 44)); $table->addMultipleRows($rows); $this->addComponent($table); }
public function buildDashboard() { $categories = ['Beverages', 'Condiments', 'Confections', 'Dairy Products', 'Grains/Cereal', 'Meat/Poultry', 'Produce', 'Seafood']; $c1 = new TableComponent("table1"); $c1->setCaption("List of items in stock"); $c1->setDimensions(6, 6); $c1->addColumn('ProductID', 'Product ID'); $c1->addColumn('ProductName', 'Product Name'); $c1->addColumn('CategoryName', 'Category'); $c1->addColumn('UnitPrice', 'Price', array('dataType' => 'number', 'numberPrefix' => '$', 'numberForceDecimals' => true, 'numberDecimalPoints' => 2)); $c1->addColumn('UnitsInStock', 'Stock'); $c1->addColumn('Discontinued', 'Discontinued?'); $this->addComponent($c1); $c2 = new FormComponent('form1'); $c2->setCaption("Form items in stock"); $c2->setDimensions(6, 6); $c2->addTextField('contains', 'Product Name Contains'); $c2->addNumericRangeField('stock', 'Units In Stock', array(10, 100)); $c2->addCheckboxField('discontinued', 'Exclude Discontinued Items', false); $this->addComponent($c2); }
public function buildDashboard() { $table = new TableComponent('table1'); $table->setCaption("Movies & Ratings"); $table->setDimensions(6, 6); $table->setRowsPerPage(8); $table->addColumn('rank', "Rank"); $table->addColumn('title', "Title"); $table->addColumn('rating', "Rating"); $table->addMultipleRows($this->rows); // Adding multiple rows at once $filter = new FormComponent('form'); $filter->setCaption('Filter'); $filter->setDimensions(5, 3); $filter->addSelectField('rating_filter', 'Rating Greater Than', array(5, 6, 7, 8, 9)); $filter->onApplyClick(array($table), 'handleApplyClick', $this); $this->addComponent($table); $this->addComponent($filter); }
public function buildDashboard() { $quarterlySales = new ChartComponent('quarterlySales'); $quarterlySales->setDimensions(6, 6); $quarterlySales->setCaption("Quarterly Sales"); $quarterlySales->setLabels(array("Q1", "Q2", "Q3", "Q4")); $quarterlySales->addYAxis('quantity', "Quantity"); $quarterlySales->addSeries('sales', "Sales", array(13122, 41312, 46132, 51135), array('numberPrefix' => "\$")); $quarterlySales->addSeries('quantity', "Quantity", array(121, 392, 420, 489), array('yAxis' => 'quantity')); $quarterlySales->addComponentKPI('beverage', array('caption' => 'Beverages', 'value' => 22900, 'numberPrefix' => ' $', 'numberHumanize' => true)); $quarterlySales->addComponentKPI('vegetable', array('caption' => 'Vegetables', 'value' => 10401, 'numberPrefix' => ' $', 'numberHumanize' => true)); $quarterlySales->addComponentKPI('dairy', array('caption' => 'Dairy', 'value' => 27700, 'numberPrefix' => ' $', 'numberHumanize' => true)); $quarterlySales->addDrillStep('drillIntoMonths', $this); $this->addComponent($quarterlySales); $numTickets = new KPIComponent('numTickets'); $numTickets->setDimensions(3, 3); $numTickets->setCaption("Open Support Tickets"); $numTickets->setValue(42); $this->addComponent($numTickets); $satisfactionGauge = new GaugeComponent('satisfactionGauge'); $satisfactionGauge->setDimensions(3, 3); $satisfactionGauge->setCaption('Customer Satisfaction'); $satisfactionGauge->setValue(8); $satisfactionGauge->setLimits(0, 10); $this->addComponent($satisfactionGauge); $ticketPriorities = new KPIGroupComponent('ticketPriorities'); $ticketPriorities->setDimensions(6, 3); $ticketPriorities->setCaption('Ticket Priorities'); $ticketPriorities->addKPI('high', array('caption' => 'High Priority', 'value' => 6)); $ticketPriorities->addKPI('normal', array('caption' => 'Normal Priority', 'value' => 36)); $this->addComponent($ticketPriorities); $productsTable = new TableComponent('productsTable'); $productsTable->setDimensions(6, 6); $productsTable->setCaption('Products'); $productsTable->addColumn('name', 'Name'); $productsTable->addColumn('category', 'Category'); $productsTable->addColumn('price', 'Price', array('dataType' => "number", 'numberPrefix' => "\$", 'textAlign' => "right", 'numberForceDecimals' => true)); $productsTable->addMultipleRows($this->tableData); $this->addComponent($productsTable); $productFilterForm = new FormComponent('productFilterForm'); $productFilterForm->setDimensions(6, 6); $productFilterForm->setCaption('Filter Products'); $productFilterForm->addMultiSelectField('category', 'Select Category', array('Vegetables', 'Dairy', 'Beverages')); $productFilterForm->addTextField('name', 'Product Name Contains'); $productFilterForm->addNumericRangeField('price', 'Price', array(5, 20)); $this->addComponent($productFilterForm); $productFilterForm->onApplyClick(array($productsTable), 'handleApplyClick', $this); }
public function buildDashboard() { $yearwise = new ChartComponent('yearly_sales'); $yearwise->setCaption("Yearly Sales"); $yearwise->setDimensions(6, 6); $yearData = $this->get_year(); $yearwise->setLabels(ArrayUtils::pluck($yearData, 'payment_year')); $yearwise->setYAxis("Sales", array("numberHumanize" => true, 'numberPrefix' => "\$")); $totalSalesArr = ArrayUtils::pluck($yearData, "total_amount"); $yearwise->addSeries("sales", "Sales", $totalSalesArr, array('numberPrefix' => "\$")); $yearwise->addDrillStep("get_monthwise", $this); $yearwise->addDrillStep("get_daywise", $this); $totalSales = 0; foreach ($totalSalesArr as $key => $value) { $totalSales += $value; } $yearwise->addComponentKPI("sales", array("caption" => "Total Sales", "value" => $totalSales, "numberPrefix" => "\$", "numberHumanize" => true)); $yearwise->addComponentKPI("second", array("caption" => "Revenue", "value" => $totalSales, "numberPrefix" => "\$", "numberHumanize" => true)); $this->setDashboardTitle("Sales Dashboard"); $this->addComponent($yearwise); $category = new ChartComponent('category'); $category->setCaption("Category wise Sales"); $category->setDimensions(6, 6); $categoryData = $this->get_category(); $category->setLabels(ArrayUtils::pluck($categoryData, 'CategoryName')); $category->setYAxis("Sales", array("numberHumanize" => true, 'numberPrefix' => "\$")); $totalSalesArr = ArrayUtils::pluck($categoryData, "total_amount"); $category->addSeries("sales", "Sales", $totalSalesArr, array('numberPrefix' => "\$")); $this->addComponent($category); $table = new TableComponent('table'); $table->setCaption("Average Shipping Time"); $table->setDimensions(6, 4); $ship = $this->get_shipping(); $table->addColumn('country', 'Country'); $table->addColumn('avg_time', 'Average Time'); $table->addMultipleRows($this->PolulateData($ship)); $this->addComponent($table); $goods = new ChartComponent('goods_sold'); $goods->setCaption("Cost of Goods Sold"); $goods->setDimensions(12, 6); $yearArr = $this->get_yearName(); $goods->setLabels(ArrayUtils::pluck($yearArr, 'payment_year')); $goods->setYAxis("Sales", array("numberHumanize" => true, 'numberPrefix' => "\$")); $goodsSoldData = $this->get_goodsSold(); foreach ($goodsSoldData as $key => $value) { $goods->addSeries($key, $key, ArrayUtils::pluck($value, "total_amount"), array('numberPrefix' => "\$", 'seriesStacked' => true)); } $this->addComponent($goods); }
<?php define("BYPASS_INSTANCE_CHECK", false); require_once "../../../server/bootstrap.php"; $page = new GerenciaComponentPage(); $page->addComponent(new TitleComponent("Billetes")); $page->addComponent(new MessageComponent("Lista de billetes")); $tabla = new TableComponent(array("nombre" => "Nombre", "valor" => "Valor", "id_moneda" => "Moneda", "foto_billete" => "Foto"), EfectivoController::ListaBillete()); function funcion_moneda($id_moneda) { return MonedaDAO::getByPK($id_moneda) ? MonedaDAO::getByPK($id_moneda)->getNombre() : "-----"; } $tabla->addColRender("id_moneda", "funcion_moneda"); $tabla->addOnClick("id_billete", "(function(a){ window.location = 'efectivo.billete.ver.php?bid=' + a; })"); $page->addComponent($tabla); $page->render();
<?php require_once '../../../server/bootstrap.php'; $page = new GerenciaComponentPage(); $page->addComponent(new TitleComponent("Categorias de Productos")); $page->addComponent("<div class='POS Boton' onClick='window.location=\"productos.categoria.nueva.php\"'>Crear</div>"); // Lista $categorias = ProductosController::BuscarCategoria(); $table = new TableComponent(array('nombre_completo' => '<b>Nombre completo</b>'), $categorias['categorias']); $table->addOnClick("id_clasificacion_producto", "(function(a){window.location = 'productos.categoria.ver.php?id='+a;})"); $page->addComponent($table); $page->render();
<?php define("BYPASS_INSTANCE_CHECK", false); require_once "../../../server/bootstrap.php"; $page = new GerenciaComponentPage(); $page->addComponent(new TitleComponent("Sucursales")); $sucursales = SucursalesController::Buscar(); $tabla = new TableComponent(array("descripcion" => "Descripcion", "id_gerente" => "Gerente", "activa" => "Activa"), $sucursales["resultados"]); $tabla->addColRender("id_gerente", "funcion_gerente"); $tabla->addColRender("activa", "funcion_activa"); $tabla->addOnClick("id_sucursal", "(function(a){window.location = 'sucursales.ver.php?sid='+a;})"); $page->addComponent($tabla); $page->render();
$btn_eliminar->addName("eliminar"); $funcion_eliminar = " function eliminar_sucursal(btn){" . "if(btn == 'yes')" . "{" . "var p = {};" . "p.id_tipo_almacen = " . $_GET["tid"] . ";" . "sendToApi_eliminar(p);" . "}" . "}" . " " . "function confirmar(){" . " Ext.MessageBox.confirm('Eliminar', 'Desea eliminar este tipo de almacen?', eliminar_sucursal );" . "}"; $btn_eliminar->addOnClick("confirmar", $funcion_eliminar); $menu->addMenuItem($btn_eliminar); } $page->addComponent($menu); // // Forma de producto // $form = new DAOFormComponent($este_tipo_almacen); $form->setEditable(false); $form->hideField(array("id_tipo_almacen", "activo")); $page->addComponent($form); $page->addComponent(new TitleComponent("Almacenes con este tipo de almacen")); $r = AlmacenesController::Buscar(null, null, null, $_GET["tid"]); $tabla = new TableComponent(array("nombre" => "Nombre", "id_sucursal" => "Sucursal", "id_empresa" => "Empresa", "activo" => "Activo"), $r['resultados']); function funcion_sucursal($id_sucursal) { return SucursalDAO::getByPK($id_sucursal) ? SucursalDAO::getByPK($id_sucursal)->getRazonSocial() : "------"; } function funcion_empresa($id_empresa) { return EmpresaDAO::getByPK($id_empresa) ? EmpresaDAO::getByPK($id_empresa)->getRazonSocial() : "------"; } function funcion_activo($activo) { return $activo ? "Activo" : "Inactivo"; } $tabla->addColRender("id_sucursal", "funcion_sucursal"); $tabla->addColRender("id_empresa", "funcion_empresa"); $tabla->addColRender("id_tipo_almacen", "funcion_tipo_almacen");
<?php define("BYPASS_INSTANCE_CHECK", false); require_once "../../../server/bootstrap.php"; $page = new GerenciaComponentPage(); $page->addComponent(new TitleComponent("Impuestos")); $tabla = new TableComponent(array("id_impuesto" => "ID", "nombre" => "Nombre", "descripcion" => "Descripcion", "codigo" => "Codigo", "importe" => "Importe", "tipo" => "Tipo", "aplica" => "Aplica", "incluido" => "Incluido", "activo" => "Activo"), ImpuestoDAO::getAll()); function funcion_es_monto($es_monto) { return $es_monto ? "Si" : "No"; } $tabla->addColRender("es_monto", "funcion_es_monto"); $tabla->addOnClick("id_impuesto", "(function(a){window.location = 'impuestos.impuesto.ver.php?iid='+a;})"); $page->addComponent($tabla); $page->render();
public function buildDashboard() { $this->setDashboardTitle("Sales Dashboard"); $this->setActionPath("/static/transfer/build/tour/motherboard_action.php"); // $yearwise = new ChartComponent ('yearly_sales'); // $yearwise->setCaption ("Yearly Sales"); // $yearwise->setDimensions (6, 6); // $yearData = $this->get_year(); // $yearwise->setLabels(ArrayUtils::pluck($yearData, 'payment_year')); // $yearwise->setYAxis("Sales", array( // "numberHumanize" => true, // 'numberPrefix' => "$" // )); // $totalSalesArr = ArrayUtils::pluck($yearData, "total_amount"); // $yearwise->addSeries ("sales", "Sales", $totalSalesArr, array( // 'numberPrefix' => "$" // )); // $yearwise->addDrillStep("get_monthwise", $this); // $yearwise->addDrillStep("get_daywise", $this); // $totalSales = 0; // foreach ($totalSalesArr as $key => $value) { // $totalSales += $value; // } // $yearwise->addComponentKPI("sales", array( // "caption" => "Total Sales", // "value" => $totalSales, // "numberPrefix" => "$", // "numberHumanize" => true // )); // $yearwise->addComponentKPI("second", array( // "caption" => "Revenue", // "value" => $totalSales, // "numberPrefix" => "$", // "numberHumanize" => true // )); // $this->addComponent ($yearwise); $category = new ChartComponent('category'); $category->setCaption("Category wise Sales"); $category->setDimensions(6, 6); $categoryData = $this->get_category(); $quantityData = $this->get_units(); $category->setLabels(ArrayUtils::pluck($categoryData, 'CategoryName')); $category->setYAxis("Sales", array("numberHumanize" => true, 'numberPrefix' => "\$")); $totalSalesArr = ArrayUtils::pluck($categoryData, "total_amount"); $category->addSeries("sales", "Sales", $totalSalesArr, array('numberPrefix' => "\$")); $category->addYAxis('unitsAx', "Units in Inventory", array()); $totalUnitsArr = ArrayUtils::pluck($quantityData, "total_quantity"); $category->addSeries("units", "Units in Inventory", $totalUnitsArr, array("seriesDisplayType" => "line", "yAxis" => 'unitsAx')); $category->addDrillStep("get_prod", $this); $category->addComponentKPI("cost", array("caption" => "Total Sales", "value" => $this->get_cost_inventory(), "numberPrefix" => "\$")); $category->addComponentKPI("units", array("caption" => "Total Units in Inventory", "value" => $this->get_unit_inventory())); $this->addComponent($category); $chart = new ChartComponent("Customer_satisfaction"); $chart->setCaption("Customer Satisfaction"); $chart->setDimensions(6, 6); $chart->setLabels(["Very Unsatisfied", "UnSatisfied", "Neutral", "Satisfied", "Very Satisfied"]); $chart->setPieValues([4, 10, 25, 25, 36], array("numberSuffix" => "%")); $this->addComponent($chart); $table = new TableComponent('table'); $table->setCaption("Average Shipping Time"); $table->setDimensions(6, 6); $ship = $this->get_shipping(); $table->addColumn('country', 'Country'); $table->addColumn('avg_time', 'Average Time', array("textAlign" => "right")); $table->addMultipleRows($this->PolulateData($ship)); $table->setRowsPerPage(12); $this->addComponent($table); $goods = new ChartComponent('goods_sold'); $goods->setCaption("Cost of Goods Sold"); $goods->setDimensions(6, 6); $yearArr = $this->get_yearName(); $goods->setLabels(ArrayUtils::pluck($yearArr, 'payment_year')); $goods->setYAxis("Sales", array("numberHumanize" => true, 'numberPrefix' => "\$")); $goodsSoldData = $this->get_goodsSold(); foreach ($goodsSoldData as $key => $value) { $goods->addSeries($key, $key, ArrayUtils::pluck($value, "total_amount"), array('numberPrefix' => "\$", 'seriesStacked' => true)); } $this->addComponent($goods); }
$t->addColRender("activa", "FormatBoolean"); $t->addColRender("pos_instance", "FormatBoolean"); function FormatBoolean($activa) { if ($activa === "0") { return "<font style = \"color:red;\">no</font>"; } if ($activa === "1") { return "sí"; } return "undefined"; } $p->addComponent($t); if (!empty($instancia["request"])) { $p->addComponent(new TitleComponent("Request", 3)); $tt = new TableComponent(array("id_request" => "Id", "email" => "Email", "fecha" => "Fecha", "ip" => "Ip", "date_validated" => "Validado", "date_installed" => "Instalado"), array($instancia["request"])); $tt->addColRender("fecha", "FormatTime"); $tt->addColRender("date_validated", "FormatTime"); $tt->addColRender("date_installed", "FormatTime"); $p->addComponent($tt); } $p->partialRender(); ?> <script> var eliminarInstancia = function() { var answer = confirm("¿En verdad quiere eliminar la instancia? Tenga en cuenta que se eliminara la instalacion de la BD 'pos_instance'") if (answer){ window.location = "instancias.ver.php?id=<?php echo $_GET['id'];
<?php define("BYPASS_INSTANCE_CHECK", false); require_once "../../../server/bootstrap.php"; $page = new GerenciaComponentPage(); $page->addComponent(new TitleComponent("Ordenes de servicio")); $page->addComponent(new MessageComponent("Lista de ordenes de servicio")); $ordenes = ServiciosController::ListaOrden(); $tabla = new TableComponent(array("fecha_orden" => "Fecha Orden", "id_servicio" => "Servicio", "id_usuario_venta" => "Cliente"), $ordenes["resultados"]); $tabla->addColRender("activa", "funcion_activa"); $tabla->addColRender("cancelada", "funcion_cancelada"); $tabla->addColRender("id_servicio", "funcion_servicio"); $tabla->addColRender("id_usuario_venta", "funcion_usuario_venta"); $tabla->addOnClick("id_orden_de_servicio", "(function(a){ window.location = 'servicios.detalle.orden.php?oid=' + a; })"); $page->addComponent($tabla); $page->render();
<?php define("BYPASS_INSTANCE_CHECK", false); require_once "../../../server/bootstrap.php"; $page = new GerenciaComponentPage(); $page->addComponent(new TitleComponent("Proveedores")); $page->addComponent(new MessageComponent("Lista de proveedores")); $proveedoresLista = ProveedoresController::Lista(); $tabla = new TableComponent(array("nombre" => "Nombre", "id_categoria_contacto" => "Clasificacion de proveedor", "activo" => "Activo", "consignatario" => "Consignatario"), $proveedoresLista["resultados"]); $tabla->addColRender("id_categoria_contacto", "funcion_clasificacion_proveedor"); $tabla->addColRender("activo", "funcion_activo"); $tabla->addColRender("consignatario", "funcion_consignatario"); $tabla->addOnClick("id_usuario", "(function(a){ window.location = 'proveedores.ver.php?pid=' + a; })"); $page->addComponent($tabla); $page->render();
function addRow($var_args) { $row = array(); $n_args = func_num_args(); for ($ai = 0; $ai < $n_args; $ai++) { array_push($row, func_get_arg($ai)); } parent::addRow($row); }
<?php if (!class_exists("PHPUnit_Runner_Version")) { define("BYPASS_INSTANCE_CHECK", false); require_once "../../../server/bootstrap.php"; } $page = new ClienteComponentPage("Bienvendio a POS ERP"); $banner = new BannerComponent("POS ERP", "Bienvenido a POS ERP <br>un sistema de gestion empresarial", "../../../media/EAbydW1M_XR.png"); $page->addComponent($banner); //buscar si tiene ordenes de servico a su nombre $sesion_actual = SesionController::Actual(); $ordenes_array = new OrdenDeServicio(array("id_usuario_venta" => $sesion_actual["id_usuario"])); $ordenes = OrdenDeServicioDAO::search($ordenes_array); if (sizeof($ordenes) > 0) { $page->addComponent(new TitleComponent("Sus ordenes de servicio", 2)); $table = new TableComponent(array("id_servicio" => "Servicio", "fecha_orden" => "Fecha"), $ordenes); function renderIdServicio($id) { $serv = ServicioDAO::getByPK($id); return $serv->getNombreServicio(); } $table->addColRender("fecha_orden", "FormatTime"); $table->addOnClick("id_orden_de_servicio", "(function(a){ window.location = 'servicios.detalle.orden.php?oid='+a; })"); $table->addColRender("id_servicio", "renderIdServicio"); $page->addComponent($table); } $page->render();
<?php define("BYPASS_INSTANCE_CHECK", false); require_once "../../../server//bootstrap.php"; $page = new GerenciaComponentPage(); $page->addComponent(new TitleComponent("Ingresos")); $page->addComponent(new MessageComponent("Lista de ingresos ")); $lista = CargosYAbonosController::ListaIngreso(); $tabla = new TableComponent(array("id_ingreso" => "id_ingreso", "id_empresa" => "id_empresa", "id_usuario" => "id_usuario", "id_concepto_ingreso" => "concpto", "fecha_del_ingreso" => "fecha", "monto" => "monto"), $lista["resultados"]); function funcion_cancelado($cancelado) { return $cancelado ? "Cancelado" : "Activo"; } $tabla->addColRender("cancelado", "funcion_cancelado"); $tabla->addOnClick("id_ingreso", "(function(a){ window.location = 'cargos_y_abonos.lista.ingreso.php'; })"); $page->addComponent($tabla); $page->render();
<?php define("BYPASS_INSTANCE_CHECK", false); require_once "../../../server/bootstrap.php"; $page = new GerenciaComponentPage(); $page->addComponent(new TitleComponent("Empresas")); $lista_empresas = EmpresasController::Buscar($activa = false, $limit = null, $order = "DESC", $order_by = "id_empresa", $query = null, $start = null); $tabla = new TableComponent(array("id_empresa" => "Id", "razon_social" => "Razon Social", "rfc" => "RFC", "fecha_alta" => "Fecha Alta", "activo" => "Activa"), $lista_empresas["resultados"]); $tabla->addColRender("activo", "funcion_activa"); $tabla->addColRender("fecha_alta", "FormatTime"); $tabla->addOnClick("id_empresa", "(function(a){window.location = 'empresas.ver.php?eid='+a;})"); $tabla->addNoData("No hay ninguna empresa registrada. <a href='empresas.nuevo.php'>¿ Tal vez desee crear una ahora ?</a>"); $page->addComponent($tabla); $page->render();
<?php define("BYPASS_INSTANCE_CHECK", false); require_once "../../../server/bootstrap.php"; $page = new GerenciaComponentPage(); $page->addComponent(new TitleComponent("Productos")); $page->addComponent(new MessageComponent("Lista de productos en sus empresas")); $tabla = new TableComponent(array("codigo_producto" => "codigo_producto", "nombre_producto" => "nombre_producto", "descripcion" => "descripcion", "activo" => "activo"), ProductosController::Lista()); $tabla->addColRender("activo", "funcion_activo"); $tabla->addOnClick("id_producto", "(function(a){ window.location = 'productos.ver.php?pid=' + a; })"); $page->addComponent($tabla); $page->render();
<?php define("BYPASS_INSTANCE_CHECK", false); require_once "../../../server//bootstrap.php"; $page = new GerenciaComponentPage(); $page->addComponent(new TitleComponent("Clientes")); $page->addComponent(new MessageComponent("Lista de clientes")); $cselector = new ClienteSelectorComponent(); $cselector->addJsCallback("(function(a){ window.location = 'clientes.ver.php?cid='+a.get('id_usuario'); })"); $page->addComponent($cselector); $lista = ClientesController::Buscar(); $tabla = new TableComponent(array("nombre" => "Nombre", "activo" => "Activo", "saldo_del_ejercicio" => "Saldo"), $lista["resultados"]); $tabla->addColRender("saldo_del_ejercicio", "FormatMoney"); /* function funcion_clasificacion_cliente($id_clasificacion_cliente){ return (ClasificacionClienteDAO::getByPK($id_clasificacion_cliente) ? ClasificacionClienteDAO::getByPK($id_clasificacion_cliente)->getNombre() : "----" ); } */ function funcion_activo($activo) { return $activo ? "Activo" : "Inactivo"; } function funcion_consignatario($consignatario) { return $consignatario ? "Consignatario" : "----"; } //$tabla->addColRender("id_clasificacion_cliente", "funcion_clasificacion_cliente"); $tabla->addColRender("activo", "funcion_activo"); $tabla->addColRender("consignatario", "funcion_consignatario"); $tabla->addOnClick("id_usuario", "(function(a){ window.location = 'clientes.ver.php?cid=' + a; })");
function toDate($unix_time) { if (strlen($unix_time) == 0) { return ''; } return FormatTime($unix_time); return $unix_time; return date('F jS h:i:s a', $unix_time); } function toBold($f, $row) { return "<h3 style='margin:0px; padding:0px'>" . $row['title'] . '</h3>'; } $table->addColRender('start_time', 'toDate'); $table->addColRender('finish_time', 'toDate'); $table->addColRender('alias', 'toBold'); $table->addOnClick('alias', "(function(alias){window.location ='contest.php?alias='+alias;})"); $page->addComponent($table); $page->nextTab('Nuevo'); $page->addComponent(new NewContestFormComponent()); $a = new Contests(array('finish_time' => '1970-01-01 00:00:00')); $b = new Contests(array('finish_time' => date('c'))); $rows = ContestsDAO::byRange($a, $b); $table = new TableComponent($header, $rows); $page->nextTab('Pasados'); $table->addColRender('start_time', 'toDate'); $table->addColRender('finish_time', 'toDate'); $table->addColRender('alias', 'toBold'); $table->addOnClick('alias', "(function(alias){window.location ='contest.php?alias='+alias;})"); $page->addComponent($table); $page->render();
<?php define("BYPASS_INSTANCE_CHECK", false); require_once "../../../server/bootstrap.php"; $page = new GerenciaComponentPage(); $page->addComponent(new TitleComponent("Clasificaciones de Servicio")); $page->addComponent(new MessageComponent("Lista de clasificaciones de servicio")); $tabla = new TableComponent(array("nombre" => "Nombre", "garantia" => "Garantia", "descripcion" => "Descripcion", "activa" => "Activa"), ClasificacionServicioDAO::getAll()); $tabla->addColRender("activa", "funcion_activa"); $tabla->addOnClick("id_clasificacion_servicio", "(function(a){ window.location = 'servicios.clasificacion.ver.php?cid=' + a; })"); $page->addComponent($tabla); $page->render();