Esempio n. 1
0
        } else {
            $published = false;
        }
        // convert to bool the onhome box
        if (isset($_REQUEST['onhome'])) {
            $onhome = true;
        } else {
            $onhome = false;
        }
        $product->setContent($_REQUEST['title_1'], $_REQUEST['content_1'], $_REQUEST['title_2'], $_REQUEST['content_2'], $_REQUEST['title_3'], $_REQUEST['content_3'], $_REQUEST['title_4'], $_REQUEST['content_4'], $_REQUEST['title_5'], $_REQUEST['content_5'], $_REQUEST['title_6'], $_REQUEST['content_6'], $_REQUEST['code']);
        $product->setReference($_REQUEST['reference']);
        $product->setPrice($_REQUEST['price']);
        $product->setVAT($_REQUEST['vat']);
        $product->setDiscount($_REQUEST['discount']);
        $product->setCategory($_REQUEST['category']);
        $product->setDateUpdate();
        $product->setService($service);
        $product->setPublished($published);
        $product->setonHome($onhome);
        if ($product->update()) {
            print 'sucess';
        } else {
            print 'failure';
        }
    }
} else {
    print 'error';
}
?>
</div>
Esempio n. 2
0
        $_REQUEST['onhome'] = true;
    } else {
        $_REQUEST['onhome'] = false;
    }
    $product = new product();
    $product->setReference($_REQUEST['reference']);
    $product->setContent($_REQUEST['title_1'], $_REQUEST['content_1'], $_REQUEST['title_2'], $_REQUEST['content_2'], $_REQUEST['title_3'], $_REQUEST['content_3'], $_REQUEST['title_4'], $_REQUEST['content_4'], $_REQUEST['title_5'], $_REQUEST['content_5'], $_REQUEST['title_6'], $_REQUEST['content_6'], $_REQUEST['code']);
    $product->setService($_REQUEST['service']);
    $product->setPrice($_REQUEST['price']);
    $product->setVAT($_REQUEST['vat']);
    $product->setDiscount($_REQUEST['discount']);
    $product->setUserId($account['name']);
    $product->setCategory($_REQUEST['category']);
    $product->setDate();
    $product->setDateUpdate();
    $product->setPublished($_REQUEST['published']);
    $product->setonHome($_REQUEST['onhome']);
    if ($product->insert()) {
        print 'sucess';
        $id = $mysqli->insert_id;
        ?>
			<div class="separator30"></div>

			<span id="label">Lista de ficheiros</span>
			<?php 
        print returnFilesList($id, 'product');
        ?>

			<div class="separator30"></div>

			<?php