Domain: amberpublishers.in
Server Adress: 86.38.243.169
privdayz.com
<?php
require('Common/Header.php');
if (isset($_POST['DeleteAll'])) {
$DeleteSelect = $_POST['DeleteSelect'];
$files_arr = array('pass_img');
delete_multiple_with_file('student_data', $DeleteSelect, $files_arr, '../Files/student/');
}
if (isset($_POST['Import'])) {
$File = $_FILES['File']['name'];
$Filetmp = $_FILES['File']['tmp_name'];
if (file_format($File, $excel)) {
$Data = ImportFiles($Filetmp);
$stu_data = remove_empty_cell($Data);
$n = 0;
$d = 0;
for ($i = 1; $i < count($stu_data); $i++) {
$full_name = strtoupper(trim($stu_data[$i][0]));
$enroll_no = trim($stu_data[$i][1]);
$roll_no = trim($stu_data[$i][2]);
// fake data for email because email field is unique
$email = md5(mt_rand(5, 10) . uid_generator());
$insert = "INSERT INTO `student_data`(`full_name`, `enroll_no`, `roll_no`,`email`)
VALUES ('$full_name','$enroll_no','$roll_no','$email' )";
$check_stu_data = mysqli_query($conn, "SELECT * FROM `student_data` where enroll_no = '$enroll_no' or roll_no = '$roll_no'");
$get_row = mysqli_num_rows($check_stu_data);
if ($get_row == 0) {
if (mysqli_query($conn, $insert)) {
$n++;
}
} else {
$d++;
}
}
if ($n != 0) {
SuccessFun("Total $n Data Imported Successfully. Duplicate data $d");
} else {
DangerFun('Failed To Import Data');
}
} else {
DangerFun('Invalid File Format');
}
}
?>
<div class="container-fluid">
<!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-0 text-gray-800">All Students</h1>
</div>
<div class="row">
<div class="col-12">
<div class="card shadow mb-4">
<form method="POST" enctype="multipart/form-data">
<div class="card-header py-3 d-flex justify-content-between align-items-center flex-wrap">
<h6 class="m-0 font-weight-bold text-primary text-md-left text-center " style="width:300px">Students</h6>
<div class="text-center text-md-right mt-2" style=" width:300px">
<button type="submit" name="DeleteAll" disabled class="btn btn-primary DeleteAllBtn"><i class="fas fa-trash"></i></button>
<!-- <button type="button" class="btn btn-primary" onclick="Export('student-data-table', 'student_data')"><i class="fas fa-download"></i></button> -->
<!-- <a href='add_student.php' class="btn btn-primary" data-toggle="tooltip" data-placement="auto" title="Add"><i class="fas fa-plus"></i></a> -->
<button type="button" class="btn btn-primary" data-toggle="tooltip" data-placement="auto" title="Import" onclick="show_modal('#stu_data-Import')"><i class="fas fa-upload"></i></button>
</div>
</div>
<div class="card-body">
<!-- <table class="table table-bordered DataTable" id="student-data-table" width="100%" cellspacing="0">
<thead class="text-light" style="background-color:#008080;">
<tr>
<th class="text-center"></th>
<th class="text-center">Pro.Pic.</th>
<th class="text-center">Full<i class="invisible">_</i>Name</th>
<th class="text-center">Father<i class="invisible">_</i>Name</th>
<th class="text-center">Mother<i class="invisible">_</i>Name</th>
<th class="text-center">Enroll.No.</th>
<th class="text-center">Roll.No.</th>
<th class="text-center">Department</th>
<th class="text-center">Course</th>
<th class="text-center">Semester</th>
<th class="text-center">Email</th>
<th class="text-center">Phone</th>
<th class="text-center">10th<i class="invisible">_</i>Marksheet</th>
<th class="text-center">Fee<i class="invisible">_</i>Receipt</th>
<th class="text-center">Admission<i class="invisible">_</i>Date</th>
<th class="text-center">Session</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tfoot class="text-light" style="background-color:#008080;">
<tr>
<th class="text-center"></th>
<th class="text-center">Pro.Pic.</th>
<th class="text-center">Full<i class="invisible">_</i>Name</th>
<th class="text-center">Father<i class="invisible">_</i>Name</th>
<th class="text-center">Mother<i class="invisible">_</i>Name</th>
<th class="text-center">Enroll.No.</th>
<th class="text-center">Roll.No.</th>
<th class="text-center">Department</th>
<th class="text-center">Course</th>
<th class="text-center">Semester</th>
<th class="text-center">Email</th>
<th class="text-center">Phone</th>
<th class="text-center">10th<i class="invisible">_</i>Marksheet</th>
<th class="text-center">Fee<i class="invisible">_</i>Receipt</th>
<th class="text-center">Admission<i class="invisible">_</i>Date</th>
<th class="text-center">Session</th>
<th class="text-center">Action</th>
</tr>
</tfoot>
<tbody>
<?php
$Select = "SELECT * FROM `student_data` order by col_id DESC limit 10";
$query = mysqli_query($conn, $Select);
$get_r = mysqli_num_rows($query);
if ($get_r != 0) {
$n = 1;
while ($d = mysqli_fetch_assoc($query)) {
if ($d['pass_img'] == '') {
$pro_pic = 'default.svg';
} else {
$pro_pic = $d['pass_img'];
}
$date = change_date_format($d['admi_date']);
echo "
<tr id = 'stu_data_tr$n'>
<th class = 'text-center'>
<div class = 'form-check'>
<input class='form-check-input checkbox-class' type='checkbox' name = 'DeleteSelect[]' value='$d[col_id]' style = 'width:17px;height:17px'>
</div>
</th>
<td class = 'text-center'>
<img src = '../Files/student/$pro_pic' class= 'pro-pic table-pro-pic'>
</td>
<td class = 'text-center'>$d[full_name] </td>
<td class = 'text-center'>$d[father]</td>
<td class = 'text-center'>$d[mother]</td>
<td class = 'text-center'>$d[enroll_no]</td>
<td class = 'text-center'>$d[roll_no]</td>
<td class = 'text-center'>$d[dep]</td>
<td class = 'text-center'>$d[course]</td>
<td class = 'text-center'>$d[sem]</td>
<td class = 'text-center'>$d[email]</td>
<td class = 'text-center'>$d[phone]</td>
<td class = 'text-center'>
<img src='../Files/10th_marksheet/$d[marksheet]' height='100' class='table-pro-pic'>
</td>
<td class = 'text-center'>
<img src='../Files/student/$d[fee_receipt]' height='100' class='table-pro-pic'>
</td>
<td class = 'text-center'>$date</td>
<td class = 'text-center'>$d[session]</td>
<td class = 'text-center'>
<div class='dropdown no-arrow'>
<a class='dropdown-toggle' href='#' role='button' id='dropdownMenuLink'
data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
<i class='fas fa-ellipsis-v fa-sm fa-fw text-gray-400'></i>
</a>
<div class='dropdown-menu dropdown-menu-right shadow animated--fade-in'
aria-labelledby='dropdownMenuLink'>
<div class='dropdown-header'>Action</div>
<a class='dropdown-item' href='students_data_edit.php?col_id=$d[col_id]' ><i class = 'fas fa-edit'></i> Edit</a>
<a class='dropdown-item' href='#' onclick = deleteSingle_with_file([{'table':'student_data','col_id':'$d[col_id]','files':['pass_img','marksheet'],'path':'../Files/student/'}],'stu_data_tr$n')><i class = 'fas fa-trash-alt'></i> Delete</a>
</div>
</div>
</td>
</tr>
";
$n++;
}
}
?>
</tbody>
</table> -->
<table class="table table-bordered " id="student-data-table" width="100%" cellspacing="0">
<thead class="text-light" style="background-color:#008080;">
<tr>
<th class="text-center"></th>
<th class="text-center">Pro.Pic</th>
<th class="text-center text-nowrap">Full<i class="invisible">_</i>Name</th>
<th class="text-center">Enrollement</th>
<th class="text-center">Roll</th>
<th class="text-center">Department</th>
<th class="text-center">Course</th>
<th class="text-center">Semester</th>
<th class="text-center">Father</th>
<th class="text-center">Mother</th>
<th class="text-center">Address</th>
<th class="text-center">Email</th>
<th class="text-center">Phone</th>
<th class="text-center text-nowrap">Admission Date</th>
<th class="text-center">Marksheet</th>
<th class="text-center text-nowrap">Fee Receipt</th>
<th class="text-center text-nowrap">Action</th>
</tr>
</thead>
</table>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- ------------------------- Modal Tem--------------- -->
<div class="modal fade" id="stu_data-Import" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<form method="POST" enctype="multipart/form-data">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Import Student Data</h5>
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="mb-3">
<p> <b class="text-danger">Note : </b> See file format before import. <a href="Files/FileFormat/student_data.xlsx" download>Download File Format</a></p>
</div>
<div class="mt-3 mb-3">
<label for="formFile">Choose Excel File</label>
<input type="file" name="File" id="formFile" class="form-control" accept=".xlsx, .xls" required>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
<button type="submit" name="Import" class="btn btn-primary"> Import</button>
</div>
</form>
</div>
</div>
</div>
<?php require('Common/Footer.php') ?>
</body>
</html>
