Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--1)
- http://www.w3schools.com/css/box-model.gif
- o box model é as "caixas" que estão à volta de um elemento HTML. Este contem o conteúdo, padding, borda e margem.
- O padding é o espaço que é "consumido" na caixa do conteúdo. É transparente
- A Borda é a caixaque está entre a margem e o padding, que normalmente tem o seu proprio estilo.
- Margin é a area de fora do elemento que afasta do outro elemento a que esteja ligado. É transparente.
- ???? IE?????
- Por defeito alguns browsers têm um padding e margem por defeito. O IE 8 e anterior incluia automaticamente um padding e borda na propriedade width dos elementos.
- -->
- <!--2)-->
- <!--HTML-->
- <html>
- <head>
- <title>Perfect To Do List</title>
- <link rel="stylesheet" type="text/css" href="style.css">
- </head>
- <body>
- <div class="principal">
- <div class="header">
- <div class="title">
- <p>Perfect To Do List</p>
- </div>
- </div>
- <div class="head2">
- <p class="sel">Select Project: </p>
- <select id="projsel" name="projsel" class="sel">
- </select>
- <p id="welcome" name="welcome" class="welcome">Welcome pedro.silva</p>
- </div>
- <div class="tasks">
- <p class="pendtitle">Pending Tasks</p>
- <p class="inst"><i>Check tasks done or add a new task:</i></p>
- <form class="checkas" method="post" action="">
- <input type="checkbox" value="Kick-off">Kick-off meeting</br>
- <input type="checkbox" value="Analysis">Analysis report</br>
- <input type="checkbox" value="Design">Design report</br>
- <input type="checkbox" value="Functional">Functional requirements report</br>
- <input type="checkbox" value="Coding">Coding</br>
- <input type="checkbox" value="Test">Testing</br>
- <p class="ntask">New task:</p>
- <textarea class="textar">
- </textarea></br>
- <input class="butao" type="submit" value="OK">
- </form>
- </div>
- <div class="tasks2" method="post" action="">
- <p class="conctitle">Concluded Tasks</p>
- <p class="inst"><i>Select tasks you want to send back to the Pending list.</i></p>
- <form class="checkas" action="undo.php">
- <input type="checkbox" value="Meet">First meeting with client</br>
- <input type="checkbox" value="Bizz">Business Proposal</br>
- <input type="checkbox" value="WinP">Win Project</br>
- <input class="butao2" type="submit" value="Undo">
- </form>
- </div>
- </div>
- </body>
- </html>
- <!--css-->
- body{
- background-color:grey;
- padding:0;
- margin:0;
- }
- div{
- margin:0;
- padding:0;
- }
- p{
- font-family:Arial;
- font-size:14px;
- margin:0;
- padding:0;
- }
- br{
- margin:10px;
- }
- .principal{
- margin-left:100px;
- width:800px;
- height:800px;
- background-color: white;
- }
- .header{
- width:780px;
- background-color:lightgrey;
- height:80px;
- padding:10px;
- }
- .head2{
- width:780px;
- height:35px;
- margin-bottom:10px;
- }
- .title{
- width:350px;
- background-color:darkgrey;
- padding:10px;
- }
- .title p{
- color:white;
- }
- .sel{
- float:left;
- margin:10px;
- }
- .welcome{
- float:right;
- margin:10px;
- }
- .tasks{
- float:left;
- width:395px;
- }
- .pendtitle{
- background-color:darkgrey;
- padding-top:10px;
- padding-bottom:10px;
- padding-left:10px;
- width:385px;
- }
- .inst{
- margin:10px 10px 10px 20px;
- font-size:12px;
- }
- .checkas{
- margin:10px 10px 10px 20px;
- }
- .ntask{
- margin:10px;
- }
- .textar{
- margin-left:10px;
- width:345px;
- }
- .butao{
- margin:10px;
- float:right;
- width:100px;
- }
- .tasks2{
- float:right;
- width:395px;
- }
- .conctitle{
- background-color:darkgrey;
- padding-top:10px;
- padding-bottom:10px;
- padding-left:10px;
- width:385px;
- }
- .butao2{
- margin:10px;
- float:left;
- width:100px;
- }
- <!--3)-->
- <!--index.php-->
- <?php
- if(!session_id())
- {
- session_start();
- }
- if(!isset($_SESSION['user-login']))
- {
- header('Location: login.php');
- die();
- }
- $conn = mysqli_connect('localhost', 'root', '', 'todolist');
- if ($_SERVER["REQUEST_METHOD"] == "POST")
- {
- if($_POST['action'] == 'pending')
- {
- $aux=0;
- $sql = "SELECT count(*) as `cnt` FROM `pending_tasks` WHERE `project_id` = " . $checkedproj;
- $res = mysqli_query($sql,$conn);
- $row = mysqli_fetch_assoc($res);
- if($res)
- {
- while($aux < $row['cnt'])
- {
- if(isset($_POST[$aux]))
- {
- $sql = "INSERT INTO `concluded_tasks` count(*) (`text`,`project_id) VALUES(SELECT `text`,`project_id` FROM `pending_tasks` WHERE `text` LIKE " . $_POST[$aux] . ")";
- mysqli_query($sql,$conn);
- $sql = "DELETE FROM `concluded_tasks` WHERE `text` LIKE " . $_POST[$aux];
- mysqli_query($sql,$conn);
- }
- $aux++;
- }
- }
- }
- else if($_POST['action'] == 'concluded')
- {
- $aux=0;
- $sql = "SELECT count(*) as `cnt` FROM `concluded_tasks` WHERE `project_id` = " . $checkedproj;
- $res = mysqli_query($sql,$conn);
- $row = mysqli_fetch_assoc($res);
- if($res)
- {
- while($aux < $row['cnt'])
- {
- if(isset($_POST[$aux]))
- {
- $sql = "INSERT INTO `pending_tasks` count(*) (`text`,`project_id) VALUES(SELECT `text`,`project_id` FROM `concluded_tasks` WHERE `text` LIKE " . $_POST[$aux] . ")";
- mysqli_query($sql,$conn);
- $sql = "DELETE FROM `pending_tasks` WHERE `text` LIKE " . $_POST[$aux];
- mysqli_query($sql,$conn);
- }
- $aux++;
- }
- }
- }
- else if($_POST['action'] == 'project')
- {
- $checkedproj = $_POST['projsel'];
- }
- }
- ?>
- <html>
- <head>
- <title>Perfect To Do List</title>
- <link rel="stylesheet" type="text/css" href="style.css">
- </head>
- <body>
- <div class="principal">
- <div class="header">
- <div class="title">
- <p>Perfect To Do List</p>
- </div>
- </div>
- <div class="head2">
- <p class="sel">Select Project: </p>
- <form action="" method="post">
- <input type="hidden" name="project">;
- <select id="projsel" name="projsel" class="sel">
- <?php
- $sql = "SELECT * FROM `projects` WHERE `user_id` = " . $_SESSION['user-login'];
- $res = mysqli_query($sql,$conn);
- if($res)
- {
- $aux=0;
- while($row = mysqli_fetch_assoc($res))
- {
- if($aux === $checkedproj)
- echo "<option value=\"" . $row['id'] . "\" selected>". $row['project_name'];
- echo "<option value=\"" . $row['id'] . "\">". $row['project_name'];
- $aux++;
- }
- }
- ?>
- </select>
- </form>
- <p id="welcome" name="welcome" class="welcome">Welcome <?php echo $_SESSION['user-login']?></p>
- </div>
- <div class="tasks">
- <p class="pendtitle">Pending Tasks</p>
- <p class="inst"><i>Check tasks done or add a new task:</i></p>
- <form class="checkas" method="post" action="">
- <input type="hidden" name="action" value="pending" />
- <?php
- if($checkedproj !== '')
- {
- $sql = "SELECT * FROM `pending_tasks` WHERE `project_id` = " . $checkedproj;
- $res = mysqli_query($sql,$conn);
- if($res)
- {
- while($row = mysqli_fetch_assoc($res))
- {
- echo "<input type=\"checkbox\" value=\"" . $row['text'] . "\">". $row['text'];
- }
- }
- }
- ?>
- <p class="ntask">New task:</p>
- <textarea class="textar">
- </textarea></br>
- <input class="butao" type="submit" value="OK">
- </form>
- </div>
- <div class="tasks2" >
- <p class="conctitle">Concluded Tasks</p>
- <p class="inst"><i>Select tasks you want to send back to the Pending list.</i></p>
- <form class="checkas" method="post" action="">
- <input type="hidden" name="action" value="concluded" />
- <?php
- if($checkedproj !== '')
- {
- $sql = "SELECT * FROM `concluded_tasks` WHERE `project_id` = " . $checkedproj;
- $res = mysqli_query($sql,$conn);
- if($res)
- {
- while($row = mysqli_fetch_assoc($res))
- {
- echo "<input type=\"checkbox\" value=\"" . $row['text'] . "\">". $row['text'];
- }
- }
- }
- ?>
- </form>
- </div>
- </div>
- </body>
- </html>
- <!--login.php-->
- <?php
- if(!session_id())
- {
- session_start();
- }
- if(isset($_SESSION['user-login']))
- {
- header('index.php');
- die();
- }
- $mess = '';
- $conn = mysqli_connect('localhost', 'todolist', '12345', 'todolist');
- if ($_SERVER["REQUEST_METHOD"] == "POST")
- {
- if($_POST['name'] !== '' && $_POST['pass'] !== '')
- {
- $sql = "SELECT `Password` FROM `users` WHERE `Username` LIKE ".$_POST['name'];
- $res = mysqli_query($sql,$conn);
- if($res)
- {
- $row = mysqli_fetch_assoc($res);
- if(password_verify($_POST['pass'],$row['Password']))
- {
- $_SESSION['user-login'] = $_POST['name'];
- header('Location: index.php');
- die();
- }
- else
- {
- $mess='Wrong Password';
- }
- }
- else
- {
- $mess="User Name Doesn't Exist.";
- }
- }
- else
- {
- $mess="Please fill all fields.";
- }
- }
- ?>
- <html>
- <head>
- <title>Login</title>
- <link rel="stylesheet" type="text/css" href="style.css">
- </head>
- <body>
- <div class="principal">
- <?php
- if($mess !== '')
- {
- echo "<p>".$mess."</p>";
- }
- ?>
- <form class="checkas" method="post" action="">
- <p>Username:</p><input type="text" name="name"><br>
- <p>Password:</p><input type="password" name="pass"><br>
- <input type="submit" value="Login">
- </form>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement