{*
* 2007-2024 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author    PrestaShop SA <contact@prestashop.com>
*  @copyright 2007-2024 PrestaShop SA
*  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}
{extends file='page.tpl'}

{block name='page_content'}

	<h2>{l s='Awaiting feedback' d='Modules.Agilemultisellerpro.Raitings'}</h2>
	{if $agileFeedbacks}
		<h3>{l s='Please leave feedback for the following transactions:' d='Modules.Agilemultisellerpro.Raitings'}</h3>
		<div class="table-responsive clearfix">
			<table class="table">
				<thead>
					<tr>
						<th>{l s='Order No' d='Modules.Agilemultisellerpro.Raitings'}</th>
						<th>{l s='Purchase Date' d='Modules.Agilemultisellerpro.Raitings'}</th>
						<th>{l s='Seller Name' d='Modules.Agilemultisellerpro.Raitings'}</th>
						<th>{l s='Action' d='Modules.Agilemultisellerpro.Raitings'}</th>
					</tr>
				</thead>
				<tbody>
					{foreach from=$agileFeedbacks item=feedback}
						<tr id="feedback_order_{$feedback.id_order|intval}">
							<td> {$feedback.id_order|intval}</td>
							<td> {Tools::displayDate($feedback.date_add, true)|escape:'htmlall':'UTF-8'}</td>
							<td> {$feedback.company|escape:'htmlall':'UTF-8'}</td>
							<td><input type="button" name="feedback" value="{l s='Leave Feedback' d='Modules.Agilemultisellerpro.Raitings'}"
									onclick="javascript:showRatingForm({$feedback.id_order|intval}, {$feedback.id_sellerinfo|intval})" class="btn btn-primary" />
							</td>
						</tr>
					{/foreach}
				</tbody>
			</table>

			<div>
				<form action="" method="post" onsubmit="return validateRatingForm()" class="std" id="sendRatingForm"
					style="display:none;">
					<input type="hidden" name="rating_id_order" id="rating_id_order" value="0" />
					<input type="hidden" name="rating_id_sellerinfo" id="rating_id_sellerinfo" value="0" />

					<hr>

					<fieldset>
						<div>
							<div class="col-xs-12 col-sm-8 col-md-6 col-lg-5 col-xl-4">
								<p class="bold">{l s='Please leave your feedback' d='Modules.Agilemultisellerpro.Raitings'}</p>
								<table class="std">
									{section loop=$criterions name=i start=0 step=1}
										<input type="hidden" name="{$criterions[i].id_sellerinfo_rating_criterion|intval}_rating_grade"
											id="{$criterions[i].id_sellerinfo_rating_criterion|intval}_rating_grade" value="0" />
										<tr>
											<td>{$criterions[i].name|escape:'htmlall':'UTF-8'}:</td>
											{section loop=6 step=1 start=1 name=img_review}
												<td width="18px">
													<div style="width:16px;height:16px; border:solid 0px red; overflow:hidden;">
														<img src="{$base_dir_ssl|escape:'html':'UTF-8'}modules/agilemultisellerpro/views/img/ratings/star.png"
															name="stars_{$criterions[i].id_sellerinfo_rating_criterion|intval}"
															style="margin:0px 0px 0px 0px;cursor:pointer"
															id="stars_{$criterions[i].id_sellerinfo_rating_criterion|intval}_{$smarty.section.img_review.index|escape:'html':'UTF-8'}"
															title="{$criterions[i].id_sellerinfo_rating_criterion|intval}_rating_grade"
															alt="{$smarty.section.img_review.index|escape:'html':'UTF-8'}" />
													</div>
												</td>
											{/section}
										</tr>
									{/section}
								</table>
							</div>
						</div>

						<div>
							<div class="col-xs-11 col-sm-11 col-md-6 col-lg-5 col-xl-4">
								<p class="bold">{l s='Your comment' d='Modules.Agilemultisellerpro.Raitings'}</p>
								<p>
									<textarea class="form-control" rows="6" name="content" id="content"></textarea>
								</p>
								<p class="submit text-xs-center">
									<button type="submit" name="submitFeedback" class="button btn btn-primary">
										<span>
											{l s='Send' d='Modules.Agilemultisellerpro.Raitings'}
										</span>
									</button>
								</p>
							</div>
						</div>
					</fieldset>
				</form>
			</div>


		</div>
	{else}
		<p class="align_center">
			{l s='There are currently no transactions for which to leave feedback.' d='Modules.Agilemultisellerpro.Raitings'}</p>
	{/if}

{/block}

{block name='javascript_bottom'}
	{$smarty.block.parent}

{/block}
