Example #1
0
	/**
	 * @covers Bedrock\View::printValue
	 * @covers Bedrock\View::setValue
	 *
	 * @return void
	 */
	public function testPrintValue() {
		// Setup
		$this->_object->setValue('test', 'Lorem ipsum dolor sit amet, consectetur adipisicing elit.');

		// Assertions
		$this->expectOutputString('Lorem ipsum dolor sit amet, consectetur adipisicing elit.');
		$this->_object->printValue('test');
	}
Example #2
0
 public function edit()
 {
     try {
         // define view
         $view = new View("editar_registro.html");
         $view->addFile("TOPO", "topo.html");
         $vData = new DateTime(str_replace("/", "-", $_GET["_token"]));
         // preenche view com dados do profissional
         $oProf = new Profissional();
         $oProf = Sessao::getObject("oProf");
         $vTitulo = ":: EDITAR REGISTRO DE PONTO :: " . $oProf->getMatricula() . " - " . $oProf->getNome() . " :: " . $oProf->getFuncao();
         $view->setValue("TITULO", $vTitulo);
         // preenche view com dados do registro
         $oRegistro = new Registro();
         $oRegistro = $this->model->getByDate($oProf, $vData->format("d-m-Y"));
         $view->setValue("DATA", $vData->format("d-m-Y"));
         $view->setValue("DIASEMANA", Data::getDiaSemana($vData));
         if ($oRegistro) {
             $view->setValue("ENTRADA", $oRegistro->getEntradaManha());
             $view->setValue("ALMOCO", $oRegistro->getSaidaManha());
             $view->setValue("RETORNO", $oRegistro->getEntradaTarde());
             $view->setValue("SAIDA", $oRegistro->getSaidaTarde());
         }
         // carrega selects de ocorrencia
         $oOcorrencia = new Ocorrencia();
         $vOcorrencia = $oOcorrencia->getAll();
         foreach ($vOcorrencia as $row) {
             $view->setValue("CODIGO", $row->getCodigo());
             $view->setValue("DESCRICAO", $row->getDescricao());
             $view->parseBlock("BLOCK_OCORRENCIA1", true);
             $view->parseBlock("BLOCK_OCORRENCIA2", true);
             $view->parseBlock("BLOCK_OCORRENCIA3", true);
             $view->parseBlock("BLOCK_OCORRENCIA4", true);
         }
         // exibe view
         $view->addFile("FOOTER", "rodape.html");
         $view->show();
     } catch (Exception $e) {
         die($e->getMessage());
     }
 }