if (empty($idUser) || !fAuthorization::checkACL('geolocation', 'edit')) { exit("No se ha podido acceder a esta secci&oacite;n"); } $id = fRequest::encode('id', 'integer'); if (empty($id)) { exit("Ha ocurrido un error"); } if (!fAuthorization::checkAuthLevel('super')) { $isOwner = fRecordSet::build('EconomicUnit', array('economic_unit_id =' => $id, 'economic_unit_region=' => fSession::get('regs'))); $count = $isxOwner->count() > 0; if (!$count) { header('Location: ' . SITE); } } try { $av = new EconomicUnit($id); } catch (Exception $e) { header("Location: " . SITE); } $av->setEconomicUnitName(fRequest::encode('title', 'string')); //$av->setCreatedAt(date('Y-m-d H:m:s')); $av->setEconomicUnitStreetType(fRequest::encode('type', 'string')); $av->setEconomicUnitLatitude(fRequest::encode('latitude', 'string')); $av->setEconomicUnitLongitude(fRequest::encode('longitude', 'string')); $av->setEconomicUnitDescription(fRequest::encode('description', 'string')); $av->setEconomicUnitStreetName(fRequest::encode('street', 'string')); $av->setEconomicUnitLocationNumber(fRequest::encode('number', 'string')); $av->setEconomicUnitReserve(fRequest::encode('reserve', 'string')); $av->setEconomicUnitPhone(fRequest::encode('phone', 'string')); $av->setEconomicUnitCellphone(fRequest::encode('cellphone', 'string')); $av->setEconomicUnitEmail(fRequest::encode('email', 'string'));
<?php fSession::open(); $idUser = fSession::get(SESSION_ID_USER); if (empty($idUser) || !fAuthorization::checkACL('news', 'delete')) { header('Location: ' . SITE); exit("No se ha podido acceder a esta secci&oacite;n"); } $id = fRequest::encode('id', 'string'); if (strstr($id, ",")) { fORMDatabase::retrieve()->query("DELETE FROM economic_units WHERE economic_unit_id IN ({$id})"); } else { $author = new EconomicUnit($id); $author->delete(); } fORMDatabase::retrieve()->query("DELETE FROM economic_units_has_economic_unit_categories WHERE economic_units_economic_unit_id IN ({$id})");
header('Location: ' . SITE); exit("No se ha podido acceder a esta secci&oacite;n"); } $id = fRequest::encode('id', 'integer'); if (empty($id)) { header("Location: " . SITE); } if (!fAuthorization::checkAuthLevel('super')) { $isOwner = fRecordSet::build('EconomicUnit', array('economic_unit_id =' => $id)); $count = $isxOwner->count() > 0; if (!$count) { header('Location: ' . SITE); } } try { $e = new EconomicUnit($id); } catch (Exception $e) { header("Location: " . SITE); } require_once INCLUDES . 'header.php'; ?> <link rel="stylesheet" href="<?php echo CSS; ?> ui-lightness/jquery-ui-1.8.16.custom.css" type="text/css" /> <link rel="stylesheet" href="<?php echo JS; ?> jwysiwyg/jquery.wysiwyg.css" type="text/css" />