Your IP : 216.73.217.64


Current Path : /home3/gp97/baillifpre.97gp.net/core/sql/pgsql/
Upload File :
Current File : //home3/gp97/baillifpre.97gp.net/core/sql/pgsql/om_etat.inc.php

<?php
/**
 *
 *
 * @package openmairie_exemple
 * @version SVN : $Id: om_etat.inc.php 2726 2014-03-07 08:59:25Z fmichon $
 */

//
include "../gen/sql/pgsql/om_etat.inc.php";

//
$champAffiche = array(
    'om_etat.om_etat as "'._("om_etat").'"',
    'om_etat.id as "'._("id").'"',
    'om_etat.libelle as "'._("libelle").'"',
    "case om_etat.actif when 't' then 'Oui' else 'Non' end as \""._("actif")."\"",
    'om_collectivite.niveau as "'._("niveau").'"',
);
//
if ($_SESSION['niveau'] == '2') {
    array_push($champAffiche, "om_collectivite.libelle as \""._("collectivite")."\"");
}
//
$champRecherche = array(
    'om_etat.om_etat as "'._("om_etat").'"',
    'om_etat.id as "'._("id").'"',
    'om_etat.libelle as "'._("libelle").'"',
    'om_collectivite.niveau as "'._("niveau").'"',
);
//
if ($_SESSION['niveau'] == '2') {
    array_push($champRecherche, "om_collectivite.libelle as \""._("collectivite")."\"");
}
//
if (isset($f) && $f->isAccredited(array($obj, $obj."_copier"), "OR")) {
    //
    $href_copie = array(
        "lien" => "../scr/valid_copie.php?obj=".$obj."&amp;idx=",
        "id" => "",
        "lib" => "<span class=\"om-icon om-icon-16 om-icon-fix copy-16\" title=\""._("Copier")."\">"._("Copier")."</span>",
    );
    //
    $href[3] = $href_copie;
} else {
    //
    $href_copie = array("lien" => "", "id" => "", "lib" => "");
}

/**
 * Options
 */
if ($_SESSION['niveau'] == '2') {
    $selection = "";
    if ($retourformulaire== 'om_requete') {
        $selection .= " WHERE (".$obj.".om_sql ='".$idx."')";
    }
} else {
    $selection = " WHERE (".$obj.".om_collectivite='".$_SESSION['collectivite']."' or niveau='2')";
    if ($retourformulaire== 'om_requete') {
        $selection .= " AND (".$obj.".om_sql ='".$idx."')";
    }
}

if ($_SESSION['niveau'] == '1') {
    $options = array();
    $option = array(
        "type" => "condition",
        "field" => "om_collectivite.niveau",
        "case" => array(
            "0" => array(
                "values" => array('2', ),
                "style" => "tab_desactive",
                "href" => array(
                    0 => array("lien" => "", "id" => "", "lib" => ""),
                    1 => array("lien" => "", "id" => "", "lib" => ""),
                    2 => array("lien" => "", "id" => "", "lib" => ""),
                    3 => $href_copie,
                ),
            ),
        ),
    );
    array_push($options, $option);
}

?>