api.sormyahont.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709
  1. <?php
  2. /**
  3. * SORM Yahont draft support
  4. */
  5. class SormYahont {
  6. /**
  7. * Contains system alter config as key=>value
  8. *
  9. * @var array
  10. */
  11. protected $altCfg = array();
  12. /**
  13. * Contains stargazer users table as login=>userdata
  14. *
  15. * @var array
  16. */
  17. protected $allUsers = array();
  18. /**
  19. * Contains users data with fields like address, realname, etc as login=>userdata
  20. *
  21. * @var array
  22. */
  23. protected $allUsersData = array();
  24. /**
  25. * Contains all contract dates as contract=>date
  26. *
  27. * @var array
  28. */
  29. protected $allContractDates = array();
  30. /**
  31. * Contains users passport data as login=>passportdata
  32. *
  33. * @var array
  34. */
  35. protected $AllPassportData = array();
  36. /**
  37. * Default branch ID
  38. *
  39. * @var int
  40. */
  41. protected $branchId = 1;
  42. /**
  43. * Contains ISP name
  44. *
  45. * @var string
  46. */
  47. protected $ispName = '';
  48. /**
  49. * Contains ISP location country
  50. *
  51. * @var string
  52. */
  53. protected $ispCountry = '';
  54. /**
  55. * Contains ISP location region
  56. *
  57. * @var string
  58. */
  59. protected $ispRegion = '';
  60. /**
  61. * Contains ISP location district
  62. *
  63. * @var string
  64. */
  65. protected $ispDistrict = '';
  66. /**
  67. * Contains ISP location city
  68. *
  69. * @var string
  70. */
  71. protected $ispCity = '';
  72. /**
  73. * Contains ISP location street
  74. *
  75. * @var string
  76. */
  77. protected $ispStreet = '';
  78. /**
  79. * Contains ISP location build number
  80. *
  81. * @var string
  82. */
  83. protected $ispBuildNum = '';
  84. /**
  85. * Export date format
  86. */
  87. const DATE_FORMAT = 'd.m.Y H:i:s';
  88. /**
  89. * Ubilling database charset
  90. */
  91. const IN_CHARSET = 'utf-8';
  92. /**
  93. * Output charset
  94. */
  95. const OUT_CHARSET = 'windows-1251';
  96. /**
  97. * Default output CSV delimiter
  98. */
  99. const DELIMITER = ';';
  100. /**
  101. * Default CSV enclosure
  102. */
  103. const ENCLOSURE = '"';
  104. /**
  105. * Describes path for exporting output data
  106. */
  107. const PATH_EXPORT = 'content/documents/sorm/';
  108. /**
  109. * Creates new SormYahont instance
  110. *
  111. * @return void
  112. */
  113. public function __construct() {
  114. $this->loadAlter();
  115. $this->setOptions();
  116. $this->loadUsersData();
  117. $this->loadContractDates();
  118. $this->loadPassportData();
  119. }
  120. /**
  121. * Loads system alter config into protected property for further usage
  122. *
  123. * @global type $ubillingConfig
  124. *
  125. * @return void
  126. */
  127. protected function loadAlter() {
  128. global $ubillingConfig;
  129. $this->altCfg = $ubillingConfig->getAlter();
  130. }
  131. /**
  132. * Sets some object config-based options if required
  133. *
  134. * @return void
  135. */
  136. protected function setOptions() {
  137. //setting ISP location options
  138. $this->ispName = @$this->altCfg['SORM_ISPNAME'];
  139. $this->branchId = @$this->altCfg['SORM_BRANCHID'];
  140. $this->ispCountry = @$this->altCfg['SORM_ISPCOUNTRY'];
  141. $this->ispRegion = @$this->altCfg['SORM_ISPREGION'];
  142. $this->ispDistrict = @$this->altCfg['SORM_ISPDISTRICT'];
  143. $this->ispCity = @$this->altCfg['SORM_ISPCITY'];
  144. $this->ispStreet = @$this->altCfg['SORM_ISPSTREET'];
  145. $this->ispBuildNum = @$this->altCfg['SORM_ISPBUILD'];
  146. }
  147. /**
  148. * Loads users data from database into protected object props
  149. *
  150. * @return void
  151. */
  152. protected function loadUsersData() {
  153. $this->allUsers = zb_UserGetAllStargazerDataAssoc();
  154. $this->allUsersData = zb_UserGetAllDataCache();
  155. }
  156. /**
  157. * Loads all contract dates
  158. *
  159. * @return void
  160. */
  161. protected function loadContractDates() {
  162. $contractDates = new ContractDates();
  163. $this->allContractDates = $contractDates->getAllDatesBasic();
  164. }
  165. /**
  166. * Loads all users passport data
  167. *
  168. * @return void
  169. */
  170. protected function loadPassportData() {
  171. $this->AllPassportData = zb_UserPassportDataGetAll();
  172. }
  173. /**
  174. * Little workaround for future multiple branches support
  175. *
  176. * @param string $userLogin
  177. *
  178. * @return int
  179. */
  180. protected function getUserBranchId($userLogin) {
  181. return ($this->branchId);
  182. }
  183. /**
  184. * Encodes data to output charset before export
  185. *
  186. * @param string $data
  187. *
  188. * @return string
  189. */
  190. protected function changeCharset($data) {
  191. $data = iconv(self::IN_CHARSET, self::OUT_CHARSET, $data);
  192. return ($data);
  193. }
  194. /**
  195. * Casts date in required format
  196. *
  197. * @param string $date
  198. *
  199. * @return string
  200. */
  201. protected function formatDate($date) {
  202. $result = '';
  203. if (!empty($date)) {
  204. $timestamp = strtotime($date);
  205. $result = date(self::DATE_FORMAT, $timestamp);
  206. }
  207. return ($result);
  208. }
  209. /**
  210. * Converts single dimension array into CSV string data
  211. *
  212. * @param array $fields
  213. * @param string $delimiter
  214. * @param string $enclosure
  215. * @param bool $encloseAll
  216. * @param bool $nullToMysqlNull
  217. *
  218. * @return string
  219. */
  220. protected function arrayToCsv(array &$fields, $delimiter = ';', $enclosure = '"', $encloseAll = false, $nullToMysqlNull = false) {
  221. $delimiter_esc = preg_quote($delimiter, '/');
  222. $enclosure_esc = preg_quote($enclosure, '/');
  223. $output = array();
  224. foreach ($fields as $field) {
  225. if ($field === null && $nullToMysqlNull) {
  226. $output[] = 'NULL';
  227. continue;
  228. }
  229. // Enclose fields containing $delimiter, $enclosure or whitespace
  230. if ($encloseAll || preg_match("/(?:${delimiter_esc}|${enclosure_esc}|\s)/", $field)) {
  231. $output[] = $enclosure . str_replace($enclosure, $enclosure . $enclosure, $field) . $enclosure;
  232. } else {
  233. $output[] = $field;
  234. }
  235. }
  236. return implode($delimiter, $output);
  237. }
  238. /**
  239. * Returns user data squense 4.1
  240. *
  241. * @return string
  242. */
  243. public function getUserData() {
  244. $result = '';
  245. if (!empty($this->allUsersData)) {
  246. foreach ($this->allUsersData as $io => $each) {
  247. $userLogin = $each['login'];
  248. $stgData = $this->allUsers[$userLogin];
  249. $userContract = $each['contract'];
  250. $userContractDate = @$this->allContractDates[$userContract];
  251. $userState = 1;
  252. //detecting user state
  253. if (($each['Cash'] <= $each['Credit']) OR ( $each['Passive'] == 1) OR ( $stgData['Down'] == 1) OR ( $each['AlwaysOnline'] == 0)) {
  254. $userState = 0;
  255. }
  256. $dataTmp = array(
  257. $this->getUserBranchId($userLogin), //default branch
  258. $userLogin, // login
  259. $each['ip'], // ip
  260. $each['email'], // email
  261. $each['mobile'], // phone
  262. $each['mac'], // mac
  263. $this->formatDate($userContractDate), //contract date
  264. $userContract, //contract number
  265. $userState, //user state
  266. $this->formatDate($userContractDate), //using contract date as service activation date
  267. '', //using empty value as service deactivation date
  268. 0, // by default home user, may be we can detect corporative users (1) if CORPS_ENABLED
  269. 1, //single string user data fields
  270. //empty struct realname data for 3 fields , using type 1
  271. '', // first name
  272. '', // patronymic
  273. '', // surname
  274. $each['realname'], //realname as single string
  275. $this->formatDate(@$this->AllPassportData[$userLogin]['birthdate']), // birthdate
  276. 1, //single string passport data
  277. //empty struct passport data for 3 fields, using type 1
  278. '', // passport series
  279. '', // passport number
  280. '', // when and who applied
  281. //unsctruct passport data below
  282. @$this->AllPassportData[$userLogin]['passportnum'] . ' ' . @$this->AllPassportData[$userLogin]['passportdate'] . ' ' . @$this->AllPassportData[$userLogin]['passportwho'],
  283. 1, // i guess 1 is passport
  284. '', //empty user bank
  285. '', //empty bank account
  286. //corporate users data below, now its unprocessed
  287. '', //empty corp name
  288. '', //empty INN
  289. '', //empty contact person
  290. '', //empty phones/faxes
  291. '', //empty corp bank name
  292. '', //empty corp bank account
  293. 1, // single string address data
  294. //empty struct address 9 fields, using type 1
  295. '', // postal index aka zip
  296. '', // country
  297. '', // region
  298. '', // district
  299. '', // city name
  300. '', // street
  301. '', // build num
  302. '', // housing
  303. '', // apartment
  304. $each['fulladress'], //single string address
  305. 1, //single string device address
  306. //empty 9 fields for struct device address
  307. '', // postal index aka zip
  308. '', // country
  309. '', // region
  310. '', // district
  311. '', // city name
  312. '', // street
  313. '', // build num
  314. '', // housing
  315. '', // apt
  316. $each['fulladress'], //using user address as device address
  317. );
  318. $result .= $this->arrayToCsv($dataTmp, self::DELIMITER, self::ENCLOSURE, true) . PHP_EOL;
  319. }
  320. }
  321. return ($result);
  322. }
  323. /**
  324. * Returns user services data squense 4.2
  325. *
  326. * @return string
  327. */
  328. public function getServicesData() {
  329. $result = '';
  330. if (!empty($this->allUsersData)) {
  331. foreach ($this->allUsersData as $io => $each) {
  332. $userLogin = $each['login'];
  333. $stgData = @$this->allUsers[$userLogin];
  334. $userContract = $each['contract'];
  335. $userContractDate = @$this->allContractDates[$userContract];
  336. $dataTmp = array(
  337. $this->getUserBranchId($userLogin), //default branch
  338. $userLogin, // login
  339. $userContract, //contract number
  340. 1, //using something like service ID
  341. $this->formatDate($userContractDate), //contract date
  342. '', //using empty value as service deactivation date
  343. '', // using empty service custom parameters
  344. );
  345. $result .= $this->arrayToCsv($dataTmp, self::DELIMITER, self::ENCLOSURE, true) . PHP_EOL;
  346. }
  347. }
  348. return ($result);
  349. }
  350. /**
  351. * Banks transactons data squense 6.1 returns empty data because no mechanics for detecting it
  352. *
  353. * @return string
  354. */
  355. public function getBankTransactions() {
  356. $result = '';
  357. return ($result);
  358. }
  359. /**
  360. * Payment cards usage data squense 6.2
  361. *
  362. * @return string
  363. */
  364. public function getPaycardsTransactions() {
  365. $result = '';
  366. $query = "SELECT * from `cardbank` WHERE `usedlogin`!='';";
  367. $allCards = simple_queryall($query);
  368. if (!empty($allCards)) {
  369. foreach ($allCards as $io => $each) {
  370. $userLogin = $each['usedlogin'];
  371. //not showing card payments for users that not exists anymore
  372. if (isset($this->allUsersData[$userLogin])) {
  373. $userData = $this->allUsersData[$userLogin];
  374. $userContract = $userData['contract'];
  375. $dataTmp = array(
  376. $this->getUserBranchId($userLogin), //default branch ID
  377. $userContract, //user contract
  378. $userData['ip'], //user IP
  379. $this->formatDate($each['usedate']), //card usage aka payment date
  380. $each['part'] . $each['serial'], //card part and number
  381. $each['cash'] // card price
  382. );
  383. $result .= $this->arrayToCsv($dataTmp, self::DELIMITER, self::ENCLOSURE, true) . PHP_EOL;
  384. }
  385. }
  386. }
  387. return ($result);
  388. }
  389. /**
  390. * Returns existing OpenPays transactions data squense 6.3
  391. *
  392. * @return string
  393. */
  394. public function getOpenPayzTransactions() {
  395. $result = '';
  396. //is openpayz used on this host?
  397. if (zb_CheckTableExists('op_transactions')) {
  398. $allPayIds = array();
  399. $queryPayIds = "SELECT * from `op_customers`";
  400. $allPayIdsTmp = simple_queryall($queryPayIds);
  401. //payment IDs preprocessing
  402. if (!empty($allPayIdsTmp)) {
  403. foreach ($allPayIdsTmp as $io => $each) {
  404. $allPayIds[$each['virtualid']] = $each['realid'];
  405. }
  406. }
  407. //transactions processing
  408. $query = "SELECT * from `op_transactions`";
  409. $allTransactions = simple_queryall($query);
  410. if (!empty($allTransactions)) {
  411. foreach ($allTransactions as $io => $each) {
  412. //detecting user login by its PaymentID
  413. if (isset($allPayIds[$each['customerid']])) {
  414. $userLogin = $allPayIds[$each['customerid']];
  415. //not showing transactions for users that not exists anymore
  416. if (isset($this->allUsersData[$userLogin])) {
  417. $userData = $this->allUsersData[$userLogin];
  418. $dataTmp = array(
  419. $this->getUserBranchId($userLogin), //user branch ID
  420. $userData['contract'], // user contract number
  421. $this->formatDate($each['date']), //transaction processing aka payment date
  422. $each['paysys'] . ' ' . $each['hash'], //using payment system name + hash as terminal ID
  423. '', //we dont know anything about terminal number
  424. '', //and nothing about its address
  425. $each['summ'], //but we know transaction summ
  426. );
  427. $result .= $this->arrayToCsv($dataTmp, self::DELIMITER, self::ENCLOSURE, true) . PHP_EOL;
  428. }
  429. }
  430. }
  431. }
  432. }
  433. return ($result);
  434. }
  435. /**
  436. * Returns data squense 6.4 for users cash payments
  437. *
  438. * @return string
  439. */
  440. public function getCashPayments() {
  441. $result = '';
  442. $query = "SELECT * from `payments` WHERE `cashtypeid`='1' AND `summ`>0;";
  443. $allPayments = simple_queryall($query);
  444. if (!empty($allPayments)) {
  445. foreach ($allPayments as $io => $each) {
  446. $userLogin = $each['login'];
  447. //no export payments for users that not exists anymore
  448. if (isset($this->allUsersData[$userLogin])) {
  449. $userData = $this->allUsersData[$userLogin];
  450. $dataTmp = array(
  451. $this->getUserBranchId($userLogin), //user branch ID
  452. $userData['contract'], //user contract number
  453. $userData['ip'], //user IP address
  454. $this->formatDate($each['date']), //payment date
  455. 'cashbox', // its cash payment point
  456. //6 empty fields for cashbox address
  457. $this->ispCountry, // country
  458. $this->ispRegion, // region
  459. $this->ispDistrict, // district
  460. $this->ispCity, // city name
  461. $this->ispStreet, // street
  462. $this->ispBuildNum, //build num
  463. $each['summ'], // payment sum
  464. );
  465. $result .= $this->arrayToCsv($dataTmp, self::DELIMITER, self::ENCLOSURE, true) . PHP_EOL;
  466. }
  467. }
  468. }
  469. return ($result);
  470. }
  471. /**
  472. * Returns data about payments summary aka data squense 6.7
  473. *
  474. * @return string
  475. */
  476. public function getPaymentsSummary() {
  477. $result = '';
  478. $query = "SELECT * from `payments` WHERE `summ`>0;";
  479. $allPayments = simple_queryall($query);
  480. if (!empty($allPayments)) {
  481. foreach ($allPayments as $io => $each) {
  482. $userLogin = $each['login'];
  483. //no export payments for users that not exists anymore
  484. if (isset($this->allUsersData[$userLogin])) {
  485. $userData = $this->allUsersData[$userLogin];
  486. $dataTmp = array(
  487. $this->getUserBranchId($userLogin), //user branch ID
  488. $each['cashtypeid'], //cash type id
  489. $userData['contract'], //user contract number
  490. $userData['ip'], //user IP address
  491. $this->formatDate($each['date']), //payment date
  492. $each['summ'], // payment sum
  493. $each['note'], // payment notes
  494. );
  495. $result .= $this->arrayToCsv($dataTmp, self::DELIMITER, self::ENCLOSURE, true) . PHP_EOL;
  496. }
  497. }
  498. }
  499. return ($result);
  500. }
  501. /**
  502. * Returns available NAS servers list aka gates as data squense 7.1
  503. *
  504. * @return string
  505. */
  506. public function getNasData() {
  507. $result = '';
  508. $query = "SELECT * from `nas`";
  509. $all = simple_queryall($query);
  510. if (!empty($all)) {
  511. foreach ($all as $io => $each) {
  512. /**
  513. * Когда я с ними - я перестаю умирать
  514. * У них открытые руки и цветные слова
  515. * Они дышат травой и им на всё наплевать
  516. * А майор идёт их уничтожать
  517. */
  518. $dataTmp = array(
  519. $this->branchId, //default branch id
  520. $each['nasip'], // NAS IP
  521. '01.01.2017 00:00:00', // we dont know when NAS start working
  522. '', // and guesss what? we think that NAS still works
  523. $each['nasname'], //using NAS name as description
  524. $this->ispCountry, //location country
  525. $this->ispRegion, // location region
  526. $this->ispDistrict, //location district
  527. $this->ispCity, //location city
  528. $this->ispStreet, //location street
  529. $this->ispBuildNum, //location build
  530. 7, // NAS type AAA
  531. );
  532. $result .= $this->arrayToCsv($dataTmp, self::DELIMITER, self::ENCLOSURE, true) . PHP_EOL;
  533. }
  534. }
  535. return ($result);
  536. }
  537. /**
  538. * Returns available services list aka 7.2
  539. *
  540. * @return string
  541. */
  542. public function getServicesList() {
  543. $result = '';
  544. $dataTmp = array(
  545. $this->branchId, // branch id
  546. 1, //serviceID
  547. 'Internet', //service internal name
  548. '', //start date
  549. '', //end date
  550. __('Internet'), //localised service name
  551. );
  552. $result .= $this->arrayToCsv($dataTmp, self::DELIMITER, self::ENCLOSURE, true) . PHP_EOL;
  553. return ($result);
  554. }
  555. /**
  556. * Payment types directory aka 7.3
  557. *
  558. * @return string
  559. */
  560. public function getPaymentTypesList() {
  561. $result = '';
  562. $all = zb_CashGetAllCashTypes();
  563. if (!empty($all)) {
  564. foreach ($all as $cashTypeId => $cashTypeName) {
  565. $dataTmp = array(
  566. $this->branchId, //branch ID
  567. $cashTypeId, // payment type id
  568. '01.01.2017 00:00:00', //type start date
  569. '', //type end date
  570. __($cashTypeName) //type name localised
  571. );
  572. $result .= $this->arrayToCsv($dataTmp, self::DELIMITER, self::ENCLOSURE, true) . PHP_EOL;
  573. }
  574. }
  575. return ($result);
  576. }
  577. /**
  578. * Returns available IP pools directory aka 7.4
  579. *
  580. * @return string
  581. */
  582. public function getIpPoolsList() {
  583. $result = '';
  584. $query = "SELECT * from `networks`";
  585. $all = simple_queryall($query);
  586. if (!empty($all)) {
  587. foreach ($all as $io => $each) {
  588. $ipSegs = explode('/', $each['desc']);
  589. if (!empty($ipSegs)) {
  590. $dataTmp = array(
  591. $this->branchId, //branch id
  592. 'Users IP pool', // ip pool purpose
  593. $ipSegs[0], //IP pool network address
  594. $ipSegs[1], //IP pool network CIDR mask
  595. '01.01.2017 00:00:00', //start date
  596. '', //end date
  597. );
  598. $result .= $this->arrayToCsv($dataTmp, self::DELIMITER, self::ENCLOSURE, true) . PHP_EOL;
  599. }
  600. }
  601. }
  602. return ($result);
  603. }
  604. /**
  605. * Returns document types list aka 7.5
  606. *
  607. * @return string
  608. */
  609. public function getDocsTypesList() {
  610. $result = '';
  611. $dataTmp = array(
  612. $this->branchId, //branch id
  613. 1, // document type
  614. '01.01.2017 00:00:00', //start date
  615. '', //end date
  616. __('Passport data') //document type name
  617. );
  618. $result .= $this->arrayToCsv($dataTmp, self::DELIMITER, self::ENCLOSURE, true) . PHP_EOL;
  619. return ($result);
  620. }
  621. /**
  622. * Returns branches directory aka 7.8
  623. *
  624. * @return string
  625. */
  626. public function getBranchesList() {
  627. $result = '';
  628. $dataTmp = array(
  629. $this->branchId, //branch id
  630. '', //start date
  631. '', //end date
  632. $this->ispName //Branch name
  633. );
  634. $result .= $this->arrayToCsv($dataTmp, self::DELIMITER, self::ENCLOSURE, true) . PHP_EOL;
  635. return ($result);
  636. }
  637. /**
  638. * Saves all output data to some path
  639. *
  640. * @return void
  641. */
  642. public function saveAllDataCsv() {
  643. //telephony only
  644. //file_put_contents(self::PATH_EXPORT . 'dictionaries/' . '7.8-branches.csv', $this->changeCharset($this->getBranchesList()));
  645. file_put_contents(self::PATH_EXPORT . 'dictionaries/' . '7.5-doctypes.csv', $this->changeCharset($this->getDocsTypesList()));
  646. file_put_contents(self::PATH_EXPORT . 'dictionaries/' . '7.4-ip_numbering_plan.csv', $this->changeCharset($this->getIpPoolsList()));
  647. file_put_contents(self::PATH_EXPORT . 'dictionaries/' . '7.3-pay_types.csv', $this->changeCharset($this->getPaymentTypesList()));
  648. file_put_contents(self::PATH_EXPORT . 'dictionaries/' . '7.2-supplement_services.csv', $this->changeCharset($this->getServicesList()));
  649. file_put_contents(self::PATH_EXPORT . 'dictionaries/' . '7.1-gates.csv', $this->changeCharset($this->getNasData()));
  650. file_put_contents(self::PATH_EXPORT . 'payments/' . '6.7-balance-fillup.csv', $this->changeCharset($this->getPaymentsSummary()));
  651. //not required if fillup used
  652. //file_put_contents(self::PATH_EXPORT . 'payments/' . '6.4-service-center.csv', $this->changeCharset($this->getCashPayments()));
  653. //file_put_contents(self::PATH_EXPORT . 'payments/' . '6.3-public-terminal.csv', $this->changeCharset($this->getOpenPayzTransactions()));
  654. //file_put_contents(self::PATH_EXPORT . 'payments/' . '6.2-express-card.csv', $this->changeCharset($this->getPaycardsTransactions()));
  655. file_put_contents(self::PATH_EXPORT . 'abonents/' . '4.2-services.csv', $this->changeCharset($this->getServicesData()));
  656. file_put_contents(self::PATH_EXPORT . 'abonents/' . '4.1-abonents.csv', $this->changeCharset($this->getUserData()));
  657. }
  658. }
  659. ?>