<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
<?php if($this->app_acl->component_loaded('utilities')){ ?>
<div class="widget" id="widget-<?php echo create_widget_id(); ?>" data-name="<?php echo _l('home_my_todo_items'); ?>">
   <div class="panel_s todo-panel">
      <div class="panel-body padding-10 cul-6">
         <div class="widget-dragger"></div>
         <p class="pull-left padding-5 titlu-dash text-white">
            <?php echo _l('home_my_todo_items'); ?>
         </p>
         <a href="<?php echo admin_url('todo'); ?>" class="pull-right padding-5 text-white">&nbsp;|&nbsp;<?php echo _l('home_widget_view_all'); ?></a>
         <a href="#__todo" data-toggle="modal" class="pull-right padding-5 text-white" style="padding-right:0px;">
            <?php echo _l('new_todo'); ?>
         </a>
         <div class="clearfix"></div>
         <?php $total_todos = count($todos); ?>
         <h4 class="todo-title text-white text-warning"><i class="fal fa-warning"></i> <?php echo _l('home_latest_todos'); ?></h4>
         <ul class="list-unstyled todo unfinished-todos todos-sortable sortable">
            <?php foreach($todos as $todo) { ?>
               <li>
                <?php echo form_hidden('todo_order',$todo['item_order']); ?>
                <?php echo form_hidden('finished',0); ?>
                <div class="media">
                 <div class="media-left no-padding-right">
                  <div class="dragger todo-dragger"></div>
                  <div class="checkbox checkbox-default todo-checkbox">
                     <input type="checkbox" name="todo_id" value="<?php echo $todo['todoid']; ?>">
                     <label></label>
                  </div>
               </div>
               <div class="media-body">
                  <p class="todo-description text-white read-more no-padding-left" data-todo-description="<?php echo $todo['todoid']; ?>">
                        <?php echo $todo['description']; ?>
                     </p>
                        <a href="#" onclick="delete_todo_item(this,<?php echo $todo['todoid']; ?>); return false;" class="pull-right text-muted text-white">
                           <i class="fal fa-removete text-white"></i>
                        </a>
                        <a href="#" onclick="edit_todo_item(<?php echo $todo['todoid']; ?>); return false;" class="pull-right text-muted mright5 text-white">
                           <i class="fal fa-pencil text-white"></i>
                        </a>
                        <small class="todo-date text-white"><?php echo $todo['dateadded']; ?></small>
               </div>
            </div>
         </li>
      <?php } ?>
      <li class="padding no-todos text-white ui-state-disabled <?php if($total_todos > 0){echo 'hide';} ?>"><?php echo _l('home_no_latest_todos'); ?></li>
   </ul>
   <?php $total_finished_todos = count($todos_finished); ?>
   <h4 class="todo-title text-success text-white"><i class="fal fa-check"></i> <?php echo _l('home_latest_finished_todos'); ?></h4>
   <ul class="list-unstyled todo finished-todos todos-sortable sortable" >
      <?php foreach($todos_finished as $todo_finished){ ?>
         <li>
            <?php echo form_hidden('todo_order',$todo_finished['item_order']); ?>
            <?php echo form_hidden('finished',1); ?>
            <div class="media">
              <div class="media-left no-padding-right">
               <div class="dragger todo-dragger"></div>
               <div class="checkbox checkbox-default todo-checkbox">
                  <input type="checkbox" value="<?php echo $todo_finished['todoid']; ?>" name="todo_id" checked>
                  <label></label>
               </div>
            </div>
            <div class="media-body">
               <p class="todo-description read-more line-throught no-padding-left">
                  <?php echo $todo_finished['description']; ?>
               </p>
                 <a href="#" onclick="delete_todo_item(this,<?php echo $todo_finished['todoid']; ?>); return false;" class="pull-right text-muted"><i class="fal fa-remove"></i></a>
               <a href="#" onclick="edit_todo_item(<?php echo $todo_finished['todoid']; ?>); return false;" class="pull-right text-muted mright5">
                  <i class="fal fa-pencil"></i>
               </a>
               <small class="todo-date todo-date-finished"><?php echo $todo_finished['datefinished']; ?></small>
            </div>
         </div>
      </li>
   <?php } ?>
   <li class="padding no-todos text-white <?php if($total_finished_todos > 0){echo 'hide';} ?>"><?php echo _l('home_no_finished_todos_found'); ?></li>
</ul>
<div id="ch13" class="text-center ht-160 rickshaw_graph" style="margin-bottom:-15px;"><svg width="355" height="160"><rect x="0" y="106.66666666666667" width="18.73611111111111" height="53.33333333333333" transform="matrix(1,0,0,1,0,0)" fill="#f25766"></rect><rect x="39.44444444444444" y="93.33333333333333" width="18.73611111111111" height="66.66666666666667" transform="matrix(1,0,0,1,0,0)" fill="#f25766"></rect><rect x="78.88888888888889" y="133.33333333333334" width="18.73611111111111" height="26.666666666666664" transform="matrix(1,0,0,1,0,0)" fill="#f25766"></rect><rect x="118.33333333333333" y="120" width="18.73611111111111" height="40" transform="matrix(1,0,0,1,0,0)" fill="#f25766"></rect><rect x="157.77777777777777" y="106.66666666666667" width="18.73611111111111" height="53.33333333333333" transform="matrix(1,0,0,1,0,0)" fill="#f25766"></rect><rect x="197.22222222222223" y="53.33333333333334" width="18.73611111111111" height="106.66666666666666" transform="matrix(1,0,0,1,0,0)" fill="#f25766"></rect><rect x="236.66666666666666" y="120" width="18.73611111111111" height="40" transform="matrix(1,0,0,1,0,0)" fill="#f25766"></rect><rect x="276.1111111111111" y="53.33333333333334" width="18.73611111111111" height="106.66666666666666" transform="matrix(1,0,0,1,0,0)" fill="#f25766"></rect><rect x="315.55555555555554" y="93.33333333333333" width="18.73611111111111" height="66.66666666666667" transform="matrix(1,0,0,1,0,0)" fill="#f25766"></rect><rect x="18.73611111111111" y="133.33333333333334" width="18.73611111111111" height="26.666666666666664" transform="matrix(1,0,0,1,0,0)" fill="#aa2531"></rect><rect x="58.18055555555556" y="80" width="18.73611111111111" height="80" transform="matrix(1,0,0,1,0,0)" fill="#aa2531"></rect><rect x="97.625" y="40" width="18.73611111111111" height="120" transform="matrix(1,0,0,1,0,0)" fill="#aa2531"></rect><rect x="137.06944444444443" y="80" width="18.73611111111111" height="80" transform="matrix(1,0,0,1,0,0)" fill="#aa2531"></rect><rect x="176.51388888888889" y="48" width="18.73611111111111" height="112" transform="matrix(1,0,0,1,0,0)" fill="#aa2531"></rect><rect x="215.95833333333334" y="106.66666666666667" width="18.73611111111111" height="53.33333333333333" transform="matrix(1,0,0,1,0,0)" fill="#aa2531"></rect><rect x="255.40277777777777" y="80" width="18.73611111111111" height="80" transform="matrix(1,0,0,1,0,0)" fill="#aa2531"></rect><rect x="294.8472222222222" y="120" width="18.73611111111111" height="40" transform="matrix(1,0,0,1,0,0)" fill="#aa2531"></rect><rect x="334.29166666666663" y="106.66666666666667" width="18.73611111111111" height="53.33333333333333" transform="matrix(1,0,0,1,0,0)" fill="#aa2531"></rect></svg></div>
</div>
</div>
<?php $this->load->view('admin/todos/_todo.php'); ?>
</div>
<?php } ?>