Exemplo n.º 1
0
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with NOALYSS; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
// Copyright Author Dany De Bontridder danydb@aevalys.eu
/*!\file
 * \brief Manage the attributs
 */
if (!defined('ALLOWED')) {
    die('Appel direct ne sont pas permis');
}
require_once NOALYSS_INCLUDE . '/class_fiche_attr.php';
$fa = new Fiche_Attr($cn);
/////////////////////////////////////////////////////////////////////////////
// If data are post we save them first
/////////////////////////////////////////////////////////////////////////////
if (isset($_POST['save'])) {
    $ad_id = $_POST['ad_id'];
    $ad_text = $_POST['desc'];
    $ad_type = $_POST['type'];
    $ad_size = $_POST['size'];
    $ad_extra = $_POST['extra'];
    try {
        $cn->start();
        for ($e = 0; $e < count($ad_id); $e++) {
            $fa->set_parameter('id', $ad_id[$e]);
            $fa->set_parameter('desc', $ad_text[$e]);
            $fa->set_parameter('type', $ad_type[$e]);
Exemplo n.º 2
0
switch ($op) {
    /* ------------------------------------------------------------ */
    /* Remove a attribut */
    /* ------------------------------------------------------------ */
    case 'rmfa':
        if ($g_user->check_action(FICCAT) == 0) {
            exit;
        }
        ob_start();
        if (!isset($_GET['ad_id']) || isNumber($_GET['ad_id']) == 0) {
            throw new Exception(_("Parametre ad_id est invalide"), 11);
        }
        $ad_id = $_GET['ad_id'];
        try {
            $cn->start();
            $fa = new Fiche_Attr($cn, $ad_id);
            $fa->delete();
            $cn->commit();
        } catch (Exception $e) {
            $cn->rollback();
            echo $e->getMessage();
        }
        $html = ob_get_contents();
        ob_end_clean();
        break;
        /* ------------------------------------------------------------ */
        /* Display card detail */
        /* ------------------------------------------------------------ */
    /* ------------------------------------------------------------ */
    /* Display card detail */
    /* ------------------------------------------------------------ */