<?
global $db;
ob_start();
?>
<?= \Html::input( [
      'label'  => 'Nazwa',
      'name'   => 'firm',
      'id'     => 'firm',
      'value'  => $this -> client -> firm,
      'inline' => true
    ] );?>
<?= \Html::input( [
      'label'  => 'Nazwa firmy',
      'name'   => 'firm_name',
      'id'     => 'firm_name',
      'value'  => $this -> client -> firm_name,
      'inline' => true
    ] );?>
<?= \Html::input( [
      'label'  => 'Emaile',
      'name'   => 'emails',
      'id'     => 'emails',
      'value'  => $this -> client -> emails,
      'inline' => true
    ] );?>
<?= \Html::input( [
    'label'  => 'Telefony',
    'name'   => 'phones',
    'id'     => 'phones',
    'value'  => $this -> client -> phones,
    'inline' => true
  ] );?>
<?= \Html::textarea( [
      'label' => 'Notatki',
      'name'  => 'notes',
      'id'    => 'notes',
      'value' => $this -> client -> notes,
      'rows'  => 10
    ] );?>
<?
$out = ob_get_clean();

$grid = new \gridEdit;
$grid -> id = 'client-edit';
$grid -> gdb_opt = $gdb;
$grid -> include_plugins = true;
$grid -> title = 'edycja <strong>klient</strong>';
$grid -> title_small = 'Zarządzaj klientem';
$grid -> fields = [
    [
        'db'    => 'id',
        'type'  => 'hidden',
        'value' => $this -> client -> id
    ]
];
$grid -> external_code = $out;
$grid -> actions = [
    'save'   => [ 'url' => '/crm/client_save/', 'back_url' => '/crm/main_view/' ],
    'cancel' => [ 'url' => '/crm/main_view/' ]
];
$grid -> persist_edit = true;
$grid -> id_param = 'id';
echo $grid -> draw();
?>
<script type="text/javascript" src="/libraries/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/libraries/ckeditor/adapters/jquery.js"></script>
<script type="text/javascript">
  $(document).ready(function ()
  {
    $('textarea#notes').ckeditor({
      toolbar: 'Basic',
      language: 'pl',
      height: '100'
    });
  });
</script>