Sponsorenverwaltung - Team StarCraft e.V.
 All Data Structures Files Functions Variables
functions_delete.php File Reference

This file holds some of the functions used for (non-)permanent delete. More...

Go to the source code of this file.

Functions

 deleteSponsorCar ($sponsorCarId)
 
 deleteSponsor ($sponsorId)
 
 deleteSponsorPermanently ($sponsorId)
 
 deleteSponsorCarPermanently ($cars=NULL, $carId=NULL)
 
 fetchAllDeletedSponsorCarsForSponsor ($sponsorId, $fetchTimestamp=FALSE)
 
 fetchDeletedSponsorCars ($sponsorId, $fetchTimestamp=FALSE)
 
 fetchAllDeletedSponsors ()
 
 isSponsorDeleted ($sponsorId)
 
 fetchAllSponsorsWithDeletedCars ()
 

Detailed Description

This file holds some of the functions used for (non-)permanent delete.

This script holds functions to delete sponsors and sponsorcars. This covers non permanent delete functions as well as functions capable of deleting the given sponsor respectively sponsorcar and all of its stored backup- entries from the database. Due to the power of these functions most of them realize a hardcoded access-controll.

This file is linked with the other funcions via the inc/common.php and it needs lots of globals defined in inc/common.php or its includes.

Version
1.0.0
Author
Daniel Seichter
Alexander Vorndran
Florian Wirthmüller
Date
02.07.2013

Definition in file functions_delete.php.

Function Documentation

deleteSponsor (   $sponsorId)

Delete a sponsor and all its related information from the normal database tables.

Parameters
integer$sponsorId
Returns
mixed
  • FALSE if the query failed or the given $sponsorId was not valid
  • -1 if their are unresolved locks on the sponsor
  • -2 if an error occurred in the process of deletion
Author
Daniel Seichter
Alexander Vorndran

Definition at line 118 of file functions_delete.php.

References $db, $mysqli, deleteSponsorCar(), deleteSponsorContactPerson(), deleteSponsorProductionFacility(), fetchSponsorCarDetails(), fetchSponsorContactPersons(), fetchSponsorProductionFacilities(), isSponsorEditSectionLocked(), isUserLoggedIn(), lockSponsorEditSection(), and unlockSponsorEditSection().

+ Here is the call graph for this function:

deleteSponsorCar (   $sponsorCarId)

Deletes a sponsor car from the database

Parameters
integer$sponsorCarIdthe id of the sponsor car
Author
Alexander Vorndran
Daniel Seichter

Definition at line 32 of file functions_delete.php.

References $db, $mysqli, deleteSponsorCarAttachment(), deleteSponsorCarEvent(), deleteSponsorCarFinancialDonation(), deleteSponsorCarMaterialDonation(), deleteSponsorCarProducedPart(), fetchSponsorCarAttachments(), fetchSponsorCarDetails(), fetchSponsorCarEvents(), fetchSponsorCarMaterialDonation(), fetchSponsorCarProducedParts(), and isUserLoggedIn().

Referenced by deleteSponsor().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

deleteSponsorCarPermanently (   $cars = NULL,
  $carId = NULL 
)

Deletes a sponsor car and it's associated information from the backup-tables

Parameters
array$carsarray with the key 'id' which should hold the sponsorcar id
integer$carId
Returns
mixed
  • on success the number of successful deletions
  • FALSE on failure
Author
Alexander Vorndran
Daniel Seichter

Definition at line 295 of file functions_delete.php.

References $dbBackup, $mysqli, ABS_PATH, and isUserAdministrator().

Referenced by deleteSponsorPermanently().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

deleteSponsorPermanently (   $sponsorId)

This function deletes the backup entries of a sponsor completly und permanently.

Parameters
integer$sponsorId
Returns
boolean
  • TRUE on success
  • FALSE on failure
Author
Alexander Vorndran
Daniel Seichter

Definition at line 206 of file functions_delete.php.

References $dbBackup, $mysqli, ABS_PATH, deleteSponsorCarPermanently(), fetchAllDeletedSponsorCarsForSponsor(), isSponsorDeleted(), and isUserRoot().

+ Here is the call graph for this function:

fetchAllDeletedSponsorCarsForSponsor (   $sponsorId,
  $fetchTimestamp = FALSE 
)

Fetches a list of all deleted sponsorcars that belong to a sponsor

Parameters
integer$sponsorIdid of the sponsor
boolean$fetchTimestamp
  • TRUE: the filestamp of the deletion will be included in the resulting array
  • FALSE: the filestamp of the deletion won't be included in the resulting array
Returns
mixed
  • an array containg all the sponsorcar ids
  • FALSE on failure
Author
Alexander Vorndran

Definition at line 406 of file functions_delete.php.

References $dbBackup, $mysqli, and fetchUsername().

Referenced by deleteSponsorPermanently().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

fetchAllDeletedSponsors ( )

Retrieves a list of all deleted sponsors from the backup tables

Returns
mixed
  • a list of the deleted sponsors
  • FALSE failure
Author
Alexander Vorndran
Daniel Seichter
Florian Wirthmüller

Definition at line 513 of file functions_delete.php.

References $dbBackup, $mysqli, and fetchUsername().

+ Here is the call graph for this function:

fetchAllSponsorsWithDeletedCars ( )

Fetches a list of all non deleted sponsors with deleted sponsorcars

Returns
array an array containing id and name of all the sponsors
Author
Alexander Vorndran

Definition at line 596 of file functions_delete.php.

References $db, $dbBackup, and $mysqli.

fetchDeletedSponsorCars (   $sponsorId,
  $fetchTimestamp = FALSE 
)

Fetches a list of deleted sponsorcars with their last known name that belong to a sponsor

Parameters
integer$sponsorIdid of the sponsor
boolean$fetchTimestamp
  • TRUE: the filestamp of the deletion will be included in the resulting array
  • FALSE: the filestamp of the deletion won't be included in the resulting array
Returns
mixed
  • an array containg all the sponsorcar ids
  • FALSE on failure
Author
Alexander Vorndran

Definition at line 458 of file functions_delete.php.

References $dbBackup, $mysqli, and fetchUsername().

+ Here is the call graph for this function:

isSponsorDeleted (   $sponsorId)

Checks if a sponsor with a given id has been deleted

Parameters
integer$sponsorIdthe id of the sponsor
Returns
boolean
  • TRUE if the sponsor was deleted
  • FALSE if not
Author
Alexander Vorndran

Definition at line 568 of file functions_delete.php.

References $dbBackup, and $mysqli.

Referenced by deleteSponsorPermanently().

+ Here is the caller graph for this function: