public function uploadCoverPhoto($item_name, $owner)
 {
     $fileName = $this->uploadFile();
     if ($fileName != null) {
         $itemModel = new itemModel();
         $queryResult = false;
         $queryResult = $itemModel->addCoverImage($item_name, $owner, $fileName);
         if (!$queryResult) {
             $photoUploadError = true;
             $photoUploadErrorMessage = "<p class=\"text-danger\">Image upload Failed! Please contact admin.</p>";
         }
     }
 }
     // adding item entry
     include 'models/itemModel.php';
     $itemModel = new itemModel();
     $result = $itemModel->addLoan($_POST['item_name'], $_POST['owner'], $_POST['category'], $_POST['price'], $_POST['description'], $_POST['location']);
     if ($result == true) {
         $result = "<p class='text-success'>Item Successfully Created!</p>";
     } else {
         $result = "<p class='text-danger'>Error Occured! Try checking your database constraint.</p>";
     }
 } else {
     if (isset($_POST['item_name']) && isset($_POST['owner']) && isset($_POST['image_url'])) {
         // adding image url entry
         include 'models/itemModel.php';
         $itemModel = new itemModel();
         if (isset($_POST['is_cover'])) {
             $result = $itemModel->addCoverImage($_POST['item_name'], $_POST['owner'], $_POST['image_url']);
         } else {
             $result = $itemModel->addNonCoverImage($_POST['item_name'], $_POST['owner'], $_POST['image_url']);
         }
         if ($result == true) {
             $result = "<p class='text-success'>Item Image Successfully Created!</p>";
         } else {
             $result = "<p class='text-danger'>Error Occured! Try checking your database constraint.</p>";
         }
     } else {
         if (isset($_POST['item_name']) && isset($_POST['owner']) && isset($_POST['commentor']) && isset($_POST['content'])) {
             // adding comment entry
             include 'models/commentModel.php';
             $commentModel = new commentModel();
             $result = $commentModel->addComment($_POST['item_name'], $_POST['owner'], $_POST['commentor'], $_POST['content']);
             if ($result == true) {