Add version files and new GIF images for UI components

This commit is contained in:
2025-04-03 06:26:44 +07:00
commit 663c28a2ea
5219 changed files with 772528 additions and 0 deletions

View File

@ -0,0 +1,516 @@
<?php
class BASE_HOME extends MY_DHTMLX // base class and derived class from fs_library
{
public function fn_page_construct()
{
}
}
class HOME_HTML extends BASE_HOME // derived class
{
public function fn_page_default()
{
//$year=$this->fn_get_fieldvalue("years","select years from ".DB_DMCS.".tbl_smsc_sumyears where isdeleted=0 order by id desc limit 1");
$year=date("Y");
$month=date("m");
//$month=$this->fn_get_fieldvalue("period","select period from ".DB_DMCS.".tbl_smsc_sumtop5month where isdeleted=0 order by id desc limit 1");
$monthname=$this->FN_GETMONTHNAME((int)$month);
echo $this->FN_CREATEHEADER();
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"".PATH_THEME."/font/fontface.css\"/>";
echo "<style>
.spnumber {
width:60px;height:60px;background-color:black;color:#76FF03;text-align:center;
display:table-cell;font-family:tahoma;
font-size:60pt;vertical-align:middle;
}
</style>"; //dseg7modernregular
echo "<script>
var t1;
function initObject()
{";
//$qrymax="select count(m.id) totalmax
// from ".DB_DIMAS.".tbl_siswa m inner join ".DB_DIMAS.".tbl_kelas f on f.id=m.idkelas
// where m.isdeleted=0 and thnmasuk>=(".date("Y")."-5) and thnmasuk<=".date("Y")."
// group by m.idkelas,m.thnmasuk
// order by count(m.id) desc limit 1";
// $max=$this->fn_get_fieldvalue("totalmax",$qrymax);
// $max=round($max/100)*100;
// $qrylegend="select distinct f.kdkelas
// from ".DB_DIMAS.".tbl_siswa m inner join ".DB_DIMAS.".tbl_kelas f on f.id=m.idkelas
// where m.isdeleted=0 and thnmasuk>=(".date("Y")."-5) and thnmasuk<=".date("Y")."
// group by m.idkelas,m.thnmasuk
// order by f.id,m.thnmasuk asc";
// $rslegend=$this->selectquery($qrylegend);
// if($rslegend)
// {
// $casewhen="";$sumfield="";
// while($rw=$this->data_row_object($rslegend))
// {
// $casewhen.="case f.kdkelas when '".$rw->kdkelas."' then count(m.id) else 0 end '".$rw->kdkelas."',";
// $sumfield.="sum(x.`".$rw->kdkelas."`) '".$rw->kdkelas."',";
// }
// $casewhen=substr($casewhen,0,strlen($casewhen)-1);
// $sumfield=substr($sumfield,0,strlen($sumfield)-1);
// }
// $this->clearrecordset($rslegend);
//
// $qry="select x.thnmasuk,$sumfield
// from
// (
// select m.thnmasuk,$casewhen
// from ".DB_DIMAS.".tbl_siswa m inner join ".DB_DIMAS.".tbl_kelas f on f.id=m.idkelas
// where m.isdeleted=0 and m.thnmasuk>=(".date("Y")."-5) and m.thnmasuk<=".date("Y")."
// group by f.id,f.kdkelas,m.thnmasuk
// ) x group by x.thnmasuk";
// $rs=$this->selectquery($qry);
// if($rs)
// {
// $arrval=array();
// while($rw=$this->data_row_array($rs))
// {
// array_push($arrval,array("fI"=>$rw["I"],"fII"=>$rw["II"],"fIII"=>$rw["III"],"Tahun"=>$rw["thnmasuk"]));
// }
// $jsonencode=json_encode($arrval);
// }
// $this->clearrecordset($rs);
$arrval=array();$max=700;
array_push($arrval,array("HITS"=>100,"Periode"=>"Jan"));
array_push($arrval,array("HITS"=>150,"Periode"=>"Feb"));
array_push($arrval,array("HITS"=>125,"Periode"=>"Mar"));
array_push($arrval,array("HITS"=>135,"Periode"=>"Apr"));
array_push($arrval,array("HITS"=>189,"Periode"=>"Mei"));
array_push($arrval,array("HITS"=>289,"Periode"=>"Jun"));
array_push($arrval,array("HITS"=>290,"Periode"=>"Jul"));
array_push($arrval,array("HITS"=>350,"Periode"=>"Aug"));
array_push($arrval,array("HITS"=>638,"Periode"=>"Sept"));
array_push($arrval,array("HITS"=>0,"Periode"=>"Okt"));
array_push($arrval,array("HITS"=>0,"Periode"=>"Nov"));
array_push($arrval,array("HITS"=>0,"Periode"=>"Des"));
$jsonencode=json_encode($arrval);
// === LAYOUT TRAFIC
echo " var jsonval=$jsonencode;
var chart1 = new dhtmlXChart({
view:\"line\",
container:\"divtrendhits\",
value:\"#HITS#\",
item:{
borderColor: \"#1293f8\",
color: \"#ffffff\"
},
line:{
color:\"#1293f8\",
width:3
},
tooltip:{
template:\"#HITS#\"
},
offset:0,
xAxis:{
template:\"#Periode#\"
},
yAxis:{
start:0,
step:50,
end:$max,
template:function(value){
return value%100?\"\":value
}
},
padding:{
left:35,
bottom: 50
},
origin:0,
legend:{
layout:\"x\",
width: 75,
align:\"center\",
valign:\"bottom\",
values:[
{text:\"SMS\",color:\"#3399ff\"}
],
margin:10
}
});
chart1.parse(jsonval,\"json\");
// === SUM OF YEARS
t1=setTimeout(function(){fn_sumofyears();fn_sumoftop5();fn_sumoftop3();},500);
}
function fn_sumofyears()
{
var sumofyears=ajaxuridhtmlx('".$this->enc("obj_home")."','obj=".$this->enc("home_marsal")."&task=".$this->enc("sumofyears")."&years=$year');
var valsumofyears='-----------'+sumofyears.toString();
//alert(sumofyears);
valsumofyears=valsumofyears.substring(valsumofyears.length-11,valsumofyears.length);
for(i=0;i<9;i++)
{
document.getElementById('dvsum'+(i+1)).innerHTML=valsumofyears.substring(i,i+1);
}
t1=setTimeout(function(){fn_sumofyears();fn_sumoftop5();fn_sumoftop3();},1000);
}
function fn_sumoftop5()
{
var sumoftop5=ajaxuridhtmlx('".$this->enc("obj_home")."','obj=".$this->enc("home_marsal")."&task=".$this->enc("sumoftop5")."&years=$year&months=$month');
//alert(sumoftop5);
var valsumoftop5=JSON.parse(sumoftop5).toString().split(',');
for(i=0;i<valsumoftop5.length;i++)
{
var valtop5=valsumoftop5[i].split('|');
document.getElementById('divrate5'+(i+1)).innerHTML=valtop5[0];
document.getElementById('divrateval5'+(i+1)).innerHTML=valtop5[1]+' SMS';
}
}
function fn_sumoftop3()
{
var sumoftop3=ajaxuridhtmlx('".$this->enc("obj_home")."','obj=".$this->enc("home_marsal")."&task=".$this->enc("sumoftop3")."&years=$year');
var valsumoftop3=JSON.parse(sumoftop3).toString().split(',');
for(i=0;i<valsumoftop3.length;i++)
{
var valtop3=valsumoftop3[i].split('|');
document.getElementById('divrate3'+(i+1)).innerHTML=valtop3[0];
document.getElementById('divrateval3'+(i+1)).innerHTML=valtop3[1]+' SMS';
}
}
</script>";
echo $this->FN_CLOSEHEADER();
echo $this->FN_CREATEBODY("white");
echo "<table width=\"100%\" style=\"height:100%;\" cellpadding=\"0\" cellspacing=\"0\">
<tr>";
// === HITS MONITORING
echo " <td width=\"50%\" style=\"background-color:#F50057\" valign=\"top\" align=\"center\">
<div style=\"position:absolute;margin:0px 0px;padding:5px;z-index:9999;background-color:blue;color:white;font-size:12pt;\">
PERIODE : $year
</div>
<table style=\"margin-top:25%;color:white;font-size:20pt;\" border=\"0\">
<tr>
<td valign=\"middle\" align=\"center\">TOTAL SMS $year</td>
</tr>
<tr>
<td align=\"center\" valign=\"middle\">
<table cellpadding=\"1\" cellspacing=\"0\">
<tr>
<td><div id=\"dvsum1\" class=\"spnumber\">-</div></td>
<td><div id=\"dvsum2\" class=\"spnumber\">-</div></td>
<td><div id=\"dvsum3\" class=\"spnumber\">-</div></td>
<td>.</td>
<td><div id=\"dvsum4\" class=\"spnumber\">-</div></td>
<td><div id=\"dvsum5\" class=\"spnumber\">-</div></td>
<td><div id=\"dvsum6\" class=\"spnumber\">-</div></td>
<td>.</td>
<td><div id=\"dvsum7\" class=\"spnumber\">-</div></td>
<td><div id=\"dvsum8\" class=\"spnumber\">-</div></td>
<td><div id=\"dvsum9\" class=\"spnumber\">-</div></td>
</tr>
</table>
</td>
</tr>
<tr style=\"height:80px;\">
<td valign=\"bottom\" align=\"center\">UPT TOP 5 RATING IN $monthname $year</td>
</tr>
<tr>
<td align=\"center\" valign=\"middle\">
<table cellpadding=\"1\" cellspacing=\"0\" width=\"100%\">
<tr>
<td width=\"60%\">
<div id=\"divrate51\">Medan Utara</div>
</td>
<td width=\"2%\">:</td>
<td style=\"text-align:right;\">
<div id=\"divrateval51\">300 SMS</div>
</td>
</tr>
<tr>
<td width=\"60%\">
<div id=\"divrate52\">Medan Selayang</div>
</td>
<td width=\"2%\">:</td>
<td style=\"text-align:right;\">
<div id=\"divrateval52\">120 SMS</div>
</td>
</tr>
<tr>
<td width=\"60%\">
<div id=\"divrate53\">Medan Denai</div>
</td>
<td width=\"2%\">:</td>
<td style=\"text-align:right;\">
<div id=\"divrateval53\">80 SMS</div>
</td>
</tr>
<tr>
<td width=\"60%\">
<div id=\"divrate54\">Sunggal</div>
</td>
<td width=\"2%\">:</td>
<td style=\"text-align:right;\">
<div id=\"divrateval54\">78 SMS</div>
</td>
</tr>
<tr>
<td width=\"60%\">
<div id=\"divrate55\">Medan Marelan</div>
</td>
<td width=\"2%\">:</td>
<td style=\"text-align:right;\">
<div id=\"divrateval55\">60 SMS</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td>
<table width=\"100%\" style=\"height:100%;\">";
// === LAYOUT 3 Top Rating
echo "<tr height=\"225px\">
<td style=\"background-color:#FFEB3B\" colspan=\"2\" valign=\"top\" align=\"center\">
<table style=\"color:#212121;font-size:20pt;\" border=\"0\" width=\"75%\">
<tr style=\"height:60px;\">
<td valign=\"bottom\" align=\"center\"><b>UPT TOP 3 RATING IN $year</b></td>
</tr>
<tr>
<td align=\"center\" valign=\"middle\">
<table cellpadding=\"1\" cellspacing=\"0\" width=\"100%\">
<tr>
<td width=\"60%\">
<div id=\"divrate31\">Medan Utara</div>
</td>
<td width=\"2%\">:</td>
<td style=\"text-align:right;\">
<div id=\"divrateval31\">111.026 SMS</div>
</td>
</tr>
<tr>
<td width=\"60%\">
<div id=\"divrate32\">Medan Denai</div>
</td>
<td width=\"2%\">:</td>
<td style=\"text-align:right;\">
<div id=\"divrateval32\">80.900 SMS</div>
</td>
</tr>
<tr>
<td width=\"60%\">
<div id=\"divrate33\">Medan Selayang</div>
</td>
<td width=\"2%\">:</td>
<td style=\"text-align:right;\">
<div id=\"divrateval33\">78.989 SMS</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>";
// === LAYOUT OPERATOR TSEL or NON TSEL
echo "<tr>
<td style=\"background-color:#FF5722\" valign=\"top\" width=\"50%\">
<div style=\"float:left;padding:5px;position:relative;z-index:9999;background-color:blue;color:white;font-size:12pt;\">
OPR TSEL PERIODE : $year
</div>
<table style=\"margin-top:20%;color:white;font-size:40pt;\" width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td valign=\"middle\" align=\"center\">
<span id=\"divoptsel\">444.247</span><sup style=\"font-size:12pt;\">SMS</sup>
</td>
</tr>
<tr>
<td style=\"font-size:12pt;\" align=\"center\">
<div style=\"margin-top:-5px;\">
<i><span id=\"spoptselpersen\">".$this->CREATE_IMAGE("up.png")." 30%</span> from last year</i>
</div>
</td>
</tr>
<tr>
<td style=\"font-size:12pt;\" align=\"center\">
<div>
<i><span id=\"spoptsellastyear\">123.908</span> from last year ( 2015 )</i>
</div>
</td>
</tr>
</table>
</td>
<td style=\"background-color:#4CAF50\" valign=\"top\">
<div style=\"float:right;padding:5px;position:relative;z-index:9999;background-color:blue;color:white;font-size:12pt;\">
OPR NON TSEL PERIODE : $year
</div>
<table style=\"margin-top:20%;color:white;font-size:40pt;\" width=\"100%\" border=\"0\" cellpadding=\"0\">
<tr>
<td valign=\"middle\" align=\"center\">
<span id=\"spopnontsel\">190.401</span><sup style=\"font-size:12pt;\">SMS</sup>
</td>
</tr>
<tr>
<td style=\"font-size:12pt;\" align=\"center\">
<div style=\"margin-top:-5px;\">
<i><span id=\"spopnontselpersen\">".$this->CREATE_IMAGE("down.png")." 25%</span> from last year</i>
</div>
</td>
</tr>
<tr>
<td style=\"font-size:12pt;\" align=\"center\">
<div>
<i><span id=\"spopnontsellastyear\">223.458</span> from last year ( 2015 )</i>
</div>
</td>
</tr>
</table>
</td>
</tr>";
// === LAYOUT TRAFIC
echo "<tr>
<td style=\"background-color:#BBDEFB;height:250px;text-align:right;\" colspan=\"2\" valign=\"top\">
<div style=\"float:right;padding:5px;position:relative;z-index:9999;background-color:blue;color:white;font-size:12pt;\">
TRAFIC SMS PERIODE : $year
</div>
<div id=\"divtrendhits\" style=\"width:100%;height:250px;border:0px solid #A4BED4;\">
</div>
</td>
</tr>";
echo " </table>
</td>
</tr>
</table>";
echo $this->FN_CREATEFOOTER();
}
public function fn_treemenu()
{
header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>
<tree id=\"0\" radio=\"1\">";
if($_SESSION['treemenuid'])
{
$id_menu_groupproject=$_REQUEST['id_menu_groupproject'];
$qrymnu1="select id,menuid,menutext,menuimg from ".DB_APORTIL.".tbl_treemenu
where id in(".$_SESSION['treemenuid'].") and menutype='H' and menuactivated=1 and isdeleted=0 and id_menu_groupproject='$id_menu_groupproject'
order by menuorder asc";
//echo $qrymnu1;
$rs1=$this->selectquery($qrymnu1);
if($rs1)
{
//$i=1;
if($this->REC_ROWS_COUNT($rs1)>0)
{
while($rw1=$this->data_row_object($rs1))
{
//$mymenu.="<item id='".$rw1->menuid."' text='".$rw1->menutext."' img='".$rw1->menuimg."'>";
echo "<item id='".$rw1->menuid."' text='".$rw1->menutext."'>";
$qrymnu2="select id,menuid,menutype,menutext,menuimg from ".DB_APORTIL.".tbl_treemenu
where id in(".$_SESSION['treemenuid'].") and menuheader='".$rw1->id."' and menuactivated=1 and isdeleted=0 and id_menu_groupproject='$id_menu_groupproject'
order by menuorder asc";
$rs2=$this->selectquery($qrymnu2);
if($rs2)
{
if($this->REC_ROWS_COUNT($rs2)>0)
{
while($rw2=$this->data_row_object($rs2))
{
//$mymenu.="<item id='".$rw2->menuid."' text='".$rw2->menutext."' img='".$rw2->menuimg."'>";
if($rw2->menutype=='S'){$propheader=" img0='folderClosed.gif' img1='folderOpen.gif' img2='folderClosed.gif'";}
echo "<item id='".$rw2->menuid."' text='".$rw2->menutext."'>";
$qrymnu3="select id,menuid,menutype,menutext,menuimg from ".DB_APORTIL.".tbl_treemenu
where id in(".$_SESSION['treemenuid'].") and menuheader='".$rw2->id."' and menuactivated=1 and isdeleted=0 and id_menu_groupproject='$id_menu_groupproject'
order by menuorder asc";
$rs3=$this->selectquery($qrymnu3);
if($rs3)
{
if($this->REC_ROWS_COUNT($rs3)>0)
{
//echo "<item id=\"s\" text=\"t\"></item>";
//$k=1;
while($rw3=$this->data_row_object($rs3))
{
//if($rw2->menutype=='S'){$propheader=" img0='folderClosed.gif' img1='folderOpen.gif' img2='folderClosed.gif'";}
//$mymenu.="<item id='".$rw3->menuid."' text='".$rw3->menutext."' img='".$rw3->menuimg."'></item>";
//if($rw3->menutype=='S'){$propheader=" img0='folderClosed.gif' img1='folderOpen.gif' img2='folderClosed.gif'";}
echo "<item id='".$rw3->menuid."' text='".$rw3->menutext."'>";
$qrymnu4="select id,menuid,menutype,menutext,menuimg from ".DB_APORTIL.".tbl_treemenu
where id in(".$_SESSION['treemenuid'].") and menuheader='".$rw3->id."' and menuactivated=1 and isdeleted=0 and id_menu_groupproject='$id_menu_groupproject'
order by menuorder asc";
$rs4=$this->selectquery($qrymnu4);
if($rs4)
{
if($this->REC_ROWS_COUNT($rs4)>0)
{
while($rw4=$this->data_row_object($rs4))
{
echo "<item id='".$rw4->menuid."' text='".$rw4->menutext."'/>";
}
}
}
$this->clearrecordset($rs4);
echo "</item>";
//$k+=1;
}
}
}
$this->clearrecordset($rs3);
echo "</item>";
}
}
}
$this->clearrecordset($rs2);
// if($i==1){$mymenu.="<item id='submnuclose' text='Close' img='exit.png'></item>";}
echo "</item>";
//$i+=1;
}
}
else
{
echo "<item text=\"Konfigurasi\" id=\"trkonfigurasi\" open=\"1\" im0=\"folderClosed.gif\" im1=\"folderOpen.gif\" im2=\"folderClosed.gif\">
<item text=\"Penambahan Menu\" id=\"mc0\"></item>
<item text=\"Pencarian Menu\" id=\"mc1\"></item>
<item text=\"Penambahan User\" id=\"mc2\"></item>
<item text=\"Authentifikasi User\" id=\"mc3\"></item>
</item>";
}
}
$this->clearrecordset($rs1);
}
else if($_SESSION['nik']=='9999')
{
echo "<item text=\"Konfigurasi\" id=\"trkonfigurasi\" open=\"1\" im0=\"folderClosed.gif\" im1=\"folderOpen.gif\" im2=\"folderClosed.gif\">
<item text=\"Penambahan Menu\" id=\"mc0\"></item>
<item text=\"Pencarian Menu\" id=\"mc1\"></item>
<item text=\"Penambahan User\" id=\"mc2\"></item>
<item text=\"Authentifikasi User\" id=\"mc3\"></item>
</item>";
}
echo " </tree>";
}
public function fn_treemenuadmin()
{
header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>
<tree id=\"0\" radio=\"1\">";
if($_SESSION['nik']=='82010')
{
echo "<item text=\"Konfigurasi\" id=\"trkonfigurasi\" open=\"1\">
<item text=\"Penambahan Menu\" id=\"mc0\"></item>
<item text=\"Pencarian Menu\" id=\"mc1\"></item>
<item text=\"Penambahan User\" id=\"mc2\"></item>
<item text=\"Authentifikasi User\" id=\"mc3\"></item>
</item>";
}
echo " </tree>";
}
}
?>

53
objectx/obj_home/home.php Normal file
View File

@ -0,0 +1,53 @@
<?php
//echo $_SESSION['branch_group'];
//echo "<br/><br/>GGGGGG<br/>";
require_once($pg.".html.php");
//echo "xxx<br/><br/>xxx$pg<br/>";
class HOME extends HOME_HTML
{
}
//echo $pg;return false;
$cl=new HOME();
if(isset($_REQUEST['task'])){$case=$_REQUEST['task'];}
if(isset($_POST['task'])){$case=$_POST['task'];}
if(isset($_REQUEST['obj'])){$obj=$_REQUEST['obj'];}
if(isset($_POST['obj'])){$obj=$_POST['obj'];}
if($_REQUEST){if($_REQUEST['sec']){$case=$cl->dec($case);$obj=$cl->dec($obj);}}
if(file_exists(PATH_OBJECT."/$option/$obj.php"))
{
require_once("$obj.php");
$className=strtoupper($obj);
$clfile=new $className();
$fn_init_java=$className."_javainit";
$init_java=trim($_REQUEST['init_java']);if($init_java){$clfile->$fn_init_java();}
$case=$obj;
}
if(!$case){$case=$obj;if(!file_exists(PATH_OBJECT."/$option/$obj.php")){$cl->under_construction();}}
$sptask=explode("_",$case);$modulename=$sptask[1];$fn_module_init="fn_".$modulename."_init";
//echo $case;
switch($case)
{
case "home_$modulename":
$clfile->$fn_module_init();
break;
case "treemenu":
$cl->fn_treemenu();
break;
case "treemenuadmin":
$cl->fn_treemenuadmin();
break;
default:
//echo "test";return false;
$cl->fn_page_default();
break;
}
?>

View File

@ -0,0 +1,147 @@
<?php
class HOME_CORESAU extends HOME
{
public function home_coresau_javainit()
{
}
public function fn_coresau_init()
{
if(isset($_REQUEST['task'])){$task=trim(strtolower($_REQUEST['task']));}
if(isset($_POST['task'])){$task=trim(strtolower($_POST['task']));}
if($_REQUEST||$_POST){if($_REQUEST['sec']||$_POST['sec']){$task=$this->dec($task);}}
switch($task)
{
case "default":
$this->fn_default_sum();
break;
case $task:
$task="fn_".$task;
if(method_exists($this,$task)){$this->$task();}
break;
default:
$this->fn_default_sum();
break;
}
}
public function fn_default_sum()
{
echo $this->FN_CREATEHEADER();
echo "<style>
.besidebtnsave {margin-left:80px;margin-top:-6px;position:absolute;}
</style>";
echo "<script>
var myForm,myFormsearch,dgtra;
function initObject()
{";
$qry="select datasets,startvalue,stepvalue,endvalue from ".DB_APORTIL.".tbl_chart_trendsum
where modules='coresaugsm' and isdeleted=0 order by id desc limit 1";
$spval=$this->fn_get_fieldsvalues("datasets,startvalue,stepvalue,endvalue",$qry);
$datasets=$spval[0];$startvalue=$spval[1];$stepvalue=$spval[2];$endvalue=$spval[3];
echo " var datasets=$datasets;
myLineChart = new dhtmlXChart({
view:\"line\",
container:\"div_coresauline\",
value:\"#saugsm#\",
item:{
borderColor: \"#447900\",
color: \"#69ba00\"
},
line:{
color:\"#69ba00\",
width:2
},
tooltip:{
template:\"#saugsm#\"
},
offset:0,
xAxis:{
template:\"'#times#\"
},
yAxis:{
start:$startvalue,
step: $stepvalue,
end: $endvalue,
title:'in Thousand'
},
padding:{
left:35,
bottom: 50
},
origin:0,
legend:{
values:[{text:\"Sau GSM\"},{text:\"Sau WCDMA\"},{text:\"Sau LTE\"}],
align:\"right\",
valign:\"middle\",
layout:\"y\",
width: 100,
margin: 8,
marker:{
type: \"item\"
}
}
});
myLineChart.addSeries({
value:\"#sauwcdma#\",
item:{
borderColor: \"#0a796a\",
color: \"#4aa397\",
type:\"s\",
radius: 4
},
line:{
color:\"#4aa397\",
width:2
},
tooltip:{
template:\"#sauwcdma#\"
}
});
myLineChart.addSeries({
value:\"#saulte#\",
item:{
borderColor: \"#b7286c\",
color: \"#de619c\",
type:\"t\",
radius: 4
},
line:{
color:\"#de619c\",
width:2
},
tooltip:{
template:\"#saulte#\"
}
});
myLineChart.parse(datasets,\"json\");";
echo " };
</script>";
echo $this->FN_CLOSEHEADER();
echo $this->FN_CREATEBODY("white");
echo "<table width=\"98%\" height=\"100%\" border=\"0\">";
echo " <tr>
<td valign=\"top\" width=\"100%\">
<div style=\"width:100%;text-align:center;text-decoration:underline;font-size:24px;color:blue\">Trend SAU Information Period ".date("d M Y")."</div>
<div id=\"div_coresauline\" style=\"width:100%;height:330px;\"></div>
</td>
</tr>
<tr>
<td valign=\"top\" style=\"border:1px solid black\">
<div style=\"width:100%;text-align:center;text-decoration:underline;font-size:24px;color:blue\">Space AVailable</div>
<div id=\"div_coresauline2\" style=\"width:100%;height:330px;\">
</div>
</td>
</tr>";
echo "</table>";
echo $this->FN_CREATEFOOTER();
}
}
?>

View File

@ -0,0 +1,123 @@
<?php
class HOME_KPIPRFDLY extends HOME
{
public function home_kpiprfdly_javainit()
{
}
public function fn_kpiprfdly_init()
{
if(isset($_REQUEST['task'])){$task=trim(strtolower($_REQUEST['task']));}
if(isset($_POST['task'])){$task=trim(strtolower($_POST['task']));}
if($_REQUEST||$_POST){if($_REQUEST['sec']||$_POST['sec']){$task=$this->dec($task);}}
switch($task)
{
case "default":
$this->fn_default_sum();
break;
case $task:
$task="fn_".$task;
if(method_exists($this,$task)){$this->$task();}
break;
default:
$this->fn_default_sum();
break;
}
}
public function fn_default_sum()
{
echo $this->FN_CREATEHEADER();
echo "<style>
.besidebtnsave {margin-left:80px;margin-top:-6px;position:absolute;}
</style>";
echo "<script>
var myForm,myFormsearch,dgtra;
function initObject()
{";
$dtnow=date("Y-m-d",strtotime("-1 days"));
$qry="select datasets,legend,series,startvalue,stepvalue,endvalue from ".DB_APORTIL.".tbl_chart_trendran
where modules='netperf' and cast(chartname as date)=cast('$dtnow' as date)
and isdeleted=0 order by id desc limit 1";
//echo $qry;
$spval=$this->fn_get_fieldsvalues("datasets,legend,series,startvalue,stepvalue,endvalue",$qry);
$datasets=$spval[0];$legend=$spval[1];$series=$spval[2];$startvalue=$spval[3];$stepvalue=$spval[4];$endvalue=$spval[5];
//echo " var datasets=[{\"4GBETO\": \"6.91\", \"LENUH\": \"6.54\", \"times\": \"0\"},
// {\"4GBETO\": \"5.46\", \"LENUH\": \"2.73\", \"times\": \"1\"},
// {\"4GBETO\": \"1.46\", \"LENUH\": \"5.73\", \"times\": \"2\"}
// ];
$j=json_decode($series,true);
$firstseries=$j[0];
//echo $firstseries["value"];
// echo " var datasets=$datasets;var legend=$legend;var series=$series;
//echo " var datasets=[{\"MANLEUANA_4G\":\"16.84\",\"nartuto\":\"1.79\",\"vilanova\":\"2.97\",\"times\":\"0\"},{\"MANLEUANA_4G\":\"12.15\",\"nartuto\":\"2.4\",\"vilanova\":\"1.95\",\"times\":\"1\"},{\"MANLEUANA_4G\":\"7.37\",\"nartuto\":\"1.41\",\"vilanova\":\"1.59\",\"times\":\"2\"}];
echo " var datasets=$datasets;
myLineChart = new dhtmlXChart({
view:\"spline\",
container:\"div_kpiprfdlyline\",
value:\"".$firstseries['value']."\",
item:".json_encode($firstseries['item']).",
line:".json_encode($firstseries['line']).",
tooltip:".json_encode($firstseries['tooltip']).",
offset:0,
xAxis:{
title:\"\",
template:\"#times#\"
},
yAxis:{
title:\"Gigabytes\",
start:$startvalue,
step:$stepvalue,
end:$endvalue,
template:function(value){
return value%$stepvalue?'':value
}
},
padding:{
left:35,
bottom: 130
},
origin:0,
legend:{
values: $legend,
align:\"center\",
valign:\"bottom\",
layout:\"x\",
width: 200,
margin: 10
}
});";
$x=0;
foreach($j as $v)
{
if($x>0)
{
echo "myLineChart.addSeries(".json_encode($v).");";
}
$x+=1;
}
echo " myLineChart.parse(datasets,\"json\");";
echo " };
</script>";
echo $this->FN_CLOSEHEADER();
echo $this->FN_CREATEBODY("white");
echo "<table width=\"98%\" height=\"100%\" border=\"0\">";
echo " <tr>
<td valign=\"top\" width=\"100%\">
<div style=\"width:100%;text-align:center;text-decoration:underline;font-size:24px;color:blue\">Payload Performance Period ".date("d M Y",strtotime('-1 days'))."</div>
<div style=\"width:100%;text-align:center;font-style:italic;font-size:18px;color:grey\">Today : ".date("d M Y")."</div>
<div id=\"div_kpiprfdlyline\" style=\"width:100%;height:430px;\"></div>
</td>
</tr>";
echo "</table>";
echo $this->FN_CREATEFOOTER();
}
}
?>

View File

@ -0,0 +1,100 @@
<?php
class HOME_MARSAL extends HOME
{
public function home_marsal_javainit()
{
}
public function fn_marsal_init()
{
if(isset($_REQUEST['task'])){$task=trim(strtolower($_REQUEST['task']));}
if(isset($_POST['task'])){$task=trim(strtolower($_POST['task']));}
if($_REQUEST||$_POST){if($_REQUEST['sec']||$_POST['sec']){$task=$this->dec($task);}}
switch($task)
{
case "default":
$this->fn_default_sum();
break;
case $task:
$task="fn_".$task;
if(method_exists($this,$task)){$this->$task();}
break;
default:
$this->fn_default_sum();
break;
}
}
public function fn_default_sum()
{
echo $this->FN_CREATEHEADER();
echo "<style>
.besidebtnsave {margin-left:80px;margin-top:-6px;position:absolute;}
</style>";
echo "<script>
var myForm,myFormsearch,dgtra;
function initObject()
{";
echo " };
</script>";
echo $this->FN_CLOSEHEADER();
echo $this->FN_CREATEBODY();
echo $this->FN_CREATEFOOTER();
}
public function fn_sumofyears()
{
$years=$_REQUEST['years'];
// $qry="select sum(totalsms) sumofyears from ".DB_DMCS.".tbl_smsc_sumyears where years='$years' and isdeleted=0";
// $sumofyears=$this->fn_get_fieldvalue("sumofyears",$qry);
//echo $sumofyears;
echo "5234";
}
public function fn_sumoftop5()
{
$years=$_REQUEST['years'];
$months=$_REQUEST['months'];
// $qry="select uptname,totalsms from ".DB_DMCS.".tbl_smsc_sumtop5month where years='$years' and period='$months' and isdeleted=0 order by totalsms desc";
// $rs=$this->selectquery($qry);
// if($rs)
// {
// $res=array();
// while($rw=$this->data_row_object($rs))
// {
// array_push($res,array($rw->uptname."|".$rw->totalsms));
// }
// echo json_encode($res);
// }
// $this->clearrecordset($rs);
}
public function fn_sumoftop3()
{
$years=$_REQUEST['years'];
$months=$_REQUEST['months'];
// $qry="select uptname,totalsms from ".DB_DMCS.".tbl_smsc_sumtop3years where years='$years' and isdeleted=0 order by totalsms desc";
// $rs=$this->selectquery($qry);
// if($rs)
// {
// $res=array();
// while($rw=$this->data_row_object($rs))
// {
// array_push($res,array($rw->uptname."|".$rw->totalsms));
// }
// echo json_encode($res);
// }
// $this->clearrecordset($rs);
}
}
?>

View File

@ -0,0 +1,98 @@
<?php
class HOME_NETPERFDAILY extends HOME
{
public function home_netperfdaily_javainit()
{
}
public function fn_netperfdaily_init()
{
if(isset($_REQUEST['task'])){$task=trim(strtolower($_REQUEST['task']));}
if(isset($_POST['task'])){$task=trim(strtolower($_POST['task']));}
if($_REQUEST||$_POST){if($_REQUEST['sec']||$_POST['sec']){$task=$this->dec($task);}}
switch($task)
{
case "default":
$this->fn_default_sum();
break;
case $task:
$task="fn_".$task;
if(method_exists($this,$task)){$this->$task();}
break;
default:
$this->fn_default_sum();
break;
}
}
public function fn_default_sum()
{
echo $this->FN_CREATEHEADER();
echo "<style>
.besidebtnsave {margin-left:80px;margin-top:-6px;position:absolute;}
</style>";
echo "<script>
var myForm,myFormsearch,dgtra;
function initObject()
{";
$qry="select datasets,legend,series,startvalue,stepvalue,endvalue from ".DB_APORTIL.".tbl_chart_trendran
where modules='netperf' and cast(chartname as date)=cast('2019-06-30' as date)
and isdeleted=0 order by id desc limit 1";
//echo $qry;
$spval=$this->fn_get_fieldsvalues("datasets,legend,series,startvalue,stepvalue,endvalue",$qry);
$datasets=$spval[0];$legend=$spval[1];$series=$spval[2];$startvalue=$spval[3];$stepvalue=$spval[4];$endvalue=$spval[5];
echo " var datasets=$datasets;
myLineChart = new dhtmlXChart({
view:\"line\",
container:\"div_netperfdailyline\",
offset:0,
xAxis:{
template:\"'#times#\"
},
yAxis:{
start:$startvalue,
step: $stepvalue,
end: $endvalue,
title:'In Decimal'
},
padding:{
left:35,
bottom: 50
},
origin:0,
legend:{
values: $legend,
align:\"bottom\",
valign:\"middle\",
layout:\"y\",
width: 800,
margin: 8,
marker:{
type: \"item\"
}
}
});
myLineChart.addSeries($series);
myLineChart.parse(datasets,\"json\");";
echo " };
</script>";
echo $this->FN_CLOSEHEADER();
echo $this->FN_CREATEBODY("white");
// echo "<table width=\"98%\" height=\"100%\" border=\"0\">";
// echo " <tr>
// <td valign=\"top\" width=\"100%\">
// <div style=\"width:100%;text-align:center;text-decoration:underline;font-size:24px;color:blue\">Network Performance Period ".date("d M Y",strtotime('2019-'))."</div>
// <div id=\"div_netperfdailyline\" style=\"width:100%;height:330px;\"></div>
// </td>
// </tr>";
// echo "</table>";
echo $this->FN_CREATEFOOTER();
}
}
?>

View File

@ -0,0 +1,99 @@
<?php
class HOME_SUM extends HOME
{
public function home_sum_javainit()
{
}
public function fn_sum_init()
{
if(isset($_REQUEST['task'])){$task=trim(strtolower($_REQUEST['task']));}
if(isset($_POST['task'])){$task=trim(strtolower($_POST['task']));}
if($_REQUEST||$_POST){if($_REQUEST['sec']||$_POST['sec']){$task=$this->dec($task);}}
switch($task)
{
case "default":
$this->fn_default_sum();
break;
case $task:
$task="fn_".$task;
if(method_exists($this,$task)){$this->$task();}
break;
default:
$this->fn_default_sum();
break;
}
}
public function fn_default_sum()
{
echo $this->FN_CREATEHEADER();
echo "<style>
.besidebtnsave {margin-left:80px;margin-top:-6px;position:absolute;}
</style>";
echo "<script>
var myForm,myFormsearch,dgtra;
function initObject()
{";
echo " };
</script>";
echo $this->FN_CLOSEHEADER();
echo $this->FN_CREATEBODY();
echo $this->FN_CREATEFOOTER();
}
public function fn_sumofyears()
{
$years=$_REQUEST['years'];
$qry="select sum(totalsms) sumofyears from ".DB_DMCS.".tbl_smsc_sumyears where years='$years' and isdeleted=0";
$sumofyears=$this->fn_get_fieldvalue("sumofyears",$qry);
echo $sumofyears;
}
public function fn_sumoftop5()
{
$years=$_REQUEST['years'];
$months=$_REQUEST['months'];
$qry="select uptname,totalsms from ".DB_DMCS.".tbl_smsc_sumtop5month where years='$years' and period='$months' and isdeleted=0 order by totalsms desc";
$rs=$this->selectquery($qry);
if($rs)
{
$res=array();
while($rw=$this->data_row_object($rs))
{
array_push($res,array($rw->uptname."|".$rw->totalsms));
}
echo json_encode($res);
}
$this->clearrecordset($rs);
}
public function fn_sumoftop3()
{
$years=$_REQUEST['years'];
$months=$_REQUEST['months'];
$qry="select uptname,totalsms from ".DB_DMCS.".tbl_smsc_sumtop3years where years='$years' and isdeleted=0 order by totalsms desc";
$rs=$this->selectquery($qry);
if($rs)
{
$res=array();
while($rw=$this->data_row_object($rs))
{
array_push($res,array($rw->uptname."|".$rw->totalsms));
}
echo json_encode($res);
}
$this->clearrecordset($rs);
}
}
?>

View File

@ -0,0 +1,745 @@
<?php
class HOME_TICKET extends HOME
{
public function home_ticket_javainit()
{
}
public function fn_ticket_init()
{
if(isset($_REQUEST['task'])){$task=trim(strtolower($_REQUEST['task']));}
if(isset($_POST['task'])){$task=trim(strtolower($_POST['task']));}
if($_REQUEST||$_POST){if($_REQUEST['sec']||$_POST['sec']){$task=$this->dec($task);}}
switch($task)
{
case "default":
$this->fn_default_sum();
break;
case $task:
$task="fn_".$task;
if(method_exists($this,$task)){$this->$task();}
break;
default:
$this->fn_default_sum();
break;
}
}
public function fn_default_sum()
{
echo $this->FN_CREATEHEADER();
// === Init Route information dashboard
$idship=1;
$idroutestart=1;
$routestartname="Dili";
$idrouteend=3;
$routeendname="Atauro";
$shipname="Nakroma";
$route="Dili-Atauro";
$qry="select idship,shipname,idroutestart,routestartname,idrouteend,routeendname from ".DB_APORTIL.".tbl_dashboard_setting_rute ";
$qry.="where idemployee='".$_SESSION['idemployee']."' and isdeleted=0 order by id asc limit 1";
if($this->fn_row_isexists($qry)){
$sp=$this->fn_get_fieldsvalues("idship,idroutestart,idrouteend,routestartname,routeendname,shipname",$qry);
$idship=$sp[0];$idroutestart=$sp[1];$idrouteend=$sp[2];$routestartname=$sp[3];$routeendname=$sp[4];
$route=$routestartname."-".$routeendname;
$shipname=$sp[5];
}
echo "<style>
.besidebtnsave {margin-left:80px;margin-top:-6px;position:absolute;}
</style>";
echo "<script>
var myForm,myFormsearch,dgtra,dwins;
var t1;
function initObject()
{
t1=setTimeout(function(){
fn_getStatusInfo();
},5000);";
// === Get Info Trend Chart Bar
$qry="select modules,typechart,datasets,startvalue,stepvalue,endvalue from ".DB_APORTIL.".tbl_chart_trendsum where modules='hometicketbarchart'";
$sp=$this->fn_get_fieldsvalues("modules,typechart,datasets,startvalue,stepvalue,endvalue",$qry);
$datasets=$sp[2];$startvalue=$sp[3];$stepvalue=$sp[4];$endvalue=$sp[5];
echo "var multiple_dataset = $datasets;";
//echo "var multiple_dataset = [
// { sales:\"20\", sales2:\"35\", year:\"02\" },
// { sales:\"40\", sales2:\"24\", year:\"03\" },
// { sales:\"44\", sales2:\"20\", year:\"04\" },
// { sales:\"23\", sales2:\"50\", year:\"05\" },
// { sales:\"21\", sales2:\"36\", year:\"06\" },
// { sales:\"50\", sales2:\"40\", year:\"07\" },
// { sales:\"30\", sales2:\"65\", year:\"08\" },
// { sales:\"90\", sales2:\"62\", year:\"09\" },
// { sales:\"55\", sales2:\"40\", year:\"10\" },
// { sales:\"72\", sales2:\"45\", year:\"11\" }
// ];";
echo "var myBarChart = new dhtmlXChart({
view:\"bar\",
container:\"div_ticketbaralarm\",
value:\"#atauro#\",
color: \"#58dccd\",
gradient:\"rising\",
tooltip:{
template:\"#atauro#\"
},
width:60,
xAxis:{
template:\"'#months#\"
},
yAxis:{
start:0,
step:10,
end:100
},
legend:{
values:[{text:\"Atauro\",color:\"#58dccd\"},{text:\"Oecusse\",color:\"#a7ee70\"}],
valign:\"middle\",
align:\"bottom\",
width:190,
layout:\"x\"
}
});
myBarChart.addSeries({
value:\"#oecusse#\",
color:\"#a7ee70\",
tooltip:{
template:\"#oecusse#\"
}
});
myBarChart.parse(multiple_dataset,\"json\");";
// === Get Info Trend Chart Bar
$qry="select modules,typechart,datasets,startvalue,stepvalue,endvalue from ".DB_APORTIL.".tbl_chart_trendsum where modules='hometicketpie1'";
$sp=$this->fn_get_fieldsvalues("modules,typechart,datasets,startvalue,stepvalue,endvalue",$qry);
$datasets=$sp[2];$startvalue=$sp[3];$stepvalue=$sp[4];$endvalue=$sp[5];
echo " var destination = $datasets;
myPieChart = new dhtmlXChart({
view:\"pie\",
container:\"div_pieshippasstrend\",
value:\"#percent#\",
color:\"#color#\",
labelLines: true,
label:\"#dest#: #percent# %\",
shadow:0
});
myPieChart.parse(destination,\"json\");
";
echo " }
function fn_getStatusInfo(){
var idship=document.getElementById('txt_idship').value;
var idroutestart=document.getElementById('txt_idroutestart').value;
var idrouteend=document.getElementById('txt_idrouteend').value;
//alert(idship+' '+idroutestart+' '+idrouteend);
var data=ajaxuridhtmlx('".$this->enc("obj_home")."','obj=".$this->enc("home_ticket")."&task=".$this->enc("getstinfo")."&idship='+idship+'&idroutestart='+idroutestart+'&idrouteend='+idrouteend);
data=JSON.parse(data);
//alert(data);
//alert(data);
for(var i in data){
var div=document.getElementById('div'+data[i]['ndx']);
div.style.color=data[i]['colorfont'];
div.style.backgroundColor=data[i]['colors'];
}
t1=setTimeout(function(){
fn_getStatusInfo();
},10000);
}
function fn_showsettings()
{
var idship=document.getElementById('txt_idship').value;
var shipname=document.getElementById('spshipname').innerHTML;
var idroutestart=document.getElementById('txt_idroutestart').value;
var routestartname=document.getElementById('txt_routestartname').value;
var idrouteend=document.getElementById('txt_idrouteend').value;
var routeendname=document.getElementById('txt_routeendname').value;
dwins=new dhtmlXWindows();dwins.attachViewportTo(\"winVP\");
var url='?ajax=1&sec=1&option=".$this->enc("obj_home")."&obj=".$this->enc("home_ticket")."&task=".$this->enc("settings")."&idship='+idship+'&shipname='+shipname+'&idroutestart='+idroutestart;
url=url+'&routestartname='+routestartname+'&idrouteend='+idrouteend+'&routeendname='+routeendname;
dwins.createWindow(\"winpic\",350,150,600,250);
dwins.window('winpic').progressOn();
dwins.window('winpic').setText(\"SETTINGS\");
dwins.window('winpic').attachURL(url);
dwins.window('winpic').setModal(true);
dwins.window('winpic').progressOff();";
//$url="?ajax=1&sec=1&option=".$this->enc("obj_home")."&obj=".$this->enc("home_ticket")."&task=".$this->enc("settings")."&idship='";
//$this->FN_DHTMLXWINDOWSURL("dwins","winpic","Settings","350","150","560","250",$url,false,true);
echo " }
function fn_setdashboard(idship,idroutestart,routenamestart,idrouteend,routenameend,shipname,routename)
{
//alert(idship+' '+idroutestart+' '+idrouteend);
document.getElementById('txt_idship').value=idship;
document.getElementById('txt_idroutestart').value=idroutestart;
document.getElementById('txt_routestartname').value=routenamestart;
document.getElementById('txt_idrouteend').value=idrouteend;
document.getElementById('txt_routeendname').value=routenameend;
document.getElementById('spshipname').innerHTML=shipname;
document.getElementById('sproutename').innerHTML=routename;
dwins.unload();
}
</script>";
echo $this->FN_CLOSEHEADER();
echo $this->FN_CREATEBODY("white");
echo "<div id=\"winVP\" style=\"height:1020px;\">";
echo "<table width=\"98%\" height=\"100%\">";
echo " <tr>
<td valign=\"top\" width=\"70%\" style=\"background-color:none;height:380px\">
<div style=\"width:100%;text-align:center;text-decoration:underline;font-size:24px;color:blue\">Nakroma Passenger Performance Period ".date("Y")."</div>
<div id=\"div_ticketbaralarm\" style=\"width:100%;height:330px;\"></div>
</td>
<td valign=\"top\" rowspan=\"2\">
<div>
<table width=\"100%\">
<tr>
<td colspan=\"11\">
<table width=\"100%\" style=\"background-Color:transparent\">
<tr>
<td>Ship</td>
<td>:</td>
<td width=\"400px\">
<span id=\"spshipname\">$shipname</span>
<input type=\"hidden\" id=\"txt_idship\" value=\"$idship\" />
</td>
<td>,</td>
<td>Rute</td>
<td>:</td>
<td width=\"160px\">
<span id=\"sproutename\">$route</span>
<input type=\"hidden\" id=\"txt_idroutestart\" value=\"$idroutestart\" />
<input type=\"hidden\" id=\"txt_routestartname\" value=\"$routestartname\" />
<input type=\"hidden\" id=\"txt_idrouteend\" value=\"$idrouteend\" />
<input type=\"hidden\" id=\"txt_routeendname\" value=\"$routeendname\" />
</td>
<td><a href=\"javascript:void(0)\" onClick=\"fn_showsettings()\"><i class=\"fa fa-cog\" style=\"font-size:14pt;\"></i></a></td>
</tr>
</table>
</td>
</tr>";
$qry="select totalseat from ".DB_APORTIL.".tbl_ship_information where id=1";
if($this->fn_row_isexists($qry)){
$totalseat=$this->fn_get_fieldvalue("totalseat",$qry);
$j=10;$s=5;
for($i=1;$i<=$totalseat;$i++){
$colors="#ecf0f1";$colorfont="black";
if($i==1||$i==($j+1)){
echo "<tr>";
}
// Content
// === Dili atauro
$qrycheckin="select inctiket,status from ".DB_APORTIL.".tbl_passenger_tiket
where inctiket='$i' and idship=$idship and idroutestart=$idroutestart and idrouteend=$idrouteend and cast(dates as date)=cast(now() as date) and isdeleted=0";
if($this->fn_row_isexists($qrycheckin)){
$colorfont="white";
$status=$this->fn_get_fieldvalue("status",$qrycheckin);
$colors="#f1c40f";
if($status==1){$colors="#3498db";}
if($status==-2){$colors="#ecf0f1";$colorfont="black";}
}
echo "<td width=\"10px\" height=\"8px\" style=\"height:8px;background-color:transparent\">
<div id=\"div$i\" style=\"color:$colorfont;padding-top:1px;font-size:8pt;text-align:center;border: 1px solid transparent;border-radius: 2px;background-color:$colors;width:25px;height:15px\">
$i
</div>
</td>";
if($i==$s){
echo "<td width=\"20px\">&nbsp</td>";
}
if($i%10==0){
$j+=10;$s+=10;
echo "</tr>";
}
}
}
//$arr=array("4-H"=>"#f1c40f","5-C"=>"#f1c40f","5-F"=>"#f1c40f","5-G"=>"#f1c40f","5-H"=>"#f1c40f","20-C"=>"#2980b9","20-D"=>"#2980b9","30-D"=>"#2980b9");
// === Seat Code
// echo "<tr>";
// for($h=1;$h<=10;$h++){
// if($h==1){
// echo "<td width=\"1px\">&nbsp</td>";
// }
// echo "<td width=\"10\" style=\"font-size:8pt;\">&nbsp;".chr(64+$h)."</td>";
// if($h==5){
// echo "<td width=\"20px\">&nbsp</td>";
// }
// }
// echo "</tr>";
//
// === SEAT Number
// for($i=1;$i<=30;$i++){
// echo "<tr>";
// for($j=1;$j<=10;$j++)
// {
// $colors="#ecf0f1";
//if($i==4&&$j==8){$colors="#f1c40f";}
// if(array_key_exists("$i-".chr(64+$j),$arr)){
// $colors=$arr["$i-".chr(64+$j)];
// }
// if($j==1){
// echo "<td width=\"1px\" style=\"font-size:10pt;color:black\">$i.</td>";
// }
// echo "<td width=\"10px\" height=\"8px\" style=\"height:8px;background-color:none\">
// <div style=\"border: 1px solid transparent;border-radius: 2px;background-color:$colors;width:15px;height:8px\">
// &nbsp;
// </div>
// </td>";
// if($j==5){
// echo "<td width=\"20px\">&nbsp</td>";
// }
// }
// echo "</tr>";
// }
echo " </table>
</div>
</td>
</tr>
<tr>
<td valign=\"top\" style=\"background-color:none\">
<table width=\"100%\">
<tr>
<td>
<div class=\"preview_tpl\" id=\"previewData\" style=\"\">
<div class=\"header_tpl\" style=\"font-weight:bold\">Nakroma Passenger</div>
<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"width:400px\">
<tr>
<td>
<div style=\"text-align:center;text-decoration:underline;font-size:20px;color:blue;margin-top:10px\">
Period ".date("Y")."
</div>
<div id=\"div_pieshippasstrend\" style=\"height:250px;margin-top:0px;\"></div>
</td>
</tr>
<!--<tr>
<td>
<table>
<tr>
<td>Atauro</td>
<td>: 55% (1.5K)</td>
<td>Oekuse</td>
<td>: 45% (800)</td>
</tr>
</table>
</td>
</tr>-->
</table>
</div>
</td>
<td valign=\"top\">
<div class=\"preview_tpl\" id=\"previewData\" style=\"margin-left:20px\">
<div class=\"header_tpl\" style=\"font-weight:bold\">Nakroma Manifest</div>
<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"width:450px\">
<thead>
<tr>
<td colspan=\"5\">
<table>
<tr>
<td>Nacroma Tonase</td>
<td>:</td>
<td><span style=\"font-size:19px\">200</span> ton</td>
</tr>
<tr>
<td>Threshold</td>
<td>:</td>
<td><span style=\"font-size:19px\">180</span> ton</td>
</tr>
</table>
</td>
</tr>
</thead>
<tr>
<td style=\"border-bottom:1px solid black;border-right:1px solid black\"></td>
<td style=\"border-bottom:1px solid black;\">Unit</td>
<td align=\"right\" style=\"border-bottom:1px solid black\">Qty</td>
<td align=\"right\" style=\"border-bottom:1px solid black\">( \$ )</td>
<td align=\"right\" style=\"border-bottom:1px solid black\">( ton )</td>
</tr>
<tr>
<td style=\"border-right:1px solid black\">Passenger</td>
<td>Person</td>
<td align=\"right\">300</td>
<td align=\"right\">\$1.800</td>
<td align=\"right\">15.0</td>
</tr>
<tr>
<td style=\"border-right:1px solid black\">Vehichle</td>
<td>unit</td>
<td align=\"right\">10</td>
<td align=\"right\">\$6.800</td>
<td align=\"right\">20.0</td>
</tr>
<tr>
<td style=\"border-right:1px solid black\">Non Vehichle</td>
<td>unit</td>
<td align=\"right\">10</td>
<td align=\"right\">\$4.700</td>
<td align=\"right\">18.0</td>
</tr>
<tr>
<td style=\"border-top:1px dashed black;border-right:1px solid black\">Total</td>
<td style=\"border-top:1px dashed black\"></td>
<td align=\"right\" style=\"border-top:1px dashed black;color:blue;\">330</td>
<td align=\"right\" style=\"border-top:1px dashed black;color:blue;\">\$13.300</td>
<td align=\"right\" style=\"border-top:1px dashed black;color:blue;\">54.0</td>
</tr>
<tfoot>
<tr>
<td colspan=\"5\">
<table width=\"100%\" style=\"background-color:none\">
<tr>
<td width=\"220px\" style=\"font-Size:12pt;\">GAP ( Ton )</td>
<td width=\"1px\" style=\"font-Size:12pt;\">-></td>
<td width=\"220px\" style=\"font-Size:12pt;\">180.0 - 54.0</td>
<td width=\"1px\" style=\"font-Size:12pt;\">=</td>
<td style=\"font-Size:14pt;\">
<div style=\"background-color:green;color:white;padding:5px;border: 2px solid green;border-radius: 5px 2px;\">
126.0
</div>
</td>
</tr>
<tr>
<td colspan=\"5\" style=\"font-Size:14pt;\">
<span>Tonase Status</span>&nbsp;
<span>:</span>&nbsp;
<span style=\"color:green;font-size:16pt;font-weight:bold\">GOOD</span>
</td>
</tr>
</table>
</td>
</tr>
</tfoot>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>";
echo "</table>";
echo "</div>";
echo $this->FN_CREATEFOOTER();
}
public function fn_getstinfo(){
$idship=$_REQUEST['idship'];
// $shipname=$_REQUEST['shipname'];
$idroutestart=$_REQUEST['idroutestart'];
// $routestartname=$_REQUEST['routestartname'];
$idrouteend=$_REQUEST['idrouteend'];
// $routeendname=$_REQUEST['routeendname'];
$arr=array();
$qry="select totalseat from ".DB_APORTIL.".tbl_ship_information where id=$idship";
//echo $qry;return false;
if($this->fn_row_isexists($qry)){
$totalseat=$this->fn_get_fieldvalue("totalseat",$qry);
for($i=1;$i<=$totalseat;$i++){
$colors="#ecf0f1";$colorfont="black";
// === Dili atauro
$qrycheckin="select inctiket,status from ".DB_APORTIL.".tbl_passenger_tiket
where inctiket='$i' and (idship=$idship and idroutestart=$idroutestart and idrouteend=$idrouteend)
and cast(dates as date)=cast(now() as date) and isdeleted=0";
//echo $qrycheckin;return false;
if($this->fn_row_isexists($qrycheckin)){
$status=$this->fn_get_fieldvalue("status",$qrycheckin);
$colors="#f1c40f";$colorfont="white";
if($status==1){$colors="#3498db";}
if($status==-2){$colors="#ecf0f1";$colorfont="black";}
// array_push($arr,array("$i"=>$colors));
}
array_push($arr,array("ndx"=>$i,"colors"=>$colors,"colorfont"=>$colorfont));
}
}
echo json_encode($arr);
}
public function fn_settings()
{
$idship=$_REQUEST['idship'];
$shipname=$_REQUEST['shipname'];
$idroutestart=$_REQUEST['idroutestart'];
$routestartname=$_REQUEST['routestartname'];
$idrouteend=$_REQUEST['idrouteend'];
$routeendname=$_REQUEST['routeendname'];
echo $this->FN_CREATEHEADER();
echo "<style>
.besidebtnsave {margin-left:108px;margin-top:-6px;position:absolute;}
.besidebtnupdate {margin-left:210px;margin-top:-6px;position:absolute;}
.besidebtnsubmit {margin-left:292px;margin-top:-6px;position:absolute;}
.besidebtndelete {margin-left:306px;margin-top:-6px;position:absolute;}
</style>";
echo "<script>
var myForm,myFormsearch,dgroute;
function initObject()
{";
$formdata=array(
array("type"=>"settings","position"=>"label-left","labelWidth"=>"180","inputWidth"=>"120"),
array("type"=>"block","width"=>"500",
"list"=>array(
array("type"=>"hidden","name"=>"txt_id"),
array("type"=>"combo","name"=>"cbo_idship","label"=>"Ship Name","required"=>"true","info"=>"true","inputWidth"=>"280","value"=>"0",
"tooltip"=>"Pilih Ship Name first. Thank You","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtleft"),
array("type"=>"combo","name"=>"cbo_idroutestart","label"=>"Rute From","required"=>"true","info"=>"true","inputWidth"=>"150","value"=>"",
"tooltip"=>"Pilih From terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtleft"),
array("type"=>"combo","name"=>"cbo_idrouteend","label"=>"Rute To","required"=>"true","info"=>"true","inputWidth"=>"150","value"=>"",
"tooltip"=>"Pilih To terlebih dahulu. TERIMA KASIH","validate"=>"NotEmpty","maxLength"=>"11","className"=>"txtleft"),
array("type"=>"button","name"=>"btnsave","value"=>"Set","className"=>"button_update","offsetLeft"=>"20","offsetTop"=>"15"),
//array("type"=>"button","name"=>"btnupdate","value"=>"Update","className"=>"button_saveas besidebtnsave","offsetLeft"=>"0","disabled"=>"1"),
//array("type"=>"button","name"=>"btnsubmit","value"=>"Submit","className"=>"button_submit besidebtnupdate","offsetLeft"=>"0","disabled"=>"1"),
//array("type"=>"button","name"=>"btndelete","value"=>"Delete","className"=>"button_delete besidebtnupdate","offsetLeft"=>"0","disabled"=>"1"),
//array("type"=>"button","name"=>"btncancel","value"=>"Cancel","className"=>"button_cancel besidebtndelete","offsetLeft"=>"0","disabled"=>"0")
)
)
);
$this->FN_DHTMLXFORM("myForm","divroutenew",$formdata);
$urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_ship_information|id,shipname')";
$this->FN_COMBOVALIDATIONVALUENEW("myForm","cbo_idship","tbl_ship_information","$urlcbo","");
echo "myForm.getCombo('cbo_idship').addOption($idship,'$shipname', null, null, true);";
$urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_route_information|id,routename')";
$this->FN_COMBOVALIDATIONVALUENEW("myForm","cbo_idroutestart","tbl_route_information","$urlcbo","");
echo "myForm.getCombo('cbo_idroutestart').addOption($idroutestart,'$routestartname', null, null, true);";
$urlcbo="fn_dhtmlxloadobject('".$this->enc("obj_controller")."','obj=".$this->enc("-")."&task=".$this->enc("dhtmlxcbofilter")."&tableobj=tbl_route_information|id,routename')";
$this->FN_COMBOVALIDATIONVALUENEW("myForm","cbo_idrouteend","tbl_route_information","$urlcbo","");
echo "myForm.getCombo('cbo_idrouteend').addOption($idrouteend,'$routeendname', null, null, true);";
$arrerror=array("cbo_idroutestart"=>"Error Found : Harap Isikan <b>Rute Start</b> terlebih dahulu.TERIMA KASIH",
"cbo_idrouteend"=>"Error Found : Harap Isikan <b>Rute Tiba</b> terlebih dahulu.TERIMA KASIH"
);
$this->FN_DHTMLXFORMVALIDATIONERROR("myForm",$arrerror);
$arrayControls=array("txt_id"=>"",
"cbo_idship"=>"",
"cbo_idroutestart"=>"",
"cbo_idrouteend"=>""
);
// === Form Event
$onobjkeydown="if(ev.keyCode==13){ev.stopPropagation();ev.preventDefault();if(myForm.isItemEnabled('btnupdate')){myForm.setItemFocus('btnupdate');dhtmlXclickButton('btnupdate');}else{myForm.setItemFocus('btnsave');}return false;}";
$onbuttonclickbtnsave="if(myForm.validate())
{
dhtmlx.confirm({
title:'Confirmation',text:'Are you will be saved and data is correctly?',type:'confirm',
callback:function(result){
if(result)
{";
$params="'obj=".$this->enc("home_ticket")."&task=".$this->enc("setdashboard")."'";
$onformsenddata="url=fn_dhtmlxsenddata('".$this->enc("obj_home")."',$params);
myForm.send(url,\"get\",function(loader, response){";
$onformsenddata.=$this->FN_DHTMLXWINDOWSHIDEPROGRESS();
$onformsenddata.="var sp=trim(response).split('|');
//alert(response);
if(sp[0]=='ok')
{
fn_dhtmlxmessage('','Data <b>'+myForm.getCombo('cbo_idroutestart').getComboText()+'</b> has been saved');";
//$onformsenddata.=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls,"txt_routename");
//$onformsenddata.="fn_grid_loaddata();
$onformsenddata.="var idship=myForm.getItemValue('cbo_idship');";
$onformsenddata.="var idroutestart=myForm.getItemValue('cbo_idroutestart');";
$onformsenddata.="var routenamestart=myForm.getCombo('cbo_idroutestart').getComboText();";
$onformsenddata.="var idrouteend=myForm.getItemValue('cbo_idrouteend');";
$onformsenddata.="var routenameend=myForm.getCombo('cbo_idrouteend').getComboText();";
$onformsenddata.="var route=myForm.getCombo('cbo_idroutestart').getComboText()+'-'+myForm.getCombo('cbo_idrouteend').getComboText();";
$onformsenddata.="var shipname=myForm.getCombo('cbo_idship').getComboText();";
$onformsenddata.="window.parent.fn_setdashboard(idship,idroutestart,routenamestart,idrouteend,routenameend,shipname,route);
}
else if(sp[0]=='failed')
{fn_dhtmlxmessage('error','Error Found : '+sp[1]);}
else
{fn_dhtmlxmessage('error','Error Found : '+response);}
});";
$onbuttonclickbtnsave.=$this->FN_DHTMLXWINDOWSHOWPROGESS($onformsenddata);
$onbuttonclickbtnsave.=" }
}
});
}";
$onbuttonclickbtnupdt="if(myForm.validate())
{
dhtmlx.confirm({
title:'Confirmation',text:'Are you will be updated and data is correctly?',type:'confirm',
callback:function(result){
if(result)
{";
$params="'obj=".$this->enc("data_route")."&task=".$this->enc("updrecord")."'";
$onformsenddata="url=fn_dhtmlxsenddata('".$this->enc("obj_data")."',$params);
myForm.send(url,\"get\",function(loader, response){";
$onformsenddata.=$this->FN_DHTMLXWINDOWSHIDEPROGRESS();
$onformsenddata.="var sp=trim(response).split('|');
//alert(response);
if(sp[0]=='ok')
{
fn_dhtmlxmessage('','Data <b>'+myForm.getItemValue('txt_routename')+'</b> has been update');";
$onformsenddata.=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls,"txt_routename");
$onformsenddata.="myForm.enableItem('btnsave');";
$onformsenddata.="myForm.disableItem('btnupdate');";
$onformsenddata.="myForm.disableItem('btndelete');";
$onformsenddata.="fn_grid_loaddata();
}
else if(sp[0]=='failed')
{fn_dhtmlxmessage('error','Error Found : '+sp[1]);}
else
{fn_dhtmlxmessage('error','Error Found : '+response);}
});";
$onbuttonclickbtnupdt.=$this->FN_DHTMLXWINDOWSHOWPROGESS($onformsenddata);
$onbuttonclickbtnupdt.=" }
}
});
}";
$eventafterdeleted=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls,"txt_routename");
$eventafterdeleted.="myForm.enableItem('btnsave');";
$eventafterdeleted.="myForm.disableItem('btnupdate');";
$eventafterdeleted.="myForm.disableItem('btndelete');";
$eventafterdeleted.="fn_grid_loaddata();";
$onbuttonclickbtndeleted=$this->FN_DHTMLXREMARKFORDELETED2("obj_data","data_route","myForm.getItemValue('txt_id')","myForm.getItemValue('txt_routename')",$eventafterdeleted);
$onbuttonclickbtncancel=$this->FN_DHTMLXFORMCLEAR2("myForm",$arrayControls);
$onbuttonclickbtncancel.="myForm.enableItem('btnsave');";
$onbuttonclickbtncancel.="myForm.disableItem('btnupdate');";
$onbuttonclickbtncancel.="myForm.disableItem('btndelete');";
$onbuttonclickbtncancel.="myForm.setItemFocus('txt_routename');";
$onbuttonclickbtncancel.="fn_grid_loaddata();";
$arrevent=array(
array("eventname"=>"onbuttonclick","eventparam"=>"id,val",
"switch"=>array(
"btnsave"=>"$onbuttonclickbtnsave",
"btnupdate"=>"$onbuttonclickbtnupdt",
"btndelete"=>"$onbuttonclickbtndeleted",
"btncancel"=>"$onbuttonclickbtncancel"
)
),
array("eventname"=>"onkeydown","eventparam"=>"inp,ev,id,val",
"switch"=>array(
"txt_description"=>"$onobjkeydown"
)
)
);
$this->FN_DHTMLXFORMEVENT("myForm",$arrevent);
// === FORM SEARCH AND GRID
// $formdata=array(
// array("type"=>"settings","position"=>"label-left","labelWidth"=>"180","inputWidth"=>"120"),
// array("type"=>"fieldset","width"=>"580","label"=>"Search",
// "list"=>array(
// array("type"=>"input","name"=>"txtsearch","label"=>"Insert Your Keyword","info"=>"true","inputWidth"=>"240",
// "tooltip"=>"Insert Your Keyword","maxLength"=>"","className"=>"txtleft","labelWidth"=>"210"),
// array("type"=>"newcolumn"),
// array("type"=>"button","name"=>"btnfind","value"=>"","className"=>"button_find","offsetLeft"=>"10","offsetTop"=>"0")
// )
// )
// );
// $this->FN_DHTMLXFORM("myFormsearch","divroutesearch",$formdata,true);
// $ontxtsearchkeydown="if(ev.keyCode==13){ev.stopPropagation();ev.preventDefault();myFormsearch.setItemFocus('btnfind');}";
// $arrevent=array(
// array("eventname"=>"onbuttonclick","eventparam"=>"id,val",
// "switch"=>array(
// "btnfind"=>"fn_grid_loaddata()"
// )
// ),
// array("eventname"=>"onkeydown","eventparam"=>"inp,ev,id,val",
// "switch"=>array(
// "txtsearch"=>"$ontxtsearchkeydown"
// )
// )
// );
// $this->FN_DHTMLXFORMEVENT("myFormsearch",$arrevent);
// $grdinit=array("gridname"=>"dgroute","divtarget"=>"div_dgroute","divpaging"=>"div_dgroutepaging","paginglimit"=>PAGE_LIMIT,
// "showloader"=>"true");
// $gridproperties=array("id"=>"right,ro,96,right,int,false,true",
// "No.&nbsp;"=>"right,ro,35,center,int,false",
// "Route Name"=>"left,ro,230,left,str,false",
// "Description"=>"left,ro,238,left,str,false");
// $this->FN_DHTMLXGRIDVIEW($grdinit,$gridproperties,"bricks","","fn_grid_loaddata()");
// $arrfields=array("txt_id"=>"","txt_routename"=>"","txt_description"=>"");
// $otherevent="";
// $this->FN_DHTMLXGRIDVIEWTOFORMNEW("dgroute","myForm","tbl_route_information",0,$arrfields,"");
echo " }
</script>";
echo $this->FN_CLOSEHEADER();
echo $this->FN_CREATEBODY("e8f1ff");
echo "<table width=\"98%\" border=\"0\">
<tr>
<td>";
$url="location.reload();";
$myuri=array("<b>DASHBOARD CONFIGURATION</b>"=>"$url|id='a_route'");
echo $this->MULTIPLE_LINK($myuri);
echo " </td>
</tr>
<tr>
<td>
<div id=\"divroutecontent\" style=\"margin-left:0px;\">
<table width=\"98%\" border=\"0\">
<tr>
<td width=\"45%\" valign=\"top\">
<div id=\"divroutenew\" style=\"\"></div>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>";
echo $this->FN_CREATEFOOTER();
}
public function fn_setdashboard($isupdate=null)
{
$year=date("Y");
// if($isupdate){$id=$_REQUEST['txt_id'];}
$idemployee=$_SESSION['idemployee'];
$nik=$_SESSION['nik'];
$idship=$_REQUEST['cbo_idship'];
$sp=$this->fn_get_fieldsvalues("shipname,shipnumber","select shipname,shipnumber from ".DB_APORTIL.".tbl_ship_information where id='$idship'");
$shipnumber=$sp[1];$shipname=$sp[0];
$idroutestart=$_REQUEST['cbo_idroutestart'];
$routenamestart=$this->fn_get_fieldvalue("routename","select routename from ".DB_APORTIL.".tbl_route_information where id='$idroutestart'");
$idrouteend=$_REQUEST['cbo_idrouteend'];
$routenameend=$this->fn_get_fieldvalue("routename","select routename from ".DB_APORTIL.".tbl_route_information where id='$idrouteend'");
$qry="insert into ".DB_APORTIL.".tbl_dashboard_setting_rute
set idemployee='$idemployee',nik='$nik',idship='$idship',shipname='$shipname',idroutestart='$idroutestart',
routestartname='$routenamestart',idrouteend='$idrouteend',routeendname='$routenameend',iby='".$_SESSION['nik']."',idt=now()";
if($this->fn_row_isexists("select id from ".DB_APORTIL.".tbl_dashboard_setting_rute where idemployee='$idemployee'"))
{
$qry="update ".DB_APORTIL.".tbl_dashboard_setting_rute
set idemployee='$idemployee',nik='$nik',idship='$idship',shipname='$shipname',idroutestart='$idroutestart',
routestartname='$routenamestart',idrouteend='$idrouteend',routeendname='$routenameend',uby='".$_SESSION['nik']."',udt=now()
where idemployee='$idemployee'";
}
if($this->executequery($qry))
{
echo 'ok|';
}
}
}
?>

View File

@ -0,0 +1,292 @@
<?php
class HOME_TICKET extends HOME
{
public function home_ticket_javainit()
{
}
public function fn_ticket_init()
{
if(isset($_REQUEST['task'])){$task=trim(strtolower($_REQUEST['task']));}
if(isset($_POST['task'])){$task=trim(strtolower($_POST['task']));}
if($_REQUEST||$_POST){if($_REQUEST['sec']||$_POST['sec']){$task=$this->dec($task);}}
switch($task)
{
case "default":
$this->fn_default_sum();
break;
case $task:
$task="fn_".$task;
if(method_exists($this,$task)){$this->$task();}
break;
default:
$this->fn_default_sum();
break;
}
}
public function fn_default_sum()
{
echo $this->FN_CREATEHEADER();
echo "<style>
.besidebtnsave {margin-left:80px;margin-top:-6px;position:absolute;}
</style>";
echo "<script>
var myForm,myFormsearch,dgtra;
function initObject()
{";
$qry="select datasets,startvalue,stepvalue,endvalue from ".DB_APORTIL.".tbl_chart_trendsum
where modules='hometicketperformance' and isdeleted=0 order by id desc limit 1";
$spval=$this->fn_get_fieldsvalues("datasets,startvalue,stepvalue,endvalue",$qry);
$datasets=$spval[0];$startvalue=$spval[1];$stepvalue=$spval[2];$endvalue=$spval[3];
// echo " var datasets = [
// { sitedown:\"20\", mainsfail:\"35\", alarm3G:\"35\", alarm4G:\"15\", totalticket:\"55\", year:\"Jan\" },
// { sitedown:\"20\", mainsfail:\"35\", alarm3G:\"35\", alarm4G:\"35\", totalticket:\"55\", year:\"Feb\" },
// { sitedown:\"40\", mainsfail:\"24\", alarm3G:\"35\", alarm4G:\"25\", totalticket:\"40\", year:\"Mar\" },
// { sitedown:\"44\", mainsfail:\"20\", alarm3G:\"35\", alarm4G:\"5\", totalticket:\"27\", year:\"Apr\" },
// { sitedown:\"23\", mainsfail:\"50\", alarm3G:\"35\", alarm4G:\"56\", totalticket:\"43\", year:\"May\" },
// { sitedown:\"21\", mainsfail:\"36\", alarm3G:\"35\", alarm4G:\"23\", totalticket:\"31\", year:\"Jun\" },
// { sitedown:\"50\", mainsfail:\"40\", alarm3G:\"35\", alarm4G:\"12\", totalticket:\"56\", year:\"Jul\" },
// { sitedown:\"30\", mainsfail:\"65\", alarm3G:\"35\", alarm4G:\"33\", totalticket:\"75\", year:\"Aug\" },
// { sitedown:\"90\", mainsfail:\"62\", alarm3G:\"35\", alarm4G:\"20\", totalticket:\"55\", year:\"Sep\" },
// { sitedown:\"55\", mainsfail:\"40\", alarm3G:\"35\", alarm4G:\"10\", totalticket:\"60\", year:\"Oct\" },
// { sitedown:\"72\", mainsfail:\"45\", alarm3G:\"35\", alarm4G:\"14\", totalticket:\"54\", year:\"Nov\" },
// { sitedown:\"72\", mainsfail:\"45\", alarm3G:\"35\", alarm4G:\"13\", totalticket:\"54\", year:\"Dec\" }
// ];";
echo " var datasets=$datasets;
var barChart1 = new dhtmlXChart({
view:\"bar\",
container:\"div_ticketbaralarm\",
value:\"#T1#\",
color: \"#58dccd\",
gradient:\"rising\",
tooltip:{
template:\"#T1#\"
},
width:10,
tooltip:{
template:\"#T1#\"
},
xAxis:{
template:\"'#mon#\"
},
yAxis:{
start:$startvalue,
step:$stepvalue,
end:$endvalue
},
legend:{
values:[
{text:\"SiteDown\",color:\"#58dccd\"},
{text:\"Mainsfails\",color:\"#a7ee70\"},
{text:\"alarm3G\",color:\"#2980b9\"},
{text:\"alarm4G\",color:\"#1abc9c\"},
{text:\"Total Ticket\",color:\"#36abee\",markerType: \"item\"}
],
valign:\"bottom\",
align:\"center\",
layout:\"x\"
}
});
barChart1.addSeries({
value:\"#T2#\",
color:\"#a7ee70\",
tooltip:{
template:\"#T2#\"
}
});
barChart1.addSeries({
value:\"#T3#\",
color:\"#2980b9\",
tooltip:{
template:\"#T3#\"
}
});
barChart1.addSeries({
value:\"#T4#\",
color:\"#1abc9c\",
tooltip:{
template:\"#T4#\"
}
});
barChart1.addSeries({
//offset:0,
view: \"line\",
item:{
radius:0
},
line:{
color:\"#36abee\"
},
value:\"#totalticket#\",
tooltip:{
template:\"#totalticket#\"
},
label:\"<b>#totalticket#</b>\"
});
barChart1.parse(datasets,\"json\");";
// === Trend Pie1 by Revenue
$qry="select datasets,startvalue,stepvalue,endvalue from ".DB_APORTIL.".tbl_chart_trendsum
where modules='hometicketperformancepie1' and isdeleted=0 order by id desc limit 1";
$spval=$this->fn_get_fieldsvalues("datasets,startvalue,stepvalue,endvalue",$qry);
$datasets=$spval[0];$startvalue=$spval[1];$stepvalue=$spval[2];$endvalue=$spval[3];
echo " var datasets = $datasets;
var pieChart = new dhtmlXChart({
view:\"pie\",
container:\"div_ticketpie1alarm\",
value:\"#vals#\",
color:\"#color#\",
legend:\"#category#\",
pieInnerText:\"<b>#vals#</b>\",
shadow:0
});
pieChart.parse(datasets,\"json\");";
// === Trend Pie2 by Sitetype
$qry="select datasets,startvalue,stepvalue,endvalue from ".DB_APORTIL.".tbl_chart_trendsum
where modules='hometicketperformancepie2' and isdeleted=0 order by id desc limit 1";
$spval=$this->fn_get_fieldsvalues("datasets,startvalue,stepvalue,endvalue",$qry);
$datasets=$spval[0];$startvalue=$spval[1];$stepvalue=$spval[2];$endvalue=$spval[3];
echo " var datasets = $datasets;
var pieChart2 = new dhtmlXChart({
view:\"pie\",
container:\"div_ticketpie2alarm\",
value:\"#vals#\",
color:\"#color#\",
legend:\"#sitetype#\",
pieInnerText:\"<b>#vals#</b>\",
shadow:0
});
pieChart2.parse(datasets,\"json\");
};
</script>";
echo $this->FN_CLOSEHEADER();
echo $this->FN_CREATEBODY("white");
echo "<table width=\"100%\" height=\"100%\">";
echo " <tr>
<td valign=\"top\" width=\"70%\">
<div style=\"width:100%;text-align:center;text-decoration:underline;font-size:24px;color:blue\">Trend Tickets Alarm Period ".date("Y")."</div>
<div id=\"div_ticketbaralarm\" style=\"width:100%;height:330px;\"></div>
</td>
<td valign=\"top\">
<div style=\"width:100%;text-align:center;text-decoration:underline;font-size:24px;color:blue\">MTTR Ticket Period ".date("M")."/".date("Y")."</div>
<div style=\"width:100%;height:230px;margin-top:35px;border-radius:2%;background-image: linear-gradient(to right, #4facfe 0%, #00f2fe 100%);\">";
$qry="select category,slainhours sla from ".DB_APORTIL.".tbl_nits_mttrbycategory where isdeleted=0 order by id asc";
$rs=$this->selectquery($qry);$arrsla=array();
if($rs)
{
$avgall=0;
while($rw=$this->data_row_object($rs))
{
$arrsla[$rw->category]=round($rw->sla,2);
$avgall+=$rw->sla;
}
$avgall=round(($avgall/4),2);
}
$this->clearrecordset($rs);
echo " <table width=\"98%\" height=\"100%\" align=\"center\" style=\"color:white;font-size:18px\">
<tr height=\"10%\">
<td colspan=\"3\" style=\"font-size:20px;font-style:italic;\">Today ".date("d M Y")."&nbsp;</td>
</tr>
<tr height=\"10%\">
<td width=\"25%\">PLATINUM</td>
<td width=\"2px\" align=\"center\">:</td>
<td>".$arrsla["PLATINUM"]." Hours</td>
</tr>
<tr height=\"10%\">
<td>GOLD</td>
<td width=\"2px\" align=\"center\">:</td>
<td>".$arrsla["GOLD"]." Hours</td>
</tr>
<tr height=\"10%\">
<td>SILVER</td>
<td width=\"2px\" align=\"center\">:</td>
<td>".$arrsla["SILVER"]." Hours</td>
</tr>
<tr height=\"10%\">
<td>BRONZE</td>
<td width=\"2px\" align=\"center\">:</td>
<td>".$arrsla["BRONZE"]." Hours</td>
</tr>
<tr>
<td colspan=\"3\" align=\"center\" valign=\"middle\">
<span style=\"font-size:46px;\">
$avgall Hours
</span>
<div style=\"margin-top:-15px\">
<font style=\"font-size:12px;font-style:italic;\">average for closed ticket</font>
</div>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td valign=\"top\">
<table width=\"96%\" style=\"background-color:#ecf0f1\" align=\"center\">
<tr>
<td style=\"text-align:center;\" width=\"50%\" halign=\"center\">
<div id=\"div_content\" style=\"width:100%;border:1px solid #A4BED4;\">
<div style=\"width:100%;text-align:center;text-decoration:underline;font-size:20px;color:blue\">Alarm By Category Period ".date("M")."/".date("Y")."</div>
<div id=\"div_ticketpie1alarm\" style=\"width:100%;height:250px;\"></div>
</div>
</td>
<td>
<div id=\"div_content\" style=\"width:100%;border:1px solid #A4BED4;\">
<div style=\"width:100%;text-align:center;text-decoration:underline;font-size:20px;color:blue\">Alarm By Sitetype Period ".date("M")."/".date("Y")."</div>
<div id=\"div_ticketpie2alarm\" style=\"width:100%;height:250px;\"></div>
</div>
</td>
</tr>
</table>
</td>
<td valign=\"top\">
<div style=\"width:100%;text-align:center;text-decoration:underline;font-size:24px;color:blue\">SUMMARY Ticket Period ".date("M")."/".date("Y")."</div>
<div style=\"width:100%;height:230px;margin-top:15px;border-radius:2%;background-image: linear-gradient(to right, #92fe9d 0%, #00c9ff 100%);\">
<br/>
<table width=\"80%\" align=\"center\" style=\"color:white;margin-top:30;\" cellspacing=\"0\">
<tr>
<td style=\"border-bottom:1px solid white;\"></td>
<td width=\"30%\" style=\"border-bottom:1px solid white;border-left:1px solid white;text-align:right;\">Open&nbsp;</td>
<td width=\"30%\" style=\"border-bottom:1px solid white;border-left:1px solid white;text-align:right;\">Closed&nbsp;</td>
</tr>";
$qry="select category,opened,closed from ".DB_APORTIL.".tbl_nits_sumticketstatus
where isdeleted=0 order by id asc";
$rs=$this->selectquery($qry);
if($rs)
{
while($rw=$this->data_row_object($rs))
{
echo "<tr>";
echo " <td>".$rw->category."</td>";
echo " <td style=\"text-align:right;\">".$rw->opened."&nbsp;</td>";
echo " <td style=\"text-align:right;\">".$rw->closed."&nbsp;</td>";
echo "</tr>";
}
}
$this->clearrecordset($rs);
echo " </table>
</div>
</td>
</tr>";
echo "</table>";
echo $this->FN_CREATEFOOTER();
}
}
?>

View File

@ -0,0 +1,271 @@
<?php
class HOME_TICKET extends HOME
{
public function home_ticket_javainit()
{
}
public function fn_ticket_init()
{
if(isset($_REQUEST['task'])){$task=trim(strtolower($_REQUEST['task']));}
if(isset($_POST['task'])){$task=trim(strtolower($_POST['task']));}
if($_REQUEST||$_POST){if($_REQUEST['sec']||$_POST['sec']){$task=$this->dec($task);}}
switch($task)
{
case "default":
$this->fn_default_sum();
break;
case $task:
$task="fn_".$task;
if(method_exists($this,$task)){$this->$task();}
break;
default:
$this->fn_default_sum();
break;
}
}
public function fn_default_sum()
{
echo $this->FN_CREATEHEADER();
echo "<style>
.besidebtnsave {margin-left:80px;margin-top:-6px;position:absolute;}
</style>";
echo "<script>
var myForm,myFormsearch,dgtra;
function initObject()
{";
$qry="select datasets,startvalue,stepvalue,endvalue from ".DB_APORTIL.".tbl_chart_trendsum
where modules='hometicketperformance2' and isdeleted=0 order by id desc limit 1";
$spval=$this->fn_get_fieldsvalues("datasets,startvalue,stepvalue,endvalue",$qry);
$datasets=$spval[0];$startvalue=$spval[1];$stepvalue=$spval[2];$endvalue=$spval[3];
echo " var datasets=$datasets;
var barChart1 = new dhtmlXChart({
view:\"bar\",
container:\"div_ticketbaralarm\",
value:\"#Tclosed#\",
color: \"#2ecc71\",
gradient:\"rising\",
tooltip:{
template:\"#Tclosed#\"
},
width:10,
tooltip:{
template:\"#Tclosed#\"
},
xAxis:{
template:\"'#mon#\"
},
yAxis:{
start:$startvalue,
step:$stepvalue,
end:$endvalue
},
legend:{
values:[
{text:\"Closed\",color:\"#2ecc71\"},
{text:\"Opened\",color:\"#e74c3c\"},
{text:\"Total Ticket\",color:\"#f1c40f\",markerType: \"item\"}
],
valign:\"bottom\",
align:\"center\",
layout:\"x\"
}
});
barChart1.addSeries({
value:\"#Topened#\",
color:\"#e74c3c\",
tooltip:{
template:\"#Topened#\"
}
});
barChart1.addSeries({
//offset:0,
view: \"line\",
item:{
radius:0
},
line:{
color:\"#f1c40f\"
},
value:\"#totalticket#\",
tooltip:{
template:\"#totalticket#\"
},
label:\"<b>#totalticket#</b>\"
});
barChart1.parse(datasets,\"json\");";
// === Trend Pie1 by Revenue
$qry="select datasets,startvalue,stepvalue,endvalue from ".DB_APORTIL.".tbl_chart_trendsum
where modules='hometicketperformancepie1' and isdeleted=0 order by id desc limit 1";
$spval=$this->fn_get_fieldsvalues("datasets,startvalue,stepvalue,endvalue",$qry);
$datasets=$spval[0];$startvalue=$spval[1];$stepvalue=$spval[2];$endvalue=$spval[3];
echo " var datasets = $datasets;
var pieChart = new dhtmlXChart({
view:\"pie\",
container:\"div_ticketpie1alarm\",
value:\"#vals#\",
color:\"#color#\",
legend:\"#category#\",
pieInnerText:\"<b><span style='color:white'>#vals#</span></b>\",
shadow:0
});
pieChart.parse(datasets,\"json\");";
// === Trend Pie2 by Sitetype
$qry="select datasets,startvalue,stepvalue,endvalue from ".DB_APORTIL.".tbl_chart_trendsum
where modules='hometicketperformancepie2' and isdeleted=0 order by id desc limit 1";
$spval=$this->fn_get_fieldsvalues("datasets,startvalue,stepvalue,endvalue",$qry);
$datasets=$spval[0];$startvalue=$spval[1];$stepvalue=$spval[2];$endvalue=$spval[3];
echo " var datasets = $datasets;
var pieChart2 = new dhtmlXChart({
view:\"pie\",
container:\"div_ticketpie2alarm\",
value:\"#vals#\",
color:\"#color#\",
legend:\"#sitetype#\",
pieInnerText:\"<b><span style='color:white'>#vals#</span></b>\",
shadow:0
});
pieChart2.parse(datasets,\"json\");
};
</script>";
echo $this->FN_CLOSEHEADER();
echo $this->FN_CREATEBODY("white");
echo "<table width=\"98%\" height=\"100%\">";
echo " <tr>
<td valign=\"top\" width=\"70%\">
<div style=\"width:100%;text-align:center;text-decoration:underline;font-size:24px;color:blue\">Trend Tickets Alarm Period ".date("Y")."</div>
<div id=\"div_ticketbaralarm\" style=\"width:100%;height:330px;\"></div>
</td>
<td valign=\"top\">
<div style=\"width:100%;text-align:center;text-decoration:underline;font-size:24px;color:blue\">MTTR Ticket Period ".date("M")."/".date("Y")."</div>
<div style=\"width:100%;height:230px;margin-top:35px;box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);border-radius:2%;background-image: linear-gradient(to right, #4facfe 0%, #00f2fe 100%);\">";
$qry="select category,slainhours sla from ".DB_APORTIL.".tbl_nits_mttrbycategory where isdeleted=0 and category<>'' order by id asc";
$rs=$this->selectquery($qry);$arrsla=array();
if($rs)
{
$avgall=0;
while($rw=$this->data_row_object($rs))
{
$arrsla[$rw->category]=round($rw->sla,2);
$avgall+=round($rw->sla,2);
//echo round($rw->sla,2)."<br/>";
}
$avgall=round(($avgall/4),2);
}
$this->clearrecordset($rs);
echo " <table width=\"98%\" height=\"100%\" align=\"center\" style=\"color:white;font-size:18px\">
<tr height=\"10%\">
<td colspan=\"3\" style=\"font-size:20px;font-style:italic;\">Today ".date("d M Y")."&nbsp;</td>
</tr>
<tr height=\"10%\">
<td width=\"25%\">PLATINUM</td>
<td width=\"2px\" align=\"center\">:</td>
<td>".$arrsla["PLATINUM"]." Hours</td>
</tr>
<tr height=\"10%\">
<td>GOLD</td>
<td width=\"2px\" align=\"center\">:</td>
<td>".$arrsla["GOLD"]." Hours</td>
</tr>
<tr height=\"10%\">
<td>SILVER</td>
<td width=\"2px\" align=\"center\">:</td>
<td>".$arrsla["SILVER"]." Hours</td>
</tr>
<tr height=\"10%\">
<td>BRONZE</td>
<td width=\"2px\" align=\"center\">:</td>
<td>".$arrsla["BRONZE"]." Hours</td>
</tr>
<tr>
<td colspan=\"3\" align=\"center\" valign=\"middle\">
<span style=\"font-size:46px;\">
$avgall Hours
</span>
<div style=\"margin-top:-15px\">
<font style=\"font-size:12px;font-style:italic;\">average for closed ticket</font>
</div>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td valign=\"top\">
<table width=\"96%\" style=\"background-color:#ecf0f1\" align=\"center\">
<tr>
<td style=\"text-align:center;\" width=\"50%\" halign=\"center\">
<div id=\"div_content\" style=\"width:100%;border:1px solid #A4BED4;\">
<div style=\"width:100%;text-align:center;text-decoration:underline;font-size:20px;color:blue\">Alarm By Category Period ".date("M")."/".date("Y")."</div>
<div id=\"div_ticketpie1alarm\" style=\"width:100%;height:250px;\"></div>
</div>
</td>
<td>
<div id=\"div_content\" style=\"width:100%;border:1px solid #A4BED4;\">
<div style=\"width:100%;text-align:center;text-decoration:underline;font-size:20px;color:blue\">Alarm By Sitetype Period ".date("M")."/".date("Y")."</div>
<div id=\"div_ticketpie2alarm\" style=\"width:100%;height:250px;\"></div>
</div>
</td>
</tr>
</table>
</td>
<td valign=\"top\">
<div style=\"width:100%;text-align:center;text-decoration:underline;font-size:24px;color:blue\">SUMMARY Ticket Period ".date("M")."/".date("Y")."</div>
<div style=\"width:100%;height:230px;margin-top:15px;box-shadow: 0 4px 8px 0 rgba(0,0,0,0.3);border-radius:2%;background-image: linear-gradient(-20deg, #b721ff 0%, #21d4fd 100%);\">
<br/>
<table width=\"90%\" align=\"center\" style=\"color:white;margin-top:30;\" cellspacing=\"0\">
<tr>
<td style=\"border-bottom:1px solid white;\"></td>
<td width=\"20%\" style=\"border-bottom:1px solid white;border-left:1px solid white;text-align:right;\">Open&nbsp;</td>
<td width=\"20%\" style=\"border-bottom:1px solid white;border-left:1px solid white;text-align:right;\">Closed&nbsp;</td>
<td width=\"20%\" style=\"border-bottom:1px solid white;border-left:1px solid white;text-align:right;\">Total&nbsp;</td>
</tr>";
$qry="select category,opened,closed from ".DB_APORTIL.".tbl_nits_sumticketstatus
where isdeleted=0 order by id asc";
$rs=$this->selectquery($qry);
if($rs)
{
$grandtotal=0;
while($rw=$this->data_row_object($rs))
{
echo "<tr>";
echo " <td style=\"border-bottom:1px solid white;font-size:14pt;\">".$rw->category."</td>";
echo " <td style=\"border-bottom:1px solid white;border-left:1px solid white;text-align:right;\">".number_format($rw->opened)."&nbsp;</td>";
echo " <td style=\"border-bottom:1px solid white;border-left:1px solid white;text-align:right;\">".number_format($rw->closed)."&nbsp;</td>";
$total=$rw->opened+$rw->closed;
echo " <td style=\"border-bottom:1px solid white;border-left:1px solid white;text-align:right;\">".number_format($total)."&nbsp;</td>";
echo "</tr>";
$grandtotal+=$total;
}
echo "<tr>";
echo " <td style=\"font-style:italic;text-align:right;\" colspan=\"3\">Total : &nbsp;</td>";
echo " <td style=\"font-weight:bold;font-size:18pt;text-align:right;\">".number_format($grandtotal)."&nbsp;</td>";
echo "</tr>";
}
$this->clearrecordset($rs);
echo " </table>
</div>
</td>
</tr>";
echo "</table>";
echo $this->FN_CREATEFOOTER();
}
}
?>

View File

@ -0,0 +1,319 @@
<?php
class HOME_TICKET extends HOME
{
public function home_ticket_javainit()
{
}
public function fn_ticket_init()
{
if(isset($_REQUEST['task'])){$task=trim(strtolower($_REQUEST['task']));}
if(isset($_POST['task'])){$task=trim(strtolower($_POST['task']));}
if($_REQUEST||$_POST){if($_REQUEST['sec']||$_POST['sec']){$task=$this->dec($task);}}
switch($task)
{
case "default":
$this->fn_default_sum();
break;
case $task:
$task="fn_".$task;
if(method_exists($this,$task)){$this->$task();}
break;
default:
$this->fn_default_sum();
break;
}
}
public function fn_default_sum()
{
echo $this->FN_CREATEHEADER();
echo "<style>
.besidebtnsave {margin-left:80px;margin-top:-6px;position:absolute;}
</style>";
echo "<script>
var myForm,myFormsearch,dgtra;
function initObject()
{";
echo "var multiple_dataset = [
{ sales:\"20\", sales2:\"35\", year:\"02\" },
{ sales:\"40\", sales2:\"24\", year:\"03\" },
{ sales:\"44\", sales2:\"20\", year:\"04\" },
{ sales:\"23\", sales2:\"50\", year:\"05\" },
{ sales:\"21\", sales2:\"36\", year:\"06\" },
{ sales:\"50\", sales2:\"40\", year:\"07\" },
{ sales:\"30\", sales2:\"65\", year:\"08\" },
{ sales:\"90\", sales2:\"62\", year:\"09\" },
{ sales:\"55\", sales2:\"40\", year:\"10\" },
{ sales:\"72\", sales2:\"45\", year:\"11\" }
];";
echo "var myBarChart = new dhtmlXChart({
view:\"bar\",
container:\"div_ticketbaralarm\",
value:\"#sales#\",
color: \"#58dccd\",
gradient:\"rising\",
tooltip:{
template:\"#sales#\"
},
width:60,
xAxis:{
template:\"'#year#\"
},
yAxis:{
start:0,
step:10,
end:100
},
legend:{
values:[{text:\"Atauro\",color:\"#58dccd\"},{text:\"Oekuse\",color:\"#a7ee70\"}],
valign:\"middle\",
align:\"bottom\",
width:190,
layout:\"x\"
}
});
myBarChart.addSeries({
value:\"#sales2#\",
color:\"#a7ee70\",
tooltip:{
template:\"#sales2#\"
}
});
myBarChart.parse(multiple_dataset,\"json\");
var data = {
first_name: \"Richard\",
last_name: \"Wilson\",
addr1: \"Upton Avenue 1870\",
addr2: \"Liberty Square 4949\",
company: \"Monk Home Loans\"
};
var parentObj = document.getElementById(\"previewData\");
parentObj.innerHTML = window.dhx4.template(parentObj.innerHTML, data);
var destination = [
{ id:1, percent:45, dest:\"Oekuse\", color: \"#ee9e36\"},
{ id:2, percent:55, dest:\"Atauro\", color: \"#eeea36\"}
];
myPieChart = new dhtmlXChart({
view:\"pie\",
container:\"div_pieshippasstrend\",
value:\"#percent#\",
color:\"#color#\",
labelLines: true,
label:\"#dest#: #percent# %\",
shadow:0
});
myPieChart.parse(destination,\"json\");
var destination = [
{ id:1, percent:45, dest:\"Oekuse\", color: \"#ee9e36\"},
{ id:2, percent:55, dest:\"Atauro\", color: \"#eeea36\"}
];
myPieChart1 = new dhtmlXChart({
view:\"pie\",
container:\"div_pieshiptriptrend\",
value:\"#percent#\",
color:\"#color#\",
labelLines: true,
label:\"#dest#: #percent# %\",
shadow:0
});
myPieChart1.parse(destination,\"json\");";
echo " };
</script>";
echo $this->FN_CLOSEHEADER();
echo $this->FN_CREATEBODY("white");
echo "<table width=\"98%\" height=\"100%\">";
echo " <tr>
<td valign=\"top\" width=\"70%\">
<div style=\"width:100%;text-align:center;text-decoration:underline;font-size:24px;color:blue\">Nakroma Passenger Performance Period ".date("Y")."</div>
<div id=\"div_ticketbaralarm\" style=\"width:100%;height:330px;\"></div>
</td>
<td valign=\"top\" rowspan=\"2\">
<div style=\"height:200\">
<table width=\"100%\">";
$arr=array("4-H"=>"#f1c40f","5-C"=>"#f1c40f","5-F"=>"#f1c40f","5-G"=>"#f1c40f","5-H"=>"#f1c40f","20-C"=>"#2980b9","20-D"=>"#2980b9","30-D"=>"#2980b9");
// === Seat Code
echo "<tr>";
for($h=1;$h<=10;$h++){
if($h==1){
echo "<td width=\"1px\">&nbsp</td>";
}
echo "<td width=\"10\" style=\"font-size:8pt;\">&nbsp;".chr(64+$h)."</td>";
if($h==5){
echo "<td width=\"20px\">&nbsp</td>";
}
}
echo "</tr>";
// === SEAT Number
for($i=1;$i<=30;$i++){
echo "<tr>";
for($j=1;$j<=10;$j++)
{
$colors="#ecf0f1";
//if($i==4&&$j==8){$colors="#f1c40f";}
if(array_key_exists("$i-".chr(64+$j),$arr)){
$colors=$arr["$i-".chr(64+$j)];
}
if($j==1){
echo "<td width=\"1px\" style=\"font-size:10pt;color:black\">$i.</td>";
}
echo "<td width=\"10px\" height=\"8px\" style=\"height:8px;background-color:none\">
<div style=\"border: 1px solid transparent;border-radius: 2px;background-color:$colors;width:15px;height:8px\">
&nbsp;
</div>
</td>";
if($j==5){
echo "<td width=\"20px\">&nbsp</td>";
}
}
echo "</tr>";
}
echo " </table>
</div>
</td>
</tr>
<tr>
<td valign=\"top\" style=\"background-color:none\">
<table width=\"100%\">
<tr>
<td>
<div class=\"preview_tpl\" id=\"previewData\" style=\"\">
<div class=\"header_tpl\" style=\"font-weight:bold\">Nakroma Passenger</div>
<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"width:400px\">
<tr>
<td>
<div style=\"text-align:center;text-decoration:underline;font-size:20px;color:blue;margin-top:10px\">
Period ".date("Y")."
</div>
<div id=\"div_pieshippasstrend\" style=\"height:200px;margin-top:0px;\"></div>
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td>Atauro</td>
<td>: 55% (1.5K)</td>
<td>Oekuse</td>
<td>: 45% (800)</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</td>
<td valign=\"top\">
<div class=\"preview_tpl\" id=\"previewData\" style=\"margin-left:20px\">
<div class=\"header_tpl\" style=\"font-weight:bold\">Nakroma Manifest</div>
<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"width:450px\">
<thead>
<tr>
<td colspan=\"5\">
<table>
<tr>
<td>Nacroma Tonase</td>
<td>:</td>
<td><span style=\"font-size:19px\">200</span> ton</td>
</tr>
<tr>
<td>Threshold</td>
<td>:</td>
<td><span style=\"font-size:19px\">180</span> ton</td>
</tr>
</table>
</td>
</tr>
</thead>
<tr>
<td style=\"border-bottom:1px solid black;border-right:1px solid black\"></td>
<td style=\"border-bottom:1px solid black;\">Unit</td>
<td align=\"right\" style=\"border-bottom:1px solid black\">Qty</td>
<td align=\"right\" style=\"border-bottom:1px solid black\">( \$ )</td>
<td align=\"right\" style=\"border-bottom:1px solid black\">( ton )</td>
</tr>
<tr>
<td style=\"border-right:1px solid black\">Passenger</td>
<td>Person</td>
<td align=\"right\">300</td>
<td align=\"right\">\$1.800</td>
<td align=\"right\">15.0</td>
</tr>
<tr>
<td style=\"border-right:1px solid black\">Vehichle</td>
<td>unit</td>
<td align=\"right\">10</td>
<td align=\"right\">\$6.800</td>
<td align=\"right\">20.0</td>
</tr>
<tr>
<td style=\"border-right:1px solid black\">Non Vehichle</td>
<td>unit</td>
<td align=\"right\">10</td>
<td align=\"right\">\$4.700</td>
<td align=\"right\">18.0</td>
</tr>
<tr>
<td style=\"border-top:1px dashed black;border-right:1px solid black\">Total</td>
<td style=\"border-top:1px dashed black\"></td>
<td align=\"right\" style=\"border-top:1px dashed black;color:blue;\">330</td>
<td align=\"right\" style=\"border-top:1px dashed black;color:blue;\">\$13.300</td>
<td align=\"right\" style=\"border-top:1px dashed black;color:blue;\">54.0</td>
</tr>
<tfoot>
<tr>
<td colspan=\"5\">
<table width=\"100%\" style=\"background-color:none\">
<tr>
<td width=\"220px\" style=\"font-Size:12pt;\">GAP ( Ton )</td>
<td width=\"1px\" style=\"font-Size:12pt;\">-></td>
<td width=\"220px\" style=\"font-Size:12pt;\">180.0 - 54.0</td>
<td width=\"1px\" style=\"font-Size:12pt;\">=</td>
<td style=\"font-Size:14pt;\">
<div style=\"background-color:green;color:white;padding:5px;border: 2px solid green;border-radius: 5px 2px;\">
126.0
</div>
</td>
</tr>
<tr>
<td colspan=\"5\" style=\"font-Size:14pt;\">
<span>Tonase Status</span>&nbsp;
<span>:</span>&nbsp;
<span style=\"color:green;font-size:16pt;font-weight:bold\">GOOD</span>
</td>
</tr>
</table>
</td>
</tr>
</tfoot>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>";
echo "</table>";
echo $this->FN_CREATEFOOTER();
}
}
?>

View File

@ -0,0 +1,419 @@
<?php
class HOME_TICKET extends HOME
{
public function home_ticket_javainit()
{
}
public function fn_ticket_init()
{
if(isset($_REQUEST['task'])){$task=trim(strtolower($_REQUEST['task']));}
if(isset($_POST['task'])){$task=trim(strtolower($_POST['task']));}
if($_REQUEST||$_POST){if($_REQUEST['sec']||$_POST['sec']){$task=$this->dec($task);}}
switch($task)
{
case "default":
$this->fn_default_sum();
break;
case $task:
$task="fn_".$task;
if(method_exists($this,$task)){$this->$task();}
break;
default:
$this->fn_default_sum();
break;
}
}
public function fn_default_sum()
{
echo $this->FN_CREATEHEADER();
echo "<style>
.besidebtnsave {margin-left:80px;margin-top:-6px;position:absolute;}
</style>";
echo "<script>
var myForm,myFormsearch,dgtra;
var t1;
function initObject()
{
t1=setTimeout(function(){
fn_getStatusInfo();
},5000);";
echo "var multiple_dataset = [
{ sales:\"20\", sales2:\"35\", year:\"02\" },
{ sales:\"40\", sales2:\"24\", year:\"03\" },
{ sales:\"44\", sales2:\"20\", year:\"04\" },
{ sales:\"23\", sales2:\"50\", year:\"05\" },
{ sales:\"21\", sales2:\"36\", year:\"06\" },
{ sales:\"50\", sales2:\"40\", year:\"07\" },
{ sales:\"30\", sales2:\"65\", year:\"08\" },
{ sales:\"90\", sales2:\"62\", year:\"09\" },
{ sales:\"55\", sales2:\"40\", year:\"10\" },
{ sales:\"72\", sales2:\"45\", year:\"11\" }
];";
echo "var myBarChart = new dhtmlXChart({
view:\"bar\",
container:\"div_ticketbaralarm\",
value:\"#sales#\",
color: \"#58dccd\",
gradient:\"rising\",
tooltip:{
template:\"#sales#\"
},
width:60,
xAxis:{
template:\"'#year#\"
},
yAxis:{
start:0,
step:10,
end:100
},
legend:{
values:[{text:\"Atauro\",color:\"#58dccd\"},{text:\"Oekuse\",color:\"#a7ee70\"}],
valign:\"middle\",
align:\"bottom\",
width:190,
layout:\"x\"
}
});
myBarChart.addSeries({
value:\"#sales2#\",
color:\"#a7ee70\",
tooltip:{
template:\"#sales2#\"
}
});
myBarChart.parse(multiple_dataset,\"json\");
var data = {
first_name: \"Richard\",
last_name: \"Wilson\",
addr1: \"Upton Avenue 1870\",
addr2: \"Liberty Square 4949\",
company: \"Monk Home Loans\"
};
var parentObj = document.getElementById(\"previewData\");
parentObj.innerHTML = window.dhx4.template(parentObj.innerHTML, data);
var destination = [
{ id:1, percent:45, dest:\"Oekuse\", color: \"#ee9e36\"},
{ id:2, percent:55, dest:\"Atauro\", color: \"#eeea36\"}
];
myPieChart = new dhtmlXChart({
view:\"pie\",
container:\"div_pieshippasstrend\",
value:\"#percent#\",
color:\"#color#\",
labelLines: true,
label:\"#dest#: #percent# %\",
shadow:0
});
myPieChart.parse(destination,\"json\");
var destination = [
{ id:1, percent:45, dest:\"Oekuse\", color: \"#ee9e36\"},
{ id:2, percent:55, dest:\"Atauro\", color: \"#eeea36\"}
];
myPieChart1 = new dhtmlXChart({
view:\"pie\",
container:\"div_pieshiptriptrend\",
value:\"#percent#\",
color:\"#color#\",
labelLines: true,
label:\"#dest#: #percent# %\",
shadow:0
});
myPieChart1.parse(destination,\"json\");
";
echo " }
function fn_getStatusInfo(){
//var data=fn_dhtmlxloadobject('".$this->enc("obj_home")."','obj=".$this->enc("home_ticket")."&task=".$this->enc("getstinfo")."');
var data=ajaxuridhtmlx('".$this->enc("obj_home")."','obj=".$this->enc("home_ticket")."&task=".$this->enc("getstinfo")."&idship=1&idroutestart=1');
data=JSON.parse(data);
//alert(data);
t1=setTimeout(function(){
fn_getStatusInfo();
},10000);
//alert(data);
for(var i in data){
var div=document.getElementById('div'+data[i]['ndx']);
div.style.color=data[i]['colorfont'];
div.style.backgroundColor=data[i]['colors'];
}
};
</script>";
echo $this->FN_CLOSEHEADER();
echo $this->FN_CREATEBODY("white");
echo "<table width=\"98%\" height=\"100%\">";
echo " <tr>
<td valign=\"top\" width=\"70%\">
<div style=\"width:100%;text-align:center;text-decoration:underline;font-size:24px;color:blue\">Nakroma Passenger Performance Period ".date("Y")."</div>
<div id=\"div_ticketbaralarm\" style=\"width:100%;height:330px;\"></div>
</td>
<td valign=\"top\" rowspan=\"2\">
<div style=\"height:200\">
<table width=\"100%\">
<tr>
<td colspan=\"10\">
<table>
<tr>
<td>Ship</td>
<td>:</td>
<td>Nakroma</td>
<td>,</td>
<td>Rute</td>
<td>:</td>
<td>Dili-Atauro</td>
<td><a href=\"javascript:void(0)\"><i class=\"fa fa-cog\" style=\"font-size:14pt;\"></i></a></td>
</tr>
</table>
</td>
</tr>";
$qry="select totalseat from ".DB_APORTIL.".tbl_ship_information where id=1";
if($this->fn_row_isexists($qry)){
$totalseat=$this->fn_get_fieldvalue("totalseat",$qry);
$j=10;$s=5;
for($i=1;$i<=$totalseat;$i++){
$colors="#ecf0f1";$colorfont="black";
if($i==1||$i==($j+1)){
echo "<tr>";
}
// Content
// === Dili atauro
$qrycheckin="select inctiket,status from ".DB_APORTIL.".tbl_passenger_tiket
where inctiket='$i' and idship=1 and idroutestart=1 and cast(dates as date)=cast(now() as date)";
if($this->fn_row_isexists($qrycheckin)){
$colorfont="white";
$status=$this->fn_get_fieldvalue("status",$qrycheckin);
$colors="#f1c40f";
if($status==1){$colors="#3498db";}
if($status==-2){$colors="#ecf0f1";$colorfont="black";}
}
echo "<td width=\"10px\" height=\"8px\" style=\"height:8px;background-color:transparent\">
<div id=\"div$i\" style=\"color:$colorfont;padding-top:1px;font-size:8pt;text-align:center;border: 1px solid transparent;border-radius: 2px;background-color:$colors;width:25px;height:15px\">
$i
</div>
</td>";
if($i==$s){
echo "<td width=\"20px\">&nbsp</td>";
}
if($i%10==0){
$j+=10;$s+=10;
echo "</tr>";
}
}
}
//$arr=array("4-H"=>"#f1c40f","5-C"=>"#f1c40f","5-F"=>"#f1c40f","5-G"=>"#f1c40f","5-H"=>"#f1c40f","20-C"=>"#2980b9","20-D"=>"#2980b9","30-D"=>"#2980b9");
// === Seat Code
// echo "<tr>";
// for($h=1;$h<=10;$h++){
// if($h==1){
// echo "<td width=\"1px\">&nbsp</td>";
// }
// echo "<td width=\"10\" style=\"font-size:8pt;\">&nbsp;".chr(64+$h)."</td>";
// if($h==5){
// echo "<td width=\"20px\">&nbsp</td>";
// }
// }
// echo "</tr>";
//
// === SEAT Number
// for($i=1;$i<=30;$i++){
// echo "<tr>";
// for($j=1;$j<=10;$j++)
// {
// $colors="#ecf0f1";
//if($i==4&&$j==8){$colors="#f1c40f";}
// if(array_key_exists("$i-".chr(64+$j),$arr)){
// $colors=$arr["$i-".chr(64+$j)];
// }
// if($j==1){
// echo "<td width=\"1px\" style=\"font-size:10pt;color:black\">$i.</td>";
// }
// echo "<td width=\"10px\" height=\"8px\" style=\"height:8px;background-color:none\">
// <div style=\"border: 1px solid transparent;border-radius: 2px;background-color:$colors;width:15px;height:8px\">
// &nbsp;
// </div>
// </td>";
// if($j==5){
// echo "<td width=\"20px\">&nbsp</td>";
// }
// }
// echo "</tr>";
// }
echo " </table>
</div>
</td>
</tr>
<tr>
<td valign=\"top\" style=\"background-color:none\">
<table width=\"100%\">
<tr>
<td>
<div class=\"preview_tpl\" id=\"previewData\" style=\"\">
<div class=\"header_tpl\" style=\"font-weight:bold\">Nakroma Passenger</div>
<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"width:400px\">
<tr>
<td>
<div style=\"text-align:center;text-decoration:underline;font-size:20px;color:blue;margin-top:10px\">
Period ".date("Y")."
</div>
<div id=\"div_pieshippasstrend\" style=\"height:200px;margin-top:0px;\"></div>
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td>Atauro</td>
<td>: 55% (1.5K)</td>
<td>Oekuse</td>
<td>: 45% (800)</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</td>
<td valign=\"top\">
<div class=\"preview_tpl\" id=\"previewData\" style=\"margin-left:20px\">
<div class=\"header_tpl\" style=\"font-weight:bold\">Nakroma Manifest</div>
<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"width:450px\">
<thead>
<tr>
<td colspan=\"5\">
<table>
<tr>
<td>Nacroma Tonase</td>
<td>:</td>
<td><span style=\"font-size:19px\">200</span> ton</td>
</tr>
<tr>
<td>Threshold</td>
<td>:</td>
<td><span style=\"font-size:19px\">180</span> ton</td>
</tr>
</table>
</td>
</tr>
</thead>
<tr>
<td style=\"border-bottom:1px solid black;border-right:1px solid black\"></td>
<td style=\"border-bottom:1px solid black;\">Unit</td>
<td align=\"right\" style=\"border-bottom:1px solid black\">Qty</td>
<td align=\"right\" style=\"border-bottom:1px solid black\">( \$ )</td>
<td align=\"right\" style=\"border-bottom:1px solid black\">( ton )</td>
</tr>
<tr>
<td style=\"border-right:1px solid black\">Passenger</td>
<td>Person</td>
<td align=\"right\">300</td>
<td align=\"right\">\$1.800</td>
<td align=\"right\">15.0</td>
</tr>
<tr>
<td style=\"border-right:1px solid black\">Vehichle</td>
<td>unit</td>
<td align=\"right\">10</td>
<td align=\"right\">\$6.800</td>
<td align=\"right\">20.0</td>
</tr>
<tr>
<td style=\"border-right:1px solid black\">Non Vehichle</td>
<td>unit</td>
<td align=\"right\">10</td>
<td align=\"right\">\$4.700</td>
<td align=\"right\">18.0</td>
</tr>
<tr>
<td style=\"border-top:1px dashed black;border-right:1px solid black\">Total</td>
<td style=\"border-top:1px dashed black\"></td>
<td align=\"right\" style=\"border-top:1px dashed black;color:blue;\">330</td>
<td align=\"right\" style=\"border-top:1px dashed black;color:blue;\">\$13.300</td>
<td align=\"right\" style=\"border-top:1px dashed black;color:blue;\">54.0</td>
</tr>
<tfoot>
<tr>
<td colspan=\"5\">
<table width=\"100%\" style=\"background-color:none\">
<tr>
<td width=\"220px\" style=\"font-Size:12pt;\">GAP ( Ton )</td>
<td width=\"1px\" style=\"font-Size:12pt;\">-></td>
<td width=\"220px\" style=\"font-Size:12pt;\">180.0 - 54.0</td>
<td width=\"1px\" style=\"font-Size:12pt;\">=</td>
<td style=\"font-Size:14pt;\">
<div style=\"background-color:green;color:white;padding:5px;border: 2px solid green;border-radius: 5px 2px;\">
126.0
</div>
</td>
</tr>
<tr>
<td colspan=\"5\" style=\"font-Size:14pt;\">
<span>Tonase Status</span>&nbsp;
<span>:</span>&nbsp;
<span style=\"color:green;font-size:16pt;font-weight:bold\">GOOD</span>
</td>
</tr>
</table>
</td>
</tr>
</tfoot>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>";
echo "</table>";
echo $this->FN_CREATEFOOTER();
}
public function fn_getstinfo(){
$idship=$_REQUEST['idship'];
$idroutestart=$_REQUEST['idroutestart'];
$arr=array();
$qry="select totalseat from ".DB_APORTIL.".tbl_ship_information where id=$idship";
//echo $qry;return false;
if($this->fn_row_isexists($qry)){
$totalseat=$this->fn_get_fieldvalue("totalseat",$qry);
for($i=1;$i<=$totalseat;$i++){
$colors="#ecf0f1";$colorfont="black";
// === Dili atauro
$qrycheckin="select inctiket,status from ".DB_APORTIL.".tbl_passenger_tiket
where inctiket='$i' and idship=$idship and idroutestart=$idroutestart
and cast(dates as date)=cast(now() as date)";
//echo $qrycheckin;return false;
if($this->fn_row_isexists($qrycheckin)){
$status=$this->fn_get_fieldvalue("status",$qrycheckin);
$colors="#f1c40f";$colorfont="white";
if($status==1){$colors="#3498db";}
if($status==-2){$colors="#ecf0f1";$colorfont="black";}
// array_push($arr,array("$i"=>$colors));
array_push($arr,array("ndx"=>$i,"colors"=>$colors,"colorfont"=>$colorfont));
}
}
}
echo json_encode($arr);
}
}
?>

View File

@ -0,0 +1,289 @@
<?php
class HOME_TICKETDIA extends HOME
{
public function home_ticketdia_javainit()
{
}
public function fn_ticketdia_init()
{
if(isset($_REQUEST['task'])){$task=trim(strtolower($_REQUEST['task']));}
if(isset($_POST['task'])){$task=trim(strtolower($_POST['task']));}
if($_REQUEST||$_POST){if($_REQUEST['sec']||$_POST['sec']){$task=$this->dec($task);}}
switch($task)
{
case "default":
$this->fn_default_sum();
break;
case $task:
$task="fn_".$task;
if(method_exists($this,$task)){$this->$task();}
break;
default:
$this->fn_default_sum();
break;
}
}
public function fn_default_sum()
{
echo $this->FN_CREATEHEADER();
echo "<style>
.besidebtnsave {margin-left:80px;margin-top:-6px;position:absolute;}
</style>";
echo "<script>
var myForm,myFormsearch,dgtra;
function initObject()
{";
$qry="select datasets,startvalue,stepvalue,endvalue from ".DB_APORTIL.".tbl_chart_trendsum
where modules='homediaperformance' and isdeleted=0 order by id desc limit 1";
$spval=$this->fn_get_fieldsvalues("datasets,startvalue,stepvalue,endvalue",$qry);
$datasets=$spval[0];$startvalue=$spval[1];$stepvalue=$spval[2];$endvalue=$spval[3];
echo " var datasets=$datasets;
var barChart1 = new dhtmlXChart({
view:\"bar\",
container:\"div_ticketdiabaralarm\",
value:\"#Tclosed#\",
color: \"#2ecc71\",
gradient:\"rising\",
tooltip:{
template:\"#Tclosed#\"
},
width:10,
tooltip:{
template:\"#Tclosed#\"
},
xAxis:{
template:\"'#mon#\"
},
yAxis:{
start:$startvalue,
step:$stepvalue,
end:$endvalue
},
legend:{
values:[
{text:\"Closed\",color:\"#2ecc71\"},
{text:\"Opened\",color:\"#e74c3c\"},
{text:\"Total Ticket\",color:\"#f1c40f\",markerType: \"item\"}
],
valign:\"bottom\",
align:\"center\",
layout:\"x\"
}
});
barChart1.addSeries({
value:\"#Topened#\",
color:\"#e74c3c\",
tooltip:{
template:\"#Topened#\"
}
});
barChart1.addSeries({
//offset:0,
view: \"line\",
item:{
radius:0
},
line:{
color:\"#f1c40f\"
},
value:\"#totalticket#\",
tooltip:{
template:\"#totalticket#\"
},
label:\"<b>#totalticket#</b>\"
});
barChart1.parse(datasets,\"json\");";
// === Trend Pie1 by Revenue
$qry="select datasets,startvalue,stepvalue,endvalue from ".DB_APORTIL.".tbl_chart_trendsum
where modules='homediaperformance2' and isdeleted=0 order by id desc limit 1";
$spval=$this->fn_get_fieldsvalues("datasets,startvalue,stepvalue,endvalue",$qry);
$datasets=$spval[0];$startvalue=$spval[1];$stepvalue=$spval[2];$endvalue=$spval[3];
echo " var datasets=$datasets;
var barChart2 = new dhtmlXChart({
view:\"bar\",
container:\"div_ticketdiabaralarm2\",
value:\"#Tclosed#\",
color: \"#2ecc71\",
gradient:\"rising\",
tooltip:{
template:\"#Tclosed#\"
},
width:10,
tooltip:{
template:\"#Tclosed#\"
},
xAxis:{
template:\"'#times#\"
},
yAxis:{
start:$startvalue,
step:$stepvalue,
end:$endvalue
},
legend:{
values:[
{text:\"Closed\",color:\"#2ecc71\"},
{text:\"Opened\",color:\"#e74c3c\"},
{text:\"Total Ticket\",color:\"#f1c40f\",markerType: \"item\"}
],
valign:\"bottom\",
align:\"center\",
layout:\"x\"
}
});
barChart2.addSeries({
value:\"#Topened#\",
color:\"#e74c3c\",
tooltip:{
template:\"#Topened#\"
}
});
barChart2.addSeries({
//offset:0,
view: \"line\",
item:{
radius:0
},
line:{
color:\"#f1c40f\"
},
value:\"#totalticket#\",
tooltip:{
template:\"#totalticket#\"
},
label:\"<b>#totalticket#</b>\"
});
barChart2.parse(datasets,\"json\");";
echo " };
</script>";
echo $this->FN_CLOSEHEADER();
echo $this->FN_CREATEBODY("white");
echo "<table width=\"98%\" height=\"100%\" border=\"0\">";
echo " <tr>
<td valign=\"top\" width=\"70%\">
<div style=\"width:100%;text-align:center;text-decoration:underline;font-size:24px;color:blue\">Trend Tickets Alarm Period ".date("Y")."</div>
<div id=\"div_ticketdiabaralarm\" style=\"width:100%;height:330px;\"></div>
</td>
<td rowspan=\"2\" valign=\"top\">
<div style=\"width:100%;text-align:center;text-decoration:underline;font-size:24px;color:blue\">ALARM DIA ".date("M")."/".date("Y")."</div>
<div style=\"overflow:auto;width:100%;height:630px;margin-top:10px;box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);border-radius:2%;background-image: linear-gradient(to right, #4facfe 0%, #00f2fe 100%);\">";
echo "<table width=\"95%\" style=\"color:white;margin-top:10px;font-size:11pt\" align=\"center\">";
$qry="select id,customerdia,downtime,issues,durationinmonths,durationindays,durationinhours,durationinminutes
from ".DB_APORTIL.".tbl_nits_diaticketsheader
where status=0 order by id asc";
//echo $qry;
$qrycheck="select id,customerdia,downtime,issues,durationinmonths,durationindays,durationinhours,durationinminutes
from ".DB_APORTIL.".tbl_nits_diaticketsheader
where status=0
order by id asc limit 1";
if($this->fn_row_isexists($qrycheck))
{
$rs=$this->selectquery($qry);
if($rs)
{
$i=1;
while($rw=$this->data_row_object($rs))
{
// === GET DURATION DOWN TIME
$df=$this->durationindate($rw->downtime,date("Y-m-d H:i"));
$durationinmonths=0;$durationindays=0;$durationinhours=0;$durationinminutes=0;
if(count($df)>0)
{
$durationinmonths=$df['month'];
$durationindays=$df['day'];
$durationinhours=$df['hour'];
$durationinminutes=$df['minute'];
}
$duration="";
if($durationinmonths){$months="month";if($durationinmonths>1){$months="months";}$duration="$durationinmonths $months ";}
if($durationindays){$days="day";if($durationindays>1){$days="days";}$duration.="$durationindays $days ";}
if($durationinhours){$hours="hour";if($durationinhours>1){$hours="hours";}$duration.="$durationinhours $hours ";}
if($durationinminutes){$minutes="minute";if($durationinminutes>1){$minutes="minutes";}$duration.="$durationinminutes $minutes ";}
echo "<tr>";
echo " <td valign=\"top\" width=\"2px\"><i>$i.</i></td>";
echo " <td valign=\"top\" width=\"90px\"><i>ID</i></td>";
echo " <td valign=\"top\" width=\"2px\">:</td>";
echo " <td valign=\"top\"><i>".$rw->id."</i></td>";
echo "</tr>";
echo "<tr>";
echo " <td></td>";
echo " <td valign=\"top\" width=\"110px\"><i>Customer Name</i></td>";
echo " <td valign=\"top\" width=\"2px\">:</td>";
echo " <td valign=\"top\"><i>".$rw->customerdia."</i></td>";
echo "</tr>";
echo "<tr>";
echo " <td></td>";
echo " <td valign=\"top\">Down Time</td>";
echo " <td valign=\"top\">:</td>";
echo " <td valign=\"top\">".date("Y-m-d H:i:s",strtotime($rw->downtime))."</td>";
echo "</tr>";
echo "<tr>";
echo " <td></td>";
echo " <td valign=\"top\">Duration</td>";
echo " <td valign=\"top\">:</td>";
echo " <td valign=\"top\">$duration</td>";
echo "</tr>";
echo "<tr>";
echo " <td></td>";
echo " <td valign=\"top\">Issues</td>";
echo " <td valign=\"top\">:</td>";
echo " <td valign=\"top\">".$rw->issues."</td>";
echo "</tr>";
echo "<tr>";
echo " <td></td>";
echo " <td valign=\"top\"><b>Last Response</b></td>";
echo " <td valign=\"top\"><b>:</b></td>";
$response="";$dateupdated="-";
if($this->fn_row_isexists("select actions,dateupdated from ".DB_APORTIL.".tbl_nits_diaticketsdetail where idheader='".$rw->id."' and isdeleted=0 order by id desc limit 1"))
{
$sp=$this->fn_get_fieldsvalues("actions,dateupdated","select actions,dateupdated from ".DB_APORTIL.".tbl_nits_diaticketsdetail where idheader='".$rw->id."' and isdeleted=0 order by id desc limit 1");
$response=$sp[0];$dateupdated=$sp[1];
}
$lastresponse="-";
if($response){$lastresponse=$response." at ( $dateupdated )";}
echo " <td valign=\"top\"><b>$lastresponse</b></td>";
echo "</tr>";
echo "<tr height=\"10px\"><td colspan=\"4\"></td></tr>";
$i+=1;
}
}
}
else
{
echo "<tr>";
echo " <td>Nihil.</td>";
echo "</tr>";
}
echo "</table>";
echo " </div>
</td>
</tr>
<tr>
<td valign=\"top\">
<div style=\"width:100%;text-align:center;text-decoration:underline;font-size:24px;color:blue\">Trend Tickets Alarm By Time Period ".date("M Y")."</div>
<div id=\"div_ticketdiabaralarm2\" style=\"width:100%;height:330px;\"></div>
</td>
</tr>";
echo "</table>";
echo $this->FN_CREATEFOOTER();
}
}
?>