Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fazo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nuriddin
fazo
Commits
117c67d7
Commit
117c67d7
authored
Oct 29, 2019
by
Khumoyunmirzo Sodiqov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Release 28.10.2019
( - Disabled Auto LogIn before Register )
parent
3219cbe5
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
121 additions
and
12 deletions
+121
-12
Controller.php
app/Http/Controllers/Controller.php
+10
-0
OrderController.php
app/Http/Controllers/OrderController.php
+14
-7
PackagesController.php
app/Http/Controllers/PackagesController.php
+12
-4
ProfileController.php
app/Http/Controllers/ProfileController.php
+25
-0
User.php
app/User.php
+1
-1
verify.blade.php
resources/views/auth/verify.blade.php
+48
-0
main.blade.php
resources/views/layouts/main.blade.php
+9
-0
web.php
routes/web.php
+2
-0
No files found.
app/Http/Controllers/Controller.php
View file @
117c67d7
...
...
@@ -6,6 +6,7 @@ use Illuminate\Foundation\Bus\DispatchesJobs;
use
Illuminate\Routing\Controller
as
BaseController
;
use
Illuminate\Foundation\Validation\ValidatesRequests
;
use
Illuminate\Foundation\Auth\Access\AuthorizesRequests
;
use
Illuminate\Support\Facades\Auth
;
class
Controller
extends
BaseController
{
...
...
@@ -17,4 +18,13 @@ class Controller extends BaseController
return
(
int
)
substr
(
number_format
(
time
()
*
rand
(),
0
,
''
,
''
),
0
,
$digit
);
}
// public function checkVerify()
// {
// $user = Auth::user();
//
// if ($user->is_email_ver == 0) {
// return redirect(route('verifyShow'));
// }
// }
}
app/Http/Controllers/OrderController.php
View file @
117c67d7
...
...
@@ -28,17 +28,25 @@ class OrderController extends Controller
public
function
__construct
()
{
$this
->
middleware
(
'auth'
);
}
/**
* Show the application Clients page.
*
* @return \Illuminate\
Contracts\Support\Renderable
* @return \Illuminate\
Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public
function
index
(
Request
$request
)
{
$user
=
Auth
::
user
();
if
(
$user
->
is_email_ver
==
0
)
{
return
redirect
(
route
(
'verifyShow'
));
}
$id
=
Auth
::
user
()
->
id
;
$status_id
=
(
$request
->
get
(
'status_id'
))
?
$request
->
get
(
'status_id'
)
:
0
;
...
...
@@ -238,7 +246,8 @@ class OrderController extends Controller
return
view
(
'pages.parcels.payment'
,
[
'order'
=>
$order
[
0
],
'payment'
=>
$payment
[
0
]]);
}
public
function
paymentSuccess
(
$orderId
){
public
function
paymentSuccess
(
$orderId
)
{
// dd($orderId);
...
...
@@ -254,15 +263,13 @@ class OrderController extends Controller
print
"Order ID:
{
$response
->
result
->
id
}
\n
"
;
print
"Intent:
{
$response
->
result
->
intent
}
\n
"
;
print
"Links:
\n
"
;
foreach
(
$response
->
result
->
links
as
$link
)
{
foreach
(
$response
->
result
->
links
as
$link
)
{
print
"
\t
{
$link
->
rel
}
:
{
$link
->
href
}
\t
Call Type:
{
$link
->
method
}
\n
"
;
}
// 4. Save the transaction in your database. Implement logic to save transaction to your database for future reference.
print
"Gross Amount:
{
$response
->
result
->
purchase_units
[
0
]
->
amount
->
currency_code
}
{
$response
->
result
->
purchase_units
[
0
]
->
amount
->
value
}
\n
"
;
if
(
!
count
(
debug_backtrace
()))
{
if
(
!
count
(
debug_backtrace
()))
{
GetOrder
::
getOrder
(
$response
->
result
->
id
);
}
}
...
...
@@ -366,7 +373,7 @@ class OrderController extends Controller
'id'
,
'user_id'
,
'country'
,
'firstname'
,
'secondname'
,
'phone'
,
'firstname'
,
'secondname'
,
'phone'
,
'city'
,
'street'
,
'house'
,
'apartment'
,
'zip'
,
'passport'
,
'type'
,
DB
::
raw
(
'(SELECT title_ru FROM country WHERE id=address_info.country) as country_name'
),
DB
::
raw
(
'(SELECT title_ru FROM city WHERE id=address_info.city) as city_name'
),
...
...
app/Http/Controllers/PackagesController.php
View file @
117c67d7
...
...
@@ -20,6 +20,11 @@ class PackagesController extends Controller
public
function
__construct
()
{
$this
->
middleware
(
'auth'
);
$user
=
Auth
::
user
();
if
(
$user
->
is_email_ver
==
0
)
{
return
redirect
(
route
(
'verifyShow'
));
}
}
/**
...
...
@@ -28,6 +33,8 @@ class PackagesController extends Controller
*/
public
function
all_packages
()
{
$packages
=
Package
::
where
(
'user_id'
,
Auth
::
id
())
->
orderBy
(
'id'
,
'DESC'
)
->
get
();
$declarationJson
=
$this
->
makeDeclarationJSON
(
$packages
);
...
...
@@ -168,7 +175,7 @@ class PackagesController extends Controller
Session
::
flash
(
'success'
,
'Ваша посылка успешно создана'
);
return
redirect
(
'/packages'
);
}
catch
(
Exception
$ex
)
{
Session
::
flash
(
'error'
,
'Ошибка сохранения информации о посылке: '
.
$ex
->
getMessage
());
Session
::
flash
(
'error'
,
'Ошибка сохранения информации о посылке: '
.
$ex
->
getMessage
());
}
}
...
...
@@ -222,14 +229,14 @@ class PackagesController extends Controller
* @return string
*/
private
function
makeDeclarationJSON
(
&
$packages
)
:
string
private
function
makeDeclarationJSON
(
&
$packages
)
:
string
{
$declaration_data
=
[];
foreach
(
$packages
as
$package
)
{
$package_items
=
PackageItems
::
where
(
'package_id'
,
$package
->
id
)
->
get
();
$items_data
=
[];
foreach
(
$package_items
as
$item
)
{
$items_data
[]
=
[
$items_data
[]
=
[
'package_id'
=>
$package
->
id
,
'name'
=>
$item
->
item_name
,
'amount'
=>
$item
->
amount
,
...
...
@@ -249,7 +256,7 @@ class PackagesController extends Controller
*
* @return array
*/
private
function
countPackages
()
:
array
private
function
countPackages
()
:
array
{
$itemsCounter
=
[
'allPackages'
=>
Package
::
where
(
'user_id'
,
Auth
::
id
())
->
count
(),
...
...
@@ -267,6 +274,7 @@ class PackagesController extends Controller
{
return
view
(
'pay'
);
}
public
function
addr
()
{
return
view
(
'addpackage'
);
...
...
app/Http/Controllers/ProfileController.php
View file @
117c67d7
...
...
@@ -9,10 +9,13 @@
namespace
App\Http\Controllers
;
use
App\Models\Address
;
use
App\Models\Client
;
use
App\Models\ClientAuthCodes
;
use
App\Models\Images
;
use
App\User
;
use
Illuminate\Http\Request
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\Session
;
use
Illuminate\Support\Facades\Hash
;
use
Exception
;
...
...
@@ -316,4 +319,26 @@ class ProfileController extends Controller
return
redirect
()
->
back
()
->
with
(
'success'
,
'Информация успешно сохранена.'
);
}
public
function
verifyShow
()
{
return
view
(
'auth.verify'
);
}
public
function
verifySend
(
Request
$request
)
{
$user
=
Auth
::
user
();
$code
=
DB
::
table
(
'client_auth_codes'
)
->
latest
(
'code'
)
->
where
(
'client_id'
,
'='
,
$user
->
id
)
->
first
();
if
(
$code
->
code
==
$request
->
get
(
'code'
))
{
$client
=
Client
::
find
(
$user
->
id
);
$client
->
is_email_ver
=
1
;
$client
->
save
();
return
redirect
(
route
(
'package'
));
}
else
{
return
redirect
(
route
(
'verifyShow'
));
}
}
}
app/User.php
View file @
117c67d7
...
...
@@ -21,7 +21,7 @@ class User extends Authenticatable
'name'
,
'surname'
,
'birthday'
,
'sex'
,
'passport'
,
'passport_issue'
,
'passport_by'
,
'country_id'
,
'city_id'
,
'street'
,
'house'
,
'apartment'
,
'phone'
,
'mobile'
,
'email'
,
'add_operator_id'
,
'edit_operator_id'
,
'added'
,
'edited'
,
'orders'
,
'last_order'
,
'allowed'
,
'status'
,
'uni_code'
,
'lang_id'
,
'password'
,
'remember_token'
,
'scan_id'
,
'client_type'
'scan_id'
,
'client_type'
,
'is_email_ver'
];
/**
...
...
resources/views/auth/verify.blade.php
0 → 100644
View file @
117c67d7
@
extends
(
'layouts.main'
)
@
section
(
'content'
)
<
section
class
="
section
section
-
inset
-
1
">
<div class="
container
">
<h2>Подтверждение по электронной почте</h2>
<hr>
<div class="
row
">
<div class="
col
-
xs
-
12
col
-
md
-
8
col
-
md
-
offset
-
2
">
<div class="
row
offset
-
5
">
<div class="
col
-
lg
-
6
col
-
lg
-
offset
-
3
">
<form class="
rd
-
mailform
text
-
left
" method="
POST
" action="
{{
route
(
'verifySend'
)
}}
">
@csrf
<div class="
form
-
wrap
">
<input id="
email
" type="
number
"
class="
form
-
input
{{
$errors
->
has
(
'code'
)
?
' is-invalid'
:
''
}}
"
name="
code
" data-constraints="
@
Required
" value=""
placeholder="
Пожалуйста
,
введите
код
подтверждения
" required autofocus>
@if (
$errors->has
('verifyCode'))
<span class="
invalid
-
feedback
">
<strong>{{
$errors->first
('verifyCode') }}</strong>
</span>
@endif
</div>
<div class="
button
-
wrap
text
-
center
">
<button class="
btn
btn
-
primary
btn
-
sm
btn
-
min
-
width
-
lg
" type="
submit
">Отправить
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</section>
<script>
$('div span img').css('margin-top: 20px;
\n
' +
' border-radius: 5px;
\n
' +
' box-shadow: 0px 0px 2px 1px;');
</script>
@endsection
resources/views/layouts/main.blade.php
View file @
117c67d7
...
...
@@ -23,6 +23,15 @@
<link
rel=
"stylesheet"
type=
"text/css"
href=
"https://fonts.googleapis.com/css?family=Ubuntu:400,500,700%7COpen+Sans:400,300);"
>
<link
rel=
"stylesheet"
href=
"/css/style.css"
>
<style>
input
[
type
=
number
]
::-webkit-inner-spin-button
,
input
[
type
=
number
]
::-webkit-outer-spin-button
{
-webkit-appearance
:
none
;
margin
:
0
;
}
</style>
<!--[if lt IE 10]>
<div style="background: #212121; padding: 10px 0; box-shadow: 3px 3px 5px 0 rgba(0,0,0,.3); clear: both; text-align:center; position: relative; z-index:1;">
<a href="http://windows.microsoft.com/en-US/internet-explorer/"><img
...
...
routes/web.php
View file @
117c67d7
...
...
@@ -75,6 +75,8 @@ Route::post('/packages/order-store', 'OrderController@orderStore')->name('packag
Route
::
get
(
'/packages/get-address-ajax-s'
,
'OrderController@getAddressAjaxS'
)
->
name
(
'package.getAddressAjaxS'
)
->
middleware
(
'auth'
);
Route
::
get
(
'/packages/get-address-ajax-r'
,
'OrderController@getAddressAjaxR'
)
->
name
(
'package.getAddressAjaxR'
)
->
middleware
(
'auth'
);
Route
::
get
(
'/declaration/{package_id}'
,
'Postman\DeclarationController@generatePDF'
)
->
where
([
'package_id'
=>
'[0-9]+'
])
->
middleware
(
'auth'
);
Route
::
get
(
'/verify-email'
,
'ProfileController@verifyShow'
)
->
name
(
'verifyShow'
)
->
middleware
(
'auth'
);
Route
::
post
(
'/verify-send'
,
'ProfileController@verifySend'
)
->
name
(
'verifySend'
)
->
middleware
(
'auth'
);
Route
::
get
(
'/profile/address'
,
'ProfileController@address'
)
->
name
(
'address'
)
->
middleware
(
'auth'
);
Route
::
get
(
'/profile/addaddress'
,
'ProfileController@addaddress'
)
->
name
(
'address.add'
)
->
middleware
(
'auth'
);
Route
::
post
(
'/profile/storeaddress'
,
'ProfileController@storeaddress'
)
->
name
(
'address.store'
)
->
middleware
(
'auth'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment