|
Server : Apache/2.4.41 (Ubuntu) System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64 User : www-data ( 33) PHP Version : 8.2.12 Disable Function : NONE Directory : /var/www/parasoffline.edukrypt.in/application/modules/admin/views/quiz/ |
Upload File : |
<?php
if (isset($message)) {
echo '<div class="alert alert-success" role="alert">' . $message . '</div>';
}
if ($this->session->flashdata('message')) {
echo $this->session->flashdata('message');
}
?>
<div class="row">
<?php echo $this->session->flashdata('alert'); ?>
<div class="col-md-12">
<div class="box box-primary">
<div class="box-body">
<form action="<?php echo base_url('admin/quiz/upload_file/'); ?>" method="post" enctype="multipart/form-data">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="subject">Subject</label>
<select required class="form-control" name="subject" id="subject">
<option value="">--select-subject--</option>
<?php
if (!empty($mcqSubjects)) {
foreach ($mcqSubjects as $mcqSubject) { ?>
<option value="<?php echo $mcqSubject->id; ?>"><?php echo $mcqSubject->subject; ?>
</option>
<?php }
} ?>
</select>
<?php form_error('subject'); ?>
</div>
<div class="form-group">
<label for="question">Quiz word file upload:</label>
<input type="file" name="questions_upload" required class="form-control" id="question" name="questions" rows="3"><?php echo set_value('questions'); ?></textarea>
<?php form_error('questions'); ?>
<input type="hidden" name="quiz_id" value="<?php echo $this->uri->segment(4); ?>">
<a href="<?php echo base_url();?>btoffline.docx">Download Sample
Format</a>
</div>
</div>
</div>
<button id="submit" type="submit" class="btn btn-primary">Submit</button>
<button type="reset" class="btn btn-danger">Reset</button>
</form>
</div>
</div>
</div>
<div class="col-md-12">
<div class="box box-primary">
<div class="box-body">
<div class="table-responsive">
<table class="table table-bordered table-striped table-hover table-sm" id="mcq-questions" mcq_id="<?php echo $mcq_id; ?>">
<thead style="font-size: 12px;">
<!-- <th>
<input type="checkbox" id="all_check_in" value="">
</th> -->
<th>#</th>
<th>Questions</th>
<th>Subject</th>
<!-- <th>correct Answer</th> -->
<th style="width: 110px;">Action</th>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/plugins/datatables/dataTables.bootstrap4.min.css'); ?>">
<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/plugins/datatables/responsive.bootstrap4.min.css'); ?>">
<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/plugins/datatables/buttons.bootstrap4.min.css'); ?>">
<script type="text/javascript" src="<?php echo base_url('assets/plugins/datatables/jquery.dataTables.min.js'); ?>">
</script>
<script type="text/javascript" src="<?php echo base_url('assets/plugins/datatables/dataTables.bootstrap4.min.js'); ?>"></script>
<script type="text/javascript">
$(document).ready(function() {
/***********************************************************************************************************/
// var a = $('#mcq-questions').attr('mcq_id');
// alert(a);
$('#mcq-questions').DataTable({
"processing": true,
"serverSide": true,
"pageLength": 50,
"dom": 'Bfrtip',
"buttons": [
'copy', 'excel', 'print'
],
"ajax": {
"url": JS_BASE_URL + 'admin/quiz/mcquestionsposts',
"dataType": "json",
"type": "POST",
"data": {
'mcq_id': $('#mcq-questions').attr('mcq_id')
},
// "success": function(result) {
// console.log(result);
// },
"error": function(jqXHR, e) {
console.log(jqXHR.responseText);
}
},
"columns": [{
"data": "id"
},
{
"data": "questions"
},
{
"data": "mcq_subject"
},
{
"data": "Actions"
},
],
"columnDefs": [{
"targets": '',
"orderable": false,
}]
});
/**********************************************************************************/
$(document).on('click', '#all_check_in', function() {
var all_check_in = $(this),
_check_in = $('._check_in');
if (typeof _check_in !== 'undefined' || _check_in !== null) {
if (all_check_in.prop('checked') == true) {
all_check_in.prop('checked', true);
all_check_in.parent().parent().css({
'background-color': '#000',
'color': '#fff'
});
_check_in.prop('checked', true);
_check_in.parent().parent().css({
'background-color': '#ccc'
});
} else {
all_check_in.prop('checked', false);
all_check_in.parent().parent().removeAttr('style');
_check_in.prop('checked', false);
_check_in.parent().parent().removeAttr('style');
}
}
});
$(document).on('click', '._check_in', function() {
var _check_in = $('._check_in');
_check_in.each(function() {
if ($(this).prop('checked') == true) {
$(this).parent().parent().css({
'background-color': '#ccc'
});
} else {
$(this).parent().parent().removeAttr('style');
}
});
});
/**********************************************************************************/
});
</script>