Showing source for: https://www.musabase.org/
Duration: 0.82815s
Server: nginx/1.18.0




<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

<head>
  <link rel="stylesheet" type="text/css" href="/css/new_sgn.css" />
<link rel="stylesheet" type="text/css" href="/css/jquery-sgn-theme/jquery-ui-1.10.3.custom.css" />
<link rel="stylesheet" type="text/css" href="/css/jstree/themes/default/style.min.css" />
<link rel="stylesheet" type="text/css" href="/css/fullcalendar.min.css" />
<link rel="stylesheet" type="text/css" href="/documents/inc/datatables/jquery.dataTables.css" />
<link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="/css/bootstrap-toggle/bootstrap-toggle.min.css" />
<link rel="stylesheet" type="text/css" href="/css/ladda-themeless.min.css" />
<link rel="stylesheet" type="text/css" href="/css/daterangepicker.css" />
<link rel="stylesheet" type="text/css" href="/css/buttons/buttons.bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="/css/buttons/buttons.dataTables.css" />
<link rel="stylesheet" type="text/css" href="/css/bootstrap3-xl-class.css" />
<link rel="stylesheet" type="text/css" href="/css/bootstrap-select.min.css" />
<link rel="stylesheet" type="text/css" href="/css/datepicker.css" />

<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">

  <!-- <link rel="stylesheet" href="/css/sgn.css" type="text/css" /> -->
  <link rel="search" type="application/opensearchdescription+xml" title="Search Database" href="/documents/sgn_sol_search.xml" />
  

  <!-- <link rel="stylesheet" href="/documents/inc/colorbox/colorbox.css" type="text/css" /> -->
  <!-- <link rel="stylesheet" type="text/css" href="/css/dataTables.bootstrap.min.css"> -->

<script language="javascript" type="text/javascript">
   JSAN = {};
   JSAN.use = function() {};
   MochiKit = {__export__: false};
</script>


    

<script type="text/javascript"
  src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>

<!-- file needed to add more styles and js libraries to sites dependent on SGN -->
  <title>MusaBase</title>

  <!--<link href='/css/nextgen-cassava-base.css' rel='stylesheet' type='text/css'>-->
  <link href='/css/nextgen-cassava-base-new.css' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" href="/documents/inc/jquery-cassava-theme/jquery-ui-1.10.3.custom.css" type="text/css" />

  <!--<link href='http://fonts.googleapis.com/css?family=Lato:300' rel='stylesheet' type='text/css'>-->


 <!-- Google Analytics code -->

<script>
  (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-2460904-9', 'auto');
  ga('send', 'pageview');

</script>





<script src="/js/legacy/jquery.js" type="text/javascript"></script>
<script src="/js/legacy/jqueryui.js" type="text/javascript"></script>
<script src="/js/legacy/sgn.js" type="text/javascript"></script>
<script src="/js/legacy/jquery/simpletooltip.js" type="text/javascript"></script>
<script src="/js/legacy/jquery/cookie.js" type="text/javascript"></script>
<script src="/js/legacy/MochiKit/Base.js" type="text/javascript"></script>
<script src="/js/legacy/MochiKit/Logging.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/Effects.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/Dataset.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/Page/FormattingHelpers.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/Base.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/Cookie.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/User.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/UserPrefs.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/Page/Toolbar.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/List.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/Login.js" type="text/javascript"></script>
<script src="/js/legacy/bootstrap_min.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/BreedersToolbox/HTMLSelect.js" type="text/javascript"></script>
<script src="/js/legacy/bootstrap-toggle_min.js" type="text/javascript"></script>
<script src="/js/legacy/jquerymigrate-min.js" type="text/javascript"></script>
<script src="/js/legacy/jquery/dataTables-min.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/GuidedHelp.js" type="text/javascript"></script>
<script src="/js/legacy/jquery/iframe-post-form.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/BreedersToolbox/AddTrial.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/BreedersToolbox/UploadTrial.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/BreedersToolbox/Trial.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/Trial.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/BreedersToolbox/GenotypingTrial.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/BreedersToolbox/Accessions.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/BreedersToolbox/UploadPedigrees.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/BreedersToolbox/Crosses.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/BreedersToolbox/FieldBook.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/BreedersToolbox/UploadPhenotype.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/BreederSearch.js" type="text/javascript"></script>
<script src="/js/legacy/CXGN/TrialTreeFolders.js" type="text/javascript"></script>
<script src="/js/legacy/workflow.js" type="text/javascript"></script>
<script src="/js/legacy/d3/d3v4Min.js" type="text/javascript"></script>
<script src="/js/legacy/moment_min.js" type="text/javascript"></script>
<script src="/js/legacy/daterangepicker.js" type="text/javascript"></script>
<script src="/js/legacy/calendar/moment_min.js" type="text/javascript"></script>
<script src="/js/legacy/calendar/fullcalendar_min.js" type="text/javascript"></script>
<script src="/js/legacy/jquery/dataTables.js" type="text/javascript"></script>
<script src="/js/legacy/calendar/fullcalendar_gcal_min.js" type="text/javascript"></script>
<script src="/js/legacy/calendar/bootstrap_datepicker_min.js" type="text/javascript"></script>

  
</head>

<body>

<div id="outercontainer">
  <a name="top"></a>

  <div id="clone_shoppingcart" style="display: none">
    <span id="clone_cart_count"></span> clone(s) in cart (<a class="toplink" style="text-decoration: underline" href="/search/clone-order.pl">order</a>)
  </div>

  <div class="modal fade" id="nav_dialog" role="dialog">
  <div class="modal-dialog modal-sm">
  
    <!-- Modal content-->
  <div class="modal-content">
    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal">&times;</button>
      <h4 class="modal-title">Old browser version detected</h4>
      <!-- <h4 class="modal-title">This site is best viewed with:</h4> -->
    </div>
    
    <div class="modal-body">
    	<p>
        This site is optimized for modern web browsers<br>
        <center>
        <a href="http://browsehappy.com" target="_blank" class="footer">
          Please upgrade your browser<br>
          <img src="https://lh3.ggpht.com/O0aW5qsyCkR2i7Bu-jUU1b5BWA_NygJ6ui4MgaAvL7gfqvVWqkOBscDaq4pn-vkwByUx=w300" width="25">
          <img src="https://mozorg.cdn.mozilla.net/media/img/firefox/desktop/index/animations/firefox-logo.png" width="25">
          <img src="https://km.support.apple.com/kb/image.jsp?productid=PL165" width="25">
          <img src="/documents/img/o-logo.jpg" width="25">
          <img src="https://c.s-microsoft.com/en-us/CMSImages/ie_symbol_clr_56x56.png?version=73aa5bf1-0743-11e7-8f71-718675c983bf" width="25">
        </a>
        </center>
      </p>
        Sorry!, some features may not work in outdated browsers
      
        <!-- <a href="http://www.google.com/chrome" target="_blank"><img src="https://lh3.ggpht.com/O0aW5qsyCkR2i7Bu-jUU1b5BWA_NygJ6ui4MgaAvL7gfqvVWqkOBscDaq4pn-vkwByUx=w300" width="25">&nbsp; Google Chrome</a><br/>
        <br/>
        <a href="http://www.firefox.com/" target="_blank"><img src="https://mozorg.cdn.mozilla.net/media/img/firefox/desktop/index/animations/firefox-logo.png" width="25">&nbsp; Mozilla Firefox</a><br/>
        <br/>
        <a href="http://www.apple.com/safari/" target="_blank"><img src="http://km.support.apple.com/kb/image.jsp?productid=PL165" width="25">&nbsp; Safari</a><br/>
        <br/>
        <a href="http://www.opera.com/" target="_blank"><img src="http://www-static.opera.com/static-heap/b4/b43d0a4442ae0b771bf45f3ed519e5f4272b63d2/o-logo.jpg" width="25">&nbsp; Opera</a><br/>
        <br/>
        <a href="http://windows.microsoft.com/ie" target="_blank"><img src="http://c.s-microsoft.com/en-us/CMSImages/ie_symbol_clr_56x56.png?version=73aa5bf1-0743-11e7-8f71-718675c983bf" width="25">&nbsp; MS Internet Explorer</a><br/> -->
    </div>
    
    <div class="modal-footer">
      <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
    </div>
  </div>
    
  </div>
</div>

<script>

  var str = navigator.userAgent;
  var ie = /MSIE/.test(str);
  // alert(navigator.userAgent);

  jQuery(document).ready(function ($) {
    if(ie) {
      $('#nav_dialog').modal("show");
    }
  });

</script>

  

<nav class="navbar navbar-default navbar-fixed-top">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      
<a class="navbar-brand" href="/" style="padding:10px 0px">
<!-- img id="sgnlogo" 
src="/static/img/musabase/breeding_better_bananas_logo2.png" width="60" alt="MusaBase Home" title="MusaBase Home"></a -->

<img id="sgnlogo" 
src="/static/img/musabase/breeding_better_bananas_logo2.png" width="60" alt="MusaBase Home" title="MusaBase Home"></a>

<a class="navbar-brand sgn_brand_name" href="/">MusaBase</a>

    </div>
    <div class="collapse navbar-collapse" id="myNavbar">
      <ul class="nav navbar-nav">
        <li class="dropdown"><a class="menu_click_dropdown dropdown-toggle" data-toggle="dropdown">Search</a>
  <ul class="dropdown-menu">
    <li><a href="/breeders/search">Wizard</a></li>
    <li><a href="/search/phenotypes/stock">Accessions and Plots</a></li>
    <li><a href="/search/organisms">Organisms</a></li>
    <li><a href="/search/cross">Progenies and Crosses</a></li>
    <li><a href="/search/trials">Field Trials</a></li>
    <li role="separator" class="divider"></li>
    <li><a href="/search/genotyping_trials">Genotyping Plates</a></li>
    <li><a href="/search/genotyping_data_projects">Genotyping Data Projects</a></li>
    <li><a href="/search/genotyping_protocols">Genotyping Protocols</a></li>
    <li><a href="/search/stocks_using_genotypes">Accessions Using Genotypes</a></li>
    <li role="separator" class="divider"></li>
    <li><a href="/search/traits">Traits</a></li>
    <li><a href="/search/markers">Markers</a></li>
    <li><a href="/search/images">Images</a></li>
    <li role="separator" class="divider"></li>
    <li><a href="/search/people">People</a></li>
    <li><a href="/help/faq.pl">FAQ</a></li>
    <li role="separator" class="divider"></li>
    <li><a href="/ftp">FTP Data</a><li>
  </ul>
</li>

        <li class="dropdown"><a class="menu_click_dropdown dropdown-toggle" data-toggle="dropdown">Manage</a>

  <ul class="dropdown-menu">
    <li><a href="/breeders/manage_roles/">User Roles</a></li>
    <li><a href="/breeders/manage_programs/">Breeding Programs</a></li>
    <li><a href="/breeders/locations">Locations</a></li>
    <li><a href="/breeders/accessions/">Accessions</a></li>
    <li role="separator" class="divider"></li>
    <li><a href="/breeders/seedlots/">Seed Lots</a></li>   
    <li><a href="/breeders/crosses/">Crosses</a></li>
    <li><a href="/breeders/trials/">Field Trials</a></li>
    <li><a href="/breeders/genotyping/">Genotyping Plates</a></li>
    <li><a href="/breeders/samples/">Tissue Samples</a></li>
    <li role="separator" class="divider"></li>
    <li><a href="/fieldbook">Field Book App</a></li>
    <li><a href="/breeders/phenotyping/">Phenotyping</a></li>     
    <li><a href="/barcode">Barcodes</a></li>
    <li><a href="/tools/label_designer">Label Designer</a></li>
    <li><a href="/breeders/nirs/">NIRS</a></li>
    <li><a href="/breeders/markers/">Markerset</a></li>
    <li role="separator" class="divider"></li>
    <li><a href="/breeders/download">Download</a></li>
    <li><a href="/breeders/upload">Upload</a></li>
    <li><a href="/breeders/odk">ODK Data Collection</a></li>
    <li><a href="/breeders/identifier_generation">Identifier Generation</a></li>   
  </ul>
</li>

        <li class="dropdown"><a class="menu_click_dropdown dropdown-toggle" data-toggle="dropdown">Analyze</a>
<!-- <li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">Genomes<span class="caret"></span></a> -->
  <ul class="dropdown-menu">
    <li><a href="/analyses">Stored Analyses</a></li>
    <li role="separator" class="divider"></li>
    <li><a href="/tools/trial/comparison/list">Compare Trials</a></li>
    <li><a href="/tools/graphicalfiltering">Graphical Filtering</a></li>
     
    <li><a href="/selection/index">Selection Index</a></li>
    <li><a href="/solgs/search">Genomic Selection</a></li>
    <li><a href="/accession_usage">Accession Usage</a></li>
    <li role="separator" class="divider"></li>
    <li><a href="/tools/mixedmodels">Mixed Models</a></li>
    <li><a href="/tools/trial/comparison/list">Compare Trials</a></li>
    <li><a href="/tools/graphicalfiltering">Graphical Filtering</a></li>
    <li><a href="/tools/heritability">Heritability</a></li>
    <li><a href="/tools/stability">Stability AMMI</a></li>
    <li><a href="/tools/solgwas">GWAS</a></li>
    <li><a href="/tools/boxplotter">BoxPlotter</a></li>
    <li><a href="/tools/image_analysis">Image Analysis</a></li>

    <li role="separator" class="divider"></li>
    <li class="dropdown-header">Sequence Analysis</li>
    <li><a href="/tools/blast/">BLAST</a></li>

    <li role="separator" class="divider"></li>
    <li class="dropdown-header">Other</li>
    <li><a href="/tools/onto/">Ontology Browser</a></li>
    <li><a href="/tools/compose">Compose a New Trait</a></li>
  </ul>
</li>

        <li class="dropdown"><a class="menu_click_dropdown dropdown-toggle" data-toggle="dropdown">Maps</a>
<!-- <li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">Tools<span class="caret"></span></a> -->
<ul class="dropdown-menu">

    <li class="dropdown-header">Jbrowse Genome Browser</li>

    <li><a href="/jbrowse_musabase/?data=data/json/Musa_acuminataV2">Musa acuminata genome</a></li>

        <li role="separator" class="divider"></li>    
   
    
  </ul>
</li>

        
<li class="dropdown"><a class="menu_click_dropdown dropdown-toggle" data-toggle="dropdown">SOPs</a>

<ul class="dropdown-menu">

  <!-- li class="dropdown-header"></li -->

  <!-- li><a href="/ftp/SOPs/Banana nematode screening protocol - September 2021.pdf">Nematode screening</a></li>
  <li><a href="/ftp/SOPs/Banana weevil screening protocol - September 2021.pdf">Weevil screening</a></li>
  <li><a href="/ftp/SOPs/Screening for resistance to Sigatoka - September 2021.pdf">Sigatoka resistance screening</a></li>
  <li><a href="/ftp/SOPs/Screening for resistance to Xvm - September 2021 new.pdf">Xvm resistance screening</a></li>
  <li><a href="/ftp/SOPs/Glasshouse protocol for screening for resistance to FOC-R1 - 300921.pdf">FOC-R1 resistances screening (Glasshouse)</a></li -->
  <li><a href="/ftp/SOPs/Phenotyping for FOC-R1 - 220822.pdf">Phenotyping for FOC-R1</a></li>
  <li><a href="/ftp/SOPs/Sigatoka SOP - 220822.pdf">Phenotyping for Sigatoka</a></li>
  <li><a href="/ftp/SOPs/SOP Phenotyping for R. similis resistance - 150722.pdf">Phenotyping for <i>R. similis</i></a></li>
  <li><a href="/ftp/SOPs/Phenotyping for BXW - 220822.pdf">Phenotyping for BXW</a></li>
  <li><a href="/ftp/SOPs/SOP phenotyping for C. sordidus resistance - 270722.pdf">Phenotyping for <i>C. sordidus</i> resistance</a></li>

    
  </ul>
</li>

	<li class="dropdown"><a class="menu_click_dropdown dropdown-toggle" data-toggle="dropdown">Pathogens</a>
<!-- <li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">About Us<span class="caret"></span></a> -->
  <ul class="dropdown-menu">
      <li><a href="/pages/sigatoka_and_fusarium_collection">Sigatoka and Fusarium Collection</a></li>
      </ul>
      
        <li class="dropdown"><a class="menu_click_dropdown dropdown-toggle" data-toggle="dropdown">About</a>
  <ul class="dropdown-menu">
    <li><a href="/about">About</a></li>
    <li><a href="/contact/form">Contact</a></li>
    <li><a href="/help/index.pl">Cite Musabase</a></li>
    
    <li role="separator" class="divider"></li>

    <li><a href="https://solgenomics.github.io/sgn/" class="footer">Manual</a></li>
    <li><a href="https://www.youtube.com/channel/UC3jrvvzGKKEHzOriDBgnj0A" target="_blank">Video tutorials</a></li>

    <li role="separator" class="divider"></li>
    
    <li><a href="/breeders/dbstats" class="footer">Database statistics</a></li>
    <li><a href="/help/index.pl">Help</a></li>
    <li><a href="/help/faq.pl">FAQ</a></li>
    <li><a href="/forum/topics.pl">Forum</a></li>
    
    <li role="separator" class="divider"></li>
    
    <li><a href="https://twitter.com/solgenomics">Twitter</a></li>
    <li><a href="https://www.facebook.com/solgenomics">Facebook</a></li>
  </ul>
</li>

      </ul>
      <ul class="nav navbar-nav navbar-right">
        
<li style="height:100%">
  <form id="toolbar_search_form" class="navbar-form navbar-left form-inline" role="search" action="/search/quick_search.pl" style="padding-right: 2px;height:100%">
    <div class="input-group">
      <span id="advanced_search_li" class="btn btn-default input-group-addon" style="display:none" onclick="location.href='/search';">Advanced</span>
      <input id="quick_search_input" style="display:none;" type="text" name="term" class="form-control" placeholder="">
      <span id="quick_search_icon" class="btn btn-default" style="height:34px; font-size:16; padding-top:8px;" title="Search"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></span>
    </div>
  </form>
</li>

<script defer="defer">
  jQuery(document).ready(function() {
    
    jQuery('#quick_search_icon').click(function () {
      
      //open the search box
      if (jQuery('#quick_search_input').attr("placeholder") == "") {
        jQuery('#quick_search_input').attr("placeholder","Search");
        
        jQuery('#quick_search_icon').addClass("input-group-addon");
        
        jQuery('#advanced_search_li').css("display","table-cell");
        jQuery('#quick_search_input').css("display","table-cell");
        jQuery('#quick_search_input').css("width","0px");
        jQuery('#quick_search_input').animate({
          width: '150px'
        }, 400);

      }
      else {
        //close the search box if empty
        var search_val = jQuery('#quick_search_input').val();
        // alert("search_val: "+search_val);

        if (search_val) {
          jQuery('#toolbar_search_form').submit();
        }
        else {

          jQuery('#quick_search_input').animate({
            width: '0px'
          }, 400, function(){
            // callback function
            jQuery('#quick_search_input').attr("placeholder","");
            jQuery('#quick_search_input').css("display","none");
            jQuery('#advanced_search_li').css("display","none");
            jQuery('#quick_search_icon').removeClass("input-group-addon");
          });

        } //close search_val else
      }
    });
    
  });
</script>
        
<span id="login_button_html_div" style="white-space:nowrap;width:200;float:right"><button class="btn btn-primary disabled" type="button" style="margin: 7px 7px 0px 0px">Login</button></span>


<script>

  // Add URL paths to this array that should not have the login dialog shown
  // when the config `require_login` is set
  const PATHS_TO_NOT_REQUIRE_LOGIN = ["/user/reset_password_form"];

  function update_login_button() { 

    jQuery.ajax( { 
      url: '/ajax/user/login_button_html',
      error: function(r) { alert('An error occurred'); },
      success: function(r) { 
        if (r.error) { alert(r.error); }
        else { 
          jQuery('#login_button_html_div').html(r.html);

          if (0 == 1 && !r.logged_in) {
            if ( !PATHS_TO_NOT_REQUIRE_LOGIN.includes(window.location.pathname) ) {
              jQuery('#site_login_dialog').modal({backdrop: 'static', keyboard: false});
            }
          }
        }
      }
    });
  }
        
  function logout() { 
    var answer = confirm("Are you sure you want to log out?");

    if (answer === true) { 
      jQuery.ajax( { 
        url: '/ajax/user/logout',
        error: function(r) { alert('An error occurred'); },
        success: function(r) { 
          if (r.error) { alert(r.error); }
          else { 
            location.reload();
          }
        }
      });
    }
  }
  
jQuery(document).ready(function () {

  update_login_button();
   
  jQuery(document).on('click', 'button[name="site_login_button"]', function(event) 
  { 
    jQuery('#site_login_dialog').modal("show");
  });
});
  
</script>

      </ul>
    </div>
  </div>
</nav>
<br>

<style>
  li {
    margin-bottom:0;
  }
  body {
    padding-top: 30px;
  }
  
  @media (min-width: 0px) and (max-width: 768px) {
    body {
      padding-top: 30px;
    }
  }

  @media (min-width: 768px) and (max-width: 856px) {
    body {
      padding-top: 90px;
    }
  }
  
  @media (max-width: 768px) {
    .sgn_brand_name {
      padding-left: 0px;
      padding-right: 0px;
    }
    .sgn_brand_name {
      padding-left: 0px;
      padding-right: 0px;
    }
  }
  
  @media (min-width: 768px) {
    .dropdown:hover .dropdown-menu {
      display: block;
      margin-top: 0;
      padding-bottom: 10px;
    }
    .dropdown-menu > li > a {
        line-height: 14px;
        font-size: 14px;
        margin-top:0px;
        padding-top:0px;
    }
  }
  
</style>

<script>

jQuery( document ).ready(function() {
  if (jQuery( document ).width() > 768) {
    jQuery(".menu_click_dropdown").removeClass("dropdown-toggle");
    jQuery(".menu_click_dropdown").removeAttr("data-toggle");
  }
});

</script>

  <!-- <div class="devbar"> -->
<div class="devbar_tmp">
   <span style="color: #922; font-weight: bold">Notice: </span>
   <!-- system message active -->
   Due to a server issue on May 1, the database was reloaded from a backup. Please check your data. Apologies for any inconvenience.

</div>

  <style>
    .devbar_tmp {
      width: 100%;
      padding: 5px;
      margin: 0px 0 0px 0px;
      text-align: center;
      background-color: #eef;
      border-bottom: 2px solid #905;
    }
  </style>


<script defer="defer">

jQuery(document).ready( function() { 

  setUpLogin();
  setUpLists();
  setUpDatasets();

});

</script>

<!-- END HEADER -->


<!-- START CONTENT WRAPPER -->
  <br/>

  <div id="wrapper" class="container-fluid">
    <div id="main_row" class="row">
      <div class="col-md-1 col-lg-1 col-xl-2">
      </div>
      <div class="col-sm-12 col-md-10 col-lg-10 col-xl-8">


<div id="cookie_popup" name="cookie_popup" style="display:none">
    <div class="container-fluid">
        <div id="cookie_popup_content_div">
            <div class="panel panel-danger">
                <div class="panel-body bg-danger">
                    <div class="row">
                        <div class="col-sm-10">
                            <p>This site uses cookies to provide logins and other features. Please accept the use of cookies by clicking Accept.</p>
                        </div>
                        <div class="col-sm-2">
                            <button class="btn btn-primary btn-sm" id="cookie_agree_submit">Accept</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>



<script>

    jQuery(document).ready(function(){

        jQuery('#cookie_agree_submit').click( function () {
            var expDate = new Date();
            expDate.setTime(expDate.getTime() + (50000 * 60 * 1000)); //about 30 days
            jQuery.cookie("cookies_approved", "1", { expires: expDate, path: '/' } );
            jQuery('#cookie_popup_content_div').html('<div class="panel panel-success"><div class="panel-body bg-success"><center><h3>Thank you :-)</h3></center></div></div>');
            setTimeout(function() {
                jQuery('#cookie_popup').hide('slow');
            }, 1500);
        });

        if (jQuery.cookie("cookies_approved") == 1) {
            jQuery('#cookie_popup').hide();
        } else {
            jQuery('#cookie_popup').show();
        }
    })

</script>




<center>
<br/>
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="false">

    <!-- Indicators -->
    <ol class="carousel-indicators" style="display:none">
      <li data-target="#myCarousel" data-slide-to="0"></li>
      <li data-target="#myCarousel" data-slide-to="1"></li>
      <li data-target="#myCarousel" data-slide-to="2"></li>
      <li data-target="#myCarousel" data-slide-to="3"></li>
      <li data-target="#myCarousel" data-slide-to="4"></li>
    </ol>

    <!-- Wrapper for slides -->
    <div class="carousel-inner" role="listbox">

		<div class="item">
                        <div style="background:url(/documents/img/musabase/carousel/germplasm_trial_pics.jpg) center center; background-size:cover;" class="slider-size">
                                <div class="carousel-sgn-caption">
                                <h3><a href="/breeders/manage_programs/"> Breeding programs</a></h3>
                                <p><a target="_blank">Search, retrieve, save breeding trials</a></p>
                   </div>

                   <div class="carousel-sgn-links">
                         <ul class="sgn_sm_list">
                                <li><a href="/breeders/manage_programs"> Design and create breeding trials</a></li>
                                <li><a href="/breeders/accessions"> Upload accessions</a></li>
                                <li><a href="/breeders/crosses"> Make crosses</a></li>
                                <li><a href="http://www.slideshare.net/solgenomics/3d-cassavabase-workshop-manage-fieldtrial"_blank"> Manage trials tutorials @ SGN</a></li>
                         </ul>
                   </div>
         	  </div>
      		 </div>


                <div class="item">
                        <div style="background:url(/documents/img/musabase/carousel/GS_2014.jpg) center center; background-size:cover;" class="slider-size">
                                <div class="carousel-sgn-caption">
                                <h3><a href="/breeders/phenotyping/"> Phenotyping</a></h3>
                                <p><a target="_blank">Phenotypic data collection and upload in Musabase</a></p>
                   </div>

                   <div class="carousel-sgn-links">
                         <ul class="sgn_sm_list">
                                <li><a href="/breeders/phenotyping/">Upload phenotypes</a></li>
                                <li><a href="/fieldbook">Upload fieldbook</a></li>
                                <li><a href="/breeders/download"> Download data with list</a></li>
                                <li><a href="/breeders/search"> Download data with Wizard search</a></li>
                                <li><a href="http://www.slideshare.net/solgenomics/cassavabase-video-wizard-search-and-list-management-demo"_blank"> Use search & list tutorials @ SGN</a></li>
                         </ul>
                   </div>
         	  </div>
		 </div>
  
    	         <div class="item">
               	      <div style="background:url(/documents/img/musabase/carousel/mgis_slide_bckgd3.png) center center; background-size:cover;" class="slider-size">
          	      	      <div class="carousel-sgn-caption">
			      <p><a href="http://www.crop-diversity.org/mgis"> MGIS </a></p>
                   </div>

                   <div class="carousel-sgn-links">
                       <ul class="sgn_sm_list">
			     <li><a href="http://www.crop-diversity.org/mgis/accession-search"> Search accessions </a></li>
              		     <li><a href="http://www.crop-diversity.org/mgis/organisations"> Search germplasm collection </a></li>
              		     <li><a href="http://www.crop-diversity.org/mgis/taxonomy"> Taxonomy browser </a></li>
            	      </ul>
          	 </div>
		</div>
      	       </div>

     	       <div class="item">
                    <div style="background:url(/documents/img/musabase/carousel/banana_hub_slide_bckgd3.png) center center; background-size:cover;" class="slider-size">
          	    	    <div class="carousel-sgn-caption">
             		    <p><a href="http://www.nature.com/nature/journal/v488/n7410/full/nature11241.html">The banana (Musa acuminata) genome and the evolution of monocotyledonous plants</a></p>
                </div>

                <div class="carousel-sgn-links">
                      <ul class="sgn_sm_list">
              	      	    <li><a href="http://banana-genome-hub.southgreen.fr/jbrowse"> Browse the banana genome </a></li>
              		    <li><a href="http://banana-genome-hub.southgreen.fr/blast"> BLAST search</a></li>
              		    <li><a href="http://banana-genome-hub.southgreen.fr/download"> Download reference genome </a></li>
              		    <li><a href="http://banana-genome-hub.southgreen.fr/download"> Download resequencing project data </a></li>
            	     </ul>
                </div>
	       </div>
      	      </div>

              <div class="item">
              	   <div style="background:url(/documents/img/musabase/carousel/arusha_meeting2016_grpic.jpg) center center; background-size:cover;" class="slider-size">
            	   	  <div class="carousel-sgn-caption">
                          <a href="http://eastafricanhighlandbananas.org" target="_blank">
               		  <h3>East African Highland</h3>
               		  <h3>bananas project<h3>
               		  <h3>& Partners</h3>
                 </div>

	         <div class="carousel-sgn-links">
                     <ul class="sgn_sm_list">
                     	   <li><a href="https://www.biw.kuleuven.be/biosyst/plantenbiotechniek/tropical" target="_blank">KU Leuven </b> <img src="/documents/img/musabase/carousel/kuleuven_logo.png" width="20"></a></li>
                	   <li><a href="http://www.bioversityinternational.org/research-portfolio/conservation-use-of-bananas-tree-crops/banana/" target="_blank">Bioversity International </b> <img src="/documents/img/musabase/carousel/bioversity_logo.jpg" width="20"></a></li>
                	   <li><a href="http://www.rtb.cgiar.org/banana/" target="_blank">RTB program </b> <img src="/documents/img/musabase/carousel/rtb_logo_green.jpg" width="20"></a></li>
                	   <li><a href="http://www.naro.go.ug/" target="_blank">NARO Uganda</a></li>
                	   <li><a href="http://bti.cornell.edu/staff/dr-lukas-mueller/"_blank">Mueller lab @BTI</a></li>
              </ul>
            </div>
	   </div>
	  </div>

  <!-- Wrapper for slides end-->
    
  <div class="progress" style="height:5px">
    <hr class="transition-timer-carousel-progress-bar" />
  </div>

  <!-- Left and right controls -->
  <a id="prev_slide" class="left carousel-control" href="#myCarousel" role="button" data-slide="prev" style="color:white;">
    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a  id="next_slide" class="right carousel-control" href="#myCarousel" role="button" data-slide="next" style="color:white;">
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>

</div>

<ul id="btn_carousel_indicators" class="nav nav-pills nav-justified sgn_carousel_button_group">
  <li class="active"><a data-target="#myCarousel" data-slide-to="0">Breeding</a></li>
  <li><a data-target="#myCarousel" data-slide-to="1">Phenotyping</a></li>
  <li><a data-target="#myCarousel" data-slide-to="2">Germplasm</a></li>
  <li><a data-target="#myCarousel" data-slide-to="3">Genomics</a></li>
  <li><a data-target="#myCarousel" data-slide-to="4">Community</a></li>
</ul>

<style>
	.sgn_carousel_button_group {
	 margin-left: 10px;
	 margin-top: 10px;
	 width:98% !important;
	}
	
	.slider-size {
	 height: 400px; /* This is your slider height */
	}
	.carousel {
	 max-width:98%;
	 /*width:100%;*/
	 margin:0 auto; /* center your carousel if other than 100% */
	 margin-bottom:0px;
	}

	.carousel-sgn-caption {
	 position:relative;
	 float: left;
	 max-width:49%;
	 min-width:35%;
	 padding: 0px 10px 0px 10px;
	 margin-top:20px;

    	 color: #444;
         font-size: 16px;
         text-decoration: none;
	 background-color: #fff;
	 opacity: 0.80;
	 filter: alpha(opacity=80); /* For IE8 and earlier */
	 border-top-right-radius:12px;
  	 border-bottom-right-radius:12px;
	}

       .carousel-sgn-caption a {
        color: #444;
        text-decoration: none;
       }

      .carousel-sgn-caption a:hover {
        color: #00426c;
	text-decoration: none;
       }

      .carousel-sgn-links {
	position:absolute;
	min-width:35%;
	max-width:49%;
	margin-top:20px;
	right:0px;
	text-align: left;
	color: #000;
	font-size: 16px;
	text-decoration: none;
	background-color: #fff;
	opacity: 0.85;
	filter: alpha(opacity=85); /* For IE8 and earlier */
	border-top-left-radius:12px;
	border-bottom-left-radius:12px;
       }

       .carousel-sgn-links ul {
	padding: 10px 0px 0px 15px;
	list-style-type: none;
       }

       .carousel-sgn-links a {
	color: #000;
	text-decoration: none;
       }

       .carousel-sgn-links a:hover {
	color: #666;
	text-decoration: none;
       }

       .sgn_sm_list {
        color: #444;
    	width: 100%;
	text-align: left;
    	padding: 0px;
    	padding-left: 5px;
       }

       .sgn_sm_list li {
        color: #444;
    	width: 100%;
    	padding: 0px;
    	padding-left: 5px;
    	padding-right: 5px;
       }

       .sgn_sm_list li:hover {
        color: #00426c;
       }

  #btn_carousel_indicators {
    cursor: pointer;
  }

  @media (min-width: 0px) and (max-width: 768px) {

    .carousel-sgn-caption {
      margin-top:0px;
      width: 100%;
      max-width: 100%;
      border-radius:0px;
      float: none;
      margin-bottom:0px;
      opacity: 0.90;
    }

    .carousel-sgn-links {
      background-color: #efefef;
      max-width: 100%;
      width: 100%;
      border-radius:0px;
      bottom:0px;
      opacity: 0.9;
    }

    .carousel-sgn-links ul {
      padding: 0px;
      margin-bottom: 0px;
      }

    .sgn_sm_list li {
      color: #00426c;
      width: 100%;
      position: relative;
      display: block;
      padding: 0px;
      padding-left: 5px;
      border: 1px solid #ddd;
    }

    .sgn_sm_list li:hover {
      color: #444;
        background-color: #fff;
      opacity: 1;
    }

/*    .carousel-indicators {
      bottom:0px;
      margin-bottom: 0px;
      width:100%;
      left:auto;
      margin-left:auto;
    }
*/
    .nav-pills>li>a {
      border-radius: 4px;
      border: 1px solid #ccc;
    }

    .sgn_carousel_button_group {
      margin-left: 5px;
      		   margin-top: 5px;
  		   	       width:98% !important;
  			       }

			       }

			       .carousel-control {
			       			 height:100px;
							margin-top:170px
							}
  
  .transition-timer-carousel-progress-bar {
      height: 4px;
      background-color: #337ab7;
      width: 0;
      margin: 0 0 0 0;
      border: none;
      z-index: 11;
      position: relative;
      border-radius: 0px;
  }
  
  .progress {
    margin-top: 5px;
    border-radius: 0px;
  }
  
</style>

<!--
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
-->

<script>

  jQuery(document).ready(function() {

    var $item = jQuery('.carousel .item');
    // var $wHeight = jQuery(window).height();

    var numberofSlides = jQuery('.item').length;
    var randomSlide = Math.floor((Math.random() * numberofSlides));
    var currentSlide = randomSlide;

    jQuery('.carousel-indicators li').each(function(){
      var $slideValue = jQuery(this).attr('data-slide-to');
      if (randomSlide == $slideValue) {
        jQuery(this).addClass('active');
        $item.eq($slideValue).addClass('active');
      } else {
        jQuery(this).removeClass('active');
        $item.eq($slideValue).removeClass('active');
      }
    });

    jQuery('#btn_carousel_indicators a').each(function(){
      var $slideValue = jQuery(this).attr('data-slide-to');
      // alert("currentSlide: "+$currentSlide+", slideValue: "+$slideValue)
      if (randomSlide == $slideValue) {
        jQuery(this).parent().addClass('active');
      } else {
        jQuery(this).parent().removeClass('active');
      }
    });

    jQuery('#myCarousel').bind('slid.bs.carousel', function (e) {
      jQuery('.carousel-indicators li').each(function(){
        if (jQuery(this).hasClass('active')) {
          currentSlide = jQuery(this).attr('data-slide-to');;
        }
      });

      jQuery('#btn_carousel_indicators li').removeClass('active');

      jQuery('#btn_carousel_indicators a').each(function(){
        var $slideValue = jQuery(this).attr('data-slide-to');
        // alert("currentSlide: "+currentSlide+", slideValue: "+$slideValue)
        if(currentSlide == $slideValue) {
          jQuery(this).parent().addClass('active');
        }
      });

    });

    // touch screen
       //     $("#myCarousel").swiperight(function() {
       	      //       $("#myCarousel").carousel('prev');
	      	       //     });
		       	      //
				// $("#myCarousel").swipeleft(function() {
				   //       $("#myCarousel").carousel('next');
				   	    //     });
       
    
    
    
  //progress bar
  var percent = 0,
      interval = 50,//time showing each slide
    $bar = jQuery('.transition-timer-carousel-progress-bar'),
    $crsl = jQuery('#myCarousel');

    $crsl.carousel({//initialize
      interval: false,
      pause: true
    }).on('slide.bs.carousel', function (){percent = 0;});//restart progress bar on new slide
    
    function progressBarCarousel() {
      $bar.css({width:percent+'%'});
	percent = percent +0.5;
  		if (percent>=100) {
  		   		  percent=0;
						$crsl.carousel('next');
							}
  							}
  							var barInterval = setInterval(progressBarCarousel, interval);//set interval to progressBarCarousel function
    if (!(/Mobi/.test(navigator.userAgent))) {//tests if it isn't mobile, progress bar stop on mouse over slide
      $crsl.hover(function(){
            clearInterval(barInterval);
          },
          function(){
            barInterval = setInterval(progressBarCarousel, interval);
          }
      );
    }
    
    
    
    
    jQuery(".ui-loading").css("display","none");
    jQuery(".ui-loader").css("display","none");
  });
</script>
<br/>
</center>

<br/>

<div class="container-fluid">

    



<div class="panel panel-default">
    <div class="panel-body">
        <div id="pagetitle"><h3 id="pagetitle_h3">New to the database?</h3></div>


        <center>
        <button class="btn btn-primary btn-block" id="guided_help_begin_button">Let us help!<br/>Click this button to begin our guided help.</button>
        </center>
    </div>
</div>

<div class="modal fade" id="guided_help_begin_dialog" name="guided_help_begin_dialog" tabindex="-1" role="dialog" aria-labelledby="guidedHelpBeginDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="guidedHelpBeginDialog">What are you interested in? <a href="https://solgenomics.github.io/sgn">For General Help</a></h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="well">
                                <div class="row">
                                    <div class="col-sm-3">
                                        <span style="font-size:2.5em;" class="glyphicon glyphicon-cloud-upload"></span>
                                    </div>
                                    <div class="col-sm-7">
                                        <h4>Upload an experimental field trial into the database that you have saved on your computer in Excel</h4>
                                    </div>
                                    <div class="col-sm-2">
                                        <button name="upload_trial_link" class="btn btn-primary btn-sm">Go</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="well">
                                <div class="row">
                                    <div class="col-sm-3">
                                        <span style="font-size:2.5em;" class="glyphicon glyphicon glyphicon-flash"></span>
                                    </div>
                                    <div class="col-sm-7">
                                        <h4>Design a completely new experimental field trial in the database</h4>
                                    </div>
                                    <div class="col-sm-2">
                                        <button id="add_project_link" class="btn btn-primary btn-sm">Go</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="well">
                                <div class="row">
                                    <div class="col-sm-3">
                                        <span style="font-size:2.5em;" class="glyphicon glyphicon-list-alt"></span>
                                    </div>
                                    <div class="col-sm-7">
                                        <h4>Catalog your available seed inventory into the database</h4>
                                    </div>
                                    <div class="col-sm-2">
                                        <button id="guided_help_seedlot_inventory_button" class="btn btn-primary btn-sm">Go</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="well">
                                <div class="row">
                                    <div class="col-sm-3">
                                        <span style="font-size:2.5em;" class="glyphicon glyphicon-book"></span>
                                    </div>
                                    <div class="col-sm-7">
                                        <h4>Upload phenotypic data into the database that you have saved on your computer in Excel</h4>
                                    </div>
                                    <div class="col-sm-2">
                                        <button id="guided_help_upload_phenotypes_button" class="btn btn-primary btn-sm">Go</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="well">
                                <div class="row">
                                    <div class="col-sm-3">
                                        <span style="font-size:2.5em;" class="glyphicon glyphicon-flag"></span>
                                    </div>
                                    <div class="col-sm-7">
                                        <h4>Plan tissue sampling</h4>
                                    </div>
                                    <div class="col-sm-2">
                                        <button name="tissue_sample_guided_help" class="btn btn-primary btn-sm">Go</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="well">
                                <div class="row">
                                    <div class="col-sm-3">
                                        <span style="font-size:2.5em;" class="glyphicon glyphicon-random"></span>
                                    </div>
                                    <div class="col-sm-7">
                                        <h4>Upload crosses and crossing information into the database</h4>
                                    </div>
                                    <div class="col-sm-2">
                                        <button name="upload_crosses_link" class="btn btn-primary btn-sm">Go</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="well">
                                <div class="row">
                                    <div class="col-sm-3">
                                        <span style="font-size:2.5em;" class="glyphicon glyphicon-tags"></span>
                                    </div>
                                    <div class="col-sm-7">
                                        <h4>Print barcode labels for my experiment (for your plots or plants or tissue samples in the field, or for your 96 well plate and tissue samples)</h4>
                                    </div>
                                    <div class="col-sm-2">
                                        <button id="guided_help_barcode_trial_button" class="btn btn-primary btn-sm">Go</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="well">
                                <div class="row">
                                    <div class="col-sm-3">
                                        <span style="font-size:2.5em;" class="glyphicon glyphicon-blackboard"></span>
                                    </div>
                                    <div class="col-sm-7">
                                        <h4>Analyze phenotypic performance across trials</h4>
                                    </div>
                                    <div class="col-sm-2">
                                        <button id="guided_help_trial_comparison_button" class="btn btn-primary btn-sm">Go</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="well">
                                <div class="row">
                                    <div class="col-sm-3">
                                        <span style="font-size:2.5em;" class="glyphicon glyphicon-th"></span>
                                    </div>
                                    <div class="col-sm-7">
                                        <h4>Prepare a 96 or 384 well plate for a genotyping experiment</h4>
                                    </div>
                                    <div class="col-sm-2">
                                        <button name="create_genotyping_trial_link" class="btn btn-primary btn-sm">Go</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="well">
                                <div class="row">
                                    <div class="col-sm-3">
                                        <span style="font-size:2.5em;" class="glyphicon glyphicon-map-marker"></span>
                                    </div>
                                    <div class="col-sm-7">
                                        <h4>Upload VCF genotypic data</h4>
                                    </div>
                                    <div class="col-sm-2">
                                        <button name="upload_genotyping_data_link" class="btn btn-primary btn-sm">Go</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button id="close_guided_help_begin_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>




<div class="modal fade" id="tissue_sample_help_dialog" name="tissue_sample_help_dialog" tabindex="-1" role="dialog" aria-labelledby="tissueSampleHelpDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="tissueSampleHelpDialog">Tissue Sampling</h4>
            </div>
            <div class="modal-body">

                <div class="container-fluid">

                    






<style media="screen">
  ol.workflow-prog{
    display: table;
    table-layout: fixed;
    list-style-type: none;
    text-align: center;
    margin: 0 0 1em 0;
    padding: 0;
    width: 100%;
    counter-reset: step;
    font-size: 16px;
  }
  
  ol.workflow-prog>li{
    display: table-cell;
    text-align: center;
    color: black;
    position: relative;
    font-size: 11px;
  }
  
  ol.workflow-prog>li>div.workflow-title{
    display: inline-block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  ol.workflow-prog>li::after{
    font-size: 14px;
    width: 30px;
    height: 30px;
    content: counter(step);
    counter-increment: step;
    line-height: 1em;
    padding-top: 0.3em;
    border: 4px solid;
    display: block;
    text-align: center;
    position: relative;
    border-radius: 50%;
    margin: 0 auto 0 auto;
    background: white;
    border-color: #bbb;
    color: #bbb;
  }
  
  ol.workflow-prog>li.workflow-complete::after{
    border-color: #5fba7d;
    color: white;
    background: #5fba7d;
  }
  
  @keyframes pend_blink {
    0% {}
    50% {
      border-color: white;
    }
    100% {}
  }
  
  ol.workflow-prog>li.workflow-pending::after{
    animation: pend_blink 2s linear infinite;
  }
  
  ol.workflow-prog>li.workflow-skipped::after{
    border-color: #eeb700;
    background: #eeb700;
    color: white;
  }
  
  ol.workflow-prog>li.workflow-focus::after{
    border-color: #5fba7d;
    background: white;
    color: #5fba7d;
  }
  
  
  ol.workflow-prog>li::before {
    width: 100%;
    height: 2px;
    content: '';
    display: block;
    position: relative;
    top: 34px;
    margin-left: 50%;
    background-color: #bbb;
  }
  
  ol.workflow-prog>li:last-of-type::before {
    width: 0%;
  }
  
  ol.workflow-prog>li.workflow-complete::before{
    background: #5fba7d;
  }
  
  ol.workflow-content{
    display: block;
    table-layout: fixed;
    list-style-type: none;
    margin: 0;
    padding: 0;
    width: 100%;
  }
  
  ol.workflow-content>li{
    width: 100%;
    position: relative;
    display: none;
  }
  
  ol.workflow-content>li.workflow-focus{
    display: block;
  }  
  
  div.workflow-pending-message{
    display: none;
  }
  div.workflow-complete-message{
    display: none;
  }
  div.workflow-message-show{
    display: block;
  }
  
</style>



                        
    

                        
    
                        
    
                        
    
                        
    
                        
  
                    
<div id="tissue_sample_help_workflow" class="workflow">
  <ol class="workflow-prog">
      <li><div class="workflow-title">Intro</div></li>
      <li><div class="workflow-title">Sampling Level</div></li>
      <li><div class="workflow-title">Select a field trial</div></li>
      <li><div class="workflow-title">Plant Entries</div></li>
      <li><div class="workflow-title">Create Tissue Sample Entries</div></li>
  </ol>
  <div class="panel panel-default">
    <div class="panel-body">
      <ol class="workflow-content">
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">This workflow will guide you through tissue sampling an experiment</h3></div>

                            <p>Tissue samples collected from the field are linked to a single plant, which is in turn linked to a single plot.</p>
                            <p>Many tissue samples can be created for each plant.</p>
                            <p>Each tissue sample has a globally unique name.</p>
                            <br/>
                            <p>A unique tissue sample is present in each well of a genotyping plate (96 or 384 well plates).</p>
                            <p>The tissue sample in a 96 well plate can originate from another tissue sample name, plant name, plot name, or accession name.</p>

                            <br/><br/>
                            <center>
                            <button class="btn btn-primary" onclick="Workflow.complete(this); return false;">Go to Next Step</button>
                            </center>
                        </li>
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">At which level do you plan to keep track of your sampling?</h3></div>


                            <input type="radio" name="tissue_sample_help_select_level" value="accession">&nbsp;&nbsp;&nbsp;Accession Level: The sample is not from a field trial entity and only the accession name is known.<br/>
                            <input type="radio" name="tissue_sample_help_select_level" value="plot">&nbsp;&nbsp;&nbsp;Plot Level: Each plot in the field has a unique identifier, ideally with a barcode label.<br/>
                            <input type="radio" name="tissue_sample_help_select_level" value="plant">&nbsp;&nbsp;&nbsp;Plant Level: Each plant in the field has a unique identifier, ideally with a barcode label.<br/>
                            <input type="radio" name="tissue_sample_help_select_level" value="tissue_sample">&nbsp;&nbsp;&nbsp;Tissue Sample Level: Each tissue sample collected from the field has a unique identifier, ideally with a barcode label.

                            <br/><br/>
                            <center>
                                <button class="btn btn-primary" id="tissue_sample_help_select_level_submit">Go to Next Step</button>
                            </center>
                        </li>
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">Select a field trial</h3></div>


                            <div id="tissue_sample_help_trial_select_not_relevant" style="display:none">
                                <h4>Field trial is not relevant for the type of tissue sampling you selected. Go to next step.</h4>
                                <center>
                                <button class="btn btn-primary" onclick="Workflow.complete(this); return false;">Go to Next Step</button>
                                </center>
                            </div>
                            <div id="tissue_sample_help_trial_select_relevant" style="display:none">
                                <div class="well well-sm">
                                    <div class="panel panel-default">
                                        <div class="panel-body">
                                            <table id="tissue_sample_help_field_search_results" class="table table-hover table-striped">
                                                <thead>
                                                    <tr>
                                                        <th>Select</th>
                                                        <th>Trial name</th>
                                                        <th>Description</th>
                                                        <th>Breeding program</th>
                                                        <th>Folder</th>
                                                        <th>Year</th>
                                                        <th>Location</th>
                                                        <th>Trial type</th>
                                                        <th>Design</th>
                                                        <th>Planting Date</th>
                                                        <th>Harvest Date</th>
                                                        <th>Download</th>
                                                    </tr>
                                                </thead>
                                            </table>
                                        </div>
                                    </div>
                                </div>

                                <br/><br/>
                                <center>
                                    <button class="btn btn-primary" id="tissue_sample_help_select_trial_submit">Go to Next Step</button>
                                </center>
                            </div>

                        </li>
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">Plant entries in your field trial</h3></div>


                            <div id="tissue_sample_help_plant_entries_not_relevant" style="display:none">
                                <h4>Plant entries not relevant for the type of tissue sampling you selected. Go to next step.</h4>
                                <center>
                                <button class="btn btn-primary" onclick="Workflow.complete(this); return false;">Go to Next Step</button>
                                </center>
                            </div>
                            <div id="tissue_sample_help_plant_entries_exist_section" style="display:none">
                                <h4>Plant entries exist for this trial. Go to next step.</h4>
                                <center>
                                <button class="btn btn-primary" onclick="Workflow.complete(this); return false;">Go to Next Step</button>
                                </center>
                            </div>
                            <div id="tissue_sample_help_plant_entries_dont_exist_section" style="display:none">
                                <h4>Please create plant entries for this trial.</h4>
                                <form class="form-horizontal">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">Number of plants per plot: </label>
                                        <div class="col-sm-9" >
                                            <input name="tissue_sample_help_plants_per_plot_num" id="tissue_sample_help_plants_per_plot_num" class="form-control" type="number" autofocus/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">Inherits Management Factor(s) From Plots: </label>
                                        <div class="col-sm-9" >
                                            <input name="tissue_sample_help_plants_per_plot_inherit_treatments" id="tissue_sample_help_plants_per_plot_inherit_treatments" type="checkbox" checked disabled/>
                                        </div>
                                    </div>
                                </form><br/>
                                <center>
                                    <button type="button" class="btn btn-primary" id="tissue_sample_help_plants_per_plot_submit">Submit</button>
                                </center>
                            </div>

                        </li>
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">Create tissue sample entries for this trial</h3></div>


                            <div id="tissue_sample_help_tissue_samples_not_relevant" style="display:none">
                                <h4>Field trial tissue sample entries not relevant for the type of tissue sampling you selected. Go to next step.</h4>
                                <center>
                                <button class="btn btn-primary" onclick="Workflow.complete(this); return false;">Go to Next Step</button>
                                </center>
                            </div>
                            <div id="tissue_sample_help_tissue_samples_exist_section" style="display:none">
                                <h4>Tissue sample entries exist for this trial. Go to next step.</h4>
                                <center>
                                <button class="btn btn-primary" onclick="Workflow.complete(this); return false;">Go to Next Step</button>
                                </center>
                            </div>
                            <div id="tissue_sample_help_tissue_samples_relevant" style="display:none">
                                <form class="form-horizontal" >
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label"><span title="You can use the same tissue name, e.g. root and root, more than once below. The tissue name will still be unique because of a tissue index e.g. 1 and 2 added to the end." </span><span class="glyphicon glyphicon-info-sign"></span>&nbsp;&nbsp;Number of tissue samples per plant: </span></label>
                                        <div class="col-sm-9" >
                                            <input name="tissue_sample_help_tissue_samples_per_plant_num" id="tissue_sample_help_tissue_samples_per_plant_num" class="form-control" type="number" autofocus/>
                                        </div>
                                    </div>

                                    <div id="tissue_sample_help_tissue_samples_names_div">
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">Inherits Management Factor(s) From Plots: </label>
                                        <div class="col-sm-9" >
                                            <input name="tissue_sample_help_per_plant_inherit_treatments" id="tissue_sample_help_per_plant_inherit_treatments" type="checkbox" checked disabled/>
                                        </div>
                                    </div>
                                </form><br/>

                                <center>
                                <button type="button" class="btn btn-primary" name="tissue_sample_help_per_plant_submit" id="tissue_sample_help_per_plant_submit">Submit</button>
                                </center>
                            </div>
                        </li>
      </ol>
      <div class="workflow-pending-message">
                            <div id="pagetitle"><h3 id="pagetitle_h3">Complete! You have all the entities you need to conduct your sampling.</h3></div>

                            <ul>
                                <li>All of the entities that you want to sample are saved in the database and available to use!</li>
                                <li>You can print barcodes for the entities you intend to sample on. These barcodes can be attached to your collection vials/containers to assist during sampling.</li>
                            </ul>
                            <center>
                                <button class="btn btn-primary" onclick="final_download_layout_button_click()">Download Field Trial Layout!</button>
                            </center>
                            <br/>

                            <ul>
                                <li>After you have finished sampling, you can use these entities as source material for a genotyping plate (96 or 384 well plate). Click the button below to create a genotyping plate now, if you will create a 96 or 384 well plate.</li>
                                <li>The Android Coordinate application can help you create 96 or 384 well plates. Alternatively you can create your plate layout in Excel and upload it.</li>
                            </ul>
                            <center>
                                <button class="btn btn-primary" name="create_genotyping_trial_link">Create Genotyping Plate Now!</button>
                            </center>
                        </div>
      <div class="workflow-complete-message">
                            <div id="pagetitle"><h3 id="pagetitle_h3">Complete! You have all the entities you need to conduct your sampling.</h3></div>

                            <ul>
                                <li>All of the entities that you want to sample are saved in the database and available to use!</li>
                                <li>You can print barcodes for the entities you intend to sample on. These barcodes can be attached to your collection vials/containers to assist during sampling.</li>
                            </ul>
                            <center>
                                <button class="btn btn-primary" onclick="final_download_layout_button_click()">Download Field Trial Layout!</button>
                            </center>
                            <br/>

                            <ul>
                                <li>After you have finished sampling, you can use these entities as source material for a genotyping plate (96 or 384 well plate). Click the button below to create a genotyping plate now, if you will create a 96 or 384 well plate.</li>
                                <li>The Android Coordinate application can help you create 96 or 384 well plates. Alternatively you can create your plate layout in Excel and upload it.</li>
                            </ul>
                            <center>
                                <button class="btn btn-primary" name="create_genotyping_trial_link">Create Genotyping Plate Now!</button>
                            </center>
                        </div>
    </div>
  </div>
</div>
<script type="text/javascript">
  Workflow.init("#tissue_sample_help_workflow");
</script>


                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<script>

var selected_level;
var selected;

jQuery(document).ready(function(){

    jQuery('button[name="tissue_sample_guided_help"]').click(function(){
        jQuery('#tissue_sample_help_dialog').modal('show');
    });

    var tissue_sample_help_trial_table = jQuery('#tissue_sample_help_field_search_results').DataTable( {
        'ajax': {
            'url':'/ajax/search/trials',
            'data': function(d) {
                d.select_checkbox_name = 'tissue_sample_help_select_trial_checkbox';
            }
        },
        "scrollX": true
    });

    jQuery('#tissue_sample_help_select_level_submit').click(function(){
        selected_level = jQuery('input[name="tissue_sample_help_select_level"]:checked').val();
        if (selected_level == '' || !selected_level){
            alert('Please select one');
        } else {
            Workflow.complete('#tissue_sample_help_select_level_submit');
            if (selected_level == 'accession'){
                jQuery('#tissue_sample_help_plant_entries_not_relevant').show();
                jQuery('#tissue_sample_help_plant_entries_exist_section').hide();
                jQuery('#tissue_sample_help_plant_entries_dont_exist_section').hide();
                jQuery('#tissue_sample_help_trial_select_not_relevant').show();
                jQuery('#tissue_sample_help_trial_select_relevant').hide();
                jQuery('#tissue_sample_help_tissue_samples_not_relevant').show();
                jQuery('#tissue_sample_help_tissue_samples_relevant').hide();
                Workflow.skip('#tissue_sample_help_select_trial_submit');
                Workflow.skip('#tissue_sample_help_plants_per_plot_submit');
                Workflow.skip('#tissue_sample_help_per_plant_submit');
                Workflow.focus("#tissue_sample_help_workflow", -1);
            } else {
                jQuery('#tissue_sample_help_plant_entries_not_relevant').hide();
                jQuery('#tissue_sample_help_plant_entries_exist_section').hide();
                jQuery('#tissue_sample_help_plant_entries_dont_exist_section').hide();
                jQuery('#tissue_sample_help_trial_select_not_relevant').hide();
                jQuery('#tissue_sample_help_trial_select_relevant').show();
                jQuery('#tissue_sample_help_tissue_samples_not_relevant').hide();
                jQuery('#tissue_sample_help_tissue_samples_relevant').hide();
                jQuery('#tissue_sample_help_tissue_samples_exist_section').hide();
                Workflow.focus("#tissue_sample_help_workflow", 2);
            }
        }
    });

    jQuery('#tissue_sample_help_select_trial_submit').click(function(){
        selected = [];
        jQuery('input[name="tissue_sample_help_select_trial_checkbox"]:checked').each(function() {
            selected.push(jQuery(this).val());
        });
        selected_level = jQuery('input[name="tissue_sample_help_select_level"]:checked').val();
        if (selected.length !== 1){
            alert('Only select one trial!');
        } else {
            Workflow.complete('#tissue_sample_help_select_trial_submit');
            if (selected_level == 'plot'){
                jQuery('#tissue_sample_help_plant_entries_not_relevant').show();
                jQuery('#tissue_sample_help_plant_entries_exist_section').hide();
                jQuery('#tissue_sample_help_plant_entries_dont_exist_section').hide();
                jQuery('#tissue_sample_help_tissue_samples_not_relevant').show();
                jQuery('#tissue_sample_help_tissue_samples_relevant').hide();
                Workflow.skip('#tissue_sample_help_plants_per_plot_submit');
                Workflow.skip('#tissue_sample_help_per_plant_submit');
                Workflow.focus("#tissue_sample_help_workflow", -1);
            } else {
                new jQuery.ajax({
                    type: 'POST',
                    url: '/ajax/breeders/trial/'+selected[0]+'/has_plants',
                    dataType: "json",
                    beforeSend: function() {
                        jQuery("#working_modal").modal("show");
                    },
                    success: function (response) {
                        jQuery("#working_modal").modal("hide");
                        if (response.has_plants){
                            jQuery('#tissue_sample_help_plant_entries_exist_section').show();
                            jQuery('#tissue_sample_help_plant_entries_dont_exist_section').hide();
                            Workflow.complete('#tissue_sample_help_select_trial_submit');
                            Workflow.skip('#tissue_sample_help_plant_entries_exist_section');
                            if (selected_level == 'plant'){
                                jQuery('#tissue_sample_help_tissue_samples_not_relevant').show();
                                jQuery('#tissue_sample_help_tissue_samples_relevant').hide();
                                Workflow.skip('#tissue_sample_help_per_plant_submit');
                                Workflow.focus("#tissue_sample_help_workflow", -1);
                            } else {
                                new jQuery.ajax({
                                    type: 'POST',
                                    url: '/ajax/breeders/trial/'+selected[0]+'/has_tissue_samples',
                                    dataType: "json",
                                    beforeSend: function() {
                                        jQuery("#working_modal").modal("show");
                                    },
                                    success: function (response) {
                                        jQuery("#working_modal").modal("hide");
                                        if (response.has_tissue_samples){
                                            jQuery('#tissue_sample_help_tissue_samples_not_relevant').hide();
                                            jQuery('#tissue_sample_help_tissue_samples_relevant').hide();
                                            jQuery('#tissue_sample_help_tissue_samples_exist_section').show();
                                            Workflow.skip('#tissue_sample_help_per_plant_submit');
                                            Workflow.focus("#tissue_sample_help_workflow", -1);
                                        } else {
                                            jQuery('#tissue_sample_help_tissue_samples_not_relevant').hide();
                                            jQuery('#tissue_sample_help_tissue_samples_relevant').show();
                                            jQuery('#tissue_sample_help_tissue_samples_exist_section').hide();
                                            Workflow.focus("#tissue_sample_help_workflow", 4);
                                        }
                                    },
                                    error: function () {
                                        jQuery("#working_modal").modal("hide");
                                        alert('An error occurred checking trial for tissue samples.');
                                    }
                                });
                            }
                        } else {
                            jQuery('#tissue_sample_help_plant_entries_dont_exist_section').show();
                            jQuery('#tissue_sample_help_plant_entries_exist_section').hide();
                            Workflow.complete('#tissue_sample_help_select_trial_submit');
                            Workflow.focus("#tissue_sample_help_workflow", 3);
                        }
                    },
                    error: function () {
                        jQuery("#working_modal").modal("hide");
                        alert('An error occurred checking trial for plants.');
                    }
                });
            }
        }
    });


    jQuery('#tissue_sample_help_plants_per_plot_submit').click(function(){
        var is_checked;
        if(jQuery('#tissue_sample_help_plants_per_plot_inherit_treatments').is(":checked")){
            is_checked = 1;
        }

        jQuery.ajax({
            url: '/ajax/breeders/trial/'+selected[0]+'/create_plant_entries/',
            type: 'POST',
            beforeSend: function() {
                jQuery("#working_modal").modal("show");
            },
            data: {
                'plants_per_plot' : jQuery('#tissue_sample_help_plants_per_plot_num').val(),
                'inherits_plot_treatments' : is_checked
            },
            success: function(response) {
                jQuery("#working_modal").modal("hide");
                if (response.error) {
                    alert(response.error);
                }
                else {
                    alert("Successfully created plant entries.");
                    Workflow.complete('#tissue_sample_help_plants_per_plot_submit');
                    if (selected_level == 'plant'){
                        jQuery('#tissue_sample_help_tissue_samples_not_relevant').show();
                        jQuery('#tissue_sample_help_tissue_samples_relevant').hide();
                        Workflow.skip('#tissue_sample_help_per_plant_submit');
                        Workflow.focus("#tissue_sample_help_workflow", -1);
                    } else {
                        new jQuery.ajax({
                            type: 'POST',
                            url: '/ajax/breeders/trial/'+selected[0]+'/has_tissue_samples',
                            dataType: "json",
                            beforeSend: function() {
                                jQuery("#working_modal").modal("show");
                            },
                            success: function (response) {
                                jQuery("#working_modal").modal("hide");
                                if (response.has_tissue_samples){
                                    jQuery('#tissue_sample_help_tissue_samples_not_relevant').hide();
                                    jQuery('#tissue_sample_help_tissue_samples_relevant').hide();
                                    jQuery('#tissue_sample_help_tissue_samples_exist_section').show();
                                    Workflow.skip('#tissue_sample_help_per_plant_submit');
                                    Workflow.focus("#tissue_sample_help_workflow", -1);
                                } else {
                                    jQuery('#tissue_sample_help_tissue_samples_not_relevant').hide();
                                    jQuery('#tissue_sample_help_tissue_samples_relevant').show();
                                    jQuery('#tissue_sample_help_tissue_samples_exist_section').hide();
                                    Workflow.focus("#tissue_sample_help_workflow", 4);
                                }
                            },
                            error: function () {
                                jQuery("#working_modal").modal("hide");
                                alert('An error occurred checking trial for tissue samples.');
                            }
                        });
                    }
                }
            },
            error: function(response) {
                jQuery("#working_modal").modal("hide");
                alert("An error occurred saving plant entries");
            },
        });
    });

    jQuery('#tissue_sample_help_tissue_samples_per_plant_num').keyup(function(){
        var num_tissues = jQuery(this).val();
        var html = '';
        for (var i=1; i<=num_tissues; i++){
            html = html + '<div class="form-group"><label class="col-sm-3 control-label"><span title="The sample names will be a combination of the plant name, the tissue name you give here, and the tissue number."><span class="glyphicon glyphicon-info-sign"></span>&nbsp;&nbsp;Tissue Name '+i+': </span></label><div class="col-sm-9" ><input name="tissue_sample_help_tissue_name" id="tissue_samples_help_tissue_name_'+i+'" class="form-control" type="text" placeholder="examples: leaf, root, stem, seed, fruit or tuber" /></div></div>';
        }
        jQuery('#tissue_sample_help_tissue_samples_names_div').html(html);
    });

    jQuery('#tissue_sample_help_per_plant_submit').click(function(){
        var is_checked;
        if(jQuery('#tissue_sample_help_per_plant_inherit_treatments').is(":checked")){
            is_checked = 1;
        }

        var tissue_names = [];
        jQuery('input[name="tissue_sample_help_tissue_name"]').each(function() {
            tissue_names.push(this.value);
        });

        jQuery.ajax({
            url: '/ajax/breeders/trial/'+selected[0]+'/create_tissue_samples/',
            type: 'POST',
            beforeSend: function() {
                jQuery("#working_modal").modal("show");
            },
            data: {
                'tissue_samples_per_plant' : jQuery('#tissue_sample_help_tissue_samples_per_plant_num').val(),
                'inherits_plot_treatments' : is_checked,
                'tissue_samples_names' : JSON.stringify(tissue_names)
            },
            success: function(response) {
                jQuery("#working_modal").modal("hide");
                if (response.error) {
                    alert(response.error);
                }
                else {
                    alert("Successfully created tissue sample entries.");
                    Workflow.complete('#tissue_sample_help_per_plant_submit');
                    Workflow.focus("#tissue_sample_help_workflow", -1); //go to success
                }
            },
            error: function(response) {
                jQuery("#working_modal").modal("hide");
                alert("An error occurred creating tissue sample entries");
            },
        });
    });

});

function final_download_layout_button_click(){
    if (selected_level == 'accession'){
        alert('You selected to sample on the accession level, meaning that you wil not sample from a field trial. In this case there is no field layout to download!');
    }
    if (selected_level == 'plot'){
        var selected_columns = {'plot_name':1,'plot_id':1,'block_number':1,'plot_number':1,'rep_number':1,'row_number':1,'col_number':1,'accession_name':1,'is_a_control':1};
        var selected_columns_json = JSON.stringify(selected_columns);
        window.open("/breeders/trial/"+selected[0]+"/download/layout?format=csv&dataLevel=plots&selected_columns="+selected_columns_json);
    }
    if (selected_level == 'plant'){
        var selected_columns = {'plant_name':1,'plant_id':1,'plot_name':1,'block_number':1,'plant_number':1,'plot_number':1,'rep_number':1,'row_number':1,'col_number':1,'accession_name':1,'is_a_control':1};
        var selected_columns_json = JSON.stringify(selected_columns);
        window.open("/breeders/trial/"+selected[0]+"/download/layout?format=csv&dataLevel=plants&selected_columns="+selected_columns_json);
    }
    if (selected_level == 'tissue_sample'){
        var selected_columns = {'tissue_sample_name':1,'tissue_sample_id':1,'plant_name':1,'plot_name':1,'block_number':1,'plant_number':1,'plot_number':1,'rep_number':1,'row_number':1,'col_number':1,'accession_name':1,'is_a_control':1};
        var selected_columns_json = JSON.stringify(selected_columns);
        window.open("/breeders/trial/"+selected[0]+"/download/layout?format=csv&dataLevel=field_trial_tissue_samples&selected_columns="+selected_columns_json);
    }
}

</script>





<div class="modal fade" id="guided_help_seedlot_inventory_dialog" name="guided_help_seedlot_inventory_dialog" tabindex="-1" role="dialog" aria-labelledby="guidedHelpSeedlotInventoryDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="guidedHelpSeedlotInventoryDialog">Workflow for seedlot inventory</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-sm-6">
                            <div class="well">
                                <div class="row">
                                    <div class="col-sm-3">
                                        <span style="font-size:2.5em;" class="glyphicon glyphicon-plus"></span>
                                    </div>
                                    <div class="col-sm-7">
                                        <h4>I have new seedlots that need to be added into the database.</h4>
                                    </div>
                                    <div class="col-sm-2">
                                        <button name="seedlot_bulk_upload" class="btn btn-primary btn-sm">Go</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <div class="well">
                                <div class="row">
                                    <div class="col-sm-3">
                                        <span style="font-size:2.5em;" class="glyphicon glyphicon-scale"></span>
                                    </div>
                                    <div class="col-sm-7">
                                        <h4>I conducted an inventory (in weight(g)) and want to update the database to reflect the current state of the inventory.</h4>
                                    </div>
                                    <div class="col-sm-2">
                                        <button name="seedlot_upload_inventory" class="btn btn-primary btn-sm">Go</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button id="close_guided_help_seedlot_inventory_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>






<div class="modal fade" id="guided_help_upload_phenotypes_dialog" name="guided_help_upload_phenotypes_dialog" tabindex="-1" role="dialog" aria-labelledby="guidedHelpUploadPhenotypesDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="guidedHelpUploadPhenotypesDialog">Workflow for uploading phenotypes</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                Nothing Here Yet<br/>
                Please refer to the <a href="https://solgenomics.github.io/sgn">Documentation</a>
                </div>
            </div>
            <div class="modal-footer">
                <button id="close_guided_help_phenotype_upload_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>






<div class="modal fade" id="guided_help_trial_barcoding_dialog" name="guided_help_trial_barcoding_dialog" tabindex="-1" role="dialog" aria-labelledby="guidedHelpTrialBarcodingDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="guidedHelpTrialBarcodingDialog">Workflow for trial barcoding</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                Nothing Here Yet<br/>
                Please refer to the <a href="https://solgenomics.github.io/sgn">Documentation</a>
                </div>
            </div>
            <div class="modal-footer">
                <button id="close_guided_help_trial_barcoding_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>






<div class="modal fade" id="guided_help_trial_comparison_dialog" name="guided_help_trial_comparison_dialog" tabindex="-1" role="dialog" aria-labelledby="guidedHelpTrialComparisonDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="guidedHelpTrialComparisonDialog">Workflow for comparing one or many trials</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                Nothing Here Yet<br/>
                Please refer to the <a href="https://solgenomics.github.io/sgn">Documentation</a>
                </div>
            </div>
            <div class="modal-footer">
                <button id="close_guided_help_trial_comparison_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>








<div class="modal fade" id="upload_trial_dialog" name="upload_trial_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadTrialDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="uploadTrialDialog">Upload Existing Trial(s)</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">

                    <!-- <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" encoding="multipart/form-data" id="upload_trial_form" name="upload_trial_form"> -->

                        









                            
    
                            
    

                            
    
                            
    

                            
    
                            
    
                            
    
                            
  
                        
<div id="trial_upload_workflow" class="workflow">
  <ol class="workflow-prog">
      <li><div class="workflow-title">Intro</div></li>
      <li><div class="workflow-title">File Formatting</div></li>
      <li><div class="workflow-title">Enter trial information</div></li>
      <li><div class="workflow-title">Trial Linkage</div></li>
      <li><div class="workflow-title">Fix missing accessions problem</div></li>
      <li><div class="workflow-title">Fix missing seedlots problem</div></li>
      <li><div class="workflow-title">Try submitting trial again</div></li>
  </ol>
  <div class="panel panel-default">
    <div class="panel-body">
      <ol class="workflow-content">
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">This workflow will guide you through uploading a new trial or trials into the database</h3></div>

                                <p>A field trial represents plots in the field where each plot has a globally unique <i>plot_name</i>, a sequential <i>plot_number</i> that is unique in the trial (e.g. 101, 102, 103 for three separate plots), and an <i>accession_name</i> representing the genotype being tested in that plot. In cases where a cross/family is being evaluated (e.g. F1 hybrid, backcrossing), a <i>cross_unique_id</i> or a <i>family_name</i> can be used instead of an accession_name. Each plot can belong to different blocks (<i>block_number</i>) and reps (<i>rep_number</i>) depending on the experimental design you are using (e.g. complete block vs augmented design). Each plot can have a <i>row_number</i> and <i>col_number</i> indicating the relative position of the plot in the field.</p>
                                <p>If a specific accession is a check or control, you can indicate the plots that that accession is planted in as controls using <i>is_a_control</i>.</p>
                                <p>You can provide the specific <i>seedlot_name</i> planted in each plot, along with the number of seeds (<i>num_seed_per_plot</i>) and/or the weight (g) of seed (<i>weight_gram_seed_per_plot</i>) that were used.</p>
                                <p>A trial can represent a yield trial, a phenotyping trial, a crossing block, a greenhouse, a nursery, etc.</p>
                                <p>A plot can have many plants, which the database can track as separate entities, allowing you to record plant level observations and information.</p>
                                <br/><br/>
                                <center>
                                <button id="next_step_upload_intro_button" class="btn btn-primary" onclick="Workflow.complete(this); return false;">Go to Next Step</button>
                                </center>
                            </li>
          <li>
                                <ul class="nav nav-pills nav-justified" id="upload_trial_designs_tab_select">
                                    <li class="active" id="upload_single_trial_design_tab"><a data-toggle="tab" href="#single_tab">Single Trial Design</a></li>
                                    <li id="upload_multiple_trial_designs_tab"><a data-toggle="tab" href="#multiple_tab">Multiple Trial Designs</a></li>
                                </ul>
                                <div class="tab-content">

                                    <div id="single_tab" class="tab-pane fade in active">
                                        <hr>
                                        <center>
                                            <table style="border: 1px solid gray; padding: 1em 2em; margin: 25px 15px; background: #f3f3ff;">
  <tr>
    <td>
      <img src="/documents/img/info_icon.png" border="0" style="margin: 10px; vertical-align: middle" />
    </td>
    <td style="padding-top: 0.35em; padding-right:0.35em; vertical-align: middle">

                                                <p>
                                                    <b>File format information</b>
                                                    <br>
                                                    <a id="upload_single_trial_design_format_info">Single trial spreadsheet</a>
                                                </p>
                                            
     </td>
  </tr>
</table>

                                            <button id="next_step_file_formatting_button" class="btn btn-primary" onclick="Workflow.complete(this); return false;">Go to Next Step</button>
                                        </center>
                                    </div>

                                    <div id="multiple_tab" class="tab-pane fade">
                                        <hr>
                                        <center>
                                            <table style="border: 1px solid gray; padding: 1em 2em; margin: 25px 15px; background: #f3f3ff;">
  <tr>
    <td>
      <img src="/documents/img/info_icon.png" border="0" style="margin: 10px; vertical-align: middle" />
    </td>
    <td style="padding-top: 0.35em; padding-right:0.35em; vertical-align: middle">

                                                <p>
                                                    <b>File format information</b>
                                                    <br>
                                                    <a id="upload_multiple_trial_designs_format_info">Multiple trial spreadsheet</a>
                                                </p>
                                            
     </td>
  </tr>
</table>

                                            <br>

                                            <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" encoding="multipart/form-data" id="upload_multiple_trial_designs_form" name="upload_multiple_trial_designs_form">
                                              <div class="form-group">
                                                  <input type="file" name="multiple_trial_designs_upload_file" id="multiple_trial_designs_upload_file" encoding="multipart/form-data" />
                                              </div>
                                              <div class="form-group">
                                                  <div class="col-sm-4"></div>
                                                  <label class="col-sm-2 control-label">Ignore Warnings: </label>
                                                  <div class="col-sm-2" >
                                                      <input id="upload_multiple_trials_ignore_warnings" name="upload_multiple_trials_ignore_warnings" type="checkbox" data-toggle="toggle" encoding="multipart/form-data">
                                                  </div>
                                                  <div class="col-sm-4"></div>
                                              </div>
                                            </form>

                                            <div style="display:none" id="upload_multiple_trials_warning_messages" class="alert-warning" role="alert">
                                            </div>
                                            <div style="display:none" id="upload_multiple_trials_error_messages" class="alert-danger" role="alert">
                                            </div>
                                            <div style="display:none" id="upload_multiple_trials_success_messages" class="alert-success" role="alert">
                                            </div>

                                            <br>
                                            <button type="button" class="btn btn-primary" id="multiple_trial_designs_upload_submit" disabled>Upload Trial Designs</button>
                                            <button style="display:none" class="btn btn-primary" id="upload_multiple_trials_success_button">Reload Page</button>
                                        </center>
                                    </div>

                                </div>
                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Enter information about the experiment and upload your trial layout</h3></div>

                              <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" encoding="multipart/form-data" id="upload_trial_form" name="upload_trial_form">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Trial Name: </label>
                                    <div class="col-sm-9" >
                                        <input type="text" class="form-control" id="trial_upload_name" name="trial_upload_name" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Breeding Program: </label>
                                    <div class="col-sm-9">
                                        <select class="form-control" id="trial_upload_breeding_program" name="trial_upload_breeding_program">
                                            <option value='ABC-International'>ABC-International</option><option value='BiovInt'>BiovInt</option><option value='CIAT'>CIAT</option><option value='ICAR_NRCB'>ICAR_NRCB</option><option value='IITA'>IITA</option><option value='NARITA'>NARITA</option><option value='NARO'>NARO</option><option value='NIHORT'>NIHORT</option>                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Location: </label>
                                    <div class="col-sm-9" >
                                        <select class="form-control" id="trial_upload_location" name="trial_upload_location">
                                        <option value="Cornell Biotech" data-program="">Cornell Biotech</option><option value="Sendusu" data-program="IITA & ABC-International & BiovInt">Sendusu</option><option value="Mbarara" data-program="BiovInt & ABC-International">Mbarara</option><option value="mitalula" data-program="BiovInt & ABC-International">mitalula</option><option value="Kawanda" data-program="ABC-International & BiovInt & NARO">Kawanda</option><option value="Maruku" data-program="ABC-International & BiovInt">Maruku</option><option value="Lyamungo-TaCRI" data-program="BiovInt & ABC-International">Lyamungo-TaCRI</option><option value="Ibadan" data-program="IITA">Ibadan</option><option value="Onne" data-program="IITA">Onne</option><option value="Arusha" data-program="IITA">Arusha</option><option value="Hoima" data-program="NARITA & NARO">Hoima</option><option value="[Computation]" data-program="">[Computation]</option><option value="Ibadan-onsite" data-program="">Ibadan-onsite</option>                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Trial Type: </label>
                                    <div class="col-sm-9">
                                        <select class="form-control" id="trial_upload_trial_type" name="trial_upload_trial_type" type="text">
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Year: </label>
                                    <div class="col-sm-9" >
                                        <select class="form-control" id="trial_upload_year" name="trial_upload_year"></select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Planting Date (MM-DD-YYYY): </label>
                                    <div class="col-sm-9" >
                                        <input class="form-control" id="trial_upload_planting_date" name="trial_upload_planting_date" type="text" value="" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Transplanting Date(MM-DD-YYYY): </label>
                                    <div class="col-sm-9" >
                                        <input class="form-control" id="trial_upload_transplanting_date " name="trial_upload_transplanting_date" type="text" value="" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Plot Width (m): </label>
                                    <div class="col-sm-9">
                                        <input type="text" class="form-control" id="trial_upload_plot_width" name="trial_upload_plot_width" />
                                        <!-- <select class="form-control" id="trial_upload_plot_width" name="trial_upload_plot_width">
                                            <option value="">NA</option>
                                            <option value="0.1">0.1</option>
                                            <option value="0.15">0.15</option>
                                            <option value="0.2">0.2</option>
                                            <option value="0.25">0.25</option>
                                            <option value="0.3">0.3</option>
                                            <option value="0.35">0.35</option>
                                            <option value="0.4">0.4</option>
                                            <option value="0.45">0.45</option>
                                            <option value="0.5">0.5</option>
                                            <option value="0.55">0.55</option>
                                            <option value="0.6">0.6</option>
                                            <option value="0.65">0.65</option>
                                            <option value="0.7">0.7</option>
                                            <option value="0.75">0.75</option>
                                            <option value="0.8">0.8</option>
                                            <option value="0.85">0.85</option>
                                            <option value="0.9">0.9</option>
                                            <option value="0.95">0.95</option>
                                            <option value="1">1</option>
                                            <option value="1.5">1.5</option>
                                            <option value="2">2</option>
                                            <option value="2.5">2.5</option>
                                            <option value="3">3</option>
                                            <option value="3.5">3.5</option>
                                            <option value="4">4</option>
                                            <option value="4.5">4.5</option>
                                            <option value="5">5</option>
                                            <option value="5.5">5.5</option>
                                            <option value="6">6</option>
                                            <option value="6.5">6.5</option>
                                            <option value="7">7</option>
                                            <option value="7.5">7.5</option>
                                            <option value="8">8</option>
                                            <option value="8.5">8.5</option>
                                            <option value="9">9</option>
                                            <option value="9.5">9.5</option>
                                            <option value="10">10</option>
                                            <option value="10.5">10.5</option>
                                            <option value="11">11.0</option>
                                            <option value="11.5">11.5</option>
                                            <option value="12">12.0</option>
                                            <option value="12.5">12.5</option>
                                        </select> -->
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Plot Length (m): </label>
                                    <div class="col-sm-9">
                                        <input type="text" class="form-control" id="trial_upload_plot_length" name="trial_upload_plot_length" />
                                        <!-- <select class="form-control" id="trial_upload_plot_length" name="trial_upload_plot_length">
                                            <option value="">NA</option>
                                            <option value="0.1">0.1</option>
                                            <option value="0.15">0.15</option>
                                            <option value="0.2">0.2</option>
                                            <option value="0.25">0.25</option>
                                            <option value="0.3">0.3</option>
                                            <option value="0.35">0.35</option>
                                            <option value="0.4">0.4</option>
                                            <option value="0.45">0.45</option>
                                            <option value="0.5">0.5</option>
                                            <option value="0.55">0.55</option>
                                            <option value="0.6">0.6</option>
                                            <option value="0.65">0.65</option>
                                            <option value="0.7">0.7</option>
                                            <option value="0.75">0.75</option>
                                            <option value="0.8">0.8</option>
                                            <option value="0.85">0.85</option>
                                            <option value="0.9">0.9</option>
                                            <option value="0.95">0.95</option>
                                            <option value="1">1</option>
                                            <option value="1.5">1.5</option>
                                            <option value="2">2</option>
                                            <option value="2.5">2.5</option>
                                            <option value="3">3</option>
                                            <option value="3.5">3.5</option>
                                            <option value="4">4</option>
                                            <option value="4.5">4.5</option>
                                            <option value="5">5</option>
                                            <option value="5.5">5.5</option>
                                            <option value="6">6</option>
                                            <option value="6.5">6.5</option>
                                            <option value="7">7</option>
                                            <option value="7.5">7.5</option>
                                            <option value="8">8</option>
                                            <option value="8.5">8.5</option>
                                            <option value="9">9</option>
                                            <option value="9.5">9.5</option>
                                            <option value="10">10</option>
                                            <option value="10.5">10.5</option>
                                            <option value="11">11.0</option>
                                            <option value="11.5">11.5</option>
                                            <option value="12">12.0</option>
                                            <option value="12.5">12.5</option>
                                        </select> -->
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Field Size (ha): </label>
                                    <div class="col-sm-9">
                                        <input class="form-control" id="trial_upload_field_size" name="trial_upload_field_size" type="text" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Plants per Plot: </label>
                                    <div class="col-sm-9">
                                        <input class="form-control" id="trial_upload_plant_entries" name="trial_upload_plant_entries" type="text" />
                                        <p><i>Creates plant entries for each plot. Ignore if not adding plant entries.</i></p>
                                    </div>
                                    <label style="font-size: 80%;" class="col-sm-3 control-label">Inherits Management Factor(s) From Plots: </label>
                                    <div class="col-sm-8" >
                                        <input name="trial_upload_plants_per_plot_inherit_treatments" id="trial_upload_plants_per_plot_inherit_treatments" type="checkbox" checked disabled/>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Description: </label>
                                    <div class="col-sm-9" >
                                        <textarea class="form-control" id="trial_upload_description" name="trial_upload_description" form="upload_trial_form" maxlength="250"></textarea>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Stock Type Being Evaluated in Trial: </label>
                                    <div class="col-sm-9">
                                        <select class="form-control" id="trial_upload_trial_stock_type" name="trial_upload_trial_stock_type">
                                            <option value="">Select a stock type</option>
                                            <option value="accession">accession</option>
                                            <option value="cross">cross</option>
                                            <option value="family_name">family_name</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Design Type: </label>
                                    <div class="col-sm-9" >
                                        <select class="form-control" id="trial_upload_design_method" name="trial_upload_design_method">
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Upload File: </label>
                                    <div class="col-sm-9" >
                                        <input type="file" name="trial_uploaded_file" id="trial_uploaded_file" encoding="multipart/form-data" />
                                    </div>
                                </div>

                                <br/><br/>
                                <center>
                                <button id="next_step_trial_information_button" class="btn btn-primary" onclick="Workflow.complete(this); return false;">Go To Next Step</button>
                                </center>
                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Is your trial linked with other field trials, genotyping plates, or crossing experiments in the database? If you are unsure, you can skip this. This information can be added from the trial detail page after the trial is saved.</h3></div>


                                <div class="well form-horizontal">
                                    <div class="form-group">
                                        <label class="col-sm-5 control-label">Is this trial following-up a previous field trial?: </label>
                                        <div class="col-sm-7">
                                            <select class="form-control" id="upload_trial_trial_sourced" name="upload_trial_trial_sourced">
                                                <option value="no">No</option>
                                                <option value="yes">Yes</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group" style="display:none" id="upload_trial_source_trial_section">
                                        <label class="col-sm-5 control-label">Select the trial(s) which preceded this trial: </label>
                                        <div class="col-sm-7">
                                            <div id="upload_trial_trial_source" name="upload_trial_trial_source">
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <p>If you go on to collect tissue samples for creating a 96 well plate for genotyping, when adding the genotyping plate (96 well plate layout) to the database you can use plot names or plant names or tissue sample names from this field trial. By doing so, we can create linkage between this field trial and the genotyping plate.</p>

                                <div class="well form-horizontal">
                                    <div class="form-group">
                                        <label class="col-sm-5 control-label">Will this trial be genotyped?: </label>
                                        <div class="col-sm-7">
                                            <select class="form-control" id="upload_trial_trial_will_be_genotyped" name="upload_trial_trial_will_be_genotyped">
                                                <option value="no">No</option>
                                                <option value="yes">Yes</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>

                                <p>If you go on to perform crosses on this field trial, each cross can be linked to specific female and male plots. When you upload these crosses we can then automatically link this field trial to the crossing experiment in the database.</p>

                                <div class="well form-horizontal">
                                    <div class="form-group">
                                        <label class="col-sm-5 control-label">Will crosses be done on this trial?: </label>
                                        <div class="col-sm-7">
                                            <select class="form-control" id="upload_trial_trial_will_be_crossed" name="upload_trial_trial_will_be_crossed">
                                                <option value="no">No</option>
                                                <option value="yes">Yes</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>

                                <br />

                                <div class="form-horizontal">
                                    <p>Check this box to ignore any possible warning messages and save the trial to the database.</p>
                                    <div class="form-group">
                                        <label class="col-sm-5 control-label">Ignore Warnings?: </label>
                                        <div class="col-sm-7">
                                            <input id="upload_trial_ignore_warnings" name="upload_trial_ignore_warnings" type="checkbox">
                                        </div>
                                    </div>
                                </div>

                                <div style="display:none; padding: 5px; text-align: center" id="upload_trial_warning_messages" class="alert-warning" role="alert"></div>

                                <br />

                                <center>
                                    <button type="button" class="btn btn-lg btn-primary" name="upload_trial_validate_form_button" id="upload_trial_validate_form_button">First validate the form</button>
                                    <button type="button" class="btn btn-lg btn-primary" disabled name="upload_trial_submit_first" onclick="Workflow.complete(this, false); return false;" >Upload Trial</button>
                                <center>
                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Fixing the missing accession(s) problem</h3></div>


                                <div id="upload_trial_missing_accessions_div" style="display:none">
                                    <div class="well">
                                        <ul>
                                            <li>Accessions tested in your trial must exist in the database prior to adding your trial. The reason for this is that an accession can be tested in many trials and therefore exists as a separate entity in the database. We also want to be careful about adding new accessions into the database because we do not want incorrectly duplicated data.</li>
                                            <li>When adding accessions into the database, you can use either a list of accessions or an Excel file.</li>
                                        </ul>
                                    </div>

                                    <div id="upload_trial_add_missing_accessions_html">
                                    </div>

                                    <button class="btn btn-info" name="add_accessions_link">Add your accessions to the database</button><br/><br/>
                                    <button class="btn btn-primary" onclick="Workflow.complete(this); return false;">Once all your accessions are in the database Click Here</button><br/><br/>
                                </div>
                                <div id="upload_trial_error_display">

                                    <h3>Trial Upload Error Messages</h3>
                                    <div class="panel panel-danger">
                                        <div class="panel-body">
                                            <table>
                                                <tbody></tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                                <center>
                                <div id="upload_trial_no_error_messages_html">
                                </div>
                                <div name="upload_trial_completed_message">
                                </div>
                                </center>
                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Fixing the missing seedlot(s) problem</h3></div>


                                <div id="upload_trial_missing_seedlots_div" style="display:none">
                                    <div class="well">
                                        <ul>
                                            <li>Seedlots tested in your experimental trial must exist in the database prior to adding your trial. The reason for this is that a seedlot can be tested in many trials and therefore exists as a separate entity in the database. We also want to be careful about adding new seedlots into the database because we do not want data to be incorrectly linked to duplicates.</li>
                                        </ul>
                                    </div>
                                    <ul>
                                    <li>When adding seedlots into the database, you can upload an Excel file or you can add seedlots one at a time.<br/><br/>
                                        <ul>
                                        <li><button class="btn btn-info" name="seedlot_bulk_upload">Upload Excel file</button><br/><br/></li>
                                        <li><button class="btn btn-info" name="add_seedlot_button">Add One Seedlot</button></li>
                                        </ul>
                                    </li>
                                    </ul><br/>
                                    <button class="btn btn-primary" onclick="Workflow.complete(this); return false;">Once all your seedlots are in the database Click Here</button><br/><br/>
                                </div>
                                <div id="upload_trial_error_display_seedlot">

                                    <h3>Trial Upload Error Messages</h3>
                                    <div class="panel panel-danger">
                                        <div class="panel-body">
                                            <table>
                                                <tbody></tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                                <center>
                                <div id="upload_trial_no_error_messages_seedlot_html">
                                </div>
                                <div name="upload_trial_completed_message">
                                </div>
                                </center>
                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Submit your trial again. You should have corrected all errors by now, but if not please take a look at the errors in the red box below. You can continue to modify your file and then click Upload until it works.</h3></div>

                                <div id="trial_upload_show_repeat_upload_button">
                                    <center>
                                    <button type="button" class="btn btn-lg btn-primary" name="upload_trial_submit_second" >Upload Trial</button><br/><br/>
                                    </center>
                                </div>
                                <center>
                                <div name="upload_trial_completed_message">
                                </div>
                                </center>

                                <div id="upload_trial_error_display_second_try" style="display:none">

                                    <h3>There exist these problems in your file:</h3>
                                    <div class="panel panel-danger">
                                        <div class="panel-body">
                                            <table>
                                                <tbody></tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </li>
      </ol>
      <div class="workflow-pending-message">
                                <div id="pagetitle"><h3 id="pagetitle_h3">Finished! Your trial is now in the database</h3></div>

                                <p>
                                    <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                                    The trial file was uploaded successfully
                                </p>

                                <ul>
                                    <li>You may want to proceed to the trial detail page for the trial you just created.</li>
                                    <li>You can print barcodes for the plots or plants or tissue samples in this trial.</li>
                                    <li>You an add phenotypes for the plots or plants in this trial now.</li>
                                </ul>
                                <br/>
                                <!--center>
                                <button class="btn btn-primary" id="upload_trial_success_complete_button">The trial was saved to the database with no errors! Congrats Click Here</button><br/><br/>
                                </center-->
                            </div>
      <div class="workflow-complete-message">
                                <div id="pagetitle"><h3 id="pagetitle_h3">Finished! Your trial is now in the database</h3></div>

                                <p>
                                    <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                                    The trial file was uploaded successfully
                                </p>

                                <ul>
                                    <li>You may want to proceed to the trial detail page for the trial you just created.</li>
                                    <li>You can print barcodes for the plots or plants or tissue samples in this trial.</li>
                                    <li>You an add phenotypes for the plots or plants in this trial now.</li>
                                </ul>
                                <br/>
                                <!--center>
                                <button class="btn btn-primary" id="upload_trial_success_complete_button">The trial was saved to the database with no errors! Congrats Click Here</button><br/><br/>
                                </center-->
                            </div>
    </div>
  </div>
</div>
<script type="text/javascript">
  Workflow.init("#trial_upload_workflow");
</script>

                    </form>
                </div>
            </div>
            <div class="modal-footer">
                <button id="close_trial_upload_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="trial_upload_spreadsheet_info_dialog" name="trial_upload_spreadsheet_info_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadTrialInfoDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="uploadTrialInfoDialog">Upload Template Information</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <b>Trials may be uploaded in an Excel file (.xls or .xlsx)</b>
                    <br />
                    <hr>
                    


<a class="info_section_anchor" name="stock_type_being_evaluated_in_this_trial_accession"></a>

<table cellspacing="0" cellpadding="0" class="infosectionhead" summary=""><tr><td class="infosectiontitle">	<a class="collapser collapser_show" target="" href="" style=";;display:none;" onclick=" 
		Effects.swapElements('sgnc7652_offswitch', 'sgnc7652_onswitch'); 
		Effects.hideElement('sgnc7652_content');
			
		return false;"
		id="sgnc7652_offswitch"><img class="collapser_img" src="/documents/img/collapser_minus.png" />Stock type being evaluated in this trial: accession</a>
	<a class="collapser collapser_show" target="" href="" style=";;" onclick="
		Effects.swapElements('sgnc7652_onswitch', 'sgnc7652_offswitch'); 
		Effects.showElement('sgnc7652_content');
			
		return false;"
		id="sgnc7652_onswitch"><img class="collapser_img" src="/documents/img/collapser_plus.png" />Stock type being evaluated in this trial: accession</a>
</td><td class="infosectionsubtitle" role="button" tabindex="0">&nbsp;</td></tr></table>

<span id="sgnc7652_content" style="display:none;"><div class="infosectioncontent" >

                        <div class="well well-sm">
                            <b>Header:</b>
                            <br/>
                            The first row (header) must contain the following:
                            <br />
                            <table class="table table-hover table-bordered table-condensed" >
                                <thead></thead>
                                <tbody>
                                    <tr>
                                        <td>plot_name</td>
                                        <td>accession_name</td>
                                        <td>plot_number</td>
                                        <td>block_number</td>
                                        <td>is_a_control</td>
                                        <td>rep_number</td>
                                        <td>range_number</td>
                                        <td>row_number</td>
                                        <td>col_number</td>
                                        <td>seedlot_name</td>
                                        <td>num_seed_per_plot</td>
                                        <td>weight_gram_seed_per_plot</td>
                                    </tr>
                                </tbody>
                            </table>
                            <b>Header as a string:</b><br/>
                            <p>plot_name,accession_name,plot_number,block_number,is_a_control,rep_number,range_number,row_number,col_number,seedlot_name,num_seed_per_plot,weight_gram_seed_per_plot</p>
                        </div>
                    
</div>
</span>



                    


<a class="info_section_anchor" name="stock_type_being_evaluated_in_this_trial_cross_unique_id"></a>

<table cellspacing="0" cellpadding="0" class="infosectionhead" summary=""><tr><td class="infosectiontitle">	<a class="collapser collapser_show" target="" href="" style=";;display:none;" onclick=" 
		Effects.swapElements('sgnc7775_offswitch', 'sgnc7775_onswitch'); 
		Effects.hideElement('sgnc7775_content');
			
		return false;"
		id="sgnc7775_offswitch"><img class="collapser_img" src="/documents/img/collapser_minus.png" />Stock type being evaluated in this trial: cross unique id</a>
	<a class="collapser collapser_show" target="" href="" style=";;" onclick="
		Effects.swapElements('sgnc7775_onswitch', 'sgnc7775_offswitch'); 
		Effects.showElement('sgnc7775_content');
			
		return false;"
		id="sgnc7775_onswitch"><img class="collapser_img" src="/documents/img/collapser_plus.png" />Stock type being evaluated in this trial: cross unique id</a>
</td><td class="infosectionsubtitle" role="button" tabindex="0">&nbsp;</td></tr></table>

<span id="sgnc7775_content" style="display:none;"><div class="infosectioncontent" >

                        <div class="well well-sm">
                            <b>Header:</b>
                            <br/>
                            The first row (header) must contain the following:
                            <br />
                            <table class="table table-hover table-bordered table-condensed" >
                                <thead></thead>
                                <tbody>
                                    <tr>
                                        <td>plot_name</td>
                                        <td>cross_unique_id</td>
                                        <td>plot_number</td>
                                        <td>block_number</td>
                                        <td>is_a_control</td>
                                        <td>rep_number</td>
                                        <td>range_number</td>
                                        <td>row_number</td>
                                        <td>col_number</td>
                                        <td>seedlot_name</td>
                                        <td>num_seed_per_plot</td>
                                        <td>weight_gram_seed_per_plot</td>
                                    </tr>
                                </tbody>
                            </table>
                            <b>Header as a string:</b><br/>
                            <p>plot_name,cross_unique_id,plot_number,block_number,is_a_control,rep_number,range_number,row_number,col_number,seedlot_name,num_seed_per_plot,weight_gram_seed_per_plot</p>
                        </div>
                    
</div>
</span>



                    


<a class="info_section_anchor" name="stock_type_being_evaluated_in_this_trial_family_name"></a>

<table cellspacing="0" cellpadding="0" class="infosectionhead" summary=""><tr><td class="infosectiontitle">	<a class="collapser collapser_show" target="" href="" style=";;display:none;" onclick=" 
		Effects.swapElements('sgnc2301_offswitch', 'sgnc2301_onswitch'); 
		Effects.hideElement('sgnc2301_content');
			
		return false;"
		id="sgnc2301_offswitch"><img class="collapser_img" src="/documents/img/collapser_minus.png" />Stock type being evaluated in this trial: family name</a>
	<a class="collapser collapser_show" target="" href="" style=";;" onclick="
		Effects.swapElements('sgnc2301_onswitch', 'sgnc2301_offswitch'); 
		Effects.showElement('sgnc2301_content');
			
		return false;"
		id="sgnc2301_onswitch"><img class="collapser_img" src="/documents/img/collapser_plus.png" />Stock type being evaluated in this trial: family name</a>
</td><td class="infosectionsubtitle" role="button" tabindex="0">&nbsp;</td></tr></table>

<span id="sgnc2301_content" style="display:none;"><div class="infosectioncontent" >

                        <div class="well well-sm">
                            <b>Header:</b>
                            <br/>
                            The first row (header) must contain the following:
                            <br />
                            <table class="table table-hover table-bordered table-condensed" >
                                <thead></thead>
                                <tbody>
                                    <tr>
                                        <td>plot_name</td>
                                        <td>family_name</td>
                                        <td>plot_number</td>
                                        <td>block_number</td>
                                        <td>is_a_control</td>
                                        <td>rep_number</td>
                                        <td>range_number</td>
                                        <td>row_number</td>
                                        <td>col_number</td>
                                        <td>seedlot_name</td>
                                        <td>num_seed_per_plot</td>
                                        <td>weight_gram_seed_per_plot</td>
                                    </tr>
                                </tbody>
                            </table>
                            <b>Header as a string:</b><br/>
                            <p>plot_name,family_name,plot_number,block_number,is_a_control,rep_number,range_number,row_number,col_number,seedlot_name,num_seed_per_plot,weight_gram_seed_per_plot</p>
                        </div>
                    
</div>
</span>



                    <b>Required fields:</b>
                    <ul>
                    <li>plot_name (must be unique across entire database. This is often a concatenation of the trial name and the plot number.)</li>
                    <li>accession_name or cross_unique_id or family_name (must exist in the database. This is the accession or cross unique id or family name being tested in the plot.)</li>
                    <li>plot_number (a sequential number for the plot in the field (e.g. 1001, 1002, 2001, 2002). These numbers should be unique for the trial.)</li>
                    <li>block_number (a design parameter indicating which block the plot is in)</li>
                    </ul>

                    <b>Optional fields:</b>
                    <ul>
                    <li>is_a_control (type 1 in this field if the plot is a control, otherwise leave blank. generally you will have accessions/cross unique ids/family names that are controls, so you should indicate the plots of those accessions/cross unique ids/family names as a control.)</li>
                    <li>rep_number (replicate number, numeric)</li>
                    <li>range_number (range number. often synonymous with col_number, numeric)</li>
                    <li>row_number (row number. If the field is a grid, this represents the y coordinate, numeric, required for field map generation. the top left plot should be row 1, column 1)</li>
                    <li>col_number (column number. If the field is a grid, this represents the x coordinate. Sometimes called range_number, numeric, required for field map generation. the top left plot should be row 1, column 1)</li>
                    <li>seedlot_name (the seedlot from where the planted seed originated. Must exist in the database)</li>
                    <li>num_seed_per_plot (number seeds per plot. Seed is transferred from seedlot mentioned in seedlot_name. Numeric)</li>
                    <li>weight_gram_seed_per_plot (weight in gram of seeds in plot. seed is transferred from seedlot mentioned in seedlot name. Numeric)</li>
                    </ul>

                    <b>Treatments:</b>
                    <ul>
                    <li>treatment columns (additional column(s) that specify the name of a treatment (e.g. inoculated, drought, etc). The value for each plot should be 1 if the treatment was applied or empty.)</li>
                    </ul>
                </div>
            </div>
            <div class="modal-footer">
                <button id="close_trial_upload_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>


<div class="modal fade" id="multiple_trial_upload_spreadsheet_info_dialog" name="multiple_trial_upload_spreadsheet_info_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadMultipleTrialInfoDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="uploadMultipleTrialInfoDialog">Upload Template Information</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <b>Trials may be uploaded in an Excel file (.xls or .xlsx)</b>
                    <br />
                    <b>Multiple Trial Designs:</b>
                    <br />
                    <b>Header:</b>
                    <br>
                    The first row (header) must contain the following, which is an expansion of the single trial design header:
                    <br />

                    <table class="table table-hover table-bordered table-condensed" >
                        <thead></thead>
                        <tbody>
                            <tr>
                                <td>trial_name</td>
                                <td>breeding_program</td>
                                <td>location</td>
                                <td>year</td>
                                <td>transplanting_date</td>
                                <td>design_type</td>
                                <td>description</td>
                                <td>trial_type</td>
                                <td>plot_width</td>
                                <td>plot_length</td>
                                <td>field_size</td>
                                <td>planting_date</td>
                                <td>harvest_date</td>
                                <td>plot_name</td>
                                <td>accession_name</td>
                                <td>plot_number</td>
                                <td>block_number</td>
                                <td>is_a_control</td>
                                <td>rep_number</td>
                                <td>range_number</td>
                                <td>row_number</td>
                                <td>col_number</td>
                                <td>seedlot_name</td>
                                <td>num_seed_per_plot</td>
                                <td>weight_gram_seed_per_plot</td>
                            </tr>
                        </tbody>
                    </table>

                    <b>Header as a string:</b><br/>
                    <p>trial_name,breeding_program,location,year,transplanting_date,design_type,description,trial_type,plot_width,plot_length,field_size,planting_date,harvest_date,plot_name,accession_name,plot_number,block_number,is_a_control,rep_number,range_number,row_number,col_number,seedlot_name,num_seed_per_plot,weight_gram_seed_per_plot</p>

                    <b> Required fields:</b>
                    <ul>
                    <li>trial_name (Must be unique across entire database. It is often a concatenation of the year, transplanting_date, purpose, unique number, and location.)</li>
                    <li>breeding_program (The name of breeding program that managed the trial, must exist in the database.)</li>
                    <li>location (The <strong>name</strong> or <strong>abbreviation</strong> of the location where the trial was held, must exist in the database.)</li>
                    <li>year (The year the trial was held.)</li>

                    <li>design_type (The shorthand for the design type, must exist in the database. Possible values include CRD (Completely Randomized Design), RCBD (Randomized Complete Block Design), RRC (Resolvable Row-Column), DRRC (Doubly-Resolvable Row-Column), ARC (Augmented Row-Column), Alpha (Alpha Lattice Design), Lattice (Lattice Design), Augmented (Augmented Design), MAD (Modified Augmented Design), greenhouse (undesigned Nursery/Greenhouse), splitplot (Split Plot), p-rep (Partially Replicated), Westcott (Westcott Design))</li>
                    <li>description (Additional text with any other relevant information about the trial.)</li>
                    <li>plot_name (Must be unique across entire database. It is often a concatenation of the trial name and the plot number.)</li>
                    <li>accession_name (The accession being tested in the plot, must exist in the database.)</li>
                    <li>plot_number (A sequential number for the plot in the field (e.g. 1001, 1002, 2001, 2002). These numbers should be unique for the trial.)</li>
                    <li>block_number (A design parameter indicating which block the plot is in.)</li>
                    </ul>

                    <b>Additional optional fields:</b>
                    <ul>
                    <li>trial_type (The name of the trial type, must exist in the database. Possible values include Seedling Nursery, phenotyping_trial, Advanced Yield Trial, Preliminary Yield Trial, Uniform Yield Trial, Variety Release Trial, Clonal Evaluation, genetic_gain_trial, storage_trial, heterosis_trial, health_status_trial, grafting_trial, Screen House, Seed Multiplication, crossing_block_trial, Specialty Trial)</li>
                    <li>plot_width (plot width in meters)</li>
                    <li>plot_length (plot length in meters)</li>
                    <li>field_size (field size in hectares)</li>
                    <li>planting_date (Date of Planting in YYYY-MM-DD format)</li>
                    <li>transplanting_date(The transplanting_date of the trial was conducted. Date in YYYY-MM-DD format))</li>
                    <li>harvest_date (Date of Harvest in YYYY-MM-DD format)</li>
                    <li>is_a_control (type 1 in this field if the plot is a control, otherwise 0 or leave blank. generally you will have accessions that are controls, so you should indicate the plots that that accession is in as a control.)</li>
                    <li>rep_number (replicate number, must be numeric)</li>
                    <li>range_number (range number. often synonymous with col_number, must be numeric)</li>
                    <li>row_number (row number. if the field is a grid, this represents the y coordinate, numeric, required for field map generation. the top left plot shuold be row 1, column 1)</li>
                    <li>col_number (column number. if the field is a grid, this represents the x coordinate. sometimes called range_number, numeric, required for field map generation. the top left plot shuold be row 1, column 1)</li>
                    <li>seedlot_name (the seedlot from where the planted seed originated. must exist in the database)</li>
                    <li>num_seed_per_plot (number seeds per plot. seed is transferred from seedlot mentioned in seedlot_name. numeric)</li>
                    <li>weight_gram_seed_per_plot (weight in gram of seeds in plot. seed is transferred from seedlot mentioned in seedlot name. numeric)</li>
                    </ul>

                    <b>Treatments:</b>
                    <ul>
                    <li>treatment columns (additional column(s) that specify the name of a treatment (e.g. inoculated, drought, etc). the value for each plot should be 1 if the treatment was applied or empty if not applied.)</li>
                    </ul>

                </div>
            </div>
            <div class="modal-footer">
                <button id="close_multiple_trial_upload_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<script>
jQuery(document).ready(function(){

    var selectedProgram = jQuery('#trial_upload_breeding_program').val()

    filter_options(selectedProgram, 'program', 'trial_upload_location');

    jQuery('#trial_upload_breeding_program').change(function() {
        filter_options(jQuery(this).val(), 'program', 'trial_upload_location');
    });

    jQuery('#multiple_trial_designs_upload_file').change(function() {
        if (jQuery(this).val()) {
          jQuery('#multiple_trial_designs_upload_submit').prop("disabled",false);
        } else {
          jQuery('#multiple_trial_designs_upload_submit').prop("disabled",true);
        }
    });

    jQuery('#upload_multiple_trials_ignore_warnings').change(function() {
      if (this.checked) {
        jQuery('#upload_multiple_trials_warning_messages').hide();
      }
    });
});
</script>





<style>
#container_field_map_view {display: none; }
#d3legend {display: none}
#no_map_view_MSG {display: none; }

#container_fm {
    //border:2px dashed #000;
    height: 390px;
    width: 700px;
    overflow: auto;
    //overflow: scroll;
    display: none;
    margin: 10px;
}

rect.bordered {
    stroke: #E6E6E6;
    stroke-width:2px;
  }

  text.mono {
    font-size: 9pt;
    font-family: Consolas, courier;
    fill: #aaa;
  }

  text.axis-workweek {
    fill: #000;
  }

  text.axis-worktime {
    fill: #000;
  }

  .legend { list-style: none; }
  .legend li { float: left; margin-right: 10px; }
  .legend span { border: 1px solid #ccc; float: left; width: 12px; height: 12px; margin: 2px; }

  .legend .d3_block_even_number { background-color: #c7e9b4; }
  .legend .d3_block_odd_number { background-color: #41b6c4; }
  .legend .d3_checks { background-color: #081d58; }
  .legend .d3_rep_even_number { background-color: red; height: 8px; width: 18px;}
  .legend .d3_rep_odd_number { background-color: green; height: 8px; width: 18px;}

</style>

<div class="modal fade" id="add_project_dialog" name="add_project_dialog" tabindex="-1" role="dialog" aria-labelledby="addProjectDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="addProjectDialog">Design New Trial</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">

                    <form class="form-horizontal" id="create_new_trial_form" name="create_new_trial_form">

                        









                            
    

                            
    
                            
    
                            
    
                            
    
                            
    
                            
    
                            
  

                        
<div id="trial_design_workflow" class="workflow">
  <ol class="workflow-prog">
      <li><div class="workflow-title">Intro</div></li>
      <li><div class="workflow-title">Trial Information</div></li>
      <li><div class="workflow-title">Design Information</div></li>
      <li><div class="workflow-title">Trial Linkage</div></li>
      <li><div class="workflow-title">Field Map Information</div></li>
      <li><div class="workflow-title">Custom Plot Naming</div></li>
      <li><div class="workflow-title">Review Designed Trial</div></li>
  </ol>
  <div class="panel panel-default">
    <div class="panel-body">
      <ol class="workflow-content">
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">This workflow will guide you through designing a new trial in the database</h3></div>

                                <p>A field trial represents a field where each plot has a globally unique plot name, a sequential plot number that is unique in the trial (e.g. 101, 102, 103 for three separate plots), and an accession representing the genotype being tested in that plot. In cases where crosses/families are being evaluated (e.g. F1 hybrid, backcrossing), cross unique ids or family names can be used instead of accessions. Each plot can belong to different blocks and reps depending on the experimental design you are using (e.g. complete block vs augmented design). Each plot can have a row number and col number indicating the relative position of the plot in the field.</p>
                                <p>To design a trial you need to provide a globally unique trial name. The plot names will be generated based on the trial name you provide (e.g. if the trial name is 2018MyTrial, plot_names will be generated like 2018MyTrial_101, 2018MyTrial_102, etc).</p>
                                <p>You also need to provide a list of accessions, cross unique ids or family names to use. Based on the design you have picked, the accessions, cross unique ids or family names will be randomized over the blocks or replicates in the trial.</p>
                                <p>You can provide a list of accessions to use as controls or checks in your experiment.</p>
                                <p>Depending on the design you have picked, you will need to provide different design parameters (e.g. for complete block you will need to provide number of blocks, while for alpha lattice you will need to provide block size and number of replicates.).</p>
                                <p>A trial can represent a yield trial, a phenotyping trial, a crossing block, a greenhouse, a nursery, etc.</p>
                                <p>A plot can have many plants, which the database can track as separate entities, allowing you to record plant level observations and information.</p>
                                <br/><br/>
                                <center>
                                <button id="next_step_intro_button" class="btn btn-primary" onclick="Workflow.complete(this); return false;">Go to Next Step</button>
                                </center>
                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Enter basic information about the trial</h3></div>


                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Breeding Program: </label>
                                    <div class="col-sm-9">
                                        <select class="form-control" id="select_breeding_program" name="select_breeding_program">
                                        <option value='ABC-International'>ABC-International</option><option value='BiovInt'>BiovInt</option><option value='CIAT'>CIAT</option><option value='ICAR_NRCB'>ICAR_NRCB</option><option value='IITA'>IITA</option><option value='NARITA'>NARITA</option><option value='NARO'>NARO</option><option value='NIHORT'>NIHORT</option>                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Locations: (One or More)</label>
                                    <div class="col-sm-9">
                                        <select multiple class="form-control" id="add_project_location" name="add_project_location">
                                        <option value="Cornell Biotech" data-program="">Cornell Biotech</option><option value="Sendusu" data-program="IITA & ABC-International & BiovInt">Sendusu</option><option value="Mbarara" data-program="BiovInt & ABC-International">Mbarara</option><option value="mitalula" data-program="BiovInt & ABC-International">mitalula</option><option value="Kawanda" data-program="ABC-International & BiovInt & NARO">Kawanda</option><option value="Maruku" data-program="ABC-International & BiovInt">Maruku</option><option value="Lyamungo-TaCRI" data-program="BiovInt & ABC-International">Lyamungo-TaCRI</option><option value="Ibadan" data-program="IITA">Ibadan</option><option value="Onne" data-program="IITA">Onne</option><option value="Arusha" data-program="IITA">Arusha</option><option value="Hoima" data-program="NARITA & NARO">Hoima</option><option value="[Computation]" data-program="">[Computation]</option><option value="Ibadan-onsite" data-program="">Ibadan-onsite</option>                                        </select>
                                        <div class="well well-sm"><div id="locations_count" >No Locations Selected</div></div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Trial Name: </label>
                                    <div class="col-sm-9">
                                        <input class="form-control" id="new_trial_name" name="new_trial_name" type="text" />
                                        <p><i>Location abbreviation will automatically be added as a prefix if multiple locations are selected.</i></p>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Trial Type: </label>
                                    <div class="col-sm-9">
                                        <select class="form-control" id="add_project_type" name="add_project_type" type="text">
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Year: </label>
                                    <div class="col-sm-9">
                                        <select class="form-control" id="add_project_year" name="add_project_year" type="text"></select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Planting Date: </label>
                                    <div class="col-sm-9">
                                        <input class="form-control" id="add_project_planting_date" name="add_project_planting_date" title="planting_date" type="text"/>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Plot Width (m): </label>
                                    <div class="col-sm-9">
                                        <input class="form-control" id="add_project_plot_width" name="add_project_plot_width" type="text" />

                                        <!-- <select class="form-control" id="add_project_plot_width" name="add_project_plot_width">
                                            <option value="">NA</option>
                                            <option value="0.1">0.1</option>
                                            <option value="0.15">0.15</option>
                                            <option value="0.2">0.2</option>
                                            <option value="0.25">0.25</option>
                                            <option value="0.3">0.3</option>
                                            <option value="0.35">0.35</option>
                                            <option value="0.4">0.4</option>
                                            <option value="0.45">0.45</option>
                                            <option value="0.5">0.5</option>
                                            <option value="0.55">0.55</option>
                                            <option value="0.6">0.6</option>
                                            <option value="0.65">0.65</option>
                                            <option value="0.7">0.7</option>
                                            <option value="0.75">0.75</option>
                                            <option value="0.8">0.8</option>
                                            <option value="0.85">0.85</option>
                                            <option value="0.9">0.9</option>
                                            <option value="0.95">0.95</option>
                                            <option value="1">1</option>
                                            <option value="1.5">1.5</option>
                                            <option value="2">2</option>
                                            <option value="2.5">2.5</option>
                                            <option value="3">3</option>
                                            <option value="3.5">3.5</option>
                                            <option value="4">4</option>
                                            <option value="4.5">4.5</option>
                                            <option value="4.8">4.8</option>
                                            <option value="5">5</option>
                                            <option value="5.5">5.5</option>
                                            <option value="6">6</option>
                                            <option value="6.5">6.5</option>
                                            <option value="7">7</option>
                                            <option value="7.5">7.5</option>
                                            <option value="8">8</option>
                                            <option value="8.5">8.5</option>
                                            <option value="9">9</option>
                                            <option value="9.5">9.5</option>
                                            <option value="10">10</option>
                                            <option value="10.5">10.5</option>
                                            <option value="11">11.0</option>
                                            <option value="11.5">11.5</option>
                                            <option value="12">12.0</option>
                                            <option value="12.5">12.5</option>
                                        </select> -->
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Plot Length (m): </label>
                                    <div class="col-sm-9">
                                        <input class="form-control" id="add_project_plot_length" name="add_project_plot_length" type="text" />

                                        <!-- <select class="form-control" id="add_project_plot_length" name="add_project_plot_length">
                                            <option value="">NA</option>
                                            <option value="0.1">0.1</option>
                                            <option value="0.15">0.15</option>
                                            <option value="0.2">0.2</option>
                                            <option value="0.25">0.25</option>
                                            <option value="0.3">0.3</option>
                                            <option value="0.35">0.35</option>
                                            <option value="0.4">0.4</option>
                                            <option value="0.45">0.45</option>
                                            <option value="0.5">0.5</option>
                                            <option value="0.55">0.55</option>
                                            <option value="0.6">0.6</option>
                                            <option value="0.65">0.65</option>
                                            <option value="0.7">0.7</option>
                                            <option value="0.75">0.75</option>
                                            <option value="0.8">0.8</option>
                                            <option value="0.85">0.85</option>
                                            <option value="0.9">0.9</option>
                                            <option value="0.95">0.95</option>
                                            <option value="1">1</option>
                                            <option value="1.5">1.5</option>
                                            <option value="2">2</option>
                                            <option value="2.5">2.5</option>
                                            <option value="3">3</option>
                                            <option value="3.5">3.5</option>
                                            <option value="4">4</option>
                                            <option value="4.5">4.5</option>
                                            <option value="4.8">4.8</option>
                                            <option value="5">5</option>
                                            <option value="5.5">5.5</option>
                                            <option value="6">6</option>
                                            <option value="6.5">6.5</option>
                                            <option value="7">7</option>
                                            <option value="7.5">7.5</option>
                                            <option value="8">8</option>
                                            <option value="8.5">8.5</option>
                                            <option value="9">9</option>
                                            <option value="9.5">9.5</option>
                                            <option value="10">10</option>
                                            <option value="10.5">10.5</option>
                                            <option value="11">11.0</option>
                                            <option value="11.5">11.5</option>
                                            <option value="12">12.0</option>
                                            <option value="12.5">12.5</option>
                                        </select> -->
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Field Size (ha): </label>
                                    <div class="col-sm-9">
                                        <input class="form-control" id="new_trial_field_size" name="new_trial_field_size" type="text" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Plants per Plot: </label>
                                    <div class="col-sm-9">
                                        <input class="form-control" id="add_plant_entries" name="add_plant_entries" type="text" />
                                        <p><i>Creates plant entries for each plot. Ignore if not adding plant entries.</i></p>
                                    </div>
                                    <label style="font-size: 80%;" class="col-sm-3 control-label">Inherits Management Factor(s) From Plots: </label>
                                        <div class="col-sm-8" >
                                            <input name="trial_create_plants_per_plot_inherit_treatments" id="trial_create_plants_per_plot_inherit_treatments" type="checkbox" checked disabled/>
                                        </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Description: </label>
                                    <div class="col-sm-9">
                                        <textarea class="form-control" id="add_project_description" name="add_project_description" maxlength="250"></textarea>
                                    </div>
                                </div>
                                <hr>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Stock Type Being Evaluated in Trial: </label>
                                    <div class="col-sm-9">
                                        <select class="form-control" id="select_stock_type">
                                            <option value="">Select a stock type</option>
                                            <option value="accession">accession</option>
                                            <option value="cross">cross</option>
                                            <option value="family_name">family_name</option>
                                        </select>
                                    </div>
                                </div>
                                <hr>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Design Type: </label>
                                    <div class="col-sm-9">
                                        <select class="form-control" id="select_design_method" name="select_design_method">
                                        </select>
                                        <div id="create_trial_design_description_div">
                                        </div>
                                        <div id="prephelp" style="display: none">
                                            <button type="button" class="btn btn-link" data-toggle="modal" data-target="#partial_rep_help_dialog">Usage Help <span class="glyphicon glyphicon-question-sign"></span></button>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group" id="randomization_div" style="display:none;">
                                    <label class="col-sm-4 control-label">Use same randomization for all locations: </label>
                                    <div class="col-sm-8" >
                                        <input type="checkbox" id="use_same_layout" value="same_design" />
                                    </div>
                                </div>
                                <hr>
                                <center>
                                <button type="button" class="btn btn-lg btn-primary" name="create_trial_validate_form_button" id="create_trial_validate_form_button">First validate the form</button>
                                <button type="button" class="btn btn-lg btn-primary" disabled onclick="Workflow.complete(this); return false;" name="create_trial_submit">Continue to Next Step</button>
                                <center>

                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Design your trial layout</h3></div>

                                <div class="well well-sm">
                                    <div class="form-group form-group-sm" id="show_list_of_accession_section" >
                                        <center><h4>Which accessions will be in the field?</h4></center>
                                        <hr>
                                        <label class="col-sm-7 control-label">List of accessions to include (required):</label>
                                        <div class="col-sm-5" id="select_list" name="select_list">
                                        </div>
                                    </div>
                                    <div class="form-group form-group-sm" id="show_list_of_cross_section" >
                                        <center><h4>Which crosses will be in the field?</h4></center>
                                        <hr>
                                        <label class="col-sm-7 control-label">List of crosses to include (required):</label>
                                        <div class="col-sm-5" id="select_cross_list" name="select_cross_list">
                                        </div>
                                    </div>
                                    <div class="form-group form-group-sm" id="show_list_of_family_name_section" >
                                        <center><h4>Which family names will be in the field?</h4></center>
                                        <hr>
                                        <label class="col-sm-7 control-label">List of family names to include (required):</label>
                                        <div class="col-sm-5" id="select_family_name_list" name="select_family_name_list">
                                        </div>
                                    </div>
                                    <div class="form-group" id="westcott_check_1_section" style="display: none">
                                      <label class="col-sm-3 control-label">Name of Check 1: </label>
                                      <div class="col-sm-9" >
                                        <input class="form-control" id="westcott_check_1" name="westcott_check_1" placeholder="Required"></input>
                                      </div>
                                    </div>
                                    <div class="form-group" id="westcott_check_2_section" style="display: none">
                                      <label class="col-sm-3 control-label">Name of Check 2: </label>
                                      <div class="col-sm-9" >
                                        <input class="form-control" id="westcott_check_2" name="westcott_check_2" placeholder="Required"> </input>
                                      </div>
                                    </div>
                                    <div class="form-group form-group-sm" id="show_list_of_checks_section" style="display: none" >
                                        <label class="col-sm-7 control-label">List of checks to include (required): </label>
                                        <div class="col-sm-5" id="list_of_checks_section" >
                                        </div>
                                    </div>
                                    <div class="form-group form-group-sm" id="show_list_of_cross_checks_section" style="display: none" >
                                        <label class="col-sm-7 control-label">List of checks to include (required): </label>
                                        <div class="col-sm-5" id="list_of_cross_checks_section" >
                                        </div>
                                    </div>
                                    <div class="form-group form-group-sm" id="show_list_of_family_name_checks_section" style="display: none" >
                                        <label class="col-sm-7 control-label">List of checks to include (required): </label>
                                        <div class="col-sm-5" id="list_of_family_name_checks_section" >
                                        </div>
                                    </div>
                                    <div class="form-group form-group-sm" id="crbd_show_list_of_checks_section" style="display: none" >
                                        <label class="col-sm-7 control-label">List of checks to include. Checks list should be separate from accessions list. (optional): </label>
                                        <div class="col-sm-5" id="crbd_list_of_checks_section" >
                                        </div>
                                    </div>
                                    <div class="form-group form-group-sm" id="crbd_show_list_of_cross_checks_section" style="display: none" >
                                        <label class="col-sm-7 control-label">List of checks to include. Checks list should be accessions list. (optional): </label>
                                        <div class="col-sm-5" id="crbd_list_of_cross_checks_section" >
                                        </div>
                                    </div>
                                    <div class="form-group form-group-sm" id="crbd_show_list_of_family_name_checks_section" style="display: none" >
                                        <label class="col-sm-7 control-label">List of checks to include. Checks list should be accessions list. (optional): </label>
                                        <div class="col-sm-5" id="crbd_list_of_family_name_checks_section" >
                                        </div>
                                    </div>
                                    <div class="form-group form-group-sm" id="show_list_of_unrep_accession" style="display: none" >
                                        <label class="col-sm-7 control-label">List of unreplicated accession (required):</label>
                                        <div class="col-sm-5" id="list_of_unrep_accession"  >
                                        </div>
                                    </div>
                                    <div class="form-group form-group-sm" id="show_list_of_unrep_cross" style="display: none" >
                                        <label class="col-sm-7 control-label">List of unreplicated cross (required):</label>
                                        <div class="col-sm-5" id="list_of_unrep_cross"  >
                                        </div>
                                    </div>
                                    <div class="form-group form-group-sm" id="show_list_of_unrep_family_name" style="display: none" >
                                        <label class="col-sm-7 control-label">List of unreplicated family_name (required):</label>
                                        <div class="col-sm-5" id="list_of_unrep_family_name"  >
                                        </div>
                                    </div>
                                    <div class="form-group form-group-sm" id="show_list_of_rep_accession" style="display: none" >
                                        <label class="col-sm-7 control-label">List of replicated accession (required): </label>
                                        <div class="col-sm-5" id="list_of_rep_accession" >
                                        </div>
                                    </div>
                                    <div class="form-group form-group-sm" id="show_list_of_rep_cross" style="display: none" >
                                        <label class="col-sm-7 control-label">List of replicated cross (required): </label>
                                        <div class="col-sm-5" id="list_of_rep_cross" >
                                        </div>
                                    </div>
                                    <div class="form-group form-group-sm" id="show_list_of_rep_family_name" style="display: none" >
                                        <label class="col-sm-7 control-label">List of replicated family_name (required): </label>
                                        <div class="col-sm-5" id="list_of_rep_family_name" >
                                        </div>
                                    </div>

                                    <center>Need to create a list?&nbsp;&nbsp;&nbsp;&nbsp;<button name="lists_link" class="btn btn-default btn-sm" style="margin:6px 0px 0px 0px" type="button" >Manage Lists</button></center>
                                </div>

                                <div class="form-group form-group-sm" id="show_no_of_row_in_design" style="display: none" >
                                    <label class="col-sm-7 control-label">Number of rows in design: </label>
                                    <div class="col-sm-5"  >
                                        <div class="input-group">
                                            <span class="input-group-addon"><i class="glyphicon glyphicon-qrcode"></i></span>
                                            <input class="form-control" id="no_of_row_in_design" name="no_of_row_in_design" placeholder="26"/>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group form-group-sm" id="show_no_of_col_in_design" style="display: none" >
                                    <label class="col-sm-7 control-label">Number of columns in design : </label>
                                    <div class="col-sm-5"  >
                                        <div class="input-group">
                                            <span class="input-group-addon"><i class="glyphicon glyphicon-qrcode"></i></span>
                                            <input class="form-control" id="no_of_col_in_design" name="no_of_col_in_design" placeholder="26"/>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group form-group-sm" id="show_no_of_rep_times" style="display: none" >
                                    <label class="col-sm-7 control-label">Number of times replicated accessions are replicated: </label>
                                    <div class="col-sm-5"  >
                                        <div class="input-group">
                                            <span class="input-group-addon"><i class="glyphicon glyphicon-qrcode"></i></span>
                                            <input class="form-control" id="no_of_rep_times" name="no_of_rep_times" placeholder="4"/>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group form-group-sm" id="show_no_of_block_sequence" style="display: none" >
                                    <label class="col-sm-7 control-label">Block sequence: </label>
                                    <div class="col-sm-5" >
                                        <div class="input-group">
                                            <span class="input-group-addon"><i class="glyphicon glyphicon-qrcode"></i></span>
                                            <input class="form-control" id="no_of_block_sequence" name="no_of_block_sequence" placeholder="13, 2"/>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group form-group-sm" id="show_no_of_sub_block_sequence" style="display: none" >
                                    <label class="col-sm-7 control-label">Sub-block sequence: </label>
                                    <div class="col-sm-5" >
                                        <div class="input-group">
                                            <span class="input-group-addon"><i class="glyphicon glyphicon-qrcode"></i></span>
                                            <input class="form-control" id="no_of_sub_block_sequence" name="no_of_sub-block_sequence" placeholder="13, 1"/>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group form-group-sm" id="greenhouse_default_num_plants_per_accession" style="display: none">
                                    <label class="col-sm-7 control-label">Default Number of Plants: </label>
                                    <div class="col-sm-5" >
                                        <input class="form-control" type="text" id="greenhouse_default_num_plants_per_accession_val" placeholder="1" value="1" />
                                    </div>
                                </div>
                                <div class="form-group form-group-sm" id="greenhouse_num_plants_per_accession_section" style="display: none" >
                                    <hr>
                                    <center><h4>Number of Plants:</h4></center>
                                    <div id="greenhouse_num_plants_per_accession" >
                                    </div>
                                </div>

                                <div class="form-group form-group-sm" id="westcott_num_col_section" style="display: none" >
                                    <hr>
                                    <center><h4>Number of Columns (required):</h4></center>
                                    <div id="westcott_num_col" >
                                        <input class="form-control" id="westcott_col" name="westcott_col" placeholder="Required"/>
                                    </div>
                                </div>
                                <div class="form-group form-group-sm" id="westcott_num_col_between_check_section" style="display: none" >
                                    <hr>
                                    <center><h4>Number of columns between two check columns (Optional):</h4></center>
                                    <div id="westcott_num_col_between_check" >
                                        <input class="form-control" id="westcott_col_between_check" name="westcott_col_between_check" placeholder="default is 10" />
                                    </div>
                                </div>

                                <div id="design_info" name="design_info">
                                    <div class="form-group form-group-sm" id="rep_count_section" style="display: none">
                                        <label class="col-sm-7 control-label">Number of replicates (required): </label>
                                        <div class="col-sm-5" >
                                            <input class="form-control" id="rep_count" name="rep_count" />
                                        </div>
                                    </div>
                                    <div class="form-group form-group-sm" id="block_number_section" style="display: none">
                                        <label class="col-sm-7 control-label">Number of blocks (required): </label>
                                        <div class="col-sm-5" >
                                            <input class="form-control" id="block_number" name="block_number" />
                                        </div>
                                    </div>
                                    <div class="form-group form-group-sm" id="row_number_section" style="display: none">
                                        <label class="col-sm-7 control-label">Number of field rows (Required): </label>
                                        <div class="col-sm-5" >
                                            <input class="form-control" id="row_number" name="row_number" />
                                        </div>
                                    </div>
                                    <div class="form-group form-group-sm" id="row_number_per_block_section" style="display: none">
                                        <label class="col-sm-7 control-label">Number of Rows Per Block (Optional): </label>
                                        <div class="col-sm-5" >
                                            <input class="form-control" id="row_number_per_block" name="row_number_per_block" />
                                        </div>
                                    </div>

                                    <div id="create_trial_with_treatment_section" style="display: none">
                                        <div class="form-group form-group-sm" >
                                            <label class="col-sm-7 control-label">Subplot 1 Treatment Name: </label>
                                            <div class="col-sm-5" >
                                                <input class="form-control" id="create_trial_with_treatment_name_input1" name="create_trial_with_treatment_name_input1" type="text" value="Control" placeholder="Required Treatment 1"/>
                                            </div>
                                        </div>
                                        <div class="form-group form-group-sm" >
                                            <label class="col-sm-7 control-label">Subplot 2 Treatment Name: </label>
                                            <div class="col-sm-5" >
                                                <input class="form-control" id="create_trial_with_treatment_name_input2" name="create_trial_with_treatment_name_input2" type="text" placeholder="Required Treatment 2"/>
                                            </div>
                                        </div>
                                        <div class="form-group form-group-sm" >
                                            <label class="col-sm-7 control-label">Subplot 3 Treatment Name: </label>
                                            <div class="col-sm-5" >
                                                <input class="form-control" id="create_trial_with_treatment_name_input3" name="create_trial_with_treatment_name_input3" type="text" placeholder="Optional Treatment 3"/>
                                            </div>
                                        </div>
                                        <div class="form-group form-group-sm" >
                                            <label class="col-sm-7 control-label">Subplot 4 Treatment Name: </label>
                                            <div class="col-sm-5" >
                                                <input class="form-control" id="create_trial_with_treatment_name_input4" name="create_trial_with_treatment_name_input4" type="text" placeholder="Optional Treatment 4"/>
                                            </div>
                                        </div>
                                        <div id="create_trial_with_treatment_additional_treatment">
                                            <input type="hidden" id="create_trial_with_treatment_additional_count" value=0>
                                            <div class="form-group form-group-sm" >
                                                <label class="col-sm-7 control-label">Add Another Treatment: </label>
                                                <div class="col-sm-5" >
                                                    <button class="btn btn-info btn-sm" id="create_trial_with_treatment_additional_treatment_buton">+ Treatment</button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group form-group-sm" id="num_plants_per_plot_section" style="display: none">
                                        <label class="col-sm-7 control-label">Number of Plants Per Treatment (required): </label>
                                        <div class="col-sm-5" >
                                            <input class="form-control" id="num_plants_per_treatment" name="num_plants_per_treatment" />
                                        </div>
                                    </div>

                                    <div id="other_parameter_section" style="display:none">
                                        <hr>
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">Show optional parameters: </label>
                                            <div class="col-sm-8" >
                                                <input type="checkbox" id="show_other_parameter_options" />
                                            </div>
                                        </div>

                                        <div id="other_parameter_options" style="display:none">
                                            <div class="form-group form-group-sm">
                                                <label class="col-sm-7 control-label">Column number per block: </label>
                                                <div class="col-sm-5" >
                                                    <input type="text" class="form-control" id="col_number_per_block" name="col_number_per_block" />
                                                </div>
                                            </div>
                                            <div class="form-group form-group-sm">
                                                <label class="col-sm-7 control-label">Number of field columns: </label>
                                                <div class="col-sm-5" >
                                                    <input type="text" class="form-control" id="col_number" name="col_number" />
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group form-group-sm" id="block_size_section" style="display: none">
                                        <label class="col-sm-7 control-label">Block size (required): </label>
                                        <div class="col-sm-5" >
                                            <input type="text" class="form-control" id="block_size" name="block_size" />
                                        </div>
                                    </div>
                                    <div class="form-group form-group-sm" id="max_block_size_section" style="display: none">
                                        <label class="col-sm-7 control-label">Maximum block size (required): </label>
                                        <div class="col-sm-5" >
                                            <input type="text" class="form-control" id="max_block_size" name="block_size" />
                                        </div>
                                    </div>

                                    <div id="trial_design_seedlots_section" style="display:none">
                                        <div class="well well-sm">
                                            <center><h4>Which seedlots will you grow in the field? <br/><small>This is optional and can be decided later. If you do not know exactly which seedlot packets you will be planting at this time, you can add this information on the Trial Detail Page after the trial has been saved in the database.</small></h4></center>
                                            <hr>
                                            <div class="form-group form-group-sm" id="show_list_of_seedlots_section" >
                                                <label class="col-sm-7 control-label">List of seedlots for selected accessions (optional):</label>
                                                <div class="col-sm-5" id="select_seedlot_list" name="select_seedlot_list">
                                                </div>
                                            </div>
                                            <div class="form-group form-group-sm" id="show_num_seed_per_plot_section" >
                                                <label class="col-sm-7 control-label">Number of seeds per plot (required if seedlot list given):</label>
                                                <div class="col-sm-5">
                                                    <input type="number" class="form-control" id="num_seed_per_plot" name="num_seed_per_plot" />
                                                </div>
                                            </div>
                                            <center>Need a list of seedlots for the selected accessions?&nbsp;&nbsp;&nbsp;&nbsp;<button name="convert_accessions_to_seedlots" class="btn btn-default btn-sm" style="margin:6px 0px 0px 0px" type="button" >Search Seedlots for Accessions</button></center>
                                        </div>
                                    </div>

                                </div>

                                <br/>
                                <center>
                                <button id="next_step_design_information_button" type="button" class="btn btn-lg btn-primary" onclick="Workflow.complete(this); return false;" >Continue to Next Step</button>
                                <center>

                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Is your trial linked with other field trials, genotyping plates, or crossing experiments in the database? If you are unsure, you can skip this. This information can be added from the trial detail page after the trial is saved.</h3></div>


                                <br/>
                                <div class="well">
                                    <div class="form-group">
                                        <label class="col-sm-5 control-label">Is this trial following-up a previous field trial?: </label>
                                        <div class="col-sm-7">
                                            <select class="form-control" id="add_project_trial_sourced" name="add_project_trial_sourced">
                                                <option value="no">No</option>
                                                <option value="yes">Yes</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="form-group" style="display:none" id="add_trial_source_trial_section">
                                        <label class="col-sm-5 control-label">Select the trial(s) which preceded this trial: </label>
                                        <div class="col-sm-7">
                                            <div id="add_project_trial_source" name="add_project_trial_source">
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <p>If you go on to collect tissue samples for creating a 96 well plate for genotyping, when adding the genotyping plate (96 well plate layout) to the database you can use plot names or plant names or tissue sample names from this field trial. By doing so, we can create linkage between this field trial and the genotyping plate.</p>

                                <div class="well">
                                    <div class="form-group">
                                        <label class="col-sm-5 control-label">Will this trial be genotyped?: </label>
                                        <div class="col-sm-7">
                                            <select class="form-control" id="add_project_trial_will_be_genotyped" name="add_project_trial_will_be_genotyped">
                                                <option value="no">No</option>
                                                <option value="yes">Yes</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>

                                <p>If you go on to perform crosses on this field trial, each cross can be linked to specific female and male plots. When you upload these crosses we can then automatically link this field trial to the crossing experiment in the database.</p>

                                <div class="well">
                                    <div class="form-group">
                                        <label class="col-sm-5 control-label">Will crosses be done on this trial?: </label>
                                        <div class="col-sm-7">
                                            <select class="form-control" id="add_project_trial_will_be_crossed" name="add_project_trial_will_be_crossed">
                                                <option value="no">No</option>
                                                <option value="yes">Yes</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>

                                <br/>
                                <center>
                                <button id="next_step_trail_linkage_button" type="button" class="btn btn-lg btn-primary" onclick="Workflow.complete(this); return false;" >Continue to Next Step</button>
                                <center>
                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Specify the number of rows and columns for the entire field</h3></div>

                                <p>By default field map display is set to serpentine and uses the block or rep number as row number.</p>
                                <p>If you do not want to create field map along with this trial, set 'Plot layout format' to 'select plot layout format'.</p>
                                <p>If you do not know exactly in which rows and columns you will end up planting the plots, do not provide this and go to the next step.</p>
                                <p>If you will plant your plots in an irregular (non-rectangular) layout, do not provide this and go to the next step.</p>
                                <p>You can upload the exact row and column information for your plots (in any layout shape) on the Trial Detail Page after you have created the trial in the database and actually planted the experiment.</p>

                                <hr>
                                <div class="form-group"  id="FieldMap_westcott" style="display: none">
                                    <label class="col-sm-4 control-label">Field map display: </label>
                                    <div class="col-sm-8" > <label class="col-sm-8 control-label">
                                        <input type="checkbox" id="westcott_field_map" checked="checked" disabled/>  (comes with design)</label>
                                    </div>
                                </div>
                                <div class="form-group"  id="FieldMap">
                                    <label class="col-sm-4 control-label">Field map display: </label>
                                    <div class="col-sm-8" >
                                        <input type="checkbox" id="show_field_map_options" checked="checked"/>
                                    </div>
                                </div>

                                <div id="field_map_options" >
                                    <!--<div class="form-group form-group-sm" >
                                        <label class="col-sm-7 control-label">Number of columns per row (uses accession number by default): </label>
                                        <div class="col-sm-5" >
                                            <input type="text" class="form-control" id="fieldMap_col_number" name="fieldMap_col_number" />
                                        </div>
                                    </div> -->
                                    <div class="form-group form-group-sm" id="field_map_row_aug">
                                        <label class="col-sm-7 control-label">Number of rows (required): </label>
                                        <div class="col-sm-5" >
                                          <input type="text" class="form-control" id="fieldMap_row_number" name="fieldMap_row_number" placeholder="Will use number of blocks by default"/>
                                        </div>
                                    </div>
                                    <div class="form-group form-group-sm" >
                                        <label class="col-sm-7 control-label">Plot layout format: </label>
                                        <div class="col-sm-5" >
                                          <select class="form-control" id="plot_layout_format" name="plot_layout_format">
                                            <option value="">select plot layout format</option>
                                            <option value=zigzag>Zigzag(unserpentine)</option>
                                            <option value=serpentine selected="selected">Serpentine</option>
                                          </select>
                                        </div>
                                    </div>
                                </div>

                                <br/>
                                <center>
                                <button id="next_step_field_map_button"  type="button" class="btn btn-lg btn-primary" onclick="Workflow.complete(this); return false;" >Continue to Next Step</button>
                                <center>

                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">If you want to change the way in which plot names will be generated by the database</h3></div>

                                <p>It is recommended to allow the database to create the plot prefixes, so leave the prefix blank unless necessary.</p>

                                <div class="form-group" >
                                    <label class="col-sm-4 control-label">Custom plot naming/numbering: </label>
                                    <div class="col-sm-8" >
                                        <input type="checkbox" id="show_plot_naming_options" checked/>
                                    </div>
                                </div>

                                <div id="plot_naming_options">
	                          <div class="form-group form-group-sm">
				    <div class="col-sm-5">
				      &nbsp;
				    </div>
				    <span class="col-sm-1 text-right">
				      <input type="radio" name="plot_numbering_scheme"  id="block_based" value="block_based" checked="checked" />
				    </span>

                                    <span class="col-sm-6 text-left">block based plot numbers (increment leading digit for every block)</span>
				  </div>
				  <div class="form-group form-group-sm">
				    <span class="col-sm-5">
				      &nbsp;
				    </span>
				    <span class="col-sm-1 text-right">
				      <input type="radio" name="plot_numbering_scheme" id="consecutive" value="consecutive" />
				    </span>
				    <span class="col-sm-6 text-left">
				      consecutive plot numbers throughout the blocks
				    </span>
				  </div>

                                     <div class="form-group form-group-sm" >
                                         <label class="col-sm-7 control-label">Plot prefix: </label>
                                         <div class="col-sm-5" >
                                             <input type="text" class="form-control" id="plot_prefix" name="plot_prefix" placeholder="Optional" />
                                         </div>
                                      </div>
                                      <div class="form-group form-group-sm" >
                                          <label class="col-sm-7 control-label">Plot start number: </label>
                                          <div class="col-sm-5" >
                                              <select class="form-control" id="start_number" name="start_number">
                                                  <option value=1 >1</option>
                                                  <option value=101 >101</option>
                                                  <option value=1001 >1001</option>
                                               </select>
                                            <!--<input type="text" class="form-control" id="start_number" name="start_number" />-->
                                          </div>
                                       </div>
                                       <div class="form-group form-group-sm" >
                                           <label class="col-sm-7 control-label">Plot number increment: </label>
                                           <div class="col-sm-5" >
                                               <input type="text" class="form-control" id="increment" name="increment" placeholder="1"/>
                                           </div>
                                       </div>
                                   </div>
                                <br/>
                                <center>
                                <button type="button" class="btn btn-lg btn-primary" onclick="Workflow.complete(this, false); return false;" name="new_trial_submit" id="new_trial_submit">Continue to Next Step</button>
                                <center>

                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Review the generated trial layout. Make sure to click Submit at the bottom of this page if you approve of the trial!</h3></div>


                                <div id="trial_design_warning_message">
                                </div>

                                <div class="well">
                                    <center><p>Check to confirm that your design looks good. If there are any problems you can redo the randomization step.</p></center>
                                    <div class="d3_legend" id="d3_legend"> <p></br>  &nbsp;&nbsp; <ul class="legend">
                                        <li><span class="d3_block_even_number"></span> Even Block Numbers (e.g. 2,4,...)</li>
                                        <li><span class="d3_block_odd_number"></span> Odd Block Numbers (e.g. 1,3,...)</li>
                                        <li><span class="d3_checks"></span> Checks</li>
                                        <li><span class="d3_rep_odd_number"></span> Odd Rep Numbers (e.g. 1,3,...)</li>
                                        <li><span class="d3_rep_even_number"></span> Even Rep Numbers (e.g. 2,4,...)</li>
                                    </div>
                                    <div id="container_field_map_view" ></div>
                                    <div id="no_map_view_MSG" >No field map to display...</div>
                                </div>

                                <div id="trial_design_view_layout_return">
                                </div>
                                <br/>
                                <center>
                                    <button class="btn btn-info btn-lg" id="redo_trial_layout_button" >Redo Randomization</button>
                                </center>

                                <hr>
                                <p><span class="ui-icon ui-icon-check"></span>Trial Is Valid<br>The following trial will be added</p>
                                <hr>
                                <div id="trial_design_information">
                                </div>

                                <br/>
                                <center>
                                <button type="button" class="btn btn-info" name="new_trial_add_treatments" >Add Field Management Factor(s) to Design</button>
                                <button type="button" class="btn btn-lg btn-primary" name="new_trial_confirm_submit" id="new_trial_confirm_submit">Confirm (Saves Trial In Database)</button>
                                </center>

                            </li>
      </ol>
      <div class="workflow-pending-message">
                                <div id="pagetitle"><h3 id="pagetitle_h3">Complete! Your trial was saved in the database.</h3></div>


                                <p>
                                    <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                                    The trial was saved successfully
                                </p>

                                <ul>
                                    <li>You may want to proceed to the trial detail page for the trial you just created.</li>
                                    <li>You can print barcodes for the plots or plants or tissue samples in this trial.</li>
                                    <li>You an add phenotypes for the plots or plants in this trial now.</li>
                                </ul>
                                <br/>
                                <center>
                                <button id="create_trial_success_complete_button" class="btn btn-primary" name="create_trial_success_complete_button">The trial was saved to the database with no errors! Congrats Click Here</button><br/><br/>
                                </center>
                            </div>
      <div class="workflow-complete-message">
                                <div id="pagetitle"><h3 id="pagetitle_h3">Complete! Your trial was saved in the database.</h3></div>


                                <p>
                                    <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                                    The trial was saved successfully
                                </p>

                                <ul>
                                    <li>You may want to proceed to the trial detail page for the trial you just created.</li>
                                    <li>You can print barcodes for the plots or plants or tissue samples in this trial.</li>
                                    <li>You an add phenotypes for the plots or plants in this trial now.</li>
                                </ul>
                                <br/>
                                <center>
                                <button id="create_trial_success_complete_button" class="btn btn-primary" name="create_trial_success_complete_button">The trial was saved to the database with no errors! Congrats Click Here</button><br/><br/>
                                </center>
                            </div>
    </div>
  </div>
</div>
<script type="text/javascript">
  Workflow.init("#trial_design_workflow");
</script>
<!-- End of workflow-->
                    </form>

                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>


<div class="modal fade" id="trial_design_add_treatments" name="trial_design_add_treatments" tabindex="-1" role="dialog" aria-labelledby="addTrialDesignTreatmentsDialog">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="addTrialDesignTreatmentsDialog">Add Field Management Factor to Design</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <form class="form-horizontal" role="form">
                        <div class="form-group">
                            <label class="col-sm-4 control-label">Add Field Management Factor Name: </label>
                            <div class="col-sm-8">
                                <input class="form-control" id="new_treatment_name" name="new_treatment_name" type="text" placeholder="e.g. Fertilizer01_20N40P50K or Weeding01_Manual"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-4 control-label">Add Field Management Factor Description: </label>
                            <div class="col-sm-8">
                                <input class="form-control" id="new_treatment_description" name="new_treatment_description" type="text" placeholder="e.g. Fertilizer Brand Sprayed with 20N40P50K"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-4 control-label">Field Management Factor Type: </label>
                            <div class="col-sm-8">
                                <select class="form-control" id="new_treatment_type" name="new_treatment_type">
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-4 control-label">Field Management Factor Year: </label>
                            <div class="col-sm-8">
                                <select class="form-control" id="new_treatment_year" name="new_treatment_year" type="text"></select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-4 control-label">Field Management Factor Date: </label>
                            <div class="col-sm-8">
                                <input class="form-control" id="new_treatment_date" name="new_treatment_date" title="planting_date" type="text"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-4 control-label">Applied To: </label>
                            <div class="col-sm-8">
                                <select class="form-control" id="new_treatment_unit" name="new_treatment_unit">
                                    <option value='plot'>Plots</option>
                                    <option value='plant'>Plants</option>
                                    <!--option value='subplot'>Subplots</option-->
                                </select>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-info" id="new_trial_add_treatments_continue" >Continue</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="trial_design_add_treatment_select" name="trial_design_add_treatment_select" tabindex="-1" role="dialog" aria-labelledby="addTrialDesignTreatmentSelectDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="addTrialDesignTreatmentSelectDialog">Add Field Management Factor to Design</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <div id="trial_design_add_treatment_select_html"></div>
                </div>
            </div>
            <div class="modal-footer">
                Apply Field Management Factors to Plants and Subplots and Tissue Samples (if available): <input type="checkbox" id="new_trial_add_treatments_apply_to_plants" checked disabled />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <button type="button" class="btn btn-info" id="new_trial_add_treatments_submit" >Continue</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<script>
jQuery(document).ready(function(){
    get_select_box('years', 'new_treatment_year', {'auto_generate': 1 });
    var treatment_date_element = jQuery("#new_treatment_date");
    set_daterangepicker_default (treatment_date_element);
    jQuery('input[title="planting_date"]').daterangepicker(
        {
            "singleDatePicker": true,
            "showDropdowns": true,
            "autoUpdateInput": false,
        },
        function(start){
            treatment_date_element.val(start.format('MM/DD/YYYY'));
        }
    );
});
</script>


<div class="modal fade" id="partial_rep_help_dialog" name="partial_rep_help_dialog" tabindex="-1" role="dialog" aria-labelledby="partialRepHelpDialog">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="partialRepHelpDialog">Partially Replicated Design Usage Help</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <p>
                        <h4>
                        <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                          <b>Background:</b>
                        </h4>
                          <center><p>Partially replicated designs have some treatments that are unreplicated and rely on replicated treatments to make the trial analysable. The design were described in Cullis et al. (2006). It is recommended that at least 20% of the experimental units are occupied by replicated treatments. The aim of these experiments is usually to select promising treatments from a set of replicated and unreplicated test treatments, with check and quality standard treatments providing the necessary replication overall to give a valid experiment. DiGGer (Coombes, 2002) was used to implement this design. DiGGer is a flexible tool for creating experimental designs that are efficient for specified blocking and correlation patterns. DiGGer package (http://www.austatgen.org/files/software/downloads) is an add-on for the statistical computing language and environment R (R
Development Core Team, 2009).</p></center>
                        <h4>
                        <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                        <b>Design Parameters:</b>
                        </h4>
                            <center><p> The parameters will consider a sample partially replicated design trial with 200 unreplicated accessions, 119 accessions replicated 4 times, 26 rows in design, 26 columns in design, bock sequence of 13 by 2 (13, 2) i.e 2 blocks with each having 13 rows; sub-block sequence of block of 13 by 1 (13, 1) i.e 1 sub-block with each having 13 rows in each block. </p></center>

                        <dl>
                            <dt>List of Unreplicated Accession</dt>
                            <ul>
                                <li>
                                    <dd> You're expected to provide the list of unreplicated accessions in this selectbox. E.g. is a list of 200 accessions.</dd>
                                </li>
                            </ul>
                            <dt>List of Replicated Accession</dt>
                            <ul>
                                <li>
                                    <dd>List of replicated accessions should be provided in this selectbox. E.g. is a list of 119 accessions.</dd>
                                </li>
                            </ul>
                            <dt>Number of rows in design</dt>
                            <ul>
                                <li>
                                    <dd> Provide the number of rows you want to have in the design. E.g. 26 number of rows. </dd>
                                </li>
                            </ul>
                            <dt>Number of Columns in Design</dt>
                            <ul>
                                <li>
                                    <dd> Provide the number of columns you want to have in the design. E.g. 26 number of columns. </dd>
                                </li>
                            </ul>
                            <dt>Number of Times Replicated Accessions are Replicated</dt>
                            <ul>
                                <li>
                                    <dd>Provide the number of times you want the replicated accessions to be replicated. E.g. 4</dd>
                                </li>
                            </ul>
                            <dt>Block Sequence</dt>
                            <ul>
                                <li>
                                    <dd>The block sequence should reflect the blocking structure of your design. E.g. (13, 2), meaning the design has 2 blocks and each block has 13 rows.</dd>
                                </li>
                            </ul>
                            <dt>Sub-block Sequence</dt>
                            <ul>
                                <li>
                                    <dd>The sub-block sequence should reflect the sub-blocking structure of your design. E.g. (13, 1), meaning the design has 1 sub-block (column) and each sub-block has 13 rows.</dd>
                                </li>
                            </ul>
                        </dl>
                        <h4>
                            <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                            <b>NOTE:</b>
                        </h4>
                        <dl><dt>
                        <ul>
                            <li>
                                <dd>The product of the number of rows and columns in the design should equal the total number of plots.</dd>
                            </li>
                            <li>
                                <dd>The sum of the unreplicated accessions and the replicated accessions (given the number of times it was replicated) should equal the total number of plots. </dd>
                            </li>
                        </ul>
                        </dt></dl>

                    </p>
                </div>
            </div>
            <div class="modal-footer">
                <button id="partial_rep_usage_dialog_ok_button" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<script>
jQuery(document).ready(function(){

    var selectedProgram = jQuery('#select_breeding_program').val()

    filter_options(selectedProgram, 'program', 'add_project_location');

    jQuery('#select_breeding_program').change(function() {
        filter_options(jQuery(this).val(), 'program', 'add_project_location');
    });

    jQuery('#add_project_location').change(function() {
        var number_selected = jQuery(this).val().length;
        if (number_selected > 1) {
            jQuery('#locations_count').html('Locations Selected: '+number_selected);
            jQuery('#randomization_div').show();
        } else if (number_selected > 0) {
            jQuery('#locations_count').html('Locations Selected: '+number_selected);
            jQuery('#randomization_div').hide();
        } else {
            jQuery('#locations_count').html('No Locations Selected');
            jQuery('#randomization_div').hide();
        }
    });

    var planting_date_element = jQuery("#add_project_planting_date");
    jQuery('input[title="planting_date"]').daterangepicker(
        {
            "singleDatePicker": true,
            "showDropdowns": true,
            "autoUpdateInput": false,
        },
        function(start){
            planting_date_element.val(start.format('MM/DD/YYYY'));
        }
    );
});
</script>





<div class="modal fade" id="upload_genotypes_dialog" name="upload_genotypes_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadGenotypesDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" encoding="multipart/form-data" id="upload_genotypes_form" name="upload_genotypes_form" action="/ajax/genotype/upload">

                <div class="modal-header">
                    <button type="reset" class="close" id="upload_genotype_data_close_modal_1" name="upload_genotype_data_close_modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="uploadGenotypesDialog">Upload Genotypes</h4>
                </div>
                <div class="modal-body">
                    <div class="container-fluid">

                        









                            
    

                            
    

                            
    
                            
    
                            
    
                            
    
                            
    
                        
<div id="upload_genotypes_workflow" class="workflow">
  <ol class="workflow-prog">
      <li><div class="workflow-title">Intro</div></li>
      <li><div class="workflow-title">Data Type</div></li>
      <li><div class="workflow-title">Genotyping Project</div></li>
      <li><div class="workflow-title">Genotyping Protocol</div></li>
      <li><div class="workflow-title">Genotype Info</div></li>
      <li><div class="workflow-title">Confirm</div></li>
      <li><div class="workflow-title">Complete</div></li>
  </ol>
  <div class="panel panel-default">
    <div class="panel-body">
      <ol class="workflow-content">
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">This workflow will guide you through uploading genotypes into the database</h3></div>

                                <p>Select a genotyping project on the next screen. This project can represent a series of genotyping plates sent to a genotyping facilty.</p>
                                <p>Ideally the sample names in your VCF file will match sample names in genotyping plates in the database; however, the sample names in your file can also match accession names in the database.</p>
                                <p>Curently we support the VCF format, the Tassel HDF5 format, the Intertek CSV format, KASP data and SSR data for upload.</p>
                                <p>If you are uploading many files that used the same genotyping protocol, you can do so, and the database will ensure that the marker information is consistent across the genotyping data (e.g. the same reference, alternate, position, etc.).</p>

                                <br/><br/>
                                <center>
                                <button class="btn btn-primary" onclick="Workflow.complete(this); return false;">Go to Next Step</button>
                                </center>
                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Select the type of genotyping data being uploaded</h3></div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Type of genotyping data: </label>
                                    <div class="col-sm-9">
                                        <select class="form-control" id="genotype_data_type_select" name="genotype_data_type_select">
                                            <option value="">Select data type</option>
                                            <option value="vcf">VCF</option>
                                            <option value="tassel_hdf5">Tassel HDF5</option>
                                            <option value="intertek">Intertek</option>
                                            <option value="KASP">KASP (csv)</option>
                                            <option value="ssr">SSR</option>
                                        </select>
                                    </div>
                                </div>
                                <br/><br/>
                                <center>
                                <button class="btn btn-primary" id="upload_genotyping_data_type_check_button">Go to Next Step</button>
                                </center>
                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Select the genotyping project or create a new one. A genotyping project is a specific genotyping event. You can have many genotyping projects under the same genotyping protocol to indicate that those genotyping events used the same markers.</h3></div>


                                <table id="upload_genotyping_data_project_search_results" width="100%" class="table table-hover table-striped">
                                    <thead>
                                        <tr>
                                            <th>Select</th>
                                            <th>Genotyping Project Name</th>
                                            <th>Description</th>
                                            <th>Breeding program</th>
                                            <th>Year</th>
                                            <th>Location</th>
                                            <th>Genotyping Facility</th>
                                        </tr>
                                    </thead>
                                </table>

                                <center>
                                <button class="btn btn-primary" id="upload_genotyping_data_project_missing_button">My project is not here. Create a new one.</button>
                                </center>
                                <br/>

                                <!-- If genotyping project is selected above, the project_id is passed to controller, negating need to create new project -->
                                <input id="upload_genotype_project_id" name="upload_genotype_project_id" type="hidden" />

                                <div id="upload_genotyping_data_project_details" style="display:none">
                                    <div class="well">
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">Genotyping Project Name: <br/><small>Should match Vendor Project if you have one</small></label>
                                            <div class="col-sm-7">
                                                <input class="form-control" id="upload_genotype_vcf_project_name" name="upload_genotype_vcf_project_name" type="text" placeholder="e.g. NextGenCassava"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">Genotyping Facility: </label>
                                            <div class="col-sm-7">
                                                <select class="form-control" id="upload_genotype_vcf_facility_select" name="upload_genotype_vcf_facility_select">
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">Breeding Program: </label>
                                            <div class="col-sm-7">
                                                <span id="upload_genotype_breeding_program_select_div"></span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">Year: </label>
                                            <div class="col-sm-7">
                                                <span id="upload_genotype_year_select_div"></span>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">Description: </label>
                                            <div class="col-sm-7">
                                                <textarea class="form-control" id="upload_genotype_vcf_project_description" name="upload_genotype_vcf_project_description" maxlength="250"></textarea>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <br/>
                                <center>
                                <button class="btn btn-primary" id="upload_genotyping_data_project_check_button">Go to Next Step</button>
                                </center>
                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Provide info about the genotyping protocol used. The genotyping protocol represents a specific instance of how genotypes were called for a set of markers in a genotyping platform. Many genotyping projects can use the same genotyping protocol.</h3></div>


                                <table id="upload_genotyping_data_protocol_search_results" width="100%" class="table table-hover table-striped">
                                    <thead>
                                        <tr>
                                            <th>Select</th>
                                            <th>Protocol Name</th>
                                            <th>Header Description</th>
                                            <th>Number of Markers</th>
                                            <th>Protocol Description</th>
                                            <th>Reference Genome</th>
                                            <th>Species</th>
                                            <th>Sample Unit</th>
                                            <th>Create Date</th>
                                        </tr>
                                    </thead>
                                </table>

                                <center>
                                <button class="btn btn-primary" id="upload_genotyping_data_protocol_missing_button">My protocol is not here. Create a new one.</button>
                                </center>
                                <br/>

                                <!-- If protocol is selected above, the protocol_id is passed to controller, negating need to create new protocol -->
                                <input id="upload_genotype_protocol_id" name="upload_genotype_protocol_id" type="hidden" />

                                <div id="upload_genotype_data_protocol_details" style="display:none">
                                    <div class="well">
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">Genotyping Protocol Name:</label>
                                            <div class="col-sm-7">
                                                <input class="form-control" id="upload_genotype_vcf_protocol_name" name="upload_genotype_vcf_protocol_name" type="text" placeholder=" e.g. GBS ApeKI Cassava genome v6 Jan2015"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">Genotyping Protocol Reference Genome:</label>
                                            <div class="col-sm-7">
                                                <input class="form-control" id="upload_genotype_vcf_reference_genome_name" name="upload_genotype_vcf_reference_genome_name" type="text" placeholder="Mesculenta_511_v7.0"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">Species:</label>
                                            <div class="col-sm-7">
                                                <input class="form-control" id="upload_genotypes_species_name_input" name="upload_genotypes_species_name_input" type="text" placeholder=" e.g. Manihot esculenta"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">Assay Type </label>
                                            <div class="col-sm-7">
                                                <select class="form-control" id="assay_type_select" name="assay_type_select">
                                                    <option value="">Select assay type</option>
                                                    <option value="GBS">GBS</option>
                                                    <option value="KASP">KASP</option>
                                                    <option value="SSR">SSR</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">Description:</label>
                                            <div class="col-sm-7">
                                                <input class="form-control" id="upload_genotypes_protocol_description_input" name="upload_genotypes_protocol_description_input" type="text" />
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-5 control-label">Choose Sample Unit: </label>
                                            <div class="col-sm-7">
                                                <div class="panel panel-default">
                                                    <div class="panel-body">
                                                        <input type="radio" name="upload_genotype_vcf_observation_type" value="tissue_sample" checked>&nbsp;&nbsp;&nbsp;Exported Tissue Sample Name: The sample names in your VCF are tissue_sample_names that already exist in genotyping plates (e.g. 96 well plates) or sampling trials in the database. The sample names in your VCF file can be the tissue_sample_name triple pipe joined to the accession_name (e.g. tissue_sample_name|||accession_name) or just simply the tissue_sample_name corresponding to the genotyping plate well or sampling trial sample. This is the <strong>recommended format</strong>.
                                                        <br/><br/>
                                                        <input type="radio" name="upload_genotype_vcf_observation_type" value="accession">&nbsp;&nbsp;&nbsp;Accession: The sample names are of accession names
                                                        <br/><br/>
                                                        <input type="radio" name="upload_genotype_vcf_observation_type" value="stocks">&nbsp;&nbsp;&nbsp;Mixed Stocks: The sample names are a mix of accession names or plot names or sample names or other stock names. This is <strong>not recommended</strong> because it will lead to messy sample metadata.
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>


                                <div class="well">
                                    <div class="form-group">
                                        <label class="col-sm-5 control-label">Location of Data Generation: </label>
                                        <div class="col-sm-7">
                                            <span id="upload_genotype_location_select_div"></span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-5 control-label">Exported Tissue Sample Names Include Numbers Generated by Genotyping Facility (e.g. sample_name:IGD1001:09):<br/><small>The generated number is separated from the tissue sample name in the database by a ':' separating character.</small> </label>
                                        <div class="col-sm-7">
                                            <input type="checkbox" id="upload_genotype_vcf_include_igd_numbers" name="upload_genotype_vcf_include_igd_numbers" >
                                        </div>
                                    </div>
                                </div>

                                <br/>
                                <center>
                                <button class="btn btn-primary" id="upload_genotyping_data_protocol_check_button">Go to Next Step</button>
                                </center>
                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Provide genotype information</h3></div>

                                <br/><br/>

                                <div class="form-group">
                                    <label class="col-sm-5 control-label">Type of Genotype Data:</label>
                                    <div class="col-sm-7">
                                        <input class="form-control" id="upload_genotype_data_type" name="upload_genotype_data_type" type="text" value = "" disabled />
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-5 control-label">Ignore any possible warnings and upload genotypes?: </label>
                                    <div class="col-sm-7">
                                        <select class="form-control" id="upload_genotype_accept_warnings" name="upload_genotype_accept_warnings">
                                            <option value="">No</option>
                                            <option value="1">Yes</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="well well-sm" id="upload_genotype_data_format_vcf">
                                    <div class="row">
                                        <div class="col-sm-4">
                                            <table style="border: 1px solid gray; padding: 1em 2em; margin: 25px 15px; background: #f3f3ff;">
  <tr>
    <td>
      <img src="/documents/img/info_icon.png" border="0" style="margin: 10px; vertical-align: middle" />
    </td>
    <td style="padding-top: 0.35em; padding-right:0.35em; vertical-align: middle">

                                                <p>
                                                    <b>File format information</b>
                                                    <br>
                                                    <a id="upload_genotype_vcf_spreadsheet_info_format">VCF format</a>
                                                </p>
                                            
     </td>
  </tr>
</table>

                                        </div>
                                        <div class="col-sm-8">
                                            <br/>
                                            <div class="panel panel-default">
                                                <div class="panel-body">
                                                    <div class="form-group">
                                                        <label class="col-sm-6 control-label">Select VCF File: </label>
                                                        <div class="col-sm-6">
                                                            <input type="file" name="upload_genotype_vcf_file_input" id="upload_genotype_vcf_file_input" encoding="multipart/form-data" />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="well well-sm" id="upload_genotype_data_format_tassel_hdf5" style="display:none">
                                    <div class="row">
                                        <div class="col-sm-4">
                                            <table style="border: 1px solid gray; padding: 1em 2em; margin: 25px 15px; background: #f3f3ff;">
  <tr>
    <td>
      <img src="/documents/img/info_icon.png" border="0" style="margin: 10px; vertical-align: middle" />
    </td>
    <td style="padding-top: 0.35em; padding-right:0.35em; vertical-align: middle">

                                                <p>
                                                    <b>File format information</b>
                                                    <br>
                                                    <a id="upload_genotype_tassel_hdf5_info_format">VCF format</a>
                                                </p>
                                            
     </td>
  </tr>
</table>

                                        </div>
                                        <div class="col-sm-8">
                                            <br/>
                                            <div class="panel panel-default">
                                                <div class="panel-body">
                                                    <div class="form-group">
                                                        <label class="col-sm-6 control-label">Select Tassel HDF5 (.h5) File: </label>
                                                        <div class="col-sm-6">
                                                            <input type="file" name="upload_genotype_tassel_hdf5_file_input" id="upload_genotype_tassel_hdf5_file_input" encoding="multipart/form-data" />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="well well-sm" id="upload_genotype_data_format_intertek" style="display:none">
                                    <div class="row">
                                        <div class="col-sm-4">
                                            <table style="border: 1px solid gray; padding: 1em 2em; margin: 25px 15px; background: #f3f3ff;">
  <tr>
    <td>
      <img src="/documents/img/info_icon.png" border="0" style="margin: 10px; vertical-align: middle" />
    </td>
    <td style="padding-top: 0.35em; padding-right:0.35em; vertical-align: middle">

                                                <p>
                                                    <b>File format information</b>
                                                    <br>
                                                    <a id="upload_genotype_intertek_spreadsheet_info_format">Intertek format</a>
                                                </p>
                                            
     </td>
  </tr>
</table>

                                        </div>
                                        <div class="col-sm-8">
                                            <br/>
                                            <div class="panel panel-default">
                                                <div class="panel-body">
                                                    <div class="form-group">
                                                        <label class="col-sm-6 control-label">Select Intertek SNP Result Grid File: </label>
                                                        <div class="col-sm-6">
                                                            <input type="file" name="upload_genotype_intertek_file_input" id="upload_genotype_intertek_file_input" encoding="multipart/form-data" />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="panel panel-default">
                                                <div class="panel-body">
                                                    <div class="form-group">
                                                        <label class="col-sm-6 control-label">Select Intertek SNP Information File: </label>
                                                        <div class="col-sm-6">
                                                            <input type="file" name="upload_genotype_intertek_snp_file_input" id="upload_genotype_intertek_snp_file_input" encoding="multipart/form-data" />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="well well-sm" id="upload_genotype_data_format_kasp" style="display:none">
                                    <div class="row">
                                        <div class="col-sm-4">
                                            <table style="border: 1px solid gray; padding: 1em 2em; margin: 25px 15px; background: #f3f3ff;">
  <tr>
    <td>
      <img src="/documents/img/info_icon.png" border="0" style="margin: 10px; vertical-align: middle" />
    </td>
    <td style="padding-top: 0.35em; padding-right:0.35em; vertical-align: middle">

                                                <p>
                                                    <b>File format information</b>
                                                    <br>
                                                    <a id="upload_genotype_kasp_spreadsheet_info_format">KASP data format</a>
                                                </p>
                                            
     </td>
  </tr>
</table>

                                        </div>
                                        <div class="col-sm-8">
                                            <br/>
                                            <div class="panel panel-default">
                                                <div class="panel-body">
                                                    <div class="form-group">
                                                        <label class="col-sm-6 control-label">Select KASP Marker Information File (csv): </label>
                                                        <div class="col-sm-6">
                                                            <input type="file" name="upload_genotype_kasp_marker_info_file_input" id="upload_genotype_kasp_marker_info_file_input" encoding="multipart/form-data" />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="panel panel-default">
                                                <div class="panel-body">
                                                    <div class="form-group">
                                                        <label class="col-sm-6 control-label">Select KASP Result File (csv): </label>
                                                        <div class="col-sm-6">
                                                            <input type="file" name="upload_genotype_data_kasp_file_input" id="upload_genotype_data_kasp_file_input" encoding="multipart/form-data" />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="well well-sm" id="upload_genotype_data_format_ssr" style="display:none">
                                    <div class="row">
                                        <div class="col-sm-4">
                                            <table style="border: 1px solid gray; padding: 1em 2em; margin: 25px 15px; background: #f3f3ff;">
  <tr>
    <td>
      <img src="/documents/img/info_icon.png" border="0" style="margin: 10px; vertical-align: middle" />
    </td>
    <td style="padding-top: 0.35em; padding-right:0.35em; vertical-align: middle">

                                                <p>
                                                    <b>File format information</b>
                                                    <br>
                                                    <a id="upload_ssr_data_spreadsheet_info">SSR format</a>
                                                </p>
                                            
     </td>
  </tr>
</table>

                                        </div>
                                        <div class="col-sm-8">
                                            <br/>
                                            <div class="panel panel-default">
                                                <div class="panel-body">
                                                    <div class="form-group">
                                                        <label class="col-sm-6 control-label">Select SSR File: </label>
                                                        <div class="col-sm-6">
                                                            <input type="file" name="upload_genotype_ssr_file_input" id="upload_genotype_ssr_file_input" encoding="multipart/form-data" />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <br/><br/>
                                <center>
                                    <button type="button" class="btn btn-default" name="file_check_button" id="file_check_button">Check File Type</button>
                                    <button type="button" style="display:none" class="btn btn-primary" disabled onclick="Workflow.complete(this); return false;" id="genotyping_data_upload_next">Go to Next Step</button>
                                </center>
                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Finalize and submit your genotyping data</h3></div>


                                <div id="upload_genotypes_missing_stocks_div" style="display:none">
                                    <div id="upload_genotypes_add_missing_stocks_html">
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-5 control-label">Add these missing stocks as new accessions?: </label>
                                        <div class="col-sm-7">
                                            <select class="form-control" id="upload_genotype_add_new_accessions" name="upload_genotype_add_new_accessions">
                                                <option value="">No (currently disabled for safety)</option>
                                                <!--option value="1">Yes</option-->
                                            </select>
                                        </div>
                                    </div>
                                </div>

                                <div id="upload_genotypes_errors_div">
                                </div>

                                <div id="upload_genotypes_warnings_div" style="display:none">
                                    <div id="upload_genotypes_warnings_html">
                                    </div>
                                </div>

                                <center>
                                <button type="button" class="btn btn-primary" name="upload_genotype_submit" id="upload_genotype_submit">Submit</button>
                                </center>
                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Complete! Your genotyping data was saved in the database.</h3></div>


                                <p>
                                    <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                                    The genotyping data was saved successfully
                                </p>

                                <div id="upload_genotype_submit_complete"></div>

                                <br/>
                            </li>
      </ol>
      <div class="workflow-pending-message">Complete!</div>
      <div class="workflow-complete-message">Complete!</div>
    </div>
  </div>
</div>
<script type="text/javascript">
  Workflow.init("#upload_genotypes_workflow");
</script>

                    </div>
                    <div class="modal-footer">
                        <button type="reset" id="upload_genotype_data_close_modal_2" name="upload_genotype_data_close_modal" class="btn btn-default" >Close</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<div class="modal fade" id="upload_genotype_vcf_spreadsheet_info_format_dialog" name="upload_genotype_vcf_spreadsheet_info_format_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadGenotypeVCFDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="uploadGenotypeVCFDialog">Upload VCF Template Information</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <b>This is for uploading VCF genotype data.</b>
                    <br/>
                    <b>VCF is a tab separated format. If your VCF is very large (greater than 10GB), please consider converting it to an HDF5 (.h5) file using Tassel, and uploading the HDF5 formatted file instead.</b>
                    <br />
                    <b>Header:</b>
                    <br>
                    The first row (header) must contain the following fields, followed by all genotyped sample names:

                    <table class="table table-hover table-bordered table-condensed" >
                        <thead></thead>
                        <tbody>
                            <tr>
                                <td>#CHROM</td>
                                <td>POS</td>
                                <td>ID</td>
                                <td>REF</td>
                                <td>ALT</td>
                                <td>QUAL</td>
                                <td>FILTER</td>
                                <td>INFO</td>
                                <td>FORMAT</td>
                                <td>Sample names...</td>
                            </tr>
                        </tbody>
                    </table>

                    <b>Required fields:</b>
                    <ul>
                    <li>#CHROM (chromosome: An identifier from the reference genome pointing to a contig in the assembly file (cf. the ##assembly line in the header). All entries for a specific CHROM should form a contiguous block within the VCF file. The colon symbol (:) must be absent from all chromosome names to avoid parsing errors when dealing with breakends. (String, no white-space permitted, Required))</li>
                    <li>POS (position: The reference position, with the 1st base having position 1. Positions are sorted numerically, in increasing order, within each reference sequence CHROM. It is permitted to have multiple records with the same POS. Telomeres are indicated by using positions 0 or N+1, where N is the length of the corresponding chromosome or contig. (Integer, Required) )</li>
                    <li>ID ( identifier: Semi-colon separated list of unique identifiers where available. If this is a dbSNP variant it is encouraged to use the rs number(s). No identifier should be present in more than one data record. If there is no identifier available, then the missing value should be used. (String, no white-space or semi-colons permitted) )</li>
                    <li>REF (reference base(s): Each base must be one of A,C,G,T,N (case insensitive). Multiple bases are permitted. The value in the POS field refers to the position of the first base in the String. For simple insertions and deletions in which either the REF or one of the ALT alleles would otherwise be null/empty, the REF and ALT Strings must include the base before the event (which must be reflected in the POS field), unless the event occurs at position 1 on the contig in which case it must include the base after the event; this padding base is not required (although it is permitted) for e.g. complex substitutions or other events where all alleles have at least one base represented in their Strings. If any of the ALT alleles is a symbolic allele then the padding base is required and POS denotes the coordinate of the base preceding the polymorphism. Tools processing VCF files are not required to preserve case in the allele Strings. (String, Required) )</li>
                    <li>ALT (alternate base(s): Comma separated list of alternate non-reference alleles. These alleles do not have to be called in any of the samples. Options are base Strings made up of the bases A,C,G,T,N,*, (case insensitive) or a breakend replacement string as described in the section on breakends. The '*' allele is reserved to indicate that the allele is missing due to a upstream deletion. If there are no alternative alleles, then the missing value should be used. Tools processing VCF files are not required to preserve case in the allele String, except for IDs, which are case sensitive. (String; no whitespace, commas, or angle-brackets are permitted in the ID String itself) )</li>
                    <li>QUAL (quality: Phred-scaled quality score for the assertion made in ALT. i.e. -10log10 prob(call in ALT is wrong). If ALT is '.' (no variant) then this is -10log10 prob(variant), and if ALT is not '.' this is -10log10 prob(no variant). If unknown, the missing value should be specified. (Numeric) )</li>
                    <li>FILTER (filter status: PASS if this position has passed all filters, i.e. a call is made at this position. Otherwise, if the site has not passed all filters, a semicolon-separated list of codes for filters that fail. e.g. "q10;s50" might indicate that at this site the quality is below 10 and the number of samples with data is below 50% of the total number of samples. "0" is reserved and should not be used as a filter String. If filters have not been applied, then this field should be set to the missing value. (String, no white-space or semi-colons permitted) )</li>
                    <li>INFO (additional information: (String, no white-space, semi-colons, or equals-signs permitted; commas are permitted only as delimiters for lists of values) INFO fields are encoded as a semicolon-separated series of short keys with optional values in the format: key=data[,data]. Arbitrary keys are permitted, although the following sub-fields are reserved (albeit optional):</li>
                        <ul>
                            <li>AA : ancestral allele</li>
                            <li>AC : allele count in genotypes, for each ALT allele, in the same order as listed</li>
                            <li>AF : allele frequency for each ALT allele in the same order as listed: use this when estimated from primary data, not called genotypes</li>
                            <li>AN : total number of alleles in called genotypes</li>
                            <li>BQ : RMS base quality at this position</li>
                            <li>CIGAR : cigar string describing how to align an alternate allele to the reference allele</li>
                            <li>DB : dbSNP membership</li>
                            <li>DP : combined depth across samples, e.g. DP=154</li>
                            <li>END : end position of the variant described in this record (for use with symbolic alleles)</li>
                            <li>H2 : membership in hapmap2</li>
                            <li>H3 : membership in hapmap3</li>
                            <li>MQ : RMS mapping quality, e.g. MQ=52</li>
                            <li>MQ0 : Number of MAPQ == 0 reads covering this record</li>
                            <li>NS : Number of samples with data</li>
                            <li>SB : strand bias at this position</li>
                            <li>SOMATIC : indicates that the record is a somatic mutation, for cancer genomics</li>
                            <li>VALIDATED : validated by follow-up experiment</li>
                            <li>1000G : membership in 1000 Genomes</li>
                        </ul>
                    <br/>The exact format of each INFO sub-field should be specified in the meta-information (as described above). Example for an INFO field: DP=154;MQ=52;H2. Keys without corresponding values are allowed in order to indicate group membership (e.g. H2 indicates the SNP is found in HapMap 2). It is not necessary to list all the properties that a site does. )</li>
                    <li>FORMAT (A format field is given specifying the data types and order (colon-separated alphanumeric String). This is followed by one field per sample, with the colon-separated data in this field corresponding to the types specified in the format. The first sub-field must always be the genotype (GT) if it is present. There are no required sub-fields. As with the INFO field, there are several common, reserved keywords that are standards across the community:
                        <ul>
                            <li>GT : genotype, encoded as allele values separated by either of / or |. The allele values are 0 for the reference allele (what is in the REF field), 1 for the first allele listed in ALT, 2 for the second allele list in ALT and so on. For diploid calls examples could be 0/1, 1 | 0, or 1/2, etc. For haploid calls, e.g. on Y, male nonpseudoautosomal X, or mitochondrion, only one allele value should be given; a triploid call might look like 0/0/1. If a call cannot be made for a sample at a given locus, '.' should be specified for each missing allele in the GT field (for example './.' for a diploid genotype and '.' for haploid genotype). The meanings of the separators are as follows (see the PS field below for more details on incorporating phasing information into the genotypes):</li>
                            <ul>
                                <li>/ : genotype unphased</li>
                                <li>| : genotype phased</li>
                            </ul>
                            <li>DP : read depth at this position for this sample (Integer)</li>
                            <li>FT : sample genotype filter indicating if this genotype was "called" (similar in concept to the FILTER field). Again, use PASS to indicate that all filters have been passed, a semi-colon separated list of codes for filters that fail, or '.' to indicate that filters have not been applied. These values should be described in the metainformation in the same way as FILTERs (String, no white-space or semi-colons permitted)</li>
                            <li>GL : genotype likelihoods comprised of comma separated floating point log10-scaled likelihoods for all possible genotypes given the set of alleles defined in the REF and ALT fields. In presence of the GT field the same ploidy is expected and the canonical order is used; without GT field, diploidy is assumed. If A is the allele in REF and B,C,... are the alleles as ordered in ALT, the ordering of genotypes for the likelihoods is given by: F(j/k) = (k*(k+1)/2)+j. In other words, for biallelic sites the ordering is: AA,AB,BB; for triallelic sites the ordering is: AA,AB,BB,AC,BC,CC, etc. For example: GT:GL 0/1:-323.03,-99.29,-802.53 (Floats)</li>
                            <li>GLE : genotype likelihoods of heterogeneous ploidy, used in presence of uncertain copy number. For example: GLE=0:-75.22,1:-223.42,0/0:-323.03,1/0:-99.29,1/1:-802.53 (String)</li>
                            <li>PL : the phred-scaled genotype likelihoods rounded to the closest integer (and otherwise defined precisely as the GL field) (Integers)</li>
                            <li>GP : the phred-scaled genotype posterior probabilities (and otherwise defined precisely as the GL field); intended to store imputed genotype probabilities (Floats)</li>
                            <li>GQ : conditional genotype quality, encoded as a phred quality -10log10 p(genotype call is wrong, conditioned on the site's being variant) (Integer)</li>
                            <li>HQ : haplotype qualities, two comma separated phred qualities (Integers)</li>
                            <li>PS : phase set. A phase set is defined as a set of phased genotypes to which this genotype belongs. Phased genotypes for an individual that are on the same chromosome and have the same PS value are in the same phased set. A phase set specifies multi-marker haplotypes for the phased genotypes in the set. All phased genotypes that do not contain a PS subfield are assumed to belong to the same phased set. If the genotype in the GT field is unphased, the corresponding PS field is ignored. The recommended convention is to use the position of the first variant in the set as the PS identifier (although this is not required). (Non-negative 32-bit Integer)</li>
                            <li>PQ : phasing quality, the phred-scaled probability that alleles are ordered incorrectly in a heterozygote (against all other members in the phase set). We note that we have not yet included the specific measure for precisely defining "phasing quality"; our intention for now is simply to reserve the PQ tag for future use as a measure of phasing quality. (Integer)</li>
                            <li>EC : comma separated list of expected alternate allele counts for each alternate allele in the same order as listed in the ALT field (typically used in association analyses) (Integers)</li>
                            <li>MQ : RMS mapping quality, similar to the version in the INFO field. (Integer)</li>
                        </ul>
                    <br/>If any of the fields is missing, it is replaced with the missing value. For example if the FORMAT is GT:GQ:DP:HQ then 0 | 0 : . : 23 : 23, 34 indicates that GQ is missing. Trailing fields can be dropped (with the exception of the GT field, which should always be present if specified in the FORMAT field). )</li>
                    </ul>

                </div>
            </div>
            <div class="modal-footer">
                <button id="close_upload_genotyping_spreadsheet_info_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="upload_genotype_intertek_spreadsheet_info_format_dialog" name="upload_genotype_intertek_spreadsheet_info_format_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadGenotypeIntertekDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="uploadGenotypeIntertekDialog">Upload Intertek Template Information</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <b>This is for uploading Intertek genotype data.</b>
                    <br/>
                    <b>Please use csv formatted files</b>
                    <br/>
                    <br/>
                    <b>For Intertek SNP Result Grid File:</b>
                    <br>
                    <p>The header must be:</p>
                    <br/>

                    <table class="table table-hover table-bordered table-condensed" >
                        <thead></thead>
                        <tbody>
                            <tr>
                                <td>SampleName.LabID</td>
                                <td>All Marker Names In Separate Columns (e.g. marker name = S12_7926132)</td>
                            </tr>
                        </tbody>
                    </table>

                    <br/>
                    <p>The SampleName.LabID column should contain the sample name (exported_tissue_sample_name or accession_name) and it must exist in the database already</p>

                    <b>For Intertek SNP Information File:</b>
                    <br>
                    <p>The header must be:</p>
                    <br/>

                    <table class="table table-hover table-bordered table-condensed" >
                        <thead></thead>
                        <tbody>
                            <tr>
                                <td>IntertekSNPID</td>
                                <td>CustomerSNPID</td>
                                <td>Reference</td>
                                <td>Alternate</td>
                                <td>Chromosome</td>
                                <td>Position</td>
                                <td><b>Optional:</b> additional marker info can be included. Please see below.</td>
                            </tr>
                        </tbody>
                    </table>
                    <b>
                        Optional columns:
                    </b>
                    You can include additional marker infomation by selecting one or more column headers listed below. Please add the selected column(s) after "Position" column. </li>
                    <ul>
                        <li><b>Quality</b></li>
                        <li><b>Filter</b></li>
                        <li><b>Info</b></li>
                        <li><b>Format</b></li>
                        <li><b>Sequence</b></li>
                    </ul>
                </div>
            </div>
            <div class="modal-footer">
                <button id="close_upload_genotyping_intertek_spreadsheet_info_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="upload_genotype_tassel_hdf5_spreadsheet_info_format_dialog" name="upload_genotype_tassel_hdf5_spreadsheet_info_format_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadGenotypeTasselHDF5Dialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="uploadGenotypeTasselHDF5Dialog">Upload Tassel HDF5 Template Information</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <b>This is for uploading Tassel HDF5 genotype data.</b>
                    <br/>
                    <b>Please use HDF5 (.h5) formatted files that work with Tassel</b>
                    <br/>
                    <b>Uploading an HDF5 file is important when the size of the VCF grows greater than 10GB</b>
                    <br/>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="upload_ssr_protocol_format_dialog" name="upload_ssr_protocol_format_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadSSRProtocolFormatDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="uploadSSRProtocolFormatDialog">Upload SSR Marker Info Template Information</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <b>SSR marker info may be uploaded in an Excel file (.xls or .xlsx)</b>
                    <br />
                    <b>Header:</b>
                    <br>
                    The first row (header) must contain the following fields:

                    <table class="table table-hover table-bordered table-condensed" >
                        <thead></thead>
                        <tbody>
                            <tr>
                                <td>marker_name</td>
                                <td>forward_primer</td>
                                <td>reverse_primer</td>
                                <td>annealing_temperature</td>
                                <td>product_sizes</td>
                                <td>sequence_motif</td>
                                <td>sequence_source</td>
                                <td>linkage_group</td>
                            </tr>
                        </tbody>
                    </table>
                    <b>Required columns:</b>
                    <ul>
                        <li>marker_name</li>
                        <li>forward_primer</li>
                        <li>reverse_primer</li>
                        <li>annealing_temperature</li>
                        <li>product_sizes</li>
                    </ul>
                    <b>Optional columns (required in the header, but value may be left blank)</b>
                    <ul>
                        <li>sequence_motif</li>
                        <li>sequence_source</li>
                        <li>linkage_group</li>
                    </ul>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="upload_ssr_protocol_error_display" name="upload_ssr_protocol_error_display" tabindex="-1" role="dialog" aria-labelledby="uploadSSRProtocolErrorDialog">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="uploadSSRProtocolErrorDialog">Upload SSR Marker Info Error</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <table>
                        <tbody></tbody>
                    </table>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="ssr_protocol_saved_dialog_message" name="ssr_protocol_saved_dialog_message" tabindex="-1" role="dialog" aria-labelledby="SSRProtocolSavedDialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="SSRProtocolSavedDialog">Success</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <p>
                        <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                        SSR marker info was saved successfully. You can now proceed with SSR genotyping data upload.
                    </p>
                </div>
            </div>
            <div class="modal-footer">
                <button id="dismiss_ssr_protocol_saved_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="upload_ssr_protocol_dialog" name="upload_ssr_protocol_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadSSRProtocolDialog">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="uploadSSRProtocolDialog">Upload SSR Protocol (Marker Info) </h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" encoding="multipart/form-data" id="upload_ssr_protocol_form" name="upload_ssr_protocol_form">
                        <div class="form-group">
                            <label class="col-sm-5 control-label">SSR Protocol Name:</label>
                            <div class="col-sm-7">
                                <input class="form-control" id="upload_ssr_protocol_name" name="upload_ssr_protocol_name" type="text" placeholder=" e.g. SSR Cassava set 1"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-5 control-label">Species:</label>
                            <div class="col-sm-7">
                                <input class="form-control" id="upload_ssr_species_name_input" name="upload_ssr_species_name_input" type="text" placeholder=" e.g. Manihot esculenta"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-5 control-label">Description:</label>
                            <div class="col-sm-7">
                                <input class="form-control" id="upload_ssr_protocol_description_input" name="upload_ssr_protocol_description_input" type="text" />
                            </div>
                        </div>
<!--
                        <div class="form-group">
                            <label class="col-sm-5 control-label">Sample Type: </label>
                            <div class="col-sm-7">
                                <select class="form-control" id="upload_ssr_sample_type_select" name="upload_ssr_sample_type_select">
                                    <option value="">Select sample type</option>
                                    <option value="accession">Accession</option>
                                    <option value="tissue_sample">Tissue Sample</option>
                                </select>
                            </div>
                        </div>
-->
                        <div class="row">
                            <div class="col-sm-5">
                                <table style="border: 1px solid gray; padding: 1em 2em; margin: 25px 15px; background: #f3f3ff;">
  <tr>
    <td>
      <img src="/documents/img/info_icon.png" border="0" style="margin: 10px; vertical-align: middle" />
    </td>
    <td style="padding-top: 0.35em; padding-right:0.35em; vertical-align: middle">

                                    <p>
                                        <b>File format information</b>
                                        <br>
                                        <a id="upload_ssr_protocol_format">Spreadsheet format</a>
                                    </p>
                                
     </td>
  </tr>
</table>

                            </div>
                            <div class="col-sm-7">
                                <br/>
                                <div class="panel panel-default">
                                    <div class="panel-body">
                                        <div class="form-group">
                                            <label class="col-sm-4 control-label">Select an XLSX (or XLS) File: </label>
                                            <div class="col-sm-4">
                                                <input type="file" name="xls_ssr_protocol_file" id="xls_ssr_protocol_file" encoding="multipart/form-data" />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" name="upload_ssr_protocol_submit" id="upload_ssr_protocol_submit">Upload File</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="upload_ssr_spreadsheet_info_dialog" name="upload_ssr_spreadsheet_info_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadSSRSpreadsheetInfoDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="uploadSSRSpreadsheetInfoDialog">Upload SSR Data Template Information</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <b>SSR data may be uploaded in an Excel file (.xls or .xlsx)</b>
                    <br />
                    <b>Example of SSR Data Spreadsheet:</b>
                    <br>
                    <table class="table table-hover table-bordered table-condensed" >
                        <thead></thead>
                        <tbody>
                            <tr>
                                <td>sample_name</td>
                                <td>s01</td>
                                <td>s01</td>
                                <td>s01</td>
                                <td>s02</td>
                                <td>s02</td>
                                <td>s02</td>
                            </tr>
                        </tbody>
                        <thead></thead>
                        <tbody>
                            <tr>
                                <td></td>
                                <td>139</td>
                                <td>170</td>
                                <td>194</td>
                                <td>203</td>
                                <td>229</td>
                                <td>290</td>
                            </tr>
                        </tbody>
                        <thead></thead>
                        <tbody>
                            <tr>
                                <td>sample_A</td>
                                <td>1</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>1</td>
                                <td>1</td>
                            </tr>
                        </tbody>
                        <thead></thead>
                        <tbody>
                            <tr>
                                <td>sample_B</td>
                                <td>0</td>
                                <td>0</td>
                                <td>0</td>
                                <td>1</td>
                                <td>0</td>
                                <td>0</td>
                            </tr>
                        </tbody>
                        <thead></thead>
                        <tbody>
                            <tr>
                                <td>sample_C</td>
                                <td>0</td>
                                <td>1</td>
                                <td>1</td>
                                <td>0</td>
                                <td>1</td>
                                <td>0</td>
                            </tr>
                        </tbody>
                    </table>
                    <b>
                        Column Info:
                    </b>
                    <ul>
                        <li>s01 and s02 are marker names.</li>
                        <li>139, 170, 194 are product sizes generated by marker s01 and 203,229,290 are product sizes generated by marker s02.</li>
                        <li>sample_A, sample_B, sample_C are accession names.</li>
                        <li>"1" indicates the presence of PCR product.</li>
                        <li>"0" indicates the absence of PCR product.</li>
                        <br>
                    </ul>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="upload_genotype_kasp_spreadsheet_info_format_dialog" name="upload_genotype_kasp_spreadsheet_info_format_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadGenotypeKASPDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="uploadGenotypeKASPDialog">Upload KASP data Template Information</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <b>This is for uploading KASP genotype data.</b>
                    <br/>
                    <b>Please use csv formatted files</b>
                    <br/>
                    <br/>
                    <u><b>For KASP Marker Information File:</b></u>
                    <br>
                    <p>The header must be:</p>
                    <table class="table table-hover table-bordered table-condensed" >
                        <thead></thead>
                        <tbody>
                            <tr>
                                <td>MarkerName</td>
                                <td>Xallele</td>
                                <td>Yallele</td>
                                <td>Chromosome</td>
                                <td>Position</td>
                                <td><b>Optional:</b> additional marker info can be included. Please see below.</td>
                            </tr>
                        </tbody>
                    </table>
                    <b>Note:</b> For dosage calculation, Xallele is used as reference allele (0) and Yallele is used as alternative allele (1).
                    <br>
                    <b>Optional columns:</b>
                    You can include additional marker information by selecting one or more column headers listed below. Please add the selected column(s) after "Position" column. </li>
                    <ul>
                        <li>Quality</li>
                        <li>Filter</li>
                        <li>Info</li>
                        <li>Format</li>
                        <li>Sequence</li>
                        <li><b>FacilityMarkerName:</b> if you are uploading genotyping data by using facility marker names, please include these names in the KASP marker information file using "FacilityMarkerName" header</li>
                    </ul>
                    <hr class ="solid">
                    <u><b>For KASP Result File:</b></u>
                    <br>
                    <b>Note:</b> If your genotyping facility assigned facility marker names and facility sample names for the genotyping data generated, you have an option to directly use these facility names for uploading. After uploaded into database, the genotyping data will be automatically linked to the original marker names and sample names.
                    <br>
                    <br>
                    <p>If you are uploading genotyping data using your marker names and sample names, the header must be:</p>
                    <table class="table table-hover table-bordered table-condensed" >
                        <tbody>
                            <tr>
                                <td>MarkerName</td>
                                <td>SampleName</td>
                                <td>SNPcall</td>
                                <td>Xvalue</td>
                                <td>Yvalue</td>
                            </tr>
                        </tbody>
                    </table>
                    <b>
                        Required columns:
                    </b>
                    <ul>
                        <li><b>MarkerName:</b> Must exist in the marker information file. If you are uploading genotyping data using previously stored protocol, marker names must exist in the selected protocol.
                        <li><b>SampleName:</b> Must exist in the database as uniquenames.</li>
                        <li><b>SNPcall:</b> Allele separated by ":" (for example A:G).
                        <li><b>Xvalue:</b> raw data of X.
                        <li><b>Yvalue:</b> raw data of Y.
                    </ul>
                    <br>
                    <p>If you are uploading genotyping data using facility marker names and facility sample names, the header must be:</p>
                    <table class="table table-hover table-bordered table-condensed" >
                        <thead></thead>
                        <tbody>
                            <tr>
                                <td>FacilityMarkerName</td>
                                <td>FacilitySampleName</td>
                                <td>SNPcall</td>
                                <td>Xvalue</td>
                                <td>Yvalue</td>
                            </tr>
                        </tbody>
                    </table>
                    <b>
                        Required columns:
                    </b>
                    <ul>
                        <li><b>FacilityMarkerName:</b> Must exist in the marker information file.
                        <li><b>FacilitySampleName:</b> Must exist in the database. You can create a link between each sample name and facility sample name by including facility sample name during uploading genotyping plates</li>
                        <li><b>SNPcall:</b> Allele separated by ":" (for example A:G).
                        <li><b>Xvalue:</b> raw data of X.
                        <li><b>Yvalue:</b> raw data of Y.
                    </ul>
                </div>
            </div>
            <div class="modal-footer">
                <button id="close_upload_genotyping_kasp_spreadsheet_info_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<style>

.ui-autocomplete { z-index:2147483647; }

hr.solid { border-top: 3px solid #bbb; }

</style>

<script>
jQuery(document).ready(function(){

    jQuery('#genotype_data_type_select').change(function() {
        var data_type = jQuery('#genotype_data_type_select').val();

        document.getElementById('upload_genotype_data_type').value = data_type;

        if (data_type == 'vcf') {
            jQuery('#upload_genotype_data_format_vcf').show();
            jQuery('#upload_genotype_data_format_intertek').hide();
            jQuery('#upload_genotype_data_format_kasp').hide();
            jQuery('#upload_genotype_data_format_tassel_hdf5').hide();
            jQuery('#upload_genotype_data_format_ssr').hide();
        } else if (data_type == 'intertek') {
            jQuery('#upload_genotype_data_format_vcf').hide();
            jQuery('#upload_genotype_data_format_intertek').show();
            jQuery('#upload_genotype_data_format_kasp').hide();
            jQuery('#upload_genotype_data_format_tassel_hdf5').hide();
            jQuery('#upload_genotype_data_format_ssr').hide();
        } else if (data_type == 'tassel_hdf5') {
            jQuery('#upload_genotype_data_format_vcf').hide();
            jQuery('#upload_genotype_data_format_intertek').hide();
            jQuery('#upload_genotype_data_format_kasp').hide();
            jQuery('#upload_genotype_data_format_tassel_hdf5').show();
            jQuery('#upload_genotype_data_format_ssr').hide();
        } else if (data_type == 'ssr') {
            jQuery('#upload_genotype_data_format_vcf').hide();
            jQuery('#upload_genotype_data_format_intertek').hide();
            jQuery('#upload_genotype_data_format_kasp').hide();
            jQuery('#upload_genotype_data_format_tassel_hdf5').hide();
            jQuery('#upload_genotype_data_format_ssr').show();
        } else if (data_type == 'KASP') {
            jQuery('#upload_genotype_data_format_vcf').hide();
            jQuery('#upload_genotype_data_format_intertek').hide();
            jQuery('#upload_genotype_data_format_kasp').show();
            jQuery('#upload_genotype_data_format_tassel_hdf5').hide();
            jQuery('#upload_genotype_data_format_ssr').hide();
        }


    jQuery('#upload_genotyping_data_protocol_missing_button').click(function(){
        if (data_type == 'ssr') {
            selected = [];
            jQuery('input[name="upload_genotyping_data_protocol_select"]:checked').each(function() {
                selected.push(jQuery(this).val());
            });
            if (selected.length == 0){
                jQuery('#upload_ssr_protocol_dialog').modal('show');
                jQuery("#upload_ssr_species_name_input").autocomplete({
                    source: '/organism/autocomplete'
                });
            } else if (selected.length > 0) {
                alert('If you selected a protocol, do not try to make a new one at the same time!');
            }
        } else {
            jQuery('#upload_genotype_data_protocol_details').show();
        }
        return false;
    });

    });

    var upload_genotyping_data_trial_table = jQuery('#upload_genotyping_data_project_search_results').DataTable( {
        'ajax': {
            'url':'/ajax/genotyping_data/projects?select_checkbox_name=upload_genotyping_data_project_select',
        },
    });

    var upload_genotyping_data_protocol_table = jQuery('#upload_genotyping_data_protocol_search_results').DataTable( {
        'ajax': {
            'url':'/ajax/genotyping_data/protocols?select_checkbox_name=upload_genotyping_data_protocol_select',
        },
    });

    jQuery('#upload_genotyping_data_project_missing_button').click(function(){
        jQuery('#upload_genotyping_data_project_details').show();
        return false;
    });

    jQuery('#upload_genotyping_data_type_check_button').click(function(){
        var data_type = jQuery('#genotype_data_type_select').val();
        if (data_type == '') {
            alert('Please select a data type');
        } else {
            Workflow.complete('#upload_genotyping_data_type_check_button');
            Workflow.focus('#upload_genotypes_workflow', 2);
        }
    });

    jQuery('#upload_genotyping_data_project_check_button').click(function(){
        selected = [];
        jQuery('input[name="upload_genotyping_data_project_select"]:checked').each(function() {
            selected.push(jQuery(this).val());
        });
        if (selected.length > 1){
            alert('Only select one genotyping project!');
        } else {
            if (selected.length == 0 && jQuery('#upload_genotype_vcf_project_name').val() == ''){
                alert('Select a genotyping project or create a new one!');
            } else if (selected.length == 1 && jQuery('#upload_genotype_vcf_project_name').val() != ''){
                alert('If you selected a project, do not try to make a new one at the same time!');
            } else if (selected.length == 1 && jQuery('#upload_genotype_vcf_project_name').val() == ''){
                jQuery('#upload_genotype_project_id').val(selected[0]);
                Workflow.complete('#upload_genotyping_data_project_check_button');
                Workflow.focus('#upload_genotypes_workflow', 3);
            } else if (selected.length == 0 && jQuery('#upload_genotype_vcf_project_name').val() != '') {
                if (jQuery('#upload_genotype_year_select').val() == ''){
                    alert('Please give a year');
                } else if (jQuery('#upload_genotype_vcf_project_description').val() == ''){
                    alert('Please give a description.');
                } else {
                    jQuery('#upload_genotype_project_id').val(undefined);
                    Workflow.complete('#upload_genotyping_data_project_check_button');
                    Workflow.focus('#upload_genotypes_workflow', 3);
                }
            }
        }
        return false;
    });

    var ssr_protocol_id;

    jQuery('#upload_genotyping_data_protocol_check_button').click(function(){
        selected = [];
        jQuery('input[name="upload_genotyping_data_protocol_select"]:checked').each(function() {
            selected.push(jQuery(this).val());
        });
        if (selected.length > 1){
            alert('Only select one genotyping protocol!');
        } else {
            if (selected.length == 0 && jQuery('#upload_genotype_vcf_protocol_name').val() == '' && jQuery('#upload_genotype_protocol_id').val() == ''){
                alert('Select a genotyping protocol or create a new one!');
            } else if (selected.length == 1 && jQuery('#upload_genotype_vcf_protocol_name').val() != ''){
                alert('If you selected a protocol, do not try to make a new one at the same time!');
            } else if (selected.length == 1 && jQuery('#upload_genotype_vcf_protocol_name').val() == ''){
                jQuery('#upload_genotype_protocol_id').val(selected[0]);
                Workflow.complete('#upload_genotyping_data_protocol_check_button');
                Workflow.focus('#upload_genotypes_workflow', 4);
            } else if (selected.length == 0 && jQuery('#upload_genotype_protocol_id').val() != ''){
                Workflow.complete('#upload_genotyping_data_protocol_check_button');
                Workflow.focus('#upload_genotypes_workflow', 4);
            } else if (selected.length == 0 && jQuery('#upload_genotype_vcf_protocol_name').val() != '') {
                if (jQuery('#upload_genotype_vcf_reference_genome_name').val() == ''){
                    alert('Please give a reference genome name.');
                } else if (jQuery('#upload_genotypes_species_name_input').val() == ''){
                    alert('Please give a species name.');
                } else {
                    jQuery('#upload_genotype_protocol_id').val(undefined);
                    Workflow.complete('#upload_genotyping_data_protocol_check_button');
                    Workflow.focus('#upload_genotypes_workflow', 4);
                }
            }
        }
        return false;
    });

    jQuery('#file_check_button').click(function(){
        var data_type = jQuery('#genotype_data_type_select').val();
        if (data_type == 'vcf') {
            if (jQuery('#upload_genotype_vcf_file_input').val() == ''){
                alert('Please select a VCF file.');
            } else {
                jQuery('#file_check_button').hide();
                jQuery('#genotyping_data_upload_next').show();
                jQuery('#genotyping_data_upload_next').attr('disabled', false);
            }
        } else if (data_type == 'tassel_hdf5') {
            if (jQuery('#upload_genotype_tassel_hdf5_file_input').val() == ''){
                alert('Please select a Tassel HDF5 file.');
            } else {
                jQuery('#file_check_button').hide();
                jQuery('#genotyping_data_upload_next').show();
                jQuery('#genotyping_data_upload_next').attr('disabled', false);
            }
        } else if (data_type == 'intertek') {
            if (jQuery('#upload_genotype_intertek_file_input').val() == ''){
                alert('Please select an Intertek SNP Result Grid file.');
            } else if (jQuery('#upload_genotype_intertek_snp_file_input').val() == ''){
                alert('Please select an Intertek SNP Information File.');
            } else {
                jQuery('#file_check_button').hide();
                jQuery('#genotyping_data_upload_next').show();
                jQuery('#genotyping_data_upload_next').attr('disabled', false);
            }
        } else if (data_type == 'KASP') {
                if (jQuery('#upload_genotype_data_kasp_file_input').val() == ''){
                    alert('Please select a KASP Result file.');
                } else if (jQuery('#upload_genotype_kasp_marker_info_file_input').val() == ''){
                    alert('Please select a KASP Marker Information File.');
                } else {
                    jQuery('#file_check_button').hide();
                    jQuery('#genotyping_data_upload_next').show();
                    jQuery('#genotyping_data_upload_next').attr('disabled', false);
                }

        } else if (data_type == 'ssr') {
            if (jQuery('#upload_genotype_ssr_file_input').val() == ''){
                alert('Please select a SSR file.');
            } else {
                jQuery('#file_check_button').hide();
                jQuery('#genotyping_data_upload_next').show();
                jQuery('#genotyping_data_upload_next').attr('disabled', false);
            }
        }
    });

    jQuery('#upload_genotype_vcf_spreadsheet_info_format').click(function(){
        jQuery('#upload_genotype_vcf_spreadsheet_info_format_dialog').modal('show');
    });

    jQuery('#upload_genotype_tassel_hdf5_info_format').click(function(){
        jQuery('#upload_genotype_tassel_hdf5_spreadsheet_info_format_dialog').modal('show');
    });

    jQuery('#upload_genotype_intertek_spreadsheet_info_format').click(function(){
        jQuery('#upload_genotype_intertek_spreadsheet_info_format_dialog').modal('show');
    });

    jQuery('#upload_genotype_kasp_spreadsheet_info_format').click(function(){
        jQuery('#upload_genotype_kasp_spreadsheet_info_format_dialog').modal('show');
    });

    jQuery('#upload_ssr_data_spreadsheet_info').click(function(){
        jQuery('#upload_ssr_spreadsheet_info_dialog').modal('show');
    });

    jQuery('#upload_ssr_protocol_format').click(function(){
        jQuery('#upload_ssr_protocol_format_dialog').modal('show');
        jQuery('#upload_ssr_protocol_dialog').modal('hide');
    });

    jQuery("#upload_ssr_protocol_submit").click(function(){

        var ssr_protocol_name = jQuery("#upload_ssr_protocol_name").val();
        var ssr_protocol_species_name = jQuery("#upload_ssr_species_name_input").val();
        var ssr_protocol_description = jQuery("#upload_ssr_protocol_description_input").val();
        var uploadFile = jQuery("#xls_ssr_protocol_file").val();

        jQuery('#upload_ssr_protocol_form').attr("action", "/ajax/genotype/upload_ssr_protocol");
        if (ssr_protocol_name === ''){
            alert("Please give a protocol name");
            return;
        }
        if (ssr_protocol_species_name === ''){
            alert("Please give a species name");
            return;
        }
        if (ssr_protocol_description === ''){
            alert("Please give a description");
            return;
        }
        if (uploadFile === ''){
            alert("Please select a file");
            return;
        }
        jQuery('#upload_ssr_protocol_form').submit();
        jQuery('#upload_ssr_protocol_dialog').modal("hide");
    });

    jQuery('#upload_ssr_protocol_form').iframePostForm({
        json: true,
        post: function(){
            jQuery("#working_modal").modal("show");
        },
        complete: function(response) {
            jQuery("#working_modal").modal("hide");
            if (response.error_string) {
                jQuery("#upload_ssr_protocol_error_display tbody").html('');
                jQuery("#upload_ssr_protocol_error_display tbody").append(response.error_string);
                jQuery("#upload_ssr_protocol_error_display").modal("show");
                return;
            }
            if (response.error) {
                alert(response.error);
                return;
            }
            if (response.success) {
                jQuery('#ssr_protocol_saved_dialog_message').modal("show");

                ssr_protocol_id = response.protocol_id;
                jQuery('#upload_genotype_protocol_id').val(ssr_protocol_id);

            }

        }
    });

    jQuery("[name='upload_genotype_data_close_modal']").click(function() {
        jQuery('#upload_genotypes_dialog').modal('hide');
        location.reload();
    });



});
</script>





<div class="modal fade" id="genotyping_trial_dialog" name="genotyping_trial_dialog" tabindex="-1" role="dialog" aria-labelledby="addGenoTrialDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="addGenoTrialDialog">Add Genotyping Plate</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    









                        
    

                        
    

                        
    
                            
    
                            
    
                            
    

                            
  
                        
<div id="genotyping_trial_create_workflow" class="workflow">
  <ol class="workflow-prog">
      <li><div class="workflow-title">Intro</div></li>
      <li><div class="workflow-title">Genotyping Project</div></li>
      <li><div class="workflow-title">Basic Plate Info</div></li>
      <li><div class="workflow-title">Well Info</div></li>
      <li><div class="workflow-title">Trial Linkage</div></li>
      <li><div class="workflow-title">Confirm</div></li>
  </ol>
  <div class="panel panel-default">
    <div class="panel-body">
      <ol class="workflow-content">
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">This workflow will guide you through adding a genotyping plate in the database</h3></div>

                            <p>Genotyping plates represent 96 or 384 well plates.</p>
                            <p>Each plate has a globally unique Plate ID.</p>
                            <p>Each well in the plate has a globally unique tissue sample ID.</p>
                            <p>The "contents" of each well can be either a tissue sample, plant name, plot name, or accession name. This "source" name must be in the database already. This is useful if you provide a field trial entity (such as a plot or plant or tissue sample name), so that phenotypes and genotypes can be directly compared.</p>
                            <p>If you choose to submit your genotyping plate to a genotyping facility (Cornell IGD, Intertek, BGI, etc) we can generate the files they require for you. Please be aware of their requirements, such as blank well positions and concentrations.</p>
                            <p>In addition to sample ID, you have an option to include facility identifier for each well. </p>
                            <br/><br/>
                            <center>
                                <button id="next_step_intro_button" class="btn btn-primary" onclick="Workflow.complete(this); return false;">Go to Next Step</button>
                            </center>
                        </li>
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">Select a genotyping project</h3></div>

                            <p>Genotyping projects are for grouping genotyping plates and/or genotyping data together. Genotyping Project should match Vendor Project if you have one. </p>
                            <center>
                                <button class="btn btn-info" name="create_genotyping_project_link">If you need to create a genotyping project, click here</button><br/><br/>
                                <button id="next_step_creating_genotyping_plates" class="btn btn-primary" onclick="Workflow.complete(this);">Once you have a genotyping project, go to Next Step</button>
                            </center>
                        </li>
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">Provide info about your plate</h3></div>

                            <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" encoding="multipart/form-data" id="upload_genotyping_trials_form" name="upload_genotyping_trials_form">
                                <div class="form-group">
                                    <label class="col-sm-5 control-label">Genotyping Project Name: </label>
                                    <div class="col-sm-7">
                                        <span id="plate_genotyping_project_select_div"></span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-5 control-label">Genotyping Plate ID: <br/><small>-In Coordinate App this is called "Plate Name"<br/>-This is the globally unique name of the plate</small></label>
                                    <div class="col-sm-7">
                                        <input class="form-control" id="genotyping_trial_name" name="genotyping_trial_name" type="text" placeholder=" e.g. 18DNA00001"/>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-5 control-label">Plate Format: </label>
                                    <div class="col-sm-7">
                                        <select class="form-control" id="genotyping_trial_plate_format">
                                            <option value="96">96 Well</option>
                                            <option value="384">384 Well</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-5 control-label">Sample Type: </label>
                                    <div class="col-sm-7">
                                        <select class="form-control" id="genotyping_trial_plate_sample_type">
                                            <option value="DNA">DNA</option>
                                            <option value="RNA">RNA</option>
                                            <option value="Tissue">Tissue</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-5 control-label">Genotyping Plate's Description (optional): </label>
                                    <div class="col-sm-7">
                                        <textarea class="form-control" id="genotyping_trial_description" name="genotyping_trial_description" maxlength="250"></textarea>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-5 control-label">Include Identifiers Generated by Genotyping Facility <br/>(only for upload options):<br/></label>
                                    <div class="col-sm-7">
                                        <input type="checkbox" id="upload_include_facility_identifiers" name="upload_include_facility_identifiers" >
                                    </div>
                                </div>
                                <br/>
                                <center>
                                    <button id="plate_info_intro_button" class="btn btn-primary" onclick="Workflow.complete(this); return false;">Go to Next Step</button>
                                </center>
                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Provide information about the wells in your plate</h3></div>

                                <br/>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label text-align: right">Select One: </label>
                                    <div class="col-sm-9">
                                        <select class="form-control" id="genotyping_trial_well_input_option">
                                            <option value="">Select a file format that you want to upload</option>
                                            <option value="xlsx">I am uploading a plate design I made in Excel</option>
                                            <option value="coordinate">I am uploading a Default Coordinate Android Application plate design</option>
                                            <option value="coordinate_template">I am uploading a Custom Coordinate Android Application plate design</option>
                                            <option value="design">I need to design a completely new plate</option>
                                        </select>
                                    </div>
                                </div>
                                <br/><br/>

                                <div id="genotyping_trial_well_upload_section" style="display:none">
                                    <h3>You want to upload an existing plate layout</h3>
                                    <div class="well well-sm">
                                        <div class="row">
                                            <div class="col-sm-4">
                                                <table style="border: 1px solid gray; padding: 1em 2em; margin: 25px 15px; background: #f3f3ff;">
  <tr>
    <td>
      <img src="/documents/img/info_icon.png" border="0" style="margin: 10px; vertical-align: middle" />
    </td>
    <td style="padding-top: 0.35em; padding-right:0.35em; vertical-align: middle">

                                                    <p>
                                                        <b>File format information</b>
                                                        <br>
                                                        <a id="genotyping_trial_layout_upload_spreadsheet_info_format">Spreadsheet format</a>
                                                    </p>
                                                
     </td>
  </tr>
</table>

                                            </div>
                                            <div class="col-sm-8">
                                                <br/>
                                                <div class="panel panel-default">
                                                    <div class="panel-body">
                                                        <div class="form-group">
                                                            <label class="col-sm-6 control-label">Select Plate Layout XLSX File: </label>
                                                            <div class="col-sm-6">
                                                                <input type="file" name="genotyping_trial_layout_upload" id="genotyping_trial_layout_upload" encoding="multipart/form-data" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div id="genotyping_trial_well_coordinate_upload_section" style="display:none">
                                    <h3>You want to upload a Coordinate Android Application file.</h3>
                                    <div class="well well-sm">
                                        <div class="row">
                                            <div class="col-sm-4">
                                                <table style="border: 1px solid gray; padding: 1em 2em; margin: 25px 15px; background: #f3f3ff;">
  <tr>
    <td>
      <img src="/documents/img/info_icon.png" border="0" style="margin: 10px; vertical-align: middle" />
    </td>
    <td style="padding-top: 0.35em; padding-right:0.35em; vertical-align: middle">

                                                    <p>
                                                        <b>File format information</b>
                                                        <br>
                                                        <a id="genotyping_trial_layout_upload_coordinate_spreadsheet_info_format">Spreadsheet format</a>
                                                    </p>
                                                
     </td>
  </tr>
</table>

                                            </div>
                                            <div class="col-sm-8">
                                                <br/>
                                                <div class="panel panel-default">
                                                    <div class="panel-body">
                                                        <div class="form-group">
                                                            <label class="col-sm-6 control-label">Select Coordinate CSV File: </label>
                                                            <div class="col-sm-6">
                                                                <input type="file" name="genotyping_trial_layout_upload_coordinate" id="genotyping_trial_layout_upload_coordinate" encoding="multipart/form-data" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div id="genotyping_trial_well_coordinate_template_upload_section" style="display:none">
                                    <h3>You want to upload a Custom Android Application file.</h3>
                                    <div class="well well-sm">
                                        <div class="row">
                                            <div class="col-sm-4">
                                                <table style="border: 1px solid gray; padding: 1em 2em; margin: 25px 15px; background: #f3f3ff;">
  <tr>
    <td>
      <img src="/documents/img/info_icon.png" border="0" style="margin: 10px; vertical-align: middle" />
    </td>
    <td style="padding-top: 0.35em; padding-right:0.35em; vertical-align: middle">

                                                    <p>
                                                        <b>File format information</b>
                                                        <br>
                                                        <a id="genotyping_trial_layout_upload_coordinate_custom_spreadsheet_info_format">Spreadsheet format</a>
                                                    </p>
                                                
     </td>
  </tr>
</table>

                                            </div>
                                            <div class="col-sm-8">
                                                <br/>
                                                <div class="panel panel-default">
                                                    <div class="panel-body">
                                                        <div class="form-group">
                                                            <label class="col-sm-6 control-label">Select Coordinate CSV File: </label>
                                                            <div class="col-sm-6">
                                                                <input type="file" name="genotyping_trial_layout_upload_coordinate_template" id="genotyping_trial_layout_upload_coordinate_template" encoding="multipart/form-data" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div id="genotyping_trial_well_design_section" style="display:none">
                                    <h3>You want to design a completely new plate.</h3>
                                    <div class="well well-sm">
                                        <ul>
                                            <li>Select a list for the source material going into each well. Your list should be a one to one pairing to each well e.g. if you want to fill 95 wells you should supply a list of 95 elements.</li>
                                            <li>Note: From the most desirable to least desirable source observation unit you can choose: tissue samples, plants, plots, or accessions</li>
                                        </ul>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-7 control-label">Source Observation Unit List: </label>
                                        <div class="col-sm-5">
                                            <span id="accession_select_box_span">[loading...]</span>
                                        </div>
                                    </div>
                                    <br/>
                                    <br/>
                                    <div class="form-group form-group-sm">
                                        <label class="col-sm-7 control-label"><i>Optional</i> Blank Well: <small>(Cornell IGD requires a specific well to be blank.)</small></label>
                                        <div class="col-sm-5">
                                            <input class="form-control" id="genotyping_blank_well" name="genotyping_blank_well" type="text" placeholder="e.g. A01"/>
                                        </div>
                                    </div>
                                    <br/>
                                    <div class="form-group form-group-sm">
                                        <label class="col-sm-7 control-label"><i>Optional</i> Well Concentration (ng/ul): <small>(If you used the same conc for all wells)</small></label>
                                        <div class="col-sm-5">
                                            <input class="form-control" id="genotyping_well_concentration" name="genotyping_well_concentration" type="text" />
                                        </div>
                                    </div>
                                    <br/>
                                    <div class="form-group form-group-sm">
                                        <label class="col-sm-7 control-label"><i>Optional</i> Well Volume (ul): <small>(If you used the same vol for all wells)</small></label>
                                        <div class="col-sm-5">
                                            <input class="form-control" id="genotyping_well_volume" name="genotyping_well_volume" type="text" />
                                        </div>
                                    </div>
                                    <br/>
                                    <div class="form-group form-group-sm">
                                        <label class="col-sm-7 control-label"><i>Optional</i> Tissue: <small>(If used the same tissue for all wells)</small> </label>
                                        <div class="col-sm-5">
                                            <select class="form-control" id="genotyping_well_tissue">
                                                <option value="leaf">Leaf</option>
                                                <option value="root">Root</option>
                                                <option value="stem">Stem</option>
                                                <option value="seed">Seed</option>
                                                <option value="fruit">Fruit</option>
                                                <option value="tuber">Tuber</option>
                                            </select>
                                        </div>
                                    </div>
                                    <br/>
                                    <div class="form-group form-group-sm">
                                        <label class="col-sm-7 control-label"><i>Optional</i> NCBI Taxonomy ID: <small>(Official NCBI ID.)</small> </label>
                                        <div class="col-sm-5">
                                            <input class="form-control" id="genotyping_well_ncbi_taxonomy_id" name="genotyping_well_ncbi_taxonomy_id" type="text" />
                                        </div>
                                    </div>
                                    <br/>
                                    <div class="form-group form-group-sm">
                                        <label class="col-sm-7 control-label"><i>Optional</i> Extraction: <small>(If used the same extraction for all wells)</small> </label>
                                        <div class="col-sm-5">
                                            <input class="form-control" id="genotyping_well_extraction" name="genotyping_well_extraction" type="text" />
                                        </div>
                                    </div>
                                    <br/>
                                    <div class="form-group form-group-sm">
                                        <label class="col-sm-7 control-label"><i>Optional</i> Person: <small>(If same person prepared all wells.)</small> </label>
                                        <div class="col-sm-5">
                                            <input class="form-control" id="genotyping_well_dna_person" name="genotyping_well_dna_person" type="text" />
                                        </div>
                                    </div>
                                    <br/>
                                    <div class="form-group form-group-sm">
                                        <label class="col-sm-7 control-label"><i>Optional</i> Date: <small>(If plated on same date. YYYY/MM/DD)</small> </label>
                                        <div class="col-sm-5">
                                            <input class="form-control" id="genotyping_well_date" name="genotyping_well_date" type="text" placeholder="YYYY/MM/DD"/>
                                        </div>
                                    </div>
                                    <br/>
                                    <div class="form-group form-group-sm">
                                        <label class="col-sm-7 control-label"><i>Optional</i> Notes: <small>(Additional notes for these wells.)</small> </label>
                                        <div class="col-sm-5">
                                            <input class="form-control" id="genotyping_well_notes" name="genotyping_well_notes" type="text" />
                                        </div>
                                    </div>
                                </div>

                                <br/>
                                <div id="next_upload_button" style="display:none">
                                    <center>
                                        <button id="well_info_intro_button" class="btn btn-primary" onclick="Workflow.complete(this); return false;">Go to Next Step</button>
                                    </center>
                                </div>
                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Is your genotyping plate linked with field trials in the database? This information can also be added from the genotyping plate detail page once the trial is saved in the database.</h3></div>

                                <p>If you provided us with information about where the tissue sample in each well originated (e.g. it came from a plot name or plant name or tissue sample name in a field trial), we will automatically create linkage between the field trial(s) and this genotyping plate.</p>
                                <br/>
                                <center>
                                    <button id="trial_linkage_intro_button"  class="btn btn-lg btn-primary" onclick="Workflow.complete(this); return false;" >Continue to Next Step</button>
                                <center>
                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Finalize and submit your genotyping plate</h3></div>


                                <p>Automatic submission to the Genotyping Facility currently not working. You can submit it from the Genotyping Plate's detail page or download the information from the Genotyping Plate's detail page and submit it yourself after clicking Submit</p>
<!--
                                <div class="form-group">
                                    <label class="col-sm-5 control-label">Along with saving this information to this database, I want to automatically submit to the Genotyping Facility: <small>Automatic submission currently not working. You can submit it from the Genotyping Plate's detail page or download the information from the Genotyping Plate's detail page and submit it yourself after clicking Submit</small></label>
                                    <div class="col-sm-7">
                                        <select class="form-control" id="genotyping_trial_facility_submit_select" disabled>
                                            <option value="no">No</option>
                                            <option value="yes">Yes</option>
                                        </select>
                                    </div>
                                </div>
-->
                                <input name="genotyping_trial_facility_submit_select" id="genotyping_trial_facility_submit_select" type="hidden" value="no">

                                </form>
                                <hr/>
                                <center>
                                    <button type="button" class="btn btn-primary" name="add_geno_trial_submit" id="add_geno_trial_submit">Submit</button>
                                </center>
                            </li>
      </ol>
      <div class="workflow-pending-message">
                                <div id="pagetitle"><h3 id="pagetitle_h3">Complete! Your genotyping plate was saved in the database.</h3></div>

                                <p>
                                    <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                                    The genotyping plate was saved successfully
                                </p>
                                <ul>
                                    <li>You may want to proceed to the genotyping plate detail page for the trial you just created.</li>
                                    <li>You can print barcodes for the plate and tissue samples.</li>
                                </ul>
                                <br/>
                            </div>
      <div class="workflow-complete-message">
                                <div id="pagetitle"><h3 id="pagetitle_h3">Complete! Your genotyping plate was saved in the database.</h3></div>

                                <p>
                                    <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                                    The genotyping plate was saved successfully
                                </p>
                                <ul>
                                    <li>You may want to proceed to the genotyping plate detail page for the trial you just created.</li>
                                    <li>You can print barcodes for the plate and tissue samples.</li>
                                </ul>
                                <br/>
                            </div>
    </div>
  </div>
</div>
<script type="text/javascript">
  Workflow.init("#genotyping_trial_create_workflow");
</script>

                    </div>
            </div>
            <div class="modal-footer">
                <button id="close_trial_button" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="genotyping_trial_layout_upload_spreadsheet_info_format_dialog" name="genotyping_trial_layout_upload_spreadsheet_info_format_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadGenotypingTrialInfoDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="uploadGenotypingTrialInfoDialog">Upload Template Information</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <b>This is for uploading a pre-existing genotyping plate layout.</b>
                    <br/>
                    <b>File must be Excel file (.xls or .xlsx)</b>
                    <br />
                    <b>Header:</b>
                    <br>
                    The first row (header) must contain the following:

                    <table class="table table-hover table-bordered table-condensed" >
                        <thead></thead>
                        <tbody>
                            <tr>
                                <td>date</td>
                                <td>sample_id</td>
                                <td>well_A01</td>
                                <td>row</td>
                                <td>column</td>
                                <td>source_observation_unit_name</td>
                                <td>ncbi_taxonomy_id</td>
                                <td>dna_person</td>
                                <td>notes</td>
                                <td>tissue_type</td>
                                <td>extraction</td>
                                <td>concentration</td>
                                <td>volume</td>
                                <td>is_blank</td>
                            </tr>
                        </tbody>
                    </table>
                    Optional column: In addition to sample ids, you can add facility identifiers in the last column with the header: "facility_identifier".
                    <br/><br/>
                    <b>Required fields:</b>
                    <ul>
                    <li>date (should be YYYY-MM-DD)</li>
                    <li>sample_id (the unique identifier for the sample in the well)</li>
                    <li>well_A01 (the position of the sample in the plate e.q. A10)</li>
                    <li>row (the row position of the sample in the plate e.g. A)</li>
                    <li>column (the column position of the sample in the plate e.g. 10)</li>
                    <li>source_observation_unit_name (must exist in the database. the identifier of the origin material. in order of most desirable identifier to least desirable identifier that can be used here: tissue sample name, plant name, plot name, accession name. For blank wells, you can write BLANK here and place a 1 in the is_blank column also.)</li>
                    <li>tissue_type (must be either leaf, root, stem, seed, fruit or tuber)</li>
                    </ul>

                    <b>Optional fields:</b>
                    <ul>
                    <li>ncbi_taxonomy_id (NCBI taxonomy identifier)</li>
                    <li>dna_person (the name of the person who prepared the well)</li>
                    <li>notes (any additional notes on the well)</li>
                    <li>extraction (free-text for the extraction method e.g. CTAB)</li>
                    <li>concentration (concentration in ng/ul)</li>
                    <li>volume (volume in ul)</li>
                    <li>is_blank (indicates if well is blank. write 1 if blank, otherwise leave empty.)</li>
                    <li>facility_identifier (if you would like to include facility identifiers in your genotyping plate layout, you can add facility identifiers in the last column with the header <b>"facility_identifier"</b>)</li>
                    </ul>

                </div>
            </div>
            <div class="modal-footer">
                <button id="close_upload_genotyping_spreadsheet_info_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="genotyping_trial_layout_upload_coordinate_info_format_dialog" name="genotyping_trial_layout_upload_coordinate_info_format_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadGenotypingTrialCoordinateInfoDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="uploadGenotypingTrialCoordinateInfoDialog">Upload Template Information</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <b>This is for uploading a Default Coordinate Android Application exported plate layout.</b>
                    <br/>
                    <b>File must be a CSV file (.csv)</b>
                    <br />
                    (Excel format not supported)
                    <br /><br />
                    <b>Header:</b>
                    <br>
                    The first row (header) must contain the following:

                    <table class="table table-hover table-bordered table-condensed" >
                        <thead></thead>
                        <tbody>
                            <tr>
                                <td>date</td>
                                <td>plate_id</td>
                                <td>plate_name</td>
                                <td>sample_id</td>
                                <td>well_A01</td>
                                <td>well_01A</td>
                                <td>tissue_id</td>
                                <td>dna_person</td>
                                <td>notes</td>
                                <td>tissue_type</td>
                                <td>extraction</td>
                            </tr>
                        </tbody>
                    </table>
                    Optional column: In addition to sample ids, you can add facility identifiers in the last column with the header: "facility_identifier".
                    <br/><br/>
                    <b>Required fields:</b>
                    <ul>
                    <li>date (should be YYYY-MM-DD)</li>
                    <li>plate_id (an identifier for a grouping of plates. called "Genotyping Project Name" in genotyping plate submission form. e.g. NextGenCassava)</li>
                    <li>plate_name (the unique name for the individual plate. called "Plate ID" in genotyping plate submission form. e.g. 18DNA00001)</li>
                    <li>sample_id (the unique identifier for the sample in the well. e.g. 18DNA00001_A01)</li>
                    <li>well_A01 (the position of the sample in the plate in this format A01)</li>
                    <li>well_01A (the position of the sample in the plate in this format 01A)</li>
                    <li>tissue_id (the identifier of the origin material. in order of most desirable identifier to least desirable identifier that can be used here: tissue sample name, plant name, plot name, accession name. this can also say 'BLANK' to indicate a blank well.)</li>
                    <li>dna_person (the name of the person who plated the individual sample. can be any name.)</li>
                    <li>tissue_type (must be either leaf, root, or stem)</li>
                    </ul>

                    <b>Optional fields:</b>
                    <ul>
                    <li>notes (any additional notes on the well)</li>
                    <li>extraction (free-text for the extraction method e.g. CTAB)</li>
                    <li>facility_identifier (if you would like to include facility identifiers in your genotyping plate layout, you can add facility identifiers in the last column with the header <b>"facility_identifier"</b>)</li>
                    </ul>

                </div>
            </div>
            <div class="modal-footer">
                <button id="close_upload_genotyping_coordinate_info_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="genotyping_trial_layout_upload_coordinate_custom_info_format_dialog" name="genotyping_trial_layout_upload_coordinate_custom_info_format_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadGenotypingTrialCoordinateCustomInfoDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="uploadGenotypingTrialCoordinateCustomInfoDialog">Upload Template Information</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <b>This is for uploading a Custom Coordinate Android Application exported plate layout.</b>
                    <br/>
                    <b>File must be a CSV file (.csv)</b>
                    <br />
                    (Excel format not supported)
                    <br /><br />
                    <b>Header:</b>
                    <br

                    <p>Note that tissue type will be set to 'leaf' if you use this upload type, since tissue type is not provided in the upload and tissue type is required for DaRT.</p>

                    The first row (header) must contain the following:

                    <table class="table table-hover table-bordered table-condensed" >
                        <thead></thead>
                        <tbody>
                            <tr>
                                <td>Value</td>
                                <td>Column</td>
                                <td>Row</td>
                                <td>Identification</td>
                                <td>Person</td>
                                <td>Date</td>
                            </tr>
                        </tbody>
                    </table>
                    Optional column: In addition to sample ids, you can add facility identifiers in the last column with the header: "Facility Identifier".
                    <br/><br/>
                    <b>Required fields:</b>
                    <ul>
                        <li>Value (the identifier of the origin material. e.g. 2018MyPlant0001. in order of most desirable identifier to least desirable identifier that can be used here: tissue sample name, plant name, plot name, accession name. This can also say 'exclude' to indicate a BLANK)</li>
                        <li>Column (the column position of the sample e.g. 10)</li>
                        <li>Row (the row position of the sample e.g. A)</li>
                        <li>Identification (free text)</li>
                        <li>Person (the name of the person who plated the individual sample. can be any name.)</li>
                        <li>Date (should be YYYY-MM-DD)</li>
                    </ul>
                    <b>Optional field:</b>
                    <ul>
                        <li>Facility Identifier (if you would like to include facility identifiers in your genotyping plate layout, you can add facility identifiers in the last column with the header <b>"Facility Identifier"</b>)</li>
                    </ul>

                </div>
            </div>
            <div class="modal-footer">
                <button id="close_upload_genotyping_coordinate_custom_info_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<script>
jQuery(document).ready(function(){

    jQuery('#genotyping_trial_layout_upload_spreadsheet_info_format').click(function(){
        jQuery('#genotyping_trial_layout_upload_spreadsheet_info_format_dialog').modal('show');
    });

    jQuery('#genotyping_trial_layout_upload_coordinate_spreadsheet_info_format').click(function(){
        jQuery('#genotyping_trial_layout_upload_coordinate_info_format_dialog').modal('show');
    });

    jQuery('#genotyping_trial_layout_upload_coordinate_custom_spreadsheet_info_format').click(function(){
        jQuery('#genotyping_trial_layout_upload_coordinate_custom_info_format_dialog').modal('show');
    });

    jQuery('#genotyping_trial_well_input_option').change(function(){
        if (jQuery(this).val() == 'xlsx'){
            jQuery("#genotyping_trial_well_upload_section").show();
            jQuery('#next_upload_button').show();
            jQuery("#genotyping_trial_well_design_section").hide();
            jQuery('#genotyping_trial_well_coordinate_upload_section').hide();
            jQuery('#genotyping_trial_well_coordinate_template_upload_section').hide();
            jQuery('#genotyping_trial_layout_upload_coordinate').val('');
            jQuery('#genotyping_trial_layout_upload_coordinate_template').val('');
        }
        if(jQuery(this).val() == 'coordinate'){
            jQuery('#genotyping_trial_well_coordinate_upload_section').show();
            jQuery('#next_upload_button').show();
            jQuery("#genotyping_trial_well_design_section").hide();
            jQuery("#genotyping_trial_well_upload_section").hide();
            jQuery('#genotyping_trial_well_coordinate_template_upload_section').hide();
            jQuery('#genotyping_trial_layout_upload').val('');
            jQuery('#genotyping_trial_layout_upload_coordinate_template').val('');
        }
        if(jQuery(this).val() == 'coordinate_template'){
            jQuery('#genotyping_trial_well_coordinate_template_upload_section').show();
            jQuery('#next_upload_button').show();
            jQuery('#genotyping_trial_well_coordinate_upload_section').hide();
            jQuery("#genotyping_trial_well_design_section").hide();
            jQuery("#genotyping_trial_well_upload_section").hide();
            jQuery('#genotyping_trial_layout_upload').val('');
            jQuery('#genotyping_trial_layout_upload_coordinate').val('');
        }
        if (jQuery(this).val() == 'design' ){
            jQuery("#genotyping_trial_well_design_section").show();
            jQuery('#next_upload_button').show();
            jQuery("#genotyping_trial_well_upload_section").hide();
            jQuery('#genotyping_trial_well_coordinate_upload_section').hide();
            jQuery('#genotyping_trial_well_coordinate_template_upload_section').hide();
            jQuery('#genotyping_trial_layout_upload_coordinate').val('');
            jQuery('#genotyping_trial_layout_upload').val('');
            jQuery('#genotyping_trial_layout_upload_coordinate_template').val('');
        }
    });

    get_select_box('breeding_programs', 'plate_breeding_program_select_div', {'name' : 'plate_breeding_program_id', 'id' : 'plate_breeding_program_id', 'empty': 1  });

    jQuery('#next_step_creating_genotyping_plates').click(function(){
        get_select_box('projects', 'plate_genotyping_project_select_div', { 'name' : 'plate_genotyping_project_id', 'id' : 'plate_genotyping_project_id', 'get_genotyping_projects': '1', 'empty':1});
    });

});
</script>



<div class="modal fade" id="upload_seedlot_inventory_dialog" name="upload_seedlot_inventory_dialog" tabindex="-1" role="dialog" aria-labelledby="seedlot_upload_inventory_dialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="seedlot_upload_inventory_dialog">Upload Seedlot Inventory</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">

                    









                        
    

                        
    
                        
    
                        
    
                        
    
                        
  
                    
<div id="upload_seedlot_inventory_workflow" class="workflow">
  <ol class="workflow-prog">
      <li><div class="workflow-title">Intro</div></li>
      <li><div class="workflow-title">File format</div></li>
      <li><div class="workflow-title">Upload inventory</div></li>
      <li><div class="workflow-title">Fix missing seedlots problem</div></li>
      <li><div class="workflow-title">Try submitting inventory again</div></li>
  </ol>
  <div class="panel panel-default">
    <div class="panel-body">
      <ol class="workflow-content">
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">What is a seedlot inventory?</h3></div>

                            <ul>
                            <li>Seedlots represent physical seed in packets.</li>
                            <li>This seed can be from crosses or for named accessions.</li>
                            <li>Seedlots can have a specific location, box, weight(g), and count.</li>
                            <li>Seedlots can belong to breeding programs and organizations.</li>
                            <li>Seedlots can be used in trials (e.g. they were planted in a plot) and they can be harvested from a plot or plant (e.g. a cross was performed and seeds were collected.)</li>
                            <li>A seedlot inventory consists of giving a location and current weight(g) to your seedlots. The seedlot name is the unique identifier for each seedlot and so should be encoded in a barcode on each seedlot packet.</li>
                            <li>You can use the "Inventory" Android Application to scan seedlot barcodes and record weight. If you prefer you can create your own CSV file and upload that, if you do not want to use the Inventory Application. For info about the format of the file to upload, go to the next tab.</li>
                            <!-- li><b>For more info about the "Seed Inventory" Android Application go to <a href="https://play.google.com/store/apps/details?id=org.wheatgenetics.inventory/">Inventory</a>.</b></li --><!-- Note: inventory app is being revamped, until then link to Google app store doesn't work, re-instate as soon as new version is up -->
                            <li>It is also possible to manually enter a transaction by going to the seedlot detail page and clicking "Add New Transaction".</li>
                            </ul>

                            <br/><br/>
                            <center>
                                <button class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
                            </center>
                        </li>
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">Make sure you are collecting seedlot inventory in the following format</h3></div>


                            <p>The "Seed Inventory" Android Application will export this same exact format by default.</p>

                            <br/><br/>
                            <center>
                                <button class="btn btn-info" id="seedlot_upload_inventory_spreadsheet_format_info">Info about file format</button><br/><br/>
                                <button class="btn btn-primary" onclick="Workflow.complete(this);">Once you think your file matches, go to Next Step</button>
                            </center>
                        </li>
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">Select your file and upload seedlot inventory</h3></div>


                            <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" encoding="multipart/form-data" id="upload_seedlot_inventory_form" name="upload_seedlot_inventory_form">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Upload File (.csv): </label>
                                    <div class="col-sm-9" >
                                        <input type="file" name="seedlot_uploaded_inventory_file" id="seedlot_uploaded_inventory_file" encoding="multipart/form-data" />
                                    </div>
                                </div>
                            </form>

                            <br/><br/>
                            <center>
                                <button name="upload_seedlot_inventory_button" onclick="Workflow.complete(this, false);" type="button" class="btn btn-primary" >Submit</button>
                            </center>
                        </li>
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">Fixing the missing seedlot(s) problem</h3></div>


                            <div id="upload_seedlot_inventory_missing_seedlots_div" style="display:none">
                                <div class="well">
                                    <ul>
                                        <li>Seedlots must exist in the database prior to updating or adding inventory. The reason for this is that the inventory does not give information about the content (a named accession or a cross name) and this information is required for a seedlot to exist in the database. We also want to be careful about adding new seedlots into the database because we do not want data to be incorrectly linked to duplicates.</li>
                                    </ul>
                                </div>
                                <ul>
                                <li>When adding seedlots into the database, you can upload an Excel file or you can add seedlots one at a time.<br/><br/>
                                    <ul>
                                    <li><button class="btn btn-info" name="seedlot_bulk_upload">Upload Excel file</button><br/><br/></li>
                                    <li><button class="btn btn-info" name="add_seedlot_button">Add One Seedlot</button></li>
                                    </ul>
                                </li>
                                </ul><br/>
                                <button class="btn btn-primary" onclick="Workflow.complete(this);">Once all your seedlots are in the database Click Here</button><br/><br/>
                            </div>
                            <div id="upload_seedlot_inventory_error_display">

                                <h3>Seedlot Inventory Upload Error Messages</h3>
                                <div class="panel panel-danger">
                                    <div class="panel-body">
                                        <table>
                                            <tbody></tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                            <center>
                            <div id="upload_seedlot_inventory_no_error_messages_html">
                            </div>
                            <div name="upload_seedlot_inventory_completed_message">
                            </div>
                            </center>
                        </li>
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">Submit your inventory again. You should have corrected all errors by now, but if not please take a look at the errors in the red box below. You can continue to modify your file and then click Upload until it works.</h3></div>

                            <div id="seedlot_inventory_upload_show_repeat_upload_button">
                                <center>
                                <button type="button" class="btn btn-lg btn-primary" name="upload_seedlot_inventory_button" >Upload Seedlot Inventory</button><br/><br/>
                                </center>
                            </div>
                            <center>
                            <div name="upload_seedlot_inventory_completed_message">
                            </div>
                            </center>

                            <div id="upload_seedlot_inventory_error_display_second_try" style="display:none">

                                <h3>There exist these problems in your file:</h3>
                                <div class="panel panel-danger">
                                    <div class="panel-body">
                                        <table>
                                            <tbody></tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </li>
      </ol>
      <div class="workflow-pending-message">
                            <div id="pagetitle"><h3 id="pagetitle_h3">Finished! Your seedlot inventory is in the database</h3></div>

                            <p>
                                <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                                The seedlot inventory file was uploaded successfully
                            </p>

                            <ul>
                                <li>You may want to proceed to the seedlot detail page(s) for the seedlot(s) you just updated.</li>
                                <li>You can print barcodes for the seedlots.</li>
                            </ul>
                            <br/>
                        </div>
      <div class="workflow-complete-message">
                            <div id="pagetitle"><h3 id="pagetitle_h3">Finished! Your seedlot inventory is in the database</h3></div>

                            <p>
                                <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                                The seedlot inventory file was uploaded successfully
                            </p>

                            <ul>
                                <li>You may want to proceed to the seedlot detail page(s) for the seedlot(s) you just updated.</li>
                                <li>You can print barcodes for the seedlots.</li>
                            </ul>
                            <br/>
                        </div>
    </div>
  </div>
</div>
<script type="text/javascript">
  Workflow.init("#upload_seedlot_inventory_workflow");
</script>
<!-- End of workflow -->

                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="seedlot_upload_inventory_spreadsheet_info_dialog" name="seedlot_upload_inventory_spreadsheet_info_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadSeedlotInventoryInfoDialog">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="uploadSeedlotInventoryInfoDialog">Upload Template Information</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <b>Seedlots may be uploaded in a CSV file (.csv)</b>
                    <br />
                    (Excel .xls and .xlsx format not supported)
                    <br /><br />
                    <b>Header:</b>
                    <br>
                    The first row (header) should contain the following:
                    <br />

                    <table class="table table-hover table-bordered table-condensed" >
                        <thead></thead>
                        <tbody>
                            <tr>
                                <td>box_id</td>
                                <td>seed_id</td>
                                <td>inventory_date</td>
                                <td>inventory_person</td>
                                <td>weight_gram</td>
                            </tr>
                        </tbody>
                    </table>

                    <b>Required fields:</b>
                    <ul>
                    <li>box_id (the name of the box that the seedlot is in. also called box_name.)</li>
                    <li>seed_id (unique identifier for the seedlot. must exist in the database. also called seedlot_name)</li>
                    <li>inventory_date (a timestamp for when the seedlot was inventoried)</li>
                    <li>inventory_person (the name of the person doing the inventory. can be any name. also called operator_name)</li>
                    <li>weight_gram (the weight in grams of the seedlot)</li>
                    </ul>

                </div>
            </div>
            <div class="modal-footer">
                <button id="close_seedlot_info_upload_inventory_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>


<script>
jQuery(document).ready(function(){

    jQuery('[name="seedlot_upload_inventory"]').click( function() {
        jQuery('#upload_seedlot_inventory_dialog').modal('show');
    });

    jQuery("#seedlot_upload_inventory_spreadsheet_format_info").click( function () {
        jQuery("#seedlot_upload_inventory_spreadsheet_info_dialog" ).modal("show");
    });

    jQuery('[name="upload_seedlot_inventory_button"]').click(function () {
        upload_seedlot_inventory_button();
    });
    function upload_seedlot_inventory_button() {
        jQuery('#upload_seedlot_inventory_form').attr("action", "/ajax/breeders/seedlot-inventory-upload");
        jQuery("#upload_seedlot_inventory_form").submit();
    }

    jQuery('#upload_seedlot_inventory_form').iframePostForm({
        json: true,
        post: function () {
            var uploadedSeedlotInventoryFile = jQuery("#seedlot_uploaded_inventory_file").val();
            jQuery('#working_modal').modal("show");
            if (uploadedSeedlotInventoryFile === '') {
                jQuery('#working_modal').modal("hide");
                alert("No file selected");
            }
        },
        complete: function (response) {
            console.log(response);
            jQuery('#working_modal').modal("hide");

            if (response.error){
                alert(response.error);
            }

            if (response.error_string) {
                if (response.missing_seedlots) {
                    jQuery('#upload_seedlot_inventory_missing_seedlots_div').show();
                } else {
                    jQuery('#upload_seedlot_inventory_missing_seedlots_div').hide();
                    var no_missing_seedlot_html = '<button class="btn btn-primary" onclick="Workflow.skip(this);">There were no errors regarding missing seedlots Click Here</button><br/><br/>';
                    jQuery('#upload_seedlot_inventory_no_error_messages_html').html(no_missing_seedlot_html);
                    Workflow.skip('#upload_seedlot_inventory_missing_seedlots_div', false);
                }
                jQuery("#upload_seedlot_inventory_error_display tbody").html(response.error_string);
                jQuery("#upload_seedlot_inventory_error_display_second_try").show();
                jQuery("#upload_seedlot_inventory_error_display_second_try tbody").html(response.error_string);
            }

            if(response.missing_seedlots){
                Workflow.focus("#upload_seedlot_inventory_workflow", 3);
            } else if(response.error_string){
                Workflow.focus("#upload_seedlot_inventory_workflow", 4);
                jQuery("#upload_seedlot_inventory_error_display_second_try").show();
            }

            if (response.success) {
                jQuery("#upload_seedlot_inventory_error_display_second_try").hide();
                jQuery('#seedlot_inventory_upload_show_repeat_upload_button').hide();
                jQuery('[name="upload_seedlot_inventory_completed_message"]').html('<h3>The trial was saved to the database with no errors!</h3><br/><br/>');
                Workflow.skip('#upload_seedlot_inventory_missing_seedlots_div', false);
                Workflow.skip('#upload_seedlot_inventory_error_display_second_try', false);
                Workflow.focus("#upload_seedlot_inventory_workflow", -1); //Go to success page
                Workflow.check_complete("#upload_seedlot_inventory_workflow");
            }
        }
    });
});
</script>


<div class="modal fade" id="upload_seedlot_dialog" name="upload_seedlot_dialog" tabindex="-1" role="dialog" aria-labelledby="seedlot_upload_dialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="seedlot_upload_dialog">Upload Seedlots</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">

                    









                        
    

                        
    

                        
    

                        
    
                        
    
                        
    
                        
  
                    
<div id="upload_seedlot_main_workflow" class="workflow">
  <ol class="workflow-prog">
      <li><div class="workflow-title">Intro</div></li>
      <li><div class="workflow-title">What seedlots do you have?</div></li>
      <li><div class="workflow-title">File format</div></li>
      <li><div class="workflow-title">Upload seedlots</div></li>
      <li><div class="workflow-title">Fix errors in file</div></li>
      <li><div class="workflow-title">Try submitting seedlots again</div></li>
  </ol>
  <div class="panel panel-default">
    <div class="panel-body">
      <ol class="workflow-content">
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">What are seedlots?</h3></div>

                            <ul>
                            <li>Seedlots represent physical seed in packets.</li>
                            <li>This seed can be from crosses or for named accessions.</li>
                            <li>Seedlots can have a specific location, box, weight(g), and count.</li>
                            <li>Seedlots can belong to breeding programs and organizations.</li>
                            <li>Seedlots can be used in trials (e.g. they were planted in a plot) and they can be harvested from a plot or plant (e.g. a cross was performed and seeds were collected.)</li>
                            </ul>

                            <br/><br/>
                            <center>
                                <button class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
                            </center>
                        </li>
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">Seedlots fall into two categories</h3></div>


                            <div class="form-group">
                                <label class="col-sm-3 control-label">Select One: </label>
                                <div class="col-sm-9">
                                    <select class="form-control" id="upload_seedlots_type_select" name="upload_seedlots_type_select">
                                        <option value=""></option>
                                        <option data-desc="If you have seed lots for named accessions, such as seed that was ordered from a vendor, use this option. Use this option if the seed was not harvested from a cross that is in the database." value="from_accession">I have seed lots for named accessions</option>
                                        <option data-desc="If you have seed lots that were harvested from crosses that are in the database, use this option." value="from_cross">I have seed lots harvested from crosses</option>
                                    </select>
                                </div>
                            </div>
                            <br/><br/>
                            <div id="upload_seedlots_types_description">
                            </div>
                            <br/>
                            <center>
                                <button disabled id="seedlot_upload_type_select_button" class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
                            </center>
                        </li>
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">Make sure your file matches the correct file format</h3></div>

                            <br/><br/>
                            <center>
                                <div id="upload_seedlots_accessions_template_section" style="display:none">
                                    <button class="btn btn-info" name="guided_help_seedlot_upload_format_button">Information about file format for uploading seedlots of named accessions</button><br/><br/>
                                </div>
                                <div id="upload_seedlots_crosses_template_section" style="display:none">
                                    <button class="btn btn-info" name="guided_help_seedlot_crosses_upload_format_button">Information about file format for uploading seed lots harvested</button><br/><br/>
                                </div>
                                <button class="btn btn-primary" onclick="Workflow.complete(this);">Once you think your file matches, go to Next Step</button>
                            </center>
                        </li>
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">Provide basic information about the seedlots and upload your file</h3></div>


                            <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" encoding="multipart/form-data" id="upload_seedlot_form" name="upload_seedlot_form">

                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Breeding Program: </label>
                                    <div class="col-sm-9" >
                                        <div id="upload_seedlot_breeding_program_div"></div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Location of seedlot storage: </label>
                                    <div class="col-sm-9" >
                                        <input class="form-control" name="upload_seedlot_location" id="upload_seedlot_location" placeholder="Required">
                                    </div>
                                </div>
                                <!--
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Population Name: </label>
                                    <div class="col-sm-9" >
                                        <input class="form-control" name="upload_seedlot_population_name" id="upload_seedlot_population_name" placeholder="Optional">
                                    </div>
                                </div>
                                -->
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Organization Name: </label>
                                    <div class="col-sm-9" >
                                        <input class="form-control" name="upload_seedlot_organization_name" id="upload_seedlot_organization_name" placeholder="Optional">
                                    </div>
                                </div>

                                <div id="upload_seedlots_accessions_section" style="display:none">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">Upload File (.xls or .xlsx): </label>
                                        <div class="col-sm-9" >
                                            <input type="file" name="seedlot_uploaded_file" id="seedlot_uploaded_file" encoding="multipart/form-data" />
                                        </div>
                                    </div>
                                </div>

                                <div id="upload_seedlots_harvested_section" style="display:none">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">Upload File (.xls or .xlsx): </label>
                                        <div class="col-sm-9" >
                                            <input type="file" name="seedlot_harvested_uploaded_file" id="seedlot_harvested_uploaded_file" encoding="multipart/form-data" />
                                        </div>
                                    </div>
                                </div>

                            </form>
                            <center>
                            <button type="button" class="btn btn-lg btn-primary" onclick="Workflow.complete(this, false);" name="upload_seedlot_button" >Upload Seedlots</button><br/><br/>
                            </center>

                        </li>
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">Fix all errors in your file</h3></div>


                            <div id="upload_seedlots_missing_accessions_or_crosses_div" style="display:none">
                                <div id="upload_seedlots_missing_accessions_div" style="display:none">
                                    <div class="well">
                                        <ul>
                                            <li>Accessions must exist in the database prior to adding seedlots of them. The reason for this is that an accession can be exist in many seedlots and therefore exists as a separate entity in the database. We also want to be careful about adding new accessions into the database because we do not want incorrectly duplicated data.</li>
                                            <li>When adding accessions into the database, you can use either a list of accessions or an Excel file.</li>
                                        </ul>
                                    </div>

                                    <div id="upload_seedlots_add_missing_accessions_html">
                                    </div>

                                    <button class="btn btn-info" name="add_accessions_link">Add your accessions to the database</button><br/><br/>
                                    <button class="btn btn-primary" onclick="Workflow.complete(this);">Once all your accessions are in the database Click Here</button><br/><br/>
                                </div>
                                <div id="upload_seedlots_missing_crosses_div" style="display:none">
                                    <div class="well">
                                        <ul>
                                            <li>Crosses must exist in the database before adding your seed lots. The reason for this is that a cross can produce many seed lots and so the cross must exists as a separate entity in the database. We also want to be careful about adding new crosses into the database because we do not want data to be incorrectly linked to duplicates.</li>
                                        </ul>
                                    </div>
                                    <ul>
                                    <li>When adding crosses into the database, you can upload an Excel file or you can add seedlots one at a time.<br/><br/>
                                        <ul>
                                        <li><button class="btn btn-info" name="upload_crosses_link">Upload Excel file</button><br/><br/></li>
                                        <li><button class="btn btn-info" name="create_cross_link">Add One Cross</button></li>
                                        </ul>
                                    </li>
                                    </ul><br/>
                                    <center>
                                    <button class="btn btn-primary" onclick="Workflow.complete(this);">Once all your crosses are in the database Click Here</button><br/><br/>
                                    </center>
                                </div>
                            </div>
                            <div id="upload_seedlots_error_display" style="display:none">

                                <h3>Seedlot Upload Error Messages</h3>
                                <div class="panel panel-danger">
                                    <div class="panel-body">
                                        <table>
                                            <tbody></tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                            <center>
                            <div id="upload_seedlots_no_error_messages_accessions_html">
                            </div>
                            <div name="upload_seedlots_completed_message">
                            </div>
                            </center>
                        </li>
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">Submit your seedlots again. You should have corrected all errors by now, but if not please take a look at the errors in the red box below. You can continue to modify your file and then click Upload until it works.</h3></div>

                            <div id="seedlot_upload_show_repeat_upload_button">
                                <center>
                                <button type="button" class="btn btn-lg btn-primary" name="upload_seedlot_button" >Upload Seedlots</button><br/><br/>
                                </center>
                            </div>
                            <center>
                            <div name="upload_seedlots_completed_message">
                            </div>
                            </center>

                            <div id="upload_seedlots_error_display_second_try" style="display:none">

                                <h3>There exist these problems in your file:</h3>
                                <div class="panel panel-danger">
                                    <div class="panel-body">
                                        <table>
                                            <tbody></tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </li>
      </ol>
      <div class="workflow-pending-message">
                            <div id="pagetitle"><h3 id="pagetitle_h3">Finished! Your seedlots are now in the database</h3></div>

                            <p>
                                <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                                The seedlot file was uploaded successfully
                            </p>

                            <ul>
                                <li>You may want to proceed to the seedlot detail page(s) for the seedlot(s) you just created.</li>
                                <li>You can print barcodes for the seedlots.</li>
                            </ul>
                            <br/>
                            <center>
                            <button class="btn btn-primary" name="upload_seedlot_success_complete_button">The seedlots were saved to the database with no errors! Congrats Click Here</button><br/><br/>
                            </center>
                        </div>
      <div class="workflow-complete-message">
                            <div id="pagetitle"><h3 id="pagetitle_h3">Finished! Your seedlots are now in the database</h3></div>

                            <p>
                                <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                                The seedlot file was uploaded successfully
                            </p>

                            <ul>
                                <li>You may want to proceed to the seedlot detail page(s) for the seedlot(s) you just created.</li>
                                <li>You can print barcodes for the seedlots.</li>
                            </ul>
                            <br/>
                            <center>
                            <button class="btn btn-primary" name="upload_seedlot_success_complete_button">The seedlots were saved to the database with no errors! Congrats Click Here</button><br/><br/>
                            </center>
                        </div>
    </div>
  </div>
</div>
<script type="text/javascript">
  Workflow.init("#upload_seedlot_main_workflow");
</script>


                </div>
            </div>
            <div class="modal-footer">
                <button id="close_seedlot_upload_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="seedlot_upload_spreadsheet_info_dialog" name="seedlot_upload_spreadsheet_info_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadSeedlotInfoDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="uploadSeedlotInfoDialog">Upload Template Information For Named Accessions</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <b>Seedlots may be uploaded in an Excel file (.xls or .xlsx)</b>
                    <br />
                    <b>Header:</b>
                    <br>
                    The first row (header) must contain the following:
                    <br />

                    <table class="table table-hover table-bordered table-condensed" >
                        <thead></thead>
                        <tbody>
                            <tr>
                                <td>seedlot_name</td>
                                <td>accession_name</td>
                                <td>operator_name</td>
                                <td>amount</td>
                                <td>weight(g)</td>
                                <td>description</td>
                                <td>box_name</td>
				<td>quality</td>
				<td>source</td>
                            </tr>
                        </tbody>
                    </table>

                    <b>Required fields:</b>
                    <ul>
                    <li>seedlot_name (must be unique)</li>
                    <li>accession_name (must exist in the database. the accession_name is the unique identifier for the named genotype)</li>
                    <li>operator_name (the name of the person who oversaw the inventory process. can be any name.)</li>
                    <li>
                    amount (number of seeds in seedlot. can be provided in conjunction with weight(g). must provide a value for amount or weight(g) or both.)
                    <br/><b>AND/OR</b><br/>
                    weight(g) (weight in grams of seedlot. can be provided in conjunction with amount. must provide a value for amount or weight(g) or both.)
                    </li>
                    <li>box_name (the box name that the seed is located in. can be any name.)</li>
                    </ul>

                    <b>Optional fields:</b>
                    <ul>
                      <li>description (information about why this seedlot is being added)</li>
		      <li>quality (status of the seedlot, for example "ok", "moldy", "insect damage" etc.</li>
		      <li>source (an alternate source, such as a plot or plant identifier from which the seed was sourced if no specific cross experiment was entered in the database)</li>
                    </ul>

		    Note that the columns have to be arranged in the order presented above and carry the correct column headers.

                </div>
            </div>
            <div class="modal-footer">
                <button id="close_seedlot_info_upload_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="seedlot_upload_spreadsheet_harvested_info_dialog" name="seedlot_upload_spreadsheet_harvested_info_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadSeedlotHarvestedInfoDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="uploadSeedlotHarvestedInfoDialog">Upload Template Information For Harvested Seedlots</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <b>Seedlots may be uploaded in an Excel file (.xls or .xlsx)</b>
                    <br />
                    <b>Header:</b>
                    <br>
                    The first row (header) must contain the following:
                    <br />

                    <table class="table table-hover table-bordered table-condensed" >
                        <thead></thead>
                        <tbody>
                            <tr>
                                <td>seedlot_name</td>
                                <td>cross_unique_id</td>
                                <td>operator_name</td>
                                <td>amount</td>
                                <td>weight(g)</td>
                                <td>description</td>
                                <td>box_name</td>
				<td>quality</td>
				<td>source</td>
                            </tr>
                        </tbody>
                    </table>

                    <b>Required fields:</b>
                    <ul>
                    <li>seedlot_name (must be unique)</li>
                    <li>cross_unique_id (must exist in the database. a cross_unique_id can represent a cross between accessions e.g. AxB, but a cross can also represent a cross between specific plots in the field if you have this information)</li>
                    <li>operator_name (the name of the person who oversaw the inventory process. can be any name.)</li>
                    <li>
                    amount (number of seeds in seedlot. can be provided in conjunction with weight(g). must provide a value for amount or weight(g) or both.)
                    <br/><b>AND/OR</b><br/>
                    weight(g) (weight in grams of seedlot. can be provided in conjunction with amount. must provide a value for amount or weight(g) or both.)
                    </li>
                    <li>box_name (the box name that the seed is located in. can be any name.)</li>
                    </ul>

                    <b>Optional fields:</b>
                    <ul>
                      <li>description (information about why this seedlot is being added)</li>
		      <li>quality (brief description of quality, e.g.,  "ok", "moldy", "insect damage", etc)</li>
		      <li>source (an alternate source, such as a plot or plant identifier from which the seed was sourced if no specific cross experiment was entered in the database)</li>
		    </ul>
		    

                </div>
            </div>
            <div class="modal-footer">
                <button id="close_seedlot_harvested_info_upload_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>



<script>
jQuery(document).ready(function(){

    jQuery("#upload_seedlot_location").autocomplete({
       source: '/ajax/stock/geolocation_autocomplete',
    });

    jQuery('#upload_seedlots_type_select').change(function(){
        if (jQuery(this).val() != ''){
            jQuery('#seedlot_upload_type_select_button').attr('disabled', false);
            jQuery('#upload_seedlots_types_description').html('<br/><div class="well"><p>'+jQuery(this).find("option:selected").data("desc")+'</p></div>');
        } else {
            jQuery('#seedlot_upload_type_select_button').attr('disabled', true);
            jQuery('#upload_seedlots_types_description').html('');
        }

        if(jQuery(this).val() == 'from_accession'){
            jQuery('#upload_seedlots_accessions_template_section').show();
            jQuery('#upload_seedlots_crosses_template_section').hide();
            jQuery('#upload_seedlots_accessions_section').show();
            jQuery('#upload_seedlots_harvested_section').hide();
        }
        if(jQuery(this).val() == 'from_cross'){
            jQuery('#upload_seedlots_crosses_template_section').show();
            jQuery('#upload_seedlots_accessions_template_section').hide();
            jQuery('#upload_seedlots_accessions_section').hide();
            jQuery('#upload_seedlots_harvested_section').show();
        }
    });

    jQuery('[name="seedlot_bulk_upload"]').click( function() {
        jQuery('#upload_seedlot_dialog').modal('show');
        get_select_box('breeding_programs', 'upload_seedlot_breeding_program_div', { 'name' : 'upload_seedlot_breeding_program_id', 'id' : 'upload_seedlot_breeding_program_id' });
    });

    jQuery("[name='guided_help_seedlot_upload_format_button']").click( function () {
        jQuery("#seedlot_upload_spreadsheet_info_dialog" ).modal("show");
    });

    jQuery("[name='guided_help_seedlot_crosses_upload_format_button']").click( function () {
        jQuery("#seedlot_upload_spreadsheet_harvested_info_dialog" ).modal("show");
    });

    jQuery('[name="upload_seedlot_button"]').click(function () {
        upload_seedlot_button();
    });
    function upload_seedlot_button() {
        var uploadSeedlotAccessionsFile = jQuery("#seedlot_uploaded_file").val();
        var uploadSeedlotsHarvestedFile = jQuery("#seedlot_harvested_uploaded_file").val();
        var location = jQuery("#upload_seedlot_location").val();
        var breeding_program = jQuery("#upload_seedlot_breeding_program_id").val();
        jQuery('#upload_seedlot_form').attr("action", "/ajax/breeders/seedlot-upload");
        if (breeding_program === '') {
            alert("Please choose a breeding program");
            return;
        }
        if (location === '') {
            alert("Please give a location");
            return;
        }
        if (uploadSeedlotAccessionsFile === '' && uploadSeedlotsHarvestedFile == '') {
            alert("Please select a file");
            return;
        }
        jQuery("#upload_seedlot_form").submit();
    }

    jQuery('#upload_seedlot_form').iframePostForm({
        json: true,
        post: function () {
        var uploadSeedlotAccessionsFile = jQuery("#seedlot_uploaded_file").val();
        var uploadSeedlotsHarvestedFile = jQuery("#seedlot_harvested_uploaded_file").val();
            jQuery('#working_modal').modal("show");
            if (uploadSeedlotAccessionsFile === '' && uploadSeedlotsHarvestedFile == '') {
                jQuery('#working_modal').modal("hide");
                alert("No file selected");
            }
        },
        complete: function (response) {
            console.log(response);
            jQuery('#working_modal').modal("hide");

            if (response.error) {
                alert(response.error);
                return;
            }
            else if (response.error_string) {

                if (response.missing_accessions || response.missing_crosses) {
                    jQuery('#upload_seedlots_missing_accessions_or_crosses_div').show();
                    if (response.missing_accessions){
                        jQuery('#upload_seedlots_missing_accessions_div').show();
                        var missing_accessions_html = "<div class='well well-sm'><h3>Add the missing accessions to a list</h3><div id='upload_seedlots_missing_accessions' style='display:none'></div><div id='upload_seedlots_add_missing_accessions'></div></div><br/>";
                        jQuery("#upload_seedlots_add_missing_accessions_html").html(missing_accessions_html);

                        var missing_accessions_vals = '';
                        for(var i=0; i<response.missing_accessions.length; i++) {
                            missing_accessions_vals = missing_accessions_vals + response.missing_accessions[i] + '\n';
                        }
                        jQuery("#upload_seedlots_missing_accessions").html(missing_accessions_vals);
                        addToListMenu('upload_seedlots_add_missing_accessions', 'upload_seedlots_missing_accessions', {
                            selectText: true,
                            listType: 'accessions'
                        });
                    } else if (response.missing_crosses){
                        jQuery('#upload_seedlots_missing_crosses_div').show();
                    }
                } else {
                    jQuery('#upload_seedlots_missing_accessions_or_crosses_div').hide();
                    var no_missing_accessions_html = '<button class="btn btn-primary" onclick="Workflow.skip(this);">There were no errors regarding missing accessions or crosses  Click Here</button><br/><br/>';
                    jQuery('#upload_seedlots_no_error_messages_accessions_html').html(no_missing_accessions_html);
                    Workflow.skip('#upload_seedlots_missing_accessions_or_crosses_div', false);
                }

                jQuery("#upload_seedlots_error_display").show();
                jQuery("#upload_seedlots_error_display tbody").html(response.error_string);
                jQuery("#upload_seedlots_error_display_second_try").show();
                jQuery("#upload_seedlots_error_display_second_try tbody").html(response.error_string);
            }
            if (response.missing_accessions || response.missing_crosses){
                Workflow.focus("#upload_seedlot_main_workflow", 4);
            } else if(response.error_string){
                Workflow.focus("#upload_seedlot_main_workflow", 5);
                jQuery("#upload_seedlots_error_display_second_try").show();
            }
            if (response.success) {
                jQuery("#upload_seedlots_error_display").hide();
                jQuery("#upload_seedlots_error_display_second_try").hide();
                jQuery('#seedlot_upload_show_repeat_upload_button').hide();
                jQuery('[name="upload_seedlots_completed_message"]').html('<button class="btn btn-primary" name="upload_seedlot_success_complete_button">The seedlots were saved to the database with no errors! Congrats Click Here</button><br/><br/>');
                Workflow.skip('#upload_seedlots_missing_accessions_or_crosses_div', false);
                Workflow.skip('#upload_seedlots_error_display_second_try', false);
                Workflow.focus("#upload_seedlot_main_workflow", -1); //Go to success page
                Workflow.check_complete("#upload_seedlot_main_workflow");
            }

        }
    });

    jQuery(document).on('click', '[name="upload_seedlot_success_complete_button"]', function(){
        alert('Seedlots were saved in the database');
        jQuery('#upload_seedlot_dialog').modal('hide');
        //location.reload();
    });
});
</script>


<div class="modal fade" id="add_seedlot_dialog" name="add_seedlot_dialog" tabindex="-1" role="dialog" aria-labelledby="seedlot_dialog">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="seedlot_dialog">Create New Seedlot</h4>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
            <form class="form-horizontal" role="form" method="post" id="create_new_seedlot_form" name="create_new_seedlot_form">

                <div class="form-group">
                    <label class="col-sm-3 control-label">Name: </label>
                    <div class="col-sm-9" >
                        <input class="form-control" id="seedlot_name" placeholder="Required">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">Seedlot Description: </label>
                    <div class="col-sm-9" >
                        <input class="form-control" id="seedlot_description" placeholder="Optional">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">Breeding Program: </label>
                    <div class="col-sm-9" >
                        <div id="seedlot_breeding_program_div"></div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">Location: </label>
                    <div class="col-sm-9" >
                        <input class="form-control" id="seedlot_location" placeholder="Required">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">Box Name: </label>
                    <div class="col-sm-9" >
                        <input class="form-control" id="seedlot_box_name" placeholder="Required">
                    </div>
                </div>

		<div class="form-group">
                    <label class="col-sm-3 control-label">Quality issues:</label>
                    <div class="col-sm-9" >
                        <input class="form-control" id="seedlot_quality" placeholder="list quality issues here, or 'ok' for good quality seed" >
                    </div>
                </div>

                <div class="well well-sm">
                    <div class="row">
                        <div class="col-sm-3">
                            <div class="form-group">
                                <label class="col-sm-12 control-label">Contents: </label>
                            </div>
                        </div>
                        <div class="col-sm-9">
                            <div class="panel panel-default">
                                <div class="panel-body">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">Accession name: </label>
                                        <div class="col-sm-9" >
                                            <input class="form-control" id="seedlot_accession_uniquename" placeholder="One Content Required">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <center><h4>OR</h4></center>
                            <div class="panel panel-default">
                                <div class="panel-body">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">Cross Unique ID: </label>
                                        <div class="col-sm-9" >
                                            <input class="form-control" id="seedlot_cross_uniquename" placeholder="One Content Required">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label">Amount (number of seeds): </label>
                    <div class="col-sm-9" >
                        <input class="form-control" id="seedlot_amount" placeholder="Amount OR Weight(g) Required">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">Weight (g): </label>
                    <div class="col-sm-9" >
                        <input class="form-control" id="seedlot_weight" placeholder="Amount OR Weight(g) Required">
                    </div>
                </div>
                <!--
                <div class="form-group">
                    <label class="col-sm-3 control-label">Population: </label>
                    <div class="col-sm-9" >
                        <input class="form-control" id="seedlot_population_name" placeholder="Optional">
                    </div>
                </div>
                -->
                <div class="form-group">
                    <label class="col-sm-3 control-label">Organization: </label>
                    <div class="col-sm-9" >
                        <input class="form-control" id="seedlot_organization" placeholder="Optional">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">Timestamp: </label>
                    <div class="col-sm-9" >
                        <input class="form-control" id="seedlot_timestamp" value="Fri May 31 23:16:17 2024" placeholder="Fri May 31 23:16:17 2024">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">Transaction Description: </label>
                    <div class="col-sm-9" >
                        <input class="form-control" id="seedlot_transaction_description" placeholder="Optional">
                    </div>
                </div>
            </form>
        </div>
      </div>
      <div class="modal-footer">
        <button id="create_new_seedlot_button" type="button" class="btn btn-primary" >OK</button>
      </div>
    </div>
  </div>
</div>

<script>
jQuery(document).ready(function(){

    jQuery("#seedlot_location").autocomplete({
       source: '/ajax/stock/geolocation_autocomplete',
    });
    jQuery("#seedlot_accession_uniquename").autocomplete({
       source: '/ajax/stock/accession_autocomplete',
    });
    jQuery("#seedlot_cross_uniquename").autocomplete({
       source: '/ajax/stock/cross_autocomplete',
    });

    jQuery('[name="add_seedlot_button"]').click( function() {
        jQuery('#add_seedlot_dialog').modal('show');
        get_select_box('breeding_programs', 'seedlot_breeding_program_div', { 'name' : 'seedlot_breeding_program_id', 'id' : 'seedlot_breeding_program_id' });
    });

    jQuery('#create_new_seedlot_button').click( function() {
        var name = jQuery('#seedlot_name').val();
        var seedlot_description = jQuery('#seedlot_description').val();
        var location = jQuery('#seedlot_location').val();
        var box_name = jQuery('#seedlot_box_name').val();
        var accession_uniquename = jQuery('#seedlot_accession_uniquename').val();
        var cross_uniquename = jQuery('#seedlot_cross_uniquename').val();
        var population_name = jQuery('#seedlot_population_name').val();
        var organization = jQuery('#seedlot_organization').val();
        var amount = jQuery('#seedlot_amount').val();
        var weight = jQuery('#seedlot_weight').val();
        var timestamp = jQuery('#seedlot_timestamp').val();
        var transaction_description = jQuery('#seedlot_transaction_description').val();
        var breeding_program_id = jQuery('#seedlot_breeding_program_id').val();
        var seedlot_quality = jQuery('#seedlot_quality').val();

        if (name == '') { alert("Please provide a name"); return; }
        else if (location == '') { alert("Please provide a location"); return; }
        else if (box_name == '') { alert("Please provide a box name"); return; }
        else if (amount == '' && weight == '') { alert("Please provide an seed count amount or a weight in grams!"); return; }
        else if (breeding_program_id == '') { alert("Please select a breeding program"); return; }
        else if (accession_uniquename == '' && cross_uniquename == '') {
            alert("Please provide an accession name or a cross unique id as the content of the seedlot."); return;
        }
        else if (accession_uniquename != '' && cross_uniquename != '') {
            alert("Please provide an accession name OR a cross unique id as the content of the seedlot. Not both."); return;
        }
        else {

            jQuery.ajax({
                url: '/ajax/breeders/seedlot-create',
                data : {
                    'seedlot_name' : name,
                    'seedlot_description': seedlot_description,
                    'seedlot_location': location,
                    'seedlot_box_name':box_name,
                    'seedlot_accession_uniquename': accession_uniquename,
                    'seedlot_cross_uniquename': cross_uniquename,
                    'seedlot_organization': organization,
                    'seedlot_population_name': population_name,
                    'seedlot_amount':amount,
                    'seedlot_weight':weight,
                    'seedlot_timestamp':timestamp,
                    'seedlot_transaction_description':transaction_description,
                    'seedlot_breeding_program_id':breeding_program_id,
                    'seedlot_quality' : seedlot_quality

                },
                beforeSend: function(response){
                    jQuery('#working_modal').modal('show');
                },
                success: function(response) {
                    jQuery('#working_modal').modal('hide');
                    if (response.success == 1) {
                        alert("The seedlot has been created.");
                        jQuery('#add_seedlot_dialog').modal('hide');
                        //seedlots_table.ajax.reload();
                        //document.location.reload();
                    }
                    if (response.error) {
                        alert(response.error);
                    }
                },
                error: function(response){
                    jQuery('#working_modal').modal('hide');
                    alert('An error occurred creating seed lot');
                }
            });
        }

    });

});
</script>



<div class="modal fade" id="add_accessions_dialog" name="add_accessions_dialog" tabindex="-1" role="dialog" aria-labelledby="addAccessionsDialog" data-backdrop="static" data-keyboard="false">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="addAccessionsDialog">Add Accessions</h4>
      </div>
      <div class="modal-body">
        <div class="container-fluid">

            <ul class="nav nav-pills nav-justified" id="add_new_accessions_tab_select">
                <li class="active" id="add_new_accessions_list_tab"><a data-toggle="tab" href="#with_list_tab">Using Lists</a></li>
                <li id="add_new_accessions_file_tab"><a data-toggle="tab" href="#with_file_tab">Uploading a File</a></li>
            </ul>

            <div class="tab-content">

                <div id="with_list_tab" class="tab-pane fade in active">
                    <hr>
                    <form class="form-horizontal" role="form" name="new_accessions_form" id="new_accessions_form">
                        <div class="form-group">
                            <label class="col-sm-4 control-label">Choose a List of Accessions to Add: </label>
                            <div class="col-sm-8" id="list_div" name="list_div">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-4 control-label"></label>
                            <div class="col-sm-8">
                                <button name="lists_link" class="btn btn-info btn-sm" style="margin:6px 0px 0px 0px" type="button" >Manage Lists</button>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-4 control-label">Use Fuzzy Search: </label>
                            <div class="col-sm-8">
                                <input type="checkbox" id="fuzzy_check" name="fuzzy_check" checked disabled></input>
                                <br/>
                                <small>Note: Use the fuzzy search to match similar names to prevent uploading of duplicate accessions. Fuzzy searching is much slower than regular search. Only a curator can disable the fuzzy search.</small>
                            </div>
                        </div>
                    </form>
                </div>

                <div id="with_file_tab" class="tab-pane fade">
                    <hr>
                    <table style="border: 1px solid gray; padding: 1em 2em; margin: 25px 15px; background: #f3f3ff;">
  <tr>
    <td>
      <img src="/documents/img/info_icon.png" border="0" style="margin: 10px; vertical-align: middle" />
    </td>
    <td style="padding-top: 0.35em; padding-right:0.35em; vertical-align: middle">

                        <p>
                            <b>File format information</b>
                            <br>
                            <a id="accessions_upload_spreadsheet_format_info">Spreadsheet format</a>
                        </p>
                    
     </td>
  </tr>
</table>


                    <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" encoding="multipart/form-data" id="upload_new_accessions_form" name="upload_new_accessions_form">
                        <div class="form-group">
                            <label class="col-sm-4 control-label">Upload File: </label>
                            <div class="col-sm-8" >
                                <input type="file" name="new_accessions_upload_file" id="new_accessions_upload_file" encoding="multipart/form-data" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-4 control-label">Use Fuzzy Search: </label>
                            <div class="col-sm-8">
                                <input type="checkbox" id="fuzzy_check_upload_accessions" name="fuzzy_check_upload_accessions" checked disabled></input>
                                <br/>
                                <small>Note: Use the fuzzy search to match similar names to prevent uploading of duplicate accessions. Fuzzy searching is much slower than regular search. Only a curator can disable the fuzzy search.</small>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-4 control-label">Append Synonyms:</label>
                            <div class="col-sm-8">
                                <input type="checkbox" id="append_synonyms" name="append_synonyms" checked />
                                <br />
                                <small>When checked, add synonyms of existing accession entries to the synonyms already stored in the database.  When not checked, remove any existing synonyms of existing accession entries and store only the synonyms in the upload file.</small>
                            </div>
                        </div>
                    </form>

                </div>

            </div>

        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary" name="new_accessions_submit" id="new_accessions_submit">Continue</button>
      </div>
    </div>
  </div>
</div>

<div class="modal fade" id="accessions_upload_spreadsheet_format_modal" name="accessions_upload_spreadsheet_format_modal" tabindex="-1" role="dialog" aria-labelledby="uploadAccessionsInfoDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="uploadAccessionsInfoDialog">Upload Accessions Template Information</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <b>Accessions may be uploaded in an Excel file (.xls or .xlsx)</b>
                    <br /><br />
                    <b>Header:</b>
                    <br>
                    The first row (header) should contain the following:
                    <br />

                    <table class="table table-hover table-bordered table-condensed" >
                        <thead></thead>
                        <tbody>
                            <tr>
                                <td>accession_name</td>
                                <td>species_name</td>
                                <td>population_name</td>
                                <td>organization_name</td>
                                <td>synonym</td>
<td>PUI</td><td>accession number</td><td>acquisition date</td><td>biological status of accession code</td><td>country of origin</td><td>donor</td><td>donor PUI</td><td>donor institute</td><td>genome_structure</td><td>institute code</td><td>institute name</td><td>introgression_backcross_parent</td><td>introgression_chromosome</td><td>introgression_end_position_bp</td><td>introgression_map_version</td><td>introgression_parent</td><td>introgression_start_position_bp</td><td>location_code</td><td>ncbi_taxonomy_id</td><td>notes</td><td>organization</td><td>ploidy_level</td><td>released_variety_name</td><td>seed source</td><td>state</td><td>transgenic</td><td>type of germplasm storage code</td><td>variety</td>                            </tr>
                        </tbody>
                    </table>

                    <b>Comma Separated Fields:</b>
                    <ul>
                    <li>The following fields can take comma-separated values to indicate there are several values for the accession: organization_name, synonym
, PUI, accession number, acquisition date, biological status of accession code, country of origin, donor, donor PUI, donor institute, genome_structure, institute code, institute name, introgression_backcross_parent, introgression_chromosome, introgression_end_position_bp, introgression_map_version, introgression_parent, introgression_start_position_bp, location_code, ncbi_taxonomy_id, notes, organization, ploidy_level, released_variety_name, seed source, state, transgenic, type of germplasm storage code, variety                    </li>
                    </ul>

                    <b>Required Fields:</b>
                    <ul>
                    <li>accession_name (must be unique)</li>
                    <li>species_name (must exist in the database)</li>
                    </ul>
                    <b>Optional Fields:</b>
                    <ul>
                    <li>population_name (a population is a grouping of accessions. if the population already exists in the database, the accession will be added into it, otherwise, the new population will be created.)</li>
                    <li>organization_name (the name(s) of the organization(s) which use this accession e.g. NARO,IITA)</li>
                    <li>synonym (an accession can be known by many names including local popular names. a synonym name can be used instead of the accession_name throughout the database; because of this, synonyms must themselves be unique. e.g. accession_synonym1,accession_synonym001)</li>
<li>PUI (no definition available)</li><li>accession number (no definition available)</li><li>acquisition date (no definition available)</li><li>biological status of accession code (no definition available)</li><li>country of origin (no definition available)</li><li>donor (no definition available)</li><li>donor PUI (no definition available)</li><li>donor institute (no definition available)</li><li>genome_structure (no definition available)</li><li>institute code (no definition available)</li><li>institute name (no definition available)</li><li>introgression_backcross_parent (no definition available)</li><li>introgression_chromosome (no definition available)</li><li>introgression_end_position_bp (no definition available)</li><li>introgression_map_version (no definition available)</li><li>introgression_parent (no definition available)</li><li>introgression_start_position_bp (no definition available)</li><li>location_code (no definition available)</li><li>ncbi_taxonomy_id (no definition available)</li><li>notes (no definition available)</li><li>organization (no definition available)</li><li>ploidy_level (no definition available)</li><li>released_variety_name (no definition available)</li><li>seed source (no definition available)</li><li>state (no definition available)</li><li>transgenic (no definition available)</li><li>type of germplasm storage code (no definition available)</li><li>variety (no definition available)</li>                    </ul>
                </div>
            </div>
            <div class="modal-footer">
                <button id="close_trial_upload_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="review_absent_dialog" name="review_absent_dialog" tabindex="-1" role="dialog" aria-labelledby="reviewAbsentDialog" data-backdrop="static" data-keyboard="false">
  <div class="modal-dialog modal-xl" role="document">
    <div class="modal-content ui-front">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="reviewAbsentDialog">Accessions to be Added</h4>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
            <div id="add_accessions_using_list_inputs" style="display:none">
                <label for="species_name_input">Species name for added accessions</label>
                <input class="form-control" type="text" id="species_name_input" value="Musa acuminata"></input>
                <br><br>
                <label for="population_name_input">Population name for added accessions (optional)</label>
                <input class="form-control" type="text" id="population_name_input"></input>
                <br><br>
                <label for="organization_name_input">Organization name for added accessions (optional)</label>
                <input class="form-control" type="text" id="organization_name_input"></input>
                <br><br>
                <b>The following accessions are new and will be added to the database:</b>
                <div id="count_of_absent_accessions"></div>
                <br>
                <div id="view_absent"></div>
            </div>
            <div id="view_infoToAdd"></div>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
	<button type="button" class="btn btn-primary" name="review_absent_accessions_submit" id="review_absent_accessions_submit">Add Accessions</button>
      </div>
    </div>
  </div>
</div>

<div class="modal fade" id="review_fuzzy_matches_dialog" name="review_fuzzy_matches_dialog" tabindex="-1" role="dialog" aria-labelledby="reviewFuzzyDialog" data-backdrop="static" data-keyboard="false">
  <div class="modal-dialog modal-xl" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="reviewFuzzyDialog">Fuzzy Matches</h4>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
    	  <b>Accessions were found with similar names.</b>
  	  <br/><br/>
  	  <div id="view_fuzzy_matches"></div>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" name="review_fuzzy_matches_download" id="review_fuzzy_matches_download">Download Fuzzy Matches</button>
        <button type="button" class="btn btn-primary" name="review_fuzzy_matches_continue" id="review_fuzzy_matches_continue" data-dismiss="modal">Make Changes and Continue</button>
      </div>
    </div>
  </div>
</div>

<div class="modal fade" id="review_found_matches_dialog" name="review_found_matches_dialog" tabindex="-1" role="dialog" aria-labelledby="reviewFoundDialog" data-backdrop="static" data-keyboard="false">
  <div class="modal-dialog modal-xl" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="reviewFoundDialog">Found Accessions</h4>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
    	  <b>The following accessions already exist in the database:</b>
  	  <div id="count_of_found_accessions"></div>
  	  <br/>
  	  <div id="view_found_matches"></div>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary" name="review_found_matches_hide" id="review_found_matches_hide" data-dismiss="modal">Continue</button>
      </div>
    </div>
  </div>
</div>

<div class="modal fade" id="add_accessions_saved_message_modal" name="add_accessions_saved_message_modal" tabindex="-1" role="dialog" aria-labelledby="addAccessionsSavedDialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align: center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="addAccessionsSavedDialog">Accessions Saved</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <div id="add_accessions_saved_message"></div>
                </div>
            </div>
            <div class="modal-footer">
                <button id="close_add_accessions_saved_message_modal" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<form id="add_accession_fuzzy_match_download" method="post" action="/ajax/accession_list/fuzzy_download" target="TheWindow">
    <input type="hidden" name="fuzzy_response" value="" />
</form>

<style>
.ui-autocomplete {
  max-height: 100px;
  overflow-y: auto;
  /* prevent horizontal scrollbar */
  overflow-x: hidden;
}

/* IE 6 doesn't support max-height
* we use height instead, but this forces the menu to always be this tall
*/
* html .ui-autocomplete {
  height: 100px;
}
</style>



<div class="modal fade" id="upload_crosses_dialog" name="upload_crosses_dialog" tabindex="-1" role="dialog" aria-labelledby="uploadCrossesDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="reset" class="close" id="upload_crosses_dismiss_button_2" name="upload_crosses_dismiss_button" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="uploadCrossesDialog">Upload Crosses</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">

                    









                        
    

                        
    
                        
    
                        
  

                    
<div id="crosses_upload_workflow" class="workflow">
  <ol class="workflow-prog">
      <li><div class="workflow-title">Intro</div></li>
      <li><div class="workflow-title">Crossing experiment</div></li>
      <li><div class="workflow-title">Upload your crosses</div></li>
  </ol>
  <div class="panel panel-default">
    <div class="panel-body">
      <ol class="workflow-content">
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">Introduction</h3></div>

                            <ul>
                                <li>Crosses can be of different types (biparental, self, open, backcross, sib, polycross, bulk, bulk_open, bulk_self, doubled_haploid, or dihaploid_induction)</li>
                                    <ul class="a">
                                        <li>cross type descriptions:</li>
                                        <ul class="b">
                                            <li><b>biparental:</b> An individual plant pollinated by another individual plant.</li>
                                            <li><b>self:</b> A self pollinated individual plant.</li>
                                            <li><b>open:</b> An individual plant pollinated by a group of plants or open pollinated (pollen may be from a group with known or unknown members).</li>
                                            <li><b>backcross:</b> An individual plant pollinated by one of its parents. Cross Unique ID can be used as one of the parents.</li>
                                            <li><b>sib:</b> Mating between individuals that have at least one parent in common. Generally between two individuals within the same plot.</li>
                                            <li><b>polycross:</b> Mating between individual female parent from a population and the corresponding male population.</li>
                                            <li><b>bulk:</b> A group of plants (usually a related family) pollinated by an individual plant (between a female population and a male accession).</li>
                                            <li><b>bulk_open:</b> A group of plants (usually a related family) that are pollinated by another group of plants or open pollinated (between a female population and a male population or unknown male parent).</li>
                                            <li><b>bulk_self:</b> A group of plants (usually a related family) that are self pollinated (each individual selfed, not combined pollen).</li>
                                            <li><b>doubled_haploid:</b> Plants derived from doubling the chromosome number of haploid tissue.</li>
					    <li><b>dihaploid_induction</b>: Plants derived from reducing the chromosome set from tetraploid to diploid.</li>
                                        </ul>
                                    </ul>
                                </li>
                                <li>An individual cross can be linked to a female plot or plant, as well as a male plot or plant.</li>
                                <li>A cross can have a number of properties associated to it, such as number of flowers, pollination date, etc.</li>
                                <li>A cross can produce seed, which goes into a seedlot.</li>
                                <li>A cross can ultimately produce progeny, which then become named accessions in the database.</li>
                            </ul>

                            <br/><br/>
                            <center>
                                <button id="next_step_intro_button" class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
                            </center>
                        </li>
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">Select a crossing experiment for your crosses</h3></div>

                            <center><label style="color:DarkOliveGreen" class="col-sm-12 control-label">If you are uploading an Intercross file and using auto-generated cross unique IDs, please use manage Intercross section</label></center>
                            <br>
                            <br>
                            <div id="manage_page_section_1" style="display:none">
                                <p>Crossing experiments are for grouping crosses together. The grouping is most often done for crosses derived from the same field trial, the same year, or for crosses that have the same breeding objective.</p>
                                <center>
                                    <button class="btn btn-info" name="create_crossingtrial_link">If you need to create a new crossing experiment, click here</button><br/><br/>
                                    <button id="next_step_crossing_trial_button" class="btn btn-primary" onclick="Workflow.complete(this);">If you already have a crossing experiment, go to Next Step</button>
                                </center>
                            </div>

                            <div id="crossing_experiment_page_section_1" style="display:none">
                                <center>
                                    <div class="form-group">
                                        <label class="col-sm-5 control-label">You are uploading crosses for crossing experiment: </label>
                                        <div class="col-sm-6" >
                                            <input class="form-control" name="experiment_name_1" id="experiment_name_1" disabled value="">
                                        </div>
                                    </div>
                                    <br/><br/><br/><br/>
                                    <button class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
                                </center>
                            </div>
                        </li>
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">Enter basic information about the crosses and upload your file</h3></div>


                            <br/>
                            <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" encoding="multipart/form-data" id="upload_crosses_form" name="upload_crosses_form">
                                <div id="manage_page_section_2" style="display:none">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">Breeding Program: </label>
                                        <div class="col-sm-9" >
                                            <div id="upload_crosses_breeding_program_select_div">
                                            </div>
                                        </div>
                                    </div>
                                    <div id="manage_page_crossing_experiment" style="display:none">
                                        <div class="form-group">
                                            <label class="col-sm-3 control-label">Crossing Experiment: </label>
                                            <div class="col-sm-9">
                                                <div id="upload_crosses_crossing_experiment_select_div" name="upload_crosses_crossing_experiment_select_div" >
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div id="crossing_experiment_page_section_2" style="display:none">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">Crossing Experiment: </label>
                                        <div class="col-sm-9" >
                                            <input class="form-control" name="experiment_name" id="experiment_name" disabled value="">
                                            <input name="experiment_id" id="experiment_id" type="hidden" value="">
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">File Format: </label>
                                    <div class="col-sm-9">
                                        <select class="form-control" id="cross_file_format_option">
                                            <option value="">Select a file format that you want to upload</option>
                                            <option value="xls_cross_accession">Excel (.xls or .xlsx) file with only accession/population names for parents</option>
                                            <option value="xls_cross_plot">Excel (.xls or .xlsx) file with accession and plot names for parents</option>
                                            <option value="xls_cross_plant">Excel (.xls or .xlsx) file with accession and plant names for parents</option>
                                            <option value="xls_cross_simplified">Excel (.xls or .xlsx) file with simplified information for parents</option>
                                        </select>
                                    </div>
                                </div>
                                <div id="xls_cross_accession_section" style="display:none">
                                    <h3>You want to upload crosses in an Excel file with accession or population names for parents</h3>
                                    <div class="well well-sm">
                                        <div class="row">
                                            <div class="col-sm-4">
                                                <table style="border: 1px solid gray; padding: 1em 2em; margin: 25px 15px; background: #f3f3ff;">
  <tr>
    <td>
      <img src="/documents/img/info_icon.png" border="0" style="margin: 10px; vertical-align: middle" />
    </td>
    <td style="padding-top: 0.35em; padding-right:0.35em; vertical-align: middle">

                                                    <p>
                                                        <b>File format information</b>
                                                        <br>
                                                        <a id="cross_accession_info_format">Spreadsheet format</a>
                                                    </p>
                                                
     </td>
  </tr>
</table>

                                            </div>
                                            <div class="col-sm-8">
                                                <br/>
                                                <div class="panel panel-default">
                                                    <div class="panel-body">
                                                        <div class="form-group">
                                                            <label class="col-sm-6 control-label">Select an .xls or .xlsx File: </label>
                                                            <div class="col-sm-6">
                                                                <input type="file" name="xls_crosses_simple_file" id="xls_crosses_simple_file" encoding="multipart/form-data" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div id="xls_cross_plot_section" style="display:none">
                                    <h3>You want to upload crosses in an Excel file with accession and plot names for parents</h3>
                                    <div class="well well-sm">
                                        <div class="row">
                                            <div class="col-sm-4">
                                                <table style="border: 1px solid gray; padding: 1em 2em; margin: 25px 15px; background: #f3f3ff;">
  <tr>
    <td>
      <img src="/documents/img/info_icon.png" border="0" style="margin: 10px; vertical-align: middle" />
    </td>
    <td style="padding-top: 0.35em; padding-right:0.35em; vertical-align: middle">

                                                    <p>
                                                        <b>File format information</b>
                                                        <br>
                                                        <a id="cross_plot_info_format">Spreadsheet format</a>
                                                    </p>
                                                
     </td>
  </tr>
</table>

                                            </div>
                                            <div class="col-sm-8">
                                                <br/>
                                                <div class="panel panel-default">
                                                    <div class="panel-body">
                                                        <div class="form-group">
                                                            <label class="col-sm-6 control-label">Select an .xls or .xlsx File: </label>
                                                            <div class="col-sm-6">
                                                                <input type="file" name="xls_crosses_plots_file" id="xls_crosses_plots_file" encoding="multipart/form-data" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div id="xls_cross_plant_section" style="display:none">
                                    <h3>You want to upload crosses in an Excel file with accession and plant names for parents</h3>
                                    <div class="well well-sm">
                                        <div class="row">
                                            <div class="col-sm-4">
                                                <table style="border: 1px solid gray; padding: 1em 2em; margin: 25px 15px; background: #f3f3ff;">
  <tr>
    <td>
      <img src="/documents/img/info_icon.png" border="0" style="margin: 10px; vertical-align: middle" />
    </td>
    <td style="padding-top: 0.35em; padding-right:0.35em; vertical-align: middle">

                                                    <p>
                                                        <b>File format information</b>
                                                        <br>
                                                        <a id="cross_plant_info_format">Spreadsheet format</a>
                                                    </p>
                                                
     </td>
  </tr>
</table>

                                            </div>
                                            <div class="col-sm-8">
                                                <br/>
                                                <div class="panel panel-default">
                                                    <div class="panel-body">
                                                        <div class="form-group">
                                                            <label class="col-sm-6 control-label">Select an .xls or .xlsx File: </label>
                                                            <div class="col-sm-6">
                                                                <input type="file" name="xls_crosses_plants_file" id="xls_crosses_plants_file" encoding="multipart/form-data" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div id="xls_cross_simplified_section" style="display:none">
                                    <h3>You want to upload crosses in an Excel file with simplified information for parents</h3>
                                    <div class="well well-sm">
                                        <div class="row">
                                            <div class="col-sm-4">
                                                <table style="border: 1px solid gray; padding: 1em 2em; margin: 25px 15px; background: #f3f3ff;">
  <tr>
    <td>
      <img src="/documents/img/info_icon.png" border="0" style="margin: 10px; vertical-align: middle" />
    </td>
    <td style="padding-top: 0.35em; padding-right:0.35em; vertical-align: middle">

                                                    <p>
                                                        <b>File format information</b>
                                                        <br>
                                                        <a id="cross_simplified_parent_info_format">Spreadsheet format</a>
                                                    </p>
                                                
     </td>
  </tr>
</table>

                                            </div>
                                            <div class="col-sm-8">
                                                <br/>
                                                <div class="panel panel-default">
                                                    <div class="panel-body">
                                                        <div class="form-group">
                                                            <label class="col-sm-6 control-label">Select an .xls or .xlsx File: </label>
                                                            <div class="col-sm-6">
                                                                <input type="file" name="xls_crosses_simplified_parents_file" id="xls_crosses_simplified_parents_file" encoding="multipart/form-data" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <!--
                                <hr>
                                <h3>Additional options:</h3>

                                <p>Progeny naming: <i>If generating progeny, use cross name and:</i></p>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">Prefix: </label>
                                    <div class="col-sm-10">
                                        <input class="form-control" id="upload_prefix" name="upload_prefix" value="P" />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">Suffix: </label>
                                    <div class="col-sm-10">
                                        <input class="form-control" id="upload_suffix" name="upload_suffix" />
                                    </div>
                                </div>
                                -->
                            </form>
                            <div id="submit_button_section" style="display:none">
                                <center>
                                    <button type="button" onclick="Workflow.complete(this, false);" class="btn btn-primary" name="upload_crosses_submit" id="upload_crosses_submit">Upload File</button>
                                </center>
                            </div>

                        </li>
      </ol>
      <div class="workflow-pending-message">
                            <div id="pagetitle"><h3 id="pagetitle_h3">Finished! Your crosses are now in the database</h3></div>

                            <p>
                                <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                                The crosses file was uploaded successfully
                            </p>

                            <ul>
                                <li>You may want to proceed to the cross detail page(s) for the cross(es) you just created.</li>
                                <li>You can print barcodes for the crosses.</li>
                                <li>You can add crossing information as it becomes available (e.g. number of seeds, progeny, etc).</li>
                            </ul>
                            <br/>
                            <center>
                            <button  class="btn btn-primary" name="upload_crosses_success_complete_button">The crosses were saved to the database with no errors! Congrats Click Here</button><br/><br/>
                            </center>
                        </div>
      <div class="workflow-complete-message">
                            <div id="pagetitle"><h3 id="pagetitle_h3">Finished! Your crosses are now in the database</h3></div>

                            <p>
                                <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                                The crosses file was uploaded successfully
                            </p>

                            <ul>
                                <li>You may want to proceed to the cross detail page(s) for the cross(es) you just created.</li>
                                <li>You can print barcodes for the crosses.</li>
                                <li>You can add crossing information as it becomes available (e.g. number of seeds, progeny, etc).</li>
                            </ul>
                            <br/>
                            <center>
                            <button  class="btn btn-primary" name="upload_crosses_success_complete_button">The crosses were saved to the database with no errors! Congrats Click Here</button><br/><br/>
                            </center>
                        </div>
    </div>
  </div>
</div>
<script type="text/javascript">
  Workflow.init("#crosses_upload_workflow");
</script>
<!-- End of workflow -->

                </div>
            </div>
            <div class="modal-footer">
                <button id="upload_crosses_dismiss_button_1" name="upload_crosses_dismiss_button" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="upload_cross_error_display" name="upload_cross_error_display" tabindex="-1" role="dialog" aria-labelledby="uploadCrossesErrorDialog">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="uploadCrossesErrorDialog">Upload Crosses File Error</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <table>
                        <tbody></tbody>
                    </table>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="cross_spreadsheet_info_dialog" name="cross_spreadsheet_info_dialog" tabindex="-1" role="dialog" aria-labelledby="crossSpreadsheetInfoDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="crossSpreadsheetInfoDialog">Template Information</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <b>Crosses may be uploaded in an Excel file (.xls or .xlsx)</b>
                    <br>
                    <b>Header:</b>
                    <br>
                    To set up crosses in the database, please provide required information. The first row (header) must contain the following:
                    <br>

                    <table class="table table-bordered table-hover" id = "cross_parents_header" style="display:none">
                        <tbody>
                            <tr>
                                <td>cross_unique_id</td>
                                <td>cross_combination</td>
                                <td>cross_type</td>
                                <td>female_parent</td>
                                <td>male_parent</td>
                            </tr>
                        </tbody>
                    </table>
                    <table class="table table-bordered table-hover" id = "cross_plot_parents_header" style="display:none">
                        <tbody>
                            <tr>
                                <td>cross_unique_id</td>
                                <td>cross_combination</td>
                                <td>cross_type</td>
                                <td>female_parent</td>
                                <td>male_parent</td>
                                <td>female_plot</td>
                                <td>male_plot</td>
                        </tr>
                        </tbody>
                    </table>

                    <table class="table table-bordered table-hover" id = "cross_plant_parents_header" style="display:none">
                        <tbody>
                            <tr>
                                <td>cross_unique_id</td>
                                <td>cross_combination</td>
                                <td>cross_type</td>
                                <td>female_parent</td>
                                <td>male_parent</td>
                                <td>female_plant</td>
                                <td>male_plant</td>
                            </tr>
                        </tbody>
                    </table>

                    <style>
                        ul.a {text-indent};
                        ul.b {text-indent};
                    </style>
                    <b>Required columns:</b>
                    <ul>
                        <li><b>cross_unique_id</b> (must NOT exist in the database)</li>
                        <li><b>cross_combination</b> (required in the header, but value for cross combination (e.g. female accession/male accession) may be left blank)</li>
                        <li><b>cross_type</b> (must be one of the following: biparental, self, open, sib, polycross, backcross, bulk, bulk_open, bulk_self, doubled_haploid, dihaploid_induction)
                            <ul class="a">
                                <li><b>cross type descriptions:</b></li>
                                <ul class="b">
                                    <li><b>biparental:</b> An individual plant pollinated by another individual plant.</li>
                                    <li><b>self:</b> A self pollinated individual plant.</li>
                                    <li><b>open:</b> An individual plant pollinated by a group of plants or open pollinated (pollen may be from a group with known or unknown members).</li>
                                    <li><b>backcross:</b> An individual plant pollinated by one of its parents.</li>
                                    <li><b>sib:</b> Mating between individuals that have at least one parent in common. Generally between two individuals within the same plot.</li>
                                    <li><b>polycross:</b> Mating between individual female parent from a population and the corresponding male population.</li>
                                    <li><b>bulk:</b> A group of plants (usually a related family) pollinated by an individual plant (between a female population and a male accession).</li>
                                    <li><b>bulk_open:</b> A group of plants (usually a related family) that are pollinated by another group of plants or open pollinated (between a female population and a male population or unknown male parent).</li>
                                    <li><b>bulk_self:</b> A group of plants (usually a related family) that are self pollinated (each individual selfed, not combined pollen).</li>                                
                                    <li><b>doubled_haploid:</b> Plants derived from doubling the chromosome number of haploid tissue.</li>
				    <li><b>dihaploid_induction</b>: Plants derived from reducing the chromosome set from 4 to 2.</li>
				    <li>
                                </ul>
                            </ul>
                        </li>
                        <div id = "accession_parent_info" style="display:none">
                            <li><b>female_parent:</b> Accession names (for biparental, self, open, sib, polycross, doubled_haploid cross types) or population names (for bulk, bulk_self and bulk_open cross types) or cross unique ids (for backcross cross type) must exist as <b>uniquenames</b> in the database.</li>
                            <li><b>male_parent:</b> Required in the header, but value may be left blank for most cross types. Must be specified for biparental, sib, polycross and bulk cross types. When specified, accession names or population names must exist as <b>uniquenames</b> in the database.</li>
                        </div>
                        <div id = "plot_parent_info" style="display:none">
                            <li><b>female_parent:</b> Accession names must exist as <b>uniquenames</b> in the database.</li>
                            <li><b>male_parent:</b> Required in the header, but value may be left blank for most cross types. Must be specified for biparental, sib, polycross and bulk cross types. When specified, accession or population names must exist as <b>uniquenames</b> in the database.</li>
                            <li><b>female_plot:</b> Plot names must exist in the database.</li>
                            <li><b>male_plot:</b> Plot names must exist in the database.</li>
                        </div>
                        <div id = "plant_parent_info" style="display:none">
                            <li><b>female_parent:</b> Accession names must exist as <b>uniquenames</b> in the database.</li>
                            <li><b>male_parent:</b> Required in the header, but value may be left blank for most cross types. Must be specified for biparental, sib, polycross and bulk cross types. When specified, accession or population names must exist as <b>uniquenames</b> in the database.</li>
                            <li><b>female_plant:</b> Plant names must exist in the database.</li>
                            <li><b>male_plant:</b> Plant names must exist in the database.</li>
                        </div>
                        <div id = "any_parent_info" style="display:none">
                            <li><b>female_parent:</b> Female parent names must exist as <b>uniquenames</b> in the database, can be accession, plot, plant or population stock type.</li>
                            <li><b>male_parent:</b> Required in the header, but value may be left blank for most cross types. Must be specified for biparental, sib, polycross and bulk cross types. When specified, male parent names must exist as <b>uniquenames</b> in the database, can be accession, plot, plant or population stock type.</li>
                        </div>
                    </ul>
                    <b>Optional columns (additional parent info):</b> You can add additional parent info after male_plant column by using one or more of these column headers.
                    <ul>
                        <li>female_focus_trait</li>
                        <li>male_focus_trait</li>
                        <li>female_source_trial</li>
                        <li>male_source_trial</li>
                    </ul>
                    <b>Additional cross information:</b>
                    <ul>
                        <li>After cross unique ids are stored in the database, you can add field crossing data (e.g. pollination date, total number of flowers pollinated, total number of fruits set) or progenies to each cross unique id.</li>
                        <li>Field crossing data and progenies can be uploaded via links in crossing experiment detail page or can be added directly in each cross detail page.</li>
                    </ul>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<script>

jQuery(document).ready(function(){

    jQuery('#upload_new_crosses_link').click(function(){
        jQuery('#upload_crosses_dialog').modal("show");

        var trial_id = "";
        var trial_name = "";
        if (trial_id) {
            jQuery('#crossing_experiment_page_section_1').modal("show");
            jQuery('#manage_page_section_1').modal("hide");

            jQuery('#crossing_experiment_page_section_2').modal("show");
            jQuery('#manage_page_section_2').modal("hide");

        }
    });

    jQuery("[name='upload_crosses_dismiss_button']").click(function() {
        jQuery('#upload_crosses_dialog').modal('hide');
        jQuery('#upload_crosses_breeding_program_select_div').val('');
        jQuery('#upload_crosses_crossing_experiment_select_div').val('');
        jQuery('#cross_file_format_option').val('');
        jQuery('#xls_crosses_simple_file').val('');
        jQuery('#xls_crosses_plots_file').val('');
        jQuery('#xls_crosses_plants_file').val('');
        jQuery('#xls_crosses_simplified_parents_file').val('');
        location.reload();
    });


});

</script>


<style>
  .ui-autocomplete {
  max-height: 100px;
  overflow-y: auto;
  /* prevent horizontal scrollbar */
  overflow-x: hidden;
  }

  /* IE 6 doesn't support max-height
  * we use height instead, but this forces the menu to always be this tall
  */
  * html .ui-autocomplete {
  height: 100px;
  }
</style>

<div class="modal fade" id="create_cross" name="create_cross" tabindex="-1" role="dialog" aria-labelledby="createNewCrossesDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content ui-front">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="createNewCrosses">Add New Cross</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">

                    









                        
    
                        
    

                        <form class="form-horizontal" role="form" name="create_cross_form" id="create_cross_form">

                            
    
                            
    
                            
    
                        </form>

                        
  
                    
<div id="add_cross_workflow" class="workflow">
  <ol class="workflow-prog">
      <li><div class="workflow-title">Intro</div></li>
      <li><div class="workflow-title">Crossing Experiment</div></li>
      <li><div class="workflow-title">Enter cross information</div></li>
      <li><div class="workflow-title">Enter parentage information</div></li>
      <li><div class="workflow-title">Additional cross info</div></li>
  </ol>
  <div class="panel panel-default">
    <div class="panel-body">
      <ol class="workflow-content">
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">What is a cross?</h3></div>


                            <ul>
                                <li>The Cross Tool can track any pollinations in a breeding program.</li>
                                <li>Each cross has a globally unique cross id.</li>
                                <li>Supported cross types are: biparental, self, open, backcross, sib, polycross, bulk, bulk_self, bulk_open, doubled_haploid, or dihaploid_induction</li>
                                <li>For an open pollinated cross, the cross can be defined as between female accession A and male population P1 (populations in the database are defined strictly as groups of accessions). If the male parent is not known, it can be left blank.</li>
                                <li>For backcross cross type, cross unique id can be used as one of the parents.</li>
                                <li>An individual cross can be linked to the specific female plot or plant, as well as to the specific male plot or plant.</li>
                                <li>A cross can have other data associated to it, such as number of flowers, pollination date, etc.</li>
                                <li>Seed produced by a cross can be managed using a seedlot.</li>
                                <li>Progenies from a cross can become named accessions in the database.</li>
                            </ul>

                            <br/>
                            <center>
                                <button id="next_step_cross_intro" class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
                            </center>
                        </li>
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">Select a crossing experiment</h3></div>


                            <p>Crossing experiments are for grouping crosses together. The grouping is most often done for crosses derived from the same field trial, the same year, or for crosses that have the same breeding objective.</p>
                            <center>
                                <button class="btn btn-info" name="create_crossingtrial_link">If you need to create a crossing experiment, click here</button><br/><br/>
                                <button id="next_step_cross_experiment" class="btn btn-primary" onclick="Workflow.complete(this);">Once you have a crossing experiment, go to Next Step</button>
                            </center>

                        </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Enter basic information about the cross</h3></div>


                                <table style="border: 1px solid gray; padding: 1em 2em; margin: 25px 15px; background: #f3f3ff;">
  <tr>
    <td>
      <img src="/documents/img/info_icon.png" border="0" style="margin: 10px; vertical-align: middle" />
    </td>
    <td style="padding-top: 0.35em; padding-right:0.35em; vertical-align: middle">

                                    <p>
                                        <b>Cross type information</b>
                                        <br>
                                        <a id="cross_type_info">Descriptions of cross types</a>
                                    </p>
                                
     </td>
  </tr>
</table>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Breeding Program: </label>
                                    <div class="col-sm-9">
                                        <div id="add_cross_breeding_program_select_div" name="add_cross_breeding_program_select_div">
                                        </div>
                                    </div>
                                </div><br/><br/><br/>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Crossing Experiment: </label>
                                    <div class="col-sm-9">
                                        <div id="add_cross_crossing_experiment_select_div" name="add_cross_crossing_experiment_select_div" >
                                        </div>
                                    </div>
                                </div><br/><br/>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Cross Unique ID: </label>
                                    <div class="col-sm-9">
                                        <input class="form-control" type="text" id="cross_name" name="cross_name" />
                                    </div>
                                </div><br/><br/>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Cross Combination (optional): </label>
                                    <div class="col-sm-9">
                                        <input class="form-control" type="text" id="dialog_cross_combination" name="dialog_cross_combination" placeholder="e.g. female_name/male_name"/>
                                    </div>
                                </div><br/><br/>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">Cross Type: </label>
                                    <div class="col-sm-9">
                                        <select class="form-control" id="cross_type">
                                            <option value="">Select a cross type</option>
                                            <option value="biparental">biparental</option>
                                            <option value="self">self</option>
                                            <option value="open">open pollinated</option>
                                            <option value="backcross">backcross</option>
                                            <option value="sib">sib</option>
                                            <option value="bulk">bulk</option>
                                            <option value="bulk_self">bulk selfed</option>
                                            <option value="bulk_open">bulk and open pollinated</option>
                                            <option value="doubled_haploid">doubled haploid</option>
					    <option value="dihaploid_induction">dihaploid induction</option>
                                            <option value="polycross">polycross</option>
                                            <option value="reciprocal">reciprocal</option>
                                            <option value="multicross">multicross</option>
                                        </select>
                                    </div>
                                </div>
                                <br/><br/>
                                <center>
                                    <button id="next_step_cross_information" class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
                                </center>
                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Enter basic information about the cross</h3></div>


                                <div class="form-group" id="get_maternal_parent" style="display: none">
                                    <label class="col-sm-2 control-label">Female Parent: </label>
                                    <div class="col-sm-10">
                                        <input class="form-control" id="maternal_parent" type="text" name="maternal" placeholder="Enter female parent name" />
                                    </div><br/><br/>
                                </div>
                                <div class="form-group" id="get_paternal_parent" style="display: none">
                                    <label class="col-sm-2 control-label">Male Parent: </label>
                                    <div class="col-sm-10">
                                        <input class="form-control" id="paternal_parent" type="text" name="paternal" placeholder="Enter male parent name"  />
                                    </div><br/><br/>
                                </div>
                                <div class="form-group" id="get_selfed_parent" style="display: none">
                                    <label class="col-sm-2 control-label">Selfed Parent: </label>
                                    <div class="col-sm-10">
                                        <input class="form-control" id="selfed_parent" type="text" name="selfed" placeholder="Enter parent name" />
                                    </div><br/><br/>
                                </div>
                                <div class="form-group" id="get_open_maternal_parent" style="display: none">
                                    <label class="col-sm-2 control-label">Female Parent: </label>
                                    <div class="col-sm-10">
                                        <input class="form-control" id="open_maternal_parent" type="text" name="open maternal" placeholder="Enter female parent name" />
                                    </div><br/><br/>
                                </div>
                                <div class="form-group" id="get_open_paternal_population" style="display: none">
                                    <div class="col-sm-2"><center><label class="control-label">Male Population: </label><i>(optional)</i></center></div>
                                    <div class="col-sm-10">
                                        <input class="form-control" id="open_paternal_population" type="text" name="open paternal" placeholder="Enter male population name" />
                                    </div><br/><br/>
                                </div>
                                <div class="form-group" id="get_bulk_maternal_population" style="display: none">
                                    <label class="col-sm-2 control-label">Female Population: </label>
                                    <div class="col-sm-10">
                                        <input class="form-control" id="bulk_maternal_population" type="text" name="bulk maternal" placeholder="Enter female population name" />
                                    </div><br/><br/>
                                </div>
                                <div class="form-group" id="get_bulk_paternal_parent" style="display: none">
                                    <label class="col-sm-2 control-label">Male Parent: </label>
                                    <div class="col-sm-10">
                                        <input class="form-control" id="bulk_paternal_parent" type="text" name="bulk paternal" placeholder="Enter male parent name" />
                                    </div><br/><br/>
                                </div>
                                <div class="form-group" id="get_bulk_selfed_population" style="display: none">
                                    <label class="col-sm-2 control-label">Selfed Population: </label>
                                    <div class="col-sm-10">
                                        <input class="form-control" id="bulk_selfed_population" type="text" name="bulk selfed" placeholder="Enter parent population name" />
                                    </div><br/><br/>
                                </div>
                                <div class="form-group" id="get_bulk_open_maternal_population" style="display: none">
                                    <label class="col-sm-2 control-label">Female Population: </label>
                                    <div class="col-sm-10">
                                        <input class="form-control" id="bulk_open_maternal_population" type="text" name="bulk open maternal" placeholder="Enter female population name" />
                                    </div><br/><br/>
                                </div>
                                <div class="form-group" id="get_bulk_open_paternal_population" style="display: none">
                                    <div class="col-sm-2"><center><label class="control-label">Male Population: </label><i>(optional)</i></center></div>
                                    <div class="col-sm-10">
                                        <input class="form-control" id="bulk_open_paternal_population" type="text" name="bulk open paternal" placeholder="Enter male population name" />
                                    </div><br/><br/>
                                </div>
                                <div class="form-group" id="get_doubled_haploid_parent" style="display: none">
                                    <label class="col-sm-2 control-label">Doubled Haploid Parent: </label>
                                    <div class="col-sm-10">
                                        <input class="form-control" id="doubled_haploid_parent" type="text" name="doubled haploid" placeholder="Enter parent name" />
                                    </div><br/><br/>
                                </div>
				<div class="form-group" id="get_dihaploid_induction_parent" style="display: none">
                                  <label class="col-sm-2 control-label">Dihaploid induction Parent: </label>
                                  <div class="col-sm-10">
                                    <input class="form-control" id="dihaploid_induction_parent" type="text" name="dihaploid_induction" placeholder="Enter parent name" />
                                  </div><br/><br/>
                                </div>
                                <div class="form-group" id="polycross_accessions" style="display: none">
                                    <label class="col-sm-2 control-label">Accessions to use in Polycross: </label>
                                    <div class="col-sm-10">
                                        <div id="polycross_accession_list"></div>
                                    </div><br/><br/>
                                </div>
                                <div class="form-group" id="reciprocal_accessions" style="display: none">
                                    <label class="col-sm-2 control-label">Accessions to use in Reciprocal cross: </label>
                                    <div class="col-sm-10">
                                        <div id="reciprocal_accession_list"></div>
                                    </div><br/><br/>
                                </div>
                                <div class="form-group" id="maternal_accessions" style="display: none">
                                    <label class="col-sm-2 control-label">Multicross Female Parents: </label>
                                    <div class="col-sm-10">
                                        <div id="maternal_accession_list"></div>
                                    </div><br/><br/>
                                </div>
                                <div class="form-group" id="paternal_accessions" style="display: none">
                                    <label class="col-sm-2 control-label">Multicross Male Parents: </label>
                                    <div class="col-sm-10">
                                        <div id="paternal_accession_list"></div>
                                    </div><br/><br/>
                                </div>
                                <div class="form-group" id="exact_parents" style="display: none">
                                    <div id="pagetitle"><h3 id="pagetitle_h3">Optional: If you choose to record exact cross parents, you can do so.</h3></div>


                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">Field Trial: </label>
                                        <div class="col-sm-10">
                                            <div class="input-group">
                                                <input type ="text" class ="form-control" id ="field_trial" placeholder="Enter trial name">
                                                <div class ="input-group-btn">
                                                    <button class = "btn btn-info" id ="search_plots"></i>Search Plots</button>
                                                </div>
                                            </div>
                                        </div>
                                    </div><br/><br/>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">Female Plot: </label>
                                        <div class="col-sm-10">
                                            <select class="form-control" id="female_plot" name="female_plot">
                                                <option value="">Enter trial name first</option>
                                            </select>
                                        </div>
                                    </div><br/><br/>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">Male Plot: </label>
                                        <div class="col-sm-10">
                                            <select class="form-control" id="male_plot" name="male_plot">
                                                <option value="">Enter trial name first</option>
                                            </select>
                                        </div>
                                    </div><br/><br/>
                                </div>
                                <br>
                                <center>
                                    <button id="next_step_basic_information" class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
                                </center>
                            </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">If you would like to add auto-generated progeny names for this cross, you can add it here</h3></div>

                                <h3>Optional:</h3>
                                <table>
                                <!--
                                    <tr>
                                        <td>
                                            <div class="form-group">
                                                <label class="col-sm-9 control-label">Specify Pollination Date: </label>
                                                <div class="col-sm-3">
                                                    <input id= "pollination_date_checkbox" type="checkbox" />
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div class="form-group" id="get_pollination_date" style="display: none">
                                                <label class="col-sm-6 control-label">Pollination Date (YYYY/MM/DD): </label>
                                                <div class="col-sm-6">
                                                    <input class="form-control" type="text" id="pollination_date" />
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="form-group">
                                                <label class="col-sm-9 control-label">Specify Number of Flowers: </label>
                                                <div class="col-sm-3">
                                                    <input id= "flower_number_checkbox" type="checkbox" />
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label class="col-sm-9 control-label">Specify Number of Fruits: </label>
                                                <div class="col-sm-3">
                                                    <input id= "fruit_number_checkbox" type="checkbox" />
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div class="form-group" id="get_flower_number" style="display: none">
                                                <label class="col-sm-6 control-label">Number of Flowers: </label>
                                                <div class="col-sm-6">
                                                    <input class="form-control" type="text" id="flower_number" />
                                                </div>
                                            </div>
                                            <div class="form-group" id="get_fruit_number" style="display: none">
                                                <label class="col-sm-6 control-label">Number of Fruits: </label>
                                                <div class="col-sm-6">
                                                    <input class="form-control" type="text" id="fruit_number" />
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="form-group">
                                                <label class="col-sm-9 control-label">Specify Number of Seeds: </label>
                                                <div class="col-sm-3">
                                                    <input id= "seed_number_checkbox" type="checkbox" />
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div class="form-group" id="get_seed_number" style="display: none">
                                                <label class="col-sm-6 control-label">Number of Seeds: </label>
                                                <div class="col-sm-6">
                                                    <input class="form-control" type="text" id="seed_number" />
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    -->
                                    <tr>
                                        <td>
                                            <div class="form-group">
                                                <label title="You may choose to create accessions for the progeny of the cross at this time." class="col-sm-9 control-label">Add New Accessions for Progeny: </label>
                                                <div class="col-sm-3">
                                                    <input id="create_progeny_checkbox" type="checkbox"/>
                                                </div>
                                            </div>
                                        </td>
                                        <td>
                                            <div class="form-group" id="create_progeny_number" style="display: none">
                                                <label class="col-sm-6 control-label">Number of progeny: </label>
                                                <div class="col-sm-6">
                                                    <input class="form-control" type="text" id="progeny_number" />
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr id="use_prefix_suffix" style = "display: none">
                                        <td>
                                            <div class="form-group">
                                                <label class="col-sm-9 control-label">Use Prefix and/or Suffix: </label>
                                                <div class="col-sm-3">
                                                    <input id="use_prefix_suffix_checkbox" type="checkbox" checked/>
                                                </div>
                                            </div>
                                        </td>
                                        <td id="get_prefix_suffix" style="display: none">
                                            <div class="form-group" >
                                                <label class="col-sm-6 control-label">Prefix: </label>
                                                <div class="col-sm-6">
                                                    <input class="form-control" id="prefix" name="prefix" value="P" size="5" />
                                                </div>
                                            </div>
                                            <div class="form-group" >
                                                <label class="col-sm-6 control-label">Suffix: </label>
                                                <div class="col-sm-6">
                                                    <input class="form-control" id="suffix" name="suffix" size="5" />
                                                </div>
                                            </div>
                                        </td>
                                    </tr>
                                </table>
                                <br/>
                                <center>
                                    <button class="btn btn-primary" name="create_cross_submit" id="create_cross_submit" onclick="Workflow.complete(this, false);">Submit Cross</button>
                                </center>
                            </li>
      </ol>
      <div class="workflow-pending-message">
                            <div id="pagetitle"><h3 id="pagetitle_h3">Finished! Your cross is now in the database</h3></div>

                            <p>
                                <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                                The cross was added successfully
                            </p>

                            <ul>
                                <li>You may want to proceed to the cross detail page for the cross you just created.</li>
                                <li>You can print barcodes for the cross.</li>
                                <li>You can add crossing information as it becomes available (e.g. number of seeds, progeny, etc).</li>
                            </ul>
                            <br/>
                        </div>
      <div class="workflow-complete-message">
                            <div id="pagetitle"><h3 id="pagetitle_h3">Finished! Your cross is now in the database</h3></div>

                            <p>
                                <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                                The cross was added successfully
                            </p>

                            <ul>
                                <li>You may want to proceed to the cross detail page for the cross you just created.</li>
                                <li>You can print barcodes for the cross.</li>
                                <li>You can add crossing information as it becomes available (e.g. number of seeds, progeny, etc).</li>
                            </ul>
                            <br/>
                        </div>
    </div>
  </div>
</div>
<script type="text/javascript">
  Workflow.init("#add_cross_workflow");
</script>
<!-- End of workflow -->
                </div>
            </div>
            <div class="modal-footer">
                <button id="new_cross_close_modal" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="cross_type_dialog" name="cross_type_dialog" tabindex="-1" role="dialog" aria-labelledby="crossTypeDialog">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="crossTypeDialog">Template Information</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <h2>
                        Individual Crosses:
                    </h2>

                    <p><b>biparental:</b> An individual plant pollinated by another individual plant.</p>
                    <p><b>self:</b> A self pollinated individual plant.</p>
                    <p><b>open pollinated:</b> An individual plant pollinated by a group of plants or open pollinated (pollen may be from a group with known or unknown members).</p>
                    <p><b>backcross:</b> An individual plant pollinated by one of its parents.</p>
                    <p><b>sib:</b> Mating between individuals that have at least one parent in common. Generally between two individuals within the same plot.</p>
                    <p><b>bulk:</b> A group of plants (usually a related family) pollinated by an individual plant.</p>
                    <p><b>bulk selfed:</b> A group of plants (usually a related family) that are self pollinated (each individual selfed, not combined pollen).</p>
                    <p><b>bulk and open pollinated:</b> A group of plants (usually a related family) that are pollinated by another group of plants or open pollinated (pollen may be from a group with known or unknown members).</p>
                    <p><b>doubled haploid:</b> Plants derived from doubling the chromosome number of haploid tissue.</p>
		    <p><b>dihaploid induction:</b> Plants derived from a chromosome reduction from tetraploid to diploid</p>
                    <br>

                    <h2>
                      Group of Crosses:
                    </h2>

                    <p><b>polycross:</b> Creates a group of open pollinated crosses. Each accession in the selected list becomes the female parent in an open cross, and all the members of the list grouped together form the male parent.<p>
                    <p><b>reciprocal:</b> Creates a group of biparental crosses. Starting with a list of accessions, all possible biparental cross combinations are made between them.<p>
                    <p><b>multicross:</b> Creates a group of biparental crosses. Starting with a list of maternal accessions and a list of paternal accessions, direct crosses are made in order.<p>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="cross_saved_dialog_message" name="cross_saved_dialog_message" tabindex="-1" role="dialog" aria-labelledby="crossSavedDialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="crossSavedDialog">Success</h4>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
	    <p>
    	  <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
    	  The cross or crosses were saved successfully.
  	  </p>
        </div>
      </div>
      <div class="modal-footer">
        <button id="dismiss_cross_saved_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>

<script>

jQuery.noConflict();

jQuery(document).ready(function($) {

    jQuery("#field_trial").autocomplete({
        source:'/ajax/stock/project_autocomplete',
    });

    $("#search_plots").click(function(e){
        e.preventDefault();

        var maternal_parent;
        if ($('#maternal_parent').val() != ''){
            maternal_parent = $('#maternal_parent').val();
        }

        if ($('#selfed_parent').val() != ''){
            maternal_parent = $('#selfed_parent').val();
        }

        if ($('#open_maternal_parent').val() != ''){
            maternal_parent = $('#open_maternal_parent').val();
        }

        console.log(maternal_parent);

        jQuery.ajax({
            url:'/ajax/breeders/get_accession_plots',
            data:{'field_trial':$('#field_trial').val(),
                  'parent_accession':maternal_parent,
                  },
            success: function(response){
            console.log(response);
            var html = '<select id = "female_plot" >';
            for (var i=0; i<response.data.length; i++) {
            html = html + "<option value='"+response.data[i][0]+ "'>" + response.data[i][1] + "</option>";
            }
            html = html + "</select>";
            console.log(html);

            if(i ==''){
            alert("No female plot");
            return;
            }

            jQuery('#female_plot').html(html);

            },
            error:function(response){
            alert("An error occurred getting female plots.");
            }
        });

        var paternal_parent;

        if ($('#paternal_parent').val() != ''){
        paternal_parent = $('#paternal_parent').val();
        }

        if ($('#selfed_parent').val() != ''){
        paternal_parent = $('#selfed_parent').val();
        }

        jQuery.ajax({
            url:'/ajax/breeders/get_accession_plots',
            data:{'field_trial':$('#field_trial').val(),
                  'parent_accession':paternal_parent,
                  },
            success: function(response){
            console.log(response);
            var html = '<select id = "male_plot" >';
            for (var i=0; i<response.data.length; i++) {
            html = html + "<option value='"+response.data[i][0]+ "'>" + response.data[i][1] + "</option>";
            }
            html = html + "</select>";
            console.log(html);

            if(i ==''){
            alert("No male plot");
            return;
            }

            jQuery('#male_plot').html(html);

            },
        });
    });
});

</script>





<div class="modal fade" id="create_crossingtrial_dialog" name="create_crossingtrial_dialog" tabindex="-1" role="dialog" aria-labelledby="createCrossingTrialDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content ui-front">
            <div class="modal-header">
                <button type="reset" class="close" id="add_crossing_experiment_dismiss_button_1" name="add_crossing_experiment_dismiss_button" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <center><h4 class="modal-title" id="creatCrossingTrial">Add New Crossing Experiment</h4></center>
            </div>
            <div class="modal-body">
                <div class="container-fluid">

                    









                        
    

                        <form class="form-horizontal" role="form" name="create_crossingtrial_form" id="create_crossingtrial_form">
                            
    
                        </form>

                        
  
                    
<div id="add_crossing_trial_workflow" class="workflow">
  <ol class="workflow-prog">
      <li><div class="workflow-title">Intro</div></li>
      <li><div class="workflow-title">Add a crossing experiment</div></li>
  </ol>
  <div class="panel panel-default">
    <div class="panel-body">
      <ol class="workflow-content">
          <li>
                            <div id="pagetitle"><h3 id="pagetitle_h3">What are crossing experiments?</h3></div>


                            <p>Crossing experiments group crosses. The grouping can reflect crosses done in the same field trial, crosses in a breeding program in a given year, or crosses that have the same breeding objective. This grouping can be used to encapsulate all the crosses done in a crossing block field trial that you have saved in the database (e.g. in Manage Trials your crossing block will appear as a field trial with plots)</p>
                            <hr>

                            <center>
                                <button id="next_step_add_new_intro" class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
                            </center>
                        </li>
          <li>
                                <div id="pagetitle"><h3 id="pagetitle_h3">Enter basic information about the crossing experiment</h3></div>

                                    <br/>
                                    <div class="form-group">
                                        <label class="col-sm-4 control-lable">Crossing Experiment Name: </label>
                                        <div class="col-sm-8">
                                            <input class="form-control" type="text" id="crossingtrial_name" name="crossingtrial_name"  />
                                        </div>
                                    </div><br/>
                                    <div class="form-group">
                                        <label class="col-sm-4 control-label">Breeding Program: </label>
                                        <div class="col-sm-8">
                                            <select class="form-control" id="crossingtrial_program" name="crossingtrial_program">
                                                <option value="">Select Breeding Program</option>
<option value='896'>ABC-International</option><option value='891'>BiovInt</option><option value='890'>CIAT</option><option value='722'>ICAR_NRCB</option><option value='287'>IITA</option><option value='289'>NARITA</option><option value='288'>NARO</option><option value='465'>NIHORT</option>                                            </select>
                                        </div>
                                    </div><br/>
                                    <div class="form-group">
                                        <label class="col-sm-4 control-label">Location of crossing experiment: </label>
                                        <div class="col-sm-8">
                                            <select class="form-control" id="crossingtrial_location" name="crossingtrial_location">
                                                <option value="">Select Location</option>
<option value="Cornell Biotech" data-program="">Cornell Biotech</option><option value="Sendusu" data-program="IITA & ABC-International & BiovInt">Sendusu</option><option value="Mbarara" data-program="BiovInt & ABC-International">Mbarara</option><option value="mitalula" data-program="BiovInt & ABC-International">mitalula</option><option value="Kawanda" data-program="ABC-International & BiovInt & NARO">Kawanda</option><option value="Maruku" data-program="ABC-International & BiovInt">Maruku</option><option value="Lyamungo-TaCRI" data-program="BiovInt & ABC-International">Lyamungo-TaCRI</option><option value="Ibadan" data-program="IITA">Ibadan</option><option value="Onne" data-program="IITA">Onne</option><option value="Arusha" data-program="IITA">Arusha</option><option value="Hoima" data-program="NARITA & NARO">Hoima</option><option value="[Computation]" data-program="">[Computation]</option><option value="Ibadan-onsite" data-program="">Ibadan-onsite</option>                                            </select>
                                        </div>
                                    </div><br/>
                                    <div class="form-group">
                                        <label class="col-sm-4 control-label">Year:</label>
                                        <div class="col-sm-8">
                                            <div id="crosses_add_project_year" name="crosses_add_project_year" ></div>
                                        </div>
                                    </div><br/>
                                    <div class="form-group">
                                        <label class="col-sm-4 control-label">Description:</label>
                                        <div class="col-sm-8">
                                            <textarea class="form-control" id="crosses_add_project_description" name="crosses_add_project_description" ></textarea>
                                        </div>
                                    </div>
                                <br/>
                                <br/>
                                <br/>
                                <center>
                                    <button type="button" class="btn btn-primary" onclick="Workflow.complete(this, false);" name="create_crossingtrial_submit" id="create_crossingtrial_submit">Submit</button>
                                </center>
                            </li>
      </ol>
      <div class="workflow-pending-message">
                            <div id="pagetitle"><h3 id="pagetitle_h3">Finished! Your crossing experiment is now in the database</h3></div>

                            <p>
                                <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                                Crossing experiment was added successfully
                            </p>

                            <ul>
                                <li>You may want to proceed to the crossing experiment detail page you just created.</li>
                                <li>You can add or upload crosses into your crossing experiment as they become available.</li>
                                <li>You can add crossing information as it becomes available (e.g. number of seeds, progeny, etc).</li>
                            </ul>
                            <br/>
                        </div>
      <div class="workflow-complete-message">
                            <div id="pagetitle"><h3 id="pagetitle_h3">Finished! Your crossing experiment is now in the database</h3></div>

                            <p>
                                <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
                                Crossing experiment was added successfully
                            </p>

                            <ul>
                                <li>You may want to proceed to the crossing experiment detail page you just created.</li>
                                <li>You can add or upload crosses into your crossing experiment as they become available.</li>
                                <li>You can add crossing information as it becomes available (e.g. number of seeds, progeny, etc).</li>
                            </ul>
                            <br/>
                        </div>
    </div>
  </div>
</div>
<script type="text/javascript">
  Workflow.init("#add_crossing_trial_workflow");
</script>
<!-- End of workflow -->
                </div>
            </div>
            <div class="modal-footer">
                <button id="add_crossing_experiment_dismiss_button_2" name="add_crossing_experiment_dismiss_button" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<script>

jQuery(document).ready(function(){

    var selectedProgram = jQuery('#crossingtrial_program option:selected').text()

    filter_options(selectedProgram, 'program', 'crossingtrial_location');

    jQuery('#crossingtrial_program').change(function() {
        filter_options(jQuery('#crossingtrial_program option:selected').text(), 'program', 'crossingtrial_location');
    });

    jQuery("[name='add_crossing_experiment_dismiss_button']").click(function() {
        jQuery('#create_crossingtrial_dialog').modal('hide');
        jQuery('#crossingtrial_name').val('');
        jQuery('#crossingtrial_program').val('');
        jQuery('#crossingtrial_location').val('');
        jQuery('#crosses_add_project_year').val('');
        jQuery('#crosses_add_project_description').val('');
    });


});

</script>



  <center>
    
<div class="modal fade" id="usage_policy" name="usage_policy" tabindex="-1" role="dialog" aria-labelledby="usagePolicyDialog" data-controls-modal="your_div_id" data-backdrop="static" data-keyboard="false" href="#">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="modal-title" id="usagePolicyDialog">Please Note: Website Data Usage Policy</h4>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
	  <h4>MusaBase adheres to the Toronto agreement on prepublication data release</h4>
All data deposited on MusaBase adheres to the Toronto Agreement on prepublication data release. To foster transparent and accessible data sharing culture, in accordance with the Toronto Agreement, all data deposited on MusaBase will be made public immediately. Data producers can provide information on the data they deposit, including planned analyses and publication timeline information, to indicate their publication intentions. Data users are expected to respect scientific etiquette and allow data producers the first global analyses of their data set, and should be aware that pre-publication data may not have been subject to full quality control and peer review, so caution must be applied when utilizing these data. More information is available on the <a href="/usage_policy">data usage policy</a> page.
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" id="usage_policy_disagree_submit">Don't Agree</button>
        <button type="button" class="btn btn-primary" id="usage_policy_agree_submit">Agree</button>
      </div>
    </div>
  </div>
</div>


<script>

  jQuery('#usage_policy_agree_submit').click( function () {
     jQuery.cookie("website_usage_policy_approved", "1", { expires: 10000 } );
     jQuery('#usage_policy').modal("hide");
  });

  jQuery('#usage_policy_disagree_submit').click( function () {
     document.location.href="http://www.biochemie.nat.uni-erlangen.de/Cassava/index.html";
  });


  if (jQuery.cookie("website_usage_policy_approved") == 1) {
    document.write('<div class="well well-sm">You have already accepted the <a href="/usage_policy">website usage policy</a>. Thank you.</div>');
  }

  window.onload=function() {
    var cookie = jQuery.cookie("website_usage_policy_approved");
  //alert("have cookie: "+cookie);

    if (cookie == undefined) {
    //  alert("showing!");

      jQuery('#usage_policy').modal("show");
  //alert("Done!");
    }
    else {
      //alert("Hiding!");
      jQuery('#usage_policy').modal("hide");

    }
  }

</script>

  </center>
</div>

<div class="container-fluid">
    <div class="row">
        <div class="col-sm-6 col-md-6 col-lg-6">

            <div class="panel panel-info">
                <div class="panel-heading">News</div>
                <div class="panel-body" style="overflow:hidden">
                    

<!-- <div class="boxbgcolor1" style="margin:0px;">
<div class="boxheading">News</div>
<div class="boxcontent"> -->
  <div class="subheading">Breedbase/Cassavabase Webinar</div>
<div class="boxsubcontent">
A Cassavabase Webinar will be given on Wednesday, March 23, at 8am EST, 12:00 GMT, 13:00 WAT/CET and 15:00 EAT.
<a href="https://cornell.zoom.us/j/93893326747?pwd=UWVzTG5qa25pWE1Vd3RqRkFSbkJSdz09">Zoom Link</a>. Topics will also be relevant to Musabase users.
</div>
<div class="subheading"><a href="/breeders/manage_programs">Product Profile Management</a></div>
<div class="boxsubcontent">
Manage product profiles on the site! Each breeding program can define product profiles on the respective <a href="/breeders/manage_programs">breeding program manage</a> page. [Nov 1, 2020]
</div>
<div class="subheading"><a href="/tools/mixedmodels">Mixed Model tool</a></div>
<div class="boxsubcontent">
A tool for calculating mixed models is now <a href="/tools/mixedmodels">available</a>. [Nov 1, 2020]
</div>
<div class="subheading">
<b><a href="https://www.youtube.com/watch?v=eWnLfTJUsPs">NARO: New Banana Breed Are Disease Resistant </a></b>
</div>
<div class="boxsubcontent">
25 million Ugandans rely on Matooke cultivation, interview Breeding Better Banana project leaders on NBS TV channel. [April 27, 2017]
</div>

<!-- </div> -->

<button class="btn btn-info btn-sm" onclick='location.href="/oldhighlights.pl"'>See all news...</button>

<!--
<a href="oldhighlights.pl">See all news...</a>
-->
<!-- </div> -->

                </div>
            </div>

            <div class="panel panel-info">
                <div class="panel-heading">Featured Publication</div>
                <div class="panel-body" style="overflow:hidden">
                    

<!--
<div class="boxbgcolor1" style="margin:0px;">
<div class="boxheading">Featured publication</div>
<div class="boxcontent"><div class="boxsubheading"><a href="https://dl.sciencesocieties.org/publications/tpg/articles/0/0/170090">Genomic Prediction in a Multiploid Crop: Genotype by Environment Interaction and Allele Dosage Effects on Predictive Ability in Banana</a></div>
<div class="boxsubcontent">
Moses Nyine, Brigitte Uwimana, Nicolas Blavet, Eva Hribova, Helena Vanrespaille, Michael Batte, Violet Akech, Allan Brown, Jim Lorenzen, Rony Swennend and Jaroslav Dolezel. PLant genome March 2, 2018 doi:10.3835/plantgenome2017.10.0090
</Div>

<a href="oldpublications.pl">See all publications...</a></div>
-->

<h4>Featured Publication</h4>
<div class="boxsubheading"><a href="https://dl.sciencesocieties.org/publications/tpg/articles/0/0/170090">Genomic Prediction in a Multiploid Crop: Genotype by Environment Interaction and Allele Dosage Effects on Predictive Ability in Banana</a></div>
<div class="boxsubcontent">
Moses Nyine, Brigitte Uwimana, Nicolas Blavet, Eva Hribova, Helena Vanrespaille, Michael Batte, Violet Akech, Allan Brown, Jim Lorenzen, Rony Swennend and Jaroslav Dolezel. PLant genome March 2, 2018 doi:10.3835/plantgenome2017.10.0090
</Div>

<button class="btn btn-info btn-sm" onclick='location.href="/oldpublications.pl"'>See all publications...</button>
<br/>
                </div>
            </div>

        </div>

        <div class="col-sm-6 col-md-6 col-lg-6">

            <div class="panel panel-info">
                <div class="panel-heading">Events</div>
                <div class="panel-body" style="overflow:hidden">
                    


<div>
<div class="subheading"> <a href="https://plan.core-apps.com/pag_2023/event/3cee484866e6d00c5e492240c4d5bad6">BreedBase Workshop at PAG 30</a></div>
<div class="boxsubcontent">
The <a href="https://plan.core-apps.com/pag_2023/event/3cee484866e6d00c5e492240c4d5bad6">BreedBase workshop</a> at <a href="http://intlpag.org">PAG 30</a> will be held at:</br/>
Venue:  Palm 7</br>
Time: Tuesday, Jan 17, 2023, 10:30 am - 12:40 pm
</div>

<a href="oldevents.pl">See all events...</a>
</div>



                </div>
            </div>

            <div class="panel panel-info">
                <div class="panel-heading">Links</div>
                <div class="panel-body" style="overflow:hidden">
                    <dl>
<dt><a href="http://btract.sgn.cornell.edu/btract/"> BTRACT</a></dt>
<dd> The Banana tracking tool dashboard (requires login)</dd>
<dt><a href="http://bananabreeding.iita.org/">Breeding Better Bananas Project</a></dt>
<dd> Project website</dd>
<dt><a href="http://banana-genome-hub.southgreen.fr/">Southgreen Banana Genome Hub</a></dt>
<dd>Database for musa genomes and genomics</dd>
<dt><a href="http://www.crop-diversity.org/mgis/">MGIS</a></dt>
<dd>Musa germplasm database</dd>
<dt><a href="http://www.promusa.org/Musapedia">Musapedia</a></dt>
<dd>Promusa: Mobilizing banana science for sustainable livelihoods</dd>
<dt><a href="http://www.farmradio.org/">Farm Radio</a></dt>
<dd>ULIZA (ask in Swahili) is an interactive platform for farmers</dd>
<dt><a href="http://www.iita.org/banana-and-plantain">IITA banana program</a></dt>
<dd>IITA banana and plantain research program </dd>
<dt><a href="http://www.banana.go.ug/">Ugandan banana research portal</a></dt>
<dd>National Banana research program for improved food security and and house hold income</dd>
<dt><a href="ftp://ftp.musabase.org/product_profiles/">Product profiles</a></dd>
<dd>Banana Product Profiles for Matooke and Mchare</dd>
<dt><a href="http://www.istrc.org">Int'l Society for Tropical Root Crops</a></dt>
</dl>
<hr>
<dl>
<dt>Banana Pests and Diseases Handbook</dt>
<dd>Altus Viljoen, Editor. <a href="ftp://ftp.musabase.org/banana_pests_and_diseases/banana_pests_and_diseases.pdf">PDF</a></dd>
</dl>
<hr>
<dl>
<dt>Genomic selection course</dt>
<dd>Jose Crossa. <a href="ftp://ftp.cassavabase.org/workshops/Genomic_selection_course/">Documentation</a></dd</dl>
<hr>
<dt>Tutorial videos</dt>
<dd>Delphine Amah et al. <a href="ftp://ftp.musabase.org/video/flowering/">Videos</a></dd</dl>
</dl>
<hr>

                </div>
            </div>

        </div>

    </div>
</div>



<div class="container-fluid">
    <div class="row">
        <div class="col-sm-12">
            <div class="panel panel-info">
                <div class="panel-heading">Recent Changes to Database</div>
                <div class="panel-body">
                    <div id="homepage_github_pullrequests_div"></div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
jQuery(document).ready(function() {
    
    var pr_body_begin = "Description <!-- Describe your changes in detail. -->\r\n-----------------------------------------------------";
    var pr_body_end = "Checklist <!-- Put an `x` in all the boxes that apply, or check them once submitted.-->";

    jQuery.ajax( {
      'url': 'https://api.github.com/repos/solgenomics/sgn/pulls?state=closed&sort=updated&direction=desc&per_page=5',
      'method': 'GET',
      'success': function(response) {
        //console.log(response);
        var html = '<table class="table table-bordered table-hover" id="homepage_github_pullrequests" alt=""><thead><tr><th>Title</th><th>Description</th><th>Date</th></tr></thead><tbody>';
        for (var i=0; i<response.length; i++){
            pr_body = response[i].body;
            trim1 = pr_body.split(pr_body_end)[0];
            body = trim1.split(pr_body_begin).slice(-1)[0];
            html = html + '<tr><td><a href="'+response[i].html_url+'" >'+response[i].title+'</a></td><td>'+body+'</td><td>'+response[i].merged_at+'</td></tr>';
        }
        html = html + '</tbody></table>';
        jQuery('#homepage_github_pullrequests_div').html(html);
      },
      error: function(response) {
        //alert('An error occurred fetching github pull requests.');
      }
    });

});
</script>



  


<!-- LOAD WORKING MODAL, LIST MODAL, AND CALENDAR MODAL AT END SO THAT THEY ALWAYS APPEAR ON TOP -->


<!-- Lists dialog -->

<div class="modal fade" id="list_dialog" name="list_dialog" tabindex="-1" role="dialog" aria-labelledby="listDialog">
  <div class="modal-dialog modal-xl" role="document">
    <div class="modal-content">
      <div class="modal-header" style="text-align:center">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h3 class="modal-title" id="listDialog">Your Lists</h3>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
	  <div id="list_dialog_div">
	  </div>
        </div>
      </div>
      <div class="modal-footer">
        <button id="view_public_lists_button" type="button" class="btn btn-primary" >View Public Lists</button>
        <button id="close_list_dialog_button" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>

<div class="modal fade" id="public_list_dialog" name="public_list_dialog" tabindex="-1" role="dialog" aria-labelledby="publicListDialog">
  <div class="modal-dialog modal-xl" role="document">
    <div class="modal-content">
      <div class="modal-header" style="text-align:center">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="publicListDialog">Public Lists</h4>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
	  <div id="public_list_dialog_div">
	  </div>
        </div>
      </div>
      <div class="modal-footer">
        <button id="close_public_list_item_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>

<div class="modal fade" id="list_item_dialog" name="list_item_dialog" tabindex="-1" role="dialog" aria-labelledby="listItemDialog">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header" style="text-align:center">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="listItemDialog">List Contents</h4>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
	  <div id="list_item_dialog_div">
	  </div>
        </div>
      </div>
      <div class="modal-footer">
        <button id="close_list_item_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>


<div class="modal fade" id="validate_accession_error_display" name="validate_accession_error_display" tabindex="-1" role="dialog" aria-labelledby="listValidationErrorDialog">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="listValidationErrorDialog">List Validation Report: Failed</h4>
            </div>
            <div class="modal-body">
              <div class="container-fluid">
		<div id='validate_stock_missing_accessions_html' style='display:none'></div>
	      </div>
	      <div id='validate_stock_add_missing_accessions_for_list' style='display:none'></div>
              <div class="well">
		
                <h3>Elements not found:</h3>

		<div id="elements_not_found_stats"></div>

		<table id="missing_accessions_table" style="margin:0pt">
		</table><br />
					
                <div id="validate_stock_add_missing_accessions">
                </div>

		<div class='well well-sm'><h3>Optional: Add Missing Accessions to A List</h3>
		  <div id='validate_stock_add_missing_accessions_for_list_div'></div>
		  <div id='stocks_with_wrong_case'></div>
		</div>
		
		<div id="validate_stock_missing_accessions"></div>
		
		<div id="adjust_case_div">
		  <h3>Mismatched case</h3>
		  <table id="wrong_case_table" style="margin:0pt">
		  </table>
		  <br />
		  
		</div>
		
		<div id="wrong_case_message_div"></div>
		<br />
		
		<button class="btn btn-default" id="adjust_case_action_button" disabled>Adjust Case</button>
		<br /><br />
		<div>
		  Click the Adjust Case button to align the case in the list with what is in the database.
		</div>
		
		<h3>Multiple mismatched case</h3>
		<div id="multiple_case_match_message_div">
		  <br />
		  Items listed here have mulitple case mismatches and must be fixed manually. If accessions need to be merged, contact the database directly.
		</div>
		
		<table id="multiple_wrong_case_table" style="margin:0pt">
		</table>
		
		<div id="multiple_case_match_div"><br /><br /></div>
		
		<h3>List elements matching a synonym</h3>
		<div id="synonym_matches_div">
		  
		  <table id="element_matches_synonym"  style="margin:0pt">
		  </table>
		  <br />
		  <button class="btn btn-default" id="replace_synonyms_with_uniquenames_button">Replace synonyms with corresponding DB name</button>
		  
		</div>
		
		<div id="synonym_message"></div>
		<br />
		
		<h3>Multiple synonym matches</h3>
		<div id="multiple_synonym_matches_div">
		  <table id="element_matches_multiple_synonyms_table" style="margin:0pt">
		  </table>
		  
		  Multiple synonym matches have to be resolved manually. Contact database administrators if necessary.
		</div>
              </div>
            </div>
	</div>
	
        <div class="modal-footer">
          <button id="close_missing_accessions_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
    </div>
</div>


<div class="modal fade" id="fuzzy_search_result_display" name="fuzzy_search_result_display" tabindex="-1" role="dialog" aria-labelledby="fuzzySearchResultDialog">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="fuzzySearchResultDialog">Fuzzy Search Results</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <div id="fuzzy_search_result_display_html">
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button id="download_fuzzy_search_result" type="button" class="btn btn-primary" onclick="javascript:downloadFuzzyResponse()" >Download</button>
                <button id="close_fuzzy_search_result_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="synonym_search_result_display" name="synonym_search_result_display" tabindex="-1" role="dialog" aria-labelledby="synonymSearchResultDialog">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="synonymSearchResultDialog">Synonym Search Results</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <div id="synonym_search_result_display_html">
                    </div>
                </div>
            </div>
            <div class="modal-footer">
              <form id="new-list-from-unames" class="form-inline" style="float:left">
                <label>Create a New List from Unique Names:</label>
                <input name="name" type="text" class="form-control" placeholder="List Name...">
                <button class="btn btn-primary" type="submit">Save</button>
              </form>
              <form class="form-inline" style="float:right">
                <button id="close_fuzzy_search_result_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
              </form>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="availible_seedlots_modal" name="availible_seedlots_modal" tabindex="-1" role="dialog" aria-labelledby="availible_seedlots_modal">
    <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4>Available Seedlots</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    
<form id="available-seedlots">
  <table class="table table-hover table-bordered">
    <thead>
      <tr>
        <th rowspan="2" style="text-align: center;">Accessions</th><th colspan="7" style="text-align: center;">Seedlots</th>
      </tr>
      <tr>
        <th></th>
        <th style="text-align: center;">Breeding Program</th>
        <th style="text-align: center;">Seedlot Name</th>
        <th style="text-align: center;">Contents</th>
        <th style="text-align: center;">Seedlot Location</th>
        <th style="text-align: center;">Count</th>
        <th style="text-align: center;">Weight(g)</th>
      </tr>
    </thead>
  </table>
</form>
<script type="text/javascript">
  (function(global){
    var mainFormSelector = "#available-seedlots";
    var d3 = global.d3v4;
    var ex = {};
    ex.build_table = function(accession_names, list_type){
      jQuery('#working_modal').modal('show');
      jQuery.ajax({
        type: 'POST',
        url: '/ajax/accessions/possible_seedlots',
        data: {'names': accession_names, 'type': list_type},
        dataType: "json",
        success: function(response) {
          _build_table(accession_names,response.seedlots,response.synonyms);
          jQuery('#working_modal').modal('hide');
        },
        error: function(response) {
          jQuery('#working_modal').modal('hide');
          console.log(response);
          alert("Something went wrong in the available-seedlots AJAX call. See console for more information.")
        }
      });
    };
    ex.get_selected = function(){
      return jQuery(mainFormSelector).serializeArray();
    };
    var empty_placeholder = new Object();
    function _build_table(accession_list,seedlot_obj,synonyms){
      console.log(seedlot_obj);
      synonymized = {};
      for (var acc_uname in seedlot_obj) {
        if (seedlot_obj.hasOwnProperty(acc_uname)) {
          var name;
          if (accession_list.indexOf(acc_uname)>-1){
            name = acc_uname;
          } else {
            for (var i = 0; i < synonyms[acc_uname].length; i++) {
              if (accession_list.indexOf(synonyms[acc_uname][i])>-1){
                name = synonyms[acc_uname][i];
                break;
              }
            }
          }
          synonymized[name] = seedlot_obj[acc_uname];
        }
      }
      var row_data = accession_list.map(function(acc){
        return {'name':acc,'seedlots':synonymized[acc]?synonymized[acc]:[]};
      });
      var table = d3.select(mainFormSelector).select("table");
      var groups = table.selectAll("tbody").data(row_data,function(d){return d.name;});
      groups.exit().remove();
      var newGroups = groups.enter().append("tbody");
      var newInitRows = newGroups.append("tr");
      newInitRows.append("th").classed("as-acc-name",true)
        .style("text-align","center")
        .style("vertical-align","middle");
      var allGroups = newGroups.merge(groups);
      allGroups.style("border-top","2px solid #999")
      allGroups.select(".as-acc-name")
        .attr("rowspan",function(d){return Math.max(1,d.seedlots.length);})
        .text(function(d){return d.name;});
      var optionRows = allGroups.selectAll("tr")
        .data(function(d){
          return d.seedlots.length>0 ? d.seedlots : [empty_placeholder];
        });
      optionRows.exit().remove();
      newOptionRows = optionRows.enter().append("tr");
      allOptionRows = newOptionRows.merge(optionRows);
      var optionRowCells = allOptionRows.selectAll("td").data(function(d){
          if (d==empty_placeholder){
            return ['<input disabled type="checkbox">'," ","No Available Seedlots"," "," "," "," "]
          }
          var cells = [];
          cells.push('<input value="'+d.seedlot[0]+'" name="'+d.seedlot[0]+'" type="checkbox">');
          cells.push(d.program);
          cells.push('<a href="/breeders/seedlot/'+d.seedlot[1]+'">'+d.seedlot[0]+'</a>');
          cells.push('<a href="/stock/'+d.contents[1]+'/view">'+d.contents[0]+'</a>');
          cells.push(d.location);
          cells.push(d.count);
          cells.push(d.weight_gram);
          return cells;
        });
      var newOptionRowCells = optionRowCells.enter().append("td");
      optionRowCells.exit().remove();
      var allOptionRowCells = newOptionRowCells.merge(optionRowCells);
      allOptionRowCells.html(function(d){return d;});
      allOptionRows.select("td") //select the checkbox cells
        .style("text-align","center")
        .style("vertical-align","middle");
    };
    global.available_seedlots = ex;
  }(window));
</script>

                </div>
            </div>
            <div class="modal-footer">
              <form id="new-list-from-seedlots" class="form-inline" style="float:left">
                <label>Create a New List from Selected Seedlots:</label>
                <input name="name" type="text" class="form-control" placeholder="List Name...">
                <button class="btn btn-primary" type="submit">Save</button>
              </form>
              <form class="form-inline" style="float:right">
                <a href="/breeders/seedlots/" class="btn btn-primary">Manage Seedlots</a>
                <button id="close_availible_seedlots_modal" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
              </form>
            </div>
        </div>
    </div>
</div>


<!-- Datasets dialog -->

<div class="modal fade" id="dataset_dialog" name="dataset_dialog" tabindex="-1" role="dialog" aria-labelledby="datasetDialog">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header" style="text-align:center">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h3 class="modal-title" id="datasetDialog">Your Datasets</h3>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
	  <div id="dataset_dialog_div">
	  </div>
        </div>
      </div>
      <div class="modal-footer">
        <button id="view_public_datasets_button" type="button" class="btn btn-primary" >View Public Datasets</button>
        <button id="close_dataset_dialog_button" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>

<div class="modal fade" id="public_dataset_dialog" name="public_dataset_dialog" tabindex="-1" role="dialog" aria-labelledby="publicListDialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header" style="text-align:center">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="publicListDialog">Public Datasets</h4>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
	  <div id="public_dataset_dialog_div">
	  </div>
        </div>
      </div>
      <div class="modal-footer">
        <button id="close_public_dataset_item_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>

<div class="modal fade" id="dataset_item_dialog" name="dataset_item_dialog" tabindex="-1" role="dialog" aria-labelledby="datasetItemDialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header" style="text-align:center">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="datasetItemDialog">Dataset Contents</h4>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
	  <div id="dataset_item_dialog_div">
	  </div>
        </div>
      </div>
      <div class="modal-footer">
        <button id="close_dataset_item_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>


<div class="modal fade" id="validate_accession_error_display" name="validate_accession_error_display" tabindex="-1" role="dialog" aria-labelledby="datasetValidationErrorDialog">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="datasetValidationErrorDialog">Dataset Validation Failed</h4>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <div id="validate_stock_add_missing_accessions_html">
                    </div>

                    <h3>Elements not found:</h3>
                    <table>
                        <tbody></tbody>
                    </table>
                </div>
            </div>
            <div class="modal-footer">
                <button id="close_missing_accessions_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>  

<script>

jQuery("#dataset_item_dialog").draggable();
jQuery("#dataset_dialog").draggable();
jQuery("#public_dataset_dialog").draggable();

</script>





<style>
.fc-center h2 {
    font-size:1.4em;
 }

.fc-day-header {
    font-size: 0.9em;
}
.datepicker{z-index:1151 !important;}
</style>

<div class="modal fade" id="calendar_modal" name="calendar_modal"  tabindex="-1" role="dialog" aria-labelledby="calendarDialog">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="calendarDialog">Your Calendar</h4>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
            <div id='calendar' style="background:#f9f9f9; padding:2px; width:100%">
            </div>
            <br/><br/>

            <div class="well well-sm">
                <center>
                    <p><b>Having trouble viewing events on the calendar?</b> <br/>Are you associated with the breeding program you are interested in viewing?</p>
                    <a class="btn btn-primary" id="calendar_bp_user_roles_show" href="/breeders/manage_roles/">Calendar Permissions</a>
                </center>
            </div>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>



<div class="modal fade" id="day_dialog" name="day_dialog"  tabindex="-1" role="dialog" aria-labelledby="addEventDialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="addEventDialog">Add New Event</h4>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
  	  <form class="form-horizontal" role="form" name="day_dialog_add_event_form" id="day_dialog_add_event_form">
    	    <div class="form-group">
      	      <label class="col-sm-2 control-label">Project: </label>
      	      <div class="col-sm-10">
		<select class="form-control" name="event_project_select" id="event_project_select"></select>
              </div>
	    </div>
	    <div class="form-group">
      	      <label class="col-sm-2 control-label">Event Type: </label>
      	      <div class="col-sm-10">
	        <select class="form-control" name="event_type_select" id="event_type_select" ></select>
              </div>
	    </div>
	    <div class="form-group">
      	      <label class="col-sm-2 control-label">Start: </label>
      	      <div class="col-sm-10">
	        <div class="input-group date">
    		  <input type="text" class="form-control datepicker" name="event_start" id="event_start">
    		  <div class="input-group-addon">
        	    <span class="glyphicon glyphicon-th"></span>
    		  </div>
		</div>
              </div>
	    </div>
	    <div class="form-group">
      	      <label class="col-sm-2 control-label">End: </label>
      	      <div class="col-sm-10">
	        <div class="input-group date">
    		  <input type="text" class="form-control datepicker" name="event_end" id="event_end" placeholder="Leave Blank if Not Applicable">
    		  <div class="input-group-addon">
        	    <span class="glyphicon glyphicon-th"></span>
    		  </div>
		</div>
              </div>
	    </div>
	    <div class="form-group">
      	      <label class="col-sm-2 control-label">Description: </label>
      	      <div class="col-sm-10">
		<input class="form-control" name="event_description" id="event_description" type="text" >
              </div>
	    </div>
	    <div class="form-group">
      	      <label class="col-sm-2 control-label">Web URL: </label>
      	      <div class="col-sm-10">
	        <div class="input-group">
		  <span class="input-group-addon" id="basic-addon2">http://www.</span>
  		  <input type="text" name="event_url" id="event_url" class="form-control" placeholder="example.com" aria-describedby="basic-addon2" />
  		</div>
              </div>
	    </div>
          </form>      
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary" name="add_event_submit" id="add_event_submit">Add Event</button>
      </div>
    </div>
  </div>
</div>

<div class="modal fade" id="event_dialog" name="event_dialog"  tabindex="-1" role="dialog" aria-labelledby="eventDialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="eventDialog">Event Info</h4>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
	  <table class="table table-hover">
	    <thead>
	      <tr>
	        <th>Attribute</th>
	        <th>Value</th>
	      </tr>
	    </thead>
	    <tbody>
    	      <tr>
      	        <td>Project Name: </td>
      	        <td id="event_info_title"></td>
    	      <tr>
    	      <tr>
      	        <td>Start Date: </td>
      	        <td id="event_info_start_display"></td>
		<input id="event_info_start" type="hidden" />
    	      </tr>
    	      <tr>
      	        <td>End Date: </td>
      	        <td id="event_info_end_display"></td>
		<input id="event_info_end" type="hidden" />
    	      </tr>
    	      <tr>
      	        <td>Event Type: </td>
      	        <td id="event_info_property"></td>
		<input id="event_info_cvterm_id" type="hidden" />
    	      </tr>
    	      <tr>
      	        <td>Event Description: </td>
      	        <td id="event_info_description"></td>
    	      </tr>
    	      <tr>
      	        <td>Event Web URL: </td>
      	        <td id="event_info_url"></td>
		<input id="event_info_url_raw" type="hidden" />
    	      </tr>
	    </tbody>
  	  </table>
        </div>
      </div>
      <div class="modal-footer">
        <form name="event_dialog_more_info_form" id="event_dialog_more_info_form">
          <input type="hidden" name="event_project_id" id="event_project_id" />
	  <input type="hidden" name="event_project_title" id="event_project_title" />
        </form>
	<form name="event_dialog_delete_event_form" id="event_dialog_delete_event_form">
          <input type="hidden" name="event_projectprop_id" id="event_projectprop_id" />
        </form>
	<button type="button" class="btn btn-primary" name="event_edit_display" id="event_edit_display">Edit Event</button>
	<button type="button" class="btn btn-danger" name="delete_event_submit" id="delete_event_submit">Delete Event</button>
	<button type="button" class="btn btn-info" name="export_event_display" id="export_event_display">Export Event</button>
	<button type="button" class="btn btn-default" data-dismiss="modal" id="event_dialog_dismiss">Close</button>
      </div>
    </div>
  </div>
</div>


<div class="modal fade" id="edit_event_dialog" name="edit_event_dialog" tabindex="-1" role="dialog" aria-labelledby="editEventDialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="editEventDialog">Edit Event</h4>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
  	  <form class="form-horizontal" role="form" name="edit_event_form" id="edit_event_form">
    	    <div class="form-group">
      	      <label class="col-sm-2 control-label">Project: </label>
      	      <div class="col-sm-10">
		<select class="form-control" name="edit_event_project_select" id="edit_event_project_select"></select>
              </div>
	    </div>
	    <div class="form-group">
      	      <label class="col-sm-2 control-label">Event Type: </label>
      	      <div class="col-sm-10">
		<select class="form-control" name="edit_event_type_select" id="edit_event_type_select" ></select>
              </div>
	    </div>
	    <div class="form-group">
      	      <label class="col-sm-2 control-label">Start: </label>
      	      <div class="col-sm-10">
	        <div class="input-group date">
    		  <input type="text" class="form-control datepicker" name="edit_event_start" id="edit_event_start">
    		  <div class="input-group-addon">
        	    <span class="glyphicon glyphicon-th"></span>
    		  </div>
		</div>
              </div>
	    </div>
	    <div class="form-group">
      	      <label class="col-sm-2 control-label">End: </label>
      	      <div class="col-sm-10">
	        <div class="input-group date">
    		  <input type="text" class="form-control datepicker" name="edit_event_end" id="edit_event_end" placeholder="Leave Blank if Not Applicable">
    		  <div class="input-group-addon">
        	    <span class="glyphicon glyphicon-th"></span>
    		  </div>
		</div>
              </div>
	    </div>
	    <div class="form-group">
      	      <label class="col-sm-2 control-label">Description: </label>
      	      <div class="col-sm-10">
		<input class="form-control" name="edit_event_description" id="edit_event_description" type="text" >
              </div>
	    </div>
	    <div class="form-group">
      	      <label class="col-sm-2 control-label">Web URL: </label>
      	      <div class="col-sm-10">
		<input type="hidden" id="edit_event_projectprop_id" name="edit_event_projectprop_id" />
  		<input type="text" name="edit_event_url" id="edit_event_url" class="form-control" placeholder="example.com">
              </div>
	    </div>
          </form>      
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary" name="edit_event_submit" id="edit_event_submit">Save</button>
      </div>
    </div>
  </div>
</div>



<script>

jQuery(document).ready(function() {

    jQuery(document).on('click', "button[name='personal_calendar_link']", function() {
        jQuery("#calendar_modal").modal("show");
    });

    //If a date is given in the url, using the query parameter currentDate=<timestamp>
    var captured = /currentDate=([^&]+)/.exec(window.location.href);
    var result = captured ? captured[1] : Date.now();
    var valid = (new Date(result)).getTime() > 0;
    if (valid && captured) {
      jQuery('#calendar').fullCalendar('gotoDate', result);
      jQuery("#calendar_modal").modal("show");
    }

    jQuery('#calendar_modal').on('shown.bs.modal', function () {
        jQuery("#calendar").fullCalendar('render');
    });

    jQuery('.datepicker').datepicker({
        format: 'yyyy-mm-dd',
    });

    var fcSources = {
        //month_view: {
        //    url: '/ajax/calendar/populate/personal/month',
        //    error: function() {window.location.replace('/solpeople/login.pl');},
        //    className: 'bg-info',
        //    textColor: '#000',
        //    borderColor: '#FFF',
        //},
        agendaWeek_view: {
            url: '/ajax/calendar/populate/personal/agendaWeek',
            error: function() {window.location.replace('/user/login');},
            className: 'bg-info',
            textColor: '#000',
            borderColor: '#FFF',
        },
        //gcal_cassbase: {
        //    googleCalendarId: '[email protected]',
        //    className: 'bg-success',
        //    textColor: '#000',
        //    borderColor: '#FFF',
        //},
        //gcal_holidays: {
        //    googleCalendarId: 'en.usa#[email protected]',
        //    className: 'bg-danger',
        //    textColor: '#000',
        //    borderColor: '#FFF',
        //}
    };

    var lastView;
    jQuery('#calendar').fullCalendar({
        editable: true,
        eventLimit: true,
        lazyFetching: false,
        header: {
            left:   'title',
            center: 'month,agendaWeek',
            right:  'prevYear,prev,today,next,nextYear'
        },
        views: {
            month: {
                titleFormat: 'MMM YYYY'
            },
            agendaWeek: {
                titleFormat: 'MMM D YYYY'
            }
        },
        eventSources: [fcSources.month_view, fcSources.agendaWeek_view, fcSources.gcal_cassbase, fcSources.gcal_holidays],
        defaultView: 'month',
        googleCalendarApiKey: 'AIzaSyDHH6NGHEYJcYRcxr5mHBWKcqNlKyu-L-Q',
        eventRender: function(event, element, view) {
            if (!event.url) {
                element.find('.fc-title').html(event.title + ": " + event.property ); 
            }
        },
        dayClick: function(date, jsEvent, view) {
            jQuery.ajax({
                url: "/ajax/calendar/dayclick/personal",
                type: "GET",
                dataType: "json",
                success: function(data) {
                    jQuery("input#event_start").val(date.format());
                    var options = jQuery("#event_project_select");
                    options.empty();
                    jQuery.each(data.project_list, function () {
                        options.append(jQuery("<option />").val(this.project_id).text(this.project_name));
                    });
                    var options = jQuery("#event_type_select");
                    options.empty();
                    jQuery.each(data.projectprop_list, function () {
                        options.append(jQuery("<option />").val(this.cvterm_id).text(this.cvterm_name));
                    });
                    return;
                },
                error: function() {
                    alert("Error preparing Day dialog!");
                }
            });
            jQuery('#day_dialog').modal('show');
            // jQuery(this).css('background-color', '#A9F5F2');
        },
        eventClick: function(event) {
            if (event.url) {
                window.open(event.url);
                return false;
            } else {
                jQuery("#event_info_title").html("<a href='" + event.project_url + "'>" + event.title + "</a>");
                jQuery("#event_info_start_display").html(event.start_display);
                jQuery("#event_info_end_display").html(event.end_display);
                jQuery("input#event_info_start").val(event.start_drag);
                jQuery("input#event_info_end").val(event.end_drag);
                jQuery("input#event_info_cvterm_id").val(event.cvterm_id);
                jQuery("#event_info_property").html("<a href='" + event.cvterm_url + "'>" + event.property + "</a>");
                jQuery("#event_info_description").html(event.event_description);
                jQuery("input#event_info_url_raw").val(event.event_url);
                jQuery("#event_info_url").html("<a href='" + event.event_url + "'>" + event.event_url + "</a>");
                jQuery("input#event_project_title").val(event.title);
                jQuery("input#event_project_id").val(event.project_id);
                jQuery("input#event_projectprop_id").val(event.projectprop_id);
                jQuery('#event_dialog').modal('show');
                return false;
            }
        },
        eventMouseover: function(event, jsEvent) {
            if (event.url) {
                jQuery(this).popover({html:true, title:event.title, placement:'right', container:'body', content: 'Location: ' + event.location + '<br/>Description: ' + event.description,}).popover('show');
                return false;
            } else {
                jQuery(this).popover({html:true, title:event.title, placement:'right', container:'body', content: 'Start: ' + event.start_display + '<br/>End: ' + event.end_display + '<br/>Type: ' + event.property + '<br/>Description: ' + event.event_description + '<br/>URL: ' + event.event_url,}).popover('show');
                return false;
              }
        },
        eventMouseout: function(event) {
            jQuery(this).popover("hide");
            return false;
        },
        eventDrop: function(event, delta, revertFunc, jsEvent, ui, view) {
            if (!confirm("Are you sure about this change?")) {
                revertFunc();
                return;
            }
            jQuery.ajax({
                url: "/ajax/calendar/drag_or_resize",
                type: "POST",
                dataType: "json",
                data: ({
                    id: event.id,
                    start_drag: event.start_drag,
                    end_drag: event.end_drag,
                    description: event.event_description,
                    url: event.event_url,
                    projectprop_id: event.projectprop_id,
                    delta: delta.asSeconds(),
                    view: view.name,
                    allday: +event.allDay,
                    drag: 1,
                }),
                success: function(data) {
                    if (data.status ==3) {
                        alert("You do not have the permissions to edit this event.");
                    } else if (data.error ==1) {
                        alert("The was a problem editing this event.");
                    } else if (data.success == 1) {
                        event.start = data.start;
                        event.start_drag = data.start_drag;
                        event.start_display = data.start_display;
                        event.end = data.end;
                        event.end_drag = data.end_drag;
                        event.end_display = data.end_display;
                    }
                    jQuery('#calendar').fullCalendar('updateEvent', event);
                    return;
                },
                error: function() {
                    revertFunc();
                    alert("Error! Did Not Update Event! E.001");
                }
            });
        },
        eventResize: function(event, delta, revertFunc, jsEvent, ui, view) {
            if (!confirm("Are you sure about this change?")) {
                revertFunc();
                return;
            }
            jQuery.ajax({
                url: "/ajax/calendar/drag_or_resize",
                type: "POST",
                dataType: "json",
                data: ({
                    id: event.id,
                    start_drag: event.start_drag,
                    end_drag: event.end_drag,
                    description: event.event_description,
                    url: event.event_url,
                    projectprop_id: event.projectprop_id,
                    delta: delta.asSeconds(),
                    view: view.name,
                    allday: +event.allDay,
                    drag: 0,
                }),
                success: function(data) {
                    if (data.status ==3) {
                        alert("You do not have the permissions to edit this event.");
                    } else if (data.error ==1) {
                        alert("The was a problem editing this event.");
                    } else if (data.success == 1) {
                        event.start = data.start;
                        event.start_drag = data.start_drag;
                        event.start_display = data.start_display;
                        event.end = data.end;
                        event.end_drag = data.end_drag;
                        event.end_display = data.end_display;
                    }
                    jQuery('#calendar').fullCalendar('updateEvent', event);
                    return;
                },
                error: function() {
                    revertFunc();
                    alert("Error! Did Not Update Event! E.001");
                }
            });
        },
    });

    jQuery('button#add_event_submit').click( function(event) {
        event.preventDefault();
        jQuery.ajax({
            url: "/ajax/calendar/add_event",
            type: "POST",
            dataType: "json",
            data: jQuery('form#day_dialog_add_event_form').serialize(),
            success: function(data) {
                if(data.status == 1){
                    alert("Event Successfully Added!");
                    jQuery('#day_dialog').modal('hide');
                    jQuery('#calendar').fullCalendar('refetchEvents');
                }else if(data.status == 2){
                    alert("Error! Event Not Added! E.002");
                }else if(data.status == 3){
                    alert("You do not have the permissions to add an event.");
                }
            },
            error: function() {
                alert("Error! Event Not Added! E.001");
            }
        });
    });

    jQuery('button#delete_event_submit').click( function(event) {
        event.preventDefault();
        jQuery('button#export_event_display').popover('hide');
        if (!confirm("Are you sure you want to delete this event?")) {
            return;
        }
        jQuery.ajax({
            url: "/ajax/calendar/delete_event",
            type: "POST",
            dataType: "json",
            data: jQuery('form#event_dialog_delete_event_form').serialize(),
            success: function(data) {
                jQuery('#event_dialog').modal('hide');
                jQuery('#calendar').fullCalendar( 'refetchEvents' );
                if (data.status==3){
                    alert("You do not have the permissions to delete an event.");
                } else if (data.status==0){
                    alert("The event was not deleted!");
                }
            },
            error: function() {
                alert("Did Not Delete Event! E.001");
            }
        });
    });
    
    jQuery('button#event_edit_display').click( function(event) {
        event.preventDefault();
        jQuery.ajax({
            url: "/ajax/calendar/dayclick/personal",
            type: "GET",
            dataType: "json",
            success: function(data) {
                var options = jQuery("#edit_event_project_select");
                options.empty();
         	      jQuery.each(data.project_list, function () {
                    options.append(jQuery("<option />").val(this.project_id).text(this.project_name));
         	      });
                options.val(jQuery("input#event_project_id").val());
                var options = jQuery("#edit_event_type_select");
                options.empty();
         	      jQuery.each(data.projectprop_list, function () {
                    options.append(jQuery("<option />").val(this.cvterm_id).text(this.cvterm_name));
         	      });
                options.val(jQuery("input#event_info_cvterm_id").val());
                return;
            },
            error: function() {
                alert("Error Preparing Edit Event Dialog!");
            }
        });

      	jQuery("#edit_event_projectprop_id").val(jQuery("#event_projectprop_id").val());
      	jQuery("#edit_event_start").val(jQuery("#event_info_start").val());
      	jQuery("#edit_event_end").val(jQuery("#event_info_end").val());
      	jQuery("#edit_event_description").val(jQuery("#event_info_description").html());
      	jQuery("#edit_event_url").val(jQuery("#event_info_url_raw").val());
      	jQuery("#edit_event_dialog").modal("show");
    });

    jQuery('button#edit_event_submit').click( function(event) {
        event.preventDefault();
        if (!confirm("Are you sure you want to save this edit?")) {
            return;
        }
        jQuery.ajax({
            url: "/ajax/calendar/edit_event",
            type: "POST",
            dataType: "json",
            data: jQuery('form#edit_event_form').serialize(),
            success: function(data) {
                if (data.status == 1) {
                    jQuery('#event_dialog').modal('hide');
                    jQuery('#edit_event_dialog').modal('hide');
                    jQuery('#calendar').fullCalendar( 'refetchEvents' );
                } else if (data.status == 0) {
                    alert("Event Already Existed! Your Edit Was Not Saved!");
                } else if (data.status == 3) {
                    alert("You do not have the permissions to edit thie event.");
                }
            },
            error: function() {
                alert("Did Not Save Edit! E.001");
            }
        });
    });

    jQuery('button#export_event_display').click( function() {
    	jQuery(this).popover({html:true, title:"Export Event", placement:'right', container:'body', content: "Google Calendar: <a href='http://www.google.com/calendar' target='_blank' >Export</a>"}).popover('toggle');
    });

    jQuery('#event_dialog').on('hide.bs.modal', function (e) {
       jQuery('button#export_event_display').popover('hide');
    });

});



</script>


<!-- Login Dialog -->



<div class="modal fade" id="site_login_dialog" name="site_login_dialog" tabindex="-1" role="dialog" aria-labelledby="site_login_dialog_title">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align:center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h3 class="modal-title" id="site_login_dialog_title">Login</h3>
            </div>
            <div class="modal-body">
                <form id="login_form" name="login_form">
                    <div class="container-fluid">

                        <div class="input-group">
                            <input class="form-control" id="username" name="username" placeholder="Username" type="text" tabindex="1" />
                            <span class="input-group-btn">
                                <button id="forgot_username_modal_show" class="btn btn-default" type="button" tabindex="4">&nbsp;<span class="glyphicon glyphicon-question-sign"></span>&nbsp;</button>
                            </span>
                        </div>
                        <br />
                        <div class="input-group">
                            <input class="form-control" id="password" name="password" placeholder="Password" type="password" tabindex="2" />
                            <span class="input-group-btn">
                                <button id="reset_password_modal_show" class="btn btn-default" type="button" tabindex="5">&nbsp;<span class="glyphicon glyphicon-question-sign"></span>&nbsp;</button>
                            </span>
                        </div>
                        <br />

                        <input type="hidden" value="/" id="goto_url" name="goto_url" />

                        <div>
                            <button class="btn btn-default" id="new_user_modal_show" style="float:left" tabindex="6">New User</button>
                            <button class="btn btn-primary" id="submit_password" name="submit_password" type="submit" style="float:right" tabindex="3">Login</button>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="close_site_login_dialog_button" type="button" class="btn btn-default" data-dismiss="modal" style="float:left">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="site_login_forgot_username_dialog" name="site_login_forgot_username_dialog" tabindex="-1" role="dialog" aria-labelledby="site_login_forgot_username_dialog_title">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align:center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h3 class="modal-title" id="site_login_forgot_username_dialog_title">Forgot Username</h3>
            </div>
            <div class="modal-body">
                <div>
                    If you've forgotten your username, enter your email address below. An email will be sent with any account username(s) associated with your email address.
                </div>
                <br />
                <div style="white-space:nowrap">
                    <form id="forgot_username_form" name="forgot_username_form" style="white-space:nowrap">
                        <div style="white-space:nowrap; align:center">
                            <label class="textlabel">Email Address</label>
                            <input class="form-control" style="width:200px; white-space:nowrap; float:center" id="forgot_username_email" name="forgot_username_email" /><br />
                            <button type="submit" class="btn btn-primary" id="submit_forgot_username_email" style="float:center" >Get Username(s)</button>
                        </div>
                    </form>
                </div>
            </div>
            <div class="modal-footer">
                <button id="close_site_login_forgot_username_dialog_button" type="button" class="btn btn-default" data-dismiss="modal" style="float:left">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="site_login_reset_password_dialog" name="site_login_reset_password_dialog" tabindex="-1" role="dialog" aria-labelledby="site_login_reset_password_dialog_title">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align:center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h3 class="modal-title" id="site_login_reset_password_dialog_title">Reset Password</h3>
            </div>
            <div class="modal-body">
                <div>
                    To reset your password, please enter your email address. A link will be sent to that address with a link that will enable you to reset your password.
                </div>
                <br />
                <div style="white-space:nowrap">
                    <form id="password_reset_form" name="password_reset_form" style="white-space:nowrap">
                        <div style="white-space:nowrap; align:center">
                            <label class="textlabel">Email Address</label>
                            <input class="form-control" style="width:200px; white-space:nowrap; float:center" id="password_reset_email" name="password_reset_email" /><br />
                            <button type="submit" class="btn btn-primary" id="submit_password_reset_email" style="float:center" >Get link</button>
                        </div>
                    </form>
                </div>
            </div>
            <div class="modal-footer">
                <button id="close_site_login_reset_password_dialog_button" type="button" class="btn btn-default" data-dismiss="modal" style="float:left">Close</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="site_login_new_user_dialog" name="site_login_new_user_dialog" tabindex="-1" role="dialog" aria-labelledby="site_login_new_user_dialog_title">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header" style="text-align:center">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h3 class="modal-title" id="site_login_new_user_dialog_title">Create New User</h3>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-10 col-sm-offset-1">

                        <form id="new_account_form">
                            <div class="container-fluid">
                                <div class="panel panel-danger">
                                    <div class="panel-heading">Notice</div>
                                    <div class="panel-body">
                                        <ul>
                                            <li><b>Before</b> creating a new account, please check if you <b>already have an account</b> using the <a href="/search/direct_search.pl?search=directory">directory search</a>. </li>
                                            <li>A link will be emailed to you. Please click on it to activate the account.</li>
                                            <li><b>All fields are required.</b></li>
                                        </ul>
                                    </div>
                                </div>

                                <div class="form-horizontal">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">First Name: </label>
                                        <div class="col-sm-9">
                                            <input class="form-control" type="text" name="first_name" value="" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">Last Name: </label>
                                        <div class="col-sm-9">
                                            <input class="form-control" type="text" name="last_name" value="" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">Organization: </label>
                                        <div class="col-sm-9">
                                            <input class="form-control" type="text" name="organization" value="" />
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">Username: </label>
                                        <div class="col-sm-9">
                                            <input class="form-control" type="text" name="username" value="" />
                                            <p class="help-block">Username must be at least 7 characters long.</p>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">Password: </label>
                                        <div class="col-sm-9">
                                            <input class="form-control" type="password" name="password" value="" />
                                            <p class="help-block">Password must be at least 7 characters long and different from your username.</p>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">Confirm Password: </label>
                                        <div class="col-sm-9">
                                            <input class="form-control" type="password" name="confirm_password" value="" />
                                            <p class="help-block">Password must be at least 7 characters long and different from your username.</p>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">Email Address: </label>
                                        <div class="col-sm-9">
                                            <input class="form-control" type="text" name="email_address" value="" />
                                            <p class="help-block">An email will be sent to this address requiring you to confirm its receipt to activate your account.</p>
                                        </div>
                                    </div>

                                    <div align="right">
                                        <button class="btn btn-default btn-lg" type="reset" >Reset</button>
                                        <button class="btn btn-primary btn-lg" type="submit" name="create_account" >Create Account</button>
                                    </div>
                                </div>
                            </div>
                        </form>

                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button id="close_site_login_new_user_dialog_button" type="button" class="btn btn-default" data-dismiss="modal" style="float:left">Close</button>
            </div>
        </div>
    </div>
</div>

<script>
jQuery(document).ready( function() { 

    jQuery("#site_login_dialog").on('shown.bs.modal', function() {
        jQuery("#username").focus();
    });

    jQuery('#forgot_username_modal_show').click(function() {
        jQuery('#site_login_forgot_username_dialog').modal('show');
    });

    jQuery('#forgot_username_form').submit(function(event) {
        event.preventDefault();
        var form_data = jQuery('#forgot_username_form').serialize();
        jQuery.ajax( {
            url: '/ajax/user/forgot_username',
            data: form_data,
            error: function(r) { alert('An error occurred! Sorry!');  },
            success: function(r) {
                if (r.error) { alert(r.error); }
                else { 
                    alert(r.message);
                    jQuery('#site_login_forgot_username_dialog').modal('hide');
                }
            }
        });
    });

    jQuery('#reset_password_modal_show').click(function(){
        event.preventDefault();
        jQuery('#site_login_reset_password_dialog').modal('show');
    });

    jQuery('#password_reset_form').submit( function(event) {
        event.preventDefault();
        var form_data = jQuery('#password_reset_form').serialize();
        jQuery.ajax( {
            url: '/ajax/user/reset_password',
            data: form_data,
            error: function(r) { alert('An error occurred! Sorry!');  },
            success: function(r) {
                if (r.error) { alert(r.error); }
                else { 
                    alert(r.message);
                    jQuery('#site_login_reset_password_dialog').modal('hide');
                }
            }
        });
    });

    jQuery('#new_user_modal_show').click(function(){
        event.preventDefault();
        jQuery('#site_login_new_user_dialog').modal('show');
    });
    jQuery("#site_login_new_user_dialog").on('shown.bs.modal', function() {
        get_select_box('breeding_programs', 'breeding_programs_div', { 'name': 'breeding_programs', 'id': 'breeding_programs', 'default': -1, 'multiple': 1 });
    });

    jQuery('#new_account_form').submit(function(event) {
        event.preventDefault();
        var form_data = jQuery('#new_account_form').serialize();
        //alert(JSON.stringify(form_data));
        jQuery.ajax({
            url: '/ajax/user/new',
            beforeSend: function(){
                jQuery('#working_modal').modal('show');
            },
            data: form_data,
            success: function(r) {
                jQuery('#working_modal').modal('hide');
                console.log(r);
                if (r.error) { alert(r.error); }
                else {
                    let message = r.message || 'New account added. Check your email for the confirmation link - you must confirm your account before you can login.';
                    alert(message);
                    jQuery('#site_login_new_user_dialog').modal('hide');
                    jQuery('#site_login_dialog').modal('hide');
                }
            }
        });
    });

    jQuery("#username, #password").keydown(function(event) {
        var key = event.keyCode ? event.keyCode : event.which;
        if ( key === 13 ) {
            jQuery("#login_form").submit();
            event.preventDefault();
        }
    });
    jQuery('#login_form').submit( function(event) { 
        event.preventDefault();
        var form_data = jQuery('#login_form').serialize();
        if (!jQuery('#username').val() || !jQuery('#password').val()) { 
            alert('Please enter a username and password');
            return;
        }
        jQuery.ajax( { 
            url: '/ajax/user/login',
            data: form_data,
            error: function(r) { alert('An error occurred! Sorry!');  },
            success: function(r) {
                if (r.error) { 
                    alert(r.error);
                    return;
                }
                if (r.goto_url.match('login')) {
                    location.href='/';
                } else if (r.goto_url && r.goto_url !== "" ) { 
                    location.href=r.goto_url;
                } else {
                    location.href='/';
                }
            }
        });
    });

    // Display New User Dialog if `new_user` query param set
    url = new URL(window.location.href);
    if ( url.searchParams.get('new_user') ) {
        jQuery('#site_login_new_user_dialog').modal('show');
    }
});
</script>


<!-- End login dialog -->


<!--
<div id="working" style="text-align : center;">
  <img src="/img/wheel.gif" />
  <div id="working_msg"></div>
</div>
-->

<div class="modal fade" id="working_modal" name="working_modal" tabindex="-1" role="dialog" aria-labelledby="workingModalDialog" data-controls-modal="your_div_id" data-backdrop="static" data-keyboard="false" href="#">
  <div class="modal-dialog modal-sm" role="document">
    <div class="modal-content">
      <div class="modal-header">
	      <center>
          <h4 class="modal-title" id="workingModalDialog">Working</h4>
	      </center>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
	        <center>
	          <img src="/img/wheel.gif" />
    	      <div id="working_msg"></div>
	        </center>
          <div id="working_modal_progress_div" style="display: none">
            <br /><br />
            <div class="progress">
              <div id="working_modal_progress" class="progress-bar progress-bar-success" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" style="width: 0"></div>
            </div>
          </div>
        </div>
      </div>
      <div class="modal-footer"></div>
    </div>
  </div>
</div>

<div class="modal fade" id="progress_modal" name="progress_modal" tabindex="-1" role="dialog" aria-labelledby="progressModalDialog" data-controls-modal="your_div_id" data-backdrop="static" data-keyboard="false" href="#">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
	<center>
          <h4 class="modal-title" id="progressModalDialog">Progress</h4>
	</center>
      </div>
      <div class="modal-body">
        <div class="container-fluid">
	  <center>
		  <div id="progress_msg"></div>
		  <div class="progress">
		    <div id="progress_bar" class="progress-bar progress-bar-striped" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
		  </div>
	  </center>
	  <ul id="current_task" class="form-group list-unstyled"></ul>
        </div>
      </div>
      <div class="modal-footer">
      </div>
    </div>
  </div>
</div>

<!-- END CONTENT WRAPPER -->

</div>
<div class="col-md-1 col-lg-1 col-xl-2">
</div>
</div>
</div>


<!-- BEGIN FOOTER -->
<br/>
<div id="pagefooter" class="navbar navbar-default" style="margin-bottom:0px;">
   
  <br/>
  <div class="container-fluid">
    <div class="row">
      <div class="col-xs-1 col-sm-1 col-md-1 col-lg-2">
      </div>
      <div class="col-xs-10 col-sm-10 col-md-10 col-lg-8">
        <div class="container-fluid">
    	  <div class="row">

      	    <div class="col-sm-12 col-md-12 col-lg-12">

	      <div class="panel panel-success" style="margin-bottom:11px; padding-bottom:5px;">
	        <div class="panel-heading"></div>

		  <table class="center table hidden-xs" style="margin-bottom:-4px">
	    	  <tbody>
            	    <tr>
              	      <td>
                	<a href="https://btiscience.org/" target="_new" class="footer" title="Hosted at the Boyce Thompson Institute"><img width="160"  src="/documents/img/bti_logo_2024.png"  border="0" style="padding-top:5px"/></a>
              	      </td>
		      <td>
		      	 <a href="https://breedbase.org" target="_new" title="powered by Breedbase"><img src="/documents/img/Breedbase_HighRes.png" width="160" style="padding-top:10px"  /></a>
			 </td>
			<td>
		         <a href="https://brapi.org/" target="_new" title="BrAPI compliant" ><img src="/documents/img/brapi-logo.svg" width="100" style="padding-top:35px" /></a>
			 </td>
              	      <td>
              	    <a href="https://www.iita.org/" class="footer" target="_new" ><img width="90" alt="IITA" src="/documents/img/IITA.png" title="IITA" border="0" style="padding-top:30px"/></a>
              	      </td>
              	      <td>
              	    <a href="https://www.naro.go.ug/" class="footer" target="_new" ><img width="80" alt="NARO" src="/documents/img/musabase/carousel/naro-logo.png" title="NARO" border="0" style="padding-top:5px"/></a>
              	      </td>
              	      <td>
              	    <a href="https://www.rtb.cgiar.org/banana/" class="footer" target="_new" ><img width="200" alt="RTB" src="/documents/img/musabase/carousel/rtb_logo.jpg" title="CGIAR" border="0" style="padding-top:5px"/></a>
              	      </td>
            	    </tr>
	    	  </tbody>
          	</table>

	        <ul class="visible-xs-block list-inline center nav-justified">
            	  <li>
              	  <a href="https://btiscience.org/" target="_new"  class="footer"><img width="100" alt="Boyce Thompson Institute" src="/documents/img/bti_logo_2024.gif" title="Boyce Thompson Institute" border="0" style="padding-top:5px"/></a>
            	  </li>
		   <li>
		      	 <a href="https://breedbase.org" target="_new" class="footer" ><img src="/documents/img/Breedbase_HighRes.png" width="160" style="padding-top:10px" title="Breedbase" /></a>
			 </li>
			<li>
		         <a href="https://brapi.org/" target="_new" class="footer" ><img src="/documents/img/brapi-logo.svg" width="100" style="padding-top:35px" title="BrAPI" /></a>
			 </li>
            	  <li>
              	  <a href="http://www.iita.org/" class="footer"><img width="90" alt="IITA" src="/documents/img/IITA.png" title="IITA" border="0" style="padding-top:20px" title="IITA"   /></a>
            	  </li>
            	  <li>
              	  <a href="https://www.naro.go.ug/" class="footer"><img width="80" alt="NARO" src="/documents/img/musabase/carousel/naro-logo.png" title="NARO" border="0" style="padding-top:5px" title="NARO"   /></a>
            	  </li>
            	  <li>
              	  <a href="https://www.rtb.cgiar.org/banana/" class="footer"><img width="200" alt="RTB" src="/documents/img/musabase/carousel/rtb_logo.jpg" title="CGIAR" border="0" style="padding-top:5px" title="CGIAR RTB"    /></a>
            	  </li>
          	</ul>
	      </div>
            </div>
	    <!-- div class="col-sm-3 col-md-3 col-lg-3">
	      <div class="panel panel-info">
		<table class="table table-hover">
		  <tbody>
		    <tr>
		      <td><a href="/about/index.pl"><span class="glyphicon glyphicon-info-sign"></span>&nbsp;&nbsp;&nbsp;&nbsp;About</a></td>
		    </tr>
		    
		    <tr>
		      <td><a href="/contact/form/"><span class="glyphicon glyphicon-envelope"></span>&nbsp;&nbsp;&nbsp;&nbsp;Contact Us</a></td>
		    </tr>
		    <tr>
		      <td><a href="/help/index.pl"><span class="glyphicon glyphicon-blackboard"></span>&nbsp;&nbsp;&nbsp;&nbsp;Help</a></td>
		    </tr>
		    <tr>
		      <td><a href="/help/faq.pl"><span class="glyphicon glyphicon-question-sign"></span>&nbsp;&nbsp;&nbsp;&nbsp;FAQ</a></td>
		    </tr>
		    <tr>
		      <td><a href="/forum/topics.pl"><span class="glyphicon glyphicon-comment"></span>&nbsp;&nbsp;&nbsp;&nbsp;Forum</a></td>
		    </tr>
		  </tbody>
		</table>
	      </div>
	    </div  -->
	  </div>
	</div>
      </div>
      
      <div class="col-xs-1 col-sm-1 col-md-1 col-lg-2">
      </div>
    </div>
  </div>
  
</div>

<script>
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.4";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>

<script src="https://platform.twitter.com/widgets.js" type="text/javascript"></script>

</body>
</html>



Latest requests

# Url Url Source Date
1 https://www.musabase.org/ 2024-06-01 03:16:19
2 https://thebolditalic.com/?gi=ce8e… 2024-06-01 03:16:17
3 https://filedn.eu/lXvDNJGJo3S0aUrN… 2024-06-01 03:16:16
4 https://thebolditalic.com/?gi=689b… 2024-06-01 03:16:16
5 https://thebolditalic.com/?gi=16b5… 2024-06-01 03:16:15
6 https://mirkolopes.sites.umassd.ed… 2024-06-01 03:16:15
7 https://thebolditalic.com/?gi=b96f… 2024-06-01 03:16:13
8 https://thebolditalic.com/?gi=aa4f… 2024-06-01 03:16:12
9 https://thebolditalic.com/?gi=9717… 2024-06-01 03:16:11
10 https://mmsi-pkc.auth0.com/login?s… 2024-06-01 03:16:11
11 https://staging.yadayadamarketing.… 2024-06-01 03:16:10
12 https://mmsi-pkc.auth0.com/login?s… 2024-06-01 03:16:10
13 https://gameslotgacor55430.bloginw… 2024-06-01 03:16:10
14 https://mmsi-pkc.auth0.com/login?s… 2024-06-01 03:16:09
15 https://thebolditalic.com/?gi=433f… 2024-06-01 03:16:09
16 https://filedn.eu/lXvDNJGJo3S0aUrN… 2024-06-01 03:16:09
17 https://www.google.com.pk/url?q=ht… 2024-06-01 03:16:08
18 https://mmsi-pkc.auth0.com/login?s… 2024-06-01 03:16:08
19 https://pro-akun-malaysia98664.ezb… 2024-06-01 03:16:08
20 https://thebolditalic.com/?gi=0eea… 2024-06-01 03:16:08