<!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.lblAdmin} : {$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}/product-details.css" media="screen" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/colorbox.css" />
</head><body>
<div class="outer_container"> {include file='CommonTop.tpl'} 
  <!--End:Header Container--> 
  <!--***********************************************************************END HEADER CONTAINER******************************************************-->
  <div class="content_container">
    <div class="content_wrapper">
      <div class="product-basic-info"> 
	{html->anchor href="shipping/shipped/" caption="{$language.lblBack}" class="back-link fixing_right top-space"}
        <h2>{$language.lblShipmentDetails} #{$shipmentID} 
		{if $labelPrivilege}
		<img src="{$view_root_path}/public/default/manage/standard/images/print-icon.png"
		id="print_slip"
		width="24" height="24" alt="print" class="print">
		{/if}
		<!--  {form->hidden name="shipmentID"  value=$shipmentDetails.shippingID} -->
		</h2>
		<div id="common_message"></div>
        <div class="content-tab-block">
          <div class="content-block clearfix"> 
            <!--order_details :: Starts-->
            <div class="product-info-details">
              <div class="order_details clearfix padding-b-15">

                <div class="details fixing_left" style="float: left !important;">
                  <div class="left-pane">{assign var="currentLangID" value=$currentLangID|default:''}
                    <h3 class="padding-b-8">{$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>
                  <!--End:BILLING information--> 
                  <!-- shipping Information-->
                  <div class="right-pane">
                    <h3 class="padding-b-8">{$language.lblShippinginfo}</h3>
                    <address>
                    {$shipmentDetails.shippingAddress|address_format:$languageIDs:'':'':$currentLangID}
                    {if $shippingPhone|default:'' neq ''}<br><span> {$language.lblPhone}:</span>{$shippingPhone} {/if}
                    </address>
                  </div>
                  <!-- End shipping Information--> 
                </div>
              </div>
              <div class="clear"></div>
              
              <div class="products_ordered clearfix padding-b-15">
                <h3><span>{$language.lblProductsOrdered}</span> </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"> 
                          {assign var="unserialize" value=$product.extra}
                        {$unserialize.itemDetails.admin.productOptionName|default:''}<br/>
                        
                        {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}
							{if $showprivilege}
							{html->anchor history="yes" href="order/show/id/$masterOrderID/tab/1/"  class="normal_link" title={$language.lblView}|cat:" "|cat:{$language.lblShippedOrder} caption="#"|cat:{$shipmentDetails.orderNumber}}{else}
							{$shipmentDetails.orderNumber}
							{/if}
                        </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>

  {form->start name="formChangeShippingStatus" action="" method="post" enctype="multipart/form-data"}
<div class="full_width pane01">
  <div class="form_listing paneBx  clearfix">
    <div class="left-pane flt-left">
      <ul>
        <li class="clearfix"> <span class="leftside01">{$language.lblGroosWeight}</span> <span class="rightside01 pos-relative"> {form->textbox class="textbox width-55per" name="grossWeight" value="{$shipmentDetails.gross_weight|default:''}"}<span class="position01">({$language.lblPounds})</span></span></li>  
        <li class="clearfix">
		<span class="leftside01">{$language.lblLogisticPartner}</span>
		<span class="rightside01">
			{form->select name="sm_main" disabled="yes" value="{$shipmentDetails.carrier}" options=$resSmServices validate="required" class="width-55per" error=$language.lblErrorShippingMethod}
          {form->hidden name="realtimeCarrier"}
		  </span>
		</li>
		<li class="clearfix other">
			 <span class="leftside01">{$language.lblLogisticPartnerName}</span>
			 <span class="rightside01 pos-relative">
				{form->textbox class="textbox width-55per" name="partnerName" value="{$shipmentDetails.other_logistic_partner}" validate="sm_main->isequal->other~*required" error="{$language.errPartnerName}"}
			 </span>
		</li>
		<li class="clearfix other">
			 <span class="leftside01">{$language.lblTrackingUrl}</span>
			 <span class="rightside01 pos-relative">
				{form->textbox class="textbox width-55per" name="trackingUrl" value="{$shipmentDetails.other_tracking_url}"}
			 </span>
		</li>
        <li class="clearfix service_type"> <span class="leftside01"> {$language.lblShippingServiceType} </span> <span class="rightside01"> {form->select name="realtime_sm_services" disabled="yes" class="width-55per select-box"}
          {form->hidden name="hid_realtime_sm_services" value="{$shipmentDetails.service_type}"} </span> </li>
        <li class="clearfix fedex_options" style="display:none;"><span class="leftside01">{$language.lblPackageType}</span> <span class="rightside01"> {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="width-55per select-box" validate="required" error="{$language.errPackageType}"} </span> </li>
        <li class="clearfix fedex_options" style="display:none;"><span class="leftside01">{$language.lblDropOffType}</span> <span class="rightside01"> {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="width-55per select-box" validate="required" error="{$language.errDropOffType}"} </span> </li>
        <li class="clearfix">
			<span class="leftside01">{$language.lblShipmentRemark}</span>
			<span class="rightside01">
				{form->textarea name="CareerDetails" maxlength="100" id="CareerDetails" class="width-55per textbox"  cols="100" value="{$shipmentDetails.comment|default:''}"}
			</span>
			</li>
		<li class="clearfix">
			<span class="leftside01">{$language.lblTrackingnumber}</span>
			<span class="rightside01">
				{form->textbox class="textbox width-55per" name="trackingNumber" value="{$shipmentDetails.trackingNumber}" validate="callback_checkTrackingNumberRequired" error=$language.errTrackingNumber maxlength="225"}
			</span>
		</li>
        <li class="clearfix pick_up"> <h5>{if $shipmentDetails.pickup_date_time == '0000-00-00 00:00:00' || $shipmentDetails.pickup_date_time == ''}
          {form->checkbox name="createPickup" value="Yes"} {$language.lblPickUpSchedule} <small>
          ({$language.lblPickUpScheduleNote})
          {else}
          {$language.lblPickupScheduled}
          {/if}</small> </h5>
           </li>
        <li class="clearfix pick_up">
		<span class="leftside01">{$language.lblPickupDateTime}</span>
		<span class="rightside01">
		{if $shipmentDetails.pickup_date_time != '0000-00-00 00:00:00' && $shipmentDetails.pickup_date_time != ''}
          {assign var="pickup_date" value=$shipmentDetails.pickup_date_time}
          {assign var="pickup_date_disabled" value="disabled=Yes"}
          {else}
          {assign var="pickup_date" value=""}
		  {assign var="pickup_date_disabled" value=""}
          {/if}
          {form->textbox name="pickupDate" disabled="{$pickup_date_disabled}"
          value= "{$pickup_date|date_format:$date_format}{$pickup_date|date_format:$time_format}"
          class="date_picker_field width-55per"
          validate="realtimeCarrier->isequal->Yes~*createPickup->isequal->1~*required"
          error="{$language.errDate}"}
		</span>
		</li>
		<li class="clearfix pick_up">
			<span class="leftside01">{$language.lblPickupClosingTime}</span>
			<span class="rightside01">
			{if $shipmentDetails.pickup_closing_time != '00:00:00' && $shipmentDetails.pickup_closing_time != ''}
				{assign var="pickup_closing_time" value=$shipmentDetails.pickup_closing_time}
				{assign var="pickup_closing_disabled" value="disabled=Yes"}
			{else}
				{assign var="pickup_closing_time" value=""}
				{assign var="pickup_closing_disabled" value=""}
			{/if}
				{form->textbox class="date_picker_field width-55per"
					value="{$pickup_closing_time|date_format:$time_format}"
					name="pickupClosingTime"
					validate="realtimeCarrier->isequal->Yes~*createPickup->isequal->1~*required"
					error="{$language.errTime}"}
			</span>
		</li>
        <li  class="clearfix">
                <span class="leftside01"></span>
                <span class="rightside01">
			<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="button03 curve-3"}
			</div>
			</span>
                </li> 
      </ul>
    </div>
    <div class="right-pane flt-right" id="afterPickUp" style="display:{$display|default:''};">
    {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>
          <li class="clearfix"> <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" checked="{$checked}"}{$language.lblDispatchedInfo}
           <small> ({$language.lblDispatchedOrShippedNote}) </small></h5> </li>
          <li class="clearfix"> <span class="leftside01">{$language.lblDispatchedDate}</span> <span class="rightside01"> {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 width-55per" validate="dispatchInfo->isequal->1~*required" error="{$language.errDate}"} </span> </li>
          <li class="clearfix"> <span class="leftside01">{$language.lblExpectedDeliveryDate}</span> <span class="rightside01"> {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 width-55per"
            validate="dispatchInfo->isequal->1~*required" error="{$language.errDate}"} </span> </li>
          <li class="clearfix"> <span class="leftside01"> {$language.lblDispatchStatusDetails} </span> <span class="rightside01"> {form->textarea name="dispatchStatusDetails" maxlength="100" class="width-55per" 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}"} {$language.lblNotifyCustomer}
            </div>
          </span> </li>
        </ul>
    </div>
    <div class="info-G-Bx bordrNone">
    <ul>
          <li class="clearfix"><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" checked="{$checked}"} {$language.lblDeliveredInfo}</h5> </li>
         
          <li class="clearfix">
		  <span class="leftside01">{$language.lblDeliveredDateTime}</span>
		  <span class="rightside01">
		  {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 width-55per"
            validate="deliveredInfo->isequal->1~*required" error="{$language.errDate}"}
			</span>
		  </li>
          <li class="clearfix">
		  <span class="leftside01"> {$language.lblComment} </span>
		  <span class="rightside01">
		  {form->textarea name="deliveredComment" maxlength="100" class="width-55per" 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}"}{$language.lblNotifyCustomer} </div>
          </span>
		  </li>
          
        </ul>
    </div>
    </div>
  </div>
</div>
{form->close} 
			
              </div>
            </div>
            <!--End:Table Listing-->

			</div>
          <!--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>
