gerrit
|
| Posted: 03/26/2005, 7:06 AM |
|
I'm searching for a multiple colums example. I wan't to display
8 x 2 records in one grid.
|
|
|
 |
Nicole
Posts: 586
|
| Posted: 03/28/2005, 5:11 AM |
|
Gerrit,
You can check this article on GotoCode, it describes how to create grid with several columns with CCS http://www.gotocode.com/art.asp?art_id=115&
_________________
Regards,
Nicole |
 |
 |
gerrit
|
| Posted: 03/28/2005, 10:43 AM |
|
hello Nicole
I look on http://www.gotocode.com/art.asp?art_id=115&
I have done what stood there, but it does not work. This I have done
Html
<!-- BEGIN Row -->
{open}
<td class="StormyWeatherColumnTD" nowrap><a class="StormyWeatherDataLink" href="{image_url}"><img class="StormyWeatherInput" height="140" src="images/{image_url_Src}" width="140" border="0"></a></td>
<td class="StormyWeatherDataTD">
<table class="StormyWeatherFormTABLE" cellspacing="0" cellpadding="2" style="WIDTH: 329px; HEIGHT: 94px">
<td class="StormyWeatherColumnTD" nowrap>Artikel Nr.</td>
<td class="StormyWeatherDataTD">{product_name} </td>
<td class="StormyWeatherColumnTD" nowrap>Merk </td>
<td class="StormyWeatherDataTD">{merk} </td>
<td class="StormyWeatherColumnTD" nowrap>Korte Omschrijving </td>
<td class="StormyWeatherDataTD">{korte_omschrijving} </td>
<td class="StormyWeatherColumnTD" nowrap>Prijs </td>
<td class="StormyWeatherDataTD">{price} </td>
</table>
<p> </p>
<p>
<a class="StormyWeatherDataLink" href="{meerinfo}"><img class="" src="images/meerinfo.gif" border="0"></a> <a class="StormyWeatherDataLink" href="{bestellen}"></a></p>
</td>
</tr>{close}
<!-- END Row -->
CODE ---- BeforeShowRow ( server )
global $store_products;
global $i;
global $rec_count;
global $Tpl;
global $i;
if ((int)($i/2) == $i/2)
{
if ($i == 0)
$Tpl->SetVar("open", "<tr>");
else
$Tpl->SetVar("open", "</tr><tr>");
}
else
$Tpl->SetVar("open", "");
if ($i == $rec_count)
$Tpl->SetVar("close", "</tr>");
else
$Tpl->SetVar("close", "");
$i++;
CODE ----- BeforeShow ( server )
//Custom Code @32-17AC310D
// -------------------------
global $store_products;
global $i;
global $rec_count;
$i = 0;
global $DBsqlConn;
$rec_count = CCDLookUp("count(*)", "store_products", "1=1", $DBsqlConn);
$rec_count --;
//End Custom Code
What does I wrong in codecharge studio
|
|
|
 |
Nicole
Posts: 586
|
| Posted: 03/29/2005, 1:34 AM |
|
Gerrit,
Well, HTML seems to be incorrect. I’m not sure what layout inside each table cell you want to get.
I recommend that you experiment with HTML code and probably use <table> and </table> instead of <tr> and </tr> correspondingly in PHP code.
The good way to find out the tags need to be used for {open} and {close} is to copy live page output to any HTML editor and play with HTML there.
_________________
Regards,
Nicole |
 |
 |
gerrit
|
| Posted: 03/29/2005, 8:38 AM |
|
hello
sorry her my new html
HTML------
<html>
<head>
<meta name="GENERATOR" content="CodeCharge Studio 2.3.2.24">
<title>Default</title>
<link rel="stylesheet" type="text/css" href="Style.css">
<link rel="stylesheet" type="text/css" href="Themes/Noise/Style.css">
<link rel="stylesheet" type="text/css" href="Themes/StormyWeather/Style.css">
<link rel="stylesheet" type="text/css" href="Themes/BlueNote/Style.css">
</head>
<body link="#000000" alink="#000000" vlink="#000000" text="#000000" class="BlueNotePageBODY" bgcolor="#dee3ef" style="CLEAR: right; PADDING-RIGHT: 1px; PADDING-LEFT: 1px; FLOAT: left; PADDING-BOTTOM: 1px; MARGIN: 1px; PADDING-TOP: 1px">
<p align="center">{Header}
<!-- BEGIN Record products_search --></p>
<p align="center">
<form name="{HTMLFormName}" action="{Action}" method="post">
<font class="NoiseSectionHeaderFont">Produkt zoeken </font>
<table style="WIDTH: 245px; HEIGHT: 98px" cellspacing="1" cellpadding="2" width="245" border="0">
<tbody>
<tr>
<td> Categorie
<select class="BlueNoteSelect" name="{category_id_Name}">
<option value="" selected>All</option>
{category_id_Options}
</select>
</td>
</tr>
<tr>
<td>Artikel Nr. <input class="BlueNoteInput" maxlength="250" value="{artikelnr}" name="{artikelnr_Name}" style="WIDTH: 148px; HEIGHT: 20px" size="18"> </td>
</tr>
<tr>
<td nowrap>
<!-- BEGIN Button DoSearch --><input class="BlueNoteButton" type="submit" value="Zoeken" name="{Button_Name}"><!-- END Button DoSearch --> </td>
</tr>
</form>
<p></p>
</tbody>
</table>
<!-- END Record products_search -->
<p align="right"></p>
<p> </p>
<p align="center"><a href="{shopping_cart}"><img class="" src="images/uitgebr-zoeken.gif" border="0"></a></p>
<p> <a class="StormyWeatherDataLink" href="{ImageLink1}"></a><a id="ImageLink1" href="http://" name="ImageLink1"></a></p>
<hr style="WIDTH: 649px; HEIGHT: 4px" size="4">
<p id="even<p>" align="center">
<!-- BEGIN Grid store_products --><font class="StormyWeatherFormHeaderFont">Overzicht Produkten </font>
<table class="StormyWeatherFormTABLE" cellspacing="0" cols="2" cellpadding="2" style="WIDTH: 455px; HEIGHT: 196px">
<!-- BEGIN Row -->
<tr>
<td class="StormyWeatherColumnTD" nowrap><a class="StormyWeatherDataLink" href="{image_url}"><img class="StormyWeatherInput" height="140" src="images/{image_url_Src}" width="140" border="0"></a></td>
<td class="StormyWeatherDataTD">
<table class="StormyWeatherFormTABLE" cellspacing="0" cellpadding="2" style="WIDTH: 307px; HEIGHT: 94px">
<tr>
<td class="StormyWeatherColumnTD" nowrap>Artikel Nr.</td>
<td class="StormyWeatherDataTD">{product_name} </td>
</tr>
<tr>
<td class="StormyWeatherColumnTD" nowrap>Merk </td>
<td class="StormyWeatherDataTD">{merk} </td>
</tr>
<tr>
<td class="StormyWeatherColumnTD" nowrap>Korte Omschrijving </td>
<td class="StormyWeatherDataTD">{korte_omschrijving} </td>
</tr>
<tr>
<td class="StormyWeatherColumnTD" nowrap>Prijs </td>
<td class="StormyWeatherDataTD">{price} </td>
</tr>
</table>
<p> </p>
<p>
<a class="StormyWeatherDataLink" href="{meerinfo}"><img class="" src="images/meerinfo.gif" border="0"></a> <a class="StormyWeatherDataLink" href="{bestellen}"></a></p>
</td>
</tr>
<!-- END Row -->
<!-- BEGIN NoRecords -->
<tr>
<td class="StormyWeatherDataTD" colspan="2">Geen gegevens </td>
</tr>
<!-- END NoRecords -->
<tr>
<td class="StormyWeatherFooterTD" nowrap colspan="2">
<!-- BEGIN Navigator Navigator -->
<!-- BEGIN Prev_On --><a class="StormyWeatherNavigatorLink" href="{Prev_URL}">Vorige</a> <!-- END Prev_On -->
<!-- BEGIN Prev_Off -->Vorige <!-- END Prev_Off --> {Page_Number}
<!-- BEGIN Next_On --><a class="StormyWeatherNavigatorLink" href="{Next_URL}">Volgende</a> <!-- END Next_On -->
<!-- BEGIN Next_Off -->Volgende <!-- END Next_Off --><!-- END Navigator Navigator --> </td>
</tr>
</table>
<!-- END Grid store_products --></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
</body>
</html>
CODE ---- BeforeShowRow ( server )
global $store_products;
global $i;
global $rec_count;
global $Tpl;
global $i;
if ((int)($i/2) == $i/2)
{
if ($i == 0)
$Tpl->SetVar("open", "<tr>");
else
$Tpl->SetVar("open", "</tr><tr>");
}
else
$Tpl->SetVar("open", "");
if ($i == $rec_count)
$Tpl->SetVar("close", "</tr>");
else
$Tpl->SetVar("close", "");
$i++;
CODE ----- BeforeShow ( server )
//Custom Code @32-17AC310D
// -------------------------
global $store_products;
global $i;
global $rec_count;
$i = 0;
global $DBsqlConn;
$rec_count = CCDLookUp("count(*)", "store_products", "1=1", $DBsqlConn);
$rec_count --;
//End Custom Code
Dis Is wat I have but it is not working
What does I wrong in codecharge studio
|
|
|
 |
Nicole
Posts: 586
|
| Posted: 03/30/2005, 12:17 AM |
|
Gerrit,
For my opinion it’d be enough to replace the first open and close <tr> tags of HTML Row with template variables.
E.g.
Instead of
<table class="StormyWeatherFormTABLE" cellspacing="0" cols="2" cellpadding="2" style="WIDTH: 455px; HEIGHT: 196px">
<!-- BEGIN Row -->
<tr>
<td class="StormyWeatherColumnTD" nowrap>
And
</td>
</tr>
<!-- END Row -->
Use
<table class="StormyWeatherFormTABLE" cellspacing="0" cols="2" cellpadding="2" style="WIDTH: 455px; HEIGHT: 196px">
<!-- BEGIN Row -->
{open}
<td class="StormyWeatherColumnTD" nowrap>
And
</td>
{close}
<!-- END Row -->
_________________
Regards,
Nicole |
 |
 |
gerrit
|
| Posted: 03/30/2005, 9:05 AM |
|
Hello,
I have adapted my html
<html>
<head>
<meta name="GENERATOR" content="CodeCharge Studio 2.3.2.24">
<title>Default</title>
<link rel="stylesheet" type="text/css" href="Style.css">
<link rel="stylesheet" type="text/css" href="Themes/Noise/Style.css">
<link rel="stylesheet" type="text/css" href="Themes/StormyWeather/Style.css">
<link rel="stylesheet" type="text/css" href="Themes/BlueNote/Style.css">
</head>
<body link="#000000" alink="#000000" vlink="#000000" text="#000000" class="BlueNotePageBODY" bgcolor="#dee3ef" style="CLEAR: right; PADDING-RIGHT: 1px; PADDING-LEFT: 1px; FLOAT: left; PADDING-BOTTOM: 1px; MARGIN: 1px; PADDING-TOP: 1px">
<p align="center">{Header}
<!-- BEGIN Record products_search --></p>
<p align="center">
<form name="{HTMLFormName}" action="{Action}" method="post">
<font class="NoiseSectionHeaderFont">Produkt zoeken </font>
<table style="WIDTH: 245px; HEIGHT: 98px" cellspacing="1" cellpadding="2" width="245" border="0">
<tbody>
<tr>
<td> Categorie
<select class="BlueNoteSelect" name="{category_id_Name}">
<option value="" selected>All</option>
{category_id_Options}
</select>
</td>
</tr>
<tr>
<td>Artikel Nr. <input class="BlueNoteInput" maxlength="250" value="{artikelnr}" name="{artikelnr_Name}" style="WIDTH: 148px; HEIGHT: 20px" size="18"> </td>
</tr>
<tr>
<td nowrap>
<!-- BEGIN Button DoSearch --><input class="BlueNoteButton" type="submit" value="Zoeken" name="{Button_Name}"><!-- END Button DoSearch --> </td>
</tr>
</form>
<p></p>
</tbody>
</table>
<!-- END Record products_search -->
<p align="right"></p>
<p> </p>
<p align="center"><a href="{shopping_cart}"><img class="" src="images/uitgebr-zoeken.gif" border="0"></a></p>
<p> <a class="StormyWeatherDataLink" href="{ImageLink1}"></a><a id="ImageLink1" href="http://" name="ImageLink1"></a></p>
<hr style="WIDTH: 649px; HEIGHT: 4px" size="4">
<p id="even<p>" align="center">
<!-- BEGIN Grid store_products --><font class="StormyWeatherFormHeaderFont">Overzicht Produkten </font>
<table class="StormyWeatherFormTABLE" cellspacing="0" cols="2" cellpadding="2" style="WIDTH: 455px; HEIGHT: 196px">
<!-- BEGIN Row -->
{open}
<td class="StormyWeatherColumnTD" nowrap><a class="StormyWeatherDataLink" href="{image_url}"><img class="StormyWeatherInput" height="140" src="images/{image_url_Src}" width="140" border="0"></a></td>
<td class="StormyWeatherDataTD">
<table class="StormyWeatherFormTABLE" cellspacing="0" cellpadding="2" style="WIDTH: 307px; HEIGHT: 94px">
<tr>
<td class="StormyWeatherColumnTD" nowrap>Artikel Nr.</td>
<td class="StormyWeatherDataTD">{product_name} </td>
</tr>
<tr>
<td class="StormyWeatherColumnTD" nowrap>Merk </td>
<td class="StormyWeatherDataTD">{merk} </td>
</tr>
<tr>
<td class="StormyWeatherColumnTD" nowrap>Korte Omschrijving </td>
<td class="StormyWeatherDataTD">{korte_omschrijving} </td>
</tr>
<tr>
<td class="StormyWeatherColumnTD" nowrap>Prijs </td>
<td class="StormyWeatherDataTD">{price} </td>
</tr>
</table>
<p> </p>
<p>
<a class="StormyWeatherDataLink" href="{meerinfo}"><img class="" src="images/meerinfo.gif" border="0"></a> <a class="StormyWeatherDataLink" href="{bestellen}"></a></p>
</td>
{close}
<!-- END Row -->
<!-- BEGIN NoRecords -->
<tr>
<td class="StormyWeatherDataTD" colspan="2">Geen gegevens </td>
</tr>
<!-- END NoRecords -->
<tr>
<td class="StormyWeatherFooterTD" nowrap colspan="2">
<!-- BEGIN Navigator Navigator -->
<!-- BEGIN Prev_On --><a class="StormyWeatherNavigatorLink" href="{Prev_URL}">Vorige</a> <!-- END Prev_On -->
<!-- BEGIN Prev_Off -->Vorige <!-- END Prev_Off --> {Page_Number}
<!-- BEGIN Next_On --><a class="StormyWeatherNavigatorLink" href="{Next_URL}">Volgende</a> <!-- END Next_On -->
<!-- BEGIN Next_Off -->Volgende <!-- END Next_Off --><!-- END Navigator Navigator --> </td>
</tr>
</table>
<!-- END Grid store_products --></p>
<p></p>
<p></p>
<p></p>
<p></p>
<p></p>
</body>
</html>
I hoop it is oke den I make dis
CODE ---- BeforeShowRow ( server )
global $store_products;
global $i;
global $rec_count;
global $Tpl;
global $i;
if ((int)($i/2) == $i/2)
{
if ($i == 0)
$Tpl->SetVar("open", "<tr>");
else
$Tpl->SetVar("open", "</tr><tr>");
}
else
$Tpl->SetVar("open", "");
if ($i == $rec_count)
$Tpl->SetVar("close", "</tr>");
else
$Tpl->SetVar("close", "");
$i++;
CODE ----- BeforeShow ( server )
//Custom Code @32-17AC310D
// -------------------------
global $store_products;
global $i;
global $rec_count;
$i = 0;
global $DBsqlConn;
$rec_count = CCDLookUp("count(*)", "store_products", "1=1", $DBsqlConn);
$rec_count --;
//End Custom Code
en I upload but it Is Not Oke, make I dis code Oke ??
Thanks that you want help me!!
|
|
|
 |
Nicole
Posts: 586
|
| Posted: 03/31/2005, 12:33 AM |
|
Gerrit,
Both HTML and PHP looks OK. It seems that it should work and you get 2 columns in a grid. I don’t know what you mean by "I upload but it Is Not Oke". Can you provide a link to your page?
_________________
Regards,
Nicole |
 |
 |
gerrit
|
| Posted: 03/31/2005, 10:57 AM |
|
Hello Nicole,
I hef een error on my site Fatal error: Call to a member function on a non-object in /home/resellers/841289/841289/datrepareerikzelfwel.nl/www/Common.php on line 375, Im looking in my common dis is line 375
function CCGetDBValue($sql, &$db)
{
$db->query($sql); <--- line 375
$dbvalue = $db->next_record() ? $db->f(0) : "";
return $dbvalue;
}
my url is http://www.datrepareerikzelfwel.nl/Default.php
Im using sql, ken jou take e look for me ! wats wrong
|
|
|
 |
Nicole
Posts: 586
|
| Posted: 04/01/2005, 1:36 AM |
|
Gerrit,
If you do not use other custom code then error is produced for this line
$rec_count = CCDLookUp("count(*)", "store_products", "1=1", $DBsqlConn);
Remember, you need to use real database connection name, form name, field and table names.
_________________
Regards,
Nicole |
 |
 |
gerrit
|
| Posted: 04/01/2005, 4:15 AM |
|
hello Nicole
I dont ketit, I haf 1 grid whit de name store_products
In my sql do I hef a table whit de name store_products so
I do not get it.
Is possible it you me explaining what I must do
Thanks.
|
|
|
 |
Nicole
Posts: 586
|
| Posted: 04/01/2005, 5:23 AM |
|
Just make sure that table name that is used as form’s data source is "store_products".
And please make sure you’re using valid database connection name. If "sqlConn" is not connection name, please use real name in a code.
_________________
Regards,
Nicole |
 |
 |
gerrit
|
| Posted: 04/01/2005, 5:35 AM |
|
hello,
"sqlConn" is dit my sql database name
example "gerrit "
sorry Im new whit php
|
|
|
 |
Nicole
Posts: 586
|
| Posted: 04/01/2005, 5:38 AM |
|
You need to use database connection name you created in CCS project (not MYSQL database name). To check the connection name open database Connection dialog.
E.g. if connection name is Connection1 then corresponding variable name is $DBConnection1
_________________
Regards,
Nicole |
 |
 |
gerrit
|
| Posted: 04/01/2005, 5:46 AM |
|
thank jou,
So my code is nou
CODE ----- BeforeShow ( server )
global $store_products;
global $i;
global $rec_count;
$i = 0;
global $DBInternetDB;
$rec_count = CCDLookUp("count(*)", "store_products", "1=1", $DBInternetDB);
$rec_count --;
|
|
|
 |
gerrit
|
| Posted: 04/01/2005, 5:55 AM |
|
if I nou look on my site http://www.datrepareerikzelfwel.nl/Default.php
I see that it not works I get 7 columns in a grid
end I wand 2 columms in a grid
I hef dis code I siems oke but wat ken I do
CODE ---- BeforeShowRow ( server )
global $store_products;
global $i;
global $rec_count;
global $Tpl;
global $i;
if ((int)($i/2) == $i/10)
{
if ($i == 0)
$Tpl->SetVar("open", "<tr>");
else
$Tpl->SetVar("open", "</tr><tr>");
}
else
$Tpl->SetVar("open", "");
if ($i == $rec_count)
$Tpl->SetVar("close", "</tr>");
else
$Tpl->SetVar("close", "");
$i++;
|
|
|
 |
Nicole
Posts: 586
|
| Posted: 04/01/2005, 6:02 AM |
|
In this code line you need to use the number of columns you want to get
if ((int)($i/K) == $i/K)
where K is number of columns. If you want to get 2 columns use
if ((int)($i/2) == $i/2)
_________________
Regards,
Nicole |
 |
 |
gerrit
|
| Posted: 04/01/2005, 6:25 AM |
|
Nicole,
It works
Thank jou
|
|
|
 |
|