<?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/lorry_link.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[tracker_carrier_name*=\'selected\']').attr('checked', this.checked);" /></td>
              <td class="center"><?php echo $column_tracker_image; ?></td>
              <td class="left"><?php if ($sort == 'tracker_carrier_name') { ?>
                <a href="<?php echo $sort_tracker_carrier_name; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_tracker_carrier_name; ?></a>
                <?php } else { ?>
                <a href="<?php echo $sort_tracker_carrier_name; ?>"><?php echo $column_tracker_carrier_name; ?></a>
                <?php } ?></td>
              <td class="left"><?php if ($sort == 'tracker_carrier_link') { ?>
                <a href="<?php echo $sort_tracker_carrier_link; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_tracker_carrier_link; ?></a>
                <?php } else { ?>
                <a href="<?php echo $sort_tracker_carrier_link; ?>"><?php echo $column_tracker_carrier_link; ?></a>
                <?php } ?></td>
              <td class="left"><?php echo $column_tracker_status; ?></td>
              <td class="right" width="60"><?php echo $column_action; ?></td>
            </tr>
          </thead>
          <tbody>
            <?php if ($trackers) { ?>
            <?php foreach ($trackers as $tracker) { ?>
            <tr>
              <td style="text-align: center;"><?php if ($tracker['selected']) { ?>
                <input type="checkbox" name="selected[]" value="<?php echo $tracker['tracker_id']; ?>" checked="checked" />
                <?php } else { ?>
                <input type="checkbox" name="selected[]" value="<?php echo $tracker['tracker_id']; ?>" />
                <?php } ?></td>
              <td class="center"><img src="<?php echo $tracker['tracker_image']; ?>" alt="<?php echo $tracker['tracker_carrier_name']; ?>" style="padding: 1px; border: 1px solid #DDDDDD;" /></td>
              <td class="left"><?php echo $tracker['tracker_carrier_name']; ?></td>
              <td class="left"><?php echo $tracker['tracker_carrier_link']; ?></td>
              <td class="left"><?php echo $tracker['tracker_status']; ?></td>
              <td class="right"><?php foreach ($tracker['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="5"><?php echo $text_no_results; ?></td>
            </tr>
            <?php } ?>
          </tbody>
        </table>
      </form>
      <div class="pagination"><?php echo $pagination; ?></div>
    </div>
  </div>
</div>
<?php echo $footer; ?>