<?php
namespace admin\controls;
class ShopClients
{
  public static function view_list()
  {
    return \Tpl::view(
        'shop-clients/view-list'
    );
  }

  public static function clients_details()
  {
    $query_string = $_SERVER['REDIRECT_QUERY_STRING'];
    parse_str($query_string, $query_array);

    $orders_info = \admin\factory\ShopClients::get_order_all_info( $query_array['name'], $query_array['surname'], $query_array['email'] );

    return \Tpl::view('shop-clients/clients-details', [
      'name' => $query_array['name'],
      'surname' => $query_array['surname'],
      'email' => $query_array['email'],
      'total_spent' => $query_array['total_spent'],
      'orders_info' => $orders_info
    ]);
  }
}
?>