Team:TU-Delft/SynBioData

From 2013.igem.org

(Difference between revisions)
Line 2: Line 2:
    
    
<script type="text/javascript">
<script type="text/javascript">
 +
<table width="100%">
 +
<tr>
 +
<td>
 +
<div style="width:300px;border:1px solid #c0c0c0;text-align:center; padding:15px;background-color:#f0f0f0;">
 +
<b>First Semester Result Published</b><br/><br/>
 +
Roll No: <input type="text" id="rollNum"  onKeyUp="checkEnter(event.keyCode)"> &nbsp;
 +
<input type="button" value="Show" onClick="showModalWindow(document.getElementById('rollNum').value)">
 +
</div>
 +
</td>
 +
</tr>
 +
</table>
-
var isFirstTime = true;
 
-
var options = {'showRowNumber': true};
 
-
var data;
 
-
var queryInput;
 
-
var query = new google.visualization.Query(
+
<script language="JavaScript">
-
    'https://docs.google.com/spreadsheet/ccc?key=0ArsDNt8sj-LBdEdCREdxUTFmVXpPaTVnZm43d0RTdmc#gid=0');
+
  var data;
-
 
+
  function showModalWindow(data)
-
 
+
  {
-
query.setQuery('SELECT A');
+
      var url="https://docs.google.com/spreadsheet/tq?tqx=out:html&tq=select%20*%20where%20A%3D"+ data + "&key=0AgHK_Z79lrOmdEJ0ekd2aDhPbHBRT3BIX3FwRGRsYUE";
-
 
+
      window.showModalDialog(url,"","dialogWidth:500px; dialogHeight:80px;center:on;resizable: no ");
-
function sendAndDraw() {
+
  }
-
  // Send the query with a callback function.
+
function checkEnter(code){
-
  query.send(handleQueryResponse);
+
if(code==13){
 +
showModalWindow(document.getElementById('rollNum').value);
}
}
-
 
-
function handleQueryResponse(response) {
 
-
  if (response.isError()) {
 
-
    alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());
 
-
    return;
 
-
  }
 
-
  data = response.getDataTable();
 
-
  var table = new google.visualization.Table(document.getElementById('querytable'));
 
-
  table.draw(data, {'showRowNumber': false});
 
-
  if (isFirstTime) {
 
-
  init();
 
-
  }
 
}
}
-
 
-
function setQuery(queryString) {
 
-
  // Query language examples configured with the UI
 
-
  query.setQuery(queryString);
 
-
  sendAndDraw();
 
-
  queryInput.value = queryString;
 
-
}
 
-
 
-
 
-
 
-
google.setOnLoadCallback(sendAndDraw);
 
-
 
-
function init() {
 
-
  isFirstTime = false;
 
-
  (new google.visualization.Table(document.getElementById('table'))).draw(data, options);
 
-
  queryInput = document.getElementById('display-query');
 
-
}
 
-
 
-
function setQueryFromUser() {
 
-
  setQuery(queryInput.value);
 
-
}
 
-
 
</script>
</script>
</html>
</html>

Revision as of 13:02, 2 September 2013