<!-- BEGIN: MAIN -->
<script src="themes/itbirja/js/sL-plugin.min.js" type="text/javascript"></script>
<script src="themes/itbirja/js/chosen.jquery.min.js" type="text/javascript"></script>
<script src="themes/itbirja/js/libs/withinviewport.js" type="text/javascript"></script>
<script src="themes/itbirja/js/libs/jquery.withinviewport.min.js" type="text/javascript"></script>
<script src="themes/itbirja/js/pages/prd_new_edit.js" type="text/javascript"></script>
<script src="themes/itbirja/js/track/readTrackService.js" type="text/javascript"></script>
<script src="themes/itbirja/js/track/track.js" type="text/javascript"></script>
<script src="themes/itbirja/js/pages/add-files.js" type="text/javascript"></script>
<script src="themes/itbirja/js/jquery.imgareaselect.min.js" type="text/javascript"></script>
<script>
  var Track = {
      "maxFileCount": 10,
      "maxFileSize": 6291456,
      "multiDodjiRate": 0.5,
      "isDodjiUser": false,
      "orderId": {ORDER_ID},
      "opponentId": {ORDER_CUSTOMER_ID},
      "inCancelRequest": false,
      "canWriteMessage": false,
      "isDoneConvAllow": true,
      "isArbitrageEnabled": true,
      "canWriteReview": false,
      "editTypeReview": "all",
      "deadline": {ORDER_DEADLINE.date},
      "hasCountbox": {ORDER_DEADLINE.hasCountbox},
      "canWriteToSeller": true,
      "canSendPortfolio": false,
      "canDeletePortfolio": false,
      "canReOrder": true,
      "isCancelRequest": false,
      "needHideAddExtrasList": true,
      "maxDodjiCount": 10,
      "actorType": "admin",
      "time": {PHP.sys.now}
  };
</script>

<div class="centerwrap clearfix pt20 block-response">
  <h1 class="orders-title">Администрирование заказа №{ORDER_ID}</h1>
</div>

<div class="centerwrap clearfix pb20 mt20">
  <div class="contentArea pb0 bgWhite clearfix mb0">
    <div class="p15-20 white-bg-border track-head" style="border-bottom:none;padding-bottom:25px;">
      <div class="">
        <div class="mb15">
          <div class="m-text-center prd-image">
            <div class="prd-image__inner rounded" style="background-image:url(<!-- IF {ORDER_PRD_PHOTO_FIRST_CROP} -->{ORDER_PRD_PHOTO_FIRST_CROP}<!-- ELSE --><!-- IF {ORDER_SELLER_AVATAR_SRC} -->{ORDER_SELLER_AVATAR_SRC}<!-- ELSE -->themes/itbirja/files/avatar/big/noprofilepicture.gif<!-- ENDIF --><!-- ENDIF -->);"></div>
          </div>
          <h1 class="pl10" style="display: table-cell;vertical-align:middle;">
            <!-- IF {ORDER_PRD_ID} > 0 -->
              <a class="color-text break-word" href="{ORDER_PRD_URL}">{ORDER_TITLE}</a>
            <!-- ELSE -->
              <span class="color-text break-word">{ORDER_TITLE}</span>
            <!-- ENDIF -->
          </h1>
          <div class="m-visible mt15"></div>
        </div>
      </div>
      <div class="clear"></div>
      <div class="pull-left m-pull-reset bread-crump block-response w100p mr-150 mb25 mt5">
        <span class="select-none">
        <a href="{PHP|cot_url('plug', 'e=marketorders&m=purchases')}">Мои заказы</a>
        <img class="ml10 mr10" style="width:5px" src="themes/itbirja/images/arrow_right_gray.png" alt="">
        </span>
        Заказ №{ORDER_ID} &nbsp;
      </div>
      <div class="pull-right m-pull-reset color-gray mt5">{ORDER_PAID|cot_date('d.m.Y, в H:i', $this)}</div>
      <div class="clear"></div>
      <div id="order-data" class="info mt10">
        <table class="order-info" style="width:100%;border-spacing:0px;table-layout:fixed;">
          <thead style="background-color:#f0f0f0;color:#000">
            <tr>
              <td style='padding:10px 20px;width:40%;' class="font-OpenSansSemi">Услуги</td>
              <td class="ta-center nowrap" style='width:14%;padding:10px 10px;'>Кол-во</td>
              <td class="ta-center nowrap" style='width:14%;padding:10px 10px;'>Срок</td>
              <td class="ta-center" style='width:18%;padding:10px 10px;'>Стоимость</td>
            </tr>
          </thead>
          <tbody>
            <tr class="font-OpenSans prd">
              <td style='padding:10px 20px;width: 100%;' class="order-info_services">
                <span class="f15 track-description-spoiler font-OpenSans link-color cur break-word" onclick="showDodjiDescription($(this));">
                <!-- IF {ORDER_PRD_ID} > 0 -->{ORDER_PRD_SHORTTITLE}<!-- ELSE -->{ORDER_TITLE}<!-- ENDIF --><img src="themes/itbirja/images/arrow_right_blue.png" width="9" alt=""/>
                </span>
              </td>
              <td class="nowrap" style="text-align:right;padding:10px 20px">{ORDER_COUNT}</td>
              <td class="nowrap" style="text-align:right;padding:10px 20px">{ORDER_COSTPLAN.info.time|cot_declension($this, 'день,дня,дней')}</td>
              <td class="nowrap" style="text-align:right;padding:10px 20px;color:#009900;">
                <!-- IF {ORDER_COSTPLAN.info.price} > 0 -->
                {ORDER_COSTPLAN.info.price}&nbsp;<span class="rouble">Р</span>
                <!-- ENDIF -->
                <!-- IF {ORDER_COSTPLAN.info.price_dodji} > 0 -->
                  <!-- IF {ORDER_COSTPLAN.info.price} > 0 -->/<!-- ENDIF -->
                  {ORDER_COSTPLAN.info.price_dodji}&nbsp;<span class="rouble rouble-dodji">Р</span>
                <!-- ENDIF -->
              </td>
            </tr>
            <tr class="track-order_description" style="display: none;">
              <td colspan="4" style='padding:10px 20px;' class="p10">
                <div class="shortened-url-track">
                  <span class="bold db">Описание {PHP|cot_sitename('padeg', '_r')}</span>
                  {ORDER_TEXT}
                </div>
                <br>
                <!-- IF {ORDER_COSTPLAN.extras.info.title} != '' -->
                  <div>
                    <span class="bold">Объем услуги при заказе {PHP|cot_sitename('gender_3')} {PHP|cot_sitename('padeg', 'r')}: </span>
                    {ORDER_COSTPLAN.extras.info.title}
                  </div>
                <!-- ENDIF -->
                <div class="mt10" onclick="hideDodjiDescription($(this));">
                  <a class="dib mt5 m-hidden" style="cursor:pointer;">
                  Свернуть<img src="themes/itbirja/images/arrow_right_blue.png" class="rotate180" width="9" alt=""/>
                  </a>
                </div>
              </td>
            </tr>
            <!-- BEGIN: ORDER_CP_ROW -->
            <tr class="option font-OpenSans">
              <td style="padding:10px 20px;width: 100%;" class="font-OpenSans break-word">
                {CP_ROW.name}
                <!-- IF {CP_ROW.type} == 'text' AND {CP_ROW.select} != '' -->
                  ({CP_ROW.select})
                <!-- ENDIF -->
              </td>
              <!-- IF {PHP.costplan.package} == 'single' OR {CP_ROW.opt_type} == 'custom_addextra' -->
                <td class="nowrap" style="text-align:right;padding:10px 20px">{CP_ROW.count}</td>
                <td class="nowrap" style="text-align:right;padding:10px 20px">{CP_ROW.time_format}</td>
                <td class="nowrap" style="text-align:right;padding:10px 20px;color:#009900;">
                  <!-- IF {CP_ROW.cost} > 0 -->
                    {CP_ROW.cost}&nbsp;<span class="rouble">Р</span>
                  <!-- ENDIF -->
                  <!-- IF {CP_ROW.cost_dodji} > 0 -->
                    <!-- IF {CP_ROW.cost} > 0 -->/<!-- ENDIF -->
                    {CP_ROW.cost_dodji}&nbsp;<span class="rouble rouble-dodji">Р</span>
                  <!-- ENDIF -->
                </td>
              <!-- ELSE -->
                <td class="nowrap" style="text-align:right;padding:10px 20px"></td>
                <td class="nowrap" style="text-align:right;padding:10px 20px"></td>
                <td style="text-align:right;padding:10px 20px;color:#009900;"></td>
              <!-- ENDIF -->
            </tr>
            <!-- END: ORDER_CP_ROW -->
            <tr class="m-hidden">
              <td colspan="4" style="margin:0px;padding:0px;">
                <div style="margin:5px 15px;background-color:#EAEAEA;height:1px;"></div>
              </td>
            </tr>
            <tr class="m-text-center">
              <td></td>
              <td class="nowrap f14 font-OpenSansSemi p10 m-text-cente t-align-r" style="padding:10px 20px;">Итого:</td>
              <td class="nowrap f14 font-OpenSansSemi p10 m-text-center t-align-r" style="padding:10px 20px">{ORDER_COSTPLAN.itog.time|cot_declension($this, 'день,дня,дней')}</td>
              <td class="nowrap f14 font-OpenSansSemi p10 m-text-center t-align-c" style="padding:10px 0">
                <!-- IF {ORDER_COST} > 0 -->
                  <span class="f20" style="color:#009900;">
                    {ORDER_COST}&nbsp;<span class="rouble">Р</span>
                  </span>
                <!-- ENDIF -->
                <!-- IF {ORDER_COST_DODJI} > 0 -->
                  <!-- IF {ORDER_COST} > 0 --><br><!-- ENDIF -->
                  <span class="f20" style="color:#009900;">
                    {ORDER_COST_DODJI}&nbsp;<span class="rouble rouble-dodji">Р</span>
                  </span>
                <!-- ENDIF -->
              </td>
            </tr>
          </tbody>
        </table>
      </div>
      <div class="clear"></div>
    </div>
    <div class="waveborder bottom"></div>
    <div style="height:15px;background-color:#F6F6F6"></div>
    <div class="m-visible">
      <div class="sidebar-order-state p15-20 white-bg-border pt20">
        <div class="mb14">
          <i class="{ORDER_STATUSARR.icon} v-align-t mt5"></i>
          <h2 class="dib v-align-t ml10 w218 {ORDER_STATUSARR.color}">
            №{ORDER_ID}<br>
            <span class="track-order-state">
              {ORDER_STATUSARR.title}
              <!-- IF {ORDER_STATUSARR.hint} -->
                &nbsp;
                <span class="v-align-m tooltipster tooltip_circle tooltip_circle--light tooltip_circle--hover" data-tooltip-side="right" data-tooltip-text="{ORDER_STATUSARR.hint}">?</span>
              <!-- ENDIF -->
            </span>
          </h2>
        </div>
        <!-- IF {ORDER_DEADLINE.time} > 0 -->
        <i class="dib v-align-m icon-time ml5"></i>
        <span class="fs16 pl10 v-align-m color-light-green tooltipster" data-tooltip-side="right" data-tooltip-text="{ORDER_DEADLINE.hint}" data-orderdeadline="{ORDER_DEADLINE.time}">{ORDER_DEADLINE.ago}</span>
        <!-- ENDIF -->
      </div>
      <div class="bgLightGray p15-20">
        <div class="font-OpenSans">
          <div class="profile-info clearfix">
            <div class="profile-avatar-track">
              <a href="{ORDER_SELLER_DETAILSLINK}">
              <img class="rounded" src="<!-- IF {ORDER_SELLER_AVATAR_SRC} -->{ORDER_SELLER_AVATAR_SRC}<!-- ELSE -->themes/itbirja/files/avatar/big/noprofilepicture.gif<!-- ENDIF -->" width="80" height="80" alt="">
              </a>
            </div>
            <div class="pull-left">
              <div class="user-info m-border-none mt0" style="max-width: 150px;">
                <div>
                  <b>Продавец</b>
                </div>
                <a class="mt6 mb4" href="{ORDER_SELLER_DETAILSLINK}">{ORDER_SELLER_NICKNAME}</a>
                <a href="{ORDER_SELLER_DETAILSLINK}">{ORDER_SELLER_FNAME}</a>
                <div class="f13 mt8 fw300 color-gray online-status">
                  <!-- IF {ORDER_SELLER_ONLINE} == 1 -->
                  <i class="icon ico-online"></i>
                    Онлайн
                  <!-- ELSE -->
                    <i class="icon ico-offline"></i>
                    Оффлайн<!--<span class="f12">(7 часов)</span>-->
                  <!-- ENDIF -->
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="bgLightGray p15-20">
        <div class="font-OpenSans">
          <div class="profile-info clearfix">
            <div class="profile-avatar-track">
              <a href="{ORDER_CUSTOMER_DETAILSLINK}">
              <img class="rounded" src="<!-- IF {ORDER_CUSTOMER_AVATAR_SRC} -->{ORDER_CUSTOMER_AVATAR_SRC}<!-- ELSE -->themes/itbirja/files/avatar/big/noprofilepicture.gif<!-- ENDIF -->" width="80" height="80" alt="">
              </a>
            </div>
            <div class="pull-left">
              <div class="user-info m-border-none mt0" style="max-width: 150px;">
                <div>
                  <b>Покупатель</b>
                </div>
                <a class="mt6 mb4" href="{ORDER_CUSTOMER_DETAILSLINK}">{ORDER_CUSTOMER_NICKNAME}</a>
                <a href="{ORDER_CUSTOMER_DETAILSLINK}">{ORDER_CUSTOMER_FNAME}</a>
                <div class="f13 mt8 fw300 color-gray online-status">
                  <!-- IF {ORDER_CUSTOMER_ONLINE} == 1 -->
                  <i class="icon ico-online"></i>
                    Онлайн
                  <!-- ELSE -->
                    <i class="icon ico-offline"></i>
                    Оффлайн<!--<span class="f12">(7 часов)</span>-->
                  <!-- ENDIF -->
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div style="height:15px;background-color:#F6F6F6"></div>
    <div class="waveborder top"></div>
    <div id="step-block-order" class="step-block-order white-bg-border" style="border-top:none;">

      <!-- IF {MKTRACK_CNT} > 10 -->
      <div class="t-align-c pt20 pb20 show-track">
        Показаны 10 последних сообщений.&nbsp;<a role="button" class="show-track-action link">Показать все</a>
      </div>
      <div class="t-align-c pt20 pb20 show-track-hide hide">
        Показаны все сообщения.&nbsp;<a role="button" class="show-track-action-hide link">Свернуть</a>
      </div>
      <!-- ENDIF -->

      <div id="tracks-wrapper">
        <!-- BEGIN: MTK_ROW_DS -->
        <div id="track-id-0" class="step-block-order_item text_message<!-- IF {MKTRACK_CNT} > 10 --> hide<!-- ENDIF --><!-- IF {DS_ROW_JJ} > 1 --> hidable-message hide-by-conversation<!-- ENDIF --> <!-- IF {DS_ROW_USER_ID} == {PHP.dsfromid} -->out<!-- ELSE -->in<!-- ENDIF -->" data-track-id="0">
          <!-- IF {DS_ROW_JJ} == 1 -->
          <div style="text-align:center;font-weight:bold;">
            <a class="show-conversation link">
              Переписка, которая может относиться к заказу<img src="themes/itbirja/images/arrow_right_blue.png" width="9" alt="Развернуть" class="">
            </a>
          </div>
          <!-- ENDIF -->
          <div class="block-circle pull-left">
            <img alt="{DS_ROW_USER_NICKNAME}" src="<!-- IF {DS_ROW_USER_AVATAR_SRC} -->{DS_ROW_USER_AVATAR_SRC}<!-- ELSE -->themes/itbirja/files/avatar/medium/noprofilepicture.gif<!-- ENDIF -->" class="rounded" width="50" alt=""/>
          </div>
          <div class="font-OpenSans ml80">
            <div class="f14 color-gray mt3 floatright">{DS_ROW_DATE}</div>
            <div class="f16 pt10 font-OpenSans online-status">
              <span data-is-online="{DS_ROW_USER_ONLINE}" data-darktheme="true" data-user-id="{DS_ROW_USER_ID}">
                <i class="icon ico-<!-- IF {DS_ROW_USER_ONLINE} -->online<!-- ELSE -->offlineDark<!-- ENDIF -->"></i>
              </span>
              <span class="username f16">{DS_ROW_USER_NICKNAME}</span>
            </div>
          </div>
          <div class="clear"></div>

          <!-- IF {DS_ROW_MTYPE} == 1 -->
            <div class="t-align-c">
              <i class="ico-quest-info"></i>
              <h3 class="font-OpenSansSemi mb15 js-message-text">Запрос {PHP|cot_sitename('padeg_individ', 'r')}</h3>
              <!-- IF {DS_ROW_USER_ID} != {PHP.dsfromid} -->
                Покупатель {DS_ROW_USER_NICKNAME} прислал запрос на {PHP|cot_sitename('padeg_individ', 'v')}. Пожалуйста, ответьте покупателю как можно скорее<br>
              <!-- ENDIF -->
            </div>
          <!-- ENDIF -->
          <!-- IF {DS_ROW_MTYPE} == 2 -->
            <div class="t-align-c">
              <i class="ico-green-extras"></i>
              <h3 class="font-OpenSansSemi mb15 js-message-text">Предложение {PHP|cot_sitename('padeg_individ', 'r')}</h3>
            </div>
          <!-- ENDIF -->
          <!-- IF {DS_ROW_MTYPE} == 3 -->
            <div class="t-align-c">
              <i class="ico-green-extras"></i>
              <h3 class="font-OpenSansSemi mb15 js-message-text">Предложение {PHP|cot_sitename('padeg_individ', 'r')}</h3>
            </div>
          <!-- ENDIF -->

          <!-- IF {DS_ROW_PRETEXT} -->
          <div class="font-OpenSans ml80 m-ml0 m-mt10">
            <div class="f15 breakwords">
              {DS_ROW_PRETEXT}
            </div>
          </div>
          <!-- ENDIF -->

          <div class="clear"></div>

          <div class="font-OpenSans ml80 m-ml0 m-mt10">
            <div class="f15 breakwords">
              {DS_ROW_TEXT}
            </div>
            <div class="track-files" data-json-files="null">
              <!-- IF {DS_MAVATARS.MAVATARCOUNT} > 0 -->
                <!-- FOR {KEY}, {VALUE} IN {DS_MAVATARS.MAVATAR} -->
                  <div id="id{VALUE.ID}" class="mb5 file-item file-item-conversations">
                    <a href="{VALUE.FILE}" target="_blank" class="color-text">
                    <i class="ico-file-{VALUE.FILEEXTICON} dib v-align-m"></i>
                    <span class="v-align-m ml10 mw80p">{VALUE.FILEORIGNAME}.{VALUE.FILEEXT}</span>
                    </a>
                  </div>
                <!-- ENDFOR -->
              <!-- ENDIF -->
            </div>
            {DS_ROW_RESEND}
            <!-- IF {DS_ROW_MTYPE} == 1 -->
              Бюджет: <!-- IF {DS_ROW_MDATA.budget} --><b>{DS_ROW_MDATA.budget} <span class="rouble">Р</span></b><!-- ELSE -->не указан<!-- ENDIF --><br>
              Сроки: <!-- IF {DS_ROW_MDATA.prd_duration} --><b>{DS_ROW_MDATA.prd_duration}</b><!-- ELSE -->не указаны<!-- ENDIF --><br>
            <!-- ENDIF -->
          </div>
        </div>
        <!-- END: MTK_ROW_DS -->

        <!-- BEGIN: MKT_ROW_MAIN -->
        <!-- IF {MKT_CODE} == 'market_msg' -->
        <div<!-- IF {MKT_ID} > 0 --> id="track-id-{MKT_ID}"<!-- ENDIF --> class="step-block-order_item<!-- IF !{MKT_JJ_SHOW} --> hide<!-- ENDIF --> text_message edit-important<!-- IF {MKT_FRUSER} == {ORDER_SELLER_ID} --> out<!-- IF {MKT_MSG_EDITABLE} --> editable<!-- ENDIF --><!-- ELSE --> in<!-- ENDIF --><!-- IF !{MKT_STATUS} --> unread<!-- ENDIF -->" data-track-id="{MKT_ID}" data-isadmin="1">
          <!-- IF {MKT_FRUSER} == {ORDER_CUSTOMER_ID} -->
          <div class="block-circle pull-left">
            <img class="rounded" width="50" src="<!-- IF {ORDER_CUSTOMER_AVATAR_SRC} -->{ORDER_CUSTOMER_AVATAR_SRC}<!-- ELSE -->themes/itbirja/files/avatar/big/noprofilepicture.gif<!-- ENDIF -->" alt="">
          </div>
          <div class="font-OpenSans ml80">
            <div class="f14 color-gray mt3 floatright">{MKT_DATE}</div>
            <div class="f16 pt10 font-OpenSans online-status">
              <i class="icon ico-{ORDER_CUSTOMER_ONLINEICO}"></i>
              <span class="username f16">{ORDER_CUSTOMER_NICKNAME}</span>
            </div>
          </div>
          <!-- ELSE -->
          <div class="block-circle pull-left">
            <img class="rounded" width="50" src="<!-- IF {ORDER_SELLER_AVATAR_SRC} -->{ORDER_SELLER_AVATAR_SRC}<!-- ELSE -->themes/itbirja/files/avatar/big/noprofilepicture.gif<!-- ENDIF -->" alt="">
          </div>
          <div class="font-OpenSans ml80">
            <div class="f14 color-gray mt3 floatright">{MKT_DATE}</div>
            <div class="f16 pt10 font-OpenSans online-status">
              <i class="icon ico-{ORDER_SELLER_ONLINEICO}"></i>
              <span class="username f16">{ORDER_SELLER_NICKNAME}</span>
            </div>
          </div>
          <!-- ENDIF -->
          <div class="clear"></div>
          <div class="font-OpenSans ml80 m-ml0 m-mt10">
            <div class="f15 breakwords">{MKT_JSON.msg}</div>
            <!-- IF {MKT_MAVATARS.MAVATARCOUNT} > 0 -->
            <div class="track-files">
              <!-- FOR {KEY}, {VAL} IN {MKT_MAVATARS.MAVATAR} -->
               <div class="mb5 file-item">
                <a href="{VAL.FILE}" target="_blank" class="dib color-text" style="width: calc(100% - 35px);">
                 <i class="ico-file-{VAL.FILEEXTICON} dib v-align-m"></i>
                 <span class="v-align-m ml10 mw80p dib">{VAL.FILEORIGNAME}.{VAL.FILEEXT}</span>
                </a>
                <!-- IF {MKT_FRUSER} == {ORDER_SELLER_ID} AND {MKT_MSG_EDITABLE} -->
                  <a href="" class="remove-file-link" onclick="deleteTrackFile($(this), {VAL.ID}, {MKT_ID});return false;"></a>
                <!-- ENDIF -->
               </div>
              <!-- ENDFOR -->
            </div>
            <!-- ENDIF -->
          </div>
        </div>
        <!-- ELSE -->
        <div<!-- IF {MKT_ID} > 0 --> id="track-id-{MKT_ID}"<!-- ENDIF --> class="step-block-order_item<!-- IF !{MKT_JJ_SHOW} --> hide<!-- ENDIF --><!-- IF {MKT_FRUSER} == {ORDER_SELLER_ID} --> out<!-- ELSE --> in<!-- ENDIF --><!-- IF !{MKT_STATUS} --> unread<!-- ENDIF -->" data-track-id="{MKT_ID}">
          <div class="f14 color-gray mt3 t-align-r">{MKT_DATE}</div>
          <div class="t-align-c">

            <!-- IF {MKT_CODE} == 'order_paid' -->
              <i class="ico-more-info"></i>
              <h3 class="track-green pt10 font-OpenSansSemi mb10">Создан новый заказ</h3>
              <div class="f15 mt15">Вы создали заказ</div>
            <!-- ENDIF -->

            <!-- IF {MKT_CODE} == 'cancel' -->
              <!-- IF {MKT_CODE_ORIG_IN_SELLERCANCEL_CODES} AND !{MKT_JSON.cancel_accept} -->
                <i class="ico-quest-red-info"></i>
              <!-- ELSE -->
                <i class="ico-close"></i>
              <!-- ENDIF -->

              <h3 class="track-red pt10 font-OpenSansSemi mb10">{MKT_TEXT}</h3>
              <div class="f15 mt15"></div>
              <!-- IF {MKT_JSON.msg} -->
                <div class="f15 mt15">{MKT_JSON.msg}</div>
              <!-- ENDIF -->
              <!-- IF {MKT_CODE_ORIG_IN_SELLERCANCEL_CODES} -->
                <hr class="gray">
                <div class="db f12 color-gray v-align-m ml10 mt15">
                  <!-- IF !{MKT_JSON.cancel_accept} -->
                    Ожидаем подтверждение покупателя
                    <script>$(document).ready(function() { $('[data-trackstatehist="{MKT_ID}"] .track-history-desc').html('Предложение отмены заказа'); });</script>
                  <!-- ELSE -->
                    Покупатель вернул заказ в работу
                    <script>$(document).ready(function() { $('[data-trackstatehist="{MKT_ID}"] .track-history-desc').html('Покупатель вернул заказ в работу'); });</script>
                  <!-- ENDIF -->
                </div>
              <!-- ELSE -->
                <!-- IF {MKT_JSON.lowrating} > 0 -->
                  <div class="f15 mt15 track-red">Рейтинг ответственности продавца снижен <i>на {MKT_JSON.lowrating}</i></div>
                <!-- ELSE -->
                  <div class="f15 mt15">Отмена заказа не повлияла на рейтинг продавца</div>
                <!-- ENDIF -->
              <!-- ENDIF -->
            <!-- ENDIF -->

            <!-- IF {MKT_CODE} == 'seller_accept_order' -->
              <i class="ico-check"></i>
              <h3 class="track-green pt10 font-OpenSansSemi mb10">Продавец принял заказ</h3>
              <!-- IF {PHP.queuemsg} -->
              <hr class="gray">
              <div class="db f12 color-gray v-align-m ml10 mt15">
                {PHP.queuemsg}
              </div>
              <!-- ENDIF -->
            <!-- ENDIF -->

            <!-- IF {MKT_CODE} == 'seller_start_order' -->
              <i class="ico-green-truck"></i>
              <h3 class="track-green pt10 font-OpenSansSemi mb10">В работе</h3>
              <div class="f15 mt15">Продавец приступил к работе над заказом</div>
            <!-- ENDIF -->

            <!-- IF {MKT_CODE} == 'seller_to_arbitrage' OR {MKT_CODE} == 'payer_to_arbitrage' -->
              <i class="ico-quest-info"></i>
              <h3 class="track-orange pt10 font-OpenSansSemi">{MKT_TEXT}</h3>
              <!-- IF {MKT_JSON.msg} -->
              <div class="f15 mt15 t-align-l ml80 mb15 breakwords m-ml0">
                <i>{MKT_JSON.msg}</i>
              </div>
              <!-- ENDIF -->
              <!-- IF {MKT_MAVATARS.MAVATARCOUNT} > 0 -->
              <div class="f15 mt15 t-align-l ml80 mb15 breakwords m-ml0">
                <div class="track-files">
                  <!-- FOR {KEY}, {VAL} IN {MKT_MAVATARS.MAVATAR} -->
                   <div class="mb5 file-item">
                    <a href="{VAL.FILE}" target="_blank" class="dib color-text" style="width: calc(100% - 35px);">
                     <i class="ico-file-{VAL.FILEEXTICON} dib v-align-m"></i>
                     <span class="v-align-m ml10 mw80p dib">{VAL.FILEORIGNAME}.{VAL.FILEEXT}</span>
                    </a>
                    <!-- IF {MKT_MSG_EDITABLE} -->
                      <a href="" class="remove-file-link" onclick="deleteTrackFile($(this), {VAL.ID}, {MKT_ID});return false;"></a>
                    <!-- ENDIF -->
                   </div>
                  <!-- ENDFOR -->
                </div>
              </div>
              <!-- ENDIF -->
            <!-- ENDIF -->

            <!-- IF {MKT_CODE} == 'seller_check_order' -->
              <i class="ico-green-box"></i>
              <h3 class="track-green pt10 font-OpenSansSemi">Заказ сдан на проверку</h3>
              <!-- IF {MKT_JSON.msg} -->
              <div class="f15 mt15 t-align-l ml80 mb15 breakwords m-ml0">
                <i>{MKT_JSON.msg}</i>
              </div>
              <!-- ENDIF -->
              <!-- IF {MKT_MAVATARS.MAVATARCOUNT} > 0 -->
              <div class="f15 mt15 t-align-l ml80 mb15 breakwords m-ml0">
                <div class="track-files">
                  <!-- FOR {KEY}, {VAL} IN {MKT_MAVATARS.MAVATAR} -->
                   <div class="mb5 file-item">
                    <a href="{VAL.FILE}" target="_blank" class="dib color-text" style="width: calc(100% - 35px);">
                     <i class="ico-file-{VAL.FILEEXTICON} dib v-align-m"></i>
                     <span class="v-align-m ml10 mw80p dib">{VAL.FILEORIGNAME}.{VAL.FILEEXT}</span>
                    </a>
                    <!-- IF {MKT_MSG_EDITABLE} -->
                      <a href="" class="remove-file-link" onclick="deleteTrackFile($(this), {VAL.ID}, {MKT_ID});return false;"></a>
                    <!-- ENDIF -->
                   </div>
                  <!-- ENDFOR -->
                </div>
              </div>
              <!-- ENDIF -->
              <!-- IF {MKT_JSON.accept} == 0 -->
                <hr class="gray">
                <div class="f12 color-gray v-align-m ml10 t-align-l">Покупатель примет заказ или вернет его на доработку. Если в течение 3 дней покупатель не примет решение, заказ будет принят автоматически.</div>
              <!-- ENDIF -->
            <!-- ENDIF -->

            <!-- IF {MKT_CODE} == 'payer_reorder' -->
              <i class="ico-orange-box"></i>
              <h3 class="track-orange pt10 font-OpenSansSemi mb10">В работе</h3>
              <div class="f15 mt15">Покупатель не принял сданную работу, а вернул ее на доработку.</div>
            <!-- ENDIF -->

            <!-- IF {MKT_CODE} == 'payer_done_order' -->
              <i class="ico-check"></i>
              <h3 class="track-green pt10 font-OpenSansSemi mb10">Заказ выполнен</h3>
              <div class="f15 mt15">
                <div class='f15 mt15'>
                  Поздравляем! Этот заказ выполнен.
                </div>
                Покупатель проверил и принял работу
              </div>
            <!-- ENDIF -->

            <!-- IF {MKT_CODE} == 'auto_done_order' -->
              <i class="ico-check"></i>
              <h3 class="track-green pt10 font-OpenSansSemi mb10">Заказ выполнен</h3>
              <div class="f15 mt15">
                <div class='f15 mt15'>
                  Поздравляем! Этот заказ выполнен. (Завершен автоматически)
                </div>
              </div>
            <!-- ENDIF -->

            <!-- IF {MKT_CODE} == 'payer_addextras' -->
                <i class="ico-green-extras"></i>
                <h3 class="pt10 font-OpenSansSemi track-green">К заказу добавлены дополнительные опции</h3>
                <h3 class="pt10 font-OpenSansSemi fs15" style="font-weight: 400;">Покупатель оплатил следующие опции</h3>
              </div>
              <table style='width:100%;border-spacing:0px;border:1px solid #f0f0f0' class="mt10">
                <thead style="background-color:#f0f0f0;" class="font-OpenSansSemi">
                  <tr>
                    <td style="padding:10px 20px;width:54%;" class="font-OpenSansSemi">Опция</td>
                    <td class="ta-center nowrap" style="width:14%;padding:10px 10px;">Кол-во</td>
                    <td class="ta-center nowrap" style="width:14%;padding:10px 10px;">Срок</td>
                    <td class="ta-center" style="width:18%;padding:10px 10px;">Стоимость</td>
                  </tr>
                </thead>
                <tbody>
                  <!-- FOR {KEY}, {VAL} IN {MKT_JSON.selected} -->
                  <tr class="option font-OpenSans">
                    <td style="padding:10px 20px;">{VAL.name}</td>
                    <td class="ta-center">{VAL.count}</td>
                    <td class="ta-center">{VAL.time|cot_declension($this, 'день,дня,дней')}</td>
                    <td class="ta-center">
                      {VAL.payerPrice} &nbsp;<span class="rouble">Р</span>
                    </td>
                  </tr>
                  <!-- ENDFOR -->
                  <tr class="m-hidden">
                    <td colspan="4" style="margin:0px;padding:0px;">
                      <div style="margin:5px 15px;background-color:#EAEAEA;height:1px;"></div>
                    </td>
                  </tr>
                  <tr class="m-text-center">
                    <td></td>
                    <td class="nowrap f14 font-OpenSansSemi p10 m-text-cente t-align-r" style="padding:10px 20px;">Итого:</td>
                    <td class="nowrap f14 font-OpenSansSemi p10 m-text-center t-align-r" style="padding:10px 20px">{MKT_JSON.totaltime|cot_declension($this, 'день,дня,дней')}</td>
                    <td class="nowrap f14 font-OpenSansSemi p10 m-text-center t-align-c" style="padding:10px 0">
                      <span class="f20" style="color:#009900;">
                      {MKT_JSON.totalcost} &nbsp;<span class="rouble">Р</span>
                      </span>
                    </td>
                  </tr>
                </tbody>
              </table>
              <div><!--FIX-->
            <!-- ENDIF -->

            <!-- IF {MKT_CODE} == 'seller_addextras' -->
                <i class="ico-green-extras"></i>
                <!-- IF {MKT_JSON.payed} > 0 -->
                  <h3 class="pt10 font-OpenSansSemi track-green">
                   К заказу добавлены дополнительные опции
                  </h3>
                  <h3 class="pt10 font-OpenSansSemi fs15" style="font-weight: 400;">Покупатель оплатил, предложенные вами, опции</h3>
                <!-- ELSE -->
                  <!-- IF {MKT_JSON.payed} == -1 -->
                    <h3 class="pt10 font-OpenSansSemi track-green">
                     Продавец предложил добавить к заказу дополнительные опции
                    </h3>
                    <h3 class="pt10 font-OpenSansSemi fs15" style="font-weight: 400;">Покупатель отказался от вашего предложения</h3>
                  <!-- ELSE -->
                  <h3 class="pt10 font-OpenSansSemi track-green">
                    Продавец предложил добавить к заказу дополнительные опции
                  </h3>
                  <!-- ENDIF -->
                <!-- ENDIF -->
                <h3 class="pt10 font-OpenSansSemi fs15" style="font-weight: 400;"><i>{MKT_JSON.msg}</i></h3>
              </div>
              <table style='width:100%;border-spacing:0px;border:1px solid #f0f0f0' class="mt10">
                <thead style="background-color:#f0f0f0;" class="font-OpenSansSemi">
                  <tr>
                    <td style="padding:10px 20px;width:54%;" class="font-OpenSansSemi">Опция</td>
                    <td class="ta-center nowrap" style="width:14%;padding:10px 10px;">Кол-во</td>
                    <td class="ta-center nowrap" style="width:14%;padding:10px 10px;">Срок</td>
                    <td class="ta-center" style="width:18%;padding:10px 10px;">Стоимость</td>
                  </tr>
                </thead>
                <tbody>
                  <!-- FOR {KEY}, {VAL} IN {MKT_JSON.selected} -->
                  <tr class="option font-OpenSans">
                    <td style="padding:10px 20px;">{VAL.name}</td>
                    <td class="ta-center">{VAL.count}</td>
                    <td class="ta-center">{VAL.time|cot_declension($this, 'день,дня,дней')}</td>
                    <td class="ta-center">
                      {VAL.payerPrice} &nbsp;<span class="rouble">Р</span>
                    </td>
                  </tr>
                  <!-- ENDFOR -->
                  <!-- FOR {KEY}, {VAL} IN {MKT_JSON.selected_custom} -->
                  <tr class="option font-OpenSans">
                    <td style="padding:10px 20px;">{VAL.name}</td>
                    <td class="ta-center">{VAL.count}</td>
                    <td class="ta-center">{VAL.time|cot_declension($this, 'день,дня,дней')}</td>
                    <td class="ta-center">
                      {VAL.payerPrice} &nbsp;<span class="rouble">Р</span>
                    </td>
                  </tr>
                  <!-- ENDFOR -->
                  <tr class="m-hidden">
                    <td colspan="4" style="margin:0px;padding:0px;">
                      <div style="margin:5px 15px;background-color:#EAEAEA;height:1px;"></div>
                    </td>
                  </tr>
                  <tr class="m-text-center">
                    <td></td>
                    <td class="nowrap f14 font-OpenSansSemi p10 m-text-cente t-align-r" style="padding:10px 20px;">Итого:</td>
                    <td class="nowrap f14 font-OpenSansSemi p10 m-text-center t-align-r" style="padding:10px 20px">{MKT_JSON.totaltime|cot_declension($this, 'день,дня,дней')}</td>
                    <td class="nowrap f14 font-OpenSansSemi p10 m-text-center t-align-c" style="padding:10px 0">
                      <span class="f20" style="color:#009900;">
                      {MKT_JSON.totalcost} &nbsp;<span class="rouble">Р</span>
                      </span>
                    </td>
                  </tr>
                </tbody>
              </table>
              <div><!--FIX-->
            <!-- ENDIF -->

            <!-- IF {MKT_CODE} == 'market_fmsg' -->
              <i class="ico-more-info"></i>
              <h3 class="track-green pt10 font-OpenSansSemi mb10">Получена информация от покупателя</h3>
              <div class="f15 mt15">
                <!-- IF {MKT_TEXT} -->
                <hr class="gray">
                <div class="db f12 color-gray v-align-m ml10 mt15">
                  {MKT_TEXT}
                </div>
                <!-- ENDIF -->
              </div>
            <!-- ENDIF -->

<!-- IF {MKT_CODE} == 'add_phases' -->
              <i class="ico-quest-info"></i>
              <h3 class="track-green pt10 font-OpenSansSemi mb10">Заказ разделен на этапы</h3>
              <div class="mt15">
                <link rel="stylesheet" href="themes/itbirja/css/pages/phases.css" type="text/css"/>
                <table class="phases phases_show js-phases-wrap-show">
                  <col width="40"/>
                  <col width="auto"/>
                  <col width="262"/>
                  <thead>
                    <tr>
                      <th></th>
                      <th>Название этапа</th>
                      <th>Прогресс</th>
                    </tr>
                  </thead>
                  <tbody>
                    <!-- FOR {KEY}, {VAL} IN {ORDER_STEPS} -->
                    <tr class="js-phases-item" data-index="0" data-progress="100">
                      <td>{KEY|cot_mk_step_plus_one($this)}.</td>
                      <td class="phase_name">
                        <span class="js-phases-name">{VAL.title}</span>
                      </td>
                      <td class="phases__loadbar">
                        Прогресс <span class="current-percent-value">{VAL.lprc}</span>%
                        <span class="phases__progress toolpster" data-tooltip-text="Продавец будет отправлять вам промежуточные отчеты в процессе выполнения заказа.">
                          <ul class="loadbar">
                           <!-- FOR {CKEY}, {CVAL} IN {VAL.changes} -->
                            <li>
                              <div data-track-id="{MKT_ID}" data-report-id="{CVAL.r}" title="{CVAL.m}" data-value="{CKEY}" data-progressindex="{KEY}" class="progress-bar<!-- IF {CVAL.v} OR {CKEY} == 0 --> progress-bar-fill min-active-value<!-- ENDIF -->"></div>
                            </li>
                           <!-- ENDFOR -->
                          </ul>
                        </span>
                      </td>
                    </tr>
                    <!-- ENDFOR -->
                  </tbody>
                </table>
              </div>
            <!-- ENDIF -->

            <!-- IF {MKT_CODE} == 'report_phases' -->
                <i class="ico-quest-info"></i>
                <h3 class="track-green mb15 pt10 font-OpenSansSemi">Промежуточный отчет продавца</h3>
                <!-- FOR {CKEY}, {CVAL} IN {MKT_JSON.changes} -->
                <div class="mb15 breakwords m-ml0">
                  <div class="mt10">
                    {CVAL.title}
                    <b>
                      <span class="current-percent-value">{CVAL.val}</span>
                      %&nbsp;
                    </b>
                  </div>
                  <ul class="loadbar">
                    <!-- FOR {JKEY}, {JJ} IN {CVAL.changes_main} -->
                      <li>
                        <div data-track-id="{MKT_CODE}" data-value="{JKEY}" title="{JKEY}%" class="progress-bar min-active-value<!-- IF {JKEY} <= {CVAL.val} --> progress-bar-fill<!-- ENDIF -->"></div>
                      </li>
                    <!-- ENDFOR -->
                  </ul>
                </div>
                <!-- ENDFOR -->
              <!-- IF {MKT_JSON.msg} -->
              </div>
                <div class="f15 mt15 t-align-c">{MKT_JSON.msg}</div>
              <div><!--FIX-->
              <!-- ENDIF -->
            <!-- ENDIF -->

            <!-- IF {MKT_CODE} == 'arbitrage_result' -->
              <!-- IF {MKT_JSON.status} == 'start' -->
                <i class="ico-orange-box"></i>
                <h3 class="track-orange pt10 font-OpenSansSemi mb10">В работе</h3>
              <!-- ENDIF -->
              <!-- IF {MKT_JSON.status} == 'cancel' OR {MKT_JSON.status} == 'close' -->
                <i class="ico-close"></i>
                <h3 class="track-red pt10 font-OpenSansSemi mb10">Заказ отменен</h3>
              <!-- ENDIF -->
              <!-- IF {MKT_JSON.status} == 'done' -->
                <i class="ico-check"></i>
                <h3 class="track-green pt10 font-OpenSansSemi mb10">Заказ выполнен</h3>
              <!-- ENDIF -->

              <div class="f15 mt15">
                {MKT_TEXT}<!-- IF {MKT_JSON.msg} -->: <span class="f15 italic">{MKT_JSON.msg}</span><!--  ENDIF -->
              </div>

              <!-- IF {MKT_JSON.payreturn.to_payer} > 0 OR {MKT_JSON.payreturn.to_seller} > 0 OR {MKT_JSON.chg_lowrating} OR {MKT_JSON.del_reviews} -->
                <div class="alert alert-warning t-align-l mt10">
                  <b>Внимание!</b>
                  <!-- IF {MKT_JSON.payreturn.to_payer} > 0 -->
                    <br>Сумма в размере {MKT_JSON.payreturn.to_payer} <span class="rouble">Р</span> была возвращена покупателю.
                  <!-- ENDIF -->
                  <!-- IF {MKT_JSON.payreturn.to_seller} > 0 -->
                    <br>Сумма в размере {MKT_JSON.payreturn.to_seller} <span class="rouble">Р</span> была возвращена продавцу.
                  <!-- ENDIF -->
                  <!-- IF {MKT_JSON.chg_lowrating} -->
                    <br>Рейтинг продавца изменен на <i>{MKT_JSON.val_lowrating}</i>.
                  <!-- ENDIF -->
                  <!-- IF {MKT_JSON.del_reviews} -->
                    <br>Отзыв продавца был удален.
                  <!-- ENDIF -->
                </div>
              <!-- ENDIF -->
            <!-- ENDIF -->

          </div>
        </div>
        <!-- ENDIF -->
        <!-- END: MKT_ROW_MAIN -->

        <!-- IF {ORDER_REVIEW.item_id} -->
        <div class="step-block-order_item<!-- IF !{ORDER_REVIEW.item_status} --> unread<!-- ENDIF -->" data-track-id="0">
          <div class="f14 color-gray mt3 t-align-r">{ORDER_REVIEW.item_date|cot_date('d M, в H:i', $this)}</div>
          <div class="t-align-c">
            <i class="ico-reating-<!-- IF {ORDER_REVIEW.item_score} -->good<!-- ELSE -->bad<!-- ENDIF -->"></i>
            <h3 class="pt10 font-OpenSansSemi track-<!-- IF {ORDER_REVIEW.item_score} -->green<!-- ELSE -->red<!-- ENDIF -->">Отзыв по заказу</h3>
            <div class="f15 mt15">
              {ORDER_CUSTOMER_NICKNAME} оставил <!-- IF {ORDER_REVIEW.item_score} -->положительный<!-- ELSE -->отрицательный<!-- ENDIF --> отзыв по этому заказу
              <br>
              <i>{ORDER_REVIEW.item_text|cot_mk_msg_html($this)}</i>
            </div>
          </div>
        </div>
          <!-- IF {ORDER_REVIEW_ANSWER.item_id} -->
          <div class="step-block-order_item" data-track-id="0">
            <div class="f14 color-gray mt3 t-align-r">{ORDER_REVIEW_ANSWER.item_date|cot_date('d M, в H:i', $this)}</div>
            <div class="t-align-c">
              <i class="ico-reating-<!-- IF {ORDER_REVIEW_ANSWER.item_score} -->good<!-- ELSE -->bad<!-- ENDIF -->"></i>
              <h3 class="pt10 font-OpenSansSemi track-<!-- IF {ORDER_REVIEW_ANSWER.item_score} -->green<!-- ELSE -->red<!-- ENDIF -->">Ответ на отзыв</h3>
              <div class="f15 mt15">
                Продавец оставил ответ на отзыв по этому заказу<br>
                <i>{ORDER_REVIEW_ANSWER.item_text|cot_mk_msg_html($this)}</i>
              </div>
              <i class="js-prd-comment-remove__link icon ico-trash-18 mb-5 mr5"></i>
              <a class="js-prd-comment-remove__link prd-comment-remove__link" href="javascript:void(0);">Удалить отзыв</a>
              <i class="js-prd-comment-edit__link icon ico-edit mb-5 mr5 ml15"></i>
              <a class="f14 dib mt10 prd-comment-edit__link" href="javascript:void(0);">Редактировать отзыв</a>
              <div class="bgLightGray p15-20 mt10" style='display: none'>
                <form action="/send_mk" method="post">
                  <input type="hidden" name="is_admin_get" value="1" />
                   <div class="rating-block-review mt15">
                    <div class="rating-block-review_good<!-- IF {ORDER_REVIEW.item_score} --> active<!-- ENDIF -->"></div>
                    <div class="rating-block-review_bad<!-- IF !{ORDER_REVIEW.item_score} --> active<!-- ENDIF -->"></div>
                   </div>
                   <input type="hidden" name="action" value="rating_update">
                   <input type="hidden" name="orderId" value="{ORDER_ID}">
                   <input type="radio" class="hide" name="vote" id="rating-block-review_good-js" value="1"<!-- IF {ORDER_REVIEW.item_score} --> checked<!-- ENDIF -->>
                   <input type="radio" class="hide" name="vote" id="rating-block-review_bad-js" value="0"<!-- IF !{ORDER_REVIEW.item_score} --> checked<!-- ENDIF -->>
                   <textarea id="message_body" maxlength="300" name="comment" class="control-en styled-input db wMax mh115 mt20 js-stopwords-check" requiredplaceholder="Текст отзыва">{ORDER_REVIEW.item_text}</textarea>
                   <div class="clear"></div>
                  <input type="submit" class="hugeGreenBtn hoverMe GreenBtnStyle h50 w210 mt20 pull-reset btn-disable-toggle" value="Сохранить">
                </form>
              </div>
              <div class="js-popup-delete-rating__container hidden">
                <form action="/send_mk" method="post">
                  <input type="hidden" name="is_admin_get" value="1" />
                  <h2>Удаление отзыва</h2>
                  <input type="hidden" name="action" value="payer_remove_rating">
                  <input type="hidden" name="orderId" value="{ORDER_ID}">
                  <hr class="gray">
                  <p>Вы хотите удалить отзыв?
                  <!-- IF {ORDER_REVIEW_ANSWER.item_id} > 0 -->
                    <p class="mb10">Ответ на отзыв также будет удалён.
                  <!-- ENDIF -->
                  <div class="popup__buttons">
                    <button type="button" class="popup__button white-btn popup-close-js">Отменить</button>
                    <button type="submit" class="popup__button green-btn pull-right">Удалить</button>
                    <div class="clearfix"></div>
                  </div>
                </form>
              </div>

              <a class="f14 dib mt10 prd-rating-comment-edit__link" href="javascript:void(0);">Редактировать ответ</a>
              <div class="bgLightGray mt15" style='display: none'>
                <form action="/send_mk" method="post" class="rating_comment">
                  <input type="hidden" name="is_admin_get" value="1" />
                  <div class="rating-block-review p15-20-0-20">
                    <div class="rating-block-review_good<!-- IF {ORDER_REVIEW_ANSWER.item_score} --> active<!-- ENDIF -->"></div>
                    <div class="rating-block-review_bad<!-- IF !{ORDER_REVIEW_ANSWER.item_score} --> active<!-- ENDIF -->"></div>
                  </div>
                  <input type="hidden" name="orderId" value="{ORDER_ID}">
                  <input type="hidden" name="action" value="rating_comment_update">
                  <input type="radio" class="hide" name="vote" id="rating-block-review_good-js" value="1"<!-- IF {ORDER_REVIEW.item_score} --> checked<!-- ENDIF -->>
                  <input type="radio" class="hide" name="vote" id="rating-block-review_bad-js" value="0"<!-- IF !{ORDER_REVIEW.item_score} --> checked<!-- ENDIF -->>
                  <textarea id="message_body" maxlength="300" name="comment" class="control-en styled-input db wMax mh115 mt20 js-stopwords-check" requiredplaceholder="Текст отзыва">{ORDER_REVIEW_ANSWER.item_text}</textarea>
                  <div class="clear"></div>
                  <input type="submit" class="hugeGreenBtn hoverMe GreenBtnStyle h50 w210 mt20 pull-reset btn-disable-toggle" value="Редактировать">
                </form>
              </div>
            </div>
          </div>
          <!-- ENDIF -->
        <!-- ENDIF -->

      </div>
    </div>
    <script>
      var trackFormHash = '{PHP.sys.xk}';
    </script>
    <div id="track-form">
      <script>
        var cancelReasons = {
          <!-- FOR {KEY}, {VAL} IN {ORDER_DATA_CANSELRESONS} -->
            "{KEY}": {
                "name": "{VAL.name}",
                "track_status": "{VAL.track_status}",
                "tooltip": "{VAL.tooltip}"
            },
          <!-- ENDFOR -->
        };
        var options = [{
            "id": "{CP_ROW.id}",
            "priceWithComission": 400,
            "priceWithComissionStr": "400 ggg \u0440\u0443\u0431",
            "duration": 10
        }];
        var optionPrices = [
          <!-- IF {PHP.costplans_prices|is_array($this)} -->
            <!-- FOR {KEY}, {VAL} IN {PHP.costplans_prices} -->
            {
              "id": {KEY},
              "priceWithComission": {VAL},
              "priceWithComissionStr": "{VAL} \u0420"
            },
            <!-- ENDFOR -->
          <!-- ENDIF -->
        ];
      </script>
      <div class="p15-20 white-bg-border js-comment-box">
      <!--admin-->
        <!-- BEGIN: ORDPAYS_BLOCK -->
          <table class="table-style response-table m-order-table">
            <thead>
              <tr>
                <td colspan="4">
                  <div class="ml20 t-align-c"><span>История платежей по заказу</span></div>
                </td>
              </tr>
              <tr>
                <td class="w19p">
                  <div class="ml20"><span>Дата</span></div>
                </td>
                <td class="w19p"><span>Пользователь</span></td>
                <td class="w52p"><span>Описание</span></td>
                <td class="w12p"><span>Сумма</span></td>
              </tr>
            </thead>
            <tbody>
              <!-- BEGIN: HIST_ROW -->
              <tr>
                <td class="pl20 m-text-right">{HIST_ROW_PDATE|cot_date('d.m.Y, в H:i', $this)}</td>
                <td class="m-w50p m-pull-left m-white-space-noraml m-order-table_username" style="white-space: nowrap;">
                  <a href="{HIST_ROW_OWNER_DETAILSLINK}" target="_blank">
                    <i class="icon ico-<!-- IF {HIST_ROW_OWNER_ONLINE} == 1 -->online<!-- ELSE -->offlineDark<!-- ENDIF -->"></i>
                    <span>{HIST_ROW_OWNER_NICKNAME}</span>
                  </a>
                </td>
                <td class="clearfix">
                  {HIST_ROW_DESC}
                </td>
                <td class="m-visible clearfix p0"></td>
                <td class="m-w50p m-pull-right  m-text-right">
                  <!-- IF {HIST_ROW_AREA} != 'balance' -->-<!-- ENDIF -->{HIST_ROW_SUMM}&nbsp;<span class="rouble">Р</span>
                </td>
              </tr>
              <!-- END: HIST_ROW -->
            </tbody>
          </table>
        <!-- END: ORDPAYS_BLOCK -->

        <!-- IF {ORDER_DATA_ADMIN_ALERTREZRVSUMM} OR {ORDER_LOWRATING} != 0 -->
          <div class="alert alert-warning">
            <b>Внимание!</b>
            <!-- IF {ORDER_DATA_ADMIN_ALERTREZRVSUMM} -->
              <br>Сумма заказа зарезервирована со счета покупателя!
            <!-- ENDIF -->
            <!-- IF {ORDER_LOWRATING} != 0 -->
              <br>Рейтинг продавца <!-- IF {ORDER_LOWRATING} > 0 -->повышен<!-- ELSE -->снижен<!-- ENDIF --> на <i>{ORDER_LOWRATING|abs($this)}</i>
            <!-- ENDIF -->
          </div>
        <!-- ENDIF -->

        <!-- IF {ORDER_STATUS} == 'claim' -->
        <form id="arbitrage_result_form" action="send_mk" method="post">
          <input type="hidden" name="is_admin_get" value="1">
          <input type="hidden" name="redirect" value="1">
          <input type="hidden" name="orderId" value="{ORDER_ID}">
          <input type="hidden" name="action" value="admin_arbitrage_result">

          <hr class="gray mt20 mb20">

          <div style="display:block;margin-top:10px">
            <h4 class="mb10">Действие с заказом</h4>
            <input type="radio" name="radm_rad_status" value="start" /> Вернуть в работу <br>
              <div class="order_arb_extra_params rad_status_extra_params rad_status_param_start" style="margin-bottom:10px">
                <label>
                  <input type="radio" name="radm_rad_return_start" value="none" checked="checked" /> Не выполнять действий с возвратом средств <br>
                  <input type="radio" name="radm_rad_return_start" value="to_payer" /> Вернуть часть стоимости покупателю <br>
                </label>
                <div class="clear"></div>

                <div id="rad_return_start_ext" class="order_arb_extra_params">
                  Возврат покупателю <input type="text" name="radm_val_return_start_to_payer" value="" /> <br>
                  <small>* стоимость заказа будет изменена на сумму возврата.</small>
                </div>
              </div>

            <input type="radio" name="radm_rad_status" value="cancel" /> Отменить заказ <br>
              <div class="order_arb_extra_params rad_status_extra_params rad_status_param_cancel" style="margin-bottom:10px">
                <label>
                  <input type="radio" name="radm_rad_return_cancel" value="to_payer" checked="checked" /> Вернуть стоимость заказа покупателю (решение в пользу покупателя) <br>
                  <input type="radio" name="radm_rad_return_cancel" value="to_seller" /> Оплатить стоимость заказа продавцу (решение в пользу продавца)<br>
                  <input type="radio" name="radm_rad_return_cancel" value="to_split" /> Разделить стоимость заказа между пользователями <br>
                </label>
                <div class="clear"></div>

                <div id="rad_return_cancel_ext" class="order_arb_extra_params">
                  Возврат покупателю <input type="text" name="radm_val_return_cancel_to_payer" value="{ORDER_COST}" /> <br>
                  Возврат продавцу <input type="text" name="radm_val_return_cancel_to_seller" value="0" /> <br>
                </div>
              </div>

            <input type="radio" name="radm_rad_status" value="done" /> Завершить заказ (подтвердить выполнение) <br>
              <div class="order_arb_extra_params rad_status_extra_params rad_status_param_done" style="margin-bottom:10px">
                <label>
                  <input type="radio" name="radm_rad_return_done" value="to_payer" /> Вернуть стоимость заказа покупателю (решение в пользу покупателя) <br>
                  <input type="radio" name="radm_rad_return_done" value="to_seller" checked="checked" /> Оплатить стоимость заказа продавцу (решение в пользу продавца)<br>
                  <input type="radio" name="radm_rad_return_done" value="to_split" /> Разделить стоимость заказа между пользователями <br>
                </label>
                <div class="clear"></div>

                <div id="rad_return_done_ext" class="order_arb_extra_params">
                  Возврат покупателю <input type="text" name="radm_val_return_done_to_payer" value="{ORDER_COST}" /> <br>
                  Возврат продавцу <input type="text" name="radm_val_return_done_to_seller" value="0" /> <br>
                </div>
              </div>

          </div>
          <div class="clear"></div>

          <div class="clear" style="margin-top:10px">
            <label>
               <input type="checkbox" name="radm_chg_lowrating" value="1" />
               Изменить рейтинг продавца
            </label>
            <div class="clear"></div>

            <div id="chg_lowrating_ext" class="order_arb_extra_params">
              Рейтинг продавца <input type="text" name="radm_val_lowrating" value="{ORDER_LOWRATING}" /> <br>
              <small>* для понижения рейтинга укажите отрицательное значение (к примеру "-2")</small>
            </div>
          </div>

          <!-- IF !{ORDER_CANREVIEW} -->
          <div class="clear" style="margin-top:10px">
            <label>
               <input type="checkbox" name="radm_del_reviews" value="1" />
               Удалить отзыв покупателя
            </label>
            <div class="clear"></div>
          </div>
          <!-- ENDIF -->

          <div style="margin-top: 10px">
            <p>Ваше сообщение</p>
            <textarea name="radm_message" style="width: 100%;max-width: 100%;"></textarea>
          </div>

          <div class="mt20">
            <button id="send_arbitrage_btn" type="submit" class="orange-btn disabled" disabled="disabled">Отправить решение арбитража</button>
            <div class="clearfix"></div>
          </div>
        </form>

        <script>
          var maxord_return = <!-- IF {ORDER_COST} > 0 -->{ORDER_COST}<!-- ELSE -->0+0<!-- ENDIF -->;
          $(document).ready(function() {
            $('[name="radm_chg_lowrating"]').change(function() {
              if($(this).prop('checked')) {
                $('#chg_lowrating_ext').show();
              } else {
                $('#chg_lowrating_ext').hide();
              }
            });

            $('[name="radm_rad_status"]').change(function() {
              var thisval = $(this).val();
              $('.rad_status_extra_params').hide();
              $('.rad_status_param_' + thisval).show();
              $('#send_arbitrage_btn').removeClass('disabled').attr('disabled', false);
            });

            $('[name="radm_rad_return_start"]').change(function() {
              var thisval = $(this).val();
              if(thisval == 'to_payer') {
                $('#rad_return_start_ext').show();
              } else {
                $('#rad_return_start_ext').hide();
              }
            });

            $('[name="radm_val_return_start_to_payer"]').change(function() {
              var thisval = $(this).val() - 0;
              if(thisval >= maxord_return) $(this).val('0.00');
            });

            $(['cancel', 'done']).each(function(key, type) {
              $('[name="radm_rad_return_' + type + '"]').change(function() {
                var thisval = $(this).val();
                if(thisval == 'to_split') {
                  $('#rad_return_' + type + '_ext').show();
                } else {
                  $('#rad_return_' + type + '_ext').hide();
                }
              });

              $('[name="radm_val_return_' + type + '_to_payer"]').change(function() {
                var thisval = $(this).val() - 0;
                var chckval = $('[name="radm_val_return_' + type + '_to_seller"]').val() - 0;
                if(thisval >= maxord_return) {
                  $(this).val(maxord_return);
                  $('[name="radm_val_return_' + type + '_to_seller"]').val('0');
                } else {
                  $('[name="radm_val_return_' + type + '_to_seller"]').val(maxord_return - thisval);
                }
              });

              $('[name="radm_val_return_' + type + '_to_seller"]').change(function() {
                var thisval = $(this).val() - 0;
                var chckval = $('[name="radm_val_return_' + type + '_to_payer"]').val() - 0;
                if(thisval >= maxord_return) {
                  $(this).val(maxord_return);
                  $('[name="radm_val_return_' + type + '_to_payer"]').val('0');
                } else {
                  $('[name="radm_val_return_' + type + '_to_payer"]').val(maxord_return - thisval);
                }
              });
            });
          });
        </script>
        <!-- ENDIF -->
      <!--admin-->
      </div>
    </div>
  </div>

  <div class="sidebarArea">
    <div class="m-hidden">
      <div class="sidebar-order-state p15-20 white-bg-border pt20">
        <div class="mb14">
          <i class="{ORDER_STATUSARR.icon} v-align-t mt5"></i>
          <h2 class="dib v-align-t ml10 w218 {ORDER_STATUSARR.color}">
            №{ORDER_ID}<br>
            <span class="track-order-state">
              {ORDER_STATUSARR.title}
              <!-- IF {ORDER_STATUSARR.hint} -->
                &nbsp;
                <span class="v-align-m tooltipster tooltip_circle tooltip_circle--light tooltip_circle--hover" data-tooltip-side="right" data-tooltip-text="{ORDER_STATUSARR.hint}">?</span>
              <!-- ENDIF -->
            </span>
          </h2>
        </div>
        <div class="clearfix"></div>
      </div>
      <div class="bgLightGray p15-20">
        <div class="font-OpenSans">
          <div class="profile-info clearfix">
            <div class="profile-avatar-track">
              <a href="{ORDER_SELLER_DETAILSLINK}">
              <img class="rounded" src="<!-- IF {ORDER_SELLER_AVATAR_SRC} -->{ORDER_SELLER_AVATAR_SRC}<!-- ELSE -->themes/itbirja/files/avatar/big/noprofilepicture.gif<!-- ENDIF -->" width="80" height="80" alt="">
              </a>
            </div>
            <div class="pull-left">
              <div class="user-info m-border-none mt0" style="max-width: 150px;">
                <div>
                  <b>Продавец</b>
                </div>
                <a class="mt6 mb4" href="{ORDER_SELLER_DETAILSLINK}">{ORDER_SELLER_NICKNAME}</a>
                <a href="{ORDER_SELLER_DETAILSLINK}">{ORDER_SELLER_FNAME}</a>
                <div class="f13 mt8 fw300 color-gray online-status">
                  <!-- IF {ORDER_SELLER_ONLINE} == 1 -->
                  <i class="icon ico-online"></i>
                    Онлайн
                  <!-- ELSE -->
                    <i class="icon ico-offline"></i>
                    Оффлайн<!--<span class="f12">(7 часов)</span>-->
                  <!-- ENDIF -->
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="bgLightGray p15-20">
        <div class="font-OpenSans">
          <div class="profile-info clearfix">
            <div class="profile-avatar-track">
              <a href="{ORDER_CUSTOMER_DETAILSLINK}">
              <img class="rounded" src="<!-- IF {ORDER_CUSTOMER_AVATAR_SRC} -->{ORDER_CUSTOMER_AVATAR_SRC}<!-- ELSE -->themes/itbirja/files/avatar/big/noprofilepicture.gif<!-- ENDIF -->" width="80" height="80" alt="">
              </a>
            </div>
            <div class="pull-left">
              <div class="user-info m-border-none mt0" style="max-width: 150px;">
                <div>
                  <b>Покупатель</b>
                </div>
                <a class="mt6 mb4" href="{ORDER_CUSTOMER_DETAILSLINK}">{ORDER_CUSTOMER_NICKNAME}</a>
                <a href="{ORDER_CUSTOMER_DETAILSLINK}">{ORDER_CUSTOMER_FNAME}</a>
                <div class="f13 mt8 fw300 color-gray online-status">
                  <!-- IF {ORDER_CUSTOMER_ONLINE} == 1 -->
                  <i class="icon ico-online"></i>
                    Онлайн
                  <!-- ELSE -->
                    <i class="icon ico-offline"></i>
                    Оффлайн<!--<span class="f12">(7 часов)</span>-->
                  <!-- ENDIF -->
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div class="question-block-track-page">
      <div class="p15-20 white-bg-border mt20">
        <i class="icon ico-history dib v-align-m"></i>
        <span class="dib v-align-m ml10">История заказа</span>
        <i class="ico-arrow-down dib v-align-m"></i>
      </div>
      <div class="track-order-state-history bgLightGray p15-20 question-block-track-page_hidden" style="display: block !important;">
        <!-- BEGIN: MKT_ROW_RIGHT -->
        <hr class="gray" data-trackstatehist="{MKT_ID}">
        <div class="clearfix" data-trackstatehist="{MKT_ID}">
          <div class="pull-left track-history-date">{MKT_DATE}</div>
          <div class="pull-right track-history-desc">{MKT_TITLE}</div>
        </div>
        <!-- END: MKT_ROW_RIGHT -->
      </div>
    </div>
    <!-- IF {ORDER_ALL_FILES.MAVATARCOUNT} > 0 -->
    <div class="question-block-track-page">
      <div id="order-files">
        <div class="p15-20 white-bg-border mt20">
          <i class="icon ico-files dib v-align-m"></i>
          <span class="dib v-align-m ml10">Файлы заказа</span>
          <i class="ico-arrow-down dib v-align-m"></i>
        </div>
        <div class="order-files bgLightGray p15-20 f14 question-block-track-page_hidden" style="display:none;">
         <!-- FOR {KEY}, {VAL} IN {MKT_MAVATARS.MAVATAR} -->
          <a href="{VAL.FILE}" target="_blank" class="color-text">
            <i class="ico-file-{VAL.FILEEXTICON} dib v-align-m"></i>
            <span class="dib v-align-m ml10 mw78p">{VAL.FILEORIGNAME}.{VAL.FILEEXT}</span>
          </a>
          <a href="{VAL.FILE}" download>
            <img src="themes/itbirja/images/download.png">
          </a>
         <!-- ENDFOR -->
        </div>
      </div>
    </div>
    <!-- ENDIF -->

    {ADS_BLOCK_POS_7}

  </div>
</div>
<script>
  var comission = 20;
  var formData = new FormData;
  var haveFiles = false;
  $(window).load(function() {
      $('#cancel-order').on('click', function() {
          if ($('.cancel-order-js input:checked').val() == 'worker_inprogress_cancel_request' || $('.cancel-order-js input:checked').val() == 'payer_inprogress_cancel_request') {

          } else if ($('.cancel-order-js input:checked').val() == 'payer_inprogress_cancel' || $('.cancel-order-js input:checked').val() == 'worker_inprogress_cancel') {

          }
      });
      $('.instruction-js .js-toggle-message-button[data-action=instruction]').click();
  });

  function show_popup_confurm() {
      var html = '<div>\
        <form action="send_mk" method="post">\
        <h1 class="popup__title">Подтверждение заказа</h1>\
        <input type="hidden" name="redirect" value="1">\
        <input type="hidden" name="orderId" value="{ORDER_ID}">\
        <input type="hidden" name="action" value="seller_accept_order">\
        <hr class="gray mt20 mb20">\
        <div class="popup-msg">\
        <div class="icon ico-i-small"></div>\
        <div class="popup-text">Внимание! Принимая заказ вы должы приступить к нему в течении 24 часов. Если у вас в очереди есть другие заказы, у Вас будет время завершить их.</div>\
        </div>\
        <p>Вы уверены, что хотите принять заказ?</p>\
        <p>После принятия заказ будет поставлен в очередь на выполнение.</p>\
        \
        <div class="popup__buttons mt20">\
        <button type="button" class="popup__button green-btn popup-close-js">Вернуться к заказу</button>\
        <button type="submit" class="popup__button inactive white-btn pull-right">Принять заказ</button>\
        <div class="clearfix"></div>\
        </div>\
        </form>\
        </div>';
      show_popup(html, "popup-confirm-order", true);
  }

  function show_popup_startorder() {
      var html = '<div>\
        <form action="send_mk" method="post">\
        <h1 class="popup__title">Начать выполнение заказа</h1>\
        <input type="hidden" name="redirect" value="1">\
        <input type="hidden" name="orderId" value="{ORDER_ID}">\
        <input type="hidden" name="action" value="seller_start_order">\
        <hr class="gray mt20 mb20">\
        <p>Вы уверены, что хотите начать выполнение заказа?</p>\
        <p>Начиная заказ вы должы выполнить его в течении указанного срока.</p>\
        \
        <div class="popup__buttons mt20">\
        <button type="button" class="popup__button green-btn popup-close-js">Вернуться к заказу</button>\
        <button type="submit" class="popup__button inactive white-btn pull-right">Начать выполнение</button>\
        <div class="clearfix"></div>\
        </div>\
        </form>\
        </div>';
      show_popup(html, "popup-confirm-order", true);
  }
</script>

<!-- END: MAIN -->