<?php
/*******************************************************************************
 *                    _ _ _ _
 *                   / _ _  /
 *            _ _   / /__/ /_ _   ____ _ _   _ _ _    __
 *           / _ ` /   _ _// _ ` / __// _ ` / _ \\ \ / /
 *          / _ _// /\ \  / _ _/ \_ \/ _ _// / \/ \ ` /
 *          \_ , /_/  \_\ \_ ,  /__ /\_ , /_/      \_/
 *
 *******************************************************************************
 *    Application:  eReserv
 *    Version:      6
 *    Author:       David Di Certo
 *    Website:      http://www.cogites.com
 *    Email:        contact@cogites.com
 *    Copyright:    2013 - David Di Certo
 *******************************************************************************
 *    == FR ==      La revente et la redistribution de l'application sont
 *                  strictement interdites.
 *
 *                  Vous êtes tenu d'avoir pris connaissance des
 *                  Conditions Générales de Vente disponibles sur Cogites.com
 *                  (y compris pour la version Free).
 *
 *    == EN ==      Resale and redistribution of the application are
 *                  Strictly prohibited.
 *
 *                  You are required to have read the Terms and Conditions
 *                  available on Cogites.com (including the Free version).
 *
 *******************************************************************************
*/

require_once('dao/LeaseContentDao.php');

class LeaseContentMgr {

	function getLease ($id){
		return LeaseContentDao::getLease ($id);
	}
	function deleteLeaseByTenancy($id) {
		if (file_exists(LEASE_IMAGE_PATH_RESS. "/lease_" . $id)){
			unlink(LEASE_IMAGE_PATH_RESS ."/lease_" . $id);
		}
		if (file_exists(LEASE_IMAGE_PATH_RESS. "/signing_" . $id)){
			unlink(LEASE_IMAGE_PATH_RESS ."/signing_" . $id);
		}

		return LeaseContentDao::deleteLeaseByTenancy ($id);
	}
	function deleteAllLeaseExcept($id) {
		return LeaseContentDao::deleteAllLeaseExcept ($id);
	}
	function addBlock($selectTenancy, $index, $head, $desc){
		return LeaseContentDao::addBlock ($selectTenancy, $index, $head, $desc);
	}
	function getPageBreak($id) {
		return LeaseContentDao::getPageBreak ($id);
	}
}
