function expand(Ast $crossover, Cycle $cycle, Directives $directives, BlueContext $blueContext) : TokenStream { $expansion = clone $this->expansion; if ($this->unsafe) { hygienize($expansion, ['scope' => $cycle->id()]); } return $this->mutate($expansion, $crossover, $cycle, $directives, $blueContext); }
/** * Check if a page has any answers associated with it in a specific cycle * @param Page $page * @param Cycle $cycle * @return boolean */ public function hasCycleAnswers(Page $page, Cycle $cycle) { $query = $this->_em->createQuery('SELECT answer.id FROM Jazzee\\Entity\\Answer answer JOIN answer.applicant applicant JOIN applicant.application application WHERE answer.page = :pageId AND application.cycle = :cycleId'); $query->setParameter('pageId', $page->getId()); $query->setParameter('cycleId', $cycle->getId()); $query->setMaxResults(1); $result = $query->getResult(); return count($result); }
/** * findOneByProgramAndCycle * Search for an Application using its Program and Cycle * @param Program $program * @param Cycle $cycle * @return Application */ public function findOneByProgramAndCycle(Program $program, Cycle $cycle) { $query = $this->_em->createQuery('SELECT a FROM Jazzee\\Entity\\Application a WHERE a.program = :programId AND a.cycle = :cycleId'); $query->setParameter('programId', $program->getId()); $query->setParameter('cycleId', $cycle->getId()); $result = $query->getResult(); if (count($result)) { return $result[0]; } return false; }
function test_cycle_class() { $cycle = new Cycle(array("one", 2, "3")); $this->assertEqual("one", $cycle->value()); $this->assertEqual(2, $cycle->value()); $this->assertEqual("3", $cycle->value()); $this->assertEqual("one", $cycle->value()); $cycle->reset(); $this->assertEqual("one", $cycle->value()); $this->assertEqual(2, $cycle->value()); $this->assertEqual("3", $cycle->value()); }
public function packages() { $this->data['cycles'] = Cycle::all(); $this->data['services'] = Service::orderBy('name')->get(); $this->data['packages'] = Package::paginate(25); return $this->layout->content = View::make('packages', $this->data); }
public static function exists($cycle_id) { $service = Cycle::where('id', '=', $cycle_id)->count(); if ($service > 0) { return true; } else { return false; } }
/** * Get the navigation * @return Navigation */ public function getNavigation() { if (empty($this->program) and empty($this->application)) { return null; } $navigation = new \Foundation\Navigation\Container(); $menu = new \Foundation\Navigation\Menu(); $menu->setTitle('Navigation'); if (empty($this->application)) { $link = new \Foundation\Navigation\Link('Welcome'); $link->setHref($this->path('apply')); $menu->addLink($link); } else { $path = 'apply/' . $this->program->getShortName() . '/' . $this->cycle->getName(); $link = new \Foundation\Navigation\Link('Welcome'); $link->setHref($this->path($path)); $link->setCurrent(true); $menu->addLink($link); //Only show the other cycles link if there are other published visible cycles $applications = $this->_em->getRepository('Jazzee\\Entity\\Application')->findByProgram($this->program, false, true, array($this->application->getId())); if (count($applications) > 0) { $link = new \Foundation\Navigation\Link('Other Cycles'); $link->setHref($this->path('apply/' . $this->program->getShortName())); $menu->addLink($link); } $link = new \Foundation\Navigation\Link('Returning Applicants'); $link->setHref($this->path($path . '/applicant/login')); $menu->addLink($link); if (!$this->application->isByInvitationOnly()) { $link = new \Foundation\Navigation\Link('Start a New Application'); $link->addClass('highlight'); $link->setHref($this->path($path . '/applicant/new')); $menu->addLink($link); } } $navigation->addMenu($menu); if ($this->isPreviewMode()) { $menu = new \Foundation\Navigation\Menu(); $navigation->addMenu($menu); $menu->setTitle('Preview Functions'); $link = new \Foundation\Navigation\Link('Become Administrator'); $link->setHref($this->path('admin/login')); $menu->addLink($link); } return $navigation; }
<?php $cycleClass = new Cycle('class="col1"', 'class="col2"'); ?> <table cellspacing="0" cellpadding="4" class="cycles caches"> <caption><?php echo _T('Caches'); ?> </caption> <tr> <?php echo th(N_("cache.cache")), th(N_("cache.slots")), th(N_("cache.size")), th(N_("cache.avail")), th(N_("cache.blocksgraph")), th(N_("cache.operations")), th(N_("cache.status")), th(N_("cache.hits")), th(N_("cache.hits_graph")), th(N_("cache.hits_avg_h")), th(N_("cache.hits_avg_s")), th(N_("cache.updates")), th(N_("cache.skips")), th(N_("cache.ooms")), th(N_("cache.errors")), th(N_("cache.readonly_protected")), th(N_("cache.cached")), th(N_("cache.deleted")), th(N_("cache.gc_timer")); ?> </tr> <?php $numkeys = explode(',', 'slots,size,avail,hits,updates,skips,ooms,errors,cached,deleted'); $l_clear = _T('Clear'); $l_disabled = _T('Disabled'); $l_disable = _T('Disable'); $l_enable = _T('Enable'); $l_compiling = _T('Compiling'); $l_normal = _T('Normal'); $l_confirm = _T('Sure?'); foreach (getCacheInfos() as $i => $ci) { $class = $cycleClass->next(); echo <<<TR \t<tr {$class}> TR; $pvalue = (int) ($ci['avail'] / $ci['size'] * 100); $pempty = 100 - $pvalue;
/** * find applicants in a cycle * * Search for an Applicant by cycle * @param Cycle $cycle * @return array */ public function findByCycle(Cycle $cycle) { $query = $this->_em->createQuery('SELECT a FROM Jazzee\\Entity\\Applicant a WHERE a.application IN (SELECT app FROM Jazzee\\Entity\\Application app WHERE app.cycle = :cycleId) AND a.deactivated=false'); $query->setParameter('cycleId', $cycle->getId()); return $query->getResult(); }
/* formulaire_cyclique.php */ /*-----------------------------------*/ /* */ /* Formulaire d'ajout d'une */ /* tache cyclique */ /* */ /*-----------------------------------*/ ?> <?php //Récupération des informations nécessaires au formulaires //Liste des ouvrages $ouvrage = new Ouvrage(); $list_ouvrage = $ouvrage->lister($base); //Liste des cycles $cycle = new Cycle(); $list_cycle = $cycle->lister($base); ?> <!-- Formulaire d'ajout d'une tache cyclique --> <form method="post" action="./php/traitement_formulaire.php"> <fieldset> <legend>Ajout d'une intervention cyclique</legend> <p> <label for="intervention">Intervention</label> : <input class="form-control" type="text" name="intervention" required /> </p> <p> <label for="ouvrage">Ouvrage</label> : <select class="form-control" name="ouvrage" id="ouvrage" required /> <?php while ($donnees_ouvrage = $list_ouvrage->fetch()) {
<?php class Cycle { public $arr; function setCycle() { for ($i = 1; $i <= 100; $i++) { $this->arr[] = $i; } return $this->arr; } function viewResult($arr) { $i = 0; while ($i < 100) { if ($this->arr[$i] % 3 == 0 && $this->arr[$i] % 12 != 0) { echo $this->arr[$i]; echo "<br>"; } $i++; } } } $cycle = new Cycle(); $cycle->viewResult($cycle->setCycle());
include "header.tpl.php"; ?> <!-- //// BEGIN <a href="help.php" target="_blank" id="help"><?php echo _T("Help"); ?> »</a> //// END --> <span class="switcher"><?php echo switcher("type", $types); ?> </span> <?php $a = new Cycle('class="col1"', 'class="col2"'); $b = new Cycle('class="col1"', 'class="col2"'); echo _T('Caches'); ?> : <table cellspacing="0" cellpadding="4" class="cycles"> <col /> <col align="right" /> <col align="right" /> <col align="right" /> <col /> <col /> <col align="right" /> <col align="right" /> <col align="right" /> <col align="right" /> <col align="right" />
<?php // Include the configuration file require_once realpath(dirname(__FILE__) . '/../inc/config.php'); // Create Cycle instance and set Cycle Framework options $cycle = Cycle::getInstance(); $cycle->configure(array('base_url' => '/database/', 'app_path' => realpath(dirname(__FILE__) . '/../'), 'views_path' => 'views/', 'layout' => 'layouts/layout.php')); // Declare routes $cycle->route('/', 'index'); function index($cycle) { return $cycle->render('pages/index.php'); } $cycle->route('/example', 'example'); function example($cycle) { $server = new Zend_Json_Server(); $server->setClass('WOPR_Test_Example'); return $cycle->send($server->handle(), Cycle_Response::JSON); } $cycle->route('*', 'error'); function error($cycle) { $cycle->response->redirect('/error/'); } // Run the application $cycle->run();
function reset_cycle($name = 'default') { $cycle = Cycle::get_cycle($name); if ($cycle !== null) { $cycle->reset(); } }