index.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606
  1. <?php
  2. if (cfr('REPORTSIGNUP')) {
  3. $altercfg = $ubillingConfig->getAlter();
  4. /**
  5. * Returns signups array with some custom options
  6. *
  7. * @param string $where
  8. *
  9. * @return array
  10. */
  11. function zb_SignupsGet($where) {
  12. $query = "SELECT * from `userreg` " . $where;
  13. $result = simple_queryall($query);
  14. return($result);
  15. }
  16. /**
  17. * returns array like $month_num=>$signup_count
  18. *
  19. * @param int $year
  20. *
  21. * @return array
  22. */
  23. function zb_SignupsGetCountYear($year) {
  24. $months = months_array();
  25. $result = array();
  26. foreach ($months as $monthNum => $monthName) {
  27. $result[$monthNum] = 0;
  28. }
  29. $allYearSignups_q = "SELECT * from `userreg` WHERE `date` LIKE '" . $year . "-%';";
  30. $allYearSignups = simple_queryall($allYearSignups_q);
  31. if (!empty($allYearSignups)) {
  32. foreach ($allYearSignups as $idx => $eachYearSignup) {
  33. $statsMonth = date("m", strtotime($eachYearSignup['date']));
  34. if (isset($result[$statsMonth])) {
  35. $result[$statsMonth] ++;
  36. } else {
  37. $result[$statsMonth] = 1;
  38. }
  39. }
  40. }
  41. return($result);
  42. }
  43. /**
  44. * Shows user signups by year with funny bars
  45. *
  46. * @global object $ubillingConfig
  47. * @param int $year
  48. *
  49. * @return void
  50. */
  51. function web_SignupsGraphYear($year) {
  52. global $ubillingConfig;
  53. $altCfg = $ubillingConfig->getAlter();
  54. $cache = new UbillingCache();
  55. $cemeteryEnabled = (@$altCfg['CEMETERY_ENABLED']) ? true : false;
  56. if ($cemeteryEnabled) {
  57. $cemetery = new Cemetery();
  58. }
  59. $year = vf($year);
  60. $yearcount = zb_SignupsGetCountYear($year);
  61. $maxsignups = max($yearcount);
  62. $allmonths = months_array();
  63. $totalcount = 0;
  64. $tablecells = wf_TableCell('');
  65. $tablecells .= wf_TableCell(__('Month'));
  66. $tablecells .= wf_TableCell(__('Signups'));
  67. if ($cemeteryEnabled) {
  68. $tablecells .= wf_TableCell(__('Dead souls'));
  69. $tablecells .= wf_TableCell('', '10%');
  70. }
  71. $tablecells .= wf_TableCell(__('Visual'), '50%');
  72. $tablerows = wf_TableRow($tablecells, 'row1');
  73. foreach ($yearcount as $eachmonth => $count) {
  74. $totalcount = $totalcount + $count;
  75. $tablecells = wf_TableCell($eachmonth);
  76. $tablecells .= wf_TableCell(wf_Link('?module=report_signup&month=' . $year . '-' . $eachmonth, rcms_date_localise($allmonths[$eachmonth])));
  77. $tablecells .= wf_TableCell($count);
  78. if ($cemeteryEnabled) {
  79. $deadDateMask = $year . '-' . $eachmonth . '-';
  80. $deadCount = $cemetery->getDeadDateCount($deadDateMask);
  81. $deadBar = web_barTariffs(abs($count), abs($deadCount));
  82. $tablecells .= wf_TableCell($deadCount);
  83. $tablecells .= wf_TableCell($deadBar);
  84. }
  85. $tablecells .= wf_TableCell(web_bar($count, $maxsignups), '', '', 'sorttable_customkey="' . $count . '"');
  86. $tablerows .= wf_TableRow($tablecells, 'row3');
  87. }
  88. $aliveStats = $cache->getCallback('SIGALIVESTATS_' . $year, function () use ($year) {
  89. return (zb_SignupsGetAilveStats($year));
  90. }, 86400); //cached for 1 day
  91. $result = wf_TableBody($tablerows, '100%', '0', 'sortable');
  92. $result .= wf_tag('b', false) . __('Total users registered') . ': ' . $totalcount . wf_tag('b', true);
  93. if ($totalcount > 0) {
  94. $result .= wf_tag('br');
  95. $result .= ' ' . $aliveStats['alive'] . ' ' . __('of them remain active');
  96. $result .= ' ' . __('and') . ' ' . $aliveStats['dead'] . ' ' . wf_Link('?module=report_signup&showdeadusers=' . $year, __('now is dead')) . ' (' . zb_PercentValue($aliveStats['total'], $aliveStats['dead']) . '%)';
  97. }
  98. $sigMapLinkControls = '';
  99. if (cfr('REPORTSIGNUP') AND cfr('USERSMAP')) {
  100. $sigMapLinkControls .= wf_tag('div', false, '', 'style="float:right; margin-left: 5px; padding-top: 0px;"');
  101. $sigMapLinkControls .= wf_Link('?module=report_sigmap', wf_img_sized('skins/swmapsmall.png', '', '12') . ' ' . __('Signups map'), false, 'ubButton') . ' ';
  102. $sigMapLinkControls .= wf_tag('div', true);
  103. }
  104. $ponLastLinkControls = '';
  105. if (cfr('PON')) {
  106. if ($ubillingConfig->getAlterParam('PON_ENABLED')) {
  107. $ponLastLinkControls .= wf_tag('div', false, '', 'style="float:right; margin-left: 5px; padding-top: 0px;"');
  108. $ponLastLinkControls .= wf_Link('?module=report_ponlastsig', wf_img_sized('skins/switch_models.png', '', '12') . ' ' . __('ONU signals'), false, 'ubButton') . ' ';
  109. $ponLastLinkControls .= wf_tag('div', true);
  110. }
  111. }
  112. //some additional controls here
  113. $result .= $sigMapLinkControls;
  114. $result .= $ponLastLinkControls;
  115. show_window(__('User signups by year') . ' ' . $year, $result);
  116. }
  117. /**
  118. * Renders dead users for some year
  119. *
  120. * @param int $year
  121. *
  122. * @return void
  123. */
  124. function web_SignupsShowDeadUsers($year) {
  125. $year = vf($year, 3);
  126. global $ubillingConfig;
  127. $altCfg = $ubillingConfig->getAlter();
  128. $cache = new UbillingCache();
  129. if ($altCfg['MOBILES_EXT']) {
  130. $mobilesExt = new MobilesExt();
  131. }
  132. $aliveStats = $cache->getCallback('SIGALIVESTATS_' . $year, function () use ($year) {
  133. return (zb_SignupsGetAilveStats($year));
  134. }, 86400); //cached for 1 day
  135. $allUserData = zb_UserGetAllDataCache();
  136. $contractDates = new ContractDates();
  137. $allContractDates = $contractDates->getAllDatesBasic();
  138. $deadCount = 0;
  139. $frozenCount = 0;
  140. $result = '';
  141. $result .= wf_BackLink('?module=report_signup');
  142. $result .= wf_delimiter();
  143. if (!empty($aliveStats)) {
  144. if (!empty($aliveStats['deadlogins'])) {
  145. $cells = wf_TableCell(__('Login'));
  146. $cells .= wf_TableCell(__('Address'));
  147. $cells .= wf_TableCell(__('Real Name'));
  148. $cells .= wf_TableCell(__('IP'));
  149. $cells .= wf_TableCell(__('Tariff'));
  150. $cells .= wf_TableCell(__('Active'));
  151. $cells .= wf_TableCell(__('Balance'));
  152. $cells .= wf_TableCell(__('Credit'));
  153. $cells .= wf_TableCell(__('Phones'));
  154. $cells .= wf_TableCell(__('Contract date'));
  155. $rows = wf_TableRow($cells, 'row1');
  156. foreach ($aliveStats['deadlogins'] as $io => $login) {
  157. $userData = @$allUserData[$login];
  158. $userExtMobiles = '';
  159. $allExt = array();
  160. if ($altCfg['MOBILES_EXT']) {
  161. $extMobilesTmp = $mobilesExt->getUserMobiles($login);
  162. if (!empty($extMobilesTmp)) {
  163. if (!empty($extMobilesTmp)) {
  164. foreach ($extMobilesTmp as $ia => $each) {
  165. $allExt[] = $each['mobile'];
  166. }
  167. }
  168. $userExtMobiles = implode(',', $allExt);
  169. }
  170. }
  171. $cells = wf_TableCell(wf_Link('?module=userprofile&username=' . $login, web_profile_icon() . ' ' . $login));
  172. $cells .= wf_TableCell(@$userData['fulladress']);
  173. $cells .= wf_TableCell(@$userData['realname']);
  174. $cells .= wf_TableCell(@$userData['ip']);
  175. $cells .= wf_TableCell(@$userData['Tariff']);
  176. $actFlag = ($userData['Cash'] >= -$userData['Credit']) ? web_bool_led(true) : web_bool_led(false);
  177. if ($userData['Passive']) {
  178. $freezeFlag = ' ' . wf_img('skins/icon_passive.gif', __('User is frozen'));
  179. $frozenCount++;
  180. } else {
  181. $freezeFlag = '';
  182. }
  183. $cells .= wf_TableCell($actFlag . $freezeFlag);
  184. $cells .= wf_TableCell($userData['Cash']);
  185. $cells .= wf_TableCell($userData['Credit']);
  186. $cells .= wf_TableCell($userData['mobile'] . ' ' . $userData['phone'] . ' ' . $userExtMobiles);
  187. $cells .= wf_TableCell(@$allContractDates[$userData['contract']]);
  188. $rows .= wf_TableRow($cells, 'row5');
  189. $deadCount++;
  190. }
  191. $result .= wf_TableBody($rows, '100%', 0, 'sortable');
  192. $result .= __('Total') . ': ' . $deadCount . wf_tag('br');
  193. $result .= __('Frozen') . ': ' . $frozenCount;
  194. }
  195. }
  196. show_window(__('Inactive') . ' ' . $year, $result);
  197. }
  198. /**
  199. * Shows current month signups
  200. *
  201. * @global object $altercfg
  202. *
  203. * @param string $yearMonth
  204. *
  205. * @return void
  206. */
  207. function web_SignupsMonthShow($yearMonth = '') {
  208. global $altercfg;
  209. if (empty($yearMonth)) {
  210. $cmonth = curmonth();
  211. } else {
  212. $cmonth = ubRouting::filters($yearMonth, 'mres');
  213. }
  214. $messages = new UbillingMessageHelper();
  215. $alltariffs = zb_TariffsGetAllUsers();
  216. $deleatableFlag = @$altercfg['SIGREP_DELETABLE'] ? true : false;
  217. $cityColumn = @$altercfg['SIGREP_CITYRENDER'] ? true : false;
  218. $userCities = array();
  219. $curdate = curdate();
  220. $totalCount = 0;
  221. $frozenCount = 0;
  222. $aliveCount = 0;
  223. $chartDataMonth = array();
  224. $chartDataDay = array();
  225. $where = "WHERE `date` LIKE '" . $cmonth . "%' ORDER by `date` DESC;";
  226. $signups = zb_SignupsGet($where);
  227. //preload cities data
  228. if ($cityColumn) {
  229. $userCities = zb_AddressGetCityUsers();
  230. }
  231. //cemetery hide processing
  232. $ignoreUsers = array();
  233. if ($altercfg['CEMETERY_ENABLED']) {
  234. $cemetery = new Cemetery();
  235. $ignoreUsers = $cemetery->getAllTagged();
  236. }
  237. $tablecells = wf_TableCell(__('ID'));
  238. $tablecells .= wf_TableCell(__('Date'));
  239. $tablecells .= wf_TableCell(__('Administrator'));
  240. if ($altercfg['SIGREP_CONTRACT']) {
  241. $tablecells .= wf_TableCell(__('Contract'));
  242. $allcontracts = array_flip(zb_UserGetAllContracts());
  243. }
  244. $tablecells .= wf_TableCell(__('Login'));
  245. $tablecells .= wf_TableCell(__('Tariff'));
  246. $tablecells .= wf_TableCell(__('Status'));
  247. if ($cityColumn) {
  248. $tablecells .= wf_TableCell(__('City'));
  249. }
  250. $tablecells .= wf_TableCell(__('Address'));
  251. if ($deleatableFlag) {
  252. if (cfr('ROOT')) {
  253. $tablecells .= wf_TableCell(''); //just column placeholder
  254. }
  255. }
  256. $tablerows = wf_TableRow($tablecells, 'row1');
  257. if (!empty($signups)) {
  258. $employeeLogins = ts_GetAllEmployeeLoginsAssocCached();
  259. $allUserData = zb_UserGetAllDataCache();
  260. foreach ($signups as $io => $eachsignup) {
  261. $tablecells = wf_TableCell($eachsignup['id']);
  262. $tablecells .= wf_TableCell($eachsignup['date']);
  263. $administratorName = (isset($employeeLogins[$eachsignup['admin']])) ? $employeeLogins[$eachsignup['admin']] : $eachsignup['admin'];
  264. $tablecells .= wf_TableCell($administratorName);
  265. if ($altercfg['SIGREP_CONTRACT']) {
  266. $tablecells .= wf_TableCell(@$allcontracts[$eachsignup['login']]);
  267. }
  268. $sigTariff = @$alltariffs[$eachsignup['login']];
  269. $tariffCellClass = ($sigTariff == '*_NO_TARIFF_*') ? 'undone' : '';
  270. $tablecells .= wf_TableCell($eachsignup['login']);
  271. $tablecells .= wf_TableCell($sigTariff, '', $tariffCellClass);
  272. $userState = '';
  273. $userStateMark = '';
  274. if (isset($allUserData[$eachsignup['login']])) {
  275. $userData = $allUserData[$eachsignup['login']];
  276. if (zb_SignupCheckIsUserActive($userData)) {
  277. $userState .= wf_img_sized('skins/icon_ok.gif', __('Alive'), '12');
  278. $aliveCount++;
  279. $userStateMark = 'A';
  280. } else {
  281. if ($userData['Passive']) {
  282. $userState .= wf_img_sized('skins/icon_passive.gif', __('Frozen user'), '12');
  283. $frozenCount++;
  284. $userStateMark = 'F';
  285. } else {
  286. $userState .= wf_img_sized('skins/icon_inactive.gif', __('Inactive'), '12');
  287. $userStateMark = 'I';
  288. }
  289. }
  290. } else {
  291. $userState .= wf_img_sized('skins/skull.png', __('Deleted'), '12');
  292. $userStateMark = 'D';
  293. }
  294. $tablecells .= wf_TableCell($userState, '', '', 'sorttable_customkey="' . $userStateMark . '"');
  295. if ($cityColumn) {
  296. $tablecells .= wf_TableCell(@$userCities[$eachsignup['login']]);
  297. }
  298. $profilelink = wf_Link('?module=userprofile&username=' . trim($eachsignup['login']), web_profile_icon() . ' ' . $eachsignup['address']);
  299. $tablecells .= wf_TableCell($profilelink);
  300. if (ispos($eachsignup['date'], $curdate)) {
  301. $rowClass = 'todaysig';
  302. //today chart data
  303. if (isset($chartDataDay[$administratorName])) {
  304. $chartDataDay[$administratorName] ++;
  305. } else {
  306. $chartDataDay[$administratorName] = 1;
  307. }
  308. } else {
  309. $rowClass = 'row5';
  310. }
  311. //cemetary user
  312. if (isset($ignoreUsers[$eachsignup['login']])) {
  313. $rowClass = 'sigcemeteryuser';
  314. }
  315. //ugly check - is user removed?
  316. if (empty($sigTariff)) {
  317. $rowClass = 'sigdeleteduser';
  318. }
  319. //chart data filling
  320. if (isset($chartDataMonth[$administratorName])) {
  321. $chartDataMonth[$administratorName] ++;
  322. } else {
  323. $chartDataMonth[$administratorName] = 1;
  324. }
  325. //record deletion control
  326. if ($deleatableFlag) {
  327. if (cfr('ROOT')) {
  328. if (empty($sigTariff)) {
  329. $deletionLink = wf_JSAlert('?module=report_signup&deleterecord=' . $eachsignup['id'], __('Delete'), $messages->getDeleteAlert());
  330. } else {
  331. $deletionLink = '';
  332. }
  333. $tablecells .= wf_TableCell($deletionLink);
  334. }
  335. }
  336. $tablerows .= wf_TableRow($tablecells, $rowClass);
  337. $totalCount++;
  338. }
  339. }
  340. $result = wf_TableBody($tablerows, '100%', '0', 'sortable');
  341. //stats
  342. $result .= wf_img_sized('skins/icon_stats_16.gif', '', '12') . ' ' . __('Total') . ': ' . $totalCount . wf_tag('br');
  343. $result .= wf_img_sized('skins/icon_ok.gif', '', '12') . ' ' . __('Alive') . ': ' . $aliveCount . wf_tag('br');
  344. $result .= wf_img_sized('skins/icon_passive.gif', '', '12') . ' ' . __('Frozen') . ': ' . $frozenCount . wf_tag('br');
  345. $result .= wf_tag('br');
  346. $result .= web_SignupsRenderChart($chartDataMonth, $chartDataDay);
  347. $reportTitle = (empty($yearMonth)) ? __('Current month user signups') : __('User signups by month') . ' ' . $cmonth;
  348. show_window($reportTitle, $result);
  349. }
  350. /**
  351. * Renders google charts for month signups data array
  352. *
  353. * @param array $dataMonth
  354. * @param array $dataDay
  355. *
  356. * @return string
  357. */
  358. function web_SignupsRenderChart($dataMonth, $dataDay) {
  359. $result = '';
  360. $options = "chartArea: { width: '90%', height: '90%' }, pieSliceText: 'value-and-percentage', legend : {position: 'right'}, ";
  361. if (!empty($dataMonth)) {
  362. $chartMonth = wf_gcharts3DPie($dataMonth, __('Month'), '400px;', '300px;', $options);
  363. } else {
  364. $chartMonth = '';
  365. }
  366. if (!empty($dataDay)) {
  367. $chartDay = wf_gcharts3DPie($dataDay, __('Today'), '400px;', '300px;', $options);
  368. } else {
  369. $chartDay = '';
  370. }
  371. $cells = wf_TableCell($chartMonth);
  372. $cells .= wf_TableCell($chartDay);
  373. $rows = wf_TableRow($cells);
  374. $result .= wf_tag('h3') . __('Administrators') . wf_tag('h3', true);
  375. $result .= wf_TableBody($rows, '100%', '0', '');
  376. return ($result);
  377. }
  378. /**
  379. * Shows signups performed today
  380. *
  381. * @return void
  382. */
  383. function web_SignupsShowToday() {
  384. $messages = new UbillingMessageHelper();
  385. $query = "SELECT COUNT(`id`) from `userreg` WHERE `date` LIKE '" . curdate() . "%'";
  386. $sigcount = simple_query($query);
  387. $sigcount = $sigcount['COUNT(`id`)'];
  388. show_window('', $messages->getStyledMessage(__('Today signups') . ': ' . wf_tag('strong') . $sigcount . wf_tag('strong', true), 'info'));
  389. }
  390. /**
  391. * Shows signup tariffs popularity chart
  392. *
  393. * @return void
  394. */
  395. function web_SignupGraph() {
  396. if (!wf_CheckGet(array('month'))) {
  397. $cmonth = curmonth();
  398. } else {
  399. $cmonth = mysql_real_escape_string($_GET['month']);
  400. }
  401. $where = "WHERE `date` LIKE '" . $cmonth . "%'";
  402. $alltariffnames = zb_TariffsGetAll();
  403. $tariffusers = zb_TariffsGetAllUsers();
  404. $allsignups = zb_SignupsGet($where);
  405. $tcount = array();
  406. if (!empty($allsignups)) {
  407. foreach ($alltariffnames as $io => $eachtariff) {
  408. foreach ($allsignups as $ii => $eachsignup) {
  409. if (@$tariffusers[$eachsignup['login']] == $eachtariff['name']) {
  410. @$tcount[$eachtariff['name']] = $tcount[$eachtariff['name']] + 1;
  411. }
  412. }
  413. }
  414. }
  415. $tablecells = wf_TableCell(__('Tariff'));
  416. $tablecells .= wf_TableCell(__('Count'));
  417. $tablecells .= wf_TableCell(__('Visual'), '50%');
  418. $tablerows = wf_TableRow($tablecells, 'row1');
  419. if (!empty($tcount)) {
  420. foreach ($tcount as $sigtariff => $eachcount) {
  421. $tablecells = wf_TableCell($sigtariff);
  422. $tablecells .= wf_TableCell($eachcount);
  423. $tablecells .= wf_TableCell(web_bar($eachcount, sizeof($allsignups)), '', '', 'sorttable_customkey="' . $eachcount . '"');
  424. $tablerows .= wf_TableRow($tablecells, 'row3');
  425. }
  426. }
  427. $result = wf_TableBody($tablerows, '100%', '0', 'sortable');
  428. show_window(__('Tariffs report'), $result);
  429. }
  430. /**
  431. * Check is user active right now?
  432. *
  433. * @param array $userData
  434. *
  435. * @return bool
  436. */
  437. function zb_SignupCheckIsUserActive($userData) {
  438. $result = false;
  439. if (!empty($userData)) {
  440. if (($userData['Cash'] >= '-' . $userData['Credit']) AND ( $userData['AlwaysOnline'] == 1) AND ( $userData['Passive'] == 0) AND ( $userData['Down'] == 0)) {
  441. $result = true;
  442. }
  443. }
  444. return ($result);
  445. }
  446. /**
  447. *
  448. * @param int $year
  449. *
  450. * @return array => alive/dead/total/deadlogins
  451. */
  452. function zb_SignupsGetAilveStats($year) {
  453. $result = array();
  454. $aliveTotal = 0;
  455. $deadTotal = 0;
  456. $year = vf($year, 3);
  457. $deadUserData = array();
  458. $allUsersData = array();
  459. $allUsersData = zb_UserGetAllStargazerDataAssoc();
  460. if (!empty($year)) {
  461. $query = "SELECT * from `userreg` WHERE `date` LIKE '" . $year . "-%';";
  462. $all = simple_queryall($query);
  463. if (!empty($all)) {
  464. foreach ($all as $io => $eachReg) {
  465. //is user deleted?
  466. if (isset($allUsersData[$eachReg['login']])) {
  467. $userData = $allUsersData[$eachReg['login']];
  468. if (zb_SignupCheckIsUserActive($userData)) {
  469. $aliveTotal++;
  470. } else {
  471. $deadTotal++;
  472. $deadUserData[$eachReg['login']] = $eachReg['login'];
  473. }
  474. } else {
  475. //he is dead if deleted, yeah
  476. $deadTotal++;
  477. }
  478. }
  479. }
  480. }
  481. //forming results
  482. $result['alive'] = $aliveTotal;
  483. $result['dead'] = $deadTotal;
  484. $result['total'] = $aliveTotal + $deadTotal;
  485. $result['deadlogins'] = $deadUserData;
  486. return ($result);
  487. }
  488. /**
  489. * Deletes record from signups report database
  490. *
  491. * @param int $sigrepid
  492. *
  493. * @return void
  494. */
  495. function zb_SignupsDeleteRecord($sigrepid) {
  496. if (!empty($sigrepid)) {
  497. $signups = new NyanORM('userreg');
  498. $signups->where('id', '=', $sigrepid);
  499. $recordToDelete = $signups->getAll('', false); //dont flush where struct
  500. if (!empty($recordToDelete)) {
  501. $signups->delete();
  502. log_register('SIGREP DELETE [' . $sigrepid . '] FOR (' . $recordToDelete[0]['login'] . ') DATE `' . $recordToDelete[0]['date'] . '`');
  503. }
  504. }
  505. }
  506. //record deletion
  507. if (ubRouting::checkGet('deleterecord')) {
  508. zb_SignupsDeleteRecord(ubRouting::get('deleterecord', 'int'));
  509. ubRouting::nav('?module=report_signup');
  510. }
  511. //other report routines
  512. if (!ubRouting::checkGet('showdeadusers')) {
  513. if (!ubRouting::checkPost('yearsel')) {
  514. $year = curyear();
  515. } else {
  516. $year = ubRouting::post('yearsel');
  517. }
  518. $yearinputs = wf_YearSelectorPreset('yearsel', '', false, $year);
  519. $yearinputs .= wf_Submit(__('Show'));
  520. $yearform = wf_Form('?module=report_signup', 'POST', $yearinputs, 'glamour');
  521. $yearform .= wf_CleanDiv();
  522. web_SignupsShowToday();
  523. show_window(__('Year'), $yearform);
  524. web_SignupsGraphYear($year);
  525. web_SignupGraph();
  526. if ($altercfg['CEMETERY_ENABLED']) {
  527. $cemetery = new Cemetery();
  528. show_window('', $cemetery->renderChart());
  529. }
  530. //render some signups data by selected or current month
  531. web_SignupsMonthShow(ubRouting::get('month'));
  532. } else {
  533. web_SignupsShowDeadUsers(ubRouting::get('showdeadusers'));
  534. }
  535. zb_BillingStats(true);
  536. } else {
  537. show_error(__('You cant control this module'));
  538. }