Viewing file: test_question.php (12.14 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php session_start(); include('includes/header.php'); ?> <?php
// Storing session data $_SESSION["role"]; if(!isset($_SESSION["role"])) {
header("location:admin_login.php"); ?> <script type="text/javascript"> window.location.href = "admin_login.php"; </script> <?php } else { ?> <div class="page-container"> <div class="left-content"> <div class="mother-grid-inner"> <!--header start here--> <div class="header-main" style="min-height: 90px;"> <div class="header-left"> <div class="logo-name"> <a href="admin_index.php"> <h3>SICS ADMIN</h3> </br> <h4>Add Assignment</h4> </a> </div>
<div class="clearfix"> </div>
</div>
<!--notification menu end --> <div class="profile_details"> <ul> <li class="dropdown profile_details_drop"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> <div class="profile_img"> <span class="prfil-img"><img src="images/p1.png" alt=""> </span> <div class="user-name"> <p>Srishti Innovative</p> <span><?php echo $_SESSION["name"];?></span> </div> <i class="fa fa-angle-down lnr"></i> <i class="fa fa-angle-up lnr"></i> <div class="clearfix"></div> </div> </a> <ul class="dropdown-menu drp-mnu"> <!-- <li> <a href="#"><i class="fa fa-cog"></i> Settings</a> </li> <li> <a href="#"><i class="fa fa-user"></i> Profile</a> </li> --> <li> <a href="logout.php"><i class="fa fa-sign-out"></i> Logout</a> </li> </ul> </li> </ul> </div> </div> <div class="span5">
<div class="row" style="margin-top:70px;margin-left:50px;"> <form class="forms-sample" id="add_assign" action="test_action.php" enctype="multipart/form-data" method="post"> <div class="txt-field"> <?php $query1 = "select * from technologies order by id desc"; $result1 = $con->query($query1); ?> <label>Technology</label><br> <select id="technology" name="technology" required style="width:25%;"> <option value="">------------Select------------</option> <?php while ($row1 = $result1->fetch_assoc()) { ?> <option value="<?php echo $row1["id"]; ?>"><?php echo $row1["name"]; ?></option> <?php } ?> </select> </div> <br> <div class="txt-field"> <label>Package</label><br> <select id="semester" placeholder="Package" name="semester" required=""> <option value="">------------Select--------------</option>
</select> </div> <br>
<div class="txt-field"> <label>Subject</label><br> <select id="subject" placeholder="Subject" name="subject" id="subject" required=""> <option value="">---------Select Topic-----------</option> </select> </div> <br> <div class="txt-field"> <label >Exam Title</label><br> <select id="title" placeholder="Exam Title" name="title" required="" > <option value="">---------Select Title------------</option> </select> </div> <br> <div class="txt-field"> <input type="radio" name="qtype" value="Individual Questions" id="qtype1"> <label >Individual Questions</label> <input type="radio" name="qtype" value="Excel Upload" id="qtype2"> <label >Excel Upload</label> </div> <br> <div id="question_type" style="display: none;"> <div class="txt-field"> <label >Question</label><br> <textarea id="question" placeholder="Question" name="question" style="width: 280px;"></textarea> </div> <br> <div class="txt-field"> <label >Option A</label><br> <textarea id="optiona" placeholder="Option A" name="optiona" style="width: 280px;"></textarea> </div> <br> <div class="txt-field"> <label >Option B</label><br> <textarea id="optionb" placeholder="Option B" name="optionb" style="width: 280px;"></textarea> </div> <br> <div class="txt-field"> <label >Option C</label><br> <textarea id="optionc" placeholder="Option C" name="optionc" style="width: 280px;"></textarea> </div> <br> <div class="txt-field"> <label >Option D</label><br> <textarea id="optiond" placeholder="Option D" name="optiond" style="width: 280px;"></textarea> </div> <br>
<div class="txt-field"> <label >Correct Option</label><br> <select id="correct" placeholder="Option D" name="correct" > <option value="">-----Select Correct option-----</option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> </select> </div> <br> </div> <div id="question_type1" style="display: none;"> <br> <a href="uploads/Samplefile.csv" download style="float: left;margin: -4% 30%;color: red;">Click Here To Download Sample CSV File </a> <div class="txt-field"> <input type="file" name="excel_up" id="excel_up"> </div> </div><br> <button type="submit" class="btn btn-gradient-primary mr-2" id="submit">Submit</button>
</form> <br><br><br><br><br> <br><br><br><br><br> <br><br><br><br><br> <br><br><br><br><br> </div>
</div> <div class="clearfix"> </div> </div> <div class="clearfix"> </div> </div>
<!--heder end here--> <!-- script-for sticky-nav -->
<!-- /script-for sticky-nav --> <!--inner block start here-->
</div> <div class="clearfix"> </div>
<!--slider menu--> <?php include('includes/sidebar.php'); ?>
<div class="clearfix"> </div> </div> <!--slide bar menu end here-->
<?php include('includes/footer.php'); ?> <script type="text/javascript"> $(document).ready(function(){ $('#technology').on('change', function(){ // alert('hai'); var technology = $(this).val(); if(technology){ $.ajax({ type:'POST', url:'ajaxPackage.php', data:'technology='+technology, success:function(html){ $('#semester').html(html); } }); }else{ $('#semester').html('<option value="">Select </option>'); } });
$('#semester').on('change', function(){ // alert('hai'); var semester = $(this).val(); // alert(countryID); if(semester){ $.ajax({ type:'POST', url:'ajaxSyllabus.php', data:'semester='+semester, success:function(html){ $('#subject').html(html); } }); }else{ $('#subject').html('<option value="">Select Topic</option>'); } }); $('#subject').on('change', function(){ // alert('hai'); var subject = $(this).val(); if(subject){ $.ajax({ type:'POST', url:'ajaxExam.php', data:'subject='+subject, success:function(html){ $('#title').html(html); } }); }else{ $('#title').html('<option value="">Select exam</option>'); } });
$('#qtype1').click(function(){
$('#question_type').show(); }); $('#qtype2').click(function(){
$('#question_type1').show(); });
// $('#submit').click(function(){ // var qtype1=$('#qtype1').val(); // var qtype2=$('#qtype2').val(); // if(qtype1=="Individual Questions"){ // alert(qtype1); // var technology=$('#technology').val(); // var semester=$('#semester').val(); // var subject=$('#subject').val(); // var question=$('#question').val(); // var optiona=$('#optiona').val(); // var optionb=$('#optionb').val(); // var optionc=$('#optionc').val(); // var optiond=$('#optiond').val(); // var correct=$('#correct').val(); // var title=$('#title').val(); // $.ajax({ // type: "POST", // url: "test_action.php", // data: "technology=" + technology+ "&semester=" + semester+ "&subject=" + subject+ "&question=" + question+ "&optiona=" + optiona+ "&optionb=" + optionb+ "&optionc=" + optionc+ "&optiond=" + optiond+ "&correct=" + correct+"&title="+title, // success: function(txt) { // alert(txt); // if(txt=='success'){ // $('#success').show(); // // $('#semester').val(""); // // $('#subject').val(""); // $('#question').val(""); // $('#optiona').val(""); // $('#optionb').val(""); // $('#optionc').val(""); // $('#optiond').val(""); // $('#correct').val("");
// } // else{ // $('#failed').show(); // } // } // }); // } // else{ // alert(qtype2); // var technology=$('#technology').val(); // var semester=$('#semester').val(); // var subject=$('#subject').val(); // var title=$('#title').val(); // $.ajax({ // url:"export.php", // method:"post", // data:new FormData(this), // contentType:false, // processData:false, // success:function(data){ // alert(data); // }
// });
// } // });
}); </script> <?php } ?>
|