Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
7032cem/editattendence.php
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
296 lines (229 sloc)
13.8 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include "dbconnection.php"; | |
include "session_check.php"; | |
if(isset($_REQUEST['add_btn'])) | |
{ $date=date("Y/m/d"); | |
for($i=0;$i<count($_REQUEST['artistid']);$i++) | |
{ | |
$attend=$_REQUEST['attend'][$i]; | |
$artist=$_REQUEST['artistid'][$i]; | |
$c="insert into attendence_tbl (attdate,attvalue,attartistid,attclassid) values('$date','$attend',$artist,$_REQUEST[cid])"; | |
$ce=mysqli_query($conn,$c); | |
} | |
if($ce) | |
{ | |
echo '<script>alert("New Attendence Added Successfully");</script>'; | |
} | |
} | |
// else if(isset($_REQUEST['update_btn'])) | |
// { | |
// echo '<script>alert('.$_REQUEST['update_id'].');</script>'; | |
// } | |
?> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<title>SB Admin 2 - Dashboard</title> | |
<!-- Custom fonts for this template--> | |
<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css"> | |
<link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet"> | |
<!-- Custom styles for this template--> | |
<link href="css/sb-admin-2.min.css" rel="stylesheet"> | |
</head> | |
<body id="page-top"> | |
<!-- Page Wrapper --> | |
<div id="wrapper"> | |
<?php include "sidenavbar.php"; ?> | |
<!-- Content Wrapper --> | |
<div id="content-wrapper" class="d-flex flex-column"> | |
<!-- Main Content --> | |
<div id="content"> | |
<?php include "header.php"; ?> | |
<!-- Begin Page Content --> | |
<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"><?php if(isset($_REQUEST['id'])){echo 'View';}else{ echo 'Add New';}?> Attendence</h1> | |
</div> | |
<!-- Content Row --> | |
<div class="row flex-lg-nowrap"> | |
<div class="col"> | |
<div class="row"> | |
<div class="col mb-3"> | |
<div class="card"> | |
<div class="card-body"> | |
<form id="editform" action="" enctype="multipart/form-data" method="POST"> | |
<div class="e-profile"> | |
<ul class="nav nav-tabs" > | |
<li class="nav-item"><a href="" class="active nav-link">Details</a></li> | |
<li style="width:90%;"> | |
<!-- @if(session()->has('success')) --> | |
<!-- <div class="alert alert-success" style="float:right;margin-bottom:5px;" id="success-alert"> --> | |
<!-- {{ session()->get('success') }} --> | |
<!-- </div> --> | |
<!-- @endif --> | |
</li> | |
</ul> | |
<div class="tab-content pt-3"> | |
<div class="tab-pane active"> | |
<div class="row"> | |
<?php | |
if(isset($_REQUEST['cid'])) | |
{ | |
$q="Select * from artist_tbl where aclass=$_REQUEST[cid] and astatus=1"; | |
$qe=mysqli_query($conn,$q); | |
if(mysqli_num_rows($qe)>0) | |
{ $i=0; | |
while($qer=mysqli_fetch_array($qe)) | |
{ | |
?> | |
<div class="col-sm-6"> | |
<div class="form-group"> | |
<label>Name</label> | |
<input type="hidden" name="artistid[<?php echo $i;?>]" value="<?php echo $qer['aid']?>"> | |
<input class="form-control" disabled value="<?php echo $qer['aname']; ?>" type="text" required > | |
</div> | |
</div> | |
<div class="col-sm-6"> | |
<div class="form-group" style="padding-top:15px;"> | |
<label>Attendence</label><br> | |
<input type="radio" name="attend[<?php echo $i;?>]" value="Present"> | |
<label>Present </label> | |
<input type="radio" name="attend[<?php echo $i;?>]" value="Absent"> | |
<label >Absent</label> | |
</div> | |
</div> | |
<?php $i++; | |
} | |
} | |
?> | |
<div class="col-sm-6"> | |
<inout type="hidden" name="attclassid" value="<?php echo $_REQUEST['cid'];?>"> | |
<?php | |
if(isset($_REQUEST['cid'])) | |
{ | |
echo '<button class="btn btn-primary" name="add_btn" type="submit"><i class="fa fa-plus"></i> Add Attendence</button>'; | |
} | |
?> | |
<!-- <button class="btn btn-success" type="submit"><i class="fa fa-plus"></i> Add Product</button> --> | |
</div> | |
<?php | |
} | |
else if(isset($_REQUEST['id'])) | |
{ | |
$q="Select * from attendence_tbl where attclassid=$_REQUEST[id] and attdate='$_REQUEST[date]'"; | |
$qe=mysqli_query($conn,$q); | |
if(mysqli_num_rows($qe)>0) | |
{ | |
while($qer=mysqli_fetch_array($qe)) | |
{ | |
?> | |
<div class="col-sm-6"> | |
<div class="form-group"> | |
<label>Name</label> | |
<?php | |
$q2="select aname from artist_tbl where aid=$qer[attartistid]"; | |
$q2e=mysqli_query($conn,$q2); | |
$q2r=mysqli_fetch_array($q2e); | |
?> | |
<input class="form-control" disabled value="<?php echo $q2r['aname']; ?>" type="text" required > | |
</div> | |
</div> | |
<div class="col-sm-6"> | |
<div class="form-group" style="padding-top:15px;"> | |
<label>Attendence</label><br> | |
<p><b><?php echo $qer['attvalue'];?></b></p> | |
</div> | |
</div> | |
<?php | |
} | |
} | |
} | |
?> | |
</div> | |
</div> | |
</div> | |
</form> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> | |
<!-- End Content Row --> | |
</div> | |
<!-- /.container-fluid --> | |
</div> | |
<!-- End of Main Content --> | |
<!-- Footer --> | |
<!-- <footer class="sticky-footer bg-white" style="bottom:0px;"> | |
<div class="container my-auto"> | |
<div class="copyright text-center my-auto"> | |
<span>Copyright © Your Website 2019</span> | |
</div> | |
</div> | |
</footer> --> | |
<!-- End of Footer --> | |
</div> | |
<!-- End of Content Wrapper --> | |
</div> | |
<!-- End of Page Wrapper --> | |
<!-- Scroll to Top Button--> | |
<a class="scroll-to-top rounded" href="#page-top"> | |
<i class="fas fa-angle-up"></i> | |
</a> | |
<!-- Bootstrap core JavaScript--> | |
<script src="vendor/jquery/jquery.min.js"></script> | |
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script> | |
<!-- Core plugin JavaScript--> | |
<script src="vendor/jquery-easing/jquery.easing.min.js"></script> | |
<!-- Custom scripts for all pages--> | |
<script src="js/sb-admin-2.min.js"></script> | |
<!-- Page level plugins --> | |
<script src="vendor/chart.js/Chart.min.js"></script> | |
<!-- Page level custom scripts --> | |
<script src="js/demo/chart-area-demo.js"></script> | |
<script src="js/demo/chart-pie-demo.js"></script> | |
<script> | |
$(document).ready(function(){ | |
$("#success-alert").fadeTo(2000, 500).slideUp(500, function(){ | |
$("#success-alert").slideUp(500); | |
}); | |
// function readURL(input) { | |
// if (input.files && input.files[0]) { | |
// var reader = new FileReader(); | |
// reader.onload = function (e) { | |
// $('#image_block').attr('src', e.target.result); | |
// // $("#image").val(input.files[0]); | |
// } | |
// reader.readAsDataURL(input.files[0]); | |
// } | |
// } | |
// $("#image").change(function(){ | |
// readURL(this); | |
// }); | |
// $("#fileselect").on('click',function(){ | |
// $("#image").click(); | |
// }); | |
}); | |
// $(document).on('submit','#editform',function(e){ | |
// e.preventDefault(); | |
// var img=$("#image").val(); | |
// // alert($("#image").attr('value')); | |
// if(img!="") | |
// { | |
// this.submit(); | |
// } | |
// else | |
// { | |
// alert('Please select Slider Image !'); | |
// } | |
// }); | |
</script> | |
</body> | |
</html> |