Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ngounoubernard 201925800180 contributor list #18

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions Connect.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<?php

$servername = "localhost";
$username = "root";
$password = "";
//$servername = "localhost";
//$username = "root";
//$password = "";


// $servername = "sql202.epizy.com";
// $username = "epiz_23626301";
// $password = "wtn2rmj3";
// Create connection
$con = new mysqli($servername, $username, $password,'lrr');
$dsn = 'mysql:dbname=ngounou;host=127.0.0.1;port=3306';
$user = 'root';
$password = '';

// Check connection
if ($con->connect_error) {
die("Database Connection failed: " . $conn->connect_error);
}
// else
// {
try {
$dbh = new PDO($dsn, $user, $password);

// echo "Connected";
// }
session_start();
}
catch (PDOException $e) {
echo 'connexion has failed : ' . $e->getMessage();
}
$stmt = $dbh->query("SELECT * FROM course_students_table");
while ($row = $stmt->fetch()) {
$tablel_user[] = $row['Student_ID']."<br />\n";
}
session_start();
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ these bugs.




# The Bug Tracker

We use Bugzilla to track LRR's bugs and feature requests.
Expand Down Expand Up @@ -123,12 +122,13 @@ To submit bug reports or improvement ideas, please ask Hui [lanhui at zjnu.edu.c
Check FAQ.md (TBA) for details.



# The Original GitHub Repo

The original GitHub Repo is at https://github.com/EngMohamedNor/LabReportRepo




# Contributor List


Expand All @@ -140,7 +140,6 @@ WhyteAsamoah - Yeboah Martha Asamoah - 201732120135

xiaoyusoil - ZhengXiaoyu - 201732120110


Benny123-cell - ZhangBin - 201732120127

421281726 - LiJiaxing - 201732120118
Expand All @@ -156,5 +155,10 @@ Richard1427 - XieJiacong - 201732120123
yutengYing - YingYuteng - 201732120126

Samrusike - Samantha Rusike - 201632120140

Teecloudy - Ashly Tafadzwa Dhani - 201632120150

ngounou92 - ngounou bernard - 201925800180

pipafrica - mohamed moumou - 201925800178
>>>>>>> 8f7191061de9c185b0e7ee9db30d712b75a55479
36 changes: 36 additions & 0 deletions UserDoc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
LRR User Documentation
======================


Resetting password
-------------------

We can reset a user's password by directly modifying the MySQL database table called `users_table`. More specifically, we delete that user's information from `users_table` so that the user could sign up again. Suppose the user's student number is 201131129138.

To do so, LRR administrator logs in to MySQL using the following command: `mysql -u username -p`. Type the correct password to access the MySQL database.

After that, issue the following commands in the mysql prompt.

- `use lrr;`

- `delete from users_table where Student_ID="201131129138";`

The first one uses a database called lrr in MySQL. The second one deletes a record from `users_table` where the student number is 201131129138.


Joining by using course name or course
--------------------------------------

In this section we are going to present what we did on the course page to allowed the users(students) to find the course and join that course using the course name/course code.
we have created a new page with some links (home, course, disabled).those links will help the users to navigate through the other pages of LRRS.

we have use the lrr database especially the courses_table that store different courses information.

You can have a look on our new code source (home.php, connect.php, verif-form.php,connect.php) for more details.

we have not yet associated our page with other pages(script.php) of LRRS because this page is quite different to other pages.

have a look on our user guide file(user guide file) to see some screenshots of our page.


*Last modified on 1 June 2020 by Hui*
164 changes: 164 additions & 0 deletions home.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
<?php

include 'Header.php';
$student_id=$_SESSION["user_student_id"];
$group_id=$_SESSION["user_group_id"];
$c_date= date("Y-m-d H:i");

?>
<!DOCTYPE html>
<html >
<head>
<meta charset="utf-8"/>
<title>Recherche</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">

<style>
table{width:100%;border-collapse:collapse}
table tr,table th,table td{border:1px solid black;}
table tr td{text-align:center;padding:1em;}
</style>
</head>
<body>
<div class="jumbotron text-center">
<h1> Lab Report Repository System </h1>
<p>a new Version for a better future !</p>

<!-- Grey with black text -->
<nav class="navbar navbar-expand-sm bg-light navbar-light">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#">Home</a>
</li>

<li class="nav-item active">
<a class="nav-link" href="#">Courses</a>
</li>


<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
</nav>

<!-- Black with white text -->
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">...</nav>

<!-- Blue with white text -->


</div>

<div class="container">


<div class="row">
<div class="col-sm-4">
<div class="col-md-4">
<br><br>
<img src="../my_lrr/logo_text.png" style="width">


<br><br>

</div>
</div>
<div class="col-sm-4">
<form method='post'>


<div class="form-group">
<br><br>
<a>Find course by : </a>
<select class="form-control" id="sel1" name="identif">
<option>Course Name</option>
<option>Course Code</option>
</select>
</div>
<br><br>
<input type='text' placeholder='recherche' name="recherche_valeur"/>
<input type='submit' value="Search" onclick="resp();"/> <label id="resp"></label>
</form>
</div>
<div class="col-sm-4">
<?php include('verif-form.php');



?>


<table>
<thead>
<tr><th>Course Name</th><th>Faculty</th><th>Course Code</th><th>URL</th></tr>

</thead>
<tbody>
<?php




if(isset($_POST['recherche_valeur'])){

if($_POST['identif'] == "Course Name") {

$sql='select * from courses_table';
$params=[];
$sql.=' where Course_name like :Course_name';
$params[':Course_name']="%".addcslashes($_POST['recherche_valeur'],'_')."%";

$resultats=$connect->prepare($sql);
$resultats->execute($params);
if($resultats->rowCount()>0){
while($d=$resultats->fetch(PDO::FETCH_ASSOC)){
?>
<tr><td><?=$d['Course_Name']?></td><td><?=$d['Faculty']?></td><td><?=$d['Course_Code']?></td><td> <a class="nav-link" href="<?=$d['URL']?>">Link</a></td></tr>
<?php
}
$resultats->closeCursor();
}
else echo '<tr><td colspan=4>Find Courses Area</td></tr>'.
$connect=null;
}
if($_POST['identif'] == "Course Code") {
$c_k=$_POST['identif'] ;
$sql='select * from courses_table';
$params=[];

$sql.=' where Course_Code like :Course_Code';
$params[':Course_Code']="%".addcslashes($_POST['recherche_valeur'],'_')."%";

$resultats=$connect->prepare($sql);
$resultats->execute($params);
if($resultats->rowCount()>0){
while($d=$resultats->fetch(PDO::FETCH_ASSOC)){
?>
<tr><td><?=$d['Course_Name']?></td><td><?=$d['Faculty']?></td><td><?=$d['Course_Code']?></td><td> <a class="nav-link" href="<?=$d['URL']?>">Link</a></td></tr>
<?php
}
$resultats->closeCursor();
}
else echo '<tr><td colspan=4>Find Courses Area</td></tr>'.
$connect=null;
}

}




?>
</tbody>
</table>
</div>
</div>
</div>





</body>
</html>
11 changes: 11 additions & 0 deletions verif-form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

<?php

//connection_database.php

$connect = new PDO('mysql:host=localhost;port=3308;dbname=ngounou', 'root', '',[
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"
]);

?>