[eluser]Zimooon[/eluser]
Hey guys,
in my controller i got those 2 functions:
Code:
function showfolder()
{
$data = array();
$data['folders'] = $this->folder_model->getFolder();
$this->load->view('auth/folderlist', $data);
$this->data['title'] = "Bilderordner";
}
function showimage()
{
$data = array();
$folderx = $this->input->post('folderx');
$data['images'] = $this->image_model->getImages();
$this->load->view('auth/imagelist', $data , $folderx);
$this->data['title'] = "Bilder";
}
here is the view for showfolder:
Code:
<th class="thAktion">Aktion</th>
</tr><?php foreach($folders as $folders_row): ?>
<tr class="<?php echo alternator('even', 'odd');?>">
<td><?php echo $folders_row['id']; ?>
<a name="folderx" id="folderx" href="/upload/showimage/"><?php echo $folders_row['foldername']; ?> </a> //* this line is important *//
<?php echo $folders_row['tag'];
?>
</td>
and here is the view of showimage:
Code:
</tr><?php foreach($images as $images_row): ?>
<tr class="<?php echo alternator('even', 'odd');?>">
<td><?php if($images_row['folder'] == 'folderx' ):?>
<img src="<?php echo $images_row['imagepath'];?>">
</td>
</tr>
<?php endif;?>
<?php endforeach ?>
So as you maybe see i have folders which are stored in a DB.
They are echoed in showfolder and are linked to showimage.
I want that the link i click (f.e. Folder1) all images with 'folder == Folder1 are shown.
Whats the problem? folderx get the input and the a href hast the id/name foldex .
When i change
Code:
<?php if($images_row['folder'] == 'folderx' ):?>
to
Code:
<?php if($images_row['folder'] == 'folder1' ):?>
all images in folder1(have db tag folder1) are shown and no others in DB.
Please help
have a nice day