export.php
<? define("NO_KEEP_STATISTIC", true); define("NO_AGENT_STATISTIC", true); require_once($_SERVER["DOCUMENT_ROOT"] . '/bitrix/modules/main/include/prolog_before.php'); global $APPLICATION; $params = ["controller"=>"exportDealerClient"]; $APPLICATION->IncludeComponent("dealer:client", "europe", $params); require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_after.php"); |
шаблон вывода
customers.xls заменить на свое имя
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();?> <table cellpadding="0" cellspacing="0" border="1"> <thead> <tr> <th>ID</th> <th>Company</th> <th>Last Name</th> <th>Name</th> <th>Phone</th> <th>Comment</th> </tr> </thead> <tbody> <?foreach($arResult["clients"] as $client):?> <tr> <td><?php echo $client->getID()?></td> <td><?= $client->getWorkCompany() ?></td> <td><?= $client->getLastName()?></td> <td><?= $client->getName()?></td> <td><?= $client->getLogin()?></td> <td><?= $client->getPersonalPhone()?></td> <td><?= $client->getPersonalNotes()?></td> </tr> <?endforeach;?> </tbody> </table> <? header("Content-type: application/vnd.ms-excel"); header("Content-Disposition: attachment; filename=customers.xls");?> |