/** * @return string */ public function mutate() { $running_delta = 0; foreach ($this->selector->getSelection() as $range) { //if anything has adjusted the delta $range->setOffset($running_delta); //after correcting the offset, it's safe to split it $temp = $range->parts($this->selector->getSource()); //once we split it we have the middle string and can calculate the new delta $running_delta += $this->subDelta($temp['mid']); $temp['mid'] = $this->subMutate($temp['mid']); $this->selector->setSource(implode('', $temp)); } return $this->selector->getSource(); }
public function execute( $par ) { global $wgOut, $wgRequest; $name = $wgRequest->getVal( 'name' ); $format = $wgRequest->getVal( 'format' ); if( $wgRequest->wasPosted() ) { $wgOut->disable(); $namespace = $wgRequest->getVal( 'namespace' ); $article = $wgRequest->getVal( 'article' ); $action = $wgRequest->getVal( 'action' ); if( $action == 'setrevision' ) { $revision = $wgRequest->getVal( 'revision' ); $success = Selection::setRevision( $name, $namespace, $article, $revision ); $title = Title::makeTitle( $namespace, $article ); $url = $title->getLinkUrl( array( 'oldid' => $revision ) ); $return = array( 'status' => $success, 'revision' => $revision, 'revision_url' => $url ); } elseif ( $action == 'deletearticle') { $success = Selection::deleteArticle( $name, $namespace, $article ); $return = array( 'status' => $success ); } echo json_encode($return); return; } $entries = Selection::getSelection( $name ); $this->setHeaders(); $wgOut->setPageTitle("Selection"); if( $format == 'csv' ) { $wgRequest->response()->header( 'Content-type: text/csv' ); // Is there a security issue in letting the name be arbitrary? $wgRequest->response()->header( "Content-Disposition: attachment; filename=$name.csv" ); $wgOut->disable(); $this->makeCSV( $entries, $name ); } $csv_link = $this->getFullTitle()->getFullUrl( array( 'format' => 'csv', 'name' => $name ) ); $template = new SelectionTemplate(); $template->set( 'articles', $entries ); $template->set( 'name', $name ); $template->set( 'csv_link', $csv_link ); $wgOut->addTemplate( $template ); }
echo $kelas->kelas_name; ?> <small><?php echo $ta; ?> </small> </h1> <?php if (!$muridview) { ?> <div class="row" style="margin-bottom: 10px;"> <div class="col-md-3 col-xs-12"> <?php //select on kelas $urlOnChange = _SPPATH . $webClass . "/" . $method . "?dummy=1"; Selection::kelasSelector($kelas, $urlOnChange); ?> </div> </div> <?php } Mold::both("wall/class_wall_einzel", $arr); ?> <?php //pr($arr); /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor.
echo Account::getMyName(); ?> <small><?php echo $monname; ?> <?php echo $year; ?> </small> </h1> <div class="row" style="margin-bottom: 10px;"> <div class="col-md-3 col-xs-12"> <?php //select on mon $urlOnChange = _SPPATH . $webClass . "/" . $method . "?d=1"; Selection::monthSelectorInTA($mon, $ta, $urlOnChange); ?> </div> </div> <?php //Mold::both("studensetup/absensi_legends",array("numDays"=>$numDays,"mon"=>$mon,"year"=>$year,"calendar"=>$calendar,"arrCl"=>$arrCl,"arrMacemAbsens"=>$arrMacemAbsens)); $cale = new Calendar(); $arrCl = $cale->arrCl; $abs = new Absensi(); $arrMacemAbsens = $abs->arrMacamAbsen; $limithari = 5; if (Schoolsetting::apaSabtuMasuk()) { $limithari = 6; } if (Schoolsetting::apaMingguMasuk()) {
/** * Set association. * @param ActiveRecord $record A record. * @param array $association Association options. * @param ActiveRecord|Selection|ActiveRecord[] $value New value. * @throws InvalidAssociationException If association type unknown. */ public function setAssociation(ActiveRecord $record, $association, $value) { switch ($association['type']) { case 'belongsTo': if (!isset($value)) { $this->unsetAssociation($record, $association); return; } assume($value instanceof ActiveRecord); assume($value->getModel() == $association['model']); $key = $association['otherKey']; $otherId = $association['model']->primaryKey; $record->{$key} = $value->{$otherId}; return; case 'hasOne': assume($value instanceof ActiveRecord); assume($value->getModel() == $association['model']); $this->unsetAssociation($record, $association); $key = $association['thisKey']; $id = $this->primaryKey; $value->{$key} = $record->{$id}; $value->save(); return; case 'hasMany': $key = $association['thisKey']; $id = $this->primaryKey; $idValue = $record->{$id}; if ($value instanceof Selection) { $value->set($key, $idValue)->update(); return; } if (!is_array($value)) { $value = array($value); } $this->unsetAssociation($record, $association); foreach ($value as $item) { assume($item instanceof ActiveRecord); assume($item->getModel() == $association['model']); $item->{$key} = $idValue; if (!$item->isNew()) { $item->save(); } } return; case 'hasAndBelongsToMany': return; } throw new InvalidAssociationException(tr('Unknown association type: %1', $association['type'])); }
?> <small><?php echo Lang::t('Subject'); ?> : <?php echo $mp->mp_name; ?> </small> </h1> <div class="row" style="margin-bottom: 10px;"> <div class="col-md-3 col-xs-12"> <?php //select on mon $urlOnChange = _SPPATH . $webClass . "/" . $method . "?mp_id=" . $mp->mp_id; // echo $urlOnChange; Selection::subjectSelector($mp, $urlOnChange); $t = time(); ?> </div> </div> </div> <div class="table-responsive"> <table class="table table-bordered table-hover"> <thead> <tr> <td><?php echo Lang::t('Name'); ?> </td>
public function execute( $par ) { $out = $this->getOutput(); $lang = $this->getLanguage(); $request = $this->getRequest(); if( $request->wasPosted() ) { $out->disable(); $action = $request->getVal( 'action' ); $selection_name = $request->getText( 'selection' ); if( $action == 'addtoselection' ) { $success = Selection::addEntries( $selection_name, $entries ); $sel_page = new SpecialSelection(); $url = $sel_page->getTitle()->getLinkUrl( array( 'name' => $selection_name ) ); $return = array( 'status' => $success, 'selection_url' => $url ); } echo json_encode($return); return; } $fields = array( 'Project-Name' => array( 'type' => 'text', 'label-message' => 'ss-project', 'tabindex' => '1' ), 'Importance' => array( 'type' => 'text', 'label-message' => 'ss-importance', 'tabindex' => '2' ), 'Quality' => array( 'type' => 'text', 'label-message' => 'ss-quality', 'tabindex' => '3' ) ); $project = $request->getText( 'wpProject' ); $importance = $request->getText( 'wpImportance' ); $quality = $request->getText( 'wpQuality' ); $filters = array_filter( array( 'r_project' => $project, 'r_importance' => $importance, 'r_quality' => $quality ) ); $this->setHeaders(); $this->outputHeader(); $out->setPageTitle( $this->msg( 'ss-filter-ratings' ) ); $form = new HTMLForm( $fields, $this->getContext() ); $form->setMethod( 'get' ); $form->prepareForm(); $form->displayForm( '' ); $pager = new RatingsPager( $this, $filters ); if ( $pager->getNumRows() ) { $out->addHTML( $pager->getNavigationBar() . $pager->getBody() ); } else { $out->addWikiMsg( 'ss-ratings-empty' ); } return; }
?> <small><?php echo Lang::t('level'); ?> <?php echo $klslevel; ?> </small> </h1> <div class="row" style="margin-bottom: 10px;"> <div class="col-md-12"> <?php //select on kelas $urlOnChange = _SPPATH . $webClass . "/" . $method . "?mp_id=" . $mp->mp_id; Selection::levelSelector($klslevel, $urlOnChange); ?> </div> </div> <div class="row"> <div class="col-md-12"> <!-- Nav tabs --> <ul class="nav nav-tabs" role="tablist"> <li class="active"><a href="#quiztab" role="tab" data-toggle="tab"><?php echo Lang::t('Quiz'); ?> </a></li> <li><a href="#tmtab" role="tab" data-toggle="tab"><?php echo Lang::t('Topic Maps');
<div class="row widgethead"> <div class="col-md-7"> <h3><?php echo Lang::t('Attendance'); ?> </h3> </div> <div class="col-md-5"> <?php //select on mon $urlOnChange = _SPPATH . "widget/myAbsensiWidget?d=1"; Selection::monthSelectorInTARefreshID($refreshID, $mon, $ta, $urlOnChange); ?> </div> </div> <hr/> <div class="row"> <div class="col-md-4 col-sm-4 col-xs-4" style="text-align: center;"> <div style="background-color: white; padding: 10px;"> <div style="font-size: 40px; color: green;"><?php echo $absensi['Masuk']; ?> </div> <div><?php echo Lang::t("Att"); ?> </div> </div> </div> <div class="col-md-4 col-sm-4 col-xs-4" style="text-align: center;"> <div style="background-color: white; padding: 10px;">
<?php error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); include_once "class/nitobi.xml.php"; include_once '../../mainfile.php'; include_once "class/Selection.inc.php"; include_once "class/Log.inc.php"; include_once "setting.php"; $id = $_GET['id']; $defaultorganization_id = $_SESSION['defaultorganization_id']; $defaultpagesize = 15; $action = $_GET['action']; $log = new Log(); $o = new Selection(); $isadmin = $xoopsUser->isAdmin(); $getHandler = new EBAGetHandler(); switch ($action) { case "country": $wherestring = " WHERE country_id>0 and isdeleted=0"; $o->showCountry(); break; case "module": $wherestring = " WHERE mid>0"; $o->showModule(); break; case "window": $wherestring = " WHERE window_id>=0"; $o->showWindow(); break; case "currency": $wherestring = " WHERE currency_id>0";
public function offsetUnset($offset) { unset($this->data[$offset]); return $this->selection->offsetUnset($offset); }
/** * Retrieves the entities based on the selection * @param Selection $selection * @return mixed */ public function query($selection) { return $selection->getQuery(); }
include '../php/controller/MethodController.php'; include '../php/controller/MarkController.php'; include '../php/controller/ResidentController.php'; include '../php/controller/PastPupilController.php'; include '../php/controller/PresentPupilController.php'; include '../php/controller/StaffController.php'; include '../php/model/Resident.php'; include '../php/model/Staff.php'; include '../php/model/PastPupil.php'; include '../php/model/PresentPupil.php'; include '../php/model/Selection.php'; $id = $_POST["calculate_school_id"]; $all_schools = getAllSchools(); foreach ($all_schools as $main_result) { $methods = getMethod($main_result['school_id']); $select = new Selection($main_result['capacity']); foreach ($methods as $result_2) { if (strcmp($result_2['method_name'], "RESIDENT") == 0) { $res_detail = getAllResidenMethodInforChild($result_2['method_id']); foreach ($res_detail as $result_3) { $resi = new \Model\Resident($result_3['resident_id'], $result_2['method_id'], $result_3['num_of_years_spent'], $result_3['ownership'], $result_3['num_of_closes_schools'], $result_3['confirm'], null); if ($resi->getConfirm() == 1) { $resi_marks = $resi->getFullMarks(); $count_sel = $select->getCount("RESIDENT"); insertMarksForChild("RESIDENT", $resi_marks, $result_2['child_id']); } } $resi_select = getResidentSelection($main_result['school_id']); foreach ($resi_select as $selec_resi) { if ($count_sel > 0) { updateMarksForChild("QUALIFIED", $selec_resi['child_id']);
public function testSubselect() { $selection = new Selection(4); $result = $selection->select([1, 2, 3, 4, 5, 6]); $this->assertCount(4, $result); }