08-12-2009, 04:53 PM
[eluser]adrian.web20[/eluser]
I'm really really tired.
I've been working all day on this. First of all, the User Guide helped me a lot but until a point. Right now, my head doesn't help me a lot.
I seriously need somebody to tell me "Dude, it's wrong because: "
Please help me :| I'm kinda desperate.
I want to make a job seeker website. I've made a db with some job domains categories. This is the URL for testing purposes: http://blt.ath.cx/
I've hit a big bad wall here. As you can see on the website. The rewrite works perfectly... a bit messed up but that's not a problem, for now.
I've manage to go so far but... know I realize I can't do nothing because I don't know how to get the ID from the category, which is very important.
Can somebody please, look over my work and give me some suggestions? I can't continue without your help :|
Thank you
acasa.php
oferta.php
2 views
acasa_view.php
domeniu_view.php
.htaccess
I'm really really tired.
I've been working all day on this. First of all, the User Guide helped me a lot but until a point. Right now, my head doesn't help me a lot.
I seriously need somebody to tell me "Dude, it's wrong because: "
Please help me :| I'm kinda desperate.
I want to make a job seeker website. I've made a db with some job domains categories. This is the URL for testing purposes: http://blt.ath.cx/
I've hit a big bad wall here. As you can see on the website. The rewrite works perfectly... a bit messed up but that's not a problem, for now.
I've manage to go so far but... know I realize I can't do nothing because I don't know how to get the ID from the category, which is very important.
Can somebody please, look over my work and give me some suggestions? I can't continue without your help :|
Thank you
acasa.php
Code:
<?php
class Acasa extends Controller{
function Acasa()
{
parent::Controller();
$this->load->scaffolding('domenii');
}
function index()
{
$data['title'] = "http://www.AngajariPitesti.ro/";
$data['heading'] = "Lista cu domenii";
$data['query'] = $this->db->get('domenii');
$this->load->helper('url');
$this->load->view('acasa_view', $data);
}
}
?>
oferta.php
Code:
<?php
class Oferta extends Controller{
function Oferta()
{
parent::Controller();
$this->load->scaffolding('domenii');
}
function categorii($categorie)
{
$data['query'] = $this->db->get('domenii');
$this->load->view('domeniu_view', $data);
}
}
?>
2 views
acasa_view.php
Code:
<html>
<head>
<title><?=$title?></title>
</head>
<body>
<h1><?=$heading?></h1>
<?php foreach($query->result() as $row): ?>
<a >id_domeniu?>-<?=$row->nume_url?>.html"><?=$row->nume_domeniu?>(<?=$row->numar_inscrieri?>)</a><br>
<?php endforeach; ?>
<body>
</html>
domeniu_view.php
Code:
<html>
<head>
</head>
<body>
<a href="">Acasa</a>
<?php echo $_SERVER['PHP_SELF']; ?>
<body>
</html>
.htaccess
Code:
RewriteEngine On
RewriteBase /
RewriteRule ^categorie/(.*)\.html$ oferta/categorii/$1 [C]
RewriteRule ^(.*)$ index.php/$1 [L]