Skip to content

Instantly share code, notes, and snippets.

@cezar62882
Last active September 7, 2015 06:05
Show Gist options
  • Save cezar62882/15470c517ede7ec5a9a2 to your computer and use it in GitHub Desktop.
Save cezar62882/15470c517ede7ec5a9a2 to your computer and use it in GitHub Desktop.
<div class="account-caption-wrap">
<div class="account-caption-box-stock">
<p class="account-caption">Ниже вы видите товары, которые мы выкупили и доставили на наш склад. Отметьте нужные товары и сформируйте из них посылку для отправки на ваш почтовый адрес. Обратите внимание, что на этой странице вы также можете заказать услугу проверки товара, если не сделали этого ранее.</p>
<span class="icon"></span>
</div>
</div>
<br />
<h3>Купленные товары, доставленные на наш склад</h3>
<form method="post" action="<?php echo site_url("client/orders/addtoorder/{$country}"); ?>">
<input type="hidden" name="<?php echo $this->security->get_csrf_token_name();?>" value="<?php echo $this->security->get_csrf_hash();?>" />
<div class="account-table">
<?php if (count($stock['ebay']) + count($stock['shops']) + count($stock['forwarding']) <= 0): ?>
<p class="message">У Вас нет ни одного товара</p>
<?php else: ?>
<table class="stock-table">
<colgroup>
<col width="10%"/>
<col/>
<col/>
<col/>
<col width="15%"/>
</colgroup>
<thead>
<tr>
<td><input type="checkbox" id="checkbox-all" /></td>
<td class="number">№<br />&nbsp;</td>
<td>Название товара</td>
<td>Дата поступления на склад</td>
<td class="last-cell green">Базовая цена</td>
</tr>
<tr>
<td class="header-border" colspan="5">&nbsp;</td>
</tr>
</thead>
<tbody>
<?php
foreach ($stock['shops'] as $k => $item)
{
$color = $item->color ? ', Цвет: ' . $item->color : '';
$size = $item->size ? ', Размер: ' . $item->size : '';
$picture = $item->picture ? '<br /><img src="' . $item->picture . '" width="60px" />' : '';
$action = $item->tariff_id == Tariffs_model::TARIFF_VIPGARANT ? '<img src="'. static_url("images/vip-garant.png") .'" alt="VIP Гарант" class="tooltip" data-text="Оплачено по тарифу «VIP Гарант»"/>' : '';
$servicesLinks = array(
$this->item_service_model->get_link_or_status('verification', $item->verification, $item->id, $this->user->profile->balance, 1),
$this->item_service_model->get_photo_service_link($item, 1)
);
$date_diff = human_plural_form(get_date_diff($item->delivered_time), array('день', 'дня', 'дней'));
$parse_url = parse_url($item->url);
echo '<tr>
<td><input type="checkbox" name="shops[' . $item->id . ']" id="checkbox_shop_' . $item->id . '" /></td>
<td class="number">' . $item->id . $picture . '</td>
<td class="description">
<a target="_blank" href="' . $this->data->getShopItemUrl(urldecode($item->url)) . '" style="width: 650px;">' . $item->name . '</a><br />'
. $parse_url['host'] . ' Количество: ' . $item->amount . $color . $size . '<br />'
. implode(', ', $servicesLinks) . '
</td>
<td>' . get_human_date_without_time($item->delivered_time) . ' (' . $date_diff . ')</td>
<td class="last-cell green">$' . $item->price . '<br />' . $action . '</td>
</tr>';
}
foreach ($stock['ebay'] as $k => $item)
{
$action = $item->tariff_id == Tariffs_model::TARIFF_VIPGARANT ? '<img src="'. static_url("images/vip-garant.png") .'" alt="VIP Гарант" class="tooltip" data-text="Оплачено по тарифу «VIP Гарант»"/>' : '';
$servicesLinks = array(
$this->item_service_model->get_link_or_status('verification', $item->verification, $item->id, $this->user->profile->balance, 0),
$this->item_service_model->get_photo_service_link($item, 0)
);
$date_diff = human_plural_form(get_date_diff($item->delivered_time), array('день', 'дня', 'дней'));
echo '<tr>
<td><input type="checkbox" name="items[' . $item->id . ']" id="checkbox_' . $item->id . '" /></td>
<td class="number">' . $item->id . '<br /><img src="http://thumbs2.ebaystatic.com/pict/' . $item->ebay_id . '_1.jpg" width="60px" /></td>
<td class="description">
<a class="short-name" target="_blank" href="' . site_url('items/' . $item->ebay_id) . '" style="width: 650px;">' . $item->name . '</a>
ID лота: ' . $item->ebay_id . ',
Кол-во: ' . $item->amount . ' шт.' . '<br />' . implode(', ', $servicesLinks) . ($item->comment ? '<br />
Комментарий: ' . str_replace('||', ' ', $item->comment) : '') . '
</td>
<td>' . get_human_date_without_time($item->delivered_time) . ' (' . $date_diff . ')</td>
<td class="last-cell green">$' . $item->price . '<br />' . $action . '</td>
</tr>';
}
if ($stock['forwarding'] && count($stock['forwarding']))
{
foreach ($stock['forwarding'] as $k => $item)
{
$action = $item->tariff_id == Tariffs_model::TARIFF_VIPGARANT ? '<img src="'. static_url("images/vip-garant.png") .'" alt="VIP Гарант" class="tooltip" data-text="Оплачено по тарифу «VIP Гарант»"/>' : '';
$servicesLinks = array(
$this->item_service_model->get_link_or_status('verification', $item->verification, $item->id, $this->user->profile->balance, 2),
$this->item_service_model->get_photo_service_link($item, 2)
);
$date_diff = human_plural_form(get_date_diff($item->time_delivered), array('день', 'дня', 'дней'));
echo '<tr>
<td><input type="checkbox" name="forwarding[' . $item->id . ']" id="checkbox_' . $item->id . '" /></td>
<td class="number">MF' . $item->id . '</td>
<td class="description">' . $item->description . '<br />' . implode(', ', $servicesLinks) . '</td>
<td>' . get_human_date_without_time($item->time_delivered) . ' (' . $date_diff . ')</td>
<td class="last-cell green">$' . $item->price . '<br />' . $action . '</td>
</tr>';
}
}
?>
</tbody>
</table>
<?php endif; ?>
<?php if (count($stock['ebay']) OR count($stock['shops']) OR count($stock['forwarding'])): ?>
<table class="table-footer">
<colgroup>
<col width="160px"/>
<col/>
<col/>
</colgroup>
<tbody>
<tr>
<td class="footer-border" colspan="4">&nbsp;</td>
</tr>
<tr>
<td class="manage-packages" colspan="4">
<span class="selected-block">С отмеченными:</span>
<?php if ( ! count($stock['packages'])): ?>
<input type="hidden" name="orderID" value="new" />
<?php else: ?>
<select name="orderID">
<option value="new">[Новая посылка]</option>
<?php foreach($stock['packages'] as $package): ?>
<option value="<?php echo $package->id; ?>">Посылка № <?php echo $this->user->userID . '-' . $package->id; ?></option>
<?php endforeach; ?>
</select>
<?php endif; ?>
<button type="submit" class="well-button"><span>Добавить в посылку</span></button>
<?php if (isset($joint_packages_available) && $joint_packages_available === TRUE && $country === 'usa'): ?>
<button type="submit" class="well-button joint-btn" name="addtojoint" value="Y"><span>Добавить в совместную посылку</span></button>
<a href="<?php echo order_link('join_packages', $country) ?>">Подробнее</a>
<?php endif; ?>
</td>
</tr>
<tr>
<td class="footer-end" colspan="4">&nbsp;</td>
</tr>
</tbody>
</table>
<?php endif; ?>
</div>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment