-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfidu-bus.php
More file actions
executable file
·37 lines (32 loc) · 976 Bytes
/
fidu-bus.php
File metadata and controls
executable file
·37 lines (32 loc) · 976 Bytes
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
<?php
require_once 'fidu/JsonData.php';
require_once 'fidu/ExcelData.php';
require_once 'fidu/Data2HTML.php';
require_once 'fidu/Common.php';
require_once 'fidu/FiduXML.php';
header('Content-Type: text/html; charset=UTF-8');
if(isset($_POST['action'])){
JsonToHTML( );
}else{
ExcelToHTML();
}
function JsonToHTML(){
$table = $_POST['table'];
$jsondata = new JsonData($table);
$dataToHtml = new Data2HTML( $jsondata);
$fiduXml = new FiduXML();
$fiduXml->editItem($_POST['moduleId'], $_POST['moduleName'], json_encode($jsondata -> getSheet('config')));
echo $dataToHtml->toHTML();
}
function ExcelToHTML(){
$file_path = dirname(dirname(dirname(__FILE__))).'/wp-content/uploads/excel/'.$_GET['filename'];
$exceldata = new ExcelData($file_path);
$dataToHtml = new Data2HTML( $exceldata);
$type = $_GET['type'];
if( isset($type) && $type=='html' ){
echo $dataToHtml->toHTML();
}else{
echo $dataToHtml->toJson();
}
}
?>