Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
<div class="panel panel-default panel-table">
<div class="panel-heading">
<div class="title">Recent Orders</div>
</div>
<?php if (empty($StoresConnection) && empty($ChannelConnection)) : ?>
<center><button class="btn btn-space btn-primary" id="see">Connect Your Store to see Data</button></center>
<?php else : ?>
<div class="panel-body table-responsive ">
<table id="recent_orders_dashboard" class="table-borderless table table-striped table-hover table-fw-widget dataTable">
<thead>
<tr>
<th >Order ID</th>
<th>Customer Name</th>
<th class="number12" style="text-align:left;">Amount</th>
<!-- <th style="width:20%;">Date</th> -->
<th >Status</th>
</tr>
</thead>
<tbody class="no-border-x">
<?php if (empty($orders_data_REcent)): ?>
<?php
else :
usort($orders_data_REcent, function($a,$b){
$t1 = strtotime($a->order_date);
$t2 = strtotime($b->order_date);
return $t2 - $t1;
});
foreach ($orders_data_REcent as $orders_data_value) :
$channel_abb_id = isset($orders_data_value->channel_abb_id) ? $orders_data_value->channel_abb_id : "";
$firstname = $orders_data_value->customer->first_name;
$lname = $orders_data_value->customer->last_name;
$order_amount = isset($orders_data_value->total_amount) ? $orders_data_value->total_amount : 0;
$order_value = number_format((float) $order_amount, 2, '.', '');
$date_order = date('M-d-Y', strtotime($orders_data_value->order_date));
$order_status = $orders_data_value->order_status;
$label = '';
if ($order_status == 'Completed') :
$label = 'label-success';
endif;
if ($order_status == 'Returned' || $order_status == 'Refunded' || $order_status == 'Cancel') :
$label = 'label-danger';
endif;
if ($order_status == 'In Transit' || $order_status == 'On Hold'):
$label = 'label-primary';
endif;
if ($order_status == 'Awaiting Fulfillment' || $order_status == 'Incomplete' || $order_status == 'waiting-for-shipment' || $order_status == 'Pending' || $order_status == 'Awaiting Payment' || $order_status == 'On Hold'):
$label = 'label-warning';
endif;
if ($order_status == 'Shipped'):
$label = 'label-primary';
endif;
$conversion_rate = 1;
$user = Yii::$app->user->identity;
if (isset($user->currency) and $user->currency != 'USD') {
$username = Yii::$app->params['xe_account_id'];
$password = Yii::$app->params['xe_account_api_key'];
$URL = Yii::$app->params['xe_base_url'] . 'convert_from.json/?from=USD&to=' . $user->currency . '&amount=1';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
$result = curl_exec($ch);
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); //get status code
curl_close($ch);
//echo'<pre>';
$result = json_decode($result, true);
if (isset($result) and !empty($result) and isset($result['to']) and isset($result['to'][0]) and isset($result['to'][0]['quotecurrency'])) {
$conversion_rate = $result['to'][0]['mid'];
$conversion_rate = number_format((float) $conversion_rate, 2, '.', '');
$order_value = $order_value * $conversion_rate;
$order_value = number_format((float) $order_value, 2, '.', '');
}
}
$selected_currency = backendmodelsCurrencySymbols::find()->where(['name' => strtolower($user->currency)])->select(['id', 'symbol'])->asArray()->one();
if (isset($selected_currency) and !empty($selected_currency)) {
$currency_symbol = $selected_currency['symbol'];
}
?>
<tr>
<td><a href="orders/view/<?php echo $orders_data_value->order_ID; ?>"><?= $channel_abb_id; ?></a></td>
<td class="captialize"><?= $firstname . ' ' . $lname; ?></td>
<td class="number12" style="text-align:left;"><?php echo $currency_symbol ?><?= number_format($order_value, 2); ?></td>
<!-- <td><?= $date_order; ?></td> -->
<td><span class="label <?= $label; ?>"><?= $order_status; ?></span></td>
</tr>
<?php
endforeach;
endif;
?>
</tbody>
</table>
</div>
<?php
endif;
?>
</div>
</div>
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team