<html>
    <head><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400"> 
<style>
  .speech {border: 1px solid #DDD; width: 70%; padding: 0; margin: 0}
  .speech input {border: 0; width: 65%; display: inline-block; height: 30px;}
  .speech img {float: right; width: 40px }
  .dugme {width: 30%; height: 5%;}
  body {
    font-family: 'Open Sans';font-size: 22px;
    } 
    
    .dugme{
  background-color: #006599; 
  border: none;
  color: white;
  padding: 0px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
}
}

</style>
  
</head>
<body style='font-family="sans-serif"'>

<form id="labnol" method='get' action='db_cos_sim.php?novo=' >
    
    <!--input type="text" name="q" id="transcript" placeholder="Speak" />
    <img onclick="startDictation()" src="//i.imgur.com/cHidSVu.gif" /-->
  
<div id="pitanja"><div class="speech">
	<input type='text' name='novo' id="transcript" class="tekst" placeholder="Unesite pitanje putem tastature ili mikrofona" required>
	<img onclick="startDictation()" src="//i.imgur.com/cHidSVu.gif" /></div>
	<input type='submit' name='trazi' class="dugme" value='Traži'/>

</div>
<script>
  function startDictation() {

    if (window.hasOwnProperty('webkitSpeechRecognition')) {

      var recognition = new webkitSpeechRecognition();

      recognition.continuous = false;
      recognition.interimResults = false;

      recognition.lang = "sr-RS";
      recognition.start();

      recognition.onresult = function(e) {
        document.getElementById('transcript').value
                                 = e.results[0][0].transcript;
        recognition.stop();
       // document.getElementById('labnol').submit();
      };

      recognition.onerror = function(e) {
        recognition.stop();
      }

    }
  }
</script>
<div style="float:right;">
<b>Najčešća pitanja</b><br/><hr/>
<?php
error_reporting(E_WARNING);
function db_aldina_ngram_connect()
{
$result= mysqli_connect("localhost","tagstudi_aldina","aldina1234567","tagstudi_dokumenta");
if(!$result)
	return false;
return $result;
}
$con=db_aldina_ngram_connect();
mysqli_query($con,"SET NAMES 'utf8'");
$result = mysqli_query($con,"SELECT Pitanje FROM najcesca_pitanja");

 while($row = mysqli_fetch_array($result)) 
  {
   echo '<a href="db_cos_sim.php?pitanje='.$row['Pitanje'].'">'.$row['Pitanje'].'</a><br/>';    
  }
?>
<hr/><p style="font-size:9px; color:grey;">*Selektovati pitanje i prevući u polje za pitanje</p>
</div>
</form>
</body>
</html>