Example #1
0
    function reporte()
    {
        header('Content-Type: text/html; charset=' . $this->config->item('charset'));
        $this->rapyd->load('dataedit');
        $this->rapyd->uri->keep_persistence();
        $atts = array('width' => '800', 'height' => '600', 'scrollbars' => 'yes', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => '0', 'screeny' => '0');
        $edit = new DataEdit('', 'reportes');
        $id = $edit->_dataobject->pk['nombre'];
        $uri2 = anchor_popup('reportes/ver/' . $id, 'Probar reporte', $atts);
        $uri3 = anchor_popup('supervisor/mantenimiento/centinelas', 'Centinela', $atts);
        $edit->title(' ');
        $script = '
		$("#df1").submit(function(){
			$("#proteo").val(editor.getValue());

			$.post("' . site_url('supervisor/repomenu/gajax_proteo/update/' . $id) . '", {nombre: "' . $id . '", proteo: $("#proteo").val()},
				function(data){
					//alert("Reporte guardado" + data);
				}
			);
			return false;
		});

		function guarda() {
			$("#proteo").val(editor.getValue());
			$.post("' . site_url('supervisor/repomenu/gajax_proteo/update/' . $id) . '", {nombre: "' . $id . '", proteo: $("#proteo").val()},
				function(data){
					//alert("Reporte guardado" + data);
				}
			);
			return false;
		};

		function fcargar(){
			$.post("' . site_url('supervisor/repomenu/cargar/') . '", { nombre:"' . $id . '"},
			function(data){
				if (data){ $("#proteo").val(editor.setValue(data)); } else { alert("Archivo vacio");}
			});
			return false;
		};

		function fguardar(){
			$("#proteo").val(editor.getValue());
			$.post("' . site_url('supervisor/repomenu/guardar/') . '", {nombre: "' . $id . '", proteo: $("#proteo").val()},
			function(data){
				alert(data);
			});
			return false;
		};';
        $edit->script($script, 'modify');
        $edit->back_save = true;
        $edit->back_cancel = true;
        $edit->back_cancel_save = true;
        $edit->back_url = site_url('supervisor/repomenu/filteredgrid');
        $edit->proteo = new textareaField('', 'proteo');
        $edit->proteo->rows = 30;
        $edit->proteo->cols = 130;
        $edit->proteo->css_class = 'text-indent:100px;width:90%;11';
        //$edit->buttons('modify', 'save', 'undo', 'delete', 'back');
        //$accion=$this->datasis->jwinopen(site_url('reportes/ver/'.$id."'"));
        //$edit->button_status('btn_probar','Probar Reporte',$accion,'TL','modify');
        //$accion=$this->datasis->jwinopen(site_url('supervisor/mantenimiento/centinelas'));
        //$edit->button_status('btn_centinela','Centinelas',$accion,'TL','modify');
        //$edit->button_status('btn_guardar'  ,'Guardar a Archivo'   ,'fguardar()','TL','modify');
        //$edit->button_status('btn_cargar'   ,'Cargar desde Archivo','fcargar()' ,'TL','modify');
        $edit->build();
        $rt = array('status' => '', 'msj' => '', 'pk' => '');
        if ($edit->on_success()) {
            $rt['status'] = 'A';
            $rt['msj'] = 'Guardado';
            echo json_encode($rt);
        }
        if ($edit->on_error()) {
            $rt['status'] = 'B';
            $rt['msj'] = $edit->error_string;
            echo json_encode($rt);
        }
        //$this->rapyd->jquery[]='$("#proteo").tabby();';
        //$this->rapyd->jquery[]='$("#proteo").linedtextarea();';
        if ($edit->on_show()) {
            $data['back_url'] = $edit->back_url;
            $data['content'] = $edit->output;
            $data['title'] = $id;
            $data['head'] = $this->rapyd->get_head();
            $this->load->view('editorep', $data);
        }
    }
Example #2
0
    function reporte()
    {
        $this->rapyd->load('dataedit');
        $this->rapyd->uri->keep_persistence();
        $atts = array('width' => '800', 'height' => '600', 'scrollbars' => 'yes', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => '0', 'screeny' => '0');
        $edit = new DataEdit('', 'reportes');
        $id = $edit->_dataobject->pk['nombre'];
        $uri2 = anchor_popup('reportes/ver/' . $id, 'Probar reporte', $atts);
        $uri3 = anchor_popup('supervisor/mantenimiento/centinelas', 'Centinela', $atts);
        $edit->title($uri2 . ' ' . $uri3);
        $script = '
		$(document).ready(function() {
			$("#proteo").tabby();
			$("#proteo").linedtextarea();

			$("#df1").submit(function(){
			$.post("' . site_url('supervisor/repomenu/gajax_proteo/update/' . $id) . '", {nombre: "' . $id . '", proteo: $("#proteo").val()},
				function(data){
					alert("Reporte guardado" + data);
				},
				"application/x-www-form-urlencoded;charset=' . $this->config->item('charset') . '"
				);
				return false;
			});
		})';
        $edit->script($script, 'modify');
        $edit->back_save = true;
        $edit->back_cancel = true;
        $edit->back_cancel_save = true;
        $edit->back_url = site_url('supervisor/repomenu/filteredgrid');
        $edit->proteo = new textareaField('', 'proteo');
        $edit->proteo->rows = 30;
        $edit->proteo->cols = 180;
        $edit->proteo->css_class = 'codepress php linenumbers-on readonly-off';
        //$edit->proteo->when = array('create','modify');
        $edit->buttons('modify', 'save', 'undo', 'delete', 'back');
        $edit->build();
        if ($this->genesal) {
            $data['content'] = $edit->output;
            $data['title'] = '';
            $data['head'] = $this->rapyd->get_head() . script('jquery.js');
            //$data['head']   .= script('codepress/codepress.js');
            $data['head'] .= script('plugins/jquery-linedtextarea.js') . script('plugins/jquery.textarea.js') . style('jquery-linedtextarea.css');
            $script = '$(document).ready(function() {
				$("#proteo").tabby();
				$("#proteo").linedtextarea();
			})';
            $this->load->view('view_ventanas_sola', $data);
        } else {
            echo $edit->error_string;
        }
    }