[eluser]007CR[/eluser]
Happy new year 2010 !
I'm a big begnner in CI, so iti is very appreciated if someone here can help me:
I've this on the modal :
function GetLesPlusRecents($argIdThematique=0, $argDebut=0, $argFin=10){
$Sql = "select *
from experiences E
where E.FK_IdThematique = ".$argIdThematique."
order by E.DatePost asc limit ".$argDebut.",".$argFin ;
$Query = $this->db->query($Sql);
return $Query->result();
}
and in the controler :
function LesPlusRecents($argIdThematique = 0,$Page=1){
if(IsValidId($argIdThematique)){
if($Page==1){
$DebutOffset = 0;
$FinOffset = $Page*10;
}else{
$DebutOffset = (10*($Page-1))+1;
$FinOffset = $Page*10;
}
$this->data['Page'] = $Page;
$this->data['Thematique'] = $this->mdlthematique->GetById($argIdThematique);
$this->data["Experiences"] = $this->mdlthematique->GetLesPlusRecents($argIdThematique,$DebutOffset,$FinOffset);
foreach ($this->data["Experiences"] as $IdExp => $Exp) {
$this->data["Createur"][$Exp->PK_IdProbleme] = $this->mdluser->GetById($Exp->FK_IdMembreCreateur);
$this->data["Marques"][$Exp->PK_IdProbleme] = $this->mdlrelexpmarque->GetByExperienceTxt($Exp->PK_IdProbleme);
$this->data['NbReagir'][$Exp->PK_IdProbleme] = $this->mdlreponses->Compter("FK_IdProbleme = ".$Exp->PK_IdProbleme);
$this->data['NbCasSimilaire'][$Exp->PK_IdProbleme] = null;
}
//$this->debug(array($this->data));
$this->load->view('vwThematiquesLesPlusRecents',$this->data);
}
}
I don't know how to put it on a view!
Thank ou very much!