Şuanki Dizin: /home/wwwdreamtechnolo/public_html/kpmim.org/admin/ |
Şuanki Dosya : /home/wwwdreamtechnolo/public_html/kpmim.org/admin/student-staff-achievements.php |
<?php require_once('../lib/functions.php'); $db = new login_function(); if(isset($_SESSION['current_login_admin'])) { $current_login_admin = $_SESSION['current_login_admin']; } if(!isset($_SESSION['current_login_admin'])) { header("location:index.php"); } $class_name =""; $SuccessMsg =""; $url =""; $flag =""; $success_msg = 0; $image_error=""; $titles_error=""; $flag1 =""; if(isset($_POST['add'])) { $title = $_POST['title']; $valid_formats = array("jpg","png","gif","bmp","jpeg","pdf","JPEG","JPG","BMP","PNG","GIF","PDF"); if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST") { $name = $_FILES['picture']['name']; $size = $_FILES['picture']['size']; if(strlen($name)) { list($txt, $ext) = explode(".", $name); if(in_array($ext,$valid_formats)) { $files = array(); function generateRandomString($length = 10) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $characters[rand(0, $charactersLength - 1)]; } return $randomString; } $current_random_string = generateRandomString(); $actual_image_name = $current_random_string.".".strtolower($ext); $tmp = $_FILES['picture']['tmp_name']; $img_Dir = "../gallery/"; if(!file_exists($img_Dir)) { mkdir($img_Dir); } if(move_uploaded_file($tmp,$img_Dir.$actual_image_name)) { } else { $image_error = "failed" ; $flag = 1; } } else { $image_error = "Invalid file format"; $flag = 1; } } } if($flag==0) { $db->new_achievements_images($title,$actual_image_name); $flag = 1 ; } } if(isset($_GET['delete_id']) AND (isset($_GET['image']))) { $del_id = $_GET['delete_id']; $name = $_GET['image']; $db->delete_achievements_images($del_id); unlink('../gallery/'.$name); header("Location:student-staff-achievements.php"); $success_msg = 2; } ?> <!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.0"> <title><?php echo $project_title; ?></title> <!-- GLOBAL MAINLY STYLES--> <link href="css/bootstrap.min.css" rel="stylesheet" /> <link href="css/font-awesome.min.css" rel="stylesheet" /> <link href="css/line-awesome.min.css" rel="stylesheet" /> <link href="css/themify-icons.css" rel="stylesheet" /> <link href="css/animate.min.css" rel="stylesheet" /> <link href="css/toastr.min.css" rel="stylesheet" /> <link href="css/bootstrap-select.min.css" rel="stylesheet" /> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css"> <!-- PLUGINS STYLES--> <!-- THEME STYLES--> <link href="css/main.min.css" rel="stylesheet" /> <link href="datatable/datatables.min.css" rel="stylesheet" /> <!-- PAGE LEVEL STYLES--> <style> .col-md-12 { width:100%; margin:auto; margin-top:20px; } table,th,td { text-align:center; } @media only screen and (max-width: 600px) { .col-md-12 { width:100%; } .alert { width:100%; } .side-row { width:49%; display:inline-table; } } </style> <link href="css/animate.css" rel="stylesheet" type="text/css" media="all"> <script src="js/wow.min.js"></script> </head> <body class="fixed-navbar"> <div class="page-wrapper"> <?php include('header.php'); ?> <?php include('side-bar.php'); ?> <div class="content-wrapper"> <div class="row"> <div class="col-md-12"> <?php if($SuccessMsg == 1) { ?> <div class="alert alert-pink"> <span class="alert-link">Successfully ! </span> Slider Image Added... </div> <?php } if($SuccessMsg == 2) { ?> <div class="alert alert-danger"> <span class="alert-link">Failed ! </span> Already Slider Image Exists... </div> <?php } ?> <div class="ibox"> <form class="form-pink" method="post" action="<?php echo $_SERVER['PHP_SELF']?>" name="myForm" onsubmit="return validateForm()" autocomplete="off" enctype="multipart/form-data"> <div class="ibox-head"> <div class="ibox-title"><i class="fas fa-list" style="margin-right:20px;"></i>Add Student / Staff Achievement</div> </div> <div class="ibox-body"> <div class="row"> <div class="col-sm-6 form-group mb-6"> <label class="form-group mb-4 set-row"><b>Enter Title</b></label> <div class="input-group-icon input-group-icon-left set-row"> <input class="form-control form-control-air" placeholder="Enter Title" name="title" type="text" required> </div> </div> <div class="col-sm-6 form-group mb-6"> <label class="form-group mb-4 set-row"><b>Add Attachments</b></label> <div class="input-group-icon input-group-icon-left set-row"> <span class="input-icon input-icon-left"><i class="fas fa-list"></i></span> <input class="form-control form-control-air " placeholder="Enter Attachments" name="picture" type="file" required> </div> </div> <div class="col-sm-12 form-group mb-12"> <br /> <center><button class="btn btn-pink btn-air mr-2" type="submit" name="add">ADD ATTACHMENT</button></center> </div> </div> </div> </form> </div> <?php if($SuccessMsg == 3) { ?> <div class="alert alert-pink"> <span class="alert-link">Successfully ! </span> Image Deleted... </div> <?php } ?> <div class="page-content fade-in-up"> <div class="ibox"> <div class="ibox-body"> <h5 class="font-strong mb-4"><i class="fas fa-list" style="margin-right:20px;"></i> Student / Staff Achievement Report</h5> <div class="flexbox mb-4"> <div class="input-group-icon input-group-icon-left mr-3"> <span class="input-icon input-icon-right font-16"><i class="fas fa-search"></i></span> <input class="form-control form-control-rounded form-control-solid" id="key-search" type="text" placeholder="Search ..."> </div> </div> <div class="table-responsive row"> <table class="table table-bordered table-hover" id="example" style="overflow-x:auto;overflow-y:auto;"> <thead class="thead-default thead-lg"> <tr> <th>Serial No</th> <th>Titles</th> <th>Attachment</th> <th>Edit</th> <th>Delete</th> </tr> </thead> <tbody> <?php $report_details = $db->get_all_achievement_images(); if(!empty($report_details)) { $counter =0; foreach($report_details as $record) { $id = $report_details[$counter][0]; $title = $report_details[$counter][1]; $image = $report_details[$counter][2]; ?> <tr> <td><?php echo $counter+1; ?></td> <td><?php echo $title; ?></td> <?php if($image != "") { list($txt, $ext) = explode(".", $image); if($ext=="pdf") { ?> <td><a href="/gallery/<?php echo $image; ?>" target="_blank"><img src="/images/pdfimg.jpg" height="50px" width="50px" title="view"></a></td> <?php } else { ?> <td> <a href="/gallery/<?php echo $image; ?>" target="_blank"><img src="/gallery/<?php echo $image; ?>" height="50px" width="50px" title="view"></a></td> <?php } ?> <?php } else { ?> <td><img src="/images/no_image_available.png" style="height:90px;width:90px;" /></td> <?php } ?> <td><a href="edit-student-staff-achievements.php?up_id=<?php echo $id;?>" ><i class="fas fa-edit"style="color:green; margin-left:20px;"></i></a></td> <td><a href="student-staff-achievements.php?delete_id=<?php echo $id;?>&image=<?php echo $image;?>" onclick="return confirm('Are you sure?');"><i class="fas fa-trash"style="color:red;margin-left:20px;"></i></a></td> </tr> <?php $counter++; } } ?> </tbody> </table> </div> </div> </div> </div> </div> </div> <?php include('footer.php'); ?> </div> </div> <?php include('search.php'); ?> <!-- END SEARCH PANEL--> <!-- BEGIN THEME CONFIG PANEL--> <!-- END THEME CONFIG PANEL--> <!-- BEGIN PAGA BACKDROPS--> <div class="sidenav-backdrop backdrop"></div> <div class="preloader-backdrop"> <div class="page-preloader">Loading</div> </div> <!-- END PAGA BACKDROPS--> <!-- New question dialog--> <!-- End New question dialog--> <!-- QUICK SIDEBAR--> <?php include('right-side-bar.php'); ?> <script src="js/jquery.min.js"></script> <script src="js/popper.min.js"></script> <script src="js/bootstrap.min.js"></script> <script src="js/metisMenu.min.js"></script> <script src="js/jquery.slimscroll.min.js"></script> <script src="js/idle-timer.min.js"></script> <script src="js/toastr.min.js"></script> <script src="js/jquery.validate.min.js"></script> <script src="js/bootstrap-select.min.js"></script> <!-- PAGE LEVEL PLUGINS--> <!-- CORE SCRIPTS--> <script src="datatable/datatables.min.js"></script> <script src="js/app.min.js"></script> <script> $(function() { $('#example').DataTable({ pageLength: 30, fixedHeader: true, responsive: true, "sDom": 'rtip', columnDefs: [{ targets: 'no-sort', orderable: false }] }); var table = $('#example').DataTable(); $('#key-search').on('keyup', function() { table.search(this.value).draw(); }); }); </script> <!-- PAGE LEVEL SCRIPTS--> </body> </html>
Linux 65-254-81-4.cprapid.com 5.14.0-284.11.1.el9_2.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 9 05:49:00 EDT 2023 x86_64
Apache
65.254.81.4