$display_if_nolock = $lock_num_rows == 0 ? '' : 'display_off'; //buttons to display only if not locked $display_if_lock = $lock_num_rows > 0 ? '' : 'display_off'; //elements to display only if locked #Display Info about the Archive status. $archive_present = $aa_exists == "Yes" ? 'Note: An ArchiveGDB directory is present.' : 'Note: No Archive is available. '; //pointing out that archive exists $archive_option = $aa_exists == "Yes" ? ' or restore from the ArchiveGDB directory' : ''; //indicate user can restore if they wish # submit radio button script echo "\r\n\r\n\t\t\t\t\t\t\t\t\t\t<script type=\"text/javascript\">\r\n\t\t\t\t\t\t\t\t\t\t/* <![CDATA[ */\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tfunction formSubmit(name) {\r\n\t\t\t\t\t\t\t\t\t\t\t//alert('hi got here');\r\n\t\t\t\t\t\t\t\t\t\t\tvar objForm = document.forms[name]\r\n\t\t\t\t\t\t\t\t\t\t\t//alert(name);\r\n\t\t\t\t\t\t\t\t\t\t\tobjForm.submit();\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t/* ]]> */\r\n\t\t\t\t\t\t\t\t\t\t</script>\r\n"; #Text depends on whether DB created or not, and Archive status $table_text = $GDB_num_rows > 0 ? "\r\n\t<span class=\"heading indent2\">\r\n\t\t{$archive_present}\r\n\t</span>\r\n\t<span class=\"topmargin1 {$display_if_lock} indent2\">\r\n\t\t<br /><br /> \r\n\t\tPipeline is underway, interface <span class=\"Locked\">Locked</span>.\r\n\t\t<br /><br />\r\n\t\tTo abort process, click <b>GDB ID</b> to open its config page, click <b>Data Process Options → Abort</b>\".\r\n\t</span>\r\n" : "\r\n\t<span class=\"warning largerfont\">\r\n\t\tNOTE:\r\n\t</span> \r\n\t<span class=\\instruction\">\r\n\t\tYou haven't created any genome databases yet! To start the process, click <a href=\"/XGDB/conf/new.php\">Configure New</a> {$archive_option}\r\n\t</span>.\r\n"; ########## flag any extraneous GDB in /data/ or /data/ and if so create $warning_text $extra_data_msg = ""; $extra_data = checkExtra("data"); //flag any extraneous GDB in data if (!empty($extra_data)) { foreach ($extra_data as $data_item) { $extra_data_list .= "{$data_item} "; } $extra_data_msg = "<div class=\"warningcontainer\">\r\n\t\t<span class=\"warning normalfont\">\r\n\t\t\tImportant Notice: The GDB directory or directories below, found under <span class=\"plaintext largerfont\">xGDBvm/data/</span>, is not associated with any <span class=\"Current\">Current</span> GDB. Please rename or delete before proceeding: \r\n\t\t\t→ <a id='config_extra_dir_data' title='Click for more info' class='help-button link'>Click for more information </a> \r\n\t\t</span>\r\n\t\t<pre class=\"large topmargin1\">\r\n\t\t\t{$extra_data_list}\r\n\t\t</pre></div>"; $warning_text .= "{$extra_data_msg}"; } ## Dropdown for selecting GDB subsets ## $display_block = "\r\n\r\n\r\n\r\n<table style=\"margin:20px 5px 10px 0; width: 100%;\" class=\"{$showMultiple}\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td width=\"80%\" align = \"left\" class=\"normalfont\">\r\n\t\t\t\t<form method=\"post\" action=\"/XGDB/conf/viewall.php\" name=\"status_view\" class=\"styled\">\r\n\t\t\t\t<span>Filter by Status:</span>\r\n\t\t\t\t\t<input title =\"Current\" style=\"cursor:pointer\" class=\"normalfont\" type=\"radio\" name=\"status\" value=\"Current\" {$current_check} onclick=\"formSubmit('status_view');\" /> <span class=\"Current\">Current</span> \r\n\t\t\t\t\t\r\n\t\t\t\t\t<input title =\"Development\" style=\"cursor:pointer\" class=\"normalfont\" type=\"radio\" name=\"status\" value=\"Development\" {$dev_check} onclick=\"formSubmit('status_view');\" /> <span class=\"Development\">Development</span> \r\n\t\t\t\t\t\r\n\t\t\t\t\t<input title =\"Locked\" style=\"cursor:pointer\" class=\"normalfont\" type=\"radio\" name=\"status\" value=\"Locked\" {$locked_check} onclick=\"formSubmit('status_view');\" /> <span class=\"Locked\">Locked</span> \r\n\t\t\t\t\t\r\n\t\t\t\t\t<input title =\"Offline\" style=\"cursor:pointer\" class=\"normalfont\" type=\"radio\" name=\"status\" value=\"Offline\" {$offline_check} onclick=\"formSubmit('status_view');\" /> <span class=\"Offline\">Offline</span> \r\n\t\t\t\t\t\r\n\t\t\t\t\t<input title =\"online\" style=\"cursor:pointer\" class=\"normalfont\" type=\"radio\" name=\"status\" value=\"all\" {$all_check} onclick=\"formSubmit('status_view');\" /> All \r\n\t\t\t\t\t<input type=\"hidden\" name=\"passed\" value=\"2\" />\r\n\t\t\t\t\t<!-- input type=\"submit\" name=\"submit\" value=\"Go\" /-->\r\n\t\t\t\t</form>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td width=\"10%\" align = \"right\" class=\"{$display_if_nolock}\">\r\n\t\t\t\t\t<form method=\"post\" name=\"new_record\" action=\"/XGDB/conf/new.php\" class=\"styled\">\r\n\t\t\t\t\t\t<input id=\"new\" type=\"submit\" value=\"Configure New\" name=\"New\" class=\"submit\" />\r\n\t\t\t\t\t</form>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td width=\"10%\" class=\"{$display_if_db}\" align = \"right\">\r\n\t\t\t\t\t<form method=\"post\" name=\"archive\" action=\"/XGDB/conf/archive_exec.php\" class=\"styled\">\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"archive_all\" />\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"return\" value=\"viewall\" />\r\n <input type=\"hidden\" name=\"valid\" value=\"{$valid_post}\" />\r\n\t\t\t\t\t\t<span class=\"nowrap\"><input id=\"archive\" class=\"submit\" type=\"submit\" value=\"Archive All\" onclick=\"return confirm('Do you really want to archive? This will not affect current xGDB data, but may overwrite any existing archive data')\"/>\r\n <img id='config_archive_all' title='Search Help' class='help-button' src='/XGDB/images/help-icon.png' alt='?' /> </span>\r\n \t\t\t</form>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td width=\"10%\" class=\"{$display_if_nodb}\" align = \"right\">\r\n\t\t\t\t\t<form method=\"post\" name=\"restore\" action=\"/XGDB/conf/restore_exec.php\" class=\"styled\">\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"restore_all\" />\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"return\" value=\"viewall\" />\r\n <input type=\"hidden\" name=\"valid\" value=\"{$valid_post}\" />\r\n\t\t\t\t\t\t<span class=\"nowrap\"><input id=\"restore\" class=\"submit\" style=\"color:darkgreen\" type=\"submit\" value=\"Restore\" onclick=\"return confirm('Do you really want to restore? (This will load data from attached drive)')\"/>\r\n <img id='config_restore_all' title='Search Help' class='help-button' src='/XGDB/images/help-icon.png' alt='?' /> </span>\r\n\t\t\t\t\t</form>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td width=\"10%\" class=\"{$display_if_db}\" align = \"right\">\r\n\t\t\t\t\t<form method=\"post\" name=\"drop_all\" action=\"/XGDB/conf/deleteall_exec.php\" class=\"styled\">\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"deleteall\" />\r\n\t\t\t\t\t\t<input type=\"hidden\" name=\"redirect\" value=\"archive\" />\r\n <input type=\"hidden\" name=\"valid\" value=\"{$valid_post}\" />\r\n\t\t\t\t\t\t<span class=\"nowrap\"><input id=\"deleteall\" class=\"submit\" type=\"submit\" style=\"color:red\" value=\"Delete All\" onclick=\"return confirm('Do you really want to delete ALL GDB, annotations, and archives? NOT REVERSIBLE')\"/>\r\n <img id='config_delete_all' title='Search Help' class='help-button' src='/XGDB/images/help-icon.png' alt='?' /> </span>\r\n\t\t\t\t\t</form>\r\n\t\t\t\t</td>\r\n\t\t\t</tr>\r\n\t</table>\r\n\t\t\t\t\r\n\r\n"; $display_block .= "<table class=\"featuretable bottommargin1 striped\" style=\"font-size:12px\" cellpadding=\"6\">\r\n<thead align=\"center\">\r\n\t\t\t\t<tr class=\"reverse_1\">\r\n\t\t\t\t\t<th rowspan=\"2\">\r\n\t\t\t\t\t\tGDB <br /> ID <br /><br />\r\n\t\t\t\t\t<span class=\"lightgrayfont\">(Click <img src=\"/XGDB/images/configure.png\" alt=\"\" /> to view config)</span>\r\n\t\t\t\t\t</th>\r\n\t\t\t\t\t<th colspan=\"4\">Links to:<img id='config_viewall_links' title='Search Help' class='help-button' src='/XGDB/images/help-icon.png' alt='?' /></th>\r\n\t\t\t\t\t<!--th rowspan=\"2\">C<br />o<br />n<br />f<br />i<br />g</th -->\r\n\t\t\t\t\t<th rowspan=\"2\">Name<br /></th>\r\n\t\t\t\t\t<th rowspan=\"2\">Status</th>\r\n\t\t\t\t\t<th rowspan=\"2\">Organism </th>\r\n\t\t\t\t\t<th rowspan=\"2\">Type</th>\r\n\t\t\t\t\t<th class=\"smallerfont\" rowspan=\"2\" style=\"text-align:left\"> Status Date: <br /><br /><img style=\"margin-bottom:-4px\" alt=\"\" src=\"/XGDB/images/configure.png\" /> Configured<br />\r\n\t\t\t\t\t\t<img style=\"margin-bottom:-4px\" alt=\"\" src=\"/XGDB/images/create.png\" /> Created<br /> \r\n\t\t\t\t\t\t<img style=\"margin-bottom:-4px\" alt=\"\" src=\"/XGDB/images/update.png\" /> Updated<br />\r\n\t\t\t\t\t</th>\r\n\t\t\t\t\t<th colspan=\"2\" class=\"smallerfont\" >\r\n\t\t\t\t\tArchived & Restored <img id='config_archive_restore_column' title='Search Help' class='help-button' src='/XGDB/images/help-icon.png' alt='?' />\r\n\t\t\t\t\t</th>\r\n\t\t\t\t\t<th rowspan=\"2\"><img src=\"/XGDB/images/genomesegments.png\" alt=\"\" /> gDNA <br /> seg -<br /> ments </th>\r\n\t\t\t\t\t<th colspan=\"3\"># Gene Annotations / <span class=\"lightgrayfont\">Loci</span></th>\r\n\t\t\t\t\t<th colspan=\"3\"># Transcript Alignments / <span class=\"lightgrayfont\">Total</span></th>\r\n\t\t\t\t\t<th colspan=\"2\"># Protein Alignments / <span class=\"lightgrayfont\">Total</span></th>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr class=\"reverse_1\">\r\n\t\t\t\t\t<th>Home</th>\r\n\t\t\t\t\t<th>Sample <br /> region</th>\r\n\t\t\t\t\t<th>Down <br /> loads</th>\r\n\t\t\t\t\t<th>Log Files <br /></th>\r\n\t\t\t\t\t<th class=\"smallerfont\" >GDB</th>\r\n\t\t\t\t\t<th class=\"smallerfont\" >All</th>\r\n\t\t\t\t\t<th><img src=\"/XGDB/images/genemodels.png\" alt=\"\" /> GFF3\r\n\t\t\t\t\t</th>\r\n\t\t\t\t\t<th><img src=\"/XGDB/images/cpgatmodels.png\" alt=\"\" /> CpGAT\r\n\t\t\t\t\t</th>\r\n\t\t\t\t\t<th><img src=\"/XGDB/images/yrgatemodels.png\" alt=\"\" /> yrGATE</th>\r\n\t\t\t\t\t<th><img src=\"/XGDB/images/transcripts_est.png\" alt=\"\" /> EST</th>\r\n\t\t\t\t\t<th><img src=\"/XGDB/images/transcripts_cdna.png\" alt=\"\" /> cDNA</th>\r\n\t\t\t\t\t<th><img src=\"/XGDB/images/transcripts_put.png\" alt=\"\" /> TSA<span class=\"heading\">*</span></th>\r\n\t\t\t\t\t<th>Species</th>\r\n\t\t\t\t\t<th><img src=\"/XGDB/images/proteins.png\" alt=\"\" /> <br />Proteins </th>\r\n\r\n\t\t\t\t</tr>\r\n\t\t</thead>\r\n<tbody>\r\n"; while ($row = mysql_fetch_assoc($result)) { $status_class = ""; //assigned below $Status = $row["Status"];
$dbname_query = "SELECT ID, DBname FROM {$global_DB}.xGDB_Log order by ID"; $rows = mysql_query($dbname_query); $db_id = ""; $db = ""; $name = ""; while ($row = mysql_fetch_array($rows)) { $db_id = $row['ID']; $name = $row['DBname']; $db = 'GDB' . substr('00' . $db_id, -3); #calculated from unique ID $db_list .= "<option value=\"" . $db_id . "\">" . $db . ": " . $name . "</option>\n"; } } ########## flag any extraneous GDB in /data/ or $XGDB_DATAURL and if so create warning text $extra_data_msg = ""; $extra_data = checkExtra("{$dataDir}"); //flag any extraneous GDB in data if (!empty($extra_data)) { foreach ($extra_data as $data_item) { $extra_data_list .= "{$data_item}"; } $extra_data_msg = "<div class=\"warningcontainer {$warning}\"><span class=\"warning normalfont\">Warning! The GDB directory or directories below, found under <a href=\"/data/\">xGDBvm/data/</a>, is not associated with any <span class=\"Current\">Current</span> GDB. Please rename or delete before proceeding:\n\t→ <a id='config_extra_dir_data' title='Click for more info' class='help-button link'>Click for more information </a> </span>\n\t<pre class=\"large topmargin1\">\n\t{$extra_data_list}\n\t</pre></div>"; $warning_msg .= "{$extra_data_msg}"; } ###### (Development mode) Show Restore button in options mode if an archive exists (or the user has configured Restore_From_File), an archive date exists in xGDB_Log and the date is later than any restore date, $restore = ($a_exists == "Yes" || !empty($Restore_From_File)) && $Status == "Development" && $options == "display_on" && $Archive_Date != "" ? "display_on" : "display_off"; ########## Set Data Process Options Mode. $mode is a post variable that is passed when 'Data Process Options' is clicked. Its value is determined by the database value of $Status and whether config data are complete. ########### It determines what button(s) are visible in Data Process Options mode ('Create', 'Update', 'Drop') ########### We are also setting mode_message and model_message_style here. $mode = ""; ## Make sure user only uses "append CpGAT" when "append GSEG" is selected. Prevent user from clicking "update".