예제 #1
0
 public function run()
 {
     // セッション開始 認証に利用します。
     $this->auth = new Auth();
     $this->auth->set_authname(_SYSTEM_AUTHINFO);
     $this->auth->set_sessname(_SYSTEM_SESSNAME);
     $this->auth->start();
     if (!$this->auth->check() && $this->type != 'authenticate') {
         // 未認証
         $this->type = 'login';
     }
     // 共用のテンプレートなどをこのフラグで管理用に切り替えます。
     $this->is_system = true;
     // 会員側の画面を表示するためMemberControllerを利用します。
     $MemberController = new MemberController($this->is_system);
     switch ($this->type) {
         case "login":
             $this->screen_login();
             break;
         case "logout":
             $this->auth->logout();
             $this->screen_login();
             break;
         case "modify":
             $MemberController->screen_modify($this->auth);
             break;
         case "delete":
             $MemberController->screen_delete();
             break;
         case "list":
             $this->screen_list();
             break;
         case "regist":
             $MemberController->screen_regist($this->auth);
             break;
         case "notice":
             $NoticeController = new NoticeController();
             $NoticeController->screen_modify();
             break;
         case "authenticate":
             $this->do_authenticate();
             break;
         default:
             $this->screen_top();
     }
 }
예제 #2
0
            }
            if ($key == 'section') {
                if ($id == $sectionId) {
                    $result = $result . '<option value="' . $id . '" selected >' . $value . '</option>';
                } else {
                    $result = $result . '<option value="' . $id . '">' . $value . '</option>';
                }
            }
        }
    }
    return $result;
}
// obtenemos la noticia que queremos modificar
$noticeId = isset($_GET['searchid']) ? $_GET['searchid'] : 0;
if ($noticeId > 0) {
    $objNoticeController = new NoticeController();
    $objNoticeController->getNotice($noticeId);
    $objNotice = new Notice();
    foreach ($objNoticeController->objNoticeService->listNotices as $notice) {
        foreach ($notice as $propiedad => $valor) {
            $objNotice->{$propiedad} = $valor;
        }
    }
}
?>


<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
예제 #3
0
<?php 
require_once '../controllers/noticeController.php';
require_once '../views/procesaViews.inc';
require_once '../functions/functions.inc';
$sectionId = 0;
$query = isset($_GET['q']) ? $_GET['q'] : '';
$offset = isset($_GET['offset']) ? $_GET['offset'] : 0;
$objNoticeController = new NoticeController();
$objNoticeController->searchBySection($query, $sectionId, $offset);
$numPages = calculateNumberPages($objNoticeController->objNoticeService->totalNotices);
?>


    <?php 
include '../taglibs/head.inc';
?>
    <?php 
include '../taglibs/header.inc';
?>

    <div class="sub_noticia">

    <?php 
echo createPagination($objNoticeController->objNoticeService->totalNotices, $offset);
?>

<?php 
if ($objNoticeController->objNoticeService->totalNotices > 0) {
    foreach ($objNoticeController->objNoticeService->listNotices as $notice) {
        $objNotice = new Notice();
예제 #4
0
<?php

require_once '../controllers/noticeController.php';
require_once '../functions/functions.inc';
$seccionId = $_POST['inputSeccionId'];
$title = $_POST['inputTitle'];
$summary = $_POST['inputSummary'];
$urlImgListado = $_POST['picListado'];
$urlImgInterior = $_POST['picInterior'];
$status = 'deactive';
$userId = 1;
$objNoticeController = new NoticeController();
$objNoticeController->setNotice($seccionId, $title, $summary, $urlImgListado, $urlImgInterior, $status, $userId);
$objNotice = new Notice();
foreach ($objNoticeController->objNoticeService->listNotices as $notice) {
    foreach ($notice as $propiedad => $valor) {
        $objNotice->{$propiedad} = $valor;
    }
}
//echo '<br>La noticia creada fue'.$objNotice->id;
$url_redirect = 'dashboard.php?searchid=' . $objNotice->id;
header('Location:' . $url_redirect);
/*echo '<br><b>seccion_id:</b>'.$objNotice->id;
	

	echo '<br><b>titulo:</b>'.$title;
	echo '<br><b>resumen:</b>'.$summary;
	echo '<br><b>imagen_listado:</b> <br> <img src="'.$urlImgListado.'" />';
	echo '<br><b>imagen_principal:</b><br> <img src="'.$urlImgInterior.'" />'
	*/