Пример #1
0
 function consultaBl($id_atencion)
 {
     //----------------------------------------------------------
     $d = array();
     $d['id_atencion'] = $id_atencion;
     $d['atencion'] = $this->urgencias_model->obtenerAtencion($id_atencion);
     $d['paciente'] = $this->paciente_model->obtenerPacienteConsulta($d['atencion']['id_paciente']);
     $d['tercero'] = $this->paciente_model->obtenerTercero($d['paciente']['id_tercero']);
     $d['ultima_nota'] = $this->enfermeria_model->obtenerUltimaNota($id_atencion);
     //Codificación de la sala de espera según el servicio
     $d['notas'] = $this->enfermeria_model->obtenerBlNotas($id_atencion, $d['atencion']['id_servicio']);
     //print_r($d['notas']);
     $id_serv = $d['atencion']['id_servicio'];
     $d['urlRegresar'] = site_url('/hce/main/consultarAtencion/' . $id_atencion);
     ////////////////////capturamos los valores de los liquidos eliminados/////////////////////
     $bar_1 = array();
     $bar_2 = array();
     $bar_3 = array();
     $tamano = array();
     $tamanoadmi = 0;
     $tamanoelimi = 0;
     $eliminadodia = array();
     $administradodia = array();
     $balance = array();
     $fechas = array();
     $d['valorelimi'] = $this->enfermeria_model->obtenerBlEliminados($id_atencion, $d['atencion']['id_servicio']);
     if ($d['valorelimi'] != 0) {
         foreach ($d['valorelimi'] as $item) {
             $eliminadodia[] = -$item['drend'] - $item['drene'] - $item['storaxe'] - $item['storaxd'] - $item['vomito'] - $item['orina'] - $item['otros'] - $item['deposicion'] - $item['sng'];
             $fechas[] = $item['fecha_nota'];
         }
         $tamanoelimi = sizeof($eliminadodia);
     }
     /////////////////////////////////////////////////////////////////////////////////////////////
     ////////////////////capturamos los valores de los liquidos eliminados/////////////////////
     $d['valoradmi'] = $this->enfermeria_model->obtenerBlAdministrados($id_atencion, $d['atencion']['id_servicio']);
     if ($d['valoradmi'] != 0) {
         foreach ($d['valoradmi'] as $item) {
             $administradodia[] = $item['liv'] + $item['sng'] + $item['via_oral'];
         }
         $tamanoadmi = sizeof($administradodia);
     }
     if ($tamanoadmi == $tamanoelimi) {
         $tamano = $tamanoelimi;
     } else {
         if ($tamanoadmi > $tamanoelimi) {
             $tamano = $tamanoelimi;
         } else {
             if ($tamanoadmi < $tamanoelimi) {
                 $tamano = $tamanoadmi;
             }
         }
     }
     /////////////////////////////////////////////////////////////////////////////////////////////
     for ($i = 0; $i < $tamano; $i++) {
         $balance[] = $administradodia[$i] + $eliminadodia[$i];
     }
     //print_r($balance);
     // generate some random data
     srand((double) microtime() * 1000000);
     $bar_1 = new bar_glass(55, '#5E83BF', '#424581');
     $bar_1->key('Administrados', 10);
     // add 10 bars with random heights
     $maxadmi = 0;
     if ($administradodia != 0) {
         foreach ($administradodia as $item) {
             $bar_1->data[] = $item;
             if ($maxadmi < $item) {
                 $maxadmi = $item;
             }
         }
     }
     //
     // create a 2nd set of bars:
     //
     $bar_2 = new bar_glass(55, '#D54C78', '#C31812');
     $bar_2->key('Eliminados', 10);
     $maxelimi = 0;
     // make 10 bars of random heights
     if ($eliminadodia != 0) {
         foreach ($eliminadodia as $item) {
             $bar_2->data[] = $item;
             if ($maxelimi > $item) {
                 $maxelimi = $item;
             }
         }
     }
     $bar_3 = new bar_glass(55, '#83bf5d', '#448141');
     $bar_3->key('Balance', 10);
     // add 10 bars with random heights\
     if ($balance != 0) {
         foreach ($balance as $item) {
             $bar_3->data[] = $item;
         }
     }
     $this->graph->title('Balance de líquidos', '{font-size:20px; color: #5e6b7f; margin:10px; padding: 5px 15px 5px 15px;}');
     // add both sets of bars:
     $this->graph->data_sets[] = $bar_1;
     $this->graph->data_sets[] = $bar_2;
     $this->graph->data_sets[] = $bar_3;
     // label the X axis (10 labels for 10 bars):
     $this->graph->set_x_labels($fechas);
     // colour the chart to make it pretty:
     $this->graph->x_axis_colour('#909090', '#D2D2FB');
     $this->graph->y_axis_colour('#909090', '#D2D2FB');
     //$this->graph->set_y_min( $maxelimi);
     //$this->graph->set_y_max( $maxadmi);
     $this->graph->set_y_min(-2000);
     $this->graph->set_y_max(2000);
     $this->graph->y_label_steps(10);
     $this->graph->set_y_legend('mililitros (mL)', 12, '#736AFF');
     $this->graph->set_output_type('js');
     //-----------------------------------------------------------
     $this->load->view('core/core_inicio');
     $this->load->view('urg/urg_blListadoM', $d);
     $this->load->view('core/core_fin');
     //----------------------------------------------------------
 }
Пример #2
0
 function grafico($codigo = '', $mes = '', $anio = '')
 {
     $this->load->library('Graph');
     if (empty($mes) and empty($anio)) {
         return;
     }
     $fechad = $anio . str_pad($mes, 2, "0", STR_PAD_LEFT) . '01';
     $fechah = $anio . str_pad($mes, 2, "0", STR_PAD_LEFT) . '31';
     $mSQL = "SELECT DATE_FORMAT(fecha, '%d')as fecha, codigo, sum(cantidad) cantidad, IF(sum(cantidad)<=salcant,sum(cantidad),salcant)*(salcant>0)as salcant \n\t\tFROM costos \n\t\tWHERE codigo='{$codigo}' AND fecha>='{$fechad}' AND fecha<='{$fechah}' AND origen='3I'\n\t\tGROUP BY fecha HAVING cantidad>0";
     echo $mSQL;
     $maxval = 0;
     $query = $this->db->query($mSQL);
     foreach ($query->result() as $row) {
         if ($row->cantidad > $maxval) {
             $maxval = $row->cantidad;
         }
         $fecha[] = $row->fecha;
         $codigo = $row->codigo;
         $data_1[] = $row->cantidad;
         $data_2[] = $row->salcant;
     }
     $fechadd = dbdate_to_human($fechad);
     $fechahh = dbdate_to_human($fechah);
     $nombre = $this->datasis->dameval("SELECT descrip FROM sinv WHERE codigo='{$codigo}'");
     $om = 1;
     while ($maxval / $om > 100) {
         $om = $om * 10;
     }
     $bar_1 = new bar_glass(55, '#D54C78', '#C31812');
     $bar_1->key('Ventas', 10);
     $bar_2 = new line_dot(3, 5, '#0066CC', 'Downloads', 10);
     $bar_2->key('Existencias', 10);
     for ($i = 0; $i < count($data_1); $i++) {
         $bar_1->add_data_tip($data_1[$i] / $om, graph::esc(number_format($data_1[$i], 2, ',', '.')));
         $bar_2->add_data_tip($data_2[$i] / $om, graph::esc(number_format($data_2[$i], 2, ',', '.')));
         //  $bar_1->links[]= site_url("/inventario/gproductos/mensuales/$anio/".str_replace('/',':slach:',$proveed[$i]));
         //  $bar_1->links[]= site_url("/inventario/gproductos/mensuales/$anio/".raencode($proveed[$i]));
     }
     $g = new graph();
     $g->set_is_decimal_separator_comma(1);
     if ($maxval > 0) {
         $g->title('Grafico de ' . $nombre . ' Desde ' . $fechadd . ' Hasta ' . $fechahh, '{font-size: 16px; color:#0F3054}');
         $g->data_sets[] = $bar_1;
         $g->data_sets[] = $bar_2;
         $g->set_x_labels($fecha);
         $g->set_x_label_style(10, '#000000', 2, 1);
         $g->set_x_axis_steps(10);
         $g->set_x_legend('Fecha', 14, '#004381');
         $g->bg_colour = '#FFFFFF';
         $g->set_tool_tip('#key#<br>Fecha: #x_label# <br>Cantidad: #tip#');
         $g->set_y_max(ceil($maxval / $om));
         $g->y_label_steps(5);
         //$g->set_y_legend('Ventas x '.number_format($om,0,'','.').' (Bs)', 16, '#004381' );
     } else {
         $g->title('No existen datos con la informacion seleccionada', '{font-size:18px; color: #d01f3c}');
     }
     $g->bg_colour = '#FFFFFF';
     echo utf8_encode($g->render());
 }
Пример #3
0
$chart->x_axis = null;

echo $chart->toPrettyString();
*/
$title = new title("ESTADISTICAS CONTROL DE LEGALIDAD");
$data = array($_SESSION['total1']);
$bar = new bar_glass();
$bar->colour('#0404B4');
$bar->key('SOLICITUDES', 12);
$bar->set_values($data);
$data2 = array($_SESSION['total2']);
$bar2 = new bar_glass();
$bar2->colour('#5FB404');
$bar2->key('RESPUESTAS', 12);
$bar2->set_values($data2);
$data3 = array($_SESSION['total3']);
$bar3 = new bar_glass();
$bar3->colour('#BF3B69');
$bar3->key('EN TRAMITE', 12);
$bar3->set_values($data3);
$y = new y_axis();
$y->set_range(0, $_SESSION['total1'], 25);
$chart = new open_flash_chart();
$chart->set_title($title);
$chart->set_bg_colour('#FFFFFF');
$chart->add_element($bar);
$chart->add_element($bar2);
$chart->add_element($bar3);
$chart->add_y_axis($y);
echo $chart->toString();
Пример #4
0
for($i = 0; $i < $total; $i ++) {
	$resultado = resultadorelatorio ( $idcolecao [$i], $param );
	$bar->data [] = $resultado;
	if ($resultado > $maiorvalor) {
		$maiorvalor = $resultado;
	}
	if ($resultado < $menorvalor) {
		$menorvalor = $resultado;
	}
}

srand ( ( double ) microtime () * 1000000 );

$bar_1 = new bar_glass ( 55, '#5E83BF', '#424581' );
$bar_1->key ( titulo_selecionado ( $param ), 10 );

for($i = 0; $i < $total; $i ++)
	$bar_1->data [] = resultadorelatorio ( $vetor_url [$i], $param );

$g = new graph ( );

$g->data_sets [] = $bar_1;

$g->set_x_labels ( $nome_colecao );

$g->x_axis_colour ( '#FFFFFF', '#D2D2FB' );
$g->y_axis_colour ( '#FFFFFF', '#D2D2FB' );

$g->bg_colour = '#FFFFFF';
Пример #5
0
$tooltip->set_hover();
$title = new title("\nJahresueberblick");
$title->set_style('{font-size: 20px; color: #778877}');
$bar_last = new bar_glass();
$bar_last->key("Voriges Jahr {$last_year}", 12);
$bar_last->colour('#546656');
$bar_last->set_tooltip('#val# kWh');
$data = array();
for ($i = 0; $i < count($data_last); $i++) {
    $bval = new bar_value($data_last[$i]);
    $bval->{"on-click"} = "load_chart('month',{$ltime_axis[$i]})";
    $data[] = $bval;
}
$bar_last->set_values($data);
$bar_curr = new bar_glass();
$bar_curr->key("Aktuelles Jahr {$curr_year}", 12);
$bar_curr->colour('#EFC01D');
$bar_curr->set_alpha(0.8);
$bar_curr->set_tooltip('#val# kWh');
$data = array();
for ($i = 0; $i < count($data_curr); $i++) {
    $bval = new bar_value($data_curr[$i]);
    $bval->{"on-click"} = "load_chart('month',{$ttime_axis[$i]})";
    $data[] = $bval;
}
$bar_curr->set_values($data);
$lin_soll = new Line();
$lin_soll->set_key("Sollwert {$curr_year}", 11);
$lin_soll->set_colour('#BFA447');
$lin_soll->set_width(1);
$lin_soll->set_values($data_soll);
Пример #6
0
for($i = 0; $i < $total; $i ++) {
	$resultado = resultadorelatorio_fornecedor ( $idfornecedor [$i], $param );
	$bar->data [] = $resultado;
	if ($resultado > $maiorvalor) {
		$maiorvalor = $resultado;
	}
	if ($resultado < $menorvalor) {
		$menorvalor = $resultado;
	}
}

srand ( ( double ) microtime () * 1000000 );

$bar_1 = new bar_glass ( 55, '#5E83BF', '#424581' );
$bar_1->key ( titulo_selecionado_fornecedor ( $param ), 10 );

for($i = 0; $i < $total; $i ++)
	$bar_1->data [] = ( double ) resultadorelatorio_fornecedor ( $vetor_url [$i], $param );

$g = new graph ( );

//$g->data_sets[] = $bar;
$g->data_sets [] = $bar_1;

$g->set_x_labels ( $nome_fornecedor );

$g->x_axis_colour ( '#FFFFFF', '#D2D2FB' );
$g->y_axis_colour ( '#FFFFFF', '#D2D2FB' );

$g->bg_colour = '#FFFFFF';