Example #1
0
File: events.php Project: qb90/www
<?php

require_once 'lib/page.php';
$page = new Page();
$page->setTitle('Events');
$page->setImage('cr-m.jpg');
$page->startBody();
?>

<blockquote>
Eleven events are included on the provisional calendar although it is the intention to increase to 12 once all agreements for a new season-opening round have been reached. 
Providing it goes ahead, that would mean 24 races, 12 DHL pole position shootouts and 12 MAC3 contests.
</blockquote>

François Ribeiro, Head of Eurosport Events, the WTCC promoter, said: 
<blockquote>
“The intention is for the calendar to have 12 events but the agreement with the potential new venue is not there yet. Providing all elements of the deal fall into place we hope to announce the final calendar with 12 weekends prior to the Christmas break. Otherwise, we have kept the same venues in a number of key markets that provide the challenge and prestige we crave, plus the variety.”
</blockquote>

<?php 
$page->endBody();
echo $page->render('templ/template.php');
Example #2
0
File: index.php Project: qb90/www
<?php

require_once 'lib/page.php';
$page = new Page();
$page->setTitle('Home');
$page->setImage('wtcc1-bl.jpg');
$page->startBody();
?>

<blockquote>The provisional FIA World Touring Car Championship calendar for 2016 will blend legendary racetracks with similarly excellent, albeit newer facilities. Formula One venues past and present – Circuit Paul Ricard and Hungaroring – appear on the roster early season along with the Slovakia Ring.
There will be two street circuits (the new Hermann Tilke-designed FIA Grade II track in Marrakech and Vila Real in Portugal) to test WTCC drivers’ skill and judgement and a highly anticipated return to the infamous Nürburgring Nordschleife in Germany (pictured) to check out just how brave they are.
Following the summer break, WTCC engines will fire up again in Termas de Río Hondo, Argentina – home race of recently-crowned double world champion José María López – in early August.
Twin Ring Motegi, host venue of Japan’s MotoGP round and where the overtaking barely stopped during the WTCC’s first visit this year, signals the start of a tour of Asia. The Shanghai International Circuit, home of the Chinese Grand Prix, showcases the WTCC to the world’s largest population and online community, while the Chang International Circuit in Buriram takes the WTCC to Thailand for another twilight event.
Meanwhile, the Qatar night race spectacular in late November brings the curtain down on the 2016 campaign.</blockquote>

<?php 
$page->endBody();
echo $page->render('templ/template.php');
Example #3
0
 /**
  * Save page properties.
  *
  * @param Page $page
  * @param array $values
  */
 public static function savePageProperties(Page $page, array $values)
 {
     $urlChanged = $page->getUrl() != $values['url'];
     $page->setAutoName($values['name']);
     $page->setEnabled($values['enabled']);
     $page->setVisible($values['visible']);
     $page->setIncludeInIndex($values['index']);
     // Redirection
     $v = $values['redirect'];
     $page->setRedirectMethod($v['method'] ? $v['method'] : null);
     if ($v['page_id'] == 'external') {
         $page->setRedirectUrl($v['url']);
     } else {
         $redirectPageId = (int) $v['page_id'];
         $page->setRedirectPageId($redirectPageId ? $redirectPageId : null);
         $page->setRedirectUrl(null);
     }
     // Base page and template
     $v = $values['base_page'];
     $pageRevision = $page->getPageRevision();
     $pageRevision->setBasePageId($v['base_page_id'] ? (int) $v['base_page_id'] : null);
     // Advanced
     $v = $values['advanced'];
     $page->setImage($v['image']);
     $pageRevision->setTemplate($v['template'] ? $v['template'] : null);
     $page->setLangcode(strlen($v['langcode']) ? $v['langcode'] : null);
     $page->setModelRoute($v['model_route'] ? $v['model_route'] : null);
     $page->setCacheLifetime((int) $v['cache_lifetime']);
     $page->setGenerator(strlen($v['generator']) ? $v['generator'] : null);
     $page->setEncoding(strlen($v['encoding']) ? $v['encoding'] : null);
     // Save page/revision
     $pageRevision->save();
     $page->save();
     // Update url recursively
     if (empty($values['url'])) {
         // reset url
         $page->setUrlRecurse($page->getExpectedUrl());
     } else {
         if ($urlChanged) {
             // set new url
             $url = $values['url'];
             if (substr($url, -1) != '/') {
                 $url .= '/';
             }
             if ($url != '/' && substr($url, 0, 1) == '/') {
                 $url = substr($url, 1);
             }
             $page->setUrlRecurse($url);
         }
     }
 }
 function index()
 {
     $this->load->helper('text');
     $this->load->helper('security');
     //appel formulaire
     $this->load->helper(array('form', 'url'));
     $this->load->library('form_validation');
     //Regle de validation
     //appel de l'object
     if (isset($_POST['idPage']) && !empty($_POST['idPage'])) {
         $id = $_POST['idPage'];
         //echo "id : ".$id."<br>";
         $this->form_validation->set_rules('idArticle', 'Id de l\'article', 'trim');
         $object = $this->doctrine->em->find('page', $id);
     } else {
         $object = new Page();
     }
     if (isset($_POST['idUser']) && !empty($_POST['idUser'])) {
         //echo "idUser : "******"<br>";
         $idUser = $_POST['idUser'];
         $this->form_validation->set_rules('idUser', 'Id de l\'utilisateur', 'trim');
         $queryUser = $this->doctrine->em->createQuery("SELECT u\n\t\t\t\t\t\tFROM user u\n\t\t\t\t\t\tWHERE u.iduser="******"Recup : ".$_POST['langue']."<br>";
         $postLangue = $_POST['langue'];
         $this->form_validation->set_rules('langue', 'Id de la langue', 'trim');
         //Recuperation de l'objet dans la base;
         $langue = $this->doctrine->em->createQuery("SELECT l FROM langue l")->getResult();
         foreach ($langue as $dataLg) {
             $test = utf8_encode($dataLg->getLangue());
             //echo "Test : ".$test." = ".$postLangue."<br>";
             if ($test == $postLangue) {
                 //echo "-> this : ".$test." = OK <br>";
                 $object->setIdlangue($dataLg);
             }
         }
     }
     if (isset($_POST['date']) && !empty($_POST['date'])) {
         //echo "date : ".$_POST['date']."<br>";
         $this->form_validation->set_rules('date', 'Date', 'trim');
         $date = new DateTime($_POST['date']);
         $object->setDate($date);
     }
     if (isset($_POST['titre']) && !empty($_POST['titre'])) {
         //echo "titre : ".$_POST['titre']."<br>";
         $this->form_validation->set_rules('titre', 'Titre', 'trim|min_length[5]|xss_clean');
         $object->setTitre(utf8_decode($_POST['titre']));
     }
     if (isset($_POST['texte']) && !empty($_POST['texte'])) {
         //echo "texte : ".$_POST['texte']."<br>";
         $this->form_validation->set_rules('texte', 'texte', 'trim|min_length[5]|xss_clean');
         $object->setTexte(utf8_decode($_POST['texte']));
     }
     if (isset($_POST['page']) && !empty($_POST['page'])) {
         //echo "page : ".$_POST['page']."<br>";
         $idPage = $_POST['page'];
         $this->form_validation->set_rules('page', 'Id de la page', 'trim');
         //Recuperation de l'objet dans la base;
         $page = $this->doctrine->em->createQuery("SELECT p.idpage FROM page p WHERE p.idpage=" . $idPage)->getResult();
         foreach ($page as $dataPage) {
             $object->setIdpage($dataPage['idpage']);
         }
     }
     if (isset($_FILES['fileImg']['name']) && !empty($_FILES['fileImg']['name'])) {
         $dir = '../theDogsCrew-site/imagesPage/';
         $fileImages = scandir($dir);
         $exist = false;
         foreach ($fileImages as $fileImage) {
             if ($fileImage == $_FILES['fileImg']['name']) {
                 $exist = true;
             }
         }
         if (!$exist) {
             $config['upload_path'] = '../theDogsCrew-site/imagesPage/';
             $config['allowed_types'] = 'gif|jpg|png|jpeg';
             $this->load->library('upload', $config);
             $this->upload->initialize($config);
             $this->upload->set_allowed_types('*');
             $data['upload_data'] = '';
             if (!$this->upload->do_upload('fileImg')) {
                 $data = array('msg' => $this->upload->display_errors());
             } else {
                 $data = array('msg' => "Upload success!");
                 $data['upload_data'] = $this->upload->data();
             }
             $urlImg = 'imagesPage/' . $_FILES['fileImg']['name'];
             $object->setImage($urlImg);
             //echo $object->getImage()."<br>";
         }
     }
     if (isset($_POST['existImg']) && !empty($_POST['existImg'])) {
         //echo "Recup Img: ".$_POST['existImg']."<br>";
         if ($_POST['existImg'] == "NULL") {
             $object->setImage(NULL);
         } else {
             $this->form_validation->set_rules('existImg', 'Nom existImg', 'trim');
             $urlImg = 'imagesPage/' . $_POST['existImg'];
             $object->setImage($urlImg);
             //echo $object->getImage()."<br>";
         }
     }
     if ($this->form_validation->run() == FALSE) {
         //echo 'test false';
         $titre = "Page";
         $this->layout->set_titre($titre);
         $this->layout->th_default();
         if (isset($id)) {
             $object = $this->doctrine->em->createQuery("SELECT p FROM page p WHERE p.idpage=" . $id)->getResult();
             $langues = $this->doctrine->em->createQuery("SELECT l FROM langue l")->getResult();
             $this->load->view('page/vEdit', array('page' => $object, 'langues' => $langues));
         } else {
             $langues = $this->doctrine->em->createQuery("SELECT l FROM langue l")->getResult();
             $this->load->view('page/vAdd', array('page' => $object, 'langues' => $langues));
         }
     } else {
         //echo 'test true';
         $this->doctrine->em->persist($object);
         $this->doctrine->em->flush();
         redirect('cPage', 'refresh');
     }
 }
Example #5
0
<?php

require_once 'lib/page.php';
$page = new Page();
$page->setTitle('Calendar');
$page->setImage('cal-m.jpg');
$page->startBody();
?>

<strong>FIA World Touring Car Championship provisional calendar 2016</strong>
<blockquote>
<ul>
	<li><ins>20 March 2016:</ins> Spare date TBD</li>
	<li><ins>3 April 2016:</ins> FIA WTCC Race of France (Circuit Paul Ricard)</li>
	<li><ins>17 April 2016:</ins> FIA WTCC Race of Slovakia (Slovakia Ring)</li>
	<li><ins>24 April 2016:</ins> FIA WTCC Race of Hungary (Hungaroring)</li>
	<li><ins>8 May 2016:</ins> FIA WTCC Race of Morocco (Circuit Moulay El Hassan, Marrakech) S</li>
	<li><ins>28 May 2016:</ins> FIA WTCC Race of Germany (Nürburgring Nordschleife)</li>
	<li><ins>12 June 2016:</ins> FIA WTCC Race of Portugal (Circuito Internacional de Vila Real) S</li>
	<li><ins>7 August 2016:</ins> FIA WTCC Race of Argentina (Autódromo Termas de Río Hondo)*</li>
	<li><ins>4 September 2016:</ins> FIA WTCC Race of Japan (Twin Ring Motegi)</li>
	<li><ins>25 September 2016:</ins> FIA WTCC Race of China (Shanghai International Circuit)</li>
	<li><ins>6 November 2016:</ins> FIA WTCC Race of Thailand (Chang International Circuit)*</li>
	<li><ins>27 November 2016:</ins> FIA WTCC Race of Qatar (Losail International Circuit) N</li>
</ul>
</blockquote>

<?php 
$page->endBody();
echo $page->render('templ/template.php');