Example #1
0
 public function connect(SilexApplication $app)
 {
     $app['controller.prod'] = $this;
     $controllers = $app['controllers_factory'];
     $controllers->before(function (Request $request) use($app) {
         if (!$app['authentication']->isAuthenticated() && null !== $request->query->get('nolog')) {
             return $app->redirectPath('login_authenticate_as_guest');
         }
         if (null !== ($response = $app['firewall']->requireAuthentication())) {
             return $response;
         }
     });
     $controllers->get('/', function (Application $app) {
         try {
             \Session_Logger::updateClientInfos($app, 1);
         } catch (SessionNotFound $e) {
             return $app->redirectPath('logout');
         }
         $cssPath = $app['root.path'] . '/www/skins/prod/';
         $css = [];
         $cssfile = false;
         $finder = new Finder();
         $iterator = $finder->directories()->depth(0)->filter(function (\SplFileInfo $fileinfo) {
             return ctype_xdigit($fileinfo->getBasename());
         })->in($cssPath);
         foreach ($iterator as $dir) {
             $baseName = $dir->getBaseName();
             $css[$baseName] = $baseName;
         }
         $cssfile = $app['settings']->getUserSetting($app['authentication']->getUser(), 'css');
         if (!$cssfile && isset($css['000000'])) {
             $cssfile = '000000';
         }
         $feeds = $app['repo.feeds']->getAllForUser($app['acl']->get($app['authentication']->getUser()));
         $aggregate = Aggregate::createFromUser($app, $app['authentication']->getUser());
         $thjslist = "";
         $queries_topics = '';
         if ($app['conf']->get(['registry', 'classic', 'render-topics']) == 'popups') {
             $queries_topics = \queries::dropdown_topics($app['translator'], $app['locale']);
         } elseif ($app['conf']->get(['registry', 'classic', 'render-topics']) == 'tree') {
             $queries_topics = \queries::tree_topics($app['locale']);
         }
         $sbas = $bas2sbas = [];
         foreach ($app['phraseanet.appbox']->get_databoxes() as $databox) {
             $sbas_id = $databox->get_sbas_id();
             $sbas['s' + $sbas_id] = ['sbid' => $sbas_id, 'seeker' => null];
             foreach ($databox->get_collections() as $coll) {
                 $bas2sbas['b' . $coll->get_base_id()] = ['sbid' => $sbas_id, 'ckobj' => ['checked' => false], 'waschecked' => false];
             }
         }
         return $app['twig']->render('prod/index.html.twig', ['module_name' => 'Production', 'WorkZone' => new Helper\WorkZone($app, $app['request']), 'module_prod' => new Helper\Prod($app, $app['request']), 'cssfile' => $cssfile, 'module' => 'prod', 'events' => $app['events-manager'], 'GV_defaultQuery_type' => $app['conf']->get(['registry', 'searchengine', 'default-query-type']), 'GV_multiAndReport' => $app['conf']->get(['registry', 'modules', 'stories']), 'GV_thesaurus' => $app['conf']->get(['registry', 'modules', 'thesaurus']), 'cgus_agreement' => \databox_cgu::askAgreement($app), 'css' => $css, 'feeds' => $feeds, 'aggregate' => $aggregate, 'GV_google_api' => $app['conf']->get(['registry', 'webservices', 'google-charts-enabled']), 'queries_topics' => $queries_topics, 'search_status' => \databox_status::getSearchStatus($app), 'queries_history' => \queries::history($app, $app['authentication']->getUser()->getId()), 'thesau_js_list' => $thjslist, 'thesau_json_sbas' => json_encode($sbas), 'thesau_json_bas2sbas' => json_encode($bas2sbas), 'thesau_languages' => $app['locales.available']]);
     })->bind('prod');
     return $controllers;
 }
Example #2
0
 public function indexAction(Request $request)
 {
     try {
         \Session_Logger::updateClientInfos($this->app, 1);
     } catch (SessionNotFound $e) {
         return $this->app->redirectPath('logout');
     }
     $cssPath = $this->app['root.path'] . '/www/assets/prod/skins';
     $css = [];
     $finder = new Finder();
     /** @var SplFileInfo[] $iterator */
     $iterator = $finder->directories()->depth(0)->filter(function (\SplFileInfo $fileinfo) {
         return ctype_xdigit($fileinfo->getBasename());
     })->in($cssPath);
     foreach ($iterator as $dir) {
         $baseName = $dir->getBaseName();
         $css[$baseName] = $baseName;
     }
     $user = $this->getAuthenticatedUser();
     $cssfile = $this->getSettings()->getUserSetting($user, 'css');
     if (!$cssfile && isset($css['000000'])) {
         $cssfile = '000000';
     }
     $feeds = $this->getFeedRepository()->getAllForUser($this->getAclForUser());
     $aggregate = Aggregate::createFromUser($this->app, $user);
     $thjslist = "";
     $queries_topics = '';
     $conf = $this->getConf();
     if ($conf->get(['registry', 'classic', 'render-topics']) == 'popups') {
         $queries_topics = \queries::dropdown_topics($this->app['translator'], $this->app['locale']);
     } elseif ($conf->get(['registry', 'classic', 'render-topics']) == 'tree') {
         $queries_topics = \queries::tree_topics($this->app['locale']);
     }
     $sbas = $bas2sbas = [];
     foreach ($this->getApplicationBox()->get_databoxes() as $databox) {
         $sbas_id = $databox->get_sbas_id();
         $sbas['s' . $sbas_id] = ['sbid' => $sbas_id, 'seeker' => null];
         foreach ($databox->get_collections() as $coll) {
             $bas2sbas['b' . $coll->get_base_id()] = ['sbid' => $sbas_id, 'ckobj' => ['checked' => false], 'waschecked' => false];
         }
     }
     $helper = new Helper\Prod($this->app, $request);
     /** @var \Closure $filter */
     $filter = $this->app['plugin.filter_by_authorization'];
     $plugins = ['workzone' => $filter('workzone'), 'actionbar' => $filter('actionbar')];
     return $this->render('prod/index.html.twig', ['module_name' => 'Production', 'WorkZone' => new Helper\WorkZone($this->app, $request), 'module_prod' => $helper, 'search_datas' => $helper->get_search_datas(), 'cssfile' => $cssfile, 'module' => 'prod', 'events' => $this->app['events-manager'], 'GV_defaultQuery_type' => $conf->get(['registry', 'searchengine', 'default-query-type']), 'GV_multiAndReport' => $conf->get(['registry', 'modules', 'stories']), 'GV_thesaurus' => $conf->get(['registry', 'modules', 'thesaurus']), 'cgus_agreement' => \databox_cgu::askAgreement($this->app), 'css' => $css, 'feeds' => $feeds, 'aggregate' => $aggregate, 'GV_google_api' => $conf->get(['registry', 'webservices', 'google-charts-enabled']), 'queries_topics' => $queries_topics, 'search_status' => \databox_status::getSearchStatus($this->app), 'queries_history' => \queries::history($this->app, $user->getId()), 'thesau_js_list' => $thjslist, 'thesau_json_sbas' => json_encode($sbas), 'thesau_json_bas2sbas' => json_encode($bas2sbas), 'thesau_languages' => $this->app['locales.available'], 'plugins' => $plugins]);
 }
Example #3
0
        }
    } else {
        ?>
		
		
		
		
		NOT FOUND
		
		
		
		
		<?php 
    }
} else {
    $search_item = new queries();
    $search_item->cat_search($cat);
    $ctr = $search_item->query_num_rows;
    while ($ctr != 0) {
        $item = $search_item->query_run->fetch();
        ?>
  
  <?php 
        if ($ctr % 4 == 1) {
            ?>
  <br />
    <div style="width:200px; height:270px; border:1px solid blue">
    
     <img src="../uploads/images/products/<?php 
            echo $item['code'];
            ?>
Example #4
0
        echo $counter . '.' . $monthResults[$counter] . ' ' . utils::getMileageString();
        echo "<br>";
    }
    ?>
            </div>
            </div>
        </div>

        <h2 class="rounded-heading">
            <span>Years Top Riders
        </span>  </h2>
        <div class="content-1-details">
          <div id="widgetdiv">
          <div>
          <?php 
    $yearResults = queries::getYearTopRiders();
    for ($counter = 1; $counter <= count($yearResults); $counter++) {
        echo $counter . '.' . $yearResults[$counter] . ' ' . utils::getMileageString();
        echo "<br>";
    }
    ?>
          </div>
          </div>
        </div>
    </div>

    <div style="clear:both; height:78px;"></div>
    <?php 
} else {
    ?>
    <H3>Welcome to CylceBrain!</H3>
Example #5
0
<?php

include 'includes/header.php';
$item = $_GET['p'];
$pro = new queries();
$pro->pro_search($item);
if ($pro->query_num_rows != 0) {
    $item_p = $pro->query_run2->fetch();
    ?>
	
	<img src="../uploads/images/products/<?php 
    echo $pro->p['code'];
    ?>
.jpg" style="width:200px; height:220px;" />
    
	<br /><br />
    <?php 
    echo $pro->p['name'];
    ?>
<br>
    <?php 
    echo $pro->p['price'];
    ?>
<br>
    <?php 
    echo $item_p['email'];
    ?>
<br>
	
	
<?php 
Example #6
0
 /**
  * Gets client main page
  *
  * @param  Application $app
  * @param  Request     $request
  * @return Response
  */
 public function getClient(Application $app, Request $request)
 {
     try {
         \Session_Logger::updateClientInfos($app, 2);
     } catch (SessionNotFound $e) {
         return $app->redirectPath('logout');
     }
     $renderTopics = '';
     if ($app['conf']->get(['registry', 'classic', 'render-topics']) == 'popups') {
         $renderTopics = \queries::dropdown_topics($app['translator'], $app['locale']);
     } elseif ($app['conf']->get(['registry', 'classic', 'render-topics']) == 'tree') {
         $renderTopics = \queries::tree_topics($app['locale']);
     }
     return new Response($app['twig']->render('client/index.html.twig', ['last_action' => !$app['authentication']->getUser()->isGuest() && false !== $request->cookies->has('last_act') ? $request->cookies->has('last_act') : null, 'phrasea_home' => $this->getDefaultClientStartPage($app), 'render_topics' => $renderTopics, 'grid_properties' => $this->getGridProperty(), 'search_order' => SearchEngineOptions::SORT_MODE_DESC, 'storage_access' => $this->getDocumentStorageAccess($app), 'tabs_setup' => $this->getTabSetup($app), 'module' => 'client', 'menubar' => $app['twig']->render('common/menubar.html.twig', ['module' => 'client']), 'css_file' => $this->getCssFile($app), 'basket_status' => $app['settings']->getUserSetting($app['authentication']->getUser(), 'client_basket_status', '1'), 'mod_pres' => $app['settings']->getUserSetting($app['authentication']->getUser(), 'client_view', ''), 'start_page' => $app['settings']->getUserSetting($app['authentication']->getUser(), 'start_page'), 'start_page_query' => $app['settings']->getUserSetting($app['authentication']->getUser(), 'start_page_query', '')]));
 }
Example #7
0
<?php

include "queries.php";
include '../libs/Smarty.class.php';
// skapar smarty objekt
$smarty = new Smarty();
//Skapar en ny anslutning mot databasen
$q = new queries("usr_11320778", "320778", "db_11320778");
//$post = "";// Skapar en post variabel i fall att det inte finns något att hämta !
if (!empty($_POST['name']) && !empty($_POST['email']) && !empty($_POST['website']) && !empty($_POST['comment'])) {
    $newName = $_POST['name'];
    $newEmail = $_POST['email'];
    $newWebsite = $_POST['website'];
    $newComment = $_POST['comment'];
    $newName = $q->secureSQLString($newName);
    $newEmail = $q->secureSQLString($newEmail);
    $newWebsite = $q->secureSQLString($newWebsite);
    $newComment = $q->secureSQLString($newComment);
    $insert1 = $q->runInsertQuery("INSERT INTO person (name, email, website) VALUES('" . $newName . "', '" . $newEmail . "' , '" . $newWebsite . "' )");
    // Om inte insert satsen fungerar så ska det ha att göra med att email adressen redan finns
    if (!$insert1) {
        $smarty->assign('PostInformation', 'Det fanns sparad information om användare med email: ' . $newEmail . ' adressen, uppdaterade informationen om denna!');
        //Uppdaterar användaren med en viss emailadress
        $q->runInsertQuery("UPDATE person SET name='" . $newName . "', website='" . $newWebsite . "'WHERE email='" . $newEmail . "'");
    }
    // tar reda på användarens id
    $pid = $q->runSelectQuery("SELECT id FROM person WHERE email =  '" . $newEmail . "' ");
    $i = 0;
    foreach ($pid as $v) {
        $personid[$i] = $v['id'];
        $i += 1;