Skip to content

Commit

Permalink
suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
justafolk committed Oct 20, 2022
1 parent 9f50500 commit c160d87
Show file tree
Hide file tree
Showing 22 changed files with 1,798 additions and 115 deletions.
87 changes: 2 additions & 85 deletions feedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,8 @@
<title>Feedback Form</title>
<link href="assets/img/logo.png" rel="icon">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa" crossorigin="anonymous"></script>

<style>
@font-face {
font-family: "San Francisco";
font-weight: 400;
src: url("./assets/css/SF-Pro-Display-Semibold.otf")
}

body {

font-family: "San Francisco" !important;
font-size: .875rem;
}

.main-question {
border: 0px;
padding: 0px;
Expand Down Expand Up @@ -236,77 +222,8 @@
textarea.style.height = Math.min(textarea.scrollHeight, heightLimit) + "px";
};
</script>
<script>
var index = 0;
$(document).ready(function() {
$("#shortans").click(function() {
index++;
$.get("./genform.php", {
'id': index,
'type': "shortans"
}, function(data) {
$("#allquestions").append(data);
})

});
$("#longans").click(function() {
index++;
$.get("./genform.php", {
'id': index,
'type': "longans"
}, function(data) {
$("#allquestions").append(data);
})

});
$("#mcqans").click(function() {
index++;
$.get("./genform.php", {
'id': index,
'type': "mcqans"
}, function(data) {
$("#allquestions").append(data);
})

});
$("#sliderans").click(function() {
index++;
$.get("./genform.php", {
'id': index,
'type': "sliderans"
}, function(data) {
$("#allquestions").append(data);
})

});
$("#addform").click(function() {
var formtype = $("#formtype").val();
var quantity = $("#quantity").val();
var questions = $("#questions").val();
for (let i = 0; i < quantity; i++) {
index++;
$.get("./genform.php", {
'id': index,
'type': formtype,
'questions': questions
}, function(data) {
$("#allquestions").append(data);
})
}


});
});
</script>
<script>
document.getElementById("personalcheck").addEventListener("click", function() {
if (this.checked) {
document.getElementById("personal").style.display = "block";
} else {
document.getElementById("personal").style.display = "none";
}
});
</script>


</body>

</html>
2 changes: 1 addition & 1 deletion flag.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cwit{c00l-u-kn0w-stuff-huh?...osint for admin details op: heapbytes/justafolk [github]}
cwit{c00l-u-kn0w-stuff-huh?...osint for admin details op: heapbytes/justafolk/MK-C0dE5 [github]}
54 changes: 48 additions & 6 deletions roles/admin/create_course.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@
<div class="card-body">
<form action="" method="post">
<div class="row">
<div class="col-6">
<div class="col-7">
<div class="row">
<div class="col-6">
<div class="form-group mb-3">
<label for="course_name">
Course Name
Expand All @@ -73,12 +75,13 @@
<div class="col-6">
<div class="form-group">
<label for="course_code">
Course Code
Course Code <span style="color: red;" >
</span>
</label>
<input type="text" name="course_code" id="course_code" class="form-control" placeholder="Course Code">
</div>
</div>
<br>
<div class="col-12">
<div class="form-group mb-3">
<label for="dept_code">
Department
Expand All @@ -105,7 +108,32 @@
<button class="btn btn-dark btn-ecomm" name="submit">Submit</button>
</div>

</div>

</div>


</div>
</div>
<div class="col-5">
<div class="card shadow-none border">
<div class="card-body">
<span style="" >
<ul>
<li>
Don't use symbols like '!@#$%^&*()_+-='
</li>
<li> If multiple entries of same course are to be made, enter them as : <ul>
<li>R18CP4403A</li>
<li>R18CP4403B</li>
<li>R18CP4403C</li>
</ul>
</ul>
</span>

</div>
</div>
</div>
</div>
</form>
</div>
</div>
Expand All @@ -115,9 +143,22 @@
$course_code = $_POST["course_code"];
$dept_code = $_POST["dept_code"];
$mode = $_POST["mode"];

$final_name = $course_name . " - " . $mode;
$final_code = $course_code . " - " . $mode;
$sql1 = "Select * from courses where course_code = '$final_code' && dept_code = '{$_POST['dept_code']}'";
$result1 = mysqli_query($conn, $sql1);
if (mysqli_num_rows($result1) > 0) {
?>
<div class="alert alert-danger" role="alert">
Course Code already existed!
</div>
<?php
}
else {

//echo "<script>alert('$final_name')</script>";
$sql = "INSERT INTO `courses` (`course_name`, `course_code`, `dept_code`) VALUES ('$final_name', '$course_code', '$dept_code')";
$sql = "INSERT INTO `courses` (`course_name`, `course_code`, `dept_code`) VALUES ('$final_name', '$final_code', '$dept_code')";
$result = mysqli_query($conn, $sql);
if ($result) {
echo '<div class="alert alert-success alert-dismissible fade show" role="alert">
Expand All @@ -129,7 +170,8 @@
<strong>Error!</strong> Course Not Added.
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>';
}
}
}
/*
echo "<script>alert('$_POST[course_name]')</script>";
echo "<script>alert('$_POST[mode]')</script>";
Expand Down
8 changes: 5 additions & 3 deletions roles/admin/create_feedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@
$sql = "insert into form_ques (form_id, question_title, sub_content, type) values('$formid', '$value[0]', '".json_encode(array_slice($value, 1))."', 'mcq')";

}
elseif (in_array(explode(";",$key)[2], ["short"])){
elseif (in_array($value, ["short"])){

$sql = "insert into form_ques (form_id, question_title, sub_content, type) values('$formid', '$value[0]', '".json_encode(array_slice($value, 1))."', 'short')";
}
elseif (in_array(explode(";",$key)[2], ["long"])){
elseif (strpos($key, "long") != false ){

$sql = "insert into form_ques (form_id, question_title, sub_content, type) values('$formid', '$value[0]', '".json_encode(array_slice($value, 1))."', 'long')";
}
Expand All @@ -90,6 +90,8 @@
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
exit();
}
header("Location: ./index.php?flag=done");

}

header("Location: feedback/roles/admin/index.php?flag=done");
header("Location: ./index.php?flag=done");
2 changes: 1 addition & 1 deletion roles/admin/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ function addSlider(id) {

<div class="card my-2">
<div class="card-body">
<h5 class="card-title"> <input type="text" value="<?php echo $row["question_title"] ?>. " name="main-question main-question<?php echo $id ?>;long" class="main-question" id="main-question<?php echo $id ?>"> </h5>
<h5 class="card-title"> <input type="text" value="<?php echo $row["question_title"] ?>. " name="main-question longans main-question<?php echo $id ?>;long" class="main-question" id="main-question<?php echo $id ?>"> </h5>
<!-- 5 radio buttons ranging from 5 to 1 -->
<textarea type="text" name="longans<?php echo $id ?>" class="form-control" placeholder="Enter Answer in Long" id="ans<?php echo $id ?>"></textarea>
<div class="row">
Expand Down
8 changes: 7 additions & 1 deletion roles/admin/final_print_report.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<?php

error_reporting(0);
$semester_id = $_GET['semester'];
$department_id = $_GET['dept'];

Expand All @@ -22,6 +22,12 @@
$courses = array();

while ($row = mysqli_fetch_assoc($result)) {
$sf = "select * from courses where course_code='$row[course_code]'";
$reg = mysqli_query($conn, $sf);
$rof = mysqli_fetch_assoc($reg);
if (strpos($rof["course_name"], "Suggest")!==false){
continue;
}
$group_array[] = $row['form_id'];
$courses[] = $row['course_code'];
$academic_fo = $row["academic_year"];
Expand Down
Loading

0 comments on commit c160d87

Please sign in to comment.