Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • fabcat/vmap
1 result
Select Git revision
Loading items
Show changes
Showing
with 4401 additions and 0 deletions
<?php
/**
* \file Composants.class.inc
* \class Composants
*
* \author Armand Bahi <armand.bahi@veremes.com>.
*
* \brief This file contains the Composants php class
*
* This class defines Rest Api to Vitis Composants
*
*/
require_once __DIR__ . '/Anc.class.inc';
require_once 'Composant.class.inc';
class Composants extends Anc {
/**
* @SWG\Definition(
* definition="/composants",
* allOf={
* @SWG\Schema(ref="#/definitions/composants")
* }
* )
* * @SWG\Tag(
* name="Composants",
* description="Operations about Composants"
* )
*/
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
*/
function __construct($aPath, $aValues, $properties) {
$this->aValues = $aValues;
$this->aPath = $aPath;
$this->aProperties = $properties;
$this->oConnection = new Connection($this->aValues, $this->aProperties);
$this->aSelectedFields = Array( "id_installation", "id_controle", "id_composant", "composant_type", "label", "observations", "size", "rotation", "feature_style_id", "draw_color", "draw_outline_color", "draw_size", "draw_dash", "draw_symbol", "draw_rotation", "image", "text_font", "text_color", "text_outline_color", "text_size", "text_outline_size", "text_offset_x", "text_offset_y", "text_rotation", "text_text", "ST_AsGeoJSON(ST_Transform(geom, 4326)) as geom");
}
/**
* @SWG\Get(path="/composants",
* tags={"Composants"},
* summary="Get Composants",
* description="Request to get Composants",
* operationId="GET",
* produces={"application/xml", "application/json", "application/x-vm-json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="order_by",
* in="query",
* description="list of ordering fields",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="sort_order",
* in="query",
* description="sort_order",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="limit",
* in="query",
* description="number of element",
* required=false,
* type="integer",
* format="int32"
* ),
* @SWG\Parameter(
* name="offset",
* in="query",
* description="index of first element",
* required=false,
* type="string",
* format="int32"
* ),
* @SWG\Parameter(
* name="attributs",
* in="query",
* description="list of attributs",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="filter",
* in="query",
* description="filter results",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="distinct",
* in="query",
* description="delete duplicates",
* required=false,
* type="boolean"
* ),
* @SWG\Response(
* response=200,
* description="composant Response",
* @SWG\Schema(ref="#/definitions/composants")
* )
* )
*/
/**
* get Composants
* @return Composants
*/
function GET() {
$aReturn = $this->genericGet($this->aProperties['schema_anc'], "v_composant", "id_composant");
$sMessage = $aReturn['sMessage'];
return $sMessage;
}
/**
* @SWG\Post(path="/composants",
* tags={"Composants"},
* summary="Add composant",
* description="Request to add Composants",
* operationId="POST",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="composant Response",
* @SWG\Schema(ref="#/definitions/composants")
* )
* )
*/
/**
* insert composant
* @return id of the composant created
*/
function POST() {
$aReturn = $this->genericPost($this->aProperties['schema_anc'], 'v_composant', null, 'id_composant');
return $aReturn['sMessage'];
}
/**
* @SWG\Put(path="/composants/{id_composant}",
* tags={"Composants"},
* summary="update Composants",
* description="Request to update Composants",
* operationId="PUT",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="Composant token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="id_composant",
* in="path",
* description="id of the Composants",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/composants")
* )
* )
*/
/**
* update composants
* @return id of composants updated or error object if a composants is not updated
*/
function PUT() {
$aReturn = $this->genericPut($this->aProperties['schema_anc'], 'v_composant', 'id_composant');
return $aReturn['sMessage'];
}
/**
* @SWG\Delete(path="/composants",
* tags={"Composants"},
* summary="delete Composants",
* description="Request to delete Composants",
* operationId="DELETE",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="idList",
* in="query",
* description="id of the composant",
* required=true,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="composant Response",
* @SWG\Schema(ref="#/definitions/composants")
* )
* )
*/
/**
* @SWG\Delete(path="/composants/{id_composant}",
* tags={"Composants"},
* summary="delete Composants",
* description="Request to delete Composants",
* operationId="DELETE",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="Composant token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="id_composant",
* in="path",
* description="id of the Composants",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/composants")
* )
* )
*/
/**
* delete composants
* @return id of composants deleted or error object if a composants is not deleted
*/
function DELETE() {
$aReturn = $this->genericDelete($this->aProperties['schema_anc'], 'v_composant', 'id_composant');
return $aReturn['sMessage'];
}
}
?>
\ No newline at end of file
<?php
require_once __DIR__ . '/Anc.class.inc';
require_once __DIR__ . '/Composants.class.inc';
require_once __DIR__ . '/ComposantTypeFeatureStyles.class.inc';
require_once dirname($_SERVER['SCRIPT_FILENAME']) . '/class/vitis_lib/Connection.class.inc';
/**
* \file Controle.class.inc
* \class Controle
*
* \author WAB <support.wab@veremes.com>.
*
* \brief This file contains the Controle php class
*
* This class defines operation for one Controle
*
*/
class Controle extends Anc {
public $oError;
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
* @param type $oConnection connection object
*/
function __construct($aPath, $aValues, $properties) {
$this->aValues = $aValues;
$this->aPath = $aPath;
$this->aProperties = $properties;
$this->oConnection = new Connection($this->aValues, $this->aProperties);
$this->oFilesManager = new Files_manager($this->aProperties);
}
/**
* @SWG\Get(path="/controles/{id_controle}",
* tags={"Controles"},
* summary="Get Controle",
* description="Request to get Controle by id",
* operationId="GET",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="id_controle",
* in="path",
* description="id_controle",
* required=true,
* type="integer",
* format="int32"
* ),
* @SWG\Parameter(
* name="attributs",
* in="query",
* description="list of attributs",
* required=false,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="Controle Response",
* @SWG\Schema(ref="#/definitions/controles")
* )
* )
*/
/**
* get informations about mode
*/
function GET() {
$this->aFields = $this->getFields($this->aProperties['schema_anc'], 'v_controle', 'id_controle', 'anc_saisie_anc_controle', $this->aProperties['anc']['files_container']);
// Champ sur lequel sera fait le typage pour changer les styles etc..
$this->sTyleField = 'composant_type';
// custom_form du controle pour map_workbench
$this->getCustomFormInfos();
// Composants du controle
$this->getComposants();
}
/**
* Récupère au format GeoJSON les composants à afficher
*/
function getComposants() {
$aPath = array('anc', 'composants');
$aValues = $this->aValues;
unset($aValues['my_vitis_id']);
unset($aValues['attributs']);
//$aValues['attributs'] = 'composant_type|label|observations||geom';
$aValues['filter'] = '{"column":"id_controle","compare_operator":"=","value":"' . $this->aFields['id_controle'] . '"}';
$oComposants = new Composants($aPath, $aValues, $this->aProperties, $this->oConnection);
$oComposants->GET();
$aComposants = array();
if (!empty($oComposants->aObjects)) {
for ($i = 0; $i < count($oComposants->aObjects); $i++) {
if (!empty($oComposants->aObjects[$i]->aFields)) {
array_push($aComposants, $oComposants->aObjects[$i]->aFields);
}
}
}
$aFeatures = array();
for ($i = 0; $i < count($aComposants); $i++) {
if (!empty($aComposants[$i]['geom'])) {
$aGeom = json_decode($aComposants[$i]['geom'], true);
$aAttributes = $aComposants[$i];
unset($aAttributes['geom']);
$aTmpFeature = array(
'type' => 'Feature',
'geometry' => $aGeom,
'properties' => array(
'style' => $this->getGeoJSONStyle($aAttributes),
'attributes' => $aAttributes
)
);
array_push($aFeatures, $aTmpFeature);
}
}
if (!empty($aFeatures)) {
$this->aFields['composants'] = json_encode(array(
'type' => 'FeatureCollection',
'features' => $aFeatures
));
}
}
/**
* Récupère les informations à merger dans le custom_form
*/
function getCustomFormInfos() {
$aPath = array('anc', 'composanttypefeaturestyles');
$aValues = $this->aValues;
unset($aValues['my_vitis_id']);
unset($aValues['filter']);
unset($aValues['attributs']);
$oComposantTypeFeatureStyles = new ComposantTypeFeatureStyles($aPath, $aValues, $this->aProperties, $this->oConnection);
$oComposantTypeFeatureStyles->GET();
if (!empty($oComposantTypeFeatureStyles->aObjects)) {
$this->aFields['custom_form'] = array(
'featureStructure' => array(
'field' => $this->sTyleField,
'types' => array()
)
);
for ($i = 0; $i < count($oComposantTypeFeatureStyles->aObjects); $i++) {
if (!empty($oComposantTypeFeatureStyles->aObjects[$i]->aFields)) {
$aStyle = $oComposantTypeFeatureStyles->aObjects[$i]->aFields;
if (!empty($aStyle[$this->sTyleField])) {
$this->aFields['custom_form']['featureStructure']['types'][$aStyle[$this->sTyleField]] = array(
'style' => $this->getGeoJSONStyle($aStyle),
'geometryType' => $aStyle['feature_type']
);
}
}
}
}
}
/**
* Returns a GeoJSON format style from an array format style
* @param array $aStyle
* @return array
*/
function getGeoJSONStyle($aStyle) {
$aGeoJSONStyle = array(
'draw' => array(),
'text' => array()
);
// Draw
if (!empty($aStyle['draw_color'])) {
$aGeoJSONStyle['draw']['color'] = $aStyle['draw_color'];
}
if (!empty($aStyle['draw_outline_color'])) {
$aGeoJSONStyle['draw']['outline_color'] = $aStyle['draw_outline_color'];
}
if (!empty($aStyle['draw_size'])) {
$aGeoJSONStyle['draw']['size'] = $aStyle['draw_size'];
}
if (!empty($aStyle['draw_dash'])) {
$aGeoJSONStyle['draw']['dash'] = $aStyle['draw_dash'];
}
if (!empty($aStyle['draw_symbol'])) {
$aGeoJSONStyle['draw']['symbol'] = $aStyle['draw_symbol'];
}
if (!empty($aStyle['draw_rotation'])) {
$aGeoJSONStyle['draw']['rotation'] = $aStyle['draw_rotation'];
}
if (!empty($aStyle['image'])) {
$aGeoJSONStyle['draw']['image'] = $aStyle['image'];
}
// Text
if (!empty($aStyle['text_font'])) {
$aGeoJSONStyle['text']['font'] = $aStyle['text_font'];
}
if (!empty($aStyle['text_color'])) {
$aGeoJSONStyle['text']['color'] = $aStyle['text_color'];
}
if (!empty($aStyle['text_outline_color'])) {
$aGeoJSONStyle['text']['outline_color'] = $aStyle['text_outline_color'];
}
if (!empty($aStyle['text_size'])) {
$aGeoJSONStyle['text']['size'] = $aStyle['text_size'];
}
if (!empty($aStyle['text_outline_size'])) {
$aGeoJSONStyle['text']['outline_size'] = $aStyle['text_outline_size'];
}
if (!empty($aStyle['text_offset_x'])) {
$aGeoJSONStyle['text']['offsetX'] = $aStyle['text_offset_x'];
}
if (!empty($aStyle['text_offset_y'])) {
$aGeoJSONStyle['text']['offsetY'] = $aStyle['text_offset_y'];
}
if (!empty($aStyle['text_rotation'])) {
$aGeoJSONStyle['text']['rotation'] = $aStyle['text_rotation'];
}
if (!empty($aStyle['text_text'])) {
$aGeoJSONStyle['text']['text'] = $aStyle['text_text'];
}
// Vide draw ou text si ils sont vides
if (empty($aGeoJSONStyle['draw'])) {
unset($aGeoJSONStyle['draw']);
}
if (empty($aGeoJSONStyle['text'])) {
unset($aGeoJSONStyle['text']);
}
return $aGeoJSONStyle;
}
/**
* delete a Point_situation
*/
function DELETE() {
$this->oConnection->oBd->delete($this->aProperties['schema_anc'], 'v_controle', 'id_controle', $this->aValues["my_vitis_id"], 'integer');
if ($this->oConnection->oBd->enErreur()) {
$this->oError = new VitisError(1, $this->oConnection->oBd->getBDMessage());
} else {
$this->aFields["id_controle"] = $this->aValues["my_vitis_id"];
}
}
}
?>
<?php
/**
* \file Controles.class.inc
* \class Controles
*
* \author WAB <support.wab@veremes.com>.
*
* \brief This file contains the Controles php class
*
* This class defines Rest Api to Vitis Controles
*
*/
require_once __DIR__ . '/Anc.class.inc';
require_once 'Controle.class.inc';
require_once 'Evacuation_eauxs.class.inc';
require_once 'Filieres_agrees.class.inc';
require_once 'Pretraitements.class.inc';
require_once 'Traitements.class.inc';
require_once 'Composants.class.inc';
class Controles extends Anc {
/**
* @SWG\Definition(
* definition="/controles",
* allOf={
* @SWG\Schema(ref="#/definitions/controles")
* }
* )
* * @SWG\Tag(
* name="Controles",
* description="Operations about Controles"
* )
*/
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
*/
function __construct($aPath, $aValues, $properties) {
$this->aValues = $aValues;
$this->aPath = $aPath;
$this->aProperties = $properties;
$this->oConnection = new Connection($this->aValues, $this->aProperties);
$this->oFilesManager = new Files_manager($this->aProperties);
}
/**
* @SWG\Get(path="/controles",
* tags={"Controles"},
* summary="Get Controles",
* description="Request to get Controles",
* operationId="GET",
* produces={"application/xml", "application/json", "application/x-vm-json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="order_by",
* in="query",
* description="list of ordering fields",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="sort_order",
* in="query",
* description="sort_order",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="limit",
* in="query",
* description="number of element",
* required=false,
* type="integer",
* format="int32"
* ),
* @SWG\Parameter(
* name="offset",
* in="query",
* description="index of first element",
* required=false,
* type="string",
* format="int32"
* ),
* @SWG\Parameter(
* name="attributs",
* in="query",
* description="list of attributs",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="filter",
* in="query",
* description="filter results",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="distinct",
* in="query",
* description="delete duplicates",
* required=false,
* type="boolean"
* ),
* @SWG\Response(
* response=200,
* description="controle Response",
* @SWG\Schema(ref="#/definitions/controles")
* )
* )
*/
/**
* get Controles
* @return Controles
*/
function GET() {
$aReturn = $this->genericGet($this->aProperties['schema_anc'], "v_controle", "id_controle");
$sMessage = $aReturn['sMessage'];
return $sMessage;
}
/**
* @SWG\Post(path="/controles",
* tags={"Controles"},
* summary="Add controle",
* description="Request to add Controles",
* operationId="POST",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="controle Response",
* @SWG\Schema(ref="#/definitions/controles")
* )
* )
*/
/**
* insert controle
* @return id of the controle created
*/
function POST() {
$this->aValues['create'] = $_SESSION["ses_Login"];
$this->aValues['create_date'] = date('Y-m-d');
//if (empty($this->aValues['des_date_control']))
//$this->aValues['des_date_control'] = date('Y-m-d');
if (empty($this->aValues['des_interval_control']))
$this->aValues['des_interval_control'] = 0;
// Conversion des dates
$aDates = array('cl_date_avis', 'cl_facture_le', 'des_date_installation', 'des_date_recommande', 'dep_date_depot', 'dep_date_envoi_incomplet', 'des_date_control');
foreach ($aDates as $sDate) {
if (isset($this->aValues[$sDate])) {
if ($this->aValues[$sDate] == '')
unset($this->aValues[$sDate]);
else
$this->aValues[$sDate] = date_format(date_create_from_format('d/m/Y', $this->aValues[$sDate]), 'Y-m-d');
}
}
// Fichiers à uploader
$aUploadFiles = array(
'photos_f' => [],
'fiche_f' => [],
'rapport_f' => [],
'schema_f' => [],
'documents_f' => [],
'plan_f' => []
);
// Envoi Post
$aReturn = $this->genericPost($this->aProperties['schema_anc'], 'v_controle', $this->aProperties['schema_anc'] . '.controle_id_controle_seq', 'id_controle', $aUploadFiles, 'anc_saisie_anc_controle', $this->aProperties['anc']['files_container']);
return $aReturn['sMessage'];
}
/**
* @SWG\Put(path="/controles/{id_controle}",
* tags={"Controles"},
* summary="update Controles",
* description="Request to update Controles",
* operationId="PUT",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="Controle token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="id_controle",
* in="path",
* description="id of the Controles",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/controles")
* )
* )
*/
/**
* update controles
* @return id of controles updated or error object if a controles is not updated
*/
function PUT() {
if (empty($this->aValues['maj']))
$this->aValues['maj'] = $_SESSION["ses_Login"];
if (empty($this->aValues['maj_date']))
$this->aValues['maj_date'] = date('Y-m-d');
// Si il y a des composants à ajouter/supprimer/mettre à jour
if (!empty($this->aValues['composants'])) {
// Supprime les composants liés au controle
$this->deleteControleComposants($this->aPath[2]);
// Récupère les composants au bon format
$aComposants = $this->getTableFormedComposants(json_decode($this->aValues['composants'], true));
// Inserre les composants
$this->createComposants($aComposants);
}
// Conversion des dates
$aDates = array('cl_date_avis', 'cl_facture_le', 'des_date_control', 'des_date_installation', 'des_date_recommande', 'dep_date_depot', 'dep_date_envoi_incomplet');
foreach ($aDates as $sDate) {
if (isset($this->aValues[$sDate])) {
if ($this->aValues[$sDate] == '')
unset($this->aValues[$sDate]);
else
$this->aValues[$sDate] = date_format(date_create_from_format('d/m/Y', $this->aValues[$sDate]), 'Y-m-d');
}
}
// Fichiers à uploader
$aUploadFiles = array(
'photos_f' => [],
'fiche_f' => [],
'rapport_f' => [],
'schema_f' => [],
'documents_f' => [],
'plan_f' => []
);
// Mise à jour
$aReturn = $this->genericPut($this->aProperties['schema_anc'], 'v_controle', 'id_controle', $aUploadFiles, 'anc_saisie_anc_controle', $this->aProperties['anc']['files_container']);
return $aReturn['sMessage'];
}
/**
* Get the composant on table format
* @param array $aGeoJSONComposants
* @return array
*/
function getTableFormedComposants($aGeoJSONComposants) {
$aComposants = array();
for ($i = 0; $i < count($aGeoJSONComposants['features']); $i++) {
$aTmpComposant = array();
// Récupère la géométrie en EWKT
if (!empty($aGeoJSONComposants['features'][$i]['geometry'])) {
$sSql = 'SELECT ST_AsEWKT(ST_SetSRID(ST_GeomFromGeoJSON([geom]), 4326)) as ewktgeom';
$aSQLParams = array('geom' => array('value' => json_encode($aGeoJSONComposants['features'][$i]['geometry']), 'type' => 'geometry'));
$oPDOresult = $this->oConnection->oBd->executeWithParams($sSql, $aSQLParams);
if (!$this->oConnection->oBd->enErreur()) {
while ($aLine = $this->oConnection->oBd->ligneSuivante($oPDOresult)) {
$aTmpComposant['geom'] = $aLine['ewktgeom'];
}
}
}
if (!empty($aGeoJSONComposants['features'][$i]['properties'])) {
if (!empty($aGeoJSONComposants['features'][$i]['properties']['attributes'])) {
foreach ($aGeoJSONComposants['features'][$i]['properties']['attributes'] as $key => $value) {
$aTmpComposant[$key] = $value;
}
}
if (!empty($aGeoJSONComposants['features'][$i]['properties']['style'])) {
if (!empty($aGeoJSONComposants['features'][$i]['properties']['style']['draw'])) {
foreach ($aGeoJSONComposants['features'][$i]['properties']['style']['draw'] as $key => $value) {
$aTmpComposant['draw_' . $key] = $value;
}
}
if (!empty($aGeoJSONComposants['features'][$i]['properties']['style']['text'])) {
foreach ($aGeoJSONComposants['features'][$i]['properties']['style']['text'] as $key => $value) {
$aTmpComposant['text_' . $key] = $value;
}
}
}
}
array_push($aComposants, $aTmpComposant);
}
return $aComposants;
}
/**
* Insert the composants defined in $aComposants
* @param array $aComposants
*/
function createComposants($aComposants) {
for ($i = 0; $i < count($aComposants); $i++) {
$aPath = array('anc', 'composants');
$aValues = array(
'token' => $this->aValues['token'],
'output' => $this->aValues['output'],
'sEncoding' => $this->aValues['sEncoding'],
'sSourceEncoding' => $this->aValues['sSourceEncoding'],
'xslstylesheet' => $this->aValues['xslstylesheet'],
'module' => $this->aValues['module'],
'id_controle' => $this->aPath[2]
);
$aValues = array_merge($aValues, $aComposants[$i]);
$oComposants = new Composants($aPath, $aValues, $this->aProperties, $this->oConnection);
$oComposants->POST();
}
}
/**
* @SWG\Delete(path="/controles",
* tags={"Controles"},
* summary="delete Controles",
* description="Request to delete Controles",
* operationId="DELETE",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="idList",
* in="query",
* description="id of the controle",
* required=true,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="controle Response",
* @SWG\Schema(ref="#/definitions/controles")
* )
* )
*/
/**
* @SWG\Delete(path="/controles/{id_controle}",
* tags={"Controles"},
* summary="delete Controles",
* description="Request to delete Controles",
* operationId="DELETE",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="Controle token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="id_controle",
* in="path",
* description="id of the Controles",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/controles")
* )
* )
*/
/**
* delete controles
* @return id of controles deleted or error object if a controles is not deleted
*/
function DELETE() {
require $this->sRessourcesFile;
// Supprime les objets dépendants
$this->deleteControleDependencies($this->aValues['idList']);
$aReturn = $this->genericDelete($this->aProperties['schema_anc'], 'v_controle', 'id_controle');
return $aReturn['sMessage'];
}
/**
* Delete the controle dependencies
* @param string $sIdControles
*/
function deleteControleDependencies($sIdControles) {
// Suppression dpépendance s_anc.evacuation_eaux
$this->deleteControleEvacuationEaux($sIdControles);
// Suppression dpépendance s_anc.filieres_agrees
$this->deleteControleFilieresAgrees($sIdControles);
// Suppression dpépendance s_anc.pretraitement
$this->deleteControlePretraitements($sIdControles);
// Suppression dpépendance s_anc.traitement
$this->deleteControleTraitements($sIdControles);
// Suppression dpépendance s_anc.composant
$this->deleteControleComposants($sIdControles);
}
/**
* Get the composant's evacuationEaux
* @param string $sIdControles
* @return array|null
*/
function getControleEvacuationEaux($sIdControles) {
require $this->sRessourcesFile;
$aParams = array();
$aParams['sSchemaAnc'] = array('value' => $this->aProperties['schema_anc'], 'type' => 'schema_name');
$aParams['idList'] = array('value' => $sIdControles, 'type' => 'group');
$oPDOresult = $this->oConnection->oBd->executeWithParams($aSql['getControleEvacuationEaux'], $aParams);
if ($this->oConnection->oBd->enErreur()) {
return null;
} else {
$aEvacuationEaux = $this->oConnection->oBd->getResultTableAssoc($oPDOresult);
return $aEvacuationEaux;
}
}
/**
* Get the composant's FilieresAgrees
* @param string $sIdControles
* @return array|null
*/
function getControleFilieresAgrees($sIdControles) {
require $this->sRessourcesFile;
$aParams = array();
$aParams['sSchemaAnc'] = array('value' => $this->aProperties['schema_anc'], 'type' => 'schema_name');
$aParams['idList'] = array('value' => $sIdControles, 'type' => 'group');
$oPDOresult = $this->oConnection->oBd->executeWithParams($aSql['getControleFilieresAgrees'], $aParams);
if ($this->oConnection->oBd->enErreur()) {
return null;
} else {
$aFilieresAgrees = $this->oConnection->oBd->getResultTableAssoc($oPDOresult);
return $aFilieresAgrees;
}
}
/**
* Get the composant's Pretraitement
* @param string $sIdControles
* @return array|null
*/
function getControlePretraitements($sIdControles) {
require $this->sRessourcesFile;
$aParams = array();
$aParams['sSchemaAnc'] = array('value' => $this->aProperties['schema_anc'], 'type' => 'schema_name');
$aParams['idList'] = array('value' => $sIdControles, 'type' => 'group');
$oPDOresult = $this->oConnection->oBd->executeWithParams($aSql['getControlePretraitements'], $aParams);
if ($this->oConnection->oBd->enErreur()) {
return null;
} else {
$aPretraitement = $this->oConnection->oBd->getResultTableAssoc($oPDOresult);
return $aPretraitement;
}
}
/**
* Get the composant's Traitement
* @param string $sIdControles
* @return array|null
*/
function getControleTraitements($sIdControles) {
require $this->sRessourcesFile;
$aParams = array();
$aParams['sSchemaAnc'] = array('value' => $this->aProperties['schema_anc'], 'type' => 'schema_name');
$aParams['idList'] = array('value' => $sIdControles, 'type' => 'group');
$oPDOresult = $this->oConnection->oBd->executeWithParams($aSql['getControleTraitements'], $aParams);
if ($this->oConnection->oBd->enErreur()) {
return null;
} else {
$aTraitement = $this->oConnection->oBd->getResultTableAssoc($oPDOresult);
return $aTraitement;
}
}
/**
* Get the composant's Composant
* @param string $sIdControles
* @return array|null
*/
function getControleComposants($sIdControles) {
require $this->sRessourcesFile;
$aParams = array();
$aParams['sSchemaAnc'] = array('value' => $this->aProperties['schema_anc'], 'type' => 'schema_name');
$aParams['idList'] = array('value' => $sIdControles, 'type' => 'group');
$oPDOresult = $this->oConnection->oBd->executeWithParams($aSql['getControleComposants'], $aParams);
if ($this->oConnection->oBd->enErreur()) {
return null;
} else {
$aComposant = $this->oConnection->oBd->getResultTableAssoc($oPDOresult);
return $aComposant;
}
}
/**
* Delete the composant's EvacuationEaux
* @param string $sIdControles
*/
function deleteControleEvacuationEaux($sIdControles) {
$aEvacuationEaux = $this->getControleEvacuationEaux($sIdControles);
if (!empty($aEvacuationEaux)) {
if (count($aEvacuationEaux) > 0) {
$sIdList = '';
$aIdList = array();
for ($i = 0; $i < count($aEvacuationEaux); $i++) {
if (!empty($aEvacuationEaux[$i]['id_eva'])) {
array_push($aIdList, $aEvacuationEaux[$i]['id_eva']);
}
}
$sIdList = join('|', $aIdList);
$aPath = array('anc', 'evacuation_eauxs');
$aValues = array(
'token' => $this->aValues['token'],
'output' => $this->aValues['output'],
'sEncoding' => $this->aValues['sEncoding'],
'sSourceEncoding' => $this->aValues['sSourceEncoding'],
'xslstylesheet' => $this->aValues['xslstylesheet'],
'module' => $this->aValues['module'],
'idList' => $sIdList,
);
$oComposants = new Evacuation_eauxs($aPath, $aValues, $this->aProperties, $this->oConnection);
$oComposants->DELETE();
}
}
}
/**
* Delete the composant's FilieresAgrees
* @param string $sIdControles
*/
function deleteControleFilieresAgrees($sIdControles) {
$aFilieresAgrees = $this->getControleFilieresAgrees($sIdControles);
if (!empty($aFilieresAgrees)) {
if (count($aFilieresAgrees) > 0) {
$sIdList = '';
$aIdList = array();
for ($i = 0; $i < count($aFilieresAgrees); $i++) {
if (!empty($aFilieresAgrees[$i]['id_fag'])) {
array_push($aIdList, $aFilieresAgrees[$i]['id_fag']);
}
}
$sIdList = join('|', $aIdList);
$aPath = array('anc', 'evacuation_eauxs');
$aValues = array(
'token' => $this->aValues['token'],
'output' => $this->aValues['output'],
'sEncoding' => $this->aValues['sEncoding'],
'sSourceEncoding' => $this->aValues['sSourceEncoding'],
'xslstylesheet' => $this->aValues['xslstylesheet'],
'module' => $this->aValues['module'],
'idList' => $sIdList,
);
$oComposants = new Filieres_agrees($aPath, $aValues, $this->aProperties, $this->oConnection);
$oComposants->DELETE();
}
}
}
/**
* Delete the composant's Pretraitement
* @param string $sIdControles
*/
function deleteControlePretraitements($sIdControles) {
$aPretraitement = $this->getControlePretraitements($sIdControles);
if (!empty($aPretraitement)) {
if (count($aPretraitement) > 0) {
$sIdList = '';
$aIdList = array();
for ($i = 0; $i < count($aPretraitement); $i++) {
if (!empty($aPretraitement[$i]['id_pretraitement'])) {
array_push($aIdList, $aPretraitement[$i]['id_pretraitement']);
}
}
$sIdList = join('|', $aIdList);
$aPath = array('anc', 'evacuation_eauxs');
$aValues = array(
'token' => $this->aValues['token'],
'output' => $this->aValues['output'],
'sEncoding' => $this->aValues['sEncoding'],
'sSourceEncoding' => $this->aValues['sSourceEncoding'],
'xslstylesheet' => $this->aValues['xslstylesheet'],
'module' => $this->aValues['module'],
'idList' => $sIdList,
);
$oComposants = new Pretraitements($aPath, $aValues, $this->aProperties, $this->oConnection);
$oComposants->DELETE();
}
}
}
/**
* Delete the composant's Traitement
* @param string $sIdControles
*/
function deleteControleTraitements($sIdControles) {
$aTraitement = $this->getControleTraitements($sIdControles);
if (!empty($aTraitement)) {
if (count($aTraitement) > 0) {
$sIdList = '';
$aIdList = array();
for ($i = 0; $i < count($aTraitement); $i++) {
if (!empty($aTraitement[$i]['id_traitement'])) {
array_push($aIdList, $aTraitement[$i]['id_traitement']);
}
}
$sIdList = join('|', $aIdList);
$aPath = array('anc', 'evacuation_eauxs');
$aValues = array(
'token' => $this->aValues['token'],
'output' => $this->aValues['output'],
'sEncoding' => $this->aValues['sEncoding'],
'sSourceEncoding' => $this->aValues['sSourceEncoding'],
'xslstylesheet' => $this->aValues['xslstylesheet'],
'module' => $this->aValues['module'],
'idList' => $sIdList,
);
$oComposants = new Traitements($aPath, $aValues, $this->aProperties, $this->oConnection);
$oComposants->DELETE();
}
}
}
/**
* Delete the composant's Composant
* @param string $sIdControles
*/
function deleteControleComposants($sIdControles) {
$aComposant = $this->getControleComposants($sIdControles);
if (!empty($aComposant)) {
if (count($aComposant) > 0) {
$sIdList = '';
$aIdList = array();
for ($i = 0; $i < count($aComposant); $i++) {
if (!empty($aComposant[$i]['id_composant'])) {
array_push($aIdList, $aComposant[$i]['id_composant']);
}
}
$sIdList = join('|', $aIdList);
$aPath = array('anc', 'evacuation_eauxs');
$aValues = array(
'token' => $this->aValues['token'],
'output' => $this->aValues['output'],
'sEncoding' => $this->aValues['sEncoding'],
'sSourceEncoding' => $this->aValues['sSourceEncoding'],
'xslstylesheet' => $this->aValues['xslstylesheet'],
'module' => $this->aValues['module'],
'idList' => $sIdList,
);
$oComposants = new Composants($aPath, $aValues, $this->aProperties, $this->oConnection);
$oComposants->DELETE();
}
}
}
}
?>
<?php
require_once __DIR__ . '/Anc.class.inc';
require_once dirname($_SERVER['SCRIPT_FILENAME']) . '/class/vitis_lib/Connection.class.inc';
/**
* \file Entreprise.class.inc
* \class Entreprise
*
* \author WAB <support.wab@veremes.com>.
*
* \brief This file contains the Entreprise php class
*
* This class defines operation for one Entreprise
*
*/
class Entreprise extends Anc {
public $oError;
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
* @param type $oConnection connection object
*/
function __construct($aPath, $aValues, $properties) {
$this->aValues = $aValues;
$this->aPath = $aPath;
$this->aProperties = $properties;
$this->oConnection = new Connection($this->aValues, $this->aProperties);
$this->aSelectedFields = Array("id_parametre_entreprises", "commune", "siret", "raison_sociale", "nom_entreprise", "nom_contact", "telephone_fixe", "telephone_mobile", "web", "mail", "code_postal", "voie", "bureau_etude", "concepteur", "constructeur", "installateur", "vidangeur", "en_activite", "observations", "creat", "creat_date", "maj", "maj_date", "geom");
}
/**
* @SWG\Get(path="/entreprises/{id_entreprise}",
* tags={"Entreprises"},
* summary="Get Entreprise",
* description="Request to get Entreprise by id",
* operationId="GET",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="id_entreprise",
* in="path",
* description="id_entreprise",
* required=true,
* type="integer",
* format="int32"
* ),
* @SWG\Parameter(
* name="attributs",
* in="query",
* description="list of attributs",
* required=false,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="Entreprise Response",
* @SWG\Schema(ref="#/definitions/entreprises")
* )
* )
*/
/**
* get informations about mode
*/
function GET() {
$this->aFields = $this->getFields($this->aProperties['schema_anc'], "param_entreprise", "id_parametre_entreprises");
}
/**
* delete a Point_situation
*/
function DELETE() {
$this->oConnection->oBd->delete($this->aProperties['schema_anc'], 'param_entreprise', 'id_parametre_entreprises', $this->aValues["my_vitis_id"], 'integer');
if ($this->oConnection->oBd->enErreur()) {
$this->oError = new VitisError(1, $this->oConnection->oBd->getBDMessage());
} else {
$this->aFields["id_parametre_entreprises"] = $this->aValues["my_vitis_id"];
}
}
}
?>
<?php
/**
* \file Entreprises.class.inc
* \class Entreprises
*
* \author WAB <support.wab@veremes.com>.
*
* \brief This file contains the Entreprises php class
*
* This class defines Rest Api to Vitis Entreprises
*
*/
require_once __DIR__ . '/Anc.class.inc';
require_once 'Entreprise.class.inc';
class Entreprises extends Anc {
/**
* @SWG\Definition(
* definition="/entreprises",
* allOf={
* @SWG\Schema(ref="#/definitions/entreprises")
* }
* )
* * @SWG\Tag(
* name="Entreprises",
* description="Operations about Entreprises"
* )
*/
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
*/
function __construct($aPath, $aValues, $properties) {
$this->aValues = $aValues;
$this->aPath = $aPath;
$this->aProperties = $properties;
$this->oConnection = new Connection($this->aValues, $this->aProperties);
$this->aSelectedFields = Array("id_parametre_entreprises", "commune", "siret", "raison_sociale", "nom_entreprise", "nom_contact", "telephone_fixe", "telephone_mobile", "web", "mail", "code_postal", "voie", "bureau_etude", "concepteur", "constructeur", "installateur", "vidangeur", "en_activite", "observations", "creat", "creat_date", "maj", "maj_date", "geom");
}
/**
* @SWG\Get(path="/entreprises",
* tags={"Entreprises"},
* summary="Get Entreprises",
* description="Request to get Entreprises",
* operationId="GET",
* produces={"application/xml", "application/json", "application/x-vm-json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="order_by",
* in="query",
* description="list of ordering fields",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="sort_order",
* in="query",
* description="sort_order",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="limit",
* in="query",
* description="number of element",
* required=false,
* type="integer",
* format="int32"
* ),
* @SWG\Parameter(
* name="offset",
* in="query",
* description="index of first element",
* required=false,
* type="string",
* format="int32"
* ),
* @SWG\Parameter(
* name="attributs",
* in="query",
* description="list of attributs",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="filter",
* in="query",
* description="filter results",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="distinct",
* in="query",
* description="delete duplicates",
* required=false,
* type="boolean"
* ),
* @SWG\Response(
* response=200,
* description="entreprise Response",
* @SWG\Schema(ref="#/definitions/entreprises")
* )
* )
*/
/**
* get Entreprises
* @return Entreprises
*/
function GET() {
$aReturn = $this->genericGet($this->aProperties['schema_anc'], "param_entreprise", "id_parametre_entreprises");
$sMessage = $aReturn['sMessage'];
return $sMessage;
}
/**
* @SWG\Post(path="/entreprises",
* tags={"Entreprises"},
* summary="Add entreprise",
* description="Request to add Entreprises",
* operationId="POST",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="entreprise Response",
* @SWG\Schema(ref="#/definitions/entreprises")
* )
* )
*/
/**
* insert entreprise
* @return id of the entreprise created
*/
function POST() {
$this->aValues['creat'] = $_SESSION["ses_Login"];
$this->aValues['creat_date'] = date('Y-m-d');
$aReturn = $this->genericPost($this->aProperties['schema_anc'], 'param_entreprise', $this->aProperties['schema_anc'].'.param_entreprise_id_parametre_entreprises_seq', 'id_parametre_entreprises');
return $aReturn['sMessage'];
}
/**
* @SWG\Put(path="/entreprises/{id_entreprise}",
* tags={"Entreprises"},
* summary="update Entreprises",
* description="Request to update Entreprises",
* operationId="PUT",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="Entreprise token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="id_entreprise",
* in="path",
* description="id of the Entreprises",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/entreprises")
* )
* )
*/
/**
* update entreprises
* @return id of entreprises updated or error object if a entreprises is not updated
*/
function PUT() {
if (empty($this->aValues['maj']))
$this->aValues['maj'] = $_SESSION["ses_Login"];
if (empty($this->aValues['maj_date']))
$this->aValues['maj_date'] = date('Y-m-d');
$aReturn = $this->genericPut($this->aProperties['schema_anc'], 'param_entreprise', 'id_parametre_entreprises');
return $aReturn['sMessage'];
}
/**
* @SWG\Delete(path="/entreprises",
* tags={"Entreprises"},
* summary="delete Entreprises",
* description="Request to delete Entreprises",
* operationId="DELETE",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="idList",
* in="query",
* description="id of the entreprise",
* required=true,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="entreprise Response",
* @SWG\Schema(ref="#/definitions/entreprises")
* )
* )
*/
/**
* @SWG\Delete(path="/entreprises/{id_entreprise}",
* tags={"Entreprises"},
* summary="delete Entreprises",
* description="Request to delete Entreprises",
* operationId="DELETE",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="Entreprise token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="id_entreprise",
* in="path",
* description="id of the Entreprises",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/entreprises")
* )
* )
*/
/**
* delete entreprises
* @return id of entreprises deleted or error object if a entreprises is not deleted
*/
function DELETE() {
$aReturn = $this->genericDelete($this->aProperties['schema_anc'], 'param_entreprise', 'id_parametre_entreprises');
return $aReturn['sMessage'];
}
}
?>
<?php
require_once __DIR__ . '/Anc.class.inc';
require_once dirname($_SERVER['SCRIPT_FILENAME']) . '/class/vitis_lib/Connection.class.inc';
/**
* \file Evacuation_eaux.class.inc
* \class Evacuation_eaux
*
* \author WAB <support.wab@veremes.com>.
*
* \brief This file contains the Evacuation_eaux php class
*
* This class defines operation for one Evacuation_eaux
*
*/
class Evacuation_eaux extends Anc {
public $oError;
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
* @param type $oConnection connection object
*/
function __construct($aPath, $aValues, $properties) {
$this->aValues = $aValues;
$this->aPath = $aPath;
$this->aProperties = $properties;
$this->oConnection = new Connection($this->aValues, $this->aProperties);
$this->oFilesManager = new Files_manager($this->aProperties);
}
/**
* @SWG\Get(path="/evacuation_eauxs/{id_evacuation_eaux}",
* tags={"Evacuation_eauxs"},
* summary="Get Evacuation_eaux",
* description="Request to get Evacuation_eaux by id",
* operationId="GET",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="id_evacuation_eaux",
* in="path",
* description="id_evacuation_eaux",
* required=true,
* type="integer",
* format="int32"
* ),
* @SWG\Parameter(
* name="attributs",
* in="query",
* description="list of attributs",
* required=false,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="Evacuation_eaux Response",
* @SWG\Schema(ref="#/definitions/evacuation_eauxs")
* )
* )
*/
/**
* get informations about mode
*/
function GET() {
$this->aFields = $this->getFields($this->aProperties['schema_anc'], 'v_evacuation_eaux', 'id_eva', 'anc_saisie_anc_evacuation_eaux', $this->aProperties['anc']['files_container']);
}
/**
* delete a Point_situation
*/
function DELETE() {
$this->oConnection->oBd->delete($this->aProperties['schema_anc'], 'v_evacuation_eaux', 'id_eva', $this->aValues["my_vitis_id"], 'integer');
if ($this->oConnection->oBd->enErreur()) {
$this->oError = new VitisError(1, $this->oConnection->oBd->getBDMessage());
} else {
$this->aFields["id_eva"] = $this->aValues["my_vitis_id"];
}
}
}
?>
<?php
/**
* \file Evacuation_eauxs.class.inc
* \class Evacuation_eauxs
*
* \author WAB <support.wab@veremes.com>.
*
* \brief This file contains the Evacuation_eauxs php class
*
* This class defines Rest Api to Vitis Evacuation_eauxs
*
*/
require_once __DIR__ . '/Anc.class.inc';
require_once 'Evacuation_eaux.class.inc';
class Evacuation_eauxs extends Anc {
/**
* @SWG\Definition(
* definition="/evacuation_eauxs",
* allOf={
* @SWG\Schema(ref="#/definitions/evacuation_eauxs")
* }
* )
* * @SWG\Tag(
* name="Evacuation_eauxs",
* description="Operations about Evacuation_eauxs"
* )
*/
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
*/
function __construct($aPath, $aValues, $properties) {
$this->aValues = $aValues;
$this->aPath = $aPath;
$this->aProperties = $properties;
$this->oConnection = new Connection($this->aValues, $this->aProperties);
$this->oFilesManager = new Files_manager($this->aProperties);
}
/**
* @SWG\Get(path="/evacuation_eauxs",
* tags={"Evacuation_eauxs"},
* summary="Get Evacuation_eauxs",
* description="Request to get Evacuation_eauxs",
* operationId="GET",
* produces={"application/xml", "application/json", "application/x-vm-json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="order_by",
* in="query",
* description="list of ordering fields",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="sort_order",
* in="query",
* description="sort_order",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="limit",
* in="query",
* description="number of element",
* required=false,
* type="integer",
* format="int32"
* ),
* @SWG\Parameter(
* name="offset",
* in="query",
* description="index of first element",
* required=false,
* type="string",
* format="int32"
* ),
* @SWG\Parameter(
* name="attributs",
* in="query",
* description="list of attributs",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="filter",
* in="query",
* description="filter results",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="distinct",
* in="query",
* description="delete duplicates",
* required=false,
* type="boolean"
* ),
* @SWG\Response(
* response=200,
* description="evacuation_eaux Response",
* @SWG\Schema(ref="#/definitions/evacuation_eauxs")
* )
* )
*/
/**
* get Evacuation_eauxs
* @return Evacuation_eauxs
*/
function GET() {
$aReturn = $this->genericGet($this->aProperties['schema_anc'], "v_evacuation_eaux", "id_eva");
$sMessage = $aReturn['sMessage'];
return $sMessage;
}
/**
* @SWG\Post(path="/evacuation_eauxs",
* tags={"Evacuation_eauxs"},
* summary="Add evacuation_eaux",
* description="Request to add Evacuation_eauxs",
* operationId="POST",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="evacuation_eaux Response",
* @SWG\Schema(ref="#/definitions/evacuation_eauxs")
* )
* )
*/
/**
* insert evacuation_eaux
* @return id of the evacuation_eaux created
*/
function POST() {
$this->aValues['create'] = $_SESSION["ses_Login"];
$this->aValues['create_date'] = date('Y-m-d');
// Fichiers à uploader
$aUploadFiles = array(
'photos_f' => [],
'fiche_f' => [],
'schema_f' => [],
'documents_f' => [],
'plan_f' => []
);
// Envoi Post
$aReturn = $this->genericPost($this->aProperties['schema_anc'], 'v_evacuation_eaux', $this->aProperties['schema_anc'].'.evacuation_eaux_id_eva_seq', 'id_eva', $aUploadFiles, 'anc_saisie_anc_evacuation_eaux', $this->aProperties['anc']['files_container']);
return $aReturn['sMessage'];
}
/**
* @SWG\Put(path="/evacuation_eauxs/{id_evacuation_eaux}",
* tags={"Evacuation_eauxs"},
* summary="update Evacuation_eauxs",
* description="Request to update Evacuation_eauxs",
* operationId="PUT",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="Evacuation_eaux token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="id_evacuation_eaux",
* in="path",
* description="id of the Evacuation_eauxs",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/evacuation_eauxs")
* )
* )
*/
/**
* update evacuation_eauxs
* @return id of evacuation_eauxs updated or error object if a evacuation_eauxs is not updated
*/
function PUT() {
if (empty($this->aValues['maj']))
$this->aValues['maj'] = $_SESSION["ses_Login"];
if (empty($this->aValues['maj_date']))
$this->aValues['maj_date'] = date('Y-m-d');
// Fichiers à uploader
$aUploadFiles = array(
'photos_f' => [],
'fiche_f' => [],
'schema_f' => [],
'documents_f' => [],
'plan_f' => []
);
// Envoi Put
$aReturn = $this->genericPut($this->aProperties['schema_anc'], 'v_evacuation_eaux', 'id_eva', $aUploadFiles, 'anc_saisie_anc_evacuation_eaux', $this->aProperties['anc']['files_container']);
return $aReturn['sMessage'];
}
/**
* @SWG\Delete(path="/evacuation_eauxs",
* tags={"Evacuation_eauxs"},
* summary="delete Evacuation_eauxs",
* description="Request to delete Evacuation_eauxs",
* operationId="DELETE",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="idList",
* in="query",
* description="id of the evacuation_eaux",
* required=true,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="evacuation_eaux Response",
* @SWG\Schema(ref="#/definitions/evacuation_eauxs")
* )
* )
*/
/**
* @SWG\Delete(path="/evacuation_eauxs/{id_evacuation_eaux}",
* tags={"Evacuation_eauxs"},
* summary="delete Evacuation_eauxs",
* description="Request to delete Evacuation_eauxs",
* operationId="DELETE",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="Evacuation_eaux token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="id_evacuation_eaux",
* in="path",
* description="id of the Evacuation_eauxs",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/evacuation_eauxs")
* )
* )
*/
/**
* delete evacuation_eauxs
* @return id of evacuation_eauxs deleted or error object if a evacuation_eauxs is not deleted
*/
function DELETE() {
$aReturn = $this->genericDelete($this->aProperties['schema_anc'], 'v_evacuation_eaux', 'id_eva');
return $aReturn['sMessage'];
}
}
?>
<?php
require_once __DIR__ . '/Anc.class.inc';
require_once dirname($_SERVER['SCRIPT_FILENAME']) . '/class/vitis_lib/Connection.class.inc';
/**
* \file Filieres_agree.class.inc
* \class Filieres_agree
*
* \author WAB <support.wab@veremes.com>.
*
* \brief This file contains the Filieres_agree php class
*
* This class defines operation for one Filieres_agree
*
*/
class Filieres_agree extends Anc {
public $oError;
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
* @param type $oConnection connection object
*/
function __construct($aPath, $aValues, $properties) {
$this->aValues = $aValues;
$this->aPath = $aPath;
$this->aProperties = $properties;
$this->oConnection = new Connection($this->aValues, $this->aProperties);
$this->oFilesManager = new Files_manager($this->aProperties);
}
/**
* @SWG\Get(path="/filieres_agrees/{id_filieres_agree}",
* tags={"Filieres_agrees"},
* summary="Get Filieres_agree",
* description="Request to get Filieres_agree by id",
* operationId="GET",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="id_filieres_agree",
* in="path",
* description="id_filieres_agree",
* required=true,
* type="integer",
* format="int32"
* ),
* @SWG\Parameter(
* name="attributs",
* in="query",
* description="list of attributs",
* required=false,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="Filieres_agree Response",
* @SWG\Schema(ref="#/definitions/filieres_agrees")
* )
* )
*/
/**
* get informations about mode
*/
function GET() {
$this->aFields = $this->getFields($this->aProperties['schema_anc'], 'v_filieres_agrees', 'id_fag', 'anc_saisie_anc_filieres_agree', $this->aProperties['anc']['files_container']);
}
/**
* delete a Point_situation
*/
function DELETE() {
$this->oConnection->oBd->delete($this->aProperties['schema_anc'], 'v_filieres_agrees', 'id_fag', $this->aValues["my_vitis_id"], 'integer');
if ($this->oConnection->oBd->enErreur()) {
$this->oError = new VitisError(1, $this->oConnection->oBd->getBDMessage());
} else {
$this->aFields["id_fag"] = $this->aValues["my_vitis_id"];
}
}
}
?>
<?php
/**
* \file Filieres_agrees.class.inc
* \class Filieres_agrees
*
* \author WAB <support.wab@veremes.com>.
*
* \brief This file contains the Filieres_agrees php class
*
* This class defines Rest Api to Vitis Filieres_agrees
*
*/
require_once __DIR__ . '/Anc.class.inc';
require_once 'Filieres_agree.class.inc';
class Filieres_agrees extends Anc {
/**
* @SWG\Definition(
* definition="/filieres_agrees",
* allOf={
* @SWG\Schema(ref="#/definitions/filieres_agrees")
* }
* )
* * @SWG\Tag(
* name="Filieres_agrees",
* description="Operations about Filieres_agrees"
* )
*/
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
*/
function __construct($aPath, $aValues, $properties) {
$this->aValues = $aValues;
$this->aPath = $aPath;
$this->aProperties = $properties;
$this->oConnection = new Connection($this->aValues, $this->aProperties);
$this->oFilesManager = new Files_manager($this->aProperties);
}
/**
* @SWG\Get(path="/filieres_agrees",
* tags={"Filieres_agrees"},
* summary="Get Filieres_agrees",
* description="Request to get Filieres_agrees",
* operationId="GET",
* produces={"application/xml", "application/json", "application/x-vm-json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="order_by",
* in="query",
* description="list of ordering fields",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="sort_order",
* in="query",
* description="sort_order",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="limit",
* in="query",
* description="number of element",
* required=false,
* type="integer",
* format="int32"
* ),
* @SWG\Parameter(
* name="offset",
* in="query",
* description="index of first element",
* required=false,
* type="string",
* format="int32"
* ),
* @SWG\Parameter(
* name="attributs",
* in="query",
* description="list of attributs",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="filter",
* in="query",
* description="filter results",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="distinct",
* in="query",
* description="delete duplicates",
* required=false,
* type="boolean"
* ),
* @SWG\Response(
* response=200,
* description="filieres_agree Response",
* @SWG\Schema(ref="#/definitions/filieres_agrees")
* )
* )
*/
/**
* get Filieres_agrees
* @return Filieres_agrees
*/
function GET() {
$aReturn = $this->genericGet($this->aProperties['schema_anc'], "v_filieres_agrees", "id_fag");
$sMessage = $aReturn['sMessage'];
return $sMessage;
}
/**
* @SWG\Post(path="/filieres_agrees",
* tags={"Filieres_agrees"},
* summary="Add filieres_agree",
* description="Request to add Filieres_agrees",
* operationId="POST",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="filieres_agree Response",
* @SWG\Schema(ref="#/definitions/filieres_agrees")
* )
* )
*/
/**
* insert filieres_agree
* @return id of the filieres_agree created
*/
function POST() {
$this->aValues['create'] = $_SESSION["ses_Login"];
$this->aValues['create_date'] = date('Y-m-d');
// Conversion des dates
if (isset($this->aValues['fag_en_date'])) {
if ($this->aValues['fag_en_date'] == '')
unset($this->aValues['fag_en_date']);
else
$this->aValues['fag_en_date'] = date_format(date_create_from_format('d/m/Y', $this->aValues['fag_en_date']), 'Y-m-d');
}
// Fichiers à uploader
$aUploadFiles = array(
'photos_f' => [],
'fiche_f' => [],
'schema_f' => [],
'documents_f' => [],
'plan_f' => []
);
// Envoi Post
$aReturn = $this->genericPost($this->aProperties['schema_anc'], 'v_filieres_agrees', $this->aProperties['schema_anc'].'.filieres_agrees_id_fag_seq', 'id_fag', $aUploadFiles, 'anc_saisie_anc_filieres_agree', $this->aProperties['anc']['files_container']);
return $aReturn['sMessage'];
}
/**
* @SWG\Put(path="/filieres_agrees/{id_filieres_agree}",
* tags={"Filieres_agrees"},
* summary="update Filieres_agrees",
* description="Request to update Filieres_agrees",
* operationId="PUT",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="Filieres_agree token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="id_filieres_agree",
* in="path",
* description="id of the Filieres_agrees",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/filieres_agrees")
* )
* )
*/
/**
* update filieres_agrees
* @return id of filieres_agrees updated or error object if a filieres_agrees is not updated
*/
function PUT() {
if (empty($this->aValues['maj']))
$this->aValues['maj'] = $_SESSION["ses_Login"];
if (empty($this->aValues['maj_date']))
$this->aValues['maj_date'] = date('Y-m-d');
// Conversion des dates
if (isset($this->aValues['fag_en_date'])) {
if ($this->aValues['fag_en_date'] == '')
unset($this->aValues['fag_en_date']);
else
$this->aValues['fag_en_date'] = date_format(date_create_from_format('d/m/Y', $this->aValues['fag_en_date']), 'Y-m-d');
}
// Fichiers à uploader
$aUploadFiles = array(
'photos_f' => [],
'fiche_f' => [],
'schema_f' => [],
'documents_f' => [],
'plan_f' => []
);
// Envoi Put
$aReturn = $this->genericPut($this->aProperties['schema_anc'], 'v_filieres_agrees', 'id_fag', $aUploadFiles, 'anc_saisie_anc_filieres_agree', $this->aProperties['anc']['files_container']);
return $aReturn['sMessage'];
}
/**
* @SWG\Delete(path="/filieres_agrees",
* tags={"Filieres_agrees"},
* summary="delete Filieres_agrees",
* description="Request to delete Filieres_agrees",
* operationId="DELETE",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="idList",
* in="query",
* description="id of the filieres_agree",
* required=true,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="filieres_agree Response",
* @SWG\Schema(ref="#/definitions/filieres_agrees")
* )
* )
*/
/**
* @SWG\Delete(path="/filieres_agrees/{id_filieres_agree}",
* tags={"Filieres_agrees"},
* summary="delete Filieres_agrees",
* description="Request to delete Filieres_agrees",
* operationId="DELETE",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="Filieres_agree token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="id_filieres_agree",
* in="path",
* description="id of the Filieres_agrees",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/filieres_agrees")
* )
* )
*/
/**
* delete filieres_agrees
* @return id of filieres_agrees deleted or error object if a filieres_agrees is not deleted
*/
function DELETE() {
$aReturn = $this->genericDelete($this->aProperties['schema_anc'], 'v_filieres_agrees', 'id_fag');
return $aReturn['sMessage'];
}
}
?>
<?php
require_once __DIR__ . '/Anc.class.inc';
require_once dirname($_SERVER['SCRIPT_FILENAME']) . '/class/vitis_lib/Connection.class.inc';
/**
* \file Installation.class.inc
* \class Installation
*
* \author WAB <support.wab@veremes.com>.
*
* \brief This file contains the Installation php class
*
* This class defines operation for one Installation
*
*/
class Installation extends Anc {
public $oError;
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
* @param type $oConnection connection object
*/
function __construct($aPath, $aValues, $properties) {
$this->aValues = $aValues;
$this->aPath = $aPath;
$this->aProperties = $properties;
$this->oConnection = new Connection($this->aValues, $this->aProperties);
$this->aSelectedFields = Array("id_installation", "id_com", "id_parc", "parc_sup", "parc_parcelle_associees", "parc_adresse", "code_postal", "parc_commune", "prop_titre", "prop_nom_prenom", "prop_adresse", "prop_code_postal", "prop_commune", "prop_tel", "prop_mail", "bati_type", "bati_ca_nb_pp", "bati_ca_nb_eh", "bati_ca_nb_chambres", "bati_ca_nb_autres_pieces", "bati_ca_nb_occupant", "bati_nb_a_control", "bati_date_achat", "bati_date_mutation", "cont_zone_enjeu", "cont_zone_sage", "cont_zone_autre", "cont_zone_urba", "cont_zone_anc", "cont_alim_eau_potable", "cont_puits_usage", "cont_puits_declaration", "cont_puits_situation", "cont_puits_terrain_mitoyen", "observations", "maj", "maj_date", "create", "create_date", "archivage", "geom", "photo_f", "document_f", "num_dossier", "commune", "section", "parcelle", "nb_controle", "last_date_control", "cl_avis", "next_control", "classement_installation");
$this->oFilesManager = new Files_manager($this->aProperties);
}
/**
* @SWG\Get(path="/installations/{id_installation}",
* tags={"Installations"},
* summary="Get Installation",
* description="Request to get Installation by id",
* operationId="GET",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="id_installation",
* in="path",
* description="id_installation",
* required=true,
* type="integer",
* format="int32"
* ),
* @SWG\Parameter(
* name="attributs",
* in="query",
* description="list of attributs",
* required=false,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="Installation Response",
* @SWG\Schema(ref="#/definitions/installations")
* )
* )
*/
/**
* get informations about mode
*/
function GET() {
$this->aFields = $this->getFields($this->aProperties['schema_anc'], 'v_installation', 'id_installation', 'anc_saisie_anc_installation', $this->aProperties['anc']['files_container']);
}
/**
* delete a Point_situation
*/
function DELETE() {
$this->oConnection->oBd->delete($this->aProperties['schema_anc'], 'v_installation', 'id_installation', $this->aValues["my_vitis_id"], 'integer');
if ($this->oConnection->oBd->enErreur()) {
$this->oError = new VitisError(1, $this->oConnection->oBd->getBDMessage());
} else {
$this->aFields["id_installation"] = $this->aValues["my_vitis_id"];
}
}
}
?>
<?php
/**
* \file Installations.class.inc
* \class Installations
*
* \author WAB <support.wab@veremes.com>.
*
* \brief This file contains the Installations php class
*
* This class defines Rest Api to Vitis Installations
*
*/
require_once __DIR__ . '/Anc.class.inc';
require_once 'Installation.class.inc';
class Installations extends Anc {
/**
* @SWG\Definition(
* definition="/installations",
* allOf={
* @SWG\Schema(ref="#/definitions/installations")
* }
* )
* * @SWG\Tag(
* name="Installations",
* description="Operations about Installations"
* )
*/
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
*/
function __construct($aPath, $aValues, $properties) {
$this->aValues = $aValues;
$this->aPath = $aPath;
$this->aProperties = $properties;
$this->oConnection = new Connection($this->aValues, $this->aProperties);
$this->aSelectedFields = Array("id_installation", "id_com", "id_parc", "parc_sup", "parc_parcelle_associees", "parc_adresse", "code_postal", "parc_commune", "prop_titre", "prop_nom_prenom", "prop_adresse", "prop_code_postal", "prop_commune", "prop_tel", "prop_mail", "bati_type", "bati_ca_nb_pp", "bati_ca_nb_eh", "bati_ca_nb_chambres", "bati_ca_nb_autres_pieces", "bati_ca_nb_occupant", "bati_nb_a_control", "bati_date_achat", "bati_date_mutation", "cont_zone_enjeu", "cont_zone_sage", "cont_zone_autre", "cont_zone_urba", "cont_zone_anc", "cont_alim_eau_potable", "cont_puits_usage", "cont_puits_declaration", "cont_puits_situation", "cont_puits_terrain_mitoyen", "observations", "maj", "maj_date", "create", "create_date", "archivage", "geom", "photo_f", "document_f", "num_dossier", "commune", "section", "parcelle", "nb_controle", "last_date_control", "cl_avis", "next_control", "classement_installation");
$this->oFilesManager = new Files_manager($this->aProperties);
}
/**
* @SWG\Get(path="/installations",
* tags={"Installations"},
* summary="Get Installations",
* description="Request to get Installations",
* operationId="GET",
* produces={"application/xml", "application/json", "application/x-vm-json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="order_by",
* in="query",
* description="list of ordering fields",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="sort_order",
* in="query",
* description="sort_order",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="limit",
* in="query",
* description="number of element",
* required=false,
* type="integer",
* format="int32"
* ),
* @SWG\Parameter(
* name="offset",
* in="query",
* description="index of first element",
* required=false,
* type="string",
* format="int32"
* ),
* @SWG\Parameter(
* name="attributs",
* in="query",
* description="list of attributs",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="filter",
* in="query",
* description="filter results",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="distinct",
* in="query",
* description="delete duplicates",
* required=false,
* type="boolean"
* ),
* @SWG\Response(
* response=200,
* description="installation Response",
* @SWG\Schema(ref="#/definitions/installations")
* )
* )
*/
/**
* get Installations
* @return Installations
*/
function GET() {
$aReturn = $this->genericGet($this->aProperties['schema_anc'], "v_installation", "id_installation");
$sMessage = $aReturn['sMessage'];
return $sMessage;
}
/**
* @SWG\Post(path="/installations",
* tags={"Installations"},
* summary="Add installation",
* description="Request to add Installations",
* operationId="POST",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="installation Response",
* @SWG\Schema(ref="#/definitions/installations")
* )
* )
*/
/**
* insert installation
* @return id of the installation created
*/
function POST() {
$this->aValues['create'] = $_SESSION["ses_Login"];
$this->aValues['create_date'] = date('Y-m-d');
// Fichiers à uploader
$aUploadFiles = array(
'photo_f' => [],
'document_f' => []
);
// Envoi Post
$aReturn = $this->genericPost($this->aProperties['schema_anc'], 'v_installation', $this->aProperties['schema_anc'].'.installation_id_installation_seq', 'id_installation', $aUploadFiles, 'anc_saisie_anc_installation', $this->aProperties['anc']['files_container']);
return $aReturn['sMessage'];
}
/**
* @SWG\Put(path="/installations/{id_installation}",
* tags={"Installations"},
* summary="update Installations",
* description="Request to update Installations",
* operationId="PUT",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="Installation token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="id_installation",
* in="path",
* description="id of the Installations",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/installations")
* )
* )
*/
/**
* update installations
* @return id of installations updated or error object if a installations is not updated
*/
function PUT() {
if (empty($this->aValues['maj']))
$this->aValues['maj'] = $_SESSION["ses_Login"];
if (empty($this->aValues['maj_date']))
$this->aValues['maj_date'] = date('Y-m-d');
// Zone PLU.
if (!empty($this->aValues['geom'])) {
$sSchema = $this->aProperties["anc"]["cont_zone_urba"]["intersect"]["schema"];
$sTable = $this->aProperties["anc"]["cont_zone_urba"]["intersect"]["table"];
$sColumn = $this->aProperties["anc"]["cont_zone_urba"]["intersect"]["column"];
$sColumnGeom = $this->aProperties["anc"]["cont_zone_urba"]["intersect"]["column_geom"];
if (!empty($sSchema) && !empty($sTable) && !empty($sColumn) && !empty($sColumnGeom)) {
require $this->sRessourcesFile;
$aParams['sSchema'] = array('value' => $sSchema, 'type' => 'schema_name');
$aParams['sTable'] = array('value' => $sTable, 'type' => 'table_name');
$aParams['sColumn'] = array('value' => $sColumn, 'type' => 'column_name');
$aParams['sColumnGeom'] = array('value' => $sColumnGeom, 'type' => 'column_name');
$aParams['geom'] = array('value' => $this->aValues['geom'], 'type' => 'geometry');
$oPDOresult = $this->oConnection->oBd->executeWithParams($aSql['getContZoneUrbaIntersect'], $aParams);
if ($this->oConnection->oBd->nombreLigne($oPDOresult) > 0) {
$aLigne = $this->oConnection->oBd->ligneSuivante ($oPDOresult);
$this->aValues['cont_zone_urba'] = $aLigne[$sColumn];
}
}
}
// Fichiers à uploader
$aUploadFiles = array(
'photo_f' => [],
'document_f' => []
);
// Envoi Put
$aReturn = $this->genericPut($this->aProperties['schema_anc'], 'v_installation', 'id_installation', $aUploadFiles, 'anc_saisie_anc_installation', $this->aProperties['anc']['files_container']);
return $aReturn['sMessage'];
}
/**
* @SWG\Delete(path="/installations",
* tags={"Installations"},
* summary="delete Installations",
* description="Request to delete Installations",
* operationId="DELETE",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="idList",
* in="query",
* description="id of the installation",
* required=true,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="installation Response",
* @SWG\Schema(ref="#/definitions/installations")
* )
* )
*/
/**
* @SWG\Delete(path="/installations/{id_installation}",
* tags={"Installations"},
* summary="delete Installations",
* description="Request to delete Installations",
* operationId="DELETE",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="Installation token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="id_installation",
* in="path",
* description="id of the Installations",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/installations")
* )
* )
*/
/**
* delete installations
* @return id of installations deleted or error object if a installations is not deleted
*/
function DELETE() {
require $this->sRessourcesFile;
// Pas de Suppression si des contrôles sont associés.
$aParams['sSchemaAnc'] = array('value' => $this->aProperties['schema_anc'], 'type' => 'schema_name');
$aParams['idList'] = array('value' => $this->aValues['idList'], 'type' => 'group');
$oPDOresult = $this->oConnection->oBd->executeWithParams($aSql['getInstallationControls'], $aParams);
if ($this->oConnection->oBd->enErreur()) {
$aReturn = array('status' => 0, 'message' => $this->oConnection->oBd->getBDMessage(), 'error_code' => 1);
return json_encode($aReturn);
}
else {
if ($this->oConnection->oBd->nombreLigne($oPDOresult) > 0) {
$aReturn = array('status' => 0, 'errorMessage' => 'Des contrôles sont associés à / aux installation(s) à supprimer.', 'error_code' => 1);
return json_encode($aReturn);
}
else {
$aReturn = $this->genericDelete($this->aProperties['schema_anc'], 'v_installation', 'id_installation');
return $aReturn['sMessage'];
}
}
}
}
?>
<?php
require_once __DIR__ . '/Anc.class.inc';
require_once dirname($_SERVER['SCRIPT_FILENAME']) . '/class/vitis_lib/Connection.class.inc';
/**
* \file Param_admin.class.inc
* \class Param_admin
*
* \author WAB <support.wab@veremes.com>.
*
* \brief This file contains the Param_admin php class
*
* This class defines operation for one Param_admin
*
*/
class Param_admin extends Anc {
public $oError;
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
* @param type $oConnection connection object
*/
function __construct($aPath, $aValues, $properties) {
$this->aValues = $aValues;
$this->aPath = $aPath;
$this->aProperties = $properties;
$this->oConnection = new Connection($this->aValues, $this->aProperties);
}
/**
* @SWG\Get(path="/param_admins/{id_param_admin}",
* tags={"Param_admins"},
* summary="Get Param_admin",
* description="Request to get Param_admin by id",
* operationId="GET",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="id_param_admin",
* in="path",
* description="id_param_admin",
* required=true,
* type="integer",
* format="int32"
* ),
* @SWG\Parameter(
* name="attributs",
* in="query",
* description="list of attributs",
* required=false,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="Param_admin Response",
* @SWG\Schema(ref="#/definitions/param_admins")
* )
* )
*/
/**
* get informations about mode
*/
function GET() {
$this->aFields = $this->getFields($this->aProperties['schema_anc'], "param_admin", "id_parametre_admin");
}
/**
* delete a Point_situation
*/
function DELETE() {
$this->oConnection->oBd->delete($this->aProperties['schema_anc'], 'param_admin', 'id_parametre_admin', $this->aValues["my_vitis_id"], 'integer');
if ($this->oConnection->oBd->enErreur()) {
$this->oError = new VitisError(1, $this->oConnection->oBd->getBDMessage());
} else {
$this->aFields["id_parametre_admin"] = $this->aValues["my_vitis_id"];
}
}
}
?>
\ No newline at end of file
<?php
/**
* \file Param_admins.class.inc
* \class Param_admins
*
* \author WAB <support.wab@veremes.com>.
*
* \brief This file contains the Param_admins php class
*
* This class defines Rest Api to Vitis Param_admins
*
*/
require_once __DIR__ . '/Anc.class.inc';
require_once 'Param_admin.class.inc';
class Param_admins extends Anc {
/**
* @SWG\Definition(
* definition="/param_admins",
* allOf={
* @SWG\Schema(ref="#/definitions/param_admins")
* }
* )
* * @SWG\Tag(
* name="Param_admins",
* description="Operations about Param_admins"
* )
*/
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
*/
function __construct($aPath, $aValues, $properties) {
$this->aValues = $aValues;
$this->aPath = $aPath;
$this->aProperties = $properties;
$this->oConnection = new Connection($this->aValues, $this->aProperties);
}
/**
* @SWG\Get(path="/param_admins",
* tags={"Param_admins"},
* summary="Get Param_admins",
* description="Request to get Param_admins",
* operationId="GET",
* produces={"application/xml", "application/json", "application/x-vm-json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="order_by",
* in="query",
* description="list of ordering fields",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="sort_order",
* in="query",
* description="sort_order",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="limit",
* in="query",
* description="number of element",
* required=false,
* type="integer",
* format="int32"
* ),
* @SWG\Parameter(
* name="offset",
* in="query",
* description="index of first element",
* required=false,
* type="string",
* format="int32"
* ),
* @SWG\Parameter(
* name="attributs",
* in="query",
* description="list of attributs",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="filter",
* in="query",
* description="filter results",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="distinct",
* in="query",
* description="delete duplicates",
* required=false,
* type="boolean"
* ),
* @SWG\Response(
* response=200,
* description="param_admin Response",
* @SWG\Schema(ref="#/definitions/param_admins")
* )
* )
*/
/**
* get Param_admins
* @return Param_admins
*/
function GET() {
$aReturn = $this->genericGet($this->aProperties['schema_anc'], "v_param_admin", "id_parametre_admin");
$sMessage = $aReturn['sMessage'];
return $sMessage;
}
/**
* @SWG\Post(path="/param_admins",
* tags={"Param_admins"},
* summary="Add param_admin",
* description="Request to add Param_admins",
* operationId="POST",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="param_admin Response",
* @SWG\Schema(ref="#/definitions/param_admins")
* )
* )
*/
/**
* insert param_admin
* @return id of the param_admin created
*/
function POST() {
// Conversion des dates
$aDates = array('date_fin_validite');
foreach ($aDates as $sDate) {
if (isset($this->aValues[$sDate])) {
if ($this->aValues[$sDate] == '')
unset($this->aValues[$sDate]);
else
$this->aValues[$sDate] = date_format(date_create_from_format('d/m/Y', $this->aValues[$sDate]), 'Y-m-d');
}
}
$aReturn = $this->genericPost($this->aProperties['schema_anc'], 'param_admin', $this->aProperties['schema_anc'].'.param_admin_id_parametre_admin_seq', 'id_parametre_admin');
return $aReturn['sMessage'];
}
/**
* @SWG\Put(path="/param_admins/{id_param_admin}",
* tags={"Param_admins"},
* summary="update Param_admins",
* description="Request to update Param_admins",
* operationId="PUT",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="Param_admin token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="id_param_admin",
* in="path",
* description="id of the Param_admins",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/param_admins")
* )
* )
*/
/**
* update param_admins
* @return id of param_admins updated or error object if a param_admins is not updated
*/
function PUT() {
// Conversion des dates
$aDates = array('date_fin_validite');
foreach ($aDates as $sDate) {
if (isset($this->aValues[$sDate])) {
if ($this->aValues[$sDate] == '')
unset($this->aValues[$sDate]);
else
$this->aValues[$sDate] = date_format(date_create_from_format('d/m/Y', $this->aValues[$sDate]), 'Y-m-d');
}
}
$aReturn = $this->genericPut($this->aProperties['schema_anc'], 'param_admin', 'id_parametre_admin');
return $aReturn['sMessage'];
}
/**
* @SWG\Delete(path="/param_admins",
* tags={"Param_admins"},
* summary="delete Param_admins",
* description="Request to delete Param_admins",
* operationId="DELETE",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="idList",
* in="query",
* description="id of the param_admin",
* required=true,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="param_admin Response",
* @SWG\Schema(ref="#/definitions/param_admins")
* )
* )
*/
/**
* @SWG\Delete(path="/param_admins/{id_param_admin}",
* tags={"Param_admins"},
* summary="delete Param_admins",
* description="Request to delete Param_admins",
* operationId="DELETE",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="Param_admin token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="id_param_admin",
* in="path",
* description="id of the Param_admins",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/param_admins")
* )
* )
*/
/**
* delete param_admins
* @return id of param_admins deleted or error object if a param_admins is not deleted
*/
function DELETE() {
$aReturn = $this->genericDelete($this->aProperties['schema_anc'], 'param_admin', 'id_parametre_admin');
return $aReturn['sMessage'];
}
}
?>
\ No newline at end of file
<?php
require_once __DIR__ . '/Anc.class.inc';
require_once dirname($_SERVER['SCRIPT_FILENAME']) . '/class/vitis_lib/Connection.class.inc';
/**
* \file Param_liste.class.inc
* \class Param_liste
*
* \author WAB <support.wab@veremes.com>.
*
* \brief This file contains the Param_liste php class
*
* This class defines operation for one Param_liste
*
*/
class Param_liste extends Anc {
public $oError;
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
* @param type $oConnection connection object
*/
function __construct($aPath, $aValues, $properties) {
$this->aValues = $aValues;
$this->aPath = $aPath;
$this->aProperties = $properties;
$this->oConnection = new Connection($this->aValues, $this->aProperties);
}
/**
* @SWG\Get(path="/param_listes/{id_param_liste}",
* tags={"Param_listes"},
* summary="Get Param_liste",
* description="Request to get Param_liste by id",
* operationId="GET",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="id_param_liste",
* in="path",
* description="id_param_liste",
* required=true,
* type="integer",
* format="int32"
* ),
* @SWG\Parameter(
* name="attributs",
* in="query",
* description="list of attributs",
* required=false,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="Param_liste Response",
* @SWG\Schema(ref="#/definitions/param_listes")
* )
* )
*/
/**
* get informations about mode
*/
function GET() {
$this->aFields = $this->getFields($this->aProperties['schema_anc'], "param_liste", "id_parametre_liste");
}
/**
* delete a Point_situation
*/
function DELETE() {
$this->oConnection->oBd->delete($this->aProperties['schema_anc'], 'param_liste', 'id_parametre_liste', $this->aValues["my_vitis_id"], 'integer');
if ($this->oConnection->oBd->enErreur()) {
$this->oError = new VitisError(1, $this->oConnection->oBd->getBDMessage());
} else {
$this->aFields["id_parametre_liste"] = $this->aValues["my_vitis_id"];
}
}
}
?>
\ No newline at end of file
<?php
/**
* \file Param_listes.class.inc
* \class Param_listes
*
* \author WAB <support.wab@veremes.com>.
*
* \brief This file contains the Param_listes php class
*
* This class defines Rest Api to Vitis Param_listes
*
*/
require_once __DIR__ . '/Anc.class.inc';
require_once 'Param_liste.class.inc';
class Param_listes extends Anc {
/**
* @SWG\Definition(
* definition="/param_listes",
* allOf={
* @SWG\Schema(ref="#/definitions/param_listes")
* }
* )
* * @SWG\Tag(
* name="Param_listes",
* description="Operations about Param_listes"
* )
*/
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
*/
function __construct($aPath, $aValues, $properties) {
$this->aValues = $aValues;
$this->aPath = $aPath;
$this->aProperties = $properties;
$this->oConnection = new Connection($this->aValues, $this->aProperties);
}
/**
* @SWG\Get(path="/param_listes",
* tags={"Param_listes"},
* summary="Get Param_listes",
* description="Request to get Param_listes",
* operationId="GET",
* produces={"application/xml", "application/json", "application/x-vm-json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="order_by",
* in="query",
* description="list of ordering fields",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="sort_order",
* in="query",
* description="sort_order",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="limit",
* in="query",
* description="number of element",
* required=false,
* type="integer",
* format="int32"
* ),
* @SWG\Parameter(
* name="offset",
* in="query",
* description="index of first element",
* required=false,
* type="string",
* format="int32"
* ),
* @SWG\Parameter(
* name="attributs",
* in="query",
* description="list of attributs",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="filter",
* in="query",
* description="filter results",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="distinct",
* in="query",
* description="delete duplicates",
* required=false,
* type="boolean"
* ),
* @SWG\Response(
* response=200,
* description="param_liste Response",
* @SWG\Schema(ref="#/definitions/param_listes")
* )
* )
*/
/**
* get Param_listes
* @return Param_listes
*/
function GET() {
$aReturn = $this->genericGet($this->aProperties['schema_anc'], "param_liste", "id_parametre_liste");
$sMessage = $aReturn['sMessage'];
return $sMessage;
}
/**
* @SWG\Post(path="/param_listes",
* tags={"Param_listes"},
* summary="Add param_liste",
* description="Request to add Param_listes",
* operationId="POST",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="param_liste Response",
* @SWG\Schema(ref="#/definitions/param_listes")
* )
* )
*/
/**
* insert param_liste
* @return id of the param_liste created
*/
function POST() {
$aReturn = $this->genericPost($this->aProperties['schema_anc'], 'param_liste', $this->aProperties['schema_anc'].'.param_liste_id_parametre_liste_seq', 'id_parametre_liste');
return $aReturn['sMessage'];
}
/**
* @SWG\Put(path="/param_listes/{id_param_liste}",
* tags={"Param_listes"},
* summary="update Param_listes",
* description="Request to update Param_listes",
* operationId="PUT",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="Param_liste token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="id_param_liste",
* in="path",
* description="id of the Param_listes",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/param_listes")
* )
* )
*/
/**
* update param_listes
* @return id of param_listes updated or error object if a param_listes is not updated
*/
function PUT() {
$aReturn = $this->genericPut($this->aProperties['schema_anc'], 'param_liste', 'id_parametre_liste');
return $aReturn['sMessage'];
}
/**
* @SWG\Delete(path="/param_listes",
* tags={"Param_listes"},
* summary="delete Param_listes",
* description="Request to delete Param_listes",
* operationId="DELETE",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="idList",
* in="query",
* description="id of the param_liste",
* required=true,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="param_liste Response",
* @SWG\Schema(ref="#/definitions/param_listes")
* )
* )
*/
/**
* @SWG\Delete(path="/param_listes/{id_param_liste}",
* tags={"Param_listes"},
* summary="delete Param_listes",
* description="Request to delete Param_listes",
* operationId="DELETE",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="Param_liste token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="id_param_liste",
* in="path",
* description="id of the Param_listes",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/param_listes")
* )
* )
*/
/**
* delete param_listes
* @return id of param_listes deleted or error object if a param_listes is not deleted
*/
function DELETE() {
$aReturn = $this->genericDelete($this->aProperties['schema_anc'], 'param_liste', 'id_parametre_liste');
return $aReturn['sMessage'];
}
}
?>
\ No newline at end of file
<?php
require_once __DIR__ . '/Anc.class.inc';
require_once dirname($_SERVER['SCRIPT_FILENAME']) . '/class/vitis_lib/Connection.class.inc';
/**
* \file Param_tarif.class.inc
* \class Param_tarif
*
* \author WAB <support.wab@veremes.com>.
*
* \brief This file contains the Param_tarif php class
*
* This class defines operation for one Param_tarif
*
*/
class Param_tarif extends Anc {
public $oError;
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
* @param type $oConnection connection object
*/
function __construct($aPath, $aValues, $properties) {
$this->aValues = $aValues;
$this->aPath = $aPath;
$this->aProperties = $properties;
$this->oConnection = new Connection($this->aValues, $this->aProperties);
$this->aSelectedFields = Array("id_parametre_tarif", "id_com", "controle_type", "montant", "annee_validite", "devise", "libelle_montant");
}
/**
* @SWG\Get(path="/param_tarifs/{id_param_tarif}",
* tags={"Param_tarifs"},
* summary="Get Param_tarif",
* description="Request to get Param_tarif by id",
* operationId="GET",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="id_param_tarif",
* in="path",
* description="id_param_tarif",
* required=true,
* type="integer",
* format="int32"
* ),
* @SWG\Parameter(
* name="attributs",
* in="query",
* description="list of attributs",
* required=false,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="Param_tarif Response",
* @SWG\Schema(ref="#/definitions/param_tarifs")
* )
* )
*/
/**
* get informations about mode
*/
function GET() {
$this->aFields = $this->getFields($this->aProperties['schema_anc'], "v_param_tarif", "id_parametre_tarif");
}
/**
* delete a Point_situation
*/
function DELETE() {
$this->oConnection->oBd->delete($this->aProperties['schema_anc'], 'param_tarif', 'id_parametre_tarif', $this->aValues["my_vitis_id"], 'integer');
if ($this->oConnection->oBd->enErreur()) {
$this->oError = new VitisError(1, $this->oConnection->oBd->getBDMessage());
} else {
$this->aFields["id_parametre_tarif"] = $this->aValues["my_vitis_id"];
}
}
}
?>
\ No newline at end of file
<?php
/**
* \file Param_tarifs.class.inc
* \class Param_tarifs
*
* \author WAB <support.wab@veremes.com>.
*
* \brief This file contains the Param_tarifs php class
*
* This class defines Rest Api to Vitis Param_tarifs
*
*/
require_once __DIR__ . '/Anc.class.inc';
require_once 'Param_tarif.class.inc';
class Param_tarifs extends Anc {
/**
* @SWG\Definition(
* definition="/param_tarifs",
* allOf={
* @SWG\Schema(ref="#/definitions/param_tarifs")
* }
* )
* * @SWG\Tag(
* name="Param_tarifs",
* description="Operations about Param_tarifs"
* )
*/
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
*/
function __construct($aPath, $aValues, $properties) {
$this->aValues = $aValues;
$this->aPath = $aPath;
$this->aProperties = $properties;
$this->oConnection = new Connection($this->aValues, $this->aProperties);
$this->aSelectedFields = Array("id_parametre_tarif", "id_com", "controle_type", "montant", "annee_validite", "devise", "libelle_montant");
}
/**
* @SWG\Get(path="/param_tarifs",
* tags={"Param_tarifs"},
* summary="Get Param_tarifs",
* description="Request to get Param_tarifs",
* operationId="GET",
* produces={"application/xml", "application/json", "application/x-vm-json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="order_by",
* in="query",
* description="list of ordering fields",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="sort_order",
* in="query",
* description="sort_order",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="limit",
* in="query",
* description="number of element",
* required=false,
* type="integer",
* format="int32"
* ),
* @SWG\Parameter(
* name="offset",
* in="query",
* description="index of first element",
* required=false,
* type="string",
* format="int32"
* ),
* @SWG\Parameter(
* name="attributs",
* in="query",
* description="list of attributs",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="filter",
* in="query",
* description="filter results",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="distinct",
* in="query",
* description="delete duplicates",
* required=false,
* type="boolean"
* ),
* @SWG\Response(
* response=200,
* description="param_tarif Response",
* @SWG\Schema(ref="#/definitions/param_tarifs")
* )
* )
*/
/**
* get Param_tarifs
* @return Param_tarifs
*/
function GET() {
$aReturn = $this->genericGet($this->aProperties['schema_anc'], "v_param_tarif", "id_parametre_tarif");
$sMessage = $aReturn['sMessage'];
return $sMessage;
}
/**
* @SWG\Post(path="/param_tarifs",
* tags={"Param_tarifs"},
* summary="Add param_tarif",
* description="Request to add Param_tarifs",
* operationId="POST",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="param_tarif Response",
* @SWG\Schema(ref="#/definitions/param_tarifs")
* )
* )
*/
/**
* insert param_tarif
* @return id of the param_tarif created
*/
function POST() {
$aReturn = $this->genericPost($this->aProperties['schema_anc'], 'param_tarif', $this->aProperties['schema_anc'].'.param_tarif_id_parametre_tarif_seq', 'id_parametre_tarif');
return $aReturn['sMessage'];
}
/**
* @SWG\Put(path="/param_tarifs/{id_param_tarif}",
* tags={"Param_tarifs"},
* summary="update Param_tarifs",
* description="Request to update Param_tarifs",
* operationId="PUT",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="Param_tarif token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="id_param_tarif",
* in="path",
* description="id of the Param_tarifs",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/param_tarifs")
* )
* )
*/
/**
* update param_tarifs
* @return id of param_tarifs updated or error object if a param_tarifs is not updated
*/
function PUT() {
$aReturn = $this->genericPut($this->aProperties['schema_anc'], 'param_tarif', 'id_parametre_tarif');
return $aReturn['sMessage'];
}
/**
* @SWG\Delete(path="/param_tarifs",
* tags={"Param_tarifs"},
* summary="delete Param_tarifs",
* description="Request to delete Param_tarifs",
* operationId="DELETE",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="idList",
* in="query",
* description="id of the param_tarif",
* required=true,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="param_tarif Response",
* @SWG\Schema(ref="#/definitions/param_tarifs")
* )
* )
*/
/**
* @SWG\Delete(path="/param_tarifs/{id_param_tarif}",
* tags={"Param_tarifs"},
* summary="delete Param_tarifs",
* description="Request to delete Param_tarifs",
* operationId="DELETE",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="Param_tarif token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="id_param_tarif",
* in="path",
* description="id of the Param_tarifs",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/param_tarifs")
* )
* )
*/
/**
* delete param_tarifs
* @return id of param_tarifs deleted or error object if a param_tarifs is not deleted
*/
function DELETE() {
$aReturn = $this->genericDelete($this->aProperties['schema_anc'], 'param_tarif', 'id_parametre_tarif');
return $aReturn['sMessage'];
}
}
?>
\ No newline at end of file
<?php
require_once __DIR__ . '/Anc.class.inc';
require_once dirname($_SERVER['SCRIPT_FILENAME']) . '/class/vitis_lib/Connection.class.inc';
/**
* \file Pretraitement.class.inc
* \class Pretraitement
*
* \author WAB <support.wab@veremes.com>.
*
* \brief This file contains the Pretraitement php class
*
* This class defines operation for one Pretraitement
*
*/
class Pretraitement extends Anc {
public $oError;
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
* @param type $oConnection connection object
*/
function __construct($aPath, $aValues, $properties) {
$this->aValues = $aValues;
$this->aPath = $aPath;
$this->aProperties = $properties;
$this->oConnection = new Connection($this->aValues, $this->aProperties);
$this->oFilesManager = new Files_manager($this->aProperties);
}
/**
* @SWG\Get(path="/pretraitements/{id_pretraitement}",
* tags={"Pretraitements"},
* summary="Get Pretraitement",
* description="Request to get Pretraitement by id",
* operationId="GET",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="id_pretraitement",
* in="path",
* description="id_pretraitement",
* required=true,
* type="integer",
* format="int32"
* ),
* @SWG\Parameter(
* name="attributs",
* in="query",
* description="list of attributs",
* required=false,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="Pretraitement Response",
* @SWG\Schema(ref="#/definitions/pretraitements")
* )
* )
*/
/**
* get informations about mode
*/
function GET() {
$this->aFields = $this->getFields($this->aProperties['schema_anc'], 'v_pretraitement', 'id_pretraitement', 'anc_saisie_anc_pretraitement', 'anc');
}
/**
* delete a Point_situation
*/
function DELETE() {
$this->oConnection->oBd->delete($this->aProperties['schema_anc'], 'v_pretraitement', 'id_pretraitement', $this->aValues["my_vitis_id"], 'integer');
if ($this->oConnection->oBd->enErreur()) {
$this->oError = new VitisError(1, $this->oConnection->oBd->getBDMessage());
} else {
$this->aFields["id_pretraitement"] = $this->aValues["my_vitis_id"];
}
}
}
?>
<?php
/**
* \file Pretraitements.class.inc
* \class Pretraitements
*
* \author WAB <support.wab@veremes.com>.
*
* \brief This file contains the Pretraitements php class
*
* This class defines Rest Api to Vitis Pretraitements
*
*/
require_once __DIR__ . '/Anc.class.inc';
require_once 'Pretraitement.class.inc';
class Pretraitements extends Anc {
/**
* @SWG\Definition(
* definition="/pretraitements",
* allOf={
* @SWG\Schema(ref="#/definitions/pretraitements")
* }
* )
* * @SWG\Tag(
* name="Pretraitements",
* description="Operations about Pretraitements"
* )
*/
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
*/
function __construct($aPath, $aValues, $properties) {
$this->aValues = $aValues;
$this->aPath = $aPath;
$this->aProperties = $properties;
$this->oConnection = new Connection($this->aValues, $this->aProperties);
$this->oFilesManager = new Files_manager($this->aProperties);
}
/**
* @SWG\Get(path="/pretraitements",
* tags={"Pretraitements"},
* summary="Get Pretraitements",
* description="Request to get Pretraitements",
* operationId="GET",
* produces={"application/xml", "application/json", "application/x-vm-json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="order_by",
* in="query",
* description="list of ordering fields",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="sort_order",
* in="query",
* description="sort_order",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="limit",
* in="query",
* description="number of element",
* required=false,
* type="integer",
* format="int32"
* ),
* @SWG\Parameter(
* name="offset",
* in="query",
* description="index of first element",
* required=false,
* type="string",
* format="int32"
* ),
* @SWG\Parameter(
* name="attributs",
* in="query",
* description="list of attributs",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="filter",
* in="query",
* description="filter results",
* required=false,
* type="string"
* ),
* @SWG\Parameter(
* name="distinct",
* in="query",
* description="delete duplicates",
* required=false,
* type="boolean"
* ),
* @SWG\Response(
* response=200,
* description="pretraitement Response",
* @SWG\Schema(ref="#/definitions/pretraitements")
* )
* )
*/
/**
* get Pretraitements
* @return Pretraitements
*/
function GET() {
$aReturn = $this->genericGet($this->aProperties['schema_anc'], "v_pretraitement", "id_pretraitement");
$sMessage = $aReturn['sMessage'];
return $sMessage;
}
/**
* @SWG\Post(path="/pretraitements",
* tags={"Pretraitements"},
* summary="Add pretraitement",
* description="Request to add Pretraitements",
* operationId="POST",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="pretraitement Response",
* @SWG\Schema(ref="#/definitions/pretraitements")
* )
* )
*/
/**
* insert pretraitement
* @return id of the pretraitement created
*/
function POST() {
$this->aValues['create'] = $_SESSION["ses_Login"];
$this->aValues['create_date'] = date('Y-m-d');
$aDates = array('ptr_vi_date');
foreach ($aDates as $sDate) {
if (isset($this->aValues[$sDate])) {
if ($this->aValues[$sDate] == '')
unset($this->aValues[$sDate]);
else
$this->aValues[$sDate] = date_format(date_create_from_format('d/m/Y', $this->aValues[$sDate]), 'Y-m-d');
}
}
// Fichiers à uploader
$aUploadFiles = array(
'photos_f' => [],
'fiche_f' => [],
'schema_f' => [],
'documents_f' => [],
'plan_f' => []
);
// Envoi Post
$aReturn = $this->genericPost($this->aProperties['schema_anc'], 'v_pretraitement', $this->aProperties['schema_anc'].'.pretraitement_id_pretraitement_seq', 'id_pretraitement', $aUploadFiles, 'anc_saisie_anc_pretraitement', 'anc');
return $aReturn['sMessage'];
}
/**
* @SWG\Put(path="/pretraitements/{id_pretraitement}",
* tags={"Pretraitements"},
* summary="update Pretraitements",
* description="Request to update Pretraitements",
* operationId="PUT",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="Pretraitement token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="id_pretraitement",
* in="path",
* description="id of the Pretraitements",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/pretraitements")
* )
* )
*/
/**
* update pretraitements
* @return id of pretraitements updated or error object if a pretraitements is not updated
*/
function PUT() {
if (empty($this->aValues['maj']))
$this->aValues['maj'] = $_SESSION["ses_Login"];
if (empty($this->aValues['maj_date']))
$this->aValues['maj_date'] = date('Y-m-d');
$aDates = array('ptr_vi_date');
foreach ($aDates as $sDate) {
if (isset($this->aValues[$sDate])) {
if ($this->aValues[$sDate] == '')
unset($this->aValues[$sDate]);
else
$this->aValues[$sDate] = date_format(date_create_from_format('d/m/Y', $this->aValues[$sDate]), 'Y-m-d');
}
}
// Fichiers à uploader
$aUploadFiles = array(
'photos_f' => [],
'fiche_f' => [],
'schema_f' => [],
'documents_f' => [],
'plan_f' => []
);
// Envoi Put
$aReturn = $this->genericPut($this->aProperties['schema_anc'], 'v_pretraitement', 'id_pretraitement', $aUploadFiles, 'anc_saisie_anc_evacuation_eaux', 'anc');
return $aReturn['sMessage'];
}
/**
* @SWG\Delete(path="/pretraitements",
* tags={"Pretraitements"},
* summary="delete Pretraitements",
* description="Request to delete Pretraitements",
* operationId="DELETE",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="idList",
* in="query",
* description="id of the pretraitement",
* required=true,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="pretraitement Response",
* @SWG\Schema(ref="#/definitions/pretraitements")
* )
* )
*/
/**
* @SWG\Delete(path="/pretraitements/{id_pretraitement}",
* tags={"Pretraitements"},
* summary="delete Pretraitements",
* description="Request to delete Pretraitements",
* operationId="DELETE",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="Pretraitement token",
* required=true,
* type="string"
* ),
* * @SWG\Parameter(
* name="id_pretraitement",
* in="path",
* description="id of the Pretraitements",
* required=true,
* type="integer",
* format = "int32"
* ),
* @SWG\Response(
* response=200,
* description="Poprerties Response",
* @SWG\Schema(ref="#/definitions/pretraitements")
* )
* )
*/
/**
* delete pretraitements
* @return id of pretraitements deleted or error object if a pretraitements is not deleted
*/
function DELETE() {
$aReturn = $this->genericDelete($this->aProperties['schema_anc'], 'v_pretraitement', 'id_pretraitement');
return $aReturn['sMessage'];
}
}
?>
<?php
require_once __DIR__ . '/Anc.class.inc';
require_once dirname($_SERVER['SCRIPT_FILENAME']) . '/class/vitis_lib/Connection.class.inc';
/**
* \file Traitement.class.inc
* \class Traitement
*
* \author WAB <support.wab@veremes.com>.
*
* \brief This file contains the Traitement php class
*
* This class defines operation for one Traitement
*
*/
class Traitement extends Anc {
public $oError;
/**
* construct
* @param type $aPath url of the request
* @param type $aValues parameters of the request
* @param type $properties properties
* @param type $oConnection connection object
*/
function __construct($aPath, $aValues, $properties) {
$this->aValues = $aValues;
$this->aPath = $aPath;
$this->aProperties = $properties;
$this->oConnection = new Connection($this->aValues, $this->aProperties);
$this->oFilesManager = new Files_manager($this->aProperties);
}
/**
* @SWG\Get(path="/traitements/{id_traitement}",
* tags={"Traitements"},
* summary="Get Traitement",
* description="Request to get Traitement by id",
* operationId="GET",
* produces={"application/xml", "application/json"},
* @SWG\Parameter(
* name="token",
* in="query",
* description="user token",
* required=true,
* type="string"
* ),
* @SWG\Parameter(
* name="id_traitement",
* in="path",
* description="id_traitement",
* required=true,
* type="integer",
* format="int32"
* ),
* @SWG\Parameter(
* name="attributs",
* in="query",
* description="list of attributs",
* required=false,
* type="string"
* ),
* @SWG\Response(
* response=200,
* description="Traitement Response",
* @SWG\Schema(ref="#/definitions/traitements")
* )
* )
*/
/**
* get informations about mode
*/
function GET() {
$this->aFields = $this->getFields($this->aProperties['schema_anc'], 'v_traitement', 'id_traitement', 'anc_saisie_anc_traitement', 'anc');
}
/**
* delete a Point_situation
*/
function DELETE() {
$this->oConnection->oBd->delete($this->aProperties['schema_anc'], 'v_traitement', 'id_traitement', $this->aValues["my_vitis_id"], 'integer');
if ($this->oConnection->oBd->enErreur()) {
$this->oError = new VitisError(1, $this->oConnection->oBd->getBDMessage());
} else {
$this->aFields["id_traitement"] = $this->aValues["my_vitis_id"];
}
}
}
?>