DealsSales.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. <?php
  2. Lib::loadClass('RouteBase');
  3. class Route_DealsSales extends RouteBase {
  4. public function handleAuth() {
  5. if (!User::logged()) {
  6. throw new HttpException('Unauthorized', 401);
  7. }
  8. }
  9. public function defaultAction() {
  10. SE_Layout::gora();
  11. SE_Layout::menu();
  12. ?>
  13. TODO: ...
  14. <?php
  15. $this->legacy_DEALS_SALES();
  16. SE_Layout::dol();
  17. }
  18. public function legacy_DEALS_SALES() {
  19. $id_telboxes = V::get('id_telboxes', '', $_REQUEST);
  20. $id_companies = V::get('id_companies', '', $_REQUEST, 'int');
  21. $task = V::get('_task', '', $_REQUEST);
  22. switch ($task) {
  23. case 'TYPESPECIAL': {
  24. $DBG = ('1' == V::get('DBG', '', $_REQUEST));
  25. header("Content-type: application/json");
  26. $fld = V::get('fld', '', $_GET);
  27. switch ($fld) {
  28. case 'id_telboxes': {
  29. Lib::loadClass('TypespecialVariable');
  30. $typeSpecialTelboxes = TypespecialVariable::getInstance(-1, '__TELBOXES_NAME');
  31. $query = V::get('q', '', $_REQUEST);
  32. $rawRows = null;
  33. $rows = $typeSpecialTelboxes->getValuesWithExports($query);
  34. if($DBG){echo'<pre style="max-height:200px;overflow:auto;border:1px solid red;text-align:left;">rows('.$query.') (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($rows);echo'</pre>';}
  35. foreach ($rows as $kID => $vItem) {
  36. $itemJson = new stdClass();
  37. $itemJson->id = $vItem->id;
  38. $itemJson->name = $vItem->param_out;
  39. if (!empty($vItem->exports)) {
  40. $itemJson->exports = $vItem->exports;
  41. }
  42. $jsonData[] = $itemJson;
  43. }
  44. echo json_encode($jsonData);
  45. }
  46. break;
  47. case 'id_companies': {
  48. Lib::loadClass('TypespecialVariable');
  49. $typeSpecialCompanies = TypespecialVariable::getInstance(-1, '__COMPANIES');
  50. $query = V::get('q', '', $_REQUEST);
  51. $rawRows = null;
  52. $rows = $typeSpecialCompanies->getValuesWithExports($query);
  53. if($DBG){echo'<pre style="max-height:200px;overflow:auto;border:1px solid red;text-align:left;">rows('.$query.') (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($rows);echo'</pre>';}
  54. foreach ($rows as $kID => $vItem) {
  55. $itemJson = new stdClass();
  56. $itemJson->id = $vItem->id;
  57. $itemJson->name = $vItem->param_out;
  58. if (!empty($vItem->exports)) {
  59. $itemJson->exports = $vItem->exports;
  60. }
  61. $jsonData[] = $itemJson;
  62. }
  63. echo json_encode($jsonData);
  64. }
  65. break;
  66. }
  67. exit;
  68. }
  69. }
  70. SE_Layout::menu();
  71. Lib::loadClass('TypespecialVariable');
  72. $typeSpecialTelboxes = TypespecialVariable::getInstance(-1, '__TELBOXES_NAME');
  73. $typeSpecialCompanies = null;// TypespecialVariable::getInstance(-1, '__COMPANIES');
  74. $obroty = array();
  75. if (!empty($id_telboxes) || $id_companies > 0) {
  76. $db = DB::getDB();
  77. $sqlWhere = array();
  78. //if (!empty($id_telboxes)) $sqlWhere[] = " d.`T_TELBOX_NEIGHBOUR_IN`='{$id_telboxes}' ";
  79. if (!empty($id_telboxes)) $sqlWhere[] = " o.`T_TELBOX_NEIGHBOUR_IN`='{$id_telboxes}' ";
  80. //if ($id_companies > 0) $sqlWhere[] = " d.`ID_BILLING_USERS`='{$id_companies}' ";
  81. $sqlWhere = (!empty($sqlWhere))? implode(" or ", $sqlWhere) : '';
  82. $sql = "select o.`ID`
  83. -- , d.`T_TELBOX_NEIGHBOUR_IN`
  84. , o.`T_TELBOX_NEIGHBOUR_IN`
  85. , o.`ID_DEALS_TABLE`
  86. , o.`SALES_DATE`
  87. , o.`SALES_VALUE`
  88. from `DEALS_SALES` as o
  89. -- join `DEALS_TABLE` as d on (d.`ID`=o.`ID_DEALS_TABLE`)
  90. where
  91. {$sqlWhere}
  92. ";
  93. if(V::get('DBG','',$_GET)){echo'<pre style="max-height:200px;overflow:auto;border:1px solid red;text-align:left;"> (' . __CLASS__ . '::' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($sql);echo'</pre>';}
  94. $res = $db->query($sql);
  95. while ($r = $db->fetch($res)) {
  96. $year = substr($r->SALES_DATE, 0, 4);
  97. $month = substr($r->SALES_DATE, 5, 2);
  98. $obroty[$r->ID_DEALS_TABLE][$year][$month] = $r->SALES_VALUE;
  99. }
  100. }
  101. $monthsOut = array();
  102. for ($i = 0; $i < 12; $i++) $monthsOut[] = sprintf("%02d", $i + 1);
  103. ?>
  104. <div class="container-fluid">
  105. <form action="" method="GET" class="form-inline">
  106. <table>
  107. <!--
  108. <summary>Wybierz lokal i/lub firmę w celu przeglądania obrotów </summary>
  109. -->
  110. <thead>
  111. <tr>
  112. <th style="text-align:left">Lokal</th>
  113. <th style="text-align:left">
  114. <?php if ($typeSpecialCompanies) : ?>
  115. Firma
  116. <?php endif; ?>
  117. </th>
  118. </tr>
  119. </thead>
  120. <tbody>
  121. <tr>
  122. <td>
  123. <?php if ($typeSpecialTelboxes) : ?>
  124. <?php
  125. $fName = 'id_telboxes';
  126. $fldParams = array();
  127. $fldParams['allowCreate'] = false;
  128. $fldParams['ajaxDataUrlBase'] = "index.php?FUNCTION_INIT=" . __FUNCTION__ . "&HEADER_NOT_INIT=YES&_task=TYPESPECIAL&fld={$fName}";
  129. //$fldParams['ajaxDataUrlBase'] .= "&DBG_TS=3";
  130. echo $typeSpecialTelboxes->showFormItem($tblID = -1, $fName, $selValue = $id_telboxes, $fldParams);
  131. ?>
  132. <?php endif; ?>
  133. </td>
  134. <td>
  135. <?php if ($typeSpecialCompanies) : ?>
  136. <?php
  137. $fName = 'id_companies';
  138. $fldParams = array();
  139. $fldParams['allowCreate'] = false;
  140. $fldParams['ajaxDataUrlBase'] = "index.php?FUNCTION_INIT=" . __FUNCTION__ . "&HEADER_NOT_INIT=YES&_task=TYPESPECIAL&fld={$fName}";
  141. //$fldParams['ajaxDataUrlBase'] .= "&DBG_TS=3";
  142. echo $typeSpecialCompanies->showFormItem($tblID = -1, $fName, $selValue = $id_companies, $fldParams);
  143. ?>
  144. <?php endif; ?>
  145. </td>
  146. </tr>
  147. <tr>
  148. <td clspan="2">
  149. <button class="btn">wybierz</button>
  150. </td>
  151. </tr>
  152. </tbody>
  153. </table>
  154. </form>
  155. <?php if (empty($obroty)) : ?>
  156. <?php else : ?>
  157. <table class="table table-bordered table-hover">
  158. <thead>
  159. <th></th>
  160. <?php foreach ($monthsOut as $vMonth) : ?>
  161. <th><?php echo $vMonth; ?></th>
  162. <?php endforeach; ?>
  163. <th>suma</th>
  164. </thead>
  165. <?php foreach ($obroty as $kComId => $vSalesByYear) : ?>
  166. <?php krsort($vSalesByYear); foreach ($vSalesByYear as $kYearId => $vSalesByMonth) : ?>
  167. <tr>
  168. <th><?php echo $kYearId; ?></th>
  169. <?php $sumaYear = 0; foreach ($monthsOut as $vMonth) : ?>
  170. <td>
  171. <?php if (isset($vSalesByMonth[$vMonth])) : ?>
  172. <?php $sumaYear += $vSalesByMonth[$vMonth]; ?>
  173. <nobr><?php echo number_format($vSalesByMonth[$vMonth], 2, ',', ' '); ?></nobr>
  174. <?php else : ?>
  175. ...
  176. <?php endif; ?>
  177. </td>
  178. <?php endforeach; ?>
  179. <td><nobr><?php echo number_format($sumaYear, 2, ',', ' '); ?></nobr></td>
  180. </tr>
  181. <?php endforeach; ?>
  182. <?php endforeach; ?>
  183. </table>
  184. <script src="stuff/RGraph/libraries/RGraph.common.core.js"></script>
  185. <script src="stuff/RGraph/libraries/RGraph.common.dynamic.js"></script>
  186. <script src="stuff/RGraph/libraries/RGraph.common.key.js"></script>
  187. <script src="stuff/RGraph/libraries/RGraph.drawing.rect.js"></script>
  188. <script src="stuff/RGraph/libraries/RGraph.common.tooltips.js"></script>
  189. <script src="stuff/RGraph/libraries/RGraph.bar.js"></script>
  190. <script src="stuff/RGraph/libraries/RGraph.line.js"></script>
  191. <!--
  192. <?php
  193. $wykresWidth = 940;
  194. $jsonLabels = array();
  195. $jsonColors = array();
  196. $jsonData = array();
  197. $jsonTooltips = array();
  198. $jsonColors = array('Gradient(#fe783e:#EC561B:#F59F7D)', 'Gradient(#99f:#27afe9:#058DC7:#058DC7)', 'Gradient(#94f776:#50B332:#B1E59F)', 'Gradient(#CC76F7:#8832B3:#CE9FE5)', 'Gradient(#768CF7:#3247B3:#9FABE5)', 'Gradient(#F77681:#B3323C:#E59FA5)');
  199. $vSalesByYear = reset($obroty);// only first company
  200. krsort($vSalesByYear);
  201. foreach ($vSalesByYear as $kYearId => $vSalesByMonth) {
  202. $jsonYearData = array();
  203. foreach ($monthsOut as $vMonth) {
  204. if (isset($vSalesByMonth[$vMonth])) {
  205. $jsonYearData["{$kYearId}-{$vMonth}"] = (float)str_replace('.', ',', $vSalesByMonth[$vMonth]);
  206. } else {
  207. $jsonYearData["{$kYearId}-{$vMonth}"] = 0;
  208. }
  209. }
  210. $jsonYearData = array_reverse($jsonYearData);
  211. //$jsonData[] = array_values($jsonYearData);
  212. foreach ($jsonYearData as $kLabel => $vValue) {
  213. $jsonLabels[] = $kLabel;
  214. $jsonData[] = $vValue;
  215. $jsonTooltips[] = "Obrót " . number_format($vValue, 2, ',', ' ') . " w {$kLabel}";
  216. }
  217. }
  218. $wykresMinItemWidth = 30;
  219. $wykresTestWidth = count(array_keys($vSalesByYear)) * 12 * $wykresMinItemWidth;
  220. if ($wykresTestWidth > $wykresWidth - 60 - 20) {
  221. $wykresWidth = $wykresTestWidth + 60 + 20;
  222. }
  223. ?>
  224. <div style="width:100%; margin:10px 0; border:1px solid gray; overflow:auto">
  225. <canvas id="wykres1" width="<?php echo $wykresWidth; ?>" height="300">[No canvas support]</canvas>
  226. </div>
  227. <script>
  228. jQuery(document).ready(function(){
  229. // .Set('hmargin', 0)
  230. var bar = new RGraph.Bar('wykres1', <?php echo json_encode($jsonData); ?>)
  231. .Set('labels', <?php echo json_encode($jsonLabels); ?>)
  232. .Set('colors', <?php echo json_encode($jsonColors); ?>)
  233. .Set('strokestyle', 'white')
  234. .Set('linewidth', 1)
  235. .Set('shadow', true)
  236. .Set('shadow.color', '#ccc')
  237. .Set('shadow.offsetx', 0)
  238. .Set('shadow.offsety', 0)
  239. .Set('shadow.blur', 10)
  240. // .Set('gutter.right', 20)
  241. .Set('gutter.bottom', 60)
  242. .Set('gutter.left', 60)
  243. .Set('text.angle', 90)
  244. .Set('tooltips', RGraph.ISOLD ? null : <?php echo json_encode($jsonTooltips); ?>)
  245. .Set('tooltips.event', 'mousemove')
  246. .Set('labels.above', true)
  247. .Draw();
  248. });
  249. </script>
  250. <?php
  251. $wykresWidth = 940;
  252. $jsonLabels = array();
  253. $jsonColors = array();
  254. $jsonData = array();
  255. $jsonTooltips = array();
  256. $jsonColors = array('Gradient(#fe783e:#EC561B:#F59F7D)', 'Gradient(#99f:#27afe9:#058DC7:#058DC7)', 'Gradient(#94f776:#50B332:#B1E59F)', 'Gradient(#CC76F7:#8832B3:#CE9FE5)', 'Gradient(#768CF7:#3247B3:#9FABE5)', 'Gradient(#F77681:#B3323C:#E59FA5)');
  257. $vSalesByYear = reset($obroty);// only first company
  258. krsort($vSalesByYear);
  259. foreach ($monthsOut as $vMonth) {
  260. $jsonYearData = array();
  261. foreach ($vSalesByYear as $kYearId => $vSalesByMonth) {
  262. if (isset($vSalesByMonth[$vMonth])) {
  263. $jsonYearData["{$kYearId}-{$vMonth}"] = (float)str_replace('.', ',', $vSalesByMonth[$vMonth]);
  264. } else {
  265. $jsonYearData["{$kYearId}-{$vMonth}"] = 0;
  266. }
  267. }
  268. //$jsonYearData = array_reverse($jsonYearData);
  269. //$jsonData[] = array_values($jsonYearData);
  270. foreach ($jsonYearData as $kLabel => $vValue) {
  271. $jsonLabels[] = $kLabel;
  272. $jsonData[] = $vValue;
  273. $jsonTooltips[] = "Obrót " . number_format($vValue, 2, ',', ' ') . " w {$kLabel}";
  274. }
  275. }
  276. $wykresMinItemWidth = 30;
  277. $wykresTestWidth = count(array_keys($vSalesByYear)) * 12 * $wykresMinItemWidth;
  278. if ($wykresTestWidth > $wykresWidth - 60 - 20) {
  279. $wykresWidth = $wykresTestWidth + 60 + 20;
  280. }
  281. ?>
  282. <div style="width:100%; margin:10px 0; border:1px solid gray; overflow:auto">
  283. <canvas id="wykres2" width="<?php echo $wykresWidth; ?>" height="300">[No canvas support]</canvas>
  284. </div>
  285. <script>
  286. jQuery(document).ready(function(){
  287. // .Set('hmargin', 15)
  288. var bar = new RGraph.Bar('wykres2', <?php echo json_encode($jsonData); ?>)
  289. .Set('labels', <?php echo json_encode($jsonLabels); ?>)
  290. .Set('colors', <?php echo json_encode($jsonColors); ?>)
  291. .Set('strokestyle', 'white')
  292. .Set('linewidth', 1)
  293. .Set('shadow', true)
  294. .Set('shadow.color', '#ccc')
  295. .Set('shadow.offsetx', 0)
  296. .Set('shadow.offsety', 0)
  297. .Set('shadow.blur', 10)
  298. // .Set('gutter.right', 20)
  299. .Set('gutter.bottom', 60)
  300. .Set('gutter.left', 60)
  301. .Set('text.angle', 90)
  302. .Set('tooltips', RGraph.ISOLD ? null : <?php echo json_encode($jsonTooltips); ?>)
  303. .Set('tooltips.event', 'mousemove')
  304. .Set('labels.above', true)
  305. .Draw();
  306. });
  307. </script>
  308. -->
  309. <?php
  310. $wykresWidth = 940;
  311. $jsonLabels = array();
  312. $jsonColors = array();
  313. $jsonData = array();
  314. $jsonTooltips = array();
  315. $jsonColors = array('Gradient(#fe783e:#EC561B:#F59F7D)', 'Gradient(#99f:#27afe9:#058DC7:#058DC7)', 'Gradient(#94f776:#50B332:#B1E59F)', 'Gradient(#CC76F7:#8832B3:#CE9FE5)', 'Gradient(#768CF7:#3247B3:#9FABE5)', 'Gradient(#F77681:#B3323C:#E59FA5)');
  316. $vSalesByYear = reset($obroty);// only first company
  317. ksort($vSalesByYear);
  318. foreach ($vSalesByYear as $kYearId => $vSalesByMonth) {
  319. $jsonYearData = array();
  320. foreach ($monthsOut as $vMonth) {
  321. if (isset($vSalesByMonth[$vMonth])) {
  322. $jsonYearData["{$kYearId}-{$vMonth}"] = (float)str_replace('.', ',', $vSalesByMonth[$vMonth]);
  323. } else {
  324. $jsonYearData["{$kYearId}-{$vMonth}"] = 0;
  325. }
  326. }
  327. //$jsonYearData = array_reverse($jsonYearData);
  328. //$jsonData[] = array_values($jsonYearData);
  329. foreach ($jsonYearData as $kLabel => $vValue) {
  330. $jsonLabels[] = $kLabel;
  331. // $jsonData[] = $vValue;
  332. $jsonTooltips[] = "Obrót " . number_format($vValue, 2, ',', ' ') . " w {$kLabel}";
  333. }
  334. $jsonData[] = array_values($jsonYearData);
  335. }
  336. $wykresMinItemWidth = 20;
  337. $wykresTestWidth = count(array_keys($vSalesByYear)) * 12 * $wykresMinItemWidth;
  338. if ($wykresTestWidth > $wykresWidth - 60 - 20) {
  339. $wykresWidth = $wykresTestWidth + 60 + 20;
  340. }
  341. $jsonLabels = array_keys($vSalesByYear);
  342. $jsonColorsAll = array();
  343. for ($i = 0, $mi = 0, $mc = count($jsonColors); $i < 12; $i++) {
  344. $jsonColorsAll[] = $jsonColors[$mi];
  345. if (++$mi >= $mc) {
  346. $mi = 0;
  347. }
  348. }
  349. $jsonColors = $jsonColorsAll;
  350. ?>
  351. <div style="width:100%; margin:10px 0; border:1px solid gray; overflow:auto">
  352. <canvas id="wykres3" width="<?php echo $wykresWidth; ?>" height="300">[No canvas support]</canvas>
  353. </div>
  354. <script>
  355. jQuery(document).ready(function(){
  356. // .Set('hmargin', 0)
  357. var bar = new RGraph.Bar('wykres3', <?php echo json_encode($jsonData); ?>)
  358. .Set('labels', <?php echo json_encode($jsonLabels); ?>)
  359. .Set('colors', <?php echo json_encode($jsonColors); ?>)
  360. .Set('strokestyle', 'white')
  361. .Set('linewidth', 1)
  362. .Set('shadow', true)
  363. .Set('shadow.color', '#ccc')
  364. .Set('shadow.offsetx', 0)
  365. .Set('shadow.offsety', 0)
  366. .Set('shadow.blur', 10)
  367. // .Set('gutter.right', 20)
  368. .Set('gutter.bottom', 30)
  369. .Set('gutter.left', 60)
  370. // .Set('text.angle', 90)
  371. .Set('tooltips', RGraph.ISOLD ? null : <?php echo json_encode($jsonTooltips); ?>)
  372. .Set('tooltips.event', 'mousemove')
  373. .Set('labels.above', true)
  374. .Set('hmargin', 20)
  375. .Draw();
  376. });
  377. </script>
  378. <?php
  379. $wykresWidth = 940;
  380. $jsonLabels = array();
  381. $jsonColors = array();
  382. $jsonData = array();
  383. $jsonTooltips = array();
  384. $jsonColors = array('Gradient(#fe783e:#EC561B:#F59F7D)', 'Gradient(#99f:#27afe9:#058DC7:#058DC7)', 'Gradient(#94f776:#50B332:#B1E59F)', 'Gradient(#CC76F7:#8832B3:#CE9FE5)', 'Gradient(#768CF7:#3247B3:#9FABE5)', 'Gradient(#F77681:#B3323C:#E59FA5)');
  385. $vSalesByYear = reset($obroty);// only first company
  386. ksort($vSalesByYear);
  387. foreach ($monthsOut as $vMonth) {
  388. $jsonYearData = array();
  389. foreach ($vSalesByYear as $kYearId => $vSalesByMonth) {
  390. if (isset($vSalesByMonth[$vMonth])) {
  391. $jsonYearData["{$kYearId}-{$vMonth}"] = (float)str_replace('.', ',', $vSalesByMonth[$vMonth]);
  392. } else {
  393. $jsonYearData["{$kYearId}-{$vMonth}"] = 0;
  394. }
  395. }
  396. //$jsonYearData = array_reverse($jsonYearData);
  397. //$jsonData[] = array_values($jsonYearData);
  398. foreach ($jsonYearData as $kLabel => $vValue) {
  399. $jsonLabels[] = $kLabel;
  400. $jsonTooltips[] = "Obrót " . number_format($vValue, 2, ',', ' ') . " w {$kLabel}";
  401. }
  402. $jsonData[] = array_values($jsonYearData);
  403. }
  404. $wykresMinItemWidth = 20;
  405. $wykresTestWidth = count(array_keys($vSalesByYear)) * 12 * $wykresMinItemWidth;
  406. if ($wykresTestWidth > $wykresWidth - 60 - 20) {
  407. $wykresWidth = $wykresTestWidth + 60 + 20;
  408. }
  409. $jsonLabels = array('styczeń','luty','marzec','kwiecień','maj','czerwiec','lipiec','sierpień','wrzesień','październik','listopad','grudzień');
  410. $jsonColorsAll = array();
  411. for ($i = 0, $mi = 0, $mc = count($jsonColors); $i < count($jsonData); $i++) {
  412. $jsonColorsAll[] = $jsonColors[$mi];
  413. if (++$mi >= $mc) {
  414. $mi = 0;
  415. }
  416. }
  417. $jsonColors = $jsonColorsAll;
  418. ?>
  419. <div style="width:100%; margin:10px 0; border:1px solid gray; overflow:auto">
  420. <canvas id="wykres4" width="<?php echo $wykresWidth; ?>" height="300">[No canvas support]</canvas>
  421. </div>
  422. <script>
  423. jQuery(document).ready(function(){
  424. // .Set('hmargin', 15)
  425. var bar = new RGraph.Bar('wykres4', <?php echo json_encode($jsonData); ?>)
  426. .Set('labels', <?php echo json_encode($jsonLabels); ?>)
  427. .Set('colors', <?php echo json_encode($jsonColors); ?>)
  428. .Set('strokestyle', 'white')
  429. .Set('linewidth', 1)
  430. .Set('shadow', true)
  431. .Set('shadow.color', '#ccc')
  432. .Set('shadow.offsetx', 0)
  433. .Set('shadow.offsety', 0)
  434. .Set('shadow.blur', 10)
  435. // .Set('gutter.right', 20)
  436. .Set('gutter.bottom', 30)
  437. .Set('gutter.left', 60)
  438. // .Set('text.angle', 90)
  439. .Set('tooltips', RGraph.ISOLD ? null : <?php echo json_encode($jsonTooltips); ?>)
  440. .Set('tooltips.event', 'mousemove')
  441. .Set('labels.above', true)
  442. .Set('hmargin', 20)
  443. .Draw();
  444. });
  445. </script>
  446. <?php endif; ?>
  447. </div>
  448. <?php
  449. }
  450. }