<?php echo $header; ?>
<div id="content">
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <?php if ($error_warning) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  <?php if ($success) { ?>
  <div class="success"><?php echo $success; ?></div>
  <?php } ?>
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/blog.png" alt="" /> <?php echo $heading_title; ?></h1>
      <div class="buttons"><a onclick="location = '<?php echo $insert; ?>'" class="button"><span><?php echo $button_insert; ?></span></a><a onclick="$('form').submit();" class="button"><span><?php echo $button_delete; ?></span></a></div>
    </div>
    <div class="content">
      <form action="<?php echo $delete; ?>" method="post" enctype="multipart/form-data" id="form">
      <table class="list">
        <thead>
          <tr>
            <td width="1" style="text-align: center;"><input type="checkbox" onclick="$('input[name*=\'selected\']').attr('checked', this.checked);" /></td>
            <td class="left"><?php if ($sort == 'id.title') { ?>
              <a href="<?php echo $sort_title; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_title; ?></a>
              <?php } else { ?>
              <a href="<?php echo $sort_title; ?>"><?php echo $column_title; ?></a>
              <?php } ?></td>
            <td class="left"><?php if ($sort == 'i.date_added') { ?>
              <a href="<?php echo $sort_date_added; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_date_added; ?></a>
              <?php } else { ?>
              <a href="<?php echo $sort_date_added; ?>"><?php echo $column_date_added; ?></a>
              <?php } ?></td>
				<td class="right"><span style="color: Red;"><?php echo $column_uc; ?></span></td>    
            <td class="right"><span style="color: Green;"><?php echo $column_ac; ?></span></td>
            <td class="right"><span style="color: Black;"><?php echo $column_tc; ?></span></td>
				<td class="right"><?php if ($sort == 'i.sort_order') { ?>
              <a href="<?php echo $sort_sort_order; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_sort_order; ?></a>
              <?php } else { ?>
              <a href="<?php echo $sort_sort_order; ?>"><?php echo $column_sort_order; ?></a>
              <?php } ?></td>
            <td class="right"><?php echo $column_action; ?></td>
          </tr>
        </thead>
        <tbody>
          <?php if ($blogs) { ?>
          <?php foreach ($blogs as $blog) { ?>
          <tr>
            <td style="text-align: center;"><?php if ($blog['selected']) { ?>
              <input type="checkbox" name="selected[]" value="<?php echo $blog['blog_id']; ?>" checked="checked" />
              <?php } else { ?>
              <input type="checkbox" name="selected[]" value="<?php echo $blog['blog_id']; ?>" />
              <?php } ?></td>
            <td class="left"><?php echo $blog['title']; ?></td>
            <td class="left"><?php echo $blog['date_added']; ?></td>
            <td class="right"><span style="color: Red; font-weight: bold;"><?php echo $blog['unapproved_comment']; ?></span></td>
            <td class="right"><span style="color: Green; font-weight: bold;"><?php echo $blog['approved_comment']; ?></span></td>
            <td class="right"><span style="color: Black; font-weight: bold;"><?php echo $blog['comment_total']; ?></span></td>
            <td class="right"><?php echo $blog['sort_order']; ?></td>
            <td class="right"><?php foreach ($blog['action'] as $action) { ?>
              [ <a href="<?php echo $action['href']; ?>"><?php echo $action['text']; ?></a> ]
              <?php } ?></td>
          </tr>
          <?php } ?>
          <?php } else { ?>
          <tr>
            <td class="center" colspan="8"><?php echo $text_no_results; ?></td>
          </tr>
          <?php } ?>
        </tbody>
      </table>
		<?php if ($blogs) { ?>
      <span style="color: Red; font-weight: bold;"><?php echo $column_uc; ?>=<?php echo $column_unapproved_comments; ?></span> ; <span style="color: Green; font-weight: bold;"><?php echo $column_ac; ?>=<?php echo $column_approved_comments; ?></span> ; <span style="color: Black; font-weight: bold;"><?php echo $column_tc; ?>=<?php echo $column_comment_total; ?></span>
    	<?php } ?>
    </form>
    <div class="pagination"><?php echo $pagination; ?></div>
    </div>
  </div>
</div>
<?php echo $footer; ?>