-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaborDataMonthly.php
More file actions
78 lines (74 loc) · 1.69 KB
/
laborDataMonthly.php
File metadata and controls
78 lines (74 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
$nis = "hesun";
$password= "092700Jimmy";
$que = "SELECT L.LABOR_FORCE, D.D_YEAR, D.D_MONTH
FROM \"G.AGRAWAL\".\"LABOR_DATA\" L, \"G.AGRAWAL\".\"DATEVALUES\" D
WHERE L.D_ID=D.D_ID";
$conn=oci_connect($nis,$password,
'oracle.cise.ufl.edu:1521/orcl');
if(empty($nis) or empty($password)){
echo "UserID atau Password is empty<br>\n";}
if(!$conn){
echo 'connection error';
}
?>
<html>
<body>
<h2>Query result</h2>
<?php
$result=oci_parse($conn,$que);
oci_execute($result);
$i=1;
$data=array();
while (($row = oci_fetch_array($result, OCI_NUM)) != false) {
$temp=$row[1] . $row[2];
$arrayName = array("label" =>"$temp" ,"y"=>$row[0]);
array_push($data,$arrayName);
$i++;
}
oci_free_statement($result);
oci_close($conn);
?>
</body>
</html>
<html>
<head>
<script>
window.onload = function () {
var chart = new CanvasJS.Chart("chartContainer", {
animationEnabled: true,
exportEnabled: true,
zoonEnabled:true,
theme: "light1", // "light1", "light2", "dark1", "dark2"
title:{
text: "Labor Data Monthly"
},
axisY:{
includeZero: true,
title:"population"
},
axisX:{
title:"Year/Month"
},
data: [{
type: "line", //change type to bar, line, area, pie, etc
//indexLabel: "{y}", //Shows y value on all Data Points
indexLabelFontColor: "#5A5757",
indexLabelPlacement: "outside",
dataPoints: <?php echo json_encode($data, JSON_NUMERIC_CHECK); ?>
}]
});
chart.render();
}
</script>
</head>
<body>
<div id="chartContainer" style="height: 370px; width: 100%;"></div>
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
</body>
<div align="center">
<form method="get" action="homePage.php">
<button type="submit">HomePage</button>
</form>
</div>
</html>