<?php
-class commonTools {
+class commonTools
+{
- public static function hub($args) {
+ public static function hub($args)
+ {
global $core;
$args = cubePage::getArgs($args);
}
}
- public static function des() {
+ public static function des()
+ {
global $core;
commonDroits::min(2);
$ue = array_diff(cubeCountry::getUECountries(), array('FR'));
$countries = "'" . implode("','", $ue) . "'";
- $limit = TIME - (3600 * 24 * 180);
+ $limit = TIME - (3600 * 24 * 400);
+
+ $limit = mktime(0, 0, 0, date('m', $limit), 1, date('y', $limit));
$tvanumbers = array();
$r = $core->con->select('SELECT entreprise_id,tva_intra FROM entreprises');
foreach ($montants as $tva => $d) {
$s->getCell('A' . $line)->setValue($tva);
$s->getCell('B' . $line)->setValue($d['montant']);
- $s->getCell('C' . $line)->setValue(implode(',', $d['rs']));
- $s->getCell('D' . $line)->setValue(implode(', ', $d['factures']));
+ $s->getCell('C' . $line)->setValue(implode(',', array_unique($d['rs'])));
+ $s->getCell('D' . $line)->setValue(" " . implode(', ', $d['factures']));
$line++;
}
$s->getColumnDimension('A')->setAutoSize(true);
}
- public static function urlDecoder($args) {
+ public static function urlDecoder($args)
+ {
global $js;
$js[] = JS_PATH . '/urldecoder.js';
return $res;
}
- public static function html2php() {
+ public static function html2php()
+ {
global $core;
if (!isset($_POST['input'])) {
return $res;
}
- public static function tubeMeta($args) {
+ public static function tubeMeta($args)
+ {
$url = $_GET['u'];
$hash = sha1($url);
}
$res = array('width' => $dim[0],
- 'height' => $dim[1],
- 'ratio' => round($dim[0] / $dim[1], 5));
+ 'height' => $dim[1],
+ 'ratio' => round($dim[0] / $dim[1], 5));
echo json_encode($res);
exit;
}
- public static function url($args) {
+ public static function url($args)
+ {
ob_end_clean();
echo '<script type="text/javascript">window.location="' . $_GET['u'] . '"</script>';
exit;
}
- public static function tube($args) {
+ public static function tube($args)
+ {
global $css, $js, $jsnomerge, $jsvar;
$css = array();
$background = trim($background, '# ');
$fv = array('video' => $url,
- 'autoPlay' => $autoplay == 1,
- 'controls' => $controls == 1,
- 'loop' => $loop == 1,
- 'background' => $background);
+ 'autoPlay' => $autoplay == 1,
+ 'controls' => $controls == 1,
+ 'loop' => $loop == 1,
+ 'background' => $background);
if (file_exists($dir . 'video.jpg')) {
if ($displayPoster) {
echo $res;
}
- public static function browserInfos($args) {
+ public static function browserInfos($args)
+ {
global $core;
global $jsnomerge;
global $js;
}
- public static function favicon($args) {
+ public static function favicon($args)
+ {
global $core;
$res = commonPage::barre();
$res .= commonPage::tMain();
return $res;
}
- public static function webfonts($args) {
+ public static function webfonts($args)
+ {
global $core;
$res = commonPage::barre();
$res .= commonPage::tMain();
return $res;
}
- public static function makeWebfont() {
+ public static function makeWebfont()
+ {
$tmp = cubeFiles::tempdir();
if (!file_exists($tmp)) {
mkdir($tmp, 0777, true);
cubeHTTP::downloadFile($tmpfile, $fontName . '.zip');
}
- public static function makeFavicon() {
+ public static function makeFavicon()
+ {
$tmp = cubeFiles::tempdir();
mkdir($tmp, 0777, true);
`rm -rf $tmp`;
}
- public static function pngToIcns($file, $res) {
- if(!file_exists($file)){
+ public static function pngToIcns($file, $res)
+ {
+ if (!file_exists($file)) {
return;
}
$icns = array(128, 256, 512);
}
}
- public static function getDefaultLanguage() {
+ public static function getDefaultLanguage()
+ {
$available = explode(',', $_GET['available']);
$accept = null;
if (isset($_GET['accept'])) {
exit;
}
- public static function uglify() {
+ public static function uglify()
+ {
$js = '';
if (isset($_POST['js'])) {
$js = $_POST['js'];
exit;
}
- public static function csr() {
+ public static function csr()
+ {
commonDroits::min(1);
global $core;
$res = commonPage::barre();
return $res;
}
- public static function makeP12() {
+ public static function makeP12()
+ {
//http://help.adobe.com/en_US/as3/iphone/WS144092a96ffef7cc-371badff126abc17b1f-7fff.html
commonDroits::min(1);
$tmp = cubeFiles::tempdir();
cubeHTTP::downloadFile($tmpfile, $base . '.zip');
}
- public static function makeCsr() {
+ public static function makeCsr()
+ {
// http://help.adobe.com/en_US/as3/iphone/WS144092a96ffef7cc-371badff126abc17b1f-8000.html
cubeHTTP::downloadFile($tmpfile, 'csr.zip');
}
- public static function geocode() {
+ public static function geocode()
+ {
$opt = array();
$opt['adapter'] = 'pdo_mysql';
exit;
}
- public static function syncftp() {
+ public static function syncftp()
+ {
commonDroits::min(2);
global $core;
$res = commonPage::barre();
return $res;
}
- public static function googleLucky() {
+ public static function googleLucky()
+ {
$q = $_GET['q'];
$cx = $_GET['cx'];
}
}
- public static function copyWsAssets() {
+ public static function copyWsAssets()
+ {
commonDroits::min(5);
global $core;
$res = commonPage::barre();
return $res;
}
- protected static function searchGoogle($q, $cx, $key) {
+ protected static function searchGoogle($q, $cx, $key)
+ {
global $core;
$url = 'https://www.googleapis.com/customsearch/v1?q=' . rawurlencode($q) . '&cx=' . $cx;
}
}
- public static function devspace() {
+ public static function devspace()
+ {
commonDroits::min(1);
global $core;
return $res;
}
- public static function mailer() {
+ public static function mailer()
+ {
commonDroits::min(1);
global $core;
$res = commonPage::barre();
return $res;
}
- public function rasterize() {
+ public function rasterize()
+ {
$type = isset($_GET['type']) ? $_GET['type'] : 'png';
$intype = CubeIT_Files::getExtension($_GET['src']);
exit;
}
- public static function chiffres() {
+ public static function chiffres()
+ {
global $core;
$datas_types = array();
$datas_entreprises = array();
}
}
- public static function SNCFCodes() {
+ public static function SNCFCodes()
+ {
//commonDroits::min(1);
global $core;
$res = commonPage::barre();
return $res;
}
- public static function makeSNCFCodes() {
+ public static function makeSNCFCodes()
+ {
$list = explode("\n", file_get_contents($_FILES['file']['tmp_name']));
$labels = [];
$links = [];
exit;
}
- public static function _listToALD($list) {
+ public static function _listToALD($list)
+ {
$res = '<</Link [/c << /Desc [/t (AutoBookmark Link Dictionary File)]
/Entries [/c << ';
foreach ($list as $k => $item) {
return $res;
}
- public static function _actionToALDCode($action) {
+ public static function _actionToALDCode($action)
+ {
if ($action['type'] == 'gotolabel') {
return '@' . $action['action'];
} elseif ($action['type'] == 'uri') {
}
}
- public static function proxy() {
+ public static function proxy()
+ {
ob_end_clean();
echo file_get_contents($_GET['url']);
exit;
}
- public static function phantomjs() {
+ public static function phantomjs()
+ {
$file = CubeIT_Files::tempnam();
$exportformat = isset($_GET['exportformat']) ? $_GET['exportformat'] : 'pdf';
$pageformat = isset($_GET['pageformat']) ? $_GET['pageformat'] : '210mm*297mm';