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


PHP DataGrid::submit方法代码示例

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


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

示例1: index

    function index()
    {
        $this->rapyd->load("datagrid");
        $this->load->helper('fecha');
        for ($i = 1; $i <= 12; $i++) {
            $mmes[str_pad($i, 2, "0", STR_PAD_LEFT)] = mesLetra($i);
        }
        for ($i = date('Y'); $i >= date('Y') - 4; $i--) {
            $anhos[$i] = $i;
        }
        $descarga = $genera = array();
        $query = $this->db->query("SELECT * FROM libros WHERE activo='S'");
        foreach ($query->result() as $row) {
            if ($row->tipo == 'D') {
                $descarga[] = array('accion' => $row->metodo, 'nombre' => $row->nombre);
            } else {
                $genera[] = array('accion' => $row->metodo, 'nombre' => $row->nombre, 'estampa' => $row->estampa, 'fgenera' => $row->fgenera);
            }
        }
        $checkbox = "<input type='checkbox' name='generar[]' value='<#accion#>' /> ";
        $submit = form_submit('<#accion#>', 'Generar');
        $sanio = form_dropdown('year', $anhos, date('Y'));
        $smes = form_dropdown('mes', $mmes, date('m'));
        function obser($gene, $estampa, $metodo)
        {
            if (empty($gene) or empty($estampa)) {
                return "<span id='obs_{$metodo}'>Niguna</span>";
            }
            $hestampa = dbdate_to_human($estampa, 'd/m/Y h:i a');
            $hgene = substr($gene, 4) . '/' . substr($gene, 0, 4);
            return "<span id='obs_{$metodo}'>Generado el <b>{$hestampa}</b> para el mes <b>{$hgene}</b></span>";
        }
        $gene = new DataGrid("Documento para el mes {$smes} del a&ntilde;o {$sanio}", $genera);
        $gene->use_function('obser');
        $gene->per_page = count($genera);
        $gene->column("Generar", $checkbox);
        $gene->column("Documento", "nombre");
        $gene->column("Observaciones", "<obser><#fgenera#>|<#estampa#>|<#accion#></obser>");
        $gene->submit('enviar', 'Generar');
        $gene->build();
        $link = '<a href="javascript:void(0);" title="Descargar" onclick="descarga(\'<#accion#>\');">Descargar</a>';
        $desca = new DataGrid("Descarga de documentos", $descarga);
        $desca->per_page = count($descarga);
        $desca->column("Descargar", $link);
        $desca->column("Documento", "nombre");
        $desca->build();
        $link = site_url('finanzas/libros/generar');
        $data['script'] = '<script type="text/javascript">
		$(document).ready(function(){
			$("form").submit(function() {
				geneDoc();
				return false;
			});
		});

		function geneDoc(){
			$("#preloader").fadeIn("slow");
			$("#contenido").fadeOut("slow");
			var url = "' . $link . '";
			$.ajax({
				type: "POST",
				url: url,
				data: $("form").serialize(),
				success: function(msg){
					$("#preloader").fadeOut("slow");
					$("#contenido").fadeIn("slow");
					objs=$(":checked");
					jQuery.each(objs, function() {
						$("#obs_"+this.value).text("Acaba de ser generado");
					});
				}
			});
		}

		function descarga(nombre){
			param=$("select[name=\'year\']").val()+$("select[name=\'mes\']").val();
			window.location="' . site_url('finanzas/libros') . '/"+nombre+"/"+param;
			//alert(param);
		}
		</script>';
        $conf = anchor('finanzas/libros/configurar', 'Configurar');
        $form = form_open('/finanzas/libros');
        $data['content'] = $form . $gene->output . form_close() . $desca->output . $conf;
        $data['title'] = "<h1>Generar libros Contables</h1>";
        $data["head"] = script("jquery-1.2.6.pack.js") . $this->rapyd->get_head();
        $data['extras'] = $this->load->view('view_preloader', array(), true);
        $this->load->view('view_ventanas', $data);
    }
开发者ID:codethics,项目名称:proteoerp,代码行数:88,代码来源:libros_calore.php

示例2: carga

    function carga()
    {
        $this->rapyd->load('datagrid', 'fields', 'datafilter2');
        $formato = $this->datasis->dameval('SELECT formato FROM cemp LIMIT 0,1');
        $qformato = '%';
        for ($i = 1; $i < substr_count($formato, '.') + 1; $i++) {
            $qformato .= '.%';
        }
        $this->qformato = $qformato;
        $this->qformato = $qformato = $this->datasis->formato_cpla();
        $modbus = array('tabla' => 'cpla', 'columnas' => array('codigo' => 'C&oacute;digo', 'denominacion' => 'Denominaci&oacute;n'), 'filtro' => array('codigo' => 'C&oacute;digo', 'denominacion' => 'Denominacion'), 'retornar' => array('codigo' => 'con<#codigo#>'), 'titulo' => 'Buscar Cuenta', 'where' => 'nivel = 3', 'p_uri' => array(4 => "<#codigo#>"));
        //'where'=>" codigo LIKE \"$qformato\"",
        $btn = $this->datasis->p_modbus($modbus, "<#codigo#>");
        $modbus2 = array('tabla' => 'ppla', 'columnas' => array('codigo' => 'C&oacute;digo', 'denominacion' => 'Denominaci&oacute;n'), 'filtro' => array('codigo' => 'C&oacute;digo', 'denominacion' => 'Denominacion'), 'retornar' => array('codigo' => 'codigo'), 'titulo' => 'Buscar Cuenta');
        //'where'=>" codigo LIKE \"$qformato\"",
        $btn2 = $this->datasis->p_modbus($modbus2, "ppla");
        $error = '';
        if ($this->input->post('pros') !== FALSE) {
            foreach ($_POST as $cod => $cant) {
                if (substr($cod, 0, 3) == "con" && $cant > 0) {
                    $cod = substr($cod, 3, 20);
                    $cod = $this->db->escape($cod . '%');
                    $cod = str_replace('_', '.', $cod);
                    //$cant = $this->db->escape($cant);
                    if (!$this->datasis->dameval("SELECT COUNT(*) FROM cpla WHERE codigo='{$cant}' ")) {
                        $error .= " La cuenta contable ({$cant}) es inv&aacute;lida<br>";
                    } else {
                        $data = array('contable' => $cant);
                        $where = "codigo like {$cod}  ";
                        $mSQL = $this->db->update_string('ppla', $data, $where);
                        $this->db->simple_query($mSQL);
                    }
                }
            }
        }
        $filter = new DataFilter2("&nbsp;", 'ppla');
        $filter->error_string = $error;
        $filter->codigo = new inputField("C&oacute;digo Presupuestario", "codigo");
        //$filter->codigo->option("","Seleccionar");
        //$filter->codigo->options("SELECT codigo, CONCAT_WS(' ',codigo,denominacion) FROM ppla WHERE LENGTH(codigo) < ($this->long) ORDER BY codigo  ");
        $filter->codigo->clause = "likerigth";
        $filter->codigo->rule = "required";
        $filter->codigo->size = 20;
        $filter->codigo->append($btn2);
        $filter->buttons("reset", "search");
        $filter->build();
        $ggrid = '';
        if ($filter->is_valid()) {
            $ggrid = form_open('contabilidad/cargacuent/carga/search/osp');
            $ggrid .= form_hidden('codigo', $filter->codigo->newValue);
            $contable = new inputField("Cuenta Contable", "con<#codigo#>");
            //, "contable[<#codigo#>]"
            $contable->grid_name = "contable[<#codigo#>]";
            $contable->status = 'modify';
            $contable->size = 12;
            $contable->css_class = 'inputnum';
            $contable->append($btn);
            $contable->build();
            $grid = new DataGrid("Clasificador Presupuestario (" . $filter->codigo->newValue . ")");
            //$grid->db->where('concepto','015');
            //$grid->per_page = $filter->db->num_rows() ;
            $grid->order_by("codigo", "asc");
            $grid->column("C&oacute;digo", "codigo");
            $grid->column("Denominaci&oacute;n", "denominacion");
            $grid->column("Cuenta Contable", "contable");
            $grid->column("Cuenta Contable", $contable->output, 'align=\'right\'');
            $grid->submit('pros', 'Guardar', "BR");
            $grid->build();
            $ggrid .= $grid->output;
            $ggrid .= form_close();
            //echo $grid->db->last_query();
        }
        $script = '
		<script type="text/javascript">
		$(function() {
			$(".inputnum").numeric(".");
		});
		</script>';
        $data['content'] = $filter->output . $ggrid;
        $data['title'] = 'Asignaci&oacute;n de Cuentas';
        $data['script'] = $script;
        $data["head"] = $this->rapyd->get_head() . script("jquery.pack.js") . script("plugins/jquery.numeric.pack.js") . script("plugins/jquery.floatnumber.js");
        $this->load->view('view_ventanas', $data);
    }
开发者ID:enderochoa,项目名称:tortuga,代码行数:84,代码来源:cargacuent.php

示例3: tabla

             $this->pnomina->evalform($row->formula);
             #echo "\n";
         }
     }
 }
 function tabla()
 {
     $this->rapyd->load('datagrid', 'fields');
     $contrato = "'DIR01'";
     $ggrid = form_open('/nomina/prenom/montos/search/osp');
     $ggrid .= form_hidden('concepto', 'alguno');
     $grid = new DataGrid("Asignaciones", 'pretab');
     $grid->column("C&oacute;digo", "codigo");
     $grid->column("Nombre", "nombre");
     $query = $this->db->query("SELECT descrip,concepto FROM itnoco WHERE codigo={$contrato} ORDER BY concepto");
     foreach ($query->result() as $row) {
         $ind = 'c' . trim($row->concepto);
         $campo = new inputField("Campo", $ind);
         $campo->grid_name = $ind . '[<#codigo#>]';
         $campo->status = 'modify';
         $campo->size = 12;
         $campo->css_class = 'inputnum';
         $grid->column($row->descrip, $campo, 'align=\'center\'');
     }
     $grid->submit('pros', 'Guardar', "TR");
     $grid->build();
     $ggrid .= $grid->output;
     $ggrid .= form_close();
     $data['content'] = $ggrid;
开发者ID:enderochoa,项目名称:tortuga,代码行数:29,代码来源:prenom.php

示例4: montos

    function montos()
    {
        $this->rapyd->load('datagrid', 'fields', 'datafilter');
        /*$this->load->library('form_validation');
        
        		if ($this->form_validation->run() == FALSE){
        			$this->load->view('myform');
        		}else{
        			$this->load->view('formsuccess');
        		}*/
        $error = '';
        if ($this->input->post('pros') !== FALSE) {
            $concepto = $this->db->escape($this->input->post('concepto'));
            $pmontos = $this->input->post('monto');
            foreach ($pmontos as $cod => $cant) {
                $cod = $this->db->escape($cod);
                if (!is_numeric($cant)) {
                    $error .= "{$cant} no es un valor numerico<br>";
                } else {
                    $data = array('monto' => $cant);
                    $where = "codigo = {$cod}  AND concepto ={$concepto} ";
                    $mSQL = $this->db->update_string('prenom', $data, $where);
                    $this->db->simple_query($mSQL);
                }
            }
        }
        $filter = new DataFilter("&nbsp;", 'prenom');
        $filter->error_string = $error;
        $filter->concepto = new dropdownField("Concepto", "concepto");
        $filter->concepto->option("", "Seleccionar");
        $filter->concepto->options("SELECT concepto,descrip FROM prenom GROUP BY concepto ORDER BY descrip");
        $filter->concepto->clause = "where";
        $filter->concepto->operator = "=";
        $filter->concepto->rule = "required";
        $filter->buttons("reset", "search");
        $filter->build();
        $ggrid = '';
        if ($filter->is_valid()) {
            $ggrid = form_open('/nomina/prenom/montos/search/osp');
            $ggrid .= form_hidden('concepto', $filter->concepto->newValue);
            $monto = new inputField("Monto", "monto");
            $monto->grid_name = 'monto[<#codigo#>]';
            $monto->status = 'modify';
            $monto->size = 12;
            $monto->css_class = 'inputnum';
            $grid = new DataGrid("Concepto (" . $filter->concepto->newValue . ") " . $filter->concepto->options[$filter->concepto->newValue]);
            //$grid->db->where('concepto','015');
            //$grid->per_page = $filter->db->num_rows() ;
            $grid->column("C&oacute;digo", "codigo");
            $grid->column("Nombre", "nombre");
            $grid->column("Monto", $monto, 'align=\'right\'');
            $grid->submit('pros', 'Guardar', "BR");
            $grid->build();
            $ggrid .= $grid->output;
            $ggrid .= form_close();
        }
        $script = '
		<script type="text/javascript">
		$(function() {
			$(".inputnum").numeric(".");
		});
		</script>';
        $data['content'] = $filter->output . $ggrid;
        $data['title'] = '<h1>Asignaci&oacute;n de montos</h1>';
        $data['script'] = $script;
        $data["head"] = $this->rapyd->get_head() . script("jquery.pack.js") . script("plugins/jquery.numeric.pack.js") . script("plugins/jquery.floatnumber.js");
        $this->load->view('view_ventanas', $data);
    }
开发者ID:enderochoa,项目名称:tortuga,代码行数:68,代码来源:prenom.php

示例5: cmetas

    function cmetas()
    {
        $this->rapyd->uri->keep_persistence();
        $this->rapyd->load('datagrid', 'fields');
        $error = $msj = '';
        if ($this->input->post('pros') !== false) {
            $pmargen = $this->input->post('pmargen');
            if (is_array($pmargen)) {
                $sum = array_sum($pmargen);
                if (round($sum, 2) == 100.0) {
                    foreach ($pmargen as $id => $pm) {
                        if (is_numeric($pm) && $pm >= 0) {
                            $this->db->where('id', $id);
                            $this->db->update('vend', array('pmargen' => $pm));
                        } else {
                            $error .= 'Valor no num&eacute;rico o negativo ' . $id;
                        }
                    }
                } else {
                    $error .= 'La suma de los valores debe dar exactamente 100';
                }
            } else {
                $error = 'No se puede procesar el requerimiento';
            }
        }
        $ggrid = form_open('/ventas/metas/cmetas');
        $grid = new DataGrid('Ajuste de distribuci&oacute;n de la meta');
        $grid->order_by('nombre');
        $select = array('vendedor', 'nombre', 'pmargen', 'id');
        $grid->db->select($select);
        $grid->db->from('vend AS a');
        $campo = new inputField('Campo', 'pmargen');
        $campo->grid_name = 'pmargen[<#id#>]';
        //$campo->pattern  ='';
        $campo->status = 'modify';
        $campo->size = 6;
        $campo->autocomplete = false;
        $campo->css_class = 'inputnum';
        $campo->disable_paste = true;
        $grid->column_orderby('Vendedor', 'vendedor', 'vendedor');
        $grid->column_orderby('Nombre', 'nombre', 'nombre');
        $grid->column('Margen %', $campo, 'align=\'center\'');
        $action = "javascript:window.location='" . site_url('ventas/metas/filteredgrid') . "'";
        $grid->button('btn_regresa', 'Regresar', $action, 'TR');
        $grid->submit('pros', 'Guardar', 'BR');
        $grid->build();
        $ggrid .= $grid->output;
        $ggrid .= form_close();
        $script = '<script language="javascript" type="text/javascript">
		$(function(){
			$(".inputnum").numeric(".");

			$(\'input[name^="pmargen"]\').focus(function() {
				obj  = $(this);
				vval = Number(obj.val());

				tota=0;
				$(\'input[name^="pmargen"]\').each(function (i) {
					tota+=Number(this.value);
				});
				val=roundNumber(100-(tota-vval),2);
				obj.val(val);
				obj.select();
			});
		});
		</script>';
        $data['content'] = '<div class="alert">' . $error . '</div>';
        $data['content'] .= '<div>' . $msj . '</div>';
        $data['content'] .= $ggrid;
        $data['title'] = heading('Cambio en las metas para vendedores');
        $data['script'] = $script;
        $data['script'] .= phpscript('nformat.js');
        $data['head'] = $this->rapyd->get_head() . script('jquery.pack.js') . script('plugins/jquery.numeric.pack.js') . script('plugins/jquery.floatnumber.js');
        $data['head'] .= style('estilos.css');
        $data['head'] .= phpscript('nformat.js');
        $this->load->view('view_ventanas', $data);
    }
开发者ID:codethics,项目名称:proteoerp,代码行数:77,代码来源:metas.php

示例6: cprecios

    function cprecios($control)
    {
        $this->rapyd->uri->keep_persistence();
        $this->rapyd->load('datagrid', 'fields');
        $error = '';
        $msj = '';
        if ($this->input->post('scstp_1') !== false) {
            $precio1 = $this->input->post('scstp_1');
            $precio2 = $this->input->post('scstp_2');
            $precio3 = $this->input->post('scstp_3');
            $precio4 = $this->input->post('scstp_4');
            foreach (array_keys($precio1) as $ind) {
                $pt1 = $precio1[$ind] >= $precio2[$ind] && $precio2[$ind] >= $precio3[$ind] && $precio3[$ind] >= $precio4[$ind];
                $pt2 = $precio1[$ind] > 0 && $precio2[$ind] > 0 && $precio3[$ind] > 0 && $precio4[$ind] > 0;
                if ($pt1 && $pt2) {
                    $data = array('precio1' => $precio1[$ind], 'precio2' => $precio2[$ind], 'precio3' => $precio3[$ind], 'precio4' => $precio4[$ind]);
                    $where = 'id = ' . $this->db->escape($ind);
                    $mSQL = $this->db->update_string('itscst', $data, $where);
                    $ban = $this->db->simple_query($mSQL);
                } else {
                    $error = 'Los precios deben cumplir esta regla (precio 1 >= precio 2 >= precio 3 >= precio 4) y mayores a cero';
                }
            }
            if (strlen($error) == 0) {
                $msj = 'Nuevos Precios guardados';
            }
            if ($this->solo) {
                return '{"status":"C","id":"' . $control . '" ,"mensaje":"' . $msj . $error . '"}';
            }
        }
        if ($this->solo) {
            $ggrid = form_open('/compras/scst/solo/cprecios/' . $control, array("id" => "df1"));
        } else {
            $ggrid = form_open('/compras/scst/cprecios/' . $control);
        }
        function costo($formcal, $pond, $ultimo, $standard, $existen, $itcana)
        {
            $CI =& get_instance();
            $costo_pond = $CI->_pond($existen, $itcana, $pond, $ultimo);
            return $CI->_costos($formcal, $costo_pond, $ultimo, $standard);
        }
        function margen($formcal, $pond, $ultimo, $standard, $existen, $itcana, $precio, $iva)
        {
            $costo = costo($formcal, $pond, $ultimo, $standard, $existen, $itcana);
            if ($precio == 0) {
                return 0;
            }
            return round(100 - $costo * 100 / ($precio / (1 + $iva / 100)), 2);
        }
        function tcosto($id, $iva, $formcal, $pond, $ultimo, $standard, $existen, $itcana)
        {
            $costo = costo($formcal, $pond, $ultimo, $standard, $existen, $itcana);
            $rt = nformat($costo);
            $rt .= '<input type="hidden" id="costo[' . $id . ']" name="costo[' . $id . ']" value="' . $costo . '" />';
            $rt .= '<input type="hidden" id="iva[' . $id . ']" name="iva[' . $id . ']" value="' . $iva . '" />';
            return $rt;
        }
        $grid = new DataGrid('Precios de art&iacute;culos');
        $grid->use_function('costo', 'margen', 'tcosto');
        $grid->order_by('descrip');
        $select = array('b.codigo', 'b.descrip', 'b.formcal', 'a.costo', 'b.ultimo', 'b.pond', 'b.standard', 'a.id', 'a.precio1 AS scstp_1', 'a.precio2 AS scstp_2', 'a.precio3 AS scstp_3', 'a.precio4 AS scstp_4', 'b.precio1 AS sinvp1', 'b.precio2 AS sinvp2', 'b.precio3 AS sinvp3', 'b.precio4 AS sinvp4', 'b.formcal', 'a.cantidad', 'b.existen', 'b.iva');
        $grid->db->select($select);
        $grid->db->from('itscst AS a');
        $grid->db->join('sinv AS b', 'a.codigo=b.codigo');
        $grid->db->where('control', $control);
        //$grid->column('C&oacute;digo'     , '' );
        $grid->column_orderby('Descripci&oacute;n', '<b class=\'mininegro\'><#codigo#></b><br><#descrip#>', 'descrip');
        $ittt = array('sinvp1', 'sinvp2', 'sinvp3', 'sinvp4');
        $itt = array('scstp_1', 'scstp_2', 'scstp_3', 'scstp_4');
        foreach ($itt as $id => $val) {
            $ind = $val;
            $campo = new inputField('Campo', $ind);
            $campo->grid_name = $ind . '[<#id#>]';
            $campo->status = 'modify';
            $campo->size = 8;
            $campo->autocomplete = false;
            $campo->css_class = 'inputnum';
            $campo->append('<#' . $ittt[$id] . '#>');
            $campo->disable_paste = true;
            $grid->column('Precio ' . ($id + 1), $campo, 'align=\'center\'');
        }
        $itt = array('margen_1', 'margen_2', 'margen_3', 'margen_4');
        foreach ($itt as $id => $val) {
            $ind = $val;
            $campo = new inputField('Campo', $ind);
            $campo->grid_name = $ind . '[<#id#>]';
            $campo->pattern = '<margen><#formcal#>|<#pond#>|<#costo#>|<#standard#>|<#existen#>|<#cantidad#>|<#scstp_' . ($id + 1) . '#>|<#iva#></margen>';
            $campo->status = 'modify';
            $campo->size = 3;
            $campo->autocomplete = false;
            $campo->css_class = 'inputnum';
            $campo->disable_paste = true;
            $grid->column('Marg.' . ($id + 1), $campo, 'align=\'center\'');
        }
        $grid->column('Costo', '<tcosto><#id#>|<#iva#>|<#formcal#>|<#pond#>|<#costo#>|<#standard#>|<#existen#>|<#cantidad#></tcosto>', 'align=\'right\'');
        if (!$this->solo) {
            $action = "javascript:window.location='" . site_url('compras/scst/dataedit/show/' . $control) . "'";
            $grid->button('btn_regresa', 'Regresar', $action, 'TR');
            $grid->submit('pros', 'Guardar', 'BR');
        }
//.........这里部分代码省略.........
开发者ID:codethics,项目名称:proteoerp,代码行数:101,代码来源:scst.php

示例7: cprecios

    function cprecios()
    {
        $this->rapyd->uri->keep_persistence();
        $cpre = $this->input->post('pros');
        if ($cpre !== false) {
            $msj = $this->_cprecios();
        } else {
            $msj = '';
        }
        $this->rapyd->load('datafilter2', 'datagrid');
        $mSPRV = array('tabla' => 'sprv', 'columnas' => array('proveed' => 'C&oacute;digo', 'nombre' => 'Nombre', 'contacto' => 'Contacto'), 'filtro' => array('proveed' => 'C&oacute;digo', 'nombre' => 'Nombre'), 'retornar' => array('proveed' => 'proveed'), 'titulo' => 'Buscar Proveedor');
        $bSPRV = $this->datasis->modbus($mSPRV);
        $link2 = site_url('inventario/common/get_linea');
        $link3 = site_url('inventario/common/get_grupo');
        $script = '
		$(document).ready(function(){
			$(".inputnum").numeric(".");
			$("#depto").change(function(){
				depto();
				$.post("' . $link2 . '",{ depto:$(this).val() },function(data){$("#linea").html(data);})
				$.post("' . $link3 . '",{ linea:"" },function(data){$("#grupo").html(data);})
			});
			$("#linea").change(function(){
				linea();
				$.post("' . $link3 . '",{ linea:$(this).val() },function(data){$("#grupo").html(data);})
			});
			$("#grupo").change(function(){
				grupo();
			});
			$("#sinvprecioc").submit(function() {
				return confirm("Se van a actualizar todos los precios en pantalla \\nEstas seguro de que quieres seguir??");
			});
			depto();
			linea();
			grupo();
		});

		function depto(){
			if($("#depto").val()!=""){
				$("#nom_depto").attr("disabled","disabled");
			}
			else{
				$("#nom_depto").attr("disabled","");
			}
		}

		function linea(){
			if($("#linea").val()!=""){
				$("#nom_linea").attr("disabled","disabled");
			}
			else{
				$("#nom_linea").attr("disabled","");
			}
		}

		function grupo(){
			if($("#grupo").val()!=""){
				$("#nom_grupo").attr("disabled","disabled");
			}
			else{
				$("#nom_grupo").attr("disabled","");
			}
		}';
        $filter = new DataFilter2('Filtro por Producto');
        $select = array('IF(formcal=\'U\',ultimo,IF(formcal=\'P\',pond,IF(formcal=\'S\',standard,GREATEST(ultimo,pond)))) AS costo', 'a.existen', 'a.marca', 'a.tipo', 'a.id', 'TRIM(codigo) AS codigo', 'a.descrip', 'precio1', 'precio2', 'precio3', 'precio4', 'b.nom_grup', 'b.grupo', 'c.descrip AS nom_linea', 'c.linea', 'd.descrip AS nom_depto', 'd.depto AS depto', 'a.base1', 'a.base2', 'a.base3', 'a.base4');
        $filter->db->select($select);
        $filter->db->from('sinv AS a');
        $filter->db->join('grup AS b', 'a.grupo=b.grupo');
        $filter->db->join('line AS c', 'b.linea=c.linea');
        $filter->db->join('dpto AS d', 'c.depto=d.depto');
        $filter->db->where('a.activo', 'S');
        $filter->script($script);
        $filter->codigo = new inputField("C&oacute;digo", "codigo");
        $filter->codigo->size = 15;
        $filter->codigo->group = "Uno";
        $filter->descrip = new inputField("Descripci&oacute;n", "descrip");
        $filter->descrip->db_name = 'CONCAT_WS(" ",a.descrip,a.descrip2)';
        $filter->descrip->size = 30;
        $filter->descrip->group = "Uno";
        $filter->tipo = new dropdownField("Tipo", "tipo");
        $filter->tipo->db_name = "a.tipo";
        $filter->tipo->option('', "Todos");
        $filter->tipo->option("Articulo", "Art&iacute;culo");
        $filter->tipo->option("Servicio", "Servicio");
        $filter->tipo->option("Descartar", "Descartar");
        $filter->tipo->option("Consumo", "Consumo");
        $filter->tipo->option("Fraccion", "Fracci&oacute;n");
        $filter->tipo->style = 'width:120px;';
        $filter->tipo->group = "Uno";
        $filter->clave = new inputField("Clave", "clave");
        $filter->clave->size = 15;
        $filter->clave->group = "Uno";
        $filter->proveed = new inputField("Proveedor", "proveed");
        $filter->proveed->append($bSPRV);
        $filter->proveed->db_name = 'CONCAT_WS("-",`a`.`prov1`, `a`.`prov2`, `a`.`prov3`)';
        $filter->proveed->size = 10;
        $filter->proveed->group = "Dos";
        $filter->depto2 = new inputField("Departamento", "nom_depto");
        $filter->depto2->db_name = "d.descrip";
        $filter->depto2->size = 5;
//.........这里部分代码省略.........
开发者ID:codethics,项目名称:proteoerp,代码行数:101,代码来源:sinv.php

示例8: arancif

    function arancif($id)
    {
        $this->rapyd->load('datagrid', 'fields');
        $error = '';
        if ($this->input->post('pros') !== FALSE) {
            $pmontos = $this->input->post('arancif');
            foreach ($pmontos as $iid => $cant) {
                if (!is_numeric($cant)) {
                    $error .= "{$cant} no es un valor num&eacute;rico<br>";
                } else {
                    $data = array('arancif' => $cant);
                    $dbid = $this->db->escape($iid);
                    $where = "id = {$dbid}";
                    $mSQL = $this->db->update_string('itordi', $data, $where);
                    $this->db->simple_query($mSQL);
                }
            }
        }
        $this->_calcula($id);
        $ggrid = form_open('/import/ordi/arancif/' . $id);
        $monto = new inputField('Arancif', 'arancif');
        $monto->grid_name = 'arancif[<#id#>]';
        $monto->status = 'modify';
        $monto->size = 12;
        $monto->autocomplete = false;
        $monto->css_class = 'inputnum';
        $expli = 'En caso de que en la aduana calcule el valor del arancel en base a un costo estad&iacute;stico diferente puede asignar el nuevo costo en los campos siguientes, en caso de dejarlo en cero se tomar&aacute; el valor del importe CIF real.';
        $select = array('a.codigo', 'a.descrip', 'a.cantidad', 'a.importecif', 'a.id', 'a.arancif', 'a.montoaran', 'a.arancel', 'a.importeciflocal');
        $grid = new DataGrid($expli);
        $grid->db->select($select);
        $grid->db->from('itordi AS a');
        $grid->db->join('ordi AS b', 'a.numero=b.numero');
        $grid->db->where('a.numero', $id);
        //$grid->order_by('a.numero','desc');
        $grid->column_orderby('C&oacute;digo', 'codigo', 'codigo');
        $grid->column_orderby('Descripci&oacute;n', 'descrip', 'descrip');
        $grid->column_orderby('Cantidad', '<nformat><#cantidad#></nformat>', 'cantidad', 'align=\'right\'');
        $grid->column_orderby('Importe CIF Real', '<nformat><#importeciflocal#></nformat>', 'importeciflocal', 'align=\'right\'');
        $grid->column_orderby('Monto del arancel', '<b><nformat><#montoaran#></nformat></b> (<nformat><#arancel#></nformat>%)', 'montoaran', 'align=\'right\'');
        $grid->column('Importe CIF estad&iacute;stico en moneda local', $monto, 'align=\'right\'');
        $grid->submit('pros', 'Guardar y calcular', 'BR');
        $grid->button('btn_reg', 'Regresar', "javascript:window.location='" . site_url('/import/ordi/dataedit/show/' . $id) . "'", 'BR');
        $grid->build();
        //echo $grid->db->last_query();
        $ggrid .= $grid->output;
        $ggrid .= form_close();
        $script = '
		<script type="text/javascript">
		$(function() {
			$(".inputnum").numeric(".");
		});
		</script>';
        $data['content'] = '<div class=\'alert\'>' . $error . '</div>' . $ggrid;
        $data['title'] = '<h1>Asignaci&oacute;n en los montos estad&iacute;sticos para el c&aacute;lculo de los aranceles</h1>';
        $data['script'] = $script;
        $data['head'] = $this->rapyd->get_head() . script('jquery.pack.js') . script('plugins/jquery.numeric.pack.js') . script('plugins/jquery.floatnumber.js');
        $this->load->view('view_ventanas', $data);
    }
开发者ID:codethics,项目名称:proteoerp,代码行数:58,代码来源:ordi.php


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