1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
excel.php
См. документацию.
1<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
2
4
5if (!isset($arFilter) || !is_array($arFilter))
6 die("Wrong use 1");
7if (!isset($arSelectFields) || !is_array($arSelectFields))
8 die("Wrong use 2");
9
11 array($by => $order),
13 false,
14 false,
15 $arSelectFields
16 );
17
18ob_start();
19?>
20<table border="1">
21 <tr>
22 <?
23 for ($i = 0; $i < count($arShownFieldsParams); $i++)
24 {
25 switch ($arShownFieldsParams[$i]["KEY"])
26 {
27 case "ID":
28 echo "<td>".$arShownFieldsParams[$i]["COLUMN_NAME"]."</td>";
29 echo "<td>".GetMessage("SEXE_ORDER_DATE")."</td>";
30 break;
31 case "PAYED":
32 echo "<td>".$arShownFieldsParams[$i]["COLUMN_NAME"]."</td>";
33 echo "<td>".GetMessage("SEXE_PAY_DATE")."</td>";
34 break;
35 default:
36 echo "<td>".$arShownFieldsParams[$i]["COLUMN_NAME"]."</td>";
37 break;
38 }
39 }
40 ?>
41 </tr>
42 <?
43 while ($arOrder = $dbOrderList->Fetch()):
44 ?>
45 <tr>
46 <?
47 for ($i = 0; $i < count($arShownFieldsParams); $i++)
48 {
49 ?>
50 <td>
51 <?
52 switch ($arShownFieldsParams[$i]["KEY"])
53 {
54 case "ID":
55 echo $arOrder["ID"]."</td><td>".$arOrder["DATE_INSERT"];
56 break;
57 case "LID":
58 if (!isset($LOCAL_SITE_LIST_CACHE[$arOrder["LID"]])
59 || !is_array($LOCAL_SITE_LIST_CACHE[$arOrder["LID"]]))
60 {
61 $dbSite = CSite::GetByID($arOrder["LID"]);
62 if ($arSite = $dbSite->Fetch())
63 $LOCAL_SITE_LIST_CACHE[$arOrder["LID"]] = htmlspecialcharsEx($arSite["NAME"]);
64 }
65 echo "[".$arOrder["LID"]."] ".$LOCAL_SITE_LIST_CACHE[$arOrder["LID"]];
66 break;
67 case "PERSON_TYPE":
68 if (!isset($LOCAL_PERSON_TYPE_CACHE[$arOrder["PERSON_TYPE_ID"]])
69 || !is_array($LOCAL_PERSON_TYPE_CACHE[$arOrder["PERSON_TYPE_ID"]]))
70 {
71 if ($arPersonType = CSalePersonType::GetByID($arOrder["PERSON_TYPE_ID"]))
72 $LOCAL_PERSON_TYPE_CACHE[$arOrder["PERSON_TYPE_ID"]] = htmlspecialcharsEx($arPersonType["NAME"]);
73 }
74 echo "[".$arOrder["PERSON_TYPE_ID"]."] ".$LOCAL_PERSON_TYPE_CACHE[$arOrder["PERSON_TYPE_ID"]];
75 break;
76 case "PAYED":
77 echo (($arOrder["PAYED"] == "Y") ? GetMessage("SEXE_YES") : GetMessage("SEXE_NO"))."</td><td>";
78 echo $arOrder["DATE_PAYED"];
79 break;
80 case "CANCELED":
81 echo (($arOrder["CANCELED"] == "Y") ? GetMessage("SEXE_YES") : GetMessage("SEXE_NO"))." ";
82 echo $arOrder["DATE_CANCELED"];
83 break;
84 case "STATUS":
85 if (!isset($LOCAL_STATUS_CACHE[$arOrder["STATUS_ID"]])
86 || !is_array($LOCAL_STATUS_CACHE[$arOrder["STATUS_ID"]]))
87 {
88 if ($arStatus = CSaleStatus::GetByID($arOrder["STATUS_ID"]))
89 $LOCAL_STATUS_CACHE[$arOrder["STATUS_ID"]] = htmlspecialcharsEx($arStatus["NAME"]);
90 }
91
92 echo "[".$arOrder["STATUS_ID"]."] ".$LOCAL_STATUS_CACHE[$arOrder["STATUS_ID"]]." ";
93 echo $arOrder["DATE_STATUS"];
94 break;
95 case "PAY_VOUCHER_NUM":
96 echo $arOrder["PAY_VOUCHER_NUM"];
97 break;
98 case "PAY_VOUCHER_DATE":
99 echo $arOrder["PAY_VOUCHER_DATE"];
100 break;
101 case "DELIVERY_DOC_NUM":
102 echo $arOrder["DELIVERY_DOC_NUM"];
103 break;
104 case "DELIVERY_DOC_DATE":
105 echo $arOrder["DELIVERY_DOC_DATE"];
106 break;
107 case "PRICE_DELIVERY":
108 echo SaleFormatCurrency($arOrder["PRICE_DELIVERY"], $arOrder["CURRENCY"]);
109 break;
110 case "ALLOW_DELIVERY":
111 echo (($arOrder["ALLOW_DELIVERY"] == "Y") ? GetMessage("SEXE_YES") : GetMessage("SEXE_NO"))." ";
112 echo $arOrder["DATE_ALLOW_DELIVERY"];
113 break;
114 case "PRICE":
115 echo SaleFormatCurrency($arOrder["PRICE"], $arOrder["CURRENCY"]);
116 break;
117 case "SUM_PAID":
118 echo SaleFormatCurrency($arOrder["SUM_PAID"], $arOrder["CURRENCY"]);
119 break;
120 case "USER":
121 if (!isset($LOCAL_PAYED_USER_CACHE[$arOrder["USER_ID"]])
122 || !is_array($LOCAL_PAYED_USER_CACHE[$arOrder["USER_ID"]]))
123 {
124 $dbUser = CUser::GetByID($arOrder["USER_ID"]);
125 if ($arUser = $dbUser->Fetch())
126 $LOCAL_PAYED_USER_CACHE[$arOrder["USER_ID"]] = htmlspecialcharsEx($arUser["NAME"].(($arUser["NAME"] == '' || $arUser["LAST_NAME"] == '') ? "" : " ").$arUser["LAST_NAME"]." (".$arUser["LOGIN"].")");
127 }
128 echo "[".$arOrder["USER_ID"]."] ";
129 echo $LOCAL_PAYED_USER_CACHE[$arOrder["USER_ID"]];
130 break;
131 case "PAY_SYSTEM":
132 if (intval($arOrder["PAY_SYSTEM_ID"]) > 0)
133 {
134 if (!isset($LOCAL_PAY_SYSTEM_CACHE[$arOrder["PAY_SYSTEM_ID"]])
135 || !is_array($LOCAL_PAY_SYSTEM_CACHE[$arOrder["PAY_SYSTEM_ID"]]))
136 {
137 if ($arPaySys = CSalePaySystem::GetByID($arOrder["PAY_SYSTEM_ID"]))
138 $LOCAL_PAY_SYSTEM_CACHE[$arOrder["PAY_SYSTEM_ID"]] = htmlspecialcharsEx($arPaySys["NAME"]);
139 }
140
141 echo "[".$arOrder["PAY_SYSTEM_ID"]."] ".$LOCAL_PAY_SYSTEM_CACHE[$arOrder["PAY_SYSTEM_ID"]];
142 }
143 break;
144 case "DELIVERY":
145 if (intval($arOrder["DELIVERY_ID"]) > 0)
146 {
147 if (!isset($LOCAL_DELIVERY_CACHE[$arOrder["DELIVERY_ID"]])
148 || !is_array($LOCAL_DELIVERY_CACHE[$arOrder["DELIVERY_ID"]]))
149 {
150 if ($arDelivery = CSaleDelivery::GetByID($arOrder["DELIVERY_ID"]))
151 $LOCAL_DELIVERY_CACHE[$arOrder["DELIVERY_ID"]] = htmlspecialcharsEx($arDelivery["NAME"]);
152 }
153
154 echo "[".$arOrder["DELIVERY_ID"]."] ".$LOCAL_DELIVERY_CACHE[$arOrder["DELIVERY_ID"]];
155 }
156 break;
157 case "DATE_UPDATE":
158 echo $arOrder["DATE_UPDATE"];
159 break;
160 case "PS_STATUS":
161 if ($arOrder["PS_STATUS"] == "Y")
162 echo GetMessage("SEXE_SUCCESS")." ".$arOrder["PS_RESPONSE_DATE"];
163 elseif ($arOrder["PS_STATUS"] == "N")
164 echo GetMessage("SEXE_UNSUCCESS")." ".$arOrder["PS_RESPONSE_DATE"];
165 else
166 echo GetMessage("SEXE_NONE");
167 break;
168 case "PS_SUM":
169 echo SaleFormatCurrency($arOrder["PS_SUM"], $arOrder["PS_CURRENCY"]);
170 break;
171 case "TAX_VALUE":
172 echo SaleFormatCurrency($arOrder["TAX_VALUE"], $arOrder["CURRENCY"]);
173 break;
174 case "BASKET":
175 $bNeedLine = False;
176 $dbItemsList = CSaleBasket::GetList(
177 array("NAME" => "ASC"),
178 array("ORDER_ID" => $arOrder["ID"])
179 );
180 while ($arItem = $dbItemsList->Fetch())
181 {
182 if ($bNeedLine)
183 echo "\n";
184 $bNeedLine = True;
185
186 echo "[".$arItem["PRODUCT_ID"]."] ";
187 echo $arItem["NAME"];
188 echo " (".$arItem["QUANTITY"].GetMessage("SEXE_SHT");
189 }
190 break;
191 }
192 ?>
193 </td>
194 <?
195 }
196 ?>
197 </tr>
198 <?
200 ?>
201</table>
202
203<?
204
205$content = ob_get_contents();
206ob_end_clean();
207
208header('Pragma: public');
209header('Cache-control: private');
210header('Accept-Ranges: bytes');
211header('Content-Length: '.mb_strlen($content));
212header("Content-Type: application/vnd.ms-excel");
213header('Content-Disposition: attachment; filename=excel_dump.xls');
214
215echo $content;
216?>
static GetByID($ID)
Определения delivery.php:249
static GetByID($id, $personTypeId=0)
Определения pay_system.php:82
static GetByID($ID)
Определения person_type.php:69
static GetByID($ID)
Определения site.php:749
static GetByID($ID)
Определения user.php:3820
Определения basket.php:8
static GetList($arOrder=array("ID"=>"DESC"), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array(), $arOptions=array())
Определения order.php:339
static GetByID($statusId, $languageId=LANGUAGE_ID, $type=null)
Определения status.php:23
if(!empty($by)) $dbOrderList
Определения commerceml.php:40
while( $arBasket=$dbBasket->Fetch())
Определения commerceml.php:73
$content
Определения commerceml.php:144
if(!in_array("BC". $f_USER_ID, $arContra)) endwhile
Определения commerceml.php:102
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
if(preg_match('/^ else[a-z0-9_]{2}$/i', $siteID)===1)
Определения cron_frame.php:23
htmlspecialcharsEx($str)
Определения tools.php:2685
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
Определения tools.php:3778
GetMessage($name, $aReplace=null)
Определения tools.php:3397
$order
Определения payment.php:8
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
die
Определения quickway.php:367
$i
Определения factura.php:643
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
Определения waybill.php:936
SaleFormatCurrency($fSum, $strCurrency, $OnlyValue=false, $withoutFormat=false)
Определения include.php:142
$arFilter
Определения user_search.php:106
switch( $_REQUEST[ 'bxsender'])().Authorize(<? break
Определения wrapper_popup.php:7