/* cURL + GraphViz */
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Graph extends CI_Controller {
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/graph
* - or -
* http://example.com/graph/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's disayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /graph/<method_name>
* @see http://codeigniter.com/user_guide/general/urls.html
*/
public function __construct() {
parent::__construct();
$this->load->model('strona');
require_once 'Image/GraphViz.php';
}
public function index() {
$this->db->where('poziom <=', 2);
$wynik = $this->db->get('zasieg')->result();
$gv = new Image_GraphViz();
$nodeatts = array(
'shape' => "circle",
'style' => "filled",
'fillcolor' => "#00aa00",
'fixedsize' => FALSE,
'fontsize' => 8,
'margin' => "0.1, 0.1",
'splines' => TRUE,
'overlap' => FALSE
);
$nodeatts2 = array(
'shape' => "ellipse",
'style' => "filled",
'fillcolor' => "#00aaaaaa",
'fixedsize' => FALSE,
'fontsize' => 8,
'margin' => "0.0001, 0.0001",
'splines' => TRUE,
'overlap' => FALSE,
);
$edgeatts = array(
'arrowsize' => 0.6,
'sametail' => TRUE,
'len' => 5
);
$nicki = array();
for($i=0; $i<=count($wynik)-1; ++$i) {
$gv->addNode($wynik[$i]->nick, $nodeatts);
$nicki[] = $wynik[$i]->nick;
if(!in_array($wynik[$i]->znajomy, $nicki)) $gv->addNode($wynik[$i]->znajomy, $nodeatts2);
$gv->addEdge(array($wynik[$i]->nick => $wynik[$i]->znajomy), $edgeatts);
}
$gv->image('jpg', 'neato');
}
}
/* End of file graph.php */
/* Location: ./application/controllers/graph.php */
Inni zdjęcia: Zegar kolejowy ? ezekh114Blu-tu. ezekh114Przygoda na greckiej Evii 4/4 activegamesPrzygoda na greckiej Evii 2/4 activegamesPrzygoda na greckiej Evii 3/4 activegamesPrzygoda na greckiej Evii 1/4 activegamesOkno felgebelCiekawa cegla felgebelCiekawa latarnia felgebelGryzmoły felgebel