<head>
    <title>SplitThreader</title>
    <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="">
        <meta name="author" content="">
        <link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32">
        <link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16">

            
        <title>SplitThreader</title>
        <!--Dropzone-->
        <link href="css/lib/dropzone.css" rel="stylesheet">
        
        
        <!-- Bootstrap core CSS -->
        <link href="css/lib/bootstrap.min.css" rel="stylesheet">
        <!-- Bootstrap theme -->
        <link href="css/lib/bootstrap-theme.min.css" rel="stylesheet">

    <!-- Google Analytics -->
    <script>
      // Google Analytics Tracking Code
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-73658564-1', 'auto');
      ga('send', 'pageview');

    </script>

    
    <!-- <link rel="shortcut icon" type="image/png" href="images/cat_icon2_black.png"/> -->
    <!-- <link rel="icon" type="image/png" href="images/cat_icon2_black.png"/> -->
    
    
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body role="document">
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <!-- <img class="kitty_icon" src="images/cat_icon2_white.png"/> -->
      <div class="container">
        
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href=".">        SplitThreader</a>
        </div>
        <div class="navbar-collapse collapse">
          <ul class="nav navbar-nav" id="navbar">
            <li><a href="./">Home</a></li>
            <!--<li><a href="./help.php">Help</a></li>-->
            <li><a href="./info.php">Info</a></li>
             
                  <?php
                      $my_datasets = array();

                      if(isset($_COOKIE["splitthreader"])) {
                        echo '<li class="dropdown">
                        <a href="" class="dropdown-toggle" data-toggle="dropdown">My data <span class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu">';

                        $my_datasets = json_decode($_COOKIE["splitthreader"], true);

                        $arrlength = count($my_datasets);
                        $start_at = 0;
                        if ($arrlength > 20) {
                          $start_at = $arrlength - 20;
                        }
                        for($x = $start_at; $x < $arrlength; $x++) {
                          $seconds_ago = time() - $my_datasets[$x]["date"];
                          
                          $time_ago = $seconds_ago;
                          if ($seconds_ago > 60) {
                            $minutes_ago = $seconds_ago/60;
                            if ($minutes_ago > 60) {
                              $hours_ago = $minutes_ago/60;
                              if ($hours_ago > 24) {
                                $days_ago = $hours_ago/24;
                                $time_ago = "" . floor($days_ago) . " days";
                              } else {
                                $time_ago = "" . floor($hours_ago) . " hours";
                              }
                            } else {
                              $time_ago = "" . floor($minutes_ago) . " minutes";
                            }
                          } else {
                            $time_ago = "" . floor($seconds_ago) . " seconds";
                          }
                          
                          echo "<li><a href='analysis.php?code=" . $my_datasets[$x]["codename"] . "'>" . $my_datasets[$x]["description"] . " (" . $time_ago . " ago) </a></li>";
                        }

                        echo '</ul>';
                      } 
                  ?>
              
            <li class="dropdown">
              <a href="" class="dropdown-toggle" data-toggle="dropdown">Examples <span class="caret"></span></a>
              <ul class="dropdown-menu" role="menu">
                <li><a href="vis.php?code=example1&nickname=SK_BR_3_breast_cancer_cell_line____PacBio_sequencing">SK-BR-3 (Breast cancer cell line) PacBio+Sniffles</a></li>
                <li><a href="vis.php?code=example4&nickname=MCF7_Illumina_data_with_variants_filtered_to_10kb_min_size_with_5_split_and_5_paired_end_reads">MCF7 (breast cancer cell line) Illumina+Lumpy</a></li>
                <li><a href="vis.php?code=example3&nickname=A549_Illumina_data_with_variants_filtered_to_10kb_min_size_with_3_split_and_3_paired_end_reads">A549 (NSCLC cell line) Illumina+Lumpy</a></li>
              </ul>
            </li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </div>
