<div class="panel panel-default pjVpProductSection">
	<div class="panel-heading pjVpProductSectionHead">
		<h3 class="panel-title pjVpProductSectionTitle"><?php __('front_label_comments');?></h3><!-- /.panel-title -->
	</div><!-- /.panel-heading pjVpProductSectionHead -->
				
	<div class="panel-body pjVpProductSectionBody">
		<?php
		if(!empty($tpl['comment_arr']))
		{ 
			$sum_rating = 0;
			$cnt_rating = 0;
			?>		
			<ul class="list-group pjVpProductComments">
				<?php
				foreach($tpl['comment_arr'] as $v)
				{ 
					?>
					<li class="list-group-item pjVpProductComment">
						<div class="row">
							<div class="col-md-10 col-sm-9 col-xs-12">
								<p class="pjVpProductCommentTitle">
									<strong><?php echo stripslashes($v['title']);?></strong>
								</p>
						
								<p><?php echo nl2br(stripslashes($v['comment']));?></p>
							</div><!-- /.col-md-10 col-sm-9 col-xs-12 -->
						
							<div class="col-md-2 col-sm-3 col-xs-12 pjVpProductCommentMeta">
								<p><span><?php echo pjUtil::formatDate(date('Y-m-d', strtotime($v['created'])), 'Y-m-d', $tpl['option_arr']['o_date_format'])?> <?php echo pjUtil::formatTime(date('H:i:s', strtotime($v['created'])), 'H:i:s', $tpl['option_arr']['o_time_format'])?></span></p>
								<p><?php __('front_label_by');?> <?php echo $v['name'];?></p>
								
								<ul class="list-inline pjVpProductRating">
									<?php
									for($i = 1; $i <= 5; $i++)
									{
										?><li><i class="fa fa-star<?php echo (int) $v['rating'] < $i ? '-o' : NULL;?>"></i></li><?php
									} 
									?>
								</ul><!-- /.list-inline pjVpProductRating -->
							</div><!-- /.col-md-2 col-sm-3 col-xs-12 pjVpProductCommentMeta -->
						</div><!-- /.row -->
					</li><!-- /.list-group-item pjVpProductComment -->
					<?php
				} 
				?>
					
			</ul><!-- /.list-group pjVpProductComments -->
			<?php
		}else{
			?><p class="pjVpProductNoComments"><?php __('front_label_no_comment');?></p><?php
		} 
		?>
	</div><!-- /.panel-body pjVpProductSectionBody -->
				
	<div id="pjVpCommentSection" class="panel-footer pjVpProductSectionFoot">
		<div class="text-center">
			<button class="btn btn-default pjVpBtn pjVpBtnPrimary pjVpBtnFormTrigger"><?php echo mb_strtolower(__('front_btn_post_comment', true), 'UTF-8'); ?></button>
			
			<?php
			if(isset($tpl['comment_message']))
			{
				$front_err = __('front_error', true);
				if($tpl['comment_message'] == 'FRC02' || $tpl['comment_message'] == 'FRC03')
				{
					?><br/><br/><div class="alert alert-success"><?php echo $front_err[$tpl['comment_message']];?></div><?php
				}else{
					if($tpl['comment_message'] == 'FRC04')
					{
						?><br/><br/><div class="alert alert-danger"><?php echo $front_err[$tpl['comment_message']];?></div><?php
					}else{
						$register_status = __('register_status', true);
						?><br/><br/><div class="alert alert-danger"><?php echo $register_status[$tpl['comment_message']];?></div><?php
					}
				}
			} 
			?>
		</div><!-- /.text-center -->
				
		<div class="pjVpForm pjVpFormComment pjVpFormHidden">
			<div class="row">
				<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
					<form id="frmVPLComment_<?php echo $index?>" name="frmVPLComment" action="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjListings&amp;action=pjActionView&amp;id=<?php echo $_GET['id']; ?>" method="post" class="form-horizontal" data-toggle="validator" role="form">
						<input type="hidden" name="comment_form" value="1" />
						<input type="hidden" name="listing_id" value="<?php echo $_GET['id']; ?>" />
						<input type="hidden" name="folder" value="<?php echo PJ_INSTALL_FOLDER; ?>" />
						
						
						<div class="form-group">
							<label for="" class="col-lg-3 col-md-3 col-sm-3 col-xs-12 control-label"><?php __('front_label_name'); ?></label>
						
							<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">
								<input type="text" name="name" class="form-control required" data-msg-required="<?php __('front_field_required');?>"/>
								<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
							</div><!-- /.col-lg-9 col-md-9 col-sm-9 col-xs-12 -->
						</div><!-- /.form-group -->
						
						<div class="form-group">
							<label for="" class="col-lg-3 col-md-3 col-sm-3 col-xs-12 control-label"><?php __('front_label_email'); ?></label>
						
							<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">
								<input type="email" name="email" class="form-control required pjVpEmail" data-msg-required="<?php __('front_field_required');?>" data-msg-pjVpEmail="<?php __('front_email_invalid');?>"/>
								
								<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
							</div><!-- /.col-lg-9 col-md-9 col-sm-9 col-xs-12 -->
						</div><!-- /.form-group -->
							
						<div class="form-group">
							<label for="" class="col-lg-3 col-md-3 col-sm-3 col-xs-12 control-label"><?php __('front_label_rating');?>:</label>
							
							<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">
								<input type="hidden" id="pjVpRatingValue_<?php echo $index;?>" name="rating"/>
								<ul class="list-inline pjVpProductRating">
									<?php
									for($i = 1; $i <= 5; $i++)
									{
										?>
										<li>
											<button data-star="<?php echo $i;?>" class="btn btn-default pjVpBtn pjVpBtnSecondary pjVpBtnStar">
												<i id="pjVpStar_<?php echo $i;?>" class="fa fa-star"></i>
											</button>
										</li>
										<?php
									} 
									?>
								</ul><!-- /.list-inline pjVpProductRating -->
							</div><!-- /.col-lg-9 col-md-9 col-sm-9 col-xs-12 -->
						</div><!-- /.form-group -->
					
						<div class="form-group">
							<label for="" class="col-lg-3 col-md-3 col-sm-3 col-xs-12 control-label"><?php __('front_label_title'); ?></label>
						
							<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">
								<input type="text" name="title" class="form-control required" data-msg-required="<?php __('front_field_required');?>"/>
								<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
							</div><!-- /.col-lg-9 col-md-9 col-sm-9 col-xs-12 -->
						</div><!-- /.form-group -->
						
						<div class="form-group">
								<label for="" class="col-lg-3 col-md-3 col-sm-3 col-xs-12 control-label"><?php __('front_label_comment'); ?></label>
							
								<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">
									<textarea rows="4" name="comment" class="form-control required" data-msg-required="<?php __('front_field_required');?>"></textarea>
									<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
								</div><!-- /.col-lg-9 col-md-9 col-sm-9 col-xs-12 -->
							</div><!-- /.form-group -->
							
						<div class="form-group pjVpFormGroupCaptcha">
							<label for="" class="col-lg-3 col-md-3 col-sm-3 col-xs-12 control-label"><?php __('front_label_captcha'); ?></label>
						
							<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">
								<div class="row">
									<div class="col-lg-3 col-md-4 col-sm-4 col-xs-5 pjVrCaptchaFieldOutter">
										<input type="text" id="pjVpCaptchaCommentField" name="captcha" class="form-control required" maxlength="6" autocomplete="off" data-msg-required="<?php __('front_field_required');?>" data-msg-remote="<?php __('front_captcha_incorrect');?>"/>
									</div><!-- /.col-lg-3 col-md-4 col-sm-4 col-xs-5 -->
	
									<div class="col-lg-3 col-md-3 col-sm-4 col-xs-5">
										<img id="pjVpCaptchaCommentImage" class="property-captcha" src="<?php echo PJ_INSTALL_FOLDER;?>index.php?controller=pjFront&amp;action=pjActionCaptcha&amp;rand=<?php echo rand(1, 999999); ?>&amp;comment=1" alt="CAPTCHA" style="vertical-align: middle;cursor: pointer;" />
									</div><!-- /.col-lg-3 col-md-3 col-sm-4 col-xs-5 -->
								</div><!-- /.row -->
								<div class="help-block with-errors"><ul class="list-unstyled"></ul></div>
							</div><!-- /.col-lg-9 col-md-9 col-sm-9 col-xs-12 -->
						</div><!-- /.form-group pjVpFormGroupCaptcha -->
							
						<div class="form-group text-center pjVpFormActions">
							<button type="submit" class="btn btn-default pjVpBtn pjVpBtnPrimary"><?php echo mb_strtolower(__('front_btn_post_comment', true), 'UTF-8'); ?></button>
							<button type="button" class="btn btn-default pjVpBtn pjVpBtnSecondary pjVpBtnFormRemove"><?php echo mb_strtolower(__('front_label_cancel', true), 'UTF-8'); ?></button>
						</div><!-- /.form-group text-center pjVpFormActions -->
					</form><!-- /.form-horizontal -->
				</div><!-- /.col-lg-12 col-md-12 col-sm-12 col-xs-12 -->
				
			</div><!-- /.row -->
		</div><!-- /.pjVpForm pjVpFormComment pjVpFormHidden -->
	</div><!-- /.panel-footer pjVpProductSectionFoot -->
</div><!-- /.panel panel-default pjVpProductSection -->