Пример #1
0
 function index()
 {
     $this->open();
     # config pagination
     $config['base_url'] = base_url() . 'index.php/dashboard/index/';
     $this->pagination->initialize($config);
     # end config pagination
     $year = date('Y');
     $db['setoran_awal'] = $this->dashboard->setoran_awal($year);
     $data['setoran_awal'] = $db['setoran_awal']->row()->setoran_awal;
     $db['setoran_lunas'] = $this->dashboard->setoran_lunas($year);
     $data['setoran_lunas'] = $db['setoran_lunas']->row()->setoran_lunas;
     $db['setoran_lunas_tunda'] = $this->dashboard->setoran_lunas_tunda($year);
     $data['setoran_lunas_tunda'] = $db['setoran_lunas_tunda']->row()->setoran_lunas_tunda;
     $db['pembatalan_setoran_awal'] = $this->dashboard->pembatalan_setoran_awal($year);
     $data['pembatalan_setoran_awal'] = $db['pembatalan_setoran_awal']->row()->pembatalan_setoran_awal;
     $db['pembatalan_setoran_lunas'] = $this->dashboard->pembatalan_setoran_lunas($year);
     $data['pembatalan_setoran_lunas'] = $db['pembatalan_setoran_lunas']->row()->pembatalan_setoran_lunas;
     # load view
     $this->load->helper(array('url', 'fusioncharts'));
     $graph_swfFile = base_url() . 'asset/admin/js/chart/flash/Column3D.swf';
     $graph_caption = 'Chart';
     $graph_numberPrefix = 'Rp.';
     $graph_title = 'Penjualan Produk';
     $graph_width = 600;
     $graph_height = 300;
     // Store Name of Products
     $arrData[0][1] = "S Awal";
     $arrData[1][1] = "S Lunas";
     //pendapatan
     $arrData[2][1] = "S Lunas Tunda";
     //pendapatan
     $arrData[3][1] = "Batal S Awal";
     //pengeluaran
     $arrData[4][1] = "Batal S Lunas";
     //Store sales data
     $arrData[0][2] = $data['setoran_awal'];
     $arrData[1][2] = $data['setoran_lunas'];
     $arrData[2][2] = $data['setoran_lunas_tunda'];
     $arrData[3][2] = $data['pembatalan_setoran_awal'];
     $arrData[4][2] = $data['pembatalan_setoran_lunas'];
     $strXML = "<graph caption='" . $graph_caption . "' numberPrefix='" . $graph_numberPrefix . "' formatNumberScale='0' decimalPrecision='0'>";
     //Convert data to XML and append
     foreach ($arrData as $arSubData) {
         $strXML .= "<set name='" . $arSubData[1] . "' value='" . $arSubData[2] . "' color='" . getFCColor() . "' />";
     }
     //Close <chart> element
     $strXML .= "</graph>";
     $data['graph'] = renderChart($graph_swfFile, $graph_title, $strXML, "div", $graph_width, $graph_height);
     //$this->load->view('chart_view',$data) ;
     $this->load->view('dashboard/dashboard', $data);
     $this->close();
 }
Пример #2
0
 public function capaian_hasil()
 {
     // $sess = $this->session->userdata;
     // pre($sess);
     $this->data['title'] = 'Dashboard';
     $this->load->model('mlib');
     $this->load->model('msatker');
     //GET DEPT LIST
     $this->data['unitList'] = $this->msatker->getUnit();
     //GET UNIT LIST
     $this->data['deptList'] = $this->msatker->getDept();
     //GET PROGRAM LIST
     $getProg = $this->msatker->getAllProgram();
     foreach ($getProg as $pIdx => $pVal) {
         $program[] = $pVal['kdprogram'];
     }
     $this->data['program'] = $program;
     //GET THANG LIST
     $getThang = $this->msatker->getAllThang();
     foreach ($getThang as $index => $value) {
         $thang[] = $value['thang'];
     }
     $this->data['thang'] = $thang;
     $post = $this->input->post();
     //parameter for get report
     $nmSatuan = "";
     if ($post['dept']) {
         $kdDept = $post['dept'];
         $this->data['kdDept'] = $post['dept'];
         $resDeptName = $this->msatker->getDept($kdDept);
         $this->data['deptName'] = $resDeptName[0]['nmdept'];
         $nmSatuan = $this->data['deptName'];
     } else {
         if ($this->_kddept) {
             $kdDept = $this->_kddept;
             $this->data['kdDept'] = $this->_kddept;
             $resDeptName = $this->msatker->getDept($kdDept);
             $this->data['deptName'] = $resDeptName[0]['nmdept'];
             $nmSatuan = $this->data['deptName'];
         } else {
             $kdDept = NULL;
         }
     }
     if ($post['unit']) {
         $kdUnit = $post['unit'];
         $this->data['kdUnit'] = $post['unit'];
         $resUnitName = $this->msatker->getUnit($kdUnit);
         $this->data['unitName'] = $resUnitName[0]['nmunit'];
         $nmSatuan = $this->data['unitName'];
     } else {
         if ($this->_kdunit) {
             $kdUnit = $this->_kdunit;
             $this->data['kdUnit'] = $this->_kdunit;
             $resUnitName = $this->msatker->getUnit($kdUnit);
             $this->data['unitName'] = $resUnitName[0]['nmunit'];
             $nmSatuan = $this->data['unitName'];
         } else {
             $kdUnit = NULL;
         }
     }
     if ($this->_iskl) {
         $iskl = TRUE;
     } else {
         $iskl = NULL;
     }
     if ($post['kdprogram']) {
         $kdProgram = $post['kdprogram'];
         $this->data['kdprogram'] = $post['kdprogram'];
         $nmSatuan = "Program Dengan Kode " . $post['kdprogram'];
     } else {
         $kdProgram = NULL;
     }
     if ($post['thang']) {
         $thangVal = $post['thang'];
     } else {
         $thangVal = substr($this->data['now'], 0, 4) - 1;
     }
     $this->data['thangVal'] = $thangVal;
     $this->load->helper(array('url', 'fusioncharts'));
     //Convert data to XML and append
     /* P */
     $graph_swfFile = base_url() . 'public/charts/Line.swf';
     $graph_caption = 'Grafik Capaian Hasil ' . $nmSatuan . ' Tahun Anggaran ' . $thangVal;
     $graph_numberPrefix = '';
     $graph_numberSuffix = '%';
     $graph_title = 'Penyerapan Anggaran ' . $thangVal;
     $graph_width = 510;
     $graph_height = 250;
     $strXML_L = "<graph caption='" . $graph_caption . "' numberSuffix='" . $graph_numberSuffix . "' formatNumberScale='0' decimalPrecision='0'>";
     // Store Name of months
     $monthList = $this->mlib->getMonth();
     $getSerapanAnggaran = $this->msatker->getSerapanAnggaran($thangVal, $kdProgram, $kdUnit, $kdDept, $iskl);
     if ($getSerapanAnggaran) {
         $i = 0;
         foreach ($monthList as $month) {
             $arrData_P[$i][1] = $month;
             $i++;
         }
         $i = 0;
         foreach ($getSerapanAnggaran as $idx => $val) {
             $arrData_P[$i][2] = $val['value'];
             $i++;
         }
         // pre($arrData_P);
         foreach ($arrData_P as $arSubData) {
             if (isset($arSubData[2])) {
                 $strXML_L .= "<set name='" . $arSubData[1] . "' value='" . $arSubData[2] . "' color='" . getFCColor() . "' />";
             }
         }
         $strXML_L .= "</graph>";
         $this->data['graph_L'] = renderChart($graph_swfFile, $graph_title, $strXML_L, "LINE", $graph_width, $graph_height);
     } else {
         $this->data['graph_L'] = "No data to show";
     }
     // --------- PIE K/L --------- //
     $graph_swfFile_PieKL = base_url() . 'public/charts/Pie2D.swf';
     $graph_caption_PieKL = 'Capaian Hasil ' . $this->data['deptName'] . ' Tahun Anggaran ' . $thangVal;
     $graph_numberPrefix_PieKL = '';
     $graph_numberSuffix_PieKL = '%';
     $graph_title_PKL = 'Penyerapan Anggaran';
     $graph_width_PKL = 450;
     $graph_height_PKL = 250;
     $this->data['PKL'] = $this->msatker->getSerapanYearly($thangVal, $kdDept, NULL, NULL);
     $this->data['notPKL'] = 100 - $this->data['PKL'];
     // Store Name of months
     $arrData_PKL[0][1] = "Anggaran terserap";
     $arrData_PKL[1][1] = "Anggaran belum terserap";
     //Store P data
     $arrData_PKL[0][2] = $this->data['PKL'];
     $arrData_PKL[1][2] = $this->data['notPKL'];
     $strXML_P = "<graph caption='" . $graph_caption_PieKL . "' numberSuffix='" . $graph_numberSuffix_PieKL . "' formatNumberScale='0' decimalPrecision='0'>";
     foreach ($arrData_PKL as $arSubData) {
         $strXML_P .= "<set name='" . $arSubData[1] . "' value='" . $arSubData[2] . "' color='" . getFCColor() . "' />";
     }
     $strXML_P .= "</graph>";
     $this->data['graph_PKL'] = renderChart($graph_swfFile_PieKL, $graph_title_PKL, $strXML_P, "PIEPKL", $graph_width_PKL, $graph_height_PKL);
     // --------- PIE K/L --------- //
     // --------- PIE ESELON --------- //
     $graph_swfFile_PieEs = base_url() . 'public/charts/Pie2D.swf';
     $graph_caption_PieEs = 'Capaian Hasil ' . $this->data['unitName'] . ' Tahun Anggaran ' . $thangVal;
     $graph_numberPrefix_PieEs = '';
     $graph_numberSuffix_PieEs = '%';
     $graph_title_PKL = 'Penyerapan Anggaran';
     $graph_width_PKL = 450;
     $graph_height_PKL = 250;
     $this->data['PES'] = $this->msatker->getSerapanYearly($thangVal, $kdDept, $kdUnit, NULL);
     $this->data['notPES'] = 100 - $this->data['PES'];
     // Store Name of months
     $arrData_PKL[0][1] = "Anggaran terserap";
     $arrData_PKL[1][1] = "Anggaran belum terserap";
     //Store P data
     $arrData_PKL[0][2] = $this->data['PES'];
     $arrData_PKL[1][2] = $this->data['notPES'];
     $strXML_P = "<graph caption='" . $graph_caption_PieEs . "' numberSuffix='" . $graph_numberSuffix_PieEs . "' formatNumberScale='0' decimalPrecision='0'>";
     foreach ($arrData_PKL as $arSubData) {
         $strXML_P .= "<set name='" . $arSubData[1] . "' value='" . $arSubData[2] . "' color='" . getFCColor() . "' />";
     }
     $strXML_P .= "</graph>";
     $this->data['graph_PES'] = renderChart($graph_swfFile_PieEs, $graph_title_PKL, $strXML_P, "PIEES", $graph_width_PKL, $graph_height_PKL);
     // --------- PIE ESELON --------- //
     // --------- PIE PROGRAM --------- //
     $this->data['graph_PPRO'] = "";
     if (isset($kdProgram)) {
         $graph_swfFile_PiePro = base_url() . 'public/charts/Pie2D.swf';
         $graph_caption_PiePro = 'Capaian Hasil Dengan Kode Program ' . $post['kdprogram'];
         $graph_numberPrefix_PiePro = '';
         $graph_numberSuffix_PiePro = '%';
         $graph_title_PKL = 'Penyerapan Anggaran';
         $graph_width_PKL = 450;
         $graph_height_PKL = 250;
         $this->data['PPRO'] = $this->msatker->getSerapanYearly($thangVal, $kdDept, $kdUnit, $kdProgram);
         $this->data['notPPRO'] = 100 - $this->data['PPRO'];
         // Store Name of months
         $arrData_PKL[0][1] = "Anggaran terserap";
         $arrData_PKL[1][1] = "Anggaran belum terserap";
         //Store P data
         $arrData_PKL[0][2] = $this->data['PPRO'];
         $arrData_PKL[1][2] = $this->data['notPPRO'];
         $strXML_P = "<graph caption='" . $graph_caption_PiePro . "' numberSuffix='" . $graph_numberSuffix_PiePro . "' formatNumberScale='0' decimalPrecision='0'>";
         foreach ($arrData_PKL as $arSubData) {
             $strXML_P .= "<set name='" . $arSubData[1] . "' value='" . $arSubData[2] . "' color='" . getFCColor() . "' />";
         }
         $strXML_P .= "</graph>";
         $this->data['graph_PPRO'] = renderChart($graph_swfFile_PiePro, $graph_title_PKL, $strXML_P, "PIEPRO", $graph_width_PKL, $graph_height_PKL);
     }
     // --------- PIE PROGRAM --------- //
     $this->data['template'] = 'laporan/laporan_ch_satker';
     $this->load->view('index', $this->data);
 }
Пример #3
0
@mysql_select_db("db_smb");
include "FusionCharts/FC_Colors.php";
include "FusionCharts/FusionCharts_Gen.php";
include "FusionCharts/FusionCharts.php";
echo "<SCRIPT LANGUAGE='Javascript' SRC='FusionCharts/FusionCharts.js'></SCRIPT>";
$strXML = "<graph caption='Grafik Penjualan' numberPrefix='  ' yAxisName='jumlah' decimalPrecision='0' formatNumberScale='0'>";
$kategori = "<categories>";
$data = "<dataset seriesName='2015' color='" . getFCColor() . "' >";
$data1 = "<dataset seriesName='2016' color='" . getFCColor() . "' >";
$data2 = "<dataset seriesName='2017' color='" . getFCColor() . "' >";
$data3 = "<dataset seriesName='2018' color='" . getFCColor() . "' >";
$data4 = "<dataset seriesName='2019' color='" . getFCColor() . "' >";
$data5 = "<dataset seriesName='2020' color='" . getFCColor() . "' >";
$data6 = "<dataset seriesName='2021' color='" . getFCColor() . "' >";
$data7 = "<dataset seriesName='2022' color='" . getFCColor() . "' >";
$data8 = "<dataset seriesName='2023' color='" . getFCColor() . "' >";
$sql = "SELECT * FROM analisis_provinsipertahun ";
$qr = mysql_query($sql);
while ($Data = mysql_fetch_array($qr)) {
    $arrData[0][1] = "{$Data['provinsi']}";
    $arrData[0][2] = "{$Data['tahun2015']}";
    $arrData[0][3] = "{$Data['tahun2016']}";
    $arrData[0][4] = "{$Data['tahun2017']}";
    $arrData[0][5] = "{$Data['tahun2018']}";
    $arrData[0][6] = "{$Data['tahun2019']}";
    $arrData[0][7] = "{$Data['tahun2020']}";
    $arrData[0][8] = "{$Data['tahun2021']}";
    $arrData[0][9] = "{$Data['tahun2022']}";
    $arrData[0][10] = "{$Data['tahun2023']}";
    foreach ($arrData as $arSubData) {
        $kategori .= "<category name='" . $arSubData[1] . "' />";
}
?>

<iframe width=174 height=189 name="gToday:normal:calender/normal.js" id="gToday:normal:calender/normal.js" src="calender/ipopeng.htm" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; top:-500px; left:-500px;">
</iframe>
<?php 
@mysql_connect("localhost", "root", "");
@mysql_select_db("db_smb");
include "FusionCharts/FC_Colors.php";
include "FusionCharts/FusionCharts_Gen.php";
include "FusionCharts/FusionCharts.php";
echo "<SCRIPT LANGUAGE='Javascript' SRC='FusionCharts/FusionCharts.js'></SCRIPT>";
$strXML = "<graph caption='Grafik Penjualan' numberPrefix='  ' yAxisName='peserta' decimalPrecision='0' formatNumberScale='0'>";
$kategori = "<categories>";
$data = "<dataset seriesName='target' color='" . getFCColor() . "' >";
$data1 = "<dataset seriesName='jumlah' color='" . getFCColor() . "' >";
$sql = "SELECT * FROM view_target where provinsi like '%{$provinsi}%' and tahun between '{$tahun_awal}' and '{$tahun_akhir}'";
$qr = mysql_query($sql);
while ($Data = mysql_fetch_array($qr)) {
    $arrData[0][1] = "{$Data['provinsi']}";
    $arrData[0][2] = "{$Data['target']}";
    $arrData[0][3] = "{$Data['jumlah']}";
    foreach ($arrData as $arSubData) {
        $kategori .= "<category name='" . $arSubData[1] . "' />";
        $data .= "<set value='" . $arSubData[2] . "' />";
        $data1 .= "<set value='" . $arSubData[3] . "' />";
    }
}
$kategori .= "</categories>";
$data .= "</dataset>";
$data1 .= "</dataset>";
$arrData[1][1] = "Product B";
$arrData[2][1] = "Product C";
$arrData[3][1] = "Product D";
$arrData[4][1] = "Product E";
$arrData[5][1] = "Product F";
//Store sales data
$arrData[0][2] = 567500;
$arrData[1][2] = 815300;
$arrData[2][2] = 556800;
$arrData[3][2] = 734500;
$arrData[4][2] = 676800;
$arrData[5][2] = 648500;
//Now, we need to convert this data into XML. We convert using string concatenation.
//Initialize <graph> element
$strXML = "<graph caption='Sales by Product' numberPrefix='\$' formatNumberScale='0' decimalPrecision='0'>";
//Convert data to XML and append
foreach ($arrData as $arSubData) {
    $strXML .= "<set name='" . $arSubData[1] . "' value='" . $arSubData[2] . "' color='" . getFCColor() . "' />";
}
//Close <graph> element
$strXML .= "</graph>";
//Create the chart - Column 3D Chart with data contained in strXML
echo renderChart("../../FusionCharts/FCF_Column3D.swf", "", $strXML, "productSales", 600, 300);
?>
<BR><BR>
<a href='../NoChart.html' target="_blank">Unable to see the chart above?</a>
<H5 ><a href='../default.htm'>&laquo; Back to list of examples</a></h5>

</CENTER>
</BODY>
</HTML>
    unset($_POST['cari']);
}
?>

<iframe width=174 height=189 name="gToday:normal:calender/normal.js" id="gToday:normal:calender/normal.js" src="calender/ipopeng.htm" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; top:-500px; left:-500px;">
</iframe>
<?php 
@mysql_connect("localhost", "root", "");
@mysql_select_db("db_smb");
include "FusionCharts/FC_Colors.php";
include "FusionCharts/FusionCharts_Gen.php";
include "FusionCharts/FusionCharts.php";
echo "<SCRIPT LANGUAGE='Javascript' SRC='FusionCharts/FusionCharts.js'></SCRIPT>";
$strXML = "<graph caption='Grafik Selisih Target' numberPrefix='  ' yAxisName='peserta' decimalPrecision='0' formatNumberScale='0'>";
$kategori = "<categories>";
$data = "<dataset seriesName='' color='" . getFCColor() . "' >";
$sql = "SELECT * FROM view_analisis where provinsi like '%{$provinsi}%' and tahun between '{$tahun_awal}' and '{$tahun_akhir}'";
$qr = mysql_query($sql);
while ($Data = mysql_fetch_array($qr)) {
    $arrData[3][4] = "{$Data['provinsi']}";
    $arrData[3][5] = "{$Data['jumlah']}";
    foreach ($arrData as $arSubData) {
        $kategori .= "<category name='" . $arSubData[4] . "' />";
        $data .= "<set value='" . $arSubData[5] . "' />";
    }
}
$kategori .= "</categories>";
$data .= "</dataset>";
$data1 .= "</dataset>";
$data2 .= "</dataset>";
$strXML .= $kategori . $data;
Пример #7
0
@mysql_select_db("db_smb");
include "FusionCharts/FC_Colors.php";
include "FusionCharts/FusionCharts_Gen.php";
include "FusionCharts/FusionCharts.php";
echo "<SCRIPT LANGUAGE='Javascript' SRC='FusionCharts/FusionCharts.js'></SCRIPT>";
$strXML = "<graph caption='Grafik Penjualan' numberPrefix='  ' yAxisName='peserta' decimalPrecision='0' formatNumberScale='0'>";
$kategori = "<categories>";
$data = "<dataset seriesName='UTG1' color='" . getFCColor() . "' >";
$data1 = "<dataset seriesName='USM1' color='" . getFCColor() . "' >";
$data2 = "<dataset seriesName='JPPAN' color='" . getFCColor() . "' >";
$data3 = "<dataset seriesName='JPPAU' color='" . getFCColor() . "' >";
$data4 = "<dataset seriesName='USM2' color='" . getFCColor() . "' >";
$data5 = "<dataset seriesName='UTG2' color='" . getFCColor() . "' >";
$data6 = "<dataset seriesName='UTG3' color='" . getFCColor() . "' >";
$data7 = "<dataset seriesName='CBT' color='" . getFCColor() . "' >";
$data8 = "<dataset seriesName='Kemitraan' color='" . getFCColor() . "' >";
$sql = "SELECT * FROM view_banding where  provinsi like '%{$provinsi}%' and tahun between '{$tahun_awal}' and '{$tahun_akhir}'";
$qr = mysql_query($sql);
while ($Data = mysql_fetch_array($qr)) {
    $arrData[0][1] = "{$Data['provinsi']}";
    $arrData[0][2] = "{$Data['UTG1']}";
    $arrData[0][3] = "{$Data['USM1']}";
    $arrData[0][4] = "{$Data['JPPAN']}";
    $arrData[0][5] = "{$Data['JPPAU']}";
    $arrData[0][6] = "{$Data['USM2']}";
    $arrData[0][7] = "{$Data['UTG2']}";
    $arrData[0][8] = "{$Data['UTG3']}";
    $arrData[0][9] = "{$Data['CBT']}";
    $arrData[0][10] = "{$Data['Kemitraan']}";
    foreach ($arrData as $arSubData) {
        $kategori .= "<category name='" . $arSubData[1] . "' />";
//to get that factory id, get information from database and then show
//a detailed chart.
//Request the factory Id from Querystring
$FactoryId = $_GET['FactoryId'];
//Generate the graph element string
$strXML = "<graph caption='Factory " . $FactoryId . " Output ' subcaption='(In Units)' xAxisName='Date' formatNumberScale='0' decimalPrecision='0'>";
// Connet to the DB
$link = connectToDB();
//Now, we get the data for that factory
$strQuery = "select * from Factory_Output where FactoryId=" . $FactoryId;
$result = mysql_query($strQuery) or die(mysql_error());
//Iterate through each factory
if ($result) {
    while ($ors = mysql_fetch_array($result)) {
        //Here, we convert date into a more readable form for set name.
        $strXML .= "<set name='" . datePart("d", $ors['DatePro']) . "/" . datePart("m", $ors['DatePro']) . "' value='" . $ors['Quantity'] . "' color='" . getFCColor() . "'/>";
    }
}
mysql_close($link);
//Close <graph> element
$strXML .= "</graph>";
//Create the chart - Column 2D Chart with data from strXML
echo renderChart("../../FusionCharts/FCF_Column2D.swf", "", $strXML, "FactoryDetailed", 600, 300);
?>
<BR>
<a href='Default.php'>Back to Summary</a>
<BR><BR>
<a href='../NoChart.html' target="_blank">Unable to see the chart above?</a>
<H5 ><a href='../default.htm'>&laquo; Back to list of examples</a></h5>
</CENTER>
</BODY>
Пример #9
0
function BranchValue()
{
    $sql = "select branch_id, sum(rate) as total\r\n            from umw_mms.inv_stocks a\r\n            join umw_mms.inv_items b on item_id = b.id\r\n            group by branch_id";
    connectToDB();
    $result = mysql_query($sql) or die("error");
    while ($row = mysql_fetch_array($result)) {
        $name .= "<set name='" . $row['branch_id'] . "' value='" . $row['total'] . "'color='" . getFCColor() . "' />";
    }
    return $name;
}