Exemplo n.º 1
0
        ?>
</button>
			</div>
		</form>
        
<?php 
    } else {
        if (isset($_POST['published'])) {
            $_POST['published'] = true;
        } else {
            $_POST['published'] = false;
        }
        $category = new category();
        $category->setId(intval($_GET['i']));
        $category->setContent($_POST['title_1'], $_POST['description_1'], $_POST['title_2'], $_POST['description_2'], $_POST['title_3'], $_POST['description_3'], $_POST['title_4'], $_POST['description_4'], $_POST['title_5'], $_POST['description_5'], $_POST['title_6'], $_POST['description_6'], $_POST['code']);
        $category->setUserId($account["name"]);
        $category->setDateUpdate();
        $category->setPublished($_POST['published']);
        $category->setCategoryType($_POST['category_type']);
        if ($category->update()) {
            print 'sucess';
        } else {
            print 'failure';
        }
    }
} else {
    print 'error';
}
?>
</div>
Exemplo n.º 2
0
	  <button type="reset" name="cancel" class="red"><?php 
    echo $language['cancel'];
    ?>
</button>
	</div>

	</form>

	<?php 
} else {
    if (isset($_REQUEST['published'])) {
        $_REQUEST['published'] = true;
    } else {
        $_REQUEST['published'] = false;
    }
    $object_category = new category();
    $object_category->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']);
    $object_category->setUserId($account["name"]);
    $object_category->setDate();
    $object_category->setDateUpdate();
    $object_category->setPublished($_REQUEST['published']);
    $object_category->setCategoryType($_REQUEST['section']);
    if ($object_category->insert()) {
        print 'sucess';
    } else {
        print 'failure';
    }
}
?>
</div>