app/template/admin/Customer/index.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  4. http://www.ec-cube.co.jp/
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. #}
  8. {% extends '@admin/default_frame.twig' %}
  9. {% set menus = ['customer', 'customer_master'] %}
  10. {% block title %}{{ 'admin.customer.customer_list'|trans }}{% endblock %}
  11. {% block sub_title %}{{ 'admin.customer.customer_management'|trans }}{% endblock %}
  12. {% form_theme searchForm '@admin/Form/bootstrap_4_horizontal_layout.html.twig' %}
  13. {% block main %}
  14.     <form name="search_form" id="search_form" method="post" action="">
  15.         {{ form_widget(searchForm._token) }}
  16.         <div class="c-outsideBlock">
  17.             <div class="c-outsideBlock__contents">
  18.                 <div class="row justify-content-start">
  19.                     <div class="col-6">
  20.                         <div class="mb-2">
  21.                             <label class="col-form-label" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'tooltip.customer.multi_search_label'|trans }}">{{ 'admin.customer.multi_search_label'|trans }}<i class="fa fa-question-circle fa-lg ms-1"></i></label>
  22.                             {{ form_widget(searchForm.multi) }}
  23.                             {{ form_errors(searchForm.multi) }}
  24.                         </div>
  25.                         <div class="d-inline-block mb-3 collapsed" data-bs-toggle="collapse" href="#searchDetail" aria-expanded="false" aria-controls="searchDetail"><a><i class="fa fw-bold me-1 fa-plus-square-o"></i><span class="fw-bold">{{ 'admin.common.search_detail'|trans }}</span></a></div>
  26.                     </div>
  27.                 </div>
  28.             </div>
  29.             <div class="c-subContents ec-collapse collapse{{ has_errors ? ' show' }}" id="searchDetail">
  30.                 <div class="row mb-2">
  31.                     <div class="col">
  32.                         <div class="row">
  33.                             <div class="col-12">
  34.                                 <p class="col-form-label">{{ 'admin.customer.customer_status'|trans }}</p>
  35.                                 {{ form_widget(searchForm.customer_status, { 'label_attr': { 'class': 'checkbox-inline'}}) }}
  36.                                 {{ form_errors(searchForm.customer_status) }}
  37.                             </div>
  38.                         </div>
  39.                     </div>
  40.                     <div class="col">
  41.                         <div>
  42.                             <label>{{ 'admin.order.purchase_product'|trans }}</label>
  43.                             {{ form_widget(searchForm.buy_product_name) }}
  44.                             {{ form_errors(searchForm.buy_product_name) }}
  45.                         </div>
  46.                     </div>
  47.                 </div>
  48.                 <div class="row mb-2">
  49.                     <div class="col">
  50.                         <div class="row">
  51.                             <div class="col-12">
  52.                                 <p class="col-form-label">{{ 'admin.common.gender'|trans }}</p>
  53.                                 {{ form_widget(searchForm.sex, { 'label_attr': { 'class': 'checkbox-inline'}}) }}
  54.                                 {{ form_errors(searchForm.sex) }}
  55.                             </div>
  56.                         </div>
  57.                     </div>
  58.                     <div class="col">
  59.                         <div>
  60.                             <label>{{ 'admin.order.purchase_price'|trans }}</label>
  61.                             <div class="row align-items-center">
  62.                                 <div class="col">
  63.                                     {{ form_widget(searchForm.buy_total_start) }}
  64.                                     {{ form_errors(searchForm.buy_total_start) }}
  65.                                 </div>
  66.                                 <div class="col-auto text-center"><span>{{ 'admin.common.separator__range'|trans }}</span></div>
  67.                                 <div class="col">
  68.                                     {{ form_widget(searchForm.buy_total_end) }}
  69.                                     {{ form_errors(searchForm.buy_total_end) }}
  70.                                 </div>
  71.                             </div>
  72.                         </div>
  73.                     </div>
  74.                 </div>
  75.                 <div class="row mb-2">
  76.                     <div class="col">
  77.                         <div>
  78.                             <label>{{ 'admin.customer.birth_month'|trans }}</label>
  79.                             <div class="row">
  80.                                 <div class="col-5">
  81.                                     {{ form_widget(searchForm.birth_month) }}
  82.                                     {{ form_errors(searchForm.birth_month) }}
  83.                                 </div>
  84.                                 <div class="col-7"></div>
  85.                             </div>
  86.                         </div>
  87.                     </div>
  88.                     <div class="col">
  89.                         <div>
  90.                             <label>{{ 'admin.order.purchase_count'|trans }}</label>
  91.                             <div class="row align-items-center">
  92.                                 <div class="col">
  93.                                     {{ form_widget(searchForm.buy_times_start) }}
  94.                                     {{ form_errors(searchForm.buy_times_start) }}
  95.                                 </div>
  96.                                 <div class="col-auto text-center"><span>{{ 'admin.common.separator__range'|trans }}</span></div>
  97.                                 <div class="col">
  98.                                     {{ form_widget(searchForm.buy_times_end) }}
  99.                                     {{ form_errors(searchForm.buy_times_end) }}
  100.                                 </div>
  101.                             </div>
  102.                         </div>
  103.                     </div>
  104.                 </div>
  105.                 <div class="row mb-2">
  106.                     <div class="col">
  107.                         <div>
  108.                             <label>{{ 'admin.common.birth_day'|trans }}</label>
  109.                             <div class="row align-items-center">
  110.                                 <div class="col">
  111.                                     {{ form_widget(searchForm.birth_start) }}
  112.                                     {{ form_errors(searchForm.birth_start) }}
  113.                                 </div>
  114.                                 <div class="col-auto text-center"><span>{{ 'admin.common.separator__range'|trans }}</span></div>
  115.                                 <div class="col">
  116.                                     {{ form_widget(searchForm.birth_end) }}
  117.                                     {{ form_errors(searchForm.birth_end) }}
  118.                                 </div>
  119.                             </div>
  120.                         </div>
  121.                     </div>
  122.                     <div class="col">
  123.                         <div>
  124.                             <label>{{ 'admin.common.create_date'|trans }}</label>
  125.                             <div class="row align-items-center">
  126.                                 <div class="col">
  127.                                     {{ form_widget(searchForm.create_datetime_start) }}
  128.                                     {{ form_errors(searchForm.create_datetime_start) }}
  129.                                 </div>
  130.                                 <div class="col-auto text-center"><span>{{ 'admin.common.separator__range'|trans }}</span></div>
  131.                                 <div class="col">
  132.                                     {{ form_widget(searchForm.create_datetime_end) }}
  133.                                     {{ form_errors(searchForm.create_datetime_end) }}
  134.                                 </div>
  135.                             </div>
  136.                         </div>
  137.                     </div>
  138.                 </div>
  139.                 <div class="row mb-2">
  140.                     <div class="col">
  141.                         <div>
  142.                             <label>{{ 'admin.common.pref'|trans }}</label>
  143.                             <div class="row">
  144.                                 <div class="col-5">
  145.                                     {{ form_widget(searchForm.pref) }}
  146.                                     {{ form_errors(searchForm.pref) }}
  147.                                 </div>
  148.                                 <div class="col-7"></div>
  149.                             </div>
  150.                         </div>
  151.                     </div>
  152.                     <div class="col">
  153.                         <div>
  154.                             <label>{{ 'admin.common.update_date'|trans }}</label>
  155.                             <div class="row align-items-center">
  156.                                 <div class="col">
  157.                                     {{ form_widget(searchForm.update_datetime_start) }}
  158.                                     {{ form_errors(searchForm.update_datetime_start) }}
  159.                                 </div>
  160.                                 <div class="col-auto text-center"><span>{{ 'admin.common.separator__range'|trans }}</span></div>
  161.                                 <div class="col">
  162.                                     {{ form_widget(searchForm.update_datetime_end) }}
  163.                                     {{ form_errors(searchForm.update_datetime_end) }}
  164.                                 </div>
  165.                             </div>
  166.                         </div>
  167.                     </div>
  168.                 </div>
  169.                 <div class="row mb-2">
  170.                     <div class="col">
  171.                         <div class="mb-3">
  172.                             <label>{{ 'admin.common.phone_number'|trans }}</label>
  173.                             {{ form_widget(searchForm.phone_number) }}
  174.                             {{ form_errors(searchForm.phone_number) }}
  175.                         </div>
  176.                     </div>
  177.                     <div class="col">
  178.                         <div>
  179.                             <label>{{ 'admin.order.last_buy_date'|trans }}</label>
  180.                             <div class="row align-items-center">
  181.                                 <div class="col">
  182.                                     {{ form_widget(searchForm.last_buy_start) }}
  183.                                     {{ form_errors(searchForm.last_buy_start) }}
  184.                                 </div>
  185.                                 <div class="col-auto text-center"><span>{{ 'admin.common.separator__range'|trans }}</span></div>
  186.                                 <div class="col">
  187.                                     {{ form_widget(searchForm.last_buy_end) }}
  188.                                     {{ form_errors(searchForm.last_buy_end) }}
  189.                                 </div>
  190.                             </div>
  191.                         </div>
  192.                     </div>
  193.                 </div>
  194.                 {# エンティティ拡張の自動出力 #}
  195.                 {% for f in searchForm|filter(f => f.vars.eccube_form_options.auto_render) %}
  196.                     {# TODO 1項目1行になるのを改善 #}
  197.                     <div class="row mb-2">
  198.                         {% if f.vars.eccube_form_options.form_theme %}
  199.                             {% form_theme f f.vars.eccube_form_options.form_theme %}
  200.                             {{ form_row(f) }}
  201.                         {% else %}
  202.                             <div class="col">
  203.                                 <div class="mb-3">
  204.                                     <label>{{ f.vars.label|trans }}</label>
  205.                                     {{ form_widget(f) }}
  206.                                     {{ form_errors(f) }}
  207.                                 </div>
  208.                             </div>
  209.                         {% endif %}
  210.                     </div>
  211.                 {% endfor %}
  212.             </div>
  213.             {{ form_widget(searchForm.sortkey, {'attr': {'class': 'js-listSort-key'}}) }}
  214.             {{ form_widget(searchForm.sorttype, {'attr': {'class': 'js-listSort-type'}}) }}
  215.         </div>
  216.         <div class="c-outsideBlock__contents mb-5">
  217.             <button type="submit" class="btn btn-ec-conversion px-5">{{ 'admin.common.search'|trans }}</button>
  218.             {% if pagination %}
  219.                 <span class="fw-bold ms-2">{{ 'admin.common.search_result'|trans({'%count%':pagination.totalItemCount}) }}</span>
  220.             {% endif %}
  221.         </div>
  222.         <div class="c-outsideBlock__contents mb-5">
  223.             {{ include('@admin/search_items.twig', { 'form': searchForm }, ignore_missing = true) }}
  224.         </div>
  225.         <div class="c-contentsArea__cols">
  226.             <div class="c-contentsArea__primaryCol">
  227.                 <div class="c-primaryCol">
  228.                     {% if pagination and pagination.totalItemCount %}
  229.                         <div class="row justify-content-between mb-2">
  230.                             <div class="col-6"></div>
  231.                             <div class="col-5 text-end">
  232.                                 {#Dropdown page count#}
  233.                                 <div class="d-inline-block me-2 align-bottom">
  234.                                     <select class="form-select" onchange="location = this.value;">
  235.                                         {% for pageMax in pageMaxis %}
  236.                                             <option {% if pageMax.name == page_count %} selected {% endif %}
  237.                                                     value="{{ path('admin_customer_page', {'page_no': 1, 'page_count': pageMax.name }) }}">
  238.                                                 {{ 'admin.common.count'|trans({ '%count%': pageMax.name }) }}</option>
  239.                                         {% endfor %}
  240.                                     </select>
  241.                                 </div>
  242.                                 <div class="d-inline-block">
  243.                                     <div class="btn-group" role="group">
  244.                                         <a class="btn btn-ec-regular" href="{{ url('admin_customer_export') }}"><i class="fa fa-cloud-download me-1 text-secondary"></i><span>{{ 'admin.common.csv_download'|trans }}</span></a>
  245.                                         <a class="btn btn-ec-regular" href="{{ url('admin_setting_shop_csv', { id : constant('\\Eccube\\Entity\\Master\\CsvType::CSV_TYPE_CUSTOMER') }) }}"><i class="fa fa-cog me-1 text-secondary"></i><span>{{ 'admin.setting.shop.csv_setting'|trans }}</span></a>
  246.                                     </div>
  247.                                 </div>
  248.                             </div>
  249.                         </div>
  250.                         <div class="card rounded border-0 mb-4 d-block">
  251.                             <div class="card-body p-0">
  252.                                 <table class="table">
  253.                                     <thead>
  254.                                     <tr>
  255.                                         <th class="border-top-0 pt-2 pb-3 ps-3 text-nowrap">{{ 'admin.customer.customer_id'|trans }}<a href="#" class="js-listSort" data-sortkey="customer_id"><i class="fa fa-arrow-up" aria-hidden="true"></i></a></th>
  256.                                         <th class="border-top-0 pt-2 pb-3">{{ 'admin.common.name'|trans }}<a href="#" class="js-listSort" data-sortkey="name"><i class="fa fa-arrow-up" aria-hidden="true"></i></a></th>
  257.                                         <th class="border-top-0 pt-2 pb-3">{{ 'admin.common.phone_number'|trans }}</th>
  258.                                         <th class="border-top-0 pt-2 pb-3">{{ 'admin.common.mail_address'|trans }}</th>
  259.                                         <th class="border-top-0 pt-2 pb-3">&nbsp;</th>
  260.                                         <th class="border-top-0 pt-2 pb-3 pe-3">&nbsp;</th>
  261.                                     </tr>
  262.                                     </thead>
  263.                                     <tbody>
  264.                                     {% for Customer in pagination %}
  265.                                         <tr id="ex-customer-{{ Customer.id }}">
  266.                                             <td class="align-middle ps-3">{{ Customer.id }}</td>
  267.                                             <td class="align-middle"><a href="{{ url('admin_customer_edit', { 'id': Customer.id}) }}">{{ Customer.name01 }}&nbsp;{{ Customer.name02 }}</a></td>
  268.                                             <td class="align-middle">{{ Customer.phone_number }}</td>
  269.                                             <td class="align-middle">{{ Customer.email }}</td>
  270.                                             <td class="align-middle"></td>
  271.                                             <td class="align-middle pe-3">
  272.                                                 <div class="text-end">
  273.                                                     {% if Customer.Status.id == constant('Eccube\\Entity\\Master\\CustomerStatus::PROVISIONAL') %}
  274.                                                         <div class="px-1 d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'admin.customer.resend'|trans }}">
  275.                                                             <a class="btn btn-ec-actionIcon" data-bs-toggle="modal" data-bs-target="#discontinuance_cus_{{ Customer.id }}">
  276.                                                                 <i class="fa fa-send fa-lg text-secondary" aria-hidden="true"></i>
  277.                                                             </a>
  278.                                                         </div>
  279.                                                         <div class="modal fade" id="discontinuance_cus_{{ Customer.id }}" tabindex="-1" role="dialog" aria-labelledby="discontinuance" aria-hidden="true">
  280.                                                             <div class="modal-dialog" role="document">
  281.                                                                 <div class="modal-content">
  282.                                                                     <div class="modal-header">
  283.                                                                         <h5 class="modal-title fw-bold">{{ 'admin.customer.resend_confirm_title'|trans }}</h5>
  284.                                                                         <button class="btn-close" type="button" data-bs-dismiss="modal" aria-label="Close">
  285.                                                                         </button>
  286.                                                                     </div>
  287.                                                                     <div class="modal-body text-start">
  288.                                                                         <p class="text-start">{{ 'admin.customer.resend_confirm_message'|trans }}</p>
  289.                                                                     </div>
  290.                                                                     <div class="modal-footer">
  291.                                                                         <button class="btn btn-ec-sub" type="button" data-bs-dismiss="modal">{{ 'admin.common.cancel'|trans }}</button>
  292.                                                                         {# TODO: CSSの変更は別タスクでやります #}
  293.                                                                         <a class="btn btn-ec-delete" href="{{ url('admin_customer_resend', {'id' : Customer.id}) }}" {{ csrf_token_for_anchor() }} data-method="get" data-confirm="false">
  294.                                                                             {{ 'admin.common.send'|trans }}
  295.                                                                         </a>
  296.                                                                     </div>
  297.                                                                 </div>
  298.                                                             </div>
  299.                                                         </div>
  300.                                                     {% endif %}
  301.                                                     <div class="px-1 d-inline-block" data-bs-toggle="tooltip" data-bs-placement="top" title="{{ 'admin.common.delete'|trans }}">
  302.                                                         <a class="btn btn-ec-actionIcon" data-bs-toggle="modal" data-bs-target="#discontinuance-{{ Customer.id }}">
  303.                                                             <i class="fa fa-close fa-lg text-secondary" aria-hidden="true"></i>
  304.                                                         </a>
  305.                                                     </div>
  306.                                                     <div class="modal fade" id="discontinuance-{{ Customer.id }}" tabindex="-1" role="dialog" aria-labelledby="discontinuance" aria-hidden="true">
  307.                                                         <div class="modal-dialog" role="document">
  308.                                                             <div class="modal-content">
  309.                                                                 <div class="modal-header">
  310.                                                                     <h5 class="modal-title fw-bold">
  311.                                                                         {{ 'admin.common.delete_modal__title'|trans }}</h5>
  312.                                                                     <button class="btn-close" type="button" data-bs-dismiss="modal" aria-label="Close">
  313.                                                                     </button>
  314.                                                                 </div>
  315.                                                                 <div class="modal-body text-start">
  316.                                                                     <p class="text-start">
  317.                                                                         {{ 'admin.common.delete_modal__message'|trans({ '%name%' : Customer.email }) }}</p>
  318.                                                                 </div>
  319.                                                                 <div class="modal-footer">
  320.                                                                     <button class="btn btn-ec-sub" type="button" data-bs-dismiss="modal">
  321.                                                                         {{ 'admin.common.cancel'|trans }}
  322.                                                                     </button>
  323.                                                                     <a href="{{ url('admin_customer_delete', {'id' : Customer.id}) }}" class="btn btn-ec-delete"{{ csrf_token_for_anchor() }} data-method="delete" data-confirm="false">
  324.                                                                         {{ 'admin.common.delete'|trans }}
  325.                                                                     </a>
  326.                                                                 </div>
  327.                                                             </div>
  328.                                                         </div>
  329.                                                     </div>
  330.                                                 </div><!-- /.text-end -->
  331.                                             </td>
  332.                                         </tr>
  333.                                     {% endfor %}
  334.                                     </tbody>
  335.                                 </table>
  336.                                 <div class="row justify-content-md-center pb-4 mb-4">
  337.                                     {% if pagination.totalItemCount > 0 %}
  338.                                         {% include "@admin/pager.twig" with { 'pages' : pagination.paginationData, 'routes' : 'admin_customer_page' } %}
  339.                                     {% endif %}
  340.                                 </div>
  341.                             </div>
  342.                         </div>
  343.                     {% elseif has_errors %}
  344.                         <div class="card rounded border-0">
  345.                             <div class="card-body p-4">
  346.                                 <div class="text-center text-muted mb-4 h5">{{ 'admin.common.search_invalid_condition'|trans }}</div>
  347.                                 <div class="text-center text-muted">{{ 'admin.common.search_try_change_condition'|trans }}</div>
  348.                             </div>
  349.                         </div>
  350.                     {% else %}
  351.                         <div class="card rounded border-0">
  352.                             <div class="card-body p-4">
  353.                                 <div class="text-center text-muted mb-4 h5">{{ 'admin.common.search_no_result'|trans }}</div>
  354.                                 <div class="text-center text-muted">{{ 'admin.common.search_try_change_condition'|trans }}</div>
  355.                                 <div class="text-center text-muted">{{ 'admin.common.search_try_advanced_search'|trans }}</div>
  356.                             </div>
  357.                         </div>
  358.                     {% endif %}
  359.                 </div>
  360.             </div>
  361.         </div>
  362.     </form>
  363. {% endblock %}