9 years ago
1
Topic

Hello Everyone,
I'm with a problem that I have no idea how to solve, I am creating an application using the SEBLOD.

The form has already been created and I can view the data entered, however I would like to manipulate the data (add, subtract, etc.).

I am doing so on the Override:

<?php
defined( '_JEXEC' ) or die;


$catId = 11;
$catId2 = 12;

$sql = "SELECT * FROM #__cck_store_form_add_compras";
$con = &JFactory::getDBO();
$con->setQuery($sql);
$resultado = $con->loadObjectList();


$query = "SELECT * FROM #__content WHERE catid ='" . $catId . "' OR catid ='" . $catId2 . "'";
$db = JFactory::getDBO();
$db->setQuery($query);
$articles = $db->loadObjectList();

foreach($articles as $article){
echo '<br/><br/>ID:'. $article->id
.'<br/>Titulo: '. $article->title
.'<br/>Quantidade Comprada: '.$resultado[0]->add_compras_quantidade_comprada
.'<br/>Unidade de Medida: '.$resultado[0]->add_compras_unidade_de_medida
.'<br/>Preço Por Kilo/Unidade: '.$resultado[0]->add_compras_preco_por_unidade_kilo
.'<br/>Data da Compra: '.$resultado[0]->add_compras_data_da_compra
.'<br/>Total da Compra: '.$resultado[0]->add_compras_total_da_compra
.'<br/>Local da Compra: '.$resultado[0]->add_compras_local_da_compra
;
}
?>

Who understands you know where is the error .. I know it could be done differently and blah blah blah, I happen to be beginner (laughs) do not blame me, besides the more this wrong (I know it) .. including the indentation (...) but to understand the .. (I think ...)

How can I make this connection to work and display all the fields correctly?

Sorry for my English because I am using a translator to help me

Get a VIP membership
9 years ago
0
Level 1

Hi,

The best way to display a filtered list of SEBLOD contents is to use a SEBLOD search and display it through a menu item, a module or inside a SEBLOD content (use a CCK module or CCK list field).

In your SEBLOD search, you can set the 'article category id' as filter with "11,12" as default value so only articles in these 2 categories will be retrieved.

For the list template, juste use a basic 'List' template : http://www.seblod.com/products/62 and add the fields you want to displayed to it.

If you need a custom layout for every content, you can use a position override.

If your goal is to manage content (add/edit/view), you can take a look to the manual links below.

Olivier

Get a Book for SEBLOD