<?php
/* Smarty version 3.1.33, created on 2021-02-20 17:40:16
  from '/home/mycopjya/admin.mycodingassignment.com/content/themes/dashboard/order/order.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.33',
  'unifunc' => 'content_603149809cd353_01505520',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'b6f6129a0dab77920e15a55fa7322df02b17a2d3' => 
    array (
      0 => '/home/mycopjya/admin.mycodingassignment.com/content/themes/dashboard/order/order.tpl',
      1 => 1597565357,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:dashboard/order/_order.file.tpl' => 2,
  ),
),false)) {
function content_603149809cd353_01505520 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_loadInheritance();
$_smarty_tpl->inheritance->init($_smarty_tpl, true);
?>
 

<?php 
$_smarty_tpl->inheritance->instanceBlock($_smarty_tpl, 'Block_14841584386031498093d465_38916798', 'content_wrapper');
?>

<?php $_smarty_tpl->inheritance->endChild($_smarty_tpl, 'dashboard/layout.tpl');
}
/* {block 'content_wrapper'} */
class Block_14841584386031498093d465_38916798 extends Smarty_Internal_Block
{
public $subBlocks = array (
  'content_wrapper' => 
  array (
    0 => 'Block_14841584386031498093d465_38916798',
  ),
);
public function callBlock(Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_checkPlugins(array(0=>array('file'=>'/home/mycopjya/admin.mycodingassignment.com/vendor/smarty/smarty/libs/plugins/modifier.capitalize.php','function'=>'smarty_modifier_capitalize',),));
?>


    <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "instructions" || $_smarty_tpl->tpl_vars['sub_view']->value == "files" || $_smarty_tpl->tpl_vars['sub_view']->value == "messages" || $_smarty_tpl->tpl_vars['sub_view']->value == "history") {?>

        <div class="card">
            <div class="card-header with-icon with-nav">
                
                <div class="mb20">
                    <div class="pull-right flip">
                                                <?php if ($_smarty_tpl->tpl_vars['user']->value['is_writer']) {?>

                                                        <?php if ($_smarty_tpl->tpl_vars['order']->value['status'] == "19" || $_smarty_tpl->tpl_vars['order']->value['status'] == "16" || $_smarty_tpl->tpl_vars['order']->value['status'] == "7" || $_smarty_tpl->tpl_vars['order']->value['status'] == "17") {?>
                                <?php if ($_smarty_tpl->tpl_vars['has_bidded']->value) {?>
                                    <button data-toggle="tooltip" data-bid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['bid']->value['bid_id'], ENT_QUOTES, 'UTF-8');?>
" data-title="The bid you have placed equals to - $<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['bid']->value['amount'], ENT_QUOTES, 'UTF-8');?>
 on <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['bid']->value['date_add'], ENT_QUOTES, 'UTF-8');?>
" data-oid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
" class="btn btn-warning js_remove-bid">Remove Bid</button>
                                <?php } else { ?>
                                    <button data-toggle="tooltip" data-title="Place your bid, if you are ready to execute this order for <?php echo htmlspecialchars(formatPrice($_smarty_tpl->tpl_vars['order']->value['writerPay']), ENT_QUOTES, 'UTF-8');?>
" data-oid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
" class="btn btn-info js_place-bid">Place Bid</button>
                                <?php }?>
                            <?php }?>

                                                        <?php if ($_smarty_tpl->tpl_vars['order']->value['status'] == "6") {?>

                                <?php if (!$_smarty_tpl->tpl_vars['order']->value['writerConfirmed']) {?>
                                    <button data-toggle="tooltip" data-title="I will work on the order" class="btn btn-success js_confirm-order" data-action="accept" data-oid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
">
                                        <i class="fa fa-check fa-fw mr5"></i> Accept
                                    </button>

                                    <button data-toggle="tooltip" data-title="I cannot work on the order at the moment" class="btn btn-danger js_confirm-order" data-action="decline" data-oid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
">
                                        <i class="fa fa-times fa-fw mr5"></i> Decline
                                    </button>
                                <?php } else { ?>
                                    <?php if ($_smarty_tpl->tpl_vars['order']->value['canSubmitOrder']) {?>
                                        <?php if (!$_smarty_tpl->tpl_vars['editor_account_enabled']->value) {?>
                                            <button data-toggle="tooltip" data-title="Deliver order to customer" class="btn btn-success js_deliver-order" data-oid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
">
                                                <i class="fa fa-check fa-fw mr5"></i> Deliver Order
                                            </button>
                                        <?php } else { ?>
                                            <button data-toggle="tooltip" data-title="I have completed the order" class="btn btn-success js_complete-order" data-oid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
">
                                                <i class="fa fa-check fa-fw mr5"></i> Mark as Complete
                                            </button>
                                        <?php }?>
                                    <?php }?>
                                <?php }?>

                            <?php }?>

                                                        <?php if ($_smarty_tpl->tpl_vars['order']->value['status'] == "14" && $_smarty_tpl->tpl_vars['order']->value['canSubmitOrder']) {?>
                                <?php if (!$_smarty_tpl->tpl_vars['editor_account_enabled']->value) {?>
                                    <button data-toggle="tooltip" data-title="Deliver order to customer" class="btn btn-success js_deliver-order" data-oid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
">
                                        <i class="fa fa-check fa-fw mr5"></i> Deliver Order
                                    </button>
                                <?php } else { ?>
                                    <button data-toggle="tooltip" data-title="I have completed the order" class="btn btn-success js_complete-order" data-oid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
">
                                        <i class="fa fa-check fa-fw mr5"></i> Mark as Complete
                                    </button>
                                <?php }?>
                            <?php }?>
                            
                        <?php }?>

                                                <?php if ($_smarty_tpl->tpl_vars['user']->value['is_editor']) {?>
                                                        <?php if ($_smarty_tpl->tpl_vars['order']->value['status'] == "8" && !$_smarty_tpl->tpl_vars['order']->value['editorAssigned']) {?>
                                <button data-toggle="tooltip" data-title="Take and work on this order" class="btn btn-success js_take-order" data-oid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
">
                                    <i class="fa fa-check fa-fw mr5"></i> Take Order
                                </button>
                            <?php }?>

                                                        <?php if ($_smarty_tpl->tpl_vars['order']->value['status'] == "8" && $_smarty_tpl->tpl_vars['order']->value['editorAssigned']) {?>
                                <button data-options='{"order_id":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
}' data-toggle="modal" data-url="#revision" data-title="Send order to Revision" class="btn btn-danger" data-oid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
">
                                    Revision
                                </button>
                                
                                <button data-toggle="tooltip" data-title="Deliver order to customer" class="btn btn-success js_deliver-order" data-oid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
">
                                    <i class="fa fa-check fa-fw mr5"></i> Deliver Order
                                </button>
                            <?php }?>
                        <?php }?>

                                                <?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) {?>

                                                        <?php if ($_smarty_tpl->tpl_vars['order']->value['status'] == "0") {?>
                                <button data-toggle="tooltip" data-title="Make this order available to writers" data-oid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
" class="btn btn-info js_mark-as-paid">Mark as Paid</button>
                            <?php }?>

                            <?php if ($_smarty_tpl->tpl_vars['order']->value['status'] == "6" || $_smarty_tpl->tpl_vars['order']->value['status'] == "7" || $_smarty_tpl->tpl_vars['order']->value['status'] == "8") {?>
                                <button data-toggle="tooltip" data-title="Deliver order to customer" class="btn btn-success js_deliver-order" data-oid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
">
                                    Deliver Order
                                </button>
                            <?php }?>

                            <?php if ($_smarty_tpl->tpl_vars['order']->value['status'] == "8") {?>
                                <button data-options='{"order_id":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
}' data-toggle="modal" data-url="#revision" data-title="Send order to Revision" class="btn btn-danger" data-oid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
">
                                    Revision
                                </button> 
                            <?php }?>

                            <?php if ($_smarty_tpl->tpl_vars['sub_view']->value != "assign") {?>
                                <?php if ($_smarty_tpl->tpl_vars['order']->value['paid'] && $_smarty_tpl->tpl_vars['order']->value['status'] != "10" && $_smarty_tpl->tpl_vars['order']->value['status'] != "1") {?>
                                    <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/order/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
/assign" class="btn btn-info">
                                        <i class="fa fa-users fa-fw mr5"></i> Assign Order
                                    </a>
                                <?php }?>

                                <a data-toggle="tooltip" data-title="Edit Order" href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/order/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
/edit" class="btn btn-info">
                                    <i class="fa fa-edit fa-fw mr5"></i> Edit
                                </a>
                            <?php }?>

                        <?php }?>
                        
                        <?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0], array( array('h'=>'displayOrderActions','order'=>$_smarty_tpl->tpl_vars['order']->value),$_smarty_tpl ) );?>

                    </div>                            

                    <i class="fa fa-shopping-basket mr10"></i>
                    <strong>Orders</strong>
                    &rsaquo; <strong>#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
</strong>
                    <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "instructions" || $_smarty_tpl->tpl_vars['sub_view']->value == "files" || $_smarty_tpl->tpl_vars['sub_view']->value == "messages" || $_smarty_tpl->tpl_vars['sub_view']->value == "history") {?>&rsaquo; <strong><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['statusTitle'], ENT_QUOTES, 'UTF-8');?>
</strong><?php }?>
                </div>

                <!-- tabs nav -->
                <ul class="nav nav-tabs admin">
                    <li class="nav-item">
                        <a class="nav-link <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "instructions") {?> active <?php }?>" href="#instructions" data-toggle="tab">
                            <strong class="pr5">Instructions</strong>
                        </a>
                    </li>
                    <?php if ($_smarty_tpl->tpl_vars['order']->value['progressiveDeliveryHidden']) {?>
                    <li class="nav-item">
                        <a class="nav-link <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "#progressive-delivery") {?> active <?php }?>" href="#progressive-delivery" data-toggle="tab">
                            <strong class="pr5">Progressive Delivery</strong>
                        </a>
                    </li>
                    <?php }?>
                    <li class="nav-item">
                        <a class="nav-link <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "files") {?> active <?php }?>" href="#files" data-toggle="tab">
                            <strong class="pr5">All Files <?php if ($_smarty_tpl->tpl_vars['order']->value['allFilesCount']) {?> (<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['allFilesCount'], ENT_QUOTES, 'UTF-8');?>
) <?php }?></strong>
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "messages") {?> active <?php }?>" href="#messages" data-toggle="tab">
                            <strong class="pr5">Messages <?php if ($_smarty_tpl->tpl_vars['order']->value['allMessagesCount']) {?> (<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['allMessagesCount'], ENT_QUOTES, 'UTF-8');?>
) <?php }?></strong>
                        </a>
                    </li>

                    <?php if (count($_smarty_tpl->tpl_vars['orderHistory']->value)) {?>
                        <li class="nav-item">
                            <a class="nav-link <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "history") {?> active <?php }?>" href="#order-history" data-toggle="tab">
                                <strong class="pr5">Order History</strong>
                            </a>
                        </li>
                    <?php }?>
                </ul>
                <!-- tabs nav -->

            </div>

            <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "instructions" || $_smarty_tpl->tpl_vars['sub_view']->value == "files" || $_smarty_tpl->tpl_vars['sub_view']->value == "messages" || $_smarty_tpl->tpl_vars['sub_view']->value == "history") {?>

                <div class="card-body">

                    <!-- tabs content -->
                    <div class="tab-content">

                        <!-- instructions tab -->
                        <div class="tab-pane <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "instructions") {?>active<?php }?>" id="instructions">
                           
                            <table width="100%" cellspacing="0" cellpadding="0" border="0" class="table_info">
                                <tbody>
                                    <tr class="first">
                                        <th>Type of service:</th>
                                        <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['serviceTypeTitle'], ENT_QUOTES, 'UTF-8');?>
</td>
                                    </tr>
                                    <?php if (($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) && $_smarty_tpl->tpl_vars['order']->value['trackingId']) {?>
                                        <tr>
                                            <th>Tracking ID:</th>
                                            <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['trackingId'], ENT_QUOTES, 'UTF-8');?>
</td>
                                        </tr>
                                    <?php }?>
                                    <?php if (($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) && count($_smarty_tpl->tpl_vars['order']->value['services'])) {?>
                                        <tr>
                                            <th>Additional services:</th>
                                            <td>
                                                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['order']->value['services'], 'service');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['service']->value) {
?>
                                                    <output class="fw-bold"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['service']->value['title'], ENT_QUOTES, 'UTF-8');?>
 - <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['service']->value['description'], ENT_QUOTES, 'UTF-8');?>
</output>
                                                <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                                            </div>
                                        </tr>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) {?>
                                        <tr>
                                            <th><?php if ($_smarty_tpl->tpl_vars['order']->value['ukForm']) {?>Desirable grade<?php } else { ?>Writer category<?php }?>:</th>
                                            <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['writerCategoryTitle'], ENT_QUOTES, 'UTF-8');?>
</td>
                                        </tr>
                                    <?php }?>
                                    <tr>
                                        <th>Work type:</th>
                                        <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['paperTypeTitle'], ENT_QUOTES, 'UTF-8');?>
 <?php if ($_smarty_tpl->tpl_vars['order']->value['paperType'] == "64") {?>: <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['paperTypeOption'], ENT_QUOTES, 'UTF-8');?>
 <?php }?></td>
                                    </tr>
                                    <tr>
                                        <th>Format:</th>
                                        <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['paperFormatTitle'], ENT_QUOTES, 'UTF-8');?>
 <?php if ($_smarty_tpl->tpl_vars['order']->value['paperFormat'] == "4") {?>: <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['paperFormatTypeOption'], ENT_QUOTES, 'UTF-8');?>
 <?php }?></td>
                                    </tr>
                                    <tr>
                                        <th>Pages:</th>
                                        <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['pages'], ENT_QUOTES, 'UTF-8');?>
 pages (<?php if ($_smarty_tpl->tpl_vars['order']->value['spacing'] == 'single') {?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['pages']*550, ENT_QUOTES, 'UTF-8');?>
 <?php } else { ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['pages']*275, ENT_QUOTES, 'UTF-8');?>
 <?php }?> words, <?php echo htmlspecialchars(smarty_modifier_capitalize($_smarty_tpl->tpl_vars['order']->value['spacing']), ENT_QUOTES, 'UTF-8');?>
 spaced</td>
                                    </tr>
                                    <?php if ($_smarty_tpl->tpl_vars['order']->value['slides']) {?>
                                        <tr>
                                            <th>Slides:</th>
                                            <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['slides'], ENT_QUOTES, 'UTF-8');?>
</td>
                                        </tr>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['order']->value['charts']) {?>
                                        <tr>
                                            <th>Charts:</th>
                                            <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['charts'], ENT_QUOTES, 'UTF-8');?>
</td>
                                        </tr>
                                    <?php }?>
                                    <tr>
                                        <th>Deadline:</th>
                                        <td>
                                            <span class="js_moment" data-time="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['deadline'], ENT_QUOTES, 'UTF-8');?>
"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['deadline'], ENT_QUOTES, 'UTF-8');?>
</span> (<?php echo $_smarty_tpl->tpl_vars['order']->value['timeLeftHtml'];?>
)
                                            <?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) {?>
                                                <span data-toggle="modal" data-url="#extendDeadlineModal" data-size="small" data-options='{"order_id":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
,"handle":"customer"}' class="btn btn-secondary btn-xs pull-right"><i class="fa fa-edit"></i> Change</span>
                                            <?php }?>
                                        </td>
                                    </tr>
                                    
                                    <?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) {?>
                                        <?php if ($_smarty_tpl->tpl_vars['order']->value['paid']) {?>
                                            <tr>
                                                <th>Writer deadline:</th>
                                                <td>
                                                    <span class="js_moment" data-time="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['writerDeadline'], ENT_QUOTES, 'UTF-8');?>
"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['writerDeadline'], ENT_QUOTES, 'UTF-8');?>
</span> (<?php echo $_smarty_tpl->tpl_vars['order']->value['writerTimeLeftHtml'];?>
)
                                                    <?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) {?>
                                                        <span data-toggle="modal" data-url="#extendDeadlineModal" data-size="small" data-options='{"order_id":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
,"handle":"writer"}' class="btn btn-secondary btn-xs pull-right"><i class="fa fa-edit"></i> Change</span>
                                                    <?php }?>
                                                </td>
                                            </tr>
                                        <?php }?>
                                        <tr>
                                            <th>Created At:</th>
                                            <td>
                                                <span class="js_moment" data-time="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['createdAt'], ENT_QUOTES, 'UTF-8');?>
"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['createdAt'], ENT_QUOTES, 'UTF-8');?>
</span>
                                            </td>
                                        </tr>
                                        <?php if ($_smarty_tpl->tpl_vars['order']->value['status'] == "11" || $_smarty_tpl->tpl_vars['order']->value['status'] == "10") {?>
                                            <tr>
                                                <th>Delivered At:</th>
                                                <td>
                                                    <span class="js_moment" data-time="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['finishedAt'], ENT_QUOTES, 'UTF-8');?>
"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['finishedAt'], ENT_QUOTES, 'UTF-8');?>
</span>
                                                </td>
                                            </tr>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['order']->value['status'] == "10") {?>
                                            <tr>
                                                <th>Approved At:</th>
                                                <td>
                                                    <span class="js_moment" data-time="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['approvedAt'], ENT_QUOTES, 'UTF-8');?>
"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['approvedAt'], ENT_QUOTES, 'UTF-8');?>
</span>
                                                </td>
                                            </tr>
                                        <?php }?>
                                        <?php if ($_smarty_tpl->tpl_vars['order']->value['status'] == "9") {?>
                                            <tr>
                                                <th>Cancelled At:</th>
                                                <td>
                                                    <span class="js_moment" data-time="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['cancelledDate'], ENT_QUOTES, 'UTF-8');?>
"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['cancelledDate'], ENT_QUOTES, 'UTF-8');?>
</span>
                                                </td>
                                            </tr>
                                        <?php }?>
                                    <?php }?>
                                </tbody>
                            </table>
                            <table width="100%" cellspacing="0" cellpadding="0" border="0" class="table_info">
                                <tbody>
                                    <tr class="first">
                                        <th>Academic level:</th>
                                        <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['academicLevelTitle'], ENT_QUOTES, 'UTF-8');?>
</td>
                                    </tr>
                                    <tr>
                                        <th>Subject or discipline:</th>
                                        <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['topcat'], ENT_QUOTES, 'UTF-8');?>
 <?php if ($_smarty_tpl->tpl_vars['order']->value['topcatId'] == "52") {?>: <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['topcatOption'], ENT_QUOTES, 'UTF-8');?>
 <?php }?></td>
                                    </tr>
                                    <tr>
                                        <th>Title:</th>
                                        <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['title'], ENT_QUOTES, 'UTF-8');?>
</td>
                                    </tr>
                                    <tr>
                                        <th>Number of sources:</th>
                                        <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['sources'], ENT_QUOTES, 'UTF-8');?>
</td>
                                    </tr>
                                </tbody>
                            </table>
                            <table width="100%" cellspacing="0" cellpadding="0" border="0" class="table_info">
                                <tbody>
                                    <tr class="first">
                                        <th>Paper instructions:</th>
                                        <td>
                                            <div class="OrderInstructions">
                                                <?php echo $_smarty_tpl->tpl_vars['order']->value['paperDetails'];?>

                                            </div>
                                        </td>
                                    </tr>

                                    <?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) {?>
                                        <?php if ($_smarty_tpl->tpl_vars['order']->value['requestedWriter']['id']) {?>
                                            <tr>
                                                <th>Requested Writer:</th>
                                                <td>
                                                    <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/employees/edit/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['requestedWriter']['id'], ENT_QUOTES, 'UTF-8');?>
" target="_blank"> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['requestedWriter']['first_name'], ENT_QUOTES, 'UTF-8');?>
 <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['requestedWriter']['last_name'], ENT_QUOTES, 'UTF-8');?>
 (<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['requestedWriter']['id'], ENT_QUOTES, 'UTF-8');?>
) </a>
                                                </td>
                                            </tr>
                                        <?php }?>
                                    <?php }?>

                                    <?php if ($_smarty_tpl->tpl_vars['order']->value['comments']) {?>
                                        <tr>
                                            <th>Additional comments from Customer:</th>
                                            <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['comments'], ENT_QUOTES, 'UTF-8');?>
</td>
                                        </tr>
                                    <?php }?>

                                    <?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) {?>
                                        <tr>
                                            <th>Price:</th>
                                            <td>
                                                <?php if ($_smarty_tpl->tpl_vars['order']->value['noDiscountPrice'] > $_smarty_tpl->tpl_vars['order']->value['price']) {?>
                                                    <span style="text-decoration:line-through;" class="text-dark mr10 text-sm"><?php echo htmlspecialchars(formatPrice($_smarty_tpl->tpl_vars['order']->value['noDiscountPrice']), ENT_QUOTES, 'UTF-8');?>
</span>
                                                <?php }?>
                                                <span class="text-success text-lg"><?php echo htmlspecialchars(formatPrice($_smarty_tpl->tpl_vars['order']->value['price']), ENT_QUOTES, 'UTF-8');?>
</span>
                                                <?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) {?>
                                                    <span data-toggle="modal" data-url="#modal-edit-pay" data-size="small" data-options='{"order_id":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
,"edit_customer_pay":"1","customer_pay":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['price'], ENT_QUOTES, 'UTF-8');?>
}' class="btn btn-secondary btn-xs pull-right"><i class="fa fa-edit"></i> Edit</span>
                                                <?php }?>

                                                <?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) {?>
                                                    <span data-toggle="modal" data-url="#modal-additional-payment" data-options='{"order_id":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
}' class="btn btn-secondary btn-xs pull-right mr10">
                                                        <i class="fa fa-credit-card mr1"></i> Additional Payment
                                                    </span>
                                                <?php }?>
                                            </td>
                                        </tr>

                                        <?php if ($_smarty_tpl->tpl_vars['order']->value['additionalPayments']) {?>
                                            <tr>
                                                <th>Additional payments:</th>
                                                <td>
                                                    <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['order']->value['additionalPayments'], 'additionalPayment');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['additionalPayment']->value) {
?>
                                                        <div><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['additionalPayment']->value['title'], ENT_QUOTES, 'UTF-8');?>
 was paid at <span class="js_moment" data-time="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['additionalPayment']->value['paidAt'], ENT_QUOTES, 'UTF-8');?>
"></span></div>
                                                        <?php if (count($_smarty_tpl->tpl_vars['order']->value['additionalPayments']) > 1) {?><hr  class="mb10 mt10"><?php }?>
                                                    <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                                                </td>
                                            </tr>
                                        <?php }?>

                                        <?php if ($_smarty_tpl->tpl_vars['order']->value['paymentMethod']) {?>
                                            <tr>
                                                <th>Payment Method:</th>
                                                <td class="text-capitalize"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['paymentMethod'], ENT_QUOTES, 'UTF-8');?>
</td>
                                            </tr>
                                        <?php }?>

                                    <?php }?>

                                    <?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_writer']) {?>
                                        <tr>
                                            <th><?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) {?>Writer <?php }?>Fee:</th>
                                            <td>
                                                <span class="text-success text-lg"><?php echo htmlspecialchars(formatPrice($_smarty_tpl->tpl_vars['order']->value['writerPay']), ENT_QUOTES, 'UTF-8');?>
</span> 
                                                <?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) {?>
                                                    <span data-toggle="modal" data-url="#modal-edit-pay" data-size="small" data-options='{"order_id":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
,"edit_writer_pay":"1","writer_pay":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['writerPay'], ENT_QUOTES, 'UTF-8');?>
}' class="btn btn-secondary btn-xs pull-right"><i class="fa fa-edit"></i> Edit</span>
                                                <?php }?>
                                            </td>
                                        </tr>
                                    <?php }?>

                                    <?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_editor']) {?>
                                        <tr>
                                            <th><?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) {?>Editor <?php }?>Fee:</th>
                                            <td>
                                                <span class="text-success text-lg"><?php echo htmlspecialchars(formatPrice($_smarty_tpl->tpl_vars['order']->value['editorPay']), ENT_QUOTES, 'UTF-8');?>
</span>
                                                <?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) {?>
                                                    <span data-toggle="modal" data-url="#modal-edit-pay" data-size="small" data-options='{"order_id":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
,"edit_editor_pay":"1","editor_pay":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['editorPay'], ENT_QUOTES, 'UTF-8');?>
}' class="btn btn-secondary btn-xs pull-right"><i class="fa fa-edit"></i> Edit</span>
                                                <?php }?>
                                            </td>
                                        </tr>
                                    <?php }?>

                                    <?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['hook'][0], array( array('h'=>'displayOrderAdditionalInfo','order_id'=>intval($_smarty_tpl->tpl_vars['order']->value['id'])),$_smarty_tpl ) );?>

                                </tbody>
                            </table>
 
                             <?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) {?>
                                <table width="100%" cellspacing="0" cellpadding="0" border="0" class="table_info">
                                    <tbody>
                                        <tr class="first">
                                            <th>Status:</th>
                                            <td>
                                                <strong><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['statusTitle'], ENT_QUOTES, 'UTF-8');?>
</strong>
                                                <span data-toggle="modal" data-url="#editStatusModal" data-size="small" data-options='{"order_id":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
,"status_id":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['status'], ENT_QUOTES, 'UTF-8');?>
}' class="btn btn-secondary btn-xs pull-right"><i class="fa fa-edit"></i> Change Status</span>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th>Customer:</th>
                                            <td>
                                                <?php if ($_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) {?>
                                                    <strong><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['customer']['id'], ENT_QUOTES, 'UTF-8');?>
</strong>
                                                <?php } else { ?>
                                                    <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/customers/edit/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['customer']['id'], ENT_QUOTES, 'UTF-8');?>
" target="_blank"> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['customer']['name'], ENT_QUOTES, 'UTF-8');?>
 (<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['customer']['id'], ENT_QUOTES, 'UTF-8');?>
) </a>
                                                <?php }?>
                                            </td>
                                        </tr>

                                        <?php if ($_smarty_tpl->tpl_vars['order']->value['writer']['id']) {?>
                                            <tr>
                                                <th>Writer:</th>
                                                <td>
                                                    <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/employees/edit/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['writer']['id'], ENT_QUOTES, 'UTF-8');?>
" target="_blank"> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['writer']['first_name'], ENT_QUOTES, 'UTF-8');?>
 <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['writer']['last_name'], ENT_QUOTES, 'UTF-8');?>
 (<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['writer']['id'], ENT_QUOTES, 'UTF-8');?>
) </a>
                                                </td>
                                            </tr>
                                        <?php }?>

                                        <?php if ($_smarty_tpl->tpl_vars['order']->value['editor']['id']) {?>
                                            <tr>
                                                <th>Editor:</th>
                                                <td>
                                                    <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/employees/edit/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['editor']['id'], ENT_QUOTES, 'UTF-8');?>
" target="_blank"> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['editor']['first_name'], ENT_QUOTES, 'UTF-8');?>
 <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['editor']['last_name'], ENT_QUOTES, 'UTF-8');?>
 (<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['editor']['id'], ENT_QUOTES, 'UTF-8');?>
) </a>
                                                </td>
                                            </tr>
                                        <?php }?>

                                        <tr>
                                            <th>Site:</th>
                                            <td>
                                                <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/my-sites/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['site']['id'], ENT_QUOTES, 'UTF-8');?>
/edit" target="_blank"> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['site']['name'], ENT_QUOTES, 'UTF-8');?>
 </a>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            <?php }?>
                        </div>
                        <!-- instructions tab -->

                        <?php if ($_smarty_tpl->tpl_vars['order']->value['progressiveDeliveryHidden']) {?>
                        <!-- progressive-delivery tab -->
                        <div class="tab-pane" id="progressive-delivery">

                            <?php if ($_smarty_tpl->tpl_vars['order']->value['hasPDSchedule']) {?>

                                <div class="ProgressiveDeliverySchedule">
                                    <ul class="ProgressiveDeliverySchedule__parts">
                                        <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['order']->value['pdSchedule'], 'schedule');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['schedule']->value) {
?>
                                            <li class="ProgressiveDeliverySchedule__part">
                                                <strong class="ProgressiveDeliverySchedule__part__title">Part 1</strong>
                                                <span class="ProgressiveDeliverySchedule__part__deadline">
                                                    <strong class="ProgressiveDeliverySchedule__part__deadline__calendar">21</strong>
                                                    <span>Jun 12:48</span>
                                                </span>
                                                <span class="ProgressiveDeliverySchedule__part__counts">
                                                    <strong><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['schedule']->value['pages'], ENT_QUOTES, 'UTF-8');?>
</strong> page <strong><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['schedule']->value['slides'], ENT_QUOTES, 'UTF-8');?>
</strong> slides <strong><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['schedule']->value['pages'], ENT_QUOTES, 'UTF-8');?>
</strong> chart
                                                </span>
                                            </li>
                                        <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                                    </ul>
                                    <div class="ProgressiveDeliverySchedule__actions">
                                        <button class="btn btn-info" type="button">Edit</button>
                                    </div>
                                </div>

                            <?php } else { ?> 

                                <div class="text-center x-muted mt20 mb20"> 
                                    <i class="fa fa-calendar fa-4x"></i>
                                    <p class="mt20">
                                        <strong>This is a progressive delivey order. Create a delivery schedule.</strong>
                                    </p>
                                    <button data-options='{"order_id":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
}' data-toggle="modal" data-url="#modal-progressive-delivery" type="button" class="btn btn-xs btn-info">
                                        <i class="fa fa-plus"></i> Add Delivery Schedule
                                    </button>
                                </div>

                            <?php }?>

                        </div>
                        <!-- progressive-delivery tab -->
                        <?php }?>

                        <!-- files tab -->
                        <div class="tab-pane <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "files") {?>active<?php }?>" id="files">
                               
                            <div class="OrderDetailsFiles">
                                <div class="OrderDetailsFiles__split OrderDetailsFiles__split--from-service pl0">
                                    <div class="OrderDetailsFiles__split__header">
                                        <strong class="OrderDetailsFiles__split__title bold">Files uploaded by Writer </strong>
                                        <span class="OrderDetailsFiles__split__count"><?php echo htmlspecialchars(count($_smarty_tpl->tpl_vars['order']->value['writerFiles']), ENT_QUOTES, 'UTF-8');?>
 files</span>
                                    </div>
                                    <div class="OrderDetailsFiles__split__body">
                                        <?php if (count($_smarty_tpl->tpl_vars['order']->value['writerFiles']) > 0) {?>
                                            <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['order']->value['writerFiles'], 'file');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['file']->value) {
?>
                                                <?php $_smarty_tpl->_subTemplateRender("file:dashboard/order/_order.file.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, true);
?>
                                            <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                                        <?php } else { ?>
                                            <div class="OrderDetailsFiles__no-from-customer-message">There are no files uploaded writer</div>
                                        <?php }?>
                                    </div>
                                     
                                    <?php if ($_smarty_tpl->tpl_vars['user']->value['is_writer']) {?>
                                                                                <?php if ($_smarty_tpl->tpl_vars['order']->value['status'] == "11" || $_smarty_tpl->tpl_vars['order']->value['status'] == "6" && $_smarty_tpl->tpl_vars['order']->value['writerConfirmed']) {?>
                                            <button data-options='{"order_id":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
,"sources":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['areSourcesRequired'], ENT_QUOTES, 'UTF-8');?>
}' data-toggle="modal" data-url="#modal-upload" class="btn btn-info">Upload Files</button>
                                        <?php }?>

                                                                                <?php if ($_smarty_tpl->tpl_vars['order']->value['status'] == "14" && $_smarty_tpl->tpl_vars['order']->value['writerConfirmed']) {?>
                                            <button data-options='{"order_id":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
,"sources":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['areSourcesRequired'], ENT_QUOTES, 'UTF-8');?>
}' data-toggle="modal" data-url="#modal-upload" class="btn btn-info">Upload Files</button>
                                        <?php }?>
                                    <?php }?>

                                    <?php if ($_smarty_tpl->tpl_vars['user']->value['is_editor']) {?>
                                                                                <?php if ($_smarty_tpl->tpl_vars['order']->value['editorAssigned'] == '1' && $_smarty_tpl->tpl_vars['order']->value['editor']['id'] == $_smarty_tpl->tpl_vars['user']->value['id'] && $_smarty_tpl->tpl_vars['order']->value['status'] == "8") {?>
                                            <button data-options='{"order_id":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
,"sources":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['areSourcesRequired'], ENT_QUOTES, 'UTF-8');?>
}' data-toggle="modal" data-url="#modal-upload" class="btn btn-info">Upload Files</button>
                                        <?php }?>
                                    <?php }?>

                                    <?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) {?>
                                        <button data-options='{"order_id":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
,"sources":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['areSourcesRequired'], ENT_QUOTES, 'UTF-8');?>
}' data-toggle="modal" data-url="#modal-upload" class="btn btn-info">Upload Files</button>
                                    <?php }?>
                                </div>

                                <div class="OrderDetailsFiles__split OrderDetailsFiles__split--from-customer pr0">
                                    <div class="OrderDetailsFiles__split__header">
                                        <strong class="OrderDetailsFiles__split__title bold">Customer uploads</strong>
                                        <div class="OrderDetailsFiles__split__count"><?php echo htmlspecialchars(count($_smarty_tpl->tpl_vars['order']->value['customerFiles']), ENT_QUOTES, 'UTF-8');?>
 files</div>
                                    </div>
                                    <div class="OrderDetailsFiles__split__body">
                                        <?php if (count($_smarty_tpl->tpl_vars['order']->value['customerFiles']) > 0) {?>
                                            <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['order']->value['customerFiles'], 'file');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['file']->value) {
?>
                                                <?php $_smarty_tpl->_subTemplateRender("file:dashboard/order/_order.file.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, true);
?>
                                            <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                                        <?php } else { ?>
                                            <div class="OrderDetailsFiles__no-from-customer-message">There are no files uploaded by customer</div>
                                        <?php }?>
                                    </div>
                                    
                                    <?php if (count($_smarty_tpl->tpl_vars['order']->value['customerFiles']) > 0 && (!$_smarty_tpl->tpl_vars['cloud_storage']->value && !$_smarty_tpl->tpl_vars['ifs_enabled']->value)) {?>
                                        <a class="btn btn-info" href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/api/orders/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
/download_all_attachments">Download all attachments</a>
                                    <?php }?>
                                </div>
                            </div>
                        </div>
                        <!-- files tab -->

                        <!-- messages tab -->
                        <div class="tab-pane <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "messages") {?>active<?php }?>" id="messages">
                            <?php if (count($_smarty_tpl->tpl_vars['order']->value['messages'])) {?>
                                <div class="clearfix">
                                    <div class="pull-right">
                                        <button data-options='{"order_id":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
}' data-toggle="modal" data-url="#newMessage" class="btn btn-info">New Message</button>
                                    </div>
                                </div>
                            <?php }?>

                            <div class="OrderMessages__content mt20">
                                <?php if (count($_smarty_tpl->tpl_vars['order']->value['messages'])) {?>
                                    <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['order']->value['messages'], 'message');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['message']->value) {
?>
                                        <div class="OrderMessage <?php if (!$_smarty_tpl->tpl_vars['message']->value['isViewed']) {?>OrderMessage-new<?php }?>" data-id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['message']->value['id'], ENT_QUOTES, 'UTF-8');?>
" data-read="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['message']->value['isViewed'], ENT_QUOTES, 'UTF-8');?>
">
                                            <button type="button" class="OrderMessageHeader">
                                                <div class="OrderMessageHeader__container">
                                                    <div class="OrderMessageHeader__type OrderMessageHeader__type-is-viewed" title="Conversation with <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['message']->value['interlocutor'], ENT_QUOTES, 'UTF-8');?>
"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['message']->value['fromWide'], ENT_QUOTES, 'UTF-8');?>
 → <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['message']->value['toWide'], ENT_QUOTES, 'UTF-8');?>
</div>
                                                    <div class="OrderMessageHeader__subject"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['message']->value['subject'], ENT_QUOTES, 'UTF-8');?>
</div>
                                                    <div class="OrderMessageHeader__props OrderMessageHeader__props_is-viewed js_moment" data-time="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['message']->value['createdAt'], ENT_QUOTES, 'UTF-8');?>
"></div>
                                                </div>
                                            </button>
                                            <div class="x-hidden replyBox">
                                                <div class="OrderMessage__body">
                                                    <div class="mb20">
                                                        <?php echo $_smarty_tpl->tpl_vars['message']->value['body'];?>

                                                    </div>

                                                    <?php if (!$_smarty_tpl->tpl_vars['message']->value['isSender']) {?>
                                                        <form data-url="/messages/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['message']->value['id'], ENT_QUOTES, 'UTF-8');?>
/reply" class="ReplyMessageForm js_ajax-forms" method="POST">
                                                            <textarea name="reply" class="form-control mb10 js_autosize" placeholder="Type your reply..." tabindex="0"></textarea>
                                                            <!-- success -->
                                                            <div class="alert alert-success mt10 mb10 x-hidden" role="alert"></div>
                                                            <!-- success -->

                                                            <!-- error -->
                                                            <div class="alert alert-danger mt10 mb10 x-hidden" role="alert"></div>
                                                            <!-- error -->
                                                            <div class="ReplyMessageForm__buttons">
                                                                <button class="btn btn-info" type="submit">Reply </button>
                                                                <?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) {?>
                                                                    <button class="btn btn-danger js_admin-deleter" data-handle="message" data-id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['message']->value['id'], ENT_QUOTES, 'UTF-8');?>
" type="button">
                                                                        <i class="fa fa-trash mr5"></i> Delete
                                                                    </button>
                                                                <?php }?>
                                                            </div>
                                                        </form>
                                                    <?php } else { ?>
                                                        <?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) {?>
                                                            <div class="mt20">
                                                                <button class="btn btn-danger js_admin-deleter" data-handle="message" data-id="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['message']->value['id'], ENT_QUOTES, 'UTF-8');?>
" type="button">
                                                                    <i class="fa fa-trash mr5"></i> Delete
                                                                </button>
                                                            </div>
                                                        <?php }?>
                                                    <?php }?>
                                                </div>
                                            </div>
                                        </div>
                                    <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                                <?php } else { ?>
                                    <div class="text-center x-muted"> 
                                        <i class="fa fa-envelope fa-4x"></i>
                                        <p class="mb20"><strong>No messages to show</strong></p>
                                        <button data-options='{"order_id":<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
}' data-toggle="modal" data-url="#newMessage" class="btn btn-info">New Message</button>
                                    </div>
                                <?php }?>
                            </div>
                        </div>
                        <!-- messages tab -->

                        <!-- order-history tab -->
                        <?php if (count($_smarty_tpl->tpl_vars['orderHistory']->value) > 0) {?>
                            <div class="tab-pane <?php if ($_smarty_tpl->tpl_vars['sub_view']->value == "history") {?>active<?php }?>" id="order-history">
                                <div class="table-responsive">
                                    <table class="table <?php if ($_smarty_tpl->tpl_vars['theme_mode_night']->value) {?>table-dark<?php }?> table-striped table-bordered table-hover js_dataTable">
                                        <thead>
                                            <tr>
                                                <th>Order ID</th>
                                                <th>Topic Title</th>
                                                <th>Discipline</th>
                                                <th>Status</th>
                                                <th>Pages</th>
                                                <th>Cost</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['orderHistory']->value, 'oHistory');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['oHistory']->value) {
?>
                                                <tr>
                                                    <td>
                                                        <strong><a target="_blank" href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/order/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['oHistory']->value['id'], ENT_QUOTES, 'UTF-8');?>
">#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['oHistory']->value['id'], ENT_QUOTES, 'UTF-8');?>
</a></strong>
                                                    </td>
                                                    <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['oHistory']->value['title'], ENT_QUOTES, 'UTF-8');?>
</td>
                                                    <td>
                                                        <small class="btn-block"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['oHistory']->value['topcat'], ENT_QUOTES, 'UTF-8');?>
</small>
                                                        <small class="btn-block text-muted"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['oHistory']->value['academicLevelTitle'], ENT_QUOTES, 'UTF-8');?>
</small>
                                                    </td>
                                                    <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['oHistory']->value['statusTitle'], ENT_QUOTES, 'UTF-8');?>
</td>
                                                    <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['oHistory']->value['pages'], ENT_QUOTES, 'UTF-8');?>
</td>
                                                    <td>
                                                        <?php if ($_smarty_tpl->tpl_vars['user']->value['is_writer']) {?>
                                                            <?php echo htmlspecialchars(formatPrice($_smarty_tpl->tpl_vars['oHistory']->value['writerPay']), ENT_QUOTES, 'UTF-8');?>

                                                        <?php } elseif ($_smarty_tpl->tpl_vars['user']->value['is_editor']) {?>
                                                            <?php echo htmlspecialchars(formatPrice($_smarty_tpl->tpl_vars['oHistory']->value['editorPay']), ENT_QUOTES, 'UTF-8');?>

                                                        <?php } else { ?>
                                                            <?php echo htmlspecialchars(formatPrice($_smarty_tpl->tpl_vars['oHistory']->value['price']), ENT_QUOTES, 'UTF-8');?>

                                                        <?php }?>
                                                    </td>
                                                </tr>
                                            <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                                        </tbody>
                                    </table>

                                    <?php echo $_smarty_tpl->tpl_vars['pager']->value;?>

                                </div>
                            </div>
                        <?php }?>
                        <!-- order-history tab -->

                    </div>
                    <!-- tabs content -->

                </div>
            <?php }?>
        </div>

    <?php } elseif ($_smarty_tpl->tpl_vars['sub_view']->value == "assign") {?>
        
        <div class="card">
            <div class="card-header with-icon with-nav">
                <div class="mb20"> 
                    <div class="pull-right flip">
                        <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/order/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
" class="btn btn-secondary">
                            <i class="fa fa-arrow-left fa-fw mr5"></i> Back to Order
                        </a>
                    </div>

                    <i class="fa fa-shopping-basket mr10"></i>
                    <strong>Orders</strong>
                    &rsaquo; <strong>#<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
</strong>
                    &rsaquo; <strong>Bids &amp; Writers</strong>
                </div>

                <ul class="nav nav-tabs">
                    <li <?php if ($_smarty_tpl->tpl_vars['_get']->value == "bids") {?>class="active"<?php }?>>
                        <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/order/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
/assign?get=bids"> 
                            <?php if ($_smarty_tpl->tpl_vars['_get']->value == "bids") {?><strong class="pr5">Bids</strong><?php } else { ?>Bids<?php }?>
                            <?php if (count($_smarty_tpl->tpl_vars['bids']->value) > 0) {?>
                                <span class="label label-success ml5"><?php echo htmlspecialchars(count($_smarty_tpl->tpl_vars['bids']->value), ENT_QUOTES, 'UTF-8');?>
</span>
                            <?php }?>
                        </a>
                    </li>
                    <li <?php if ($_smarty_tpl->tpl_vars['_get']->value == "writers") {?>class="active"<?php }?>> 
                        <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/order/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
/assign?get=writers">
                            <?php if ($_smarty_tpl->tpl_vars['_get']->value == "writers") {?><strong class="pr5">Writers</strong><?php } else { ?>Writers<?php }?>
                            <?php if (count($_smarty_tpl->tpl_vars['writers']->value) > 0) {?>
                                <span class="label label-success ml5"><?php echo htmlspecialchars(count($_smarty_tpl->tpl_vars['writers']->value), ENT_QUOTES, 'UTF-8');?>
</span>
                            <?php }?>
                        </a> 
                    </li>
                </ul>

            </div>

            <?php if ($_smarty_tpl->tpl_vars['_get']->value == "writers") {?>

                <div class="card-body">

                    <form class="row mb10" method="GET">
                        <div class="col-md-7">
                            <input type="hidden" name="get" value="writers"/>
                            <input type="text" name="query" autocomplete="off" class="form-control input-sm" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['query']->value, ENT_QUOTES, 'UTF-8');?>
" placeholder="Search writer ID, name or email" />
                        </div>
                        <div class="col-md-2">
                            <button class="btn btn-info">Search</button>
                        </div>
                    </form> 

                    <?php if ($_smarty_tpl->tpl_vars['total_writers']->value > 0) {?>
                        <ul class="row">
                            <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['writers']->value, 'writer');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['writer']->value) {
?>
                                <li class="col-sm-12 col-md-6">
                                    <div class="data-container ">
                                        <div class="data-content pl0">
                                            <div class="pull-right flip">
                                                <?php if ($_smarty_tpl->tpl_vars['order']->value['writer']['id'] == $_smarty_tpl->tpl_vars['writer']->value['id']) {?>
                                                    <button type="button" class="btn btn-success" data-uid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['writer']->value['id'], ENT_QUOTES, 'UTF-8');?>
" data-oid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
"> 
                                                        <i class="fa fa-check"></i> Assigned
                                                    </button>
                                                <?php } else { ?>
                                                    <button type="button" class="btn btn-info js_assign-order" data-uid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['writer']->value['id'], ENT_QUOTES, 'UTF-8');?>
" data-oid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
"> 
                                                        <i class="fa fa-check"></i> Assign
                                                    </button>
                                                <?php }?>
                                            </div>
                                            <div> 
                                                <span class="name js_user-popover" data-uid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['writer']->value['id'], ENT_QUOTES, 'UTF-8');?>
" data-type="employee"> 
                                                    <a target="_blank" href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/employees/edit/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['writer']->value['id'], ENT_QUOTES, 'UTF-8');?>
">U<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['writer']->value['id'], ENT_QUOTES, 'UTF-8');?>
 - <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['writer']->value['first_name'], ENT_QUOTES, 'UTF-8');?>
 <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['writer']->value['last_name'], ENT_QUOTES, 'UTF-8');?>
</a> 
                                                </span>
                                                <div><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['writer']->value['order_stats']['progress'], ENT_QUOTES, 'UTF-8');?>
 progress • <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['writer']->value['order_stats']['done']+$_smarty_tpl->tpl_vars['writer']->value['order_stats']['delivered'], ENT_QUOTES, 'UTF-8');?>
 Done/Delivered • <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['writer']->value['order_stats']['revision'], ENT_QUOTES, 'UTF-8');?>
 Revision</div>
                                            </div>
                                        </div>
                                    </div>
                                </li>
                            <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                        </ul>

                        <?php echo $_smarty_tpl->tpl_vars['pager']->value;?>

                    <?php } else { ?>
                        <div class="text-center x-muted"> 
                            <i class="fa fa-users fa-4x"></i>
                            <p class="mb10"><strong>No writers found</strong></p>
                        </div>
                    <?php }?>
                </div>

            <?php } elseif ($_smarty_tpl->tpl_vars['_get']->value == "bids") {?>
                <div class="card-body">
                    <?php if ($_smarty_tpl->tpl_vars['total_bids']->value > 0) {?>
                        <ul class="row">
                            <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['bids']->value, 'bid');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['bid']->value) {
?>
                                <li class="col-sm-12 col-md-6">
                                    <div class="data-container ">
                                        <div class="data-content pl0">
                                            <div class="pull-right flip">
                                                <?php if ($_smarty_tpl->tpl_vars['bid']->value['writer_id'] == $_smarty_tpl->tpl_vars['order']->value['writer']['id']) {?>
                                                    <button type="button" class="btn btn-success" data-uid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['bid']->value['writer_id'], ENT_QUOTES, 'UTF-8');?>
" data-oid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
"> 
                                                        <i class="fa fa-check"></i> Assigned
                                                    </button>
                                                <?php } else { ?>
                                                    <button type="button" class="btn btn-info js_assign-order" data-uid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['bid']->value['writer_id'], ENT_QUOTES, 'UTF-8');?>
" data-oid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['id'], ENT_QUOTES, 'UTF-8');?>
"> 
                                                        <i class="fa fa-check"></i> Assign
                                                    </button>
                                                <?php }?>
                                            </div>
                                            <div> 
                                                <span class="name js_user-popover" data-uid="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['bid']->value['writer_id'], ENT_QUOTES, 'UTF-8');?>
" data-type="employee"> 
                                                    <a target="_blank" href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['base_uri']->value, ENT_QUOTES, 'UTF-8');?>
/employees/edit/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['bid']->value['writer']['id'], ENT_QUOTES, 'UTF-8');?>
">U<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['bid']->value['writer']['id'], ENT_QUOTES, 'UTF-8');?>
 - <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['bid']->value['writer']['first_name'], ENT_QUOTES, 'UTF-8');?>
 <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['bid']->value['writer']['last_name'], ENT_QUOTES, 'UTF-8');?>
</a> 
                                                </span>
                                                <div><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['bid']->value['writer']['order_stats']['progress'], ENT_QUOTES, 'UTF-8');?>
 progress • <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['bid']->value['writer']['order_stats']['done']+$_smarty_tpl->tpl_vars['bid']->value['writer']['order_stats']['delivered'], ENT_QUOTES, 'UTF-8');?>
 Done/Delivered • <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['bid']->value['writer']['order_stats']['revision'], ENT_QUOTES, 'UTF-8');?>
 Revision </div>
                                            </div>
                                        </div>
                                    </div>
                                </li>
                            <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                        </ul>

                        <?php echo $_smarty_tpl->tpl_vars['pager']->value;?>

                    <?php } else { ?>
                        <div class="text-center x-muted"> 
                            <i class="fa fa-users fa-4x"></i>
                            <p class="mb10"><strong>No bids found</strong></p>
                        </div>
                    <?php }?>
                </div>
            <?php }?>

        </div>

    <?php }
}
}
/* {/block 'content_wrapper'} */
}
