<?php
/* Smarty version 4.5.6, created on 2026-01-17 14:11:31
  from '/var/www/html/tivi/panel/templates/profile/edit.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.5.6',
  'unifunc' => 'content_696b8a83b0dcd9_34126599',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'c66ca1a6f8580b6cb71cc0024b19725ab3f027ff' => 
    array (
      0 => '/var/www/html/tivi/panel/templates/profile/edit.tpl',
      1 => 1766254413,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_696b8a83b0dcd9_34126599 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_loadInheritance();
$_smarty_tpl->inheritance->init($_smarty_tpl, true);
?>


<?php 
$_smarty_tpl->inheritance->instanceBlock($_smarty_tpl, 'Block_1939469262696b8a83af5529_07865253', "content");
?>

<?php $_smarty_tpl->inheritance->endChild($_smarty_tpl, "layout.tpl");
}
/* {block "content"} */
class Block_1939469262696b8a83af5529_07865253 extends Smarty_Internal_Block
{
public $subBlocks = array (
  'content' => 
  array (
    0 => 'Block_1939469262696b8a83af5529_07865253',
  ),
);
public function callBlock(Smarty_Internal_Template $_smarty_tpl) {
?>

<div class="container-fluid">
    <div class="d-flex justify-content-between align-items-center mb-4">
        <div>
            <h4 class="mb-1">Edycja profilu</h4>
            <p class="text-muted mb-0">Zaktualizuj swoje dane</p>
        </div>
        <a href="<?php echo $_smarty_tpl->tpl_vars['baseUrl']->value;?>
/profile" class="btn btn-outline-secondary">
            <i class="bi bi-arrow-left me-1"></i>Powrót
        </a>
    </div>

    <?php if ((($tmp = $_smarty_tpl->tpl_vars['error']->value ?? null)===null||$tmp==='' ? false ?? null : $tmp)) {?>
    <div class="alert alert-danger"><i class="bi bi-exclamation-circle me-2"></i><?php echo $_smarty_tpl->tpl_vars['error']->value;?>
</div>
    <?php }?>

    <div class="row g-4">
        <!-- Avatar -->
        <div class="col-lg-4">
            <div class="card">
                <div class="card-header">
                    <h5 class="card-title mb-0"><i class="bi bi-image me-2"></i>Avatar</h5>
                </div>
                <div class="card-body text-center">
                    <div class="mb-3">
                        <?php if ($_smarty_tpl->tpl_vars['profile']->value['avatar']) {?>
                        <img src="/uploads/avatars/<?php echo $_smarty_tpl->tpl_vars['profile']->value['avatar'];?>
" class="rounded-circle" style="width: 150px; height: 150px; object-fit: cover;">
                        <?php } else { ?>
                        <div class="rounded-circle bg-primary bg-opacity-10 d-inline-flex align-items-center justify-content-center" style="width: 150px; height: 150px;">
                            <i class="bi bi-person text-primary" style="font-size: 5rem;"></i>
                        </div>
                        <?php }?>
                    </div>
                    
                    <form method="post" action="<?php echo $_smarty_tpl->tpl_vars['baseUrl']->value;?>
/profile/avatar/upload" enctype="multipart/form-data" class="mb-2">
                        <input type="hidden" name="csrf_token" value="<?php echo $_smarty_tpl->tpl_vars['csrfToken']->value;?>
">
                        <div class="input-group">
                            <input type="file" name="avatar" class="form-control form-control-sm" accept="image/*" required>
                            <button type="submit" class="btn btn-sm btn-primary">Wyślij</button>
                        </div>
                        <small class="text-muted">Max 2MB, JPG/PNG/GIF/WEBP</small>
                    </form>
                    
                    <?php if ($_smarty_tpl->tpl_vars['profile']->value['avatar']) {?>
                    <form method="post" action="<?php echo $_smarty_tpl->tpl_vars['baseUrl']->value;?>
/profile/avatar/remove">
                        <input type="hidden" name="csrf_token" value="<?php echo $_smarty_tpl->tpl_vars['csrfToken']->value;?>
">
                        <button type="submit" class="btn btn-sm btn-outline-danger" onclick="return confirm('Usunąć avatar?')">
                            <i class="bi bi-trash me-1"></i>Usuń avatar
                        </button>
                    </form>
                    <?php }?>
                </div>
            </div>

            <!-- Zmiana hasła -->
            <div class="card mt-4">
                <div class="card-header">
                    <h5 class="card-title mb-0"><i class="bi bi-key me-2"></i>Zmiana hasła</h5>
                </div>
                <div class="card-body">
                    <a href="<?php echo $_smarty_tpl->tpl_vars['baseUrl']->value;?>
/change-password" class="btn btn-outline-primary w-100">
                        <i class="bi bi-key me-1"></i>Zmień hasło
                    </a>
                </div>
            </div>
        </div>

        <!-- Formularz profilu -->
        <div class="col-lg-8">
            <form method="post">
                <input type="hidden" name="csrf_token" value="<?php echo $_smarty_tpl->tpl_vars['csrfToken']->value;?>
">

                <div class="card">
                    <div class="card-header">
                        <h5 class="card-title mb-0"><i class="bi bi-person me-2"></i>Dane podstawowe</h5>
                    </div>
                    <div class="card-body">
                        <div class="row g-3">
                            <div class="col-md-6">
                                <label class="form-label">Imię i nazwisko</label>
                                <input type="text" name="full_name" class="form-control" value="<?php echo (($tmp = $_smarty_tpl->tpl_vars['profile']->value['full_name'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp);?>
">
                            </div>
                            <div class="col-md-6">
                                <label class="form-label">Firma</label>
                                <input type="text" name="company" class="form-control" value="<?php echo (($tmp = $_smarty_tpl->tpl_vars['profile']->value['company'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp);?>
">
                            </div>
                            <div class="col-md-6">
                                <label class="form-label">Email</label>
                                <input type="email" name="email" class="form-control" value="<?php echo (($tmp = $_smarty_tpl->tpl_vars['profile']->value['email'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp);?>
">
                            </div>
                            <div class="col-md-6">
                                <label class="form-label">Telefon</label>
                                <input type="text" name="phone" class="form-control" value="<?php echo (($tmp = $_smarty_tpl->tpl_vars['profile']->value['phone'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp);?>
">
                            </div>
                            <div class="col-12">
                                <label class="form-label">Adres</label>
                                <textarea name="address" class="form-control" rows="2"><?php echo (($tmp = $_smarty_tpl->tpl_vars['profile']->value['address'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp);?>
</textarea>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="card mt-4">
                    <div class="card-header">
                        <h5 class="card-title mb-0"><i class="bi bi-gear me-2"></i>Preferencje</h5>
                    </div>
                    <div class="card-body">
                        <div class="row g-3">
                            <div class="col-md-4">
                                <label class="form-label">Strefa czasowa</label>
                                <select name="timezone" class="form-select">
                                    <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['timezones']->value, 'label', false, 'tz');
$_smarty_tpl->tpl_vars['label']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['tz']->value => $_smarty_tpl->tpl_vars['label']->value) {
$_smarty_tpl->tpl_vars['label']->do_else = false;
?>
                                    <option value="<?php echo $_smarty_tpl->tpl_vars['tz']->value;?>
" <?php if ($_smarty_tpl->tpl_vars['profile']->value['timezone'] == $_smarty_tpl->tpl_vars['tz']->value) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['label']->value;?>
</option>
                                    <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                                </select>
                            </div>
                            <div class="col-md-4">
                                <label class="form-label">Język</label>
                                <select name="language" class="form-select">
                                    <option value="pl" <?php if ($_smarty_tpl->tpl_vars['profile']->value['language'] == 'pl') {?>selected<?php }?>>Polski</option>
                                    <option value="en" <?php if ($_smarty_tpl->tpl_vars['profile']->value['language'] == 'en') {?>selected<?php }?>>English</option>
                                </select>
                            </div>
                            <div class="col-md-4">
                                <label class="form-label">Motyw</label>
                                <select name="theme" class="form-select">
                                    <option value="dark" <?php if ($_smarty_tpl->tpl_vars['profile']->value['theme'] == 'dark') {?>selected<?php }?>>Ciemny</option>
                                    <option value="light" <?php if ($_smarty_tpl->tpl_vars['profile']->value['theme'] == 'light') {?>selected<?php }?>>Jasny</option>
                                </select>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="card mt-4">
                    <div class="card-header">
                        <h5 class="card-title mb-0"><i class="bi bi-bell me-2"></i>Powiadomienia</h5>
                    </div>
                    <div class="card-body">
                        <div class="form-check mb-2">
                            <input type="checkbox" name="notifications_email" class="form-check-input" id="notifEmail" value="1"
                                   <?php if ($_smarty_tpl->tpl_vars['profile']->value['notifications_email']) {?>checked<?php }?>>
                            <label class="form-check-label" for="notifEmail">Powiadomienia email</label>
                        </div>
                        <div class="form-check">
                            <input type="checkbox" name="notifications_browser" class="form-check-input" id="notifBrowser" value="1"
                                   <?php if ($_smarty_tpl->tpl_vars['profile']->value['notifications_browser']) {?>checked<?php }?>>
                            <label class="form-check-label" for="notifBrowser">Powiadomienia w przeglądarce</label>
                        </div>
                    </div>
                </div>

                <div class="mt-4">
                    <button type="submit" class="btn btn-primary">
                        <i class="bi bi-check-lg me-1"></i>Zapisz zmiany
                    </button>
                    <a href="<?php echo $_smarty_tpl->tpl_vars['baseUrl']->value;?>
/profile" class="btn btn-outline-secondary ms-2">Anuluj</a>
                </div>
            </form>
        </div>
    </div>
</div>
<?php
}
}
/* {/block "content"} */
}
