Commit bc53d2dc authored by Khumoyunmirzo Sodiqov's avatar Khumoyunmirzo Sodiqov

fix bugs

parent 35699f41
......@@ -16,4 +16,5 @@ class Controller extends BaseController
{
return (int)substr(number_format(time() * rand(), 0, '', ''), 0, $digit);
}
}
<?php
namespace App\Http\Controllers;
use App\Models\Orders;
use FedEx\ShipService\ComplexType\Address;
use FedEx\ShipService\ComplexType\ClientDetail;
use FedEx\ShipService\ComplexType\Contact;
use FedEx\ShipService\ComplexType\Dimensions;
use FedEx\ShipService\ComplexType\LabelSpecification;
use FedEx\ShipService\ComplexType\Party;
use FedEx\ShipService\ComplexType\Payment;
use FedEx\ShipService\ComplexType\Payor;
use FedEx\ShipService\ComplexType\ProcessShipmentRequest;
use FedEx\ShipService\ComplexType\RequestedPackageLineItem;
use FedEx\ShipService\ComplexType\RequestedShipment;
use FedEx\ShipService\ComplexType\VersionId;
use FedEx\ShipService\ComplexType\WebAuthenticationCredential;
use FedEx\ShipService\ComplexType\WebAuthenticationDetail;
use FedEx\ShipService\ComplexType\Weight;
use FedEx\ShipService\Request;
use FedEx\ShipService\SimpleType\DropoffType;
use FedEx\ShipService\SimpleType\LabelFormatType;
use FedEx\ShipService\SimpleType\LabelStockType;
use FedEx\ShipService\SimpleType\LinearUnits;
use FedEx\ShipService\SimpleType\PackagingType;
use FedEx\ShipService\SimpleType\PaymentType;
use FedEx\ShipService\SimpleType\RateRequestType;
use FedEx\ShipService\SimpleType\ServiceType;
use FedEx\ShipService\SimpleType\ShippingDocumentImageType;
use FedEx\ShipService\SimpleType\WeightUnits;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Response;
class DeliverySytemsController extends Controller
{
public $successStatus = 200;
public function getFedexData($id)
{
// $orderId = $data['order_id'];97 Quentin Rd, 1st floor, Brooklyn, NY 11223
$order = Orders::find($id);
$sender = \App\Models\Address::select([
'id',
'user_id',
'scan_id',
'firstname',
'secondname',
'fathername',
'phone',
'street',
'house',
'passport',
'passport_by',
'passport_issue',
'apartment',
'zip',
'is_default',
'type',
'created',
DB::raw('(select title_uz from country where id = address_info.country) as country'),
DB::raw('(SELECT (sum(orders.amount)-1000)*(-1) FROM orders where orders.to_address_id=address_info.id) as r_limit'),
DB::raw('(select title_uz from city where id = address_info.city) as city')
])->where([
['id', '=', $order->from_address]
])->get();
if ($order == null) {
return response()->json(['warning' => 'Order not found'], 200);
} elseif ($order['label_url'] == null) {
$street = $sender[0]->street; //'test str';
$city = $sender[0]->city_name; // 'Unit C1 Brooklyn';
$stateOrProvinceCode = $sender[0]->city_name; // 'NY';
$postalCode = $sender[0]->zip; // '11229';
$countryCode = 'US'; //'US';
$weight = ($order['weight'] > 0) ? $order['weight'] : 1; // 10;
$userCredential = new WebAuthenticationCredential();
$userCredential
->setKey('dXw7hhDl5lS6mwqs')
->setPassword('DDOWpwxnnmPsUxWNSM8gXLIdD');
$webAuthenticationDetail = new WebAuthenticationDetail();
$webAuthenticationDetail->setUserCredential($userCredential);
$clientDetail = new ClientDetail();
$clientDetail
->setAccountNumber('510087100')
->setMeterNumber('119157536');
$version = new VersionId();
$version
->setMajor(23)
->setIntermediate(0)
->setMinor(0)
->setServiceId('ship');
$shipperAddress = new Address();
$shipperAddress
->setStreetLines([$street])
->setCity($city)
->setStateOrProvinceCode($stateOrProvinceCode)
->setPostalCode($postalCode)
->setCountryCode($countryCode);
$shipperContact = new Contact();
$shipperContact
// ->setCompanyName('TuronExpresss')
// ->setEMailAddress('test@example.com')
->setPersonName($sender[0]->firstname.' '.$sender[0]->secondname.' '.$sender[0]->fathername)
->setPhoneNumber(($sender[0]->phone));
$shipper = new Party();
$shipper
->setAccountNumber('510087100')
->setAddress($shipperAddress)
->setContact($shipperContact);
$recipientAddress = new Address();
$recipientAddress
->setStreetLines(['97 Quentin Rd, 1st floor'])
->setCity('Brooklyn')
->setStateOrProvinceCode('NY')
->setPostalCode('11229')
->setCountryCode('US');
$recipientContact = new Contact();
$recipientContact
->setCompanyName('Fazo Cargo')
->setPersonName('Test FullName')
->setPhoneNumber('+1 347 547 9797');
$recipient = new Party();
$recipient
->setAddress($recipientAddress)
->setContact($recipientContact);
$labelSpecification = new LabelSpecification();
$labelSpecification
->setLabelStockType(new LabelStockType(LabelStockType::_PAPER_7X4POINT75))
->setImageType(new ShippingDocumentImageType(ShippingDocumentImageType::_PDF))
->setLabelFormatType(new LabelFormatType(LabelFormatType::_COMMON2D));
$packageLineItem1 = new RequestedPackageLineItem();
$packageLineItem1
->setSequenceNumber(1)
->setItemDescription('Product description')
->setDimensions(new Dimensions(array(
'Width' => 10,
'Height' => 1,
'Length' => 1,
'Units' => LinearUnits::_CM
)))
->setWeight(new Weight(array(
'Value' => $weight,
'Units' => WeightUnits::_KG
)));
$shippingChargesPayor = new Payor();
$shippingChargesPayor->setResponsibleParty($shipper);
$shippingChargesPayment = new Payment();
$shippingChargesPayment
->setPaymentType(PaymentType::_SENDER)
->setPayor($shippingChargesPayor);
$requestedShipment = new RequestedShipment();
$requestedShipment->setShipTimestamp(date('c'));
$requestedShipment->setDropoffType(new DropoffType(DropoffType::_REGULAR_PICKUP));
$requestedShipment->setServiceType(new ServiceType(ServiceType::_FEDEX_GROUND));
$requestedShipment->setPackagingType(new PackagingType(PackagingType::_YOUR_PACKAGING));
$requestedShipment->setShipper($shipper);
$requestedShipment->setRecipient($recipient);
$requestedShipment->setLabelSpecification($labelSpecification);
$requestedShipment->setRateRequestTypes(array(new RateRequestType(RateRequestType::_PREFERRED)));
$requestedShipment->setPackageCount(1);
$requestedShipment->setRequestedPackageLineItems([
$packageLineItem1
]);
$requestedShipment->setShippingChargesPayment($shippingChargesPayment);
$processShipmentRequest = new ProcessShipmentRequest();
$processShipmentRequest->setWebAuthenticationDetail($webAuthenticationDetail);
$processShipmentRequest->setClientDetail($clientDetail);
$processShipmentRequest->setVersion($version);
$processShipmentRequest->setRequestedShipment($requestedShipment);
$shipService = new Request();
$result = $shipService->getProcessShipmentReply($processShipmentRequest);
if ($result->HighestSeverity == 'ERROR') {
// dd($result->Notifications[0]->Message);
return response()->json([
'error' => $result->Notifications[0]->Message,
'code' => $result->Notifications[0]->Code
], 200);
}
if ($result->HighestSeverity == 'WARNING') {
// dd($result->Notifications[0]->Message);
return response()->json([
'warning' => $result->Notifications[0]->Message,
'code' => $result->Notifications[0]->Code
], 200);
}
if ($result->HighestSeverity == 'SUCCESS') {
// $file = file_get_contents($result->CompletedShipmentDetail->CompletedPackageDetails[0]->Label->Parts[0]->Image);
$path = 'uploads';
$path .= '/labels/';
$filename = md5(time()) . date('Ymdhis') . '.pdf';
file_put_contents(public_path($path . '/' . $filename), $result->CompletedShipmentDetail->CompletedPackageDetails[0]->Label->Parts[0]->Image);
$order->label_url = $path . '/' . $filename;
$order->save();
// dd($order);
return Response::download($order['label_url']);
}
} else {
return Response::download($order['label_url']);
}
}
}
......@@ -222,8 +222,8 @@ class OrderController extends Controller
'summa' => ($request->get('weight') * 8) + $serSum,
'weight' => $request->get('weight'),
'total' => $price,
'track_number' => $this->generateUniqNumber(12),
'is_site' => 0,
'track_number' => '98'.$this->generateUniqNumber(4),
'is_site' => $request->get('is_site'),
'is_payment_uzb' => 0,
'from_address' => $request->get('from_address'),
'to_address_id' => $request->get('to_address_id'),
......
......@@ -8,12 +8,16 @@
namespace App\Http\Controllers\Postman;
use App\Http\Controllers\Controller;
use App\Models\Activity;
use App\Models\Address;
use App\Models\Client;
use App\Models\Orders;
use App\Models\Package;
use App\Models\PackageItems;
use App\Models\Product;
use Illuminate\Support\Facades\DB;
use PDF;
class DeclarationController extends Controller
......@@ -37,29 +41,101 @@ class DeclarationController extends Controller
*/
public function generatePDF($package_id)
{
$package = Orders::find($package_id);
$package_items = Product::where('order_id', $package->id)->get();
$declaration = [];
$orderId = $package_id;
foreach ($package_items as $item) {
$itemClass = new \stdClass();
$itemClass->package_id = $package->id;
$itemClass->name = $item->title;
$itemClass->amount = $item->amount;
$itemClass->price = $item->price;
$itemClass->weight = $item->weight;
$declaration[] = $itemClass;
}
$orderData = Orders::select([
'id',
'name',
'client_id',
'added',
'track_number',
'from_address',
'to_address_id',
'edited',
DB::raw('(SELECT concat(firstname,\' \', secondname) FROM address_info where address_info.id=orders.to_address_id) as r_name'),
DB::raw('(SELECT name_uz FROM payment_statuses where payment_statuses.id=(select payment_statuses_id from payment where payment.order_id=orders.id)) as payment_status'),
'amount',
'weight',
'summa',
])->where('id', '=', $orderId)->get();
$clientData = Client::find($orderData[0]->client_id);
$recipient = Address::select([
'id',
'user_id',
'scan_id',
'firstname',
'secondname',
'fathername',
'phone',
'street',
'house',
'passport',
'passport_by',
'passport_issue',
'apartment',
'zip',
'is_default',
'type',
'created',
DB::raw('(select title_uz from country where id = address_info.country) as country'),
DB::raw('(SELECT (sum(orders.amount)-1000)*(-1) FROM orders where orders.to_address_id=address_info.id) as r_limit'),
DB::raw('(select title_uz from city where id = address_info.city) as city')
])->where([
['id', '=', $orderData[0]->to_address_id]
])->get();
$sender = Address::select([
'id',
'user_id',
'scan_id',
'firstname',
'secondname',
'fathername',
'phone',
'street',
'house',
'passport',
'passport_by',
'passport_issue',
'apartment',
'zip',
'is_default',
'type',
'created',
DB::raw('(select title_uz from country where id = address_info.country) as country'),
DB::raw('(SELECT (sum(orders.amount)-1000)*(-1) FROM orders where orders.to_address_id=address_info.id) as r_limit'),
DB::raw('(select title_uz from city where id = address_info.city) as city')
])->where([
['id', '=', $orderData[0]->from_address]
])->get();
$pdf = PDF::loadView('templates.declaration', [
$products = Product::select([
'id',
'operator_id',
'title',
'amount',
'weight',
'price',
'order_id',
])->where('order_id', '=', $orderData[0]->id)->get();
$pdf = \Barryvdh\DomPDF\Facade::loadView('templates.declaration', [
'title' => 'Declaration #',
'package' => $package,
'declaration' => $declaration,
]);
'client' => $clientData,
'order' => $orderData[0],
'recipient' => $recipient[0],
'sender' => $sender[0],
'product' => $products
])->setPaper('a4');
$path = 'uploads/declarations/';
$filename = md5(time()) . date('Ymdhis') . '.pdf';
Activity::appendLog("Сгенерирована декларация в PDF формате.", Activity::NOTICE);
return $pdf->download($filename);
$pdf->save($path . $filename);
// Activity::appendLog("Сгенерирована декларация в PDF формате.", Activity::NOTICE);
return redirect(url($path . $filename));
// return response()->json(['url' => url($path.$filename).''], 200);
// return $pdf->download('declaration.pdf');
}
/**
......
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "31b801600acd96ae69916e04307a1296",
......@@ -164,28 +164,30 @@
},
{
"name": "doctrine/lexer",
"version": "1.0.2",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/lexer.git",
"reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8"
"reference": "e17f069ede36f7534b95adec71910ed1b49c74ea"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/lexer/zipball/1febd6c3ef84253d7c815bed85fc622ad207a9f8",
"reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8",
"url": "https://api.github.com/repos/doctrine/lexer/zipball/e17f069ede36f7534b95adec71910ed1b49c74ea",
"reference": "e17f069ede36f7534b95adec71910ed1b49c74ea",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
"php": "^7.2"
},
"require-dev": {
"phpunit/phpunit": "^4.5"
"doctrine/coding-standard": "^6.0",
"phpstan/phpstan": "^0.11.8",
"phpunit/phpunit": "^8.2"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
"dev-master": "1.1.x-dev"
}
},
"autoload": {
......@@ -198,14 +200,14 @@
"MIT"
],
"authors": [
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
......@@ -220,7 +222,7 @@
"parser",
"php"
],
"time": "2019-06-08T11:03:04+00:00"
"time": "2019-07-30T19:33:28+00:00"
},
{
"name": "dompdf/dompdf",
......@@ -897,51 +899,6 @@
],
"time": "2018-12-27T15:44:58+00:00"
},
{
"name": "kylekatarnls/update-helper",
"version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/kylekatarnls/update-helper.git",
"reference": "5786fa188e0361b9adf9e8199d7280d1b2db165e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/kylekatarnls/update-helper/zipball/5786fa188e0361b9adf9e8199d7280d1b2db165e",
"reference": "5786fa188e0361b9adf9e8199d7280d1b2db165e",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.1.0 || ^2.0.0",
"php": ">=5.3.0"
},
"require-dev": {
"codeclimate/php-test-reporter": "dev-master",
"composer/composer": "2.0.x-dev || ^2.0.0-dev",
"phpunit/phpunit": ">=4.8.35 <6.0"
},
"type": "composer-plugin",
"extra": {
"class": "UpdateHelper\\ComposerPlugin"
},
"autoload": {
"psr-0": {
"UpdateHelper\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Kyle",
"email": "kylekatarnls@gmail.com"
}
],
"description": "Update helper",
"time": "2019-07-29T11:03:54+00:00"
},
{
"name": "laravel/framework",
"version": "v5.8.35",
......@@ -1511,34 +1468,36 @@
},
{
"name": "nesbot/carbon",
"version": "1.39.1",
"version": "2.25.3",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "4be0c005164249208ce1b5ca633cd57bdd42ff33"
"reference": "d07636581795383e2fea2d711212d30f941f2039"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4be0c005164249208ce1b5ca633cd57bdd42ff33",
"reference": "4be0c005164249208ce1b5ca633cd57bdd42ff33",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d07636581795383e2fea2d711212d30f941f2039",
"reference": "d07636581795383e2fea2d711212d30f941f2039",
"shasum": ""
},
"require": {
"kylekatarnls/update-helper": "^1.1",
"php": ">=5.3.9",
"symfony/translation": "~2.6 || ~3.0 || ~4.0"
"ext-json": "*",
"php": "^7.1.8 || ^8.0",
"symfony/translation": "^3.4 || ^4.0"
},
"require-dev": {
"composer/composer": "^1.2",
"friendsofphp/php-cs-fixer": "~2",
"phpunit/phpunit": "^4.8.35 || ^5.7"
"friendsofphp/php-cs-fixer": "^2.14 || ^3.0",
"kylekatarnls/multi-tester": "^1.1",
"phpmd/phpmd": "dev-php-7.1-compatibility",
"phpstan/phpstan": "^0.11",
"phpunit/phpunit": "^7.5 || ^8.0",
"squizlabs/php_codesniffer": "^3.4"
},
"bin": [
"bin/upgrade-carbon"
"bin/carbon"
],
"type": "library",
"extra": {
"update-helper": "Carbon\\Upgrade",
"laravel": {
"providers": [
"Carbon\\Laravel\\ServiceProvider"
......@@ -1547,7 +1506,7 @@
},
"autoload": {
"psr-4": {
"": "src/"
"Carbon\\": "src/Carbon/"
}
},
"notification-url": "https://packagist.org/downloads/",
......@@ -1559,16 +1518,20 @@
"name": "Brian Nesbitt",
"email": "brian@nesbot.com",
"homepage": "http://nesbot.com"
},
{
"name": "kylekatarnls",
"homepage": "http://github.com/kylekatarnls"
}
],
"description": "A simple API extension for DateTime.",
"description": "An API extension for DateTime that supports 281 different languages.",
"homepage": "http://carbon.nesbot.com",
"keywords": [
"date",
"datetime",
"time"
],
"time": "2019-10-14T05:51:36+00:00"
"time": "2019-10-20T11:05:44+00:00"
},
{
"name": "nikic/php-parser",
......@@ -1623,16 +1586,16 @@
},
{
"name": "opis/closure",
"version": "3.4.0",
"version": "3.4.1",
"source": {
"type": "git",
"url": "https://github.com/opis/closure.git",
"reference": "60a97fff133b1669a5b1776aa8ab06db3f3962b7"
"reference": "e79f851749c3caa836d7ccc01ede5828feb762c7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/opis/closure/zipball/60a97fff133b1669a5b1776aa8ab06db3f3962b7",
"reference": "60a97fff133b1669a5b1776aa8ab06db3f3962b7",
"url": "https://api.github.com/repos/opis/closure/zipball/e79f851749c3caa836d7ccc01ede5828feb762c7",
"reference": "e79f851749c3caa836d7ccc01ede5828feb762c7",
"shasum": ""
},
"require": {
......@@ -1680,7 +1643,7 @@
"serialization",
"serialize"
],
"time": "2019-09-02T21:07:33+00:00"
"time": "2019-10-19T18:38:51+00:00"
},
{
"name": "paragonie/random_compat",
......
......@@ -71,6 +71,12 @@
</div>
</section>
<script>
$('div span img').css('margin-top: 20px;\n' +
' border-radius: 5px;\n' +
' box-shadow: 0px 0px 2px 1px;');
</script>
@endsection
......@@ -67,6 +67,7 @@
<th>Стоимость товаров</th>
<th>Вес</th>
<th>Стоимость доставки</th>
<th>FedEx</th>
</tr>
</thead>
<tbody>
......@@ -84,6 +85,7 @@
<td class="text-center">${{ $package->price }}</td>
<td class="text-center">{{ $package->weight }} кг</td>
<td class="text-center">$ {{ $package->summa }}</td>
<td class="text-center"><a href="{{ ($package->is_site == 1)?'/get-fedex-label/'.$package->id:'#' }}" target="_blank">{{ ($package->is_site == 1)?'Распечатать':'No label' }}</a></td>
</tr>
@endforeach
</tbody>
......
......@@ -72,6 +72,15 @@
color: #7d7d7d;
left: -45%;
}
.scroll-horizantal {
overflow-y: scroll;
overflow-x: hidden;
transform: rotate(270deg) translateX(-100%);
transform-origin: top left;
background-color: #999;
position: absolute;
}
</style>
<!-- multistep form -->
......@@ -159,8 +168,8 @@
<th class="col-3">Название товара</th>
<th class="col-2">Количество (шт)</th>
<th class="col-2">Цена ($)</th>
<th class="col-2">Коммент...</th>
<th class="col-1">Стоим...</th>
<th class="col-2">Комментарий</th>
<th class="col-1">Сумма</th>
<th class="col-1"></th>
</tr>
</thead>
......@@ -217,8 +226,8 @@
посылку</strong></a>
</div>
<div class="col-6 text-right">
Итоговая сумма в декларации: <strong><span class="text-success"
id="total_price">$2</span></strong>
<b>Итоговая сумма в декларации:</b> <strong><span class="text-success"
id="total_price">$2</span></strong>
</div>
</div>
<br><br>
......@@ -240,7 +249,8 @@
</div>
<br/><br/>
<input type="button" name="next" class="next action-button btn btn-primary btn-lg btn-block mt-4"
<input type="button" name="next"
class="next action-button btn btn-primary btn-lg btn-block mt-4"
value="Next"/>
<br>
<hr>
......@@ -255,22 +265,10 @@
<label for="">На этой странице вам необходимо указать ваш адрес в США. Этот адрес будет
использоваться в качестве адреса отправителя</label>
</div>
<hr>
<div class="row">
<div id="senderAddresses" style="display: inline-flex; overflow-y: scroll;" class="col-md-10">
{{-- @foreach($senderAddresses as $item)--}}
{{-- @if($item->type == 'sender')--}}
{{-- <div class="custom-control custom-radio"--}}
{{-- style="width: 300px;height: 120px;border: 1px solid #e9ecef;padding: 10px 10px 10px 40px;margin: 6px;">--}}
{{-- <input type="radio" class="custom-control-input"--}}
{{-- name="from_address" value="{{ $item->id }}"--}}
{{-- id="from_address{{ $item->id }}">--}}
{{-- <label class="custom-control-label"--}}
{{-- for="from_address{{ $item->id }}">{{ $item->country.', '.$item->city.', '.$item->street.', '.$item->house.', '.$item->apartment.', '.$item->zip }}</label>--}}
{{-- </div>--}}
{{-- @endif--}}
{{-- @endforeach--}}
<div id="senderAddresses" style="display: inline-flex; overflow-y: hidden; overflow-x: scroll"
class="col-md-10">
<label for="">У вас еще нет адресов</label>
</div>
<div class="col-md-2">
<input type="button" name="add_sender" class="btn btn-primary btn-lg btn-block mt-4"
......@@ -286,40 +284,43 @@
адрес :</label>
</div>
<div class="row">
<div class="col-md-10" style="display: inline-flex">
@foreach($senderAddresses as $item)
@if($item->type == 'recipient')
<div class="custom-control custom-radio"
style="width: 300px;height: 120px;border: 1px solid #e9ecef;padding: 10px 10px 10px 40px;margin: 6px;">
<input type="radio" class="custom-control-input"
name="to_address_id" value="{{ $item->id }}"
id="to_address_id{{ $item->id }}">
<label class="custom-control-label"
for="to_address_id{{ $item->id }}">{{ $item->country.', '.$item->city.', '.$item->street.', '.$item->house.', '.$item->apartment.', '.$item->zip.' | Limit: $1000' }}</label>
</div>
@endif
@endforeach
<div id="recAddresses" style="display: inline-flex; overflow-y: hidden; overflow-x: scroll"
class="col-md-10">
<label for="">У вас еще нет адресов</label>
</div>
<div class="col-md-2">
<input type="button" name="add_sender" class="btn btn-primary btn-lg btn-block mt-4"
<input type="button" name="add_rec" class="btn btn-primary btn-lg btn-block mt-4"
style="font-size: 16px;" value="Добавить адрес" data-toggle="modal"
data-target="#addSenderAddressAddModal"/>
data-target="#addRecAddressAddModal"/>
</div>
</div>
<br/><br/>
<input type="button" name="previous"
style="width: 35%; float: left;"
style="width: 30%; float: left;" x
class="previous action-button btn btn-primary btn-lg btn-block mt-4"
value="Предыдущий"/>
<input type="button" name="next"
style="width: 35%; float: right"
style="width: 30%; float: right"
class="next action-button btn btn-primary btn-lg btn-block mt-4"
value="Следующий"/>
</fieldset>
<fieldset>
<input type="button" name="next" data-type="newyork"
style="width: 50%; height: 60px; margin-left: 25%;"
class="next action-button btn btn-primary btn-lg btn-block mt-4"
value="Отправить из Нью-Йорка"/>
<br>
<hr>
<br>
<input type="button" name="next" data-type="outnewyork"
style="width: 50%; height: 60px; margin-left: 25%;"
class="next action-button btn btn-primary btn-lg btn-block mt-4"
value="Отправить из других штатов"/>
</fieldset>
<fieldset>
......@@ -337,21 +338,25 @@
</div>
</div>
<br>
<hr>
<h1>Выберите тип доставки</h1>
<div class="row">
<div class="col-md-4">
<div class="custom-control custom-radio">
<input type="radio" class="custom-control-input" id="defaultUnchecked11"
name="delivery_info" value="Само достовка" checked>
<label class="custom-control-label" for="defaultUnchecked11">Само достовка</label>
</div>
<input type="hidden" id="is_site" name="is_site" value="0">
<div id="pickUp">
<hr>
<h1>Выберите тип доставки</h1>
<div class="row">
<div class="col-md-4">
<div class="custom-control custom-radio">
<input type="radio" class="custom-control-input" id="defaultUnchecked11"
name="delivery_info" value="Само достовка" checked>
<label class="custom-control-label" for="defaultUnchecked11">Само достовка</label>
</div>
<!-- Default checked -->
<div class="custom-control custom-radio">
<input type="radio" class="custom-control-input" id="defaultChecked22"
name="delivery_info" value="Вызов курьера">
<label class="custom-control-label" for="defaultChecked22">Вызов курьера</label>
</div>
<!-- Default checked -->
<div class="custom-control custom-radio">
<input type="radio" class="custom-control-input" id="defaultChecked22"
name="delivery_info" value="Вызов курьера">
<label class="custom-control-label" for="defaultChecked22">Вызов курьера</label>
</div>
</div>
</div>
......@@ -363,18 +368,18 @@
<div class="custom-control custom-radio">
<input type="radio" class="custom-control-input" id="defaultUnchecked12"
name="payment_info" value="Наличньыми" checked>
<label class="custom-control-label" for="defaultUnchecked12">Наличньыми</label>
<label class="custom-control-label" for="defaultUnchecked12">Оплачу по телефону</label>
</div>
<!-- Default checked -->
<div class="custom-control custom-radio">
<input type="radio" class="custom-control-input" id="defaultChecked21"
name="payment_info" value="По телефону">
<label class="custom-control-label" for="defaultChecked21">По телефону</label>
<label class="custom-control-label" for="defaultChecked21">Оплачу Наличными</label>
</div><!-- Default checked -->
<div class="custom-control custom-radio">
<input type="radio" class="custom-control-input" id="defaultChecked32"
name="payment_info" value="Online">
<label class="custom-control-label" for="defaultChecked32">Online (VISA, PayPal,
<label class="custom-control-label" for="defaultChecked32">Оплачу электронной формой оплаты (VISA, PayPal,
MasterCard, AmericanExpress)</label>
</div>
</div>
......@@ -517,22 +522,171 @@
</div>
<div class="col-md-6 select">
<input type="hidden" name="type" value="sender">
{{-- <div class="form-group form-wrap-validation">--}}
{{-- <label class="form-label" for="involve-form-country1">Выберите тип адреса <span--}}
{{-- style="color: #ff0912">*</span></label>--}}
{{-- <select class="form-control" id="involve-form-country1" name="type"--}}
{{-- data-placeholder="Выберите тип адреса" required disabled>--}}
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Закрыть</button>
<button type="submit" class="btn btn-primary">Сохранить</button>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="addRecAddressAddModal" tabindex="-1" role="dialog"
aria-labelledby="addRecAddressAddModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addRecAddressAddModalLabel">Добавление адреса получателя</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form id="addRecForm" method="post" action="{{ route('address.store') }}"
class="needs-validation border border-1 bg-white p-5">
<div class="modal-body">
@csrf
<div class="row">
<div class="col-xs-12 col-sm-4">
<div class="form-group">
<label class="form-label" for="forms-check-name1">Имя <span
style="color: #ff0912">*</span></label>
<input class="form-control" id="forms-check-name1" type="text" name="firstname"
data-constraints="@Required" placeholder="Имя" required>
</div>
</div>
<div class="col-xs-12 col-sm-4">
<div class="form-group">
<label class="form-label" for="forms-check-last-name1">Фамилия <span
style="color: #ff0912">*</span></label>
<input class="form-control" id="forms-check-last-name1" type="text"
name="secondname"
data-constraints="@Required" placeholder="Фамилия" required>
</div>
</div>
<div class="col-xs-12 col-sm-4">
<div class="form-group">
<label class="form-label" for="forms-check-last-name1">Отчество <span
style="color: #ff0912">*</span></label>
<input class="form-control" id="forms-check-last-name1" type="text"
name="fathername"
data-constraints="@Required" placeholder="Отчество" required>
</div>
</div>
</div>
{{-- <option value="sender" selected>Отправитель</option>--}}
{{-- <option value="recipient">Получатель</option>--}}
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label class="form-label" for="forms-check-company1">Паспорт серия и номер <span
style="color: #ff0912">*</span></label>
<input class="form-control" id="forms-check-company1" type="text" name="passport"
data-constraints="@Required" placeholder="Паспорт серия и номер" required>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label class="form-label" for="forms-check-company1">Когда выдан <span
style="color: #ff0912">*</span></label>
<input class="form-control" id="forms-check-company1" type="date"
name="passport_issue"
data-constraints="@Required" placeholder="Когда выдан" required>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label class="form-label" for="forms-check-company1">Кем выдан <span
style="color: #ff0912">*</span></label>
<input class="form-control" id="forms-check-company1" type="text" name="passport_by"
data-constraints="@Required" placeholder="Кем выдан" required>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<!-- RD SelectMenu-->
<div class="form-group">
<label class="form-label" for="involve-form-country1">Страна <span
style="color: #ff0912">*</span></label>
<select class="form-control" id="involve-form-country1" id="country" name="country"
data-placeholder="Select Your Country" required>
@foreach(\App\Models\Country::all() as $value)
<option value="{{ $value->id }}">{{ $value->title_ru }}</option>
@endforeach
</select>
</div>
</div>
</div>
<div class="col-xs-12 select">
<!-- RD SelectMenu-->
<div class="form-group form-wrap-validation">
<label class="form-label" for="involve-form-country1">Область <span
style="color: #ff0912">*</span></label>
<select class="form-control" id="involve-form-country1" name="city"
data-placeholder="Select Your Area" required>
@foreach(\App\Models\City::all() as $value)
<option value="{{ $value->id }}">{{ $value->title_ru }}</option>
@endforeach
</select>
</div>
</div>
{{-- </select>--}}
{{-- </div>--}}
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="form-label" for="forms-check-street">Улица <span
style="color: #ff0912">*</span></label>
<input type="text" class="form-control" id="forms-check-street" name="street"
placeholder="Улица" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="form-label" for="forms-check-house">Дом <span
style="color: #ff0912">*</span></label>
<input type="text" class="form-control" id="forms-check-house" name="house"
placeholder="Дом" required>
</div>
</div>
</div>
{{-- <button class="btn btn-primary btn-sm mt-4 shadow" type="submit">Добавить Адрес</button>--}}
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="form-label" for="forms-check-appartment">Квартира <span
style="color: #ff0912">*</span></label>
<input type="text" class="form-control" id="forms-check-appartment" name="apartment"
placeholder="Квартира" required>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="form-label" for="forms-check-postcode1">ZIP код <span
style="color: #ff0912">*</span></label>
<input class="form-control" id="forms-check-postcode1" type="text" name="zip"
data-constraints="@Required" placeholder="ZIP код" required>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-wrap">
<label class="form-label" for="forms-check-phone">Номер телефона <span
style="color: #ff0912">*</span></label>
<input class="form-control" id="forms-check-phone" type="text" name="phone"
data-constraints="@Required" placeholder="Номер телефона" required>
</div>
</div>
<div class="col-md-6 select">
<input type="hidden" name="type" value="recipient">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Закрыть</button>
......@@ -567,15 +721,16 @@
return false;
}
// var package_name = $('#package_name').val();
// if (package_name === "") {
// // Пожалуйста, введите имя для пакета
// window.alert('Пожалуйста, введите имя для пакета');
// return false;
// }
// console.log($(this).data('type'));
if ($(this).data('type') === 'outnewyork') {
$('#pickUp').hide();
$('#is_site').val(1);
}
if ($(this).data('type') === 'newyork') {
$('#pickUp').show();
$('#is_site').val(0);
}
// if (animating) return false;
// animating = true;
current_fs = $(this).parent();
next_fs = $(this).parent().next();
......@@ -586,29 +741,7 @@
next_fs.show();
//hide the current fieldset with style
current_fs.hide();
// current_fs.animate({opacity: 0}, {
// step: function (now, mx) {
// //as the opacity of current_fs reduces to 0 - stored in "now"
// //1. scale current_fs down to 80%
// scale = 1 - (1 - now) * 0.2;
// //2. bring next_fs from the right(50%)
// left = (now * 50) + "%";
// //3. increase opacity of next_fs to 1 as it moves in
// opacity = 1 - now;
// current_fs.css({
// 'transform': 'scale(' + scale + ')',
// 'position': 'absolute'
// });
// next_fs.css({'left': left, 'opacity': opacity});
// },
// duration: 800,
// complete: function () {
// current_fs.hide();
// animating = false;
// },
// //this comes from the custom easing plugin
// easing: 'easeInOutBack'
// });
});
$(".previous").click(function () {
......@@ -626,32 +759,8 @@
previous_fs.show();
//hide the current fieldset with style
current_fs.hide();
// current_fs.animate({opacity: 0}, {
// step: function (now, mx) {
// //as the opacity of current_fs reduces to 0 - stored in "now"
// //1. scale previous_fs from 80% to 100%
// scale = 0.8 + (1 - now) * 0.2;
// //2. take current_fs to the right(50%) - from 0%
// left = ((1 - now) * 50) + "%";
// //3. increase opacity of previous_fs to 1 as it moves in
// opacity = 1 - now;
// current_fs.css({'left': left});
// previous_fs.css({'transform': 'scale(' + scale + ')', 'opacity': opacity});
// },
// duration: 800,
// complete: function () {
// current_fs.hide();
// animating = false;
// },
// //this comes from the custom easing plugin
// easing: 'easeInOutBack'
// });
});
// $(".submit").click(function () {
// return false;
// })
</script>
......@@ -687,10 +796,10 @@
htmlData += "<div class='col-md-5'><div class=\"custom-control custom-radio\"\n" +
" style=\"width: 300px;height: 120px;border: 1px solid #e9ecef;padding: 10px 10px 10px 40px;margin: 6px;\">\n" +
" <input type=\"radio\" class=\"custom-control-input\"\n" +
" name=\"to_address_id\" value=\"" + value.id + "\"\n" +
" id=\"to_address_id" + value.id + "\">\n" +
" name=\"from_address\" value=\"" + value.id + "\"\n" +
" id=\"from_address" + value.id + "\">\n" +
" <label class=\"custom-control-label\"\n" +
" for=\"to_address_id" + value.id + "\">" + value.country_name + ", " + value.city_name + ", " + value.street + ", " + value.house + ", "
" for=\"from_address" + value.id + "\">" + value.country_name + ", " + value.city_name + ", " + value.street + ", " + value.house + ", "
+ value.apartment + ", " + value.zip + " | " + value.firstname + " " + value.secondname + "</label>\n" +
" </div></div>"
});
......@@ -712,6 +821,75 @@
// console.log(data[0].city_name)
var htmlData = "";
$.each(data, function (key, value) {
// console.log(key);
// console.log(value.id);
htmlData += "<div class='col-md-5'><div class=\"custom-control custom-radio\"\n" +
" style=\"width: 300px;height: 120px;border: 1px solid #e9ecef;padding: 10px 10px 10px 40px;margin: 6px;\">\n" +
" <input type=\"radio\" class=\"custom-control-input\"\n" +
" name=\"from_address\" value=\"" + value.id + "\"\n" +
" id=\"from_address" + value.id + "\">\n" +
" <label class=\"custom-control-label\"\n" +
" for=\"from_address" + value.id + "\">" + value.country_name + ", " + value.city_name + ", " + value.street + ", " + value.house + ", "
+ value.apartment + ", " + value.zip + " | " + value.firstname + " " + value.secondname + "</label>\n" +
" </div></div>"
});
$('#senderAddresses').empty();
$('#senderAddresses').append(htmlData);
}
});
$("#addRecForm").submit(function (e) {
e.preventDefault(); // avoid to execute the actual submit of the form.
var form = $(this);
var url = form.attr('action');
$.ajax({
type: "POST",
url: url,
data: form.serialize(), // serializes the form's elements.
success: function (data) {
$.ajax({
type: "GET",
url: '{{ route('package.getAddressAjaxR') }}',
success: function (data1) {
// console.log(data[0].city_name)
var htmlData = "";
$.each(data1, function (key, value) {
// console.log(key);
// console.log(value.id);
htmlData += "<div class='col-md-5'><div class=\"custom-control custom-radio\"\n" +
" style=\"width: 300px;height: 120px;border: 1px solid #e9ecef;padding: 10px 10px 10px 40px;margin: 6px;\">\n" +
" <input type=\"radio\" class=\"custom-control-input\"\n" +
" name=\"to_address_id\" value=\"" + value.id + "\"\n" +
" id=\"to_address_id" + value.id + "\">\n" +
" <label class=\"custom-control-label\"\n" +
" for=\"to_address_id" + value.id + "\">" + value.country_name + ", " + value.city_name + ", " + value.street + ", " + value.house + ", "
+ value.apartment + ", " + value.zip + " | " + value.firstname + " " + value.secondname + "</label>\n" +
" </div></div>"
});
$('#recAddresses').empty();
$('#recAddresses').append(htmlData);
}
});
$('#addRecAddressAddModal').modal('hide');
}
});
});
$.ajax({
type: "GET",
url: '{{ route('package.getAddressAjaxR') }}',
success: function (data) {
// console.log(data[0].city_name)
var htmlData = "";
$.each(data, function (key, value) {
// console.log(key);
......@@ -726,16 +904,11 @@
+ value.apartment + ", " + value.zip + " | " + value.firstname + " " + value.secondname + "</label>\n" +
" </div></div>"
});
$('#senderAddresses').empty();
$('#senderAddresses').append(htmlData);
$('#recAddresses').empty();
$('#recAddresses').append(htmlData);
}
});
// $("addSenderBtn").click(function(){
// $.ajax({url: "demo_test.txt", success: function(result){
// $("#div1").html(result);
// }});
// });
</script>
<script>
var counter = 1;
......
......@@ -36,6 +36,7 @@
<div class="">
<img width="100" height="100" src="{{ asset('android-chrome-192x192.png') }}">
<h1>FAZO CARGO INC. Tel.:(347) 547-9797</h1>
</div>
<hr />
<table border="0" style="width: 100%">
......@@ -43,7 +44,7 @@
<td><span>ПОЧТОВАЯ АДМИНИСТРАЦИЯ</span></td>
<td style="width: 70px"><span ><input type="checkbox" style="margin-right: 17px;margin-left: 10px;"> USA</span></td>
<td style="width: 50px;"><input type="checkbox" style="margin-left: 10px;"> </td>
<td><span>ТАМОЖЕННАЯ ДЕКЛАРАЦИЯ CN 23</span></td>
<td><span>ТАМОЖЕННАЯ ДЕКЛАРАЦИЯ <b>CN 23<</b></span></td>
</tr>
<tr >
<td><span>ADMINISTRATION</span></td>
......@@ -57,13 +58,13 @@
<br />
<table class="caption" style="width: 100%;">
<tr>
<td rowspan="4" class="border-right border-bottom gray-colored" style="width: 20px">FROM TO</td>
<td rowspan="4" class="border-right border-bottom gray-colored" style="width: 20px">FROM</td>
<td class="border-right gray-colored" style="width: 180px;">
Name and address of Sender <br />
Фамилия и адрес Отправителя
</td>
<td class="border-right">
Tel. 3023518293
Tel. {{ $sender->phone }}
</td>
<td class="border-right" style="width: 70px;">AGENT CODE:</td>
<td class="border-right" style="width: 123px"> - </td>
......
......@@ -76,6 +76,7 @@ Route::post('/profile/storeaddress', 'ProfileController@storeaddress')->name('ad
Route::delete('/profile/{id}', 'ProfileController@address_delete')->name('address.destroy')->middleware('auth');
Route::get('/profile', 'ProfileController@profile')->middleware('auth');
Route::post('/profile/save', 'ProfileController@save')->name('profile.save')->middleware('auth');
Route::get('/get-fedex-label/{id}', 'DeliverySytemsController@getFedexData')->middleware('auth');
//
//Route::get('/packages/list', 'PackagesController@pending_packages');
//Route::get('/packages/pending', 'PackagesController@pending_packages')->name('packagePending');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment