?PNG
IHDR ? f ??C1 sRGB ?? gAMA ?a pHYs ? ??od GIDATx^LeY?a?("Bh?_????q5k?*:t0A-o??]VkJM??f?8\k2ll1]q????T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/user1137782/www/china1.by/classwithtostring.php on line 86
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
function.back.inc.php 0000666 00000023724 15047261270 0010571 0 ustar 00
Выберите типы экспортируемых обьектов:
"; $out .= ''; } else { $out .= " "; } return $out; } function get_export_vars($fileparams=null){ global $_POST; $params=array(); $sections=explode(',',$_POST['Section_ID']); if ($fileparams['city']) { $childs = array(); foreach ($sections as $section){ $sub= get_child_nodes($section); foreach ($sub as $key => $item) { if ($item['LinkName'] == $fileparams['city']) { $childs[]=$key; } } } if (!$childs) return false; $sections=$childs; } $params['Section_ID']=implode(',',$sections); $params['Object_ID']=(int)$_POST['Object_ID']; $params['Date']=$fileparams['Date']; if ($_POST['Date']) $params['Date']=$_POST['Date']; $params['number']=$fileparams['number']; $params['clear_by_params']=$_POST['clear_by_params']; $params['add_handlers_to_section']=$_POST['add_handlers_to_section']; return $params; } function get_export_filename_params(&$file){ $fname = basename($file['name']); $pos = strrpos($fname,'.'); $ext = substr($fname,$pos+1); $fname=substr($fname,0,$pos); $pattern = '/^([0-9]{4}-[0-9]{2}-[0-9]{2})_([a-zA-Z]+)_([0-9]{1,5})$/'; preg_match($pattern, $fname, $matches, PREG_OFFSET_CAPTURE); if (!($date = $matches[1][0]) || !($cityname= $matches[2][0]) || !($number = (int)$matches[3][0])){ return false; } return array('Date'=>$date,'city'=>$cityname,'number'=>$number); } function do_export(){ global $MODULE_URL,$MODULE_VARS,$MODULE_ROOT,$MODULE_URL,$XLS_connected; $OPTIONS = &$MODULE_VARS['export']; $table = (int)$_POST['object_id']; if (!$table) $table = (int)$OPTIONS['DEFAULT_TABLE']; if (!$table) { return 'Ошибка! не указан тип экспортируемого обьекта!'; } $request = array('table'=>$table,'order' => '`Created` DESC'); $object_struct=getObjectStruct($table); $date_field = 'DATE(`'.(($object_struct['Date']) ? $object_struct['Date'] : 'Created').'`)'; $date_from=trim(mysql_real_escape_string($_POST['Date_from'])); $date_to=trim(mysql_real_escape_string($_POST['Date_to'])); if ($date_from || $date_to) { $request['where'] = " ( ".($date_to ? $date_field." <= '".$date_to."'" : "").($date_to && $date_from ? " AND " : "").($date_from ? $date_field." >= '".$date_from."'" : "").") "; } $objects = getObjects($request,true); if (!$objects) { return 'Не удалось найти ни одного обьекта за данный период!'; } $template_file = trim(mysql_real_escape_string($_POST['template-file'])); if (!$template_file) $template_file='std.xls'; $infile = $MODULE_ROOT.'templates/'.$template_file; if (!@file_exists($infile)){ return 'Файл шаблона импорта не найден! '.$infile; } connect_feature('xls'); if (!$XLS_connected) { return 'Плагин обработки excel-файлов не подключен!!'; } $objPHPExcel = PHPExcel_IOFactory::load($infile); if (!$objPHPExcel) { return 'Файл шаблона экспорта не является файлом формата EXCEL!!'; } else { $objPHPExcel->setActiveSheetIndex(0); $aSheet = $objPHPExcel->getActiveSheet(); if (!$aSheet) { return 'Отсутствуют закладки в файле.'; } } $row = SheetGetRow($aSheet,2); if (!$row || !is_array($row)){ return 'Ошибка при чтении заголовков в файле шаблона экспорта!'; } $HL = array(); $HLfunctions = array(); foreach ($row as $rowid => $cell) { $pattern = '/^(.+?)\[(.+)\((.*?)\)\]$/'; preg_match($pattern, $cell, $matches); if ($matches) { $HLfunctions[$rowid]=array('flag'=> $matches[2],'argument' => $matches[3],'field'=>$matches[1]); $HL[$rowid]=$matches[1]; } else { $HL[$rowid]=$cell; } } SheetCleanRow($aSheet,2); $bill_filename = date('Y_m_d_H_i_s').'_bill.xls'; $bill_file = $MODULE_ROOT.'files/'.$bill_filename; $bill_link = $MODULE_URL.'files/'.$bill_filename; $rows=array(); foreach ($objects as $object) { $row=array(); foreach ($HL as $y => $fieldname){ if (!$HLfunctions[$y]) { if ($fieldname == 'Date' && !$object[$fieldname]) { $fieldname='Created'; } if ($object[$fieldname]) { $type = (int)$object_struct[$fieldname]['TypeOfData_ID']; if ($fieldname == 'Created') $type=8; $val=$object[$fieldname]; switch ($type) { case 8 : $val=date('Y.m.d',strtotime($val)); break; case 2: if (substr_count($fieldname,'price')){ $val= ' '.humanMoneyExport($val).' '; } break; } $row[$y]=$val; } else { $row[$y]=''; } } else { $func = &$HLfunctions[$y]; $val = ''; switch ($func['flag']){ // список функций экспорта case 'c' : $eq = explode('=',$func['argument']); if (count($eq)!= 2) { break;} if ($object[$eq[0]] == $eq[1]) { $val = $object[$func['field']]; } break; } $row[$y]=$val; } } //if (count($rows)<1) $rows[]=$row; } if (!$rows) { return 'Извините. Произошла ошибка. Обратитесь к разработчикам.'; } echo 'Идёт экспорт, подождите...