<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$language.lblBusiness} : {$language.lblShipmentDetails}</title>
{include file='CommonStyles.tpl'}
{include file='CommonJavaScript.tpl'}
{include file='CommonCustomStyles.tpl'}
<link href="{$view_styles}/jqueryui.plugin.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/details.css" media="screen" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/colorbox.css" />
</head><body class="{$languageDirection}">
<div class="outer" id="main"> {include file='CommonHeader.tpl'}
  <!--End:Header Container--> 
  <!--***********************************************************************END HEADER CONTAINER******************************************************-->
  <div class="content-wrapper">
    <div class="container-fluid">
      <div class="clearfix">
        <div class="pull-right right">
          {include file='ContentLanguageOptions.tpl'}
        </div>
      </div>
      <div class="product-basic-info"> 
          <div id="common_message"></div>
	{html->anchor href="shipping/shipped/" caption="{$language.lblBack}" class="back-link fixing_right top-space"}
        <h2>{$language.lblShipmentDetails} #{$shipmentID} 
		<img src="{$view_root_path}/public/default/manage/standard/images/print-icon.png" id="print_slip" width="24" height="24" alt="print" class="print">
		<!--  {form->hidden name="shipmentID"  value=$shipmentDetails.shippingID} -->
		</h2>
		
        <div class="content-tab-block">
            <!--order_details :: Starts-->
            <div class="product-info-details">
              <div class="order_details clearfix">
                <div class="details">
                    <div class="row">
                        <div class="col-sm-8">
                            <div class="clearfix container-section">
                                <div class="left-pane border-right rmv-padding col-sm-6">
                                    {assign var="currentLangID" value=$currentLangID|default:''}
                                    <h3>{$language.lblBillinginfo}</h3>
                                    <address>
                                        {$shipmentDetails.billingAddress|address_format:$languageIDs:'':'':$currentLangID}
                                        <br />
                                        <a href="mailto:{$billingAddress['billingEmail']}">{$billingAddress['billingEmail']}</a> {if $billingAddress['billingPhone']} <br />
                                        <span> {$language.lblPhone}:</span>{$billingAddress['billingPhone']|escape} {/if}
                                    </address>
                                </div>
                                <div class="right-pane rmv-padding col-sm-6">
                                    <h3>{$language.lblShippinginfo}</h3>
                                    <address>
                                    {$shipmentDetails.shippingAddress|address_format:$languageIDs:'':'':$currentLangID}
                                    {if $shippingPhone|default:'' neq ''}<br><span> {$language.lblPhone}:</span>{$shippingPhone} {/if}
                                    </address>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                  <div class="left-pane">
                    
                  </div>
                  <!--End:BILLING information--> 
                  <!-- shipping Information-->
                  <div class="right-pane">
                    
                  </div>
                  <!-- End shipping Information--> 
                </div>
              </div>
              <div class="clear"></div>
              
              <div class="products_ordered clearfix">
                  <div class="container-section">
                    <h3 class="border-bottom">{$language.lblProductsOrdered}</h3>
                    <div class="grid_table00">
                    {form->start name="formOrder" action="" method="post" enctype="multipart/form-data"} 
                      <table width="100%" border="0" cellspacing="0" cellpadding="0"   >
                        <tr>
                          <th  width="10%"  align="left" valign="middle"> 
                          {$language.lblBusiness} - {$language.lblSKU}</th>
                          <th align="left" valign="middle" width="30%" >
                          {$language.lblProductTitle}</th>
                          <th align="left" valign="middle" width="5%" >
                          {$language.lblShippingBy}</th>

                          <th align="left" valign="middle" width="5%" >
                              {$language.lblOrderID}
                            </th>
                          <th width="5%" align="left" valign="middle" >
                              {$language.lblQuantity}
                            </th>
                          <th align="left" valign="middle" width="10%">{$language.lblCurrentShipmentStatus}</th>
                        </tr>
                        {foreach from=$shipmentDetails.items item="product" key="key1"}
                        <tr >
                          <td align="left" valign="top">
                          {$product.businessName} - {$product.optionSKU}</td>
                          <td align="left" valign="top"> 
                            {$product.productOptionName}<br/>
                            {assign var="unserialize" value=$product.extra}
                            {if $unserialize.combinationValues.customOption|count|default:0 >0}
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td colspan="2"><b>Combination</b></td>
                              </tr>
                              <tr>
                                <td width="30%">SKU </td>
                                <td>{$unserialize.combinationValues.cimbinationSKU}</td>
                              </tr>
                              {foreach from=$unserialize.combinationValues.customOption item="combination" key="key"}
                              <tr>
                                <td>{$combination.customOptionName} </td>
                                <td>{$combination.variantValue}</td>
                              </tr>
                              {/foreach}
                            </table>
                            {/if}

                            {if $unserialize.customOptionValues|count >0}
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td colspan="2"><b>Options</b></td>
                              </tr>
                              {foreach from=$unserialize.customOptionValues item="customOptionValues"}
                              <tr>
                                <td width="30%">{$customOptionValues.0.customOptionName} </td>
                                {foreach from=$customOptionValues item="customOption" key="key"}
                                <td> {if $customOption.inputType=='file'}
                                  {html->anchor href="/order/getFile/id/{$customOption.variantValue}/" class="normal_link"
                                  caption=$customOption.variantValue 
                                  title=$customOption.customOptionName}
                                  {if $key >0},{/if}
                                  {else}
                                  {$customOption.variantValue}{if $key >0},{/if}
                                  {/if} </td>
                                {/foreach} </tr>
                              {/foreach}
                            </table>
                            {/if} </td>

                        <td align="left" valign="top">
                            {if $product['shippingSetting'] == 'admin'}
                                {assign var="lblShippingManagment" value=$language.lblAdmin}
                            {else}
                                {assign var="lblShippingManagment" value=$language.lblBusiness}
                            {/if}
                              {$lblShippingManagment}
                           </td>	

                          <td align="left" valign="top">
                                {assign var="masterOrderID" value=$product.masterOrderID}

                                {html->anchor history="yes" href="payment/show/id/$masterOrderID/tab/1/"  class="normal_link" title={$language.lblView}|cat:" "|cat:{$language.lblShippedOrder} caption="#"|cat:{$shipmentDetails.orderNumber}}

                            </center></td>
                          <td align="left" valign="top">
                              {$product.quantity} / {$product.orderItemQuantity}
                            </td>
                          <td  align="left" valign="top">
                            {if $product.shipmentStatus== 'Delivered'}
                                {$language.lblDelivered}
                            {else if $product.shipmentStatus== 'Pending'}
                                {$language.lblPending}
                            {else if $product.shipmentStatus== 'Shipment'}
                                {$language.lblShipmentcreated}
                            {else if $product.shipmentStatus== 'Dispatched'}
                                {$language.lblDispatched}
                            {else if $product.shipmentStatus== 'Pickup'}
                                {$language.lblPickupCreated}
                            {else if $product.shipmentStatus== 'Cancelled'}
                                {$language.lblCancelled}
                            {/if}

                            {if $product.shipmentStatus !='Pending'} <br>
                                ({$product.shipmentDate|date_format:$date_format} 
                                {$product.shipmentDate|date_format:$time_format})
                            {/if} </td>
                        </tr>
                        {/foreach}
                      </table>
				    {form->close}
                    </div>
                </div>
            {form->start name="formChangeShippingStatus" action="" method="post" enctype="multipart/form-data"}
                <div class="container-section">
                    <div class="tabpane">
                      <div class="form_listing paneBx clearfix">
                        <div class="left-pane col-sm-6 col-xs-12">
                          <ul>
                            <li class="form-group row"> 
                                <label class="col-sm-4 col-md-3 col-xs-12">{$language.lblGroosWeight}</label> 
                                <span class="col-sm-8 col-md-9 col-xs-12 pos-relative"> {form->textbox class="form-control" name="grossWeight" value="{$shipmentDetails.gross_weight|default:''}" validate="required" error="{$language.errGrossWeight}"}<span class="position01">({$language.lblPounds})</span></span>
                              </li>  
                            <li class="form-group row">
                            <label class="col-sm-4 col-md-3 col-xs-12">{$language.lblLogisticPartner}</label>
                            <span class="col-sm-8 col-md-9 col-xs-12">
                                {form->select name="sm_main" disabled="yes" value="{$shipmentDetails.carrier}" options=$resSmServices validate="required" class="form-control" error=$language.lblErrorShippingMethod}
                              {form->hidden name="realtimeCarrier"}
                              </span>
                            </li>
                            <li class="form-group row other">
                                 <label class="col-sm-4 col-md-3 col-xs-12">{$language.lblLogisticPartnerName}</label>
                                 <span class="col-sm-8 col-md-9 col-xs-12 pos-relative">
                                    {form->textbox class="form-control" name="partnerName" value="{$shipmentDetails.other_logistic_partner}" validate="sm_main->isequal->other~*required" error="{$language.errPartnerName}"}
                                 </span>
                            </li>
                            <li class="form-group row other">
                                 <label class="col-sm-4 col-md-3 col-xs-12">{$language.lblTrackingUrl}</label>
                                 <span class="col-sm-8 col-md-9 col-xs-12 pos-relative">
                                    {form->textbox class="form-control" name="trackingUrl" value="{$shipmentDetails.other_tracking_url}"}
                                 </span>
                            </li>
                            <li class="form-group row service_type"> 
                                <label class="col-sm-4 col-md-3 col-xs-12"> {$language.lblShippingServiceType} </label> 
                                <span class="col-sm-8 col-md-9 col-xs-12"> {form->select name="realtime_sm_services" disabled="yes" class="form-control"}
                              {form->hidden name="hid_realtime_sm_services" value="{$shipmentDetails.service_type}"} </span> 
                              </li>
                            <li class="form-group row fedex_options" style="display:none;">
                                <label class="col-sm-4 col-md-3 col-xs-12">{$language.lblPackageType}</label> 
                                <span class="col-sm-8 col-md-9 col-xs-12"> {form->select name="packageType" disabled="yes" value="{$shipmentDetails.package_details}" 
                              options="YOUR_PACKAGING->Your packaging~*FEDEX_BOX->FedEx Box~*FEDEX_10KG_BOX->FedEx 10kg Box~*FEDEX_25KG_BOX->FedEx 25kg Box~*FEDEX_ENVELOPE->FedEx Envelope~*FEDEX_PAK->FedEx Pak~*FEDEX_TUBE->FedEx Tube"
                              class="form-control" validate="required" error="{$language.errPackageType}"} </span> 
                              </li>
                            <li class="form-group row fedex_options" style="display:none;">
                                <label class="col-sm-4 col-md-3 col-xs-12">{$language.lblDropOffType}</label> 
                                <span class="col-sm-8 col-md-9 col-xs-12"> {form->select name="dropOffType" disabled="yes" value="{$shipmentDetails.drop_off_type}"
                              options="REGULAR_PICKUP->Regular pickup~*REQUEST_COURIER->Request courier~*STATION->Drop at station"
                              class="form-control" validate="required" error="{$language.errDropOffType}"} </span> 
                              </li>
                            <li class="form-group row">
                                <label class="col-sm-4 col-md-3 col-xs-12">{$language.lblShipmentRemark}</label>
                                <span class="col-sm-8 col-md-9 col-xs-12">
                                    {form->textarea name="CareerDetails" maxlength="100" id="CareerDetails" class="form-control"  cols="100" value="{$shipmentDetails.comment|default:''}"}
                                </span>
                                </li>
                            <li class="form-group row">
                                <label class="col-sm-4 col-md-3 col-xs-12">{$language.lblTrackingnumber}</label>
                                <span class="col-sm-8 col-md-9 col-xs-12">
                                    {form->textbox class="form-control" name="trackingNumber" value="{$shipmentDetails.trackingNumber}" validate="callback_checkTrackingNumberRequired" error=$language.errTrackingNumber maxlength="225"}
                                </span>
                            </li>
                            <li  class="form-group row">
                                    <label class="col-sm-4 col-md-3 col-xs-12">&nbsp;</label>
                                    <span class="col-sm-8 col-md-9 col-xs-12">
                                <div class="submit-block" >
                                    {form->hidden name="shipmentStatus" value=$shipmentDetails.shippingStatus}
                                    {form->hidden name="shipmentID" value=$shipmentDetails.shippingID}
                                    {form->hidden name="masterOrderID" value=$masterOrderID}
                                    {form->submit name="changeShippingStatus" id="changeShippingStatus" value="{$language.lblUpdateShipment}" class="btn btn-primary"}
                                </div>
                                </span>
                                    </li> 
                          </ul>
                        </div>
                        <div class="right-pane col-sm-6 col-xs-12" id="afterPickUp">
                        {if $resShippingHistory.0.shipment_created_date|default:'' != '' && $resShippingHistory.0.pickup_created_date|default:'' != ''}
                        {assign var="display" value="block"}
                        {else}
                        {assign var="display" value="block"}
                        {/if}
                        <div class="info-G-Bx">
                        <ul class="ticker">
                              <li class="form-group"> 
                                  <h5> {if $shipmentDetails.dispatch_date != '0000-00-00 00:00:00' && $shipmentDetails.dispatch_date != ''}
                                {assign var="checked" value="checked"}
                                {else}
                                {assign var="checked" value=""}
                                {/if}
                                {form->checkbox name="dispatchInfo" value="Yes" id="dispatchInfo" checked="{$checked}"}
                                      <label for="dispatchInfo">{$language.lblDispatchedInfo}</label>
                               <small> ({$language.lblDispatchedOrShippedNote}) </small></h5> 
                            </li>
                              <li class="form-group row"> 
                                  <label class="col-sm-4 col-md-3 col-xs-12">{$language.lblDispatchedDate}</label> 
                                  <span class="col-sm-8 col-md-9 col-xs-12"> {if $shipmentDetails.dispatch_date != '0000-00-00 00:00:00' && $shipmentDetails.dispatch_date != ''}
                                {assign var="dispatch_date" value=$shipmentDetails.dispatch_date}
                                {else}
                                {assign var="dispatch_date" value=""}
                                {/if}
                                {form->textbox name="dispatchDate" value="{$dispatch_date|date_format:$date_format}" class="date_picker_field form-control" validate="dispatchInfo->isequal->1~*required" error="{$language.errDate}"} </span> </li>
                              <li class="form-group row"> 
                                  <label class="col-sm-4 col-md-3 col-xs-12">{$language.lblExpectedDeliveryDate}</label> 
                                  <span class="col-sm-8 col-md-9 col-xs-12"> {if $shipmentDetails.dispatch_exp_delivery_date != '0000-00-00 00:00:00' && $shipmentDetails.dispatch_exp_delivery_date != ''}
                                {assign var="dispatch_exp_delivery_date" value=$shipmentDetails.dispatch_exp_delivery_date}
                                {else}
                                {assign var="dispatch_exp_delivery_date" value=""}
                                {/if}
                                {form->textbox  name="dispatchExpDate"
                                value= "{$dispatch_exp_delivery_date|date_format:$date_format}"
                                class="date_picker_field form-control"
                                validate="dispatchInfo->isequal->1~*required" error="{$language.errDate}"} </span> </li>
                              <li class="form-group row"> 
                                  <label class="col-sm-4 col-md-3 col-xs-12"> {$language.lblDispatchStatusDetails} </label> 
                                  <span class="col-sm-8 col-md-9 col-xs-12"> {form->textarea name="dispatchStatusDetails" maxlength="100" class="form-control" value="{$shipmentDetails.dispatch_status_details|default:''}"} 
                              <div >{if $shipmentDetails.dispatch_notify_customer == 'Yes'}
                                {assign var="checked" value="checked"}
                                {else}
                                {assign var="checked" value=""}
                                {/if}
                                {form->checkbox name="dispatchNotify" value="Yes" checked="{$checked}"} <label for="dispatchNotify">{$language.lblNotifyCustomer}</label>
                                </div>
                              </span> </li>
                            </ul>
                        </div>
                        <div class="info-G-Bx bordrNone">
                        <ul class="ticker">
                              <li class="form-group">
                                  <h5>
                              {if $shipmentDetails.delivered_date != '0000-00-00 00:00:00' && $shipmentDetails.delivered_date != '' && $shipmentDetails.shippingStatus == 'Delivered'}
                                {assign var="checked" value="checked"}
                                {else}
                                {assign var="checked" value=""}
                                {/if}
                                {form->checkbox name="deliveredInfo" value="Yes" id="deliveredInfo" checked="{$checked}"} 
                                      <label for="deliveredInfo">{$language.lblDeliveredInfo}</label>
                                  </h5> 
                            </li>

                              <li class="form-group row">
                              <label class="col-sm-4 col-md-3 col-xs-12">{$language.lblDeliveredDateTime}</label>
                              <span class="col-sm-8 col-md-9 col-xs-12">
                              {if $shipmentDetails.delivered_date != '0000-00-00 00:00:00' && $shipmentDetails.delivered_date != '' && $shipmentDetails.shippingStatus == 'Delivered'}
                                {assign var="delivered_date" value=$shipmentDetails.delivered_date}
                                {else}
                                {assign var="delivered_date" value=""}
                                {/if}
                                {form->textbox name="deliveredDate"
                                value= "{$delivered_date|date_format:$date_format} {$delivered_date|date_format:$time_format}"
                                class="date_picker_field form-control"
                                validate="deliveredInfo->isequal->1~*required" error="{$language.errDate}"}
                                </span>
                              </li>
                              <li class="form-group row">
                              <label class="col-sm-4 col-md-3 col-xs-12"> {$language.lblComment} </label>
                              <span class="col-sm-8 col-md-9 col-xs-12">
                              {form->textarea name="deliveredComment" maxlength="100" class="form-control" value="{$shipmentDetails.delivered_comment}"} 
                              <div>
                              {if $shipmentDetails.delivered_notify_customer == 'Yes'}
                                {assign var="checked" value="checked"}
                              {else}
                                {assign var="checked" value=""}
                              {/if}
                                {form->checkbox name="deliveredNotify" value="Yes" checked="{$checked}"}<label for="deliveredNotify">{$language.lblNotifyCustomer}</label> </div>
                              </span>
                              </li>

                            </ul>
                        </div>
                        </div>
                      </div>
                    </div>
                </div>
              {form->close} 
			
              </div>
            </div>
            <!--End:Table Listing-->

          <!--End: left Block-->
          <div class="clear"></div>
        </div>
		
      </div>
    </div>
  </div>
  <!--End:Content Container--> 
  {include file='CommonBottom.tpl'} </div>
<!--End:Outer Container--> 
{include file='CommonJavaScriptBottom.tpl'} 
<!--End:Outer Container--> 
{html->messages_script id="common_message"}
</div>
{form->validate_script form="formChangeShippingStatus"} 
<script type="text/javascript" src="{$common_js}/validate.plugin.js"></script> 
<script type="text/javascript" src="{$view_javascript}/shipment.page.js"></script> 
<script type="text/javascript" src="{$view_javascript}/tab.plugin.js"></script> 
<script type="text/javascript" src="{$view_javascript}/table.plugin.js"></script> 
<script type="text/javascript"  src="{$view_javascript}/jquery.colorbox.js"></script> 
<script type="text/javascript" src="{$view_javascript}/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript">
var msgConfirmDelete="{$language.msgConfirmDelete}";
var lblSelectItems	=	"{$language.lblSelectItems}";
var lblNoDataDefault = "{$language.lblNoDataDefault}";
var msgShipMismatch = "{$language.msgShipMismatch}";
var msgDeliveredStatus = "{$language.msgDeliveredStatus}";
var msgPendingStatus = "{$language.msgPendingStatus}"
</script>

</body>
</html>
