<?php
    /**
     * @extension       Marlev Template
     * @author          Lev Milicenco<support@marlev.it>
     * @link            http://www.marlev.it
     * @copyright       Copyright 2013 marlev.it All Rights Reserved
     * @license         http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
     */
    defined('_JEXEC') or die;
?>
<div class="tm-presets tm-config" >
     <h3><?php echo JText::_("TPL_MARLEV_PRESETS");?></h3>
            <div class="slide-config-title"  >
               <?php echo JText::_("COM_TMARLEV_PRESETS_LABEL") ?>
            </div>
        <div class="control-group">
            <div class="control-label" style="width:55% !important; padding-top:25px; padding-left:15px">
                <label><?php echo JText::_("COM_TMARLEV_CREATE_NEW_PRESETS") ?></label>
            </div>
            <div class="controls" style="width:auto !important;">
                <input id="params_presets_name" class="tm-text" style="margin-top: 5px;" type="text" value="" placeholder="<?php echo JText::_("COM_TMARLEV_PRESETS_NAME") ?>" name="presets_name">
                <button class="btn btn-info ml-submit" data-lang="<?php echo JText::_("COM_TMARLEV_SAVE_ALL"); ?>" data-task="template.savepresets" >
                    <?php echo JText::_("COM_TMARLEV_SAVE_ALL"); ?>
                </button>

            </div>


        </div>


<div id="presets-block">
        <table  class="table table-striped" >
            <thead>
                <tr>

                    <th class="nowrap center" width="15%" >
                        <button class="btn  btn-danger disabled delete-presets ml-submit" data-lang="<?php echo JText::_("COM_TMARLEV_DELETE"); ?>" data-task="template.cancellpresets" >
                            <?php echo JText::_("COM_TMARLEV_DELETE"); ?>
                        </button>
                        <button class="btn btn-inverse load-preset disabled ml-submit" data-lang="<?php echo JText::_("COM_TMARLEV_LOAD"); ?>" data-task="template.loadpresets">
                            <?php echo JText::_("COM_TMARLEV_LOAD"); ?>
                        </button>
                    </th>
                    <th  class="nowrap hidden-phone center" width="30%">
                        <?php echo JText::_("COM_TMARLEV_PRESETS_NAME"); ?>
                    </th>
                    <th  class="nowrap hidden-phone center" width="20%">
                        <?php echo JText::_("COM_TMARLEV_PRESETS_CREATED"); ?>
                    </th>
                    <th  class="nowrap hidden-phone center">
                        &nbsp;
                    </th>


                </tr>
            </thead>
            <tbody class="load-table">
                <?php foreach ($this->presets as $i => $preset) :
                        ?>
                        <tr id="prestsid-<?php echo $preset->pid; ?>"class="row0<?php echo $i % 2; ?> " >
                            <td class="order has-context center ">
                                <input class="tm-preset-action" type="checkbox" name="delete_preset[]" value="<?php echo $preset->pid; ?>">
                            </td>
                            <td class="hidden-phone center" >
                                <?php echo $preset->title; ?>
                            </td>
                            <td class="hidden-phone center">
                                <?php
                                $explodedate = explode(" ", $preset->created);
                                $dateformat = explode("-", $explodedate[0]);
                                echo $dateformat[2] . "/" . $dateformat[1] . "/" . $dateformat[0] . " " . $explodedate[1];
                                ?>
                            </td>
                            <td class="hidden-phone center">

                            </td>

                        </tr>
                    <?php endforeach; ?>
                        <input type="hidden" name="ajax_return" value="<?php echo $id; ?>" />
            </tbody>
        </table>
    </div>

 
    <div class="clearfix"></div>
</div>

