예제 #1
0
 function asigna($valor, $value = 0, $soli = 0)
 {
     //$tipo,$codigoadm,$codigopres,
     $campo = new inputField("Title", "gt[{$valor}]");
     $campo->status = "create";
     $campo->css_class = 'inputnum';
     $campo->size = 10;
     if ($value == 0) {
         $campo->insertValue = $soli;
     } else {
         $campo->insertValue = $value;
     }
     //$campo->rule="readonly";
     $campo->build();
     return $campo->output;
 }
예제 #2
0
    $querystatement = "\n\t\t\tSELECT\n\t\t\t\t`tabledefs`.`displayname`,\n\t\t\t\t`attachments`.`recordid`,\n\t\t\t\t`attachments`.`creationdate`,\n\t\t\t\t`tabledefs`.`editfile`\n\t\t\tFROM\n\t\t\t\t`attachments`INNER JOIN `tabledefs` ON `attachments`.`tabledefid`=`tabledefs`.`uuid`\n\t\t\tWHERE `attachments`.`fileid`='" . $uuid . "'\n\t\t\t";
    $queryresult = $db->query($querystatement);
    return $queryresult;
}
$phpbms->cssIncludes[] = "pages/files.css";
$phpbms->jsIncludes[] = "modules/base/javascript/file.js";
//Form Elements
//==============================================================
$theform = new phpbmsForm();
$theform->enctype = "multipart/form-data";
if (isset($therecord["id"])) {
    $theinput = new inputField("name", $therecord["name"], NULL, true, NULL, 64, 128);
    $theinput->setAttribute("class", "important");
    $theform->addField($theinput);
}
$theinput = new inputField("type", $therecord["type"], "file type", false, null, 25);
$theinput->setAttribute("readonly", "readonly");
$theinput->setAttribute("class", "uneditable");
$theform->addField($theinput);
$theinput = new inputRolesList($db, "roleid", $therecord["roleid"], "access (role)");
$theform->addField($theinput);
if (isset($_GET["tabledefid"]) && !isset($therecord["id"])) {
    $theinput = new inputSmartSearch($db, "fileid", "Pick File", "", "exisiting file", false, 40);
    $theform->addField($theinput);
}
//end if
$thetable->getCustomFieldInfo();
$theform->prepCustomFields($db, $thetable->customFieldsQueryResult, $therecord);
$theform->jsMerge();
//==============================================================
//End Form Elements
예제 #3
0
$thetable = new scheduler($db, "tbld:83de284b-ef79-3567-145c-30ca38b40796");
$therecord = $thetable->processAddEditPage();
if (isset($therecord["phpbmsStatus"])) {
    $statusmessage = $therecord["phpbmsStatus"];
}
$pageTitle = "Scheduler";
$currentpath = getcwd();
$phpbms->cssIncludes[] = "pages/scheduler.css";
$phpbms->jsIncludes[] = "modules/base/javascript/scheduler.js";
//Form Elements
//==============================================================
$theform = new phpbmsForm();
$theform->id = $theform->name;
$theinput = new inputCheckbox("inactive", $therecord["inactive"]);
$theform->addField($theinput);
$theinput = new inputField("name", $therecord["name"], NULL, true, NULL, 32, 64);
$theinput->setAttribute("class", "important");
$theform->addField($theinput);
if (moduleExists("mod:b2d42220-443b-fe74-dbdb-ed2c0968c38c", $phpbms->modules)) {
    $list = array("file" => "job", "push record" => "pushrecord");
    $theinput = new inputBasicList("scripttype", $therecord["scripttype"], $list, "script type");
    $theform->addField($theinput);
    $theinput = new inputSmartSearch($db, "pushrecordid", "Pick Push Record For Cron", $therecord["pushrecordid"]);
    $theform->addField($theinput);
}
//end if
$theinput = new inputField("job", $therecord["job"], "script", false, NULL, 32, 128, false);
$theform->addField($theinput);
$theinput = new inputDatePicker("startdate", $therecord["startdate"], "start date", true, 11, 15, false);
$theform->addField($theinput);
$theinput = new inputTimePicker("starttime", $therecord["starttime"], "start time", true, 11, 15, false);
예제 #4
0
    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);
    }
예제 #5
0
 function getFields($therecord)
 {
     global $db;
     $theinput = new inputField("shipping_markup", $therecord["shipping_markup"], "shipping markup", false, "real", 4, 4);
     $fields[] = $theinput;
     $theinput = new inputField("shipping_postalcode", $therecord["shipping_postalcode"], "shipping origination zip/postal code", false, NULL, 32, 128);
     $fields[] = $theinput;
     $theinput = new inputDataTableList($db, "default_payment", $therecord["default_payment"], "paymentmethods", "uuid", "name", "inactive=0 AND (`type` != 'receivable' OR `type` IS NULL)", "priority,name", true, "default payment method", true, "");
     $fields[] = $theinput;
     $theinput = new inputDataTableList($db, "default_shipping", $therecord["default_shipping"], "shippingmethods", "uuid", "name", "inactive=0", "priority,name", true, "default shipping method", true, "");
     $fields[] = $theinput;
     $theinput = new inputDataTableList($db, "default_discount", $therecord["default_discount"], "discounts", "uuid", "name", "inactive=0", "name", true, "default discount", true, "");
     $fields[] = $theinput;
     $theinput = new inputDataTableList($db, "default_taxarea", $therecord["default_taxarea"], "tax", "uuid", "name", "inactive=0", "name", true, "default tax area", true, "");
     $fields[] = $theinput;
     $theinput = new inputBasicList("default_clienttype", $therecord["default_clienttype"], array("prospect" => "prospect", "client" => "client"), "default type");
     $fields[] = $theinput;
     $theinput = new inputCheckbox("default_hascredit", $therecord["default_hascredit"], "has credit by default");
     $fields[] = $theinput;
     $theinput = new inputCurrency("default_creditlimit", $therecord["default_creditlimit"], "default credit limit");
     $fields[] = $theinput;
     $theinput = new inputField("term1_days", $therecord["term1_days"], "term 1 length", false, "integer", 4, 4);
     $theinput->setAttribute("class", "important");
     $fields[] = $theinput;
     $theinput = new inputField("term1_percentage", $therecord["term1_percentage"], "term 1 percentage", false, "real", 4, 4);
     $fields[] = $theinput;
     $theinput = new inputField("term2_days", $therecord["term2_days"], "term 2 length", false, "integer", 4, 4);
     $theinput->setAttribute("class", "important");
     $fields[] = $theinput;
     $theinput = new inputField("term2_percentage", $therecord["term2_percentage"], "term 2 percentage", false, "real", 4, 4);
     $fields[] = $theinput;
     $theinput = new inputField("term3_days", $therecord["term3_days"], "term 3 length", false, "integer", 4, 4);
     $theinput->setAttribute("class", "important");
     $fields[] = $theinput;
     $theinput = new inputField("term3_percentage", $therecord["term3_percentage"], "term 3 percentage", false, "real", 4, 4);
     $fields[] = $theinput;
     $theinput = new inputCheckbox("prospects_on_orders", $therecord["prospects_on_orders"], "allow prospects on sales orders");
     $fields[] = $theinput;
     $theinput = new inputCheckbox("encrypt_payment_fields", $therecord["encrypt_payment_fields"], "encrypt/obfuscate payment information");
     $fields[] = $theinput;
     $theinput = new inputField("encryption_key_path", $therecord["encryption_key_path"], "absolute server path to a file containing the encryption key", false, NULL, 64);
     $fields[] = $theinput;
     $theinput = new inputCheckbox("show_payment_instructions", $therecord["show_payment_instructions"], "show payment instrucions");
     $fields[] = $theinput;
     return $fields;
 }
	public function getHTML(){
		
		$return = '<select'.parent::getAttrs($this->attr).'>';
		
		// Cycle through the options
		if(is_array($this->options)){foreach($this->options as $option => $values){
			$return .= '<option value="'.$option.'" '.(($values['selected'] == false) ? '' : 'selected').'>'.$values['displayName'].'</option>';
		}}
		
		$return .= '</select>';
		
		if($this->label != false){
			$return = '<label for="'.$this->attr['name'].'">'.$this->cuteName.$return.'</label>';
		}
		
		return $return;
	}
예제 #7
0
    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');
        }
        $grid->build();
        $ggrid .= $grid->output;
        $ggrid .= form_close();
        $script = '<script language="javascript" type="text/javascript">
		$(function(){
			$(".inputnum").numeric(".");
			$(".inputonlynum").numeric();
			$(\'input[name^="margen_"]\').keyup(function() {
				nom=this.name;
				pos0=this.name.lastIndexOf("_");
				pos1=this.name.lastIndexOf("[");
				pos2=this.name.lastIndexOf("]");
				if(pos0>0 && pos1>0 && pos2>0){
					idp = this.name.substring(pos0+1,pos1);
					ind = this.name.substring(pos1+1,pos2);

					costo  = Number($("#costo\\\\["+ind+"\\\\]").val());
					iva    = Number($("#iva\\\\["+ind+"\\\\]").val());
					margen = Number($(this).val());

					precio = roundNumber((costo*100/(100-margen))*(1+(iva/100)),2);
					$("#scstp_"+idp+"\\\\["+ind+"\\\\]").val(precio);
				}
			});

			$(\'input[name^="scstp_"]\').keyup(function() {
				nom=this.name;
				pos0=this.name.lastIndexOf("_");
				pos1=this.name.lastIndexOf("[");
				pos2=this.name.lastIndexOf("]");
				if(pos0>0 && pos1>0 && pos2>0){
					idp = this.name.substring(pos0+1,pos1);
					ind = this.name.substring(pos1+1,pos2);

					precio = Number($(this).val());
					costo  = Number($("#costo\\\\["+ind+"\\\\]").val());
					iva    = Number($("#iva\\\\["+ind+"\\\\]").val());

					margen=roundNumber(100-((costo*100)/(precio/(1+(iva/100)))),2);
					$("#margen_"+idp+"\\\\["+ind+"\\\\]").val(margen);
				}
			});
		});
		</script>';
        $data['content'] = '<div class="alert">' . $error . '</div>';
        $data['content'] .= '<div>' . $msj . '</div>';
        $data['content'] .= $ggrid;
        if ($this->solo) {
            $mensaje = "<table><tr><td>Mensaje: " . $msj . "</td><td>Error: " . $error . "</td></tr></table>\n";
            return $script . "\n" . $data['content'];
        } else {
            $data['title'] = heading('Cambio de precios');
            $data['script'] = $script;
            $data['script'] .= phpscript('nformat.js');
            $data['head'] = $this->rapyd->get_head();
            $data['head'] = script('jquery.pack.js');
            $data['head'] = script('plugins/jquery.numeric.pack.js');
            $data['head'] = script('plugins/jquery.floatnumber.js');
            $data['head'] .= style('estilos.css');
            $this->load->view('view_ventanas', $data);
        }
    }
예제 #8
0
파일: fields.php 프로젝트: Jacquesvw/phpBMS
 function getJSMods()
 {
     $thereturn = parent::getJSMods();
     $thereturn["jsIncludes"][] = "common/javascript/onchange.js";
     $thereturn["topJS"][] = "onchangeArray[onchangeArray.length]=new Array(\"" . $this->name . "\");";
     return $thereturn;
 }
예제 #9
0
 function getFields($therecord)
 {
     global $db;
     $theinput = new inputField("mailchimp_apikey", $therecord["mailchimp_apikey"], "mailchimp apikey", false, NULL, 48);
     $fields[] = $theinput;
     $theinput = new inputCheckbox("mailchimp_secure", $therecord["mailchimp_secure"], "use ssl connection");
     $fields[] = $theinput;
     $theinput = new inputField("mailchimp_list_id", $therecord["mailchimp_list_id"], "list id");
     $fields[] = $theinput;
     $theinput = new inputField("mailchimp_last_sync_date", $therecord["mailchimp_last_sync_date"], "last sync date");
     $theinput->setAttribute("class", "uneditable");
     $theinput->setAttribute("readonly", "readonly");
     $fields[] = $theinput;
     return $fields;
 }
예제 #10
0
$theinput = new inputField("email", $_SESSION["userinfo"]["email"], "e-mail address", false, "email", 32, 64);
$theinput->setAttribute("title", "Enter the email address to send site mail from. Will also be used as part of your contact details.");
$theform->addField($theinput);
$theinput = new inputField("sendmail", $_SESSION["userinfo"]["sendmail"], "sendmail path", false, null, 32, 255);
$theinput->setAttribute("title", "Enter the path to the sendmail program directory on the host server. Defaults to: '/usr/sbin/sendmail -bs'");
$theform->addField($theinput);
$theinput = new inputField("smtphost", $_SESSION["userinfo"]["smtphost"], "SMTP host", false, null, 32, 255);
$theinput->setAttribute("title", "Enter the name of the SMTP host. Defaults to: 'localhost'");
$theform->addField($theinput);
$theinput = new inputField("smtpport", $_SESSION["userinfo"]["smtpport"], "SMTP port", false, "integer", 10, 10);
$theinput->setAttribute("title", "Enter the port number of your SMTP server. Use 25 for most unsecure servers and 465 for most secure servers. Defaults to: 25");
$theform->addField($theinput);
$theinput = new inputField("smtpuser", $_SESSION["userinfo"]["smtpuser"], "SMTP username", false, NULL, 32, 255);
$theinput->setAttribute("title", "Enter the username for access to the SMTP host.");
$theform->addField($theinput);
$theinput = new inputField("smtppass", $_SESSION["userinfo"]["smtppass"], "SMTP password", false, "password", 32, 255);
$theinput->setAttribute("title", "Enter the password for the SMTP host.");
$theform->addField($theinput);
$theform->jsMerge();
//==============================================================
//End Form Elements
include "header.php";
?>
<div class="bodyline">
    <form action="<?php 
echo htmlentities($_SERVER["PHP_SELF"]);
?>
" method="post" name="record" id="record" onsubmit="return false">
    <input type="hidden" id="command" name="command" value=""/>

    <h1><span><?php 
예제 #11
0
    function filteredgrid()
    {
        //$this->datasis->modulo_id(71,1);
        $this->rapyd->load("datafilter", "datagrid");
        $this->load->helper('form');
        //$this->rapyd->uri->keep_persistence();
        $mBANC = array('tabla' => 'banc', 'columnas' => array('codbanc' => 'C&oacute;odigo', 'banco' => 'Banco', 'numcuent' => 'Cuenta'), 'filtro' => array('codbanc' => 'C&oacute;odigo', 'banco' => 'Banco', 'numcuent' => 'Cuenta'), 'retornar' => array('codbanc' => 'codbanc'), 'where' => 'activo = "S"', 'titulo' => 'Buscar Bancos');
        $bBANC = $this->datasis->p_modbus($mBANC, "banc");
        $from = "(\n\t\t\tSELECT 'r_mbancrel' tipo,id,codbanc,tipo_doc,cheque,monto,fecha,fechaing,concepto,id_mbanc \n\t\t\tFROM r_mbancrel\n\t\t\t\n\t\t\tUNION ALL\n\n\t\t\tSELECT 'r_mbanc' tipo,a.id,a.codbanc,a.tipo_doc,a.cheque,a.monto,a.fecha,MAX(c.fecha) fechaing,GROUP_CONCAT(c.numero SEPARATOR ' ') concepto,id_mbanc \n\t\t\tFROM r_mbanc a\n\t\t\tJOIN r_abonosit b ON a.abono=b.abono\n\t\t\tJOIN r_recibo c ON b.recibo=c.id\n\t\t\tWHERE a.tipo_doc='DP'\n\t\t\tGROUP BY a.id\n\t\t\t\n\t\t)t";
        $filter = new DataFilter("");
        $filter->db->select(array("t.id_mbanc", "t.tipo", "t.id", "t.codbanc", "t.tipo_doc", "t.cheque", "t.monto", "t.fecha", "t.fechaing", "t.concepto", "b.numcuent", "b.banco"));
        $filter->db->from($from);
        $filter->db->join("banc b", "b.codbanc=t.codbanc");
        //$filter->db->where("LENGTH(a.id_mbancrel )=0 OR a.id_mbancrel IS NULL");
        //$filter->db->orderby("a.cheque");
        //$filter->db->where("a.tipo =", "Trabajo");
        $filter->fecha = new dateonlyField("Fecha", "fecha");
        $filter->fecha->size = 12;
        $filter->fecha->clause = 'where';
        $filter->fecha->operator = '=';
        $filter->fechaing = new dateonlyField("Fecha Ingreso", "fechaing");
        $filter->fechaing->size = 12;
        $filter->fechaing->clause = 'where';
        $filter->fechaing->operator = '=';
        $filter->codbanc = new inputField("Banco", 'codbanc');
        $filter->codbanc->size = 6;
        $filter->codbanc->append($bBANC);
        $filter->codbanc->db_name = "a.codbanc";
        $filter->tipo_doc = new dropdownField("Tipo Documento", "tipo_doc");
        $filter->tipo_doc->db_name = 'tipo_doc';
        $filter->tipo_doc->style = "width:130px;";
        $filter->tipo_doc->option("", "");
        $filter->tipo_doc->option("EF", "Efectivo");
        $filter->tipo_doc->option("DP", "Deposito");
        $filter->tipo_doc->option("DB", "Tarjeta D&eacute;bito");
        $filter->tipo_doc->option("CR", "Tarjeta Credito");
        $filter->tipo_doc->option("DF", "Diferencia");
        $filter->tipo = new dropdownField("Origen", "tipo");
        $filter->tipo->style = "width:130px;";
        $filter->tipo->option("", "");
        $filter->tipo->option("r_mbancrel", "Relaciones");
        $filter->tipo->option("r_mbanc", "Cobranzas");
        $filter->buttons("reset", "search");
        $filter->build();
        $total = new inputField("Total", "total");
        $total->status = "create";
        $total->size = 15;
        $total->build();
        $salida = $total->label . $total->output;
        $grid = new DataGrid("");
        function sel($numero, $tipo)
        {
            return form_checkbox('data[]', $tipo . '_._' . $numero);
        }
        $codbanc = new inputField("Cod Banco", "codbanc");
        $codbanc->grid_name = 'codbanc_<#tipo#>_<#id#>';
        $codbanc->status = 'modify';
        $codbanc->size = 12;
        $codbanc->type = 'inputhidden';
        $fecha = new inputField("Fecha", "fecha");
        $fecha->grid_name = 'fecha_<#tipo#>_<#id#>';
        $fecha->status = 'modify';
        $fecha->size = 12;
        $fecha->type = 'inputhidden';
        $fechaing = new inputField("Fecha Ingreso", "fechaing");
        $fechaing->grid_name = 'fechaing_<#tipo#>_<#id#>';
        $fechaing->status = 'modify';
        $fechaing->size = 12;
        $fechaing->type = 'inputhidden';
        $tipo_doc = new inputField("Tipo Documento", "tipo_doc");
        $tipo_doc->grid_name = 'tipo_doc_<#tipo#>_<#id#>';
        $tipo_doc->status = 'modify';
        $tipo_doc->size = 12;
        $tipo_doc->type = 'inputhidden';
        $cheque = new inputField("Transaccion", "cheque");
        $cheque->grid_name = 'cheque_<#tipo#>_<#id#>';
        $cheque->status = 'modify';
        $cheque->size = 12;
        $monto = new inputField("Monto", "monto");
        $monto->grid_name = 'monto_<#tipo#>_<#id#>';
        $monto->status = 'modify';
        $monto->size = 12;
        $monto->css_class = 'inputnum';
        $monto->readonly = true;
        $concepto = new textAreaField("Concepto", "concepto");
        $concepto->grid_name = 'concepto_<#tipo#>_<#id#>';
        $concepto->status = 'modify';
        $concepto->rows = 1;
        $concepto->cols = 15;
        $data = array('name' => 'todo', 'id' => 'todo', 'checked' => FALSE, 'style' => 'margin:10px');
        $salida1 = form_checkbox($data);
        $atts3 = array('width' => '640', 'height' => '480', 'scrollbars' => 'yes', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => '5', 'screeny' => '5');
        $uri = anchor_popup('tesoreria/mbanc/dataedit/show/<#id_mbanc#>', '<#id_mbanc#>', $atts3);
        $grid = new DataGrid($salida);
        $grid->order_by("cheque", "asc");
        $grid->per_page = 100;
        $grid->use_function('substr', 'str_pad', 'sel', 'nformat');
        $grid->column($salida1, "<sel><#id#>|<#tipo#></sel>");
        $grid->column_orderby("Cod. Banco", $codbanc, "codbanc", "align='left'  ");
        $grid->column_orderby("Banco", "banco", "banco", "align='left'  ");
        $grid->column_orderby("Cuenta", "numcuent", "numcuent", "align='left'  ");
        $grid->column_orderby("Transaccion", $cheque, "cheque", "align='left'  ");
        $grid->column_orderby("Fecha", $fecha, "fecha", "align='center'");
        $grid->column_orderby("Fecha Ingreso", $fechaing, "fechaing", "align='center'");
        $grid->column_orderby("Tipo Doc", $tipo_doc, "tipo_doc", "align='center'");
        $grid->column_orderby("Monto", $monto, "monto", "align='right' ");
        $grid->column_orderby("Concepto", $concepto, "concepto", "align='left'  ");
        $grid->column_orderby("Mov Bancario", $uri, "id_mbanc", "align='left'  ");
        $grid->build();
        //echo $grid->db->last_query();
        $salida = form_open($this->url . 'guarda');
        $salida .= $grid->output;
        $salida .= form_submit('Pasar  Datos', 'Pasar  Datos');
        $salida .= form_close();
        $data['filtro'] = $filter->output;
        $data['content'] = $salida;
        $data['script'] = script("jquery.js") . "\n";
        $data['script'] = '<script language="javascript" type="text/javascript">';
        $data['script'] .= '
		function suma(){
			t=0;
			$(":checkbox").each(function(i,val){
				name =val.name;
				if(name.substring(0,4)=="data"){
				
					if(val.checked==true){
						monto=parseFloat($("#monto_"+val.value).val());
						tipo =val.name.substr(2,2);
						t=t+monto;
					}
				}
			});
			$("#total").val(Math.round(t*100)/100);
		}

		$(document).ready(function(){
			suma();
			$("#todo").change(function(){
				
				console.log("aaa");
				var ch=$(this).is(":checked");
				$(":checkbox").each(function(i,val){
					if(ch==true){
						val.checked=true;
					}else{
						val.checked=false;
					}
					
				});
			});
			
			
			$(":checkbox").change(function(){
				suma();
			});
		});';
        $data['script'] .= '</script>';
        $data['title'] = "Seleccione las Movimientos Bancarios ";
        $data['head'] = $this->rapyd->get_head() . script('jquery.js');
        $this->load->view('view_ventanas', $data);
    }
예제 #12
0
 function solicitud($valor, $value = null)
 {
     //$tipo,$codigoadm,$codigopres,
     $campo = new inputField("Title2", "gs[{$valor}]");
     $campo->status = "create";
     $campo->css_class = 'inputnum';
     $campo->size = 10;
     $campo->insertValue = $value;
     $campo->build();
     return $campo->output;
 }
예제 #13
0
    function selectr_mbanc()
    {
        //$this->datasis->modulo_id(71,1);
        $this->rapyd->load("datafilter", "datagrid");
        $this->load->helper('form');
        //$this->rapyd->uri->keep_persistence();
        $mBANC = array('tabla' => 'banc', 'columnas' => array('codbanc' => 'C&oacute;odigo', 'banco' => 'Banco', 'numcuent' => 'Cuenta'), 'filtro' => array('codbanc' => 'C&oacute;odigo', 'banco' => 'Banco', 'numcuent' => 'Cuenta'), 'retornar' => array('codbanc' => 'codbanc'), 'where' => 'activo = "S"', 'titulo' => 'Buscar Bancos');
        $bBANC = $this->datasis->p_modbus($mBANC, "banc");
        $filter = new DataFilter("");
        $filter->db->select(array("a.id", "a.abono", "a.codmbanc", "a.codbanc", "a.tipo_doc", "a.cheque", "a.monto", "a.fecha", "a.concepto", "a.id_mbancrel", "b.numcuent", "b.banco"));
        $filter->db->from("r_mbanc a");
        $filter->db->join("banc b", "b.codbanc=a.codbanc", "left");
        $filter->db->where("(LENGTH(a.id_mbancrel)=0 OR a.id_mbancrel IS NULL OR a.id_mbancrel=0)");
        //OR a.id_mbancrel=0
        #$filter->db->where("LENGTH(a.id_mbancrel )=0 OR a.id_mbancrel IS NULL");
        //$filter->db->orderby("a.cheque");
        //$filter->db->where("a.tipo =", "Trabajo");
        $filter->fecha = new dateonlyField("Fecha", "fecha");
        $filter->fecha->size = 12;
        $filter->fecha->clause = 'where';
        $filter->fecha->operator = '=';
        $filter->codbanc = new inputField("Banco", 'codbanc');
        $filter->codbanc->size = 6;
        $filter->codbanc->append($bBANC);
        $filter->codbanc->db_name = "a.codbanc";
        $filter->tipo_doc = new dropdownField("Tipo Documento", "tipo_doc");
        $filter->tipo_doc->db_name = 'tipo_doc';
        $filter->tipo_doc->style = "width:130px;";
        $filter->tipo_doc->option("", "");
        $filter->tipo_doc->option("EF", "Efectivo");
        $filter->tipo_doc->option("DP", "Deposito");
        $filter->tipo_doc->option("DB", "Tarjeta D&eacute;bito");
        $filter->tipo_doc->option("CR", "Tarjeta Credito");
        $filter->tipo_doc->option("DF", "Diferencia");
        $filter->buttons("reset", "search");
        $filter->build();
        $total = new inputField("Total", "total");
        $total->status = "create";
        $total->size = 15;
        $total->build();
        $salida = $total->label . $total->output;
        $iralfiltropagoc = anchor($this->url . 'filteredgrid', 'Ir al Filtro');
        $grid = new DataGrid($iralfiltropagoc);
        function sel($numero)
        {
            return form_checkbox('data[]', $numero);
        }
        $monto = new inputField("Monto", "monto");
        $monto->grid_name = 'monto<#id#>';
        $monto->status = 'modify';
        $monto->size = 12;
        $monto->css_class = 'inputnum';
        $monto->readonly = true;
        $data = array('name' => 'todo', 'id' => 'todo', 'checked' => FALSE, 'style' => 'margin:10px');
        $salida1 = form_checkbox($data);
        $grid = new DataGrid($iralfiltropagoc . "</br>" . $salida);
        $grid->order_by("cheque", "asc");
        $grid->per_page = 1000;
        $grid->use_function('substr', 'str_pad', 'sel', 'nformat');
        $grid->column($salida1, "<sel><#id#></sel>");
        $grid->column_orderby("Cod. Banco", "codbanc", "codbanc", "align='left'  ");
        $grid->column_orderby("Banco", "banco", "banco", "align='left'  ");
        $grid->column_orderby("Cuenta", "numcuent", "numcuent", "align='left'  ");
        $grid->column_orderby("Transaccion", "cheque", "cheque", "align='left'  ");
        $grid->column_orderby("Fecha", "<dbdate_to_human><#fecha#></dbdate_to_human>", "fecha", "align='center'");
        $grid->column_orderby("Tipo Doc", "tipo_doc", "tipo_doc", "align='center'");
        $grid->column_orderby("Monto", $monto, "monto", "align='right' ");
        $grid->build();
        $grid->db->last_query();
        $salida = form_open($this->url . 'guarda');
        $salida .= $grid->output;
        $salida .= form_submit('Crear Relacion', 'Crear Relacion');
        $salida .= form_close();
        $data['filtro'] = $filter->output;
        $data['content'] = $salida;
        $data['script'] = script("jquery.js") . "\n";
        $data['script'] = '<script language="javascript" type="text/javascript">';
        $data['script'] .= '
		function suma(){
			t=0;
			$(":checkbox").each(function(i,val){
				name =val.name;
				console.log("substr"+name.substring(0,4));
				if(name.substring(0,4)=="data"){
				
					if(val.checked==true){
						monto=parseFloat($("#monto"+val.value).val());
						tipo =val.name.substr(2,2);
						t=t+monto;
					}
				}
			});
			$("#total").val(Math.round(t*100)/100);
		}

		$(document).ready(function(){
			suma();
			$("#todo").change(function(){
				
				console.log("aaa");
				var ch=$(this).is(":checked");
				console.log("aaa"+ch);
				$(":checkbox").each(function(i,val){
					if(ch==true){
						val.checked=true;
					}else{
						val.checked=false;
					}
					
				});
			});
			
			
			$(":checkbox").change(function(){
				suma();
			});
		});';
        $data['script'] .= '</script>';
        $data['title'] = "Seleccione las Movimientos Bancarios ";
        $data['head'] = $this->rapyd->get_head() . script('jquery.js');
        $this->load->view('view_ventanas', $data);
    }