first commit
This commit is contained in:
36
templates/shop-client/address-edit.php
Normal file
36
templates/shop-client/address-edit.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<div class="client-panel address-edit box">
|
||||
<?= \front\view\ShopClient::client_menu( [
|
||||
'active_page' => 'addresses'
|
||||
] );?>
|
||||
<div class="box-title">
|
||||
<?= ucfirst( \S::lang( 'adresy-do-wysylki' ) );?>
|
||||
</div>
|
||||
<form method="POST" class="box-mini" action="/shopClient/address_save" id="f-new-address">
|
||||
<? if ( $this -> address['id'] ):?>
|
||||
<input type="hidden" name="address_id" value="<?= $this -> address['id'];?>">
|
||||
<? endif;?>
|
||||
<div class="form-group">
|
||||
<input type="text" name="name" required class="form-control" placeholder="<?= ucfirst( \S::lang( 'imie' ) );?>" value="<?= htmlspecialchars( $this -> address['name'] );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" name="surname" required class="form-control" placeholder="<?= ucfirst( \S::lang( 'nazwisko' ) );?>" value="<?= htmlspecialchars( $this -> address['surname'] );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" name="firm" class="form-control" placeholder="<?= ucfirst( \S::lang( 'firma' ) );?> (<?= \S::lang( 'opcjonalnie' );?>)" value="<?= htmlspecialchars( $this -> address['firm'] );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" name="street" required class="form-control" placeholder="<?= ucfirst( \S::lang( 'ulica-i-numer' ) );?>" value="<?= htmlspecialchars( $this -> address['street'] );?>">
|
||||
</div>
|
||||
<div class="form-group row-flex">
|
||||
<input type="text" name="postal_code" required class="form-control" pattern="[0-9]{2}-[0-9]{3}" title="Format xx-xxx" placeholder="<?= ucfirst( \S::lang( 'kod-pocztowy' ) );?>" value="<?= htmlspecialchars( $this -> address['postal_code'] );?>">
|
||||
<input type="text" name="city" required class="form-control" placeholder="<?= ucfirst( \S::lang( 'miejscowosc' ) );?>" value="<?= htmlspecialchars( $this -> address['city'] );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" name="phone" required class="form-control" placeholder="<?= ucfirst( \S::lang( 'numer-telefonu' ) );?>" value="<?= htmlspecialchars( $this -> address['phone'] );?>">
|
||||
</div>
|
||||
<div class="form-group row-flex">
|
||||
<a href="/panel-klienta/adresy" class="btn btn-dark"><?= ucfirst( \S::lang( 'anuluj' ) );?></a>
|
||||
<button type="submit" class="btn btn-success"><?= ucfirst( \S::lang( 'zapisz' ) );?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
72
templates/shop-client/client-addresses.php
Normal file
72
templates/shop-client/client-addresses.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<div class="client-panel client-addresses box">
|
||||
<?= \front\view\ShopClient::client_menu( [
|
||||
'active_page' => 'addresses'
|
||||
] );?>
|
||||
<div class="box-title">
|
||||
<?= ucfirst( \S::lang( 'adresy-do-wysylki' ) );?>
|
||||
</div>
|
||||
<a href="/panel-klienta/nowy-adres" class="btn btn-success btn-big"><?= ucfirst( \S::lang( 'dodaj-nowy-adres' ) );?></span></a>
|
||||
<? if ( is_array( $this -> addresses ) and count( $this -> addresses ) ):?>
|
||||
<div class="addresses">
|
||||
<? foreach ( $this -> addresses as $address ):?>
|
||||
<div class="address">
|
||||
<?= $address['name'] . ' ' . $address['surname'];?>
|
||||
<? if ( $address['firm'] ) echo '<br/>' . $address['firm'];?>
|
||||
<br/><?= $address['street'];?>
|
||||
<br/><?= $address['postal_code'] . ' ' . $address['city'];?>
|
||||
<br/><?= $address['phone'];?>
|
||||
<div class="buttons">
|
||||
<a href="/panel-klienta/edytuj-adres/<?= $address['id'];?>"><?= \S::lang( 'zmien' );?></a>
|
||||
<a href="/panel-klienta/usun-adres/<?= $address['id'];?>" class="btn-delete text-danger"><?= \S::lang( 'usun' );?></a>
|
||||
</div>
|
||||
</div>
|
||||
<? endforeach;?>
|
||||
</div>
|
||||
<? endif;?>
|
||||
</div>
|
||||
<script class="footer" type="text/javascript">
|
||||
$( function()
|
||||
{
|
||||
$( 'body' ).on( click_event, '.address .btn-delete', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
|
||||
var url = $( this ).attr( 'href' );
|
||||
|
||||
$.alert(
|
||||
{
|
||||
title: '<?= ucfirst( \S::lang( 'potwierdz' ) );?>',
|
||||
content: '<?= \S::lang( 'potwierdz-usuniecie-adresu' );?>',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fas fa-close',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
useBootstrap: false,
|
||||
theme: 'modern',
|
||||
autoClose: 'cancel|10000',
|
||||
icon: 'fas fa-exclamation',
|
||||
buttons:
|
||||
{
|
||||
confirm:
|
||||
{
|
||||
text: '<?= \S::lang( 'usun' );?>',
|
||||
btnClass: 'btn-orange',
|
||||
keys: ['enter'],
|
||||
action: function()
|
||||
{
|
||||
document.location.href = url;
|
||||
}
|
||||
},
|
||||
cancel:
|
||||
{
|
||||
text: '<?= \S::lang( 'zamknij' );?>',
|
||||
btnClass: 'btn-blue',
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
10
templates/shop-client/client-menu.php
Normal file
10
templates/shop-client/client-menu.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<div class="client-menu">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/panel-klienta/zamowienia" title="<?= \S::lang( 'historia-zamowien' );?>" class="btn btn-success <? if ( $this -> active_page == 'orders' ):?>active<? endif;?>"><?= \S::lang( 'historia-zamowien' );?></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/panel-klienta/adresy" title="<?= \S::lang( 'adresy' );?>" class="btn btn-success <? if ( $this -> active_page == 'addresses' ):?>active<? endif;?>"><?= \S::lang( 'adresy' );?></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
15
templates/shop-client/client-orders.php
Normal file
15
templates/shop-client/client-orders.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<? global $lang;?>
|
||||
<div class="client-panel client-orders-history box">
|
||||
<?= \front\view\ShopClient::client_menu( [
|
||||
'active_page' => 'orders'
|
||||
] );?>
|
||||
<div class="box-title">
|
||||
<?= ucfirst( \S::lang( 'historia-zamowien' ) );?>
|
||||
</div>
|
||||
<? if ( is_array( $this -> orders ) ): foreach ( $this -> orders as $order ):?>
|
||||
<?= \Tpl::view( 'shop-order/order-simple', [
|
||||
'order' => $order,
|
||||
'statuses' => \shop\Order::order_statuses()
|
||||
] );?>
|
||||
<? endforeach; endif;?>
|
||||
</div>
|
||||
21
templates/shop-client/login-form.php
Normal file
21
templates/shop-client/login-form.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<div class="user-login">
|
||||
<div class="content">
|
||||
<div class="box-title">
|
||||
<?= ucfirst( \S::lang( 'logowanie' ) );?>
|
||||
</div>
|
||||
<form method="POST" action="/shopClient/login">
|
||||
<input type="hidden" name="redirect" value="<?= $_SERVER['REQUEST_URI'];?>">
|
||||
<div class="form-group">
|
||||
<input type="email" name="email" required id="email" class="form-control" placeholder="<?= ucfirst( \S::lang( 'email' ) );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" name="password" required id="password" class="form-control" placeholder="<?= ucfirst( \S::lang( 'haslo' ) );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-success"><?= ucfirst( \S::lang( 'zaloguj-sie' ) );?></button>
|
||||
<span><?= \S::lang( 'nie-pamietasz-hasla' );?> <a href="/odzyskiwanie-hasla"><?= ucfirst( \S::lang( 'nowe-haslo' ) );?></a>.</span><br />
|
||||
<span><?= \S::lang( 'nie-masz-konta' );?> <a href="/rejestracja"><?= ucfirst( \S::lang( 'zarejestruj-sie' ) );?></a>.
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
7
templates/shop-client/mini-login.php
Normal file
7
templates/shop-client/mini-login.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<? global $lang;?>
|
||||
<? if ( !$this -> client ):?>
|
||||
<?= ucfirst( $lang['witaj'] );?>! <a href="/logowanie" title="Zaloguj się"> <?= ucfirst( $lang['zaloguj-sie'] );?></a> <?= $lang['lub'];?> <a href="/rejestracja" title="Rejestracja"><?= $lang['zarejestruj-sie'];?></a>
|
||||
<? else:?>
|
||||
<a href="/panel-klienta/zamowienia" title="<?= ucfirst( \S::lang( 'moje-konto' ) );?>" id="user-account"><span class="fa fa-user"></span><?= ucfirst( \S::lang( 'moje-konto' ) );?></a>
|
||||
<a href="/wylogowanie" title="<?= ucfirst( \S::lang( 'wyloguj-sie' ) );?>" id="user-logout"><span class="fa fa-unlock"></span><?= ucfirst( \S::lang( 'wyloguj-sie' ) );?></a>
|
||||
<? endif; ?>
|
||||
15
templates/shop-client/recover-password.php
Normal file
15
templates/shop-client/recover-password.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<div class="user-login box">
|
||||
<div class="content">
|
||||
<div class="box-title">
|
||||
<?= ucfirst( \S::lang( 'odzyskiwanie-hasla' ) );?>
|
||||
</div>
|
||||
<form method="POST" action="/shopClient/send_email_password_recovery" id="f-password-recovery">
|
||||
<div class="form-group">
|
||||
<input type="email" name="email" required id="email" class="form-control" placeholder="<?= ucfirst( \S::lang( 'email' ) );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-success"><?= ucfirst( \S::lang( 'resetuj-haslo' ) );?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
136
templates/shop-client/register-form.php
Normal file
136
templates/shop-client/register-form.php
Normal file
@@ -0,0 +1,136 @@
|
||||
<div class="user-register box">
|
||||
<div class="content">
|
||||
<div class="box-title">
|
||||
<?= \S::lang('zaloz-konto-klienta');?>
|
||||
</div>
|
||||
<form method="POST" action="/" id="f-user-register">
|
||||
<input type="hidden" id="type" name="type" value="0">
|
||||
<? if ( $this -> firm_id ):?>
|
||||
<input type="hidden" id="firm_id" name="firm_id" value="<?= $this -> firm_id;?>">
|
||||
<? endif;?>
|
||||
<div class="form-group">
|
||||
<input type="email" required id="email" class="form-control" placeholder="<?= ucfirst( \S::lang('email') );?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" required id="password" pattern="^\S{6,}$" class="form-control" placeholder="<?= ucfirst( \S::lang('haslo') );?> (<?= \S::lang('min');?> 6 <?= \S::lang('znakow');?>)">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="password" required id="password-repeat" pattern="^\S{6,}$" class="form-control" oninput="check_match(this)" placeholder="<?= ucfirst( \S::lang('powtorz-haslo') );?>">
|
||||
</div>
|
||||
<div class="form-group agreement">
|
||||
<input type="checkbox" required class="checkbox" name="agreement" id="agreement">
|
||||
<label for="agreement">
|
||||
<?
|
||||
$text = str_replace( '[LINK-REGULAMIN]', '<a href="/regulamin">' . \S::lang('regulamin') . '</a>', \S::lang('rejestracja-akceptacja-regulaminu') );
|
||||
echo $text = str_replace( '[LINK-POLITYKA-PRYWATNOSCI]', '<a href="/polityka-prywatnosci">' . \S::lang('polityke-prywatnosci') . '</a>', $text );
|
||||
?>
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group agreement-marketing">
|
||||
<input type="checkbox" name="agreement-marketing" class="checkbox" id="agreement-marketing"> <label for="agreement-marketing"><?= \S::lang('rejestracja-zgoda-na-marketing');?></label>
|
||||
</div>
|
||||
<div class="form-group buttons">
|
||||
<button type="submit" class="btn btn-success"><?= ucfirst( \S::lang('zarejestruj-sie') );?></button>
|
||||
<span id="login"><?= ucfirst( \S::lang('masz-juz-konto') );?>? <a href="/logowanie"><?= ucfirst( \S::lang('zaloguj-sie') );?></a></span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script class="footer" type='text/javascript'>
|
||||
$( function()
|
||||
{
|
||||
$( 'body' ).on( 'submit', '#f-user-register', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
|
||||
if ( $( '#f-user-register #agremment-marketing' ).is( ':checked' ) )
|
||||
var agreement_marketing = true;
|
||||
else
|
||||
var agreement_marketing = false;
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
url: '/shopClient/signup',
|
||||
data:
|
||||
{
|
||||
email: $( '#f-user-register #email' ).val(),
|
||||
password: $( '#f-user-register #password' ).val(),
|
||||
agremment_marketing: agreement_marketing
|
||||
},
|
||||
beforeSend: function()
|
||||
{
|
||||
alert1 = $.alert(
|
||||
{
|
||||
title: '<?= ucfirst( \S::lang('informacja') );?>',
|
||||
content: '<?= \S::lang('prosze-czekac');?>',
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fas fa-close',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
useBootstrap: false,
|
||||
theme: 'modern',
|
||||
icon: 'fas fa-info',
|
||||
buttons:
|
||||
{
|
||||
confirm:
|
||||
{
|
||||
text: '<?= \S::lang('zamknij');?>',
|
||||
btnClass: 'btn-orange',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
success: function( data )
|
||||
{
|
||||
alert1.close();
|
||||
response = jQuery.parseJSON( data );
|
||||
|
||||
$.alert(
|
||||
{
|
||||
title: '<?= ucfirst( \S::lang('informacja') );?>',
|
||||
content: response.msg,
|
||||
type: 'orange',
|
||||
closeIcon: true,
|
||||
closeIconClass: 'fas fa-close',
|
||||
typeAnimated: true,
|
||||
animation: 'opacity',
|
||||
useBootstrap: false,
|
||||
theme: 'modern',
|
||||
autoClose: 'confirm|10000',
|
||||
icon: 'fas fa-info',
|
||||
buttons:
|
||||
{
|
||||
confirm:
|
||||
{
|
||||
text: '<?= \S::lang('zamknij');?>',
|
||||
btnClass: 'btn-orange',
|
||||
keys: ['enter'],
|
||||
action: function() {}
|
||||
}
|
||||
},
|
||||
onClose: function ()
|
||||
{
|
||||
if ( response.status === 'ok' )
|
||||
document.location.href = '/logowanie';
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
function check_match(input)
|
||||
{
|
||||
if ( input.value !== document.getElementById( 'password' ).value )
|
||||
input.setCustomValidity( '<?= \S::lang('podane-hasla-sa-rozne');?>');
|
||||
else
|
||||
input.setCustomValidity('');
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user