class.webportoflio.php
----------------------
function getportfolio($id)
{
$id = (int) $id;
$sel = mysql_query("SELECT * FROM portfolio WHERE ID = $id LIMIT 1");
$portfolio = mysql_fetch_array($sel,MYSQL_ASSOC);
if (!empty($portfolio))
{
$portfolio["id"] = stripslashes($portfolio["id"]);
$portfolio["name"] = stripslashes($portfolio["name"]);
$portfolio["description"] = stripslashes($portfolio["description"]);
return $portfolio;
}
else
{
return false;
}
}
function getportfolios()
{
$category = mysql_real_escape_string($category);
$portfolios = array();
$sel1 = mysql_query("SELECT id, name, description FROM portfolio");
while ($portfolio = mysql_fetch_array($sel1))
{
$theportfolio = $this->getportfolio($portfolio["ID"]);
array_push($portfolios, $theportfolio);
}
if (!empty($portfolios))
{
return $portfolios;
}
else
{
return false;
}
}
----------------------
manageportfolio.php
----------------------
$portfolio = new webportfolio();
$listportfolio = $portfolio->getportfolios($id);
....
if ($action == "config")
{
$title = $langfile['configwebsite'];
$template->assign("title", $title);
$template->display("configwebsite.tpl");
} elseif ($action == "portfolio")
{
$title = $langfile['addportfolio'];
$template->assign("title", $title);
$template->assign("getlistportfolio", $listportfolio);
$template->display("showportfolio.tpl");
....
----------------------
showportfolio.tpl
----------------------
<div class="block" id="website" style = "{$websitestyle}">
<table cellpadding="0" cellspacing="0" border="0">
<thead>
<tr>
<th class="a"></th>
<th class="b">{#title#}</th>
<th class="c">{#description#}</th>
<th class="tools"></th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="4"></td>
</tr>
</tfoot>
{section name=portfolio loop=$getlistportfolio}
{*Color-Mix*}
{if $smarty.section.portfolio.index % 2 == 0}
<tbody class="color-a" id="proj_{$getlistportfolio[portfolio].id}">
{else}
<tbody class="color-b" id="proj_{$getlistportfolio[portfolio].id}">
{/if}
<tr>
<td></td>
<td>{$getlistportfolio[portfolio].id}</td>
<td>{$getlistportfolio[portfolio].description}</td>
<td class="tools">
{if $userpermissions.projects.edit}
<a class="tool_edit" href="manageproject.php?action=editform&id={$getlistportfolio[portfolio].id}" title="{#edit#}" ></a>{/if}
{if $userpermissions.projects.del}
<a class="tool_del" href="javascript:confirmfunction('{#confirmdel#}','deleteElement(\'proj_{$getlistportfolio[portfolio].id}\',\'manageproject.php?action=del&id={$getlistportfolio[portfolio].id}\')');" title="{#delete#}"></a>
{/if}
</td>
</tr>
<tr class="acc">
<td colspan="5">
<div class="accordion_toggle"></div>
<div class="accordion_content">
<div class="acc-in">
<div class="message-in">
{$getlistportfolio[portfolio].desc}
</div>
</div>
</div>
</td>
</tr>
</tbody>
{/section}
</table>
<div class="tablemenue"></div>
</div> {*block END*}
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.