public static function linkEdit(Data $data, $textLink) { $baseUrl = LinkController::getBaseURL(); $idData = $data->getId(); $link = "<a href='{$baseUrl}/admin/datacenter/dado/edit/{$idData}'>"; $link .= $textLink; $link .= "</a>"; echo $link; }
private static function afterCurrent($current, $max_index, $total_news, $max_per_page, $link_type) { $html = ""; for ($i = $current + 1; $i <= $current + $max_index; $i++) { if ($i <= ceil($total_news / $max_per_page)) { $html .= "<a href='" . LinkController::getBaseURL() . "/{$link_type}{$i}'>" . $i . "</a>"; } } return $html; }
private function objectFlash() { $object = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="110" height="110" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="false" /> <param name="movie" value="' . LinkController::getBaseURL() . '/images/logo.swf" /> <param name="quality" value="high" /> <param name="wmode" value="transparent" /> <param name="bgcolor" value="#990000" /> <embed src="' . LinkController::getBaseURL() . '/images/logo.swf" quality="high" wmode="transparent" bgcolor="#990000" width="110" height="110" name="logo" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" /> </object>'; $object = str_replace("\"", "'", $object); return $object; }
public static function editar() { $link = new Link(); $link->selecionarPorId($_GET['id']); if (!empty($_POST)) { $link->titulo = $_POST['titulo']; $link->link = $_POST['link']; $link->salvar(); self::redirecionar(Configuracao::$baseUrl . self::$viewController . '/listar' . Configuracao::$extensaoPadrao); } self::$variaveis = array('link' => $link); self::$corpo = "editar"; self::renderizar(self::$viewController); }
private static function buildImgTag($img) { $image = "<img src='" . LinkController::getBaseURL() . "/images/" . $img . "' alt=''/> "; return $image; }
</thead> <tfoot> <tr> <td></td><td></td><td></td> </tr> </tfoot> <tbody> <?foreach($response as $newRss):?> <tr id="<?echo $newRss->position()?>"> <td><?echo $newRss->title()?></td> <td><?echo $newRss->link()?></td> <td> <a id="<?echo $newRss->id()?>" class="delete" href="<?echo LinkController::getBaseURL()?>/admin/news/delete"> excluir </a> </td> </tr> <?endforeach?> </tbody> </table> <?endif;?> <? //echo "<br />".GenericHandler::prevPage(1, $link); //echo " ".GenericHandler::pages($total, 1, NewsController::$LIMIT_PER_PAGE, $link); //echo " ".GenericHandler::nextPage(1, NewsController::$LIMIT_PER_PAGE, $total, $link); ?> <br /> <a href="<?echo LinkController::getBaseURL()?>/admin/noticias" class="link-goback">Voltar</a>
<? //print_r($_GET)?> <?php if(!empty ($_GET)):?> <? if(!empty($_GET["empty"])):?> <p class="error-login">Os campos devem estar preenchidos</p> <? elseif(!empty($_GET["loginfail"])):?> <p class="error-login">Usuário e/ou senha inválidos!</p> <?endif?> <?endif?> <form id="login-form" action="<?echo LinkController::getBaseURL()?>/admin/login" method="post"> <dl> <dt> <label for="username">usuário</label> </dt> <dd> <input name="username" id="username" class="input" type="text" value="<??>"/> </dd> <dt> <label for="password">senha</label> </dt> <dd> <input name="password" id="password" class="input" type="password" value=""/> </dd> <dd> <input id="loginButton" width="93" height="40" type="image" src="<?echo LinkController::getBaseURL()?>/images/login/login.gif"/> </dd> </dl> </form> </div> </div> <div id="formFooter"></div> </div>
<?$i = 0;?> <?while($daysInfo->valid() && $i < 4):?> <?$dayInfo = $daysInfo->current();?> <?if($i % 2 == 0):?> <tr> <?endif?> <td> <div class="td-weather"> <?echo $dayInfo->day()?> <!--(<?//echo $dayInfo->situation()?>)--> <br/> <div class="weather-info"> <div class="img-weather"> <?echo str_replace("src='imgs", "src='".LinkController::getBaseURL()."/images/weather_imgs", $dayInfo->imageSituation())?> </div> <div class="weather-data"> <img alt="Mínima" src="<?echo LinkController::getBaseURL()?>/images/weather_imgs/cli_min.gif"/> Mín.: <?echo $dayInfo->min()?><br /> <img alt="Mínima" src="<?echo LinkController::getBaseURL()?>/images/weather_imgs/cli_max.gif"/> Max.: <?echo $dayInfo->max()?> </div> </div> </div> </td> <?$i++;?> <?if($i % 2 == 0):?> </tr> <?endif?> <?$daysInfo->next();?> <?endwhile?> </tbody> </table> </div> </div>
public function redirect() { header("Location: " . LinkController::getBaseURL()); }
public function logout(AdminUser $admin) { $admin->logout(); header("Location: " . LinkController::getBaseURL() . "/admin"); }
</form> <a href="" class="l1">Olá, <?echo Session::getLoggedUser()->getFirstName()?></a> | <?endif?> </div> <div class="clear"></div> <!-- #################### --> <!-- APOIO --> <!-- #################### --> <!--<div class="grid_5 apoios" style="float: right"> <div id="imgs-apoios"> <img src="<?echo $baseUrl?>/images/apoio-gov.gif" style="margin-left:2px;margin-top:1px;" /> <img src="<?echo $baseUrl?>/images/apoio-ufla.jpg" style="margin-top:2px;margin-left:2px;" /> <img src="<?echo $baseUrl?>/images/apoio-cim.jpg" style="margin-left: 12px;margin-top:2px;" /> <img src="<?echo $baseUrl?>/images/apoio-fapemig.jpg" style="margin-top:6px;margin-left:3px;" /> <img src="<?echo $baseUrl?>/images/apoio-polo.gif" style="margin-top:2px;margin-left:9px;" /> </div> </div>--> </div> <?if(Session::isLogged()):?> <div class="grid_7 form-login" style="width: 30%; float: right;"> <form action="login" method="POST"> Usuário: <input name="username" type="text" value="<?echo Session::getLoggedUser()->username()?>" class="inpt-txt" /> <br /> Senha: <input name="password" type="password" value="xxxxx" class="inpt-txt" /> <br /> | <a href="<?echo LinkController::getBaseURL()?>/logout" class="l1" id="logout">sair</a> </form> </div> <?endif?> <!-- Fim Topo --> </div>
require_once '../core/generics/City.php'; require_once '../core/generics/Activity.php'; $city = new City(null, $_POST['city']); $activity = new Activity(); $activity->setId($_POST['activity']); $user = new User($_POST['name'], $_POST['username'], $_POST['password']); $user->setEmail($_POST['email']); $user->setCity($city); $user->setActivity($activity); $positions = 'noticias,metereologia|publicacoes,videoteca|cotacoes'; $user->setPositions($positions); $userController = new UserController(new UserDao(Connection::connect())); try { if ($userController->subscribe($user, $_POST['confirm_password'])) { $jsonResponse = new JsonResponse(); print_r($jsonResponse->response(true, 'Usuário cadastrado com sucesso. Você será automaticamente conectado ao sistema')->addValue("redirectTo", LinkController::getBaseURL())->serialize()); Session::login($user); //header('Location: '.LinkController::getBaseURL()); } else { $jsonResponse = new JsonResponse(); print_r($jsonResponse->response(false, 'Falha no cadastro do usuário. Favor tentar novamente')->serialize()); } } catch (Exception $err) { $jsonResponse = new JsonResponse(); print_r($jsonResponse->response(false, $err->getMessage())->serialize()); } } else { $jsonResponse = new JsonResponse(); print_r($jsonResponse->response(false, 'Parâmetros não podem estar vazios')->serialize()); } } else {
<div class="form-insert"> <h2>Insira a planilha com os dados no formulário</h2> <form action="<?echo LinkController::getBaseURL()?>/admin/datacenter/insert" method="post" id="form-datacenter" enctype="multipart/form-data"> <fieldset> <div class="field" style="text-align: center"> <label>Grupo</label> <select id="groups" type="select-one"> <option value=""></option> </select> </div> <div class="field" style="text-align: center"> <label>Subgrupo</label> <select id="subgroups" type="select-one" disabled="disabled"> <option value=""></option> </select> <label>Tipo</label> <select id="coffetype" type="select-one"> <option value=""></option> </select> <label>Variedade</label> <select id="variety" type="select-one"> <option value=""></option> </select> <label>Origem</label> <select id="origin" type="select-one"> <option value=""></option> </select> <label>Destino</label> <select id="destiny" type="select-one"> <option value=""></option> </select>
</head> <body> <div class="container_12"> <h1 style="width: 100%" class="titleadmin">Administrador Bureau Inteligência</h1> <div class="grid_12 menu-apps"> <ul> <li><a href="<?echo $baseUrl?>/admin/publicacoes" id="lnk-publicacoes">Publicações</a></li> <li><a href="<?echo $baseUrl?>/admin/noticias" id="lnk-noticias">Notícias</a></li> <li><a href="" id="lnk-cotacoes">Cotações</a></li> <li><a href="<?echo $baseUrl?>/admin/videos" id="lnk-videoteca">Videoteca</a></li> <li><a href="" id="lnk-metereologia">Meteorologia</a></li> <li class="ultimo"><a href="" id="lnk-datacenter">Data Center</a></li> </ul> <!-- Fim Menu Apps --> </div> <div style="clear:both"></div> <div id="aplicacoes"> <div id="loading"> <img alt="loading" src="<?echo LinkController::getBaseURL()?>/images/ajax-loader.gif" /> </div> <div id="content-middle"> <?include 'loginer.php'?> </div> </div> <div class="clear"></div> <div class="grid_12 rodape"> <p>Bureau de Inteligência do Café</p> </div> </div> </body> </html>
</tfoot> <tbody> <?foreach($list as $country):?> <tr> <!--<td><?//echo utf8_encode($country->name())?></td>--> <td><?echo $country->name()?></td> <td><?echo $table_type?></td> <?if($country->isReexportCountry()):?> <td><span style="font-weight: bold; color: green">Sim</span></td> <?else:?> <td><span style="font-weight: normal; color: red">Não</span></td> <?endif?> <td> <a class="delete" href="<?echo LinkController::getBaseURL()?>/admin/datacenter/country/delete" id="<?echo $country->id();?>"> excluir </a> </td> <td> <a href="<?echo LinkController::getBaseURL()?>/admin/datacenter/country/edit/<?echo $country->id();?>">editar</a> </td> </tr> <?endforeach;?> </tbody> </table> </div> <div class="pagination"> </div> <?else:?> <strong>Nenhum país encontrado</strong> <?endif;?>
CacheCountry::setCacheBehavior(SessionAdmin::getCacheBehavior()); $cache = CacheCountry::getCountries(); $service = new DatacenterService($repository, $cache);//$countryMap); $statistic = new Statistic(); $grouper = new DataGrouper(); $controller = new DatacenterController($service, $statistic, $jsonResponse, $grouper, $factory); ?> <?php $data_id = $_REQUEST['id_data']; $data = $controller->getSingleDataValue($data_id); ?> <?if($data != null):?> <div class="form-insert"> <h2>Edição de dados</h2> <form title="country" action="<?echo LinkController::getBaseURL()?>/admin/datacenter/data/update/<?echo $data_id?>" method="post" id="form-data-value"> <fieldset> <div class="fields-readonly"> <div class="field right"><label>Ano:</label><?echo $data->getYear();?></div> <div class="field right"><label>Tipo:</label><?echo utf8_encode($data->getTypeName());?></div> <div class="field right"><label>Variedade:</label><?echo utf8_encode($data->getVarietyName());?></div> <div class="field right"><label>Origem:</label><?echo $data->getOriginName();?></div> <div class="field right"><label>Destino:</label><?echo $data->getDestinyName();?></div> <div class="field right"><label>Fonte:</label><?echo $data->getFontName();?></div> </div> <div class="field"> <label>Valor:</label> <input type="text" value="<?echo $data->getValue()?>" id="data-value" /> </div> <button type="submit" class="button-edit">Editar</button> </fieldset>
</div> </div> </div> <!-- Fim Aplicacoes --> </div> <div class="clear"></div> <div class="grid_12 rodape"> <p>Bureau de Inteligência Competitiva do Café</p> </div> <!-- Fim container_12 --> </div> </body> </html> <? }else{ if(LinkController::link() == 'login') { require_once 'core/Login/process_login.php'; }else { try { require_once LinkController::restSubscribe(); }catch(Exception $err) { echo $err->getMessage(); } } } ?>
public static function printAnalysis(Analyse $publication) { $html = "<li>"; $html .= "<span class='date-publication'>["; $html .= $publication->getDateFormatted(); $html .= "]</span>"; $html .= "<a target='_blank' href='" . LinkController::getBaseURL() . "/analise/" . $publication->link() . ".html'>"; $html .= $publication->title(); $html .= "</a><br />"; $qtdComments = $publication->getComments()->count(); $html .= "<span class='number-comments'>"; $html .= $qtdComments . ' ' . ($qtdComments == 1 ? "comentário" : "comentários"); $html .= "</span>"; $html .= "</li>"; echo $html; }
<tr> <th>Título</th> <th>link</th> <th>Tema</th> <th>Estado</th> <?if(LinkController::link() != "analysis"):?> <th>Tipo do Evento</th> <?else:?> <th>Data</th> <?endif?> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div> </div> </body> </html> <?}else{ try{ $_REQUEST['no-must-online'] = true; include LinkController::rest(); }catch(Exception $err){ $json = new JsonResponse(); print_r($json->response(false, $err->getMessage())->serialize()); } } ?>
private static function initAdminPages() { self::$map_admin_pages = new HashMap(); self::$map_admin_pages->put("main", "View/main.php"); self::$map_admin_pages->put("videos", "View/video/videos.php"); self::$map_admin_pages->put("videos/", "View/video/videos.php"); self::$map_admin_pages->put("videos/list", "View/video/video_list.php"); self::$map_admin_pages->put("videos/list/", "View/video/video_list.php"); self::$map_admin_pages->put("videos/inserir", "View/video/video_insertion.php"); self::$map_admin_pages->put("noticias", "View/news/news.php"); self::$map_admin_pages->put("noticias/", "View/news/news.php"); self::$map_admin_pages->put("noticias/list", "View/news/news_list.php"); self::$map_admin_pages->put("noticias/inserir", "View/news/news_insertion.php"); self::$map_admin_pages->put("publicacoes", "View/publication/publications.php"); self::$map_admin_pages->put("publicacoes/", "View/publication/publications.php"); self::$map_admin_pages->put("artigos/list", "View/publication/publication_list.php"); self::$map_admin_pages->put("artigos/list/", "View/publication/publication_list.php"); self::$map_admin_pages->put("artigo/inserir", "View/publication/publication_insertion.php"); self::$map_admin_pages->put("analise/inserir", "View/publication/analysis_insertion.php"); self::$map_admin_pages->put("analise/list", "View/publication/analysis_list.php"); self::$map_admin_pages->put("analise/list/", "View/publication/analysis_list.php"); self::$map_admin_pages->put("datacenter", "View/datacenter/datacenter.php"); self::$map_admin_pages->put("datacenter/", "View/datacenter/datacenter.php"); self::$map_admin_pages->put("datacenter/inserir", "View/datacenter/datacenter_insertion.php"); self::$map_admin_pages->put("datacenter/:subgroup/list/:page", "View/datacenter/datacenter_list.php"); self::$map_admin_pages->put("datacenter/list/:page", "View/datacenter/datacenter_list.php"); self::$map_admin_pages->put("datacenter/list", "View/datacenter/datacenter_list.php"); self::$map_admin_pages->put("datacenter/paises", "View/datacenter/datacenter_country_insertion.php"); self::$map_admin_pages->put("datacenter/paises/destino/:page", "View/datacenter/datacenter_country_list.php"); self::$map_admin_pages->put("datacenter/paises/origem/:page", "View/datacenter/datacenter_country_list.php"); self::$map_admin_pages->put("datacenter/country/edit/:id", "View/datacenter/datacenter_country_edition.php"); self::$map_admin_pages->put("datacenter/dado/edit/:id", "View/datacenter/datacenter_edition.php"); self::$map_admin_pages->put("logoutAdmin", "logout_admin.php"); }
/** * Controllers should in general return the correct name */ public function testNameTest() { $sut = new LinkController('test'); $sut->setTemplate(new TemplateMock()); $this->assertEquals($sut->name(), 'Link'); }
/** * Page::_getPageInfo() * * @return */ private function _getPageInfo() { for ($i = 1; $i <= 4; $i++) { ${'cat' . $i} = WebApp::get('cat' . $i); } $page = $this->_checkNormalPage($cat1, $cat2, $cat3); if ($page !== false) { return $page; } $this->parent->debug($this::name_space . ': Page not found, checking extended...'); $page = $this->_checkExtendedPage($cat1, $cat2, $cat3, $cat4); if ($page !== false) { return $page; } $this->parent->debug($this::name_space . ': Extended page not found, checking hotlinks...'); require_once __MODULE__ . '/link/controller.php'; $link = new LinkController($this); $newUrl = $link->getHotlink(WebApp::get('cat1')); if ($newUrl !== false) { header("Location: " . $newUrl); exit; } else { $this->parent->debug($this::name_space . ': Hotlink not found...'); return false; } }
<div id="metereologia" class="app"> <h1> Meteorologia <span> <a href="#" class="lnk-minimizar"> --- </a> <a href="#" class="lnk-remover"> X </a> </span> <span class="refresh"> <img title="Atualizar" alt="Atualizar" src="<?echo LinkController::getBaseURL()?>/images/refresh.png"/> </span> <span class="refreshing-app" style="display: none"> <img src="<?echo LinkController::getBaseURL()?>/images/ajax-refresh-box.gif"/> </span> </h1> <div class="app-conteudo"> <!--<p>Conteúdo do aplicativo Meteorologia</p>--> <div class="loading-apps"> <img src="<?echo LinkController::getBaseURL()?>/images/ajax-loading-apps.gif"/> </div> <div class="app-content-body"> </div> </div> </div>
<div class="form-insert"> <h2>Inserção de país</h2> <form title="country" action="<?echo LinkController::getBaseURL()?>/admin/datacenter/country" method="post" id="form-country"> <fieldset> <div class="field"> <label>Nome do País:</label> <input type="text" value="" id="name" /> </div> <div class="field"> <label>Tipo do país:</label> <select id="type_country" type="select-one"> <option value=""></option> <option value="origin">Origem</option> <option value="destiny">Destino</option> </select> </div> <div class="field" style="text-align: right"> <label for="reexport">Reexportação:</label> <input style="width: 20px" id="reexport" type="checkbox" name="reexport" value="true"/> </div> <button type="submit" class="button-insert">Inserir</button> </fieldset> </form> </div>
<div id="window-forgetPassword" style="display: none"> <form id="new-password" action="<?echo LinkController::getBaseURL()?>/user/forgetpassword"> <div class="fields"> <label>email cadastrado:</label> <input id="f-email" type="text"/> </div> <div class="fields"> <label>nome de usuário:</label> <input id="f-username" type="text"/> </div> <div class="fields"> <button id="get-new-pass">solicitar nova senha</button> </div> </form> </div> </body> </html> <? }else{ if(LinkController::link() == 'login') { require_once 'core/Login/process_login.php'; }else { try { require_once LinkController::rest(); }catch(Exception $err) { echo $err->getMessage(); } } } ?>
<? session_start(); ?> <? require_once 'requirements.php';?> <?$baseUrl = LinkController::getBaseURL();?> <?$user = new User("ramon", "raigons");?> <?Session::login($user);?> <!DOCTYPE html> <html> <head> <title>Request de Table, excel e chart</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script type="text/javascript" src="<?echo $baseUrl?>/assets/js/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="<?echo $baseUrl?>/assets/js/FusionCharts.js"></script> <script type="text/javascript" src="<?echo $baseUrl?>/assets/js/chart_builder.js"></script> <script type="text/javascript"> $(function(){ getGroups(); getVariety(); getCoffeType(); getCountry('origin'); getCountry('destiny'); getTable(); getMultiTable(); getTableTwoGroups(); getChart(); getMultiChart(); getChartsTwoGroups(); }); //functions function getGroups(){
require_once 'PublicationHandler.php'; PublicationHandler::connect(); ?> <div class="toolbars" style="border: 0 !important; padding-top: 0 !important;"> <ul class="items-toolbars"> <li title="analysis" type="content-publications"> <a href="#analysis">Análises</a> </li> <li title="papers" type="content-publications"> <a href="#papers">Artigos</a> </li> </ul> <div class="content-of-tab content-publications" id="papers"> <?include "view-papers.php"?> </div> <div class="content-of-tab content-publications" id="analysis" style="/*display: none*/"> <?if(Session::isLogged()):?> <?include "view-analysis.php"?> <?else:?> <div class="must-do-login"> Faça o login no sistema para ter acesso às Análises.<br /> Se ainda não possui um cadastro, <a href="<?echo LinkController::getBaseURL()?>/cadastro">Clique aqui</a>. </div> <?endif?> </div> </div>
<?php if (!empty($_POST['username'])) { require_once 'AdminUser.php'; require_once 'AdminLogin.php'; echo 'Im here'; $adminLogin = new AdminLogin(new AdminLoginDao(Connection::connectLogin())); if ($adminLogin->login(new AdminUser($_POST['username'], null, $_POST['password']))) { header("Location: " . LinkController::getBaseURL() . "/admin"); } else { header("Location: " . LinkController::getBaseURL() . "/admin/login-fail"); } } else { header("Location: " . LinkController::getBaseURL() . "/admin/login-fail/empty"); }
</tfoot> <tbody> <?foreach($pubs as $publication):?> <tr> <td><?echo $publication->title()?></td> <td> <?echo $publication->link()?> </td> <td> <a id="<?echo $publication->id()?>" title="analysis" class="delete publication" href="<?echo LinkController::getBaseURL()?>/admin/publication/delete"> excluir </a> </td> </tr> <?endforeach?> </tbody> </table> <?endif?> <div class="pagination"> <? $link = "admin/analise/list/"; echo "<br />".GenericHandler::prevPage($page, $link); echo " ".GenericHandler::pages($total, $page, PublicationController::$LIMIT_PER_PAGE, $link); echo " ".GenericHandler::nextPage($page, PublicationController::$LIMIT_PER_PAGE, $total, $link); ?> </div> <br /> <a href="<?echo LinkController::getBaseURL()?>/admin/publicacoes" class="link-goback">Voltar</a>
protected function buildResponse($response) { $spreadsheetName = $response; $path = LinkController::getBaseURL() . "/" . $spreadsheetName; return $this->jsonResponse->response(true, null)->addValue("planilha", $path)->withoutHeader()->serialize(); }