Gifari Industries - BD Cyber Security Team
Home
/
home
/
decohaslibrary
/
public_html
/
✏️
Editing: clinical.php
<?php session_start(); $user = $_SESSION['username']; $log = $_SESSION['HOD-Clinical']; if ($log != "log"){ header ("Location: login.php"); } $msg = ""; ?> <html> <head> <title> Library System </title> <link rel = "stylesheet" type ="text/css" href = "css/style.css"/> </head> <body > <div id ="container" style = "width:1000px;> <?php include 'header.php'; ?> <div id ="main_part "> <div class = "navbar"> <ul> <li><a href = "clinical.php">Home</a></li> <li><a href = "add_user_md.php"><img src = "images/add.png " width="15" style="margin-right:3px; border-radius:50%;">Add </img></a></li> <li><a href = "view_students_clinical.php"><img src = "images/add.png " width="15" style="margin-right:3px; border-radius:50%;">Students </img></a></li> <li></li> <li><a href = "changepassl.php"><img src = "images/my_account.png" style="margin-right:3px;">Update password</img></a></li> <li><a href = "index.php"><img src = "images/logout.png" style="margin-right:3px; ">Logout</img></a></li> </ul> </div> <?php include 'sql.php'; $msg = ''; if(isset($_POST['submit'])) { $image = $_FILES['image']['name']; $tmp_image = $_FILES['image']['tmp_name']; $message = $_POST['message']; $other = $_POST['other']; $imagename = $_FILES['imagename']['name']; $tmp_file = $_FILES['imagename']['tmp_name']; if(empty($image) || empty($message) || empty($other) || empty($imagename)){ $msg = 'all fields are required'; }else{ $mysqli_query = "INSERT INTO clinical_books VALUES('','$image','$message','$other', '$imagename')"; if(mysqli_query($con, $mysqli_query)) { if(move_uploaded_file($tmp_image,"./books/$image")) { }if(move_uploaded_file($tmp_file, "./books/$imagename")){ $msg = "Uploaded successfully"; } else { $msg = "Uploading failed"; } } } } ?> <div id = "upload_menu"> <div style="text-align:center;"> <h1 style="color:green;">Upload Books</h1> </div> <div style = "color:red; margin-bottom:20px; text-align:center;"> <?php echo $msg;?> </div> <form method="POST" action="" enctype="multipart/form-data" > <b><label style="margin-left:30px;">Upload book:</label></b></br> <input type="file" name="image" style="margin-left:30px;"/> </br> </br> <b><label style="margin-left:30px;">Title Of The Book</label></b></br> <textarea type="text" name="message" style="width:80%; height:30;margin-left:30px;" > </textarea></br></br> <b><label style="margin-left:30px;">Other Information</label></b></br> <textarea type="text" name="other" style="width:80%; height:30;margin-left:30px;" > </textarea></br></br> <b><label style="margin-left:30px;">Upload Cover Page:</label></b></br> <input type="file" name="imagename" style="margin-left:30px;"/> </br> </br> <input type="submit" name="submit" value="Send" style="width:60px; background:#C0C0C0; padding:4px; border-radius:4px; margin-left:30px;"/> </form> </div> <div style="text-align:center;"> <p style="color:blue;">DEPARTMENT OF CLINICAL MEDICINE</p> </div> <?php include 'sql.php'; include 'leaders/clinical.php'; ?> </div> </div> </div> </body>
💾 Save
❌ Cancel