Team:TU-Delft/SynBioData

From 2013.igem.org

(Difference between revisions)
Line 1: Line 1:
<html>
<html>
-
<table width="100%">
+
<input type="text" name="searchPhrase" />
-
<tr>
+
-
<td>
+
-
<div style="width:300px;border:1px solid #c0c0c0;text-align:center; padding:15px;background-color:#f0f0f0;">
+
<a href="javascript: searchExcel();">Search</a>
-
<b>First Semester Result Published</b><br/><br/>
+
-
Roll No: <input type="text" id="id" onKeyUp="checkEnter(event.keyCode)"> &nbsp;
+
-
<input type="button" value="Show" onClick="showModalWindow(document.getElementById('id').value)">
+
-
</div>
+
-
<br/><br/>
+
-
<iframe id="iframeResDis" width="100%" frameborder="0" style="border:none; height:100px;display:none;"></iframe>
+
<div id="results"></div>
-
dd
+
</html>
-
</td>
+
-
</tr>
+
-
</table>
+
 +
<html>
 +
<script type="text/javascript">
-
<script language="JavaScript">
+
function searchExcel()
 +
{
 +
var searchPhrase = document.getElementById('searchPhrase').value;
 +
var Worksheet = 'C:\\example.xls';
 +
var Excel = new ActiveXObject('Excel.Application');
-
  var data;
+
Excel.Visible = false;
-
  function showModalWindow(data)
+
var Excel_file = Excel.Workbooks.Open(Worksheet, null, true, null,
-
  {
+
        "abc", null, true, null, null, false, false, null, null, null);
-
      var url1="https://docs.google.com/spreadsheet/pub?key=0ArsDNt8sj-LBdEdCREdxUTFmVXpPaTVnZm43d0RTdmc&single=true&gid=0&output=html";
+
-
      document.getElementById('iframeResDis').style.display="block";
+
-
      document.getElementById('iframeResDis').src=url1;
+
-
  }
+
-
function checkEnter(code){
+
-
if(code==13){
+
-
var refTab = document.getElementById("id")
+
-
var  ttl;
+
-
// Loop through all rows and columns of the table and popup alert with the value
+
-
// /content of each cell.
+
-
for ( var i = 0; row = refTab.rows[i]; i++ ) {
+
-
  row = refTab.rows[i];
+
-
  for ( var j = 0; col = row.cells[j]; j++ ) {
+
-
      alert(col.firstChild.nodeValue);
+
-
  }
+
-
}
+
-
showModalWindow(document.getElementById('id').value);
+
var range = Excel_file.ActiveSheet.Range('A:A');
 +
var jsRangeArray = new VBArray(range.Value).toArray();
 +
 
 +
var found = false;
 +
for(cells in jsRangeArray)
 +
{
 +
if(jsRangeArray[cells] == searchPhrase)
 +
{
 +
  document.getElementById("results").innerHTML = "Found";
 +
  found = true;
 +
}
 +
}
 +
 
 +
if(found == false)
 +
{
 +
    document.getElementById("results").innerHTML = "Not Found";
 +
}
 +
 
 +
Excel.ActiveWorkbook.Close(true);
 +
Excel.Application.Quit();
 +
Excel = null;
}
}
-
}
+
 
-
  </script>
+
 
 +
 
 +
</script>
</html>
</html>

Revision as of 18:47, 2 September 2013

Search