-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathorganise.php
139 lines (117 loc) · 4.9 KB
/
organise.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="css/home.css">
<link rel="stylesheet" href="css/task.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous">
</script>
<script src="https://kit.fontawesome.com/a076d05399.js" crossorigin="anonymous">
<script src =
"https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
integrity =
"sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
crossorigin = "anonymous" >
</script>
</head>
<body>
<div class="wrapper">
<nav> <input type="checkbox" id="show-search"> <input type="checkbox" id="show-menu"> <label for="show-menu" class="menu-icon"><i class="fas fa-bars"></i></label>
<div class="content">
<div class="logo"><a href="home.php"><img src="images/logo/logo.png"></a></div>
<ul class="links">
<?php
echo '
<li><a href="home.php">Home</a></li>
<li><a href="travel.php">Travel</a></li>
<li> <a class="desktop-link">Relax</a> <input type="checkbox" id="show-services"> <label for="show-services">Services</label>
<ul>
<li><a href="task.php"><i class="fa fa-fw fa-helicopter"></i>Relaxing Task</a></li>
<li><a href="music.php"><i class="fa fa-fw fa-couch"></i>Relaxing Music</a></li>
</li>
</ul>
</li>
<li><a href="organise.php">Organise</a></li>
<li> <a class="desktop-link">Blogs</a> <input type="checkbox" id="show-services"> <label for="show-services">Services</label>
<ul>
<li><a href="travelblog.php"><i class="fa fa-fw fa-helicopter"></i>Travel Blogs</a></li>
<li><a href="relaxblog.php"><i class="fa fa-fw fa-couch"></i>Relax Blogs</a></li>
</li>
</ul>
</li>
</ul>'; ?>
</div> <label for="show-search" class="search-icon"><i class="fas fa-search"></i></label>
<form action="" class="search-box"> <input type="text" placeholder="Type Something to Search..." required> <button type="submit" class="go-icon"><i class="fas fa-long-arrow-alt-right"></i></button> </form>
<a href="logout.php" type="button" class="btn btn-warning">
<h5>Logout</h5>
</a>
</nav>
</div>
</div>
<div class="container my-3">
<h1>Take your Notes here</h1>
<div class="card1">
<div class="card-body">
<h5 class="card-title">
Add a Note
</h5>
<form method="post">
<div class="form-group">
<textarea class="form-control" id="addTxt" rows="3" name="txtnote">
</textarea>
</div>
<button type="submit" name="note" class="btn btn-primary" id="addBtn" style="background-color:green">
Add Note
</button>
</form>
<?php
include('Connect.php');
include('login_back.php');
if (isset($_POST['note'])) {
$userid = $_SESSION['id'];
$noteid = uniqid();
$txtnote = $_POST['txtnote'];
$query1 = " SELECT * FROM `notes` WHERE `userid` = '$userid' ";
$res1 = mysqli_query($Connect, $query1);
$data = mysqli_fetch_assoc($res1);
$res = mysqli_query($Connect, "INSERT INTO `notes`(`userid`, `noteid`, `note`) VALUES ('$userid','$noteid','$txtnote')");
}
?>
</div>
</div>
<hr>
<h1>Your Notes</h1>
<hr>
<div class="card-container">
<?php
$userid = $_SESSION['id'];
$result = mysqli_query($Connect, "SELECT * FROM `notes` WHERE `userid`='$userid'");
$i = 1;
$x = 1;
while ($row = mysqli_fetch_array($result)) {
?>
<?php echo '<div class="card card-' . $x . '">'; ?>
<h2 class="card__title"><?php echo $row['note'] ?></h2>
<br>
<script>
function confirmationDelete(anchor) {
var conf = confirm('Are you sure want to delete this record?');
if (conf)
window.location = anchor.attr("href");
}
</script>
<a onclick='javascript:confirmationDelete($(this));return false;' href="delete.php?noteid=<?php echo $row['noteid'] ?>"><i class="fas fa-trash" style="color:white"></i></a>
</div>
<?php
$x++;
if ($x > 5) {
$x = 1;
}
$i++;
}
?>
<script src="notes.js"></script>
</body>
</html>