|
10 | 10 | .two-col { |
11 | 11 | display: grid; |
12 | 12 | grid-template-columns: 1fr 1fr; |
13 | | - gap: 10px; |
| 13 | + gap: 30px; |
14 | 14 | /* align-items: center; */ |
15 | 15 | } |
16 | 16 |
|
|
23 | 23 | } |
24 | 24 |
|
25 | 25 | .expected-delivery .success { |
26 | | - background-color: #d4edda; |
27 | | - color: #155724 |
| 26 | + /* background-color: #d4edda;*/ |
| 27 | + /* color: #155724; */ |
| 28 | + border: 1px solid #CCC; |
28 | 29 | } |
29 | 30 |
|
30 | 31 | .expected-delivery .error { |
|
59 | 60 | Delhivery Tracking | {{ config('app.name') }} |
60 | 61 | </x-slot> |
61 | 62 | <div class="main" style="padding-bottom: 300px"> |
62 | | - <div class="container mt-[30px] px-[60px] max-lg:px-[30px]"> |
| 63 | + <br /> |
| 64 | + <br /> |
| 65 | + <div class="container"> |
63 | 66 | <div class="two-col"> |
64 | 67 | <div> |
65 | | - <h1 style="font-size: 24px; margin-bottom: 20px">Track Your Order</h1> |
66 | | - <p>Enter your <strong>AWB Number</strong></p> |
67 | | - <form class="two-col" method="GET"> |
68 | | - <div class="form-group"> |
69 | | - {{-- <label for="awbCode">Tracking number</label> --}} |
70 | | - <input type="text" |
71 | | - class="block w-full px-[14px] py-[14px] bg-[#F5F5F5] rounded-lg text-gray-900 text-lg font-medium transition-all border border-transparent hover:border-gray-400 focus:border-gray-400" |
72 | | - name="awbCode" id="awbCode" class="form-control" value="{{ $awbCode }}"> |
73 | | - </div> |
74 | | - <div class="btn-container"> |
75 | | - <button type="submit" class="primary-button ">Track</button> |
76 | | - </div> |
77 | | - </form> |
78 | | - </div> |
79 | | - <div class="expected-delivery"> |
80 | | - @if (isset($tracking_data['Status'])) |
81 | | - @php |
82 | | -
|
83 | | - $current_status = |
84 | | - isset($tracking_data['Status']) && isset($tracking_data['Status']) |
85 | | - ? $tracking_data['Status']['Status'] |
86 | | - : false; |
87 | | - $has_delivered = $current_status == 'Delivered'; |
88 | | - $etd = |
89 | | - isset($tracking_data['ExpectedDeliveryDate']) && |
90 | | - !empty($tracking_data['ExpectedDeliveryDate']) |
91 | | - ? $tracking_data['ExpectedDeliveryDate'] |
92 | | - : false; |
93 | | - $courier_name = 'Delhivery'; |
94 | | - $origin = |
95 | | - isset($tracking_data['Origin']) && !empty($tracking_data['Origin']) |
96 | | - ? $tracking_data['Origin'] |
97 | | - : false; |
98 | | - $destination = |
99 | | - isset($tracking_data['Destination']) && !empty($tracking_data['Destination']) |
100 | | - ? $tracking_data['Destination'] |
101 | | - : false; |
102 | | - $delivered_date = isset($tracking_data['DeliveryDate']) |
103 | | - ? !empty($tracking_data['DeliveryDate']) |
104 | | - : false; |
105 | | -
|
106 | | - @endphp |
107 | | - <div class="{{ $has_delivered ? 'success' : 'pending' }}"> |
108 | | - @if (!$has_delivered && $etd) |
109 | | - <div class="expected-delivery-date"> |
110 | | - Estimated Delivery Time |
111 | | - </div> |
112 | | - <time style="font-size: 1.5rem">{{ $etd }}</time><br /> |
113 | | - {{-- <time style="font-size: 1.5rem">{{ $tracking_data['ExpectedDeliveryDate'] ?? '' }}</time><br /> --}} |
114 | | - @endif |
115 | | - <p> |
116 | | - Current Status - <strong>{{ $current_status }}</strong> |
117 | | - <br /> |
118 | | - Courier Name - <strong>{{ $courier_name }}</strong> |
119 | | - <br /> |
120 | | - {{ $has_delivered ? 'Delivered on ' . $delivered_date : '' }} |
121 | | - </p> |
122 | | - @if ($origin && $destination) |
123 | | - <br /> |
124 | | - <hr /> |
125 | | - <div class="flex items-center" style="justify-content: space-around"> |
126 | | - <span> |
127 | | - From |
128 | | - <br> |
129 | | - <strong>{{ $origin }}</strong> |
130 | | - </span> |
131 | | - <span style="font-size: 48px">></span> |
132 | | - <span> |
133 | | - To |
134 | | - <br> |
135 | | - <strong>{{ $destination }}</strong> |
136 | | - </span> |
137 | | - </div> |
138 | | - @endif |
139 | | - </div> |
140 | | - @endif |
141 | | - </div> |
142 | | - </div> |
143 | | - <div> |
144 | | - |
145 | | - @if (!$tracking_data || ($tracking_data && isset($tracking_data['Success']) && $tracking_data['Success'] == false)) |
| 68 | + <div> |
| 69 | + <h1 style="font-size: 24px; margin-bottom: 20px">Track Your Order</h1> |
| 70 | + <p>Enter your <strong>AWB Number</strong></p> |
| 71 | + <form class="two-col" method="GET"> |
| 72 | + <div class="form-group"> |
| 73 | + {{-- <label for="awbCode">Tracking number</label> --}} |
| 74 | + <input type="text" |
| 75 | + class="w-full mb-3 py-3 px-5 shadow border rounded-lg text-sm text-gray-600 transition-all hover:border-gray-400 focus:border-gray-400" |
| 76 | + name="awbCode" id="awbCode" class="form-control" value="{{ $awbCode }}"> |
| 77 | + </div> |
| 78 | + <div class="btn-container"> |
| 79 | + <button type="submit" class="primary-button py-3 px-11 rounded-2xl">Track</button> |
| 80 | + </div> |
| 81 | + </form> |
| 82 | + </div> |
146 | 83 | <br /> |
147 | 84 | <div class="expected-delivery"> |
148 | | - <div class="error">No tracking found</div> |
| 85 | + {{-- @dd($tracking_data) --}} |
| 86 | + @if (isset($tracking_data['Status'])) |
| 87 | + @php |
| 88 | +
|
| 89 | + $current_status = |
| 90 | + isset($tracking_data['Status']) && isset($tracking_data['Status']) |
| 91 | + ? $tracking_data['Status']['Status'] |
| 92 | + : false; |
| 93 | + $has_delivered = $current_status == 'Delivered'; |
| 94 | + $etd = |
| 95 | + isset($tracking_data['ExpectedDeliveryDate']) && |
| 96 | + !empty($tracking_data['ExpectedDeliveryDate']) |
| 97 | + ? $tracking_data['ExpectedDeliveryDate'] |
| 98 | + : false; |
| 99 | +
|
| 100 | + $courier_name = 'Delhivery'; |
| 101 | + $origin = |
| 102 | + isset($tracking_data['Origin']) && !empty($tracking_data['Origin']) |
| 103 | + ? $tracking_data['Origin'] |
| 104 | + : false; |
| 105 | + $destination = |
| 106 | + isset($tracking_data['Destination']) && !empty($tracking_data['Destination']) |
| 107 | + ? $tracking_data['Destination'] |
| 108 | + : false; |
| 109 | + $delivered_date = |
| 110 | + isset($tracking_data['DeliveryDate']) && !empty($tracking_data['DeliveryDate']) |
| 111 | + ? $tracking_data['DeliveryDate'] |
| 112 | + : false; |
| 113 | +
|
| 114 | + @endphp |
| 115 | + <div class="{{ $has_delivered ? 'success' : 'pending' }}"> |
| 116 | + @if (!$has_delivered && $etd) |
| 117 | + <div class="expected-delivery-date"> |
| 118 | + Estimated Delivery Time |
| 119 | + </div> |
| 120 | + <time style="font-size: 1.5rem">{{ $etd }}</time><br /> |
| 121 | + {{-- <time style="font-size: 1.5rem">{{ $tracking_data['ExpectedDeliveryDate'] ?? '' }}</time><br /> --}} |
| 122 | + @endif |
| 123 | + <div style=""> |
| 124 | + <div style="display: flex; justify-content: space-between; margin-bottom: 20px"> |
| 125 | + <span>Current Status - <strong>{{ $current_status }}</strong></span> |
| 126 | + |
| 127 | + <span>Courier Name - <strong>{{ $courier_name }}</strong></span> |
| 128 | + </div> |
| 129 | + |
| 130 | + @if ($has_delivered) |
| 131 | + <div style='background-color: green; padding: 10px; color: #FFF;'> |
| 132 | + Delivered on |
| 133 | + {{ \Carbon\Carbon::parse($delivered_date)->toDateTimeString() }} |
| 134 | + </div> |
| 135 | + @endif |
| 136 | + </div> |
| 137 | + @if ($origin && $destination) |
| 138 | + <br /> |
| 139 | + <hr /> |
| 140 | + <div class="flex items-center" style="justify-content: space-around"> |
| 141 | + <span> |
| 142 | + From |
| 143 | + <br> |
| 144 | + <strong>{{ $origin }}</strong> |
| 145 | + </span> |
| 146 | + <span style="font-size: 48px">></span> |
| 147 | + <span> |
| 148 | + To |
| 149 | + <br> |
| 150 | + <strong>{{ $destination }}</strong> |
| 151 | + </span> |
| 152 | + </div> |
| 153 | + @endif |
| 154 | + </div> |
| 155 | + @endif |
149 | 156 | </div> |
150 | | - @endif |
| 157 | + </div> |
| 158 | + <div> |
| 159 | + |
| 160 | + @if (!$tracking_data || ($tracking_data && isset($tracking_data['Success']) && $tracking_data['Success'] == false)) |
| 161 | + <br /> |
| 162 | + <div class="expected-delivery"> |
| 163 | + <div class="error">No tracking found</div> |
| 164 | + </div> |
| 165 | + @endif |
151 | 166 |
|
152 | | - @if (isset($tracking_data) && !empty($tracking_data)) |
153 | | - @if (isset($tracking_data['Status'])) |
154 | | - {{-- @if (isset($tracking_data['shipment_track']) && isset($tracking_data['shipment_track'][0]) && $tracking_data['shipment_track'][0]['current_status']) |
| 167 | + @if (isset($tracking_data) && !empty($tracking_data)) |
| 168 | + @if (isset($tracking_data['Status'])) |
| 169 | + {{-- @if (isset($tracking_data['shipment_track']) && isset($tracking_data['shipment_track'][0]) && $tracking_data['shipment_track'][0]['current_status']) |
155 | 170 | <div> |
156 | 171 | Current Status - {{ $tracking_data['shipment_track'][0]['current_status'] }} |
157 | 172 | </div> |
158 | 173 | @endif --}} |
159 | | - <br /> |
160 | | - <hr> |
161 | | - <br /> |
| 174 | + <br /> |
| 175 | + <br /> |
| 176 | + <div style="overflow-y: auto; "> |
| 177 | + <ol class="relative" |
| 178 | + style="border-left: 1px solid rgb(219, 234, 254); max-height: 600px; "> |
| 179 | + @foreach (collect($tracking_data['Scans'])->reverse() as $key => $activity) |
| 180 | + @php |
| 181 | + $activity = $activity['ScanDetail']; |
| 182 | + @endphp |
| 183 | + <li class="tracking-item"> |
| 184 | + <div class="absolute" style="left: -7px; top: 0"> |
162 | 185 |
|
163 | | - <ol class="relative border-s border-gray-200 dark:border-gray-700"> |
164 | | - @foreach ($tracking_data['Scans'] as $key => $activity) |
165 | | - @php |
166 | | - $activity = $activity['ScanDetail']; |
167 | | - @endphp |
168 | | - <li class="tracking-item"> |
169 | | - <div class="absolute" style="left: -7px; top: 0"> |
170 | | - |
171 | | - <time class="mb-1 text-sm font-normal leading-none dark:text-gray-500 px-2 py-1" |
172 | | - style="background-color: rgb(219 234 254)"> |
173 | | - <span |
174 | | - class="text-sm icon-calendar inline-block text-[24px] cursor-pointer"></span> |
175 | | - {{ $activity['ScanDateTime'] }} |
176 | | - </time> |
177 | | - </div> |
178 | | - <div style="margin-bottom: 28px; margin-top: 18px"> |
179 | | - <h3 class="text-lg mb-2 text-gray-900 dark:text-white"> |
180 | | - {{ $activity['Scan'] }}</h3> |
181 | | - <p class="text-lg mb-2 text-gray-900 dark:text-white"> |
182 | | - {{ $activity['Instructions'] }}</p> |
183 | | - <p class="text-base font-normal text-gray-500 dark:text-gray-400">Location - |
184 | | - {{ $activity['ScannedLocation'] }}</p> |
185 | | - </div> |
186 | | - </li> |
187 | | - @endforeach |
188 | | - </ol> |
| 186 | + <time |
| 187 | + class="mb-1 text-sm font-normal leading-none dark:text-gray-500 px-2 py-1" |
| 188 | + style="background-color: rgb(219 234 254)"> |
| 189 | + <span |
| 190 | + class="text-sm icon-calendar inline-block text-[24px] cursor-pointer"></span> |
| 191 | + {{ Carbon\Carbon::parse($activity['ScanDateTime'])->toDateTimeString() }} |
| 192 | + </time> |
| 193 | + </div> |
| 194 | + <div style="margin-bottom: 28px; margin-top: 18px"> |
| 195 | + <h3 class="text-lg mb-2 text-gray-900 dark:text-white"> |
| 196 | + {{ $activity['Scan'] }}</h3> |
| 197 | + <p class="text-lg mb-2 text-gray-900 dark:text-white"> |
| 198 | + {{ $activity['Instructions'] }}</p> |
| 199 | + <p class="text-base font-normal text-gray-500 dark:text-gray-400"> |
| 200 | + Location - |
| 201 | + {{ $activity['ScannedLocation'] }}</p> |
| 202 | + </div> |
| 203 | + </li> |
| 204 | + @endforeach |
| 205 | + </ol> |
| 206 | + </div> |
| 207 | + @endif |
189 | 208 | @endif |
190 | | - @endif |
| 209 | + </div> |
191 | 210 | </div> |
| 211 | + |
192 | 212 | </div> |
193 | 213 | </div> |
194 | 214 | </x-shop::layouts> |
0 commit comments