first commit

This commit is contained in:
2024-10-23 13:44:50 +02:00
commit b6107b8c75
7924 changed files with 1087672 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace front\controls;
class ShopCoupon
{
public static function delete_coupon()
{
\S::delete_session( 'coupon' );
header( 'Location: /koszyk' );
exit;
}
public static function use_coupon()
{
$coupon = new \shop\Coupon( 0 );
$coupon -> load_from_db_by_name( (string)\S::get( 'coupon' ) );
if ( $coupon -> is_available() )
\S::set_session( 'coupon', $coupon );
else
\S::alert( 'Podany kod rabatowy jest nieprawidłowy.' );
header( 'Location: /koszyk' );
exit;
}
}