first commit

This commit is contained in:
2024-10-25 23:02:37 +02:00
commit faeb2e52e8
7653 changed files with 1095335 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;
}
}