当前位置: 首页>>代码示例>>PHP>>正文


PHP DataForm::script方法代码示例

本文整理汇总了PHP中DataForm::script方法的典型用法代码示例。如果您正苦于以下问题:PHP DataForm::script方法的具体用法?PHP DataForm::script怎么用?PHP DataForm::script使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataForm的用法示例。


在下文中一共展示了DataForm::script方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: anuales

    function anuales()
    {
        $this->rapyd->load("datagrid2");
        $this->rapyd->load("dataform");
        $this->load->helper('openflash');
        $script = '
		$(function() {
			$(".inputnum").numeric(".");
		});
		';
        if ($this->uri->segment(4)) {
            $anio = $this->uri->segment(4);
        } elseif (isset($_POST['anio'])) {
            $anio = $_POST['anio'];
        }
        if (empty($anio)) {
            $anio = date("Y");
        }
        $fechai = $anio . '0101';
        $fechaf = $anio . '1231';
        $filter = new DataForm('ventas/productos/anuales');
        $filter->title('Filtro de Ventas Anuales');
        $filter->script($script, "create");
        $filter->script($script, "modify");
        $filter->anio = new inputField("Año", "anio");
        $filter->anio->size = 4;
        $filter->anio->insertValue = $anio;
        $filter->anio->rule = "max_length[4]";
        $filter->anio->rule = "trim";
        $filter->anio->css_class = 'inputnum';
        $filter->button("btnsubmit", "Buscar", form2uri(site_url('ventas/productos/anuales/'), array('anio')), $position = "BL");
        $filter->build_form();
        $grid = new DataGrid2();
        $select = array("a.codigo", "b.descrip AS nombre", "a.cantidad AS cantidad", "SUM(a.venta)AS grantotal", "COUNT(*) AS numfac");
        $grid->db->select($select);
        $grid->db->from("costos AS a");
        $grid->db->join("sinv AS b", "a.codigo=b.codigo");
        $grid->db->where('fecha >= ', $fechai);
        $grid->db->where('fecha <= ', $fechaf);
        $grid->db->groupby("a.codigo");
        $grid->db->orderby("grantotal DESC");
        $grid->per_page = 15;
        $grid->column("Producto", "nombre", "align='left'");
        $grid->column("Total", "<number_format><#grantotal#>|2|,|.</number_format>", 'align=right');
        $grid->column("Cantidad", "<number_format><#cantidad#>|2|,|.</number_format>", 'align=right');
        $grid->column("Cant. Fact", "numfac", 'align=right');
        $grid->totalizar('grantotal');
        $grid->build();
        $grafico = open_flash_chart_object(680, 450, site_url("ventas/productos/ganuales/{$anio}/"));
        $data['content'] = $grafico;
        $data['content'] .= $filter->output . $grid->output;
        $data["head"] = script("jquery.pack.js") . script("plugins/jquery.numeric.pack.js") . script("plugins/jquery.floatnumber.js") . $this->rapyd->get_head();
        $data['title'] = $this->rapyd->get_head() . "<h1>Ventas Anuales</h1>";
        $this->load->view('view_ventanas', $data);
    }
开发者ID:codethics,项目名称:proteoerp,代码行数:55,代码来源:productos.php

示例2: anuales

    function anuales()
    {
        $this->rapyd->load("datagrid2");
        $this->rapyd->load("dataform");
        $this->load->helper('openflash');
        $script = '
		$(function() {
			$(".inputnum").numeric(".");
		});
		';
        if ($this->uri->segment(4)) {
            $anio = $this->uri->segment(4);
        } elseif (isset($_POST['anio'])) {
            $anio = $_POST['anio'];
        }
        if (empty($anio)) {
            $anio = date("Y");
        }
        $fechai = $anio . '0101';
        $fechaf = $anio . '1231';
        $filter = new DataForm('supermercado/bancos/anuales');
        $filter->title('Filtro de Bancos');
        $filter->script($script, "create");
        $filter->script($script, "modify");
        $filter->anio = new inputField("A&ntilde;o", "anio");
        $filter->anio->size = 4;
        $filter->anio->insertValue = $anio;
        $filter->anio->maxlength = 4;
        $filter->anio->rule = "trim";
        $filter->anio->css_class = 'inputnum';
        $filter->button("btnsubmit", "Buscar", form2uri(site_url('supermercado/bancos/anuales'), array('anio')), $position = "BL");
        $filter->build_form();
        $grid = new DataGrid2();
        $select = array("a.fecha", "a.concep", "b.banco", "SUM(a.monto)AS grantotal", "SUM(a.transac)AS transacciones");
        $grid->db->select($select);
        $grid->db->from("est_pago as a");
        $grid->db->join("banc as b", "a.concep=b.codbanc");
        $grid->db->where('fecha >= ', $fechai);
        $grid->db->where('fecha <= ', $fechaf);
        $grid->db->groupby("a.concep");
        $grid->db->orderby("grantotal DESC");
        $grid->column("Banco", "banco", "align='left'");
        $grid->column("Total", "<number_format><#grantotal#>|2|,|.</number_format>", 'align=right');
        $grid->column("Cant.Transac", "transacciones", 'align=right');
        $grid->totalizar('grantotal');
        $grid->build();
        //echo $grid->db->last_query();
        $grafico = open_flash_chart_object(720, 450, site_url("supermercado/bancos/ganuales/{$anio}/"));
        $data['content'] = $grafico;
        $data['content'] .= $filter->output . $grid->output;
        $data["head"] = script("jquery.pack.js") . script("plugins/jquery.numeric.pack.js") . script("plugins/jquery.floatnumber.js") . $this->rapyd->get_head();
        $data['title'] = $this->rapyd->get_head() . "<h1>Tipos de Bancos</h1>";
        $this->load->view('view_ventanas', $data);
    }
开发者ID:codethics,项目名称:proteoerp,代码行数:54,代码来源:bancos.php

示例3: index

    function index()
    {
        $this->rapyd->load("datagrid", "dataform");
        $this->load->helper('openflash');
        $anio = $this->uri->segment(4);
        if (empty($anio)) {
            $anio = date("Y");
        }
        $script = '
			$(function() {
				$(".inputnum").numeric(".");
			});
			';
        $filter = new DataForm();
        $filter->title('Filtro de An&aacute;lisis de Ventas');
        $filter->script($script, "create");
        $filter->script($script, "modify");
        $filter->anio = new inputField("A&ntilde;o", "anio");
        $filter->anio->size = 4;
        $filter->anio->insertValue = $anio;
        $filter->anio->maxlength = 4;
        $filter->anio->rule = "trim";
        $filter->anio->css_class = 'inputnum';
        $filter->button("btnsubmit", "Buscar", form2uri(site_url('/supermercado/analisis/index'), array('anio')), $position = "BL");
        $filter->build_form();
        $link = "supermercado/analisis/departamento/<#depto#>/{$anio}";
        $select = array('a.fecha', 'a.depto', 'a.familia', 'a.grupo', 'a.codigo', 'a.impuesto', 'a.monto', 'a.cantidad', 'a.transac', 'a.tipo', 'b.descrip');
        $grid = new DataGrid('Ventas por Departamentos');
        $grid->column("Departamento", anchor($link, '<#descrip#>'), 'nowrap=yes');
        for ($i = 1; $i <= 12; $i++) {
            $nmes = $this->calendar->get_month_name(str_pad($i, 2, "0", STR_PAD_LEFT));
            $grid->column($nmes, "<nformat><#m{$i}#></nformat>", 'align=right');
            $select[] = "sum(a.monto*(month(a.fecha)={$i}))  AS m{$i}";
        }
        $grid->db->select($select);
        $grid->db->from('est_item  AS a');
        $grid->db->join('dpto  AS b', 'a.depto=b.depto');
        $grid->db->where('YEAR(a.fecha)', $anio);
        $grid->db->where("a.tipo", 'I');
        $grid->db->groupby('a.depto');
        $grid->build();
        //echo  $grid->db->last_query();
        $data['content'] = $filter->output . '<div style="overflow: auto; width: 100%;">' . $grid->output . '</div>';
        $data['title'] = "<h1>An&aacute;lisis de Ventas</h1>";
        $data["head"] = script("jquery.pack.js") . script("plugins/jquery.numeric.pack.js") . script("plugins/jquery.floatnumber.js") . $this->rapyd->get_head();
        $this->load->view('view_ventanas', $data);
    }
开发者ID:codethics,项目名称:proteoerp,代码行数:47,代码来源:analisis.php

示例4: sel

    function sel()
    {
        $this->rapyd->load("dataform");
        //echo $this->flongpres;
        //$script='
        //$(function() {
        //
        //		$("#codigoadm").change(function(){
        //			$.post("'.site_url('presupuesto/presupsoli/get_tipo').'",{ codigoadm:$("#codigoadm").val() },function(data){$("#tipo").html(data);})
        //		});
        //
        //		$("#tipo").change(function(){
        //			$.post("'.site_url('presupuesto/presupsoli/get_estrupres').'",{ tipo:$("#tipo").val(),codigoadm:$("#codigoadm").val() },function(data){$("#codigopres").html(data);})
        //		});
        //
        //});
        //';
        $script = '
		$(function() {

				$("#codigoadm").change(function(){
					$.post("' . site_url('presupuesto/presusol/get_tipo') . '",{ codigoadm:$("#codigoadm").val() },function(data){$("#tipo").html(data);})
				});

				$("#tipo").change(function(){
					$.post("' . site_url('presupuesto/presusol/get_estrupres') . '",{ codigoadm:$("#codigoadm").val(),tipo:$("#tipo").val() },function(data){$("#codigopres").html(data);})
				});
				
		});
		';
        $flong = $this->flongpres;
        $rlong = $this->flongadm;
        $filter = new DataForm("presupuesto/presupsoli/sel/process");
        $filter->script($script);
        $filter->codigoadm = new dropdownField("Estructura Administrativa", "codigoadm");
        $filter->codigoadm->option("", "Seleccione");
        $filter->codigoadm->rule = 'required';
        $filter->codigoadm->options("SELECT b.codigo, CONCAT_WS(' ',b.codigo,b.denominacion) AS val FROM presusol AS a JOIN estruadm AS b ON a.codigoadm=b.codigo  GROUP BY b.codigo");
        $filter->tipo = new dropdownField('Origen de fondos', 'tipo');
        $filter->tipo->option("", "Seleccione una Estructura Administrativa");
        $filter->tipo->rule = 'required';
        $filter->codigopres = new dropdownField("Presupuesto", "codigopres");
        $filter->codigopres->option("", "Seleccione un presupuesto");
        $filter->submit("btnsubmit", "Buscar");
        $filter->build_form();
        if ($filter->on_success()) {
            $ttipo = $filter->tipo->newValue;
            $codamd = $filter->codigoadm->newValue;
            $codpre = $filter->codigopres->newValue;
            redirect("presupuesto/presupsoli/asignar/{$ttipo}/{$codamd}/{$codpre}");
        }
        $data['content'] = $filter->output;
        $data['title'] = "Presupuesto Estimado";
        $data["head"] = script("jquery.js") . $this->rapyd->get_head();
        $this->load->view('view_ventanas', $data);
    }
开发者ID:enderochoa,项目名称:tortuga,代码行数:56,代码来源:presupsoli.php

示例5: index

    function index()
    {
        $this->rapyd->load('dataform');
        $lscst = site_url('compras/scst/autocomplete/control');
        $script = '
		function formato(row) {
			return row[0]+" "+row[1]+" "+row[3];
		}

		$(function() {
			$("#control").autocomplete("' . $lscst . '",{
				delay:10,
				//minChars:2,
				matchSubset:1,
				matchContains:1,
				cacheLength:10,
				formatItem:formato,
				width:450,
				autoFill:true
				}
			);
		});';
        $form = new DataForm($this->url . 'index/process');
        $form->title('Pasar precios a cajas');
        $form->script($script);
        $form->control = new inputField('Control de compra', 'control');
        $form->control->rule = 'required|callback_chcontrol';
        $form->control->size = 12;
        $form->control->maxlength = 10;
        $form->control->append('Dejar vacio para enviar un masivo');
        $form->submit("btnsubmit", "Pasar precios a caja");
        $form->build_form();
        $error = '';
        if ($form->on_success()) {
            $control = $form->control->newValue;
            $usr = $this->session->userdata('usuario');
            $join = '';
            if (strlen($control > 0)) {
                $join = 'JOIN `itscst` AS b ON a.codigo=b.codigo AND b.codigo=' . $this->db->escape($control);
            }
            $mSQL = "INSERT INTO `enviapos` (codigo,numero,precio1,fecha,hora,usuario)\n\t\t\t\t  SELECT a.codigo,'INVENTAR',a.precio1,CURDATE(),CURTIME(),'{$usr}' FROM `maes` AS a {$join}";
            $ban = $this->db->simple_query($mSQL);
            if (!$ban) {
                $error .= "Hubo problemas al pasar los precios, comuniquese con servicio t&eacute;cnico";
                memowrite($mSQL, 'ENVIACAJA');
            } else {
                logusu('ENVIACAJA', "Fue enviado una actualizacion de precios");
            }
        }
        $data['content'] = "<div class='alert'>{$error}</div>";
        $data['content'] .= $form->output;
        $data['title'] = '<h1>Env&iacute;o de precios para las cajas</h1>';
        $data["head"] = script('jquery.pack.js') . script('plugins/jquery.autocomplete.js') . style('jquery.autocomplete.css') . $this->rapyd->get_head();
        $this->load->view('view_ventanas', $data);
    }
开发者ID:codethics,项目名称:proteoerp,代码行数:55,代码来源:enviacaja.php

示例6: DataForm

    function precios2()
    {
        $this->rapyd->load("dataform", "datatable");
        $cod = $this->uri->segment(4);
        $script = '
		$("#codigo").focus();
			$(document).ready(function() {
				$("a").fancybox();
				$("#codigo").attr("value", "");
				$("#codigo").focus();
			});

		$("#df1").submit(function() {
					valor=$("#codigo").attr("value");
					location.href="' . site_url('supermercado/consultas/precios2') . '/"+valor;
					return false;
				});

		';
        $form = new DataForm();
        $form->script($script);
        $form->codigo = new inputField("C&oacute;digo", "codigo");
        $form->codigo->size = 20;
        $form->codigo->insertValue = '';
        $form->codigo->append('Presente el articulo frente al lector de codigo de barras o escriba directamente algun codigo de identificacion y luego presione ENTER');
        $form->build_form();
        $contenido = $form->output;
        if (!empty($cod)) {
            $data2 = $this->rprecios($cod);
            if ($data2) {
                $contenido .= $this->load->view('view_rprecios', $data2, true);
            } else {
                $t = array();
                $t[1][1] = "<b>PRODUCTO NO REGISTRADO</b>";
                $t[2][1] = "";
                $t[3][1] = "<b>Por Favor introduzca un Codigo de identificaci&oacute;n del Producto</b>";
                $t[4][1] = "Presente el producto en el lector de codigo de barras";
                $t[5][1] = "o escriba directamente algun codigo de identificacion y luego presione ENTER";
                $table = new DataTable(null, $t);
                $table->cell_attributes = 'style="vertical-align:middle; text-align: center;"';
                $table->per_row = 1;
                $table->cell_attributes = '';
                //$t[2][1]="";style="vertical-align:top;"
                $table->cell_template = "<div style='color:red;' align='center'><#1#></div></br>";
                $table->build();
                $contenido .= $table->output;
            }
        } else {
            //$data['content'] = $form->output;
        }
        $data['content'] = $contenido;
        $data["head"] = script("jquery.js") . script("plugins/jquery.fancybox.pack.js") . script("plugins/jquery.easing.js") . style('fancybox/jquery.fancybox.css') . style("ventanas.css") . style("estilos.css") . $this->rapyd->get_head();
        $this->load->view('view_ventanas', $data);
    }
开发者ID:codethics,项目名称:proteoerp,代码行数:54,代码来源:consultasan.php

示例7: sel

    function sel()
    {
        $this->rapyd->load("dataform");
        //echo $this->flongpres;
        $script = '
		$(function() {
				$("#codigoadm").change(function(){
					$.post("' . site_url('presupuesto/presupuesto/get_tipo') . '",{ codigoadm:$("#codigoadm").val() },function(data){$("#tipo").html(data);})
				});

				
				
		});
		';
        $flong = $this->flongpres;
        $rlong = $this->flongadm;
        $filter = new DataForm("presupuesto/anualcierre/sel/process");
        $filter->script($script);
        $filter->codigoadm = new dropdownField("Estructura Administrativa", "codigoadm");
        $filter->codigoadm->option("", "Seleccione");
        $filter->codigoadm->rule = 'required';
        $filter->codigoadm->options("SELECT b.codigo, CONCAT_WS(' ',b.codigo,b.denominacion) AS val FROM presupuesto AS a JOIN estruadm AS b ON a.codigoadm=b.codigo  GROUP BY b.codigo");
        $filter->tipo = new dropdownField('Origen de fondos', 'tipo');
        $filter->tipo->option("", "Seleccione una Estructura Administrativa");
        $filter->tipo->rule = 'required';
        //$filter->codigopres = new dropdownField("Presupuesto","codigopres");
        //$filter->codigopres->option("","Seleccione un presupuesto");
        //$filter->ano = new inputField("A&ntilde;o","ano");
        //$filter->ano->size=5;
        //$filter->ano->maxlength=4;
        $filter->submit("btnsubmit", "Buscar");
        $filter->build_form();
        if ($filter->on_success()) {
            $tipo = $filter->tipo->newValue;
            $codigoadm = $filter->codigoadm->newValue;
            //$codigopres = $filter->codigopres->newValue;
            //$ano = $filter->ano->newValue;
            redirect("presupuesto/anualcierre/cerrar/{$tipo}/{$codigoadm}/{$codigopres}");
        }
        $data['content'] = $filter->output;
        $data['title'] = "Cierre de Presupuestos";
        $data["head"] = script("jquery.js") . $this->rapyd->get_head();
        $this->load->view('view_ventanas', $data);
    }
开发者ID:enderochoa,项目名称:tortuga,代码行数:44,代码来源:anualcierre.php

示例8: gserchipros

    function gserchipros($codbanc = null)
    {
        if (empty($codbanc)) {
            show_error('Faltan par&aacute;metros');
        }
        $dbcodbanc = $this->db->escape($codbanc);
        $mSQL = 'SELECT COUNT(*) AS cana, SUM(exento+montasa+monadic+monredu+tasa+sobretasa+reducida) AS monto FROM gserchi WHERE ngasto IS NULL AND aceptado="S" AND codbanc=' . $dbcodbanc;
        $r = $this->datasis->damerow($mSQL);
        if ($r['cana'] == 0) {
            show_error('Caja sin gastos');
        }
        $mSQL = "SELECT a.codprv, b.nombre FROM banc AS a JOIN sprv AS b ON a.codprv=b.proveed WHERE a.codbanc={$dbcodbanc}";
        $query = $this->db->query($mSQL);
        if ($query->num_rows() > 0) {
            $row = $query->row();
            $nombre = $row->nombre;
            $codprv = $row->codprv;
        } else {
            $nombre = $codprv = '';
        }
        $sql = 'SELECT TRIM(a.codbanc) AS codbanc,tbanco FROM banc AS a';
        $query = $this->db->query($sql);
        $comis = array();
        if ($query->num_rows() > 0) {
            foreach ($query->result() as $row) {
                $ind = '_' . $row->codbanc;
                $comis[$ind]['tbanco'] = $row->tbanco;
            }
        }
        $json_comis = json_encode($comis);
        $this->rapyd->load('dataform', 'datagrid');
        $modbus = array('tabla' => 'sprv', 'columnas' => array('proveed' => 'C&oacute;digo Proveedor', 'nombre' => 'Nombre', 'rif' => 'RIF'), 'filtro' => array('proveed' => 'C&oacute;digo Proveedor', 'nombre' => 'Nombre'), 'retornar' => array('proveed' => 'codprv', 'nombre' => 'nombre'), 'titulo' => 'Buscar Proveedor');
        $bsprv = $this->datasis->modbus($modbus);
        $script = 'var comis = ' . $json_comis . ';
		
		$(document).ready(function() {
			desactivacampo("");
		});
		
		function desactivacampo(codb1){
			if(codb1.length>0 && codb1!="' . $this->mcred . '"){
				eval("tbanco=comis._"+codb1+".tbanco;"  );
				if(tbanco=="CAJ"){
					$("#cheque").attr("disabled","disabled");
					$("#benefi").attr("disabled","disabled");
				}else{
					$("#cheque").removeAttr("disabled");
					$("#benefi").removeAttr("disabled");
				}
			}else{
				$("#cheque").attr("disabled","disabled");
				$("#benefi").attr("disabled","disabled");
			}
		}';
        $form = new DataForm('finanzas/gser/gserchipros/' . $codbanc . '/process');
        $form->title("N&uacute;mero de facturas aceptadas {$r['cana']}, monto total <b>" . nformat($r['monto']) . '</b>');
        $form->script($script);
        $form->codprv = new inputField('Proveedor', 'codprv');
        $form->codprv->rule = 'required';
        $form->codprv->insertValue = $codprv;
        $form->codprv->size = 5;
        $form->codprv->append($bsprv);
        $form->nombre = new inputField('Nombre', 'nombre');
        $form->nombre->rule = 'required';
        $form->nombre->insertValue = $nombre;
        $form->nombre->in = 'codprv';
        $form->cargo = new dropdownField('Con cargo a', 'cargo');
        $form->cargo->option($this->mcred, 'Cr&eacute;dito');
        $form->cargo->options("SELECT codbanc, CONCAT_WS('-',codbanc,banco) AS label FROM banc WHERE activo='S' ORDER BY codbanc");
        $form->cargo->onchange = 'desactivacampo(this.value)';
        $form->cargo->rule = 'max_length[5]|required';
        $form->cheque = new inputField('N&uacute;mero de cheque', 'cheque');
        $form->cheque->rule = 'condi_required|callback_chobligaban';
        $form->cheque->append('Aplica  solo si el cargo es a un banco');
        $form->benefi = new inputField('Beneficiario', 'benefi');
        $form->benefi->insertValue = $nombre;
        $form->benefi->rule = 'condi_required|callback_chobligaban';
        $form->benefi->append('Aplica  solo si el cargo es a un banco');
        $action = "javascript:window.location='" . site_url('finanzas/gser/cierregserchi/' . $codbanc) . "'";
        $form->button('btn_regresa', 'Regresar', $action, 'BR');
        $form->submit('btnsubmit', 'Procesar');
        $form->build_form();
        $grid = new DataGrid('Lista de Gastos', 'gserchi');
        $select = array('exento + montasa + monadic + monredu + tasa + sobretasa + reducida AS totneto', 'tasa + sobretasa + reducida AS totiva', 'proveedor', 'fechafac', 'numfac', 'codbanc');
        $grid->db->select($select);
        $grid->db->where('aceptado', 'S');
        $grid->db->where('ngasto IS NULL');
        $grid->db->where('codbanc', $codbanc);
        $grid->order_by('numfac', 'desc');
        $grid->per_page = 15;
        $grid->column('Caja', 'codbanc');
        $grid->column('N&uacute;mero', 'numfac');
        $grid->column('Fecha', '<dbdate_to_human><#fechafac#></dbdate_to_human>', 'align=\'center\'');
        $grid->column('Proveedor', 'proveedor');
        $grid->column('IVA', 'totiva', 'align=\'right\'');
        $grid->column('Monto', 'totneto', 'align=\'right\'');
        //$grid->add('finanzas/gser/datagserchi/create','Agregar nueva factura');
        $grid->build();
        if ($form->on_success()) {
            $codprv = $form->codprv->newValue;
//.........这里部分代码省略.........
开发者ID:codethics,项目名称:proteoerp,代码行数:101,代码来源:gsercol.php

示例9: mensuales

    function mensuales($anio = '', $mes = '')
    {
        $this->rapyd->load("datagrid2");
        $this->rapyd->load("dataform");
        $this->load->helper('openflash');
        if (isset($_POST['anio']) and empty($anio)) {
            $anio = $_POST['anio'];
        }
        if (isset($_POST['mes']) and empty($mes)) {
            $mes = $_POST['mes'];
        }
        if (empty($mes)) {
            redirect("supermercado/ventas/anuales/{$anio}");
        }
        $script = '
		$(function() {
			$(".inputnum").numeric(".");
		});
		';
        $fechai = $anio . str_pad($mes, 2, "0", STR_PAD_LEFT) . '01';
        $fechaf = $anio . str_pad($mes, 2, "0", STR_PAD_LEFT) . '31';
        $filter = new DataForm('supermercado/ventas/mensuales');
        $filter->attributes = array('onsubmit' => "this.action='index/'+this.form.mes.value+'/'+this.form.anio.value+'/';return FALSE;");
        $filter->title('Filtro de Ventas Mensuales');
        $filter->script($script, "create");
        $filter->script($script, "modify");
        $filter->mes = new dropdownField("Mes/A&ntilde;o", "mes");
        for ($i = 1; $i < 13; $i++) {
            $filter->mes->option(str_pad($i, 2, '0', STR_PAD_LEFT), str_pad($i, 2, '0', STR_PAD_LEFT));
        }
        $filter->mes->size = 2;
        $filter->mes->style = '';
        $filter->mes->insertValue = $mes;
        $filter->mes->rule = "trim";
        $filter->anio = new inputField("A&ntilde;o", "anio");
        $filter->anio->in = 'mes';
        $filter->anio->size = 4;
        $filter->anio->insertValue = $anio;
        $filter->anio->maxlength = 4;
        $filter->anio->rule = "trim";
        $filter->anio->css_class = 'inputnum';
        $filter->button("btnsubmit", "Buscar", form2uri(site_url('supermercado/ventas/mensuales'), array('anio', 'mes')), $position = "BL");
        $filter->build_form();
        $grid = new DataGrid2();
        $select = array("fecha", "DATE_FORMAT(fecha,'%d') AS dia", "SUM(monto)AS grantotal", "SUM(impuesto)AS iva", "SUM(transac)as transacciones");
        $grid->db->select($select);
        $grid->db->from("est_fecha");
        $grid->db->where('fecha >= ', $fechai);
        $grid->db->where('fecha <= ', $fechaf);
        $grid->db->groupby("fecha");
        $grid->db->orderby("fecha ASC");
        //$grid->db->limit(15,0);
        $grid->column("Dia", "dia", "align='left'");
        $grid->column("Total", "<number_format><#grantotal#>|2|,|.</number_format>", 'align=right');
        $grid->column("Impuesto", "<number_format><#iva#>|2|,|.</number_format>", 'align=right');
        $grid->column("Cant.Transac", "transacciones", 'align=right');
        $grid->totalizar('iva', 'grantotal');
        $grid->build();
        $grafico = open_flash_chart_object(680, 350, site_url("supermercado/ventas/gmensuales/{$anio}/{$mes}"));
        $data['content'] = $grafico;
        $data['content'] .= $filter->output . $grid->output;
        $data["head"] = script("jquery.pack.js") . script("plugins/jquery.numeric.pack.js") . script("plugins/jquery.floatnumber.js") . $this->rapyd->get_head();
        $data['title'] = $this->rapyd->get_head() . "<h1>Ventas Mensuales</h1>";
        $this->load->view('view_ventanas', $data);
    }
开发者ID:codethics,项目名称:proteoerp,代码行数:65,代码来源:ventas.php

示例10: diarias

    function diarias($anio = '', $vendedor = '', $mes = '')
    {
        $this->rapyd->load("datagrid2");
        $this->rapyd->load("dataform");
        $this->load->helper('openflash');
        $script = '
		$(function() {
			$(".inputnum").numeric(".");
		});
		';
        if (isset($_POST['anio']) and empty($anio)) {
            $anio = $_POST['anio'];
        }
        if (isset($_POST['mes']) and empty($mes)) {
            $mes = $_POST['mes'];
        }
        if (isset($_POST['vd']) and empty($vendedor)) {
            $vendedor = $_POST['vd'];
        }
        //if(empty($anio) OR ($vendedor)) redirect("ventas/vendedoresanuales/index/$anio");
        if (empty($mes)) {
            redirect("ventas/vendedores/mensuales/{$anio}/{$vendedor}");
        }
        $fechai = $anio . str_pad($mes, 2, "0", STR_PAD_LEFT) . '01';
        $fechaf = $anio . str_pad($mes, 2, "0", STR_PAD_LEFT) . '31';
        $scli = array('tabla' => 'scli', 'columnas' => array('cliente' => 'C<p align="right">&oacute;</p>digo Vendedor', 'nombre' => 'Nombre', 'contacto' => 'Contacto'), 'filtro' => array('cliente' => 'C&oacute;digo Cliente', 'nombre' => 'Nombre'), 'retornar' => array('cliente' => 'cod_cli'), 'titulo' => 'Buscar Cliente');
        $cboton = $this->datasis->modbus($scli);
        $filter = new DataForm('ventas/vendedores/diarias');
        $filter->attributes = array('onsubmit' => "this.action='index/'+this.form.mes.value+'/'+this.form.anio.value+'/';return FALSE;");
        $filter->title('Filtro de Ventas Diarias');
        $filter->script($script, "create");
        $filter->script($script, "modify");
        $filter->mes = new dropdownField("Mes/A&ntilde;o", "mes");
        for ($i = 1; $i < 13; $i++) {
            $filter->mes->option(str_pad($i, 2, '0', STR_PAD_LEFT), str_pad($i, 2, '0', STR_PAD_LEFT));
        }
        $filter->mes->size = 2;
        $filter->mes->style = '';
        $filter->mes->insertValue = $mes;
        $filter->anio = new inputField("A&ntilde;o", "anio");
        $filter->anio->in = 'mes';
        $filter->anio->size = 4;
        $filter->anio->insertValue = $anio;
        $filter->anio->maxlength = 4;
        $filter->anio->rule = "trim";
        $filter->anio->css_class = 'inputnum';
        $filter->vendedor = new inputField("Vendedor", "vd");
        $filter->vendedor->size = 10;
        $filter->vendedor->insertValue = $vendedor;
        $filter->vendedor->rule = "max_length[4]";
        $filter->vendedor->append($cboton);
        $filter->button("btnsubmit", "Buscar", form2uri(site_url('ventas/vendedores/diarias/'), array('anio', 'vd', 'mes')), $position = "BL");
        $filter->build_form();
        $grid = new DataGrid2();
        $select = array("vd", "DATE_FORMAT(fecha,'%d/%m/%Y') AS fecha", "SUM(totalg*IF(tipo_doc='D', -1, 1)) AS grantotal", "SUM(totalg*IF(tipo_doc='D', -1, 1))/ COUNT(*) AS porcentaje", "SUM(totalg*(referen IN ('E', 'M'))*IF(tipo_doc='D', -1, 1)) as contado", "SUM(totalg*(referen NOT IN ('E', 'M'))*IF(tipo_doc='D', -1, 1)) as credito", "FORMAT(sum(totals*IF(tipo_doc='D',-1,1)),2) AS subtotal", "FORMAT(sum(iva*IF(tipo_doc='D',-1,1)),2) AS impuesto", "COUNT(*) AS numfac");
        $grid->db->select($select);
        $grid->db->from("sfac");
        $grid->db->where('tipo_doc <> ', 'X');
        $grid->db->where('fecha >= ', $fechai);
        $grid->db->where('fecha <= ', $fechaf);
        $grid->db->where('vd ', $vendedor);
        $grid->db->groupby("fecha");
        $grid->column("Dia", "fecha", "align='center'");
        $grid->column("Sub-Total", "<number_format><#subtotal#>|2|,|.</number_format>", 'align=right');
        $grid->column("Impuesto", "<number_format><#impuesto#>|2|,|.</number_format>", 'align=right');
        $grid->column("Total", "<number_format><#grantotal#>|2|,|.</number_format>", 'align=right');
        $grid->column("Contado", "<number_format><#contado#>|2|,|.</number_format>", 'align=right');
        $grid->column("Cr&eacute;dito", "<number_format><#credito#>|2|,|.</number_format>", 'align=right');
        $grid->column("Participaci&oacute;n", "<number_format><#porcentaje#>|2|,|.</number_format>", 'align=right');
        $grid->column("Cant. Fact", "numfac", 'align=right');
        $grid->totalizar('subtotal', 'impuesto', 'grantotal', 'contado', 'credito');
        $grid->build();
        $grafico = open_flash_chart_object(680, 350, site_url("ventas/vendedores/gdiarias/{$anio}/{$vendedor}/{$mes}"));
        $data['content'] = $grafico;
        $data['content'] .= $filter->output . $grid->output;
        $data["head"] = script("jquery.pack.js") . script("plugins/jquery.numeric.pack.js") . script("plugins/jquery.floatnumber.js") . $this->rapyd->get_head();
        $data['title'] = $this->rapyd->get_head() . "<h1>Vendedores</h1>";
        $this->load->view('view_ventanas', $data);
    }
开发者ID:codethics,项目名称:proteoerp,代码行数:79,代码来源:vendedores.php

示例11: mensuales

    function mensuales($anio = '', $cliente = '')
    {
        $this->rapyd->load("datagrid2");
        $this->rapyd->load("dataform");
        $this->load->helper('openflash');
        if (isset($_POST['anio']) and empty($anio)) {
            $anio = $_POST['anio'];
        }
        if (isset($_POST['cod_cli']) and empty($cliente)) {
            $cliente = $_POST['cod_cli'];
        }
        $script = '
		$(function() {
			$(".inputnum").numeric(".");
		});
		';
        if (empty($anio) or empty($cliente)) {
            redirect("ventas/clientes/anuales/{$anio}");
        }
        $fechai = $anio . '0101';
        $fechaf = $anio . '1231';
        $scli = array('tabla' => 'scli', 'columnas' => array('cliente' => 'C&oacute;digo Cliente', 'nombre' => 'Nombre', 'contacto' => 'Contacto'), 'filtro' => array('cliente' => 'C&oacute;digo Cliente', 'nombre' => 'Nombre'), 'retornar' => array('cliente' => 'cod_cli'), 'titulo' => 'Buscar Cliente');
        $cboton = $this->datasis->modbus($scli);
        $filter = new DataForm('ventas/clientes/mensuales');
        $filter->title('Filtro de Ventas Mensuales');
        $filter->script($script, "create");
        $filter->script($script, "modify");
        $filter->anio = new inputField("A&ntilde;o", "anio");
        $filter->anio->size = 4;
        $filter->anio->insertValue = $anio;
        $filter->anio->maxlength = 4;
        $filter->anio->rule = "trim";
        $filter->anio->css_class = 'inputnum';
        $filter->cliente = new inputField("Cliente", "cod_cli");
        $filter->cliente->size = 10;
        $filter->cliente->insertValue = $cliente;
        $filter->cliente->rule = "max_length[4]";
        $filter->cliente->append($cboton);
        $filter->button("btnsubmit", "Buscar", form2uri(site_url('ventas/clientes/mensuales'), array('anio', 'cod_cli')), $position = "BL");
        $filter->build_form();
        $grid = new DataGrid2();
        $select = array("cod_cli,nombre", "fecha", "DATE_FORMAT(fecha,'%m/%Y')AS mes", "SUM(totalg*IF(tipo_doc='D', -1, 1)) AS grantotal", "SUM(totalg*IF(tipo_doc='D', -1, 1))/ COUNT(*) AS porcentaje", "SUM(totalg*(referen IN ('E', 'M'))*IF(tipo_doc='D', -1, 1)) AS contado", "SUM(totalg*(referen NOT IN ('E', 'M'))*IF(tipo_doc='D', -1, 1)) AS credito", "SUM(totals*IF(tipo_doc='D',-1,1))AS subtotal", "SUM(iva*IF(tipo_doc='D',-1,1))AS impuesto", "COUNT(*) AS numfac");
        $grid->db->select($select);
        $grid->db->from("sfac");
        $grid->db->where('tipo_doc<>', 'X');
        $grid->db->where('fecha >= ', $fechai);
        $grid->db->where('fecha <= ', $fechaf);
        $grid->db->where('cod_cli', $cliente);
        $grid->db->groupby("mes");
        $grid->column("Mes", "mes", "align='center'");
        $grid->column("Sub-Total", "<number_format><#subtotal#>|2|,|.</number_format>", 'align=right');
        $grid->column("Impuesto", "<number_format><#impuesto#>|2|,|.</number_format>", 'align=right');
        $grid->column("Total", "<number_format><#grantotal#>|2|,|.</number_format>", 'align=right');
        $grid->column("Contado", "<number_format><#contado#>|2|,|.</number_format>", 'align=right');
        $grid->column("Credito", "<number_format><#credito#>|2|,|.</number_format>", 'align=right');
        $grid->column("Participaci&oacute;n", "<number_format><#porcentaje#>|2|,|.</number_format>", 'align=right');
        $grid->column("Cant. Fact", "numfac", 'align=right');
        $grid->totalizar('impuesto', 'grantotal', 'contado', 'credito', 'subtotal');
        $grid->build();
        $grafico = open_flash_chart_object(750, 350, site_url("ventas/clientes/gmensuales/{$anio}/{$cliente}"));
        $data['content'] = $grafico;
        $data['content'] .= $filter->output . $grid->output;
        $data["head"] = script("jquery.pack.js") . script("plugins/jquery.numeric.pack.js") . script("plugins/jquery.floatnumber.js") . $this->rapyd->get_head();
        $data['title'] = $this->rapyd->get_head() . "<h1>Clientes</h1>";
        $this->load->view('view_ventanas', $data);
    }
开发者ID:codethics,项目名称:proteoerp,代码行数:66,代码来源:clientes.php

示例12: actualizar

    function actualizar($control)
    {
        $this->rapyd->load('dataform');
        $dbcontrol = $this->db->escape($control);
        $script = '$(function(){
			$(".littletableheader").css("width","200px");
			$(".inputnum").numeric(".");
			$("#fecha").datepicker({ dateFormat: "dd/mm/yy" });
			$("#cprecio").change(function(){
				var cprecio=$("#cprecio").val();
				if(cprecio=="S"){
					$("#advs").show();
					$("#advn").hide();
					$("#advd").hide();
				}else if(cprecio=="N"){
					$("#advs").hide();
					$("#advn").show();
					$("#advd").hide();
				}else{
					$("#advs").hide();
					$("#advn").hide();
					$("#advd").show();
				}
				if(cprecio=="M"){
					$("#tr_margens").show();
				}else{
					$("#tr_margens").hide();
				}
			});
			$("#cprecio").change();
		})';
        $form = new DataForm("compras/scst/actualizar/{$control}/process");
        $form->script($script);
        $scstrow = $this->datasis->damerow("SELECT proveed,nombre,fecha,montotot, montoiva,montonet,serie,vence,tipo_doc FROM scst WHERE control={$dbcontrol}");
        if (!empty($scstrow)) {
            $htmltabla = "<table width='100%' style='background-color:#FBEC88;text-align:center;font-size:12px'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>Proveedor:</td>\n\t\t\t\t\t<td><b>(" . htmlspecialchars($scstrow['proveed']) . ")</b></td>\n\t\t\t\t\t<td colspan='4'><b>" . htmlspecialchars($scstrow['nombre']) . "</b></td>\n\t\t\t\t</tr><tr>\n\t\t\t\t\t<td>Documento:</td>\n\t\t\t\t\t<td>" . htmlspecialchars($scstrow['tipo_doc'] . $scstrow['serie']) . "</b></td>\n\t\t\t\t\t<td>Fecha: </td>\n\t\t\t\t\t<td><b>" . dbdate_to_human($scstrow['fecha']) . "</b></td>\n\t\t\t\t\t<td>Vence:</td>\n\t\t\t\t\t<td><b>" . dbdate_to_human($scstrow['vence']) . "</b></td>\n\t\t\t\t</tr><tr>\n\t\t\t\t\t<td>Sub Total:</td>\n\t\t\t\t\t<td><b>" . nformat($scstrow['montotot']) . "</b></td>\n\t\t\t\t\t<td> I.V.A.: </td>\n\t\t\t\t\t<td><b>" . nformat($scstrow['montoiva']) . "</b></td>\n\t\t\t\t\t<td>Monto: </td>\n\t\t\t\t\t<td><b>" . nformat($scstrow['montonet']) . "</b></td>\n\t\t\t\t</tr>\n\t\t\t</table>";
            $form->tablafo = new containerField('tablafo', $htmltabla);
            if (in_array($scstrow['tipo_doc'], array('FC', 'NE'))) {
                $opt_arr = array('D' => array('Dejar el precio mayor', 'Coloca el precio mayor entre el precio en inventario y el nuevo precio seg&uacute;n compra.'), 'M' => array('Obliga Margen', 'Calcula el precio a partir del costo nuevo aplicando el margen suministrado.'), 'N' => array('No', 'Respeta los precios de los productos en inventario e ignora los provenientes de la compra.'), 'S' => array('Si', 'Coloca los precios provenientes de la compra reemplazando los del inventario exepto los productos marcados con la opci&oacute;n de repetar margen a los cuales se les calculara el precio sin modificar sus margenes.'));
                $optstr = $this->datasis->traevalor('SCSTACTUALIOPT', 'Fija las opciones para actualizar compras Ej SND');
                if (!empty($optstr)) {
                    $opt_val = array_unique(str_split(strtoupper($optstr)));
                    $pivo = array_intersect($opt_val, array_keys($opt_arr));
                    if (count($pivo) > 0) {
                        $result = array();
                        foreach ($pivo as $val) {
                            $result[$val] = $opt_arr[$val][0];
                        }
                    }
                } else {
                    foreach ($opt_arr as $id => $val) {
                        $result[$id] = $opt_arr[$id][0];
                    }
                }
                $arr_enum = array();
                $infoview = '';
                foreach ($result as $id => $val) {
                    $arr_enum[] = $id;
                    $infoview .= '<li><b>' . $val . '</b>:' . $opt_arr[$id][1] . '</li>';
                }
                $opt_arr = $result;
                $form->cprecio = new dropdownField('Cambiar precios', 'cprecio');
                $form->cprecio->options($opt_arr);
                $form->cprecio->append(' <sup>1</sup>');
                $form->cprecio->title = 'Ver nota 1';
                $form->cprecio->style = 'width:170px;';
                $form->cprecio->rule = 'required|enum[' . implode(',', $arr_enum) . ']';
                $htmltabla = '
				<div  style="background-color:#9D9FFF;font-size:1.2em">
				<span style="font-size:1.2em"><sup>1</sup> Opciones para <b>cambio de precios</b>:</span>
				<ul style="padding: 0px;margin: 0px 0px 0px 20px;">' . $infoview . '</ul>
				</div>';
            } else {
                $form->cprecio = new hiddenField('Fecha de recepci&oacute;n del documento', 'cprecio');
                $form->cprecio->insertValue = 'N';
                $form->cprecio->in = 'fecha';
                $htmltabla = '';
            }
            $form->fecha = new dateonlyField('Fecha de recepci&oacute;n del documento', 'fecha');
            $form->fecha->insertValue = date('Y-m-d');
            $form->fecha->rule = 'required|callback_chddate';
            $form->fecha->calendar = false;
            $form->fecha->title = 'El sistema asume que esta es la fecha en que la mercanc&iacute;a entra en inventario y de la retenci&oacute;n de IVA si aplica al presente caso';
            $form->fecha->size = 12;
            $form->fecha->append(' <sup>1</sup>');
            $canaordc = intval($this->datasis->dameval('SELECT COUNT(*) AS cana FROM scstordc WHERE compra=' . $this->db->escape($control)));
            if ($canaordc > 0) {
                $form->ordc = new dropdownField('Cerrar Ordenes de Compra', 'ordc');
                $form->ordc->option('N', 'No');
                $form->ordc->option('S', 'Si');
                $form->ordc->rule = 'required|enum[N,S]';
                $form->ordc->style = 'width:100px;';
                $form->ordc->title = 'Selecionar SI para cerrar las ordenes de compra asociadas o NO para dejarlas en backorder';
            }
            $style = 'style="background-color:red;border-radius: 5px;color:yellow;padding:3px;font-size:1.2em;"';
            //Advertencia con opcion a cambio de precios S
            $mSQL = "SELECT GROUP_CONCAT(DISTINCT TRIM(a.codigo)) AS codigos\n\t\t\t\tFROM itscst AS a\n\t\t\t\tJOIN sinv AS b ON a.codigo=b.codigo WHERE (\n\t\t\t\tb.margen1<0 OR b.margen2<0 OR b.margen3<0 OR b.margen4<0) AND a.rmargen='S' AND a.control={$dbcontrol}";
            $codigo1 = trim($this->datasis->dameval($mSQL));
            $mSQL = "SELECT GROUP_CONCAT(DISTINCT TRIM(a.codigo)) AS codigos\n\t\t\t\tFROM itscst AS a\n\t\t\t\tJOIN sinv AS b ON a.codigo=b.codigo WHERE (\n\t\t\t\tABS(a.costo-(a.precio1/(1+(b.iva/100))))<0 OR\n\t\t\t\tABS(a.costo-(a.precio2/(1+(b.iva/100))))<0 OR\n\t\t\t\tABS(a.costo-(a.precio3/(1+(b.iva/100))))<0  ) AND a.rmargen='N' AND a.control={$dbcontrol}";
            $codigo2 = trim($this->datasis->dameval($mSQL));
//.........这里部分代码省略.........
开发者ID:codethics,项目名称:proteoerp,代码行数:101,代码来源:scst.php

示例13: mostrar

    function mostrar($data4)
    {
        $this->rapyd->load("datagrid2", "dataform");
        $form = new DataForm("/supervisor/subexls/actualiza");
        $form->free = new freeField("Campos.Archivo xls", "free", "Campos de El Sistema");
        //var_dump($data4);
        //print_r($data4);
        $grid = new DataGrid2("Archivo Cargado", $data4);
        $j = 0;
        $campos .= 'cols="+$("#cols").val()+"&&dir="+$("#dir").val()';
        foreach ($cols as $col) {
            $grid->column("{$col}", "<#{$col}#>");
            $campo = "campo{$j}";
            $form->{$campo} = new dropdownField("{$col}", "campo{$j}");
            $form->{$campo}->option("ignorar", "ignorar");
            $form->{$campo}->option("codigo", "codigo");
            $form->{$campo}->option("costo", "costo");
            $form->{$campo}->option("descrip", "descrip");
            $form->{$campo}->option("descrip2", "descrip2");
            $form->{$campo}->option("clave", "clave");
            $form->{$campo}->option("grupo", "grupo");
            $form->{$campo}->option("iva", "iva");
            for ($i = 1; $i <= 3; $i++) {
                $form->{$campo}->option("base{$i}", "Base{$i}");
                $form->{$campo}->option("margen{$i}", "Margen{$i}");
                $form->{$campo}->option("precio{$i}", "Precio{$i}");
            }
            $form->{$campo}->style = 'width:150px;';
            $j++;
            $campos .= "+" . "\"&&" . $campo . "=\"+\$(\"#" . $campo . "\").val()";
        }
        //echo $campos;
        $form->cols = new inputField("", "cols");
        $form->cols->insertValue = implode(',', $cols);
        $form->cols->type = 'hidden';
        $form->dir = new inputField("", "dir");
        $form->dir->insertValue = $dir;
        $form->dir->type = 'hidden';
        //$form->submit("btnsubmit","Actualizar");
        $link = site_url('supervisor/subexls/actualiza');
        $script = '
		function actu(){
			a=confirm("�Esta Seguro que de desea Actualizar el Inventario ?");
			if(a){
				 $.ajax({
				 type: "POST",
				 processData:false,
					url: "' . $link . '",
					data: "' . $campos . ',
					success: function(msg){
						if(msg=="s.i"){
							alert("El Inventario fue Actualizado.");
						}
						else{
							alert(msg);
						}
					}
				});
			}
		}
		';
        $form->script($script);
        $form->button("actualiza", "Actualizar", "javascript:actu();");
        $form->build_form();
        $grid->build();
        $data2['content'] = $form->output . $salida . $grid->output;
    }
开发者ID:enderochoa,项目名称:tortuga,代码行数:67,代码来源:subexls.php

示例14: filtro

    function filtro()
    {
        $this->rapyd->load("datagrid2");
        $this->rapyd->load("dataform");
        $this->load->helper('openflash');
        $sinv = array('tabla' => 'sinv', 'columnas' => array('codigo' => 'C&oacute;digo', 'descrip' => 'descrip'), 'filtro' => array('codigo' => 'C&oacute;digo', 'descrip' => 'descrip'), 'retornar' => array('codigo' => 'codigo'), 'titulo' => 'Buscar Articulo');
        $iboton = $this->datasis->modbus($sinv);
        if ($this->uri->segment(4)) {
            $codigo = $this->uri->segment(4);
        } elseif (isset($_POST['codigo'])) {
            $codigo = $_POST['codigo'];
        }
        if (empty($codigo)) {
            $codigo = $this->datasis->dameval("SELECT codigo FROM sinv");
        }
        if ($this->uri->segment(5)) {
            $mes = $this->uri->segment(5);
        } elseif (isset($_POST['mes'])) {
            $mes = $_POST['mes'];
        } else {
            $mes = date('m');
        }
        if ($this->uri->segment(6)) {
            $anio = $this->uri->segment(6);
        } elseif (isset($_POST['anio'])) {
            $anio = $_POST['anio'];
        } else {
            $anio = date('Y');
        }
        $script = '
			$(function() {
				$(".inputnum").numeric(".");
			});
			';
        $fechad = $anio . str_pad($mes, 2, "0", STR_PAD_LEFT) . '01';
        $fechah = $anio . str_pad($mes, 2, "0", STR_PAD_LEFT) . '31';
        $filter = new DataForm('ventas/mensuales');
        $filter->attributes = array('onsubmit' => "this.action='index/'+this.form.mes.value+'/'+this.form.anio.value+'/';return FALSE;");
        $filter->title('Filtro de Ventas por Existencias');
        $filter->script($script, "create");
        $filter->script($script, "modify");
        $filter->mes = new dropdownField("Mes/A&ntilde;o", "mes");
        for ($i = 1; $i < 13; $i++) {
            $filter->mes->option(str_pad($i, 2, '0', STR_PAD_LEFT), str_pad($i, 2, '0', STR_PAD_LEFT));
        }
        $filter->mes->size = 2;
        $filter->mes->style = '';
        $filter->mes->insertValue = $mes;
        $filter->anio = new inputField("A&ntilde;o", "anio");
        $filter->anio->in = 'mes';
        $filter->anio->size = 4;
        $filter->anio->insertValue = $anio;
        $filter->anio->maxlength = 4;
        $filter->anio->rule = "trim";
        $filter->anio->css_class = 'inputnum';
        $filter->codigo = new inputField("C&oacute;digo", "codigo");
        $filter->codigo->size = 15;
        $filter->codigo->append($iboton);
        $filter->codigo->insertValue = $codigo;
        $filter->button("btnsubmit", "Buscar", form2uri(site_url('inventario/gproductos/filtro/'), array('codigo', 'mes', 'anio')), $position = "BL");
        $filter->build_form();
        $grid = new DataGrid2();
        $select = array("fecha", "codigo", "sum(cantidad) cantidad", "IF(sum(cantidad)<=salcant,sum(cantidad),salcant)*(salcant>0)as salcant");
        $grid->db->select($select);
        $grid->db->from("costos");
        $grid->db->where('codigo', $coigo);
        $grid->db->where('fecha >= ', $fechai);
        $grid->db->where('fecha <= ', $fechaf);
        $grid->db->where('origen', '3I');
        $grid->db->groupby("fecha");
        $grid->db->orderby("fecha");
        $grid->db->having("cantidad>0");
        $grid->column("Fecha", "<dbdate_to_human><#fecha#></dbdate_to_human>", 'align=center');
        $grid->column("Ventas", "cantidad", 'align=center');
        $grid->column("Existencias", "salcant", 'align=center');
        //$grid->totalizar('grantotal');
        $grid->build();
        //echo $grid->db->last_query();
        $grafico = open_flash_chart_object(680, 450, site_url("inventario/gproductos/grafico/{$codigo}/{$mes}/{$anio}/"));
        $data['content'] = $grafico;
        $data['content'] .= $filter->output . $grid->output;
        $data["head"] = $this->rapyd->get_head();
        $data['title'] = $this->rapyd->get_head() . "<h1>Ventas por Existencias</h1>";
        $this->load->view('view_ventanas', $data);
    }
开发者ID:codethics,项目名称:proteoerp,代码行数:85,代码来源:gproductos.php

示例15: dpto

    function dpto()
    {
        $this->rapyd->load("dataform");
        $campo = 'ccosto' . $this->uri->segment(4);
        $script = '
 		function pasar(){
			if($F("departa")!="-!-"){
				window.opener.document.getElementById("' . $campo . '").value = $F("departa");
				window.close();
			}else{
				alert("Debe elegir un departamento");
			}
		}';
        $form = new DataForm('');
        $form->script($script);
        $form->fdepar = new dropdownField("Departamento", "departa");
        $form->fdepar->option('-!-', 'Seleccion un departamento');
        $form->fdepar->options("SELECT depto,descrip FROM dpto WHERE tipo='G' ORDER BY descrip");
        $form->fdepar->onchange = 'pasar()';
        $form->build_form();
        $data['content'] = $form->output;
        $data["head"] = script('prototype.js') . $this->rapyd->get_head();
        $data['title'] = '<h1>Seleccione un departamento</h1>';
        $this->load->view('view_detalle', $data);
    }
开发者ID:codethics,项目名称:proteoerp,代码行数:25,代码来源:gastos.php


注:本文中的DataForm::script方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。