<?php session_start();
if(empty($_SESSION['id'])):
header('Location:../index.php');
endif;

include('../dist/dbcon.php');

	
	if(isset($_POST['submit'])) { 
	date_default_timezone_set("Asia/Manila"); 
	$date = date("Y-m-d");
									$id = $_SESSION['id'];
									  $filename = $_FILES["filename"]["name"];
									 
									  $transname = $_POST['reportname'];
									   $transtype = $_POST['note'];
									  
									
									  move_uploaded_file($_FILES["filename"]["tmp_name"],"media/".$_FILES["filename"]["name"]);
									
									  

									
mysqli_query($con,"INSERT INTO userreports(reportname,note,filename,userid,status,date,techfilename) VALUES ('$transname','$transtype','$filename','$id','pending','$date','')")or die(mysqli_error($con)); 
echo "<script>alert('Hydrocheck Uploaded Successfully Reports');</script>";
									 	
									}
									?>





<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <meta name="description" content="">
        <meta name="author" content="">

        <title>HYDROCHECK</title>

        <!-- CSS FILES -->                
        <link rel="preconnect" href="https://fonts.googleapis.com">
        
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

        <link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,200;0,400;0,700;1,200&family=Unbounded:wght@400;700&display=swap" rel="stylesheet">
        
        <link href="../css/bootstrap.min.css" rel="stylesheet">

        <link href="../css/bootstrap-icons.css" rel="stylesheet">

        <link href="../css/tooplate-kool-form-pack.css" rel="stylesheet">
        
    </head>
    
    <body>

        <main>

            <header class="site-header">
                <div class="container">
                    <div class="row justify-content-between">

                        <div class="col-lg-12 col-12 d-flex align-items-center">
                            <a class="site-header-text d-flex justify-content-center align-items-center me-auto" href="index.php">
                                <i class="bi bi-droplet-half"></i>

                                <span>
                                    HYDROCHECK
                                </span>
                            </a>

                            <ul class="social-icon d-flex justify-content-center align-items-center mx-auto">
                                <span class="text-white me-4 d-none d-lg-block">Stay connected</span>

                                <li class="social-icon-item">
                                    <a href="#" class="social-icon-link bi-instagram"></a>
                                </li>

                                <li class="social-icon-item">
                                    <a href="#" class="social-icon-link bi-twitter"></a>
                                </li>

                                <li class="social-icon-item">
                                    <a href="#" class="social-icon-link bi-whatsapp"></a>
                                </li>
                            </ul>

                            <div>
                                <!--<a href="#" class="custom-btn custom-border-btn btn" data-bs-toggle="modal" data-bs-target="#subscribeModal" > Login-As
                                    <i class="bi bi-person-check"></i>
                                </a> -->
                                 <a href="index.php" class="custom-btn custom-border-btn btn" > Back
                                    <i class="bi bi-arrow-left"></i>
                                </a>
                            </div>

                            <a class="bi-list offcanvas-icon" data-bs-toggle="offcanvas" href="#offcanvasMenu" role="button" aria-controls="offcanvasMenu"></a>

                        </div>

                    </div>
                </div>
            </header>


            <div class="offcanvas offcanvas-end" data-bs-scroll="true" tabindex="-1" id="offcanvasMenu" aria-labelledby="offcanvasMenuLabel">                
                <div class="offcanvas-header">                    
                    <button type="button" class="btn-close ms-auto" data-bs-dismiss="offcanvas" aria-label="Close"></button>
                </div>
                
                <div class="offcanvas-body d-flex flex-column justify-content-center align-items-center">
                    <nav>
                        <ul>
                            <li>
                                <a  href="user.php">User Data</a>
                            </li>

                            <li>
                                <a class="active" href="report.php">Leak Reports</a>
                            </li>

                            <li>
                                <a href="status.php">Reports Status</a>
                            </li>

                            <li>
                              <a  href="notification.php">Notification</a>
                            </li>

                            <li>
                                <a href="404.php">About</a>
                            </li>
                        </ul>
                    </nav>
                </div>
            </div>


           


            <section class="hero-section d-flex justify-content-center align-items-center" id="section_1">
                <div class="container">
                    <div class="row">

                        <div class="col-lg-5 col-12 mx-auto">
                            <form class="custom-form login-form" role="form" method="post" enctype="multipart/form-data">
                                <h2 class="hero-title text-center mb-4 pb-2">Users Profile</h2>
                                  <div class="form-floating mb-4 p-0">
                                    <input type="text" name="reportname" id="name" class="form-control" placeholder="Enter Reports" required="">

                                    <label for="email">Reports Name</label>
                                </div>
                               

                                <div class="form-floating p-0">
                                    <input type="file" id="filename" name="filename" value="" class="form-control" placeholder="File" required="">

                                    <label for="password">Upload Reports Images</label>
                                </div>
                                
                                <div class="form-floating p-0">
                                   
                                    <textarea name="note" id="note"  required="" style="width:100%;height:200px;"></textarea>
                                        
                                    <label for="email">Enter Notes</label>
                                </div>

                                <div class="row justify-content-center align-items-center">
                                    <div class="col-lg-5 col-12">
                                        <button type="submit" name="submit" class="form-control">Submit</button>
                                    </div>
<br></br> <br></br> 
                                             
                                </div>

                            </form>
                            
                        </div>
                    </div>
                </div>
                <div class="video-wrap">
                    <video autoplay="" loop="" muted="" class="custom-video" poster="">
                        <source src="../videos/video.mp4" type="video/mp4">

                       
                    </video>
                </div>
            </section>
            
        </main>

        <!-- JAVASCRIPT FILES -->
        <script src="../js/jquery.min.js"></script>
        <script src="../js/bootstrap.bundle.min.js"></script>
        <script src="../js/countdown.js"></script>
        <script src="../js/init.js"></script>
<h5 style="color:white;margin-top:0px;font-size:11px;">Developed By:PRECY R. ADORICO AND ANGELINE L. ALAHID</h5>
    </body>
</html>
