diff --git a/plugins/romanah/bagisto/Plugin.php b/plugins/romanah/bagisto/Plugin.php index a57f488..9853a05 100755 --- a/plugins/romanah/bagisto/Plugin.php +++ b/plugins/romanah/bagisto/Plugin.php @@ -27,7 +27,7 @@ class Plugin extends PluginBase public function registerComponents() { return [ - 'Romanah\Bagisto\Components\Products' => 'products' + 'Romanah\Bagisto\Components\Session' => 'session' ]; } diff --git a/plugins/romanah/bagisto/components/Products.php b/plugins/romanah/bagisto/components/Products.php deleted file mode 100644 index e149f8f..0000000 --- a/plugins/romanah/bagisto/components/Products.php +++ /dev/null @@ -1,47 +0,0 @@ - 'Products', - 'description' => 'Fetch Products settings' - ]; - } - - public $bagisto_url = 'https://nurgul.com.tm/app/api/'; - - public function onFetchProduct() - { - // $response = Http::get('https://nurgul.com.tm/app/api/products?locale=tm&limit=4'); - // $response = getenv('APP_URL'); - // dd($response); - - // $result = Http::get('https://orient.tm/ru/api/posts', function ($http) { - // // $http->header('Content-Type', 'application/json'); - // $http->header('Accept', 'application/json'); - - // // $data = []; - - // $http->setOption('CURLOPT_SSL_VERIFYHOST', false); - // }); - - // $response = Http::accept('application/json')->get('https://nurgul.com.tm/app/api/products?locale=tm&limit=4'); - $result = Http::accept('application/json')->get('http://nurgul.com.tm/app/api/products?locale=tm&limit=1'); - - // $data = json_decode($response); - - return $result; - } - - -} diff --git a/plugins/romanah/bagisto/components/Session.php b/plugins/romanah/bagisto/components/Session.php new file mode 100644 index 0000000..94b6337 --- /dev/null +++ b/plugins/romanah/bagisto/components/Session.php @@ -0,0 +1,52 @@ + 'Sessions', + 'description' => 'Set Auth Session' + ]; + } + + + function onSetSessionNurgul() + { + $data = post(); + // dd($data); + // return $data ?? 'asdasd'; + + SessionP::put('nurgulToken', $data['token']); + SessionP::put('name', $data['name']); + SessionP::put('phone', $data['phone']); + + Flash::success("Ustunlikli Icher Girdiniz"); + return Redirect::to('/'); + } + + function onLogOutNurgul() + { + + SessionP::forget('nurgulToken'); + SessionP::forget('name'); + SessionP::forget('phone'); + + $getToken = SessionP::get('nurgulToken'); + if ($getToken == "") { + Flash::success("Ustunlikli Shahsy Otagynyzdan Chykdynyz."); + return Redirect::to('/'); + } else { + return Flash::error('Ýalňyşlyk Ýüze Çykdy!!!'); + } + } +} diff --git a/themes/nurgul/layouts/main.htm b/themes/nurgul/layouts/main.htm index 0c6178c..8fe8e16 100755 --- a/themes/nurgul/layouts/main.htm +++ b/themes/nurgul/layouts/main.htm @@ -1,5 +1,17 @@ [staticMenu] code = "top-menu" + +[session] +== + == @@ -27,6 +39,11 @@ code = "top-menu"
+ {% flash %} + + {% endflash %}{{'company.privacy.title'|_}}
+ + +