Şuanki Dizin: /home/wwwdreamtechnolo/public_html/swamipolytechnic.org/old2/grievance/admin/ |
Şuanki Dosya : /home/wwwdreamtechnolo/public_html/swamipolytechnic.org/old2/grievance/admin/edit-staff.php |
<?php require_once('lib/functions.php'); $db = new db_functions(); $flag = 0; $actual_image_name=""; $success_msg = 0; $image_error=""; $department_error=""; $staff_error=""; $f_email =""; if(isset($_SESSION['current_login_admin'])) { $email = $_SESSION['current_login_admin']; } if(isset($_GET['up_id'])) { $up_id = $_GET['up_id']; $_SESSION['current_update_id'] = $up_id; } else if(isset($_SESSION['current_update_id'])) { $up_id = $_SESSION['current_update_id']; } if(isset($_GET['image'])) { $image = $_GET['image']; $db->update_faculty_profile($up_id); unlink('../profile-picture/'.$image); } if(isset($_POST['add_btn'])) { $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 = "../profile-picture/"; 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) { $image_name = $db->get_faculty_image_name_by_id($up_id); if($image_name!="") { $db->update_faculty_image_info($up_id,$actual_image_name); unlink('../profile-picture/'.$image_name); }else { $db->update_faculty_image_info($up_id,$actual_image_name); } $flag = 1 ; } } if(isset($_POST['add_btn1'])) { $full_name = $_POST['full_name']; $designation = $_POST['designation']; $qualification = $_POST['qualification']; $subject = $_POST['subject']; $experience = $_POST['experience']; $email = $_POST['email']; $department = $_POST['department']; $staff = $_POST['staff']; if($department == 'select_department') { $department_error ="Please select Department"; $flag = 1; } if($staff == 'select') { $staff_error = "Please select Teaching Staff"; $flag = 1; } if($flag == 0) { if($db->update_faculty($up_id,$full_name,$designation,$qualification,$subject,$experience,$email,$department,$staff,$actual_image_name)) { $success_msg = 1 ; } } } $report_details = $db->get_all_faculty_info_by_id($up_id); if(!empty($report_details)) { $counter =0; $id = $report_details[$counter][0]; $full_name = $report_details[$counter][1]; $designation = $report_details[$counter][2]; $qualification = $report_details[$counter][3]; $subject = $report_details[$counter][4]; $experience = $report_details[$counter][5]; $f_email = $report_details[$counter][6]; $department = $report_details[$counter][7]; $staff = $report_details[$counter][8]; $image = $report_details[$counter][9]; } ?> <!-- Author: W3layouts Author URL: http://w3layouts.com License: Creative Commons Attribution 3.0 Unported License URL: http://creativecommons.org/licenses/by/3.0/ --> <!DOCTYPE HTML> <html> <head> <title> <?php echo $application_title; ?> </title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="Novus Admin Panel Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template, SmartPhone Compatible web template, free WebDesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" /> <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script> <!-- Bootstrap Core CSS --> <link href="css/bootstrap.css" rel='stylesheet' type='text/css' /> <!-- Custom CSS --> <link href="css/style.css" rel='stylesheet' type='text/css' /> <!-- font CSS --> <!-- font-awesome icons --> <link href="css/font-awesome.css" rel="stylesheet"> <!-- //font-awesome icons --> <!-- js--> <script src="js/jquery-1.11.1.min.js"></script> <script src="js/modernizr.custom.js"></script> <!--webfonts--> <link href='//fonts.googleapis.com/css?family=Roboto+Condensed:400,300,300italic,400italic,700,700italic' rel='stylesheet' type='text/css'> <!--//webfonts--> <!--animate--> <link href="css/animate.css" rel="stylesheet" type="text/css" media="all"> <script src="js/wow.min.js"></script> <script> new WOW().init(); </script> <!--//end-animate--> <!-- chart --> <script src="js/Chart.js"></script> <!-- //chart --> <!--Calender--> <link rel="stylesheet" href="css/clndr.css" type="text/css" /> <script src="js/underscore-min.js" type="text/javascript"></script> <script src= "js/moment-2.2.1.js" type="text/javascript"></script> <script src="js/clndr.js" type="text/javascript"></script> <script src="js/site.js" type="text/javascript"></script> <!--End Calender--> <!-- Metis Menu --> <script src="js/metisMenu.min.js"></script> <script src="js/custom.js"></script> <link href="css/custom.css" rel="stylesheet"> <!--//Metis Menu --> </head> <body class="cbp-spmenu-push"> <div class="main-content"> <!--left-fixed -navigation--> <?php include("left-section.php"); ?> <!--left-fixed -navigation--> <!-- header-starts --> <?php include("header.php"); ?> <!-- //header-ends --> <!-- main content start--> <div id="page-wrapper"> <div class="main-page signup-page"> <h3 class="title1"> Update Faculty Information</h3> <div class="sign-up-row widget-shadow"> <form role="form" method="post" enctype="multipart/form-data"> <div class="form-group"> <label> Profile Picture</label> <center><br /><br /> <?php if($image != "") { ?> <a href="/profile-picture/<?php echo $image; ?>" target="_blank"><img src="/profile-picture/<?php echo $image; ?>" height="50px" width="50px" title="view"></a><br /><br /> <?php } else { ?> <img src="/images/no_image_available.png" style="height:90px;width:90px;" /><br /><br /> <?php } ?> <label><a href="edit-staff.php?u_id=<?php echo $id; ?>&image=<?php echo $image; ?>">Remove Image</a></label> <br /><br /> <input class="form-control" placeholder="Enter Name" name="picture" type="file" required> <span style="color:red;"><?php echo $image_error; ?></span> </div> <div class="sub_home"> <input type="submit" value="Update Profile picture" name="add_btn" style="width:45%;"> <div class="clearfix"> </div> </div> </form> <form role="form" method="post" enctype="multipart/form-data"> <div class="col-lg-6"> <div class="form-group"> <label> Full Name</label> <input class="form-control" placeholder="Enter Full Name" name="full_name" type="text" value="<?php echo $full_name; ?>" required> </div> </div> <div class="col-lg-6"> <div class="form-group"> <label> Designation</label> <input class="form-control" placeholder="Enter Designation" name="designation" type="text" value="<?php echo $designation; ?>" required> </div> </div> <div class="col-lg-6"> <div class="form-group"> <label> Qualification</label> <input class="form-control" placeholder="Enter Qualification" name="qualification" type="text" value="<?php echo $qualification; ?>" required> </div> </div> <div class="col-lg-6"> <div class="form-group"> <label> Subject</label> <input class="form-control" placeholder="Enter Subject" name="subject" type="text" value="<?php echo $subject; ?>" required> </div> </div> <div class="col-lg-6"> <div class="form-group"> <label> Experience</label> <input class="form-control" placeholder="Enter Experience" name="experience" type="text" value="<?php echo $experience; ?>" required> </div> </div> <div class="col-lg-6"> <div class="form-group"> <label> Email Id</label> <input class="form-control" placeholder="Enter Email Id" name="email" type="email" value="<?php echo $f_email; ?>" required> </div> </div> <div class="col-lg-6"> <div class="form-group"> <label> Department </label> <select class="form-control" placeholder="Enter Department" name="department" required> <?php if($department != "") { ?> <option value="<?php echo $department; ?>"><?php echo $department; ?></option> <?php } ?> <option value="select_department">Select Department</option> <option value="computer"> Computer Engineering</option> <option value="civil"> Civil Engineering</option> <option value="mechanical"> Mechanical Engineering</option> <option value="e&tc"> Electronics & Telecommunication Engineering</option> <option value="science"> Applied Science</option> <option value="administrative"> Administrative</option> </select> <span style="color:red;"><?php echo $department_error; ?></span> </div> </div> <div class="col-lg-6"> <div class="form-group"> <label> Teaching Staff</label> <select class="form-control" placeholder="Enter Teaching Staff" name="staff" required> <?php if($staff != "") { ?> <option value="<?php echo $staff; ?>"><?php echo $staff; ?></option> <?php } ?> <option value="select">Select Teaching Staff</option> <option value="teaching">Teaching Staff</option> <option value="non-teaching"> Non - Teaching Staff</option> </select> <span style="color:red;"><?php echo $staff_error; ?></span> </div> </div> <div class="sub_home"> <input type="submit" value="update Record" name="add_btn1" style="width:35%;"> <div class="clearfix"> </div> </div> </form> </div> </div> </div> <!--footer--> <?php include("footer.php"); ?> <!--//footer--> </div> <!-- Classie --> <script src="js/classie.js"></script> <script> var menuLeft = document.getElementById( 'cbp-spmenu-s1' ), showLeftPush = document.getElementById( 'showLeftPush' ), body = document.body; showLeftPush.onclick = function() { classie.toggle( this, 'active' ); classie.toggle( body, 'cbp-spmenu-push-toright' ); classie.toggle( menuLeft, 'cbp-spmenu-open' ); disableOther( 'showLeftPush' ); }; function disableOther( button ) { if( button !== 'showLeftPush' ) { classie.toggle( showLeftPush, 'disabled' ); } } </script> <!--scrolling js--> <script src="js/jquery.nicescroll.js"></script> <script src="js/scripts.js"></script> <!--//scrolling js--> <!-- Bootstrap Core JavaScript --> <script src="js/bootstrap.js"> </script> </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