<?php
/**
* Template Name: Notice Kitchen Cook
* CSS by 95Deli (Ver 2026.10)
* Connect: Flatsome-shop.php => DOASHBOARSH => KITCHEN
*/
get_header();
?>
<style>
.wpcode-order-badge {position:unset !important;}
.button {margin:0;display:block;}
.prs {display:block;padding:3px 0;border-radius: 3px;border: 1px solid;}
.appid {background:#000;color:yellow;font-size:16px;display:inline-block;;padding:3px 10px;border-radius:4px;}
.row {max-width: -webkit-fill-available;margin: 10px;flex-wrap: nowrap;}
.bsd {box-shadow:rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;border-radius: 4px;}
.footer-wrapper,.header-wrapper {display:none;}
.content-area {margin:0 10px;}
.col{padding:0;margin:0 5px;}
.woocommerce-orders-table th,.woocommerce-orders-table td{text-align: center;color: #333;}
.woocommerce-orders-table th{background:#ddd;}
.tmer {background:#000;color:#fff;padding:5px;letter-spacing: 0.05em;}
.tmer .cok {padding:0 10px;border-radius:4px;}
.ord_grd {text-align:left;}
/*Color*/
.shp_txt {background:rgb(237, 71, 0);color:rgb(255, 240, 226);}
.cok_txt { color:#fded8e;background:#7d590b;}
.cfrm_txt {color: #EAFAEA;background: #028a0f;}
.shp-dn_txt {color: #000;background:radial-gradient(circle farthest-side, #fceabb, #f8b500);;}
/*Color-END*/
@media only screen and (max-width: 757px) {.woocommerce-order-details,.ol_mb,.tmer {display:none;}.woocommerce-customer-details {margin:10px 0;}.ifod {margin:0;}.row{margin-bottom:50px;}.menuorder_cart_mobile .collapsible{color:#f7001e;}.woocommerce-button.button{display: grid;justify-items: center;font-size:8px;}}
@media only screen and (min-width: 757px) {.ifod,.dsl_mb{display:none;}.content-area {overflow:auto;max-height:440px;}}
</style>
<?php if (is_user_logged_in()) : ?>
<?php endif;?>
<style>
.box_fixRight {
position: fixed;
bottom: 100px;
right: -125px;
width: auto;
transition: all 0.2s ease-in-out 0s;
z-index: 999;
}
.box_fixRight .box_content {
background: #fff;
padding: 10px;
box-shadow: 10px 0px 30px #888888;
border-radius: 10px 0 0 10px;
}
.box_fixRight .box_content .item {
display: block;
padding: 13px 10px 13px 47px;
color: #111;
}
.box_fixRight .box_content .item:hover{color:#184b9b}
.box_fixRight .box_content .item.item_1 {
background: url(https://order.fship.vn/wp-content/uploads/2026/01/lb5.png) no-repeat left;
}
.box_fixRight .box_content .item.item_2 {
background: url(https://order.fship.vn/wp-content/uploads/2026/01/ltl.png) no-repeat left;
}
.box_fixRight .box_content .item.item_3 {
background: url(https://isharevn.net/wp-content/uploads/2021/05/iconfix-3.png) no-repeat left;
}
.box_fixRight:hover {
right: 0;
transition: all 0.2s ease-in-out 0s;
}
@media (max-width: 549px){
.box_fixRight{display:none}
}
</style>
<div class="box_fixRight">
<div class="box_content">
<a href="https://b5.fship.vn/webadmin/notice-kitchen-cook/" class="item item_1">Đơn Lẩu Bà 5</a>
<a href="https://order.fship.vn/webadmin/notice-kitchen-cook" class="item item_2 hidden">POS đặt hàng</a>
</div>
</div>
<div class="tmer flex justify-between">
<div><? echo $today = date_i18n("l - d/m/Y");?></div><div>Đơn đang xác nhận chế biến <? echo do_shortcode( '[pending_failed_order_count]' );?></div><div class="cok strong">95Deli - BẾP CHÚ 9</div></div>
<div class="woocommerce-order row">
<div class="large-6 col bsd ol_mb">
<div class="text-center"><h3 class="cok_txt">ĐƠN CHỜ CHẾ BIẾN <? echo do_shortcode( '[woocommerce_cook_audio_alert]' ); ?></h3></div>
<div id="primary" class="content-area">
<main id="main" class="site-main">
<?php
if ( $order ) {
$orders = wc_get_orders(array(
'limit' => -1, // Number of orders to fetch
'status' => array( 'wc-cook-done'),
'orderby' => 'date',
'order' => 'DESC',
));
if (!empty($orders)) {
echo '<table class="woocommerce-orders-table">';
echo '<tr><th>ĐƠN HÀNG</th><th>XÁC NHẬN</th><th>GHI CHÚ ĐƠN</th></tr>';
foreach ($orders as $order) {
$order_id = $order->get_id();
$order_key = $order->get_order_key();
$now = $order->get_date_modified() ? $order->get_date_modified()->date_i18n('H:i') : '';
$cod = $order->get_total();
$payment_50 = wc_price( floor(( $cod / 2 )/1000)*1000);
$chosen_gateway = $order->get_payment_method();
if ( $chosen_gateway === 'bacs' ) {
$description = 'Thu tiền COD <span class="cfrm">'.$payment_50.'</span>';
} elseif ( $chosen_gateway === 'sepay' ) {
$description = 'Đơn chuyển khoản (KHÔNG THU COD)';
} elseif ( $chosen_gateway === 'cod' ) {
$description = 'Thu tiền '.wc_price( $cod).'(Đơn COD)';
}
$statuses = array( 'cook-done' ); // Define order statuses
if ($order->has_status($statuses)) {
$button = '<a style="margin-top: 5px;" target="_blank" href="' .get_site_url( null, 'wcpdf/invoice/'.$order_id.'/'.$order_key.'/pdf', 'http' ). '" class="prs">In Hóa Đơn</a>';
$url = '<a class="woocommerce-button button shp" href="' .wp_nonce_url(
add_query_arg(array( 'confirm-order' => $order->get_id() ),wc_get_endpoint_url( '', '', get_permalink( get_option('') ) )),'woocommerce-confirm-order').'"><img width="30" height="30" src="https://img.icons8.com/stickers/100/supplier.png" alt="supplier"/>
SHIPPER ĐÃ LẤY ĐƠN</a>';
$order_ids = '<mark>#'.$order_id.'</mark>';
$note ='Giờ tiếp nhận<br>'.$now.'';
$button_2 ='<div class="ord_grd">
<div><i class="fa-regular fa-address-card"></i></div>
<div>'.$description.'</div>
<div><i class="fa-solid fa-map-location"></i></div>
<div>'.$order->get_billing_address_1().'</div>
</div>';
};
echo "<tr>
<td style='width: 30%;'>{$order_ids}{$button}</td>
<td>{$url}</td>
<td style='width: 30%;'>{$note}</td>
</tr>
<tr class='brd_tb'><td colspan='3' style='
border-bottom: 10px solid #ddd;'>{$button_2}</td></tr>
</tr>";
}
echo '</table>';
} else {
echo '<p>Chưa có đơn chờ giao đi</p>';
}
}
?>
</main><!-- #main -->*/?>
</div><!-- #primary -->
</div></div>
<?/*<div class="isures-menu--mobile_wrap">
<div class="isures-inner--mobile_wrap">
<div class="b5-menu_wrap">
<ul id="option-menu">
<li><a href="https://b5.fship.vn/webadmin/notice-kitchen-cook"><span>Đơn giao Bà 5</span></a></li><li><a href="https://b5.fship.vn/webadmin/orders-receive">Quản lý đơn hàng</a></li></ul></div></div></div>*/?>
<?php
get_footer();