Exemple #1
0
 public function __construct($arrayRestFolder = NULL)
 {
     parent::__construct($arrayRestFolder);
     if ($arrayRestFolder != NULL) {
         $this->arrayRestFolder = $arrayRestFolder;
         $this->arrayVariable = Navigation::getVariableArraySlug($this->arrayRestFolder);
     }
     $this->module = DataHandler::getValueByArrayIndex($this->arrayVariable, "module") ? DataHandler::getValueByArrayIndex($this->arrayVariable, "module") : "theme";
     switch ($this->module) {
         case "style":
             $this->DAO = StyleDAO::getInstance();
             break;
         case "technique":
             $this->DAO = TechniqueDAO::getInstance();
             break;
         case "type":
             $this->DAO = TypeDAO::getInstance();
             break;
         case "format":
             $this->DAO = FormatDAO::getInstance();
             break;
         case "composition":
             $this->DAO = CompositionDAO::getInstance();
             break;
         case "theme":
             $this->DAO = ThemeDAO::getInstance();
             break;
         default:
             $this->DAO = ThemeDAO::getInstance();
             break;
     }
 }
Exemple #2
0
 private function consultValues()
 {
     $ProductModelQuadroDAO = ProductModelQuadroDAO::getInstance();
     $this->MaterialDAO = MaterialDAO::getInstance();
     $this->ColorDAO = ColorDAO::getInstance();
     $this->StyleDAO = StyleDAO::getInstance();
     $this->FormatDAO = FormatDAO::getInstance();
     $this->ThemeDAO = ThemeDAO::getInstance();
     $this->CompositionDAO = CompositionDAO::getInstance();
     $this->TechniqueDAO = TechniqueDAO::getInstance();
     $this->TypeDAO = TypeDAO::getInstance();
     //fazendo o que precisa fazer para ter os dados do menu
     $this->arrayMaterial = $this->MaterialDAO->select(MaterialDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayMaterial);
     $this->arrayColor = $this->ColorDAO->select(ColorDAO::RETURN_VO, NULL, 1);
     // $this->addTotal($this->arrayColor);
     //Debug::print_r($this->arrayColor);
     //busca as imagens
     if ($this->arrayColor->success) {
         $tempVO = array();
         foreach ($this->arrayColor->result as $ColorVO) {
             $tempStdColor = $ColorVO->toStdClass();
             //primeira letra maiuscula
             $tempStdColor->name = ucfirst($tempStdColor->name);
             $tempVO[] = $tempStdColor;
             //Debug::print_r($tempVO);
         }
         $this->arrayColor->result = $tempVO;
     }
     $this->arrayStyle = $this->StyleDAO->select(StyleDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayStyle);
     $this->arrayFormat = $this->FormatDAO->select(FormatDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayFormat);
     $this->arrayTheme = $this->ThemeDAO->select(ThemeDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayTheme);
     $this->arrayComposition = $this->CompositionDAO->select(CompositionDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayComposition);
     $this->arrayTechnique = $this->TechniqueDAO->select(TechniqueDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayTechnique);
     $this->arrayType = $this->TypeDAO->select(TypeDAO::RETURN_VO, NULL, 1);
     $this->addTotal($this->arrayType);
     //define a base da url
     $this->url_final = Config::getRootPath("quadros/filter");
     $this->arrayBreadCrumb = array();
     if ($this->arrayVariable != NULL) {
         $temp_array = array_splice($this->arrayRestFolder, 2, count($this->arrayRestFolder) - 1);
         //Debug::print_r($temp_array);
         //exit();
         if ($this->arrayRestFolder[1] == "filter") {
             $this->url_final .= "/" . implode("/", $temp_array);
             //tirando a página da url final
             $this->url_final = preg_replace("/\\/pag\\.[0-9]+?/", "", $this->url_final);
         }
         $array_relacao_variavel_resultado = array();
         $array_relacao_variavel_resultado["search"] = "requestSearch";
         $array_relacao_variavel_resultado["material"] = "requestMaterial";
         $array_relacao_variavel_resultado["color"] = "requestColor";
         $array_relacao_variavel_resultado["style"] = "requestStyle";
         $array_relacao_variavel_resultado["format"] = "requestFormat";
         $array_relacao_variavel_resultado["theme"] = "requestTheme";
         $array_relacao_variavel_resultado["composition"] = "requestComposition";
         $array_relacao_variavel_resultado["technique"] = "requestTechnique";
         $array_relacao_variavel_resultado["type"] = "requestType";
         $array_relacao_variavel_resultado["promocoes"] = "requestPromocao";
         foreach ($this->arrayVariable as $variable => $value) {
             if ($variable == "search" && DataHandler::forceString($value) != NULL) {
                 $this->requestResumeSearch = DataHandler::forceString(urldecode($value));
                 if (strlen($this->requestResumeSearch) > 10) {
                     $this->requestResumeSearch = substr($this->requestResumeSearch, 0, 10) . "...";
                 }
             }
             if (DataHandler::forceInt($value) > 0) {
                 if (isset($array_relacao_variavel_resultado[$variable]) && $array_relacao_variavel_resultado[$variable] != null) {
                     $this->{$array_relacao_variavel_resultado}[$variable] = DataHandler::forceInt(trim($value));
                 }
             } else {
                 //se não nenhum desses itens segnifica q é sujeira por isso não grava na url
                 continue;
             }
             //popula o bread crumb de maneira incompleta pois seria esforço a toa procurar o título aqui
             $this->arrayBreadCrumb[] = new BreadCrumbInfoVO("", $variable, $value);
             //concatena as veriaveis ja enviadas para fazer a base do link
             //$this->url_final .= "/".$variable.".".$value;
         }
     }
 }
<?php

include './DAO/DAO.class.php';
include './DAO/ProfDAO.class.php';
include './DAO/CoursDAO.class.php';
include './DAO/MatiereDAO.class.php';
include './DAO/TypeDAO.class.php';
$profdao = new ProfDAO();
$coursdao = new CoursDAO();
$matieredao = new MatiereDAO();
$typedao = new TypeDAO();
$prof = $profdao->getProfByEmail('*****@*****.**');
$ArrayCours = $coursdao->getCoursByProf($prof);
foreach ($ArrayCours as $row) {
    $ArrayType[] = $typedao->getTypeByNoTypeOfCours($row->getNo_type());
    $ArrayMatiere[] = $matieredao->getMatiereByNoMatiereOfCours($row->getNo_matiere());
}
?>
<html>
	<head>
		<title>Cours</title>
	</head>
	<body>
		<?php 
$i = 0;
foreach ($ArrayCours as $row) {
    echo "<button type=\"button\">" . $ArrayMatiere[$i]->getNom() . " " . $ArrayType[$i]->getNom() . "</button>";
    $i++;
}
?>
	</body>
<?php

include 'DAO\\DAO.class.php';
include 'DAO\\ProfDAO.class.php';
include 'DAO\\CoursDAO.class.php';
include 'DAO\\TypeDAO.class.php';
include 'DAO\\MatiereDAO.class.php';
include 'DAO\\SectionDAO.class.php';
include 'DAO\\SeanceDAO.class.php';
include 'DAO\\EtudiantDAO.class.php';
include 'DAO\\AbsentDAO.class.php';
$profdao = new ProfDAO();
$coursdao = new CoursDAO();
$typedao = new TypeDAO();
$matieredao = new MatiereDAO();
$sectiondao = new SectionDAO();
$seancedao = new SeanceDAO();
$etudiantdao = new EtudiantDAO();
$absentdao = new AbsentDAO();
$ArrayProf = $profdao->getListe();
$prof = $profdao->getProfByEmail('*****@*****.**');
$ArrayCours = $coursdao->getCoursByNoProf($prof->getNo_prof());
foreach ($ArrayCours as $row) {
    $type = $typedao->getTypeByNoTypeOfCours($row->getNo_type());
    $matiere = $matieredao->getMatiereByNoMatiereOfCours($row->getNo_matiere());
    $section = $sectiondao->getSectionByNoSectionOfMatiere($matiere->getNo_section());
    echo $row->getNo_cours() . " " . $prof->getNom() . " " . $type->getNom() . " " . $matiere->getInitiales() . " " . $section->getNom() . ".</br>";
    echo $matiere->getNom() . " (" . $row->getNo_cours() . ") :</br>";
    $ArraySeance = $seancedao->getSeanceByNoCours($row->getNo_cours());
    foreach ($ArraySeance as $row2) {
        echo $row2->getNo_seance() . " : " . $row2->getNo_ordre() . " groupe : " . $row2->getNo_groupe() . "." . $row2->getNo_sous_groupe() . " : </br>";