<script>
		function gen(arg){ 
				//document.getElementsByClassName(document.getElementById(arg).value)[0].disabled = true;
				//document.getElementsByClassName(document.getElementById(arg).value)[1].disabled = true;
				//document.getElementsByClassName(document.getElementById(arg).value)[2].disabled = true;
				//document.getElementsByClassName(document.getElementById(arg).value)[3].disabled = true;
				//document.getElementsByClassName(document.getElementById(arg).value)[4].disabled = true;
				//document.getElementById(arg).disabled = true;

		}
</script>


<?php 
if (!empty($vidf)) {
    $crud = new delStep1_crud();
    $crud->insert($username, $vidf, $vids, $vidt, $vcp11, $vcp12, $vcp13, $vcp14, $vcp15, $vcp21, $vcp22, $vcp23, $vcp24, $vcp25, $vcp31, $vcp32, $vcp33, $vcp34, $vcp35);
    //$location = htmlspecialchars($_SERVER['PHP_SELF']);
    //echo '<META HTTP-EQUIV="Refresh" Content="0; URL='.$location.'">';
    // exit;
}
?>
<!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->


</body>
          	</div>
        	</div>
		<div class="jumbotron">
    		<h1>Step 2 | Essay</h1>
	 <p class="lead"><br></p>
        <p class="lead">Please Select the Position You would Like To Apply For In International Press<br></p>
	</div>        
	<div class="row">
		  			<div class="col-lg-6">
			<form class="form-horizontal" role="form" method="post" action="<?php 
echo htmlspecialchars($_SERVER['PHP_SELF']);
?>
" >
	
	<?php 
$info = new delStep1_crud();
$status = $info->readStatus($username);
if ($status) {
    $variable = "";
    if ($cursorAns->count() == 0) {
        for ($i = 0; $i < count($list); $i++) {
            $j = $i + 1;
            $temp = "Essay" . $j;
            foreach ($cursorAnsTemp as $doc) {
                $variable = $doc[$temp];
            }
            //echo "<script type='text/javascript'>alert('$variable');</script>";
            echo "<div class='form-group'><label class='control-label col-sm-4' for='essay" . $i . "'>" . $list[$i] . "</label><div class='col-sm-12'><textarea class='form-control execexp' name='essay" . $i . "' rows='20' id='essay" . $i . "' placeholder='Write your answer here' required>" . $variable . "</textarea></div></div>";
        }
        echo "<div class='form-group'><div class='col-sm-offset-4 col-sm-8'><button type='submit' class='btn btn-lg btn-primary' id = 'save' name='submit' value='save'>Save</button>";
        echo " <button type='submit' class='btn btn-lg btn-success' id = 'submit' name='submit' value='submit' onclick='return confirm('Are you sure?');'>Submit</button>";