<?php 
/*
 *
 * Copyright (c) ATRAGENE SARL
 * @website: www.atragene.com
 * @email: contact@atragene.com
 * @author: olivier.lemaitre@atragene.com
 * @company: Atragene Conseil
 * @version: 1.7.4
 * @date: 03/12/2015
 *
 */
?>
<?php echo $header; ?>
<link href="view/stylesheet/envoismoinscher.css" type="text/css" rel="stylesheet">
<div id="content">
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <?php if ($error_warning) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  <?php if ($error_emc) { ?>
  <div class="warning"><?php echo $error_emc; ?></div>
  <?php } ?>
  <?php if ($error_login) { ?>
  <div class="warning"><?php echo $error_login; ?></div>
  <?php } ?>
  <?php if ($error_pwd) { ?>
  <div class="warning"><?php echo $error_pwd; ?></div>
  <?php } ?>
  <?php if ($error_key) { ?>
  <div class="warning"><?php echo $error_key; ?></div>
  <?php } ?>
  <?php if ($error_environment) { ?>
  <div class="warning"><?php echo $error_environment; ?></div>
  <?php } ?>
  <?php if ($error_civility) { ?>
  <div class="warning"><?php echo $error_civility; ?></div>
  <?php } ?>
  <?php if ($error_lastName) { ?>
  <div class="warning"><?php echo $error_lastName; ?></div>
  <?php } ?>
  <?php if ($error_firstName) { ?>
  <div class="warning"><?php echo $error_firstName; ?></div>
  <?php } ?>
  <?php if ($error_brand) { ?>
  <div class="warning"><?php echo $error_brand; ?></div>
  <?php } ?>
  <?php if ($error_phone) { ?>
  <div class="warning"><?php echo $error_phone; ?></div>
  <?php } ?>
  <?php if ($error_adress) { ?>
  <div class="warning"><?php echo $error_adress; ?></div>
  <?php } ?>
  <?php if ($error_cp) { ?>
  <div class="warning"><?php echo $error_cp; ?></div>
  <?php } ?>
  <?php if ($error_town) { ?>
  <div class="warning"><?php echo $error_town; ?></div>
  <?php } ?>
  <?php if ($error_mail) { ?>
  <div class="warning"><?php echo $error_mail; ?></div>
  <?php } ?>
  <?php if ($error_dispoDeb) { ?>
  <div class="warning"><?php echo $error_dispoDeb; ?></div>
  <?php } ?>
  <?php if ($error_dispoEnd) { ?>
  <div class="warning"><?php echo $error_dispoEnd; ?></div>
  <?php } ?>
  <?php if ($error_typeSend) { ?>
  <div class="warning"><?php echo $error_typeSend; ?></div>
  <?php } ?>
  <?php if ($error_minWeight) { ?>
  <div class="warning"><?php echo $error_minWeight; ?></div>
  <?php } ?>
  <?php if ($error_maxWeight) { ?>
  <div class="warning"><?php echo $error_maxWeight; ?></div>
  <?php } ?>
  <?php if ($error_natureSend) { ?>
  <div class="warning"><?php echo $error_natureSend; ?></div>
  <?php } ?>
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/shipping.png" alt="" /> <?php echo $heading_title; ?></h1>
      <div class="buttons"><a onclick="$('#form').submit();" class="button"><?php echo $button_save; ?></a><a onclick="location = '<?php echo $cancel; ?>';" class="button"><?php echo $button_cancel; ?></a></div>
    </div>
    <div class="content">
      <div class="vtabs">
        <a href="#tab_id"><?php echo $entry_caption_id; ?></a>
        <a href="#tab_address"><?php echo $entry_caption_address; ?></a>
        <a href="#tab_envois"><?php echo $entry_caption_envois; ?></a>
        <a href="#tab_transport"><?php echo $entry_caption_transport; ?></a>
	<a href="#tab_dimensions"><?php echo $entry_caption_dimension; ?></a>
        <a href="#tab_order"><?php echo $entry_caption_order; ?></a>
        <a href="#tab_order_sent"><?php echo $entry_caption_order_sent; ?></a>
      </div>
      <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
        <div id="tab_id" class="vtabs_content">
          <table class="form">
            <tr><td colspan="2"><a href="../image/envoimoinscher/ATRA-OP-EMC_1.0_Opencart-1.5.x_Documentation.pdf" target="_blank"><?php echo $entry_link_help; ?></a></td></tr>
			<tr><td colspan="2"><a href="http://ecommerce.envoimoinscher.com/?register=1" target="_blank"><?php echo $entry_link_key; ?></a></td></tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_login; ?></td>
              <td><input type="text" name="envoismoinscher_login" value="<?php echo $envoismoinscher_login; ?>" />
                  <?php if ($error_login) { ?>
                    <span class="error"><?php echo $error_login; ?></span>
                  <?php } ?>
              </td>
            </tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_pwd; ?></td>
              <td><input type="text" name="envoismoinscher_pwd" value="<?php echo $envoismoinscher_pwd; ?>" />
                  <?php if ($error_pwd) { ?>
                    <span class="error"><?php echo $error_pwd; ?></span>
                  <?php } ?>
              </td>
            </tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_key; ?></td>
              <td><input type="text" name="envoismoinscher_key" value="<?php echo $envoismoinscher_key; ?>" />
                <?php if ($error_key) { ?>
                    <span class="error"><?php echo $error_key; ?></span>
                  <?php } ?>
              </td>
            </tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_environment; ?></td>
              <td><select type="text" name="envoismoinscher_environment">
                    <?php foreach ($environment_menu as $environment_menu) { ?>
                      <?php if ($environment_menu['value'] == $envoismoinscher_environment) { ?>
                        <option value="<?php echo $environment_menu['value']; ?>" selected="selected"><?php echo $environment_menu['text']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $environment_menu['value']; ?>"><?php echo $environment_menu['text']; ?></option>
                      <?php } ?>
                    <?php } ?>
                  </select>
                <?php if ($error_environment) { ?>
                    <span class="error"><?php echo $error_environment; ?></span>
                  <?php } ?>
              </td>
            </tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_status; ?></td>
              <td><select type="text" name="envoismoinscher_status">
                    <?php foreach ($status_menu as $status_menu) { ?>
                      <?php if ($status_menu['value'] == $envoismoinscher_status) { ?>
                        <option value="<?php echo $status_menu['value']; ?>" selected="selected"><?php echo $status_menu['text']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $status_menu['value']; ?>"><?php echo $status_menu['text']; ?></option>
                      <?php } ?>
                    <?php } ?>
                  </select>
              </td>
            </tr>
			<tr>
				<td><?php echo $entry_sort_order; ?></td>
				<td><input type="text" name="envoismoinscher_sort_order" value="<?php echo $envoismoinscher_sort_order; ?>" id="input-sort-order" /></td>
			</tr>			
          </table>
        </div>
        <div id="tab_address" class="vtabs_content">
          <table class="form">
            <tr>
              <td><span class="required">*</span><?php echo $entry_civility; ?></td>
              <td>
                <select type="text" name="envoismoinscher_civility">
                    <?php foreach ($civility_menu as $civility_menu) { ?>
                      <?php if ($civility_menu['value'] == $envoismoinscher_civility) { ?>
                        <option value="<?php echo $civility_menu['value']; ?>" selected="selected"><?php echo $civility_menu['text']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $civility_menu['value']; ?>"><?php echo $civility_menu['text']; ?></option>
                      <?php } ?>
                    <?php } ?>
                </select>
                <?php if ($error_civility) { ?>
                    <span class="error"><?php echo $error_civility; ?></span>
                <?php } ?>
              </td>
            </tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_lastName; ?></td>
              <td><input type="text" name="envoismoinscher_lastName" value="<?php echo $envoismoinscher_lastName; ?>" />
                <?php if ($error_lastName) { ?>
                    <span class="error"><?php echo $error_lastName; ?></span>
                  <?php } ?>
              </td>
            </tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_firstName; ?></td>
              <td><input type="text" name="envoismoinscher_firstName" value="<?php echo $envoismoinscher_firstName; ?>" />
                <?php if ($error_firstName) { ?>
                    <span class="error"><?php echo $error_firstName; ?></span>
                  <?php } ?>
              </td>
            </tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_brand; ?></td>
              <td><input type="text" name="envoismoinscher_brand" value="<?php echo $envoismoinscher_brand; ?>" /></td>
            </tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_adress; ?></td>
              <td><textarea name="envoismoinscher_adress" style="width: 229px; height: 110px;"><?php echo $envoismoinscher_adress; ?></textarea>
                <?php if ($error_adress) { ?>
                    <span class="error"><?php echo $error_adress; ?></span>
                  <?php } ?>
              </td>
            </tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_cp; ?></td>
              <td><input type="text" name="envoismoinscher_cp" value="<?php echo $envoismoinscher_cp; ?>" />
                <?php if ($error_cp) { ?>
                    <span class="error"><?php echo $error_cp; ?></span>
                  <?php } ?>
              </td>
            </tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_town; ?></td>
              <td><input type="text" name="envoismoinscher_town" value="<?php echo $envoismoinscher_town; ?>" />
                <?php if ($error_town) { ?>
                    <span class="error"><?php echo $error_town; ?></span>
                  <?php } ?>
              </td>
            </tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_iso; ?></td>
              <td><input type="text" name="envoismoinscher_iso" value="<?php echo $envoismoinscher_iso; ?>" />
                <?php if ($error_iso) { ?>
                    <span class="error"><?php echo $error_iso; ?></span>
                  <?php } ?>
              </td>
            </tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_phone; ?></td>
              <td><input type="text" name="envoismoinscher_phone" value="<?php echo $envoismoinscher_phone; ?>" />
              <?php if ($error_phone) { ?>
                    <span class="error"><?php echo $error_phone; ?></span>
                  <?php } ?>
              </td>
            </tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_mail; ?></td>
              <td><input type="text" name="envoismoinscher_mail" value="<?php echo $envoismoinscher_mail; ?>" />
                <?php if ($error_mail) { ?>
                    <span class="error"><?php echo $error_mail; ?></span>
                  <?php } ?>
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_adressComplement; ?></td>
              <td><textarea name="envoismoinscher_adressComplement" style="width: 229px; height: 110px;"><?php echo $envoismoinscher_adressComplement; ?></textarea></td>
            </tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_dispoDeb; ?></td>
              <td>
                <?php
                $starttime = '00:00:00';
                $time = new DateTime($starttime);
                $interval = new DateInterval('PT60M');
                $temptime = $time->format('H:i:s');
                $temptime_display = substr($temptime,0,-3);

                echo '<select type="text" name="envoismoinscher_dispoDeb">';
                do {
                    echo '<option value="'.$temptime_display.'"';
                    if ($temptime_display == $envoismoinscher_dispoDeb) {
                        echo ' selected="selected"';
                    }
                    echo '>'.$temptime_display.'</option>';
                    $time->add($interval);
                    $temptime = $time->format('H:i:s');
                    $temptime_display = substr($temptime,0,-3);
                } while ($temptime !== $starttime);
                echo '</select>';
                ?>
                  <?php if ($error_dispoDeb) { ?>
                  <span class="error"><?php echo $error_dispoDeb; ?></span>
                  <?php } ?>
              </td>
            </tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_dispoEnd; ?></td>
              <td>
                <?php
                $starttime = '00:00:00';
                $time = new DateTime($starttime);
                $interval = new DateInterval('PT60M');
                $temptime = $time->format('H:i:s');
                $temptime_display = substr($temptime,0,-3);

                echo '<select type="text" name="envoismoinscher_dispoEnd">';
                do {
                    echo '<option value="'.$temptime_display.'"';
                    if ($temptime_display == $envoismoinscher_dispoEnd) {
                        echo ' selected="selected"';
                    }
                    echo '>'.$temptime_display.'</option>';
                    $time->add($interval);
                    $temptime = $time->format('H:i:s');
                    $temptime_display = substr($temptime,0,-3);
                } while ($temptime !== $starttime);
                echo '</select>';
                ?>
                <?php if ($error_dispoEnd) { ?>
                    <span class="error"><?php echo $error_dispoEnd; ?></span>
                  <?php } ?>
              </td>
            </tr>          
          </table>
        </div>
        <div id="tab_envois" class="vtabs_content">
          <table class="form">
            <tr>
              <td><span class="required">*</span><?php echo $entry_type_send; ?></td>
              <td>
                <select type="text" name="envoismoinscher_typeSend">
                    <?php foreach ($typeSend_menu as $typeSend_menu) { ?>
                      <?php if ($typeSend_menu['value'] == $envoismoinscher_typeSend) { ?>
                        <option value="<?php echo $typeSend_menu['value']; ?>" selected="selected"><?php echo $typeSend_menu['text']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $typeSend_menu['value']; ?>"><?php echo $typeSend_menu['text']; ?></option>
                      <?php } ?>
                    <?php } ?>
                </select>              
              </td>
            </tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_min_weight; ?></td>
              <td>
                <input type="text" name="envoismoinscher_minWeight" value="<?php echo $envoismoinscher_minWeight; ?>" /> kg
              </td>
            </tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_max_weight; ?></td>
              <td>
                <input type="text" name="envoismoinscher_maxWeight" value="<?php echo $envoismoinscher_maxWeight; ?>" /> kg
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_default_weight; ?></td>
              <td>
                <input type="text" name="envoismoinscher_defaultWeight" value="<?php echo $envoismoinscher_defaultWeight; ?>" /> kg
                <br /><?php echo $entry_default_weight_help; ?>
              </td>
            </tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_nature_send; ?></td>
              <td>
                <select type="text" name="envoismoinscher_natureSend">
                    <?php foreach ($natureSend_menu as $natureSend_menu) { ?>
                      <?php if (isset($natureSend_menu['value']) && $natureSend_menu['value'] == $envoismoinscher_natureSend) { ?>
                        <option value="<?php echo $natureSend_menu['value']; ?>" selected="selected"><?php echo $natureSend_menu['text']; ?></option>
                      <?php } else { ?>
                        <?php if (isset($natureSend_menu['name'])){ ?>
                          <optgroup label="<?php echo $natureSend_menu['name'];?>">
                        <?php } else { ?>
                        <option value="<?php echo $natureSend_menu['value']; ?>"><?php echo $natureSend_menu['text']; ?></option>
                      <?php   }
                            } ?>
                          </optgroup>
                    <?php } ?>
                </select> 
                </br></br>
                <?php if ($envoismoinscher_check_natureSend == 1) { ?>
                  <input type="checkbox" value="1" name="envoismoinscher_check_natureSend" checked="checked">
                <?php } else { ?>
                  <input type="checkbox" value="1" name="envoismoinscher_check_natureSend">
                <?php } ?>
                <label for="envoismoinscher_check_natureSend"><?php echo $entry_use_description; ?></label>
                <br /><?php echo $entry_nature_send_help; ?>
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_embal_send; ?></td>
              <td>
                <select type="text" name="envoismoinscher_embalSend">
                    <?php foreach ($embalSend_menu as $embalSend_menu) { ?>
                      <?php if ($embalSend_menu['value'] == $envoismoinscher_embalSend) { ?>
                        <option value="<?php echo $embalSend_menu['value']; ?>" selected="selected"><?php echo $embalSend_menu['text']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $embalSend_menu['value']; ?>"><?php echo $embalSend_menu['text']; ?></option>
                      <?php } ?>
                    <?php } ?>
                </select> 
              </td>
            </tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_date_recup; ?></td>
              <td>
                <?php echo $entry_day_plus; ?><input type="text" name="envoismoinscher_dateRecup" value="<?php echo $envoismoinscher_dateRecup; ?>" /><?php echo $entry_cmd_passed; ?>
                <select type="text" name="envoismoinscher_dateRecupH1">
                    <?php foreach ($dateRecupH1_menu as $dateRecupH1_menu) { ?>
                      <?php if ($dateRecupH1_menu['value'] == $envoismoinscher_dateRecupH1) { ?>
                        <option value="<?php echo $dateRecupH1_menu['value']; ?>" selected="selected"><?php echo $dateRecupH1_menu['text']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $dateRecupH1_menu['value']; ?>"><?php echo $dateRecupH1_menu['text']; ?></option>
                      <?php } ?>
                    <?php } ?>
                </select><?php echo $entry_and; ?>
                <select type="text" name="envoismoinscher_dateRecupH2">
                    <?php foreach ($dateRecupH2_menu as $dateRecupH2_menu) { ?>
                      <?php if ($dateRecupH2_menu['value'] == $envoismoinscher_dateRecupH2) { ?>
                        <option value="<?php echo $dateRecupH2_menu['value']; ?>" selected="selected"><?php echo $dateRecupH2_menu['text']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $dateRecupH2_menu['value']; ?>"><?php echo $dateRecupH2_menu['text']; ?></option>
                      <?php } ?>
                    <?php } ?>
                </select>
                <br /><?php echo $entry_date_recup_help; ?>
              </td>
            </tr>
            <tr>
              <td><span class="required">*</span><?php echo $entry_date_recup2; ?></td>
              <td>
                <?php echo $entry_day_plus; ?><input type="text" name="envoismoinscher_dateRecup2" value="<?php echo $envoismoinscher_dateRecup2; ?>" /><?php echo $entry_cmd_passed; ?>
                <select type="text" name="envoismoinscher_dateRecup2H1">
                    <?php foreach ($dateRecup2H1_menu as $dateRecup2H1_menu) { ?>
                      <?php if ($dateRecup2H1_menu['value'] == $envoismoinscher_dateRecup2H1) { ?>
                        <option value="<?php echo $dateRecup2H1_menu['value']; ?>" selected="selected"><?php echo $dateRecup2H1_menu['text']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $dateRecup2H1_menu['value']; ?>"><?php echo $dateRecup2H1_menu['text']; ?></option>
                      <?php } ?>
                    <?php } ?>
                </select><?php echo $entry_and; ?>
                <select type="text" name="envoismoinscher_dateRecup2H2">
                    <?php foreach ($dateRecup2H2_menu as $dateRecup2H2_menu) { ?>
                      <?php if ($dateRecup2H2_menu['value'] == $envoismoinscher_dateRecup2H2) { ?>
                        <option value="<?php echo $dateRecup2H2_menu['value']; ?>" selected="selected"><?php echo $dateRecup2H2_menu['text']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $dateRecup2H2_menu['value']; ?>"><?php echo $dateRecup2H2_menu['text']; ?></option>
                      <?php } ?>
                    <?php } ?>
                </select>
                <br /><?php echo $entry_date_recup_help; ?>
              </td>
            </tr>
            <tr style="display:none;">
              <td><?php echo $entry_mode_send; ?></td>
              <td>
                <select type="text" name="envoismoinscher_modeSend">
                    <?php foreach ($modeSend_menu as $modeSend_menu) { ?>
                      <?php if ($modeSend_menu['value'] == $envoismoinscher_modeSend) { ?>
                        <option value="<?php echo $modeSend_menu['value']; ?>" selected="selected"><?php echo $modeSend_menu['text']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $modeSend_menu['value']; ?>"><?php echo $modeSend_menu['text']; ?></option>
                      <?php } ?>
                    <?php } ?>
                </select>
                <br><?php echo $entry_mode_send_help; ?>
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_pass_cmd; ?></td>
              <td>
                <select type="text" name="envoismoinscher_passCmd">
                    <?php foreach ($passCmd_menu->rows as $passCmd_menu) { ?>
                      <?php if ($passCmd_menu['order_status_id'] == $envoismoinscher_passCmd) { ?>
                        <option value="<?php echo $passCmd_menu['order_status_id']; ?>" selected="selected"><?php echo $passCmd_menu['name']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $passCmd_menu['order_status_id']; ?>"><?php echo $passCmd_menu['name']; ?></option>
                      <?php } ?>
                    <?php } ?>
                </select> 
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_send_cmd; ?></td>
              <td>
                <select type="text" name="envoismoinscher_sendCmd">
                    <?php foreach ($sendCmd_menu->rows as $sendCmd_menu) { ?>
                      <?php if ($sendCmd_menu['order_status_id'] == $envoismoinscher_sendCmd) { ?>
                        <option value="<?php echo $sendCmd_menu['order_status_id']; ?>" selected="selected"><?php echo $sendCmd_menu['name']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $sendCmd_menu['order_status_id']; ?>"><?php echo $sendCmd_menu['name']; ?></option>
                      <?php } ?>
                    <?php } ?>
                </select> 
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_arrive_cmd; ?></td>
              <td>
                <select type="text" name="envoismoinscher_arriveCmd">
                    <?php foreach ($arriveCmd_menu->rows as $arriveCmd_menu) { ?>
                      <?php if ($arriveCmd_menu['order_status_id'] == $envoismoinscher_arriveCmd) { ?>
                        <option value="<?php echo $arriveCmd_menu['order_status_id']; ?>" selected="selected"><?php echo $arriveCmd_menu['name']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $arriveCmd_menu['order_status_id']; ?>"><?php echo $arriveCmd_menu['name']; ?></option>
                      <?php } ?>
                    <?php } ?>
                </select> 
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_suppr_cmd; ?></td>
              <td>
                <select type="text" name="envoismoinscher_supprCmd">
                    <?php foreach ($supprCmd_menu->rows as $supprCmd_menu) { ?>
                      <?php if ($supprCmd_menu['order_status_id'] == $envoismoinscher_supprCmd) { ?>
                        <option value="<?php echo $supprCmd_menu['order_status_id']; ?>" selected="selected"><?php echo $supprCmd_menu['name']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $supprCmd_menu['order_status_id']; ?>"><?php echo $supprCmd_menu['name']; ?></option>
                      <?php } ?>
                    <?php } ?>
                </select> 
              </td>
            </tr>      
            <tr>
              <td><?php echo $entry_client_particulier; ?></td>
              <td>
                <select type="text" name="envoismoinscher_clientParticulier">
                    <?php foreach ($clientParticulier_menu as $clientParticulier_menu) { ?>
                      <?php if ($clientParticulier_menu['value'] == $envoismoinscher_clientParticulier) { ?>
                        <option value="<?php echo $clientParticulier_menu['value']; ?>" selected="selected"><?php echo $clientParticulier_menu['text']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $clientParticulier_menu['value']; ?>"><?php echo $clientParticulier_menu['text']; ?></option>
                      <?php } ?>
                    <?php } ?>
                </select>
                <br><?php echo $entry_client_particulier_help; ?>
              </td>
            </tr>
            <tr style="display:none;">
              <td><?php echo $entry_multicolis; ?></td>
              <td>
                <select type="text" name="envoismoinscher_multicolis">
                    <?php foreach ($multicolis_menu as $multicolis_menu) { ?>
                      <?php if ($multicolis_menu['value'] == $envoismoinscher_multicolis) { ?>
                        <option value="<?php echo $multicolis_menu['value']; ?>" selected="selected"><?php echo $multicolis_menu['text']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $multicolis_menu['value']; ?>"><?php echo $multicolis_menu['text']; ?></option>
                      <?php } ?>
                    <?php } ?>
                </select>
                <br><?php echo $entry_multicolis_help; ?>
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_assurance; ?></td>
              <td>
                <select type="text" name="envoismoinscher_assurance">
                    <?php foreach ($assurance_menu as $assurance_menu) { ?>
                      <?php if ($assurance_menu['value'] == $envoismoinscher_assurance) { ?>
                        <option value="<?php echo $assurance_menu['value']; ?>" selected="selected"><?php echo $assurance_menu['text']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $assurance_menu['value']; ?>"><?php echo $assurance_menu['text']; ?></option>
                      <?php } ?>
                    <?php } ?>
                </select>
                <br /><?php echo $entry_assurance_help; ?>
                <br /><?php echo $entry_tabassurance_desc; ?><br />
                <br />
                <select name="envoismoinscher_assurance_emballage" style="width:200px;">
                    <option value="Boîte"<?php if ($envoismoinscher_assurance_emballage == "Boîte") { ?> selected="selected"<?php } ?>><?php echo $entry_packing_box; ?></option>
                    <option value="Caisse"<?php if ($envoismoinscher_assurance_emballage == "Caisse") { ?> selected="selected"<?php } ?>><?php echo $entry_packing_case; ?></option>
                    <option value="Bac"<?php if ($envoismoinscher_assurance_emballage == "Bac") { ?> selected="selected"<?php } ?>><?php echo $entry_packing_vat; ?></option>
                    <option value="Emballage isotherme"<?php if ($envoismoinscher_assurance_emballage == "Emballage isotherme") { ?> selected="selected"<?php } ?>><?php echo $entry_packing_isothermal_packaging; ?></option>
                    <option value="Etui"<?php if ($envoismoinscher_assurance_emballage == "Etui") { ?> selected="selected"<?php } ?>><?php echo $entry_packing_cover; ?></option>
                    <option value="Malle"<?php if ($envoismoinscher_assurance_emballage == "Malle") { ?> selected="selected"<?php } ?>><?php echo $entry_packing_trunk; ?></option>
                    <option value="Sac"<?php if ($envoismoinscher_assurance_emballage == "Sac") { ?> selected="selected"<?php } ?>><?php echo $entry_packing_bag; ?></option>
                    <option value="Tube"<?php if ($envoismoinscher_assurance_emballage == "Tube") { ?> selected="selected"<?php } ?>><?php echo $entry_packing_tube; ?></option>
                </select> <?php echo $entry_packing; ?><br /><br />
                <select name="envoismoinscher_assurance_fermeture" style="width:200px;">
                    <option value="Fermeture autocollante"<?php if ($envoismoinscher_assurance_fermeture == "Fermeture autocollant") { ?> selected="selected"<?php } ?>><?php echo $entry_locking_adhesive; ?></option>
                    <option value="Ruban adhésif"<?php if ($envoismoinscher_assurance_fermeture == "Ruban adhésif") { ?> selected="selected"<?php } ?>><?php echo $entry_locking_tape; ?></option>
                    <option value="Agrafes"<?php if ($envoismoinscher_assurance_fermeture == "Agrafes") { ?> selected="selected"<?php } ?>><?php echo $entry_locking_staples; ?></option>
                    <option value="Clous"<?php if ($envoismoinscher_assurance_fermeture == "Clous") { ?> selected="selected"<?php } ?>><?php echo $entry_locking_nails; ?></option>
                    <option value="Collage"<?php if ($envoismoinscher_assurance_fermeture == "Collage") { ?> selected="selected"<?php } ?>><?php echo $entry_locking_gluing; ?></option>
                    <option value="Ruban de cerclage"<?php if ($envoismoinscher_assurance_fermeture == "Ruban de cerclage") { ?> selected="selected"<?php } ?>><?php echo $entry_locking_strapping_tape; ?></option>
                    <option value="Sangle ou feuillard"<?php if ($envoismoinscher_assurance_fermeture == "Sangle ou feuillard") { ?> selected="selected"<?php } ?>><?php echo $entry_locking_strap; ?></option>
                    <option value="Agraphes et cerclage"<?php if ($envoismoinscher_assurance_fermeture == "Agraphes et cerclage") { ?> selected="selected"<?php } ?>><?php echo $entry_locking_staples_and_strapping; ?></option>
                    <option value="Clous et cerclage"<?php if ($envoismoinscher_assurance_fermeture == "Clous et cerclage") { ?> selected="selected"<?php } ?>><?php echo $entry_locking_nails_and_strapping; ?></option>
                </select> <?php echo $entry_locking; ?><br /><br />
                <select name="envoismoinscher_assurance_fixation" style="width:200px;">
                    <option value="Sans système de stabilisation"<?php if ($envoismoinscher_assurance_fixation == "Sans système de stabilisation") { ?> selected="selected"<?php } ?>><?php echo $entry_attachment_without; ?></option>
                    <option value="Film transparent"<?php if ($envoismoinscher_assurance_fixation == "Film transparent") { ?> selected="selected"<?php } ?>><?php echo $entry_attachment_transparent; ?></option>
                    <option value="Film opaque"<?php if ($envoismoinscher_assurance_fixation == "Film opaque") { ?> selected="selected"<?php } ?>><?php echo $entry_attachment_opaque; ?></option>
                    <option value="Film opaque et sangles"<?php if ($envoismoinscher_assurance_fixation == "Film opaque et sangles") { ?> selected="selected"<?php } ?>><?php echo $entry_attachment_opaque_and_webbing; ?></option>
                    <option value="Film transparent et sangles"<?php if ($envoismoinscher_assurance_fixation == "Film transparent et sangles") { ?> selected="selected"<?php } ?>><?php echo $entry_attachment_transparent_and_webbing; ?></option>
                    <option value="Sangle ou feuillard uniquement"<?php if ($envoismoinscher_assurance_fixation == "Sangle ou feuillard uniquement") { ?> selected="selected"<?php } ?>><?php echo $entry_attachment_strapping; ?></option>
                </select> <?php echo $entry_attachment; ?><br /><br />
                <select name="envoismoinscher_assurance_materiau" style="width:200px;">
                    <option value="Carton"<?php if ($envoismoinscher_assurance_materiau == "Carton") { ?> selected="selected"<?php } ?>><?php echo $entry_material_cardboard; ?></option>
                    <option value="Bois"<?php if ($envoismoinscher_assurance_materiau == "Bois") { ?> selected="selected"<?php } ?>><?php echo $entry_material_wood; ?></option>
                    <option value="Film opaque"<?php if ($envoismoinscher_assurance_materiau == "Film opaque") { ?> selected="selected"<?php } ?>><?php echo $entry_material_opaque; ?></option>
                    <option value="Film transparent"<?php if ($envoismoinscher_assurance_materiau == "Film transparent") { ?> selected="selected"<?php } ?>><?php echo $entry_material_transparent; ?></option>
                    <option value="Métal"<?php if ($envoismoinscher_assurance_materiau == "Métal") { ?> selected="selected"<?php } ?>><?php echo $entry_material_metal; ?></option>
                    <option value="Papier"<?php if ($envoismoinscher_assurance_materiau == "Papier") { ?> selected="selected"<?php } ?>><?php echo $entry_material_paper; ?></option>
                    <option value="Papier armé"<?php if ($envoismoinscher_assurance_materiau == "Papier armé") { ?> selected="selected"<?php } ?>><?php echo $entry_material_reinforced_paper; ?></option>
                    <option value="Plastique et carton"<?php if ($envoismoinscher_assurance_materiau == "Plastique et carton") { ?> selected="selected"<?php } ?>><?php echo $entry_material_plastic_and_cardboard; ?></option>
                    <option value="Plastique"<?php if ($envoismoinscher_assurance_materiau == "Plastique") { ?> selected="selected"<?php } ?>><?php echo $entry_material_plastic; ?></option>
                    <option value="Plastique opaque"<?php if ($envoismoinscher_assurance_materiau == "Plastique opaque") { ?> selected="selected"<?php } ?>><?php echo $entry_material_opaque_plastic; ?></option>
                    <option value="Plastique transparent"<?php if ($envoismoinscher_assurance_materiau == "Plastique transparent") { ?> selected="selected"<?php } ?>><?php echo $entry_material_transparent_plastic; ?></option>
                    <option value="Polystyrène"<?php if ($envoismoinscher_assurance_materiau == "Polystyrène") { ?> selected="selected"<?php } ?>><?php echo $entry_material_polystyrene; ?></option>
                </select> <?php echo $entry_material; ?><br /><br />
                <select name="envoismoinscher_assurance_protection" style="width:200px;">
                    <option value="Sans protection particulière"<?php if ($envoismoinscher_assurance_protection == "Sans protection particulière") { ?> selected="selected"<?php } ?>><?php echo $entry_protection_without; ?></option>
                    <option value="Calage papier"<?php if ($envoismoinscher_assurance_protection == "Calage papier") { ?> selected="selected"<?php } ?>><?php echo $entry_protection_paper; ?></option>
                    <option value="Bulles plastiques"<?php if ($envoismoinscher_assurance_protection == "Bulles plastiques") { ?> selected="selected"<?php } ?>><?php echo $entry_protection_plastic; ?></option>
                    <option value="Carton antichoc"<?php if ($envoismoinscher_assurance_protection == "Carton antichoc") { ?> selected="selected"<?php } ?>><?php echo $entry_protection_cardboard; ?></option>
                    <option value="Coussin air"<?php if ($envoismoinscher_assurance_protection == "Coussin air") { ?> selected="selected"<?php } ?>><?php echo $entry_protection_air; ?></option>
                    <option value="Coussin mousse"<?php if ($envoismoinscher_assurance_protection == "Coussin mousse") { ?> selected="selected"<?php } ?>><?php echo $entry_protection_foam; ?></option>
                    <option value="Manchon carton (bouteille)"<?php if ($envoismoinscher_assurance_protection == "Manchon carton (bouteille)") { ?> selected="selected"<?php } ?>><?php echo $entry_protection_bottle_cardboard; ?></option>
                    <option value="Manchon mousse (bouteille)"<?php if ($envoismoinscher_assurance_protection == "Manchon mousse (bouteille)") { ?> selected="selected"<?php } ?>><?php echo $entry_protection_bottle_foam; ?></option>
                    <option value="Matelassage"<?php if ($envoismoinscher_assurance_protection == "Matelassage") { ?> selected="selected"<?php } ?>><?php echo $entry_protection_padding; ?></option>
                    <option value="Plaque mousse"<?php if ($envoismoinscher_assurance_protection == "Plaque mousse") { ?> selected="selected"<?php } ?>><?php echo $entry_protection_foam_plate; ?></option>
                    <option value="Polystyrène"<?php if ($envoismoinscher_assurance_protection == "Polystyrène") { ?> selected="selected"<?php } ?>><?php echo $entry_protection_polystyrene; ?></option>
                    <option value="Coussin de calage"<?php if ($envoismoinscher_assurance_protection == "Coussin de calage") { ?> selected="selected"<?php } ?>><?php echo $entry_protection_wedge_cushion; ?></option>
                    <option value="Sachet bulles"<?php if ($envoismoinscher_assurance_protection == "Sachet bulles") { ?> selected="selected"<?php } ?>><?php echo $entry_protection_bubbles; ?></option>
                </select> <?php echo $entry_protection; ?>
              </td>
            </tr>
            <tr>
              <td><?php echo $entry_mail_setting; ?></td>
              <td>
                <?php if ($envoismoinscher_check_mail1 == 1) { ?>
                  <input type="checkbox" value="1" name="envoismoinscher_check_mail1" checked="checked">
                <?php } else { ?>
                  <input type="checkbox" value="1" name="envoismoinscher_check_mail1">
                <?php } ?>
                <label for="envoismoinscher_check_mail1"><?php echo $entry_mail_slip; ?></label><br>
                <?php if ($envoismoinscher_check_mail2 == 1) { ?>
                  <input type="checkbox" value="1" name="envoismoinscher_check_mail2" checked="checked">
                <?php } else { ?>
                  <input type="checkbox" value="1" name="envoismoinscher_check_mail2">
                <?php } ?>
                <label for="envoismoinscher_check_mail2"><?php echo $entry_mail_notification; ?></label><br>
                <?php if ($envoismoinscher_check_mail3 == 1) { ?>
                  <input type="checkbox" value="1" name="envoismoinscher_check_mail3" checked="checked">
                <?php } else { ?>
                  <input type="checkbox" value="1" name="envoismoinscher_check_mail3">
                <?php } ?>
                <label for="envoismoinscher_check_mail3"><?php echo $entry_mail_bill; ?></label>
              </td>
            </tr>
          </table>
        </div>
        <div id="tab_transport" class="vtabs_content">
          <br /><?php echo $entry_ShippingUrl_help; ?><br />
          <table class="form">
            <caption style="background: #f0f0f0;padding:5px;"><b><?php echo $entry_OffresEconomiques; ?></b>
            <br /><br /><span class="help" style="text-align:justify;"><?php echo $entry_OffresEconomiques_help; ?></span></caption>
            <?php if (isset($carriers_list_eco)) {
            foreach ($carriers_list_eco as $carrier_list_eco) { ?>
            <tr>
              <td><?php echo $srv_code[$carrier_list_eco]['name']; ?></td>
              <td><b><?php echo $srv_code[$carrier_list_eco]['description']; ?></b><br>
                <?php if (isset($srv_code[$carrier_list_eco]['listpoints'])) { ?>
                <br><?php echo $entry_DroppOffPoint; ?>&nbsp;
                <select type="text" name="<?php echo $carrier_list_eco; ?>_depot">
                    <option value=""><?php echo $entry_SelectDroppOffPoint; ?></option>
                    <?php 
                        $select_emc = 0;
                        foreach ($srv_code[$carrier_list_eco]['listpoints'] as $listpoint) { ?>
                      <?php if ($listpoint['value'] == $srv_code[$carrier_list_eco]['depot']) { 
                                $select_emc = 1;
                      ?>
                       <option value="<?php echo $listpoint['value']; ?>" selected="selected"><?php echo $listpoint['text']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $listpoint['value']; ?>"><?php echo $listpoint['text']; ?></option>
                      <?php } ?>
                    <?php } 
                        if ($select_emc == 0 && $srv_code[$carrier_list_eco]['status']) { 
                            $error_select_emc = $error_relai_point;
                            $error_emc = $error_emc.$error_mess_emc1."<b>".$carrier_list_eco."</b>".$error_mess_emc2."<br>";
                        }else{
                            $error_select_emc = "";
                        }
                    ?>
                </select><br>
                <?php   if ($error_select_emc) { ?>
                <br><div class="warning"><?php echo $error_select_emc; ?></div>
                <?php   } ?>
                <?php }else{ ?>
                <input type="hidden" name="<?php echo $carrier_list_eco; ?>_depot" value="<?php echo $srv_code[$carrier_list_eco]['depot']; ?>" />
                <?php } ?>
                <br><?php echo $entry_ShippingStatus; ?>&nbsp;
                <select type="text" name="<?php echo $carrier_list_eco; ?>">
                    <?php foreach ($carrier_status as $carrier_status_item) { ?>
                      <?php if ($carrier_status_item['value'] == $srv_code[$carrier_list_eco]['status']) { ?>
                        <option value="<?php echo $carrier_status_item['value']; ?>" selected="selected"><?php echo $carrier_status_item['text']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $carrier_status_item['value']; ?>"><?php echo $carrier_status_item['text']; ?></option>
                      <?php } ?>
                    <?php } ?>
                </select>
                <?php echo $entry_ShippingPrice; ?>&nbsp;
                <select type="text" name="<?php echo $carrier_list_eco; ?>_price" class="type_frais" id="select_<?php echo $carrier_list_eco; ?>">
                    <?php foreach ($carrier_price as $carrier_price_item) { ?>
                      <?php if ($carrier_price_item['value'] == $srv_code[$carrier_list_eco]['price']) { ?>
                        <option value="<?php echo $carrier_price_item['value']; ?>" selected="selected"><?php echo $carrier_price_item['text']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $carrier_price_item['value']; ?>"><?php echo $carrier_price_item['text']; ?></option>
                      <?php } ?>
                    <?php } ?>
                </select>
                <?php echo $entry_ShippingUrl; ?>&nbsp;
                <input type="text" name="<?php echo $carrier_list_eco; ?>_url" value="<?php echo $srv_code[$carrier_list_eco]['url']; ?>" style="width:300px;"/>
                <input type="hidden" name="<?php echo $carrier_list_eco; ?>_delai" value="<?php echo $srv_code[$carrier_list_eco]['delai']; ?>" />
              </td>
            </tr>
				<tr class="tab_<?php echo $carrier_list_eco; ?>" style="<?php if( $srv_code[$carrier_list_eco]['price'] == 0 ){ echo 'display:none;'; } ?>">
					<td colspan="2">
						<select type="text" name="<?php echo $carrier_list_eco; ?>_frais_base">
							<?php foreach ( ${$carrier_list_eco.'frais_menu'} as $frais_menu ) { ?>
							  <?php if ( $frais_menu["value"] == ${$carrier_list_eco.'_frais_base'} ) { ?>
								  <option value="<?php echo $frais_menu["value"]; ?>" selected="selected"><?php echo $frais_menu["value"]; ?></option>
								<?php } else { ?>
								  <option value="<?php echo $frais_menu["value"]; ?>"><?php echo $frais_menu["value"]; ?></option>
								<?php } ?>
							  <?php } ?>
						  </select>
						  <?php echo $entry_frais_desc; ?>
					</td>
				 </tr>
				<?php
					for ($i=1; $i<= $nb_range; $i++){
					?>			
					<tr class="tab_<?php echo $carrier_list_eco; ?>" style="<?php if( $srv_code[$carrier_list_eco]['price'] == 0 ){ echo 'display:none;'; } ?>">
						<td colspan="2"><?php echo $i; ?>. &thinsp;
							<b><?php echo $entry_range_low; ?></b>
							<input type="text" name="<?php echo $carrier_list_eco; ?>_range_low_<?php echo $i; ?>" value="<?php echo ${$carrier_list_eco."_range_low_".$i}; ?>" /> € HT ou kg&nbsp;
							<b><?php echo $entry_range_high; ?></b>
							<input type="text" name="<?php echo $carrier_list_eco; ?>_range_high_<?php echo $i; ?>" value="<?php echo ${$carrier_list_eco."_range_high_".$i}; ?>" /> € HT ou kg&nbsp;
							<b><?php echo $entry_range_price; ?></b>
							<input type="text" name="<?php echo $carrier_list_eco; ?>_range_price_<?php echo $i; ?>" value="<?php echo ${$carrier_list_eco."_range_price_".$i}; ?>" /> € HT
						</td>
					</tr>
					<?php } ?>
            <?php } 
            }?>
          </table>
          <table class="form">
            <caption style="background: #f0f0f0;padding:5px;"><b><?php echo $entry_Expressistes; ?></b>
            <br /><br /><span class="help" style="text-align:justify;"><?php echo $entry_Expressistes_help; ?></span></caption>
            <?php if (isset($carriers_list_exp)) {
            foreach ($carriers_list_exp as $carrier_list_exp) { ?>
            <tr>
              <td><?php echo $srv_code[$carrier_list_exp]['name']; ?></td>
              <td><b><?php echo $srv_code[$carrier_list_exp]['description']; ?></b><br>
                <?php if (isset($srv_code[$carrier_list_exp]['listpoints'])) { ?>
                <br><?php echo $entry_DroppOffPoint; ?>&nbsp;
                <select type="text" name="<?php echo $carrier_list_exp; ?>_depot">
                    <option value=""><?php echo $entry_SelectDroppOffPoint; ?></option>
                    <?php 
                        $select_emc = 0;
                        foreach ($srv_code[$carrier_list_exp]['listpoints'] as $listpoint) { ?>
                      <?php if ($listpoint['value'] == $srv_code[$carrier_list_exp]['depot']) { 
                                $select_emc = 1;
                      ?>
                       <option value="<?php echo $listpoint['value']; ?>" selected="selected"><?php echo $listpoint['text']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $listpoint['value']; ?>"><?php echo $listpoint['text']; ?></option>
                      <?php } ?>
                    <?php } 
                        if ($select_emc == 0 && $srv_code[$carrier_list_exp]['status']) { 
                            $error_select_emc = $error_relai_point;
                            $error_emc = $error_emc.$error_mess_emc1."<b>".$carrier_list_eco."</b>".$error_mess_emc2."<br>";;
                        }else{
                            $error_select_emc = "";
                        }
                    ?>
                </select><br>
                <?php   if ($error_select_emc) { ?>
                <br><div class="warning"><?php echo $error_select_emc; ?></div>
                <?php   } ?>
                <?php }else{ ?>
                <input type="hidden" name="<?php echo $carrier_list_exp; ?>_depot" value="<?php echo $srv_code[$carrier_list_exp]['depot']; ?>" />
                <?php } ?>
                <br><?php echo $entry_ShippingStatus; ?>&nbsp;
                <select type="text" name="<?php echo $carrier_list_exp; ?>">
                    <?php foreach ($carrier_status as $carrier_status_item) { ?>
                      <?php if ($carrier_status_item['value'] == $srv_code[$carrier_list_exp]['status']) { ?>
                        <option value="<?php echo $carrier_status_item['value']; ?>" selected="selected"><?php echo $carrier_status_item['text']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $carrier_status_item['value']; ?>"><?php echo $carrier_status_item['text']; ?></option>
                      <?php } ?>
                    <?php } ?>
                </select>
                <?php echo $entry_ShippingPrice; ?>&nbsp;
                <select type="text" name="<?php echo $carrier_list_exp; ?>_price" class="type_frais" id="select_<?php echo $carrier_list_exp; ?>">
                    <?php foreach ($carrier_price as $carrier_price_item) { ?>
                      <?php if ($carrier_price_item['value'] == $srv_code[$carrier_list_exp]['price']) { ?>
                        <option value="<?php echo $carrier_price_item['value']; ?>" selected="selected"><?php echo $carrier_price_item['text']; ?></option>
                      <?php } else { ?>
                        <option value="<?php echo $carrier_price_item['value']; ?>"><?php echo $carrier_price_item['text']; ?></option>
                      <?php } ?>
                    <?php } ?>
                </select>
                <?php echo $entry_ShippingUrl; ?>&nbsp;
                <input type="text" name="<?php echo $carrier_list_exp; ?>_url" value="<?php echo $srv_code[$carrier_list_exp]['url']; ?>" style="width:300px;"/>
                <input type="hidden" name="<?php echo $carrier_list_exp; ?>_delai" value="<?php echo $srv_code[$carrier_list_exp]['delai']; ?>" />
              </td>
            </tr>
				<tr class="tab_<?php echo $carrier_list_exp; ?>" style="<?php if( $srv_code[$carrier_list_exp]['price'] == 0 ){ echo 'display:none;'; } ?>">
                    <td colspan="2">
                    <select type="text" name="<?php echo $carrier_list_exp; ?>_frais_base">
                        <?php foreach ( ${$carrier_list_exp.'frais_menu'} as $frais_menu ) { ?>
                          <?php if ( $frais_menu["value"] == ${$carrier_list_exp.'_frais_base'} ) { ?>
                              <option value="<?php echo $frais_menu["value"]; ?>" selected="selected"><?php echo $frais_menu["value"]; ?></option>
                            <?php } else { ?>
                              <option value="<?php echo $frais_menu["value"]; ?>"><?php echo $frais_menu["value"]; ?></option>
                            <?php } ?>
                          <?php } ?>
                      </select>
                      <?php echo $entry_frais_desc; ?>
					</td>
                </tr>
				<?php
                    for ($i=1; $i<= $nb_range; $i++){
                ?>			
                <tr class="tab_<?php echo $carrier_list_exp; ?>" style="<?php if( $srv_code[$carrier_list_exp]['price'] == 0 ){ echo 'display:none;'; } ?>">
                    <td colspan="2"><?php echo $i; ?>. &thinsp;
                        <b><?php echo $entry_range_low; ?></b>
                        <input type="text" name="<?php echo $carrier_list_exp; ?>_range_low_<?php echo $i; ?>" value="<?php echo ${$carrier_list_exp."_range_low_".$i}; ?>" /> € HT ou kg&nbsp;
                        <b><?php echo $entry_range_high; ?></b>
                        <input type="text" name="<?php echo $carrier_list_exp; ?>_range_high_<?php echo $i; ?>" value="<?php echo ${$carrier_list_exp."_range_high_".$i}; ?>" /> € HT ou kg&nbsp;
                        <b><?php echo $entry_range_price; ?></b>
                        <input type="text" name="<?php echo $carrier_list_exp; ?>_range_price_<?php echo $i; ?>" value="<?php echo ${$carrier_list_exp."_range_price_".$i}; ?>" /> € HT
                    </td>
                </tr>
                <?php } ?>
            <?php }
            } ?>
          </table>
        </div>        
        <div id="tab_dimensions" class="vtabs_content">
           <!-- <table class="form">
                <caption style="background: #f0f0f0;padding:5px;"><b><?php echo $entry_frais; ?></b></caption>
                <tr>
                    <td>
                      <select type="text" name="envoismoinscher_frais_base">
                          <?php foreach ($frais_menu as $frais_menu) { ?>
                            <?php if ($frais_menu['value'] == $envoismoinscher_frais_base) { ?>
                              <option value="<?php echo $frais_menu['value']; ?>" selected="selected"><?php echo $frais_menu['text']; ?></option>
                            <?php } else { ?>
                              <option value="<?php echo $frais_menu['value']; ?>"><?php echo $frais_menu['text']; ?></option>
                            <?php } ?>
                          <?php } ?>
                      </select>
                      <?php echo $entry_frais_desc; ?>
                    </td>
                </tr>
                <?php
                    for ($i=1; $i<= $nb_range; $i++){
                ?>			
                <tr>
                    <td><?php echo $i; ?>. &thinsp;
                        <b><?php echo $entry_range_low; ?></b>
                        <input type="text" name="envoismoinscher_range_low_<?php echo $i; ?>" value="<?php echo ${"envoismoinscher_range_low_".$i}; ?>" /> € HT ou kg&nbsp;
                        <b><?php echo $entry_range_high; ?></b>
                        <input type="text" name="envoismoinscher_range_high_<?php echo $i; ?>" value="<?php echo ${"envoismoinscher_range_high_".$i}; ?>" /> € HT ou kg&nbsp;
                        <b><?php echo $entry_range_price; ?></b>
                        <input type="text" name="envoismoinscher_range_price_<?php echo $i; ?>" value="<?php echo ${"envoismoinscher_range_price_".$i}; ?>" /> € HT
                    </td>
                </tr>
                <?php } ?>
            </table>-->
            <table class="form">
                <caption style="background: #f0f0f0;padding:5px;"><b><?php echo $entry_price; ?></b></caption>
                <tr>
                    <td>
                      <input type="text" name="envoismoinscher_price" value="<?php echo $envoismoinscher_price; ?>" /> <?php echo $entry_manutention; ?>
                    </td>
                </tr>
            </table>
            <table class="form">
                <caption style="background: #f0f0f0;padding:5px;"><b><?php echo $entry_dimensions; ?></b><br /><br /><?php echo $entry_dimensions_desc; ?></caption>
                <?php
                    for ($i=1; $i<= $nb_dim; $i++){
                ?>			
                <tr>
                    <td><?php echo $i; ?>. &thinsp;
                        <b><?php echo $entry_dim_weight; ?></b>
                        <input type="text" name="envoismoinscher_dim_weight_<?php echo $i; ?>" value="<?php echo ${"envoismoinscher_dim_weight_".$i}; ?>" /> kg&nbsp;
                        <b><?php echo $entry_dim_lenght; ?></b>
                        <input type="text" name="envoismoinscher_dim_lenght_<?php echo $i; ?>" value="<?php echo ${"envoismoinscher_dim_lenght_".$i}; ?>" /> cm&nbsp;
                        <b><?php echo $entry_dim_width; ?></b>
                        <input type="text" name="envoismoinscher_dim_width_<?php echo $i; ?>" value="<?php echo ${"envoismoinscher_dim_width_".$i}; ?>" /> cm&nbsp;
                        <b><?php echo $entry_dim_height; ?></b>
                        <input type="text" name="envoismoinscher_dim_height_<?php echo $i; ?>" value="<?php echo ${"envoismoinscher_dim_height_".$i}; ?>" /> cm&nbsp;
                    </td>
                </tr>
                <?php } ?>
            </table>
        </div>	
      </form>
      <div id="tab_order" class="vtabs-content">
        <div id="orderEMC"></div>
        <table>
          <tbody>
            <tr>
              <td colspan="8" style="font-weight: bold;"><?php echo $entry_statuspending; ?> :</td>
            </tr>           
            <tr>
              <th><?php echo $entry_idCmd; ?></th>
              <th><?php echo $entry_dateCmd; ?></th>
              <th><?php echo $entry_nomCliCmd; ?></th>
              <th><?php echo $entry_societeCmd; ?></th>
              <th><?php echo $entry_transCmd; ?></th>
              <th><?php echo $entry_statusCmd; ?></th>
              <th><?php echo $entry_lienCmd; ?></th>
              <th></th>
            </tr>           
            <?php if ($orderEMC) {?>
            <?php foreach ($orderEMC as $orderEMC2) {?>
              <tr>
                <td><?php echo $orderEMC2['order_id'] ?></td>
                <td><?php echo $orderEMC2['date_added'] ?></td>
                <td><?php echo $orderEMC2['shipping_firstname'].' ';echo $orderEMC2['shipping_lastname'] ?></td>
                <td><?php echo $orderEMC2['shipping_company'] ?></td>
                <td><?php echo $orderEMC2['shipping_method'] ?></td>
                <td id="emcstatus_<?php echo $orderEMC2['order_id'] ?>"><?php echo $orderEMC2['name']?></td>
                <td><a href="<?php echo $orderEMC2['url'] ?>"><?php echo $entry_viewCmd;?></a></td>
                <?php if ($orderEMC2['order_status_id'] == 1) { ?>
                <td id="emcbutton_<?php echo $orderEMC2['order_id'] ?>"><a id="<?php echo $orderEMC2['order_id'] ?>" class="button"><?php echo $entry_butt_send; ?></a></td>
                <?php } else { ?>
                <td id="emcbutton_<?php echo $orderEMC2['order_id'] ?>">&nbsp;</td>
                <?php } ?>
              </tr>
            <?php ;} ?>
            <?php ;} ?>
          </tbody>
        </table>
      </div>
      <div id="tab_order_sent" class="vtabs-content">
        <div id="orderEMCsent"></div>
        <table>
          <tbody>
            <tr>
              <td colspan="8" style="font-weight: bold;"><?php echo $entry_statusshipped; ?> :</td>
            </tr>           
            <tr>
              <th><?php echo $entry_idCmd; ?></th>
              <th><?php echo $entry_dateCmd; ?></th>
              <th><?php echo $entry_nomCliCmd; ?></th>
              <th><?php echo $entry_societeCmd; ?></th>
              <th><?php echo $entry_transCmd; ?></th>
              <th><?php echo $entry_statusCmd; ?></th>
              <th><?php echo $entry_lienCmd; ?></th>
              <th></th>
            </tr>           
            <?php if ($orderEMCsent) {?>
            <?php foreach ($orderEMCsent as $orderEMC2sent) {?>
              <tr>
                <td><?php echo $orderEMC2sent['order_id'] ?></td>
                <td><?php echo $orderEMC2sent['date_added'] ?></td>
                <td><?php echo $orderEMC2sent['shipping_firstname'].' ';echo $orderEMC2sent['shipping_lastname'] ?></td>
                <td><?php echo $orderEMC2sent['shipping_company'] ?></td>
                <td><?php echo $orderEMC2sent['shipping_method'] ?></td>
                <td id="emcstatus_<?php echo $orderEMC2sent['order_id'] ?>"><?php echo $orderEMC2sent['name']?></td>
                <td><a href="<?php echo $orderEMC2sent['url'] ?>"><?php echo $entry_viewCmd;?></a></td>
                <?php if ($orderEMC2sent['order_status_id'] == 1) { ?>
                <td id="emcbutton_<?php echo $orderEMC2sent['order_id'] ?>"><a id="<?php echo $orderEMC2sent['order_id'] ?>" class="button"><?php echo $entry_butt_send; ?></a></td>
                <?php } else { ?>
                <td id="emcbutton_<?php echo $orderEMC2sent['order_id'] ?>">&nbsp;</td>
                <?php } ?>
              </tr>
            <?php ;} ?>
            <?php ;} ?>
          </tbody>
        </table>
      </div>
    </div>
  </div>
  <?php if ($error_emc) { ?>
  <div class="warning"><?php echo $error_emc; ?></div>
  <?php } ?>
</div>

<script type="text/javascript"><!--
$('.type_frais').change( function () {	
	var code = $(this).attr('id');
	var code_tab = code.replace('select_', 'tab_');
	
	if ( $('.'+code_tab).is(":visible") ) { 
		$('.'+code_tab).hide('slow');
	} else {
		$('.'+code_tab).show('slow');
	}
});

$('.button').live('click', function() {

    //alert('#'+this.id+'#');
    id = this.id
  
    $.ajax({
    url: 'index.php?route=shipping/envoismoinscher/getOrder&token=<?php echo $token; ?>&order_id='+id,
    type: 'post',
    dataType: 'json',
    data: '',
    beforeSend: function() {
      $('.success, .warning').remove();
      $(id).attr('disabled', true);
      $('#orderEMC').prepend('<div class="attention"><img src="view/image/loading.gif" alt="" /> <?php echo $entry_wait_mess; ?></div>');
    },
    complete: function() {
      $(id).attr('disabled', false);
      $('.attention').remove();
    },
    success: function(json) {
        if (json['success']) {
            alert(json['success']);
            $('#emcstatus_'+id).empty();
            $('#emcstatus_'+id).prepend('Shipped');
            $('#emcbutton_'+id).empty();
            //$('#emcbutton_'+id).prepend('ok');
        }else{
            alert(json['error']);
        }
    }
  });
});
//--></script> 
<script type="text/javascript"><!--
$('.vtabs a').tabs();
//--></script> 
<?php  echo $footer; ?> 