/**
  * Adds the error message to the error log in the lavacharts master object.
  *
  * @param string $msg error message.
  */
 private function error($msg)
 {
     Lavacharts::_set_error(get_class($this), $msg);
 }
 /**
  * Adds an error message to the error log in the lavacharts object.
  *
  * @param string $msg
  */
 public function error($msg)
 {
     Lavacharts::_set_error($this->className, $msg);
 }
示例#3
0
 function view_rapport()
 {
     require 'vendor/autoload.php';
     $this->load->helper('html');
     $this->load->helper('url');
     $this->load->view('bootstrap/header');
     $this->load->view('bootstrap/nav');
     $this->load->model(array('Issue', 'Publication'));
     $this->load->model("extract");
     $issue = new Issue();
     //$this->load->library('MY_Chart');
     //$this->load->My_Chart->load();
     $issue->load($issue_id);
     if (!$issue->issue_id) {
         show_404();
     }
     $publication = new Publication();
     $publication->load($issue->publication_id);
     $table1 = $this->extract->extract_csv('uploads/' . $issue->issue_cover);
     foreach ($table1 as $table) {
         $period = array_shift($table);
         foreach ($table as $value) {
             //$period = array_shift($value);
             //unset($value[0]);
             $data[] = $value;
             //print_r($value);
         }
     }
     foreach ($data as $key) {
         $topsökord[] = $key['Sökord'];
         $topklicks[] = $key['Klick'];
     }
     $top = array_combine($topsökord, $topklicks);
     arsort($top);
     array_shift($top);
     $top5 = array_slice($top, 0, 5);
     /*
     		foreach($data as $key) {
     			$topsökord[] = $data;
     			$topklicks[] = $key;
     		}*/
     while ($sökord = current($top5)) {
         $sökordtop[] = key($top5);
         $klickstop[] = $sökord;
         next($top5);
     }
     $lava = new Lavacharts();
     // See note below for Laravel
     $finances = $lava->DataTable();
     $finances->addStringColumn('sökord')->addNumberColumn('Klick')->setDateTimeFormat('Y')->addRow(array($sökordtop[0], $klickstop[0]))->addRow(array($sökordtop[1], $klickstop[1]))->addRow(array($sökordtop[2], $klickstop[2]))->addRow(array($sökordtop[3], $klickstop[3]))->addRow(array($sökordtop[4], $klickstop[4]));
     $columnchart = $lava->ColumnChart('Finances')->setOptions(array('datatable' => $finances, 'title' => 'Top 5 sökord', 'colors' => ['#FF0000'], 'titleTextStyle' => $lava->TextStyle(array('color' => '#FF0000', 'fontSize' => 20))));
     $this->load->view('magazine', array('issue' => $issue, 'foretagsnamn' => $issue->foretagsnamn, 'table1' => $table1, 'columnchart' => $columnchart, 'lava' => $lava, 'publication' => $publication));
     $this->load->helper('url');
     $this->load->view('bootstrap/footer');
     $data = $this->customers_model->editFöretagsinformation($_REQUEST['id']);
     //echo $id;
     //print_r($data);
     if (isset($_REQUEST['search_option']) && $_REQUEST['search_option'] != "") {
         $search_option = $_REQUEST['search_option'];
         $get_search = $_REQUEST['get_search'];
     } else {
         $search_option = "";
         $get_search = "";
     }
     $total = $this->customers_model->gettotalCustomers();
     /* Load the 'pagination' library */
     $this->load->library('pagination');
     /* Set the config parameters */
     $config['base_url'] = base_url() . "index.php/dashboard/index";
     $config['total_rows'] = $total;
     $config['per_page'] = 5;
     $config["uri_segment"] = 3;
     $this->pagination->initialize($config);
     $page = $this->uri->segment(3) ? $this->uri->segment(3) : 0;
     /* Setup the variables that will be passed to the view */
     $data = array('rows' => $this->customers_model->getCustomers($search_option, $get_search, $config["per_page"], $page), 'pages' => $this->pagination->create_links());
     $this->load->view('includes/header', $data);
     //redirect('customers/customers_information');
     $data["customers_information"] = $this->customers_model->getdataCustomers();
     $data["supplier_lists"] = $this->modeladmin->Get_supplierDetails();
     $data["billing_duration"] = $this->modeladmin->Get_billingdetails();
     $data["getcontacttype"] = $this->customers_model->getcontractType();
     $this->load->view('customers/customers_information', $data);
     //$this->load->view('dashboard/index',$data);
     $this->load->view('includes/footer');
 }