<?php $__env->startSection('content'); ?>
<div class="row-fluid">
    <div class="span9">
        <a href="<?php echo URL::previous(); ?>" class="btn btn-default">
            <span class="glyphicon glyphicon-arrow-left"></span>
            返回
        </a>
        <hr>
	<?php if(!Session::has('userName')): ?>
        <?php echo Form::open(array( 'class'=>'form-horizontal well')); ?>

        <div class="input-group">
            <span class="input-group-addon">留言文章</span>
            <?php echo Form::select('article', $articles, 0, array('class' => 'form-control') ); ?>

        </div>
        <?php echo Form::close(); ?>

	<?php endif; ?>
	<?php if($article_content == 'N'): ?>
	   <CENTER> <h5>請選擇留言文章</h5></CENTER>
	<?php else: ?>
        <table class="table table-bordered">
	<?php foreach($article_content as $content): ?>
            <tr>
		<td class = "col-sm-2">文章標題</td>
		<td class = "col-sm-10"><?php echo e($content->title); ?></td>

            </tr>
            <tr>
		<td class = "col-sm-2">文章內容</td>
		<td class = "col-sm-10">
		<?php echo html_entity_decode($content->description); ?>
		<?php /*<?php echo e($content->description); ?>*/ ?>
		</td>
            </tr>

  	  <tr>	
		<td colspan="2">&nbsp;<hr width="75%">&nbsp;</td>
    	  </tr>
    	  <tr bgcolor="#C1C1C1">
        	<td colspan="2" height="25" align="Center"><p><b>&nbsp;留言</b></p></td>
    	  </tr>
      	  <?php if($comments != null): ?>
		<?php foreach($comments as $comment): ?>
	    	  <tr bgcolor="#E1E1E1">
			<td colspan="3">
			<div class ="row" align="center">
				<div class="col-md-4" align="right">
					<a class='btn btn-primary'><?php echo e($comment -> commender); ?></a>
				</div>
				<div class="col-md-4 col-md-offset-4" align="left">
					<a class='btn btn-danger' href="<?php echo URL::to('admin/article/delete-comment/'.$comment->id); ?>">刪除</a>
				</div>
			</div>
			<div class="row" align="center" >
				<div class="col-md-6 col-md-offset-3 well" align="left">
				<?php echo e($comment -> comment_content); ?>

				</div>
			</div>
			</td>
        		<!--td class="col-sm-2" align="right"><b><i><?php echo e($comment -> commender); ?></i></b></td>
        		<td class="col-sm-8">
			<div class='row'>
			    <div class="col-sm-10">
				<?php echo e($comment -> comment_content); ?>

			    </div>
			   <div class="col-sm-2">
	        		<a class='btn btn-danger' href="<?php echo URL::to('admin/article/delete-comment/'.$comment->id); ?>">刪除</a>
			   </div>
			</td-->
	    	  </tr>
		<tr><td colspan="3"><hr><td></tr>
		<?php endforeach; ?>
	  <?php else: ?>
    		  <tr bgcolor="#E1E1E1">
        		<td colspan="2" height="25"><p><b>&nbsp;No comment!!</b></p></td>
	    	  </tr>
	  <?php endif; ?>
	

<?php /*	<?php echo Form::open(array('action'=>'ArticleController@postNewcomment', 'class'=>'form-horizontal well', 'style'=>'display:inline')); ?>

	  <tr height = "25">
		<td class="col-sm-2" height="25" align="center">
		<H3>	<?php echo Session::get('userName');; ?></H3>
			<?php echo Form::hidden('article_id',$content->id); ?>

			<?php echo Form::hidden('blogger_id',$content->blogger_id); ?>

		</td>
        	<td class="col-sm-10" height="25">
		<div class="form-group">
            		<?php echo Form::text('comment_content', null, array('placeholder'=> 'Write a comment...','class'=>'form-control'));; ?>

			<input type="submit" name="" value="送出" class="btn btn-success" />
		</div>
        	</td>			
	  </tr>
	<?php echo Form::close(); ?>*/ ?>
	<?php endforeach; ?>

	</table>
	<?php endif; ?>
    </div>
<script type="text/javascript" charset="utf-8">
    $(document).change(function(){
        var t = $("select[name=article]").val();
        var base_url = "<?php echo URL::to('admin/article/comment'); ?>";
        var target = base_url + '/' + t;
        window.location = target;
    });
</script>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('Myadmin::layout.basic', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>