  <script>
  $(function() {
    $( "#availablefrom" ).datepicker({
      defaultDate: "+1w",
      changeMonth: true,
      numberOfMonths: 1,
      onClose: function( selectedDate ) {
        $( "#availableto" ).datepicker( "option", "minDate", selectedDate );
      }
    });
    $( "#availableto" ).datepicker({
      defaultDate: "+1w",
      changeMonth: true,
      numberOfMonths: 1,
      onClose: function( selectedDate ) {
        $( "#availablefrom" ).datepicker( "option", "maxDate", selectedDate );
      }
    });
  });
  </script>

<script type="text/javascript">
$(document).ready(function(){
  $("#createexamform").validationEngine();
}); 

</script>
<div class="mainholder">

	<div class="content ui-corner-all">
	<div class="createnewdiv">
		<p class="pagetittle">Create exam</p>
	</div>
	<?php 
		if(isset($success))
			echo '<p id="success" class="msg done">'.$success.'</p>';
		if(isset($error))
			echo '<p id="error" class="msg error">'.$error.'</p>';
		?>
		
		<form action="" method="post" id="createexamform">
		<table>
	    <tbody>
	    <tr>
	    <td><div class="label">Imtihon qaysi bo'limga ta'luqli</div></td>
	    <td><div class="input">
	    <select name="category" class="input-text validate[required]">
	    <?=(isset($categories)) ? $categories : ''; ?>
	    </select>
	    	</div>
	    </td>
	    </tr>

	    <tr>
	    <td><div class="label">Imtihon nomi</div></td>
	    <td><div class="input">
	    	<input type="text" name="examname" size="39" value="Bilet raqami - " class="ui-corner-all input-text validate[required]"><?=form_error('examname'); ?>
	    </div></td>
	    </tr>
	    <tr>
	    <td><div class="label">imtihon sarlavhasi</div></td>
	    <td><div class="input">
	    	<textarea cols="50" rows="5" name="examdesc" class="ui-corner-all input-text validate[required]" style="resize:none">Bilet raqami - </textarea>
	    </div>
	    </tr>
	      <tr>
	    <td><div class="label">Savollar soni</div></td>
	    <td><div class="input">
	    	<input type="text" name="noofques" value="10" size="39" class="ui-corner-all input-text validate[required] custom[integer]"><?=form_error('noofques'); ?></div></td>
	    </tr>
	      <tr>
	    <td><div class="label">Muhlat (daqiqada)</div></td>
	    <td><div class="input">
	    	<input type="text" name="duration" value="15"  size="39" class="ui-corner-all input-text validate[required] custom[integer]"><?=form_error('duration'); ?></div></td>
	    </tr>
	    <tr>
	    <td><div class="label">Dan</div></td>
	    <td><div class="input">
	    	<input type="text" name="availablefrom" value="01/05/2016" id="availablefrom" size="39" class="ui-corner-all input-text validate[required]"><?=form_error('availablefrom'); ?></div></td>
	    </tr>
	    <tr>
	    <td><div class="label">Gacha</div></td>
	    <td><div class="input">
	    	<input type="text" name="availableto" value="01/05/2016" id="availableto" size="39" class="ui-corner-all input-text validate[required]"><?=form_error('availableto'); ?></div></td>
	    </tr>

	    <tr>
	    <td><div class="label">Necha foiz to'g'ri yechsa imtihondan o'tsin?</div></td>
	    <td><div class="input">
	    	<input type="text" name="passmark" value="90" size="39" class="ui-corner-all input-text validate[required] custom[integer]"><?=form_error('passmark'); ?>
	    </div>

	    </td>
	    </tr>
	    
	 	<tr>
	 	<td>&nbsp;</td>
	 	<td><input type="submit" value="Save Exam" name="saveexambttn" class="input-button ui-corner-all ui-state-default"></td>
	    </tr>
	    </tbody></table>
	    </form>
	</div>
	<div class="sidebarmenu">
<?php $this->load->view('admin/sidebarmenu');?>
</div>
</div>

