Пример #1
0
 public static function removeProductAndInventoryImage($db, $fatherTable, $imagetable, $product_tag, $imageID, $postID, $userID)
 {
     if ($product_tag == 'inventory') {
         $okayBool = DatabaseObject_Helper_InventoryManager::verifyInventoryItemForUser($db, $postID, $userID);
     } else {
         $okayBool = DatabaseObject_Helper_ProductListing::confirmproductforuploader($db, $fatherTable, $userID, $postID);
     }
     if ($okayBool) {
         $image = new DatabaseObject_Image($db, $imagetable, $product_tag);
         if ($image->loadForPost($postID, $imageID)) {
             echo 'here at load image';
             if ($image->delete()) {
                 echo 'here at delete image';
                 return true;
             } else {
                 return false;
             }
         } else {
             echo 'image not loaded';
         }
     } else {
         echo 'You have no permission to perform this action';
         return false;
     }
 }