| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238 |
- <?php
- if(isset($_GET["userid"])){
- $foot_set_userid = $_GET["userid"];
- }
- else if(isset($_COOKIE["userid"])){
- $foot_set_userid = $_COOKIE["userid"];
- }
- else{
- echo "no user id";
- exit;
- }
- include "../pcdl/html_head.php";
- ?>
- <body>
- <?php
- require_once "../path.php";
- require_once "../public/_pdo.php";
- require_once '../public/function.php';
- require_once '../ucenter/function.php';
- require_once "../pcdl/head_bar.php";
- $currChannal = "course";
- require_once "../uhome/head.php";
- ?>
- <link href='../lib/fullcalendar/main.css' rel='stylesheet' />
- <script src='../lib/fullcalendar/main.js'></script>
- <script src="https://code.highcharts.com/stock/highstock.js"></script>
- <script src="https://code.highcharts.com/stock/modules/data.js"></script>
- <script src="https://code.highcharts.com/stock/modules/exporting.js"></script>
- <div id="container" style="height: 400px; min-width: 310px"></div>
- <script>
- document.addEventListener('DOMContentLoaded', function() {
- var calendarEl = document.getElementById('calendar');
- var calendar = new FullCalendar.Calendar(calendarEl, {
- headerToolbar: {
- left: 'prev,next today',
- center: 'title',
- right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
- },
- locale: getCookie("language"),
- editable: false,
- navLinks: true, // can click day/week names to navigate views
- dayMaxEvents: true, // allow "more" link when too many events
- events: {
- url: 'foot_step_data.php?userid=<?php echo $foot_set_userid;?>',
- failure: function() {
- document.getElementById('script-warning').style.display = 'block'
- }
- },
- loading: function(bool) {
- document.getElementById('loading').style.display =
- bool ? 'block' : 'none';
- }
- });
- calendar.render();
- });
- Highcharts.setOptions({
- lang: {
- weekdays: [
- gLocal.gui.ravi, gLocal.gui.canda, gLocal.gui.bhumma, gLocal.gui.budha,
- gLocal.gui.guru, gLocal.gui.sukka, gLocal.gui.sora
- ],
- shortMonths:[
- gLocal.gui.Jan, gLocal.gui.Feb, gLocal.gui.Mar, gLocal.gui.Apr, gLocal.gui.May, gLocal.gui.Jun, gLocal.gui.Jul, gLocal.gui.Aug, gLocal.gui.Sep, gLocal.gui.Oct, gLocal.gui.Nov, gLocal.gui.Dec
- ]
- }
- });
- Highcharts.getJSON('../ucenter/active_get.php', function (data) {
- var ohlc = [],
- volume = [],
- dataLength = data.length,
- // set the allowed units for data grouping
- groupingUnits = [[
- 'week', // unit name
- [1] // allowed multiples
- ], [
- 'month',
- [1, 2, 3, 4, 6]
- ]],
- i = 0;
- for (i; i < dataLength; i += 1) {
- ohlc.push([
- data[i][0], // the date
- data[i][1], // open
- data[i][2], // high
- data[i][3], // low
- data[i][4] // close
- ]);
- volume.push([
- data[i][0], // the date
- data[i][5] // the volume
- ]);
- }
- // create the chart
- Highcharts.stockChart('container', {
- rangeSelector: {
- selected: 2
- },
- title: {
- text: gLocal.gui.progress_curve
- },
- yAxis: [{
- labels: {
- align: 'right',
- x: -3
- },
- title: {
- text: gLocal.gui.EXP
- },
- height: '60%',
- lineWidth: 2,
- resize: {
- enabled: true
- }
- }, {
- labels: {
- align: 'right',
- x: -3
- },
- title: {
- text: gLocal.gui.action
- },
- top: '65%',
- height: '35%',
- offset: 0,
- lineWidth: 2
- }],
- tooltip: {
- shared: false,
- useHTML: true,
- pointFormatter: function() {
- if(this.high){
- return '<b><a href="../">'+this.series.name + ' : ' + this.high + ' ' +gLocal.gui.h+ '</a><br><a href="../">' +gLocal.gui.day_EXP + ' : ' + Math.round((this.high - this.low)*100)/100 + ' ' +gLocal.gui.h+'</a></b><br/>';
- }
- else{
- return '<b><a href="../">'+this.series.name + ' : ' + this.y + ' ' +gLocal.gui.times+'</a><span style="display:none;">'+this.x+'</span></b>';
-
- }
- },
- valueDecimals: 2,//保留两位小數
- split: true
- },
- series: [{
- type: 'ohlc',
- name: gLocal.gui.EXP_in_total,
- data: ohlc,
- dataGrouping: {
- units: [[
- 'week', // unit name
- [1] // allowed multiples
- ], [
- 'month',
- [1, 2, 3, 4, 6]
- ]]
- }
- }, {
- type: 'column',
- name: gLocal.gui.day_action,
- data: volume,
- yAxis: 1,
- dataGrouping: {
- units: groupingUnits
- }
- }]
- });
- });
- </script>
- <style>
- body {
- margin: 0;
- padding: 0;
- font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
- font-size: 14px;
- }
- #script-warning {
- display: none;
- background: #eee;
- border-bottom: 1px solid #ddd;
- padding: 0 10px;
- line-height: 40px;
- text-align: center;
- font-weight: bold;
- font-size: 12px;
- color: red;
- }
- #loading {
- display: none;
- position: absolute;
- top: 10px;
- right: 10px;
- }
- #calendar {
- max-width: 1100px;
- margin: 40px auto;
- padding: 0 10px;
- }
- </style>
- <div class='index_inner'>
- <div id='script-warning'>
- <code>php/get-events.php</code> must be running.
- </div>
- <div id='loading'>loading...</div>
- <div id='calendar'></div>
- </div>
- <?php
- include "../pcdl/html_foot.php";
- ?>
|