query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Get the year of the newest movie.
public static function getYearNewest() { if (Helpers::hasAccess('titles.create')) $year = Title::max('year'); else $year = Title::where('type', '=', 'movie') ->whereNotNull('video') ->where('video','<>','') ->whereNotNull('poster') ->where('poster','<>','') ->whereNotNull('background') ->where('background','<>','') ->max('year'); return $year; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getYearOldest()\n {\n if (Helpers::hasAccess('titles.create'))\n $year = Title::min('year');\n else\n $year = Title::where('type', '=', 'movie')\n ->whereNotNull('video')\n ->where('video','<>','')\n ->whereNotNull('poster')\n ->where('poster','<>','')\n ->whereNotNull('background')\n ->where('background','<>','') \n ->min('year'); \n return $year;\n }", "public function latestYear()\n\t{\n\t\t$year = $this->doll->orderBy('release_year', 'DESC')->pluck('release_year');\n\t\treturn $year;\n\t}", "public function getHighestYear() {\n\t\t$query = $this->createQuery();\n\t\t$query->getQuerySettings()->setRespectStoragePage(FALSE);\n\t\t$query->statement(\"SELECT MAX(year) as year FROM `tx_wxlottery_domain_model_partnerlog`\");\n\t\treturn $query->execute()->getFirst()->getYear();\n }", "function get_year()\n {\n $datearray=getdate($this->timestamp);\n return $datearray[\"year\"];\n }", "public function getYear()\n {\n if ($this->isReady) {\n if ($strReturn = $this->matchRegex($this->_strSource, IMDB::IMDB_YEAR, 1)) {\n return intval($strReturn);\n }\n }\n return 0;\n }", "public function getYear()\r\n\t{\r\n\t\treturn $this->format('y');\r\n\t}", "public function getYear() {}", "public function getYear()\n\t{\n\t\treturn $this->year \n\t\t\t?? $this->year = date('Y');\n\t}", "public function GetYear() {\n return $this->format('Y');\n }", "public function getYear(): string\n {\n return $this->toLocalizedString('y');\n }", "protected function year(){\n return $this->now->format('Y');\n }", "public function getYear()\n {\n return $this->_getDateValue('Y');\n }", "function getYear()\n {\n if (!isset($this->iyear) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iyear;\n }", "public function getYear()\n\t\t{\n\t\t\t$date = new \\DateTime($this->created_at);\n\t\t\treturn $date->format('Y');\n\t\t}", "public function getYear()\n {\n return $this->year;\n }", "public function getYear()\n {\n return $this->year;\n }", "public function getYear() : int\n {\n return $this->year;\n }", "public function getYear()\n\t{\n\t\treturn $this->year;\n\t}", "public function getYear() : string;", "public function getYear() {\n return $this->_year;\n }", "public function year()\n\t{\n\t\treturn date('Y');\n\t}", "public function getFullYear()\r\n\t{\r\n\t\treturn $this->format('Y');\r\n\t}", "function getYear()\r\n {\r\n return $this->ano;\r\n }", "public function getCurrentYear() {\n return date('Y');\n }", "function getCurrentYear ()\n\t{\n\t\treturn date ('Y');\n\t}", "public static function yearOrMostRecent($year) {\n\t if($year > 0 AND CompYear::where('year', $year)->count() > 0) {\n\t return $year;\n\t } else {\n\t return CompYear::orderBy('year', 'desc')->first()->year;\n\t }\n\t}", "public function getYear(){\n\t\treturn $this->_year;\n\t}", "public static function getCurrentYear() {\n return date('Y');\n }", "public function getYear()\n {\n return $this->calendarMonth->getYear();\n }", "public function getPublicationYear() {\n $fields = array('publicationYear');\n $result = TingOpenformatMethods::parseFields($this->_getPublicationDetails(), $fields);\n return (is_array($result)) ? reset($result) : $result;\n }" ]
[ "0.835145", "0.7984218", "0.7582918", "0.74839866", "0.74109054", "0.73996836", "0.73661256", "0.7364516", "0.735748", "0.73119915", "0.72938186", "0.72919935", "0.72705406", "0.72457206", "0.7229406", "0.7229406", "0.7185853", "0.7173339", "0.712127", "0.7105112", "0.7104063", "0.71022356", "0.7083876", "0.70522314", "0.7035548", "0.7032599", "0.70245516", "0.6975771", "0.6931727", "0.691135" ]
0.8412765
0
Movies by Relevance query scope.
public function scopeRelevance($query, $id, $relevance) { $fet = $query; if ($relevance == 'releases') { $fet = $query->where('releases', 1)->whereNotNull('video')->where('video','<>',''); } else if ($relevance == 'reindexed') { $fet = $query->where('reindexed', 'Reindexed')->whereNotNull('video')->where('video','<>',''); } else if ($relevance == 'featured') { $fet = $query->where('featured', 1)->whereNotNull('video')->where('video','<>',''); } else if ($relevance == 'popular') { $fet = $query->where('created_at', '>', DB::raw('date_sub(now(), INTERVAL 90 DAY)'))->whereNotNull('video')->where('video','<>','')->orderBy('tmdb_popularity', 'desc'); } else { $fet = $query->whereNotNull('video')->where('video','<>',''); } return $fet; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function orderByRelevance(){\n\t\tif(!$this->full_text)\n\t\t\treturn $this;\n\t\t$against = Propel::getServiceContainer()->getReadConnection($this->getDbName())->quote($this->fulltext_text);\n\t\treturn $this->withColumn('match (title) against (' . $against . ' IN BOOLEAN MODE)', 's1')->\n\t\t\twithColumn('match(description) against (' . $against . ' IN BOOLEAN MODE)', 's2')->\n\t\t\taddDescendingOrderByColumn(\"(s1*2)+s2\");\n\t}", "public function scopeSearch($query, $term);", "public function doMovieSearch()\n {\n if ( !preg_match( \"/^(.*)(19|20)[0-9]{2}/\", $this->Release, $matches ) )\n {\n $variables = array( 'status' => 'ko', 'message' => 'unable to extract the movie name' );\n }\n else\n {\n $movieTitle = $matches[1];\n\n $scraper = new MkvManagerScraperSubsynchro();\n $movies = array_map(\n function( $movie ) {\n $movie['id'] = str_replace( array( '/', '.' ), array( '|', '~' ), $movie['id'] );\n return $movie;\n },\n $scraper->searchMovies( $movieTitle )\n );\n\n $variables = array( 'status' => 'ok', 'movies' => $movies );\n }\n\n $result = new ezcMvcResult();\n $result->variables += $variables;\n\n return $result;\n }", "public function getMovies()\n {\n $movie = Movie::with('genres', 'cast', 'crew', 'licensors', 'producers', 'studios', 'reviews');\n $getters = Input::get();\n \n // Add offset/limit\n $movie->offset( (@$getters['index'] * @$getters['pageSize']) ?: 0);\n $movie->limit(@$getters['pageSize'] ?: 15);\n\n // Return items\n return $movie->get();\n }", "public function search() {\r\n //retrieve query terms from search form\r\n $query_terms = trim($_GET['query-terms']);\r\n\r\n //if search term is empty, list all vacations\r\n if ($query_terms == \"\") {\r\n $this->index();\r\n }\r\n\r\n //search the database for matching movies\r\n $vacations = $this->vacation_model->search_vacation($query_terms);\r\n\r\n if ($vacations === false) {\r\n //handle error\r\n $message = \"An error has occurred.\";\r\n $this->error($message);\r\n return;\r\n }\r\n //display matched movies\r\n $search = new VacationSearch();\r\n $search->display($query_terms, $vacations);\r\n }", "public function scopeMovieIndex($query, $perPage = 36)\n {\n return $query->where('type', '=', 'movie')\n ->orderBy(Helpers::getOrdering(), 'desc')\n ->paginate($perPage);\n }", "public function scopeSearch($query, $q)\n {\n return $query->where('title', 'LIKE', $q)\n ->select('id', 'imdb_id', 'tmdb_id', 'title', 'poster', 'type')\n ->whereNotNull('video')\n ->where('video','<>','')\n ->groupBy('title')\n ->orderBy(Helpers::getOrdering(), 'desc')\n ->get();\n }", "public function index()\n {\n $search = request('search');\n \n $movies = Movie::where([\n ['title','like','%'.$search.'%']])\n ->orwhere([['genre','like','%'.$search.'%']])\n ->orwhere([['release','like','%'.$search.'%']])\n ->orwhere([['rating','like','%'.$search.'%']])\n ->get();\n\n return view('movies.movies', compact('movies','search'));\n }", "public function getFilteredMovies()\n {\n $context = [\n 'movieList' => '',\n 'genreList' => '',\n 'conditions' => '',\n 'paginator' => '',\n ];\n\n // get the repository\n $movieRepository = $this->getRepository('movie');\n\n // get the conditions for the query, if any\n $conditions = $this->getConditions();\n\n // structure data for running the query (no pagination just yet)\n $queryConditions = Helper::prepareQueryData($conditions);\n\n try {\n // set default parameters for pagination\n $currentPage = $this->getQueryParam('page');\n $moviesPerPage = $conditions['pagination']['movies_per_page'];\n\n // but if the get parameter for pagination is not empty, use that one instead\n $moviesPerPageParam = $this->getQueryParam('movies_per_page');\n\n if (!empty($moviesPerPageParam)) {\n $moviesPerPage = $moviesPerPageParam;\n }\n\n // get results count for (potentially) filtered search\n $totalMovies = $movieRepository->getFilteredMovieCount($queryConditions);\n\n // get paginator and valid values for pagination\n $paginator = new Paginator($currentPage, $totalMovies, $moviesPerPage);\n $currentPage = $paginator->getCurrentPage();\n $moviesPerPage = $paginator->getResultsPerPage();\n\n // add pagination to query conditions\n $queryConditions['pagination'] = array('page' => $currentPage, 'per_page' => $moviesPerPage);\n\n // get results\n $movies = $movieRepository->loadFilteredMovies($queryConditions);\n\n // also get genres for displaying in the filters\n $genreRepository = $this->getRepository('genre');\n $genres = $genreRepository->loadAll();\n\n // set context for rendering\n $context = [\n 'movieList' => $movies,\n 'genreList' => $genres,\n 'conditions' => $conditions,\n 'paginator' => $paginator,\n ];\n\n // store the results for later use\n $this->session->set('movie_data', $context);\n\n // go to/show homepage\n if ($this->request->isMethod('POST')) {\n return $this->redirectRoute('homepage');\n } else {\n return $this->render('index', $context);\n }\n } catch (Exception $ex) {\n $this->addErrorMessage('Something went wrong while trying to talk to the database.');\n\n return $this->render('index', $context);\n }\n }", "public function movies(Request $request)\n {\n $query = $request->has('query') ? $request->get('query') : '';\n $page = $request->has('page') ? $request->get('page') : 1;\n\n /** @var $item */\n $item = $this->api->searchMovies($query, ['page' => $page]);\n\n if (!$item) {\n abort(404, \"The genre $query is not found.\");\n }\n\n // returns information of a genre\n return response($item);\n }", "public function moviesByYear() {\n $model = $this->model;\n $request = $this->request;\n $movies = $this->getAndSetCache(\n \\CacheVars::NAMESPACE_PAGE,\n \\CacheVars::KEY_MOVIES_DATA . \"_by_year_{$this->request->year}\",\n function() use($model, $request) {\n return $model->getMoviesByYear($request->year);\n }\n );\n $this->view->addParameter(\"movies\", $movies);\n }", "public function moviesByDirectorCount() {\n $model = $this->model;\n $request = $this->request;\n $movies = $this->getAndSetCache(\n \\CacheVars::NAMESPACE_PAGE,\n \\CacheVars::KEY_MOVIES_DATA . \"_by_director_count_{$this->request->count}\",\n function() use($model, $request) {\n return $model->getMoviesByDirectorCount($request->count);\n }\n );\n $this->view->addParameter(\"directors\", $movies);\n }", "public function scopeTitle($query, $input)\n {\n return $query->with('movie')->where('title', 'LIKE', '%'.$input.'%');\n /*$result = $query->with('movie')->where('title', 'LIKE', '%' . $input . '%')\n ->join('movie_tag', 'torrents.movie_id', '=', 'movie_tag.movie_id')\n ->join('tags', 'movie_tag.tag_id', '=', 'tags.id')->get();*/\n }", "public function movies()\n {\n return $this->morphedByMany('App\\Movie', 'source_genre');\n }", "public function moviesAndSeriesByGenre() {\n $model = $this->model;\n $request = $this->request;\n $genre = $this->getAndSetCache(\n \\CacheVars::NAMESPACE_PAGE,\n \\CacheVars::KEY_MOVIES_DATA . \"_by_genre_{$this->request->genre}\",\n function() use($model, $request) {\n return $model->getByGenre($request->genre);\n }\n );\n\n if (count($genre[\"movie\"]) + count($genre[\"serie\"]) > 0) {\n $this->view->addParameter(\"movies\", $genre[\"movie\"]);\n $this->view->addParameter(\"series\", $genre[\"serie\"]);\n } else {\n $this->view->addParameter(\"error\", \"Nothing found :/\");\n }\n }", "public function reviews()\n {\n return $this->hasMany('App\\Models\\Review', 'movies_id');\n }", "public function search(Request $request)\n {\n $name = $request->input('name');\n $studio = $request->input('studio');\n $actor = $request->input('actor');\n\n $movies = Movie::with(['actors', 'studio'])\n ->when($name, function ($query) use ($name) {\n return $query->where('name', 'like', \"%$name%\");\n })\n ->whereHas('studio', function ($query) use ($studio) {\n return $query->where('name', 'like', \"%$studio%\");\n })\n ->whereHas('actors', function ($query) use ($actor) {\n return $query->where('name', 'like', \"%$actor%\");\n })\n ->get();\n\n return new MovieCollection($movies);\n }", "public function scopeSearch($query,$search){\n if($search){\n return $query->where ('title','LIKE',\"%$search%\")\n ->orWhere('description','LIKE',\"%$search%\");\n }\n }", "public function scopeRamSearch($query, $search)\n {\n \t$brand = strtoupper($search);\n return $query = DB::table('rams')\n ->join('brands', 'rams.brand_id', '=', 'brands.id')\n ->select('rams.*', 'rams.type as Rtype', 'rams.id AS Rid', 'brands.id AS Bid', 'brands.name AS brand', 'rams.registered')\n ->where([ ['rams.type', 'LIKE', \"%$search%\"], ['rams.deleted_at', '=', null] ])\n ->orWhere([ ['brands.name', 'LIKE', \"%$brand%\"], ['rams.deleted_at', '=', null] ])\n ->orderBy('id', 'desc')\n ->paginate(25);\n }", "public function searchByTitle($title)\n {\n $searchUrl = $this->apiUrl.$this->apiKey.\"/search/movie/title/\".$title.\"/fuzzy\";\n $searchResponse = file_get_contents($searchUrl);\n $searchObj = json_decode($searchResponse, true);\n\n return $searchObj[\"results\"];\n }", "public function scopeSearch($query, $term)\n {\n if($term)\n {\n $query->where(function ($q) use ($term){\n $q->where('title', 'LIKE', \"%{$term}%\");\n\n $q->orwhereHas('author', function ($qr) use ($term){\n $qr->where('name', 'LIKE', \"%{$term}%\");\n });\n });\n }\n }", "public function search_movie_by_title($search_keyword, $page_limit = '30', $page = '1') {\n $format = variable_get('rottentomatoes_format', '.json');\n $params['q'] = $search_keyword;\n $params['page_limit'] = $page_limit;\n return $this->call('movies' . $format . '/', $params, 'GET');\n }", "public function scopeSearched($query) // this is convention method\n {\n\n $search = request()->query('search');\n\n if (!$search) {\n\n return $query->published();\n\n }\n\n return $query->published()->where('title', 'LIKE', \"%{$search}%\");\n\n }", "public function search($params)\n {\n $query = Reviews::find();\n $query->from(['r' => Reviews::tableName()]);\n // $query->joinWith('user as user');\n\n // add conditions that should always apply here\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n $this->load($params);\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n $query->andFilterWhere(['r.status' => $this->status]);\n if ($this->program_id) $query->andWhere(['r.program_id' => $this->program_id]);\n if ($this->query) $query->andWhere([\n 'OR',\n ['like', 'r.common' => $this->query],\n ['like', 'r.title' => $this->query],\n ['like', 'r.minuses' => $this->query],\n ['like', 'r.pluses' => $this->query]\n ]);\n\n return $dataProvider;\n }", "function pageController($allMovies)\n{\n\n // If $_GET['genre'] holds 'adventure', make $movies hold movies with 'adventure' as a genre.\n\n $data = [];\n // var_dump($_GET);\n\n if(isset($_GET['genre'])) {\n $genre = $_GET['genre'];\n $movies = [];\n\n foreach($allMovies as $movie) {\n if(in_array($genre, $movie['genre'])){\n $movies[] = $movie;\n //sets the search to pull all movies in the movie array set to the genre specified(by user - $genre provides doesn't hardcode the function to a specific genre)\n }\n //refer to needle/haystack concept\n }\n $data['movies'] = $movies; \n\n } elseif(isset($_GET['release'])) {\n $release = $_GET['release'];\n $movies = [];\n\n foreach($allMoveies as $movie) {\n if (in_array($release, $movie['release'])) {\n $movies[] = $movie;\n } \n }\n $data['movies'] = $movies;\n \n } else {\n $data['movies'] = $allMovies;\n }\n // set $data['movies'] to hold all movies (unless another request is made.)\n $data['movies'] = $allMovies;\n\n return $data;\n\n}", "public function searchAllCommByTitleMovie($title)\n {\n $req = $this->pdo->prepare('SELECT id_movie FROM movies WHERE title = ? ORDER BY `date` DESC');\n $req->execute([$title]);\n return $req->fetchAll();\n }", "public function scopeReindexed($query)\n {\n $fet = $query->where('reindexed', 'Reindexed')->whereNotNull('video')->where('video','<>','');\n\n return $fet;\n }", "public function findByGenre(Genre $genre)\n\t{\n\t\treturn $genre->getMovies();\n\t}", "public function getAllMovies()\n {\n return DB::table('movies')->get();\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('video_id',$this->video_id,true);\n\t\t$criteria->compare('uploader',$this->uploader,true);\n\t\t$criteria->compare('age',$this->age);\n\t\t$criteria->compare('category',$this->category,true);\n\t\t$criteria->compare('length',$this->length);\n\t\t$criteria->compare('views',$this->views);\n\t\t$criteria->compare('rate',$this->rate);\n\t\t$criteria->compare('ratings',$this->ratings);\n\t\t$criteria->compare('comments',$this->comments);\n\t\t$criteria->compare('related_1',$this->related_1,true);\n\t\t$criteria->compare('related_2',$this->related_2,true);\n\t\t$criteria->compare('related_3',$this->related_3,true);\n\t\t$criteria->compare('related_4',$this->related_4,true);\n\t\t$criteria->compare('related_5',$this->related_5,true);\n\t\t$criteria->compare('related_6',$this->related_6,true);\n\t\t$criteria->compare('related_7',$this->related_7,true);\n\t\t$criteria->compare('related_8',$this->related_8,true);\n\t\t$criteria->compare('related_9',$this->related_9,true);\n\t\t$criteria->compare('related_10',$this->related_10,true);\n\t\t$criteria->compare('related_11',$this->related_11,true);\n\t\t$criteria->compare('related_12',$this->related_12,true);\n\t\t$criteria->compare('related_13',$this->related_13,true);\n\t\t$criteria->compare('related_14',$this->related_14,true);\n\t\t$criteria->compare('related_15',$this->related_15,true);\n\t\t$criteria->compare('related_16',$this->related_16,true);\n\t\t$criteria->compare('related_17',$this->related_17,true);\n\t\t$criteria->compare('related_18',$this->related_18,true);\n\t\t$criteria->compare('related_19',$this->related_19,true);\n\t\t$criteria->compare('related_20',$this->related_20,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}" ]
[ "0.5807168", "0.57633203", "0.5763046", "0.5663409", "0.5583228", "0.55712706", "0.55194813", "0.5478193", "0.5452898", "0.5395288", "0.5261069", "0.52519494", "0.5226712", "0.52236336", "0.5213456", "0.51951873", "0.51910675", "0.5170936", "0.51475376", "0.5144644", "0.51438993", "0.51180017", "0.5065071", "0.5035217", "0.5035061", "0.5033917", "0.50289744", "0.50177056", "0.50132954", "0.50123626" ]
0.64851475
0
Movies by Range of Years query scope.
public function scopeYearsRange($query, $id, $yearFrom, $yearTo) { $fet = $query; if ($yearFrom && $yearTo) $fet = $fet->whereBetween('year', array($yearFrom, $yearTo))->whereNotNull('video')->where('video','<>',''); if ($this->options->getDataProvider() == 'db' || ! $this->options->autoUpdateData()) { return $fet; } if ($fet->isEmpty() || $fet->first()->updated_at->addDay() <= Carbon::now()) { $fet = $this->updateFeatured(); } return $fet; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function moviesByYear() {\n $model = $this->model;\n $request = $this->request;\n $movies = $this->getAndSetCache(\n \\CacheVars::NAMESPACE_PAGE,\n \\CacheVars::KEY_MOVIES_DATA . \"_by_year_{$this->request->year}\",\n function() use($model, $request) {\n return $model->getMoviesByYear($request->year);\n }\n );\n $this->view->addParameter(\"movies\", $movies);\n }", "public function scopeYear($query, $year)\n {\n return $query->whereYear('created_at', $year);\n }", "public function searchYearActionGet()\n {\n $title = \"Search by year\";\n\n $this->app->db->connect();\n\n $fromYear = $this->app->request->getGet(\"fromYear\");\n $toYear = $this->app->request->getGet(\"toYear\");\n\n if ($fromYear && $toYear) {\n $sql = \"SELECT * FROM movie WHERE year >= ? AND year <= ?;\";\n $res = $this->app->db->executeFetchAll($sql, [$fromYear, $toYear]);\n } elseif ($fromYear) {\n $sql = \"SELECT * FROM movie WHERE year >= ?;\";\n $res = $this->app->db->executeFetchAll($sql, [$fromYear]);\n } elseif ($toYear) {\n $sql = \"SELECT * FROM movie WHERE year <= ?;\";\n $res = $this->app->db->executeFetchAll($sql, [$toYear]);\n }\n\n $this->app->page->add(\"movie/search-year\", [\n \"fromYear\" => $fromYear,\n \"toYear\" => $toYear,\n ]);\n\n if (isset($res)) {\n $this->app->page->add(\"movie/show-all\", [\n \"res\" => $res,\n ]);\n }\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }", "public function years_range()\r\n {\r\n // end date.\r\n if(!($this->start && $this->end)){\r\n return NULL;\r\n }\r\n return array($this->start->format('Y'), $this->end->format('Y'));\r\n }", "public static function from_years_range($start_year, $end_year)\r\n {\r\n $newstart = new DateTime($start_year . '-01-01', new DateTimeZone('GMT'));\r\n $newend = new DateTime($end_year . '-12-31', new DateTimeZone('GMT'));\r\n return new PiplApi_DateRange($newstart, $newend);\r\n }", "public function year($year = null)\n {\n return \\App\\Event::with('venue.city.states')\n ->whereYear('start_date', $year)\n ->orderby('start_date', 'asc')\n ->paginate($this->paginate);\n }", "public function modelYear();", "public function searchActiveCelebritiesWorldYear($year = 2015)\n {\n $intervalStart = $year .'-01-01 00:00:00';\n\t\t$intervalEnd = $year .'-12-31 00:00:00';\n\t\t\n\t\t$query = ArtistPlan::find()\n\t\t\t->innerJoin('artist', 'artistplan.artist_id = artist.id')\n\t\t\t->andWhere(['artistplan.show_status' => 1])\n\t\t\t->andWhere(['artist.show_status' => 1])\n\t\t\t->andWhere(['artist.celebrity_status' => 1])\n\t\t\t->andWhere(['between', 'start_date', self::$startOfTime, $intervalEnd])\n\t\t\t->andWhere(['between', 'end_date', $intervalStart, self::$endOfTime])\n\t\t\t->orderBy([\"artist.show_order\" => SORT_ASC]);\n\t\t\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n\t\t\t'pagination' => [\n\t\t\t\t'pageSize' => 40\n\t\t\t]\n ]);\n\n return $dataProvider;\n }", "public function generateYears($range = true, $startYear = 2015, $endYear = null){\n $years_arr = array();\n \n $currentYear = date('Y'); //string\n $currentMonth = date('m');\n \n if($endYear != null){\n for($i = $endYear; $i >= $startYear; $i--){\n $range ? $years_arr[$i] = $i . '-' . ($i + 1) : $years_arr[$i] = $i;\n }\n } else {\n //show next year if it's May or later\n if($currentMonth >= 5){\n for($i = $currentYear; $i >= $startYear; $i--){\n $range ? $years_arr[$i] = $i . '-' . ($i + 1) : $years_arr[$i] = $i;\n }\n } else {\n for($i = $currentYear - 1; $i >= $startYear; $i--){\n $range ? $years_arr[$i] = $i . '-' . ($i + 1) : $years_arr[$i] = $i;\n }\n }\n }\n \n return $years_arr;\n }", "public static function selectYear($name, $start, $end = null, $value = null, $attrs = array())\n {\n $end = is_null($end) ? (int) date('Y') : $end;\n\n $years = range($start, $end);\n \n $lists = array();\n\n foreach ($years as $y) {\n $lists[$y] = $y;\n }\n\n return static::select($name, $lists, static::getValue($name, $value), $attrs);\n }", "public function findAllYears()\n {\n $query = 'SELECT DISTINCT t.year FROM ApiTracklistBundle:Track t ORDER BY t.year DESC';\n\n return $this->getEntityManager()\n ->createQuery($query)\n ->getResult();\n }", "public function setYear($year);", "function getMediaYears($date)\n{\n $sql = \"SELECT media_year,media_year_start,media_year_end from media_calendar where media_year <= YEAR('\" . $date . \"') GROUP by media_year ORDER BY media_year DESC\";\n $result = getResult($sql);\n return $result;\n}", "public function year_list()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date',\n\t\t\t\t\t'default' => 'year-01-01'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 100\n\t\t\t\t\t)\n\t\t\t);\n\n//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t$today = $this->CDT->date_array();\n\n\t\t$this->CDT->change_ymd($this->P->value('date_range_start', 'ymd'));\n\t\t$this->CDT->set_default($this->CDT->datetime_array());\n\t\tif ($this->P->value('date_range_end') === FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_end', $this->CDT->add_year($this->P->value('limit')));\n\t\t\t$this->CDT->reset();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->P->set('limit', 9999);\n\t\t}\n\n\t\t$dir = ($this->P->value('date_range_end', 'ymd') > $this->P->value('date_range_start', 'ymd')) ? 1 : -1;\n\t\t$output = '';\n\t\t$count = 0;\n\n//ee()->TMPL->log_item('Calendar: Looping');\n\n\t\tdo {\n\t\t\t$vars['conditional']\t= array\t(\t'is_current_year'\t\t=>\t($this->CDT->year == $today['year']) ? TRUE : FALSE,\n\t\t\t\t\t\t\t\t\t\t\t\t'is_not_current_year'\t=>\t($this->CDT->year == $today['year']) ? FALSE : TRUE\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t$vars['single']\t= array('year'\t=> $this->CDT->year);\n\t\t\t$vars['date']\t= array(\n\t\t\t\t'year'\t\t=> $this->CDT->datetime_array(),\n\t\t\t\t'date'\t\t=> $this->CDT->datetime_array(),\n\t\t\t);\n\t\t\t$output .= $this->swap_vars($vars, ee()->TMPL->tagdata);\n\t\t\t$this->CDT->add_year($dir);\n\t\t\t$count++;\n\t\t} while ($count < $this->P->value('limit') AND $this->CDT->year < $this->P->value('date_range_end', 'year'));\n\n\t\treturn $output;\n\t}", "public function Years() {\r\n $years = range(date(\"Y\"), 1910);\r\n return $years;\r\n }", "function getListYear($data,$start=1,$end=2)\n{\n #awal = Start Year\n #akhir = End Year\n $property = $data;\n \n $awal = date('Y')-$start;\n $akhir = date('Y')+$end;\n if($property==''){\n $select = date('Y');\n }\n else{\n $select = $property;\n } \n $i = $awal; \n for($i>=$awal;$i<=$akhir;$i++)\n {\n #cond Selection\n if($i==$select){\n $sta = 'selected';\n }\n else{\n $sta = '';\n } \n echo '<option value=\"'.$i.'\" '.$sta.'>'.$i.'</option>';\n }\n}", "public function getAllYears()\n\t{\n\t\treturn array_map(function ($election) {\n\t\t\t/** @var Election $election */\n\t\t\treturn date('Y', $election->getDate()->getTimestamp());\n\t\t}, $this->getAll());\n\t}", "public function findYearsByFilter($filter) {\n $filter2 = clone $filter;\n $filter2->year = null;\n $articles = $this->findByFilter($filter2);\n $yearArray = array();\n foreach($articles as $article) {\n $date = $article->getArticleDate();\n $year = $date->format('Y');\n if(!isset($yearArray[$year])) {\n $yearArray[$year] = array('count' => 0);\n }\n if(!isset($yearArray[$year]['value'])) {\n $yearFilter = clone $filter2;\n $yearFilter->year = $year;\n $yearArray[$year]['value'] = intval($year);\n $yearArray[$year]['searchFilter'] = $yearFilter;\n }\n $yearArray[$year]['count']++;\n }\n return $yearArray;\n }", "function cucina_year_query( $query ){\n\tif ( $query->is_main_query() && is_year() ) {\n\t\t$query->set( 'posts_per_archive_page', 110 );\n\t}\n}", "function get_vehicles_by_year() {\n global $db;\n $query = 'SELECT * FROM vehicles\n ORDER BY year DESC';\n $statement = $db->prepare($query);\n $statement->execute();\n $vehicles = $statement->fetchAll();\n $statement->closeCursor();\n return $vehicles;\n }", "public function getYearsOfEvents()\n {\n $qb = $this->entityManager->getRepository('Event\\Entity\\Event')\n ->createQueryBuilder('e')\n ->select('YEAR(e.eventStartDate) AS eYear')\n ->where('e.deleted = 0')\n ->groupBy('eYear')\n ->orderBy('eYear', 'DESC');\n\n $query = $qb->getQuery();\n $result = $query->getResult();\n return $result;\n }", "function filterByYear($year) {\n $this->setDateFilter(self::DATE_FILTER_SELECTED_YEAR);\n $this->setAdditionalProperty('date_filter_year', (string) $year);\n }", "public function filterGradYear($gradYears)\n {\n $programsid = Auth::user()->programs_id;\n //filter alumni by gradYear\n $alumni = Alumni::where('programs_id', '=', $programsid)->where('gradYear', '=', $gradYears)->orderBy('gradYear', 'asc')->get();\n \n $industry = Alumni::whereNotNull('industry')->orderBy('industry', 'asc')->pluck('industry')->unique();\n $gradYear = Alumni::whereNotNull('gradYear')->orderBy('gradYear', 'asc')->pluck('gradYear')->unique();\n $company = Alumni::whereNotNull('company')->orderBy('company', 'asc')->pluck('company')->unique();\n \n return view('Coach/alumSearch', compact('alumni', 'industry', 'gradYear', 'company'));\n }", "function getYearsSelect()\n\t{\n\t\treturn $this->db->query(\"SELECT distinct(year(created_sell)) as yearssell from tb_sell where status <> 1 order by created_sell desc\")->result();\n\t}", "function print_year_range_option_list( $p_year = 0, $p_start = 0, $p_end = 0 ) {\n\t$t_current = date( 'Y' );\n\t$t_forward_years = config_get( 'forward_year_count' );\n\n\t$t_start_year = $p_start;\n\tif( $t_start_year == 0 ) {\n\t\t$t_backward_years = config_get( 'backward_year_count' );\n\t\t$t_start_year = $t_current - $t_backward_years;\n\t}\n\n\tif( ( $p_year < $t_start_year ) && ( $p_year != 0 ) ) {\n\t\t$t_start_year = $p_year;\n\t}\n\n\t$t_end_year = $p_end;\n\tif( $t_end_year == 0 ) {\n\t\t$t_end_year = $t_current + $t_forward_years;\n\t}\n\tif( $p_year > $t_end_year ) {\n\t\t$t_end_year = $p_year + $t_forward_years;\n\t}\n\n\tfor( $i = $t_start_year;$i <= $t_end_year;$i++ ) {\n\t\tif( $i == $p_year ) {\n\t\t\techo '<option value=\"' . $i . '\" selected=\"selected\">' . $i . '</option>';\n\t\t} else {\n\t\t\techo '<option value=\"' . $i . '\">' . $i . '</option>';\n\t\t}\n\t}\n}", "public function scopeYearlyPost($query)\n {\n return $query->selectRaw('year(created_at)')->groupBy('year(created_at)')->orderByDesc('year(created_at)');\n }", "function get_all_hazard_fiscal_years($conn) {\n $query_date = \"SELECT MIN(date), MAX(date) FROM hazard\";\n $dates = exec_query($conn, $query_date);\n $min_date = DateTime::createFromFormat('Y-m-d', $dates[0][0]);\n $max_date = DateTime::createFromFormat('Y-m-d', $dates[0][1]);\n $min_fiscal_year = get_corresponding_fiscal_year($min_date);\n $max_fiscal_year = get_corresponding_fiscal_year($max_date);\n return range($min_fiscal_year, $max_fiscal_year);\n}", "public function searchActiveContinentYear($continent = false, $year = 2015)\n {\t\t\n\t\t$intervalStart = $year .'-01-01 00:00:00';\n\t\t$intervalEnd = $year .'-12-31 00:00:00';\n\n\n\t\t// artist plans sorted by artist order\t\n\t\t$query = ArtistPlan::find()->innerJoin('artist', 'artistplan.artist_id = artist.id')\n\t\t\t->where('artistplan.show_status = :status') \n\t\t\t->andWhere(['between', 'start_date', self::$startOfTime, $intervalEnd])\n\t\t\t->andWhere(['between', 'end_date', $intervalStart, self::$endOfTime]);\n\t\t\n\t\t$query->addParams([':status' => 1]); \n\t\t\n\t\tif ($continent) {\n\t\t\t$query->andWhere(\"continent = :continent\");\n\t\t\t$query->addParams([':continent' => $this->getContinentName($continent)]); \n\t\t}\n\t\t\n\t\t$query->orderBy([\"artist.show_order\" => SORT_ASC]);\n\t\t\n\t\t$dataProvider = new ActiveDataProvider([\n 'query' => $query,\n\t\t\t'pagination' => [\n\t\t\t\t'pageSize' => 40\n\t\t\t]\n ]);\n\n return $dataProvider;\n }", "function culturefeed_search_ui_get_age_range_facet_options() {\n return array(\n 0 => array(\n 'name' => '0-2 ' . t('year'),\n 'query' => '(agefrom:[0 TO 2] OR keywords:\"ook voor kinderen\")',\n 'range' => '[0 TO 2]',\n ),\n 3 => array(\n 'name' => '3-5 ' . t('year'),\n 'query' => '(agefrom:[3 TO 5] OR keywords:\"ook voor kinderen\")',\n 'range' => '[3 TO 5]',\n ),\n 6 => array(\n 'name' => '6-8 ' . t('year'),\n 'query' => '(agefrom:[6 TO 8] OR keywords:\"ook voor kinderen\")',\n 'range' => '[6 TO 8]',\n ),\n 9 => array(\n 'name' => '9-11 ' . t('year'),\n 'query' => '(agefrom:[9 TO 11] OR keywords:\"ook voor kinderen\")',\n 'range' => '[9 TO 11]',\n ),\n );\n\n}", "public static function filter_books_by_year($books, $year) {\n\t\t$result = [];\n\t\tforeach ($books as $book) {\n\t\t\t$first_date = date_create($year.'-01-01');\n\t\t\t$last_date = date_create($year.'-12-31');\n\t\t\t$book_date = date_create($book->release_at);\n\t\t\tif ($book_date >= $first_date && $book_date <= $last_date)\n\t\t\t\tarray_push($result, $book);\n\t\t}\n\t\treturn $result;\n\t}" ]
[ "0.6809021", "0.6227028", "0.5912482", "0.59111154", "0.5858381", "0.56836104", "0.5668291", "0.56246346", "0.5571376", "0.55577374", "0.5556196", "0.55444604", "0.553591", "0.54208535", "0.54151773", "0.5360978", "0.5343592", "0.5328631", "0.53198755", "0.53195614", "0.52974665", "0.52930653", "0.5277996", "0.5270481", "0.52688843", "0.5263921", "0.5201998", "0.51982915", "0.51759744", "0.5157847" ]
0.65264124
1
Featured movies query scope.
public function scopeFeatured($query) { $fet = $query->where('featured', 1)->whereNotNull('video')->where('video','<>',''); if ($this->options->getDataProvider() == 'db' || ! $this->options->autoUpdateData()) { return $fet; } if ($fet->isEmpty() || $fet->first()->updated_at->addDay() <= Carbon::now()) { $fet = $this->updateFeatured(); } return $fet; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function scopeFeatured($query)\n {\n return $query->withStatus(self::FEATURED);\n }", "public function scopeGenres($query, $id, $genre = 'all')\n {\n $fet = $query;\n\n if ($genre != 'all')\n {\n $fet = $query->where('genre', 'Like', '%' . $genre . '%')->whereNotNull('video')->where('video','<>','');\n }\n\n if ($this->options->getDataProvider() == 'db' || ! $this->options->autoUpdateData())\n {\n return $fet;\n }\n\n if ($fet->isEmpty() || $fet->first()->updated_at->addDay() <= Carbon::now())\n {\n $fet = $this->updateFeatured();\n }\n\n return $fet; \n }", "public function getFilteredMovies()\n {\n $context = [\n 'movieList' => '',\n 'genreList' => '',\n 'conditions' => '',\n 'paginator' => '',\n ];\n\n // get the repository\n $movieRepository = $this->getRepository('movie');\n\n // get the conditions for the query, if any\n $conditions = $this->getConditions();\n\n // structure data for running the query (no pagination just yet)\n $queryConditions = Helper::prepareQueryData($conditions);\n\n try {\n // set default parameters for pagination\n $currentPage = $this->getQueryParam('page');\n $moviesPerPage = $conditions['pagination']['movies_per_page'];\n\n // but if the get parameter for pagination is not empty, use that one instead\n $moviesPerPageParam = $this->getQueryParam('movies_per_page');\n\n if (!empty($moviesPerPageParam)) {\n $moviesPerPage = $moviesPerPageParam;\n }\n\n // get results count for (potentially) filtered search\n $totalMovies = $movieRepository->getFilteredMovieCount($queryConditions);\n\n // get paginator and valid values for pagination\n $paginator = new Paginator($currentPage, $totalMovies, $moviesPerPage);\n $currentPage = $paginator->getCurrentPage();\n $moviesPerPage = $paginator->getResultsPerPage();\n\n // add pagination to query conditions\n $queryConditions['pagination'] = array('page' => $currentPage, 'per_page' => $moviesPerPage);\n\n // get results\n $movies = $movieRepository->loadFilteredMovies($queryConditions);\n\n // also get genres for displaying in the filters\n $genreRepository = $this->getRepository('genre');\n $genres = $genreRepository->loadAll();\n\n // set context for rendering\n $context = [\n 'movieList' => $movies,\n 'genreList' => $genres,\n 'conditions' => $conditions,\n 'paginator' => $paginator,\n ];\n\n // store the results for later use\n $this->session->set('movie_data', $context);\n\n // go to/show homepage\n if ($this->request->isMethod('POST')) {\n return $this->redirectRoute('homepage');\n } else {\n return $this->render('index', $context);\n }\n } catch (Exception $ex) {\n $this->addErrorMessage('Something went wrong while trying to talk to the database.');\n\n return $this->render('index', $context);\n }\n }", "public function getMovies()\n {\n $movie = Movie::with('genres', 'cast', 'crew', 'licensors', 'producers', 'studios', 'reviews');\n $getters = Input::get();\n \n // Add offset/limit\n $movie->offset( (@$getters['index'] * @$getters['pageSize']) ?: 0);\n $movie->limit(@$getters['pageSize'] ?: 15);\n\n // Return items\n return $movie->get();\n }", "private function addQueryScopeForFeatured(Builder $query, $value) {\n $query->isFeatured();\n }", "public static function watchedMovies()\n {\n return self::where('user_id', Auth::id())\n ->where('watched', 1)\n ->orderBy('created_at', 'desc')\n ->limit(UserMovie::LIMIT)\n ->get();\n }", "public function movies()\n {\n return $this->morphedByMany('App\\Movie', 'source_genre');\n }", "public function scopeApplyGenre($query, $genre)\n {\n return $query->where('genre_', $genre);\n }", "public function query(Movie $movies)\n {\n return $movies->query()->orderBy('release_date', 'desc')->select('id', 'title', 'main_actors', 'director', 'producer', 'release_date', 'genre');\n }", "public function moviesByYear() {\n $model = $this->model;\n $request = $this->request;\n $movies = $this->getAndSetCache(\n \\CacheVars::NAMESPACE_PAGE,\n \\CacheVars::KEY_MOVIES_DATA . \"_by_year_{$this->request->year}\",\n function() use($model, $request) {\n return $model->getMoviesByYear($request->year);\n }\n );\n $this->view->addParameter(\"movies\", $movies);\n }", "public function show(Movies $movies)\n {\n //\n }", "public function scopeTitle($query, $input)\n {\n return $query->with('movie')->where('title', 'LIKE', '%'.$input.'%');\n /*$result = $query->with('movie')->where('title', 'LIKE', '%' . $input . '%')\n ->join('movie_tag', 'torrents.movie_id', '=', 'movie_tag.movie_id')\n ->join('tags', 'movie_tag.tag_id', '=', 'tags.id')->get();*/\n }", "public function show(movie $movie)\n {\n //\n }", "public function show(movie $movie)\n {\n //\n }", "public function scopeUpcoming($query)\n {\n return $query->where('release_date', '>', Carbon::now()->toDateString())->limit(6)->get();\n }", "public function scopeHasVideos($query)\n {\n return $query->whereHas('videos');\n }", "public function getAllMovies()\n {\n return DB::table('movies')->get();\n }", "public static function Movies() {\n //en el cual selecionamos la tabla movies\n //hacemos un join q nos diga q la tabla genres.id de la tabla genres sea igual a el movies.genre_id de la tabla movies\n //despues q nos selecione todos los campos de la tabla movies y de la tabla genres su genres.genre\n //y por ultimos q nos obtenga la consulta\n return DB::table(\"movies\")\n ->join(\"genres\", \"genres.id\", \"=\", \"movies.genre_id\")\n ->select(\"movies.*\", \"genres.genre\")\n ->get();\n }", "public function scopeMovieIndex($query, $perPage = 36)\n {\n return $query->where('type', '=', 'movie')\n ->orderBy(Helpers::getOrdering(), 'desc')\n ->paginate($perPage);\n }", "public function getHighlightActionMovie(){\n $movies = Film::with('image')\n ->whereHas('categories',function($q) {\n $q->where('slug','phim-le');\n })\n ->whereHas('genres', function($q){\n $q->where('slug','phim-hanh-dong');\n })\n ->orderByDesc('view')\n ->get();\n\n return response_success([\n 'movies' => $movies\n ],'get highlight action movie');\n }", "public function scopeSearch($query, $q)\n {\n return $query->where('title', 'LIKE', $q)\n ->select('id', 'imdb_id', 'tmdb_id', 'title', 'poster', 'type')\n ->whereNotNull('video')\n ->where('video','<>','')\n ->groupBy('title')\n ->orderBy(Helpers::getOrdering(), 'desc')\n ->get();\n }", "public function scopeArtistGenres($query, array $genres) {\n return $query->whereHas('artists', function($q) use ($genres) {\n $q->whereHas('genres', function($q) use ($genres) {\n $q->whereIn('genres.id', $genres);\n });\n });\n }", "public function movies()\n {\n return $this->hasMany('App\\Movie');\n }", "public function scopePublished($query){ \n \t$query->where('published_at','<=',Carbon::now());\n }", "public function RecentMovies($limit) {\n\n $other = DB::table('film')\n ->select('fl_id', 'fl_name')\n ->take($limit)\n ->orderBy('fl_release_date', 'desc')\n ->get();\n\n return $other;\n }", "public function showMovies()\n {\n $context = $this->session->get('movie_data');\n $page = $this->getQueryParam(\n 'page'\n ); // if there is no session data or nobody tried to go to a different page, show existing data\n if (is_null($context) || !is_null($page) || !empty($page)) {\n return $this->getFilteredMovies();\n } else {\n $html = $this->render('index', array('context' => $context));\n $this->session->set('movie_data', null);\n\n return $html;\n }\n }", "public function listByFilmId($film_id);", "public function getHighlightScienceFictionMovie() {\n $movies = Film::with('image')\n ->whereHas('categories',function($q) {\n $q->where('slug','phim-le');\n })\n ->whereHas('genres', function($q){\n $q->where('slug','phim-khoa-hoc-vien-tuong');\n })\n ->orderByDesc('view')\n ->get();\n\n return response_success([\n 'movies' => $movies\n ],'get highlight Science fiction movie');\n }", "function bgs_Movies_init() {\n\t\n}", "public function scopeMostPopular($query)\n {\n $fet = $query->where('created_at', '>', DB::raw('date_sub(now(), INTERVAL 90 DAY)'))->whereNotNull('video')->where('video','<>','')->orderBy('tmdb_popularity', 'desc');\n\n return $fet; \n }" ]
[ "0.60870653", "0.60243285", "0.59678024", "0.59297115", "0.5779024", "0.57002413", "0.5699419", "0.554258", "0.5512115", "0.5485181", "0.5459337", "0.5427247", "0.5419663", "0.5419663", "0.5380208", "0.5375964", "0.53528655", "0.5337088", "0.5332544", "0.5310524", "0.53089106", "0.5297458", "0.52945817", "0.52771324", "0.5271369", "0.52603596", "0.5248088", "0.5234102", "0.52313066", "0.5220704" ]
0.6254348
0
Most Popular movies query scope.
public function scopeMostPopular($query) { $fet = $query->where('created_at', '>', DB::raw('date_sub(now(), INTERVAL 90 DAY)'))->whereNotNull('video')->where('video','<>','')->orderBy('tmdb_popularity', 'desc'); return $fet; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function scopeIsMostAppeared()\n {\n $mostAppearedId = $this->filmService->getOneBy([\n 'mostAppeared' => 'characters'\n ]);\n\n return $this->peopleService->getBy(['id' => $mostAppearedId['_id']])->current();\n }", "public function getMovies()\n {\n $movie = Movie::with('genres', 'cast', 'crew', 'licensors', 'producers', 'studios', 'reviews');\n $getters = Input::get();\n \n // Add offset/limit\n $movie->offset( (@$getters['index'] * @$getters['pageSize']) ?: 0);\n $movie->limit(@$getters['pageSize'] ?: 15);\n\n // Return items\n return $movie->get();\n }", "public function top_earning_movies($country = 'US', $limit = '10') {\n $format = variable_get('rottentomatoes_format', '.json');\n $params['limit'] = $limit;\n $params['country'] = $country;\n return $this->call('lists/movies/box_office' . $format, $params, 'GET');\n }", "public static function watchedMovies()\n {\n return self::where('user_id', Auth::id())\n ->where('watched', 1)\n ->orderBy('created_at', 'desc')\n ->limit(UserMovie::LIMIT)\n ->get();\n }", "public function RecentMovies($limit) {\n\n $other = DB::table('film')\n ->select('fl_id', 'fl_name')\n ->take($limit)\n ->orderBy('fl_release_date', 'desc')\n ->get();\n\n return $other;\n }", "public function popular()\n {\n return view('videos.popular');\n }", "public function getTop250Movies()\r\n\t{\r\n\t\treturn $this->makeRequest('/chart/top');\r\n\t}", "public function moviesByDirectorCount() {\n $model = $this->model;\n $request = $this->request;\n $movies = $this->getAndSetCache(\n \\CacheVars::NAMESPACE_PAGE,\n \\CacheVars::KEY_MOVIES_DATA . \"_by_director_count_{$this->request->count}\",\n function() use($model, $request) {\n return $model->getMoviesByDirectorCount($request->count);\n }\n );\n $this->view->addParameter(\"directors\", $movies);\n }", "public function getAll()\n {\n return \\App\\Movie::all()->load('genre');\n }", "public function scopeMostlySearched($query, $count=5, $category=\"\"){\n if($category) {\n return $query->whereHas('categories', function($query) use ($category){\n $query->where('categories.id',$category);\n })->take($count);\n }\n\n return $query->take($count);\n }", "public function getAllMovies()\n {\n return DB::table('movies')->get();\n }", "public function scopeMovieIndex($query, $perPage = 36)\n {\n return $query->where('type', '=', 'movie')\n ->orderBy(Helpers::getOrdering(), 'desc')\n ->paginate($perPage);\n }", "public function scopePopular(Builder $query)\n {\n return $query->orderByDesc($this->popularity_field ?? 'votes_count');\n }", "public function getFilteredMovies()\n {\n $context = [\n 'movieList' => '',\n 'genreList' => '',\n 'conditions' => '',\n 'paginator' => '',\n ];\n\n // get the repository\n $movieRepository = $this->getRepository('movie');\n\n // get the conditions for the query, if any\n $conditions = $this->getConditions();\n\n // structure data for running the query (no pagination just yet)\n $queryConditions = Helper::prepareQueryData($conditions);\n\n try {\n // set default parameters for pagination\n $currentPage = $this->getQueryParam('page');\n $moviesPerPage = $conditions['pagination']['movies_per_page'];\n\n // but if the get parameter for pagination is not empty, use that one instead\n $moviesPerPageParam = $this->getQueryParam('movies_per_page');\n\n if (!empty($moviesPerPageParam)) {\n $moviesPerPage = $moviesPerPageParam;\n }\n\n // get results count for (potentially) filtered search\n $totalMovies = $movieRepository->getFilteredMovieCount($queryConditions);\n\n // get paginator and valid values for pagination\n $paginator = new Paginator($currentPage, $totalMovies, $moviesPerPage);\n $currentPage = $paginator->getCurrentPage();\n $moviesPerPage = $paginator->getResultsPerPage();\n\n // add pagination to query conditions\n $queryConditions['pagination'] = array('page' => $currentPage, 'per_page' => $moviesPerPage);\n\n // get results\n $movies = $movieRepository->loadFilteredMovies($queryConditions);\n\n // also get genres for displaying in the filters\n $genreRepository = $this->getRepository('genre');\n $genres = $genreRepository->loadAll();\n\n // set context for rendering\n $context = [\n 'movieList' => $movies,\n 'genreList' => $genres,\n 'conditions' => $conditions,\n 'paginator' => $paginator,\n ];\n\n // store the results for later use\n $this->session->set('movie_data', $context);\n\n // go to/show homepage\n if ($this->request->isMethod('POST')) {\n return $this->redirectRoute('homepage');\n } else {\n return $this->render('index', $context);\n }\n } catch (Exception $ex) {\n $this->addErrorMessage('Something went wrong while trying to talk to the database.');\n\n return $this->render('index', $context);\n }\n }", "public function popularRace(){\n $popular = Monster::selectRaw('count(race_id) as race, race_id')\n ->orderBy('race', 'desc')\n ->groupBy('race_id')\n ->limit(1)\n ->firstOrFail();\n \n $popular_race = MonsterRace::find($popular['race_id']);\n\n return response()-> json([\n \"popular_monster_race\" => $popular_race['name']\n ]);\n }", "public function getAllMovies()\n {\n $query = $this->db->get(\"Movies\");\n return $query->result();\n }", "public function movies(Request $request)\n {\n $query = $request->has('query') ? $request->get('query') : '';\n $page = $request->has('page') ? $request->get('page') : 1;\n\n /** @var $item */\n $item = $this->api->searchMovies($query, ['page' => $page]);\n\n if (!$item) {\n abort(404, \"The genre $query is not found.\");\n }\n\n // returns information of a genre\n return response($item);\n }", "public function movies()\n {\n return $this->morphedByMany('App\\Movie', 'source_genre');\n }", "public static function Movies() {\n //en el cual selecionamos la tabla movies\n //hacemos un join q nos diga q la tabla genres.id de la tabla genres sea igual a el movies.genre_id de la tabla movies\n //despues q nos selecione todos los campos de la tabla movies y de la tabla genres su genres.genre\n //y por ultimos q nos obtenga la consulta\n return DB::table(\"movies\")\n ->join(\"genres\", \"genres.id\", \"=\", \"movies.genre_id\")\n ->select(\"movies.*\", \"genres.genre\")\n ->get();\n }", "public function popular()\n {\n return Article::orderBy('views', 'desc')->get();\n }", "public function Allmovies()\n {\n // $movie = Movies::all();\n\n // return response()->json(\n // [\n // 'status' => 'success',\n // 'movie' => $movie->toArray()\n // ], 200);\n $movie = Movies::select('id', 'name', 'genre')\n ->orderBy('id', 'desc')\n ->get();\n return $movie;\n }", "protected function getMostPopularRecipes()\n {\n $self = $this;\n\n $result = Cache::remember(\n 'home_popularRecipes',\n config('kosher.cache_expiration_time'),\n function () use ($self) {\n return Recipe::mostPopular()->with('user', 'videos')\n ->whereNotIn('recipes.id', $self->receivedRecipes->all())\n ->take(config('kosher.pagination.home_popular_recipes'))\n ->get();\n }\n );\n\n $this->mergeReceivedRecipes($result);\n\n return $result;\n }", "function getMostPopularMedia ( $params=array() )\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['syndication_url']}/resources/media/mostPopularMedia.json\",$params);\n return $this->createResponse($result,'get Most popular Media','');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "public function getLatestMovie() {\n\t\treturn new Movie($this->_call('movie/latest',''));\n\t}", "public function moviesByYear() {\n $model = $this->model;\n $request = $this->request;\n $movies = $this->getAndSetCache(\n \\CacheVars::NAMESPACE_PAGE,\n \\CacheVars::KEY_MOVIES_DATA . \"_by_year_{$this->request->year}\",\n function() use($model, $request) {\n return $model->getMoviesByYear($request->year);\n }\n );\n $this->view->addParameter(\"movies\", $movies);\n }", "public function query(Movie $movies)\n {\n return $movies->query()->orderBy('release_date', 'desc')->select('id', 'title', 'main_actors', 'director', 'producer', 'release_date', 'genre');\n }", "public static function getMovies()\n {\n // Instantiate Movie model\n $model = new Movie();\n\n // Get all movies from table\n self::$return_array['movies'] = $model::orderby('movie_title', 'asc')->get();\n\n // Return movies view with list of all movies\n return view('movies', ['return_array' => self::$return_array]);\n }", "public function index()\n {\n $search = request('search');\n \n $movies = Movie::where([\n ['title','like','%'.$search.'%']])\n ->orwhere([['genre','like','%'.$search.'%']])\n ->orwhere([['release','like','%'.$search.'%']])\n ->orwhere([['rating','like','%'.$search.'%']])\n ->get();\n\n return view('movies.movies', compact('movies','search'));\n }", "public function findByGenre(Genre $genre)\n\t{\n\t\treturn $genre->getMovies();\n\t}", "function add_top_rated_movies()\n {\n $data_added_count = 0;\n $page = 1;\n\n start:\n $url ='/movie/top_rated';\n $data = $this->curl_call($url,$page);\n\n foreach (json_decode($data)->results as $movie_data)\n {\n if (Movie::find($movie_data->id) == null)\n {\n $movie = $this->store_movie($movie_data);\n\n foreach($movie_data->genre_ids as $genre_id ){\n $this->store_movie_category($movie,$genre_id);\n }\n $data_added_count++;\n }\n }\n if ($data_added_count <json_decode($data)->total_results) {\n $page++;\n goto start;\n }\n return $data_added_count. \" movies added successfully\";\n\n }" ]
[ "0.63434666", "0.60791284", "0.6061283", "0.60506594", "0.59539175", "0.58185524", "0.5800726", "0.57913625", "0.57527924", "0.5731454", "0.5661258", "0.5633893", "0.5627246", "0.5605467", "0.5582547", "0.553614", "0.5528402", "0.54789406", "0.5446614", "0.54408866", "0.5433048", "0.54214126", "0.5405881", "0.5390807", "0.5385841", "0.53602356", "0.53428966", "0.53273857", "0.5293401", "0.5274793" ]
0.6994168
0
Last Added movies query scope.
public function scopeLastAdded($query) { $fet = $query->where('featured', 0)->where('releases', 0)->whereNotNull('video')->where('video','<>',''); return $fet; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function watchedMovies()\n {\n return self::where('user_id', Auth::id())\n ->where('watched', 1)\n ->orderBy('created_at', 'desc')\n ->limit(UserMovie::LIMIT)\n ->get();\n }", "private function scopeIsMostAppeared()\n {\n $mostAppearedId = $this->filmService->getOneBy([\n 'mostAppeared' => 'characters'\n ]);\n\n return $this->peopleService->getBy(['id' => $mostAppearedId['_id']])->current();\n }", "public function scopeRecent($query)\n {\n return $query->orderBy('created_at', 'desc');\n }", "public function scopeLatest($query)\n {\n return $query->orderBy('posted_at', 'desc');\n }", "public function scopeLastCreated($query)\n\t{\n\t\treturn $query->orderBy('created_at', 'desc')->first();\n\t}", "public function scopeLastDate($query) {\n return $query->orderBy('date', 'desc');\n }", "public function scopeLatest($query)\n {\n return $query->orderBy('published_at', 'desc');\n }", "public function scopeTorrentRelatedMovie($query, $movieId)\n {\n return $query->where('movie_id', '=', $movieId)->get();\n }", "function add_latest_movie()\n {\n\n $url ='/movie/latest';\n $data = $this->curl_call($url,1);\n\n $movie_data =json_decode($data);\n $movie = $this->store_movie($movie_data);\n\n foreach($movie_data->genres as $genre_id ){\n $this->store_movie_category($movie,$genre_id);\n }\n\n return \"latest movie added successfully\";\n\n }", "public function scopeRecent($query, $limit = 3)\n {\n return $query->latest()\n ->take($limit);\n }", "public function scopeUpcoming($query)\n {\n return $query->where('release_date', '>', Carbon::now()->toDateString())->limit(6)->get();\n }", "public function scopeRecent($query) {\n // Avoid MySQL *ambiguous errors* when\n // scope is used within a join query.\n $table = $this->getTable();\n\n return $query->where(function($query) use($table) {\n return $query->where(function($query) use($table) {\n return $query->where(\"{$table}.status\", '!=', 'pending')\n ->where(\"{$table}.created_at\", '>=', Carbon::now()->subWeek());\n })->orWhere(\"{$table}.status\", 'pending');\n });\n }", "public function scopeMostPopular($query)\n {\n $fet = $query->where('created_at', '>', DB::raw('date_sub(now(), INTERVAL 90 DAY)'))->whereNotNull('video')->where('video','<>','')->orderBy('tmdb_popularity', 'desc');\n\n return $fet; \n }", "public function scopeMovieIndex($query, $perPage = 36)\n {\n return $query->where('type', '=', 'movie')\n ->orderBy(Helpers::getOrdering(), 'desc')\n ->paginate($perPage);\n }", "public function scopeLastWeek($query)\n {\n return $query->whereBetween('posted_at', [Carbon::now()->subWeek(), Carbon::now()])\n ->latest();\n }", "public function RecentMovies($limit) {\n\n $other = DB::table('film')\n ->select('fl_id', 'fl_name')\n ->take($limit)\n ->orderBy('fl_release_date', 'desc')\n ->get();\n\n return $other;\n }", "public function recentlyWatched()\n {\n return $this->hasMany(WatchHistory::class, 'video_id', 'id');\n }", "public function getLatestMovie() {\n\t\treturn new Movie($this->_call('movie/latest',''));\n\t}", "public function scopeRecentReplied($query)\n {\n // at which time updated_at timestamp will be updated as well (via trigger)\n return $query->orderBy('updated_at', 'desc');\n }", "public function scopePublished($query){ \n \t$query->where('published_at','<=',Carbon::now());\n }", "function shortcode_last_movies(){\n\n\n\t\t $args = array(\n 'post_type' => 'movies',\n 'post_status' => 'publish',\n 'posts_per_page' => 5,\n \t\t'orderby' => 'post_date',\n \t\t'order' => 'DESC',\n );\n\n $string = '';\n $query = new WP_Query( $args );\n if( $query->have_posts() ){\n $string .= '<ul>';\n while( $query->have_posts() ){\n $query->the_post();\n $string .= '<li><a href=\"' . get_permalink() . '\" title=\"' . the_title_attribute( 'echo=0' ) . '\" rel=\"bookmark\">'. get_the_title() .'</a></li>';\n }\n $string .= '</ul>';\n }\n wp_reset_postdata();\n return $string;\n\n\n\t}", "public function scopePublishedAfter($query, $date)\n {\n $query->where('created_at', '>=', $date);\n }", "public function scopeResultsLastPublishedAt($query)\n {\n // Get the last published_at from results\n $lastPublishedAt = $this->latest('published_at')->value('published_at');\n\n // Filter the results of the last pusblished_at\n return $query->where('published_at', $lastPublishedAt);\n }", "public function scopeUpcoming($query) {\n return $query->where('end_time', '>=', 'NOW()');\n }", "public function scopePublished($query){\n $query->where('RDate','<=',Carbon::now()->format('Y-m-d'))->where('EXDate','>=',Carbon::now()->format('Y-m-d'));\n }", "public function scopeLastMonth($query, $limit = 5)\n {\n return $query->whereBetween('posted_at', [Carbon::now()->subMonth(), Carbon::now()])\n ->latest()\n ->limit($limit);\n }", "function add_top_rated_movies()\n {\n $data_added_count = 0;\n $page = 1;\n\n start:\n $url ='/movie/top_rated';\n $data = $this->curl_call($url,$page);\n\n foreach (json_decode($data)->results as $movie_data)\n {\n if (Movie::find($movie_data->id) == null)\n {\n $movie = $this->store_movie($movie_data);\n\n foreach($movie_data->genre_ids as $genre_id ){\n $this->store_movie_category($movie,$genre_id);\n }\n $data_added_count++;\n }\n }\n if ($data_added_count <json_decode($data)->total_results) {\n $page++;\n goto start;\n }\n return $data_added_count. \" movies added successfully\";\n\n }", "public function scopePublished($query)\n {\n \n $query->with(['category','tags','owner','photos'])\n ->whereNotNull('published_at')\n ->where('published_at','<=',Carbon::now())\n ->latest('published_at');\n }", "public function moviesByDirectorCount() {\n $model = $this->model;\n $request = $this->request;\n $movies = $this->getAndSetCache(\n \\CacheVars::NAMESPACE_PAGE,\n \\CacheVars::KEY_MOVIES_DATA . \"_by_director_count_{$this->request->count}\",\n function() use($model, $request) {\n return $model->getMoviesByDirectorCount($request->count);\n }\n );\n $this->view->addParameter(\"directors\", $movies);\n }", "public function scopeLatest(Builder $query)\n {\n return $query->orderBy(static::CREATED_AT, 'desc');\n }" ]
[ "0.5678558", "0.56712526", "0.55861837", "0.5534024", "0.55101424", "0.54695123", "0.5438816", "0.54209626", "0.54188156", "0.5387716", "0.5377446", "0.53772914", "0.53727823", "0.5371127", "0.533551", "0.53344584", "0.5334057", "0.5318776", "0.528507", "0.5260545", "0.52584445", "0.52077043", "0.51971364", "0.51931137", "0.51802015", "0.5174153", "0.51185876", "0.5098007", "0.5066367", "0.5044184" ]
0.629569
0
Reindexed movies query scope.
public function scopeReindexed($query) { $fet = $query->where('reindexed', 'Reindexed')->whereNotNull('video')->where('video','<>',''); return $fet; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reindex();", "protected function reindex()\n\t{\n\t\t// rebuild the ordered collection\n\t\t$results = array();\n\t\tforeach ($this->_data as $old => $record)\n\t\t{\n\t\t\t$key = $record->{$this->_keyfield};\n\t\t\t$results[$key] = $record;\n\t\t}\n\t\t// sort the collection\n\t\tksort($results);\n\t\t// remember the new collection\n\t\t$this->_data = $results;\n\t\t// reset the cursor\n\t\treset($this->_data);\n\t}", "public function reindexAll()\n {\n }", "public function scopeMovieIndex($query, $perPage = 36)\n {\n return $query->where('type', '=', 'movie')\n ->orderBy(Helpers::getOrdering(), 'desc')\n ->paginate($perPage);\n }", "public function reindexAction()\n {\n $form = Ot_Form_Template::delete('reindex', 'search-index-reindex:reindex');\n \n if ($this->_request->isPost() && $form->isValid($_POST)) {\n set_time_limit(0);\n \n $workshop = new Workshop();\n \n $workshops = $workshop->fetchAll();\n \n foreach ($workshops as $w) {\n $workshop->index($w);\n }\n \n $this->_helper->flashMessenger->addMessage('msg-info-reindexed');\n \n $this->_redirect('/');\n \n }\n \n $this->view->form = $form;\n $this->_helper->pageTitle('search-index-reindex:title');\n }", "public function refreshSearchIndex()\n {\n $this->artisan('regarch:elastic:migrate');\n $this->app[Kernel::class]->setArtisan(null);\n }", "public function redirMovie()\n {\n return view('layouts.movie.movie-list');\n }", "public function reindexAll()\n {\n $this->_getIndexer()->rebuildIndex();\n }", "public function getMovies()\n {\n $movie = Movie::with('genres', 'cast', 'crew', 'licensors', 'producers', 'studios', 'reviews');\n $getters = Input::get();\n \n // Add offset/limit\n $movie->offset( (@$getters['index'] * @$getters['pageSize']) ?: 0);\n $movie->limit(@$getters['pageSize'] ?: 15);\n\n // Return items\n return $movie->get();\n }", "public function moviesByYear() {\n $model = $this->model;\n $request = $this->request;\n $movies = $this->getAndSetCache(\n \\CacheVars::NAMESPACE_PAGE,\n \\CacheVars::KEY_MOVIES_DATA . \"_by_year_{$this->request->year}\",\n function() use($model, $request) {\n return $model->getMoviesByYear($request->year);\n }\n );\n $this->view->addParameter(\"movies\", $movies);\n }", "public function updatingSearch()\n {\n $this->resetPage();\n }", "public function scopeSearch($query, $term);", "public static function reindex()\n {\n $slides = Slide::isActive()->inOrder()->get();\n\n $position = 1;\n foreach ($slides as $slide) {\n // Index the slide position\n $slide->position = $position;\n\n // Unset validation rules, and avoid a reindex loop\n $slide->rules = [];\n $slide->reindex = false;\n\n // Save the slide\n $position++;\n $slide->save();\n }\n }", "public function reindex() {\n if (!$this->server || $this->read_only) {\n return TRUE;\n }\n _search_api_index_reindex($this);\n module_invoke_all('search_api_index_reindex', $this, FALSE);\n return TRUE;\n }", "public function modifyQuery($query, SearchTerm $search);", "public function rebuildIndex( array $items = [] );", "public function reindexSearchData(\\Closure $onUpdate = null)\n {\n $db = new SearchDomainDatabase($this->name);\n $db->initialize();\n if ($onUpdate) {\n $db->onUpdate($onUpdate);\n }\n $db->recordData(true);\n }", "public function reindex()\n {\n $this->removeIndex();\n\n return $this->index();\n }", "public function resetFilterSearch() {\n\t\t$this->table->resetOffset();\n\t\t$this->table->resetFilter();\n\t\t$this->ctrl->redirect($this, self::CMD_SEARCH);\n\t}", "public function index($movie)\n {\n// $reviews = Review::where('movie_id', $movie)->get();\n\n $movie = Movie::findOrFail($movie);\n $reviews = $movie->reviews()->get();\n\n return view('reviews.index', compact('reviews', 'movie'));\n\n\n }", "public function reindexAll()\n {\n\n //@todo: indexers should be dynamically injected. Probable via `$this->getIndeces()`\n /** @var St_SphinxSearch_Model_Fulltext $fulltextIndex */\n $fulltextIndex = Mage::getModel('st_sphinxsearch/fulltext');\n\n $fulltextIndex->rebuildIndex();\n\n return;\n /** @var Mage_Core_Model_Resource $resourceSingleton */\n $resourceSingleton = Mage::getSingleton('core/resource');\n\n /** @var Varien_Db_Adapter_Interface $writeAdapater */\n $writeAdapater = $resourceSingleton->getConnection('core_write');\n\n /** @var Varien_Db_Adapter_Interface $readAdapter */\n $readAdapter = $resourceSingleton->getConnection('core_read');\n\n /** @var string $tableName */\n $tableName = $readAdapter->getTableName('st_sphinxsearch_fulltext_tmp');\n\n /** @var Mage_CatalogSearch_Model_Resource_Indexer_Fulltext $indexerFulltext */\n $indexerFulltext = Mage::getResourceModel('catalogsearch/indexer_fulltext');\n\n $fulltextTableName = $indexerFulltext->getTable('fulltext');\n\n $sql = \"CREATE TABLE IF NOT EXISTS `$tableName` LIKE `$fulltextTableName`\";\n\n $writeAdapater->query($sql);\n $t=1;\n }", "public function resetDemoAction()\n\t{\n\t\t$em = $this->getDoctrine()->getManager();\n\n\t\t$movies = $em->getRepository('UekMovieBundle:Movie')->findAll();\n\t\tforeach ($movies as $movie) {\n\t\t\t$em->remove($movie);\n\t\t}\n\n\t\t$reviews = $em->getRepository('UekMovieBundle:Review')->findAll();\n\t\tforeach ($reviews as $review) {\n\t\t\t$em->remove($review);\n\t\t}\n\n\t\t$genres = $em->getRepository('UekMovieBundle:Genre')->findAll();\n\t\tforeach ($genres as $genre) {\n\t\t\t$em->remove($genre);\n\t\t}\n\n\t\t$orders = $em->getRepository('UekStoreBundle:Order')->findAll();\n\t\tforeach ($orders as $order) {\n\t\t\t$em->remove($order);\n\t\t}\n\t\t\n\t\t$em->flush();\n\n\t\t$movies = $em->getRepository('UekMovieBundle:Movie')->findAll();\n\t\treturn $this->redirect($this->generateUrl('uek_homepage'));\n\t}", "public function moviesByDirectorCount() {\n $model = $this->model;\n $request = $this->request;\n $movies = $this->getAndSetCache(\n \\CacheVars::NAMESPACE_PAGE,\n \\CacheVars::KEY_MOVIES_DATA . \"_by_director_count_{$this->request->count}\",\n function() use($model, $request) {\n return $model->getMoviesByDirectorCount($request->count);\n }\n );\n $this->view->addParameter(\"directors\", $movies);\n }", "public function performRewind() {\n $this->data = array();\n $this->currentPage = 0;\n $this->currentCount = 0;\n }", "public function reindex(&$parentArray=array()) {\n\n\t\t$this->load->model(\"search_model\");\n\n\t\tif(count($parentArray)>5 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->buildCache();\n\n\t\t$this->search_model->addOrUpdate($this);\n\t\t// now find any related items and resave them.\n\t\t//\n\t\t// we build a parent array so we don't recurse\n\n\t\t// we might be rebuilding outside an instance, in which case we don't do this.\n\t\tif(!$this->instance) {\n\t\t\treturn;\n\t\t}\n\t\t$results = $this->search_model->find([\"searchText\"=>$this->getObjectId(), \"searchRelated\"=>true], false);\n\t\t$parentArray[] = $this->getObjectId();\n\n\t\tforeach($results[\"searchResults\"] as $result) {\n\t\t\tif(!in_array($result, $parentArray)) {\n\t\t\t\techo \"subIndex: \" . $result . \"\\n\";\n\t\t\t\t// $this->logging->logError(\"updating\", $result);\n\t\t\t\t$tempAsset = new Asset_model();\n\t\t\t\t$tempAsset->loadAssetById($result);\n\t\t\t\t$tempAsset->reindex($parentArray);\n\t\t\t\tif($this->config->item('enableCaching')) {\n\t\t\t\t\t$this->doctrineCache->setNamespace('searchCache_');\n\t\t\t\t\t$this->doctrineCache->delete($this->getObjectId());\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t}", "public function getFilteredMovies()\n {\n $context = [\n 'movieList' => '',\n 'genreList' => '',\n 'conditions' => '',\n 'paginator' => '',\n ];\n\n // get the repository\n $movieRepository = $this->getRepository('movie');\n\n // get the conditions for the query, if any\n $conditions = $this->getConditions();\n\n // structure data for running the query (no pagination just yet)\n $queryConditions = Helper::prepareQueryData($conditions);\n\n try {\n // set default parameters for pagination\n $currentPage = $this->getQueryParam('page');\n $moviesPerPage = $conditions['pagination']['movies_per_page'];\n\n // but if the get parameter for pagination is not empty, use that one instead\n $moviesPerPageParam = $this->getQueryParam('movies_per_page');\n\n if (!empty($moviesPerPageParam)) {\n $moviesPerPage = $moviesPerPageParam;\n }\n\n // get results count for (potentially) filtered search\n $totalMovies = $movieRepository->getFilteredMovieCount($queryConditions);\n\n // get paginator and valid values for pagination\n $paginator = new Paginator($currentPage, $totalMovies, $moviesPerPage);\n $currentPage = $paginator->getCurrentPage();\n $moviesPerPage = $paginator->getResultsPerPage();\n\n // add pagination to query conditions\n $queryConditions['pagination'] = array('page' => $currentPage, 'per_page' => $moviesPerPage);\n\n // get results\n $movies = $movieRepository->loadFilteredMovies($queryConditions);\n\n // also get genres for displaying in the filters\n $genreRepository = $this->getRepository('genre');\n $genres = $genreRepository->loadAll();\n\n // set context for rendering\n $context = [\n 'movieList' => $movies,\n 'genreList' => $genres,\n 'conditions' => $conditions,\n 'paginator' => $paginator,\n ];\n\n // store the results for later use\n $this->session->set('movie_data', $context);\n\n // go to/show homepage\n if ($this->request->isMethod('POST')) {\n return $this->redirectRoute('homepage');\n } else {\n return $this->render('index', $context);\n }\n } catch (Exception $ex) {\n $this->addErrorMessage('Something went wrong while trying to talk to the database.');\n\n return $this->render('index', $context);\n }\n }", "public function reIndex() {\n $index = collect([]);\n // Loop through each of the hydrated fields\n $this->getHydrated()->each(function($field,$k) use ($index) {\n // Pass each field through the toPath process\n $field->toPath($index);\n });\n // Replace the current index value\n $this->index = $index;\n // Return for chaining\n return $this;\n }", "public function index()\r\n {\r\n // Case movie detail\r\n if (!empty($_GET['id'])) {\r\n $this->model->id['col'] = 'id_movie';\r\n $this->model->id['val'] = $_GET['id'];\r\n \r\n $detail = $this->model->read();\r\n \r\n if (!empty($detail)) {\r\n $detail[0]->id_genre = $this->model->hasOne(Genre::class, $detail[0]->id_genre)[0]->name;\r\n $detail[0]->id_publisher = $this->model->hasOne(publisher::class, $detail[0]->id_publisher)[0]->name;\r\n }\r\n\r\n $this->render('detail', ['movie' => !empty($detail) ? $detail[0] : 'id is invalid']);\r\n exit;\r\n }\r\n \r\n // Case searoching for movie\r\n if (!empty($this->params['search'])) {\r\n\r\n // time to pagination\r\n\r\n // to serach for a movie\r\n // get query \r\n // display results\r\n // if search result is one then go to detail page (by redirecting) else go to index page\r\n // $this->model->params['WHERE'] => \"title LIKE '%\" . $this->model->params['search'] . \"%'\";\r\n\r\n $this->render('index', ['movies' => $this->model->read()]);\r\n exit;\r\n } \r\n\r\n \r\n \r\n // pagination\r\n $offset = 20;\r\n $p = isset($_GET['p']) ? ($_GET['p'] - 1) * $offset : 0;\r\n $this->model->params = [\r\n 'LIMIT' => $p . ', ' . $offset\r\n ];\r\n\r\n $this->render('index', ['movies' => $this->model->read()]);\r\n }", "public function reIndex($args, $assoc_args)\n {\n list($indexName) = $args;\n\n echo $indexName;\n\n // get registered post type\n $indexInstance = $this->get_registered_post_type($indexName);\n\n // echo $indexInstance;\n\n if( !$indexInstance ) {\n WP_CLI::error(sprintf(\"Index for post type '%s' is not a registered index.\", $indexName));\n return;\n }\n\n // run reindex\n $indexInstance->cli_reindex();\n }", "public function index()\n {\n $search = request('search');\n \n $movies = Movie::where([\n ['title','like','%'.$search.'%']])\n ->orwhere([['genre','like','%'.$search.'%']])\n ->orwhere([['release','like','%'.$search.'%']])\n ->orwhere([['rating','like','%'.$search.'%']])\n ->get();\n\n return view('movies.movies', compact('movies','search'));\n }" ]
[ "0.56979424", "0.5656932", "0.5635605", "0.55505675", "0.54469806", "0.51295364", "0.50930965", "0.5044858", "0.50157064", "0.49852428", "0.49760145", "0.49662077", "0.49463916", "0.49266747", "0.48946702", "0.4887019", "0.48857778", "0.4876397", "0.48495564", "0.4840712", "0.48265514", "0.4821453", "0.47992843", "0.4785879", "0.47444466", "0.47249624", "0.46976742", "0.46946087", "0.4679862", "0.46647507" ]
0.6728723
0
get correct answer choices corresponding to the quiz from the database in the form [questionnum] => "Correct choice text"
function getAnswersFromDatabase($dbconn, $quiz_id){ $querysql = "SELECT question_num, choice_text FROM answer_choice WHERE quiz_id = ? AND correct = 1 ORDER BY question_num"; $stmt = mysqli_stmt_init($dbconn); if(mysqli_stmt_prepare($stmt, $querysql)){ mysqli_stmt_bind_param($stmt, "i", $quiz_id); if(mysqli_stmt_execute($stmt)){ $result = mysqli_stmt_get_result($stmt); return mysqli_fetch_all($result, MYSQLI_ASSOC); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPreDefinedQuestions()\n {\n return [\n \"1\" => \"Select a Security Question\",\n \"2\" => \"What was your childhood nickname?\",\n \"3\" => \"What is the name of your favorite childhood friend?\",\n \"4\" => \"What was the name of your first stuffed animal?\",\n \"5\" => \"Where were you when you had your first kiss?\",\n \"6\" => \"What is the name of the company of your first job?\",\n \"7\" => \"What was your favorite place to visit as a child?\",\n \"8\" => \"What was your dream job as a child?\",\n \"9\" => \"What is your preferred musical genre?\",\n \"10\" => \"What is your favorite team?\",\n \"11\" => \"What is your father\\\"s middle name?\"\n ];\n }", "public function getAnswers();", "function getCorrectAnswers()\n\t{\n\t\treturn $this->correctanswers;\n\t}", "public function checkAnswer()\r\n{\r\n $query_string = \"SELECT ans FROM questions \";\r\n $query_string .= \"WHERE questionid = :questionid AND quizid = :quizid\";\r\n\r\n return $query_string;\r\n}", "public function getAllQuiz(){\n\t\treturn $this->db->getAllQuiz();\n\t}", "function multiplechoice($subject) { \n \n\n\n$con = new mysqli(\"localhost\", \"root\", \"\", \"diligent\");\n\n//uncommment the line of code below to see if connection to the database is a success\n\n//echo \"\\nSuccess... \" . mysqli_get_host_info($con) . \"\\n\";\n\nif(mysqli_connect_errno()){\n \n echo 'Failed to connect to database' . mysqli_connect_error();\n}\n\n$query = \"SELECT * FROM questions join diligent.categories on questions.category_id = categories.category_id WHERE categories.category = '$subject' ORDER BY RAND() limit 1\"; //the query to be passed the mysqli_query function\n$result = mysqli_query($con, $query);\n\n////uncommment the line of code below to see if the query worked\n//var_dump($result);\n\n//echo '<table>;\nwhile($row = mysqli_fetch_array($result))\n { //Creates a loop to loop through results\n\t\treturn \"<tr><td>\" . $row['question'] \n . \"</td></tr><tr><td><form action='correct.php'>\" \n .\"<input type='radio' name='answer' value=\" .$row['answer_1'] .\"/>\". $row['answer_1'] .\"<br />\" \n .\"<input type='radio' name='answer' value=\" .$row['answer_2'] .\"/>\". $row['answer_2'] .\"<br />\" \n .\"<input type='radio' name='answer' value=\" .$row['answer_3'] .\"/>\". $row['answer_3'] .\"<br />\" \n .\"<input type='radio' name='answer' value=\" .$row['answer_4'] .\"/>\". $row['answer_4'] .\"<br /><br />\"\n //.\"<input type='submit' value='Submit' />\"\n .\"<small>Answer</small>:\".$row['correct_answer']\n .\"</td></tr></td></tr>\"; //$row['index'] the index here is a field name\n \n }\n \n // echo '</table>'; // end the table\n\n \n mysqli_close($con);// make sure the database connection is closed\n \n\n}", "public function getQuestions()\r\n{\r\n $query_string = \"SELECT questionid, question, choice1, choice2, choice3, choice4, ans \";\r\n $query_string .= \"FROM questions \";\r\n $query_string .= \"WHERE quizid = :quizid\";\r\n\r\n return $query_string;\r\n}", "public function getQuestionsAndAnswers()\r\n{\r\n $query_string = \"SELECT questionid, ans \";\r\n $query_string .= \"FROM questions \";\r\n $query_string .= \"WHERE quizid = :quizid\";\r\n\r\n return $query_string;\r\n}", "function answers()\r\n {\r\n $returnArray = array();\r\n $db =& eZDB::globalDatabase();\r\n $db->array_query( $questionArray, \"SELECT ID FROM eZQuiz_Answer WHERE AlternativeID='$this->ID'\" );\r\n\r\n for ( $i = 0; $i < count( $questionArray ); $i++ )\r\n {\r\n $returnArray[$i] = new eZQuizAnswer( $questionArray[$i][$db->fieldName( \"ID\" )], true );\r\n }\r\n return $returnArray;\r\n }", "public function getChoices();", "public function getCorrectAnswers()\n {\n return $this->hasMany(CorrectAnswers::className(), ['question_id' => 'id']);\n }", "public function getQuestions()\n {\n return DB::table('questionbank_quizzes')\n ->where('quize_id','=',$this->id)\n ->orderBy('subject_id')\n ->get();\n }", "public function getQuestion()\r\n{\r\n $query_string = \"SELECT questionid, question, choice1, choice2, choice3, choice4, ans \";\r\n $query_string .= \"FROM questions \";\r\n $query_string .= \"WHERE questionid = :questionid\";\r\n\r\n return $query_string;\r\n}", "function get_correct_ans($question_id) {\r\n\t\t//throw an exception if question_id is not present\r\n\t\tif (! isset ( $question_id ) && '' != $question_id) {\r\n\t\t\tshow_error ( \"Parameter question id is missing.\" );\r\n\t\t}\r\n\t\t\r\n\t\t//Get the record for corresponding id\r\n\t\t$sql = 'SELECT answers from adhi_quiz_answers WHERE question_id = ' . $question_id . ' AND answer_option = \"Y\"';\r\n\t\t$query = $this->db->query ( $sql );\r\n\t\t\r\n\t\t$result = $query->row ();\r\n\t\t\r\n\t\t// If result is empty return false\r\n\t\tif (empty ( $result )) {\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\t\r\n\t\treturn $result->answers;\r\n\t\r\n\t}", "function displayTheQuestions($questions) {\n\tif (count($questions) > 0) {\n\t\tforeach ($questions as $key => $value) {\n\t\t\techo \"<b>$value[0]</b><br/><br/>\";\n\t\t\t\n\t\t\t// Break the choices appart into a choice array\n\t\t\t$choices = explode(\",\",$value[1]);\n\t\t\t\n\t\t\t// For each choice, create a radio button as part of that questions radio button group\n\t\t\t// Each radio will be the same group name (in this case the question number) and have\n\t\t\t// a value that is the first letter of the choice.\n\t\t\t\n\t\t\tforeach($choices as $value) {\n\t\t\t\t$letter = substr(trim($value),0,1);\n\t\t\t\techo \"<input type=\\\"radio\\\" name=\\\"$key\\\" value=\\\"$letter\\\">$value<br/>\";\n\t\t\t}\n\t\t\t\n\t\t\techo \"<br/>\";\n\t\t}\n\t}\n\telse { echo \"No questions to display.\"; }\n}", "public function get_all_question_answer_list()\n\t{\n\t\t\n\t\t$sql=\"select * from question_answer\";\n\t\t$query=$this->db->query($sql);\n\t\t//print_r($query->result_object());die();\n\t\treturn $query->result_object();\n\t}", "function get_text_question_answers($questionid, $surveyid)\n{\n $CI =& get_instance();\n $CI->db->select('answer,resultid');\n $CI->db->from('tblformresults');\n $CI->db->where('questionid', $questionid);\n $CI->db->where('rel_id', $surveyid);\n $CI->db->where('rel_type', 'survey');\n\n return $CI->db->get()->result_array();\n}", "public static function answers($q_id) {\n $ans = Database::select(\"SELECT a_id, a_text, a_correct FROM answers WHERE q_id = \\\"$q_id\\\"\");\n $answers = [];\n foreach ($ans as $an) {\n if(1 == $an['a_correct']) {\n $color = \"green\";\n }\n else {\n $color = \"red\";\n }\n $answers = array_merge($answers, [[\"a_id\" => $an['a_id'], 'a_text' => $an['a_text'], 'color' => $color]]);\n }\n return $answers;\n }", "public function getAnswerChoices()\n {\n if (array_key_exists(\"answerChoices\", $this->_propDict)) {\n return $this->_propDict[\"answerChoices\"];\n } else {\n return null;\n }\n }", "public function takeAll(){\n if(isset($_POST['submit'])){\n $post = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n // var_dump($post);\n // Messages::setMsg('Answer is submitted', 'success');\n // Check if the answer is correct\n // echo 'session data:';\n\n // Put the submitted chosen answers into an array\n $choices = array();\n // Check the number of questions\n $num_q = count($_SESSION['quiz_data']);\n // Add the choices into an array\n for($i = 0; $i < $num_q; $i++){\n $choices[] = intval($post[\"choice{$i}\"]);\n }\n echo 'CHOICES';\n var_dump($choices);\n echo 'NUMBER OF QUESTIONS IS: ';\n echo $num_q;\n\n // Loop through the answers and count the correct answers\n $score = 0;\n $question = 0;\n foreach($choices as $choice){\n // $indexed_array = array_values($_SESSION['quiz_data']);\n $is_answer = array_values($_SESSION['quiz_data']) [$question][$choice]['is_answer'];\n if($is_answer == 1){\n $score++;\n $question++;\n }\n }\n Messages::setMsg(\"You scored {$score} out of {$num_q}\", 'success');\n return;\n } else {\n // !!! Need to modified, question.user_id does not exist amy more\n $this->query('SELECT questions.content, options.content, options.is_answer FROM questions JOIN users ON questions.user_id = users.id JOIN options ON options.question_id = questions.id WHERE users.id = :user_id');\n // Bind the user_id to the current user id\n $userId = $_SESSION['user_data']['id'];\n $this->bind(':user_id', $userId);\n $rows = $this->resultSetGroup();\n // echo '<pre>';\n // print_r($rows);\n // echo '</pre>';\n // var_dump($rows);\n // print_r($rows);\n // Store $row in session to check the answer once it is submitted\n if($rows){\n $_SESSION['quiz_data'] = $rows;\n } else {\n Messages::setMsg('No quizzes yet', 'error');\n }\n return $rows;\n }\n }", "public function generateChoices(array $question)\n\t{\n\t\t[$inputMode, $inputExpectation, $notUseful, $from] = explode('_', $question['type']);\n\n\t\tif($this->config['cross_sections_for_possible_answers'])\n\t\t{\n\t\t\t//TODO\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\t//leave space for the correct answer to be slotted in!\n\t\t\t//(not done in this method BTW)\n\t\t\t//UPDATE: actually, no, we'll just clobber one to put the correct answer in\n\t\t\t//$count = $this->config['choices_per_question'] - 1;\n\t\t\t$count = $this->config['choices_per_question'];\n\n\t\t\t$randomKeys = array_rand($this->functionData[$question['section']], $count);\n\n\t\t\t$choices = [];\n\n\t\t\tforeach($randomKeys as $key)\n\t\t\t{\n\t\t\t\t$choices[] = $this->functionData[$question['section']][$key][$inputExpectation];\n\t\t\t}\n\n\t\t\treturn $choices;\n\n\t\t}\n\t}", "private function getAnswers($question){\n $answerModel = new Answer();\n $answers = $answerModel->where('id_qst',$question->id_qst)->findAll();\n $retMess = \"\";\n $this->answersId = [];\n foreach($answers as $answer){\n array_push($this->answersId,$answer->id_ans);\n $retMess .= \",\".$answer->text;\n }\n\n return $retMess;\n }", "function smartchoice_get_all_responses($choice) {\n global $DB;\n return $DB->get_records('smartchoice_answers', array('choiceid' => $choice->id));\n}", "public function generateWrongOptions($quiz_id,$question_id=-1){\n\n //for all questions-wrong options with limit\n// SELECT quiz_id, question_id, question, answer_id,answer FROM (SELECT quiz_question.quiz_id, quiz_question.question_id, question.question, answer_id,answer ,@rn := IF(@prev = quiz_question.question_id, @rn + 1, 1) as rn, @prev := quiz_question.question_id FROM quiz INNER JOIN quiz_question ON quiz.quiz_id = quiz_question.quiz_id AND quiz.deleted = 0 AND quiz.quiz_id = 1 INNER JOIN question ON quiz_question.question_id = question.question_id INNER JOIN (SELECT * FROM answer WHERE answer.answer_id NOT IN (SELECT answer_id FROM correct_question_answer) ORDER BY RAND()) as answers ON answers.question_id = quiz_question.question_id JOIN (SELECT @prev := NULL, @rn := 0) AS vars) as final WHERE rn <= 3\n\n\n\n //it means u have to generate wrong options for all questions with limit of NoOfWrongOptionsWithMostFrequency\n if($question_id==-1){\n $resultSet = $this->getNoOfWrongOptionsWithMostFrequency($quiz_id);\n $noOfWrongOptions = ($resultSet->fetchAll());\n//print_r($ans);\n $this->noOfWrongOption = $noOfWrongOptions[0]->no_of_wrong;\n// return Connection::connectToDB()->query(\"SELECT quiz_id, question_id, question, answer_id,answer FROM (SELECT quiz_question.quiz_id, quiz_question.question_id, question.question, answer_id,answer ,@rn := IF(@prev = quiz_question.question_id, @rn + 1, 1) as rn, @prev := quiz_question.question_id FROM quiz INNER JOIN quiz_question ON quiz.quiz_id = quiz_question.quiz_id AND quiz.deleted = 0 AND quiz.quiz_id = $quiz_id and question_id INNER JOIN question ON quiz_question.question_id = question.question_id INNER JOIN (SELECT * FROM answer WHERE answer.answer_id NOT IN (SELECT answer_id FROM correct_question_answer) ORDER BY RAND()) as answers ON answers.question_id = quiz_question.question_id JOIN (SELECT @prev := NULL, @rn := 0) AS vars) as final WHERE rn <= $this->noOfWrongOption\");\n\n return Connection::connectToDB()->query(\"SELECT quiz_id, question_id, question, answer_id,answer FROM (SELECT quiz_question.quiz_id, quiz_question.question_id, question.question, answer_id,answer ,@rn := IF(@prev = quiz_question.question_id, @rn + 1, 1) as rn, @prev := quiz_question.question_id FROM quiz INNER JOIN quiz_question ON quiz.quiz_id = quiz_question.quiz_id AND quiz.deleted = 0 AND quiz.quiz_id = $quiz_id and question_id not in (SELECT question_id FROM (SELECT a.question_id,a.no_of_options,b.no_of_correct,a.no_of_options-b.no_of_correct as no_of_wrong FROM (SELECT no_of_options,question_id FROM quiz_question WHERE quiz_id=$quiz_id GROUP by question_id) as a LEFT OUTER JOIN (SELECT COUNT(*) as no_of_correct,question_id FROM correct_question_answer GROUP by question_id) as b on a.question_id=b.question_id) as t WHERE no_of_wrong!=$this->noOfWrongOption) INNER JOIN question ON quiz_question.question_id = question.question_id INNER JOIN (SELECT * FROM answer WHERE answer.answer_id NOT IN (SELECT answer_id FROM correct_question_answer) ORDER BY RAND()) as answers ON answers.question_id = quiz_question.question_id JOIN (SELECT @prev := NULL, @rn := 0) AS vars) as final WHERE rn <=$this->noOfWrongOption\");\n }\n\n //else u have to generate wrong option for particular question\n $resultSet = $this->getNoOfWrongOptions($quiz_id,$question_id);\n $noOfWrongOptions = ($resultSet->fetchAll());\n//print_r($ans);\n $noOfWrongOption = $noOfWrongOptions[0]->noOfWrongOption;\n return Connection::connectToDB()->query(\"SELECT\n quiz_question.quiz_id,quiz_question.question_id,question,answer.answer_id,answer\nFROM\n answer\nJOIN quiz_question ON quiz_question.question_id = answer.question_id\nJOIN question ON quiz_question.question_id = question.question_id\nWHERE\n quiz_question.quiz_id =$quiz_id AND quiz_question.question_id=$question_id AND answer.answer_id NOT IN(\n SELECT\n answer_id\n FROM\n correct_question_answer\n JOIN quiz_question ON quiz_question.question_id = correct_question_answer.question_id\n WHERE\n quiz_id = $quiz_id\n GROUP BY\n quiz_question.question_id\n\n) ORDER BY RAND() LIMIT $noOfWrongOption\");\n }", "public function getQuestionQuiz ($quiz=\"\") \n {\n \tglobal $debug;\n \t\n \t// if $quiz not specified get all questions in db (even those with no quiz)\n \t// Initial sql without where - add where part later if required\n \t$sql = \"SELECT \".$this->table_prefix.$this->quiz_tables['questions'].\".questionid, section, intro, input, type, answer, reason, reference, hint, image, comments, qfrom, email, created, reviewed, quizname FROM \". $this->table_prefix.$this->quiz_tables['questions']. \" LEFT OUTER JOIN \".$this->table_prefix.$this->quiz_tables['rel'].\" on \".$this->table_prefix.$this->quiz_tables['questions'].\".questionid=\".$this->table_prefix.$this->quiz_tables['rel'].\".questionid\";\n \t \t \t\n \t// if we limit to a quiz then handle here\n \tif ($quiz!=\"\")\n \t{\n \t\t// add a where clause - no security checking here - it needs to be done at a higher level\n \t\t$sql .= \" WHERE \".$this->table_prefix.$this->quiz_tables['rel'].\".quizname=\\\"$quiz\\\"\";\n \t}\n \t\n \t// Add order by after where clause if we have one\n \t$sql .= \" ORDER BY \".$this->table_prefix.$this->quiz_tables['questions'].\".questionid\";\n \t\n \t\n \tif (isset ($debug) && $debug) {print \"SQL: \\n\".$sql.\"\\n\\n\";}\n \t\n \t// Get all the rows into a temp array - we then reformat appropriately (eg. move quizname into array instead of individual rows\n \t\n \t$temp_array = $this->db_object->getRowsAll ($sql);\n \t// check for errors\n \tif (isset ($temp_array['ERRORS'])) \n \t{\n \t\tif ($debug) {print \"Error in getQuestionQuiz \\n\";}\n \t\t//-here userfriendly handling?\n \t\t//print \"An error has occurred\";\n \t\t$err = Errors::getInstance();\n \t\t$err->errorEvent(ERROR_DATABASE, \"Error reading database\"+$temp_array['ERRORS']);\n\n \t}\n \t\n \t// New array that we return from the function\n \t$return_array = array();\n\n \t//print \"DEBUG\\n\";\n \t//print_r ($temp_array);\n \t\n \t// iterate over all arrays - set so we only have one question\n \tforeach ($temp_array as $this_array)\n \t{\n \t\t// pull this out of array as we will use a few times and makes easier to read\n \t\t$this_question_id = $this_array['questionid'];\n \t\t// does this question already exist - if so just add this quiz to it's quiz array\n \t\tif (isset($return_array[$this_question_id]))\n \t\t{\n \t\t\t$return_array[$this_question_id]['quizzes'][] = $this_array['quizname'];\n \t\t}\n \t\t// This is new so create a new array entry\n \t\telse\n \t\t{\n \t\t\tforeach ($this_array as $key => $value)\n \t\t\t{\n \t\t\t\t// handle quizname seperately (create array with this value as an entry\n \t\t\t\tif ($key == \"quizname\") {$return_array[$this_question_id]['quizzes']= array($value);}\n \t\t\t\telse {$return_array[$this_question_id][$key]=$value;}\n \t\t\t}\n \t\t}\n \t}\n \treturn $return_array;\n }", "function get_survey_answers($question_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated survey answers\r\n $sql = \"SELECT id\r\n FROM answers\r\n WHERE is_active = '1' AND question = '$question_id';\";\r\n\r\n $answers_data = array();\r\n $answers = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $answers_data[$key] = $value;\r\n foreach ($answers_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $answers[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $answers;\r\n}", "function alternatives()\r\n {\r\n $returnArray = array();\r\n $db =& eZDB::globalDatabase();\r\n $db->array_query( $questionArray, \"SELECT ID FROM eZQuiz_Alternative WHERE QuestionID='$this->ID' ORDER BY ID\" );\r\n\r\n for ( $i = 0; $i < count( $questionArray ); $i++ )\r\n {\r\n $returnArray[$i] = new eZQuizAlternative( $questionArray[$i][$db->fieldName( \"ID\" )], true );\r\n }\r\n return $returnArray;\r\n }", "function get_all_correct_answers()\n {\n $this->db->order_by('id', 'desc');\n return $this->db->get('correct_answers')->result_array();\n }", "function get_survey_questions($survey_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated survey answers\r\n $sql = \"SELECT id\r\n FROM questions\r\n WHERE is_active = '1' AND survey = '$survey_id';\";\r\n\r\n $questions_data = array();\r\n $questions = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $questions_data[$key] = $value;\r\n foreach ($questions_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $questions[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $questions;\r\n}", "function ipal_get_questions(){ \r\n \r\n\tglobal $ipal;\r\n\tglobal $DB;\r\n\tglobal $CFG;\r\n\t$q='';\t\r\n\t$pagearray2=array();\r\n\t // is there an quiz associated with an ipal?\r\n//\t$ipal_quiz=$DB->get_record('ipal_quiz',array('ipal_id'=>$ipal->id));\r\n\t\r\n\t// get quiz and put it into an array\r\n\t$quiz=$DB->get_record('ipal',array('id'=>$ipal->id));\r\n\t\r\n\t//Get the question ids\r\n\t$questions=explode(\",\",$quiz->questions);\r\n\t\r\n\t//get the questions and stuff them into an array\r\n\t\tforeach($questions as $q){\t\r\n\t\t\t\r\n\t\t $aquestions=$DB->get_record('question',array('id'=>$q));\r\n\t\t if(isset($aquestions->questiontext)){\r\n\t\t $pagearray2[]=array('id'=>$q, 'question'=>strip_tags($aquestions->questiontext), 'answers'=>ipal_get_answers($q));\r\n\t\t\t\t \r\n\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t}\r\n \r\n\treturn($pagearray2);\r\n\t}" ]
[ "0.6673361", "0.6512464", "0.64417034", "0.63983077", "0.6296383", "0.62548465", "0.6247941", "0.61913", "0.6140739", "0.6137861", "0.61039484", "0.6099266", "0.6089631", "0.60755074", "0.60747313", "0.6066443", "0.60663974", "0.6060929", "0.60421145", "0.60327333", "0.6025982", "0.600755", "0.5989077", "0.597399", "0.5955751", "0.5953452", "0.5946731", "0.5943309", "0.5943183", "0.5899825" ]
0.68466645
0
Helper function for processScore gets the amount of correct answers based on user answers
function getNumCorrect($dbanswers, $useranswers) { $total_correct = 0; //For each question, check if the correct answer text //is equal to the text submitted by the user foreach ($dbanswers as $question){ $question_num = $question['question_num']; if(isset($useranswers[$question_num])){ if($question['choice_text'] === $useranswers[$question_num]){ $total_correct++; } } } return $total_correct; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processScore($dbanswers, $useranswers){\n $total_questions = sizeof($dbanswers);\n $total_correct = getNumCorrect($dbanswers, $useranswers);\n \n //Calculate score to 0 decimal places\n if($total_questions === 0){\n return 0;\n } else {\n return floor($total_correct / $total_questions * 100);\n }\n }", "public function getAnswerCount();", "function CountCorrectAns(){\n\t\n\t\t\t\tglobal $count;\n\t\t\t\twhile($correct){\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t\treturn $count;\n\t\t\t}", "function countCorrectAlternatives()\r\n {\r\n $returnArray = array();\r\n $db =& eZDB::globalDatabase();\r\n $db->query_single( $result, \"SELECT count( ID ) AS COUNT FROM eZQuiz_Alternative WHERE QuestionID='$this->ID' AND IsCorrect=1\" );\r\n\r\n $ret = false;\r\n\r\n if ( is_numeric( $result[$db->fieldName( \"COUNT\" )] ) )\r\n {\r\n $ret = $result[$db->fieldName( \"COUNT\" )];\r\n }\r\n\r\n return $ret;\r\n }", "private function answer($user){\n $answers=$user->comments()->where('commentable_type','App\\Problem')->get();\n $count=[];\n $calculatedAnswerPoint=0;\n foreach($answers as $key=>$answer){\n $countLike=$answer->num_like;\n $countDisLike=$answer->num_dislike;\n $count[$key]=$countLike*Config::get('rate')['answer']['attributes']['like']-($countDisLike*Config::get('rate')['answer']['attributes']['dislike']);\n // check if the answer is true or not\n if($answer->commentable->comment_id==$answer->id){ //the answer is correct\n $count[$key]+=Config::get('rate')['answer']['attributes']['correct'];\n }else{\n $count[$key]+=Config::get('rate')['answer']['attributes']['normal'];\n }\n }\n $answerPoint=array_sum($count);\n if($answerPoint>Config::get('rate')['answer']['result'][5]){ //5 star paper\n $calculatedAnswerPoint=5;\n }elseif($answerPoint>Config::get('rate')['answer']['result'][4] && $answerPoint<=Config::get('rate')['answer']['result'][5]){\n $calculatedAnswerPoint=4;\n }elseif($answerPoint>Config::get('rate')['answer']['result'][3] && $answerPoint<=Config::get('rate')['answer']['result'][4]){\n $calculatedAnswerPoint=3;\n }elseif($answerPoint>Config::get('rate')['answer']['result'][2] && $answerPoint<=Config::get('rate')['answer']['result'][3]){\n $calculatedAnswerPoint=2;\n }elseif($answerPoint>=Config::get('rate')['answer']['result'][1] && $answerPoint<=Config::get('rate')['answer']['result'][2]){\n $calculatedAnswerPoint=1;\n }\n $finalAnswerPoint=$calculatedAnswerPoint*Config::get('rate')['answer']['weight'];\n return $finalAnswerPoint;\n }", "function submitEvaluation($arrayQuestion){\n\n\t\tglobal $conn;\n\n\t\t$numberRightAnswer = 0;\n\n\t\tfor($i = 0; $i < count($arrayQuestion); $i++){\n\n\t\t\t$questionId = $arrayQuestion[$i]['questionId'];\n\t\t\t$answer = $arrayQuestion[$i]['answer'];\t\n\t\t\t\n\t\t\tif(isQuestionAnswerCorrect($questionId, $answer) == 1){\n\n\t\t\t\t$numberRightAnswer++;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $numberRightAnswer/(count($arrayQuestion));\n\n\t}", "public function earned_score($answers, $attempt) {\n return $answers[$attempt->answerid]->score;\n }", "public function answerCheck()\n {\n $first_number = $this->post_data['firstNumber']; \n // Assign the second number in the question to $second_number in the class method.\n $second_number = $this->post_data['secondNumber'];\n // Assign the number of correct answers to $number_correct in the class method.\n $number_correct = $this->post_data['numberCorrect'];\n // Assign the question number for this level to $question_number in the class method.\n $question_number = $this->post_data['questionNumber'];\n // Assign the level number for this level to $level_number in the class method.\n $level_number = $this->post_data['levelNumber'];\n // Reset Question number to 1 if more than five questions have been completed or increase it by one\n if($question_number == 5) {\n $question_number = 1;\n $level_number++;\n } else {\n $question_number++;\n }\n\n // Check the correct answer to the question.\n $sum = $first_number * $second_number;\n // If the answer in the post data is equivalent to the correct answer, increment $number_correct by one \n // then return true and $number_correct. If it isn't correct return false and $number_correct.\n if ($sum == $this->post_data['sumAnswer']) {\n $number_correct++;\n return array(true, $number_correct, $question_number, $level_number);\n } else {\n return array(false, $number_correct, $question_number, $level_number);\n }\n }", "public function getCorrectAnswersCount($question_id, $round_id){\n global $ilAccess, $ilUser, $tpl, $ilTabs;\n\n $correct_answers_count = 0;\n // get all answers that belong to a certain round (only their user_sting)\n $answers = $this->object->getDistinctAnswers($round_id);\n\n foreach ($answers as $answer){\n \t$fault_choices = 0;\n\n // these are the choices together with their answers correlating to a certain question and a certain answer\n $choices_of_question_answer = $this->object->getChoicesOfQuestionAnswer($question_id, $answer['user_string']);\n $part_answer_correct_count=0;\n $part_answer_correct_selected_count=0;\n foreach ($choices_of_question_answer as $element){\n \tif ($element['correct_value'] == 1 ){\n \t\t$part_answer_correct_count++;\n \t}\n \t\n\t\t if ($element['correct_value'] == 1 && $element['value'] == 1 ){\n\t\t \t$part_answer_correct_selected_count++;\n\t\t }\n\n\t\t if ($element['correct_value'] == 0 && $element['value'] == 1 ){\n\t\t \t$fault_choices++;\n\t\t }\n }\n\n if ($part_answer_correct_count==$part_answer_correct_selected_count && $fault_choices==0){\n \t$correct_answers_count++;\n }\n// if ($choice['correct_value'] == 1 && $choice['value'] == 1){\n// $correct_answers_count++;\n// }\n }\n \n\n return $correct_answers_count;\n }", "function getAnswerCount()\n\t{\n\t\treturn count($this->answers);\n\t}", "public function iaqScore();", "function getScore($a, $b)\n{\n // were filling out/had already filled out quiz\n $resultA = mysql_query(\"SELECT `answer` FROM `response` WHERE `profile_id`='$a' ORDER BY `question_id`\");\n $resultB = mysql_query(\"SELECT `answer` FROM `response` WHERE `profile_id`='$b' ORDER BY `question_id`\");\n $sum = 0;\n if (mysql_num_rows($resultB) == 0) {\n\treturn -1;\n }\n while (($rowA = mysql_fetch_array($resultA)) && ($rowB = mysql_fetch_array($resultB))) {\n\t$sum += pow(abs($rowA[0] - $rowB[0]),2);\n }\n echo(mysql_error());\n return sqrt($sum);\n}", "function isAnswerCorrect($answers, $answer)\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilStr.php\";\n\t\t$result = 0;\n\t\t$textrating = $this->getTextRating();\n\t\tforeach ($answers as $key => $value)\n\t\t{\n\t\t\tswitch ($textrating)\n\t\t\t{\n\t\t\t\tcase TEXTGAP_RATING_CASEINSENSITIVE:\n\t\t\t\t\tif (strcmp(ilStr::strToLower($value), ilStr::strToLower($answer)) == 0 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_CASESENSITIVE:\n\t\t\t\t\tif (strcmp($value, $answer) == 0 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_LEVENSHTEIN1:\n\t\t\t\t\tif (levenshtein($value, $answer) <= 1 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_LEVENSHTEIN2:\n\t\t\t\t\tif (levenshtein($value, $answer) <= 2 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_LEVENSHTEIN3:\n\t\t\t\t\tif (levenshtein($value, $answer) <= 3 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_LEVENSHTEIN4:\n\t\t\t\t\tif (levenshtein($value, $answer) <= 4 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEXTGAP_RATING_LEVENSHTEIN5:\n\t\t\t\t\tif (levenshtein($value, $answer) <= 5 && $this->answers[$key]->getPoints() > 0) return $key;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn FALSE;\n\t}", "function get_user_score() \n\t{\n\t\t$this->load->model('frontendmodel');\n\n\t\t$arrResult = $this->frontendmodel->FetchResult();\n\n\t\t$intCounter = 0;\n\n\t\tforeach ($arrResult as $key => $value) \n\t\t{\n\t\t\tif($value['result'] && $value['includeinscoring'])\n\t\t\t{\n\t\t\t\t$intCounter = $intCounter + 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\techo $intCounter;\n\t}", "public function totalAnsweredChoices ($userID = null)\n { \n if (is_null($userID)) $userID = Auth::user()->id;\n\n return (int) $this->choice\n ->whereHas('question.scores', function ($query) use ($userID) { $query->where(['user_id' => $userID, 'done' => true]); })\n ->count();\n }", "function countAlternatives()\r\n {\r\n $returnArray = array();\r\n $db =& eZDB::globalDatabase();\r\n $db->query_single( $result, \"SELECT count( ID ) AS COUNT FROM eZQuiz_Alternative WHERE QuestionID='$this->ID'\" );\r\n\r\n $ret = false;\r\n\r\n if ( is_numeric( $result[$db->fieldName( \"COUNT\" )] ) )\r\n {\r\n $ret = $result[$db->fieldName( \"COUNT\" )];\r\n }\r\n\r\n return $ret;\r\n }", "public function findAnswerCount($choice) {\n\t\t$return = 0;\n\t\t$query\t= $this->createQuery();\n\n\t\tif($choice instanceof \\Qinx\\Qxsurvey\\Domain\\Model\\Choice) {\n\t\t\t$choice = $choice->getUid();\n\t\t}\n\n// kann vorerst nicht mehr in TYPO3 7 verwendet werden\n//\t\t$statement = 'SELECT COUNT(a.uid) as total FROM tx_qxsurvey_domain_model_answer AS a\n//\t\t\tWHERE a.choice = ?\n//\t\t\t\tAND a.pid IN ?' . $this->getEnabledFieldString('tx_qxsurvey_domain_model_answer', 'a');\n//\n//\t\t$result = $query\n//\t\t\t->statement($statement, array(1))\n//\t\t\t->execute(true);\n\n\t\t$statement = $GLOBALS['TYPO3_DB']->prepare_SELECTquery(\n\t\t\t'COUNT(a.uid) as total',\n\t\t\t'tx_qxsurvey_domain_model_answer AS a',\n\t\t\t'a.choice = :uid AND a.pid IN (:pid)' . $this->getEnabledFieldString('tx_qxsurvey_domain_model_answer', 'a'));\n\t\t$statement->execute(array(':uid' => $choice, ':pid' => implode(',', $query->getQuerySettings()->getStoragePageIds())));\n\n\t\t$result = $statement->fetch();\n\n\t\tif(isset($result['total']) === true) {\n\t\t\t$return = (int) $result['total'];\n\t\t}\n\n\t\treturn $return;\n\t}", "function pointsScored($quiz)\n\t{\n\t $fetch = $this->DB->database_select('points', array('points_obtained'), array('uid' => session_get('uid'), 'qid' => $quiz), 1);\n\t return ($fetch != false) ? $fetch['points_obtained'] : 0;\n\t}", "public function getCurrentQuestionCount();", "public function user_answer_rate() {\n return (float) number_format($this->usersanswered / $this->postsanswered, 2);\n }", "function calculateScore($aryTip, $aryResult, $blnSD, $blnUserSD)\n { \n \t$aryScore = array\n\t(\n\t\t\"perfect\" => 3,\n\t\t\"correctScore\"=> 2,\n\t\t\"correctTeam\" => 1\n\t); \t\n \t\n \t$intResultDiff = $aryResult[0] - $aryResult[1];\t\t\n\t$intTipDiff = $aryTip[0] - $aryTip[1];\t\t\t\n\t\n\t$intScore = 0;\n\tif(is_numeric($aryTip[0]) AND is_numeric($aryTip[1]))\n\t{\n\t\t/* Sudden Death? */\n\t\t//\n\t\tif(FALSE) /* SD can't be tipped anymore!! */\n\t\t{\t\n\t\t\t/* user tipped a SD? */\n\t\t\tif( $blnUserSD == $blnSD )\n\t\t\t{\n\t\t\t\t/* correct team -> PERFECT */\t\n\t\t\t\tif( ($intResultDiff * $intTipDiff) > 0 )\n\t\t\t\t{\n\t\t\t\t\t$intScore += $aryScore['perfect'] + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\t\t\n\t\t\t/* PERFECT */\n\t\t\tif( ($aryResult[0] == $aryTip[0]) AND ($aryResult[1] == $aryTip[1]) )\n\t\t\t{\n\t\t\t\t//echo \"perfect\";\n\t\t\t\t$intScore += $aryScore['perfect'];\n\t\t\t}\n\t\t\t/* Correct Score */\n\t\t\telseif( $intResultDiff == $intTipDiff )\n\t\t\t{\n\t\t\t\t//echo \"Correct Score\";\n\t\t\t\t$intScore += $aryScore['correctScore'];\n\t\t\t}\n\t\t\t/* correct Team */\n\t\t\telseif( ($intResultDiff * $intTipDiff) > 0 )\n\t\t\t{\n\t\t\t\t//echo \"Correct Team\";\n\t\t\t\t$intScore += $aryScore['correctTeam'];\n\t\t\t}\t\t\t\n\t\t} \t\t\n\t}\n\treturn $intScore;\n}", "function qstats($answer_table, $stat_res){\n\tglobal $stat_code, $dict, $reverse_code;\n\tforeach ($stat_code as $group => $qarray ){ // go over groups & calc avg\n\t\t$num_ans = 0; // count answers for avg.\n\t\t$sum_ans = 0; // sum of answers\n\t\tforeach ($qarray as $ans){\n\t\t\tif (empty($answer_table[$ans])) continue; // skip empty\n\t\t\t$sum_ans += in_array($ans, $reverse_code) ? 7 - $dict[$answer_table[$ans]] : $dict[$answer_table[$ans]];\n\t\t\t//error_log(\"qstat v=\". $dict[$answer_table[$ans]] . \" converted=\".(7 - $dict[$answer_table[$ans]]));\n\t\t\t// $sum_ans += $dict[$answer_table[$ans]];\n\t\t\t$num_ans += 1;\n\t\t}\n\t\tif ($num_ans > 0) \n\t\t\t$stat_res[$group] = $sum_ans / $num_ans;\n\t\telse $stat_res[$group] = 0;\n\t}\n\t// error_log(print_r($stat_res, true));\n\treturn $stat_res;\n}", "public function test_quizUserScoreFunctions() {\n \t$quiz = TheTrainingMangerLMS\\LessonQuiz::create(\n \t\tarray( 'title' => 'This is my favorite quiz!',\n \t\t\t 'options' => array(\n \t\t\t \t\t'number_of_questions' => 20,\n \t\t\t \t\t'time_limit' => 3600,\n \t\t\t \t\t'allowed_repeats' => 2\n \t\t\t \t)\n \t\t)\n \t);\n \t$this->assertTrue(get_class($quiz) == 'TheTrainingMangerLMS\\LessonQuiz');\n \t// create a whole bunch of questions, say 25 and add them\n \tfor($i = 0; $i < 25; $i++) {\n\t\t\t$question = TheTrainingMangerLMS\\Quiz\\Question::create( array( 'title' => \"This is my favorite question {$i}!\") );\n\t\t\t$question->setAnswer($this->createSimpleChoiceAnswer());\n\t\t\t$quiz->addQuestion($question);\n \t}\n \t$this->assertEquals(25, count($quiz->getQuestions()));\n \t$user = TheTrainingMangerLMS\\User::create( array( 'login' => 'Joe Schmoe', 'password' => 'test123' ) );\n \t$this->assertTrue(get_class($user) == 'TheTrainingMangerLMS\\User');\n $user = TheTrainingMangerLMS\\Student::promote($user);\n $this->assertTrue(get_class($user) == 'TheTrainingMangerLMS\\Student');\n \t$quiz->startQuiz($user);\n \t$questions = explode(',', get_user_meta($user->ID(), ttp_lms_prefix('quiz_' . $quiz->ID() . '_try_' . '1' . '_questions'), true));\n \tfor($i = 0; $i < 10; $i++) {\n\t \t$question = $quiz->getNextQuestion($user);\n \t\t$this->assertEquals($questions[$i], $question->ID());\n \t\t$quiz->saveQuestionResponseAndOutcome($user, $question, array('choice' => 1), array( 'outcome' => 'CORRECT', 'score' => 2.0, 'tpp' => 4.0));\n \t}\n \t$quiz->endQuiz($user);\n \t$totalpoints = get_user_meta($user->ID(), ttp_lms_prefix('quiz_' . $quiz->ID() . '_try_' . '1' . '_ttp'), false);\n \t$this->assertEquals(1, count($totalpoints));\n \t$this->assertEquals(80, $totalpoints[0]);\n \t$totalscore = get_user_meta($user->ID(), ttp_lms_prefix('quiz_' . $quiz->ID() . '_try_' . '1' . '_totalscore'), false);\n \t$this->assertEquals(1, count($totalscore));\n \t$this->assertEquals(20, $totalscore[0]);\n }", "function get_question_correct_perc($req_ID) {\n global $myPDO;\n\n // The query to get the IDs of hard questions\n $statement = $myPDO->prepare(\"\n SELECT\n (COUNT( CASE `Correct` WHEN 1 THEN `Correct` END ) / COUNT( * )) *100 AS 'correct_perc'\n FROM\n `rdtom_responses`\n WHERE\n `Question_ID` = :Question_ID\n \");\n\n $statement->bindValue(':Question_ID', $req_ID);\n $statement->execute();\n $result = $statement->fetch(PDO::FETCH_ASSOC);\n\n return $result['correct_perc'];\n}", "public function getTotalAnswerCount() {\n\t\treturn $this->countSurveyAnswers();\n\t}", "public function usersNeedChoice()\n {\n $madechoice = (R::count('choice'))/2;\n $choicedecided = R::count('finalchoice');\n return $madechoice - $choicedecided;\n }", "private function checkAnswer($message, $replyToken)\n {\n if($this->latihan_un->isAnswerEqual($this->user['number'], $message)){\n $this->user['score']++;\n $this->latihan_un->setScore($this->user['user_id'], $this->user['score']);\n }\n if($this->user['number'] < 10)\n {\n // update number progress\n $this->latihan_un->setUserProgress($this->user['user_id'], $this->user['number'] + 1);\n // send next question\n $this->sendQuestion($replyToken, $this->user['number'] + 1);\n }\n else {\n // soal ke 10\n $this->latihan_un->setUserProgress($this->user['user_id'], $this->user['number'] + 1);\n // create user score message\n $message = 'Nilaimu '. $this->user['score'];\n $textMessageBuilder1 = new TextMessageBuilder($message);\n // create sticker message\n $stickerId = ($this->user['score'] < 8) ? 110 : 4;\n $stickerMessageBuilder = new StickerMessageBuilder(1, $stickerId);\n // create play again message\n $message = ($this->user['score'] < 8) ?\n 'Man Jadda Wa Jada !!! Ketik \"ayok\" untuk berlatih lagi!':\n 'Yeay! Mantap bro! Ketik \"ayok\" untuk berlatih lagi!';\n $textMessageBuilder2 = new TextMessageBuilder($message);\n // merge all message\n $multiMessageBuilder = new MultiMessageBuilder();\n $multiMessageBuilder->add($textMessageBuilder1);\n $multiMessageBuilder->add($stickerMessageBuilder);\n $multiMessageBuilder->add($textMessageBuilder2);\n // send reply message\n $this->bot->replyMessage($replyToken, $multiMessageBuilder);\n $this->latihan_un->setUserProgress($this->user['user_id'], 0);\n }\n }", "public function getAnswerLength();", "private function checkAnswer($message) {\n if($this->catheaven_m->isAnswerEqual($this->quizNumber['number'], $message)){\n $this->user['score']++;\n $this->catheaven_m->setScore($this->user['user_id'], $this->user['score']);\n $message = 'Jawaban Anda Benar...';\n $textMessageBuilder = new TextMessageBuilder($message);\n $this->bot->pushMessage($this->user['user_id'], $textMessageBuilder);\n } else {\n $message = 'Jawaban Anda Kurang Tepat...';\n $textMessageBuilder = new TextMessageBuilder($message);\n $this->bot->pushMessage($this->user['user_id'], $textMessageBuilder);\n }\n\n if($this->user['number'] < 10){\n\n // update number progress\n $this->catheaven_m->setUserProgress($this->user['user_id'], $this->user['number'] + 1);\n\n // get user data from database\n $this->user = $this->catheaven_m->getUser($this->user['user_id']);\n\n // get quiz number from database\n $this->quizNumber = $this->catheaven_m->getQuizNumber($this->user['number']);\n\n // send next number\n $this->sendQuestion($this->user['user_id'], $this->quizNumber['number']);\n } else {\n\n if ($this->user['score'] >= 6) {\n\n $stickerMessageBuilder = new StickerMessageBuilder(1, 14);\n $this->bot->pushMessage($this->user['user_id'], $stickerMessageBuilder);\n // show user score\n $message = \"Selamat ya, total skor Anda \" . $this->user['score']*10 . \". Karena skor anda lebih dari 60, berikut beberapa Tips memelihara kucing :\";\n $textMessageBuilder = new TextMessageBuilder($message);\n $this->bot->pushMessage($this->user['user_id'], $textMessageBuilder);\n\n $imageUrl = 'https://pbs.twimg.com/profile_images/822943616838483968/uoYUQh63_400x400.jpg';\n $tips = $this->catheaven_m->getTips();\n $columnTemplateBuilders = array();\n\n for ($i=0; $i < count( $tips ) ; $i++) {\n $columnTemplateBuilder = new CarouselColumnTemplateBuilder(\" \", $tips[$i]['title'], $imageUrl, [\n new UriTemplateActionBuilder('Klik Di Sini.', $tips[$i]['url']),\n ]);\n array_push($columnTemplateBuilders, $columnTemplateBuilder);\n }\n\n $carouselTemplateBuilder = new CarouselTemplateBuilder($columnTemplateBuilders);\n $templateMessage = new TemplateMessageBuilder('Button alt text', $carouselTemplateBuilder);\n $this->bot->pushMessage($this->user['user_id'], $templateMessage);\n\n } else {\n\n $stickerMessageBuilder = new StickerMessageBuilder(2, 173);\n $this->bot->pushMessage($this->user['user_id'], $stickerMessageBuilder);\n // show user score\n $message = \"Sayang sekali, skor Anda hanya \" . $this->user['score']*10 . \". Silakan ketik \\\"MEONG\\\" untuk memulai kembali kuis\";\n $textMessageBuilder = new TextMessageBuilder($message);\n $this->bot->pushMessage($this->user['user_id'], $textMessageBuilder);\n }\n\n $this->catheaven_m->setUserProgress($this->user['user_id'], 0);\n }\n }", "function getCorrectAnswers()\n\t{\n\t\treturn $this->correctanswers;\n\t}" ]
[ "0.7697667", "0.7206746", "0.6975713", "0.6899548", "0.66265345", "0.6618066", "0.6608911", "0.660323", "0.6570108", "0.6548585", "0.64751816", "0.64563644", "0.64508086", "0.64364505", "0.6392756", "0.6351335", "0.63261676", "0.63061935", "0.62870806", "0.62588596", "0.6244605", "0.6205623", "0.6187675", "0.61614627", "0.6147025", "0.6126925", "0.6103571", "0.605763", "0.6052076", "0.6036177" ]
0.74057966
1
Return an apropriate file extension if it isn't already present in the $storageId.
private function _getPublicExtension($storageId, $mimeType) { if (!isset($this->_mimeTypeToExtension[$mimeType])) { return ''; } $extension = '.'.$this->_mimeTypeToExtension[$mimeType]; $extensionLength = strlen($extension); if (substr($storageId, -1 * $extensionLength, $extensionLength) !== $extension) { return $extension; } return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getFileExtension()\n {\n $filePath = '/downloads/episodes/'.\n $this->folder_name.'/'.\n $this->folder_name.'.';\n\n foreach(config('airflix.extensions.video') as $extension)\n {\n if(Storage::disk('public')->exists($filePath.$extension)) {\n return $extension;\n }\n }\n\n return 'm4v';\n }", "public function getFileExtension();", "public function getFileExtension() {\n\t\t$pathInfo = pathinfo($this->filename);\n\t\tif (!isset($pathInfo['extension'])) {\n\t\t\treturn '???';\n\t\t} else {\n\t\t\treturn $pathInfo['extension'];\n\t\t}\n\t}", "abstract protected function getFileExtension();", "public function testExtensionReturnsExtension()\n {\n file_put_contents(self::$temp.DS.'foo.txt', 'foo');\n\n $this->assertSame('txt', Storage::extension(self::$temp.DS.'foo.txt'));\n }", "public function getExtension() : string;", "public function getExtension(){\n $guesser = \"\\Symfony\\Component\\Mime\\MimeTypes\";\n if (class_exists($guesser) !== false) {\n /** @var Symfony\\Component\\Mime\\MimeTypes $guesser */\n $extensions = $guesser::getDefault()->getExtensions($this->getMimeType());\n return $extensions[0] ?? null;\n }\n\n $deprecated_guesser = \"\\Symfony\\Component\\HttpFoundation\\File\\MimeType\\ExtensionGuesser\";\n if (class_exists($deprecated_guesser) !== false){\n /** @var \\Symfony\\Component\\HttpFoundation\\File\\MimeType\\ExtensionGuesser $deprecated_guesser */\n return $deprecated_guesser::getInstance()->guess($this->getMimeType());\n }\n\n return null;\n }", "public function guessExtension();", "public function extension() : string {\n return $this->file->extension;\n }", "public function resolveExtension()\n {\n if (($pos = strrpos($this->path, '.')) !== false) {\n return substr($this->path, $pos + 1);\n }\n\n return '';\n }", "public function getFileExtension(): string\n {\n return $this->fileExtension;\n }", "public function getFileExtension($format);", "private function detectExtension()\n {\n $arr = explode('.', $this->file['name']);\n $this->file['extension'] = end($arr);\n }", "public function getExtension() {\n\t\t\n\t\t$filename = $this->file['name'];\n\t\t\n\t\t$parts = explode('.', $filename);\n\t\t$extension = end($parts);\n\t\t\n\t\treturn strtolower($extension);\n\t\t\n\t}", "public function getExtension();", "public function getExtension();", "public function getExtension();", "public function fileExtension(): string\n {\n return match_data($this,\n [\n Format::Xlsx => 'xlsx',\n Format::Pdf => 'pdf',\n Format::Html => 'html',\n Format::Ods => 'ods',\n ]);\n }", "public function getExtension()\n {\n return substr(strrchr($this->getBasename(), '.'), 1);\n }", "public function extension($filePath);", "function getFileExtension($str) {\n\n $i = strrpos($str,\".\");\n if (!$i) { return \"\"; }\n\n $l = strlen($str) - $i;\n $ext = substr($str,$i+1,$l);\n\n return $ext;\n\n }", "public function getExtension()\n {\n return File::get_file_extension($this->getField('Name'));\n }", "public function getExtension(): string\n {\n return $this->extension;\n }", "public function getExtension(): string\n {\n return $this->extension;\n }", "public static function getFileExtension($str) {\r\n \t$i \t\t= strrpos($str,\".\");\r\n \tif (!$i) { return \"\"; }\r\n \t$l \t\t= strlen($str) - $i;\r\n \t$ext \t= substr($str,$i+1,$l);\r\n \treturn $ext;\r\n }", "public function get_file_extension () {\r\n\t\treturn $this->_file_extension;\r\n\t}", "abstract function getExtension(): string;", "function get_file_extension($filename){\n if(strpos($filename, \"jpeg\")){\n $ext = \"jpeg\";\n }\n else if(strpos($filename, \"png\")){\n $ext = \"png\";\n }\n else if(strpos($filename, \"gif\")){\n $ext = \"gif\";\n }\n else{\n $ext = \"jpg\";\n }\n return $ext;\n }", "public function getExtension()\n {\n return $this->fileExtension;\n }", "function get_extension($file)\n{\n return substr(strrchr($file, '.'), 1);\n}" ]
[ "0.6480627", "0.6448386", "0.6271833", "0.6247673", "0.6225415", "0.62209386", "0.62037295", "0.61474055", "0.61411065", "0.61323154", "0.6103478", "0.6094867", "0.608297", "0.6068494", "0.6055871", "0.6055871", "0.6055871", "0.6051647", "0.60451883", "0.6016836", "0.6008653", "0.59982675", "0.59766823", "0.59766823", "0.59751093", "0.59716773", "0.59685946", "0.5960238", "0.594783", "0.5947172" ]
0.73287374
0
Get files in the directory that start with a specified string.
private function _browseDirectory($path, $startsWith = '') { $result = array(); $directories = glob($path.DIRECTORY_SEPARATOR.'*', GLOB_ONLYDIR); if (is_array($directories)) { foreach ($directories as $directory) { $result = array_merge( $result, $this->_browseDirectory($directory, $startsWith) ); } } $files = glob($path.DIRECTORY_SEPARATOR.$startsWith.'*'); if (is_array($files)) { foreach ($files as $file) { if (is_file($file)) { $result[] = substr($file, strlen($path) + 1); } } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find_by_prefix($prefix) {\n $this->ensure_path_exists();\n $prefix = preg_replace('#(\\*|\\?|\\[)#', '[$1]', $prefix);\n $files = glob($this->glob_keys_pattern($prefix), GLOB_MARK | GLOB_NOSORT);\n $return = array();\n if ($files === false) {\n return $return;\n }\n foreach ($files as $file) {\n // Trim off \".cache\" from the end.\n $return[] = substr(basename($file), 0, -6);\n }\n return $return;\n }", "function find($dir, $pattern){\n // escape any character in a string that might be used to trick\n // a shell command into executing arbitrary commands\n $dir = escapeshellcmd($dir);\n // get a list of all matching files in the current directory\n $files = glob(\"$dir/$pattern\");\n // find a list of all directories in the current directory\n // directories beginning with a dot are also included\n foreach (glob(\"$dir/{.[^.]*,*}\", GLOB_BRACE|GLOB_ONLYDIR) as $sub_dir){\n $arr = find($sub_dir, $pattern); // resursive call\n $files = array_merge($files, $arr); // merge array with files from subdirectory\n }\n // return all found files\n return $files;\n}", "function get_files($directory, $pattern = false) {\n\n\t\tif(!isset($directory) OR is_dir($directory) == false ) return false;\n\t\t$returnval = array();\n\n\t\tif(false != ($handle = opendir($directory))) {\n\t\twhile (false !== ($file = readdir($handle))) {\n\n\t if ($file != \".\" && $file != \"..\") {\n\n\t\tif($pattern != false) {\n\n\t\tif(preg_match(\"$pattern\", $file) > 0 ) {\n\t\t$returnval[] = $file;\n }\n\t\t\t}else{\n\t\t\t\t$returnval[] = $file;\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\t}\n\t\tclosedir($handle);\n\t\treturn $returnval;\n\t}", "function readFilteredFolder($dir, $fileprefix)\n{\n $filtered = array ();\n $folder = readFolder($dir);\n\n if (!$folder) {\n return false;\n }\n\n foreach ($folder as $file) {\n if (endsWith($file, $fileprefix)) {\n $filtered[] = $file;\n }\n }\n\n return $filtered;\n}", "public function findFiles();", "function grep($directory, $pattern = null, $recurse = true) {\n static $in_recurse = false;\n static $skip_charachers;\n $reset_in_recurse = false;\n if (!$in_recurse) {\n if (!\\is_dir($directory))\n return array();\n $directory = \\realpath($directory) . \"/\";\n $skip_charachers = \\strlen($directory);\n $in_recurse = $reset_in_recurse = true;\n }\n $ret = array();\n $dirhandle = \\opendir($directory);\n while (false !== ($nodename = \\readdir($dirhandle))) {\n if ($nodename[0] == \".\")\n continue;\n $subpath = $directory . $nodename;\n if (\\is_dir($subpath)) {\n if ($recurse)\n $ret = \\array_merge($ret, grep($subpath . \"/\", $pattern));\n } else if ($pattern == null || \\preg_match($pattern, $subpath))\n $ret[] = \\substr($subpath, $skip_charachers);\n }\n \\closedir($dirhandle);\n if ($reset_in_recurse)\n $in_recurse = false;\n return $ret;\n}", "function searchFiles($search, $path, $video){\n $searchFiles = scandir($path);\n foreach($searchFiles as $sFile){\n if(($sFile!=\".\")&&($sFile!=\"..\")){\n if(is_dir($path.$sFile)){\n $search = glob($path.$sFile.'/'.$video);\n if(!empty($search)){\n return $search;\n }\n }\n }\n }\n return array('did', 'not', 'work');\n}", "public function getFiles( $path, $startWith = null, $endWith = null ) {\n\n\t\tif ( !file_exists( $path ) ) {\n\t\t\tthrow new \\Exception( 'Path does not exist' . (env( 'APP_DEBUG', true ) ? ': '.$path : '') );\n\t\t}\n\n\t\tif ( !is_dir( $path ) ) {\n\t\t\tthrow new \\Exception( 'Path does not a directory'. (env( 'APP_DEBUG', true ) ? ': ' . $path : '') );\n\t\t}\n\n\t\t$pattern = ($startWith || $endWith) ? $startWith . '*' . $endWith : '';\n\n\t\treturn glob( $path . '/' . $pattern );\n\t}", "function starts_with($string,...$start)\n{\n if(!$string)\n return false;\n foreach( $start as $s )\n if( strpos(\"$string\",\"$s\") === 0 )\n return true;\n return false;\n}", "public static function matchPatternStart($pattern, $str, $isCaseSensitive = true) {\n\n // When str starts with a DIRECTORY_SEPARATOR, pattern has to start with a\n // DIRECTORY_SEPARATOR.\n // When pattern starts with a DIRECTORY_SEPARATOR, str has to start with a\n // DIRECTORY_SEPARATOR.\n if (StringHelper::startsWith(DIRECTORY_SEPARATOR, $str) !==\n StringHelper::startsWith(DIRECTORY_SEPARATOR, $pattern)) {\n return false;\n }\n\n $patDirs = explode(DIRECTORY_SEPARATOR, $pattern);\n $strDirs = explode(DIRECTORY_SEPARATOR, $str);\n\n $patIdxStart = 0;\n $patIdxEnd = count($patDirs)-1;\n $strIdxStart = 0;\n $strIdxEnd = count($strDirs)-1;\n\n // up to first '**'\n while ($patIdxStart <= $patIdxEnd && $strIdxStart <= $strIdxEnd) {\n $patDir = $patDirs[$patIdxStart];\n if ($patDir == \"**\") {\n break;\n }\n if (!self::match($patDir, $strDirs[$strIdxStart], $isCaseSensitive)) {\n return false;\n }\n $patIdxStart++;\n $strIdxStart++;\n }\n\n if ($strIdxStart > $strIdxEnd) {\n // String is exhausted\n return true;\n } elseif ($patIdxStart > $patIdxEnd) {\n // String not exhausted, but pattern is. Failure.\n return false;\n } else {\n // pattern now holds ** while string is not exhausted\n // this will generate false positives but we can live with that.\n return true;\n }\n }", "function file_list($d,$x) {\n foreach(array_diff(scandir($d),array('.','..')) as $f)if(is_file($d.'/'.$f)&&(($x)?ereg($x.'$',$f):1))$l[]=$f;\n return $l;\n}", "function starts_with($haystack, $needle)\n\t{\n\t\treturn Illuminate\\Support\\Str::startsWith($haystack, $needle);\n\t}", "public function search_files( $pattern = null, $offset = 0, $limit = 50 ) {\r\n $files = $this->list_files();\r\n\r\n // will be much better if we search in S3 directly!\r\n if ( $pattern ) {\r\n foreach ( $files as $k => &$v ) {\r\n if( stripos( $k, $pattern ) === FALSE) {\r\n unset( $files[$k] );\r\n }\r\n }\r\n }\r\n\r\n return array_slice( $files, $offset, $limit, true );\r\n }", "function startsWith($string, $startString) \n\t{\n\t\t// with given substring\n \t\n \t// from https://www.geeksforgeeks.org/php-startswith-and-endswith-functions/\n \t\n \t$len \t\t\t\t\t\t\t\t\t\t\t= strlen($startString); \n\t\treturn (substr($string, 0, $len) === $startString); \n\t}", "function grep($path, $pattern, &$results)\n{\n // find all files in the path (incl folders)\n $items = glob($path . '/*'); // */\n\n for ($i = 0; $i < count($items); $i++)\n {\n if (is_dir($items[$i]))\n {\n $add = glob($items[$i] . '/*'); // */\n $items = array_merge($items, $add);\n }\n }\n\n // search through the files.\n $results = array();\n foreach($items as $f)\n {\n if (filetype($f) == 'file')\n {\n if (preg_match($pattern, file_get_contents($f), $matches))\n $results = array_merge($results, $matches);\n }\n }\n\n return (count($results) > 0);\n}", "public function startsWith($prefix);", "function find_file($file) {\n if($results = glob($file)) {\n if($file = array_shift($results)) {\n return $file;\n } else {\n return false;\n }\n } else {\n return false;\n }\n}", "function file_list($d,$x){\r\n foreach(array_diff(scandir($d),array('.','..')) as $f)if(is_file($d.'/'.$f)&&(($x)?ereg($x.'$',$f):1))$l[]=$f;\r\n return $l;\r\n}", "function find_all_files($dir) \n{ \n $files = array();\n foreach (glob($dir) as $file) {\n $files[] = $file;\n }\n return $files;\n}", "static function starts_with($string, $find, $case_sensitive=true){\r\n if ($case_sensitive)\r\n return strpos($string, $find) === 0 ;\r\n return stripos($string, $find) === 0;\r\n }", "protected function php_grep($q, $path){\n\t\t$fp = opendir($path);\n\t\t$ret = '';\n\t\twhile($f = readdir($fp)){\n\t\t\tif($this->ignoreFile($f)) continue;\n\t\t\tif( preg_match('#^\\.+$#', $f) ) continue; // ignore symbolic links\n\t\t\t$file_full_path = $path.DIRECTORY_SEPARATOR.$f;\n\t\t\tif(is_dir($file_full_path)) {\n\t\t\t\t$ret .= $this->php_grep($q, $file_full_path);\n\t\t\t} else if( stristr(file_get_contents($file_full_path), $q) ) {\n\t\t\t\t$ret .= $file_full_path.PHP_EOL;\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "function _ft_search_find_files($dir, $q){\r\n\t$output = array();\r\n\tif (ft_check_dir($dir) && $dirlink = @opendir($dir)) {\r\n\t\twhile(($file = readdir($dirlink)) !== false){\r\n\t\t\tif($file != \".\" && $file != \"..\" && ((ft_check_file($file) && ft_check_filetype($file)) || (is_dir($dir.\"/\".$file) && ft_check_dir($file)))){\r\n\t\t\t\t$path = $dir.'/'.$file;\r\n\t\t\t\t// Check if filename/directory name is a match.\r\n\t\t\t\tif(stristr($file, $q)) {\r\n\t\t\t\t\t$new['name'] = $file;\r\n\t\t\t\t\t$new['shortname'] = ft_get_nice_filename($file, 20);\r\n\t\t\t\t\t$new['dir'] = substr($dir, strlen(ft_get_root()));\r\n\t\t\t\t\tif (is_dir($path)) {\r\n if (ft_check_dir($path)) {\r\n \t\t\t\t\t\t$new['type'] = \"dir\";\t\t\t\t\t \r\n \t\t\t\t\t$output[] = $new;\r\n }\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t $new['type'] = \"file\";\r\n \t\t\t\t\t$output[] = $new;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// Check subdirs for matches.\r\n\t\t\t\tif(is_dir($path)) {\r\n\t\t\t\t\t$dirres = _ft_search_find_files($path, $q);\r\n\t\t\t\t\tif (is_array($dirres) && count($dirres) > 0) {\r\n\t\t\t\t\t\t$output = array_merge($dirres, $output);\r\n\t\t\t\t\t\tunset($dirres);\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tsort($output);\r\n\t\tclosedir($dirlink);\r\n\t\treturn $output;\r\n\t} else {\r\n\t\treturn FALSE;\r\n\t}\r\n}", "public function find_all() {\n $this->ensure_path_exists();\n $files = glob($this->glob_keys_pattern(), GLOB_MARK | GLOB_NOSORT);\n $return = array();\n if ($files === false) {\n return $return;\n }\n foreach ($files as $file) {\n $return[] = substr(basename($file), 0, -6);\n }\n return $return;\n }", "private function recSearchFiles($dir)\n {\n $ffs = scandir($dir);\n\n foreach ($ffs as $ff) {\n\n if ($ff != '.' && $ff != '..') {\n\n if (is_dir($dir . '/' . $ff)) {\n $this->recSearchFiles($dir . $ff . '/');\n } else if (strlen($ff) >= 5) {\n $this->searchedFiles[] = $dir . $ff;\n }\n }\n }\n }", "function starts_with($haystack, $needles)\n {\n return Str::startsWith($haystack, $needles);\n }", "function starts_with($haystack, $needle)\n{\n\treturn substr($haystack, 0, strlen($needle))===$needle;\n}", "function str_starts_with($needle, $haystack)\n {\n return str::startsWith($needle, $haystack);\n }", "public static function startsWith($string, $start)\n {\n return strpos($string, $start) === 0;\n }", "protected final function stringStartsWith ($string, $pattern) {\n\t\treturn (strcmp(substr($string, 0, strlen($pattern)), $pattern) === 0);\n\t}", "function system_glob_rec($directory='',$pattern='*.*')\n{\n\tsystem_ensure_path_ending($directory);\n\t$paths = system_glob($directory.'*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT);\n\tif( $pattern )\n\t{\n\t\t$files = system_glob($directory.$pattern);\n\t\tforeach($paths as $path) { $files = array_merge($files,system_glob_rec($path,$pattern)); }\n\t}\n\telse\n\t{\n\t\t$files = $paths;\n\t\tforeach($paths as $path) { $files = array_merge($files,system_glob_rec($path,$pattern)); }\n\t}\n\treturn $files;\n}" ]
[ "0.5972105", "0.5947173", "0.59052867", "0.5747883", "0.57349575", "0.5663424", "0.5640052", "0.5629838", "0.5605673", "0.5601978", "0.5576167", "0.5576055", "0.5537546", "0.54983073", "0.5491814", "0.54902357", "0.5459613", "0.5454085", "0.5437989", "0.54320663", "0.5430042", "0.541597", "0.53856146", "0.53846455", "0.53540975", "0.53409183", "0.5339176", "0.53282374", "0.5315196", "0.5302999" ]
0.5952791
1
get public url for a storage id if file is linked
public function getUrl($storageGroup, $storageId, $mimeType) { if (strlen($storageId) > $this->_storageDirectoryDepth) { $publicFilename = $this->_getPublicFilename( $storageGroup, $storageId, $mimeType, FALSE ); if ($this->_existLocalFile($publicFilename)) { $result = $this->_publicUrl.$storageGroup; for ($i = $this->_storageDirectoryDepth, $offset = 0; $i > 0; $i--, $offset++) { $result .= '/'.substr($storageId, $offset, 1); } return $result.'/'.$storageId.$this->_getPublicExtension($storageId, $mimeType); } } return NULL; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getFileUrl() {\n return Storage::disk('public')->url('/uploads/' . $this->file_name);\n }", "abstract public function getPublicUrl(): string;", "public function url()\n {\n return Storage::url($this->path);\n }", "public function getUrl()\n {\n return $this->storage()->url(\n $this->getFilepath().DIRECTORY_SEPARATOR.$this->filename\n );\n }", "public function getUrlAttribute()\n {\n return storage_url($this->attributes['path']);\n }", "public function getPublicUrl() {\n\t\treturn \"http://flickr.com/photos/{$this->getUserId()}/{$this->getId()}/\";\n\t}", "public function getUrlAttribute()\n {\n return Storage::url($this->getDiskPath());\n }", "public function url(): string\n {\n return route('storage:get', [\n 'channel' => $this->resource->getChannel(),\n 'path' => base64_encode($this->resource->getPath()),\n ]);\n }", "public function getUrl()\n {\n if($this->storage)\n {\n $this->save();\n\n return $this->storage->getUrl($this);\n }\n\n return NULL;\n }", "protected\n function setPublicUrl()\n {\n $publicUrl = url() . config('album.paths.cache');\n\n return $publicUrl;\n }", "function file_url($file_path)\n {\n return env('STORAGE_BASE_URL') . env('ROOT_FOLDER') . DIRECTORY_SEPARATOR . $file_path;\n }", "public function getFileUrl(){\n $url = config('kontaktformular.fileDownloadUrl');\n //Prüfen ob $url auf / endet\n if(substr($url, -1) != '/'){\n $url .= '/';\n }\n return $url . $this->file_hash .'/' . $this->file_name .'/'. $this->id;\n }", "public function getImageFile()\n {\n $link = $this->link;\n return empty( $this->owner->$link ) ? null : \\Yii::getAlias(\n '@storage/' . $this->directory . '/' . $this->owner->$link\n );\n }", "function get_url($stored_file_name,$bean_id)\n\t{\n\t\tglobal $log, $site_URL, $upload_dir;\n\t\t$log->debug(\"Entering get_url(\".$stored_file_name.\",\".$bean_id.\") method ...\");\n\t\t//echo $site_URL.'/'.$upload_dir.$bean_id.$stored_file_name;\n\t\t//echo $_ENV['HOSTNAME'] .':' .$_SERVER[\"SERVER_PORT\"].'/'.$upload_dir.$bean_id.$stored_file_name;\n\t\t$log->debug(\"Exiting get_url method ...\");\n\t\treturn 'http://'.$_ENV['HOSTNAME'] .':' .$_SERVER[\"SERVER_PORT\"].'/'.$upload_dir.$bean_id.$stored_file_name;\n\t\t//return $site_URL.'/'.$upload_dir.$bean_id.$stored_file_name;\n\t}", "public function getPath() {\n return str_replace(Storage::disk('public')->url(''), '', $this->url);\n }", "function df_store_url($s, $type) {return df_store($s)->getBaseUrl($type);}", "public function getURL();", "public function getURL();", "public function getUrl()\n {\n if (!$this->filename) {\n return null;\n }\n\n return $this->base_url . '/' . $this->filename;\n }", "function upload_url(string $url = null)\n { \n return Storage::disk('armin.public')->url( \n trim_url(config('armin.path.file', 'files').\"/{$url}\")\n ); \n }", "public function publicUrl($url = '')\n\t{\n\t\treturn $this['url.public'].ltrim($url, '/');\n\t}", "public function getURL ();", "public function getMediaUrl($fileName, $storageOption = null);", "public function getUrl(): string\n {\n $url = $this->getBaseMediaDirectoryUrl().'/'.$this->getPathRelativeToRoot();\n $url = $this->makeCompatibleForNonUnixHosts($url);\n $url = $this->rawUrlEncodeFilename($url);\n\n return $url;\n }", "function file_display_url(File $file, $format = 'fullsize')\n{\n if (!$file->exists()) {\n return false;\n }\n return $file->getWebPath($format);\n}", "function generate_external_link($id, $ext)\n {\n global $data_sub;\n $data_sub1 = \"\";\n if($data_sub !== \"\")\n $data_sub1 = \"${data_sub}.\";\n \n $append_ext = \"\";\n if($ext == \"gif\" || $ext == \"webm\")\n $append_ext = \".$ext\";\n\n global $server_name;\n return format_public_uri($data_sub1.$server_name, true).\"/\".$id.$append_ext;\n }", "function fn_get_public_files_path($company_id = null)\n{\n $path = Storage::instance('images')->getAbsolutePath('');\n if ($company_id === null) {\n $company_id = Registry::get('runtime.simple_ultimate') ? Registry::get('runtime.forced_company_id') : Registry::get('runtime.company_id');\n }\n\n if (!empty($company_id)) {\n $path .= 'companies/' . $company_id . '/';\n }\n\n return $path;\n}", "public function imageUrl()\n\t{\n\t\treturn \"/storage/$this->image\";\n\t}", "public function mainImageURL()\n {\n if ($this->image) {\n $imageLocation = $this->image->location;\n } else {\n // If the image cannot be displayed, show a generic image.\n $imageLocation = 'generic/generic1.jpg';\n }\n\n return Storage::url($imageLocation);\n }", "public abstract function getURL();" ]
[ "0.7228313", "0.6935802", "0.68492264", "0.6710932", "0.67024344", "0.6653226", "0.6645142", "0.6596977", "0.658639", "0.65235883", "0.65070677", "0.64531", "0.64483756", "0.6442035", "0.64062357", "0.64061964", "0.63956827", "0.63956827", "0.63893205", "0.6376147", "0.63693553", "0.63437253", "0.632928", "0.6324103", "0.6317719", "0.63134015", "0.63044333", "0.63029003", "0.6276957", "0.6253352" ]
0.70815825
1
Create words and SynonymsPool
public function store(SynonymsPoolAddValidator $request) { $request->validated(); $wordService = new WordService; return $wordService->save($request); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _synonyms()\n\t{\n\t\treturn array(\n\t\t\tarray('multi-moderation','multimoderation'),\n\t\t\tarray('invitation','invite'),\n\t\t\tarray('banner','advert','advertising','advertise'),\n\t\t\tarray('news','blogs','press release'),\n\t\t\tarray('check-in','workflow','validation','valid','approval','approved','live','accept','posted','online','active','activate','activation'),\n\t\t\tarray('theme','skin','style'),\n\t\t\tarray('uninstall','disable','remove'),\n\t\t\tarray('pruning','prune','lurkers'),\n\t\t\tarray('colour','color','css','font','background'),\n\t\t\tarray('sef','seo','google','search engine','search-engine-friendly','search-engine-optimisation'),\n\t\t\tarray('ban','suspend','suspension','probation','warn','punish','punitive'),\n\t\t\tarray('staff','moderator','admin', 'administrator','operator'),\n\t\t\tarray('open','closed','live','activate','activation',/*'enable',*/'turn'),\n\t\t\tarray('iotd','potd','image of the day'),\n\t\t\tarray('import','convert','migrate','upload'),\n\t\t\tarray('export','download'),\n\t\t\tarray('email','e-mail'),\n\t\t\tarray('center','centre'),\n\t\t\tarray('license','licence'),\n\t\t\tarray('atom','rss','feed'),\n\t\t\tarray('login','logon','log-in','log-on'),\n\t\t\tarray('gallery','album'),\n\t\t\tarray('audit','log','usage'),\n\t\t\tarray('download','file','document'),\n\t\t\tarray('page','article','comcode'),\n\t\t\tarray('entry','item','content','resource','submission'),\n\t\t\tarray('category','node','section','repository'),\n\t\t\tarray('catalogue','database','classified','catalog'),\n\t\t\tarray('speed','slow','fast','optimisation','performance','efficiency'),\n\t\t\tarray('panel','sidebar','frame'),\n\t\t\tarray('usergroup','group','promote','rank'),\n\t\t\tarray('member','user'),\n\t\t\tarray('profile','account','memberaccount'),\n\t\t\tarray('permission','privilege','authorisation','authorization','right'),\n\t\t\tarray('option','setting','value'),\n\t\t\tarray('configure','setup','install'),\n\t\t\tarray('emoticon','smiley','face'),\n\t\t\tarray('forum','board','bbs'),\n\t\t\tarray('thread','topic'),\n\t\t\tarray('karma','point'),\n\t\t\tarray('subscribe','track','notification','alert','monitor','watch'),\n\t\t\tarray('bbcode','wikicode','comcode'),\n\t\t\tarray('html','xhtml'),\n\t\t\tarray('addon','add-on','mod','hack','extension','plugin'),\n\t\t\tarray('cedi','wiki','seedy'),\n\t\t\tarray('name','title'),\n\t\t\tarray('analytics','statistics','hits'),\n\t\t\tarray('newsletter','mass-mail','mass-mailing','bulletin','mail-merge'),\n\t\t\tarray('description','caption','summary'),\n\t\t\tarray('choose','set'),\n\t\t\tarray('add','submit','create','make'),\n\t\t\tarray('edit','modify','manage','change','control','moderate','update'),\n\t\t\tarray('delete','erase','remove','discard'),\n\t\t\tarray('restore','revert','undo'),\n\t\t\tarray('news','story','stories'),\n\t\t\tarray('language','unicode','utf','utf8','utf-8','character','charset','24','clock','timezone','time-zone','time','date','translate'),\n\t\t\tarray('ldap','active directory'),\n\t\t\tarray('contact','feedback','ticket','message','issue'),\n\t\t\tarray('documentation','help','guide'),\n\t\t\tarray('sef','short','friendly'),\n\t\t\tarray('survey','quiz','competition','test'),\n\t\t\tarray('swf','flash'),\n\t\t\tarray('subscribe','subscription'),\n\t\t\tarray('attach','embed'),\n\t\t\tarray('smf','simple machines forum'),\n\t\t\tarray('ipb','invision'),\n\t\t\tarray('join','register','signup','sign-up'),\n\t\t\tarray('logout','log-out','sign-out','sign-off'),\n\t\t\tarray('login','log-in','sign-in','sign-on'),\n\t\t\tarray('shopping','ecommerce','payment','purchase'),\n\t\t\tarray('module','addon','system'),\n\t\t\tarray('cache','decache','cleanup'),\n\t\t\tarray('ssl','https'),\n\t\t\tarray('seed','theme wizard'),\n\t\t);\n\t}", "public function words()\n {\n return self::create('',$this->provider->words()); \n }", "function mx_add_search_words($mode, $post_id, $post_text, $post_title = '', $mx_mode = 'mx')\n\t{\n\t\tglobal $db, $config, $lang;\n\n\t\t// $search_match_table = SEARCH_MATCH_TABLE;\n\t\t// $search_word_table = SEARCH_WORD_TABLE;\n\n\t\tswitch ($mx_mode)\n\t\t{\n\t\t\tcase 'mx':\n\t\t\t\t$search_match_table = MX_MATCH_TABLE;\n\t\t\t\t$search_word_table = MX_WORD_TABLE;\n\t\t\t\t$db_key = 'block_id';\n\t\t\tbreak;\n\t\t\tcase 'kb':\n\t\t\t\t$search_match_table = KB_MATCH_TABLE;\n\t\t\t\t$search_word_table = KB_WORD_TABLE;\n\t\t\t\t$db_key = 'article_id';\n\t\t\tbreak;\n\t\t}\n\n\t\tstopwords_synonyms_init();\n\n\t\t$search_raw_words = array();\n\t\t$search_raw_words['text'] = split_words(clean_words('post', $post_text, $stopwords_array, $synonyms_array));\n\t\t$search_raw_words['title'] = split_words(clean_words('post', $post_title, $stopwords_array, $synonyms_array));\n\n\t\t@set_time_limit(0);\n\n\t\t$word = array();\n\t\t$word_insert_sql = array();\n\t\twhile (list($word_in, $search_matches) = @each($search_raw_words))\n\t\t{\n\t\t\t$word_insert_sql[$word_in] = '';\n\t\t\tif (!empty($search_matches))\n\t\t\t{\n\t\t\t\tfor ($i = 0; $i < sizeof($search_matches); $i++)\n\t\t\t\t{\n\t\t\t\t\t$search_matches[$i] = trim($search_matches[$i]);\n\n\t\t\t\t\tif($search_matches[$i] != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$word[] = $search_matches[$i];\n\t\t\t\t\t\tif (!strstr($word_insert_sql[$word_in], \"'\" . $search_matches[$i] . \"'\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$word_insert_sql[$word_in] .= ($word_insert_sql[$word_in] != \"\") ? \", '\" . $search_matches[$i] . \"'\" : \"'\" . $search_matches[$i] . \"'\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (sizeof($word))\n\t\t{\n\t\t\tsort($word);\n\n\t\t\t$prev_word = '';\n\t\t\t$word_text_sql = '';\n\t\t\t$temp_word = array();\n\t\t\tfor($i = 0; $i < sizeof($word); $i++)\n\t\t\t{\n\t\t\t\tif ($word[$i] != $prev_word)\n\t\t\t\t{\n\t\t\t\t\t$temp_word[] = $word[$i];\n\t\t\t\t\t$word_text_sql .= (($word_text_sql != '') ? ', ' : '') . \"'\" . $word[$i] . \"'\";\n\t\t\t\t}\n\t\t\t\t$prev_word = $word[$i];\n\t\t\t}\n\t\t\t$word = $temp_word;\n\n\t\t\t$check_words = array();\n\n\t\t\t$value_sql = '';\n\t\t\t$match_word = array();\n\t\t\tfor ($i = 0; $i < sizeof($word); $i++)\n\t\t\t{\n\t\t\t\t$new_match = true;\n\t\t\t\tif (isset($check_words[$word[$i]]))\n\t\t\t\t{\n\t\t\t\t\t$new_match = false;\n\t\t\t\t}\n\n\t\t\t\tif ($new_match)\n\t\t\t\t{\n\t\t\t\t\t$value_sql .= (($value_sql != '') ? ', ' : '') . '(\\'' . $word[$i] . '\\', 0)';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($value_sql != '')\n\t\t\t{\n\t\t\t\t$sql = \"INSERT IGNORE INTO \" . $search_word_table . \" (word_text, word_common) VALUES $value_sql\";\n\t\t\t\t$db->sql_query($sql);\n\t\t\t}\n\t\t}\n\n\t\twhile(list($word_in, $match_sql) = @each($word_insert_sql))\n\t\t{\n\t\t\t$title_match = ($word_in == 'title') ? 1 : 0;\n\n\t\t\tif ($match_sql != '')\n\t\t\t{\n\t\t\t\t$sql = \"INSERT INTO \" . $search_match_table . \" ($db_key, word_id, title_match)\n\t\t\t\t\tSELECT $post_id, word_id, $title_match\n\t\t\t\t\t\tFROM \" . $search_word_table . \"\n\t\t\t\t\t\tWHERE word_text IN ($match_sql)\";\n\t\t\t\t$db->sql_query($sql);\n\t\t\t}\n\t\t}\n\n\t\tif ($mode == 'single')\n\t\t{\n\t\t\t// remove_common('single', 4/10, $word);\n\t\t}\n\n\t\treturn;\n\t}", "public function create(array $data) {\r\n return $this->word->create($data);\r\n }", "private function installWords()\n {\n $data = file(__DIR__ . '/../bad_words_pl.txt');\n\n $bom = pack('H*', 'EFBBBF');\n\n $rows = [];\n foreach ($data as $row) {\n $rows[] = [trim(preg_replace(\"/^$bom/\", '', $row))];\n }\n\n Yii::$app\n ->db\n ->createCommand()\n ->batchInsert($this->table, ['word'], $rows)\n ->execute();\n }", "public function run()\n {\n factory(Models\\Name::class, 50)->create()->each(function ($name) {\n $name->aliases()->save(\n factory(Models\\Alias::class)->make()\n );\n\n $name->links()->createMany(\n factory(Models\\Link::class, mt_rand(1,6))->make()->toArray()\n ); \n });\n }", "function create_taxonomy_vocabulary ( array $settings ) {\n $description = t ( $settings[ 'description' ] );\n\n if ( ! isset( $settings[ 'help' ] ) )\n $help = \"\";\n\n $vocabulary = (object) array (\n 'name' => t ( $settings[ 'name' ] ) ,\n 'description' => $description ,\n 'machine_name' => $settings[ 'machine_name' ] ,\n 'help' => $help ,\n 'nodes' => $settings[ 'nodes' ] ,\n 'multiple' => $settings[ 'multiple' ] ,\n 'required' => $settings[ 'required' ] ,\n );\n\n return taxonomy_vocabulary_save ( $vocabulary );\n}", "protected function createWordStatistics() {\n\t\tif ($this->commandLineOptions->hasOption(tx_mnogosearch_clioptions::SPELLSTATS)) {\n\t\t\t$this->showProgressMessage('Going to create word statistics.');\n\t\t\t$this->indexer->createWordStatistics();\n\t\t}\n\t}", "public function __construct( ) {\n $ts = sql_query( \"SELECT word, synonym FROM xlsimport_synonymes WHERE type='type'\" );\n $as = sql_query( \"SELECT word, synonym FROM xlsimport_synonymes WHERE type='access'\" );\n\n if( count( $ts ) == 0 && count( $as ) == 0 )\n $this->setupDefaultSynonymes();\n\n foreach( $ts as $i => $s ) {\n $this->typesynonymes[ $s['synonym'] ] = $s['word'];\n }\n foreach( $as as $i => $s ) {\n $this->accesssynonymes[ $s['synonym'] ] = $s['word'];\n }\n }", "private function create_frequency_table($words)\n {\n foreach($words as $key => $word) \n {\n $this->insert_word($word);\n }\n }", "public function run()\n {\n //\n DB::table('tcm_syndrome_alias_relations')->delete();\n\n for ($i=0; $i < 10; $i++) {\n for ($j = 0; $j < 10; $j++) {\n \\App\\TcmSyndromeAliasRelation::create([\n 'mtsar_id' => $i * 10 + $j + 1,\n 'mts_id' => $i + 1,\n 'mtsa_id' => $j + 1\n ]);\n }\n }\n }", "public function setSynonyms(array $synonyms): self\n {\n $this->synonyms = $synonyms;\n\n return $this;\n }", "public function createWordsForExam()\n {\n $words = $this->words()->get()->toArray();\n return $this->rearrangeWords($words);\n }", "function createIndex(&$files, &$word_map, $tokenizationMethod){\r\n /*TODO: How to free up memory of doc_vector object is the question!\r\n http://stackoverflow.com/questions/584960/whats-better-at-freeing-memory-\r\n with-php-unset-or-var-null\r\n */\r\n $doc_vector = null;\r\n for ($fil = 0;$fil<count($files);$fil++) {\r\n $content = file_get_contents($files[$fil]);\r\n $words = explode(\" \", $content);\r\n $count = count($words);\r\n for ($j=0;$j<$count;$j++) {\r\n\t\t\t\r\n\t\t\t$word = filter($words[$j]);\r\n\t\t\t$processedWord = tokenize(array($word), $tokenizationMethod);\t\r\n\t\t\t$offset = $j + 1;\r\n\t\t\t$f = $fil+1;\r\n\t\t\tfor ($index=0;$index<count($processedWord);$index++) {\t\r\n\t\t\t\tmapWord($word_map, $processedWord[$index], $offset, $f);\r\n\t\t\t}\r\n }\r\n }\r\n}", "public static function setMappings()\n {\n $command = static::getDb()->createCommand();\n foreach (static::$languages as $lang => $analyzer) {\n $index = static::index() . \"-$lang\";\n if (!$command->indexExists($index)) {\n $command->createIndex($index);\n $command->setMapping($index, static::type(), [\n static::type() => [\n 'properties' => [\n 'version' => ['type' => 'string', 'index' => 'not_analyzed'],\n 'language' => ['type' => 'string', 'index' => 'not_analyzed'],\n 'name' => ['type' => 'string', 'index' => 'not_analyzed'],\n 'type' => ['type' => 'string', 'index' => 'not_analyzed'],\n\n 'title' => [\n 'type' => 'string',\n // sub-fields added for language\n 'fields' => [\n 'stemmed' => [\n 'type' => 'string',\n 'analyzer' => $analyzer,\n ],\n ],\n ],\n 'body' => [\n 'type' => 'string',\n // sub-fields added for language\n 'fields' => [\n 'stemmed' => [\n 'type' => 'string',\n 'analyzer' => $analyzer,\n ],\n ],\n ],\n ]\n ]\n ]);\n $command->flushIndex(static::index());\n }\n }\n }", "function gwAddNewKeywords($id_dict, $id_term, $arKeywords, $termIdOld, $isClean, $date_created)\r\n{\r\n\tglobal $arFields, $intFields, $arStop, $sys;\r\n\tglobal $oDb, $oSqlQ;\r\n#\t@header(\"content-type: text/html; charset=utf-8\");\r\n\r\n\t// Adding search keywords\r\n\t$arKeywordsJoin = array();\r\n\tfor (reset($arKeywords); list($k, $v) = each($arKeywords);)\r\n\t{\r\n\t\t$arKeywordsJoin = array_merge($arKeywordsJoin, $v); // common array with all keywords\r\n\t}\r\n\t// unique keywords only, have to run second time\r\n\t$arKeywordsJoin = array_flip($arKeywordsJoin);\r\n\r\n\t$arQuery = array();\r\n\t$arSql = array();\r\n\tif (!empty($arKeywordsJoin))\r\n\t{\r\n\t\t$word_text_sql = \"'\" . implode(\"', '\", array_keys($arKeywordsJoin)) . \"'\";\r\n\t\t/* Get the list of already known keywords and their IDs */\r\n\t\t$arSql = $oDb->sqlExec($oSqlQ->getQ('get-word', TBL_WORDLIST, $word_text_sql));\r\n\t}\r\n# prn_r($arSql);\r\n\t$q2 = $q1 = array();\r\n\tif (!empty($arSql)) // some keywords are exist already\r\n\t{\r\n\t\t$cnt = 0;\r\n\t\t// for each founded keyword\r\n\t\tfor (; list($arK, $arV) = each($arSql);)\r\n\t\t{\r\n\t\t\tif ($isClean) // overwrite mode\r\n\t\t\t{\r\n\t\t\t\t$arQuery[0] = $oSqlQ->getQ('del-wordmap-by-term-dict', $termIdOld, $id_dict);\r\n\t\t\t}\r\n\t\t\t$q2['word_id'] = $arV['word_id'];\r\n\t\t\t$q2['term_id'] = $id_term;\r\n\t\t\t$q2['dict_id'] = $id_dict;\r\n\t\t\t$q2['date_created'] = $date_created;\r\n\t\t\t// Set Field ID\r\n\t\t\tfor (reset($arFields); list($id_field, $fV) = each($arFields);)\r\n\t\t\t{\r\n\t\t\t\tif (isset($arKeywords[$id_field]) && in_array($arV['word_text'], $arKeywords[$id_field]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$q2['term_match'] = $id_field;\r\n\t\t\t\t\t$arQueryMapExist[] = gw_sql_insert($q2, TBL_WORDMAP, 1, $cnt);\r\n\t\t\t\t\tunset($arKeywordsJoin[$arV['word_text']]); // remove existent keyword\r\n\t\t\t\t\t$cnt++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t//\r\n\t// Add new kewords\r\n# prn_r($arKeywordsJoin);\r\n# prn_r($arKeywords);\r\n\t//\r\n\t$q2 = $q1 = array();\r\n\t$q1['word_id'] = $q2['word_id'] = ($oDb->MaxId(TBL_WORDLIST, 'word_id') - 1);\r\n\t$cnt = $cntMap = 0;\r\n\t// for each new keyword\r\n\tfor (reset($arKeywordsJoin); list($newkeyword, $v2) = each($arKeywordsJoin);)\r\n\t{\r\n\t\t$q2['word_id']++;\r\n\t\t$q2['dict_id'] = $id_dict;\r\n\t\t$q2['term_id'] = $id_term;\r\n\t\t$q2['date_created'] = $date_created;\r\n\t\t$q1['word_id']++;\r\n\t\t$q1['word_text'] = '';\r\n\t\t//\r\n\t\t// Set index ID per field\r\n\t\tfor (reset($arFields); list($id_field, $fV) = each($arFields);)\r\n\t\t{\r\n\t\t\tif (isset($arKeywords[$id_field]) && in_array($newkeyword, $arKeywords[$id_field]))\r\n\t\t\t{\r\n\t\t\t\t$q2['term_match'] = $id_field;\r\n\t\t\t\t$q1['word_text'] = $newkeyword;\r\n\t\t\t\t// add keyword into map\r\n\t\t\t\t$arQueryMap[] = gw_sql_insert($q2, TBL_WORDMAP, 1, $cntMap);\r\n\t\t\t\tunset($arKeywordsJoin[$newkeyword]); // remove new keyword\r\n\t\t\t\t$cntMap++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// add new word into wordlist\r\n\t\tif ($q1['word_text'] != '')\r\n\t\t{\r\n\t\t\t$arQueryWord[] = gw_sql_insert($q1, TBL_WORDLIST, 1, $cnt);\r\n\t\t\t$cnt++;\r\n\t\t}\r\n\t}\r\n\t/* Queries for existent keywords */\r\n\tif (isset($arQueryMapExist)) { $arQuery[] = implode('', $arQueryMapExist); }\r\n\t/* Queries for new keywords */\r\n\tif (isset($arQueryWord)) { $arQuery[] = implode('', $arQueryWord); }\r\n\t/* Queries for new keywords map */\r\n\tif (isset($arQueryMap)) { $arQuery[] = implode('', $arQueryMap); }\r\n\t/* Displays queries */\r\n\tif ($sys['isDebugQ'])\r\n\t{\r\n\t\t$arQuery = gw_highlight_sql($arQuery);\r\n\t\tprint '<ul class=\"gwsql\"><li>'.implode(';</li><li>', $arQuery).';</li></ul>';\r\n\t}\r\n\telse\r\n\t{\r\n\t\tfor (; list($kq, $vq) = each($arQuery);)\r\n\t\t{\r\n\t\t\tif (!$oDb->sqlExec($vq))\r\n\t\t\t{\r\n\t\t\t\tprint '<li class=\"xt\">Error: cannot exec query: '.$arQuery[$i].';</li>';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "public function run()\n {\n for ($i=1; $i < 3; $i++) { \n \tStudentword::create([\n \t\t'words'=>'Lorem '.$i.' ipsum dolor sit amet, consectetur adipisicing elit. Molestias fugiat earum voluptatum explicabo illum doloremque debitis, tenetur officia odit unde!'\n \t])->user()->associate(1)->save();\n }\n for ($i=1; $i < 3; $i++) { \n \tStudentword::create([\n \t\t'words'=>'Lorem '.$i.' ipsum dolor sit amet, consectetur adipisicing elit. Molestias fugiat earum voluptatum explicabo illum doloremque debitis, tenetur officia odit unde!'\n \t])->user()->associate(2)->save();\n }\n for ($i=1; $i < 3; $i++) { \n \tStudentword::create([\n \t\t'words'=>'Lorem '.$i.' ipsum dolor sit amet, consectetur adipisicing elit. Molestias fugiat earum voluptatum explicabo illum doloremque debitis, tenetur officia odit unde!'\n \t])->user()->associate(3)->save();\n }\n }", "public function synonyms()\n {\n return $this->hasMany('App\\Synonym');\n }", "function synonymiser ($word){\n\n $the_version = \"2\";\n $the_api_key = \"940dc4e7f0012570aad56d02d4d9cb9d\";\n $the_format = \"json\";\n $thesaurus_url = \"http://words.bighugelabs.com/api/\".$the_version.\"/\".$the_api_key.\"/\".$word.\"/\".$the_format;\n\n $ch = curl_init($thesaurus_url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n $response = curl_exec($ch);\n curl_close($ch);\n\n $wordlist = json_decode($response, TRUE);\n\n #var_dump($wordlist);\n\n $noun = $wordlist[\"noun\"];\n $adjective = $wordlist[\"adjective\"];\n $verb = $wordlist[\"verb\"];\n\n if (is_array($noun)){\n #echo \"Noun:\".$noun;\n $wordsyns = $noun[\"syn\"];\n } elseif (is_array($adjective)) {\n $wordsyns = $adjective[\"syn\"];\n } elseif (is_array($verb)) {\n $wordsyns = $verb[\"syn\"];\n }\n\n #echo \"Noun Syns:\".$nounsyns;\n\n return $wordsyns;\n\n}", "function rootsBySynonyms($concept, $mysql_conn) {\n\t// Get language meta information from DB\n\t$meta = getMetaInformation($mysql_conn);\n\t\n\t// Get word entry from database\n\t$sql = \"SELECT * FROM synie WHERE `concept`='\" . mysql_real_escape_string($concept) . \"'\";\n\t$results = mysql_query($sql, $mysql_conn);\n\tif(!$results) die(err(\"invalid query -- \".mysql_error()));\n\t$row = mysql_fetch_assoc($results);\n\t\n\t// Storage arrays\n\t$words = array();\n\t$used_roots = array();\n\t$root_clumps = array();\n\t$edges = array();\n\t$core_nodes = array();\n\t$extra_nodes = array();\n\t\n\tforeach($meta as $lang=>$arr) {\n\t\t// Iterate through languages and build up $core_nodes and $extra_nodes\n\t\t$rootcode = $arr['rootcode'];\n\t\t$node_data = $arr['nodedata'];\n\t\t$pieroots = clean_parts(explode(\";\", $row[$rootcode]));\n\t\t$signs = clean_parts(explode(\";\", $row[$lang]));\n\t\t$groups = array();\n\t\t$roots = array();\n\t\t\n\t\tif(count($pieroots)!=count($signs)) {\n\t\t\t// Verify that $pieroots and $signs are of same length\n\t\t\t// Append blank strings to the shorter array until they are parallel.\n\t\t\twhile(count($pieroots)<count($signs)) {\n\t\t\t\t$pieroots[] = \"\";\n\t\t\t}\n\t\t\twhile(count($signs)<count($pieroots)) {\n\t\t\t\t$signs[] = \"\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach($pieroots as $index=>$pieroot) {\n\t\t\t// Determine cognate group for each pieroot\n\t\t\t$group = array_search($pieroot, $used_roots);\n\t\t\t$root_clump = array();\n\t\t\tif($group===false) {\n\t\t\t\t$used_roots[] = $pieroot;\n\t\t\t\t$group = count($used_roots)-1;\n\t\t\t\t$splitroot = clean_parts(explode(\",\", $pieroot));\n\t\t\t\tforeach($splitroot as $j=>$root) {\n\t\t\t\t\t$sql = \"SELECT `root`,`origin`,`meaning`,`attested` FROM synie_roots WHERE `root`='\". mysql_real_escape_string($root) .\"'\";\n\t\t\t\t\t$results = mysql_query($sql, $mysql_conn) or die(err(\"can't find root definition\"));\n\t\t\t\t\t$res = mysql_fetch_assoc($results);\n\t\t\t\t\t$root_clump[] = array('root' => $res['root'],\n\t\t\t\t\t\t\t\t\t\t 'origin' => $res['origin'],\n\t\t\t\t\t\t\t\t\t\t 'meaning' => $res['meaning'],\n\t\t\t\t\t\t\t\t\t\t 'attested'=> (!strcmp($res['attested'], \"1\")));\n\t\t\t\t}\n\t\t\t\t$root_clumps[] = $root_clump;\n\t\t\t}\n\t\t\t$roots[] = $root_clumps[$group];\n\t\t\t$groups[] = $group;\n\t\t}\n\t\t\n\t\t// Create new core word\n\t\t$new_core_word = array('concept' => $concept,\n\t\t\t\t\t\t\t 'sign' => $signs[0],\n\t\t\t\t\t\t\t 'PIEroot' => $roots[0],\n\t\t\t\t\t\t\t 'group' => $groups[0]);\n\t\t$new_core_node = $node_data;\n\t\t$new_core_node['data'] = $new_core_word;\n\t\t$core_nodes[] = $new_core_node;\n\t\t\n\t\t// Put the remainder of the words in extra_words array\n\t\t\n\t\tfor($i=1; $i<count($signs); $i++) {\n\t\t\t$new_extra_node = $node_data;\n\t\t\t$new_extra_word = array('concept' => $concept,\n\t\t\t\t\t\t\t\t\t'sign'\t => $signs[$i],\n\t\t\t\t\t\t\t\t\t'PIEroot' => $roots[$i],\n\t\t\t\t\t\t\t\t\t'group' => $groups[$i]);\n\t\t\t$new_extra_node['data'] = $new_extra_word;\n\t\t\t$extra_nodes[] = $new_extra_node;\n\t\t\t$core_index = count($core_nodes)-1;\n\t\t\t$extra_index = count($extra_nodes)-1;\n\t\t\t$extra_nodes[$extra_index]['data'] = $new_extra_word;\n\t\t\t$edges[] = array('source' => $core_index, 'to_delta' => $extra_index);\n\t\t}\n\t}\n\t\n\tfor($i=0; $i<count($edges); $i++) {\n\t\t// Calculate absolute position of target in edges\n\t\t$edges[$i]['target'] = count($core_nodes) + $edges[$i]['to_delta'];\n\t\tunset($edges[$i]['to_delta']);\n\t\t$edges[$i]['value'] = 1; # default value -- any semantic possibility for edge weights?\n\t}\n\t\n\t\n\t// Create final object\n\t$meta_data = array('groups' => count($used_roots));\n\t$json_data = array('nodes' => array_merge($core_nodes, $extra_nodes),\n\t\t\t\t\t 'edges' => $edges,\n\t\t\t\t\t 'meta' => $meta_data);\n\t\n\treturn $json_data;\t\n}", "public function run()\n {\n $data = [\n 'APPLE','BANANA','CAR','COMPUTER','MOUNTAIN','BUFFALO','SKY','SEA','CHAIR','TIGER','GRAPES','DOOR','BIKE','SHOES','ELECTRIC','COUNTRY','INDONESIA','NEPAL','INDIA',\n 'SENEGAL','KAMERUN','CHINA','RUSSIA','ITALIA','GERMANY','RONALDO','MESSI','JAKARTA','BANDUNG','TOKYO','REMOTE','WOOD','STONE','ICE','TURTLE','CROCODILE','IGUANA','GOOGLE','MICROSOFT','AMAZON','PINEAPPLE','BLACKPINK','TABLE','SCISSOR','KNIFE','UMBRELLA','FIRE','AMBULANCE','STATION','AIRPLANE','HELICOPTER','JETSKY','TITANIC'\n ];\n\n foreach($data as $word) :\n Question::create([\n 'word' => $word\n ]);\n endforeach;\n }", "public function run()\n {\n\n $faker = Faker::create();\n\n for($i=0;$i<rand(10,20); $i++){\n DB::table('vocabulary')->insert([\n 'word' => $faker->words(1)[0],\n ]);\n }\n\n\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n $websites = Website::all();\n\n foreach($websites as $website) {\n \t$website->meta()->create([\n \t\t\t'name' => 'domain',\n \t\t\t'label' => 'Domain',\n \t\t\t'value' => $faker->domainName\n \t]);\n }\n }", "public function run()\n {\n $amount = 13;\n\n PlaceKeyword::truncate();\n\n $faker = \\Faker\\Factory::create();\n $places = Place::all()->pluck('id')->toArray();\n $keywords = Keyword::all()->pluck('id')->toArray();\n\n for ($i = 0; $i < $amount; $i++) {\n PlaceKeyword::create([\n 'place_id' => $faker->randomElement($places),\n 'keyword_id' => $faker->randomElement($keywords),\n ]);\n }\n echo $amount . \" Keywords attached to places created!\\r\\n\";\n }", "function rawlins_register_post_types() {\n\t$rawlins_magic_post_type_maker_array = array(\n\t\t/*array(\n\t\t\t'cpt_single' => 'Resource',\n\t\t\t'cpt_plural' => 'Resources',\n\t\t\t'slug' => 'resource',\n\t\t\t'cpt_icon' => 'dashicons-index-card',\n\t\t\t'exclude_from_search' => false,\n\t\t),*/\n\n\t);\n\n\tforeach( $rawlins_magic_post_type_maker_array as $post_type ){\n\t\t$cpt_single = $post_type['cpt_single'];\n\t\t$cpt_plural = $post_type['cpt_plural'];\n\t\t$slug = $post_type['slug'];\n\t\t$cpt_icon = $post_type['cpt_icon'];\n\t\t$exclude_from_search = $post_type['exclude_from_search'];\n\n\t\t// Admin Labels\n\t \t$labels = rawlins_generate_label_array($cpt_plural, $cpt_single);\n\n\t \t// Arguments\n\t\t$args = rawlins_generate_post_type_args($labels, $cpt_plural, $cpt_icon, $exclude_from_search);\n\n\t\t// Just do it\n\t\tregister_post_type( $slug, $args );\n\t}\n\n}", "protected function _syncKeywords() {}", "public function run()\n {\n $tags = collect([\n 'Horor',\n 'Romance',\n 'Drama',\n 'Tale Story',\n 'Urban Legend',\n 'Dream',\n 'Magic',\n ]);\n\n $tags->each(function($tag){\n Tag::Create([\n 'name' => $tag,\n 'slug' => Str::slug($tag),\n ]);\n });\n }", "public function run()\n {\n $tags = collect(['science', 'sport', 'games', 'porn', 'memes']);\n $tags->each(function ($tagName) {\n Tag::create(['name' => $tagName]);\n });\n }", "public function get_synonim ($tag){\n//administration, disposal\n// => management, direction';\n// $matches1 = array ();\n// preg_match_all (\"/\\s+(.+)\\s+=>/\",\n// $raw_synonims1, $matches1, PREG_PATTERN_ORDER);\n// var_dump($raw_synonims1);\n// var_dump($matches1);\n//\n// $raw_synonims1 = 'Sense 1\n//Kennedy, Jack Kennedy, John Fitzgerald Kennedy, JFK, President Kennedy, President John F. Kennedy\n// INSTANCE OF=> President of the United States, United States President, President, Chief Executive';\n// $matches1 = array ();\n// preg_match_all (\"/\\s+(.+)\\s+=>/\",\n// $raw_synonims1, $matches1, PREG_PATTERN_ORDER);\n// var_dump($raw_synonims1);\n// var_dump($matches1);\n// exit();\n\n\n // cmd commend\n $wn_command = '\"C:/Program Files (x86)/WordNet/2.1/bin/wn\" \"'.$tag.'\" \"-synsn\"';\n $raw_synonims = shell_exec ($wn_command);\n\n // if the word exist\n if (! $raw_synonims) {\n return null;\n }\n\n // get the result of cmmend\n $matches = array ();\n preg_match_all (\"/\\s+(.+)\\s+.+?=>/\",\n $raw_synonims, $matches, PREG_PATTERN_ORDER);\n// var_dump($raw_synonims);\n\n // if no matched result\n if(!isset($matches[1][0])){\n return null;\n }\n\n// dd($matches);\n // get all accepted words\n $expanded_query = array();\n\n foreach ($matches[1] as $match){\n $match = explode (\", \", $match);\n foreach ($match as $word){\n array_push($expanded_query, strtolower($word));\n }\n }\n\n // remove repeated element\n $expanded_query = array_unique($expanded_query);\n\n // return the word\n return $expanded_query;\n }", "public function run()\n {\n $words = \"Lorem ipsum, dolor sit amet, consectetur adipisicing, elit Fugiat dolore, excepturi harum, fugit, quis placeat, ab Non maiores, Vel natus consequuntur, harum accusantium, numquam, architecto, facilis ut officia, perspiciatis, dignissimos\";\n $arr = explode(\", \", $words);\n for($i = 0; $i < 10; $i++){\n $word = $arr[array_rand($arr)];\n $img = \"brands_\".mt_rand(1, 5).\".jpg\";\n Brand::create([\n \"name\" => \"Brand \".$i,\n \"slug\" => $word.mt_rand(0, 1000),\n \"image\" => $img,\n \"description\" => $words,\n ]);\n } \n }" ]
[ "0.5523451", "0.55126363", "0.5271727", "0.52458906", "0.5199532", "0.51870954", "0.514924", "0.5133435", "0.51286817", "0.51063347", "0.5079454", "0.5042114", "0.50062186", "0.4952692", "0.4950291", "0.49444425", "0.4944216", "0.4938639", "0.49260098", "0.49111423", "0.4883244", "0.4877267", "0.48569724", "0.4848199", "0.48470116", "0.48276097", "0.481679", "0.4800336", "0.47932467", "0.4792469" ]
0.57612234
0
Test channel link leads to route
public function testChannelLink() { $this->createUser(1); $this->createChannel(); $this->createEpisode(); $this->visit('/channels') ->seePageIs('/channels'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_can_fetch_link_from_shortlink()\n {\n $this->get(route('shortlink.fetch.link', ['code' => 'AbcXyz']))->assertStatus(200);\n }", "public function test_yourls_link() {\n $this->assertEquals( yourls_link('bonjour'), YOURLS_SITE . '/bonjour' );\n }", "public function testChannelsInvite()\n {\n }", "public function test_bycmid_route() {\n global $CFG;\n list(, , $talkpoint) = $this->_setup_single_user_in_single_talkpoint();\n\n // request the page\n $client = new Client($this->_app);\n $client->request('GET', '/cmid/' . $talkpoint->cmid);\n $url = $CFG->wwwroot . SLUG . $this->_app['url_generator']->generate('byinstanceid', array(\n 'id' => $talkpoint->id,\n ));\n $this->assertTrue($client->getResponse()->isRedirect($url));\n }", "public function testChannelsJoin()\n {\n }", "public function testEmailSharedLink()\n {\n }", "public function testChannelsReplies()\n {\n }", "public function testInvite()\n {\n $this->browse(function (Browser $first, Browser $second) {\n $first->loginAs($this->user_1)\n ->visit('/employees')\n ->press('Получить ссылку приглашения');\n\n $link = $first->text('#link');\n\n $second->loginAs($this->user_2)\n ->visit('/teams')\n ->assertDontSee($this->team->name)\n ->visit($link)\n ->assertSee($this->team->name);\n });\n }", "public function testGetSharedLinkRendition()\n {\n }", "public function getChannelsRoute(): string;", "public function testGetSharedLinkRenditionContent()\n {\n }", "public function testGetRouteLink() {\n $link = $this->getMock('Route\\RouteLink');\n $link->test = 1;\n $name = new Route\\RouteName('url-name', $link);\n $this->assertEquals($link, $name->GetRouteLink());\n }", "public function testChannelsHistory()\n {\n }", "public function test_bycmid_route_1() {\n $this->_test_bycmid_route($this->_walls[1]->cmid, $this->_walls[1]->id);\n }", "public function test_yourls_statlink() {\n $this->assertEquals( yourls_statlink('hello'), YOURLS_SITE . '/hello+' );\n }", "public function testGetUrl() {\n $link = $this->getMock('Route\\RouteLink');\n $link->test = 1;\n $name = new Route\\RouteName('url-name', $link);\n $this->assertEquals('url-name', $name->GetUrl());\n }", "public function testListSharedLinks()\n {\n }", "public function test_display_shortlink_if_link_exists()\n {\n $formData = [\n 'link' => 'http://testdomain.com',\n ];\n\n $this->post(route('shortlink.create'), $formData)->assertStatus(200);\n }", "public function testChannelsInfo()\n {\n }", "public function test_links_parse(): void\n {\n $request = GroupRequest::ofUserName(self::DEFAULT_GROUP_DEEPLINK);\n $this->resolve($request, function (?int $groupId, ?int $accessHash) {\n $count = 0;\n $handler = function (?MessageModel $message = null) use (&$count) {\n if ($message) {\n $this->assertEquals('qweq', $message->getText());\n $count++;\n }\n };\n $client = new LinkParseScenario(\n new GroupId($groupId, $accessHash),\n $this->clientGenerator,\n new OptionalDateRange(),\n $handler,\n self::USERNAME\n );\n $client->setTimeout(self::TIMEOUT);\n $client->startActions();\n $this->assertEquals(1, $count);\n });\n }", "public function test_bycmid_route_2() {\n $this->_test_bycmid_route($this->_walls[2]->cmid, $this->_walls[2]->id);\n }", "public function test_user_can_see_login_link()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->assertSeeLink('LOGIN');\n });\n }", "public function testGetSharedLink()\n {\n }", "function callSample(): void\n{\n $name = '[NAME]';\n\n get_channel_partner_link_sample($name);\n}", "public function testEditFulfillmentChannel()\n {\n }", "public function testListSharedLinkRenditions()\n {\n }", "public function test1() \n {\n /*$url = \"https://integralads.com/careers/\";\n $html = file_get_contents($url);\n\n $link_text = [\"w Opening\", \"View All Openings\", \"View Jobs\", \"Openings\", \"Jobs\", \"Careers\"];\n $link = \"\";\n $text_string = \"\";\n\n foreach($link_text as $text) {\n \n $text_string = $text;\n $link = $rh->getLinkFromText($html, $text);\n if (!empty($link)) break;\n\n }\n \n print $text_string.\"<br>\";\n print $link;\n */\n //$rh->QACareerPage(625);\n // $rh->convertRobotCompanyToRoleSentryCompany(625);\n //print env('CLOUDAMQP_PORT');\n //dd(config('app.env'));\n // print $_ENV[\"CLOUDAMQP_HOST\"];\n print config(\"app.cloudampq_host\");\n print config(\"app.cloudampq_user\");\n print config(\"app.cloudampq_pw\");\n print config(\"app.cloudampq_port\");\n\n\n }", "public function testGetSharedLinkContent()\n {\n }", "public function test_yourls_link_IDN() {\n yourls_add_filter( 'get_yourls_site', function() {return 'http://xn--hh-bjab.com';} );\n $this->assertEquals( yourls_link('suicidal'), 'http://héhé.com/suicidal' );\n $this->assertEquals( yourls_statlink('angels'), 'http://héhé.com/angels+' );\n }", "public function test_bycmid_route_0() {\n $this->_test_bycmid_route($this->_walls[0]->cmid, $this->_walls[0]->id);\n }" ]
[ "0.65084064", "0.6497101", "0.6287377", "0.61032283", "0.60939246", "0.60430145", "0.6042514", "0.6008629", "0.6000013", "0.5961881", "0.58939767", "0.5892732", "0.58736193", "0.5837392", "0.5821259", "0.58124286", "0.580831", "0.57709587", "0.5756718", "0.5727109", "0.57192487", "0.5717431", "0.571243", "0.5704754", "0.5696666", "0.56944394", "0.56849784", "0.56839025", "0.56642777", "0.56409705" ]
0.78059185
0
Test user channnel relationship
public function testUserChannelRelationship() { $user = $this->createUser(1); $channel = $this->createChannel(); $this->assertEquals($channel->user_id, $channel->user->id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCardToUserRelation()\n {\n $card = factory('App\\Card')->create();\n\n $response = $this->actingAs($card->owner, 'api')\n ->withHeader('Accept', 'application/json')\n ->get(route('api.cards.index'));\n\n $response->assertJson([\n [\n 'id' => $card->id,\n 'name' => $card->name,\n 'balance' => $card->balance,\n 'currency' => $card->currency,\n 'user_id' => $card->owner->id,\n 'type' => $card->type,\n 'number' => $card->number\n ]\n ]);\n\n $response->assertStatus(200);\n }", "public function test_belongs_to_user()//pertenece a usuario\n {\n $repository = Repository::factory()->create();\n\n $this->assertInstanceOf(User::class, $repository->user);//cuando se accede al usuario es un instacia de repository?\n\n }", "public function testGetIdentityLinksForFamily()\n {\n }", "public function testGetAssociation()\n {\n $this->fixtures('users', 'articles');\n\n $user = User::find($this->users('derek')->id);\n $this->assertTrue($user->articles instanceof Mad_Model_Collection);\n $this->assertTrue($user->articles[0] instanceof Article);\n }", "public function testProfilePrototypeLinkCommunityRoles()\n {\n\n }", "public function testGetUnitRelationships()\n {\n }", "public function testRelationWithOwner()\n {\n $lot = FactoryMuff::create('Lot');\n $this->assertEquals($lot->owner_id, $lot->owners->id);\n }", "public function testGetSiteMembershipForPerson()\n {\n }", "public function testWPGetProfileOtherUserPatientRel()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/bucky-barnes\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n $this->assertEquals('success', $response->body->status);\r\n $this->assertEquals('Bucky Barnes', $response->body->data->user->name);\r\n $this->assertEquals(0, $response->body->data->user->isWellnessPro);\r\n\r\n $this->assertEquals(0, $response->body->data->relationships->isSupporter);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupportee);\r\n $this->assertEquals(1, $response->body->data->relationships->isWellnessProRel);\r\n }", "public function testCreateUnitRelationships()\n {\n }", "public function isBelongingTo(User $user)\r\n {\r\n return true;\r\n }", "public function isOwnedBy(UserInterface $user);", "public function testEpisodechannelRelationship()\n {\n $this->createUser(1);\n $this->createChannel();\n $episode = $this->createEpisode();\n\n $this->assertEquals($episode->channel_id, $episode->channel->id);\n }", "public function isAddToRelationship();", "public function testRoleUsers()\n {\n }", "public function testGetProfileOtherUserNoRel()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/steve-rogers\";\r\n\r\n $username = '[email protected]';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n $this->assertEquals('success', $response->body->status);\r\n $this->assertEquals('Steve Rogers', $response->body->data->user->name);\r\n $this->assertEquals(0, $response->body->data->relationships->isFriend);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupporter);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupportee);\r\n $this->assertEquals(0, $response->body->data->relationships->isWellnessProRel);\r\n }", "public function testAlbumBelongtoUser()\n {\n $this->assertInstanceOf(User::class, $this->album->user);\n }", "public function getParentRelationship()\n {\n return auth()->user()->testimonies();\n }", "public function canPopulateRelationTest()\n {\n $relationTest = new Relation(['test' => 'super']);\n\n $this->assertArrayHasKey('test', $relationTest->getData());\n }", "public function testMembersAndClientsCount()\n {\n $afiveone_id = $this->accounts->insert([\n 'subdomain' => 'afiveone',\n 'url' => 'https://afiveone.activecollab.com',\n 'license_key' => '123',\n ])[0];\n\n $this->assertEquals(1, $this->accounts->count());\n $this->assertEquals(1, $afiveone_id);\n\n list ($owner_id, $member_id, $subcontractor_id, $client1_id, $client2_id) = $this->users->insert(\n [ 'acid' => 1001, 'email' => '[email protected]', 'role' => 'Owner' ],\n [ 'acid' => 1002, 'email' => '[email protected]', 'role' => 'Member' ],\n [ 'acid' => 1003, 'email' => '[email protected]', 'role' => 'Subcontractor' ],\n [ 'acid' => 1004, 'email' => '[email protected]', 'role' => 'Client' ],\n [ 'acid' => 1005, 'email' => '[email protected]', 'role' => 'Client' ]\n );\n\n $this->assertEquals(1, $owner_id);\n $this->assertEquals(2, $member_id);\n $this->assertEquals(3, $subcontractor_id);\n $this->assertEquals(4, $client1_id);\n $this->assertEquals(5, $client2_id);\n\n $afiveone_users = $this->accounts->usersBelongingTo(1);\n\n $this->assertInstanceOf('ActiveCollab\\Resistance\\Storage\\Relationship\\BelongingTo', $afiveone_users);\n\n $this->assertEquals(0, $this->accounts->getFieldValue(1, 'members_count'));\n $this->assertEquals(0, $this->accounts->getFieldValue(1, 'clients_count'));\n\n // ---------------------------------------------------\n // Add members\n // ---------------------------------------------------\n\n $afiveone_users->add($owner_id, $member_id, $subcontractor_id);\n\n $this->assertEquals(3, $this->accounts->getFieldValue(1, 'members_count'));\n $this->assertEquals(0, $this->accounts->getFieldValue(1, 'clients_count'));\n\n // ---------------------------------------------------\n // Add clients\n // ---------------------------------------------------\n\n $afiveone_users->add($client1_id, $client2_id);\n\n $this->assertEquals(3, $this->accounts->getFieldValue(1, 'members_count'));\n $this->assertEquals(2, $this->accounts->getFieldValue(1, 'clients_count'));\n\n // ---------------------------------------------------\n // Remove one member and one client\n // ---------------------------------------------------\n\n $afiveone_users->remove($subcontractor_id);\n $afiveone_users->remove($client1_id);\n\n $this->assertEquals(2, $this->accounts->getFieldValue(1, 'members_count'));\n $this->assertEquals(1, $this->accounts->getFieldValue(1, 'clients_count'));\n\n // ---------------------------------------------------\n // Clear\n // ---------------------------------------------------\n\n $afiveone_users->clear();\n\n $this->assertEquals(0, $this->accounts->getFieldValue(1, 'members_count'));\n $this->assertEquals(0, $this->accounts->getFieldValue(1, 'clients_count'));\n }", "public function testListSiteMembershipsForPerson()\n {\n }", "public function testCreateChannel()\n {\n $user = factory(App\\User::class)->create();\n\n $channel = factory(App\\Channel::class)->create(\n ['user_id' => $user->id]\n );\n\n $channel->user()->associate($user);\n\n $this->assertTrue($channel->save());\n }", "abstract protected function connected($user);", "abstract protected function connected($user);", "public function testProfilePrototypeLinkOwnedGroups()\n {\n\n }", "public function testGetSiteMembershipRequestForPerson()\n {\n }", "public function setUp() {\n\t\tparent::setUp(); \n\t\t\n\t\t$this->hasOne('UserAccount as user',\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'local' => 'userid',\n\t\t\t\t\t\t\t'foreign' => 'id'\n\t\t\t\t\t\t)\n\t\t);\n\t\t$this->hasOne('UserAccount as addedby',\n\t\t\t\tarray(\n\t\t\t\t\t\t'local' => 'addedbyid',\n\t\t\t\t\t\t'foreign' => 'id'\n\t\t\t\t)\n\t\t);\n\t\t$this->hasOne('Shift as session',\n\t\t\t\tarray(\n\t\t\t\t\t\t'local' => 'sessionid',\n\t\t\t\t\t\t'foreign' => 'id'\n\t\t\t\t)\n\t\t);\n\t}", "public function setUp() {\n\t\t// A book\n\t\t$this->hasOne('Blipoteka_Book as book', array('local' => 'book_id', 'foreign' => 'book_id', 'onDelete' => 'CASCADE', 'onUpdate' => 'CASCADE'));\n\t\t// User who borrows a book\n\t\t$this->hasOne('Blipoteka_User as borrower', array('local' => 'borrower_id', 'foreign' => 'user_id', 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'));\n\t\t// User who lends a book\n\t\t$this->hasOne('Blipoteka_User as lender', array('local' => 'lender_id', 'foreign' => 'user_id', 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE'));\n\t}", "public function testHasAccess()\n {\n $user = new User(null, null, null, \"admin\");\n\n $this->assertTrue($user->is(User::STUDENT));\n $this->assertTrue($user->isStudent());\n\n $this->assertFalse($user->is(User::LECTURER));\n $this->assertFalse($user->isLecturer());\n\n $this->assertFalse($user->is(User::ADMIN));\n $this->assertFalse($user->isAdmin());\n\n $user->setVerified(true);\n\n $this->assertTrue($user->is(User::STUDENT));\n $this->assertTrue($user->isStudent());\n\n $this->assertTrue($user->is(User::LECTURER));\n $this->assertTrue($user->isLecturer());\n\n $this->assertTrue($user->is(User::ADMIN));\n $this->assertTrue($user->isLecturer());\n }", "public function test_course_relation()\n {\n $lession = new Lession();\n $relation = $lession->course();\n\n $this->assertInstanceOf(BelongsTo::class, $relation);\n $this->assertEquals('course_id', $relation->getForeignKeyName());\n $this->assertEquals('id', $relation->getOwnerKeyName());\n }" ]
[ "0.619815", "0.598721", "0.59070164", "0.59033644", "0.58914375", "0.58518094", "0.5804582", "0.5802631", "0.57935274", "0.5756727", "0.5733876", "0.5721465", "0.571348", "0.56963766", "0.5691173", "0.566787", "0.5661049", "0.56514287", "0.5648974", "0.5632167", "0.56148624", "0.56132615", "0.5610947", "0.5610947", "0.5604851", "0.5597377", "0.55946714", "0.5591842", "0.5588402", "0.55780536" ]
0.73628664
0
Test Episode Channel relationship
public function testEpisodechannelRelationship() { $this->createUser(1); $this->createChannel(); $episode = $this->createEpisode(); $this->assertEquals($episode->channel_id, $episode->channel->id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testChannelLink()\n {\n $this->createUser(1);\n $this->createChannel();\n $this->createEpisode();\n\n $this->visit('/channels')\n ->seePageIs('/channels');\n }", "public function testCreateNewEpisode()\n {\n Channel::create([\n 'channel_name' => 'test',\n 'channel_description' => 'test',\n 'user_id' => 3,\n 'subscription_count' => 0\n ]);\n\n $this->seeInDatabase('channels', [\n 'channel_name' => 'test',\n 'channel_description' => 'test',\n 'user_id' => 3,\n 'subscription_count' => 0\n ]);\n }", "public function testUserChannelRelationship()\n {\n $user = $this->createUser(1);\n $channel = $this->createChannel();\n\n $this->assertEquals($channel->user_id, $channel->user->id);\n }", "public function testCreateChannel()\n {\n $user = factory(App\\User::class)->create();\n\n $channel = factory(App\\Channel::class)->create(\n ['user_id' => $user->id]\n );\n\n $channel->user()->associate($user);\n\n $this->assertTrue($channel->save());\n }", "public function testChannelsHistory()\n {\n }", "public function testSearchForWatchedEpisodes()\n {\n $watchedEpisodes = $this->season->getWatchedEpisodes();\n $this->assertCount(2, $watchedEpisodes);\n\n foreach($watchedEpisodes as $episode) {\n $this->assertTrue($episode->watched);\n }\n }", "public function testChannelsReplies()\n {\n }", "public function testChannelsInfo()\n {\n }", "public function testChannelsCreate()\n {\n }", "public function channel()\n {\n return $this->belongsTo('App\\Channel');\n }", "public function channel()\n {\n return $this->belongsTo('App\\Models\\Channel');\n }", "public function channel()\n {\n return $this->belongsTo(\"App\\Channel\");\n }", "public function channel()\n {\n return $this->belongsTo(Channel::class);\n }", "public function channel(){\n\n return $this->belongsTo('App\\Channel');\n }", "public function testChannelsList()\n {\n }", "public function test_a_channel_consists_of_threads()\n {\n $channel=create('App\\Channel');\n $thread=create('App\\Thread',['channel_id' => $channel->id]);\n\n //dd($channel->threads,$thread);\n $this->assertTrue($channel->threads->contains($thread));\n // $reply= factory('App\\Reply')->create();\n\n // $this->assertInstanceOf('App\\User',$reply->owner);\n }", "public function testChannelsInvite()\n {\n }", "function testChannelVisibility() {\n $administrator = Users::findById(1);\n\n $web_interface_channel = new WebInterfaceNotificationChannel();\n $email_channel = new EmailNotificationChannel();\n\n $new_comment_notification = new NewCommentNotification();\n\n $this->assertTrue($new_comment_notification->isThisNotificationVisibleInChannel($web_interface_channel, $administrator));\n $this->assertTrue($new_comment_notification->isThisNotificationVisibleInChannel($email_channel, $administrator));\n\n $forgot_password_notification = new ForgotPasswordNotification();\n\n $this->assertFalse($forgot_password_notification->isThisNotificationVisibleInChannel($web_interface_channel, $administrator));\n $this->assertTrue($forgot_password_notification->isThisNotificationVisibleInChannel($email_channel, $administrator));\n }", "function testSeriesEpisode(): void\n {\n // https://www.imdb.com/title/tt0708758/\n\n // get German version.\n Global $config;\n $config['http_header_accept_language'] = 'de-DE,en;q=0.9';\n\n $id = '0708758';\n $data = engineGetData($id, 'imdb', false);\n\n $this->assertNotEmpty($data);\n // $this->printData($data);\n\n $this->assertEquals(1, $data['istv']);\n $this->assertEquals('0092455', $data['tvseries_id']);\n $this->assertEquals('Raumschiff Enterprise: Das nächste Jahrhundert', $data['title']);\n $this->assertEquals('Q Who', $data['subtitle']);\n $this->assertEquals('1989', $data['year']);\n $this->assertMatchesRegularExpression('#https://m.media-amazon.com/images/M/.+?.jpg#', $data['coverurl']);\n $this->assertEquals('Rob Bowman', $data['director']);\n $this->assertTrue($data['rating'] >= 8);\n $this->assertTrue($data['rating'] <= 9);\n $this->assertEquals('Vereinigte Staaten', $data['country']);\n $this->assertEquals('englisch', $data['language']);\n $this->assertEquals('Action, Abenteuer, Science-Fiction', join(', ', $data['genres']));\n\n $cast = explode(\"\\n\", $data['cast']);\n\n $this->assertTrue(in_array('Patrick Stewart::Captain Jean-Luc Picard::imdb:nm0001772', $cast));\n $this->assertTrue(in_array(\"Jonathan Frakes::Commander William Thomas 'Will' Riker::imdb:nm0000408\", $cast));\n $this->assertTrue(in_array('Marina Sirtis::Counselor Deanna Troi::imdb:nm0000642', $cast));\n $this->assertTrue(in_array('John de Lancie::Q (as John deLancie)::imdb:nm0209496', $cast));\n $this->assertTrue(in_array('Rob Bowman::Borg (voice) (uncredited)::imdb:nm0101385', $cast));\n\n $this->assertTrue(sizeof($cast) > 15);\n $this->assertTrue(sizeof($cast) < 30);\n\n $this->assertEquals(46, $data['runtime']);\n\n $this->assertMatchesRegularExpression('/Q bewirbt sich als Crewmitglied, wird aber von Picard abgewiesen./', $data['plot']);\n }", "public function testChannelsArchive()\n {\n }", "public function testIfEpisodeSetupCorrectly()\n {\n $xmlData = '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n <Episode>\n <id>332179</id>\n <DVD_chapter>2</DVD_chapter>\n <DVD_discid>1</DVD_discid>\n <DVD_episodenumber>2</DVD_episodenumber>\n <DVD_season>3</DVD_season>\n <Director>|Joseph McGinty Nichol|</Director>\n <EpisodeName>Chuck Versus the World</EpisodeName>\n <EpisodeNumber>1</EpisodeNumber>\n <FirstAired>2007-09-24</FirstAired>\n <GuestStars>|Julia Ling|Vik Sahay|Mieko Hillman|</GuestStars>\n <IMDB_ID>123</IMDB_ID>\n <Language>English</Language>\n <Overview>Chuck Bartowski is an average computer geek...</Overview>\n <ProductionCode>12</ProductionCode>\n <Rating>9.0</Rating>\n <RatingCount>10</RatingCount>\n <SeasonNumber>1</SeasonNumber>\n <Writer>|Josh Schwartz|Chris Fedak|</Writer>\n <absolute_number>1</absolute_number>\n <airsafter_season>1</airsafter_season>\n <airsbefore_episode>2</airsbefore_episode>\n <airsbefore_season>3</airsbefore_season>\n <filename>episodes/80348-332179.jpg</filename>\n <lastupdated>1201292806</lastupdated>\n <seasonid>27985</seasonid>\n <seriesid>80348</seriesid>\n </Episode>';\n\n $data = XmlParser::getXml($xmlData);\n\n $this->episode = new Episode($data);\n\n $this->assertEquals(332179, $this->episode->getId());\n $this->assertEquals(2, $this->episode->getDvdChapter());\n $this->assertEquals(2, $this->episode->getDvdEpisodeNumber());\n $this->assertEquals(3, $this->episode->getDvdSeason());\n $this->assertEquals(1, $this->episode->getDvdDiscId());\n $this->assertEquals(array('Joseph McGinty Nichol'), $this->episode->getDirectors());\n $this->assertEquals('Chuck Versus the World', $this->episode->getName());\n $this->assertEquals(1, $this->episode->getNumber());\n $this->assertEquals(new DateTime('2007-09-24'), $this->episode->getFirstAired());\n $this->assertEquals(array('Julia Ling','Mieko Hillman','Vik Sahay'), $this->episode->getGuestStars());\n $this->assertEquals(123, $this->episode->getImdbId());\n $this->assertEquals('English', $this->episode->getLanguage());\n $this->assertEquals('Chuck Bartowski is an average computer geek...', $this->episode->getOverview());\n $this->assertEquals(12, $this->episode->getProductionCode());\n $this->assertEquals('9.0', $this->episode->getRating());\n $this->assertEquals('10', $this->episode->getRatingCount());\n $this->assertEquals(1, $this->episode->getSeason());\n $this->assertEquals(array('Chris Fedak','Josh Schwartz'), $this->episode->getWriters());\n $this->assertEquals(1, $this->episode->getAbsoluteNumber());\n $this->assertEquals(1, $this->episode->getAirsAfterSeason());\n $this->assertEquals(2, $this->episode->getAirsBeforeEpisode());\n $this->assertEquals(3, $this->episode->getAirsBeforeSeason());\n $this->assertEquals('episodes/80348-332179.jpg', $this->episode->getThumbnail());\n $this->assertEquals(27985, $this->episode->getSeasonId());\n $this->assertEquals(80348, $this->episode->getSerieId());\n $this->assertEquals(\\DateTime::createFromFormat('U',1201292806), $this->episode->getLastUpdated());\n }", "public function testCreateChannelRepositoryObject() {\n $data = array('id'=> 1, 'name' => 'some_name');\n $obj = $this->_service->create('Channel', $data);\n $this->assertEquals($data, $obj->getData());\n }", "public function testChannelsJoin()\n {\n }", "public function test_a_user_can_filter_threads_according_to_a_channel()\n {\n $channel = factory('App\\Models\\Channel')->create();\n $threadInChannel = factory('App\\Models\\Thread')->create(['channel_id' => $channel->id]);\n $threadNotInChannel = factory('App\\Models\\Thread')->create();\n $this->get('/threads/'.$channel->slug)\n ->assertSee($threadInChannel->title)\n ->assertDontSee($threadNotInChannel->title);\n\n $this->assertTrue(true);\n }", "function testSeriesEpisode2(): void\n {\n // https://www.imdb.com/title/tt0359476\n\n // get English version.\n Global $config;\n $config['http_header_accept_language'] = 'en-US,en;q=0.9';\n\n $id = '0359476';\n $data = engineGetData($id, 'imdb', false);\n\n $this->assertNotEmpty($data);\n // $this->printData($data);\n\n $this->assertEquals(1, $data['istv']);\n $this->assertEquals('0988820', $data['tvseries_id']);\n $this->assertEquals('The Inspector Lynley Mysteries', $data['title']);\n $this->assertEquals('Playing for the Ashes', $data['subtitle']);\n $this->assertMatchesRegularExpression('/200\\d/', $data['year']);\n $this->assertMatchesRegularExpression('#https://m.media-amazon.com/images/M/.+?.jpg#', $data['coverurl']);\n $this->assertEquals('Richard Spence', $data['director']);\n $this->assertTrue($data['rating'] >= 5);\n $this->assertTrue($data['rating'] <= 8);\n $this->assertEquals('United Kingdom', $data['country']);\n $this->assertEquals('english', $data['language']);\n $this->assertEquals( 'Crime, Drama, Mystery', join(', ', $data['genres']));\n\n $cast = explode(\"\\n\", $data['cast']);\n\n $this->assertTrue(in_array('Clare Swinburne::Gabriella Patten::imdb:nm0842673', $cast));\n $this->assertTrue(in_array('Mark Anthony Brighton::Kenneth Waring (as Mark Brighton)::imdb:nm1347940', $cast));\n $this->assertTrue(in_array('Nathaniel Parker::Thomas Lynley::imdb:nm0662511', $cast));\n $this->assertTrue(in_array('Andrew Clover::Hugh Patten::imdb:nm0167249', $cast));\n $this->assertTrue(in_array('Anjalee Patel::Hadiyyah::imdb:nm1347125', $cast));\n $this->assertTrue(sizeof($cast) > 12);\n $this->assertTrue(sizeof($cast) < 30);\n\n $this->assertMatchesRegularExpression('/Lynley seeks the help of profiler Helen Clyde when he investigates the asphyxiation death of superstar cricketer with a dysfunctional personal life./', $data['plot']);\n }", "public function testChannelsKick()\n {\n }", "public function episodeCategoriesDisplayed(AcceptanceTester $I)\n {\n $I->wantTo('Verify Episode Categories is displayed on the Edit Episode page. - C15624');\n if(EpisodeEditCest::$environment == 'staging')\n {\n $guid = TestContentGuids::$episodeViewData_staging;\n }\n else //proto0\n {\n $guid = TestContentGuids::$episodeViewData_proto0;\n }\n $I->amOnPage(ContentPage::$contentUrl . $guid);\n\n $I->expect('Episode Categories displayed.');\n $I->waitForText('Portal & Content Testing', 30, ContentPage::$channelRow);\n $I->seeElement(ContentPage::$categoriesRow);\n $I->see('Action/Comedy', \"//span[contains(@class, 'tags-tagname')]\");\n }", "public function testChannelsMark()\n {\n }", "public function publishEpisode(AcceptanceTester $I)\n {\n $I->wantTo('Verify we can publish a episode. - C22274');\n if(EpisodeEditCest::$environment == 'staging')\n {\n $guid = TestContentGuids::$episodeEditData_staging;\n }\n else //proto0\n {\n $guid = TestContentGuids::$episodeEditData_proto0;\n }\n $I->amOnPage(ContentPage::$contentUrl . $guid);\n\n $I->expect('Episode is unpublished.');\n $I->waitForText('Media is currently hidden from all users.', 30);\n\n $I->amGoingTo('Publish the episode.');\n $I->click(ContentPage::$publishCheckbox);\n $I->waitForText('Users who match window settings can view and/or watch content as defined.', 30);\n $I->click('Save Changes');\n $I->wait(2);\n\n $I->amGoingTo('Reload the page.');\n $I->amOnPage(ContentPage::$contentUrl . $guid);\n\n $I->expect('Episode is still published.');\n $I->waitForText('Users who match window settings can view and/or watch content as defined.', 30);\n $I->seeElement(ContentPage::$publishCheckboxChecked);\n }", "public function channels()\n {\n return $this->belongsToMany('App\\Channel');\n }" ]
[ "0.7187579", "0.7142238", "0.6308638", "0.617252", "0.60988855", "0.60966086", "0.59683007", "0.5890005", "0.58379644", "0.5789139", "0.5784989", "0.5756073", "0.5755152", "0.5723444", "0.57038856", "0.56978106", "0.5693414", "0.55632377", "0.5558219", "0.55242616", "0.54760486", "0.5466753", "0.54581016", "0.53763264", "0.5370277", "0.53602225", "0.53325164", "0.53237283", "0.52926207", "0.5287869" ]
0.8547012
0
Test that an episode is created.
public function testCreateNewEpisode() { Channel::create([ 'channel_name' => 'test', 'channel_description' => 'test', 'user_id' => 3, 'subscription_count' => 0 ]); $this->seeInDatabase('channels', [ 'channel_name' => 'test', 'channel_description' => 'test', 'user_id' => 3, 'subscription_count' => 0 ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testIfEpisodeSetupCorrectly()\n {\n $xmlData = '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n <Episode>\n <id>332179</id>\n <DVD_chapter>2</DVD_chapter>\n <DVD_discid>1</DVD_discid>\n <DVD_episodenumber>2</DVD_episodenumber>\n <DVD_season>3</DVD_season>\n <Director>|Joseph McGinty Nichol|</Director>\n <EpisodeName>Chuck Versus the World</EpisodeName>\n <EpisodeNumber>1</EpisodeNumber>\n <FirstAired>2007-09-24</FirstAired>\n <GuestStars>|Julia Ling|Vik Sahay|Mieko Hillman|</GuestStars>\n <IMDB_ID>123</IMDB_ID>\n <Language>English</Language>\n <Overview>Chuck Bartowski is an average computer geek...</Overview>\n <ProductionCode>12</ProductionCode>\n <Rating>9.0</Rating>\n <RatingCount>10</RatingCount>\n <SeasonNumber>1</SeasonNumber>\n <Writer>|Josh Schwartz|Chris Fedak|</Writer>\n <absolute_number>1</absolute_number>\n <airsafter_season>1</airsafter_season>\n <airsbefore_episode>2</airsbefore_episode>\n <airsbefore_season>3</airsbefore_season>\n <filename>episodes/80348-332179.jpg</filename>\n <lastupdated>1201292806</lastupdated>\n <seasonid>27985</seasonid>\n <seriesid>80348</seriesid>\n </Episode>';\n\n $data = XmlParser::getXml($xmlData);\n\n $this->episode = new Episode($data);\n\n $this->assertEquals(332179, $this->episode->getId());\n $this->assertEquals(2, $this->episode->getDvdChapter());\n $this->assertEquals(2, $this->episode->getDvdEpisodeNumber());\n $this->assertEquals(3, $this->episode->getDvdSeason());\n $this->assertEquals(1, $this->episode->getDvdDiscId());\n $this->assertEquals(array('Joseph McGinty Nichol'), $this->episode->getDirectors());\n $this->assertEquals('Chuck Versus the World', $this->episode->getName());\n $this->assertEquals(1, $this->episode->getNumber());\n $this->assertEquals(new DateTime('2007-09-24'), $this->episode->getFirstAired());\n $this->assertEquals(array('Julia Ling','Mieko Hillman','Vik Sahay'), $this->episode->getGuestStars());\n $this->assertEquals(123, $this->episode->getImdbId());\n $this->assertEquals('English', $this->episode->getLanguage());\n $this->assertEquals('Chuck Bartowski is an average computer geek...', $this->episode->getOverview());\n $this->assertEquals(12, $this->episode->getProductionCode());\n $this->assertEquals('9.0', $this->episode->getRating());\n $this->assertEquals('10', $this->episode->getRatingCount());\n $this->assertEquals(1, $this->episode->getSeason());\n $this->assertEquals(array('Chris Fedak','Josh Schwartz'), $this->episode->getWriters());\n $this->assertEquals(1, $this->episode->getAbsoluteNumber());\n $this->assertEquals(1, $this->episode->getAirsAfterSeason());\n $this->assertEquals(2, $this->episode->getAirsBeforeEpisode());\n $this->assertEquals(3, $this->episode->getAirsBeforeSeason());\n $this->assertEquals('episodes/80348-332179.jpg', $this->episode->getThumbnail());\n $this->assertEquals(27985, $this->episode->getSeasonId());\n $this->assertEquals(80348, $this->episode->getSerieId());\n $this->assertEquals(\\DateTime::createFromFormat('U',1201292806), $this->episode->getLastUpdated());\n }", "public function publishEpisode(AcceptanceTester $I)\n {\n $I->wantTo('Verify we can publish a episode. - C22274');\n if(EpisodeEditCest::$environment == 'staging')\n {\n $guid = TestContentGuids::$episodeEditData_staging;\n }\n else //proto0\n {\n $guid = TestContentGuids::$episodeEditData_proto0;\n }\n $I->amOnPage(ContentPage::$contentUrl . $guid);\n\n $I->expect('Episode is unpublished.');\n $I->waitForText('Media is currently hidden from all users.', 30);\n\n $I->amGoingTo('Publish the episode.');\n $I->click(ContentPage::$publishCheckbox);\n $I->waitForText('Users who match window settings can view and/or watch content as defined.', 30);\n $I->click('Save Changes');\n $I->wait(2);\n\n $I->amGoingTo('Reload the page.');\n $I->amOnPage(ContentPage::$contentUrl . $guid);\n\n $I->expect('Episode is still published.');\n $I->waitForText('Users who match window settings can view and/or watch content as defined.', 30);\n $I->seeElement(ContentPage::$publishCheckboxChecked);\n }", "public function testEventCreate()\n {\n $response = $this->get('events/create');\n\n $response->assertStatus(200);\n }", "public function testEpisodechannelRelationship()\n {\n $this->createUser(1);\n $this->createChannel();\n $episode = $this->createEpisode();\n\n $this->assertEquals($episode->channel_id, $episode->channel->id);\n }", "function testSeriesEpisode(): void\n {\n // https://www.imdb.com/title/tt0708758/\n\n // get German version.\n Global $config;\n $config['http_header_accept_language'] = 'de-DE,en;q=0.9';\n\n $id = '0708758';\n $data = engineGetData($id, 'imdb', false);\n\n $this->assertNotEmpty($data);\n // $this->printData($data);\n\n $this->assertEquals(1, $data['istv']);\n $this->assertEquals('0092455', $data['tvseries_id']);\n $this->assertEquals('Raumschiff Enterprise: Das nächste Jahrhundert', $data['title']);\n $this->assertEquals('Q Who', $data['subtitle']);\n $this->assertEquals('1989', $data['year']);\n $this->assertMatchesRegularExpression('#https://m.media-amazon.com/images/M/.+?.jpg#', $data['coverurl']);\n $this->assertEquals('Rob Bowman', $data['director']);\n $this->assertTrue($data['rating'] >= 8);\n $this->assertTrue($data['rating'] <= 9);\n $this->assertEquals('Vereinigte Staaten', $data['country']);\n $this->assertEquals('englisch', $data['language']);\n $this->assertEquals('Action, Abenteuer, Science-Fiction', join(', ', $data['genres']));\n\n $cast = explode(\"\\n\", $data['cast']);\n\n $this->assertTrue(in_array('Patrick Stewart::Captain Jean-Luc Picard::imdb:nm0001772', $cast));\n $this->assertTrue(in_array(\"Jonathan Frakes::Commander William Thomas 'Will' Riker::imdb:nm0000408\", $cast));\n $this->assertTrue(in_array('Marina Sirtis::Counselor Deanna Troi::imdb:nm0000642', $cast));\n $this->assertTrue(in_array('John de Lancie::Q (as John deLancie)::imdb:nm0209496', $cast));\n $this->assertTrue(in_array('Rob Bowman::Borg (voice) (uncredited)::imdb:nm0101385', $cast));\n\n $this->assertTrue(sizeof($cast) > 15);\n $this->assertTrue(sizeof($cast) < 30);\n\n $this->assertEquals(46, $data['runtime']);\n\n $this->assertMatchesRegularExpression('/Q bewirbt sich als Crewmitglied, wird aber von Picard abgewiesen./', $data['plot']);\n }", "public function testCreate()\n {\n \t$game_factory = factory(Game::class)->create();\n\n $this->assertTrue($game_factory->wasRecentlyCreated);\n }", "function testSeries3Episode(): void\n {\n Global $config;\n $config['http_header_accept_language'] = 'en-US,en;q=0.9';\n\n // Bis in die Spitzen: Folge #1.1\n // https://imdb.com/title/tt0872606/\n $id = '0872606';\n $data = engineGetData($id, 'imdb', false);\n\n $this->assertNotEmpty($data);\n // $this->printData($data);\n\n $this->assertEquals(1, $data['istv']);\n $this->assertNotContains('plot', $data);\n $this->assertEquals('45', $data['runtime']);\n $this->assertNotContains('rating', $data);\n $this->assertEquals('Bis in die Spitzen', $data['title']);\n $this->assertEquals('Episode #1.1', $data['subtitle']);\n }", "public function user_can_create_event()\n {\n $user = User::factory()->create();\n $event = Event::factory()->make()->toArray();\n $response = $this->actingAs($user)->post('/events', $event);\n $response->assertStatus(302);\n $this->assertNotNull(Event::where('name', $event['name'])->first());\n }", "public function testSearchForWatchedEpisodes()\n {\n $watchedEpisodes = $this->season->getWatchedEpisodes();\n $this->assertCount(2, $watchedEpisodes);\n\n foreach($watchedEpisodes as $episode) {\n $this->assertTrue($episode->watched);\n }\n }", "public function user_can_visit_create_event_page()\n {\n $response = $this->get('/events/create');\n $response->assertStatus(200);\n $response->assertSeeText('Name');\n }", "function testSeriesEpisode3(): void {\n // https://www.imdb.com/title/tt1039379/\n\n $id = '1039379';\n $data = engineGetData($id, 'imdb', false);\n\n $this->assertNotEmpty($data);\n // $this->printData($data);\n\n // was not detected as tv episode\n $this->assertEquals(1, $data['istv']);\n\n $this->assertEquals(42, $data['runtime']);\n }", "public function episodeTitleDisplayed(AcceptanceTester $I)\n {\n $I->wantTo('Verify Episode Title is displayed on the Edit Episode page. - C15622');\n if(EpisodeEditCest::$environment == 'staging')\n {\n $guid = TestContentGuids::$episodeViewData_staging;\n }\n else //proto0\n {\n $guid = TestContentGuids::$episodeViewData_proto0;\n }\n $I->amOnPage(ContentPage::$contentUrl . $guid);\n\n $I->expect('Episode Title is displayed.');\n $I->waitForText('Portal & Content Testing', 30, ContentPage::$channelRow);\n $I->seeInField(ContentPage::$episodeTitleRow_editable, 'Episode View Filled Data For Automation');\n }", "public function testWebinarCreate()\n {\n }", "public function testIfEpisodeSetWhenMissingTags()\n {\n $xmlData = '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n <Episode>\n <id>332179</id>\n <Director>|Joseph McGinty Nichol|</Director>\n <EpisodeName>Chuck Versus the World</EpisodeName>\n <EpisodeNumber>1</EpisodeNumber>\n </Episode>';\n\n $data = new SimpleXMLElement($xmlData);\n\n $this->episode = new Episode($data);\n\n $this->assertEquals(332179, $this->episode->getId());\n $this->assertEquals(null, $this->episode->getDvdChapter());\n $this->assertEquals(null, $this->episode->getDvdEpisodeNumber());\n $this->assertEquals(null, $this->episode->getDvdSeason());\n $this->assertEquals(null, $this->episode->getDvdDiscId());\n $this->assertEquals(array('Joseph McGinty Nichol'), $this->episode->getDirectors());\n $this->assertEquals('Chuck Versus the World', $this->episode->getName());\n $this->assertEquals(1, $this->episode->getNumber());\n $this->assertEquals(null, $this->episode->getFirstAired());\n $this->assertEquals(array(), $this->episode->getGuestStars());\n $this->assertEquals('', $this->episode->getImdbId());\n $this->assertEquals('', $this->episode->getLanguage());\n $this->assertEquals('', $this->episode->getOverview());\n $this->assertEquals(null, $this->episode->getProductionCode());\n $this->assertEquals('', $this->episode->getRating());\n $this->assertEquals(0, $this->episode->getRatingCount());\n $this->assertEquals(0, $this->episode->getSeason());\n $this->assertEquals(array(), $this->episode->getWriters());\n $this->assertEquals(null, $this->episode->getAbsoluteNumber());\n $this->assertEquals(null, $this->episode->getAirsAfterSeason());\n $this->assertEquals(null, $this->episode->getAirsBeforeEpisode());\n $this->assertEquals(null, $this->episode->getAirsBeforeSeason());\n $this->assertEquals('', $this->episode->getThumbnail());\n $this->assertEquals(null, $this->episode->getSeasonId());\n $this->assertEquals(null, $this->episode->getSerieId());\n $this->assertEquals(\\DateTime::createFromFormat('U', 0), $this->episode->getLastUpdated());\n }", "public function test_create_item() {}", "public function test_create_item() {}", "function testSeriesEpisode2(): void\n {\n // https://www.imdb.com/title/tt0359476\n\n // get English version.\n Global $config;\n $config['http_header_accept_language'] = 'en-US,en;q=0.9';\n\n $id = '0359476';\n $data = engineGetData($id, 'imdb', false);\n\n $this->assertNotEmpty($data);\n // $this->printData($data);\n\n $this->assertEquals(1, $data['istv']);\n $this->assertEquals('0988820', $data['tvseries_id']);\n $this->assertEquals('The Inspector Lynley Mysteries', $data['title']);\n $this->assertEquals('Playing for the Ashes', $data['subtitle']);\n $this->assertMatchesRegularExpression('/200\\d/', $data['year']);\n $this->assertMatchesRegularExpression('#https://m.media-amazon.com/images/M/.+?.jpg#', $data['coverurl']);\n $this->assertEquals('Richard Spence', $data['director']);\n $this->assertTrue($data['rating'] >= 5);\n $this->assertTrue($data['rating'] <= 8);\n $this->assertEquals('United Kingdom', $data['country']);\n $this->assertEquals('english', $data['language']);\n $this->assertEquals( 'Crime, Drama, Mystery', join(', ', $data['genres']));\n\n $cast = explode(\"\\n\", $data['cast']);\n\n $this->assertTrue(in_array('Clare Swinburne::Gabriella Patten::imdb:nm0842673', $cast));\n $this->assertTrue(in_array('Mark Anthony Brighton::Kenneth Waring (as Mark Brighton)::imdb:nm1347940', $cast));\n $this->assertTrue(in_array('Nathaniel Parker::Thomas Lynley::imdb:nm0662511', $cast));\n $this->assertTrue(in_array('Andrew Clover::Hugh Patten::imdb:nm0167249', $cast));\n $this->assertTrue(in_array('Anjalee Patel::Hadiyyah::imdb:nm1347125', $cast));\n $this->assertTrue(sizeof($cast) > 12);\n $this->assertTrue(sizeof($cast) < 30);\n\n $this->assertMatchesRegularExpression('/Lynley seeks the help of profiler Helen Clyde when he investigates the asphyxiation death of superstar cricketer with a dysfunctional personal life./', $data['plot']);\n }", "public function episodeTitleEdit(AcceptanceTester $I)\n {\n $I->wantTo('Verify Episode Title can be edited. - C15633');\n if(EpisodeEditCest::$environment == 'staging')\n {\n $guid = TestContentGuids::$episodeEditData_staging;\n }\n else //proto0\n {\n $guid = TestContentGuids::$episodeEditData_proto0;\n }\n $I->amOnPage(ContentPage::$contentUrl . $guid);\n\n $I->amGoingTo('Edit Episode Title');\n $I->waitForText('Portal & Content Testing', 30, ContentPage::$channelRow);\n $I->fillField(ContentPage::$episodeTitleRow_editable, 'Testing All Episode');\n $I->click('Save Changes');\n $I->wait(2);\n\n $I->amGoingTo('Reload the page.');\n $I->amOnPage(ContentPage::$contentUrl . $guid);\n\n $I->expect('Changes are saved.');\n $I->waitForElementVisible(ContentPage::$attributesSection, 30);\n $I->waitForText('Portal & Content Testing', 30, ContentPage::$channelRow);\n $I->seeInField(ContentPage::$episodeTitleRow_editable, 'Testing All Episode');\n\n $I->amGoingTo('Change the title back.');\n $I->fillField(ContentPage::$episodeTitleRow_editable, 'The Episode Title');\n $I->click('Save Changes');\n $I->wait(2);\n\n $I->amGoingTo('Reload the page.');\n $I->amOnPage(ContentPage::$contentUrl . $guid);\n\n $I->expect('Changes are saved.');\n $I->waitForElementVisible(ContentPage::$attributesSection, 30);\n $I->waitForText('Portal & Content Testing', 30, ContentPage::$channelRow);\n $I->seeInField(ContentPage::$episodeTitleRow_editable, 'The Episode Title');\n }", "public function testAssessmentIsCreated()\n {\n $this->withoutExceptionHandling();\n $response = $this->post(route('assessments.store'), $this->getData());\n\n $response->assertStatus(200);\n\n $this->assertCount(1, Assessment::all());\n }", "public function testWebinarPollCreate()\n {\n }", "public function testStoreCreate()\n {\n $user = factory(User::class)->create(['id' => 1]);\n $postData = [\n 'slots' => ['10:00', '13:00', '16:00', '19:00']\n ];\n $this->actingAs($user)\n ->post(route('schedule.store'), $postData);\n $this->assertDatabaseHas('schedules', [\n 'user_id' => $user->id,\n 'date' => $tomorrow = Carbon::tomorrow()->format(config('app.date_format_db'))])\n ->assertDatabaseHas('slots', ['slot' => '10:00'])\n ->assertDatabaseHas('slots', ['slot' => '13:00'])\n ->assertDatabaseHas('slots', ['slot' => '16:00'])\n ->assertDatabaseHas('slots', ['slot' => '19:00']);\n }", "public function test_a_user_can_create_a_series()\n {\n $this->withoutExceptionHandling();\n Storage::fake('local');\n\n $this->loginAdmin(); \n\n $this->post('/admin/series',[\n 'title' => 'fake series',\n 'image' => UploadedFile::fake()->image('fake-series.png'),\n 'description' => 'fake series description',\n ])\n ->assertRedirect()\n ->assertSessionHas('success','Series created successfully');\n\n $this->assertTrue(Storage::exists(\"series/fake-series.png\"));\n\n $this->assertDatabaseHas('series',[\n 'slug' => 'fake-series'\n ]);\n }", "public function testCreate() \n\t{\n\t\t$spot=$this->createSpot(\"Too many characters in this message, haha it's gonna be hard to exceed it because I don't have a whole lot of things to type lol! Anyway I should probably go now\");\n\t\t$this->assertFalse($spot);\n\n\t\t$spot=$this->createSpot();\n\t\t$this->assertObjectHasAttribute('id', $spot, 'Spot not created properly');\n\t}", "public function testMeetingCreatePost()\n {\n $user = factory(App\\User::class)->create();\n }", "public function test_add_status_event()\n {\n $employer = Employer::factory()->create();\n $status = EmployerStatus::create([\n \"employer_id\" => $employer->id,\n \"online_at\" => $online_at = Carbon::now(),\n\n ]);\n $this->assertDatabaseHas(\"employer_statuses\", [\n \"employer_id\" => (string)$employer->id,\n \"online_at\" => $online_at,\n\n ]);\n }", "public function testCreate()\n {\n \t$player_factory = factory(KillingMode::class)->create();\n\n $this->assertTrue($player_factory->wasRecentlyCreated);\n }", "public function test_a_user_create_a_post()\n {\n // 1. Having\n $title = 'Esta es una pregunta';\n $content = 'Este es el contenido';\n\n $this->actingAs($this->defaultUser())\n\n// ->assertViewHas($title, 'title')\n// ->assertViewHas($content, 'content')\n // 2. When\n ->post(route('posts.create'))\n\n ->press('Publicar');\n\n // 3. Then\n// $this->assertDatabaseHas('posts',[\n// 'title' => $title,\n// 'content' => $content,\n// 'pending' => true,\n// ]);\n\n\n // Test a user is redirected to the posts details after creating it.\n// $this->assertViewHas($title);\n }", "public function testSeeCreatePostTest()\n {\n $response = $this->actingAs(\\App\\User::firstOrFail())->get('/posts/create');\n\n $response->assertStatus(200);\n $response->assertSeeText(config('app.name'));\n }", "public function testExample()\n {\n factory(Food::class)->create([\n 'name' => 'Burritos',\n 'qty' => 5,\n 'price' => 5,\n ]);\n\n $foods = Food::foods();\n $this->assertCount(1, $foods);\n\n $this->assertEquals([\n \"id\" => $foods[0]['id'],\n 'name' => 'Burritos',\n 'qty' => 5,\n 'price' => 5,\n ], $foods->toArray()[0]);\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance(['_getArgsForDefinition']);\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME,\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n }" ]
[ "0.69182163", "0.68267256", "0.67848974", "0.67398393", "0.6581709", "0.64415246", "0.6357774", "0.629409", "0.6281182", "0.62561905", "0.62518626", "0.6193256", "0.6179043", "0.6177542", "0.6161685", "0.6161685", "0.61294514", "0.6100502", "0.6078363", "0.6057176", "0.6040125", "0.60367876", "0.59806925", "0.59788394", "0.59525615", "0.5948658", "0.59461224", "0.5935438", "0.59287924", "0.5914046" ]
0.78416437
0
Check if the two given passwords match.
function checkIfPasswordsMatch($password1, $password2) { return $password1 == $password2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function passwordsMatch($pw1, $pw2) {\n if ($pw1 === $pw2)\n return true; \n else \n return false; \n }", "public function passwordsMatch($pw1, $pw2) {\n\t\tif ($pw1 == $pw2) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function validatePasswords($password1, $password2){\n if($password1 == $password2){\n return true;\n }\n else{\n return false;\n }\n }", "function valid_password($password1,$password2)\n{\n\t// if the comparison of the 2 strings (the passwords)\n\t// results in 0 difference\n\tif(strcmp($password1,$password2)==0)\n\t{\n\t\t// if the password has a length of at least 6 characters\n\t\tif(strlen($password1)>=6)\n\t\t{\n\t\t\t// then return true\n\t\t\treturn true;\n\t\t}\n\t\t// if length lower than 6\n\t\telse\n\t\t{\n\t\t\t// return false\n\t\t\treturn false;\n\t\t}\n\t}\n\t// if 2 passwords are different\n\telse\n\t{\n\t\t// return false\n\t\treturn false;\n\t}\n}", "function testPasswordsAreEqual($password, $password_one) {\n if (empty($password_one)) {\n $passwordErr = 'Password required';\n } elseif (strlen($password) > 0 && strlen($password_one) > 0 && $password == $password_one) {\n //QUERY FOR DATABASE CONNECTION HERE\n if (!filter_var($password, FILTER_VALIDATE_REGEXP, array(\"options\" => array(\"regexp\" => \"((?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{4,10})\")))) {\n //da 4 a 10 caratteri, deve contenere maiuscole, minuscole e numeri\n $passwordErr = \"Invalid Password format\";\n } else\n $passwordErr = \"*\";\n }else {\n $passwordErr = 'Passwords do not match!';\n }\n return $passwordErr;\n }", "function passwordMatch($wachtwoord, $wachtwoordbevestiging) {\n\tif ($wachtwoord !== $wachtwoordbevestiging) {\n\t\t$result = true;\n\t} else {\n\t\t$result = false;\n\t}\n\treturn $result;\n}", "function validate($firstpw, $secondpw) {\n\tif(strcmp($firstpw, $secondpw) == 0) {\n\t\t// Booleans to check password complexity - if true, then firstpw is ok\n\t\t$uppercase = preg_match('@[A-Z]@', $firstpw);\n\t\t$lowercase = preg_match('@[a-z]@', $firstpw);\n\t\t$number = preg_match('@[0-9]@', $firstpw);\n\t\tif($uppercase && $lowercase && $number && strlen($firstpw) > 8) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "private function check_If_The_Same_Passwords($pass1, $pass2){\r\n return ($pass1 != $pass2) ? true : false;\r\n }", "public function compare_passwords($pass1, $pass2)\r\n\t{\r\n\t\t//We use 3 equal signs, which means that both the value but also the \r\n\t\t//type is identical\r\n\t\tif ($pass1 === $pass2)\r\n\t\t{\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\treturn \"Passwords does not match\";\r\n\t}", "public function comparePassword() {\r\n if ($this->data[$this->name]['Password'] !== $this->data[$this->name]['RetypePass']) {\r\n return FALSE;\r\n } else {\r\n return TRUE;\r\n }\r\n }", "public function passwordEqual() {\n if($this->getPassword() == $this->getPasswordRepeat()) return TRUE;\n else return FALSE;\n }", "function pwdMatch($password, $passwordRepeat){\n $result = true;\n if ($password !== $passwordRepeat){\n $result = true;\n }\n else{\n $result = false;\n }\n return $result;\n}", "public function Password(string $first_password, string $second_password):bool\n {\n $bool = null;\n if(isset($first_password) && isset($second_password))\n {\n if ($first_password == $second_password) {\n $bool = true;\n } else {\n $bool = false;\n }\n }\n return $bool;\n }", "function pwdMatch($password, $pwdRepeat) {\n $result=true;\n if($password !== $pwdRepeat){\n $result =false;\n } else {\n $result = true;\n }\n return $result;\n}", "protected function comparePasswords($password1, $password2)\r\n {\r\n return hash_equals($password1, $password2);\r\n }", "function check_passwords($username, $password1, $password2)\n{\n\treturn $password1 = $password2 = Raven::_pwd($username); // This is how Raven does passwords\n}", "public function _pwdntmatch($input, $input2) {\n\t\tif($_POST[$input] != $_POST[$input2]) {\n\t\t\treturn true;\n\t\t}\n\t}", "public function validatePasswords()\n {\n $passwd = $this->_sanitized_data['password'];\n $passwd2 = $this->_sanitized_data['password2'];\n\n if ($passwd == '' || $passwd2 == '') {\n $this->_addErrorMessage(\"Missing passwords\");\n return false;\n }\n\n if ($passwd !== $passwd2) {\n $this->_addErrorMessage(\"The submitted passwords do not match\");\n return false;\n }\n\n if (strlen($passwd) < 5 && strlen($passwd2) < 5) {\n $this->_addErrorMessage(\"The submitted password must be at least 5 characters long\");\n return false;\n }\n\n return true;\n }", "public function checkPasswordsMatch($str, $str2) {\n\n\t\t//if ($str == $this->input->post('MJ_USER_PASSWORD'))\n\t\tif ($str == $str2)\n\t\t\treturn true;\n\t\telse {\n\t\t\t\t$this->form_validation->set_message('checkPasswordsMatch', 'Passwords do not match!'); \n\t\t\t\treturn false;\n\t\t\t}\n\t}", "public function verifyPassword (string $hash, string $password): bool;", "public function password_verifies() {\n\t\treturn AuthComponent::password($this->data[$this->alias]['old_password']) === $this->data[$this->alias]['password'];\n\t}", "public function testCheckPassword()\n {\n $hasher = new PasswordHash(8, true);\n\n $testHash = '$P$BbD1flG/hKEkXd/LLBY.dp3xuD02MQ/';\n $testCorrectPassword = 'test123456!@#';\n $testIncorrectPassword = 'test123456!#$';\n\n $this->assertTrue($hasher->CheckPassword($testCorrectPassword, $testHash));\n $this->assertFalse($hasher->CheckPassword($testIncorrectPassword, $testHash));\n }", "public function checkPass()\n {\n $pass = sha1($_POST['pass']);\n $pass2 = sha1($_POST['confirmation_pass']);\n if (!empty($_POST['pass']) &&\n !empty($_POST['confirmation_pass'])) {\n if ($pass == $pass2) {\n return true;\n } else {\n return $message = 'Vos mots de passes ne correspondent pas';\n }\n } else {\n return $message = 'Tous les champs ne sont pas complétés';\n }\n }", "public function comparePasswordHash($pwd, $hash);", "public function isPassword($password);", "public static function password($valueA, $valueB) {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$result = false;\n\t\t\t\n\t\t\t// Check Match\n\t\t\tif($valueA === $valueB) {\n\t\t\t\t// Valid Password?\n\t\t\t\t\n\t\t\t\t$result = true;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t}\n\t}", "public function passwordvs($password,$password2) {\n\t\n\t\n\t\n\t\treturn $password;\n\t\n\t}", "function comparePswd(&$formvars){\r\n\t\t$pswd1 = $formvars['UPswd'];\r\n\t\t$pswd2 = $formvars['ConPswd'];\r\n\t\t\r\n\t\tif($pswd1 !== $pswd2){\r\n\t\t\t$this->HandleError(\"Passwords do not match\");\r\n return false;\r\n\t\t}\r\n return true;\r\n\t}", "function confirmPassword($password, $confirmPassword){\n return $password == $confirmPassword;\n }", "function checkPassword($pwd, $pwd2, $X_langArray) {\n\tglobal $errorField;\n\n\t//le due password devono coincidere\n\tif ($pwd != $pwd2){\n\t\t$errorField .= \"&pwd2ErrMsg=\".urlencode($X_langArray['SETTING_PWD_REPET_ERROR']);\n\t}\n\telse{\n\t\t//password vuota\n\t\tif (!isset($pwd2) || $pwd2 == ''){\n\t\t\t$errorField .= \"&pwd2ErrMsg=\".urlencode($X_langArray['RECOVER_PWD_EMPTY_PWD_ERR']);\n\t\t}\n\t\telse{\n\t\t\t//la password deve contenere almeno una maiuscola, una minuscola ed un nuemro tra 7 e 21 caratteri)\n\t\t\tif (!preg_match('/(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])/', $pwd2) ) {\n\t\t\t\t$errorField .= \"&pwd2ErrMsg=\".urlencode($X_langArray['GEN_IS_NOT_PWD_REG']);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif (strlen($pwd2) < 6 || strlen($pwd2) > 20 ) {\n\t\t\t\t\t$errorField .= \"&pwd2ErrMsg=\".urlencode($X_langArray['OVERLAY_LOG_SIGN_PWD_LENGTH_ERR']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}" ]
[ "0.84097147", "0.813221", "0.8058318", "0.771545", "0.77089024", "0.7626296", "0.7620253", "0.7570164", "0.75353116", "0.74943864", "0.74825066", "0.74296194", "0.73639584", "0.73625475", "0.73066866", "0.73032904", "0.72073054", "0.71660393", "0.7160625", "0.71447635", "0.7111105", "0.7107105", "0.70627785", "0.7049851", "0.70197594", "0.7009795", "0.698643", "0.69544923", "0.69364446", "0.6924436" ]
0.8232039
1
Sets the reporter to use for reporting preogress.
public function setReporter( MessageReporter $reporter ) { $this->reporter = $reporter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set_reporter($reporter){\r\n\t\t\t$this->_reporter = $reporter;\r\n\t\t}", "function setParams(&$reporter) {\n\t\tif ($reporter->params['app']) {\n\t\t\t$this->appTest = true;\n\t\t}\n\n\t\tif ($reporter->params['group']) {\n\t\t\t$this->groupTest = true;\n\t\t}\n\n\t\tif ($reporter->params['plugin']) {\n\t\t\t$this->pluginTest = Inflector::underscore($reporter->params['plugin']);\n\t\t}\n\t}", "public function __construct($reporter){\r\n\t\t\t$this->_reporter = $reporter;\r\n\t\t}", "public function setUp() {\n\t\t$this->report = new Report();\n\t}", "public function get_reporter(){\r\n\t\t\treturn $this->_reporter;\r\n\t\t}", "function HtmlReporter($character_set = 'ISO-8859-1') {\n $this->SimpleReporter();\n $this->_character_set = $character_set;\n }", "public function setReporting() {\n if (DEVELOPMENT_ENVIRONMENT == true) {\n // Display all errors\n error_reporting(E_ALL);\n ini_set('display_errors','On');\n } else {\n error_reporting(E_ALL);\n // Dont display errors, log in tmp/logs/error.log\n ini_set('display_errors','Off');\n ini_set('log_errors', 'On');\n ini_set('error_log', ROOT.DS.'tmp'.DS.'logs'.DS.'error.log');\n }\n }", "private function _set_reporting() {\n //if set to true in config report and dispaly all errors else log erros in errors.log file\n if(DEBUG) {\n error_reporting(E_ALL);\n ini_set('display_errors', 1);\n } else {\n error_reporting(0);\n ini_set('display_errors', 0) ;\n ini_set('log_errors', 1);\n ini_set('error_log', ROOT . DS . 'tmp' . DS . 'logs' . DS . 'errors.log');\n }\n }", "function setReporting() {\r\n if (DEVELOPMENT_ENVIRONMENT == true) {\r\n error_reporting(E_ALL);\r\n ini_set('display_errors', 'On');\r\n } else {\r\n error_reporting(E_ALL);\r\n ini_set('display_errors', 'Off');\r\n ini_set('log_errors', 'On');\r\n ini_set('error_log', ROOT . DS . 'tmp' . DS . 'logs' . DS . 'error.log');\r\n }\r\n}", "function setup_pdf()\n\t{\t\t\n\t\t$this->SetDisplayMode('real');\n\t\t\n\t\t// set document information \n\t\t$this->SetCreator(PDF_CREATOR);\n\t\t$this->SetAuthor($this->report_author);\n\t\t$this->SetTitle($this->report_name);\n\t\t$this->SetSubject($this->report_name);\n\t}", "public function StartReport(){\n $this->AliasNbPages();\n $this->AddPage();\n $this->SetAutoPageBreak(true, 11);\n $this->SetTextColor(0);\n }", "function preprocess($type = NULL, $reporter){\n $pdf = SugarpdfFactory::loadSugarpdf($type, \"Reports\", $reporter, array());\n return $pdf;\n}", "protected function setPager( $pager ){\n \n $this->pager = $pager;\n \n }", "public function setReport($table) {\n $this->setSource($table);\n }", "function setReporting()\n{\n if (DEVELOPMENT_ENVIRONMENT == true)\n {\n error_reporting(E_ALL);\n ini_set('display_errors', 'On');\n } else\n {\n error_reporting(E_ALL);\n ini_set('display_errors', 'Off');\n ini_set('log_errors', 'On');\n ini_set('error_log', ROOT . DS . 'tmp' . DS . 'logs' . DS . 'error.log');\n }\n}", "function setReporting() \n{ \n if (DEVELOPMENT_ENVIRONMENT == true) \n {\n error_reporting(E_ALL);\n ini_set('display_errors', 'On');\n } \n else \n {\n error_reporting(E_ALL);\n ini_set('display_errors', 'Off');\n ini_set('log_errors', 'On');\n ini_set('error_log', ROOT . DS . 'tmp' . DS . 'logs' . DS . 'error.log');\n }\n}", "function init($testCaseFile, &$reporter) {\n\t\t$manager =& CodeCoverageManager::getInstance();\n\t\t$manager->reporter =& $reporter;\n\t\t$testCaseFile = str_replace(DS . DS, DS, $testCaseFile);\n\t\t$thisFile = str_replace('.php', '.test.php', basename(__FILE__));\n\n\t\tif (strpos($testCaseFile, $thisFile) !== false) {\n\t\t\ttrigger_error(__('Xdebug supports no parallel coverage analysis - so this is not possible.', true), E_USER_ERROR);\n\t\t}\n\t\t$manager->setParams($reporter);\n\t\t$manager->testCaseFile = $testCaseFile;\n\t}", "public function setReport(?DataValidationReport $report): void {\n\t\t$this->m_report = $report;\n\t}", "public function setReport(string $report): void\n {\n $this->report = $this->cleanReport($report);\n }", "public function setReport($val)\n {\n $this->_propDict[\"report\"] = $val;\n return $this;\n }", "protected function setUp(): void\n {\n $this->setReportingLevel(Environment::E_LEVEL_NONE);\n\n // clear previous logs\n $this->resetLogs();\n }", "function SeteoPdf(){\n\t\t$this->NameFile='../../docs/reportes/rpt'.rand(1000,1000000).'.pdf';\n\t\t\n\t\t/* Agrego las fuentes que voy a usar en el reporte */\n\t\t$this->addFont('bold', 'Arial', 'B', 8); // Esta fuente la uso para los títulos de los grupos\n\t\t$this->addFont('MyFont', 'Arial', '', 7); // Esta fuente la uso para los títulos de los grupos\n\n\t\t/* Seteo o configuro los campos que voy a usar en el reporte*/\n\t \t$this->SeteoCampos();\n\n\t\t/* Agrego los grupos que voy a tener */\n\t\t$this->CampoGrupo1='destino'; // Voy a tener el Grupo 1 agrupado por el campo dependencia\n\t \t\n\t\t/* Establezco mi área de impresión */\n\t\t/* Para A4 */ \n\t\t$this->setMaxWidth(297); // Por lo que ancho de A4 son 21cm=210mm\n\t\t$this->setMaxHeight(180); // Por lo que alto de A4 son 29.70=297mm . (La diferencia entre la altura real del papel y la altura de mi área de impresión, debe ser mínimo 30. Por ejm. 297-265=32)\n\t\t\t\t\t\t\t\t // Uso solo 265 porque considero mi area de impresión solo para el cuerpo del reporte, Sin considerar el Head y el footer\n\t \t\n\t\t// Establezco mi márgen izquierdo para que el cuerpo del reporte apareza centrado\n\t\t$this->SetLeftMargin((($this->maxWidth-$this->WidthTotalCampos)/2));\n\n\t\t// Modo de visualización. (real equivale a 100%)\n\t\t$this->SetDisplayMode('real');\n\n\t\t// Creo la primera página\n\t\t$this->Open(); \n\t\t$this->AddPage();\n\n\t}", "public function setPerProject($threshold)\n {\n $this->_perProject = $threshold;\n }", "function setProfiling(){\r\n\t\t$this->query(\"SET profiling=1\");\r\n\t}", "public function setup(string $preset, $offline): void\n {\n parent::setup($preset, $offline);\n $this->progress = new ProgressBar($this->handle, $this->count);\n }", "protected function setUp(): void\n {\n // store current error_reporting value as we may change it\n // in a test\n $this->currentErrorReporting = error_reporting();\n $this->statement = new Statement();\n }", "public function setSuite()\n {\n $this->_suite = true;\n }", "function SetUpDisplayGrps() {\n\t\tglobal $dealers_reports;\n\t\t$sWrk = @$_GET[EWRPT_TABLE_GROUP_PER_PAGE];\n\t\tif ($sWrk <> \"\") {\n\t\t\tif (is_numeric($sWrk)) {\n\t\t\t\t$this->DisplayGrps = intval($sWrk);\n\t\t\t} else {\n\t\t\t\tif (strtoupper($sWrk) == \"ALL\") { // display all groups\n\t\t\t\t\t$this->DisplayGrps = -1;\n\t\t\t\t} else {\n\t\t\t\t\t$this->DisplayGrps = 50; // Non-numeric, load default\n\t\t\t\t}\n\t\t\t}\n\t\t\t$dealers_reports->setGroupPerPage($this->DisplayGrps); // Save to session\n\n\t\t\t// Reset start position (reset command)\n\t\t\t$this->StartGrp = 1;\n\t\t\t$dealers_reports->setStartGroup($this->StartGrp);\n\t\t} else {\n\t\t\tif ($dealers_reports->getGroupPerPage() <> \"\") {\n\t\t\t\t$this->DisplayGrps = $dealers_reports->getGroupPerPage(); // Restore from session\n\t\t\t} else {\n\t\t\t\t$this->DisplayGrps = 50; // Load default\n\t\t\t}\n\t\t}\n\t}", "public function __construct(DevReport $report)\n {\n $this->report = $report;\n }", "public function setPaper($paper) {\n\t}" ]
[ "0.7231788", "0.6291427", "0.60899824", "0.561922", "0.5570766", "0.5534442", "0.547587", "0.52711284", "0.50681776", "0.50587636", "0.5058265", "0.49997848", "0.4982649", "0.49365157", "0.49280912", "0.48229352", "0.4781378", "0.4772383", "0.47707665", "0.46683517", "0.4642326", "0.4629137", "0.4626831", "0.46095935", "0.45707476", "0.455283", "0.4549618", "0.45444202", "0.4524694", "0.45191202" ]
0.6376083
1
Rebuild the search key field term_search_key from the source term_text field. Use the rebuildSearchKey.php maintenance script to invoke this from the command line. Database updates a batched into multiple transactions. Do not call this method whithin an (explicite) database transaction.
public function rebuildSearchKey() { $dbw = $this->table->getWriteDb(); $rowId = $this->fromId - 1; $total = 0; while ( true ) { // Make sure we are not running too far ahead of the slaves, // as that would cause the site to be rendered read only. wfWaitForSlaves(); $dbw->begin(); $terms = $dbw->select( $this->table->getTableName(), array( 'term_row_id', 'term_language', 'term_text', ), array( 'term_row_id > ' . (int) $rowId, $this->all ? '1' : 'term_search_key = \'\'', // if not $all, only set missing keys ), __METHOD__, array( 'LIMIT' => $this->batchSize, 'ORDER BY' => 'term_row_id ASC', 'FOR UPDATE' ) ); $c = 0; $cError = 0; foreach ( $terms as $row ) { $key = $this->updateSearchKey( $dbw, $row->term_row_id, $row->term_text ); if ( $key === false ) { $this->report( "Unable to calculate search key for " . $row->term_text ); $cError += 1; } else { $c += 1; } $rowId = $row->term_row_id; } $dbw->commit(); $this->report( "Updated $c search keys (skipped $cError), up to row $rowId." ); $total += $c; if ( $c < $this->batchSize ) { // we are done. break; } } return $total; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function updateSearchKey( DatabaseBase $dbw, $rowId, $text ) {\n\t\t$key = $this->table->getSearchKey( $text );\n\n\t\tif ( $key === '' ) {\n\t\t\twfDebugLog( __CLASS__, __FUNCTION__ . \": failed to normalized term: $text\" );\n\t\t\treturn false;\n\t\t}\n\n\t\twfDebugLog( __CLASS__, __FUNCTION__ . \": row_id = $rowId, search_key = `$key`\" );\n\n\t\t$dbw->update(\n\t\t\t$this->table->getTableName(),\n\t\t\tarray(\n\t\t\t\t'term_search_key' => $key,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'term_row_id' => $rowId,\n\t\t\t),\n\t\t\t__METHOD__\n\t\t);\n\n\t\treturn $key;\n\t}", "function gwAddNewKeywords($id_dict, $id_term, $arKeywords, $termIdOld, $isClean, $date_created)\r\n{\r\n\tglobal $arFields, $intFields, $arStop, $sys;\r\n\tglobal $oDb, $oSqlQ;\r\n#\t@header(\"content-type: text/html; charset=utf-8\");\r\n\r\n\t// Adding search keywords\r\n\t$arKeywordsJoin = array();\r\n\tfor (reset($arKeywords); list($k, $v) = each($arKeywords);)\r\n\t{\r\n\t\t$arKeywordsJoin = array_merge($arKeywordsJoin, $v); // common array with all keywords\r\n\t}\r\n\t// unique keywords only, have to run second time\r\n\t$arKeywordsJoin = array_flip($arKeywordsJoin);\r\n\r\n\t$arQuery = array();\r\n\t$arSql = array();\r\n\tif (!empty($arKeywordsJoin))\r\n\t{\r\n\t\t$word_text_sql = \"'\" . implode(\"', '\", array_keys($arKeywordsJoin)) . \"'\";\r\n\t\t/* Get the list of already known keywords and their IDs */\r\n\t\t$arSql = $oDb->sqlExec($oSqlQ->getQ('get-word', TBL_WORDLIST, $word_text_sql));\r\n\t}\r\n# prn_r($arSql);\r\n\t$q2 = $q1 = array();\r\n\tif (!empty($arSql)) // some keywords are exist already\r\n\t{\r\n\t\t$cnt = 0;\r\n\t\t// for each founded keyword\r\n\t\tfor (; list($arK, $arV) = each($arSql);)\r\n\t\t{\r\n\t\t\tif ($isClean) // overwrite mode\r\n\t\t\t{\r\n\t\t\t\t$arQuery[0] = $oSqlQ->getQ('del-wordmap-by-term-dict', $termIdOld, $id_dict);\r\n\t\t\t}\r\n\t\t\t$q2['word_id'] = $arV['word_id'];\r\n\t\t\t$q2['term_id'] = $id_term;\r\n\t\t\t$q2['dict_id'] = $id_dict;\r\n\t\t\t$q2['date_created'] = $date_created;\r\n\t\t\t// Set Field ID\r\n\t\t\tfor (reset($arFields); list($id_field, $fV) = each($arFields);)\r\n\t\t\t{\r\n\t\t\t\tif (isset($arKeywords[$id_field]) && in_array($arV['word_text'], $arKeywords[$id_field]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$q2['term_match'] = $id_field;\r\n\t\t\t\t\t$arQueryMapExist[] = gw_sql_insert($q2, TBL_WORDMAP, 1, $cnt);\r\n\t\t\t\t\tunset($arKeywordsJoin[$arV['word_text']]); // remove existent keyword\r\n\t\t\t\t\t$cnt++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t//\r\n\t// Add new kewords\r\n# prn_r($arKeywordsJoin);\r\n# prn_r($arKeywords);\r\n\t//\r\n\t$q2 = $q1 = array();\r\n\t$q1['word_id'] = $q2['word_id'] = ($oDb->MaxId(TBL_WORDLIST, 'word_id') - 1);\r\n\t$cnt = $cntMap = 0;\r\n\t// for each new keyword\r\n\tfor (reset($arKeywordsJoin); list($newkeyword, $v2) = each($arKeywordsJoin);)\r\n\t{\r\n\t\t$q2['word_id']++;\r\n\t\t$q2['dict_id'] = $id_dict;\r\n\t\t$q2['term_id'] = $id_term;\r\n\t\t$q2['date_created'] = $date_created;\r\n\t\t$q1['word_id']++;\r\n\t\t$q1['word_text'] = '';\r\n\t\t//\r\n\t\t// Set index ID per field\r\n\t\tfor (reset($arFields); list($id_field, $fV) = each($arFields);)\r\n\t\t{\r\n\t\t\tif (isset($arKeywords[$id_field]) && in_array($newkeyword, $arKeywords[$id_field]))\r\n\t\t\t{\r\n\t\t\t\t$q2['term_match'] = $id_field;\r\n\t\t\t\t$q1['word_text'] = $newkeyword;\r\n\t\t\t\t// add keyword into map\r\n\t\t\t\t$arQueryMap[] = gw_sql_insert($q2, TBL_WORDMAP, 1, $cntMap);\r\n\t\t\t\tunset($arKeywordsJoin[$newkeyword]); // remove new keyword\r\n\t\t\t\t$cntMap++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// add new word into wordlist\r\n\t\tif ($q1['word_text'] != '')\r\n\t\t{\r\n\t\t\t$arQueryWord[] = gw_sql_insert($q1, TBL_WORDLIST, 1, $cnt);\r\n\t\t\t$cnt++;\r\n\t\t}\r\n\t}\r\n\t/* Queries for existent keywords */\r\n\tif (isset($arQueryMapExist)) { $arQuery[] = implode('', $arQueryMapExist); }\r\n\t/* Queries for new keywords */\r\n\tif (isset($arQueryWord)) { $arQuery[] = implode('', $arQueryWord); }\r\n\t/* Queries for new keywords map */\r\n\tif (isset($arQueryMap)) { $arQuery[] = implode('', $arQueryMap); }\r\n\t/* Displays queries */\r\n\tif ($sys['isDebugQ'])\r\n\t{\r\n\t\t$arQuery = gw_highlight_sql($arQuery);\r\n\t\tprint '<ul class=\"gwsql\"><li>'.implode(';</li><li>', $arQuery).';</li></ul>';\r\n\t}\r\n\telse\r\n\t{\r\n\t\tfor (; list($kq, $vq) = each($arQuery);)\r\n\t\t{\r\n\t\t\tif (!$oDb->sqlExec($vq))\r\n\t\t\t{\r\n\t\t\t\tprint '<li class=\"xt\">Error: cannot exec query: '.$arQuery[$i].';</li>';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "public function modifyQuery($query, SearchTerm $search);", "public function reindexAll()\n {\n\n //@todo: indexers should be dynamically injected. Probable via `$this->getIndeces()`\n /** @var St_SphinxSearch_Model_Fulltext $fulltextIndex */\n $fulltextIndex = Mage::getModel('st_sphinxsearch/fulltext');\n\n $fulltextIndex->rebuildIndex();\n\n return;\n /** @var Mage_Core_Model_Resource $resourceSingleton */\n $resourceSingleton = Mage::getSingleton('core/resource');\n\n /** @var Varien_Db_Adapter_Interface $writeAdapater */\n $writeAdapater = $resourceSingleton->getConnection('core_write');\n\n /** @var Varien_Db_Adapter_Interface $readAdapter */\n $readAdapter = $resourceSingleton->getConnection('core_read');\n\n /** @var string $tableName */\n $tableName = $readAdapter->getTableName('st_sphinxsearch_fulltext_tmp');\n\n /** @var Mage_CatalogSearch_Model_Resource_Indexer_Fulltext $indexerFulltext */\n $indexerFulltext = Mage::getResourceModel('catalogsearch/indexer_fulltext');\n\n $fulltextTableName = $indexerFulltext->getTable('fulltext');\n\n $sql = \"CREATE TABLE IF NOT EXISTS `$tableName` LIKE `$fulltextTableName`\";\n\n $writeAdapater->query($sql);\n $t=1;\n }", "private function modifyCronEntry($search_term)\r\n {\r\n echo \"Modify Cron Entry<br>\";\r\n }", "function gwAddTerm($arPre, $id_dict, $arStop, $in_term, $is_specialchars, $is_overwrite, $intLine = 0, $isDelete = 0)\r\n{\r\n\tglobal $oDom, $oFunc, $oDb, $oSqlQ, $oCase, $oL, $oHtml, $oSess;\r\n\tglobal $arFields, $arDictParam, $arTermParam, $cnt, $tid, $sys;\r\n\tglobal $gw_this, $qT;\r\n\r\n#\t@header(\"content-type: text/html; charset=utf-8\");\r\n\r\n\t$id_w = $oDb->MaxId($arDictParam['tablename']);\r\n\t$isQ = 1;\r\n\t$isCleanMap = 0;\r\n\t$id_old = isset($tid) ? $tid : 0;\r\n\t$queryA = $qT = array();\r\n\t$isTermExist = 0;\r\n\t/* Used for keywords */\r\n\t$str_term_filtered = $oDom->get_content($arPre['term']);\r\n\t/* remove {TEMPLATES}, {%TEMPLATES%} */\r\n\t$str_term_filtered = preg_replace(\"/{(%)?([A-Za-z0-9:\\-_]+)(%)?}/\", '', $str_term_filtered);\r\n\t$str_term_filtered = trim($str_term_filtered);\r\n\t/* Used in database */\r\n\t$str_term_src = gw_fix_input_to_db($str_term_filtered);\r\n\t\r\n\t$str_term_filtered = gw_unhtmlspecialamp($str_term_filtered);\r\n\t/* 22 jul 2003: Custom Term ID */\r\n\t$qT['id'] = $oDom->get_attribute('id', 'term', $arPre['term'] );\r\n\t$qT['id'] = preg_replace(\"/[^0-9]/\", '', trim($qT['id']));\r\n\t/* */\r\n\tif (!$isDelete)\r\n\t{\r\n\t\t/* -- Check for an existed term -- */\r\n\t\t/* prepare keywords for a term */\r\n\t\tif ($is_specialchars)\r\n\t\t{\r\n\t\t\t/* Keep specials */\r\n\t\t\t$str_term_filtered = $oCase->nc($str_term_filtered);\r\n\t\t\t$str_term_filtered = gw_text_wildcars($str_term_filtered);\r\n\t\t\t$arKeywordsT = text2keywords($oCase->rm_($str_term_filtered), 1);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/* Remove specials */\r\n\t\t\t$str_term_filtered = text_normalize($str_term_filtered);\r\n\t\t\t$arKeywordsT = text2keywords($str_term_filtered, $arDictParam['min_srch_length']);\r\n\t\t}\r\n\t\t/* Are there any keywords? */\r\n\t\t$isTermEmpty = (empty($arKeywordsT) && (strlen(trim( $str_term_filtered )) == 0)) ? 1 : 0;\r\n\t\tif (!$isTermEmpty)\r\n\t\t{\r\n\t\t\t/* no empty keywords for a term */\r\n\t\t\t/* SQL-query */\r\n\t\t\t/* Get existent keywords, standard mode */\r\n\t\t\t$word_srch_sql = ($qT['id'] != '') ? 't.id = \"' . $qT['id'] . '\"' : '';\r\n\t\t\tif ($word_srch_sql == '')\r\n\t\t\t{\r\n\t\t\t\t$word_srch_sql = \"k.word_text IN ('\" . implode(\"', '\", $arKeywordsT) . \"')\";\r\n\t\t\t}\r\n\t\t\t$sql = $oSqlQ->getQ('get-term-exists', TBL_WORDLIST, $arDictParam['tablename'], $id_dict,\r\n\t\t\t\t\t\t$in_term, $word_srch_sql\r\n\t\t\t\t\t);\r\n\t\t\t/* Get existent keywords, keep specialchars mode */\r\n\t\t\tif (($is_specialchars) || empty($arKeywordsT))\r\n\t\t\t{\r\n\t\t\t\t$ar_chars_sql = array('\\\\' => '\\\\\\\\', '\\\\%' => '\\\\\\\\\\\\\\%', '\\\\_' => '\\\\\\\\\\\\\\_', '\\\\\"' => '\\\\\\\\\\\\\\\"', \"\\\\'\" => \"\\\\\\\\\\\\\\'\");\r\n\t\t\t\t$sql = $oSqlQ->getQ('get-term-exists-spec', $arDictParam['tablename'],\r\n\t\t\t\t\t\tstr_replace(array_keys($ar_chars_sql), array_values($ar_chars_sql), gw_addslashes( $str_term_src ))\r\n\t\t\t\t\t);\r\n\t\t\t}\r\n\t\t\t$arSql = $oDb->sqlExec($sql);\r\n#\t\t\tprn_r($arSql, __LINE__ . '<br />' . $sql);\r\n\t\t\t$isTermNotMatched = 1; // `No term found' by default\r\n\r\n\t\t\tfor (; list($arK, $arV) = each($arSql);) // compare founded values (Q) with imported (T)\r\n\t\t\t{\r\n\t\t\t\t$id_old = $arV['id']; // get ID for existent keywords.\r\n\t\t\t\tif ($id_old == $qT['id'])\r\n\t\t\t\t{\r\n\t\t\t\t\t$isTermNotMatched = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif ($is_specialchars)\r\n\t\t\t\t{\r\n\t\t\t\t\t/* 1 - is the minimum length */\r\n\t\t\t\t\t$arKeywordsQ = text2keywords( text_normalize($arV['term']), 1);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t/* $arDictParam['min_srch_length'] - is the minimum length */\r\n\t\t\t\t\t$arKeywordsQ = text2keywords( text_normalize($arV['term']), $arDictParam['min_srch_length']);\r\n\t\t\t\t}\r\n#\t\t\t\tprn_r($arKeywordsQ);\r\n\t\t\t\t$div1 = sizeof(gw_array_exclude($arKeywordsT, $arKeywordsQ));\r\n\t\t\t\t$div2 = sizeof(gw_array_exclude($arKeywordsQ, $arKeywordsT));\r\n\t\t\t\t$isTermNotMatched = ($div1 + $div2);\r\n\t\t\t\t// if the sum of excluded arrays is 0, this term already exists\r\n\t\t\t\tif (!$isTermNotMatched) // in english, double negative means positive... yeah\r\n\t\t\t\t{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t} // end of for each founded terms\r\n\t\t\tif ($isTermNotMatched > 0)\r\n\t\t\t{\r\n\t\t\t\t$isQ = 1;\r\n\t\t\t\t$isTermExist = 0;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$isTermExist = 1;\r\n\t\t\t}\r\n\t\t} // !$isTermEmpty\r\n\t}\r\n\t/* */\r\n\tif (!isset($str_term_filtered))\r\n\t{\r\n\t\t$str_term_filtered = gw_text_wildcars($str_term_filtered);\r\n\t\t$str_term_filtered = text_normalize($str_term_filtered);\r\n\t}\r\n\t/* 21 jan 2006: new `date_created' for new terms */\r\n\t/* 23 apr 2008: subtract 61 second */\r\n\t$qT['date_created'] = isset($arPre['date_created']) ? $arPre['date_created'] : $sys['time_now_gmt_unix'];\r\n\t$qT['date_modified'] = $sys['time_now_gmt_unix'] - 61;\r\n\t$qT['date_created'] -= 61;\r\n\t/* 21 jul 2003: Better protection by adding random Next ID number */\r\n\t$arTermParam['tid'] = $qT['id'] = ($qT['id'] == '') ? mt_rand($id_w, ($sys['leech_factor'] * 2) + $id_w) : $qT['id'];\r\n\t$qT['term'] = $str_term_src;\r\n\t/* 15 sep 2007: Term URI */\r\n\t/* 08 apr 2008: Make link to added term */\r\n\t/* 11 apr 2008: Better URI */\r\n\t/* 23 apr 2008: Even better URI. Added transliteration. */\r\n\t$qT['term_uri'] = $oDom->get_attribute('uri', 'term', $arPre['term'] );\r\n\t$qT['term_uri'] = ($qT['term_uri'] == '') ? $qT['id'].'-'.$oCase->translit( $oCase->lc($str_term_filtered)) : $qT['term_uri'];\r\n\t$qT['term_uri'] = $oCase->rm_entity($qT['term_uri']);\r\n\t$qT['term_uri'] = preg_replace('/[^0-9A-Za-z_-]/', '-', $qT['term_uri']);\r\n\t$qT['term_uri'] = preg_replace('/-{2,}/', '-', $qT['term_uri']);\r\n\tif ($qT['term_uri'] == '-')\r\n\t{\r\n\t\t$qT['term_uri'] = $qT['id'].'-';\r\n\t}\r\n\t$arTermParam['term_uri'] = $qT['term_uri'];\r\n\r\n\t$qT['defn'] =& $arPre['parameters']['xml'];\r\n\t/* Alphabetic orders 1,2,3 */\r\n\t$qT['term_1'] = $oDom->get_attribute('t1', 'term', $arPre['term'] );\r\n\t$qT['term_2'] = $oDom->get_attribute('t2', 'term', $arPre['term'] );\r\n\t$qT['term_3'] = $oDom->get_attribute('t3', 'term', $arPre['term'] );\r\n\t/* -- Custom Alphabetic Toolbar -- */\r\n\t/* Select custom rules for uppercasing */\r\n\t$sql = 'SELECT az_value, az_value_lc FROM `'.$sys['tbl_prefix'].'custom_az` WHERE `id_profile` = \"'.$arDictParam['id_custom_az'].'\"';\r\n\t$arSqlAz = $oDb->sqlRun($sql, 'st');\r\n\tfor (; list($arK, $arV) = each($arSqlAz);)\r\n\t{\r\n\t\t$str_term_src = str_replace($arV['az_value_lc'], $arV['az_value'], $str_term_src);\r\n\t}\r\n\t/* Unicode uppercase */\r\n\t$str_term_src_uc = $oCase->uc( $str_term_src );\r\n\t/* 1.8.7: Custom sorting order */\r\n\t$qT['term_order'] = $oDom->get_attribute('term_order', 'term', $arPre['term'] );\r\n\t$qT['term_order'] = ($qT['term_order'] == '') ? $str_term_src_uc : $qT['term_order'];\r\n\t$qT['term_a'] = $qT['term_b'] = $qT['term_c'] = $qT['term_d'] = $qT['term_e'] = $qT['term_f'] = 0;\r\n\t/* Prepare A, AAZZ, AAAZZZ */\r\n\t$qT['term_3'] = ($qT['term_3'] == '') ? $oFunc->mb_substr($str_term_filtered, 2, 1, $sys['internal_encoding']) : $qT['term_3'];\r\n\t$qT['term_2'] = ($qT['term_2'] == '') ? $oFunc->mb_substr($str_term_filtered, 1, 1, $sys['internal_encoding']) : $qT['term_2'];\r\n\t$qT['term_1'] = ($qT['term_1'] == '') ? $oFunc->mb_substr($str_term_filtered, 0, 1, $sys['internal_encoding']) : $qT['term_1'];\r\n\t/* */\r\n\t$ar_field_names = array('a','b','c','d','e','f');\r\n\tpreg_match_all(\"/./u\", $qT['term_order'], $ar_letters);\r\n\tfor (; list($cnt_letter, $letter) = each($ar_letters[0]);)\r\n\t{\r\n\t\tif (isset($ar_field_names[$cnt_letter]))\r\n\t\t{\r\n\t\t\t$qT['term_'.$ar_field_names[$cnt_letter]] = text_str2ord($letter);\r\n\t\t}\r\n\t}\r\n\t/* Fix htmlspecial characters */\r\n\t$qT['term_3'] = gw_htmlspecialamp(gw_unhtmlspecialamp($qT['term_3']));\r\n\t$qT['term_2'] = gw_htmlspecialamp(gw_unhtmlspecialamp($qT['term_2']));\r\n\t$qT['term_1'] = gw_htmlspecialamp(gw_unhtmlspecialamp($qT['term_1']));\r\n\t/* */\r\n\t$qT['is_active'] = $oDom->get_attribute('is_active', 'term', $arPre['term']);\r\n\t$qT['is_complete'] = $oDom->get_attribute('is_complete', 'term', $arPre['term']);\r\n#prn_r($qT, __LINE__.__FILE__);\r\n#exit;\r\n\tif ($isDelete || $isTermExist)\r\n\t{\r\n\t\t/* Assign Term ID from previously added term */\r\n\t\t$arTermParam['tid'] = $id_old;\r\n\t\tif ($is_overwrite)\r\n\t\t{\r\n\t\t\t$qT['id'] = $id_old;\r\n\t\t\t$isCleanMap = 1;\r\n\t\t\t$isTermExist = 0;\r\n#\t\t\t$queryA[] = $oSqlQ->getQ('del-term_id', $arDictParam['tablename'], $id_old, $id_dict);\r\n\t\t}\r\n\t}\r\n\tif (!$isDelete && $isTermExist)\r\n\t{\r\n\t\t/* Term already exists */\r\n\t\t$ar_matched_terms = array();\r\n\t\tfor (reset($arSql); list($arK, $arV) = each($arSql);)\r\n\t\t{\r\n\t\t\t$ar_matched_terms[] = $oHtml->a($sys['page_admin'].'?'.GW_ACTION.'='.GW_A_EDIT.'&'.GW_TARGET.'='.GW_T_TERMS.'&id='.$id_dict.'&tid=' . $arV['id'],\r\n\t\t\t\t\t\t $arV['term'], '', '', $oL->m('3_edit'));\r\n\t\t}\r\n\t\t$str_line = implode(' | ', $ar_matched_terms);\r\n\t\t$queryA = '<dl style=\"margin:0\">';\r\n\t\t$queryA .= '<dt class=\"xu red\">'.$oL->m('reason_25').' - <strong>'. $str_term_src . '</strong></dt>';\r\n\t\t$queryA .= '<dd class=\"termpreview\">' .$str_line. '</dd>';\r\n\t\t$queryA .= '</dl>';\r\n\t\t$isQ = 0;\r\n\t}\r\n\t/* Allow query */\r\n\tif ($isQ)\r\n\t{\r\n\t\t/* Prepare keywords per field */\r\n#\t\t$ot = new gw_timer('addterm');\r\n\t\tfor (reset($arFields); list($fK, $fV) = each($arFields);)\r\n\t\t{\r\n\t\t\t// Init\r\n\t\t\t$arKeywords[$fK] = array();\r\n\t\t\t//\r\n#\t\t\t$int_min_length = (isset($fV[2]) && ($fV[2] != 'auto') && ($fV[2] != '')) ? $fV[2] : $arDictParam['min_srch_length'];\r\n#\t\t\t$int_min_length = (!isset($fV[2]) || ($fV[2] == 'auto') ) ? $int_min_length : $fV[2];\r\n\t\t\t//\r\n\t\t\t// Make keywords from array\r\n\t\t\t// space is required, otherwise `...word</defn><defn>word...' will become `wordword'\r\n\t\t\t$tmpStr = '';\r\n\t\t\tif (isset($arPre[$fV[0]]))\r\n\t\t\t{\r\n\t\t\t\t$tmpStr = $oDom->get_content( $arPre[$fV[0]] );\r\n\t\t\t}\r\n\t\t\tif ($tmpStr != '') // do not parse empty strings\r\n\t\t\t{\r\n\t\t\t\t// Get maximum search length per field\r\n\t\t\t\t$int_min_length = $fV[2];\r\n\t\t\t\tif ( is_string($int_min_length) )\r\n\t\t\t\t{\r\n\t\t\t\t\t$int_min_length = $arDictParam['min_srch_length'];\r\n\t\t\t\t}\r\n#\t\t\t\t$isStrip = ($srchLength == 1) ? 0 : 1;\r\n# prn_r( text_normalize( $tmpStr ) . ' ' . $fV[0] . '; len=' . $int_min_length);\r\n\t\t\t\t/* Fix wildcars, 1.6.1 */\r\n\t\t\t\t$tmpStr = str_replace('<![CDATA[', '', $tmpStr);\r\n\t\t\t\t$tmpStr = str_replace(']]>', '', $tmpStr);\r\n\t\t\t\t$tmpStr = gw_text_wildcars($tmpStr);\r\n\t\t\t\t/* */\r\n#\t\t\t\tprn_r( $fV );\r\n\t\t\t\t$arKeywords[$fK] = text2keywords( gw_text_sql(text_normalize($tmpStr)), $int_min_length, 25, $sys['internal_encoding'] );\r\n\t\t\t\t/* Remove stopwords from parsed strings only (others are empty) */\r\n\t\t\t\t$arKeywords[$fK] = gw_array_exclude( $arKeywords[$fK], $arStop);\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* keywords convertion time */\r\n#\t\tprn_r( $arKeywords );\r\n#\t\tprint $ot->endp(__LINE__, __FILE__);\r\n#\t\texit;\r\n\t\t/* Remove double keywords from definition */\r\n\t\tfor (reset($arFields); list($fK, $fV) = each($arFields);)\r\n\t\t{\r\n\t\t\tif ($fK != 0)\r\n\t\t\t{\r\n\t\t\t\t$arKeywords[0] = gw_array_exclude( $arKeywords[0], $arKeywords[$fK]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t/** Keywords were prepared */\r\n\t\t/** Add keywords to database! */\r\n# prn_r($arStop);\r\n# prn_r($arKeywords);\r\n# prn_r($arPre);\r\n\t\tgwAddNewKeywords($id_dict, $qT['id'], $arKeywords, $id_old, $isCleanMap, $qT['date_created']);\r\n\t\t$qT['int_bytes'] = strlen($qT['defn']);\r\n\t\t/* Checksum */\r\n\t\t$qT['crc32u'] = crc32($str_term_src_uc);\r\n\t\t/* Add User ID to term */\r\n\t\tif ($gw_this['vars'][GW_ACTION] == GW_A_ADD)\r\n\t\t{\r\n\t\t\t$qT['id_user'] = $oSess->id_user;\r\n\t\t}\r\n\t\t/* Add relation `user to term' */\r\n\t\t$q2['user_id'] = $oSess->id_user;\r\n\t\t$q2['term_id'] = $qT['id'];\r\n\t\t$q2['dict_id'] = $id_dict;\r\n\t\t// -------------------------------------------------\r\n\t\t// Turn on text parsers\r\n\t\t// -------------------------------------------------\r\n\t\t// Process automatic functions\r\n\t\tfor (; list($k, $v) = each($gw_this['vars']['funcnames'][GW_A_UPDATE . GW_T_TERM]);)\r\n\t\t{\r\n\t\t\tif (function_exists($v))\r\n\t\t\t{\r\n\t\t\t\t$v();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/* REPLACE or UPDATE */\r\n\t\tif ($isDelete || $isTermExist)\r\n\t\t{\r\n\t\t\tif ($is_overwrite)\r\n\t\t\t{\r\n\t\t\t\tunset($qT['id']);\r\n\t\t\t\t$queryA[] = gw_sql_update($qT, $arDictParam['tablename'], 'id = \"'.$id_old.'\"');\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$id_old = $qT['id'];\r\n\t\t\t$queryA[] = gw_sql_insert($qT, $arDictParam['tablename'], 1);\r\n\t\t}\r\n\r\n\t\t/* 23 Nov 2007: history of changes */\r\n\t\t$qT['id_term'] = $id_old;\r\n\t\t$qT['id_dict'] = $arDictParam['id'];\r\n\t\t$qT['id_user'] = $oSess->id_user;\r\n\t\t$qT['keywords'] = serialize($arKeywords);\r\n\t\tunset($qT['id']);\r\n\t\t\r\n\t\t$queryA[] = gw_sql_insert($qT, $sys['tbl_prefix'].'history_terms', 1);\r\n\t\t/* Assign edited term to user */\r\n\t\t$queryA[] = gw_sql_replace($q2, TBL_MAP_USER_TERM, 1);\r\n\t\t/* Check table to keep indexes */\r\n\t\t$arQuery[] = 'CHECK TABLE `'.$arDictParam['tablename'].'`';\r\n\t} /* is_query allowed */\r\n\treturn $queryA;\r\n}", "public function rewrite(\\Core\\Search\\Lucene\\InterfaceLucene $index) {\n\t\t$this->_matches = array ();\n\t\t$this->_scores = array ();\n\t\t$this->_termKeys = array ();\n\t\t\n\t\tif ($this->_term->field === null) {\n\t\t\t// Search through all fields\n\t\t\t$fields = $index->getFieldNames ( true /* indexed fields list */);\n\t\t} else {\n\t\t\t$fields = array (\n\t\t\t\t\t$this->_term->field \n\t\t\t);\n\t\t}\n\t\t\n\t\t$prefix = \\Core\\Search\\Lucene\\Index\\Term::getPrefix ( $this->_term->text, $this->_prefixLength );\n\t\t$prefixByteLength = strlen ( $prefix );\n\t\t$prefixUtf8Length = \\Core\\Search\\Lucene\\Index\\Term::getLength ( $prefix );\n\t\t\n\t\t$termLength = \\Core\\Search\\Lucene\\Index\\Term::getLength ( $this->_term->text );\n\t\t\n\t\t$termRest = substr ( $this->_term->text, $prefixByteLength );\n\t\t// we calculate length of the rest in bytes since levenshtein() is not\n\t\t// UTF-8 compatible\n\t\t$termRestLength = strlen ( $termRest );\n\t\t\n\t\t$scaleFactor = 1 / (1 - $this->_minimumSimilarity);\n\t\t\n\t\tforeach ( $fields as $field ) {\n\t\t\t$index->resetTermsStream ();\n\t\t\t\n\t\t\tif ($prefix != '') {\n\t\t\t\t$index->skipTo ( new \\Core\\Search\\Lucene\\Index\\Term ( $prefix, $field ) );\n\t\t\t\t\n\t\t\t\twhile ( $index->currentTerm () !== null && $index->currentTerm ()->field == $field && substr ( $index->currentTerm ()->text, 0, $prefixByteLength ) == $prefix ) {\n\t\t\t\t\t// Calculate similarity\n\t\t\t\t\t$target = substr ( $index->currentTerm ()->text, $prefixByteLength );\n\t\t\t\t\t\n\t\t\t\t\t$maxDistance = isset ( $this->_maxDistances [strlen ( $target )] ) ? $this->_maxDistances [strlen ( $target )] : $this->_calculateMaxDistance ( $prefixUtf8Length, $termRestLength, strlen ( $target ) );\n\t\t\t\t\t\n\t\t\t\t\tif ($termRestLength == 0) {\n\t\t\t\t\t\t// we don't have anything to compare. That means if we\n\t\t\t\t\t\t// just add\n\t\t\t\t\t\t// the letters for current term we get the new word\n\t\t\t\t\t\t$similarity = (($prefixUtf8Length == 0) ? 0 : 1 - strlen ( $target ) / $prefixUtf8Length);\n\t\t\t\t\t} else if (strlen ( $target ) == 0) {\n\t\t\t\t\t\t$similarity = (($prefixUtf8Length == 0) ? 0 : 1 - $termRestLength / $prefixUtf8Length);\n\t\t\t\t\t} else if ($maxDistance < abs ( $termRestLength - strlen ( $target ) )) {\n\t\t\t\t\t\t// just adding the characters of term to target or\n\t\t\t\t\t\t// vice-versa results in too many edits\n\t\t\t\t\t\t// for example \"pre\" length is 3 and \"prefixes\" length\n\t\t\t\t\t\t// is 8. We can see that\n\t\t\t\t\t\t// given this optimal circumstance, the edit distance\n\t\t\t\t\t\t// cannot be less than 5.\n\t\t\t\t\t\t// which is 8-3 or more precisesly abs(3-8).\n\t\t\t\t\t\t// if our maximum edit distance is 4, then we can\n\t\t\t\t\t\t// discard this word\n\t\t\t\t\t\t// without looking at it.\n\t\t\t\t\t\t$similarity = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$similarity = 1 - levenshtein ( $termRest, $target ) / ($prefixUtf8Length + min ( $termRestLength, strlen ( $target ) ));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($similarity > $this->_minimumSimilarity) {\n\t\t\t\t\t\t$this->_matches [] = $index->currentTerm ();\n\t\t\t\t\t\t$this->_termKeys [] = $index->currentTerm ()->key ();\n\t\t\t\t\t\t$this->_scores [] = ($similarity - $this->_minimumSimilarity) * $scaleFactor;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$index->nextTerm ();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$index->skipTo ( new \\Core\\Search\\Lucene\\Index\\Term ( '', $field ) );\n\t\t\t\t\n\t\t\t\twhile ( $index->currentTerm () !== null && $index->currentTerm ()->field == $field ) {\n\t\t\t\t\t// Calculate similarity\n\t\t\t\t\t$target = $index->currentTerm ()->text;\n\t\t\t\t\t\n\t\t\t\t\t$maxDistance = isset ( $this->_maxDistances [strlen ( $target )] ) ? $this->_maxDistances [strlen ( $target )] : $this->_calculateMaxDistance ( 0, $termRestLength, strlen ( $target ) );\n\t\t\t\t\t\n\t\t\t\t\tif ($maxDistance < abs ( $termRestLength - strlen ( $target ) )) {\n\t\t\t\t\t\t// just adding the characters of term to target or\n\t\t\t\t\t\t// vice-versa results in too many edits\n\t\t\t\t\t\t// for example \"pre\" length is 3 and \"prefixes\" length\n\t\t\t\t\t\t// is 8. We can see that\n\t\t\t\t\t\t// given this optimal circumstance, the edit distance\n\t\t\t\t\t\t// cannot be less than 5.\n\t\t\t\t\t\t// which is 8-3 or more precisesly abs(3-8).\n\t\t\t\t\t\t// if our maximum edit distance is 4, then we can\n\t\t\t\t\t\t// discard this word\n\t\t\t\t\t\t// without looking at it.\n\t\t\t\t\t\t$similarity = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$similarity = 1 - levenshtein ( $termRest, $target ) / min ( $termRestLength, strlen ( $target ) );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($similarity > $this->_minimumSimilarity) {\n\t\t\t\t\t\t$this->_matches [] = $index->currentTerm ();\n\t\t\t\t\t\t$this->_termKeys [] = $index->currentTerm ()->key ();\n\t\t\t\t\t\t$this->_scores [] = ($similarity - $this->_minimumSimilarity) * $scaleFactor;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$index->nextTerm ();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$index->closeTermsStream ();\n\t\t}\n\t\t\n\t\tif (count ( $this->_matches ) == 0) {\n\t\t\treturn new \\Core\\Search\\Lucene\\Search\\Query\\EmptyQuery ();\n\t\t} else if (count ( $this->_matches ) == 1) {\n\t\t\treturn new \\Core\\Search\\Lucene\\Search\\Query\\Term ( reset ( $this->_matches ) );\n\t\t} else {\n\t\t\t$rewrittenQuery = new \\Core\\Search\\Lucene\\Search\\Query\\Boolean ();\n\t\t\t\n\t\t\tarray_multisort ( $this->_scores, SORT_DESC, SORT_NUMERIC, $this->_termKeys, SORT_ASC, SORT_STRING, $this->_matches );\n\t\t\t\n\t\t\t$termCount = 0;\n\t\t\tforeach ( $this->_matches as $id => $matchedTerm ) {\n\t\t\t\t$subquery = new \\Core\\Search\\Lucene\\Search\\Query\\Term ( $matchedTerm );\n\t\t\t\t$subquery->setBoost ( $this->_scores [$id] );\n\t\t\t\t\n\t\t\t\t$rewrittenQuery->addSubquery ( $subquery );\n\t\t\t\t\n\t\t\t\t$termCount ++;\n\t\t\t\tif ($termCount >= self::MAX_CLAUSE_COUNT) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $rewrittenQuery;\n\t\t}\n\t}", "public function triggerReindex()\n {\n if (!$this->owner->ID) {\n return;\n }\n\n $id = $this->owner->ID;\n $class = $this->owner->ClassName;\n $state = SearchVariant::current_state($class);\n $base = DataObject::getSchema()->baseDataClass($class);\n $key = \"$id:$base:\" . serialize($state);\n\n $statefulids = array(array(\n 'id' => $id,\n 'state' => $state\n ));\n\n $writes = array(\n $key => array(\n 'base' => $base,\n 'class' => $class,\n 'id' => $id,\n 'statefulids' => $statefulids,\n 'fields' => array()\n )\n );\n\n SearchUpdater::process_writes($writes);\n }", "public function run()\n\t{\n\t\t\\DB::table('keywords')->truncate();\n \n\t\t\\DB::table('keywords')->insert(array (\n\t\t\t0 => \n\t\t\tarray (\n\t\t\t\t'id' => 1,\n\t\t\t\t'pin_id' => 1,\n 'occurrences' => 2,\n\t\t\t\t'keywords' => 'Let\\'s go crazy',\n\t\t\t),\n\t\t\t1 => \n\t\t\tarray (\n\t\t\t\t'id' => 2,\n\t\t\t\t'pin_id' => 3,\n 'occurrences' => 2,\n 'keywords' => 'Testing keywords',\n\t\t\t),\n\t\t));\n\t}", "function buildQuery( )\n {\n $field = \"KeyWords\";\n\n $QueryText = $this->QueryText;\n \n $QueryText = trim( $QueryText );\n// $QueryText = ereg_replace( \"[ ]+\", \" \", $QueryText );\n// $queryArray = explode( \" \", $QueryText );\n $QueryText = ereg_replace( '\\\\\\\\\"', '\"', $QueryText );\n preg_match_all( \"/((\\\"[^\\\"]+\\\")|([^ ]+))/\", $QueryText, $m );\n $queryArray = array();\n foreach( $m[0] as $match )\n {\n $queryArray[] = $match;\n }\n if ( count( $queryArray ) == 0 )\n $queryArray[] = \"\";\n\n $normalArray = array();\n $addArray = array();\n $subArray = array();\n\n foreach( $queryArray as $queryItem )\n {\n switch ( $queryItem[0] )\n {\n case '-':\n {\n $subArray[] = substr( $queryItem, 1 );\n break;\n }\n case '+':\n {\n $addArray[] = substr( $queryItem, 1 );\n break;\n }\n default:\n {\n $normalArray[] = $queryItem;\n }\n }\n }\n\n $arrs = array( array( \"array\" => \"normalArray\", \"item_delim\" => \"OR\", \"delim\" => \"OR\", \"compare\" => \"LIKE\" ),\n array( \"array\" => \"addArray\", \"item_delim\" => \"OR\", \"delim\" => \"AND\", \"compare\" => \"LIKE\" ),\n array( \"array\" => \"subArray\", \"item_delim\" => \"AND\", \"delim\" => \"AND\", \"compare\" => \"NOT LIKE\" ) );\n\n $total_query = \"\";\n foreach( $arrs as $arr )\n {\n $queryArray = ${$arr[\"array\"]};\n $item_delim = $arr[\"item_delim\"];\n $delim = $arr[\"delim\"];\n $compare = $arr[\"compare\"];\n $query = \"\";\n for ( $i=0; $i<count($queryArray); $i++ )\n {\n $queryVal = $queryArray[$i];\n if ( strlen( $queryVal ) > 1 and $queryVal[0] == '\"' and $queryVal[strlen($queryVal)-1] == '\"' )\n {\n $queryVal = substr( $queryVal, 1, strlen( $queryVal ) - 2 );\n }\n\n $subquery = \"\";\n for ( $j=0; $j<count($this->Fields); $j++ )\n {\n $queryItem = $queryVal;\n\n $queryItem = $this->Fields[$j] .\" $compare '%\" . $queryItem . \"%' \";\n\n if ( $j > 0 )\n $queryItem = $item_delim . \" \" . $queryItem . \" \";\n\n $subquery .= $queryItem;\n }\n $query .= \"( $subquery )\";\n\n if ( count( $queryArray) != ($i+1) )\n $query .= \" $delim \";\n }\n if ( count( $queryArray ) )\n {\n if ( !empty( $total_query ) )\n {\n $total_query = \"$total_query $delim ( $query )\";\n }\n else\n {\n $total_query = \"( $query )\";\n }\n }\n }\n return $total_query;\n }", "function do_fulltext()\r\n\t{\r\n\t\tglobal $IN, $INFO, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;\r\n\t\t$ibforums = Ibf::app();\r\n\r\n\t\tif ($IN['ftexist'] == 1)\r\n\t\t{\r\n\t\t\t$master = array();\r\n\t\t\t$master['search_sql_method'] = $IN['search_sql_method'];\r\n\t\t\t$master['search_default_method'] = $IN['search_default_method'];\r\n\r\n\t\t\t$ADMIN->rebuild_config($master);\r\n\t\t} else\r\n\t\t{\r\n\t\t\t// They don't.\r\n\t\t\t// Check for correct version and if need be, attempt to create the indexes...\r\n\r\n\t\t\tif ($this->mysql_version >= 32323)\r\n\t\t\t{\r\n\t\t\t\t// How many posts do we have?\r\n\r\n\t\t\t\t$stmt = $ibforums->db->query(\r\n\t\t\t\t\t\"SELECT COUNT(*) as cnt\r\n\t\t\t\t\tFROM ibf_posts\"\r\n\t\t\t\t);\r\n\r\n\t\t\t\t$result = $stmt->fetch();\r\n\r\n\t\t\t\t// If over 15,000 posts...\r\n\r\n\t\t\t\tif ($result['cnt'] > 15000)\r\n\t\t\t\t{\r\n\t\t\t\t\t// Explain how, why and what to do..\r\n\r\n\t\t\t\t\t$ADMIN->page_detail = \"\";\r\n\t\t\t\t\t$ADMIN->page_title = \"Unable to continue\";\r\n\r\n\t\t\t\t\t$ADMIN->html .= $SKIN->add_td_basic($this->return_sql_no_no_cant_do_it_sorry_text(), 'left', 'faker');\r\n\r\n\t\t\t\t\t$ADMIN->output();\r\n\t\t\t\t} else\r\n\t\t\t\t{\r\n\t\t\t\t\t// Index away!\r\n\r\n\t\t\t\t\t$stmt = $ibforums->db->query(\r\n\t\t\t\t\t\t\"ALTER TABLE ibf_topics\r\n \t\t\t\t\tADD fulltext(title)\"\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\t$stmt = $ibforums->db->query(\r\n\t\t\t\t\t\t\"ALTER TABLE ibf_posts\r\n \t\t\t\t\tADD fulltext(post)\"\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t}\r\n\t\t\t} else\r\n\t\t\t{\r\n\t\t\t\t$ADMIN->error(\"Sorry, the version of MySQL that you are using is unable to use FULLTEXT searches\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$ADMIN->save_log(\"Full Text Options Updated\");\r\n\r\n\t\t$ADMIN->done_screen(\"Full Text Settings updated\", \"Full Text Set Up\", \"act=op&code=fulltext\");\r\n\r\n\t}", "function _prime_term_caches($term_ids, $update_meta_cache = \\true)\n {\n }", "protected function _postSave()\n {\n if ($this->Thread && $this->_wordCount !== null && $this->isUpdate())\n {\n if ($this->isValidThreadWordCountUpdate())\n {\n /** @var \\SV\\WordCountSearch\\Repository\\WordCount $wordCountRepo */\n $wordCountRepo = $this->repository('SV\\WordCountSearch:WordCount');\n $wordCountRepo->rebuildThreadWordCount($this->Thread);\n }\n\n \\XF::runOnce(\n 'searchIndex-' . $this->getEntityContentType() . $this->getEntityId(),\n function () {\n $this->app()->search()->index($this->getEntityContentType(), $this, true);\n }\n );\n }\n\n parent::_postSave();\n }", "public function perform()\n {\n // Truncate the `search_texts` table before indexing to clean out\n // obsolete records.\n $sql = \"TRUNCATE TABLE {$this->_db->SearchText}\";\n $this->_db->query($sql);\n\n foreach (get_custom_search_record_types() as $key => $value) {\n $recordType = is_string($key) ? $key : $value;\n\n if (!class_exists($recordType)) {\n // The class does not exist or cannot be found.\n continue;\n }\n $record = new $recordType;\n if (!($record instanceof Omeka_Record_AbstractRecord)) {\n // The class is not a valid record.\n continue;\n }\n if (!is_callable(array($record, 'addSearchText'))) {\n // The record does not implement the search mixin.\n continue;\n }\n\n $pageNumber = 1;\n $recordTable = $record->getTable();\n // Query a limited number of rows at a time to prevent memory issues.\n while ($recordObjects = $recordTable->fetchObjects($recordTable->getSelect()->limitPage($pageNumber, 100))) {\n foreach ($recordObjects as $recordObject) {\n // Save the record object, which indexes its search text.\n try {\n $recordObject->save();\n } catch (Omeka_Validate_Exception $e) {\n _log($e, Zend_Log::ERR);\n _log(sprintf('Failed to index %s #%s',\n get_class($recordObject), $recordObject->id),\n Zend_Log::ERR);\n }\n release_object($recordObject);\n }\n $pageNumber++;\n }\n }\n }", "private function cacheThis()\n\t{\n\t\t$q = 'UPDATE twitterSearch SET searchResults = \"' .addslashes($this->_results) .'\" WHERE searchTerm = \"' .$this->_searchString .'\"';\n\t\t$r = mysql_query($q, CONN) or die('could not update the results in the database for caching');\n\t}", "private function _spelling_data() \n\t{\n\t\t$query = ee()->db->query( \" SELECT COUNT(term_id) AS total_terms FROM exp_super_search_terms WHERE count > 0 AND entry_count = 0 AND suggestions = '' \");\n\n\t\t$this->cached_vars['spelling_unknown_count'] = $query->row('total_terms');\n\t\t\n\t\t$queryb = ee()->db->query( \" SELECT COUNT(term_id) AS total_terms FROM exp_super_search_terms WHERE count > 0 AND entry_count = 0 AND suggestions != '' \");\n\n\t\t$this->cached_vars['spelling_known_count'] = $queryb->row('total_terms');\n\n\t\t// -------------------------------------\n\t\t// Spelling\n\t\t// -------------------------------------\n\n\t\t$this->cached_vars['spelling_build_lang'] = lang('lexicon_build');\n\n\t\t$this->cached_vars['spelling_state_lang'] = '<strong>34</strong> Terms with suggestions recorded.<br/> <strong>1</strong> unknown term to find suggestions.';\n\n\t\t$plural = ( $this->cached_vars['spelling_unknown_count'] > 1 ? 's' : '' );\n\n\t\t$this->cached_vars['suggestions_unknown_lang'] = str_replace( array('%i%', '%s%'), array( $this->cached_vars['spelling_unknown_count'], $plural ) , lang('spelling_unknown_line') );\n\n\n\t\t$plural = ( $this->cached_vars['spelling_known_count'] > 1 ? 's' : '' );\n\n\t\t$this->cached_vars['suggestions_known_lang'] = str_replace( array('%i%', '%s%'), array( $this->cached_vars['spelling_known_count'], $plural ) , lang('spelling_known_line') );\n\n\t\t$this->cached_vars['spelling_build_url'] = $this->base.'&method=spelling&build=yes&total='.$query->row('total_terms').'&batch=0';\n\n\t\t$this->cached_vars['success_png_url'] = $this->theme_folder_url() . \"images/success.png\";\n\n\t\t$this->cached_vars['just_spelling'] = FALSE; \n\n\t\treturn;\n }", "function _index_keyword($keyword, $product_id, $frequency)\n\t{\n\t\t$model_keyword \t\t=& model::create('keyword');\n\t\t$product_keyword \t=& model::create('product_keyword');\n\t\t\n\t\t//Insert unique keyword\n\t\tif(!$model_keyword->find_by_field('keyword',$keyword))\n\t\t{\n\t\t\t$model_keyword->keyword = $keyword;\n\t\t\t$model_keyword->save();\n\t\t}\n\t\t\n\t\t//Add keyword into product frequency table\n\t\tif($product_keyword->find_by_field_array(array('keyword_id' => $model_keyword->id,'product_id' => $product_id)))\n\t\t\t$product_keyword->frequency += $frequency;\t//If keyword was found in say title and description\t\t\n\t\telse\n\t\t{\n\t\t\t$product_keyword->keyword_id \t= $model_keyword->id;\n\t\t\t$product_keyword->product_id \t= $product_id;\n\t\t\t$product_keyword->frequency \t= $frequency;\t\t\t\n\t\t}\n\t\t\n\t\treturn $product_keyword->save();\t\t\n\t}", "public function setKeyWord($key){\n $this->keyword = $key;\n }", "protected function _syncKeywords() {}", "function update_termmeta_cache($term_ids)\n {\n }", "private function rebuildIndex()\n {\n foreach ($this->rows as $id => $row) {\n $label = $row->getColumn('label');\n if ($label !== false) {\n $this->rowsIndexByLabel[$label] = $id;\n }\n }\n $this->indexNotUpToDate = false;\n }", "private function removeOldResults($key){\n\t\tSearch::where('key', '=', $key)->delete();\n\t}", "protected function _prepare_term($term)\n {\n }", "private function initSearchTerm() {\n\t\t$q = 'SELECT count(*) FROM twitterSearch WHERE searchTerm = \"' .$this->_searchString .'\"';\n\t\tif ($this->_testMode) {print \"(init) created a row, q = \" .$q .\"<br> \";}\n\t\t$r = mysql_query($q, CONN) or die('could not select the number of rows for the search term in initting');\n\t\t$arr = mysql_fetch_array($r);\n\t\t$numRows = $arr['count(*)'];\n\t\t\n\t\tif ($numRows == 0) {\n\t\t\t$q = 'INSERT INTO twitterSearch (searchTerm) VALUES (\"' .$this->_searchString .'\")';\n\t\t\t$r = mysql_query($q, CONN) or die('could not create the new row for the search term in init()');\n\t\t\tif ($this->_testMode) {print \"(init) created a row, q = \" .$q .\"<br> \";}\n\t\t}\n\t\telse {\n\t\t\tif ($this->_testMode) {print \"(init) no need to create a row<br>\";}\n\t\t}\n\t}", "function set_keywords_from_search_query()\n\t{\n\t\t$santizied_search_query = $this->get_sanitized_search_query($this->search_query);\n\t\n\t\t$keywords_to_search_for = explode(' ',$santizied_search_query);\n\t\t$unique_keywords = array_unique($keywords_to_search_for);\n\t\t\n\t\t$this->keywords_to_search_for = $this->remove_ignored_keywords_from_array($unique_keywords);\n\t}", "public function rebuildIndex()\n {\n $this->elastic->deleteIndex(self::INDEX);\n $this->elastic->addIndexCompanion(self::INDEX);\n }", "function searchesEditSearch($text){\n array_push($text, array('key' => 'PARENT_SEARCHES_EDIT_SEARCH',\n 'parent' => '',\n 'text' => 'Search - Edit search'));\n \n array_push($text, array('key' => 'SEARCHES_EDIT_SEARCH',\n 'parent' => 'PARENT_SEARCHES_EDIT_SEARCH',\n 'text' => 'Edit search details'));\n array_push($text, array('key' => 'SEARCHES_EDIT_SEARCH_SETTINGS',\n 'parent' => 'PARENT_SEARCHES_EDIT_SEARCH',\n 'text' => 'Edit search settings'));\n \n array_push($text, array('key' => 'SEARCHES_EDIT_SEARCH_EXCLUDED_CALENDARS_DAYS',\n 'parent' => 'PARENT_SEARCHES_EDIT_SEARCH',\n 'text' => 'Exclude calendars from search [hours filters disabled]'));\n array_push($text, array('key' => 'SEARCHES_EDIT_SEARCH_EXCLUDED_CALENDARS_HOURS',\n 'parent' => 'PARENT_SEARCHES_EDIT_SEARCH',\n 'text' => 'Exclude calendars from search [hours filters enabled]'));\n \n array_push($text, array('key' => 'SEARCHES_EDIT_SEARCH_NO_CALENDARS',\n 'parent' => 'PARENT_SEARCHES_EDIT_SEARCH',\n 'text' => 'There are no calendars created. Go to <a href=\"%s\">calendars</a> page to create one.'));\n \n return $text;\n }", "public static function action_edited_term( $term_id ) {\n\t\tself::purge_term( $term_id );\n\t}", "function mx_add_search_words($mode, $post_id, $post_text, $post_title = '', $mx_mode = 'mx')\n\t{\n\t\tglobal $db, $config, $lang;\n\n\t\t// $search_match_table = SEARCH_MATCH_TABLE;\n\t\t// $search_word_table = SEARCH_WORD_TABLE;\n\n\t\tswitch ($mx_mode)\n\t\t{\n\t\t\tcase 'mx':\n\t\t\t\t$search_match_table = MX_MATCH_TABLE;\n\t\t\t\t$search_word_table = MX_WORD_TABLE;\n\t\t\t\t$db_key = 'block_id';\n\t\t\tbreak;\n\t\t\tcase 'kb':\n\t\t\t\t$search_match_table = KB_MATCH_TABLE;\n\t\t\t\t$search_word_table = KB_WORD_TABLE;\n\t\t\t\t$db_key = 'article_id';\n\t\t\tbreak;\n\t\t}\n\n\t\tstopwords_synonyms_init();\n\n\t\t$search_raw_words = array();\n\t\t$search_raw_words['text'] = split_words(clean_words('post', $post_text, $stopwords_array, $synonyms_array));\n\t\t$search_raw_words['title'] = split_words(clean_words('post', $post_title, $stopwords_array, $synonyms_array));\n\n\t\t@set_time_limit(0);\n\n\t\t$word = array();\n\t\t$word_insert_sql = array();\n\t\twhile (list($word_in, $search_matches) = @each($search_raw_words))\n\t\t{\n\t\t\t$word_insert_sql[$word_in] = '';\n\t\t\tif (!empty($search_matches))\n\t\t\t{\n\t\t\t\tfor ($i = 0; $i < sizeof($search_matches); $i++)\n\t\t\t\t{\n\t\t\t\t\t$search_matches[$i] = trim($search_matches[$i]);\n\n\t\t\t\t\tif($search_matches[$i] != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$word[] = $search_matches[$i];\n\t\t\t\t\t\tif (!strstr($word_insert_sql[$word_in], \"'\" . $search_matches[$i] . \"'\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$word_insert_sql[$word_in] .= ($word_insert_sql[$word_in] != \"\") ? \", '\" . $search_matches[$i] . \"'\" : \"'\" . $search_matches[$i] . \"'\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (sizeof($word))\n\t\t{\n\t\t\tsort($word);\n\n\t\t\t$prev_word = '';\n\t\t\t$word_text_sql = '';\n\t\t\t$temp_word = array();\n\t\t\tfor($i = 0; $i < sizeof($word); $i++)\n\t\t\t{\n\t\t\t\tif ($word[$i] != $prev_word)\n\t\t\t\t{\n\t\t\t\t\t$temp_word[] = $word[$i];\n\t\t\t\t\t$word_text_sql .= (($word_text_sql != '') ? ', ' : '') . \"'\" . $word[$i] . \"'\";\n\t\t\t\t}\n\t\t\t\t$prev_word = $word[$i];\n\t\t\t}\n\t\t\t$word = $temp_word;\n\n\t\t\t$check_words = array();\n\n\t\t\t$value_sql = '';\n\t\t\t$match_word = array();\n\t\t\tfor ($i = 0; $i < sizeof($word); $i++)\n\t\t\t{\n\t\t\t\t$new_match = true;\n\t\t\t\tif (isset($check_words[$word[$i]]))\n\t\t\t\t{\n\t\t\t\t\t$new_match = false;\n\t\t\t\t}\n\n\t\t\t\tif ($new_match)\n\t\t\t\t{\n\t\t\t\t\t$value_sql .= (($value_sql != '') ? ', ' : '') . '(\\'' . $word[$i] . '\\', 0)';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($value_sql != '')\n\t\t\t{\n\t\t\t\t$sql = \"INSERT IGNORE INTO \" . $search_word_table . \" (word_text, word_common) VALUES $value_sql\";\n\t\t\t\t$db->sql_query($sql);\n\t\t\t}\n\t\t}\n\n\t\twhile(list($word_in, $match_sql) = @each($word_insert_sql))\n\t\t{\n\t\t\t$title_match = ($word_in == 'title') ? 1 : 0;\n\n\t\t\tif ($match_sql != '')\n\t\t\t{\n\t\t\t\t$sql = \"INSERT INTO \" . $search_match_table . \" ($db_key, word_id, title_match)\n\t\t\t\t\tSELECT $post_id, word_id, $title_match\n\t\t\t\t\t\tFROM \" . $search_word_table . \"\n\t\t\t\t\t\tWHERE word_text IN ($match_sql)\";\n\t\t\t\t$db->sql_query($sql);\n\t\t\t}\n\t\t}\n\n\t\tif ($mode == 'single')\n\t\t{\n\t\t\t// remove_common('single', 4/10, $word);\n\t\t}\n\n\t\treturn;\n\t}", "function _culturefeed_search_ui_sanitize_query_term($term) {\n // Replace special characters with normal ones.\n $term = culturefeed_search_transliterate($term);\n\n // Replace AND to a space.\n $term = str_replace(' AND ', ' ', $term);\n\n $query_parts = explode(' OR ', $term);\n array_walk($query_parts, function(&$search_string) {\n\n // Strip of words between quotes. The spaces don't need to be replaced to AND for them.\n preg_match_all('/\".*?\"/', $search_string, $matches);\n foreach ($matches[0] as $match) {\n $search_string = str_replace($match, '', $search_string);\n }\n\n $search_string = str_replace(' ', ' ', $search_string);\n\n // Put words with a special character between quotes.\n $words = explode(' ', trim($search_string));\n $parts = array();\n $special_characters = '-!?&/';\n foreach ($words as $word) {\n if (strpbrk($word, $special_characters)) {\n $word = '\"' . $word . '\"';\n }\n $parts[] = $word;\n }\n\n // Replace spaces between multiple search words by 'AND'.\n $search_string = implode(' AND ', $parts);\n\n // Add back the words between quotes.\n if (!empty($matches[0])) {\n if (empty($search_string)) {\n $search_string .= implode(' AND ', $matches[0]);\n }\n else {\n $search_string .= ' AND ' . implode(' AND ', $matches[0]);\n }\n }\n\n });\n\n return implode(' OR ', $query_parts);\n}" ]
[ "0.57552", "0.57265663", "0.5356105", "0.5284815", "0.5258372", "0.517849", "0.49408466", "0.48971274", "0.4832164", "0.4813756", "0.4807403", "0.48006803", "0.47924563", "0.4729824", "0.47278336", "0.4712542", "0.4662237", "0.46371254", "0.46255758", "0.46247804", "0.4608346", "0.46060872", "0.45759082", "0.4570089", "0.45565316", "0.45477226", "0.45264935", "0.4517937", "0.4515813", "0.4506824" ]
0.72409534
0
Updates a single row with a newley calculated search key. The search key is calculated using TermSqlIndex::getSearchKey().
protected function updateSearchKey( DatabaseBase $dbw, $rowId, $text ) { $key = $this->table->getSearchKey( $text ); if ( $key === '' ) { wfDebugLog( __CLASS__, __FUNCTION__ . ": failed to normalized term: $text" ); return false; } wfDebugLog( __CLASS__, __FUNCTION__ . ": row_id = $rowId, search_key = `$key`" ); $dbw->update( $this->table->getTableName(), array( 'term_search_key' => $key, ), array( 'term_row_id' => $rowId, ), __METHOD__ ); return $key; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rebuildSearchKey() {\n\t\t$dbw = $this->table->getWriteDb();\n\n\t\t$rowId = $this->fromId - 1;\n\n\t\t$total = 0;\n\n\t\twhile ( true ) {\n\t\t\t// Make sure we are not running too far ahead of the slaves,\n\t\t\t// as that would cause the site to be rendered read only.\n\t\t\twfWaitForSlaves();\n\n\t\t\t$dbw->begin();\n\n\t\t\t$terms = $dbw->select(\n\t\t\t\t$this->table->getTableName(),\n\t\t\t\tarray(\n\t\t\t\t\t'term_row_id',\n\t\t\t\t\t'term_language',\n\t\t\t\t\t'term_text',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'term_row_id > ' . (int) $rowId,\n\t\t\t\t\t$this->all ? '1' : 'term_search_key = \\'\\'', // if not $all, only set missing keys\n\t\t\t\t),\n\t\t\t\t__METHOD__,\n\t\t\t\tarray(\n\t\t\t\t\t'LIMIT' => $this->batchSize,\n\t\t\t\t\t'ORDER BY' => 'term_row_id ASC',\n\t\t\t\t\t'FOR UPDATE'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$c = 0;\n\t\t\t$cError = 0;\n\n\t\t\tforeach ( $terms as $row ) {\n\t\t\t\t$key = $this->updateSearchKey( $dbw, $row->term_row_id, $row->term_text );\n\n\t\t\t\tif ( $key === false ) {\n\t\t\t\t\t$this->report( \"Unable to calculate search key for \" . $row->term_text );\n\t\t\t\t\t$cError += 1;\n\t\t\t\t} else {\n\t\t\t\t\t$c += 1;\n\t\t\t\t}\n\n\t\t\t\t$rowId = $row->term_row_id;\n\t\t\t}\n\n\t\t\t$dbw->commit();\n\n\t\t\t$this->report( \"Updated $c search keys (skipped $cError), up to row $rowId.\" );\n\t\t\t$total += $c;\n\n\t\t\tif ( $c < $this->batchSize ) {\n\t\t\t\t// we are done.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $total;\n\t}", "public function updateRow($row);", "public function update(){\n static::setConnection();\n $table = static::$table;\n $keyColumn = static::$keyColumn;\n $sql = \"UPDATE \".$table.\" SET \";\n foreach($this as $k=>$v){\n $sql .= $k.\" = '\".$v.\"',\";\n }\n $sql = trim($sql, ',');\n $sql .= \" WHERE \".$keyColumn.\" = \".$this->keyColumn;\n mysqli_query(static::$conn, $sql);\n }", "public function table_index_edit ( $tname, $field, $value, $key )\n\t{\n\t}", "public function updateRecord() \n {\n $str = \"Id = :Id\";\n array_walk($this->arrayKeysValues(), function ($value, $key) use (&$str) {\n $str .= \", $key = :$key\";\n });\n $sql = sprintf(\"UPDATE Cubans SET %s WHERE Id = :Id\", $str);\n $statement = $this->connect->prepare($sql);\n $statement->execute(array_merge([\":Id\" => $this->id], $this->arrayKeysValues()));\n }", "public function key($sql);", "public function testUpdateKey()\n {\n }", "public function modifyQuery($query, SearchTerm $search);", "function update_product_in_search_index($product_id)\n\t{\n\t\t$this->remove_product_from_search_index($product_id);\n\t\t\n\t\t$this->add_product_to_search_index($product_id);\n\t}", "function EditRow() {\n\t\tglobal $conn, $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t\tif ($this->fbid->CurrentValue <> \"\") { // Check field with unique index\n\t\t\t$sFilterChk = \"(`fbid` = \" . ew_AdjustSql($this->fbid->CurrentValue) . \")\";\n\t\t\t$sFilterChk .= \" AND NOT (\" . $sFilter . \")\";\n\t\t\t$this->CurrentFilter = $sFilterChk;\n\t\t\t$sSqlChk = $this->SQL();\n\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t$rsChk = $conn->Execute($sSqlChk);\n\t\t\t$conn->raiseErrorFn = '';\n\t\t\tif ($rsChk === FALSE) {\n\t\t\t\treturn FALSE;\n\t\t\t} elseif (!$rsChk->EOF) {\n\t\t\t\t$sIdxErrMsg = str_replace(\"%f\", $this->fbid->FldCaption(), $Language->Phrase(\"DupIndex\"));\n\t\t\t\t$sIdxErrMsg = str_replace(\"%v\", $this->fbid->CurrentValue, $sIdxErrMsg);\n\t\t\t\t$this->setFailureMessage($sIdxErrMsg);\n\t\t\t\t$rsChk->Close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t$rsChk->Close();\n\t\t}\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$rsnew = array();\n\n\t\t\t// fbid\n\t\t\t$this->fbid->SetDbValueDef($rsnew, $this->fbid->CurrentValue, NULL, $this->fbid->ReadOnly);\n\n\t\t\t// name\n\t\t\t$this->name->SetDbValueDef($rsnew, $this->name->CurrentValue, \"\", $this->name->ReadOnly);\n\n\t\t\t// email\n\t\t\t$this->_email->SetDbValueDef($rsnew, $this->_email->CurrentValue, \"\", $this->_email->ReadOnly);\n\n\t\t\t// password\n\t\t\t$this->password->SetDbValueDef($rsnew, $this->password->CurrentValue, NULL, $this->password->ReadOnly);\n\n\t\t\t// validated_mobile\n\t\t\t$this->validated_mobile->SetDbValueDef($rsnew, $this->validated_mobile->CurrentValue, NULL, $this->validated_mobile->ReadOnly);\n\n\t\t\t// role_id\n\t\t\t$this->role_id->SetDbValueDef($rsnew, $this->role_id->CurrentValue, 0, $this->role_id->ReadOnly);\n\n\t\t\t// image\n\t\t\t$this->image->SetDbValueDef($rsnew, $this->image->CurrentValue, NULL, $this->image->ReadOnly);\n\n\t\t\t// newsletter\n\t\t\t$this->newsletter->SetDbValueDef($rsnew, $this->newsletter->CurrentValue, 0, $this->newsletter->ReadOnly);\n\n\t\t\t// points\n\t\t\t$this->points->SetDbValueDef($rsnew, $this->points->CurrentValue, NULL, $this->points->ReadOnly);\n\n\t\t\t// last_modified\n\t\t\t$this->last_modified->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->last_modified->CurrentValue, 7), NULL, $this->last_modified->ReadOnly);\n\n\t\t\t// p2\n\t\t\t$this->p2->SetDbValueDef($rsnew, $this->p2->CurrentValue, NULL, $this->p2->ReadOnly || (EW_ENCRYPTED_PASSWORD && $rs->fields('p2') == $this->p2->CurrentValue));\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\tif ($EditRow) {\n\t\t\t$this->WriteAuditTrailOnEdit($rsold, $rsnew);\n\t\t}\n\t\t$rs->Close();\n\t\treturn $EditRow;\n\t}", "private function cObjData_updateRow( $uid )\n {\n static $firstVisit = true;\n\n // RETURN: empty row\n if ( empty( $this->rows[ $uid ] ) )\n {\n return;\n }\n // RETURN: empty row\n // Add each element of the row to cObj->data\n foreach ( ( array ) $this->rows[ $uid ] as $key => $value )\n {\n $this->pObj->cObj->data[ $key ] = $value;\n }\n\n // Add the field uid with the uid of the current row\n $key = $this->sql_filterFields[ $this->curr_tableField ][ 'uid' ];\n $value = $this->rows[ $uid ][ $key ];\n $this->pObj->cObj->data[ 'uid' ] = $value;\n\n // Add the field value with the value of the current row\n $key = $this->sql_filterFields[ $this->curr_tableField ][ 'value' ];\n $value = $this->rows[ $uid ][ $key ];\n $this->pObj->cObj->data[ 'value' ] = $value;\n\n // Add the field hits with the hits of the filter item\n $key = $this->sql_filterFields[ $this->curr_tableField ][ 'hits' ];\n $value = $this->rows[ $uid ][ $key ];\n $this->pObj->cObj->data[ 'hits' ] = $value;\n//$this->pObj->dev_var_dump( $this->pObj->cObj->data['hits'] );\n // Add the field rowNumber with the number of the current row\n $key = $this->pObj->prefixId . '.rowNumber';\n $value = $this->itemsPerHtmlRow[ 'currItemNumberInRow' ];\n\n // DRS\n if ( $firstVisit && $this->pObj->b_drs_cObjData )\n {\n foreach ( ( array ) $this->pObj->cObj->data as $key => $value )\n {\n $arr_prompt[] = '\\'' . $key . '\\' => \\'' . $value . '\\'';\n }\n $prompt = 'cObj->data of the first row: ' . implode( '; ', ( array ) $arr_prompt );\n t3lib_div::devlog( '[OK/COBJ] ' . $prompt, $this->pObj->extKey, -1 );\n }\n // DRS\n\n $firstVisit = false;\n }", "public function update(phpDataMapper_Model_Row $row)\n\t{\n\t\t// Get \"col = :col\" pairs for the update query\n\t\t$placeholders = array();\n\t\t$binds = array();\n\t\tforeach($row->getDataModified() as $field => $value) {\n\t\t\tif($this->fieldExists($field)) {\n\t\t\t\t$placeholders[] = $field . \" = :\" . $field . \"\";\n\t\t\t\t// Empty values will be NULL (easier to be handled by databases)\n\t\t\t\t$binds[$field] = $this->isEmpty($value) ? null : $value;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Ensure there are actually updated values on THIS table\n\t\tif(count($placeholders) > 0) {\n\t\t\t// Build the query\n\t\t\t$sql = \"UPDATE \" . $this->getTable() .\n\t\t\t\t\" SET \" . implode(', ', $placeholders) .\n\t\t\t\t\" WHERE \" . $this->getPrimaryKeyField() . \" = '\" . $this->getPrimaryKey($row) . \"'\";\n\t\t\t\n\t\t\t// Add query to log\n\t\t\t$this->logQuery($sql, $binds);\n\t\t\t\n\t\t\t// Prepare update query\n\t\t\t$stmt = $this->adapter->prepare($sql);\n\t\t\t\n\t\t\t// Bind column values\n\t\t\t$this->bindValues($stmt, $binds);\n\t\t\t\n\t\t\tif($stmt) {\n\t\t\t\t// Execute\n\t\t\t\tif($stmt->execute($binds)) {\n\t\t\t\t\t$result = $this->getPrimaryKey($row);\n\t\t\t\t} else {\n\t\t\t\t\t$result = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$result = false;\n\t\t\t}\n\t\t} else {\n\t\t\t$result = false;\n\t\t}\n\t\t\n\t\t// Save related rows\n\t\tif($result) {\n\t\t\t$this->saveRelatedRowsFor($row);\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "protected function _update() {\n $this->_getDef();\n \n //prepare\n foreach ($this->_tableData as $field) {\n if($field['primary']) {\n $primaryKey = $field['field_name'];\n $primaryValue = $this->$primaryKey;\n continue;\n }\n \n $sql_fields[] = '`' . $field['field_name'] . '` =?';\n \n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n if($this->$field_name instanceof \\DateTime){\n $$field_name = $this->$field_name->format('Y-m-d H:i:s');\n } elseif(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n } else {\n $$field_name = $this->$field_name;\n }\n \n $values[] = $$field_name;\n }\n \n $values[] = $primaryValue;\n \n $sql = \"UPDATE `{$this->_table}` SET \" . implode(',', $sql_fields) . \" WHERE `{$primaryKey}` =?\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $this->setLastError(NULL);\n if($stmt->error !== ''){\n $this->setLastError($stmt->error);\n }\n \n $stmt->close();\n \n return $this->getLastError() === NULL ? true : false;\n }", "function update() {\n\t\t\t$updateQuery = \"UPDATE \".$this->table.\" SET \";\n\n\t\t\t$keysAR = array_keys($this->activeRecord);\n\n\t\t\tfor ($loopUp = 0; $loopUp < count($this->activeRecord); $loopUp++) {\n\n $updateQuery .= $keysAR[$loopUp] . \" = ?, \";\n $paramArray[] = $this->activeRecord[$keysAR[$loopUp]];\n\n\t\t\t}\n\n\t\t\t$updateQuery = substr($updateQuery, 0, -2); // Haal de laatste komma weg.\n\n\t\t\t$updateQuery .= \" WHERE \";\n\n\t\t\t// Fetch de primary key van de tabel.\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n $updateQuery .= $kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\n\t\t\t$this->lastQuery = $updateQuery;\n\n $updateTable = $this->mysqlConnection->prepare($this->lastQuery);\n $updateTable->execute($paramArray);\n\n\t\t}", "function updateRowById ($tablename, $idField, $updatedRow)\n\t{\n\t\t$this->updateSetWhere($tablename, $updatedRow, \n\t\t\tnew SimpleWhereClause($idField, '=', $updatedRow[$idField]));\n\t}", "function _index_keyword($keyword, $product_id, $frequency)\n\t{\n\t\t$model_keyword \t\t=& model::create('keyword');\n\t\t$product_keyword \t=& model::create('product_keyword');\n\t\t\n\t\t//Insert unique keyword\n\t\tif(!$model_keyword->find_by_field('keyword',$keyword))\n\t\t{\n\t\t\t$model_keyword->keyword = $keyword;\n\t\t\t$model_keyword->save();\n\t\t}\n\t\t\n\t\t//Add keyword into product frequency table\n\t\tif($product_keyword->find_by_field_array(array('keyword_id' => $model_keyword->id,'product_id' => $product_id)))\n\t\t\t$product_keyword->frequency += $frequency;\t//If keyword was found in say title and description\t\t\n\t\telse\n\t\t{\n\t\t\t$product_keyword->keyword_id \t= $model_keyword->id;\n\t\t\t$product_keyword->product_id \t= $product_id;\n\t\t\t$product_keyword->frequency \t= $frequency;\t\t\t\n\t\t}\n\t\t\n\t\treturn $product_keyword->save();\t\t\n\t}", "function updateKeyField($id, $field, $value){\r\n\t\t $query = \"UPDATE \".TBL_USED_KEYS.\" SET \".$field.\" = :value WHERE key_id = :id\";\r\n\t\t $stmt = $this->connection->prepare($query);\r\n\t\t return $stmt->execute(array(':id' => $id, ':value' => $value));\r\n }", "function EditRow() {\n\t\tglobal $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$conn = &$this->Connection();\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$this->LoadDbValues($rsold);\n\t\t\t$rsnew = array();\n\n\t\t\t// nomr\n\t\t\t$this->nomr->SetDbValueDef($rsnew, $this->nomr->CurrentValue, \"\", $this->nomr->ReadOnly);\n\n\t\t\t// ket_nama\n\t\t\t$this->ket_nama->SetDbValueDef($rsnew, $this->ket_nama->CurrentValue, NULL, $this->ket_nama->ReadOnly);\n\n\t\t\t// ket_tgllahir\n\t\t\t$this->ket_tgllahir->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->ket_tgllahir->CurrentValue, 0), NULL, $this->ket_tgllahir->ReadOnly);\n\n\t\t\t// ket_alamat\n\t\t\t$this->ket_alamat->SetDbValueDef($rsnew, $this->ket_alamat->CurrentValue, NULL, $this->ket_alamat->ReadOnly);\n\n\t\t\t// ket_jeniskelamin\n\t\t\t$this->ket_jeniskelamin->SetDbValueDef($rsnew, $this->ket_jeniskelamin->CurrentValue, NULL, $this->ket_jeniskelamin->ReadOnly);\n\n\t\t\t// ket_title\n\t\t\t$this->ket_title->SetDbValueDef($rsnew, $this->ket_title->CurrentValue, NULL, $this->ket_title->ReadOnly);\n\n\t\t\t// dokterpengirim\n\t\t\t$this->dokterpengirim->SetDbValueDef($rsnew, $this->dokterpengirim->CurrentValue, 0, $this->dokterpengirim->ReadOnly);\n\n\t\t\t// statusbayar\n\t\t\t$this->statusbayar->SetDbValueDef($rsnew, $this->statusbayar->CurrentValue, 0, $this->statusbayar->ReadOnly);\n\n\t\t\t// kirimdari\n\t\t\t$this->kirimdari->SetDbValueDef($rsnew, $this->kirimdari->CurrentValue, 0, $this->kirimdari->ReadOnly);\n\n\t\t\t// keluargadekat\n\t\t\t$this->keluargadekat->SetDbValueDef($rsnew, $this->keluargadekat->CurrentValue, \"\", $this->keluargadekat->ReadOnly);\n\n\t\t\t// panggungjawab\n\t\t\t$this->panggungjawab->SetDbValueDef($rsnew, $this->panggungjawab->CurrentValue, \"\", $this->panggungjawab->ReadOnly);\n\n\t\t\t// masukrs\n\t\t\t$this->masukrs->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->masukrs->CurrentValue, 0), NULL, $this->masukrs->ReadOnly);\n\n\t\t\t// noruang\n\t\t\t$this->noruang->SetDbValueDef($rsnew, $this->noruang->CurrentValue, 0, $this->noruang->ReadOnly);\n\n\t\t\t// tempat_tidur_id\n\t\t\t$this->tempat_tidur_id->SetDbValueDef($rsnew, $this->tempat_tidur_id->CurrentValue, 0, $this->tempat_tidur_id->ReadOnly);\n\n\t\t\t// nott\n\t\t\t$this->nott->SetDbValueDef($rsnew, $this->nott->CurrentValue, \"\", $this->nott->ReadOnly);\n\n\t\t\t// NIP\n\t\t\t$this->NIP->SetDbValueDef($rsnew, $this->NIP->CurrentValue, \"\", $this->NIP->ReadOnly);\n\n\t\t\t// dokter_penanggungjawab\n\t\t\t$this->dokter_penanggungjawab->SetDbValueDef($rsnew, $this->dokter_penanggungjawab->CurrentValue, 0, $this->dokter_penanggungjawab->ReadOnly);\n\n\t\t\t// KELASPERAWATAN_ID\n\t\t\t$this->KELASPERAWATAN_ID->SetDbValueDef($rsnew, $this->KELASPERAWATAN_ID->CurrentValue, NULL, $this->KELASPERAWATAN_ID->ReadOnly);\n\n\t\t\t// NO_SKP\n\t\t\t$this->NO_SKP->SetDbValueDef($rsnew, $this->NO_SKP->CurrentValue, NULL, $this->NO_SKP->ReadOnly);\n\n\t\t\t// sep_tglsep\n\t\t\t$this->sep_tglsep->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->sep_tglsep->CurrentValue, 5), NULL, $this->sep_tglsep->ReadOnly);\n\n\t\t\t// sep_tglrujuk\n\t\t\t$this->sep_tglrujuk->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->sep_tglrujuk->CurrentValue, 5), NULL, $this->sep_tglrujuk->ReadOnly);\n\n\t\t\t// sep_kodekelasrawat\n\t\t\t$this->sep_kodekelasrawat->SetDbValueDef($rsnew, $this->sep_kodekelasrawat->CurrentValue, NULL, $this->sep_kodekelasrawat->ReadOnly);\n\n\t\t\t// sep_norujukan\n\t\t\t$this->sep_norujukan->SetDbValueDef($rsnew, $this->sep_norujukan->CurrentValue, NULL, $this->sep_norujukan->ReadOnly);\n\n\t\t\t// sep_kodeppkasal\n\t\t\t$this->sep_kodeppkasal->SetDbValueDef($rsnew, $this->sep_kodeppkasal->CurrentValue, NULL, $this->sep_kodeppkasal->ReadOnly);\n\n\t\t\t// sep_namappkasal\n\t\t\t$this->sep_namappkasal->SetDbValueDef($rsnew, $this->sep_namappkasal->CurrentValue, NULL, $this->sep_namappkasal->ReadOnly);\n\n\t\t\t// sep_kodeppkpelayanan\n\t\t\t$this->sep_kodeppkpelayanan->SetDbValueDef($rsnew, $this->sep_kodeppkpelayanan->CurrentValue, NULL, $this->sep_kodeppkpelayanan->ReadOnly);\n\n\t\t\t// sep_jenisperawatan\n\t\t\t$this->sep_jenisperawatan->SetDbValueDef($rsnew, $this->sep_jenisperawatan->CurrentValue, NULL, $this->sep_jenisperawatan->ReadOnly);\n\n\t\t\t// sep_catatan\n\t\t\t$this->sep_catatan->SetDbValueDef($rsnew, $this->sep_catatan->CurrentValue, NULL, $this->sep_catatan->ReadOnly);\n\n\t\t\t// sep_kodediagnosaawal\n\t\t\t$this->sep_kodediagnosaawal->SetDbValueDef($rsnew, $this->sep_kodediagnosaawal->CurrentValue, NULL, $this->sep_kodediagnosaawal->ReadOnly);\n\n\t\t\t// sep_namadiagnosaawal\n\t\t\t$this->sep_namadiagnosaawal->SetDbValueDef($rsnew, $this->sep_namadiagnosaawal->CurrentValue, NULL, $this->sep_namadiagnosaawal->ReadOnly);\n\n\t\t\t// sep_lakalantas\n\t\t\t$this->sep_lakalantas->SetDbValueDef($rsnew, $this->sep_lakalantas->CurrentValue, NULL, $this->sep_lakalantas->ReadOnly);\n\n\t\t\t// sep_lokasilaka\n\t\t\t$this->sep_lokasilaka->SetDbValueDef($rsnew, $this->sep_lokasilaka->CurrentValue, NULL, $this->sep_lokasilaka->ReadOnly);\n\n\t\t\t// sep_user\n\t\t\t$this->sep_user->SetDbValueDef($rsnew, $this->sep_user->CurrentValue, NULL, $this->sep_user->ReadOnly);\n\n\t\t\t// sep_flag_cekpeserta\n\t\t\t$this->sep_flag_cekpeserta->SetDbValueDef($rsnew, $this->sep_flag_cekpeserta->CurrentValue, NULL, $this->sep_flag_cekpeserta->ReadOnly);\n\n\t\t\t// sep_flag_generatesep\n\t\t\t$this->sep_flag_generatesep->SetDbValueDef($rsnew, $this->sep_flag_generatesep->CurrentValue, NULL, $this->sep_flag_generatesep->ReadOnly);\n\n\t\t\t// sep_nik\n\t\t\t$this->sep_nik->SetDbValueDef($rsnew, $this->sep_nik->CurrentValue, NULL, $this->sep_nik->ReadOnly);\n\n\t\t\t// sep_namapeserta\n\t\t\t$this->sep_namapeserta->SetDbValueDef($rsnew, $this->sep_namapeserta->CurrentValue, NULL, $this->sep_namapeserta->ReadOnly);\n\n\t\t\t// sep_jeniskelamin\n\t\t\t$this->sep_jeniskelamin->SetDbValueDef($rsnew, $this->sep_jeniskelamin->CurrentValue, NULL, $this->sep_jeniskelamin->ReadOnly);\n\n\t\t\t// sep_pisat\n\t\t\t$this->sep_pisat->SetDbValueDef($rsnew, $this->sep_pisat->CurrentValue, NULL, $this->sep_pisat->ReadOnly);\n\n\t\t\t// sep_tgllahir\n\t\t\t$this->sep_tgllahir->SetDbValueDef($rsnew, $this->sep_tgllahir->CurrentValue, NULL, $this->sep_tgllahir->ReadOnly);\n\n\t\t\t// sep_kodejeniskepesertaan\n\t\t\t$this->sep_kodejeniskepesertaan->SetDbValueDef($rsnew, $this->sep_kodejeniskepesertaan->CurrentValue, NULL, $this->sep_kodejeniskepesertaan->ReadOnly);\n\n\t\t\t// sep_namajeniskepesertaan\n\t\t\t$this->sep_namajeniskepesertaan->SetDbValueDef($rsnew, $this->sep_namajeniskepesertaan->CurrentValue, NULL, $this->sep_namajeniskepesertaan->ReadOnly);\n\n\t\t\t// sep_nokabpjs\n\t\t\t$this->sep_nokabpjs->SetDbValueDef($rsnew, $this->sep_nokabpjs->CurrentValue, NULL, $this->sep_nokabpjs->ReadOnly);\n\n\t\t\t// sep_status_peserta\n\t\t\t$this->sep_status_peserta->SetDbValueDef($rsnew, $this->sep_status_peserta->CurrentValue, NULL, $this->sep_status_peserta->ReadOnly);\n\n\t\t\t// sep_umur_pasien_sekarang\n\t\t\t$this->sep_umur_pasien_sekarang->SetDbValueDef($rsnew, $this->sep_umur_pasien_sekarang->CurrentValue, NULL, $this->sep_umur_pasien_sekarang->ReadOnly);\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($EditRow) {\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\t\treturn $EditRow;\n\t}", "function EditRow() {\n\t\tglobal $conn, $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$rsnew = array();\n\n\t\t\t// model_id\n\t\t\t$this->model_id->SetDbValueDef($rsnew, $this->model_id->CurrentValue, 0, $this->model_id->ReadOnly);\n\n\t\t\t// title\n\t\t\t$this->title->SetDbValueDef($rsnew, $this->title->CurrentValue, NULL, $this->title->ReadOnly);\n\n\t\t\t// description\n\t\t\t$this->description->SetDbValueDef($rsnew, $this->description->CurrentValue, NULL, $this->description->ReadOnly);\n\n\t\t\t// s_order\n\t\t\t$this->s_order->SetDbValueDef($rsnew, $this->s_order->CurrentValue, 0, $this->s_order->ReadOnly);\n\n\t\t\t// status\n\t\t\t$this->status->SetDbValueDef($rsnew, $this->status->CurrentValue, 0, $this->status->ReadOnly);\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\t\treturn $EditRow;\n\t}", "function EditRow() {\r\n\t\tglobal $conn, $Security, $Language, $rekeningju;\r\n\t\t$sFilter = $rekeningju->KeyFilter();\r\n\t\t$rekeningju->CurrentFilter = $sFilter;\r\n\t\t$sSql = $rekeningju->SQL();\r\n\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE)\r\n\t\t\treturn FALSE;\r\n\t\tif ($rs->EOF) {\r\n\t\t\t$EditRow = FALSE; // Update Failed\r\n\t\t} else {\r\n\r\n\t\t\t// Save old values\r\n\t\t\t$rsold =& $rs->fields;\r\n\t\t\t$rsnew = array();\r\n\r\n\t\t\t// NoRek\r\n\t\t\t$rekeningju->NoRek->SetDbValueDef($rsnew, $rekeningju->NoRek->CurrentValue, \"\", $rekeningju->NoRek->ReadOnly);\r\n\r\n\t\t\t// Keterangan\r\n\t\t\t$rekeningju->Keterangan->SetDbValueDef($rsnew, $rekeningju->Keterangan->CurrentValue, NULL, $rekeningju->Keterangan->ReadOnly);\r\n\r\n\t\t\t// debet\r\n\t\t\t$rekeningju->debet->SetDbValueDef($rsnew, $rekeningju->debet->CurrentValue, 0, $rekeningju->debet->ReadOnly);\r\n\r\n\t\t\t// kredit\r\n\t\t\t$rekeningju->kredit->SetDbValueDef($rsnew, $rekeningju->kredit->CurrentValue, 0, $rekeningju->kredit->ReadOnly);\r\n\r\n\t\t\t// kode_bukti\r\n\t\t\t$rekeningju->kode_bukti->SetDbValueDef($rsnew, $rekeningju->kode_bukti->CurrentValue, NULL, $rekeningju->kode_bukti->ReadOnly);\r\n\r\n\t\t\t// tanggal\r\n\t\t\t$rekeningju->tanggal->SetDbValueDef($rsnew, ew_UnFormatDateTime($rekeningju->tanggal->CurrentValue, 7), ew_CurrentDate(), $rekeningju->tanggal->ReadOnly);\r\n\r\n\t\t\t// tanggal_nota\r\n\t\t\t$rekeningju->tanggal_nota->SetDbValueDef($rsnew, ew_UnFormatDateTime($rekeningju->tanggal_nota->CurrentValue, 7), ew_CurrentDate(), $rekeningju->tanggal_nota->ReadOnly);\r\n\r\n\t\t\t// kode_otomatis\r\n\t\t\t// kode_otomatis_tingkat\r\n\r\n\t\t\t$rekeningju->kode_otomatis_tingkat->SetDbValueDef($rsnew, $rekeningju->kode_otomatis_tingkat->CurrentValue, \"\", $rekeningju->kode_otomatis_tingkat->ReadOnly);\r\n\r\n\t\t\t// apakah_original\r\n\t\t\t$rekeningju->apakah_original->SetDbValueDef($rsnew, $rekeningju->apakah_original->CurrentValue, \"\", $rekeningju->apakah_original->ReadOnly);\r\n\r\n\t\t\t// Call Row Updating event\r\n\t\t\t$bUpdateRow = $rekeningju->Row_Updating($rsold, $rsnew);\r\n\t\t\tif ($bUpdateRow) {\r\n\t\t\t\t$conn->raiseErrorFn = 'ew_ErrorFn';\r\n\t\t\t\tif (count($rsnew) > 0)\r\n\t\t\t\t\t$EditRow = $conn->Execute($rekeningju->UpdateSQL($rsnew));\r\n\t\t\t\telse\r\n\t\t\t\t\t$EditRow = TRUE; // No field to update\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t} else {\r\n\t\t\t\tif ($rekeningju->CancelMessage <> \"\") {\r\n\t\t\t\t\t$this->setFailureMessage($rekeningju->CancelMessage);\r\n\t\t\t\t\t$rekeningju->CancelMessage = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\r\n\t\t\t\t}\r\n\t\t\t\t$EditRow = FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Call Row_Updated event\r\n\t\tif ($EditRow)\r\n\t\t\t$rekeningju->Row_Updated($rsold, $rsnew);\r\n\t\t$rs->Close();\r\n\t\treturn $EditRow;\r\n\t}", "public function updateRow($data)\r\n\t{\r\n\t\t$data = (array)$data;\r\n\t\t$data = $this->cleanupFieldNames($data);\r\n\t\t\r\n\t\t// Build SQL\r\n\t\t$sql = 'UPDATE `'.$this->name.'` SET ';\r\n\t\t$values = array();\r\n\t\t$pkFound = false;\r\n\t\tforeach($data as $key => $val)\r\n\t\t{\r\n\t\t\t// Ignore if field is not in table\r\n\t\t\tif (!$this->hasField($key))\r\n\t\t\t{\r\n\t\t\t\tunset($data[$key]);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t// Include value, but not if primary key and table has auto-incr PK\r\n\t\t\t$include = true;\r\n\t\t\tif ($key == $this->primaryKey)\r\n\t\t\t{\r\n\t\t\t\tif ($this->primaryKeyIsAutoIncrement)\r\n\t\t\t\t{\r\n\t\t\t\t\t$include = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Found non-empty primary key\r\n\t\t\t\tif (!empty($val))\r\n\t\t\t\t{\r\n\t\t\t\t\t$pkFound = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Include and process special value\r\n\t\t\tif ($include)\r\n\t\t\t{\r\n\t\t\t\tif ($val === 'NULL')\r\n\t\t\t\t{\r\n\t\t\t\t\t$values[] = \"`$key` = NULL\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$values[] = \"`$key` = :$key\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\t// Quit if has no primary key\r\n\t\tif (!$pkFound)\r\n\t\t{\r\n\t\t\tthrow new \\Exception('Cannot update: The supplied data does not contain a primary key');\r\n\t\t}\r\n\t\r\n\t\t// No fields were found - update makes no sense\r\n\t\tif (count($values) == 0)\r\n\t\t{\r\n\t\t\tthrow new \\Exception('No fields were added to the UPDATE query');\r\n\t\t}\r\n\t\t\t\r\n\t\t// Add values to query\r\n\t\t$sql .= implode(', ', $values);\r\n\t\r\n\t\t// Add where\r\n\t\t$sql .= ' WHERE `'.$this->primaryKey.'` = :' . $this->primaryKey;\r\n\r\n\t\t// Execute\r\n\t\t$result = $this->db->runQuery($sql, $data);\r\n\t\t\r\n\t\treturn $this->db->getAffectedRows();\r\n\t}", "function editRow($table_name, $key_column_name, $key_value, $row)\n {\n foreach($row as $column_name=>$column_value)\n {\n $this->editValue(\n $table_name,\n $key_column_name,\n $key_value,\n $column_name,\n $column_value);\n }\n }", "public function queryUpdate($table, $data, $where) : int;", "function EditRow() {\n\t\tglobal $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$conn = &$this->Connection();\n\t\tif ($this->Supplier_Number->CurrentValue <> \"\") { // Check field with unique index\n\t\t\t$sFilterChk = \"(`Supplier_Number` = '\" . ew_AdjustSql($this->Supplier_Number->CurrentValue, $this->DBID) . \"')\";\n\t\t\t$sFilterChk .= \" AND NOT (\" . $sFilter . \")\";\n\t\t\t$this->CurrentFilter = $sFilterChk;\n\t\t\t$sSqlChk = $this->SQL();\n\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"]; // v11.0.4\n\t\t\t$rsChk = $conn->Execute($sSqlChk);\n\t\t\t$conn->raiseErrorFn = '';\n\t\t\tif ($rsChk === FALSE) {\n\t\t\t\treturn FALSE;\n\t\t\t} elseif (!$rsChk->EOF) {\n\t\t\t\t$sIdxErrMsg = str_replace(\"%f\", $this->Supplier_Number->FldCaption(), $Language->Phrase(\"DupIndex\"));\n\t\t\t\t$sIdxErrMsg = str_replace(\"%v\", $this->Supplier_Number->CurrentValue, $sIdxErrMsg);\n\t\t\t\t$this->setFailureMessage($sIdxErrMsg);\n\t\t\t\t$rsChk->Close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t$rsChk->Close();\n\t\t}\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"]; // v11.0.4\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Begin transaction\n\t\t\tif ($this->getCurrentDetailTable() <> \"\")\n\t\t\t\t$conn->BeginTrans();\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$this->LoadDbValues($rsold);\n\t\t\t$rsnew = array();\n\n\t\t\t// Supplier_Number\n\t\t\t$this->Supplier_Number->SetDbValueDef($rsnew, $this->Supplier_Number->CurrentValue, \"\", $this->Supplier_Number->ReadOnly);\n\n\t\t\t// Supplier_Name\n\t\t\t$this->Supplier_Name->SetDbValueDef($rsnew, $this->Supplier_Name->CurrentValue, \"\", $this->Supplier_Name->ReadOnly);\n\n\t\t\t// Address\n\t\t\t$this->Address->SetDbValueDef($rsnew, $this->Address->CurrentValue, \"\", $this->Address->ReadOnly);\n\n\t\t\t// City\n\t\t\t$this->City->SetDbValueDef($rsnew, $this->City->CurrentValue, \"\", $this->City->ReadOnly);\n\n\t\t\t// Country\n\t\t\t$this->Country->SetDbValueDef($rsnew, $this->Country->CurrentValue, \"\", $this->Country->ReadOnly);\n\n\t\t\t// Contact_Person\n\t\t\t$this->Contact_Person->SetDbValueDef($rsnew, $this->Contact_Person->CurrentValue, \"\", $this->Contact_Person->ReadOnly);\n\n\t\t\t// Phone_Number\n\t\t\t$this->Phone_Number->SetDbValueDef($rsnew, $this->Phone_Number->CurrentValue, \"\", $this->Phone_Number->ReadOnly);\n\n\t\t\t// Email\n\t\t\t$this->_Email->SetDbValueDef($rsnew, $this->_Email->CurrentValue, \"\", $this->_Email->ReadOnly);\n\n\t\t\t// Mobile_Number\n\t\t\t$this->Mobile_Number->SetDbValueDef($rsnew, $this->Mobile_Number->CurrentValue, \"\", $this->Mobile_Number->ReadOnly);\n\n\t\t\t// Notes\n\t\t\t$this->Notes->SetDbValueDef($rsnew, $this->Notes->CurrentValue, \"\", $this->Notes->ReadOnly);\n\n\t\t\t// Balance\n\t\t\t$this->Balance->SetDbValueDef($rsnew, $this->Balance->CurrentValue, NULL, $this->Balance->ReadOnly);\n\n\t\t\t// Is_Stock_Available\n\t\t\t$this->Is_Stock_Available->SetDbValueDef($rsnew, ((strval($this->Is_Stock_Available->CurrentValue) == \"Y\") ? \"Y\" : \"N\"), \"N\", $this->Is_Stock_Available->ReadOnly);\n\n\t\t\t// Date_Added\n\t\t\t$this->Date_Added->SetDbValueDef($rsnew, $this->Date_Added->CurrentValue, NULL, $this->Date_Added->ReadOnly);\n\n\t\t\t// Added_By\n\t\t\t$this->Added_By->SetDbValueDef($rsnew, $this->Added_By->CurrentValue, NULL, $this->Added_By->ReadOnly);\n\n\t\t\t// Date_Updated\n\t\t\t$this->Date_Updated->SetDbValueDef($rsnew, ew_CurrentDateTime(), NULL);\n\t\t\t$rsnew['Date_Updated'] = &$this->Date_Updated->DbValue;\n\n\t\t\t// Updated_By\n\t\t\t$this->Updated_By->SetDbValueDef($rsnew, CurrentUserName(), NULL);\n\t\t\t$rsnew['Updated_By'] = &$this->Updated_By->DbValue;\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"]; // v11.0.4\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($EditRow) {\n\t\t\t\t}\n\n\t\t\t\t// Update detail records\n\t\t\t\tif ($EditRow) {\n\t\t\t\t\t$DetailTblVar = explode(\",\", $this->getCurrentDetailTable());\n\t\t\t\t\tif (in_array(\"a_purchases\", $DetailTblVar) && $GLOBALS[\"a_purchases\"]->DetailEdit) {\n\t\t\t\t\t\tif (!isset($GLOBALS[\"a_purchases_grid\"])) $GLOBALS[\"a_purchases_grid\"] = new ca_purchases_grid(); // Get detail page object\n\t\t\t\t\t\t$EditRow = $GLOBALS[\"a_purchases_grid\"]->GridUpdate();\n\t\t\t\t\t}\n\t\t\t\t\tif (in_array(\"a_stock_items\", $DetailTblVar) && $GLOBALS[\"a_stock_items\"]->DetailEdit) {\n\t\t\t\t\t\tif (!isset($GLOBALS[\"a_stock_items_grid\"])) $GLOBALS[\"a_stock_items_grid\"] = new ca_stock_items_grid(); // Get detail page object\n\t\t\t\t\t\t$EditRow = $GLOBALS[\"a_stock_items_grid\"]->GridUpdate();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Commit/Rollback transaction\n\t\t\t\tif ($this->getCurrentDetailTable() <> \"\") {\n\t\t\t\t\tif ($EditRow) {\n\t\t\t\t\t\t$conn->CommitTrans(); // Commit transaction\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$conn->RollbackTrans(); // Rollback transaction\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\t\treturn $EditRow;\n\t}", "function update($table, $items, $field, $key)\n {\n\t\t$this->db->where($field, $key);\n $this->db->update($table, $items);\n }", "public function reindexSearchDataElement(SmartElement $se)\n {\n $db = new SearchDomainDatabase($this->name);\n $db->updateSmartElement($se);\n }", "protected function updateRow()\n { \n $tableName = $this->getTableName($this->className);\n $assignedValues = $this->getAssignedValues();\n $updateDetails = [];\n\n for ($i = 0; $i < count($assignedValues['columns']); $i++) { \n array_push($updateDetails, $assignedValues['columns'][$i] .' =\\''. $assignedValues['values'][$i].'\\'');\n }\n\n $connection = Connection::connect();\n\n $allUpdates = implode(', ' , $updateDetails);\n $update = $connection->prepare('update '.$tableName.' set '. $allUpdates.' where id='.$this->resultRows[0]['id']);\n \n if ($update->execute()) { \n return 'Row updated';\n } else { \n throw new Exception(\"Unable to update row\"); \n }\n }", "function update( string $_group_key, IIndexedEntity $_entity ): bool;", "function inputted_to_sql_for_search($row,$i)\n\t{\n\t\treturn NULL;\n\t}", "public function SQL_UPDATE() {\r\n\t}" ]
[ "0.6247755", "0.6058836", "0.59340596", "0.5545855", "0.5473747", "0.5336259", "0.5326149", "0.532332", "0.52772194", "0.52581036", "0.5242321", "0.5217796", "0.52139866", "0.5209064", "0.51874864", "0.51552796", "0.5154423", "0.5124839", "0.51155907", "0.51115704", "0.51013815", "0.50913584", "0.50835824", "0.50825685", "0.5066424", "0.5057248", "0.5053418", "0.50356984", "0.50316674", "0.50199926" ]
0.67308545
0
Property API test example.
public function testPropertyGetTest() { $response = $this->get('/api/v1/properties/filter'); $response->assertStatus(200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetPeopertyValueMethod()\n {\n $firstname = 'Chris';\n $subject = new TestPropertySubject();\n $en = new Enforcer();\n\n $result = $en->getPropertyValue('firstname', $subject);\n $this->assertEquals($firstname, $result);\n }", "public function testProperty(): void\n {\n $property = $this->getMockBuilder(Property::class)->disableOriginalConstructor()->getMock();\n $property->method('property')->willReturn('test_prop');\n $property->method('value')->willReturn('test value');\n $grouping = new Grouping([], [$property]);\n\n $prop = $grouping->property('test_prop');\n $this->assertNotNull($prop);\n $this->assertSame('test value', $prop->value());\n }", "public function testGetPropertyGetPropertyMethod()\n {\n $lastname = 'Cornutt';\n $subject = new TestPropertySubject();\n $en = new Enforcer();\n\n $result = $en->getPropertyValue('lastname', $subject);\n $this->assertEquals($lastname, $result);\n }", "function testPrimitiveProperty(){\n\n\t\t//see http://services.odata.org/v3/OData/OData.svc/Suppliers(0)/Address/City?$format=application/json;odata=fullmetadata\n\t\t$property = new ODataProperty();\n\t\t$property->name = \"Count\";\n\t\t$property->typeName = 'Edm.Int16';\n\t\t$property->value = 56;\n\n\t\t$content = new ODataPropertyContent();\n\t\t$content->properties = array($property);\n\n\t\t$writer = new JsonLightODataWriter(JsonLightMetadataLevel::FULL, $this->serviceBase);\n\t\t$result = $writer->write($content);\n\t\t$this->assertSame($writer, $result);\n\n\n\t\t//decoding the json string to test\n\t\t$actual = json_decode($writer->getOutput());\n\n\t\t$expected = '{\n\t\t\t\t\t\t\"odata.metadata\":\"http://services.odata.org/OData/OData.svc/$metadata#Edm.Int16\",\n\t\t\t\t\t\t\"value\" : 56\n\t\t\t\t\t }';\n\t\t$expected = json_decode($expected);\n\n\t\t$this->assertEquals(array($expected), array($actual), \"raw JSON is: \" . $writer->getOutput());\n\t}", "function testGetProperty1 ()\n\t{\n\t\t\t$input = \"name=value\";\n\t\t\t$property = \"name\";\n\t\t\t$expectedOutput = \"value\";\n\t\t\t$this->assertEqual (\n\t\t\t\t\t$this->stringUtils->getProperty ($input, $property),\n\t\t\t\t\t$expectedOutput\n\t\t\t);\n\t}", "abstract protected function properties();", "public function testGetProperty()\n {\n $viewCounterServiceMock = $this->getMockBuilder(ViewCounter::class)\n ->setConstructorArgs([$this->counterManagerMock, $this->requestStackMock, $this->viewcounterConfigMock])\n ->setMethods(['getProperty'])\n ->getMock();\n\n $viewCounterServiceMock\n ->expects($this->once())\n ->method('getProperty')\n ->with()\n ->willReturn($this->property);\n\n $property = $this->invokeMethod($viewCounterServiceMock, 'getProperty', []);\n\n $this->assertEquals($this->property, $property);\n }", "public function testProperties(): void\n {\n $this->assertSame('FOOX', $this->validator->getAssertCode('X'));\n $this->assertSame(['a:foo', 'a:bar'], $this->validator->getPath());\n }", "public function testGetValue()\n {\n $this->todo('stub');\n }", "public function testGetAllProperties() : void {\n\t\t//count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"property\");\n\n\t\t//make a valid property uuid\n\t\t$propertyId = generateUuidV4();\n\n\t\t//make a new property with valid entries\n\t\t$property = new Property($propertyId, $this->VALID_PROPERTYCITY, $this->VALID_PROPERTYCLASS, $this->VALID_PROPERTYLATITUDE, $this->VALID_PROPERTYLONGITUDE, $this->VALID_PROPERTYSTREETADDRESS, $this->VALID_PROPERTYVALUE);\n\n\t\t//insert property\n\t\t$property->insert($this->getPDO());\n\n\t\t//grab data from MySQL and check expectations\n\t\t$results = Property::getAllProperties($this->getPDO());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"property\"));\n\t\t$this->assertCount(1, $results);\n\t\t$this->assertContainsOnlyInstancesOf(\"GoGitters\\\\ApciMap\\\\Property\", $results);\n\n\t\t//grab the property from the array and validate it\n\t\t$pdoProperty = $results[0];\n\t\t$this->assertEquals($pdoProperty->getPropertyId()->toString(), $propertyId->toString());\n\t\t$this->assertEquals($pdoProperty->getPropertyCity(), $this->VALID_PROPERTYCITY);\n\t\t$this->assertEquals($pdoProperty->getPropertyClass(), $this->VALID_PROPERTYCLASS);\n\t\t$this->assertEquals($pdoProperty->getPropertyLatitude(), $this->VALID_PROPERTYLATITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyLongitude(), $this->VALID_PROPERTYLONGITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyStreetAddress(), $this->VALID_PROPERTYSTREETADDRESS);\n\t\t$this->assertEquals($pdoProperty->getPropertyValue(), $this->VALID_PROPERTYVALUE);\n\t}", "function testShowProperty()\r\n {\r\n global $webUrl;\r\n global $lang, $SERVER, $DATABASE;\r\n \r\n // Turn to \"Operators\" page.\r\n\t\t$this->assertTrue($this->get(\"$webUrl/operators.php\", array(\r\n\t\t 'server' => $SERVER,\r\n\t\t\t\t\t 'database' => $DATABASE,\r\n\t\t\t\t\t 'schema' => 'public',\r\n\t\t\t\t\t 'subject' => 'schema'))\r\n\t\t\t\t );\r\n // Show the properties of the operator \"===\".\r\n $this->assertTrue($this->clickLink('==='));\r\n // Check the properties.\r\n $this->assertTrue($this->assertWantedText('areasel')); \r\n \r\n return TRUE;\r\n }", "public function testGetPropertyValuePublicProperty()\n {\n $username = 'ccornutt';\n $en = new Enforcer();\n $subject = new Subject((object)[\n 'username' => $username\n ]);\n\n $result = $en->getPropertyValue('username', $subject);\n $this->assertEquals($username, $result);\n }", "public function testGetPropertyByUserId() : void {\n\t\t//count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"property\");\n\n\t\t//make a valid property uuid\n\t\t$propertyId = generateUuidV4();\n\n\t\t//make a new property with valid entries\n\t\t$property = new Property($propertyId, $this->VALID_PROPERTYCITY, $this->VALID_PROPERTYCLASS, $this->VALID_PROPERTYLATITUDE, $this->VALID_PROPERTYLONGITUDE, $this->VALID_PROPERTYSTREETADDRESS, $this->VALID_PROPERTYVALUE);\n\n\t\t//insert property\n\t\t$property->insert($this->getPDO());\n\n\t\t//make a user & insert into db\n\t\t$userId = generateUuidV4();\n\t\t$userActivationToken = bin2hex(random_bytes(16));\n\t\t$userPassword = \"u9V45k\";\n\t\t$userUsername = \"lindsey\";\n\t\t$userHash= password_hash($userPassword, PASSWORD_ARGON2I, [\"time_cost\" => 384]);\n\t\t$user = new User($userId, $userActivationToken, \"[email protected]\", $userHash, $userUsername);\n\t\t$user->insert($this->getPDO());\n\n\t\t// make a new star with the property and user we just made\n\t\t$star = new Star($propertyId, $userId);\n\t\t$star->insert($this->getPDO());\n\n\t\t//grab data from MySQL and check expectations\n\t\t$results = Property::getPropertyByUserId($this->getPDO(), $userId);\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"property\"));\n\t\t$this->assertCount(1, $results);\n\t\t$this->assertContainsOnlyInstancesOf(\"GoGitters\\\\ApciMap\\\\Property\", $results);\n\n\t\t//grab the property from the array and validate it\n\t\t$pdoProperty = $results[0];\n\t\t$this->assertEquals($pdoProperty->getPropertyId()->toString(), $propertyId->toString());\n\t\t$this->assertEquals($pdoProperty->getPropertyCity(), $this->VALID_PROPERTYCITY);\n\t\t$this->assertEquals($pdoProperty->getPropertyClass(), $this->VALID_PROPERTYCLASS);\n\t\t$this->assertEquals($pdoProperty->getPropertyLatitude(), $this->VALID_PROPERTYLATITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyLongitude(), $this->VALID_PROPERTYLONGITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyStreetAddress(), $this->VALID_PROPERTYSTREETADDRESS);\n\t\t$this->assertEquals($pdoProperty->getPropertyValue(), $this->VALID_PROPERTYVALUE);\n\t}", "function testGetProperty4 ()\n\t{\n\t\t\t$input = \"Barry=a programmer and=good\";\n\t\t\t$property = \"Barry\";\n\t\t\t$expectedOutput = \"a programmer and=good\";\n\t\t\t$this->assertEqual (\n\t\t\t\t\t$this->stringUtils->getProperty ($input, $property),\n\t\t\t\t\t$expectedOutput\n\t\t\t);\n\t}", "public function testGetClassProperties() {\n\t\t$result = array_map(\n\t\t\tfunction($property) { return $property['name']; },\n\t\t\tInspector::properties($this)\n\t\t);\n\t\t$expected = ['test', 'test2'];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$result = array_map(\n\t\t\tfunction($property) { return $property['name']; },\n\t\t\tInspector::properties($this, ['public' => false])\n\t\t);\n\t\t$expected = ['test', 'test2', '_test'];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$result = Inspector::properties($this);\n\t\t$expected = [\n\t\t\t[\n\t\t\t\t'modifiers' => ['public'],\n\t\t\t\t'value' => 'foo',\n\t\t\t\t'docComment' => false,\n\t\t\t\t'name' => 'test'\n\t\t\t],\n\t\t\t[\n\t\t\t\t'modifiers' => ['public', 'static'],\n\t\t\t\t'value' => 'bar',\n\t\t\t\t'docComment' => false,\n\t\t\t\t'name' => 'test2'\n\t\t\t]\n\t\t];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$controller = new Controller(['init' => false]);\n\n\t\t$result = array_map(\n\t\t\tfunction($property) { return $property['name']; },\n\t\t\tInspector::properties($controller)\n\t\t);\n\t\t$this->assertTrue(in_array('request', $result));\n\t\t$this->assertTrue(in_array('response', $result));\n\t\t$this->assertFalse(in_array('_render', $result));\n\t\t$this->assertFalse(in_array('_classes', $result));\n\n\t\t$result = array_map(\n\t\t\tfunction($property) { return $property['name']; },\n\t\t\tInspector::properties($controller, ['public' => false])\n\t\t);\n\t\t$this->assertTrue(in_array('request', $result));\n\t\t$this->assertTrue(in_array('response', $result));\n\t\t$this->assertTrue(in_array('_render', $result));\n\t\t$this->assertTrue(in_array('_classes', $result));\n\n\t\t$this->assertNull(Inspector::properties('\\lithium\\core\\Foo'));\n\t}", "public function testProperties(): void\n {\n $body = new RequestBodyObject();\n\n $url = new UrlObject();\n $formParameter = new FormParameterObject();\n $file = new FileObject();\n\n $body->setDisabled(false);\n $body->setMode('file');\n $body->setRaw('test-raw');\n $body->setUrl($url);\n $body->setFormParameter($formParameter);\n $body->setFile($file);\n\n $this->assertProperties($body, [\n 'isDisabled' => false,\n 'getMode' => 'file',\n 'getRaw' => 'test-raw',\n 'getUrl' => $url,\n 'getFormParameter' => $formParameter,\n 'getFile' => $file\n ]);\n }", "function testGetProperty2 ()\n\t{\n\t\t\t$input = null;\n\t\t\t$property = \"name\";\n\t\t\t$this->assertNull (\n\t\t\t\t\t$this->stringUtils->getProperty ($input, $property)\n\t\t\t);\n\t}", "public function testUnfilteredProperties()\n {\n $this->visit('/properties')\n ->see('Victorian townhouse')\n ->see('Five bedroom mill conversion')\n ->see('Shack in the desert');\n }", "public function testGet()\n {\n $object = new \\Webaholicson\\Minimvc\\Core\\Object(['test' => true]);\n \n $this->assertTrue($object->get('test'));\n $this->assertEquals('', $object->get('empty'));\n $this->assertArrayHasKey('test', $object->get());\n }", "public function test_properties()\n\t{\t\n\t\t$fields = array(\n\t\t\t'id' => new Jelly_Field_Primary,\n\t\t\t'id2' => new Jelly_Field_Primary,\n\t\t\t'name' => new Jelly_Field_String,\n\t\t);\n\t\t\n\t\t$meta = new Jelly_Meta;\n\t\t$meta->db('foo')\n\t\t ->table('foo')\n\t\t ->builder('Jelly_Builder_Foo')\n\t\t ->fields($fields)\n\t\t ->fields(array(\n\t\t \t'_id' => 'id2',\n\t\t ))\n\t\t ->sorting(array('foo' => 'bar'))\n\t\t ->primary_key('id2')\n\t\t ->name_key('name')\n\t\t ->foreign_key('meta_fk')\n\t\t ->load_with(array('test_post'))\n\t\t\t ->behaviors(array(new Jelly_Behavior_Test))\n\t\t ->finalize('meta');\n\t\t\n\t\t// Ensure the simple properties are preserved\n\t\t$expected = array(\n\t\t\t'initialized' => TRUE,\n\t\t\t'db' => 'foo',\n\t\t\t'table' => 'foo',\n\t\t\t'model' => 'meta',\n\t\t\t'primary_key' => 'id2',\n\t\t\t'name_key' => 'name',\n\t\t\t'foreign_key' => 'meta_fk',\n\t\t\t'builder' => 'Jelly_Builder_Foo',\n\t\t\t'sorting' => array('foo' => 'bar'),\n\t\t\t'load_with' => array('test_post'),\n\t\t);\n\t\t\n\t\tforeach ($expected as $property => $value)\n\t\t{\n\t\t\t$this->assertSame($meta->$property(), $value);\n\t\t}\n\t\t\n\t\t// Ensure we can retrieve fields properly\n\t\t$this->assertSame($meta->field('_id'), $fields['id2']);\n\t\t$this->assertSame($meta->field('id2')->name, 'id2');\n\t\t\n\t\t// Ensure all fields match\n\t\t$this->assertSame($meta->fields(), $fields);\n\t\t\n\t\t// Ensure defaults are set properly\n\t\t$this->assertSame($meta->defaults(), array(\n\t\t\t'id' => NULL, \n\t\t\t'id2' => NULL, \n\t\t\t'name' => ''\n\t\t));\n\n\t\tforeach ($meta->behaviors() as $behavior)\n\t\t{\n\t\t\t// Ensure Behaviors return actual objects\n\t\t\t$this->assertTrue($behavior instanceof Jelly_Behavior);\n\t\t}\n\t}", "public function usageProperty()\n {\n $config =stubSoapClientConfiguration::create('http://example.net/', 'urn:foo');\n $this->assertNull($config->getUsage());\n $this->assertSame($config, $config->setUsage(SOAP_LITERAL));\n $this->assertEquals(SOAP_LITERAL, $config->getUsage());\n }", "public function testGetValue()\n {\n $reflectedProperty = new PropertyReflection('TRex\\Reflection\\resources\\Foo', 'bar');\n $this->assertSame('bar', $reflectedProperty->getValue(new Foo()));\n }", "public function testOtherAccessors()\n {\n $this->initHalResourceProperties($props = [\n 'segment' => 'shoes',\n 'countries' => ['FR', 'US'],\n 'type' => 'marketplace'\n ]);\n\n // Expectations time\n $instance = new ChannelResource($this->halResource);\n $this->assertSame($props['segment'], $instance->getSegment());\n $this->assertSame($props['countries'], $instance->getCountryCodes());\n $this->assertSame($props['type'], $instance->getType());\n }", "function properties()\n {\n }", "function testGetProperty3 ()\n\t{\n\t\t\t$input = \"Barry\";\n\t\t\t$property = null;\n\t\t\t$this->assertNull (\n\t\t\t\t\t$this->stringUtils->getProperty ($input, $property)\n\t\t\t);\n\t}", "public function getProperty();", "public function it_returns_list_of_properties()\n {\n $this->properties->setBaseUrl($this->url);\n\n $this->properties->login();\n\n $this->assertJson($this->properties->get());\n }", "public function testReadMember()\n {\n }", "public function properties() { }", "public function testGetValues()\n {\n $this->todo('stub');\n }" ]
[ "0.69223106", "0.67629147", "0.675139", "0.66662264", "0.66627896", "0.6613403", "0.6569439", "0.6558765", "0.6512696", "0.6451224", "0.6433241", "0.6418071", "0.63868016", "0.63698196", "0.63589036", "0.63441265", "0.63437045", "0.6334283", "0.6333378", "0.6327432", "0.6321757", "0.62933195", "0.62791", "0.62691903", "0.6263956", "0.622322", "0.6213699", "0.6198349", "0.61970884", "0.617594" ]
0.7466618
0
Get top 5 from a date
public function getTop5($requestDate = null) { $dates = DB::table('average_visibility')->select(DB::raw('DISTINCT date'))->get(); $data = $this->calculateData($requestDate !== null ? date('Y-m-d', strtotime($requestDate)) : date('Y-m-d')); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openskydora_get_most_viewed_items($count, $weeks_ago=7, $exclude=NULL) {\n\n $records = openskydora_get_most_viewed($count+20, $weeks_ago, $exclude);\n $item_records = array(); // No collections\n \n // filter out collection citation model\n foreach ($records as $pid=>$data) {\n $data->obj = islandora_object_load($pid);\n if (in_array('islandora:collectionCModel',$data->obj->models)) {\n // dsm ('collection! '. $pid);\n } else {\n $item_records[$pid] = $data;\n }\n }\n return array_slice($item_records, 0, $count, TRUE);\n}", "function getFilterDate($top){\n\tif(!$top)\n\t\t$top=20;\n\n\t$data = M('event');\n\t$date_set = Array();\n\t$condition = Array('event_date' => Array('egt', todayDate()));\n\t$result = $data->where($condition)->group('event_date')->limit($top)->order('event_date asc')->select();\n\tforeach($result as $value)\n\t\tarray_push($date_set, $value['event_date']);\n\n\treturn $date_set;\n}", "public function getFiveArtsByHits(){\n\t\t$sql=\"select a.articleid,a.title,a.description,a.pic,a.ptime,a.hits,a.author,c.categoryid,c.name from article a join category c on a.cid=c.categoryid order by a.hits desc limit 5\";\n\t\t\n\t\treturn $this->select($sql);\n\t}", "private function getNewest($count = 5) {\n return Posts::where('status', 'public')->orderBy('id', 'desc')->take($count)->get();\n }", "function getFilterDatePast($top){\n\tif(!$top)\n\t\t$top=20;\n\n\t$data = M('event');\n\t$date_set = Array();\n\t$condition = Array('event_date' => Array('elt', todayDate()));\n\t$result = $data->where($condition)->group('event_date')->limit($top)->order('event_date desc')->select();\n\tforeach($result as $value)\n\t\tarray_push($date_set, $value['event_date']);\n\n\treturn $date_set;\n}", "function get_top_posts( $number = 10, $days = 2 ) {\n _deprecated_function( __FUNCTION__, '2.0.0', 'wpcom_vip_top_posts_array' );\n\n return array();\n}", "function get_recent_items($num = 10)\n{\n return get_db()->getTable('Item')->findBy(array('sort_field' => 'added', 'sort_dir' => 'd'), $num);\n}", "function getRecentEntries($number = 5)\r\n{\r\n global $context, $smcFunc;\r\n \r\n if (!is_numeric($number) || empty($number))\r\n $number = 5;\r\n \r\n \r\n}", "public function iN_PopularUsersFromLastWeekInExplorePageLanding() {\n\t\t$query = mysqli_query($this->db, \"SELECT DISTINCT\n\t\tP.post_owner_id,P.post_owner_id, U.iuid,U.i_username,U.i_user_fullname,U.user_verified_status, U.user_gender , count(P.post_owner_id) as cnt\n\t\tFROM i_posts P FORCE INDEX(ixForcePostOwner)\n\t\tINNER JOIN i_users U FORCE INDEX(ixForceUser)\n\t\tON P.post_owner_id = U.iuid AND U.uStatus IN('1','3')\n\t\tWHERE WEEK(FROM_UNIXTIME(P.post_created_time)) = WEEK(NOW()) - 1 GROUP BY P.post_owner_id ORDER BY cnt DESC LIMIT 3\n\t\t\") or die(mysqli_error($this->db));\n\n\t\twhile ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)) {\n\t\t\t$data[] = $row;\n\t\t}\n\t\tif (!empty($data)) {\n\t\t\treturn $data;\n\t\t}\n\t}", "public function iN_PopularUsersFromLastWeek() {\n\t\t$query = mysqli_query($this->db, \"SELECT DISTINCT\n\t\t P.post_owner_id,P.post_owner_id, U.iuid,U.i_username,U.i_user_fullname,U.user_verified_status, U.user_gender , count(P.post_owner_id) as cnt\n\t\t FROM i_posts P FORCE INDEX(ixForcePostOwner)\n\t\t INNER JOIN i_users U FORCE INDEX(ixForceUser)\n\t\t ON P.post_owner_id = U.iuid AND U.uStatus IN('1','3')\n\t\t WHERE WEEK(FROM_UNIXTIME(P.post_created_time)) = WEEK(NOW()) - 1 GROUP BY P.post_owner_id ORDER BY cnt DESC LIMIT 5\n\t\t \") or die(mysqli_error($this->db));\n\t\t/*U.user_verified_status = '1' AND*/\n\t\twhile ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)) {\n\t\t\t$data[] = $row;\n\t\t}\n\t\tif (!empty($data)) {\n\t\t\treturn $data;\n\t\t}\n\t}", "private function getTop($count = 5, $tag_id){\n return Posts::whereHas('tags', function($query) use ($tag_id){\n $query->where('tag_id', $tag_id);\n })->where('status', 'public')->take($count);\n }", "public function iN_PopularUsersFromLastWeekInExplorePage() {\n\t\t$query = mysqli_query($this->db, \"SELECT DISTINCT\n\t\tP.post_owner_id,P.post_owner_id, U.iuid,U.i_username,U.i_user_fullname,U.user_verified_status, U.user_gender , count(P.post_owner_id) as cnt\n\t\tFROM i_posts P FORCE INDEX(ixForcePostOwner)\n\t\tINNER JOIN i_users U FORCE INDEX(ixForceUser)\n\t\tON P.post_owner_id = U.iuid AND U.uStatus IN('1','3')\n\t\tWHERE U.user_verified_status = '1' AND WEEK(FROM_UNIXTIME(P.post_created_time)) = WEEK(NOW()) - 1 GROUP BY P.post_owner_id ORDER BY cnt DESC LIMIT 30\n\t\t\") or die(mysqli_error($this->db));\n\n\t\twhile ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)) {\n\t\t\t$data[] = $row;\n\t\t}\n\t\tif (!empty($data)) {\n\t\t\treturn $data;\n\t\t}\n\t}", "function get_recent_collections($num = 10)\n{\n return get_records('Collection', array('sort_field' => 'added', 'sort_dir' => 'd'), $num);\n}", "public static function top_category_request()\n {\n $date=static::first_end_date();\n return StatisticsHelper::top_category_request(5,null,null,$date->from->format('Y-m-d'),$date->to->format('Y-m-d'));\n }", "function openskydora_get_most_viewed($count, $weeks_ago=7, $exclude=NULL) {\n $query = db_select('islandora_usage_stats_object_access_log', 'log');\n $query->join('islandora_usage_stats_objects', 'objects', 'log.pid_id = objects.id');\n $query->addExpression('COUNT(log.pid_id)', 'views');\n $query->fields('objects', array('pid'))\n ->groupBy('log.pid_id')\n ->orderBy('views', 'DESC')\n ->range(0, $count);\n // XXX: This could potentially cause slow down on large data sets.\n if ($exclude) {\n $query->condition('pid', $exclude, 'NOT IN');\n }\n if ($weeks_ago) {\n $query->condition('log.time', strtotime(\"-$weeks_ago week\"), '>');\n }\n $results = $query->execute();\n $records = $results->fetchAllAssoc('pid');\n return $records;\n}", "static function fetchTopFiveMostVisited($pdo){\n\n try {\n $sql = \"select product_real_id , count(_id) as instance from (\n select _id,concat(cast(company_id as CHARACTER(30)) ,\n cast(product_id as CHARACTER(30))) as product_real_id \n from Tracking) as innerTable\n group by product_real_id\n order by instance desc\n limit 5\";\n $stmt = $pdo->prepare($sql);\n $stmt->execute();\n return $stmt->fetchAll();\n }catch (PDOException $e) {\n\n return null;\n }\n }", "public static function top5(User $asker, User $askee = null)\n {\n if (!is_null($askee)) {\n $questionIDs = DB::table('questions_asked')\n ->select(\"*\", DB::raw(\"COUNT('question_id') AS times_asked\"))\n ->where([\n 'asker_id' => $asker->id,\n 'askee_id' => $askee->id,\n ])\n ->groupBy('asker_id')\n ->orderBy(DB::raw('times_asked'), 'DESC')\n ->take(5)\n ->get();\n } else {\n $questionIDs = DB::table('questions_asked')\n ->select(\"*\", DB::raw(\"COUNT('question_id') AS times_asked\"))\n ->where([\n 'asker_id' => $asker->id,\n ])\n ->groupBy('asker_id')\n ->orderBy(DB::raw('times_asked'), 'DESC')\n ->take(5)\n ->get();\n }\n $questions = [];\n foreach ($questionIDs as $questionAsked) {\n $question = self::find($questionAsked->question_id);\n $question->times_asked = $questionAsked->times_asked;\n $questions[] = $question;\n }\n return $questions;\n\n }", "public function get_popular_list()\n\t{\n\t\t$result = $this->db->from(\"blog\")\n\t\t\t\t\t\t->join(\"category\",\"category.category_id\",\"blog.category_id\")\n\t\t\t\t\t\t->where(array(\"blog.publish_status\"=> 1, \"blog.blog_status\" => 1))\n\t\t\t\t\t\t->orderby(\"blog.blog_views\", \"DESC\")\n\t\t\t\t\t\t->limit(5)\n\t\t\t\t\t\t->get();\t\n\t\treturn $result;\n\t}", "function openskydora_get_most_viewed_collections($count=5, $weeks_ago=5) {\n // get all the views in the window\n $views = openskydora_get_most_viewed (10000, $weeks_ago);\n\n // Kludge to keep number of pids from blowing up Solr\n $views = array_slice($views, 0, 100);\n \n // search for all the unique PIDs that aren't collections\n $query = implode (array_map ('pid_query_clause', array_keys($views)), ' OR ');\n $query = '('.$query.') NOT RELS_EXT_hasModel_uri_t:\"*collectionCModel\"';\n $solr_fields = array(\n 'PID',\n 'fgs_createdDate_dt',\n 'fgs_label_s',\n 'mods_extension_collectionKey_ms',\n 'RELS_EXT_isMemberOfCollection_uri_s',\n 'RELS_EXT_hasModel_uri_s'\n );\n $params = array(\n 'fl'=>implode($solr_fields, ','),\n 'sort'=>'fgs_createdDate_dt desc',\n 'solrLimit'=>count($views),\n );\n\n $query_results = openskydora_solr_search($query, $params);\n\n // construct most_viewed array to return\n $most_viewed = array();\n foreach($query_results as $item) {\n $pid = $item['PID'];\n //dsm($pid . ' views: ' . $views[$pid]->views);\n $collection = $item['RELS_EXT_isMemberOfCollection_uri_s'];\n $label = $item['fgs_label_s'];\n $coll_views = isset($most_viewed[$collection]) ? $most_viewed[$collection] : 0;\n $coll_views += intval($views[$pid]->views);\n // dsm (\"- $collection coll_views: $coll_views\");\n /* $most_viewed[$collection] = array (\n 'views' =>$coll_views,\n 'label' => $label\n );\n */\n $most_viewed[$collection] = $coll_views;\n }\n\n arsort($most_viewed);\n /*\n usort($most_viewed, function ($a, $b) {\n return $a['views'] <=> $b['views'];\n });\n */\n return array_slice($most_viewed, 0, $count, TRUE);\n}", "public function toplist()\n {\n $listfac = Pago::join('factura_cab', 'factura_cab.numfac', '=', 'pagos.numfac')\n ->join('entidades','entidades.COD_ENT','=','factura_cab.cod_ent')\n ->select('factura_cab.numfac as numfac','fecfac', 'fecpago','NOM_ENT','valpago','estfac')\n ->orderBy('numfac', 'desc')\n ->take(5)\n ->get();\n\n return $listfac; \n }", "public function getTrendingItems()\n {\n $items = $this->getAllDisplayableItems();\n\n $items = $items->sortByDesc(function($item){\n return $item->trendingOrders()->count();\n });\n return $items->take(5);\n }", "public function getTenLatestPhotos();", "public function findPraiseTopTen(){\n $sql = \"SELECT p.`id`, u.`nickname`, p.`favorite`, p.`pic` FROM `photo` AS p, `user` AS u WHERE p.`uid` = u.`uid` ORDER BY p.`favorite` DESC, p.`created` LIMIT 0, 10\";\n $res = $this->connect()->query($sql);\n $list = $res->fetch_all($resulttype = MYSQLI_ASSOC);\n if($list) {\n return $list;\n }\n return FALSE;\n }", "public function Top5FeedbackAuthors()\n {\n// $sth = $this->pdo->query('SELECT count(`author`) as feedback_count,`author`, `user_id` FROM feedback GROUP BY `author` ORDER by `author` DESC LIMIT 0,5');\n $sth = $this->pdo->query('SELECT count(`author`) as feedback_count,`author`, `user_id` FROM feedback GROUP BY `author` ORDER by `feedback_count` DESC LIMIT 0,5');\n $collection=[];\n\n while ($res = $sth->fetch(\\PDO::FETCH_ASSOC) ) {\n $feedback = (new Feedback())\n ->setUserId($res['user_id'])\n ->setUserName($res['author'])\n ->setFeedbackCount($res['feedback_count']);\n $collection[] = $feedback;\n }\n\n return $collection;\n }", "public function getMonthTop($howmany = 50){\n\t\t$howmany = (int)$howmany;\n\t\t$ret = $this->JackpotWinning->getMonthTop($howmany);\n\t\treturn $ret;\n\t}", "function newest($size = 5)\n {\n $this->lang->load('admin/user');\n $input = array();\n $input['limit'] = array(0, $size);\n $list = model('user')->get_list($input);\n\n // Luu bien gui den view\n $this->data['list'] = $list;\n\n $this->data['user_total'] = model('user')->get_total();\n\n // Hien thi view\n $this->load->view('tpl::_widget/user/newest', $this->data);\n }", "public function grab_top_rated($page=null)\n {\n return $this->grab(self::TOP_RATED_URL, $page);\n }", "private function queryTopPageviewItemsByDays(Carbon $timeFrom, $limit, callable $queryFunction, $keyAttribute = 'external_id')\n {\n $timeTo = (clone $timeFrom)->modify('+1 day');\n $now = Carbon::now();\n\n // do not split query if time_from -> now is less than day\n if ($timeTo > $now) {\n return $queryFunction($timeFrom, $now, $limit);\n }\n\n $results = [];\n while ($timeTo < $now) {\n $items = $queryFunction($timeFrom, $timeTo, $limit * 2);\n foreach ($items as $item) {\n if (!isset($results[$item->$keyAttribute])) {\n $results[$item->$keyAttribute] = $item;\n continue;\n }\n\n $results[$item->$keyAttribute]->pageviews += $item->pageviews;\n }\n\n $timeFrom->modify('+1 day');\n $timeTo->modify('+1 day');\n if ($timeTo > $now) {\n $timeTo = $now;\n }\n }\n\n usort($results, function ($a, $b) {\n return $a->pageviews < $b->pageviews;\n });\n\n return array_slice($results, 0, $limit);\n }", "public function findLastFiveArticles(): ?iterable\n {\n /*\n * TODO : Voir le Tri par date\n */\n return $this->iterateOverSources('findLastFiveArticles')\n ->slice(-5);\n }", "public function ajaxGetMostSoldItems(Request $request, $date) {\n\t\t\n\t\t$items = $this->transactions->getMostSoldItems($date,5);\n\t\t\t\t\t\t\t\n\t\t$response = array(\n\t\t\t\"data\" => $items\n\t\t);\n\t\t\n\t\treturn \\Response::json($response);\n\t}" ]
[ "0.616973", "0.607121", "0.59597385", "0.59505755", "0.5813968", "0.57582307", "0.57543707", "0.57298315", "0.56566775", "0.56390345", "0.56149065", "0.55895144", "0.55706733", "0.5565169", "0.55427176", "0.5492948", "0.5482236", "0.5447673", "0.542438", "0.5396414", "0.5390115", "0.53686655", "0.5366807", "0.53533113", "0.5320439", "0.5317042", "0.53082097", "0.52584857", "0.5236523", "0.5231181" ]
0.7230187
0
Retrieves the specified [SecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettings]. The returned settings may be stale by up to 1 minute.
public function GetSecuritySettings(\Google\Cloud\Dialogflow\Cx\V3beta1\GetSecuritySettingsRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService/GetSecuritySettings', $argument, ['\Google\Cloud\Dialogflow\Cx\V3beta1\SecuritySettings', 'decode'], $metadata, $options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ListSecuritySettings(\\Google\\Cloud\\Dialogflow\\Cx\\V3beta1\\ListSecuritySettingsRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService/ListSecuritySettings',\n $argument,\n ['\\Google\\Cloud\\Dialogflow\\Cx\\V3beta1\\ListSecuritySettingsResponse', 'decode'],\n $metadata, $options);\n }", "public function getSettings()\n {\n $response = $this->get('settings');\n $data = $response->json();\n return new Settings($data);\n }", "public function getSecuritySettings($platform)\n {\n try {\n $gatewayClient = $this->createGatewayClient($platform);\n\n $response = $gatewayClient->requestSecuritySettings();\n\n $this->plugin->logs->logInfos(\"# RequestSecuritySettings for ${$platform}\");\n\n return $response;\n } catch (Exception $e) {\n $this->plugin->logs->logException($e);\n throw new Exception($e->getMessage());\n }\n }", "public function getSettings() {\n if (!$this->settings) {\n $settings = get_option($this->getSettingsKey());\n $this->settings = $settings;\n }\n return $this->settings;\n }", "public function getSecurity()\n {\n return $this->get('security');\n }", "protected function get_course_settings()\n {\n if (! isset($this->course_settings_cache))\n {\n $course_settings = DataManager::retrieve_course_settings_with_tools();\n while ($course_setting = $course_settings->next_result())\n {\n $this->course_settings_cache[$course_setting[CourseSetting::PROPERTY_ID]] = $course_setting;\n }\n }\n \n return $this->course_settings_cache;\n }", "public function GetSettings(GetSettings $parameters)\n {\n return $this->__soapCall('GetSettings', array($parameters));\n }", "public function getSettings()\n {\n $settings = Setting::all();\n\n return Datatables::of($settings)\n ->editColumn('value', function ($setting) {\n return htmlentities(strlen($setting->getOriginal('value')) > 50 ? substr($setting->getOriginal('value'), 0, 50) : $setting->getOriginal('value'));\n })\n ->addColumn('actions', function ($setting) {\n $editBtn = '<a style=\"margin-right: 0.2em;\" href=\"' . url('admin/settings/' . $setting->id . '/edit/') . '\" title=\"Edit\"><i class=\"fa fa-2 fa-pencil\"></i></a>';\n\n return $editBtn;\n })->make(true);\n }", "public function getSettings() {\n\t\treturn $this -> settings;\n\t}", "public static function getSettings()\n {\n try {\n return self::getCurrent()->settings;\n } catch (Exception $exception) {\n // No application running.\n throw new SettingsException(\n $exception->getMessage(),\n $exception->getCode(),\n $exception\n );\n }\n }", "public static function getSettings() {\n\n\t\tglobal $lumi_aiowps_tweaks;\n\t\tif( isset( $lumi_aiowps_tweaks['Settings'] ) ) {\n\t\t\treturn $lumi_aiowps_tweaks['Settings'];\n\t\t} else {\n\t\t\tinclude_once( __DIR__ . '/SettingsAPI.class.php' );\n\t\t\t$lumi_aiowps_tweaks['Settings'] = new SettingsAPI();\n\t\t\treturn $lumi_aiowps_tweaks['Settings'];\n\t\t}\n\n\t}", "public function getSettings()\n {\n return $this->settings;\n }", "public function getSettings()\n {\n return $this->settings;\n }", "public function getSettings()\n {\n return $this->settings;\n }", "public function getSettings()\n {\n return $this->settings;\n }", "public function getSettings()\n\t{\n\t\treturn $this->settings;\n\t}", "public function getSettings() {\n return $this->settings;\n }", "protected static function getSettings()\r\n {\r\n if(!self::$avail_settings)\r\n {\r\n $data = self::db()->query(\r\n 'SELECT * FROM `:prefix:rbac_user_settings` AS `t1` '\r\n . 'JOIN `:prefix:forms_fieldtypes` AS `t2` '\r\n . 'ON `t1`.`fieldtype`=`t2`.`type_id` '\r\n . 'WHERE `is_editable`=? '\r\n . 'ORDER BY `fieldset` ASC, `position` ASC',\r\n array('Y')\r\n );\r\n if($data)\r\n {\r\n self::$avail_settings = $data->fetchAll();\r\n }\r\n }\r\n return self::$avail_settings;\r\n }", "public static function getSiteSettings()\n {\n $siteSettingData = SiteSetting::first();\n return $siteSettingData;\n }", "public function getSettings() {\n\t\tif ($blogSettings = Cache::read($this->_cacheKey)) {\n\t\t\treturn $blogSettings;\n\t\t}\n\t\t$blogSettings = $this->find('list', array(\n\t\t\t'fields' => array('setting', 'value')\n\t\t));\n\t\tCache::write($this->_cacheKey, $blogSettings);\n\t\treturn $blogSettings;\n\t}", "public function getSettings()\n {\n return SettingsRecord::find()->one();\n }", "public function getSettings()\n {\n $data = $this->_plugin->getSettings();\n\n return Frenet_SettingsModel::populateModel($data);\n }", "public function getSettings()\n {\n return $this->_settings;\n }", "public static function getSettings()\n {\n return Settings::getSettings();\n }", "public static function get_settings()\n\t{\n\t\tif (! isset(self::$_settings) || self::$_settings == null)\n\t\t{\n\t\t\t$settings = array();\n\t\t\t//Get the actual saved settings\n\t\t\t$query = ee()->db->get(self::$_settings_table_name);\n\t\t\tforeach ($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$settings[$row[\"setting_name\"]] = $row[\"setting_value\"];\n\t\t\t}\n\t\t\tself::$_settings = array_merge(self::_get_default_settings(), $settings);\n\t\t}\n\t\treturn self::$_settings;\n\t}", "public function getSettings() {\n $file = SETTINGS_PATH.'/'.$this->domain.'.json';\n $siteSettings = file_get_contents($file);\n return json_decode($siteSettings);\n }", "private function settings()\n {\n if (!$this->settings) {\n $this->settings = userSettings::findOrMake($this->tid);\n }\n return $this->settings;\n }", "public function getSettings()\n {\n return collect($this->settings())->mapWithKeys(function ($settings, $key) {\n return [$key => PaymentGatewaySettings::get($key)];\n });\n }", "public static function getCurrentSettings() {\r\n\t\t$settings=Yii::app()->user->getState('settings');\r\n\t\t\r\n\t\tif(is_null($settings)) {\r\n\t\t\t//it can also happen that the current session is lost, but the user stays logged in - so pull it out of the db \r\n\t\t\t$settings=UserSettings::model()->findByAttributes(array('userId'=>Yii::app()->user->getId()));\r\n\r\n\t\t\tif(is_null($settings)) {\r\n\t\t\t\t$settings=new UserSettings();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tYii::app()->user->setState('settings', $settings);\r\n\t\t}\r\n\t\t\r\n\t\treturn $settings;\r\n\t}", "protected function getSettings() {\n\t\treturn $this->configuration->getSettings();\n\t}" ]
[ "0.65667975", "0.6233191", "0.58670014", "0.583099", "0.57284546", "0.5692893", "0.5665409", "0.5628611", "0.56143904", "0.5569531", "0.55685055", "0.5562755", "0.5562755", "0.5562755", "0.5562755", "0.55390817", "0.5524283", "0.5501231", "0.54746103", "0.5469988", "0.5465756", "0.5465385", "0.544793", "0.54469717", "0.54432946", "0.543758", "0.54364854", "0.5419364", "0.5412174", "0.5403964" ]
0.70714307
0
Updates the specified [SecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettings].
public function UpdateSecuritySettings(\Google\Cloud\Dialogflow\Cx\V3beta1\UpdateSecuritySettingsRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService/UpdateSecuritySettings', $argument, ['\Google\Cloud\Dialogflow\Cx\V3beta1\SecuritySettings', 'decode'], $metadata, $options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateSecurityVersion()\n {\n $this->_settings->set('securityversion', SPOTWEB_SECURITY_VERSION);\n }", "public function update(Request $request, UserSecurity $userSecurity)\n {\n //\n }", "public function update(UserSettingsRequest $request)\n {\n $input = $request->except(['_method', '_token']);\n\n foreach ($input as $key => $value) {\n\n setting()->set(\n $key,\n $value\n );\n setting()->setExtraColumns(['user_id' => auth()->user()->id]);\n }\n setting()->save();\n\n return redirect(route('settings.index'))->with('message', 'Settings have been saved!');\n }", "public function ListSecuritySettings(\\Google\\Cloud\\Dialogflow\\Cx\\V3beta1\\ListSecuritySettingsRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService/ListSecuritySettings',\n $argument,\n ['\\Google\\Cloud\\Dialogflow\\Cx\\V3beta1\\ListSecuritySettingsResponse', 'decode'],\n $metadata, $options);\n }", "function updateSecuritySettings($siteSecretKey, $captchaKey, $captchaSecretKey)\n {\n\n // define all the global variables\n global $database, $message, $settings, $user, $captcha;\n\n // escape strings\n $siteSecretKey = $database->secureInput($siteSecretKey);\n $captchaKey = $database->secureInput($captchaKey);\n $captchaSecretKey = $database->secureInput($captchaSecretKey);\n\n // check if current user has the required permission\n if (!$user->hasPermission(\"als_update_siteSettings\")) {\n $message->setError(\"You don't have the permission to perform this action\", Message::Error);\n return false;\n }\n\n // check if any fields are empty then return an error\n if (empty($siteSecretKey) || empty($captchaKey) || empty($captchaSecretKey)) {\n $message->setError(\"All fields are required to be filled\", Message::Error);\n return false;\n }\n\n // check if site secret consists of 32 characters\n if (strlen($siteSecretKey) != 32) {\n $message->setError(\"Secret code most be 32 characters long only\", Message::Error);\n return false;\n }\n\n // check if site secret key consists of a hex32 string\n if (!ctype_xdigit($siteSecretKey)) {\n $message->setError(\"Only a Hex32 string is allowed for the site secret key\", Message::Error);\n return false;\n }\n\n // check if the site secret is the same\n // update the site secret\n if ($settings->secretKey() != $siteSecretKey) {\n $settings->setSiteSecret($siteSecretKey);\n $settings->setSetting(Settings::SECRET_KEY, $siteSecretKey);\n }\n\n // check if the current captcha key is the same\n // update the captcha key\n if ($captcha->getSiteKey() != $captchaKey) {\n $settings->setCaptchaKey($captchaKey);\n $settings->setSetting(Settings::CAPTCHA_KEY, $captchaKey);\n }\n\n // check if the current captcha secret key is the same\n // update the captcha secret key\n if ($captcha->getSecretKey() != $captchaSecretKey) {\n $settings->setSetting(Settings::CAPTCHA_SECRET_KEY, $captchaSecretKey);\n }\n\n // check if the site secret is the same\n // check for any errors then return false\n if ($message->anyError()) {\n return false;\n }\n\n //set the success message\n $message->setSuccess(\"Things might have happened\");\n return true;\n }", "public static function update(array $settings) {\n self::setup();\n self::$settings = array_merge(self::$settings, $settings);\n }", "public function setSecurity($security = false) {\r\n\t\t$this->security = $security;\r\n\t}", "public function update(Request $request, Settings $settings)\n {\n //\n }", "public function update(Request $request)\n {\n $this->preventAccessForDemoUsers();\n $this->checkPermission('settings-manage');\n\n // Cycles through posted settings and update them\n foreach ($request->all() as $name => $value) {\n if (strpos($name, 'setting-') !== 0) continue;\n $key = str_replace('setting-', '', trim($name));\n Setting::put($key, $value);\n }\n\n session()->flash('success', trans('settings.settings_save_success'));\n return redirect('/settings');\n }", "public function update(Request $request, $id)\n {\n $userSettings = UserSettings::find($id);\n\n if (isset($request->user_id))\n $userSettings->user_id = $request->user_id;\n if (isset($request->privacy_who_can_write))\n $userSettings->privacy_who_can_write = $request->privacy_who_can_write;\n if (isset($request->privacy_who_can_visit))\n $userSettings->privacy_who_can_visit = $request->privacy_who_can_visit;\n if (isset($request->privacy_who_can_ask_friendship))\n $userSettings->privacy_who_can_ask_friendship = $request->privacy_who_can_ask_friendship;\n\n $result = [];\n $result['result'] = $userSettings->save();\n\n return $result;\n\n }", "public function setAccessControl(FileSecurity $fileSecurity){\r\n //TODO: implement setAccessControl\r\n }", "public function update(Request $request) {\n $requestData = $request->all();\n unset($requestData['_token']);\n $validateData = [];\n foreach ($requestData as $key => $value) {\n $validateData[$key] = 'required';\n }\n\n // validate settings\n $validator = \\Validator::make($requestData, $validateData);\n if ($validator->fails()) {\n return redirect('admin/settings')->withInput($requestData)->withErrors($validator);\n }\n\n foreach ($requestData as $key => $value) {\n $setting = SiteSettings::where('setting_key', $key)->count();\n if ($setting > 0) {\n SiteSettings::where('setting_key', $key)->update(['setting_value' => $value]);\n } else {\n SiteSettings::insert(['setting_key' => $key, 'setting_value' => $value]);\n }\n }\n Alert::success('Success Message', 'Settings updated!');\n return redirect('admin/settings');\n }", "public function edit(UserSecurity $userSecurity)\n {\n //\n }", "public function injectSettings(array $settings)\n {\n $this->createAccessDecisionVoters($settings['security']['authorization']['accessDecisionVoters']);\n $this->allowAccessIfAllAbstain = $settings['security']['authorization']['allowAccessIfAllVotersAbstain'];\n }", "public function update(Request $request)\n {\n \n foreach ($request->settings as $ID => $value) {\n\n TechcoinSetting::where('ID', $ID)->update(['value' => $value]);\n }\n\n return redirect('techcoin-settings')->with('flash_message', 'TechcoinSetting updated!');\n }", "public function update_settings( $settings ) {\n\t\treturn $settings;\n\t}", "public function updateSeoSettings($request)\n {\n $req = $request->all();\n $data['facebook'] = @$request->facebook;\n $data['googleanalytics'] = @$request->googleanalytics;\n $data['pagespeedinsights'] = @$request->pagespeedinsights;\n $data['twittercards'] = @$request->twittercards;\n $data['titlemeta'] = @$request->titlemeta;\n $data['common'] = @$request->common;\n\n foreach ($data as $key => $val) {\n $setting = Setting::where('section', 'seo')->where('settingkey', $key)->first();\n if (!$setting) {\n $setting = new Setting;\n $setting->section = 'seo';\n $setting->settingkey = $key;\n }\n $setting->val = (is_array($val)) ? serialize($val) : $val;\n $setting->save();\n }\n\n $this->helpers->updatesession('Settings updated successfully');\n }", "public function modifySecurityIpsWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\n if (!Utils::isUnset($request->instanceId)) {\n $query['InstanceId'] = $request->instanceId;\n }\n if (!Utils::isUnset($request->modifyMode)) {\n $query['ModifyMode'] = $request->modifyMode;\n }\n if (!Utils::isUnset($request->ownerAccount)) {\n $query['OwnerAccount'] = $request->ownerAccount;\n }\n if (!Utils::isUnset($request->ownerId)) {\n $query['OwnerId'] = $request->ownerId;\n }\n if (!Utils::isUnset($request->resourceOwnerAccount)) {\n $query['ResourceOwnerAccount'] = $request->resourceOwnerAccount;\n }\n if (!Utils::isUnset($request->resourceOwnerId)) {\n $query['ResourceOwnerId'] = $request->resourceOwnerId;\n }\n if (!Utils::isUnset($request->securityIpGroupAttribute)) {\n $query['SecurityIpGroupAttribute'] = $request->securityIpGroupAttribute;\n }\n if (!Utils::isUnset($request->securityIpGroupName)) {\n $query['SecurityIpGroupName'] = $request->securityIpGroupName;\n }\n if (!Utils::isUnset($request->securityIps)) {\n $query['SecurityIps'] = $request->securityIps;\n }\n if (!Utils::isUnset($request->securityToken)) {\n $query['SecurityToken'] = $request->securityToken;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'ModifySecurityIps',\n 'version' => '2015-01-01',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return ModifySecurityIpsResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "public function update(Request $request)\n {\n $this->validate($request, [\n 'admission_open_date' => 'required|date_format:Y-m-d',\n 'admission_close_date' => 'required|date_format:Y-m-d',\n 'current_session' => 'required|regex:/\\d{4}\\/\\d{4}/',\n 'late_payment_fee' => 'required|numeric',\n 'admission_payment_fee' => 'required|numeric',\n 'acceptance_payment_fee' => 'required|numeric',\n ]);\n\n foreach ($request->post() as $name => $value) {\n SystemSetting::where('name', $name)->update(['value' => $value]);\n }\n\n return redirect()->route('settings.index')->with('success', 'Settings updated');\n }", "public function update_password_and_security_questions($id, $password, $security_question1, $security_answer1, $security_question2, $security_answer2, $security_question3, $security_answer3);", "public function editSecurity(Request $request, $id)\n {\n $security_types = $this->user_repo->getSecurityType();\n /*$clientSecurityImpl = ClientSecurityImpl::where([\n ['client_id', '=', $id],\n ])->with('securityType')->first();*/\n\n $clientSecurityImpl = $this->user_repo->getSecurityDetails($id);\n\n return View('internal.client.security.index')\n ->with('types', array_merge([0 => '----Select Any----'],$security_types))\n ->with('client_id', $id)\n ->with('clientSecurityImpl', $clientSecurityImpl);\n }", "public function update(UpdateAccountSettings $request)\n {\n $status = 'alert-danger';\n $message = 'Unable to update password, please report this to the Administrator.';\n if (Hash::check($request->input('current_password'), Auth::user()->password))\n {\n Auth::user()->password = bcrypt($request->input('new_password'));\n \n if (Auth::user()->save())\n {\n $status = 'alert-success';\n $message = 'Password updated successfully!';\n }\n else\n {\n # TODO: Log failed attempt of saving the Password to Database\n }\n }\n else\n {\n $status = 'alert-danger';\n $message = 'The password you entered is incorrect, please try again.';\n }\n \n return redirect()->back()->with($status, $message);\n }", "public function update(Request $request, PassworddSecurity $passworddSecurity)\n {\n //\n }", "public function actionUpdateServiceLevelSettings()\n {\n if (isset($_POST['ServiceLevelSettings']) && is_array($_POST['ServiceLevelSettings'])) {\n\n foreach ($_POST['ServiceLevelSettings'] as $settings) {\n $serviceLevelSettings = ServiceLevelSettings::model()->findByPk($settings['Service_Level_ID']);\n if (!$serviceLevelSettings) {\n $serviceLevelSettings = new ServiceLevelSettings();\n }\n\n $serviceLevelSettings->setAttributes($settings);\n\n if ($serviceLevelSettings->validate()) {\n $serviceLevelSettings->save();\n }\n }\n Yii::app()->user->setFlash('success', \"Service Level Settings have been saved!\");\n }\n $this->redirect('/admin?tab=service_settings');\n }", "public function setApiSettings($settings)\n {\n collect($settings['online_checkout'])->map(function ($value, $key) {\n $this->config[$key] = $value;\n });\n\n if ($this instanceof OnlineCheckout) {\n $this->setOnlineCheckoutOptions($settings);\n } else {\n throw new \\Exception('Invalid settings provided.');\n }\n }", "public function updateSecurityGroups($forceReset)\n {\n // DB connectie\n $dbCon = $this->_dbCon;\n\n if ($forceReset || ($this->_settings->get('securityversion') < 0.27)) {\n /* Truncate de huidige permissies */\n $dbCon->rawExec('DELETE FROM grouppermissions');\n\n /* Grant the logon right to the anonymous user - closed system group */\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid) VALUES(1, '.SpotSecurity::spotsec_perform_login.')');\n\n /* Default permissions for anonymous users */\n $anonPerms = [SpotSecurity::spotsec_view_spots_index, SpotSecurity::spotsec_perform_login, SpotSecurity::spotsec_perform_search,\n SpotSecurity::spotsec_view_spotdetail, SpotSecurity::spotsec_retrieve_nzb, SpotSecurity::spotsec_view_spotimage,\n SpotSecurity::spotsec_view_statics, SpotSecurity::spotsec_create_new_user, SpotSecurity::spotsec_view_comments,\n SpotSecurity::spotsec_view_spotcount_total, ];\n foreach ($anonPerms as $anonPerm) {\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid) VALUES(2, '.$anonPerm.')');\n } // foreach\n\n /* Default permissions for authenticated users */\n $authedPerms = [SpotSecurity::spotsec_download_integration, SpotSecurity::spotsec_mark_spots_asread, SpotSecurity::spotsec_view_rssfeed,\n SpotSecurity::spotsec_edit_own_userprefs, SpotSecurity::spotsec_edit_own_user, SpotSecurity::spotsec_post_comment,\n SpotSecurity::spotsec_perform_logout, SpotSecurity::spotsec_use_sabapi, SpotSecurity::spotsec_keep_own_watchlist,\n SpotSecurity::spotsec_keep_own_downloadlist, SpotSecurity::spotsec_keep_own_seenlist, SpotSecurity::spotsec_view_spotcount_filtered,\n SpotSecurity::spotsec_select_template, SpotSecurity::spotsec_consume_api, SpotSecurity::spotsec_allow_custom_stylesheet,\n SpotSecurity::spotsec_keep_own_filters, SpotSecurity::spotsec_report_spam, SpotSecurity::spotsec_post_spot,\n SpotSecurity::spotsec_blacklist_spotter, SpotSecurity::spotsec_view_statistics, ];\n foreach ($authedPerms as $authedPerm) {\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid) VALUES(3, '.$authedPerm.')');\n } // foreach\n\n /* Viewing of spotweb avatar images is a security right so administrators can globally disable this */\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid,objectid) VALUES(2, '.SpotSecurity::spotsec_view_spotimage.\", 'avatar')\");\n\n /* Allow authenticated users to consume Spotweb using an API */\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(3, '.SpotSecurity::spotsec_consume_api.\", 'rss')\");\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(3, '.SpotSecurity::spotsec_consume_api.\", 'newznabapi')\");\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(3, '.SpotSecurity::spotsec_consume_api.\", 'getnzb')\");\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(3, '.SpotSecurity::spotsec_consume_api.\", 'getspot')\");\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(3, '.SpotSecurity::spotsec_download_integration.\", 'disable')\");\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(3, '.SpotSecurity::spotsec_download_integration.\", 'client-sabnzbd')\");\n\n /* Allow certain notification services */\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid) VALUES(3, '.SpotSecurity::spotsec_send_notifications_services.')');\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(2, '.SpotSecurity::spotsec_send_notifications_services.\", 'welcomemail')\");\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(3, '.SpotSecurity::spotsec_send_notifications_services.\", 'email')\");\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(3, '.SpotSecurity::spotsec_send_notifications_services.\", 'twitter')\");\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(3, '.SpotSecurity::spotsec_send_notifications_services.\", 'prowl')\");\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(4, '.SpotSecurity::spotsec_send_notifications_services.\", 'growl')\");\n\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid) VALUES(3, '.SpotSecurity::spotsec_send_notifications_types.')');\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(3, '.SpotSecurity::spotsec_send_notifications_types.\", 'watchlist_handled')\");\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(3, '.SpotSecurity::spotsec_send_notifications_types.\", 'spot_posted')\");\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(3, '.SpotSecurity::spotsec_send_notifications_types.\", 'nzb_handled')\");\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(3, '.SpotSecurity::spotsec_send_notifications_types.\", 'report_posted')\");\n\n /* Trusted users are allowed to some additional download integration options etc */\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(4, '.SpotSecurity::spotsec_download_integration.\", 'push-sabnzbd')\");\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(4, '.SpotSecurity::spotsec_download_integration.\", 'save')\");\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(4, '.SpotSecurity::spotsec_download_integration.\", 'runcommand')\");\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(4, '.SpotSecurity::spotsec_download_integration.\", 'nzbget')\");\n // Being able to erase downloads has become its seperate rights (GH issue #935)\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid,objectid) VALUES(4, '.SpotSecurity::spotsec_keep_own_downloadlist.\", 'erasedls')\");\n\n /* Default permissions for administrative users */\n $adminPerms = [SpotSecurity::spotsec_list_all_users, SpotSecurity::spotsec_retrieve_spots, SpotSecurity::spotsec_edit_other_users,\n SpotSecurity::spotsec_delete_user, SpotSecurity::spotsec_edit_groupmembership,\n SpotSecurity::spotsec_display_groupmembership, SpotSecurity::spotsec_edit_securitygroups,\n SpotSecurity::spotsec_set_filters_as_default, SpotSecurity::spotsec_view_spotweb_updates,\n SpotSecurity::spotsec_edit_settings, ];\n foreach ($adminPerms as $adminPerm) {\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid) VALUES(5, '.$adminPerm.')');\n } // foreach\n\n // Notifications of these are only allowed to be sent to administrators\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(5, '.SpotSecurity::spotsec_send_notifications_types.\", 'retriever_finished')\");\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(5, '.SpotSecurity::spotsec_send_notifications_types.\", 'user_added')\");\n } // if\n\n //#######################################################################\n //# Security level 0.28\n //#######################################################################\n if ($forceReset || ($this->_settings->get('securityversion') < 0.28)) {\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(3, '.SpotSecurity::spotsec_send_notifications_types.\", 'newspots_for_filter')\");\n } // if\n\n //#######################################################################\n //# Security level 0.29\n //#######################################################################\n if ($forceReset || ($this->_settings->get('securityversion') < 0.29)) {\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(3, '.SpotSecurity::spotsec_select_template.\", 'we1rdo')\");\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(3, '.SpotSecurity::spotsec_select_template.\", 'mobile')\");\n } // if\n\n //#######################################################################\n //# Security level 0.30\n //#######################################################################\n if ($forceReset || ($this->_settings->get('securityversion') < 0.30)) {\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid) VALUES(5, '.SpotSecurity::spotsec_edit_spotdetail.')');\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid) VALUES(5, '.SpotSecurity::spotsec_view_spot_editor.')');\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid) VALUES(5, '.SpotSecurity::spotsec_show_spot_was_edited.')');\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid) VALUES(5, '.SpotSecurity::spotsec_delete_spot.')');\n } // if\n\n //#######################################################################\n //# Security level 0.32\n //#######################################################################\n if ($forceReset || ($this->_settings->get('securityversion') < 0.32)) {\n $dbCon->rawExec('INSERT INTO grouppermissions(groupid,permissionid, objectid) VALUES(4, '.SpotSecurity::spotsec_download_integration.\", 'nzbvortex')\");\n } // if\n\n //#######################################################################\n // Security level 0.33\n //#######################################################################\n if ($forceReset || ($this->_settings->get('securityversion') < 0.33)) {\n $dbCon->rawExec(\"DELETE FROM grouppermissions WHERE objectid = 'notifo';\");\n }\n }", "public function settings(Request $request)\n {\n $this->authorize('update', Settings::class);\n\n $settings = Settings::first();\n\n $settings->update([\n 'mail_enabled' => $request->mail_enabled ? true : false,\n ]);\n\n $settings->touch();\n\n return redirect()->route('rb28dett::settings.index', ['p' => 'Notifications'])->with('success', __('rb28dett_notifications::general.settings_updated'));\n }", "public function setSecurityContext(SecurityContext $securityContext);", "public function putUpdate(Request $request)\n {\n $settingsArray = $request->except('_token', '_method');\n\n if (!in_array('enable_recaptcha', $settingsArray)) {\n $settingsArray = $settingsArray+['enable_recaptcha' => 0];\n }\n\n $settings = json_encode($settingsArray);\n\n Storage::put('settings.json', $settings);\n\n Cache::forever('settings', $settingsArray);\n\n return redirect()->back()->withSuccess('updated');\n }", "public function update_credentials(Request $request)\n {\n foreach ($request->types as $key => $type) {\n $this->overWriteEnvFile($type, $request[$type]);\n }\n\n $sms_gateway_activation = Setting::where('type', $request->otp_method.'_activation')->first();\n if ($request->has($request->otp_method.'_activation'))\n {\n $sms_gateway_activation->value = 1;\n $sms_gateway_activation->save();\n }\n else\n {\n $sms_gateway_activation->value = 0;\n $sms_gateway_activation->save();\n }\n\n flash(\"Settings updated successfully\")->success();\n return back();\n }" ]
[ "0.5929953", "0.5390988", "0.52187425", "0.51739144", "0.5157332", "0.5136657", "0.5092442", "0.50909853", "0.49746796", "0.4967893", "0.49340108", "0.49268946", "0.49191937", "0.4916789", "0.49003476", "0.48954496", "0.488961", "0.48687983", "0.4868285", "0.4864761", "0.4831739", "0.4823664", "0.4813478", "0.47904003", "0.47600064", "0.47563878", "0.47341028", "0.4726817", "0.47073227", "0.46782523" ]
0.72015494
0
Deletes the specified [SecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettings].
public function DeleteSecuritySettings(\Google\Cloud\Dialogflow\Cx\V3beta1\DeleteSecuritySettingsRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService/DeleteSecuritySettings', $argument, ['\Google\Protobuf\GPBEmpty', 'decode'], $metadata, $options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy(Settings $settings)\n {\n //\n }", "public function ListSecuritySettings(\\Google\\Cloud\\Dialogflow\\Cx\\V3beta1\\ListSecuritySettingsRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService/ListSecuritySettings',\n $argument,\n ['\\Google\\Cloud\\Dialogflow\\Cx\\V3beta1\\ListSecuritySettingsResponse', 'decode'],\n $metadata, $options);\n }", "public function deleteSettings()\n {\n $master = new DynaGridStore([\n 'id' => $this->dynaGridId,\n 'category' => DynaGridStore::STORE_GRID,\n 'storage' => $this->storage,\n 'userSpecific' => $this->userSpecific\n ]);\n $config = $this->storage == DynaGrid::TYPE_DB ? null : $master->fetch();\n $master->deleteConfig($this->category, $config);\n $this->store->delete();\n }", "function deleteSettings() {\n\t\tdelete_option('wassup_settings');\n\t}", "public function deleteSecurityGroup($securityGroupId, $options = array())\n {\n list($config) = $this->parseOptions($options, 'config');\n if (empty($securityGroupId)) {\n throw new \\InvalidArgumentException(\n 'request $securityGroupId should not be empty.'\n );\n }\n\n return $this->sendRequest(\n HttpMethod::DELETE,\n array(\n 'config' => $config,\n ),\n '/securityGroup/' . $securityGroupId\n );\n }", "public function delete($scoId = 0, $principalId = 0) {\n\t\tif (empty($scoId) || empty($principalId)) {\n\t\t\t$scoId = $this->id;\n\t\t}\n\t\tif (empty($scoId)) {\n\t\t\treturn $this->error('AdobeConnectPermission::delete() requires 2 arguments: $scoId, $principalId');\n\t\t}\n\t\t// basic functionaliy, remove for a single Principal\n\t\tif (!empty($principalId)) {\n\t\t\treturn $this->assign($scoId, $principalId, \"remove\");\n\t\t}\n\t\t// blanket functionalty, remove all perms for all Principals - DANGEROUS\n\t\t$this->request = array(\n\t\t\t'action' => \"permissions-reset\",\n\t\t\t'acl-id' => $scoId,\n\t\t);\n\t\t$db = ConnectionManager::getDataSource($this->useDbConfig);\n\t\t$response = $db->request($this, $this->request);\n\t\tif (isset($response['status']['code']) && $this->response['status']['code']==\"ok\") {\n\t\t\treturn true;\n\t\t} elseif (isset($response['status']['code']) && $this->response['status']['code']==\"no-data\") {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private function deleteSettings()\n\t{\n\t}", "public function UpdateSecuritySettings(\\Google\\Cloud\\Dialogflow\\Cx\\V3beta1\\UpdateSecuritySettingsRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService/UpdateSecuritySettings',\n $argument,\n ['\\Google\\Cloud\\Dialogflow\\Cx\\V3beta1\\SecuritySettings', 'decode'],\n $metadata, $options);\n }", "function cxense_remove_all_settings() {\n foreach(cxense_get_settings() as $setting)\n delete_option($setting['name']);\n}", "public function destroy(UserSecurity $userSecurity)\n {\n //\n }", "function deleteSettings($userId) {\n\t\treturn $this->update(\n\t\t\t'DELETE FROM user_settings WHERE user_id = ?', $userId\n\t\t);\n\t}", "public function destroy(PassworddSecurity $passworddSecurity)\n {\n //\n }", "public function destroy(Request $request, SiteSetting $site_setting)\n {\n $site_setting->delete();\n\n $request->session()->flash('success', 'Innstillingen ble slettet.');\n return redirect()->route('site_settings.index');\n }", "public static function delete($name)\n {\n unset(self::$settings[$name]);\n\n DB::table('settings')->where('name', $name)->delete();\n }", "private function removeTokenKey(&$settings)\n {\n unset($settings['_token']);\n }", "public function saved(Settings $settings)\n {\n Settings::forget();\n }", "public function revokePermission(...$permissions)\n {\n $permissions = collect($permissions)\n ->flatten()\n ->map(function ($permission) {\n if (is_string($permission)) {\n $permission = Permission::getByName($permission);\n }\n\n return $permission;\n })\n ->all();\n \n $this->permissions()->detach(array_keys($permissions));\n\n if (config('permissionsHandler.seeder') == true) {\n Seeder::revokeRolePermissions($this, $permissions);\n }\n\n $this->clearRelatedCache();\n }", "public function destroys(SettingRequest $request)\n {\n Setting::destroy($request->get('ids'));\n\n return redirect()\n ->back()\n ->with('flash_message', Cache::get('setting')['messageDeleted']);\n }", "private function filterSettings($settings)\n {\n foreach ($settings as $index => $writer) {\n $activationFlags = $this->getActivationFlags($writer);\n $deactivationFlags = $this->getDeactivationFlags($writer);\n\n if (!empty($deactivationFlags) && $this->isAtLeastOneFlagInConfig($this->flags, $deactivationFlags)) {\n unset($settings[$index]);\n } elseif (!empty($activationFlags) && $this->noFlagsAreInConfig($this->flags, $activationFlags)) {\n unset($settings[$index]);\n }\n }\n\n return $settings;\n }", "public function remove($key, $settings = [])\n {\n $settings['value'] = '';\n $settings['expires'] = time() - 86400;\n $this->set($key, array_replace($this->defaults, $settings));\n }", "public function CreateSecuritySettings(\\Google\\Cloud\\Dialogflow\\Cx\\V3beta1\\CreateSecuritySettingsRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService/CreateSecuritySettings',\n $argument,\n ['\\Google\\Cloud\\Dialogflow\\Cx\\V3beta1\\SecuritySettings', 'decode'],\n $metadata, $options);\n }", "public function delete(SettingModel $settingModel): bool;", "protected function deleteConfiguration(){\n Configuration::deleteByName($this->name.'_settings');\n }", "public static function Delete()\r\n {\r\n return delete_option(self::OPT_SETTINGS);\r\n }", "function deleteSettingsByNotificationId($notificationId) {\n\t\treturn $this->update('DELETE FROM notification_settings WHERE notification_id = ?', (int) $notificationId);\n\t}", "public function destroy(AppSettings $appSettings)\n {\n //\n }", "public static function delete_settings( $setting_slug, $setting_group = null ) {\n\t\t\t$Settings_Models = new MV_DBI( 'mv_settings' );\n\t\t\t$args = array();\n\n\t\t\t$args = array(\n\t\t\t\t'col' => 'slug',\n\t\t\t\t'key' => $setting_slug,\n\t\t\t);\n\n\t\t\tif ( is_null( $setting_slug ) && ! empty( $setting_group ) ) {\n\t\t\t\t$args = array(\n\t\t\t\t\t'col' => 'group',\n\t\t\t\t\t'key' => $setting_group,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $Settings_Models->delete( $args );\n\t\t}", "public function GetSecuritySettings(\\Google\\Cloud\\Dialogflow\\Cx\\V3beta1\\GetSecuritySettingsRequest $argument,\n $metadata = [], $options = []) {\n return $this->_simpleRequest('/google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService/GetSecuritySettings',\n $argument,\n ['\\Google\\Cloud\\Dialogflow\\Cx\\V3beta1\\SecuritySettings', 'decode'],\n $metadata, $options);\n }", "public function destroy($setting_id)\n {\n //\n }", "public function pageSecurityDelete($page_id) {\n\t\t// Build the MindTouch API URL to delete a page's security.\n\t\t$url = $this->pageUrl($page_id) . \"/security\";\n\t\t\n\t\t// Get output from API.\n\t\t$output = $this->delete($url);\n\n\t\treturn $output;\n\t}" ]
[ "0.5684379", "0.55540955", "0.5546571", "0.52487713", "0.52474344", "0.51781285", "0.51387906", "0.5094438", "0.5087409", "0.504732", "0.49749067", "0.49723244", "0.49110207", "0.48516148", "0.47919494", "0.47624898", "0.47578615", "0.47492468", "0.45556813", "0.45528", "0.4537435", "0.453666", "0.45187703", "0.45147964", "0.45072675", "0.45016348", "0.44939482", "0.44848633", "0.44831046", "0.44450164" ]
0.7588426
0
function Participants_Friend_Levels_Latex, Parameter list: $friend Creates latex for $friend participants levels tables.
function Participants_Friend_Levels_Latex($friend,$pagehead) { $this->Participants_Friend_Read($friend); $tables=array(); foreach ($this->Participants_Friend_Levels() as $level) { array_push ( $tables, $this->Participants_Friend_Level_Latex($friend,$level) ); } $nitemsperpage=40; $page=0; $rtables=array(0 => array()); foreach ($tables as $table) { if (count($rtables[ $page ])+count($table)<$nitemsperpage) { $rtables[ $page ]=array_merge($rtables[ $page ],$table); } else { $page++; $rtables[ $page ]=$table; } } for ($n=0;$n<=$page;$n++) { $rtables[ $n ]= $pagehead. $this->H ( 3, $this->GetRealNameKey ( $this->InscriptionsObj()->Actions ( $this->CGI_GET("Action") ), "Latex_Title" ) ). $this->LatexTable ( "", $rtables[ $n ] ); } return join ( "\n\n\\clearpage\n\n", $rtables ). ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Participants_Friend_Level_Latex($friend,$level)\n {\n $table=\n $this->Participants_Friend_Level_Table\n (\n 0,\n $level,\n $friend,\n array()\n );\n\n // return array(array(\"ooo\"));;\n $titles=array_shift($table);\n $titles=$this->B($titles);\n\n if (count($table)>0)\n {\n array_unshift\n (\n $table,\n $titles\n );\n }\n \n return $table;\n }", "function Level_Noof_Participants_Cell($edit=0,$level=array())\n {\n if (is_array($edit)) { $level=$edit; }\n \n if (empty($level))\n {\n return $this->Language_Message(\"Levels_Noof_Participants_Cell_Title\");\n }\n \n return\n $this->Div\n (\n $this->Level_Noof_Participants($level),\n array(\"CLASS\" => 'right')\n );\n }", "function Submission_Authors_Info_Tables($submission,$friends=array())\n {\n if (empty($friends))\n {\n $friends=$this->Submission_Authors_Read($submission);\n }\n\n $tables=array();\n foreach ($friends as $id => $friend)\n {\n array_push\n (\n $tables,\n $this->Submission_Author_Info_Table($submission,$friend)\n );\n }\n\n return $this->Html_Table(\"\",array($tables));\n }", "function table($level){\n\t\treturn \"<div class=\\\"word quoted final\\\"><span>\".htmlspecialchars($this->id).\"</span></div>\";\t\n\t}", "function Submission_Author_Table($friendid,$datas=array())\n {\n if (empty($datas)) { $datas=array(\"Name\",\"Institution\"); }\n \n $friend=$this->FriendsObj()->Sql_Select_Hash(array(\"ID\" => $friendid));\n\n return $this->FriendsObj()->MyMod_Item_Table_Html(0,$friend,$datas);\n }", "public function loadFriendsList() {\n\t\t$this -> template = TemplateManager::load(\"StyledTable\");\n\t\t$this -> template -> insert(\"title\", \"Friends List\");\n\t\t$friends = $this -> user -> getContactManager() -> getFriends();\n\t\t$table = \"\";\n\t\t$online = array();\n\t\t$offline = array();\n\t\tforeach($friends as $friend) {\n\t\t\t$owner = User::getByName($friend);\n\t\t\tif (!$owner) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!$owner -> isOnline()) {\n\t\t\t\t$offline[$owner -> getUid()] = $owner;\n\t\t\t} else {\n\t\t\t\t$online[$owner -> getUid()] = $owner;\n\t\t\t}\n\t\t}\n\t\tforeach ($online as $owner) {\n\t\t\t$table .= \"<tr class=\\\"online\\\">\n\t\t\t<td class=\\\"name\\\"><span class='username' style=''>\" . $owner -> getModule(\"UserTools\") -> getFormatUsername(true) . \"</span></td>\n\t\t\t<td class=\\\"world\\\"> World \" . $owner -> getLastWorld() . \"</td></tr>\";\n\t\t}\n\t\tforeach ($offline as $owner) {\n\t\t\t$table .= \"<tr class=\\\"offline\\\">\n\t\t\t<td class=\\\"name\\\"><span class='username' style='color: #9fabbf; '>\" . $owner -> getModule(\"UserTools\") -> getFormatUsername(true) . \"</span></td>\n\t\t\t<td class=\\\"world\\\">Offline</td></tr>\";\n\t\t}\n\t\tif ($table == \"\") {\n\t\t$table = \"You don't have any friends in your contact list. Add friends in-game for them to appear here.\";\n\t\t}\n\t\t$this -> template ->insert(\"icon\", \"user\");\n\t\t$this -> template -> insert(\"table\", $table);\n\t\t$this -> display();\n\t}", "private function _level_tabs( $level = 1 )\n\t{\n\t\t$tabs = '';\n\t\t\n\t\t$tab_count = 1;\n\t\t\n\t\twhile( $tab_count < $level ):\n\t\t\n\t\t\t$tabs .= \"\\t\";\n\t\t\t\n\t\t\t$tab_count++;\n\t\t\t\n\t\tendwhile;\n\t\t\n\t\treturn $tabs;\n\t}", "function do_offset($level){\r\n $offset = \"\"; // offset for subarry\r\n for ($i=1; $i<$level;$i++){\r\n $offset = $offset . \"<td></td>\";\r\n }\r\n return $offset;\r\n}", "function print_members_details($fetched){\n\t$html = '';\n\t$html .= '<table id = \"table-output\">\n\t\t\t\t<tr>\n \t\t\t\t<th>Name</th>\n \t\t\t\t<th>Email address</th> \n \t\t\t\t</tr>';\n \tforeach($fetched as $school_details){\n\t\t$html .= '<tr><td>' . $school_details['member_name'] . '</td>';\n\t\t$html .= '<td>' . $school_details['member_email'] . '</td> </tr>';\n\t}\n\t$html .= '</table>';\n\treturn $html;\n}", "function Submission_Author_Info_Table($submission,$friend)\n {\n return\n $this->FriendsObj()->MyMod_Item_Table_Html\n (\n 0,\n $friend,\n array\n (\n \"Name\",\"Title\",\"Institution\",\"Curriculum\",\"MiniCurriculum\",\"Photo\"\n )\n );\n }", "function renderGroupList($db, $group, $groupLeader) { ?>\n <table>\n <tr> <th>Name</th> <th>Area of Expertise</th> <th>Actions</th> </tr>\n <?php // start looping through group members\n foreach (getGroup($db, $group) as $a) {\n ?>\n <tr>\n <td>\n <a href=\"/?page=viewProfile&amp;id=<?=$a['id']?>\">\n <?php \n if($a['displayName'] == \"\") {\n echo $a['name'];\n } else {\n echo $a['displayName'];\n }\n if($a['groupLeader'] == 1) {\n echo ' <span class=\"subtitle\">[group leader]</span>';\n }\n ?>\n </a>\n </td>\n <td><?=$a['mainArea']?></td>\n <td>\n <?php if($a['id'] != $_SESSION['id'] && $groupLeader == true) { // check if person is self or leader dont display remove button ?>\n <a class=\"button\" href=\"/?page=group&amp;action=remove&amp;user=<?=$a['id']?>\" onclick=\"return confirm('Remove <?=$a['name']?>?')\")>Remove from group</a>\n <a class=\"button\" href=\"/?page=group&amp;action=setLeader&amp;user=<?=$a['id']?>\" onclick=\"return confirm('Set <?=$a['name']?> as leader? This will remove you as leader.')\")>Set as leader</a>\n <?php } // end check for self, leader ?></td>\n </tr>\n <?php } // end looping through group members ?>\n </table>\n<?php }", "function Levels_Noof_Participants_Cell()\n {\n $cell=\n $this->Level_Noof_Participants().\n $this->H\n (\n 5,\n $this->MyLanguage_GetMessage(\"Levels_Rooms_Capacity_Cell_Title\").\n \": \".\n $this->Levels_Rooms_Capacity()\n ).\n \"\";\n\n return $cell;\n }", "function levelRank($newRow){\n if($newRow['Level'] > 0){\n //echo '<span id=\"hiddenLR\">' . $newRow['Level'] . '</span><span id=\"levelRank\"><img src=\"/images/Level.png\" alt=\"Level icon\" />x' . $newRow['Level'] . '</span>';\n echo '<span id=\"levelRank\"><img src=\"/images/Level.png\" alt=\"Level icon\" />x' . $newRow['Level'] . '</span>';\n }elseif($newRow['Rank'] > 0){\n //echo '<span id=\"hiddenLR\">' . $newRow['Rank'] . '.5</span><span id=\"levelRank\"><img src=\"/images/Rank.png\" alt=\"Rank icon\" />x' . $newRow['Rank'] . '</span>';\n echo '<span id=\"levelRank\"><img src=\"/images/Rank.png\" alt=\"Rank icon\" />x' . $newRow['Rank'] . '</span>';\n }else{\n //echo '<span id=\"hiddenLR\">Z</span><span id=\"levelRank\"></span>';\n echo '<span id=\"levelRank\"></span>';\n }\n}", "function toHTML($array_name, $ident = 0, $mark=\"\"){\n static $s1;\n if (is_array($array_name)){\n $s1=$s1.'<ul class=\"level_'.$ident.'\">\n ';\n foreach ($array_name as $k => $v){\n if (is_array($v)){\n for ($i=0; $i < $ident; $i++){ $s1=$s1.$mark; }\n $s1=$s1.'<li class=\"level_'.$ident.'_'.$ident.'\">'.$k .'</li>'. \" \" . \"\n \";\n $this->toHTML($v, $ident + 1, $mark);\n // $s=$s.'AFTERM';\n }else{\n for ($i=0; $i < $ident; $i++){$s1=$s1.$mark; }\n $s1=$s1.'<li class=\"level_'.$ident.'_'.$ident.' \">'.$k . \"</li>\n \" . $v .\"\";\n }\n }\n $s1=$s1.'</ul>\n ';\n }else{\n $s1=$s1.\"Error = \" . $array_name;\n }\n return $s1;\n }", "private function create_table_people2(): ?string\n\t{\n\t\t$offset = ($this->xxl ? 50 : 30);\n\t\t$rows = ($this->xxl ? 30 : 15);\n\t\t$results = db::query('SELECT csnick, l_total FROM ruid_lines JOIN uid_details ON ruid_lines.ruid = uid_details.uid WHERE status NOT IN (3,4) AND l_total != 0 ORDER BY l_total DESC, ruid_lines.ruid ASC LIMIT '.$offset.','.($rows * 3));\n\t\t$col = 1;\n\t\t$row = 0;\n\n\t\twhile ($result = $results->fetchArray(SQLITE3_ASSOC)) {\n\t\t\tif (++$row > $rows) {\n\t\t\t\t++$col;\n\t\t\t\t$row = 1;\n\t\t\t}\n\n\t\t\t$columns[$col][$row] = [\n\t\t\t\t'csnick' => $result['csnick'],\n\t\t\t\t'l_total' => $result['l_total'],\n\t\t\t\t'pos' => $offset + (($col - 1) * $rows) + $row];\n\t\t}\n\n\t\t/**\n\t\t * Return if we don't have enough data to fill the table.\n\t\t */\n\t\tif (!isset($columns[3][$rows])) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$total = db::query_single_col('SELECT COUNT(*) FROM ruid_lines JOIN uid_details ON ruid_lines.ruid = uid_details.uid WHERE status NOT IN (3,4)') - ($offset + $rows * 3);\n\t\t$colgroup = '<colgroup>'.str_repeat('<col>', 13);\n\t\t$thead = '<thead><tr><th colspan=\"13\">'.($total !== 0 ? '<span class=\"title-left\">Less Talkative People &ndash; All-Time</span><span class=\"title-right\">'.number_format($total).($total !== 1 ? ' People' : ' Person').' had even less to say..</span>' : 'Less Talkative People &ndash; All-Time');\n\t\t$thead .= '<tr><td><td>Lines<td><td>User<td><td>Lines<td><td>User<td><td>Lines<td><td>User<td>';\n\t\t$tbody = '<tbody>';\n\n\t\tfor ($i = 1; $i <= $rows; ++$i) {\n\t\t\t$tbody .= '<tr><td>';\n\n\t\t\tfor ($j = 1; $j <= 3; ++$j) {\n\t\t\t\t$tbody .= '<td>'.number_format($columns[$j][$i]['l_total']).'<td>'.$columns[$j][$i]['pos'].'<td>'.($this->link_user_php ? '<a href=\"user.php?nick='.$this->htmlify(urlencode($columns[$j][$i]['csnick'])).'\">'.$this->htmlify($columns[$j][$i]['csnick']).'</a>' : $this->htmlify($columns[$j][$i]['csnick'])).'<td>';\n\t\t\t}\n\t\t}\n\n\t\treturn '<table class=\"ppl2\">'.$colgroup.$thead.$tbody.'</table>'.\"\\n\";\n\t}", "function print_friend_request_pure_table($query_result) {\n echo \"<table class=\\\"pure-table pure-table-bordered\\\">\";\n\n echo \"<thead><tr>\";\n echo \"<td>UID</td>\";\n echo \"<td>UID2</td>\";\n echo \"<td>First Name</td>\";\n echo \"<td>Last Name</td>\";\n echo \"<td>Age</td>\";\n echo \"<td>Gender</td>\";\n echo \"<td>Location</td>\";\n echo \"<td>Request Time</td>\";\n echo \"</tr></thead>\";\n\n // echo \"<thead><tr>\";\n // for ($i = 0; $i < pg_num_fields($query_result); $i++) {\n // $fieldname = pg_field_name($query_result, $i);\n // echo \"<th>$fieldname</th>\";\n // }\n // echo \"</tr></thead>\";\n echo \"<tbody>\";\n while ($row = pg_fetch_row($query_result)) {\n echo \"<tr>\";\n $num = pg_num_fields($query_result);\n for ($i = 0; $i < $num; $i++) {\n echo \"<td>$row[$i]</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</tbody>\";\n echo \"</table>\";\n }", "function createFriendListRecord($user_id, $friend_id, $connection_id) {\n //get both user rows\n $friend_user_row = getUserRow($friend_id, \"user_loging\");\n if ($friend_user_row) {\n $user_row = getUserRow($user_id, \"user_loging\");\n //create friend_list record for user\n createListRecord($user_id, $friend_id, $friend_user_row['l_name'], $connection_id, 'friend_list');\n //create friend_list for friend\n createListRecord($friend_id, $user_id, $user_row['l_name'], $connection_id, 'friend_list');\n }\n}", "function getCountryRankingsTableString($top)\n{\n\n $username = current_username();\n\n if ($username !== null) {\n // Fetch Country ID for logged in user\n $user_query = <<<EOT\nselect\n u.country_id\nfrom\n user u\nwhere\n username = '$username'\nEOT;\n\n $user_country_data = mysql_query($user_query);\n if ($user_country_data) {\n list ($user_country_id) = mysql_fetch_row($user_country_data);\n } else {\n $user_country_id = -1;\n }\n }\n\n // Fetch Rows\n $rankings_query = <<<EOT\nselect\n c.name as country_name,\n c.country_id,\n c.flag_filename,\n count(*) as num_leaders\nfrom\n ranking r\n inner join submission s on s.submission_id = r.submission_id\n inner join user u on u.user_id = s.user_id\n inner join country c on c.country_id = u.country_id\nwhere\n r.leaderboard_id = (select max(leaderboard_id) from leaderboard\n where complete=1)\n and r.rank <= $top\ngroup by u.country_id\norder by num_leaders desc\nEOT;\n $rankings_results = mysql_query($rankings_query);\n\n // If query fails\n if (!$rankings_results) {\n return \"<p>Rankings are not available at the moment. Check back soon!</p>\";\n }\n\n $table = \"\";\n$table .= <<<EOT\n<table class=\"leaderboard\">\n<thead>\n<tr>\n <th>Rank</th>\n <th>Leaders</th>\n <th>Country</th>\n</tr>\n</thead>\n<tbody>\nEOT;\n for ($i = 1; $row = mysql_fetch_assoc($rankings_results); $i += 1) {\n $num_leaders = $row[\"num_leaders\"];\n $country_id = $row[\"country_id\"];\n $country_name = $row[\"country_name\"];\n $country_name = $country_name == NULL ? \"Unknown\" : htmlentities($country_name, ENT_COMPAT, 'UTF-8');\n $flag_filename = $row[\"flag_filename\"];\n $flag_filename = $flag_filename == NULL ? \"unk.png\" : $flag_filename;\n $flag_filename = \"<img alt=\\\"$country_name\\\" width=\\\"16\\\" height=\\\"11\\\" title=\\\"$country_name\\\" src=\\\"flags/$flag_filename\\\" />\";\n\n $row_class = $i % 2 == 0 ? \"even\" : \"odd\";\n if ($country_id == $user_country_id) {\n $table .= \" <tr class=\\\"$row_class, user\\\">\\n\";\n } else {\n $table .= \" <tr class=\\\"$row_class\\\">\\n\";\n }\n $table .= \" <td>$i</td>\\n\";\n $table .= \" <td>$num_leaders</td>\\n\";\n $table .= \" <td><a href=\\\"country_profile.php?country_id=$country_id\\\">$country_name</a></td>\";\n $table .= \" </tr>\\n\";\n }\n $table .= \"</tbody></table>\";\n return $table;\n}", "function overview_bestrep_members()\n{\n global $mybb, $settings, $db, $templates, $theme, $lang, $trow;\n\n $trow = alt_trow();\n\n $table_heading = $lang->overview_bestrep_members;\n $column1_heading = $lang->overview_username;\n $column2_heading = $lang->overview_reputation;\n\n // Fetch data\n $query = $db->query(\"SELECT username, reputation, uid, usergroup, displaygroup\n FROM \".TABLE_PREFIX.\"users\n ORDER BY reputation DESC\n LIMIT 0,{$settings['overview_max']};\");\n\n // Print data\n while ($users = $db->fetch_array($query))\n {\n $val1 = overview_parseuser($users['uid'], $users['username'], $users['usergroup'], $users['displaygroup']);\n $val2 = get_reputation($users['reputation'], $users['uid']);\n eval(\"\\$table_content .= \\\"\".$templates->get(\"overview_2_columns_row\").\"\\\";\");\n }\n\n eval(\"\\$output = \\\"\".$templates->get(\"overview_2_columns\").\"\\\";\");\n\n return $output;\n}", "function smarty_function_listforummods($params, &$smarty)\n{\n extract($params);\n\tunset($params);\n\n $out = \"\";\n foreach($moderators as $mod_id=>$mod_name) {\n if($count > 0) {\n\t $out .= \", \";\n\t }\n\t if($mod_id < 1000000) {\n\t $out .= '<a title=\"'. pnVarPrepForDisplay(_PNFORUM_PROFILE) . ': ' . pnVarPrepForDisplay($mod_name) . '\" href=\"user.php?op=userinfo&amp;uname='.pnVarPrepForDisplay($mod_name).'\">'.pnVarPrepForDisplay($mod_name).'</a>';\n\t } else {\n\t $out .= pnVarPrepForDisplay($mod_name);\n\t }\n\t $count++;\n }\n return $out;\n}", "function view(){\n\n $view=mysql_query(\"CREATE VIEW FriendsFriend AS\n SELECT user AS id FROM Friend WHERE\n (friend=(SELECT user_id FROM Account WHERE user_email='$_SESSION[friend_email]')\n AND NOT user=(SELECT user_id FROM Account WHERE user_email='$_SESSION[user_email]'))\n UNION ALL\n SELECT friend AS id FROM Friend WHERE \n (user=(SELECT user_id FROM Account WHERE user_email='$_SESSION[friend_email]')\n AND NOT friend=(SELECT user_id FROM Account WHERE user_email='$_SESSION[user_email]'))\")\n or die(\"Your friend is a hermit!\");\n \n return $view;\n }", "function Submission_Authors_Info(&$submission,$friends=array())\n {\n if (empty($friends))\n {\n $friends=$this->Submission_Authors_Read($submission);\n }\n\n $authors=array();\n foreach ($friends as $id => $friend)\n {\n array_push($authors,$this->FriendsObj()->FriendInfo($friend));\n }\n\n return\n //join(\"; \",$this->Submission_Authors($submission,$friends)).\n $this->Submission_Authors_Info_Tables($submission,$friends);\n }", "function Certificates_Table($friend,$event,$certs,$datas=array())\n {\n if (empty($datas)) { $datas=$this->Certificates_Table_Datas(); }\n \n $n=1;\n \n $table=array();\n foreach ($certs as $cert)\n {\n if (!$this->Certificate_Verify($cert) ) { continue; }\n \n array_push\n (\n $table,\n $this->Certificate_Row($n++,$friend,$event,$cert,$datas)\n );\n }\n\n if (!empty($table))\n {\n array_unshift\n (\n $table,\n $this->H(3,$this->GetRealNameKey($event,\"Name\"))\n );\n array_push\n (\n $table,\n $this->Certificates_Table_SumRow($friend,$event,$certs)\n );\n }\n\n return $table;\n }", "function as_table() \n {\n #$str = \"<table> \\n\";\n $str = \"\";\n foreach(get_object_vars($this) as $name => $obj) \n {\n if ($obj != NULL) \n {\n $str .= \"<tr>\\n\\t<td>\".$obj->label().\"</td>\\n\\t\";\n $str .= \"<td>\".$obj.\"</td>\\n</tr>\\n\";\n }\n }\n #$str .= \"</table>\\n\";\n return $str;\n }", "function tableauToHTML(array $tab)\n{\n echo \"<table>\";\n foreach ($tab as $i => $ligne) {\n echo \"<tr>\";\n foreach ($ligne as $j => $valeur) {\n echo \"<td>$valeur</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n}", "function beginChildren()\n {\n echo \"<tr>\";\n }", "function showMemberList()\r\n\t{\r\n\t\tglobal $skin;\r\n\t\tglobal $title;\r\n\t\tglobal $codex;\r\n\t\t$count=0;\r\n\t\t$start=\"users/\";\r\n\r\n\t\techo \"<div class='barre'>\";\r\n\t\techo \" <a class='barreLien' href='index.php' title='Index'>\". $title . \"</a> | \".$GLOBALS['l_menuMembers'];\r\n\t\techo \"</div>\";\r\n\r\n\t\techo \"<table border='0' cellpadding='0' cellspacing='0' width='100%'>\\n\";\r\n\t\techo \"<tr>\\n\";\r\n\t\techo \" <td class='col1tp' width='55%'>\".$GLOBALS['l_profUsername'].\"</td>\\n\";\r\n\t\techo \" <td class='col2tp' width='15%'>\".$GLOBALS['l_profLang'].\"</td>\\n\";\r\n\t\techo \" <td class='col3tp' width='15%'>\".$GLOBALS['l_profSkin'].\"</td>\\n\";\r\n\t\techo \" <td class='col4tp' width='15%'>\".$GLOBALS['l_getPosts'].\"</td>\\n\";\r\n\t\techo \"</tr>\\n\";\r\n\t\t$members=$codex->select_where(\"users\");\r\n\t\t\r\n\t\t\r\n\t\tforeach($members as $member)\r\n\t\t{\t\r\n\r\n\t\t\t\t\t\techo \"<tr>\\n <td class='filler' colspan='4'>\\n</td>\\n</tr>\\n\";\r\n\t\t\t\t\t\techo \"<tr valign='top'>\";\r\n\r\n\t\t\t\t\t\t// Username\r\n\t\t\t\t\t\techo \"<td class='col1bt'>\\n\";\r\n\t\t\t\t\t\techo \" <a class='topicLink' href='profile.php?action=view&amp;uname=\" .$member[\"username\"]. \"'>\" .$member[\"username\"]. \"</a>\\n\";\r\n\t\t\t\t\t\techo \"</td>\\n\";\r\n\r\n\t\t\t\t\t\t// Lang\r\n\t\t\t\t\t\techo \"<td class='col2bt'>\\n\";\r\n\t\t\t\t\t\techo $member[\"language\"].\"\\n\";\r\n\t\t\t\t\t\techo \"</td>\\n\";\r\n\r\n\t\t\t\t\t\t// Skin\r\n\t\t\t\t\t\techo \"<td class='col3bt'>\\n\";\r\n\t\t\t\t\t\techo $member[\"skin\"].\"\\n\";\r\n\t\t\t\t\t\techo \"</td>\\n\";\r\n\r\n\t\t\t\t\t\t// Num posts\r\n\t\t\t\t\t\techo \"<td class='col4bt'>\\n\";\r\n\t\t\t\t\t\tif (file_exists(\"users/\".$member[\"username\"].\".hits\")) echo getFile(\"users/\".$member[\"username\"].\".hits\") . \"\\n\";\r\n\t\t\t\t\t\telse echo \" -\";\r\n\t\t\t\t\t\techo \"</td>\\n\";\r\n\r\n\t\t\t\t\t\techo \"</tr>\\n\";\r\n\t\t\t\t\t\techo \"<tr valign='top'>\\n\";\r\n\r\n\t\t\t\t\t\t// Statement\r\n\t\t\t\t\t\techo \"<td class='coltxt' colspan='4'>\\n\";\r\n\t\t\t\t\t\techo \" <em>\".$member[\"statement\"].\"&nbsp;</em>\\n\";\r\n\t\t\t\t\t\techo \"</td>\\n\";\r\n\t\t\t\t\t\t\r\n\t\t}\t\t\r\n\t\t\techo \"<tr>\\n <td class='filler' colspan='4'>\\n</td>\\n</tr>\\n\";\r\n\t\t\r\n\t\t\r\n\t\techo \"</table>\";\r\n\t}", "public function level() {\n\t\t//assign public class values to function variable\n\t\t$data = $this->data;\n\t\t$data['common_data'] = $this->common_data;\n\t\t$data['page'] = 'tutor_level';\n\t\t$data['pageName'] = 'My Tutor Level';\n\t\tif($data['common_data']['user_data']['role'] == INACTIVE_STATUS_ID){\n\t\t\theader(\"Location: \".ROUTE_PROFILE);\n\t\t\tdie();\n\t\t}\n\t\t$data['tutor_details'] = $this->profile_model->getTutorDetailsById($data['common_data']['user_id']);\n\t\t$data['avg_rating'] = $this->reviews_model->getAvgRatingByTutorId($data['common_data']['user_id']);\n\t\tif(empty($data['tutor_details'])){\n\t\t\t$level_type = ($data['common_data']['user_data']['role'] == STUDENT)? OPEN_STAR:TIER;\n\t\t\t// get level\n\t\t\t$data['tutor_level'] = $this->profile_model->getTutorFirstLevel($level_type);\n\t\t} else {\n\t\t\t// get level\n\t\t\t$data['tutor_level'] = $this->profile_model->getLevelById($data['tutor_details']['level_id']);\n\t\t}\n\t\t$template['body_content'] = $this->load->view('frontend/profile/level', $data, true);\t\n\t\t$this->load->view('frontend/layouts/template', $template, false);\n\t}", "public function generate_level($levels, $count, $pid, $menuItemArray = '', $MP_array = [])\n {\n $count = (int)$count;\n $levelConf = $this->mconf[$count . '.'];\n // Translate PID to a mount page, if any:\n $mount_info = $this->sys_page->getMountPointInfo($pid);\n if (is_array($mount_info)) {\n $MP_array[] = $mount_info['MPvar'];\n $pid = $mount_info['mount_pid'];\n }\n // UIDs to ban:\n $banUidArray = $this->getBannedUids();\n // Initializing variables:\n $var = $this->JSVarName;\n $menuName = $this->JSMenuName;\n $parent = $count === 1 ? 0 : $var . ($count - 1);\n $prev = 0;\n $c = 0;\n $codeLines = '';\n $menuItems = is_array($menuItemArray) ? $menuItemArray : $this->sys_page->getMenu($pid);\n foreach ($menuItems as $uid => $data) {\n // $data['_MP_PARAM'] contains MP param for overlay mount points (MPs with \"substitute this page\" set)\n // if present: add param to copy of MP array (copy used for that submenu branch only)\n $MP_array_sub = $MP_array;\n if (array_key_exists('_MP_PARAM', $data) && $data['_MP_PARAM']) {\n $MP_array_sub[] = $data['_MP_PARAM'];\n }\n // Set \"&MP=\" var:\n $MP_var = implode(',', $MP_array_sub);\n $MP_params = $MP_var ? '&MP=' . rawurlencode($MP_var) : '';\n // If item is a spacer, $spacer is set\n $spacer = GeneralUtility::inList($this->spacerIDList, $data['doktype']);\n // If the spacer-function is not enabled, spacers will not enter the $menuArr\n if ($this->mconf['SPC'] || !$spacer) {\n // Page may not be 'not_in_menu' or 'Backend User Section' + not in banned uid's\n if (!GeneralUtility::inList($this->doktypeExcludeList, $data['doktype']) && (!$data['nav_hide'] || $this->conf['includeNotInMenu']) && !in_array($uid, $banUidArray, false)) {\n if ($count < $levels) {\n $addLines = $this->generate_level($levels, $count + 1, $data['uid'], '', $MP_array_sub);\n } else {\n $addLines = '';\n }\n $title = $data['title'];\n $url = '';\n $target = '';\n if (!$addLines && !$levelConf['noLink'] || $levelConf['alwaysLink']) {\n $LD = $this->menuTypoLink($data, $this->mconf['target'], '', '', [], $MP_params, $this->mconf['forceTypeValue']);\n // If access restricted pages should be shown in menus, change the link of such pages to link to a redirection page:\n $this->changeLinksForAccessRestrictedPages($LD, $data, $this->mconf['target'], $this->mconf['forceTypeValue']);\n $url = $this->getTypoScriptFrontendController()->baseUrlWrap($LD['totalURL']);\n $target = $LD['target'];\n }\n $codeLines .= LF . $var . $count . '=' . $menuName . '.add(' . $parent . ',' . $prev . ',0,' . GeneralUtility::quoteJSvalue($title) . ',' . GeneralUtility::quoteJSvalue($url) . ',' . GeneralUtility::quoteJSvalue($target) . ');';\n // If the active one should be chosen...\n $active = $levelConf['showActive'] && $this->isActive($data['uid'], $MP_var);\n // If the first item should be shown\n $first = !$c && $levelConf['showFirst'];\n // do it...\n if ($active || $first) {\n if ($count === 1) {\n $codeLines .= LF . $menuName . '.openID = ' . $var . $count . ';';\n } else {\n $codeLines .= LF . $menuName . '.entry[' . $parent . '].openID = ' . $var . $count . ';';\n }\n }\n // Add submenu...\n $codeLines .= $addLines;\n $prev = $var . $count;\n $c++;\n }\n }\n }\n if ($this->mconf['firstLabelGeneral'] && !$levelConf['firstLabel']) {\n $levelConf['firstLabel'] = $this->mconf['firstLabelGeneral'];\n }\n if ($levelConf['firstLabel'] && $codeLines) {\n $codeLines .= LF . $menuName . '.defTopTitle[' . $count . '] = ' . GeneralUtility::quoteJSvalue($levelConf['firstLabel']) . ';';\n }\n return $codeLines;\n }", "function MENU_startGroup($name)\n{\n\t echo(\"<li>$name<br>\n\t <table> \n\t \");\n}" ]
[ "0.7951698", "0.57952476", "0.5599526", "0.5483928", "0.5089075", "0.503302", "0.49742818", "0.48381996", "0.48159468", "0.47754562", "0.47403786", "0.47366074", "0.47354376", "0.47252083", "0.4686854", "0.4650685", "0.4632562", "0.4521064", "0.45034105", "0.45029858", "0.44302538", "0.44267216", "0.4424922", "0.44237432", "0.43984088", "0.43939245", "0.43829894", "0.43817115", "0.43695614", "0.43488285" ]
0.78198373
1
function Participants_Friend_Level_Latex, Parameter list: $friend,$level Creates latex for $friend participants levels tables.
function Participants_Friend_Level_Latex($friend,$level) { $table= $this->Participants_Friend_Level_Table ( 0, $level, $friend, array() ); // return array(array("ooo"));; $titles=array_shift($table); $titles=$this->B($titles); if (count($table)>0) { array_unshift ( $table, $titles ); } return $table; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Participants_Friend_Levels_Latex($friend,$pagehead)\n {\n $this->Participants_Friend_Read($friend);\n \n $tables=array();\n foreach ($this->Participants_Friend_Levels() as $level)\n {\n array_push\n (\n $tables,\n $this->Participants_Friend_Level_Latex($friend,$level)\n );\n }\n\n $nitemsperpage=40;\n \n $page=0;\n $rtables=array(0 => array());\n \n foreach ($tables as $table)\n {\n if (count($rtables[ $page ])+count($table)<$nitemsperpage)\n {\n $rtables[ $page ]=array_merge($rtables[ $page ],$table);\n }\n else\n {\n $page++;\n $rtables[ $page ]=$table;\n }\n }\n \n for ($n=0;$n<=$page;$n++)\n {\n $rtables[ $n ]=\n $pagehead.\n $this->H\n (\n 3,\n $this->GetRealNameKey\n (\n $this->InscriptionsObj()->Actions\n (\n $this->CGI_GET(\"Action\")\n ),\n \"Latex_Title\"\n )\n ).\n $this->LatexTable\n (\n \"\",\n $rtables[ $n ]\n );\n }\n \n return\n join\n (\n \"\\n\\n\\\\clearpage\\n\\n\",\n $rtables\n ).\n \"\";\n\n }", "function table($level){\n\t\treturn \"<div class=\\\"word quoted final\\\"><span>\".htmlspecialchars($this->id).\"</span></div>\";\t\n\t}", "function Level_Noof_Participants_Cell($edit=0,$level=array())\n {\n if (is_array($edit)) { $level=$edit; }\n \n if (empty($level))\n {\n return $this->Language_Message(\"Levels_Noof_Participants_Cell_Title\");\n }\n \n return\n $this->Div\n (\n $this->Level_Noof_Participants($level),\n array(\"CLASS\" => 'right')\n );\n }", "function Submission_Authors_Info_Tables($submission,$friends=array())\n {\n if (empty($friends))\n {\n $friends=$this->Submission_Authors_Read($submission);\n }\n\n $tables=array();\n foreach ($friends as $id => $friend)\n {\n array_push\n (\n $tables,\n $this->Submission_Author_Info_Table($submission,$friend)\n );\n }\n\n return $this->Html_Table(\"\",array($tables));\n }", "private function _level_tabs( $level = 1 )\n\t{\n\t\t$tabs = '';\n\t\t\n\t\t$tab_count = 1;\n\t\t\n\t\twhile( $tab_count < $level ):\n\t\t\n\t\t\t$tabs .= \"\\t\";\n\t\t\t\n\t\t\t$tab_count++;\n\t\t\t\n\t\tendwhile;\n\t\t\n\t\treturn $tabs;\n\t}", "function do_offset($level){\r\n $offset = \"\"; // offset for subarry\r\n for ($i=1; $i<$level;$i++){\r\n $offset = $offset . \"<td></td>\";\r\n }\r\n return $offset;\r\n}", "function formatLevel($level){\n\tif((int)$level == 0){\n\t\treturn C('STR_UNCERTIFIED');\n\t}\n\telseif((int)$level == 1){\n\t\treturn C('STR_LEVEL_1');\n\t}\n\telseif((int)$level == 2){\n\t\treturn C('STR_LEVEL_2');\n\t}\n\telseif((int)$level == 3){\n\t\treturn C('STR_LEVEL_3');\n\t}\n\telse return false;\n}", "function Submission_Author_Table($friendid,$datas=array())\n {\n if (empty($datas)) { $datas=array(\"Name\",\"Institution\"); }\n \n $friend=$this->FriendsObj()->Sql_Select_Hash(array(\"ID\" => $friendid));\n\n return $this->FriendsObj()->MyMod_Item_Table_Html(0,$friend,$datas);\n }", "function _formatMessage($message, $level)\n {\n return sprintf(\"\\r\\n<tr align=\\\"center\\\"><td>%s</td><td>%s</td><td>%s</td></tr>\",\n $this->getTime(),\n $this->levelToString($level),\n nl2br(htmlspecialchars($message)).'<br />');\n }", "function print_members_details($fetched){\n\t$html = '';\n\t$html .= '<table id = \"table-output\">\n\t\t\t\t<tr>\n \t\t\t\t<th>Name</th>\n \t\t\t\t<th>Email address</th> \n \t\t\t\t</tr>';\n \tforeach($fetched as $school_details){\n\t\t$html .= '<tr><td>' . $school_details['member_name'] . '</td>';\n\t\t$html .= '<td>' . $school_details['member_email'] . '</td> </tr>';\n\t}\n\t$html .= '</table>';\n\treturn $html;\n}", "function Submission_Author_Info_Table($submission,$friend)\n {\n return\n $this->FriendsObj()->MyMod_Item_Table_Html\n (\n 0,\n $friend,\n array\n (\n \"Name\",\"Title\",\"Institution\",\"Curriculum\",\"MiniCurriculum\",\"Photo\"\n )\n );\n }", "protected function help($level = 0)\n {\n $separator = self::OPTIONS['separator'];\n $name = $this->cmdName;\n\n $man = <<<HELP\n \nUsage : $name [OPTIONS]\n\n\n\n-d, --dir Spécifie l'emplacement de travail.\nHELP;\n fwrite($this->psdtout, $man . PHP_EOL);\n if ($level) die($level);\n }", "function levelRank($newRow){\n if($newRow['Level'] > 0){\n //echo '<span id=\"hiddenLR\">' . $newRow['Level'] . '</span><span id=\"levelRank\"><img src=\"/images/Level.png\" alt=\"Level icon\" />x' . $newRow['Level'] . '</span>';\n echo '<span id=\"levelRank\"><img src=\"/images/Level.png\" alt=\"Level icon\" />x' . $newRow['Level'] . '</span>';\n }elseif($newRow['Rank'] > 0){\n //echo '<span id=\"hiddenLR\">' . $newRow['Rank'] . '.5</span><span id=\"levelRank\"><img src=\"/images/Rank.png\" alt=\"Rank icon\" />x' . $newRow['Rank'] . '</span>';\n echo '<span id=\"levelRank\"><img src=\"/images/Rank.png\" alt=\"Rank icon\" />x' . $newRow['Rank'] . '</span>';\n }else{\n //echo '<span id=\"hiddenLR\">Z</span><span id=\"levelRank\"></span>';\n echo '<span id=\"levelRank\"></span>';\n }\n}", "function Level_Noof_Participants($level=array())\n {\n $where=$this->UnitEventWhere();\n if (!empty($level))\n {\n $where[ \"Level\" ]=$level[ \"ID\" ];\n }\n \n return $this->ParticipantsObj()->Sql_Select_NHashes($where);\n }", "function toHTML($array_name, $ident = 0, $mark=\"\"){\n static $s1;\n if (is_array($array_name)){\n $s1=$s1.'<ul class=\"level_'.$ident.'\">\n ';\n foreach ($array_name as $k => $v){\n if (is_array($v)){\n for ($i=0; $i < $ident; $i++){ $s1=$s1.$mark; }\n $s1=$s1.'<li class=\"level_'.$ident.'_'.$ident.'\">'.$k .'</li>'. \" \" . \"\n \";\n $this->toHTML($v, $ident + 1, $mark);\n // $s=$s.'AFTERM';\n }else{\n for ($i=0; $i < $ident; $i++){$s1=$s1.$mark; }\n $s1=$s1.'<li class=\"level_'.$ident.'_'.$ident.' \">'.$k . \"</li>\n \" . $v .\"\";\n }\n }\n $s1=$s1.'</ul>\n ';\n }else{\n $s1=$s1.\"Error = \" . $array_name;\n }\n return $s1;\n }", "public function table($rule, $level)\n\t{\n\t\tbnf::$maxLevel = $level;\n\t\treturn bnfRule::$rules[$this->id][$rule]->table(0);\n\t}", "private function create_table_people2(): ?string\n\t{\n\t\t$offset = ($this->xxl ? 50 : 30);\n\t\t$rows = ($this->xxl ? 30 : 15);\n\t\t$results = db::query('SELECT csnick, l_total FROM ruid_lines JOIN uid_details ON ruid_lines.ruid = uid_details.uid WHERE status NOT IN (3,4) AND l_total != 0 ORDER BY l_total DESC, ruid_lines.ruid ASC LIMIT '.$offset.','.($rows * 3));\n\t\t$col = 1;\n\t\t$row = 0;\n\n\t\twhile ($result = $results->fetchArray(SQLITE3_ASSOC)) {\n\t\t\tif (++$row > $rows) {\n\t\t\t\t++$col;\n\t\t\t\t$row = 1;\n\t\t\t}\n\n\t\t\t$columns[$col][$row] = [\n\t\t\t\t'csnick' => $result['csnick'],\n\t\t\t\t'l_total' => $result['l_total'],\n\t\t\t\t'pos' => $offset + (($col - 1) * $rows) + $row];\n\t\t}\n\n\t\t/**\n\t\t * Return if we don't have enough data to fill the table.\n\t\t */\n\t\tif (!isset($columns[3][$rows])) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$total = db::query_single_col('SELECT COUNT(*) FROM ruid_lines JOIN uid_details ON ruid_lines.ruid = uid_details.uid WHERE status NOT IN (3,4)') - ($offset + $rows * 3);\n\t\t$colgroup = '<colgroup>'.str_repeat('<col>', 13);\n\t\t$thead = '<thead><tr><th colspan=\"13\">'.($total !== 0 ? '<span class=\"title-left\">Less Talkative People &ndash; All-Time</span><span class=\"title-right\">'.number_format($total).($total !== 1 ? ' People' : ' Person').' had even less to say..</span>' : 'Less Talkative People &ndash; All-Time');\n\t\t$thead .= '<tr><td><td>Lines<td><td>User<td><td>Lines<td><td>User<td><td>Lines<td><td>User<td>';\n\t\t$tbody = '<tbody>';\n\n\t\tfor ($i = 1; $i <= $rows; ++$i) {\n\t\t\t$tbody .= '<tr><td>';\n\n\t\t\tfor ($j = 1; $j <= 3; ++$j) {\n\t\t\t\t$tbody .= '<td>'.number_format($columns[$j][$i]['l_total']).'<td>'.$columns[$j][$i]['pos'].'<td>'.($this->link_user_php ? '<a href=\"user.php?nick='.$this->htmlify(urlencode($columns[$j][$i]['csnick'])).'\">'.$this->htmlify($columns[$j][$i]['csnick']).'</a>' : $this->htmlify($columns[$j][$i]['csnick'])).'<td>';\n\t\t\t}\n\t\t}\n\n\t\treturn '<table class=\"ppl2\">'.$colgroup.$thead.$tbody.'</table>'.\"\\n\";\n\t}", "function print_friend_request_pure_table($query_result) {\n echo \"<table class=\\\"pure-table pure-table-bordered\\\">\";\n\n echo \"<thead><tr>\";\n echo \"<td>UID</td>\";\n echo \"<td>UID2</td>\";\n echo \"<td>First Name</td>\";\n echo \"<td>Last Name</td>\";\n echo \"<td>Age</td>\";\n echo \"<td>Gender</td>\";\n echo \"<td>Location</td>\";\n echo \"<td>Request Time</td>\";\n echo \"</tr></thead>\";\n\n // echo \"<thead><tr>\";\n // for ($i = 0; $i < pg_num_fields($query_result); $i++) {\n // $fieldname = pg_field_name($query_result, $i);\n // echo \"<th>$fieldname</th>\";\n // }\n // echo \"</tr></thead>\";\n echo \"<tbody>\";\n while ($row = pg_fetch_row($query_result)) {\n echo \"<tr>\";\n $num = pg_num_fields($query_result);\n for ($i = 0; $i < $num; $i++) {\n echo \"<td>$row[$i]</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</tbody>\";\n echo \"</table>\";\n }", "private function display_users_access($user_level, $row_access_level, $id, $employee_id, $last_name, $first_name){\n\n\t\t$data = '<tr>\n\t\t\t\t\t<td class=\"userData\">' . $employee_id . '</td>\n\t\t\t\t\t<td class=\"userData\">' . ucfirst($last_name) .'</td>\n\t\t\t\t\t<td class=\"userData\">' . ucfirst($first_name) .'</td>\n\t\t\t\t\t<td class=\"userData\">';\n\n\t\tswitch ($user_level) {\n\t\t\t//If Admin Level\n\t\t\tcase 3: {\n\t\t\t\tswitch ($row_access_level) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t$data .= '\n\t\t\t\t\t<input type=\"hidden\" name=\"id[]\" value=\"' . $id . '\">\n\t\t\t\t\t<select class=\"form-control\" name=\"userRank[]\">\n\t\t\t\t\t<option value=\"0\">No Access</option>\n\t\t\t\t\t<option value=\"1\" selected>General User</option>\n\t\t\t\t\t<option value=\"2\">Manager</option>\n\t\t\t\t\t<option value=\"3\">Admin</option>\n\t\t\t\t\t</select>';\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t$data .= '\n\t\t\t\t\t<input type=\"hidden\" name=\"id[]\" value=\"' . $id . '\">\n\t\t\t\t\t<select class=\"form-control\" name=\"userRank[]\">\n\t\t\t\t\t<option value=\"0\">No Access</option>\n\t\t\t\t\t<option value=\"1\">General User</option>\n\t\t\t\t\t<option value=\"2\" selected>Manager</option>\n\t\t\t\t\t<option value=\"3\">Admin</option>\n\t\t\t\t\t</select>';\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 3:\n\t\t\t\t\t$data .= '\n\t\t\t\t\t<input type=\"hidden\" name=\"id[]\" value=\"' . $id . '\">\n\t\t\t\t\t<select class=\"form-control\" name=\"userRank[]\">\n\t\t\t\t\t<option value=\"0\">No Access</option>\n\t\t\t\t\t<option value=\"1\">General User</option>\n\t\t\t\t\t<option value=\"2\">Manager</option>\n\t\t\t\t\t<option value=\"3\" selected>Admin</option>\n\t\t\t\t\t</select>';\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 4:\n\t\t\t\t\t$data .= '\n\t\t\t\t\t<input type=\"hidden\" name=\"id[]\" value=\"' . $id . '\" disabled>\n\t\t\t\t\t<select class=\"form-control\" name=\"userRank[]\" disabled>\n\t\t\t\t\t<option value=\"0\">No Access</option>\n\t\t\t\t\t<option value=\"1\">General User</option>\n\t\t\t\t\t<option value=\"2\">Manager</option>\n\t\t\t\t\t<option value=\"3\">Admin</option>\n\t\t\t\t\t<option value=\"4\" selected>Web Admin</option>\n\t\t\t\t\t</select>';\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t$data .= '\n\t\t\t\t\t<input type=\"hidden\" name=\"id[]\" value=\"' . $id . '\">\n\t\t\t\t\t<select class=\"form-control\" name=\"userRank[]\">\n\t\t\t\t\t<option value=\"0\" selected>No Access</option>\n\t\t\t\t\t<option value=\"1\">General User</option>\n\t\t\t\t\t<option value=\"2\">Manager</option>\n\t\t\t\t\t<option value=\"3\">Admin</option>\n\t\t\t\t\t</select>';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t//If Web Admin Level\n\t\t\tcase 4: {\n\t\t\t\tswitch ($row_access_level) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t$data .= '\n\t\t\t\t\t<input type=\"hidden\" name=\"id[]\" value=\"' . $id . '\">\n\t\t\t\t\t<select class=\"form-control\" name=\"userRank[]\">\n\t\t\t\t\t<option value=\"0\">No Access</option>\n\t\t\t\t\t<option value=\"1\" selected>General User</option>\n\t\t\t\t\t<option value=\"2\">Manager</option>\n\t\t\t\t\t<option value=\"3\">Admin</option>\n\t\t\t\t\t</select>';\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t$data .= '\n\t\t\t\t\t<input type=\"hidden\" name=\"id[]\" value=\"' . $id . '\">\n\t\t\t\t\t<select class=\"form-control\" name=\"userRank[]\">\n\t\t\t\t\t<option value=\"0\">No Access</option>\n\t\t\t\t\t<option value=\"1\">General User</option>\n\t\t\t\t\t<option value=\"2\" selected>Manager</option>\n\t\t\t\t\t<option value=\"3\">Admin</option>\n\t\t\t\t\t</select>';\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 3:\n\t\t\t\t\t$data .= '\n\t\t\t\t\t<input type=\"hidden\" name=\"id[]\" value=\"' . $id . '\">\n\t\t\t\t\t<select class=\"form-control\" name=\"userRank[]\">\n\t\t\t\t\t<option value=\"0\">No Access</option>\n\t\t\t\t\t<option value=\"1\">General User</option>\n\t\t\t\t\t<option value=\"2\">Manager</option>\n\t\t\t\t\t<option value=\"3\" selected>Admin</option>\n\t\t\t\t\t</select>';\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 4:\n\t\t\t\t\t$data .= '\n\t\t\t\t\t<input type=\"hidden\" name=\"id[]\" value=\"' . $id . '\" disabled>\n\t\t\t\t\t<select class=\"form-control\" name=\"userRank[]\" disabled>\n\t\t\t\t\t<option value=\"0\">No Access</option>\n\t\t\t\t\t<option value=\"1\">General User</option>\n\t\t\t\t\t<option value=\"2\">Manager</option>\n\t\t\t\t\t<option value=\"3\">Admin</option>\n\t\t\t\t\t<option value=\"4\" selected>Web Admin</option>\n\t\t\t\t\t</select>';\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t$data .= '\n\t\t\t\t\t<input type=\"hidden\" name=\"id[]\" value=\"' . $id . '\">\n\t\t\t\t\t<select class=\"form-control\" name=\"userRank[]\">\n\t\t\t\t\t<option value=\"0\" selected>No Access</option>\n\t\t\t\t\t<option value=\"1\">General User</option>\n\t\t\t\t\t<option value=\"2\">Manager</option>\n\t\t\t\t\t<option value=\"3\">Admin</option>\n\t\t\t\t\t</select>';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t//If General Access or Manager (They wont have access to add users or update privledges)\n\t\t\tdefault:\n\t\t\tswitch ($row_access_level) {\n\t\t\t\tcase 1:\n\t\t\t\t$data .= '\n\t\t\t\t<input type=\"hidden\" name=\"id[]\" value=\"' . $id . '\" disabled>\n\t\t\t\t<select class=\"form-control\" name=\"userRank[]\" disabled>\n\t\t\t\t<option value=\"0\">No Access</option>\n\t\t\t\t<option value=\"1\" selected>General User</option>\n\t\t\t\t<option value=\"2\">Manager</option>\n\t\t\t\t<option value=\"3\">Admin</option>\n\t\t\t\t</select>';\n\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t$data .= '\n\t\t\t\t<input type=\"hidden\" name=\"id[]\" value=\"' . $id . '\" disabled>\n\t\t\t\t<select class=\"form-control\" name=\"userRank[]\" disabled>\n\t\t\t\t<option value=\"0\">No Access</option>\n\t\t\t\t<option value=\"1\">General User</option>\n\t\t\t\t<option value=\"2\" selected>Manager</option>\n\t\t\t\t<option value=\"3\">Admin</option>\n\t\t\t\t</select>';\n\n\t\t\t\tbreak;\n\n\t\t\t\tcase 3:\n\t\t\t\t$data .= '\n\t\t\t\t<input type=\"hidden\" name=\"id[]\" value=\"' . $id . '\" disabled>\n\t\t\t\t<select class=\"form-control\" name=\"userRank[]\" disabled>\n\t\t\t\t<option value=\"0\">No Access</option>\n\t\t\t\t<option value=\"1\">General User</option>\n\t\t\t\t<option value=\"2\">Manager</option>\n\t\t\t\t<option value=\"3\" selected>Admin</option>\n\t\t\t\t</select>';\n\n\t\t\t\tbreak;\n\n\t\t\t\tcase 4:\n\t\t\t\t$data .= '\n\t\t\t\t<input type=\"hidden\" name=\"id[]\" value=\"' . $id . '\" disabled>\n\t\t\t\t<select class=\"form-control\" name=\"userRank[]\" disabled>\n\t\t\t\t<option value=\"0\">No Access</option>\n\t\t\t\t<option value=\"1\">General User</option>\n\t\t\t\t<option value=\"2\">Manager</option>\n\t\t\t\t<option value=\"3\">Admin</option>\n\t\t\t\t<option value=\"4\" selected>Web Admin</option>\n\t\t\t\t</select>\n\t\t\t\t';\n\n\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t$data .= '\n\t\t\t\t<input type=\"hidden\" name=\"id[]\" value=\"' . $id . '\" disabled>\n\t\t\t\t<select class=\"form-control\" name=\"userRank[]\">\n\t\t\t\t<option value=\"0\" selected>No Access</option>\n\t\t\t\t<option value=\"1\">General User</option>\n\t\t\t\t<option value=\"2\">Manager</option>\n\t\t\t\t<option value=\"3\">Admin</option>\n\t\t\t\t</select>';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t$data .= '</td>\n\t\t\t\t\t<td class=\"userHistory\">\n\t\t\t\t\t<a href=\"user_history.php?employee_id=' . $employee_id . '\">History</a>\n\t\t\t\t\t</td>\n\t\t\t\t\t</tr>';\n\n\t\treturn $data;\n\t}", "function Levels_Noof_Participants_Cell()\n {\n $cell=\n $this->Level_Noof_Participants().\n $this->H\n (\n 5,\n $this->MyLanguage_GetMessage(\"Levels_Rooms_Capacity_Cell_Title\").\n \": \".\n $this->Levels_Rooms_Capacity()\n ).\n \"\";\n\n return $cell;\n }", "function myRow($row,$pos){\r\n\techo \"<tr class='table-primary'>\";\r\n\techo \"<th>\".$pos.\"</th><td>\".$row['username'].\"</td><td>\".$row['credits'].\"xp</td><td class='text-dark'>\".$row['wins'].\" </td><td class='text-danger'>\".$row['loses'].\"</td>\";\r\n\techo \"</tr>\";\t\r\n}", "function setLevelHead()\n\t{\n\t\tglobal $ilTabs, $ilCtrl, $tpl, $lng, $ilHelp;\n\n\t\t// tabs\n\t\t$ilTabs->clearTargets();\n\t\t$ilHelp->setScreenIdComponent(\"skmg_lev\");\n\t\t\n\t\t$ilTabs->setBackTarget($lng->txt(\"back\"),\n\t\t\t$ilCtrl->getLinkTarget($this, \"edit\"));\n\n\t\tif ($_GET[\"level_id\"] > 0)\n\t\t{\n\t\t\t$ilTabs->addTab(\"level_settings\",\n\t\t\t\t$lng->txt(\"settings\"),\n\t\t\t\t$ilCtrl->getLinkTarget($this, \"editLevel\"));\n\n/*\t\t\t$ilTabs->addTab(\"level_trigger\",\n\t\t\t\t$lng->txt(\"skmg_trigger\"),\n\t\t\t\t$ilCtrl->getLinkTarget($this, \"editLevelTrigger\"));*/\n\t\t\t\t\n\t\t\t$ilTabs->addTab(\"level_resources\",\n\t\t\t\t$lng->txt(\"skmg_resources\"),\n\t\t\t\t$ilCtrl->getLinkTarget($this, \"showLevelResources\"));\n/*\n\t\t\t$ilTabs->addTab(\"level_certificate\",\n\t\t\t\t$lng->txt(\"certificate\"),\n\t\t\t\t$ilCtrl->getLinkTargetByClass(\"ilcertificategui\", \"certificateEditor\"));*/\n\t\t\t\n\t\t}\n\n\t\t// title\n\t\tif ($_GET[\"level_id\"] > 0)\n\t\t{\n\t\t\t$tpl->setTitle($lng->txt(\"skmg_skill_level\").\": \".\n\t\t\t\tilBasicSkill::lookupLevelTitle((int) $_GET[\"level_id\"]));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tpl->setTitle($lng->txt(\"skmg_skill_level\"));\t\t\t\n\t\t}\n\n\t\tinclude_once(\"./Services/Skill/classes/class.ilSkillTree.php\");\n\t\t$tree = new ilSkillTree();\n\t\t$path = $tree->getPathFull($this->node_object->getId());\n\t\t$desc = \"\";\n\t\tforeach ($path as $p)\n\t\t{\n\t\t\tif (in_array($p[\"type\"], array(\"scat\", \"skll\")))\n\t\t\t{\n\t\t\t\t$desc.= $sep.$p[\"title\"];\n\t\t\t\t$sep = \" > \";\n\t\t\t}\n\t\t}\n\t\t$tpl->setDescription($desc);\n\t}", "function renderTableData($users_info)\n {\n echo '\n \t<tr>\n \t<td class=\"column1\">' . $users_info[0] . '</td>\n \t<td class=\"column2\">' . $users_info[2] . '</td>\n \t<td class=\"column2\">' . $users_info[3] . '</td>\n \t<td class=\"column2\">' . $users_info[4] . '</td>\n \t<td class=\"column3\">' . $users_info[1] . '</td>\n \t<td class=\"column4\">' . $users_info[7] . ' ' . $users_info[8] . '</td>\n\t\t\t</tr>\n ';\n }", "function printHTMLTable($arrayNewPerson = array(),$col,$i){\n if(isset( $arrayNewPerson[$i][$col])){\n echo('<td>' .$arrayNewPerson[$i][$col] . '</td>');\n }\n else\n {\n echo('<td></td>');\n }\n }", "static function level ($in, $level = 1) {\n\t\tif ($level < 1) {\n\t\t\treturn $in;\n\t\t}\n\t\treturn preg_replace('/^(.*)$/m', str_repeat(\"\\t\", $level).'$1', $in);\n\t}", "public function level() {\n\t\t//assign public class values to function variable\n\t\t$data = $this->data;\n\t\t$data['common_data'] = $this->common_data;\n\t\t$data['page'] = 'tutor_level';\n\t\t$data['pageName'] = 'My Tutor Level';\n\t\tif($data['common_data']['user_data']['role'] == INACTIVE_STATUS_ID){\n\t\t\theader(\"Location: \".ROUTE_PROFILE);\n\t\t\tdie();\n\t\t}\n\t\t$data['tutor_details'] = $this->profile_model->getTutorDetailsById($data['common_data']['user_id']);\n\t\t$data['avg_rating'] = $this->reviews_model->getAvgRatingByTutorId($data['common_data']['user_id']);\n\t\tif(empty($data['tutor_details'])){\n\t\t\t$level_type = ($data['common_data']['user_data']['role'] == STUDENT)? OPEN_STAR:TIER;\n\t\t\t// get level\n\t\t\t$data['tutor_level'] = $this->profile_model->getTutorFirstLevel($level_type);\n\t\t} else {\n\t\t\t// get level\n\t\t\t$data['tutor_level'] = $this->profile_model->getLevelById($data['tutor_details']['level_id']);\n\t\t}\n\t\t$template['body_content'] = $this->load->view('frontend/profile/level', $data, true);\t\n\t\t$this->load->view('frontend/layouts/template', $template, false);\n\t}", "function translate_level_to_role($level)\n {\n }", "function tableauToHTML(array $tab)\n{\n echo \"<table>\";\n foreach ($tab as $i => $ligne) {\n echo \"<tr>\";\n foreach ($ligne as $j => $valeur) {\n echo \"<td>$valeur</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n}", "function as_table() \n {\n #$str = \"<table> \\n\";\n $str = \"\";\n foreach(get_object_vars($this) as $name => $obj) \n {\n if ($obj != NULL) \n {\n $str .= \"<tr>\\n\\t<td>\".$obj->label().\"</td>\\n\\t\";\n $str .= \"<td>\".$obj.\"</td>\\n</tr>\\n\";\n }\n }\n #$str .= \"</table>\\n\";\n return $str;\n }", "public function loadFriendsList() {\n\t\t$this -> template = TemplateManager::load(\"StyledTable\");\n\t\t$this -> template -> insert(\"title\", \"Friends List\");\n\t\t$friends = $this -> user -> getContactManager() -> getFriends();\n\t\t$table = \"\";\n\t\t$online = array();\n\t\t$offline = array();\n\t\tforeach($friends as $friend) {\n\t\t\t$owner = User::getByName($friend);\n\t\t\tif (!$owner) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!$owner -> isOnline()) {\n\t\t\t\t$offline[$owner -> getUid()] = $owner;\n\t\t\t} else {\n\t\t\t\t$online[$owner -> getUid()] = $owner;\n\t\t\t}\n\t\t}\n\t\tforeach ($online as $owner) {\n\t\t\t$table .= \"<tr class=\\\"online\\\">\n\t\t\t<td class=\\\"name\\\"><span class='username' style=''>\" . $owner -> getModule(\"UserTools\") -> getFormatUsername(true) . \"</span></td>\n\t\t\t<td class=\\\"world\\\"> World \" . $owner -> getLastWorld() . \"</td></tr>\";\n\t\t}\n\t\tforeach ($offline as $owner) {\n\t\t\t$table .= \"<tr class=\\\"offline\\\">\n\t\t\t<td class=\\\"name\\\"><span class='username' style='color: #9fabbf; '>\" . $owner -> getModule(\"UserTools\") -> getFormatUsername(true) . \"</span></td>\n\t\t\t<td class=\\\"world\\\">Offline</td></tr>\";\n\t\t}\n\t\tif ($table == \"\") {\n\t\t$table = \"You don't have any friends in your contact list. Add friends in-game for them to appear here.\";\n\t\t}\n\t\t$this -> template ->insert(\"icon\", \"user\");\n\t\t$this -> template -> insert(\"table\", $table);\n\t\t$this -> display();\n\t}" ]
[ "0.74381435", "0.63679016", "0.6210783", "0.5488166", "0.5420102", "0.5234745", "0.5188523", "0.5135487", "0.51255983", "0.50654703", "0.49575117", "0.49445164", "0.49380684", "0.49192896", "0.4888377", "0.48757696", "0.48686963", "0.48625335", "0.47404295", "0.4739599", "0.4726549", "0.47233874", "0.47174183", "0.4690643", "0.46853665", "0.4667829", "0.46331853", "0.46183768", "0.46069103", "0.46066165" ]
0.8429968
0
Define o valor do atributo sId
public function setId($sId) { $this->sId = $sId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setId($sId) \r\n\t{\r\n\t\t$this->sId = $sId;\r\n\t}", "function getSId() {\n return $this->sId;\n }", "public function setNameAndId() {}", "public function setId($x) { $this->id = $x; }", "public function getId() \r\n\t{\r\n\t\treturn $this->sId;\r\n\t}", "public function setId()\n\t{\n\t}", "function setId_situacion($iid_situacion = '')\n {\n $this->iid_situacion = $iid_situacion;\n }", "public function setId(string $sId): self\n {\n $this->sId = $sId;\n return $this;\n }", "function setId_serie($iid_serie)\n {\n $this->iid_serie = $iid_serie;\n }", "function setId_situacion($iid_situacion = '')\n {\n $this->iid_situacion = (int)$iid_situacion;\n }", "function SetId($value) { $this->id=$value; }", "public function getId_sala()\n {\n return $this->id_sala;\n }", "public static function seoIdAttribute()\n {\n return \"POST-\".Carbon::now()->format('dmyhis').str_random(5);\n }", "function setId_situacion($iid_situacion)\n {\n $this->iid_situacion = $iid_situacion;\n }", "public function getIdParameter(): string;", "public function setId($id){ $this->id=$id;}", "public function getIdSoin() {\r\n return $this->idSoin;\r\n }", "function get_id($id){\n\t\t$this->id = $id;\n\t}", "public function setId($_id);", "public function get_Id(){\n return $this->id;\n }", "public function getAttributeId();", "public function getStrId();", "public function setId($var){\n\t\t$this->id=$var;\n\t}", "abstract public function getId();", "public function determineId() {}", "public function setId($valor){\n\t\t\t$this->id = $valor;\n\t\t}", "function setId($value) {\n $this->_id = intval($value);\n }", "public function getId() ;", "public function setId($id) ;", "protected function defineNameId(){\n list($name,$id)=$this->resolveNameID();\n $this->_id=$this->htmlOptions['id']=$id;\n\t\t$this->_name=$this->htmlOptions['name']=$name;\n }" ]
[ "0.7322991", "0.7056454", "0.6685727", "0.6613332", "0.6554034", "0.65516776", "0.6495617", "0.6444906", "0.6394313", "0.63942003", "0.6392534", "0.6387904", "0.6349595", "0.6320671", "0.6252567", "0.6229197", "0.62225413", "0.61767", "0.61662096", "0.61482006", "0.6142754", "0.61261034", "0.61081123", "0.6103953", "0.6094422", "0.60899633", "0.6079235", "0.6063595", "0.6024087", "0.6011829" ]
0.7133046
1
Define o valor do atributo sRenderTo, referente ao ID do objeto onde a tela deve ser renderizada
public function setRenderTo($sRenderTo) { $this->sRenderTo = $sRenderTo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRender(){\n //Adiciona a funcionalidade para definir o campo que deve receber o foco inicial\n if($this->getCampoFoco() != null){\n $sFuncao = View::campoFocus($this->getCampoFoco()->getId());\n $this->addListener(Base::EVENTO_APOS_MONTAR, $sFuncao);\n }\n \n //Adiciona a funcionalidade que centraliza o formulário na tela\n if($this->getCentraliza()){\n $sFuncao = Base::getFuncaoCentraliza();\n $this->addListener(Base::EVENTO_MONTAR, $sFuncao);\n }\n \n //Adiciona a funcionalidade que indica que será possível arrastar o formulário\n if($this->getPermiteArrastar()){\n $sFuncao = Base::getFuncaoLimitaArrasto($this->getId(),$this->getRenderTo());\n $this->addListener(Base::EVENTO_MONTAR, $sFuncao);\n }\n \n $aRender = array(\n \"animCollapse\" => true,\n \"autoScroll\" => true,\n \"waitMsgTarget\" => true,\n \"bodyPadding\" => 10,\n \"iconCls\" => 'icon-form',\n \"border\" => $this->getAdicionaBorda(),\n //\"glyph\" => 36,\n \"layout\" => $this->getLayout(),\n \"id\" => $this->getId(),\n \"title\" => $this->getTitulo(),\n \"closable\" => $this->getPermiteFechar(),\n \"resizable\" => $this->getPermiteRedimensionar(),\n \"draggable\" => $this->getPermiteArrastar(),\n \"collapsible\" => $this->getPermiteRecolher(),\n \"height\" => $this->getAltura(),\n \"width\" => $this->getLargura(),\n \"html\" => $this->getHtml(),\n \"items\" => $this->getStringItemsLayout(),\n \"buttons\" => $this->getBotoes(),\n \"listeners\" => $this->getListeners(),\n \"reloadPreviousOnClose\" => $this->getReloadPreviousOnClose()\n );\n \n $oForm = \"Ext.create('Ext.panel.Panel', {\".Base::getRender($aRender).\"})\";\n \n return Base::addObj($oForm,$this->getRenderTo());\n }", "public function getRender(){\r\n //return $this->render;\r\n }", "public function render()\n {\n $myConfig = $this->getConfig();\n parent::render();\n\n $soxId = $this->_aViewData[\"oxid\"] = $this->getEditObjectId();\n\n\n if ($soxId != \"-1\" && isset($soxId)) {\n // load object\n $oShop = oxNew(\"oxshop\");\n $isubjlang = oxRegistry::getConfig()->getRequestParameter(\"subjlang\");\n if (!isset($isubjlang)) {\n $isubjlang = $this->_iEditLang;\n }\n\n if ($isubjlang && $isubjlang > 0) {\n $this->_aViewData[\"subjlang\"] = $isubjlang;\n }\n\n $oShop->loadInLang($isubjlang, $soxId);\n\n $this->_aViewData[\"edit\"] = $oShop;\n //oxSession::setVar( \"actshop\", $soxId);//echo \"<h2>$soxId</h2>\";\n oxRegistry::getSession()->setVariable(\"shp\", $soxId);\n }\n\n\n $this->_aViewData['IsOXDemoShop'] = $myConfig->isDemoShop();\n if (!isset($this->_aViewData['updatenav'])) {\n $this->_aViewData['updatenav'] = oxRegistry::getConfig()->getRequestParameter('updatenav');\n }\n\n return \"shop_main.tpl\";\n }", "public function render()\n {\n $style = $this->getStyle();\n $text = $this->getText();\n $id = $this->objectName;\n $func = $this->getFunction();\n\n switch ($this->getValue()) {\n case \"0\":\n $image_url = $this->myPrivateImg;\n break;\n case \"1\":\n $image_url = $this->mySharedImg;\n break;\n case \"2\":\n $image_url = $this->groupSharedImg;\n break;\n case \"3\":\n $image_url = $this->otherSharedImg;\n break;\n case \"4\":\n $image_url = $this->myAssignedImg;\n break;\n case \"5\":\n $image_url = $this->myDistributedImg;\n break;\n default:\n if ($this->defaultImg == '{OPENBIZ_RESOURCE_URL}/common/images/icon_data_shared_other.gif') {\n $this->defaultImg = $this->otherSharedImg;\n }\n $image_url = $this->defaultImg;\n break;\n }\n\n if (preg_match(\"/\\{.*\\}/si\", $image_url)) {\n $formobj = $this->getFormObj();\n $image_url = Expression::evaluateExpression($image_url, $formobj);\n } else {\n $image_url = Openbizx::$app->getImageUrl() . \"/\" . $image_url;\n }\n if ($this->width) {\n $width = \"width=\\\"$this->width\\\"\";\n }\n if ($this->link) {\n $link = $this->getLink();\n $target = $this->getTarget();\n $sHTML = \"<a id=\\\"$id\\\" href=\\\"$link\\\" $target $func $style><img $width src='$image_url' /></a>\";\n } else {\n $sHTML = \"<img id=\\\"$id\\\" alt=\\\"\" . $text . \"\\\" title=\\\"\" . $text . \"\\\" $width src='$image_url' />\";\n }\n return $sHTML;\n }", "protected function callRenderMethod() {}", "public function render()\r\n {\r\n parent::render();\r\n $this->fcLoadObjectDetails($this->oModel);\r\n return $this->_sThisTemplate;\r\n }", "function beforeRender() {\n parent::beforeRender();\n \n $dsfid = null;\n \n if($this->action == 'add' || $this->action == 'index') {\n // Accept DataScrubberFilter ID from the url\n \n if(!empty($this->request->params['named']['datascrubberfilter'])) {\n $dsfid = filter_var($this->request->params['named']['datascrubberfilter'],FILTER_SANITIZE_SPECIAL_CHARS);\n }\n } elseif($this->action == 'edit' || $this->action == 'view') {\n if(!empty($this->request->params['pass'][0])) {\n $dsfid = $this->DataScrubberFilterAttribute->field('data_scrubber_filter_id', array('DataScrubberFilterAttribute.id' => $this->request->params['pass'][0]));\n }\n }\n \n if($dsfid) {\n // Look up the record, including the parent Data Filter to get the description\n \n $args = array();\n $args['conditions']['DataScrubberFilter.id'] = $dsfid;\n $args['contain'] = false;\n // We can't use contain(DataFilter) probably because we're not setting up the\n // dynamic relations correctly\n// $args['contain'] = array('DataFilter');\n \n $dsfilter = $this->DataScrubberFilterAttribute->DataScrubberFilter->find('first', $args);\n \n if(!empty($dsfilter)) {\n $this->set('vv_dsfilter', $dsfilter['DataScrubberFilter']);\n\n // Relations aren't autobinding DataFilter...\n $DataFilter = ClassRegistry::init('DataFilter');\n \n $args = array();\n $args['conditions']['DataFilter.id'] = $dsfilter['DataScrubberFilter']['data_filter_id'];\n $args['contain'] = false;\n \n $datafilter = $DataFilter->find('first', $args);\n\n if(!empty($datafilter)) {\n $this->set('vv_datafilter', $datafilter['DataFilter']);\n }\n }\n }\n \n // Pull the set of attributes available for scrubbing\n \n $supportedAttrs = $this->DataScrubberFilterAttribute->supportedAttributes($this->cur_co['Co']['id']);\n \n $this->set('vv_available_attributes', $supportedAttrs);\n }", "public function render($toScreen = TRUE);", "abstract public function getRenderName();", "public function render() {\n \t\tif (isset($_GET['eventId']) )\n\t\t\t$this->allElements[$_GET['eventId']]->callOnClickPreRenderFn();\n\n\t\tparent::render();\n \t\t\n\t\tif (isset($_GET['eventId']) )\n\t\t\t$this->allElements[$_GET['eventId']]->callOnClickPostRenderFn();\n\n\t}", "function renderObject($def, $data, $for_pdf = false) {\n $str = \"<span id='\".$def['ID'].\"' class='\".$def['Type'].\"' style='\";\n $str .= $this->renderLayout($def);\n if(isset($def['Style'])) {\n $str .= $this->renderStyle($def['Style']);\n }\n if($for_pdf) {\n switch($this->safeGet($def, 'Type')) {\n case 'Footer':\n $str .= \"position:fixed;bottom:\";\n $str .= ($for_pdf === true) ? \"0px;\" : $for_pdf.\";\";\n break;\n case 'Header':\n $str .= \"position:fixed;top:0px;\";\n break;\n case 'Page':\n $str .= \"position:absolute;top:0px;\";\n if($for_pdf !== true) {\n $str .= \"padding-bottom:\".$for_pdf.\";\";\n }\n break;\n }\n }\n $str .= \"'>\";\n switch($def['Type']) {\n case \"Page\":\n case \"Header\":\n case \"Footer\": \n case \"Container\":\n foreach($def['Children'] as $child) {\n $str .= $this->renderObject($child, $data);\n }\n break;\n case \"Text\":\n $str .= $def['Text'];\n break;\n case \"Repeater\":\n //repeated section\n if(isset($data[$def['Source']])) {\n foreach($data[$def['Source']] as $row) {\n foreach($def['Children'] as $child) {\n $str .= $this->renderObject($child, $row);\n }\n }\n }\n break;\n case \"Data\":\n if(isset($def['Label'])) {\n $str .= ($def['Label'].\" \");\n }\n if(isset($def['Field'])) {\n $path = explode('.', $def['Field']);\n switch(count($path)) {\n case 2:\n $value = $this->safeGet($data, [$path[0],$path[1]]);\n break;\n case 1:\n $value = $this->safeGet($data,$path[0]);\n break;\n default:\n $value = \"<span style='color:red;'>Invalid binding syntax: \".$def['Field'].\"</span>\";\n break;\n }\n if(is_array($value)) {\n if(isset($def['Format'])) {\n $str .= $this->stringifyData($value, $def['Format']);\n } else {\n foreach($value as $key => $entry) {\n $str .= $entry .\" \";\n }\n }\n } else {\n $str .= $value;\n }\n }\n break;\n case \"Image\":\n //render image\n //Source\n break;\n }\n $str .= \"</span>\";\n return $str;\n }", "function render(){\n\t\t\n\t}", "function render($id){\n $data = $this->fields[$id];\n switch($data['type']){\n case \"select\": $this->createSelect($data); break;\n case \"radio\": $this->createRadio($data); break;\n case \"textarea\": $this->createTextArea($data); break;\n case \"number\": case \"date\": $this->createDateAndNumber($data); break;\n case \"password\": $this->createPassword($data); break; \n default: $this->createElement($data);\n }\n }", "private function getMenuObjectRender()\n {\n return (object)$this->getMenuArrayRender();\n }", "protected function _add_render_attributes() {\n \n // use parent attributes\n parent::_add_render_attributes();\n \n }", "public function __toString()\n {\n if (isset($this->properties['Title'])) {\n return $this->properties['Title'] . ' (# '.$this->properties['Id'].')';\n }\n return '# '.$this->properties['Id'];\n }", "protected function render() {}", "protected function render() {}", "protected function render() {}", "public function actionView($id_curso_disponible_servidor_publico)\n{\n$this->render('view',array(\n'cursoDisponibleServidorPublico'=>$this->loadModel($id_curso_disponible_servidor_publico),\n));\n}", "public function render()\n {\n parent::render();\n\n $soxId = $this->getEditObjectId();\n $sRemoxId = oxRegistry::getConfig()->getRequestParameter(\"rem_oxid\");\n if ($soxId != \"-1\" && isset($soxId)) {\n // load object\n $oUser = oxNew(\"oxuser\");\n $oUser->load($soxId);\n $this->_aViewData[\"edit\"] = $oUser;\n\n // all remark\n $oRems = oxNew(\"oxlist\");\n $oRems->init(\"oxremark\");\n $sQuotedUserId = oxDb::getDb()->quote($oUser->getId());\n $sSelect = \"select * from oxremark where oxparentid=\" . $sQuotedUserId . \" order by oxcreate desc\";\n $oRems->selectString($sSelect);\n foreach ($oRems as $key => $val) {\n if ($val->oxremark__oxid->value == $sRemoxId) {\n $val->selected = 1;\n $oRems[$key] = $val;\n break;\n }\n }\n\n $this->_aViewData[\"allremark\"] = $oRems;\n\n if (isset($sRemoxId)) {\n $oRemark = oxNew(\"oxRemark\");\n $oRemark->load($sRemoxId);\n $this->_aViewData[\"remarktext\"] = $oRemark->oxremark__oxtext->value;\n $this->_aViewData[\"remarkheader\"] = $oRemark->oxremark__oxheader->value;\n }\n }\n\n return \"user_remark.tpl\";\n }", "public function Render($render_style = NULL, $error_message = NULL) {\n // Zavolame base Render, ktera vytvori pohled a preda zakladni atributy\n $view = parent::Render($render_style, $error_message);\n\n // Predame name - z form_data/ORM modelu/watermark\n $this->addNameToView($view);\n\n // Vratime $view\n return $view;\n }", "function beforeRender() {\n parent::beforeRender();\n \n if(!$this->request->is('restful')) {\n $msid = null;\n \n if(!empty($this->params->named['matchserver'])) {\n $msid = $this->params->named['matchserver'];\n } elseif(!empty($this->request->data['MatchServerAttribute']['match_server_id'])) {\n $msid = $this->request->data['MatchServerAttribute']['match_server_id'];\n }\n \n $this->set('vv_msid', $msid);\n \n // To get the Match Server description, we have to walk all the way back\n // to the Server\n \n if($msid) {\n $serverId = $this->MatchServerAttribute->MatchServer->field('server_id', array('MatchServer.id' => $msid));\n \n if($serverId) {\n $this->set('vv_server_desc', $this->MatchServerAttribute->MatchServer->Server->field('description', array('Server.id' => $serverId)));\n }\n }\n \n // Pull the set of attributes available for the match service and\n // structure them suitably for the view\n \n $supportedAttrs = $this->MatchServerAttribute->supportedAttributes();\n \n $attrs = array();\n $attrTypes = array();\n \n foreach($supportedAttrs as $a => $acfg) {\n $attrs[$a] = $acfg['label'];\n \n if($acfg['type']) {\n $attrTypes[$a] = $this->CoExtendedType->active($this->cur_co['Co']['id'], $acfg['type']);\n }\n }\n \n $this->set('vv_available_attributes', $attrs);\n $this->set('vv_available_attribute_types', $attrTypes);\n }\n }", "abstract public function render() ;", "public function __toString()\n {\n return 'Sitemap #'.$this->id;\n }", "public function render(){\n\t\t\n\t}", "function __renderEntity($entity,$action,$data){\r\n\tTemplate::getInstance()->renderEntity($entity,$action,$data);\r\n}", "abstract protected function renderEdit();", "public function toUrl()\n {\n\n return '<a href=\"'.static::$toUrl.'&amp;objid='.$this->id.'\" >'.$this->text().'</a>';\n\n }", "protected function addAttributesToRender($writer)\n\t{\n\t\tparent::addAttributesToRender($writer);\n\t\tif(($butt=$this->getDefaultButton())!=='')\n\t\t\t$writer->addAttribute('id',$this->getClientID());\n\t}" ]
[ "0.52140653", "0.5034156", "0.50194436", "0.49335533", "0.49100548", "0.4884406", "0.48568046", "0.48444262", "0.48036072", "0.4786015", "0.4682908", "0.46659297", "0.4634784", "0.46195084", "0.46192455", "0.46038598", "0.46035457", "0.46035457", "0.46019349", "0.4597665", "0.4583505", "0.45800924", "0.45773798", "0.45541063", "0.4536942", "0.45304808", "0.45251346", "0.45250198", "0.4523217", "0.45219675" ]
0.6826935
1
Define o valor do atributo sClasseEvento
public function setClasseEvento($sClasseEvento) { $this->sClasseEvento = $sClasseEvento; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setClasseTipoEvento($sClasseTipoEvento) {\n $this->sClasseTipoEvento = $sClasseTipoEvento;\n }", "private function creaEvento() {\n $fevento = USingleton::getInstance('FEvento');\n $dati = $this->dati;\n $classe = $this->classe;\n \n //----------------sezione di controllo delle operazioni-----------------\n \n if ($this->operazione == 'inserimento') {\n if ($this->tabella == 'evento') {\n $id = 1 + $fevento->loadultimoevento()[0];\n }\n if ($this->tabella == 'evento_spec') {\n $id = $dati['code'];\n }\n if ($this->tabella == 'partecipazione') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n if ($this->tabella == 'biglietti') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n }\n if ($this->operazione == 'cancellazione') {\n if ($this->tabella == 'evento') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n if ($this->tabella == 'evento_spec') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n if ($this->tabella == 'partecipazione') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n }\n//---------------------------------------------------------------------------------------------------------\n\n $zona = [new EZona($dati['zona'], $dati['capacita'])];\n $luogo = new ELuogo($dati['citta'], $dati['struttura'], $zona);\n $partecipazioni = [new EPartecipazione($zona[0], $dati['prezzo'])];\n\n if ($classe == 'EPartita') {\n $eventoSpecifico = [new EPartita($luogo, $dati['data'], $partecipazioni, $dati['casa'], $dati['ospite'])];\n }\n if ($classe == 'ESpettacolo') {\n $eventoSpecifico = [new ESpettacolo($luogo, $dati['data'], $partecipazioni, $dati['compagnia'])];\n }\n if ($classe == 'EConcerto') {\n $eventoSpecifico = [new EConcerto($luogo, $dati['data'], $partecipazioni, $dati['artista'])];\n }\n\n $evento = new EEvento($id, $dati['immagine'], $dati['nome_evento'], $eventoSpecifico);\n\n return $evento;\n }", "function ct_event() {\n\t\tglobal $Language;\n\n\t\t// C_EVENT_ID\n\t\t$this->C_EVENT_ID = new cField('t_event', 't_event', 'x_C_EVENT_ID', 'C_EVENT_ID', '`C_EVENT_ID`', 3, -1, FALSE, '`C_EVENT_ID`', FALSE);\n\t\t$this->C_EVENT_ID->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_EVENT_ID'] =& $this->C_EVENT_ID;\n\n\t\t// FK_CONGTY_ID\n\t\t$this->FK_CONGTY_ID = new cField('t_event', 't_event', 'x_FK_CONGTY_ID', 'FK_CONGTY_ID', '`FK_CONGTY_ID`', 3, -1, FALSE, '`FK_CONGTY_ID`', FALSE);\n\t\t$this->FK_CONGTY_ID->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['FK_CONGTY_ID'] =& $this->FK_CONGTY_ID;\n\n\t\t// C_EVENT_NAME\n\t\t$this->C_EVENT_NAME = new cField('t_event', 't_event', 'x_C_EVENT_NAME', 'C_EVENT_NAME', '`C_EVENT_NAME`', 201, -1, FALSE, '`C_EVENT_NAME`', FALSE);\n\t\t$this->fields['C_EVENT_NAME'] =& $this->C_EVENT_NAME;\n\n\t\t// C_TYPE_EVENT\n\t\t$this->C_TYPE_EVENT = new cField('t_event', 't_event', 'x_C_TYPE_EVENT', 'C_TYPE_EVENT', '`C_TYPE_EVENT`', 3, -1, FALSE, '`C_TYPE_EVENT`', FALSE);\n\t\t$this->C_TYPE_EVENT->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_TYPE_EVENT'] =& $this->C_TYPE_EVENT;\n\n\t\t// C_POST\n\t\t$this->C_POST = new cField('t_event', 't_event', 'x_C_POST', 'C_POST', '`C_POST`', 3, -1, FALSE, '`C_POST`', FALSE);\n\t\t$this->C_POST->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_POST'] =& $this->C_POST;\n\n\t\t// C_URL_IMAGES\n\t\t$this->C_URL_IMAGES = new cField('t_event', 't_event', 'x_C_URL_IMAGES', 'C_URL_IMAGES', '`C_URL_IMAGES`', 201, -1, FALSE, '`C_URL_IMAGES`', FALSE);\n\t\t$this->fields['C_URL_IMAGES'] =& $this->C_URL_IMAGES;\n\n\t\t// C_URL_LINK\n\t\t$this->C_URL_LINK = new cField('t_event', 't_event', 'x_C_URL_LINK', 'C_URL_LINK', '`C_URL_LINK`', 201, -1, FALSE, '`C_URL_LINK`', FALSE);\n\t\t$this->fields['C_URL_LINK'] =& $this->C_URL_LINK;\n\n\t\t// C_DATETIME_BEGIN\n\t\t$this->C_DATETIME_BEGIN = new cField('t_event', 't_event', 'x_C_DATETIME_BEGIN', 'C_DATETIME_BEGIN', '`C_DATETIME_BEGIN`', 135, 7, FALSE, '`C_DATETIME_BEGIN`', FALSE);\n\t\t$this->C_DATETIME_BEGIN->FldDefaultErrMsg = str_replace(\"%s\", \"/\", $Language->Phrase(\"IncorrectDateDMY\"));\n\t\t$this->fields['C_DATETIME_BEGIN'] =& $this->C_DATETIME_BEGIN;\n\n\t\t// C_DATETIME_END\n\t\t$this->C_DATETIME_END = new cField('t_event', 't_event', 'x_C_DATETIME_END', 'C_DATETIME_END', '`C_DATETIME_END`', 135, 7, FALSE, '`C_DATETIME_END`', FALSE);\n\t\t$this->C_DATETIME_END->FldDefaultErrMsg = str_replace(\"%s\", \"/\", $Language->Phrase(\"IncorrectDateDMY\"));\n\t\t$this->fields['C_DATETIME_END'] =& $this->C_DATETIME_END;\n\n\t\t// C_ODER\n\t\t$this->C_ODER = new cField('t_event', 't_event', 'x_C_ODER', 'C_ODER', '`C_ODER`', 135, 7, FALSE, '`C_ODER`', FALSE);\n\t\t$this->C_ODER->FldDefaultErrMsg = str_replace(\"%s\", \"/\", $Language->Phrase(\"IncorrectDateDMY\"));\n\t\t$this->fields['C_ODER'] =& $this->C_ODER;\n\n\t\t// C_NOTE\n\t\t$this->C_NOTE = new cField('t_event', 't_event', 'x_C_NOTE', 'C_NOTE', '`C_NOTE`', 201, -1, FALSE, '`C_NOTE`', FALSE);\n\t\t$this->fields['C_NOTE'] =& $this->C_NOTE;\n\n\t\t// C_USER_ADD\n\t\t$this->C_USER_ADD = new cField('t_event', 't_event', 'x_C_USER_ADD', 'C_USER_ADD', '`C_USER_ADD`', 3, -1, FALSE, '`C_USER_ADD`', FALSE);\n\t\t$this->C_USER_ADD->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_USER_ADD'] =& $this->C_USER_ADD;\n\n\t\t// C_ADD_TIME\n\t\t$this->C_ADD_TIME = new cField('t_event', 't_event', 'x_C_ADD_TIME', 'C_ADD_TIME', '`C_ADD_TIME`', 135, 7, FALSE, '`C_ADD_TIME`', FALSE);\n\t\t$this->C_ADD_TIME->FldDefaultErrMsg = str_replace(\"%s\", \"/\", $Language->Phrase(\"IncorrectDateDMY\"));\n\t\t$this->fields['C_ADD_TIME'] =& $this->C_ADD_TIME;\n\n\t\t// C_USER_EDIT\n\t\t$this->C_USER_EDIT = new cField('t_event', 't_event', 'x_C_USER_EDIT', 'C_USER_EDIT', '`C_USER_EDIT`', 3, -1, FALSE, '`C_USER_EDIT`', FALSE);\n\t\t$this->C_USER_EDIT->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_USER_EDIT'] =& $this->C_USER_EDIT;\n\n\t\t// C_EDIT_TIME\n\t\t$this->C_EDIT_TIME = new cField('t_event', 't_event', 'x_C_EDIT_TIME', 'C_EDIT_TIME', '`C_EDIT_TIME`', 135, 7, FALSE, '`C_EDIT_TIME`', FALSE);\n\t\t$this->C_EDIT_TIME->FldDefaultErrMsg = str_replace(\"%s\", \"/\", $Language->Phrase(\"IncorrectDateDMY\"));\n\t\t$this->fields['C_EDIT_TIME'] =& $this->C_EDIT_TIME;\n\n\t\t// C_ACTIVE_LEVELSITE\n\t\t$this->C_ACTIVE_LEVELSITE = new cField('t_event', 't_event', 'x_C_ACTIVE_LEVELSITE', 'C_ACTIVE_LEVELSITE', '`C_ACTIVE_LEVELSITE`', 3, -1, FALSE, '`C_ACTIVE_LEVELSITE`', FALSE);\n\t\t$this->C_ACTIVE_LEVELSITE->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_ACTIVE_LEVELSITE'] =& $this->C_ACTIVE_LEVELSITE;\n\n\t\t// C_TIME_ACTIVE\n\t\t$this->C_TIME_ACTIVE = new cField('t_event', 't_event', 'x_C_TIME_ACTIVE', 'C_TIME_ACTIVE', '`C_TIME_ACTIVE`', 135, 7, FALSE, '`C_TIME_ACTIVE`', FALSE);\n\t\t$this->C_TIME_ACTIVE->FldDefaultErrMsg = str_replace(\"%s\", \"/\", $Language->Phrase(\"IncorrectDateDMY\"));\n\t\t$this->fields['C_TIME_ACTIVE'] =& $this->C_TIME_ACTIVE;\n\n\t\t// C_SEND_MAIL\n\t\t$this->C_SEND_MAIL = new cField('t_event', 't_event', 'x_C_SEND_MAIL', 'C_SEND_MAIL', '`C_SEND_MAIL`', 3, -1, FALSE, '`C_SEND_MAIL`', FALSE);\n\t\t$this->C_SEND_MAIL->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_SEND_MAIL'] =& $this->C_SEND_MAIL;\n\n\t\t// C_CONTENT_MAIL\n\t\t$this->C_CONTENT_MAIL = new cField('t_event', 't_event', 'x_C_CONTENT_MAIL', 'C_CONTENT_MAIL', '`C_CONTENT_MAIL`', 201, -1, FALSE, '`C_CONTENT_MAIL`', FALSE);\n\t\t$this->fields['C_CONTENT_MAIL'] =& $this->C_CONTENT_MAIL;\n\n\t\t// C_FK_BROWSE\n\t\t$this->C_FK_BROWSE = new cField('t_event', 't_event', 'x_C_FK_BROWSE', 'C_FK_BROWSE', '`C_FK_BROWSE`', 200, -1, FALSE, '`C_FK_BROWSE`', FALSE);\n\t\t$this->fields['C_FK_BROWSE'] =& $this->C_FK_BROWSE;\n\n\t\t// FK_ARRAY_TINBAI\n\t\t$this->FK_ARRAY_TINBAI = new cField('t_event', 't_event', 'x_FK_ARRAY_TINBAI', 'FK_ARRAY_TINBAI', '`FK_ARRAY_TINBAI`', 200, -1, FALSE, '`FK_ARRAY_TINBAI`', FALSE);\n\t\t$this->fields['FK_ARRAY_TINBAI'] =& $this->FK_ARRAY_TINBAI;\n\n\t\t// FK_ARRAY_CONGTY\n\t\t$this->FK_ARRAY_CONGTY = new cField('t_event', 't_event', 'x_FK_ARRAY_CONGTY', 'FK_ARRAY_CONGTY', '`FK_ARRAY_CONGTY`', 200, -1, FALSE, '`FK_ARRAY_CONGTY`', FALSE);\n\t\t$this->fields['FK_ARRAY_CONGTY'] =& $this->FK_ARRAY_CONGTY;\n\t}", "protected function getEventClass(): string\n {\n return UserContactsEvent::class;\n }", "function eventclass_TambahPergerakan()\n\t{\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\n//\tonscreen events\n\n\n\t}", "public function getIdEvento()\n {\n return $this->id_evento;\n }", "function setEventType()\n {\n $this->_eventType = 12;\n }", "public function getIdEvento()\n {\n return $this->IdEvento;\n }", "public function getEventClass()\n {\n return $this->eventClass;\n }", "public function getEventClass()\n {\n return __NAMESPACE__ . '\\TestAsset\\LongEvent';\n }", "public function __construct($venta)\n {\n $this->venta = $venta;\n }", "function tipoSituacaoEvento($tipo){\n\t\t\t\tswitch($tipo){\n\t\t\t\t\t\n\t\t\t\tcase '1':\n\t\t\t\t\t$tipo\t= 'Solicitada';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '2':\n\t\t\t\t\t$tipo\t= 'Autorizada';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '3':\n\t\t\t\t\t$tipo\t= 'Em Andamento';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '4':\n\t\t\t\t\t$tipo\t= 'Concluida';\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\treturn $tipo;\n}", "final private static function makeEvent(Sincronizacao $sincronizacao)\n {\n $endpoint = self::getEventEndpoint($sincronizacao->sym_table, $sincronizacao->sym_action);\n\n $dependencies = self::getDependencies($sincronizacao);\n $eventClass = self::getEventClass($endpoint);\n\n return new $eventClass($dependencies['entry'], $dependencies['extra']);\n }", "public function __construct()\n {\n parent::__construct('BaseEvent');\n }", "function evt__agregar()\n\t{\n\t\t$this->set_pantalla('pant_edicion');\n\t}", "function getType ()\n\t\t{\n\t\t\treturn \"Event\";\n\t\t}", "function get_class_event()\n{\n $colect = collect([\n 'event-warning', \n 'event-info', \n 'event-special', \n 'event-success', \n 'event-inverse', \n 'event-important'\n ]);\n\n return $colect->random();\n}", "public function __construct() \r\n {\r\n \t$this->con = new cConexion();\r\n\t\t$this->tabla = \"evento\";\r\n\t\t//$this->con->Conectar();\r\n }", "public function getFkFolhapagamentoConfiguracaoEventoCaso()\n {\n return $this->fkFolhapagamentoConfiguracaoEventoCaso;\n }", "public function setIdEvento($id_evento)\n {\n if (!empty($id_evento) && !is_null($id_evento))\n $this->id_evento = $id_evento;\n }", "public function getEventClass() :string {\n $class = get_class($this);\n $classParts = explode(\"\\\\\", $class);\n\n return $classParts[count($classParts) - 1];\n }", "public function getIdCalendario(){\n return $this->idCalendario;\n }", "public function getEventPersonClass() { return 'Zayso\\CoreBundle\\Entity\\EventPerson'; }", "public function getEventName() :string {\n return get_class($this);\n }", "protected function getEventClass($className)\r\n {\r\n return $this->app->getNamespace() . \"Events\\\\{$className}\";\r\n }", "public function getFullCalendarioAttribute()\n {\n return \"{$this->cal_idanio} {$this->cal_idmes} {$this->cal_idfase}\"; \n //return $this->cal_idanio . \" \" . $this->cal_idmes . \"\" . $this->cal_idfase;\n }", "function bindEventObject()\r\n\t{\r\n JTable::addIncludePath( JPATH_ADMINISTRATOR . '/components/com_calendar/tables' );\r\n\t\t$table = JTable::getInstance( 'Events', 'CalendarTable' );\r\n\t\t\r\n\t if (!empty($this->event_id))\r\n\t {\r\n\t $table->load( $this->event_id );\r\n\t }\r\n\t \r\n\t\t$table->trimProperties();\r\n\t\t\r\n\t\t$properties = $this->getProperties();\r\n\t\t$table_properties = $table->getProperties();\r\n\r\n\t\tforeach ($table_properties as $prop=>$value)\r\n\t\t{\r\n\t\t if (!array_key_exists($prop, $properties))\r\n\t\t {\r\n\t\t $this->$prop = $table->$prop;\r\n\t\t }\r\n\t\t}\r\n\t}", "public function aggiornaEvento($date,$place,$description,$imm) {\n $this->data=$date;\n $this->luogo=$place;\n $this->descrizione=$description;\n $this->idimg=$imm;\n}", "function eventclass_student_attendance()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\t\t$this->events[\"AfterDelete\"]=true;\n\n\n//\tonscreen events\n\n\n\t}", "public function getEventNameAttribute()\n {\n if (is_object($this->event)) {\n return $this->event->name;\n };\n\n return null;\n }" ]
[ "0.636072", "0.6224268", "0.58392745", "0.57443213", "0.56934464", "0.566301", "0.5646645", "0.5600154", "0.5567555", "0.55309844", "0.55157447", "0.5482661", "0.5471365", "0.54116607", "0.5392222", "0.5338377", "0.5316798", "0.5301684", "0.52991694", "0.52920985", "0.5266235", "0.5241618", "0.519763", "0.5146715", "0.5116552", "0.5099817", "0.50915104", "0.50826126", "0.508215", "0.5067113" ]
0.71578324
0
Define o valor do atributo sClasseTipoEvento
public function setClasseTipoEvento($sClasseTipoEvento) { $this->sClasseTipoEvento = $sClasseTipoEvento; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tipoSituacaoEvento($tipo){\n\t\t\t\tswitch($tipo){\n\t\t\t\t\t\n\t\t\t\tcase '1':\n\t\t\t\t\t$tipo\t= 'Solicitada';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '2':\n\t\t\t\t\t$tipo\t= 'Autorizada';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '3':\n\t\t\t\t\t$tipo\t= 'Em Andamento';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '4':\n\t\t\t\t\t$tipo\t= 'Concluida';\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\treturn $tipo;\n}", "public function setClasseEvento($sClasseEvento) {\n $this->sClasseEvento = $sClasseEvento;\n }", "function setEventType()\n {\n $this->_eventType = 12;\n }", "function getType ()\n\t\t{\n\t\t\treturn \"Event\";\n\t\t}", "private function creaEvento() {\n $fevento = USingleton::getInstance('FEvento');\n $dati = $this->dati;\n $classe = $this->classe;\n \n //----------------sezione di controllo delle operazioni-----------------\n \n if ($this->operazione == 'inserimento') {\n if ($this->tabella == 'evento') {\n $id = 1 + $fevento->loadultimoevento()[0];\n }\n if ($this->tabella == 'evento_spec') {\n $id = $dati['code'];\n }\n if ($this->tabella == 'partecipazione') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n if ($this->tabella == 'biglietti') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n }\n if ($this->operazione == 'cancellazione') {\n if ($this->tabella == 'evento') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n if ($this->tabella == 'evento_spec') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n if ($this->tabella == 'partecipazione') {\n $feventosp = USingleton::getInstance('FEventoSPecifico');\n $tipo = $feventosp->loadTipo($dati['code'])['tipo'];\n $classe = \"E\" . $tipo;\n $id = $dati['code'];\n }\n }\n//---------------------------------------------------------------------------------------------------------\n\n $zona = [new EZona($dati['zona'], $dati['capacita'])];\n $luogo = new ELuogo($dati['citta'], $dati['struttura'], $zona);\n $partecipazioni = [new EPartecipazione($zona[0], $dati['prezzo'])];\n\n if ($classe == 'EPartita') {\n $eventoSpecifico = [new EPartita($luogo, $dati['data'], $partecipazioni, $dati['casa'], $dati['ospite'])];\n }\n if ($classe == 'ESpettacolo') {\n $eventoSpecifico = [new ESpettacolo($luogo, $dati['data'], $partecipazioni, $dati['compagnia'])];\n }\n if ($classe == 'EConcerto') {\n $eventoSpecifico = [new EConcerto($luogo, $dati['data'], $partecipazioni, $dati['artista'])];\n }\n\n $evento = new EEvento($id, $dati['immagine'], $dati['nome_evento'], $eventoSpecifico);\n\n return $evento;\n }", "public function getType() {\n\t\treturn $this->eventType;\n\t}", "protected function getEventClass(): string\n {\n return UserContactsEvent::class;\n }", "function get_type_events()\n{\n return 'atu_events';\n}", "public function getType()\n {\n return $this->baseEvent->getType();\n }", "public function __construct(int $type)\n {\n $this->_eventType = $type;\n }", "public function getTypeEvt(): ?string {\n return $this->typeEvt;\n }", "public function type() {\n return $this->hasOne(EventType::class, 'id', 'events_types_id');\n }", "public function setTipo($sTipo) {\n $this->sTipo = $sTipo;\n }", "public function getTipo(){\n return $this->tipo;\n }", "public function getEventType() {\n $ret = '';\n switch($this->type) {\n case Event::TYPE_EVENT:\n $ret = 'Event';\n break;\n case Event::TYPE_FLAGSHIP:\n $ret = 'Flagship';\n break;\n case Event::TYPE_WORKSHOP:\n $ret = 'Workshop';\n break;\n case Event::TYPE_CELEBRITY_APPEARANCE:\n $ret = 'Celebrity Appearance';\n break;\n case Event::TYPE_GUEST_LECTURE:\n $ret = 'Guest Lecture';\n break;\n }\n\n return $ret;\n }", "public function getTipo() {\n return $this->sTipo;\n }", "public function getEventClass()\n {\n return $this->eventClass;\n }", "public function getTipo();", "public function getTipo(){\r\n\t\treturn $this->tipo;\r\n\t}", "public function getTipo(){\n\t\treturn $this->tipo;\n\t}", "public function getTipo(){\n\t\treturn $this->tipo;\n\t}", "public function getEventType(): string;", "public function eventType()\n {\n return $this->belongsTo('App\\EventType', \"event_type\", \"id\");\n }", "public function getFkFolhapagamentoTipoEventoPrevidencia()\n {\n return $this->fkFolhapagamentoTipoEventoPrevidencia;\n }", "public function _setTipo($Tipo)\n {\n $this->Tipo = $Tipo;\n\n }", "function ct_event() {\n\t\tglobal $Language;\n\n\t\t// C_EVENT_ID\n\t\t$this->C_EVENT_ID = new cField('t_event', 't_event', 'x_C_EVENT_ID', 'C_EVENT_ID', '`C_EVENT_ID`', 3, -1, FALSE, '`C_EVENT_ID`', FALSE);\n\t\t$this->C_EVENT_ID->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_EVENT_ID'] =& $this->C_EVENT_ID;\n\n\t\t// FK_CONGTY_ID\n\t\t$this->FK_CONGTY_ID = new cField('t_event', 't_event', 'x_FK_CONGTY_ID', 'FK_CONGTY_ID', '`FK_CONGTY_ID`', 3, -1, FALSE, '`FK_CONGTY_ID`', FALSE);\n\t\t$this->FK_CONGTY_ID->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['FK_CONGTY_ID'] =& $this->FK_CONGTY_ID;\n\n\t\t// C_EVENT_NAME\n\t\t$this->C_EVENT_NAME = new cField('t_event', 't_event', 'x_C_EVENT_NAME', 'C_EVENT_NAME', '`C_EVENT_NAME`', 201, -1, FALSE, '`C_EVENT_NAME`', FALSE);\n\t\t$this->fields['C_EVENT_NAME'] =& $this->C_EVENT_NAME;\n\n\t\t// C_TYPE_EVENT\n\t\t$this->C_TYPE_EVENT = new cField('t_event', 't_event', 'x_C_TYPE_EVENT', 'C_TYPE_EVENT', '`C_TYPE_EVENT`', 3, -1, FALSE, '`C_TYPE_EVENT`', FALSE);\n\t\t$this->C_TYPE_EVENT->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_TYPE_EVENT'] =& $this->C_TYPE_EVENT;\n\n\t\t// C_POST\n\t\t$this->C_POST = new cField('t_event', 't_event', 'x_C_POST', 'C_POST', '`C_POST`', 3, -1, FALSE, '`C_POST`', FALSE);\n\t\t$this->C_POST->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_POST'] =& $this->C_POST;\n\n\t\t// C_URL_IMAGES\n\t\t$this->C_URL_IMAGES = new cField('t_event', 't_event', 'x_C_URL_IMAGES', 'C_URL_IMAGES', '`C_URL_IMAGES`', 201, -1, FALSE, '`C_URL_IMAGES`', FALSE);\n\t\t$this->fields['C_URL_IMAGES'] =& $this->C_URL_IMAGES;\n\n\t\t// C_URL_LINK\n\t\t$this->C_URL_LINK = new cField('t_event', 't_event', 'x_C_URL_LINK', 'C_URL_LINK', '`C_URL_LINK`', 201, -1, FALSE, '`C_URL_LINK`', FALSE);\n\t\t$this->fields['C_URL_LINK'] =& $this->C_URL_LINK;\n\n\t\t// C_DATETIME_BEGIN\n\t\t$this->C_DATETIME_BEGIN = new cField('t_event', 't_event', 'x_C_DATETIME_BEGIN', 'C_DATETIME_BEGIN', '`C_DATETIME_BEGIN`', 135, 7, FALSE, '`C_DATETIME_BEGIN`', FALSE);\n\t\t$this->C_DATETIME_BEGIN->FldDefaultErrMsg = str_replace(\"%s\", \"/\", $Language->Phrase(\"IncorrectDateDMY\"));\n\t\t$this->fields['C_DATETIME_BEGIN'] =& $this->C_DATETIME_BEGIN;\n\n\t\t// C_DATETIME_END\n\t\t$this->C_DATETIME_END = new cField('t_event', 't_event', 'x_C_DATETIME_END', 'C_DATETIME_END', '`C_DATETIME_END`', 135, 7, FALSE, '`C_DATETIME_END`', FALSE);\n\t\t$this->C_DATETIME_END->FldDefaultErrMsg = str_replace(\"%s\", \"/\", $Language->Phrase(\"IncorrectDateDMY\"));\n\t\t$this->fields['C_DATETIME_END'] =& $this->C_DATETIME_END;\n\n\t\t// C_ODER\n\t\t$this->C_ODER = new cField('t_event', 't_event', 'x_C_ODER', 'C_ODER', '`C_ODER`', 135, 7, FALSE, '`C_ODER`', FALSE);\n\t\t$this->C_ODER->FldDefaultErrMsg = str_replace(\"%s\", \"/\", $Language->Phrase(\"IncorrectDateDMY\"));\n\t\t$this->fields['C_ODER'] =& $this->C_ODER;\n\n\t\t// C_NOTE\n\t\t$this->C_NOTE = new cField('t_event', 't_event', 'x_C_NOTE', 'C_NOTE', '`C_NOTE`', 201, -1, FALSE, '`C_NOTE`', FALSE);\n\t\t$this->fields['C_NOTE'] =& $this->C_NOTE;\n\n\t\t// C_USER_ADD\n\t\t$this->C_USER_ADD = new cField('t_event', 't_event', 'x_C_USER_ADD', 'C_USER_ADD', '`C_USER_ADD`', 3, -1, FALSE, '`C_USER_ADD`', FALSE);\n\t\t$this->C_USER_ADD->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_USER_ADD'] =& $this->C_USER_ADD;\n\n\t\t// C_ADD_TIME\n\t\t$this->C_ADD_TIME = new cField('t_event', 't_event', 'x_C_ADD_TIME', 'C_ADD_TIME', '`C_ADD_TIME`', 135, 7, FALSE, '`C_ADD_TIME`', FALSE);\n\t\t$this->C_ADD_TIME->FldDefaultErrMsg = str_replace(\"%s\", \"/\", $Language->Phrase(\"IncorrectDateDMY\"));\n\t\t$this->fields['C_ADD_TIME'] =& $this->C_ADD_TIME;\n\n\t\t// C_USER_EDIT\n\t\t$this->C_USER_EDIT = new cField('t_event', 't_event', 'x_C_USER_EDIT', 'C_USER_EDIT', '`C_USER_EDIT`', 3, -1, FALSE, '`C_USER_EDIT`', FALSE);\n\t\t$this->C_USER_EDIT->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_USER_EDIT'] =& $this->C_USER_EDIT;\n\n\t\t// C_EDIT_TIME\n\t\t$this->C_EDIT_TIME = new cField('t_event', 't_event', 'x_C_EDIT_TIME', 'C_EDIT_TIME', '`C_EDIT_TIME`', 135, 7, FALSE, '`C_EDIT_TIME`', FALSE);\n\t\t$this->C_EDIT_TIME->FldDefaultErrMsg = str_replace(\"%s\", \"/\", $Language->Phrase(\"IncorrectDateDMY\"));\n\t\t$this->fields['C_EDIT_TIME'] =& $this->C_EDIT_TIME;\n\n\t\t// C_ACTIVE_LEVELSITE\n\t\t$this->C_ACTIVE_LEVELSITE = new cField('t_event', 't_event', 'x_C_ACTIVE_LEVELSITE', 'C_ACTIVE_LEVELSITE', '`C_ACTIVE_LEVELSITE`', 3, -1, FALSE, '`C_ACTIVE_LEVELSITE`', FALSE);\n\t\t$this->C_ACTIVE_LEVELSITE->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_ACTIVE_LEVELSITE'] =& $this->C_ACTIVE_LEVELSITE;\n\n\t\t// C_TIME_ACTIVE\n\t\t$this->C_TIME_ACTIVE = new cField('t_event', 't_event', 'x_C_TIME_ACTIVE', 'C_TIME_ACTIVE', '`C_TIME_ACTIVE`', 135, 7, FALSE, '`C_TIME_ACTIVE`', FALSE);\n\t\t$this->C_TIME_ACTIVE->FldDefaultErrMsg = str_replace(\"%s\", \"/\", $Language->Phrase(\"IncorrectDateDMY\"));\n\t\t$this->fields['C_TIME_ACTIVE'] =& $this->C_TIME_ACTIVE;\n\n\t\t// C_SEND_MAIL\n\t\t$this->C_SEND_MAIL = new cField('t_event', 't_event', 'x_C_SEND_MAIL', 'C_SEND_MAIL', '`C_SEND_MAIL`', 3, -1, FALSE, '`C_SEND_MAIL`', FALSE);\n\t\t$this->C_SEND_MAIL->FldDefaultErrMsg = $Language->Phrase(\"IncorrectInteger\");\n\t\t$this->fields['C_SEND_MAIL'] =& $this->C_SEND_MAIL;\n\n\t\t// C_CONTENT_MAIL\n\t\t$this->C_CONTENT_MAIL = new cField('t_event', 't_event', 'x_C_CONTENT_MAIL', 'C_CONTENT_MAIL', '`C_CONTENT_MAIL`', 201, -1, FALSE, '`C_CONTENT_MAIL`', FALSE);\n\t\t$this->fields['C_CONTENT_MAIL'] =& $this->C_CONTENT_MAIL;\n\n\t\t// C_FK_BROWSE\n\t\t$this->C_FK_BROWSE = new cField('t_event', 't_event', 'x_C_FK_BROWSE', 'C_FK_BROWSE', '`C_FK_BROWSE`', 200, -1, FALSE, '`C_FK_BROWSE`', FALSE);\n\t\t$this->fields['C_FK_BROWSE'] =& $this->C_FK_BROWSE;\n\n\t\t// FK_ARRAY_TINBAI\n\t\t$this->FK_ARRAY_TINBAI = new cField('t_event', 't_event', 'x_FK_ARRAY_TINBAI', 'FK_ARRAY_TINBAI', '`FK_ARRAY_TINBAI`', 200, -1, FALSE, '`FK_ARRAY_TINBAI`', FALSE);\n\t\t$this->fields['FK_ARRAY_TINBAI'] =& $this->FK_ARRAY_TINBAI;\n\n\t\t// FK_ARRAY_CONGTY\n\t\t$this->FK_ARRAY_CONGTY = new cField('t_event', 't_event', 'x_FK_ARRAY_CONGTY', 'FK_ARRAY_CONGTY', '`FK_ARRAY_CONGTY`', 200, -1, FALSE, '`FK_ARRAY_CONGTY`', FALSE);\n\t\t$this->fields['FK_ARRAY_CONGTY'] =& $this->FK_ARRAY_CONGTY;\n\t}", "public function setCoTipo($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->co_tipo !== $v) {\n\t\t\t$this->co_tipo = $v;\n\t\t\t$this->modifiedColumns[] = C060InventarioPeer::CO_TIPO;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setTipo($tipo){\n\t\t$this->tipo = $tipo;\n\t}", "public function setTipo($tipo){\n\t\t$this->tipo = $tipo;\n\t}", "public function getCoTipo()\n\t{\n\t\treturn $this->co_tipo;\n\t}" ]
[ "0.67441595", "0.651159", "0.61537474", "0.6132499", "0.58983386", "0.5800676", "0.5773088", "0.5701931", "0.5608873", "0.55731773", "0.5571442", "0.55386865", "0.5532937", "0.5479326", "0.54744047", "0.543784", "0.54335034", "0.5401527", "0.5372703", "0.536505", "0.536505", "0.5326092", "0.5308148", "0.52835476", "0.5262047", "0.52606416", "0.5258214", "0.52486336", "0.52486336", "0.52306473" ]
0.7102245
0
Define o valor do atributo iPerspectiva
public function setPerspectiva($iPerspectiva) { $this->iPerspectiva = $iPerspectiva; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set($atributo, $valor) {\r\n\t\t\t $this->$atributo = $valor;\r\n\t\t}", "public function getValor($atributo){//retornar algún valor\n \treturn $this->$atributo;\n }", "public function __set($atributo, $valor) {\n\t\t\t// $this->modelo = $valor;\n\t\t\t$this->$atributo = $valor;\n\t\t}", "function get_aut_idautor(){return $this->aut_idautor;}", "public function __get($atributo){\n\t\treturn $this->$atributo;\n\t}", "function setId_asignatura($iid_asignatura = '')\n {\n $this->iid_asignatura = $iid_asignatura;\n }", "public function set( $atributo = '', $valor ) {\n $this->$atributo = $atributo;\n return $this;\n }", "public function __construct(){\n $this->idade = 10;\n }", "function asignar_valores2(){\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->apellido=$_POST['apellido'];\n\t\t$this->telefono=$_POST['telefono'];\n\t\t$this->email=$_POST['email'];\n\t\t\n\t\t$this->marca=$_POST['marca'];\n\t\t$this->modelo=$_POST['modelo'];\n\t\t$this->ano=$_POST['ano'];\n\t\t$this->tipo=$_POST['tipo'];\n\t\t$this->descripcion=$_POST['descripcion'];\n\t}", "function setIdadeFilho( $iIndiceFilho, $iIdade ) {\n $this->{\"iIdadeFilho$iIndiceFilho\"} = $iIdade;\n }", "function getDatosId_asignatura()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'id_asignatura'));\n $oDatosCampo->setEtiqueta(_(\"id_asignatura\"));\n return $oDatosCampo;\n }", "public function presupuestoModificado(){\n $this->iPresupuestoModificado = $this->iPresupuestoInicial;\n $this->save();\n }", "function asignar_valores(){\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->prioridad=$_POST['prioridad'];\n\t\t$this->etiqueta=$_POST['etiqueta'];\n\t\t$this->descripcion=$_POST['descripcion'];\n\t\t$this->claves=$_POST['claves'];\n\t\t$this->tipo=$_POST['tipo'];\n\t\t$this->icono=$_POST['icono'];\n\t}", "public function __get($atributo) {\n\t\t\treturn $this->$atributo;\n\t\t}", "function setId_asignatura($iid_asignatura)\n {\n $this->iid_asignatura = $iid_asignatura;\n }", "function getPerfil() {\n return $this->perfil;\n }", "function asignar_valores(){\n\t\t$this->tabla=$_POST['tabla'];\n\t\t$this->pertenece=$_POST['pertenece'];\n\t\t$this->asunto=$_POST['asunto'];\n\t\t$this->descripcion=$_POST['contenido'];\n\t\t$this->fecha=$_POST['fecha'];\n\t\t$this->hora=$_POST['hora'];\n\t\t$this->fechamod=$_POST['fechamod'];\n\t}", "public function getIdempresa(){\n return $this->idempresa;\n }", "function getId_asignatura()\n {\n if (!isset($this->iid_asignatura) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_asignatura;\n }", "public function attributes(){\n return [\n 'ofi_fk_parroquia' =>'Código de parroquia',\n 'ofi_tipo' =>'Tipo de oficina (local, almacen)',\n 'ofi_direccion' =>'Dirección de la empresa'\n\n ];\n }", "function asignar_valores3(){\n\t\t//$this->ciudad=$_SESSION['ciudad_admin'];\n\t\t\n\t\t$this->id=$_POST['id'];\n\t\t$this->temporada=$_POST['temporada'];\n\t\t$this->nombre=$_POST['nombre_plan'];\n\t\t$this->descripcion=$_POST['descripcion_plan'];\n\t\t$this->precio=$_POST['precio_plan'];\n\t\t$this->maxadultos=$_POST['maxadultos'];\n\t\t$this->prioridad=$_POST['prioridad'];\n\t\t$this->mostrar=$_POST['publica'];\n\t\t\n\t}", "public function __SET($att, $valor){\r\n $this->$att = $valor;\r\n}", "public function get_id_poblacion(){ \n return (isset($this->_id_poblacion)) ? $this->_id_poblacion: null;\n}", "function getDatosId_ubi()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'id_ubi'));\n $oDatosCampo->setEtiqueta(_(\"id_ubi\"));\n return $oDatosCampo;\n }", "function asignar_valores(){\n $this->nombre=$_POST['nombre'];\n $this->prioridad=$_POST['prioridad'];\n $this->etiqueta=$_POST['etiqueta'];\n $this->descripcion=$_POST['descripcion'];\n $this->claves=$_POST['claves'];\n $this->tipo=$_POST['tipo'];\n }", "protected function defineAttributes()\n {\n $this->dbAttributes = (object) [\n 'safe' => [\n 'fk_documento',\n 'fk_funcionario',\n 'accion',\n 'fecha',\n 'descripcion',\n 'titulo'\n ],\n 'date' => ['fecha']\n ];\n }", "public function getModificado()\n {\n return $this->modificado;\n }", "public function getModificado()\n {\n return $this->modificado;\n }", "public function setProyectorActivo( $proyector ) {\n $this->proyector_activo=$proyector;\n $proyecActual=new Properties();\n $proyecActual->load(file_get_contents(\"./pantallaActiva.properties\"));\n if(strcmp($proyector, \"\")==0)\n $this->proyector_activo=$proyecActual->getProperty(\"Proyector.activo\");\n $proyecActual->setProperty(\"Proyector.activo\",$this->proyector_activo);\n file_put_contents('./pantallaActiva.properties', $proyecActual->toString(true));\n }", "public function get_pa(){ return $this->_pa;}" ]
[ "0.60669816", "0.60374653", "0.59476876", "0.59019613", "0.5891092", "0.5755576", "0.57352513", "0.5704228", "0.56428355", "0.56421554", "0.5639783", "0.56375694", "0.56265837", "0.5603361", "0.56005186", "0.558429", "0.5567215", "0.5556501", "0.55125517", "0.5472966", "0.54667044", "0.5459697", "0.54510665", "0.54393756", "0.5429746", "0.5421385", "0.54092884", "0.54092884", "0.5396278", "0.5391657" ]
0.6433514
0
Define o valor do atributo bMostraPerspectivaDia
public function setMostraPerspectivaDia($bMostraPerspectivaDia) { $this->bMostraPerspectivaDia = $bMostraPerspectivaDia; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ManejoBD(){\n\t\t$this->BaseDatos = \"instituto\"; # aignar valor a la propiedad $BaseDatos\n\t\t$this->Servidor = \"localhost\"; # aignar valor a la propiedad $Servidor\n\t\t$this->Usuario = \"root\"; # aignar valor a la propiedad $Usuario\n\t\t$this->Clave = \"123456\"; # aignar valor a la propiedad $Clave\n\t}", "public function getFkPatrimonioBemBaixados()\n {\n return $this->fkPatrimonioBemBaixados;\n }", "function getDatosId_asignatura()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'id_asignatura'));\n $oDatosCampo->setEtiqueta(_(\"id_asignatura\"));\n return $oDatosCampo;\n }", "public function setValorDiaria($valorDiaria)\n {\n $this->valorDiaria = $valorDiaria;\n\n \n\n }", "function getDatosDesc_breve()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'desc_breve'));\n $oDatosCampo->setEtiqueta(_(\"desc_breve\"));\n return $oDatosCampo;\n }", "public function getDob(){\n //this fait réference à element de la classe\n return $this -> dob;\n }", "function getDatosBreve()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'breve'));\n $oDatosCampo->setEtiqueta(_(\"breve\"));\n return $oDatosCampo;\n }", "protected function mapeoValorProp(){\n\t $strPrecio='';\n\t if($this->propiedad->getPublicaprecio()==1){\n\t\t\tif(trim($this->propiedad->getOperacion())=='Venta'){\n\t\t\t\t$mon=$this->CAR_MONVTA;\n\t\t\t\t$val=$this->CAR_VALVTA;\n\t\t\t}else{\n\t\t\t\t$mon=$this->CAR_MONALQ;\n\t\t\t\t$val=$this->CAR_VALALQ;\n\t\t\t}\n\t\t\t$valor=\tintval($this->arrayCaracteristicas[$this->arrayClavesCarac[$val]]['contenido']);\n\t\t\t$moneda=$this->arrayCaracteristicas[$this->arrayClavesCarac[$mon]]['contenido'];\n\t\t\tif($valor!=0 && $valor!=''){\n\t\t\t\tif($moneda=='U$S'){\n\t\t\t\t\t$moneda='USD';\n\t\t\t\t}else{\n\t\t\t\t\t$moneda='ARS';\n\t\t\t\t}\n\t\t\t\t$strPrecio=\"<precio>\".$valor.\"</precio><tipoMoneda>\".$moneda.\"</tipoMoneda>\";\n\t\t\t}else{\n\t\t\t\t$strPrecio=\"<tipoMoneda></tipoMoneda>\";\n\t\t\t}\n\n\t }else{\n\t\t\t$strPrecio=\"<tipoMoneda></tipoMoneda>\";\n\t }\n\t return $strPrecio;\n\t}", "public function saveBaixaCompra($param) { \n $CB16PEDIDO = CB16PEDIDO::find()->where(\"CB16_ID = \".$param['pedido'].\" and CB16_STATUS >= 30\")->all()[0];\n if ($CB16PEDIDO) {\n $CB16PEDIDO->setAttribute('CB16_STATUS', 20);\n $CB16PEDIDO->save(); \n }\n }", "public function getValorDiaria()\n {\n return $this->valorDiaria;\n }", "public function GetCadastroNoticia(){\r\n return $this -> __cadastro; \r\n \r\n }", "public function getCodiceFiscale(){ return $this->codiceFiscale;}", "public function getidBateau(){\r\n return $this->_idBateau;\r\n }", "public function getFkPatrimonioBemMarcas()\n {\n return $this->fkPatrimonioBemMarcas;\n }", "function divorced() \n { \n $this->marsta_id=\"D\";\n $this->marsta_name=\"Divorced\";\n return($this->marsta_id);\n }", "function getDatosObserv()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'observ'));\n $oDatosCampo->setEtiqueta(_(\"observ\"));\n return $oDatosCampo;\n }", "protected function setVida() {\n $this->vida = 200;\n }", "function getDatosId_dl()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'id_dl'));\n $oDatosCampo->setEtiqueta(_(\"id_dl\"));\n $oDatosCampo->setTipo('texto');\n return $oDatosCampo;\n }", "function siguienteEstadoBoleta(){\r\n $this->procedimiento='leg.ft_boleta_garantia_dev_ime';\r\n $this->transaccion='LG_POBODEV_IME';\r\n $this->tipo_procedimiento='IME';\r\n \r\n //Define los parametros para la funcion\r\n $this->setParametro('id_proceso_wf','id_proceso_wf','int4'); \r\n\t\t$this->setParametro('id_estado_wf','id_estado_wf','int4');\r\n\t\t$this->setParametro('id_anexo','id_anexo','int4');\r\n\t\t\r\n\t\t\r\n\r\n //Ejecuta la instruccion\r\n $this->armarConsulta();\r\n $this->ejecutarConsulta();\r\n\r\n //Devuelve la respuesta\r\n return $this->respuesta;\r\n }", "public function __construct(){\n $this->idade = 10;\n }", "function modificarMetodologia(){\n\t\t$this->procedimiento='gem.f_metodologia_ime';\n\t\t$this->transaccion='GEM_GEMETO_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_metodologia','id_metodologia','int4');\n\t\t$this->setParametro('codigo','codigo','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function setMostraPerspectivaMes($bMostraPerspectivaMes) {\n $this->bMostraPerspectivaMes = $bMostraPerspectivaMes;\n }", "public function getValor_moeda()\n {\n return $this->valor_moeda;\n }", "function getDatosDl()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'dl'));\n $oDatosCampo->setEtiqueta(_(\"sigla\"));\n $oDatosCampo->setTipo('texto');\n return $oDatosCampo;\n }", "public function getFECHAMODIFICACION()\r\n {\r\n return $this->FECHA_MODIFICACION;\r\n }", "public function getValorDRAfecto()\n {\n return $this->valorDRAfecto;\n }", "function getDatosId_activ()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'id_activ'));\n $oDatosCampo->setEtiqueta(_(\"id_activ\"));\n return $oDatosCampo;\n }", "public function getIdempresa(){\n return $this->idempresa;\n }", "public function adicionarForma($idpedido,$forma,$tipo,$valor,$valorrecebido){\n //$conexao = $c->conexao();\n\n $valor=str_replace(\",\",\".\",$valor);\n // $valorrecebido=str_replace(\",\",\".\",$valorrecebido);\n\n \n // if (empty($valorrecebido)) {\n // $valorrecebido = '';\n // }\n\n // $troco = $valor - $valorrecebido;\n // $troco=str_replace(\",\",\".\",$troco);\n\n $troco = 0;\n\n if(($valor == \"0\") or ($forma == \"\")) {\n return 2; //Insira um Valor ou Forma de Pagamento em Branco!\n }else{\n\n if($forma == \"R$\" || $forma == \"CD\" || $forma == \"BL\"){\n\n $percentual = 5.0 / 100.0; // 5%\n $valor = $valor - ($percentual * $valor);\n\n $sql = \"INSERT INTO tbpedido_pagamento (idpedido, forma, valor, troco, tipo) VALUES ('$idpedido', '$forma', '$valor', '$troco', '$tipo') \";\n \n return $this->conexao->query($sql);\n \n }else{\n\n $sql = \"INSERT INTO tbpedido_pagamento (idpedido, forma, valor, troco, tipo) VALUES ('$idpedido', '$forma', '$valor', '0', '$tipo') \";\n\n return $this->conexao->query($sql);\n\n }\n\n }\n\n }", "public function getValor($atributo){//retornar algún valor\n \treturn $this->$atributo;\n }" ]
[ "0.5977456", "0.5839267", "0.5783526", "0.5770396", "0.5766731", "0.57587516", "0.5738189", "0.5714977", "0.5642583", "0.5617935", "0.558913", "0.555083", "0.5537985", "0.5498645", "0.5494823", "0.5482489", "0.54569024", "0.54463387", "0.54400206", "0.5416561", "0.5402484", "0.53968316", "0.5392165", "0.5391643", "0.5389507", "0.5387597", "0.5382928", "0.53762656", "0.5374354", "0.53737336" ]
0.62618864
0
Define o valor do atributo bMostraPerspectivaSemana
public function setMostraPerspectivaSemana($bMostraPerspectivaSemana) { $this->bMostraPerspectivaSemana = $bMostraPerspectivaSemana; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setMostraPerspectivaMes($bMostraPerspectivaMes) {\n $this->bMostraPerspectivaMes = $bMostraPerspectivaMes;\n }", "public function getFkBeneficioConcessaoValeTransporteSemanais()\n {\n return $this->fkBeneficioConcessaoValeTransporteSemanais;\n }", "public function getSemillero_id(){\n return $this->semillero_id;\n }", "public function reativar($sObservacao = null) {\n\n if (empty($this->iCodigoBem)) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.bem_nao_existe_base_de_dados'));\n }\n if (!db_utils::inTransaction()) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.sem_transacao'));\n }\n\n if (!$this->isBaixado()) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.bem_nao_esta_baixado'));\n }\n $oDaoBensBaixa = new cl_bensbaix();\n $oDaoBensBaixa->excluir($this->getCodigoBem());\n if ($oDaoBensBaixa->erro_status == 0) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.erro_reativar_bem', (object)array(\"erro_msg\" => $oDaoBensBaixa->erro_msg)));\n }\n\n $oDataAtual = new DBDate(date('Y-m-d', db_getsession(\"DB_datausu\")));\n $oInstit = new Instituicao(db_getsession(\"DB_instit\"));\n $lIntegracaoFinanceiro = ParametroIntegracaoPatrimonial::possuiIntegracaoPatrimonio($oDataAtual, $oInstit);\n\n $aNotas = $this->getNotasFiscais();\n\n $lRealizouLancamento = false;\n foreach ($aNotas as $oNota) {\n\n /**\n * realiza lancamentos contabens do bem\n * caso o desdobramento da nota do bem esteja no grupo 9 (bem permante)\n */\n if (!empty($oNota) && $this->verificaSituacaoNota() && $oNota->getValorLiquidado() == 0) {\n\n $oGrupo = GrupoContaOrcamento::getGrupoConta($oNota->getDesdobramento(), db_getsession(\"DB_anousu\"));\n if (!empty($oGrupo) && $oGrupo->getCodigo() == 9) {\n\n $sObs = \"Estorno do Lançamento em liquidação do tombamento do bem {$this->getCodigoBem()}.\";\n\n if ($lIntegracaoFinanceiro) {\n\n $nValor = $this->getValorAquisicao();\n if (count($aNotas) > 1) {\n $nValor = $this->getValorItemNota($oNota->getCodigoNota());\n }\n\n $oProcessarLancamento = new stdClass();\n $oProcessarLancamento->iCodigoDotacao = $oNota->getEmpenho()->getDotacao()->getCodigo();\n $oProcessarLancamento->iCodigoElemento = $oNota->getDesdobramento();\n $oProcessarLancamento->iCodigoNotaLiquidacao = $oNota->getCodigoNota();\n $oProcessarLancamento->iFavorecido = $oNota->getEmpenho()->getCgm()->getCodigo();\n $oProcessarLancamento->iNumeroEmpenho = $oNota->getEmpenho()->getNumero();\n $oProcessarLancamento->sObservacaoHistorico = $sObs;\n $oProcessarLancamento->nValorTotal = $nValor;\n $oProcessarLancamento->oClassificacao = $this->getClassificacao();\n $oProcessarLancamento->oGrupo = $oGrupo;\n\n LancamentoEmpenhoEmLiquidacao::processar($oProcessarLancamento);\n $lRealizouLancamento = true;\n }\n }\n }\n }\n\n if (USE_PCASP && !$lRealizouLancamento && $lIntegracaoFinanceiro ) {\n\n /**\n * Realiza acerto nas contas de depreciação e classificação, caso seja necessário\n */\n $oBemAcertoContaClassificacao = new BemAcertoContaClassificacao();\n $oDBData = new DBDate( date(\"d/m/Y\", db_getsession(\"DB_datausu\")) );\n\n $oBemDepreciacao = BemDepreciacao::getInstance($this);\n $nValorAtual = $this->nValorAquisicao;\n\n if (!empty($oBemDepreciacao)) {\n $nValorAtual = $oBemDepreciacao->getValorAtual();\n }\n\n if ($nValorAtual != 0) {\n $oLancamentoauxiliarBem = new LancamentoAuxiliarBem();\n $oLancamentoauxiliarBem->setValorTotal($nValorAtual);\n $oLancamentoauxiliarBem->setBem($this);\n $oLancamentoauxiliarBem->setObservacaoHistorico($sObservacao);\n $oLancamentoauxiliarBem->setEstorno(true);\n $oEventoContabil = new EventoContabil(702, db_getsession('DB_anousu'));\n $aLancamentos = $oEventoContabil->getEventoContabilLancamento();\n $oLancamentoauxiliarBem->setHistorico($aLancamentos[0]->getHistorico());\n $oEventoContabil->executaLancamento($oLancamentoauxiliarBem);\n }\n }\n }", "public function saveBaixaCompra($param) { \n $CB16PEDIDO = CB16PEDIDO::find()->where(\"CB16_ID = \".$param['pedido'].\" and CB16_STATUS >= 30\")->all()[0];\n if ($CB16PEDIDO) {\n $CB16PEDIDO->setAttribute('CB16_STATUS', 20);\n $CB16PEDIDO->save(); \n }\n }", "function evt__procesar(){\n $m = $this->dep('datos')->tabla('mesa')->get();\n $p = array_search('junta_electoral', $this->s__perfil);\n if($p !== false){//Ingreso con perfil junta_electoral\n $m['estado'] = 3;//Cambia el estado de la mesa a Confirmado\n }\n else{\n $p = array_search('secretaria', $this->s__perfil);\n if($p !== false){//Ingreso con perfil secretaria\n $m['estado'] = 4;//Cambia el estado de la mesa a Definitivo\n }\n else{\n $p = array_search('autoridad_mesa', $this->s__perfil); \n if($p !== false){//Ingreso con perfil autoridad de mesa\n $m['estado'] = 1;//Cambia el estado de la mesa a Cargado\n }\n }\n }\n $this->dep('datos')->tabla('mesa')->set($m);\n// print_r($m['id_mesa']);\n $this->dep('datos')->tabla('mesa')->sincronizar();\n $this->dep('datos')->tabla('mesa')->resetear();\n \n \n if(isset($this->s__retorno)){//debe retornar a confirmar\n if($this->s__retorno_estado=='')\n $dato = true;\n else\n $dato['f'] = $this->s__retorno_estado;\n toba::vinculador()->navegar_a(\"\",$this->s__retorno,$dato); \n $this->s__retorno = null; \n $this->s__id_mesa = null;\n $this->s__retorno_estado = null;\n }\n }", "function getSemanadoAno()\r\n {\r\n return Data_Calc::semanaDoAno($this->dia, $this->mes, $this->ano);\r\n }", "function modificarMaquinaria(){\n\t\t$this->procedimiento='snx.ft_maquinaria_ime';\n\t\t$this->transaccion='SNX_MAQ_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_maquinaria','id_maquinaria','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('potencia','potencia','numeric');\n\t\t$this->setParametro('peso','peso','numeric');\n\t\t$this->setParametro('maquinaria','maquinaria','varchar');\n\t\t$this->setParametro('id_factorindexacion','id_factorindexacion','int4');\n\t\t$this->setParametro('id_tipopreciomaquinaria','id_tipopreciomaquinaria','int4');\n\t\t$this->setParametro('id_ambitoprecio','id_ambitoprecio','int4');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function siguienteEstadoBoleta(){\r\n $this->procedimiento='leg.ft_boleta_garantia_dev_ime';\r\n $this->transaccion='LG_POBODEV_IME';\r\n $this->tipo_procedimiento='IME';\r\n \r\n //Define los parametros para la funcion\r\n $this->setParametro('id_proceso_wf','id_proceso_wf','int4'); \r\n\t\t$this->setParametro('id_estado_wf','id_estado_wf','int4');\r\n\t\t$this->setParametro('id_anexo','id_anexo','int4');\r\n\t\t\r\n\t\t\r\n\r\n //Ejecuta la instruccion\r\n $this->armarConsulta();\r\n $this->ejecutarConsulta();\r\n\r\n //Devuelve la respuesta\r\n return $this->respuesta;\r\n }", "static public function mdlAsignarMiembro($datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"UPDATE miembros SET id_membresia = :id_membresia WHERE id_miembro = :id_miembro\");\n\n\t\t$stmt->bindParam(\":id_membresia\", $datos[\"id_membresia\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_miembro\", $datos[\"id_miembro\"], PDO::PARAM_STR);\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n }", "function getSemaforo() {\n\t\tglobal $usr;\n\n\t\tif ($this->extra[\"imprimir\"]) {\n\t\t\t$this->resultado = $this->__getSemaforoNormal();\n\t\t}\n\t\telseif ($usr->orientacion_semaforo == 0) {\n\t\t\t$this->resultado = $this->__getSemaforoNormal();\n\t\t}\n\t\telse {\n\t\t\t$this->resultado = $this->__getSemaforoInvertido();\n\t\t}\n\t}", "function synchronizeCuentaBancaria(){\n $this->procedimiento='sigep.ft_cuenta_bancaria_ime';\n $this->transaccion='SIGEP_CUEN_BAN_SYNC';\n $this->tipo_procedimiento='IME';\n\n /************************************************ token ************************************************/\n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://sigep.sigma.gob.bo/rsseguridad/apiseg/token?grant_type=refresh_token&client_id=0&redirect_uri=%2Fmodulo%2Fapiseg%2Fredirect&client_secret=0&refresh_token=FEA520426600:Wk5yBGCh5TeT8jUG5lPkwIT25Jmlwav5XqtxhCrmgr5Yc0iaAMPZgLILZZPC7mjxk5tUgVusBs0RXlSDkIuWq2qNat2KsUM3E4q7\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_HTTPHEADER => array(\n \"cache-control: no-cache\",\n \"content-type: application/x-www-form-urlencoded\"\n ),\n ));\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n $token_response = json_decode($response);\n $access_token = $token_response->{'access_token'};\n /************************************************ token ************************************************/\n\n /************************************************ perfil ************************************************/\n //$jsonConverter = new StandardConverter();\n $param_p = array(\"gestion\" => \"2022\", \"perfil\" => \"915\");\n //$param_p = $jsonConverter->encode($param_p);\n $param_p = json_encode($param_p);\n $curl_p = curl_init();\n\n $curl_array_p = array(\n CURLOPT_URL => 'https://sigep.sigma.gob.bo/rsbeneficiarios/api/cambiaperfil',\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => 'PUT',\n CURLOPT_HTTPHEADER => array(\n \"Authorization: bearer \" . $access_token,\n \"Cache-Control: no-cache\",\n \"Content-Type: application/json\"\n ),\n CURLOPT_POSTFIELDS => $param_p\n );\n\n curl_setopt_array($curl_p,$curl_array_p);\n $response_p = curl_exec($curl_p);\n $err_p = curl_error($curl_p);\n $http_code_p = curl_getinfo( $curl_p, CURLINFO_HTTP_CODE );\n curl_close($curl_p);\n /************************************************ perfil ************************************************/\n\n /************************************************ cuentas ************************************************/\n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://sigep.sigma.gob.bo/rsclasificadores/api/v1/cuentasbancarias/cuentabancaria?idEntidad=494&fechaConsulta=04-07-2022\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => array(\n \"Authorization: bearer \" . $access_token,\n \"Cache-Control: no-cache\",\n \"Postman-Token: 011d15eb-f4ff-48db-85a6-1b380958342b\"\n ),\n ));\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n //var_dump('$response',/*curl_getinfo($curl),*/ json_decode($response)->data);exit;\n /************************************************ cuentas ************************************************/\n //$this->objParam->addParametro('jsonData', json_decode($response)->data);\n $this->arreglo['jsonData'] = json_encode(json_decode($response)->data);\n //Define los parametros para la funcion\n $this->setParametro('jsonData','jsonData','jsonb');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n //echo ($this->consulta);exit;\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "function setChangeCodigo($numero_nuevo){\n\t\t\t$numero_socio \t= $this->mCodigo ;\n\t\t\t\n\t\t\t$xQL\t\t\t= new MQL();\n\t\t\t$msg = \"\";\n\t\t\t$msg .= \"================== MODIFICANDO UN NUMERO DE SOCIO \\r\\n\";\n\t\t\t$msg .= \"================== SE ACTUALIZA DEL $numero_socio AL $numero_nuevo \\r\\n\";\n\n\t\t\t$var[\"aml_alerts\"]\t\t\t\t\t= \"persona_de_destino\";\n\t\t\t$var[\"aml_risk_register\"]\t\t\t= \"persona_relacionada\";\n\t\t\t$var[\"bancos_operaciones\"]\t\t\t= \"numero_de_socio\";\n\t\t\t$var[\"captacion_cuentas\"]\t\t\t= \"numero_socio\";\n\t\t\t$var[\"captacion_sdpm_historico\"]\t= \"numero_de_socio\";\n\t\t\t$var[\"contable_polizas_proforma\"]\t= \"socio\";\n\t\t\t$var[\"creditos_flujoefvo\"]\t\t\t= \"socio_flujo\";\n\t\t\t$var[\"creditos_garantias\"]\t\t\t= \"socio_garantia\";\n\t\t\t$var[\"creditos_lineas\"]\t\t\t\t= \"numero_socio\";\n\t\t\t$var[\"creditos_parametros_negociados\"]\t= \"numero_de_socio\";\n\t\t\t$var[\"creditos_sdpm_historico\"]\t\t= \"numero_de_socio\";\n\t\t\t$var[\"creditos_solicitud\"]\t\t\t= \"numero_socio\";\n\t\t\t\n\t\t\t$var[\"general_sucursales\"]\t\t\t= \"clave_de_persona\";\n\t\t\t$var[\"operaciones_mvtos\"]\t\t\t= \"socio_afectado\";\n\t\t\t$var[\"operaciones_recibos\"]\t\t\t= \"numero_socio\";\n\t\t\t\n\t\t\t$var[\"personas_documentacion\"]\t\t= \"clave_de_persona\";\n\t\t\t$var[\"personas_perfil_transaccional\"]\t= \"clave_de_persona\";\n\t\t\t$var[\"seguimiento_compromisos\"]\t\t= \"socio_comprometido\";\n\t\t\t$var[\"seguimiento_llamadas\"]\t\t= \"numero_socio\";\n\t\t\t$var[\"seguimiento_notificaciones\"]\t= \"socio_notificado\";\n\t\t\t$var[\"socios_aeconomica\"]\t\t\t= \"socio_aeconomica\";\n\t\t\t$var[\"socios_aeconomica_dependencias\"]\t= \"clave_de_persona\";\n\t\t\t$var[\"socios_aportaciones\"]\t\t\t= \"numero_socio\";\n\t\t\t$var[\"socios_baja\"]\t\t\t\t\t= \"numero_de_socio\";\n\t\t\t$var[\"socios_cajalocal\"]\t\t\t= \"ultimosocio\";\n\t\t\t$var[\"socios_firmas\"]\t\t\t\t= \"numero_de_socio\";\n\t\t\t$var[\"socios_general\"]\t\t\t\t= \"codigo\";\n\n\t\t\t$var[\"socios_grupossolidarios\"]\t\t= \"clave_de_persona\";\n\t\t\t$var[\"socios_memo\"]\t\t\t\t\t= \"numero_socio\";\n\t\t\t$var[\"socios_otros_parametros\"]\t\t= \"clave_de_persona\";\n\t\t\t$var[\"socios_patrimonio\"]\t\t\t= \"socio_patrimonio\";\n\t\t\t$var[\"socios_relaciones\"]\t\t\t= \"socio_relacionado\";\n\t\t\t\n\t\t\t$var[\"socios_scoring_simple\"]\t\t= \"numero_socio\";\n\t\t\t$var[\"socios_vivienda\"]\t\t\t\t= \"socio_numero\";\n\t\t\t$var[\"t_03f996214fba4a1d05a68b18fece8e71\"]\t= \"codigo_de_persona\";\n\t\t\t$var[\"tesoreria_cajas_movimientos\"]\t= \"persona\";\n\t\t\t$var[\"usuarios\"]\t\t\t\t\t= \"codigo_de_persona\";\n\t\t\t$var[\"usuarios_web_notas\"]\t\t\t= \"socio\";\n\t\t\tforeach ($var as $tabla => $campo){\n\t\t\t\t$msg\t.= \"WARN\\tCambiar Registros de la Tabla $tabla, Campo $campo de $numero_socio a $numero_nuevo\\r\\n\";\n\t\t\t\t$xQL->setRawQuery(\"UPDATE $tabla SET $campo = $numero_nuevo WHERE $campo = $numero_socio\");\n\t\t\t}\n\t\t\t$var2[\"aml_alerts\"]\t\t\t\t\t= \"persona_de_origen\";\n\t\t\t$var2[\"creditos_solicitud\"]\t\t\t= \"persona_asociada\";\n\t\t\t$var2[\"operaciones_recibos\"]\t\t\t= \"persona_asociada\";\n\t\t\t$var2[\"socios_relaciones\"]\t\t\t= \"numero_socio\";\n\t\t\t$var2[\"socios_grupossolidarios\"]\t\t= \"representante_numerosocio\";\n\t\t\t//$var2[\"socios_grupossolidarios\"]\t\t= \"vocalvigilancia_numerosocio\";\t\t\t\n\t\t\tforeach ($var2 as $tabla => $campo){\n\t\t\t\t$msg\t.= \"WARN\\tCambiar Registros de la Tabla $tabla, Campo $campo de $numero_socio a $numero_nuevo\\r\\n\";\n\t\t\t\t$xQL->setRawQuery(\"UPDATE $tabla SET $campo = $numero_nuevo WHERE $campo = $numero_socio\");\n\t\t\t}\n\t\treturn $msg;\n\t}", "protected function mapeoValorProp(){\n\t $strPrecio='';\n\t if($this->propiedad->getPublicaprecio()==1){\n\t\t\tif(trim($this->propiedad->getOperacion())=='Venta'){\n\t\t\t\t$mon=$this->CAR_MONVTA;\n\t\t\t\t$val=$this->CAR_VALVTA;\n\t\t\t}else{\n\t\t\t\t$mon=$this->CAR_MONALQ;\n\t\t\t\t$val=$this->CAR_VALALQ;\n\t\t\t}\n\t\t\t$valor=\tintval($this->arrayCaracteristicas[$this->arrayClavesCarac[$val]]['contenido']);\n\t\t\t$moneda=$this->arrayCaracteristicas[$this->arrayClavesCarac[$mon]]['contenido'];\n\t\t\tif($valor!=0 && $valor!=''){\n\t\t\t\tif($moneda=='U$S'){\n\t\t\t\t\t$moneda='USD';\n\t\t\t\t}else{\n\t\t\t\t\t$moneda='ARS';\n\t\t\t\t}\n\t\t\t\t$strPrecio=\"<precio>\".$valor.\"</precio><tipoMoneda>\".$moneda.\"</tipoMoneda>\";\n\t\t\t}else{\n\t\t\t\t$strPrecio=\"<tipoMoneda></tipoMoneda>\";\n\t\t\t}\n\n\t }else{\n\t\t\t$strPrecio=\"<tipoMoneda></tipoMoneda>\";\n\t }\n\t return $strPrecio;\n\t}", "function inicializa(){\n $this->sem=array('Sun'=>1,'Mon'=>2,'Tue'=>3,'Wed'=>4,'Thu'=>5,'Fri'=>6,'Sat'=>7);\n $this->mes=array('1'=>'JANEIRO','2'=>'FEVEREIRO','3'=>'MARÇO','4'=>'ABRIL','5'=>'MAIO','6'=>'JUNHO','7'=>'JULHO','8'=>'AGOSTO','9'=>'SETEMBRO','10'=>'OUTUBRO','11'=>'NOVEMBRO','12'=>'DEZEMBRO');\n }", "public function valordelospasajesplus();", "public function testSetSalaireMensuel() {\n\n $obj = new Collaborateurs();\n\n $obj->setSalaireMensuel(10.092018);\n $this->assertEquals(10.092018, $obj->getSalaireMensuel());\n }", "public function setASediaPembalut($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (string) $v;\n }\n\n if ($this->a_sedia_pembalut !== $v) {\n $this->a_sedia_pembalut = $v;\n $this->modifiedColumns[] = SanitasiPeer::A_SEDIA_PEMBALUT;\n }\n\n\n return $this;\n }", "function __set($modelo, $valor)\n\t{\n\t\t$this->modelo = $modelo;\n\t}", "public function getMarca(){ return $this->marca;}", "public function setMostraPerspectivaDia($bMostraPerspectivaDia) {\n $this->bMostraPerspectivaDia = $bMostraPerspectivaDia;\n }", "public function setMataPelajaran($mata_pelajaran);", "public function actionVencimiento_codmon_remito()\n {\n\n $codmon = $_POST['codmon'];\n $deposito = $_POST['deposito'];\n $remito = $_POST['remito'];\n\n $query = Consumo_medicamentos_granel_renglones::find()->where(['PF_CODMON' => $codmon,\n 'PF_DEPOSITO' => $deposito,\n 'PF_NROREM' => $remito]);\n\n $vencimiento = $query->one(); \n\n \n\n if ($vencimiento){\n $fecha_vto= Yii::$app->formatter->asDate($vencimiento->PF_FECVTO,'php:d-m-Y');\n $vencimiento_result['fecha'] = $fecha_vto;\n \n }\n else{\n $fecha_vto='';\n $vencimiento_result['fecha'] = '';\n }\n\n \n\n return \\yii\\helpers\\Json::encode($vencimiento_result);\n \n }", "public function setEmprestimos_Bancarios($object){\n\t\tif(substr($object->getrelacao_cr_db()->getCr(), 0, -3) == '2.1.2') {\n\t\t\t$this->Emprestimos_Bancarios += $object->getvalor();\n\t\t}\n\t\t\n\t\t// Debita do emprestimo (Efetua o pagamento total ou parcial do emprestimo).\n\t\tif(substr($object->getrelacao_cr_db()->getDb(), 0, -3) == '2.1.2') {\n\t\t\t$this->Emprestimos_Bancarios -= $object->getvalor();\n\t\t}\n\t}", "public function getValor_moeda()\n {\n return $this->valor_moeda;\n }", "public function getPembuanganAirLimbah()\n {\n return $this->pembuangan_air_limbah;\n }", "public function getFkPatrimonioBemBaixados()\n {\n return $this->fkPatrimonioBemBaixados;\n }", "public function setMostraNumerosSemana($bMostraNumerosSemana) {\n $this->bMostraNumerosSemana = $bMostraNumerosSemana;\n }", "function modificarSolicitudMayor500000(){\n\t\t$this->procedimiento='mat.ft_solicitud_mayor_500000_ime';\n\t\t$this->transaccion='MAT_SMI_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_sol','id_sol','int4');\n\t\t$this->setParametro('nro_po','nro_po','varchar');\n\t\t$this->setParametro('fecha_solicitud','fecha_solicitud','date');\n\t\t$this->setParametro('funcionario','funcionario','text');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('fecha_po','fecha_po','date');\n\t\t$this->setParametro('monto_dolares','monto_dolares','numeric');\n\t\t$this->setParametro('nro_tramite','nro_tramite','varchar');\n\t\t$this->setParametro('proveedor','proveedor','varchar');\n\t\t$this->setParametro('monto_bolivianos','monto_bolivianos','numeric');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function setObservacao($sObservacao){\n $this->sObservacao = $sObservacao;\n }" ]
[ "0.60086685", "0.5656344", "0.560908", "0.5577257", "0.5495303", "0.5362833", "0.53519934", "0.53329355", "0.5330021", "0.53200805", "0.5291869", "0.52786833", "0.5254742", "0.5229401", "0.52218056", "0.5200555", "0.51791525", "0.5141423", "0.51278204", "0.51144195", "0.5108376", "0.51065576", "0.50874305", "0.5072577", "0.50537384", "0.5047915", "0.5036288", "0.50283504", "0.50178176", "0.5001868" ]
0.60800785
0
Define o valor do atributo bMostraPerspectivaMes
public function setMostraPerspectivaMes($bMostraPerspectivaMes) { $this->bMostraPerspectivaMes = $bMostraPerspectivaMes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setMes($iMes) {\n $this->iMes = $iMes;\n }", "public function setMostraCabecalhoMes($bMostraCabecalhoMes) {\n $this->bMostraCabecalhoMes = $bMostraCabecalhoMes;\n }", "public function getMes() {\n return $this->iMes;\n }", "function FicheMemo()\n{\n\t$this->type_moi = \"fiche_memo\";\n}", "static public function mdlAsignarMiembro($datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"UPDATE miembros SET id_membresia = :id_membresia WHERE id_miembro = :id_miembro\");\n\n\t\t$stmt->bindParam(\":id_membresia\", $datos[\"id_membresia\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_miembro\", $datos[\"id_miembro\"], PDO::PARAM_STR);\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n }", "public function saveBaixaCompra($param) { \n $CB16PEDIDO = CB16PEDIDO::find()->where(\"CB16_ID = \".$param['pedido'].\" and CB16_STATUS >= 30\")->all()[0];\n if ($CB16PEDIDO) {\n $CB16PEDIDO->setAttribute('CB16_STATUS', 20);\n $CB16PEDIDO->save(); \n }\n }", "public function getDiaMesAno()\n {\n return $this->diaMesAno;\n }", "function evt__procesar(){\n $m = $this->dep('datos')->tabla('mesa')->get();\n $p = array_search('junta_electoral', $this->s__perfil);\n if($p !== false){//Ingreso con perfil junta_electoral\n $m['estado'] = 3;//Cambia el estado de la mesa a Confirmado\n }\n else{\n $p = array_search('secretaria', $this->s__perfil);\n if($p !== false){//Ingreso con perfil secretaria\n $m['estado'] = 4;//Cambia el estado de la mesa a Definitivo\n }\n else{\n $p = array_search('autoridad_mesa', $this->s__perfil); \n if($p !== false){//Ingreso con perfil autoridad de mesa\n $m['estado'] = 1;//Cambia el estado de la mesa a Cargado\n }\n }\n }\n $this->dep('datos')->tabla('mesa')->set($m);\n// print_r($m['id_mesa']);\n $this->dep('datos')->tabla('mesa')->sincronizar();\n $this->dep('datos')->tabla('mesa')->resetear();\n \n \n if(isset($this->s__retorno)){//debe retornar a confirmar\n if($this->s__retorno_estado=='')\n $dato = true;\n else\n $dato['f'] = $this->s__retorno_estado;\n toba::vinculador()->navegar_a(\"\",$this->s__retorno,$dato); \n $this->s__retorno = null; \n $this->s__id_mesa = null;\n $this->s__retorno_estado = null;\n }\n }", "function modificarMetodologia(){\n\t\t$this->procedimiento='gem.f_metodologia_ime';\n\t\t$this->transaccion='GEM_GEMETO_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_metodologia','id_metodologia','int4');\n\t\t$this->setParametro('codigo','codigo','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function reativar($sObservacao = null) {\n\n if (empty($this->iCodigoBem)) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.bem_nao_existe_base_de_dados'));\n }\n if (!db_utils::inTransaction()) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.sem_transacao'));\n }\n\n if (!$this->isBaixado()) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.bem_nao_esta_baixado'));\n }\n $oDaoBensBaixa = new cl_bensbaix();\n $oDaoBensBaixa->excluir($this->getCodigoBem());\n if ($oDaoBensBaixa->erro_status == 0) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.erro_reativar_bem', (object)array(\"erro_msg\" => $oDaoBensBaixa->erro_msg)));\n }\n\n $oDataAtual = new DBDate(date('Y-m-d', db_getsession(\"DB_datausu\")));\n $oInstit = new Instituicao(db_getsession(\"DB_instit\"));\n $lIntegracaoFinanceiro = ParametroIntegracaoPatrimonial::possuiIntegracaoPatrimonio($oDataAtual, $oInstit);\n\n $aNotas = $this->getNotasFiscais();\n\n $lRealizouLancamento = false;\n foreach ($aNotas as $oNota) {\n\n /**\n * realiza lancamentos contabens do bem\n * caso o desdobramento da nota do bem esteja no grupo 9 (bem permante)\n */\n if (!empty($oNota) && $this->verificaSituacaoNota() && $oNota->getValorLiquidado() == 0) {\n\n $oGrupo = GrupoContaOrcamento::getGrupoConta($oNota->getDesdobramento(), db_getsession(\"DB_anousu\"));\n if (!empty($oGrupo) && $oGrupo->getCodigo() == 9) {\n\n $sObs = \"Estorno do Lançamento em liquidação do tombamento do bem {$this->getCodigoBem()}.\";\n\n if ($lIntegracaoFinanceiro) {\n\n $nValor = $this->getValorAquisicao();\n if (count($aNotas) > 1) {\n $nValor = $this->getValorItemNota($oNota->getCodigoNota());\n }\n\n $oProcessarLancamento = new stdClass();\n $oProcessarLancamento->iCodigoDotacao = $oNota->getEmpenho()->getDotacao()->getCodigo();\n $oProcessarLancamento->iCodigoElemento = $oNota->getDesdobramento();\n $oProcessarLancamento->iCodigoNotaLiquidacao = $oNota->getCodigoNota();\n $oProcessarLancamento->iFavorecido = $oNota->getEmpenho()->getCgm()->getCodigo();\n $oProcessarLancamento->iNumeroEmpenho = $oNota->getEmpenho()->getNumero();\n $oProcessarLancamento->sObservacaoHistorico = $sObs;\n $oProcessarLancamento->nValorTotal = $nValor;\n $oProcessarLancamento->oClassificacao = $this->getClassificacao();\n $oProcessarLancamento->oGrupo = $oGrupo;\n\n LancamentoEmpenhoEmLiquidacao::processar($oProcessarLancamento);\n $lRealizouLancamento = true;\n }\n }\n }\n }\n\n if (USE_PCASP && !$lRealizouLancamento && $lIntegracaoFinanceiro ) {\n\n /**\n * Realiza acerto nas contas de depreciação e classificação, caso seja necessário\n */\n $oBemAcertoContaClassificacao = new BemAcertoContaClassificacao();\n $oDBData = new DBDate( date(\"d/m/Y\", db_getsession(\"DB_datausu\")) );\n\n $oBemDepreciacao = BemDepreciacao::getInstance($this);\n $nValorAtual = $this->nValorAquisicao;\n\n if (!empty($oBemDepreciacao)) {\n $nValorAtual = $oBemDepreciacao->getValorAtual();\n }\n\n if ($nValorAtual != 0) {\n $oLancamentoauxiliarBem = new LancamentoAuxiliarBem();\n $oLancamentoauxiliarBem->setValorTotal($nValorAtual);\n $oLancamentoauxiliarBem->setBem($this);\n $oLancamentoauxiliarBem->setObservacaoHistorico($sObservacao);\n $oLancamentoauxiliarBem->setEstorno(true);\n $oEventoContabil = new EventoContabil(702, db_getsession('DB_anousu'));\n $aLancamentos = $oEventoContabil->getEventoContabilLancamento();\n $oLancamentoauxiliarBem->setHistorico($aLancamentos[0]->getHistorico());\n $oEventoContabil->executaLancamento($oLancamentoauxiliarBem);\n }\n }\n }", "function modificarMaquinaria(){\n\t\t$this->procedimiento='snx.ft_maquinaria_ime';\n\t\t$this->transaccion='SNX_MAQ_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_maquinaria','id_maquinaria','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('potencia','potencia','numeric');\n\t\t$this->setParametro('peso','peso','numeric');\n\t\t$this->setParametro('maquinaria','maquinaria','varchar');\n\t\t$this->setParametro('id_factorindexacion','id_factorindexacion','int4');\n\t\t$this->setParametro('id_tipopreciomaquinaria','id_tipopreciomaquinaria','int4');\n\t\t$this->setParametro('id_ambitoprecio','id_ambitoprecio','int4');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function ActualizarMesas()\n\t{\n\n\t\tself::SetNames();\n\t\tif(empty($_POST[\"codmesa\"]) or empty($_POST[\"codsala\"]) or empty($_POST[\"nombremesa\"]))\n\t\t{\n\t\t\techo \"1\";\n\t\t\texit;\n\t\t}\n\t\t$sql = \" select codsala, nombremesa from mesas where codmesa != ? and codsala = ? and nombremesa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_POST[\"codmesa\"], $_POST[\"codsala\"], $_POST[\"nombremesa\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n\t\t\t$sql = \" update mesas set \"\n\t\t\t.\" codsala = ?, \"\n\t\t\t.\" nombremesa = ?, \"\n\t\t\t.\" statusmesa = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codmesa = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $codsala);\n\t\t\t$stmt->bindParam(2, $nombremesa);\n\t\t $stmt->bindParam(3, $statusmesa);\n\t\t\t$stmt->bindParam(4, $codmesa);\n\n\t\t\t$codmesa = strip_tags($_POST[\"codmesa\"]);\n\t\t\t$codsala = strip_tags($_POST[\"codsala\"]);\n\t\t\t$nombremesa = strip_tags($_POST[\"nombremesa\"]);\n\t\t\t$statusmesa = strip_tags($_POST[\"statusmesa\"]);\n\t\t\t$stmt->execute();\n\n\t\techo \"<div class='alert alert-info'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<span class='fa fa-check-square-o'></span> LA MESA EN SALA DEL RESTAURANT FUE ACTUALIZADA EXITOSAMENTE\";\n\t\techo \"</div>\";\t\t\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"2\";\n\t\t\texit;\n\t\t}\n\t}", "protected function mapeoValorProp(){\n\t $strPrecio='';\n\t if($this->propiedad->getPublicaprecio()==1){\n\t\t\tif(trim($this->propiedad->getOperacion())=='Venta'){\n\t\t\t\t$mon=$this->CAR_MONVTA;\n\t\t\t\t$val=$this->CAR_VALVTA;\n\t\t\t}else{\n\t\t\t\t$mon=$this->CAR_MONALQ;\n\t\t\t\t$val=$this->CAR_VALALQ;\n\t\t\t}\n\t\t\t$valor=\tintval($this->arrayCaracteristicas[$this->arrayClavesCarac[$val]]['contenido']);\n\t\t\t$moneda=$this->arrayCaracteristicas[$this->arrayClavesCarac[$mon]]['contenido'];\n\t\t\tif($valor!=0 && $valor!=''){\n\t\t\t\tif($moneda=='U$S'){\n\t\t\t\t\t$moneda='USD';\n\t\t\t\t}else{\n\t\t\t\t\t$moneda='ARS';\n\t\t\t\t}\n\t\t\t\t$strPrecio=\"<precio>\".$valor.\"</precio><tipoMoneda>\".$moneda.\"</tipoMoneda>\";\n\t\t\t}else{\n\t\t\t\t$strPrecio=\"<tipoMoneda></tipoMoneda>\";\n\t\t\t}\n\n\t }else{\n\t\t\t$strPrecio=\"<tipoMoneda></tipoMoneda>\";\n\t }\n\t return $strPrecio;\n\t}", "public function getisMes()\n {\n return $this->ismes;\n }", "function Consulta_Informacion_Metas()\n {\n $sql=\"SELECT b.id,b.uid,year(b.fecha_inicio) AS ano, month(b.fecha_inicio) AS mes,b.no_dias,count(substr(b.fecha_inicio,1,7)) AS no_regs,\n sum(b.cantidad) AS total,a.name\n FROM crm_proyeccion as b LEFT JOIN users as a ON b.uid = a.uid\n WHERE b.active = 1 AND year(b.fecha_inicio) ='\".$this->ano_id.\"' AND b.gid='\".$this->gid.\"' \".$this->filtro.\"\n GROUP BY substr(b.fecha_inicio,1,7)\n ORDER BY substr(b.fecha_inicio,1,7)\";\n $res=$this->db->sql_query($sql) or die (\"Error en la consulta: \".$sql);\n if($this->db->sql_numrows($res) > 0)\n {\n while(list($id,$_uid,$ano,$mes,$no_dias,$no_reg,$cantidad,$name) = $this->db->sql_fetchrow($res))\n {\n $this->array_metas[$mes]= $cantidad;\n }\n }\n }", "function mensaje() {\n $mensaje = $this->miConfigurador->getVariableConfiguracion('mostrarMensaje');\n //$this->miConfigurador->setVariableConfiguracion ( 'mostrarMensaje', null );\n\n if ($mensaje) {\n\n $tipoMensaje = $this->miConfigurador->getVariableConfiguracion('tipoMensaje');\n\n if ($tipoMensaje == 'json') {\n\n $atributos ['mensaje'] = $mensaje;\n $atributos ['json'] = true;\n } else {\n $atributos ['mensaje'] = $this->lenguaje->getCadena($mensaje);\n }\n // -------------Control texto-----------------------\n $esteCampo = 'divMensaje';\n $atributos ['id'] = $esteCampo;\n $atributos [\"tamanno\"] = '';\n $atributos [\"estilo\"] = 'information';\n $atributos [\"etiqueta\"] = '';\n $atributos [\"columnas\"] = ''; // El control ocupa 47% del tamaño del formulario\n echo $this->miFormulario->campoMensaje($atributos);\n unset($atributos);\n }\n\n return true;\n }", "public function getMesCalendario(){\n return $this->mesCalendario;\n }", "static public function mdlIngresarMembresia($tabla,$datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(id_tipo_membresia,id_precio_membresia,fecha_inicio,fecha_fin,comprobante,id_usuario,id_miembro) VALUES (:id_tipo_membresia,:id_precio_membresia,:fecha_inicio,:fecha_fin,:comprobante,:id_usuario,:id_miembro)\");\n\n $stmt->bindParam(\":id_tipo_membresia\", $datos[\"id_tipo_membresia\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_precio_membresia\", $datos[\"id_precio_membresia\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":fecha_inicio\", $datos[\"fecha_inicio\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":fecha_fin\", $datos[\"fecha_fin\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":comprobante\", $datos[\"comprobante\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_usuario\", $datos[\"id_usuario\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_miembro\", $datos[\"id_miembro\"], PDO::PARAM_STR);\n\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}", "public function setEmprestimos_Bancarios($object){\n\t\tif(substr($object->getrelacao_cr_db()->getCr(), 0, -3) == '2.1.2') {\n\t\t\t$this->Emprestimos_Bancarios += $object->getvalor();\n\t\t}\n\t\t\n\t\t// Debita do emprestimo (Efetua o pagamento total ou parcial do emprestimo).\n\t\tif(substr($object->getrelacao_cr_db()->getDb(), 0, -3) == '2.1.2') {\n\t\t\t$this->Emprestimos_Bancarios -= $object->getvalor();\n\t\t}\n\t}", "public function getMembre()\n {\n return $this->membre;\n }", "public function possuiCalculoPorDiaDoMes() {\n return $this->lControleDiasNoMes;\n }", "public function getIdMembre()\n {\n return $this->idMembre;\n }", "public function getFkPatrimonioBemBaixados()\n {\n return $this->fkPatrimonioBemBaixados;\n }", "function modificarCuentaBancaria(){\n\t\t$this->procedimiento='tes.f_cuenta_bancaria_ime';\n\t\t$this->transaccion='TES_CTABAN_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cuenta_bancaria','id_cuenta_bancaria','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('fecha_baja','fecha_baja','date');\n\t\t$this->setParametro('nro_cuenta','nro_cuenta','varchar');\n\t\t$this->setParametro('fecha_alta','fecha_alta','date');\n\t\t$this->setParametro('id_institucion','id_institucion','int4');\n\t\t$this->setParametro('id_moneda','id_moneda','int4');\n\t\t$this->setParametro('denominacion','denominacion','varchar');\n\t\t$this->setParametro('centro','centro','varchar');\n\t\t\n\t\t$this->setParametro('id_finalidads','id_finalidads','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function evt__enviar(){\n if($this->dep('datos')->tabla('mesa')->esta_cargada()){\n $m = $this->dep('datos')->tabla('mesa')->get();\n // print_r($m);\n $m['estado'] = 2;//Cambia el estado de la mesa a Enviado\n $this->dep('datos')->tabla('mesa')->set($m);\n // print_r($m['id_mesa']);\n $this->dep('datos')->tabla('mesa')->sincronizar();\n // $this->dep('datos')->tabla('mesa')->resetear();\n \n $m = $this->dep('datos')->tabla('mesa')->get_listado($m['id_mesa']);\n if($m[0]['estado'] == 2){//Obtengo de la BD y verifico que hizo cambios en la BD\n //Se enviaron correctamente los datos\n toba::notificacion()->agregar(utf8_decode(\"Los datos fueron enviados con éxito\"),\"info\");\n }\n else{\n //Se generó algún error al guardar en la BD\n toba::notificacion()->agregar(utf8_decode(\"Error al enviar la información, verifique su conexión a internet\"),\"info\");\n }\n }\n \n }", "public function getPembuanganAirLimbah()\n {\n return $this->pembuangan_air_limbah;\n }", "function modificarCuentaBancaria(){\n\t\t$this->procedimiento='sigep.ft_cuenta_bancaria_ime';\n\t\t$this->transaccion='SIGEP_CUEN_BAN_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cuenta_bancaria','id_cuenta_bancaria','int4');\n\t\t$this->setParametro('id_cuenta_bancaria_boa','id_cuenta_bancaria_boa','int4');\n\t\t$this->setParametro('desc_cuenta','desc_cuenta','varchar');\n\t\t$this->setParametro('moneda','moneda','int4');\n\t\t$this->setParametro('cuenta','cuenta','varchar');\n\t\t$this->setParametro('tipo_cuenta','tipo_cuenta','bpchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('estado_cuenta','estado_cuenta','bpchar');\n\t\t$this->setParametro('banco','banco','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function testConteoSmsPorMes() {\n $this->assertInternalType( 'integer', $this->ConteoSms->buscarConteoMes( date( 'n' ) ), \"El tipo de valor debe ser entero\" );\n $this->assertLessThanOrEqual( 8, $this->ConteoSms->buscarConteoMes( date( 'n' ) ), \"No corresponde la cantidad contabilizada del mes\" );\n $this->assertEqual( $this->ConteoSms->buscarConteoMes( 0 ), 0, \"No corresponde la cantida devuelta cuando el mes es incorrecto\" );\n $this->assertEqual( $this->ConteoSms->buscarConteoMes(), 0, \"No corresponde la cantida devuelta cuando el mes es nulo\" );\n }", "static public function mdlEditarMembresia($tabla,$datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"UPDATE $tabla SET id_tipo_membresia = :id_tipo_membresia, id_precio_membresia = :id_precio_membresia,fecha_inicio = :fecha_inicio,fecha_fin = :fecha_fin,comprobante = :comprobante, id_usuario = :id_usuario, id_miembro = :id_miembro WHERE id_membresia = :id\");\n\n\t\t$stmt->bindParam(\":id\", $datos[\"id\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":id_tipo_membresia\", $datos[\"id_tipo_membresia\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_precio_membresia\", $datos[\"id_precio_membresia\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":fecha_inicio\", $datos[\"fecha_inicio\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":fecha_fin\", $datos[\"fecha_fin\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":comprobante\", $datos[\"comprobante\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_usuario\", $datos[\"id_usuario\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_miembro\", $datos[\"id_miembro\"], PDO::PARAM_STR);\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n }", "static public function mdlRenovarMembresia($tabla,$datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(id_tipo_membresia,id_precio_membresia,fecha_inicio,fecha_fin,comprobante,id_usuario,id_miembro,estado) VALUES (:id_tipo_membresia,:id_precio_membresia,:fecha_inicio,:fecha_fin,:comprobante,:id_usuario,:id_miembro,:estado)\");\n\n $stmt->bindParam(\":id_tipo_membresia\", $datos[\"id_tipo_membresia\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_precio_membresia\", $datos[\"id_precio_membresia\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":fecha_inicio\", $datos[\"fecha_inicio\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":fecha_fin\", $datos[\"fecha_fin\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":comprobante\", $datos[\"comprobante\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_usuario\", $datos[\"id_usuario\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_miembro\", $datos[\"id_miembro\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":estado\", $datos[\"estado\"], PDO::PARAM_STR);\n\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}" ]
[ "0.6015031", "0.5866885", "0.58165264", "0.5691185", "0.5689982", "0.56155366", "0.5602413", "0.5581455", "0.55355424", "0.54869664", "0.5482256", "0.5430056", "0.5411872", "0.5400585", "0.5398327", "0.5393906", "0.5354538", "0.5351599", "0.53304696", "0.5329801", "0.5320602", "0.5313634", "0.5309675", "0.5291099", "0.5290475", "0.52852994", "0.528347", "0.52822244", "0.527956", "0.52771753" ]
0.6737042
0
Define o valor do atributo bMostraBarraPerspectivas
public function setMostraBarraPerspectivas($bMostraBarraPerspectivas) { $this->bMostraBarraPerspectivas = $bMostraBarraPerspectivas; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBairro()\n\t{\n\t\t/**\n\t\t * retorna bairro.\n\t\t * @return bairro\n\t\t */\t\t\n\t\treturn $this->bairro;\n\t}", "public function get_barbe(){ return $this->_barbe;}", "public function saveBaixaCompra($param) { \n $CB16PEDIDO = CB16PEDIDO::find()->where(\"CB16_ID = \".$param['pedido'].\" and CB16_STATUS >= 30\")->all()[0];\n if ($CB16PEDIDO) {\n $CB16PEDIDO->setAttribute('CB16_STATUS', 20);\n $CB16PEDIDO->save(); \n }\n }", "public function getBairro() {\n return $this->sBairro;\n }", "public function getFkPatrimonioBemBaixados()\n {\n return $this->fkPatrimonioBemBaixados;\n }", "public function setEmprestimos_Bancarios($object){\n\t\tif(substr($object->getrelacao_cr_db()->getCr(), 0, -3) == '2.1.2') {\n\t\t\t$this->Emprestimos_Bancarios += $object->getvalor();\n\t\t}\n\t\t\n\t\t// Debita do emprestimo (Efetua o pagamento total ou parcial do emprestimo).\n\t\tif(substr($object->getrelacao_cr_db()->getDb(), 0, -3) == '2.1.2') {\n\t\t\t$this->Emprestimos_Bancarios -= $object->getvalor();\n\t\t}\n\t}", "function getBloqueado() {\n return $this->bloqueado;\n }", "public function getBoletoInformation()\n {\n return array(\n '341' => 'Itau',\n '033' => 'Santander',\n '237' => 'Bradesco',\n '001' => 'Banco do Brasil',\n '399' => 'HSBC ',\n '104' => 'Caixa',\n '745' => 'CitiBank'\n );\n }", "private function criarBarraDeBuscaAction(){\n $cidades = $this->Localidades()->getCidades(\"RJ\");\n $busca = new form_busca();//1- primeiro eu instancio o formularioarray('selecione'=>'selecione','nome' => 'nome','cidade' => 'cidade')\n $busca->get('cidade')->setAttribute('options',$cidades);\n $busca->get('bairro')->setAttribute('options', array(0=>'Selecione uma Cidade'));\n //\n $categoriaDao = \\Base\\Model\\daoFactory::factory('SubCategoriaImovel');\n $dadosCategoria = $categoriaDao->recuperarTodos();\n $categorias = $this->SelectHelper()->getArrayData(\"selecione\",$dadosCategoria);\n $busca->get('tipo')->setAttribute('options', $categorias);\n //\n $transacaoDao = \\Base\\Model\\daoFactory::factory('TipoTransacao');\n $dadosTransacoes = $transacaoDao->recuperarTodos();\n $transacoes = $this->SelectHelper()->getArrayData(\"selecione\",$dadosTransacoes);\n $busca->get('transacao')->setAttribute('options', $transacoes);\n //\n $arrayPreco = array(array(\"value\"=>0, \"label\"=>\"selecione\", \"disabled\" => \"disabled\", \"selected\" => \"selected\"),array(\"value\" => 1, \"label\" => \"R$ 100.000 a R$ 200.000\"),array(\"value\" => 2, \"label\" => \"R$ 200.000 a R$ 300.000\"),array(\"value\" => 3, \"label\" => \"R$ 300.000 a R$ 400.000\"),array(\"value\" => 4, \"label\" => \"R$ 400.000 a R$ 500.000\"),array(\"value\" => 5, \"label\" => \"acima de R$ 500.000\"));\n $busca->get('valor')->setAttribute('options', $arrayPreco);\n return $busca;\n }", "function getDatosBreve()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'breve'));\n $oDatosCampo->setEtiqueta(_(\"breve\"));\n return $oDatosCampo;\n }", "public static function items_needed_for_brands(){\n Metabox::make('Personalizar sección de marca', 'brand', [\n 'context' => 'normal',\n 'priority' => 'high',\n 'id' => 'brand-banner-metabox'\n ])->set([\n Field::media('brand-header-banner', [\n 'title' => 'Encabezado',\n 'info' => 'Selecciona un banner que aparecerá en el encabezado cuando la marca esté activa.'\n ]),\n Field::color('brand-header-color', [\n 'title' => 'Color del encabezado',\n 'info' => 'Selecciona un color que aparecerá cuando la pantalla exceda las dimensiones de la imagen.'\n ]),\n ]);\n }", "public function set_barbe($_barbe){\n $this->_barbe = $_barbe;\n\n return $this;\n }", "public function testSetAvecCodeBarre() {\n\n $obj = new ParamEtiquettes();\n\n $obj->setAvecCodeBarre(true);\n $this->assertEquals(true, $obj->getAvecCodeBarre());\n }", "function siguienteEstadoBoleta(){\r\n $this->procedimiento='leg.ft_boleta_garantia_dev_ime';\r\n $this->transaccion='LG_POBODEV_IME';\r\n $this->tipo_procedimiento='IME';\r\n \r\n //Define los parametros para la funcion\r\n $this->setParametro('id_proceso_wf','id_proceso_wf','int4'); \r\n\t\t$this->setParametro('id_estado_wf','id_estado_wf','int4');\r\n\t\t$this->setParametro('id_anexo','id_anexo','int4');\r\n\t\t\r\n\t\t\r\n\r\n //Ejecuta la instruccion\r\n $this->armarConsulta();\r\n $this->ejecutarConsulta();\r\n\r\n //Devuelve la respuesta\r\n return $this->respuesta;\r\n }", "public function reativar($sObservacao = null) {\n\n if (empty($this->iCodigoBem)) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.bem_nao_existe_base_de_dados'));\n }\n if (!db_utils::inTransaction()) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.sem_transacao'));\n }\n\n if (!$this->isBaixado()) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.bem_nao_esta_baixado'));\n }\n $oDaoBensBaixa = new cl_bensbaix();\n $oDaoBensBaixa->excluir($this->getCodigoBem());\n if ($oDaoBensBaixa->erro_status == 0) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.erro_reativar_bem', (object)array(\"erro_msg\" => $oDaoBensBaixa->erro_msg)));\n }\n\n $oDataAtual = new DBDate(date('Y-m-d', db_getsession(\"DB_datausu\")));\n $oInstit = new Instituicao(db_getsession(\"DB_instit\"));\n $lIntegracaoFinanceiro = ParametroIntegracaoPatrimonial::possuiIntegracaoPatrimonio($oDataAtual, $oInstit);\n\n $aNotas = $this->getNotasFiscais();\n\n $lRealizouLancamento = false;\n foreach ($aNotas as $oNota) {\n\n /**\n * realiza lancamentos contabens do bem\n * caso o desdobramento da nota do bem esteja no grupo 9 (bem permante)\n */\n if (!empty($oNota) && $this->verificaSituacaoNota() && $oNota->getValorLiquidado() == 0) {\n\n $oGrupo = GrupoContaOrcamento::getGrupoConta($oNota->getDesdobramento(), db_getsession(\"DB_anousu\"));\n if (!empty($oGrupo) && $oGrupo->getCodigo() == 9) {\n\n $sObs = \"Estorno do Lançamento em liquidação do tombamento do bem {$this->getCodigoBem()}.\";\n\n if ($lIntegracaoFinanceiro) {\n\n $nValor = $this->getValorAquisicao();\n if (count($aNotas) > 1) {\n $nValor = $this->getValorItemNota($oNota->getCodigoNota());\n }\n\n $oProcessarLancamento = new stdClass();\n $oProcessarLancamento->iCodigoDotacao = $oNota->getEmpenho()->getDotacao()->getCodigo();\n $oProcessarLancamento->iCodigoElemento = $oNota->getDesdobramento();\n $oProcessarLancamento->iCodigoNotaLiquidacao = $oNota->getCodigoNota();\n $oProcessarLancamento->iFavorecido = $oNota->getEmpenho()->getCgm()->getCodigo();\n $oProcessarLancamento->iNumeroEmpenho = $oNota->getEmpenho()->getNumero();\n $oProcessarLancamento->sObservacaoHistorico = $sObs;\n $oProcessarLancamento->nValorTotal = $nValor;\n $oProcessarLancamento->oClassificacao = $this->getClassificacao();\n $oProcessarLancamento->oGrupo = $oGrupo;\n\n LancamentoEmpenhoEmLiquidacao::processar($oProcessarLancamento);\n $lRealizouLancamento = true;\n }\n }\n }\n }\n\n if (USE_PCASP && !$lRealizouLancamento && $lIntegracaoFinanceiro ) {\n\n /**\n * Realiza acerto nas contas de depreciação e classificação, caso seja necessário\n */\n $oBemAcertoContaClassificacao = new BemAcertoContaClassificacao();\n $oDBData = new DBDate( date(\"d/m/Y\", db_getsession(\"DB_datausu\")) );\n\n $oBemDepreciacao = BemDepreciacao::getInstance($this);\n $nValorAtual = $this->nValorAquisicao;\n\n if (!empty($oBemDepreciacao)) {\n $nValorAtual = $oBemDepreciacao->getValorAtual();\n }\n\n if ($nValorAtual != 0) {\n $oLancamentoauxiliarBem = new LancamentoAuxiliarBem();\n $oLancamentoauxiliarBem->setValorTotal($nValorAtual);\n $oLancamentoauxiliarBem->setBem($this);\n $oLancamentoauxiliarBem->setObservacaoHistorico($sObservacao);\n $oLancamentoauxiliarBem->setEstorno(true);\n $oEventoContabil = new EventoContabil(702, db_getsession('DB_anousu'));\n $aLancamentos = $oEventoContabil->getEventoContabilLancamento();\n $oLancamentoauxiliarBem->setHistorico($aLancamentos[0]->getHistorico());\n $oEventoContabil->executaLancamento($oLancamentoauxiliarBem);\n }\n }\n }", "function opcion__migrar_toba()\n\t{\n\t\t$proyecto = $this->get_proyecto();\n\t\t//--- Parametros\n\t\t$param = $this->get_parametros();\n\t\t$desde = isset($param['-d']) ? new toba_version($param['-d']) : $proyecto->get_version_actual();\n\t\t$hasta = isset($param['-h']) ? new toba_version($param['-h']) : toba_modelo_instalacion::get_version_actual();\n\n\t\t$desde_texto = $desde->__toString();\n\t\t$hasta_texto = $hasta->__toString();\n\t\t$this->consola->titulo(\"Migración el proyecto '{$proyecto->get_id()}'\".\" desde la versión $desde_texto hacia la $hasta_texto.\");\n\n\t\tif (! isset($param['-m'])) {\n\t\t\t$versiones = $desde->get_secuencia_migraciones($hasta);\n\t\t\tif (empty($versiones)) {\n\t\t\t\t$this->consola->mensaje(\"No es necesario ejecutar una migración entre estas versiones para el proyecto '{$proyecto->get_id()}'\");\n\t\t\t\treturn ;\n\t\t\t}\n\t\t\t$proyecto->migrar_rango_versiones($desde, $hasta, false);\n\t\t} else {\n\t\t\t//Se pidio un método puntual\n\t\t\t$proyecto->ejecutar_migracion_particular($hasta, trim($param['-m']));\n\t\t}\n\t}", "public function getTaxaLMB() {\n return $this->getChaveValor('TAXA_SERVICO_LMB');\n }", "public function getMontacargasBaja()\n {\n\n return $this->montacargas_baja;\n }", "public function GetCodBarra()\n\t{\n\t\treturn $this->codBarra;\n\t}", "public function getBanco() {\n return $this->banco;\n }", "public function getPembuanganAirLimbah()\n {\n return $this->pembuangan_air_limbah;\n }", "public function buscarBancos() {\r\n return $this->find(\"b_estatus = 'activa'\");\r\n }", "public function getCodigoBarras()\n {\n if (!empty($this->campoCodigoBarras)) {\n return $this->campoCodigoBarras;\n }\n\n if (!$this->isValid($messages)) {\n throw new \\Exception('Campos requeridos pelo banco, aparentam estar ausentes ' . $messages);\n }\n\n $codigo = Util::numberFormatGeral($this->getCodigoBanco(), 3)\n . $this->getMoeda()\n . Util::fatorVencimento($this->getDataVencimento())\n . Util::numberFormatGeral($this->getValor(), 10)\n . $this->getCampoLivre();\n\n $dv = CalculoDV::unicredCodigoBarra($codigo);\n return $this->campoCodigoBarras = substr($codigo, 0, 4) . $dv . substr($codigo, 4);\n }", "public function getFkAlmoxarifadoCatalogoItemBarras()\n {\n return $this->fkAlmoxarifadoCatalogoItemBarras;\n }", "public function get_aberto()\n {\n return $this->_aberto;\n }", "public function getAvecCodeBarre() {\n return $this->avecCodeBarre;\n }", "public function getFkPatrimonioBemMarcas()\n {\n return $this->fkPatrimonioBemMarcas;\n }", "function bancos($periodo,$ejer,$moneda){\n\t\t\t$sql=$this->query(\"select m.IdPoliza,m.Cuenta,sum(m.Importe) importe,m.TipoMovto,c.description,p.relacionExt,p.concepto\n\t\t\tfrom cont_movimientos m,cont_polizas p,cont_accounts c,cont_config conf\n\t\t\twhere m.cuenta=c.account_id and c.currency_id=\".$moneda.\" and p.idejercicio=\".$ejer.\" and c.`main_father`=conf.CuentaBancos and p.idtipopoliza!=3\n\t\t\tand m.IdPoliza=p.id and p.idperiodo in (\".$periodo.\",\".($periodo-=1).\") and p.activo=1 and m.Activo=1\n\t\t\tgroup by m.Cuenta,m.TipoMovto\");\n\t\t\treturn $sql;\n\t\t}", "public function getBanco($verificacao = false);", "protected function getBParamDataAttributes() {}" ]
[ "0.6208536", "0.6178114", "0.61529434", "0.6074654", "0.5983324", "0.5836177", "0.57827866", "0.57303756", "0.57055473", "0.569183", "0.5677648", "0.5621346", "0.5596944", "0.55520713", "0.55238557", "0.5481535", "0.54708946", "0.5455137", "0.545329", "0.5449096", "0.5437049", "0.54279137", "0.5425535", "0.54239774", "0.5384863", "0.5381404", "0.53766817", "0.535597", "0.53546846", "0.53433734" ]
0.64952254
0
Define o valor do atributo bMostraHora
public function setMostraHora($bMostraHora) { $this->bMostraHora = $bMostraHora; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHora () {\n return $this->sHora;\n }", "public function vr_hora()\n {\n\n $valor=$this->vr_hora;\n\n if ($this->id_tipotitulo == 3)\n {\n $valor='10208';\n } elseif ($this->id_tipotitulo == 4) {\n $valor='15122';\n } elseif ($this->id_tipotitulo == 5) {\n $valor='19096';\n } elseif ($this->id_tipotitulo == 7) {\n $valor='23252';\n } elseif ($this->id_tipotitulo == 10) {\n $valor='27014';\n } elseif ($this->id_tipotitulo == 9) {\n $valor='10208';\n } elseif ($this->id_tipotitulo == 11) {\n $valor='10208'; }\n elseif ($this->id_tipotitulo == 12) {\n $valor='0';\n }\n\n\n return $valor;\n\n }", "function get_hora_bd($hora){\n\t$h = substr($hora,0,2);\n\t$m = substr($hora,3,2);\n\t$meridiano = substr($hora,-2,2);\n\tif($meridiano == 'pm'){\n\t\t$h = $h + 12;\n\t\t$h = $h.':'.$m.':00';\n\t}else{\n\t\t$h = $h.':'.$m.':00';\n\t}\n\treturn $h;\n}", "public function getHora() {\n\t\treturn $this->Hora;\n\t}", "public function setHora($Hora) {\n\t\t$this->Hora=$Hora;\n\t}", "public function getHoraAttribute($value)\n {\n return \\DateTime::createFromFormat($this->getDateFormat(), $value)->format('j/n/Y g:i A');\n }", "public static function componenteHora( $nombre, $id, $defecto = \"00:00\", $estiloClase = \"\", $conNom = false ){\n\t\tif( $defecto == \"00:00\" ){\n\t\t\t$defecto = date(\"H:i\");\n\t\t}\n\t\t$actual = strtotime($defecto);\n\t\t$newformat = date('H:i',$actual);\n\t\t$defecto = $newformat;\n\t\t$hora = date('H',$actual);\n\t\t$minu = date('i',$actual);\n\t\n\t\t$hi = \"h_\" . $id;\n\t\t$mi = \"m_\" . $id;\n\t\n\t\t$hni = ( $conNom ? \" name=\\\"h_\" . $nombre . \"\\\"\" : \"\");\n\t\t$mni = ( $conNom ? \" name=\\\"m_\" . $nombre . \"\\\"\" : \"\");\n\t\t\n\t\t$jsCom = \"onkeyup=\\\"ut.ComponenteHora('#\" . $id . \"', '#\" . $hi . \"', '#\" . $mi . \"');\\\" \";\n\t\t$jsCom .= \"onchange=\\\"ut.ComponenteHora('#\" . $id . \"', '#\" . $hi . \"', '#\" . $mi . \"');\\\"\";\n\t\n\t\t\n\t\t$selHora = \"<select \" . $jsCom . $hni . \" id=\\\"\" . $hi . \"\\\" style=\\\"width: 40px;\\\" >\";\n\t\tfor ($i = 0; $i <= 23; $i++) {\n\t\t\t$vlHor = (strlen( $i ) == 1 ? \"0\" . $i : $i );\n\t\t\t$sel = ($i == $hora ? \"selected=\\\"selected\\\" \" : \"\");\n\t\t\t$selHora .= \"<option \" . $sel . \"value=\\\"\" . $vlHor . \"\\\">\" . $vlHor . \"</option>\";\n\t\t}\n\t\t$selHora .= \"</select>\";\n\t\t\n\t\t$selMinu = \"<select \" . $jsCom . $mni . \" id=\\\"\" . $mi . \"\\\" style=\\\"width: 40px;\\\" >\";\n\t\tfor ($i = 0; $i <= 59; $i++) {\n\t\t\t$vlMin = (strlen( $i ) == 1 ? \"0\" . $i : $i );\n\t\t\t$sel = ($i == $minu ? \"selected=\\\"selected\\\" \" : \"\");\n\t\t\t$selMinu .= \"<option \" . $sel . \"value=\\\"\" . $vlMin . \"\\\">\" . $vlMin . \"</option>\";\n\t\t}\n\t\t$selMinu .= \"</select>\";\n\t\n\t\t$html = \"<table class=\\\"\" . $estiloClase . \"\\\" >\";\n\t\t$html .= \"\t<tbody>\";\n\t\t$html .= \"\t\t<tr>\";\n\t\t$html .= \"\t\t\t<th><label for=\\\"\" . $hi . \"\\\">Hora</label></th>\";\n\t\t$html .= \"\t\t\t<th><label for=\\\"\" . $mi . \"\\\">Minutos</label></th>\";\n\t\t$html .= \"\t\t</tr>\";\n\t\t$html .= \"\t\t<tr>\";\n\t\t$html .= \"\t\t\t<td>\" . $selHora . \"</td>\";\n\t\t$html .= \"\t\t\t<td>\" . $selMinu . \"</td>\";\n\t\t$html .= \"\t\t</tr>\";\n\t\t$html .= \"\t</tbody>\";\n\t\t$html .= \"</table>\";\n\t\t$html .= \"<input type=\\\"hidden\\\" name=\\\"\" . $nombre . \"\\\" id=\\\"\" . $id . \"\\\" value=\\\"\" . $defecto. \"\\\" />\";\n\t\treturn $html;\n\t}", "function formatear_hora($parametro){\n\n\t\t/* Declaro variables personalizadas para que queden claros los datos */\n\t\t$hora = substr($parametro, 11, 2);\n\t\t$minuto = substr($parametro, 14, 2);\n\t\t$dia = substr($parametro, 8, 2);\n\t\t$mes = substr($parametro, 5, 2);\n\t\t\n\t\t/* Generamos el formato */\n\t\t$temp = $hora.\":\".$minuto;\n\t\t\n\t\treturn $temp;\n\t}", "public function setHora ($sHora) {\n $this->sHora = $sHora;\n }", "function convertir_hora_militar($seg_ini) {\n\n\t\t\t$horas = floor($seg_ini/3600);\n\t\t\t$minutos = floor(($seg_ini-($horas*3600))/60);\n\t\t\t\t\t\t\t\n\t\t\treturn $horas.\":\".$minutos;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}", "private static function setHorarioDeVerao() {\n $dataJunta = self::getAnoAtual() . self::getMesAtual() . self::getDiaAtual();\n //self::$horario_de_verao = ($dataJunta > '20121021' && $dataJunta < '20130217' ) ? true : false;\n self::$horario_de_verao = (date('I') == \"1\") ? true : false;\n return self::getHorarioDeVerao();\n }", "function Hora_prog($valor){\t\n\n return date(\"H:i\", strtotime($valor));\n\n}", "public function __construct($dataHoraEnvio){\n // Assim q a classe for instanciada é configurada\n date_default_timezone_set(\"America/Sao_Paulo\");\n setlocale(LC_ALL, 'pt_BR', 'pt_BR.utf-8', 'pt_BR.utf-8', 'portuguese'); \n $this->dataHoraEnvio = new \\DateTime($dataHoraEnvio);\n $this->dataHoraAgora = new \\DateTime('now'); \n \n }", "function setMaCauHoi($ma_cau_hoi){\r\n\t\t$this->ma_cau_hoi = $ma_cau_hoi;\r\n\t}", "function getHour()\r\n {\r\n return $this->hora;\r\n }", "public function gethoraentrega()\r\n {\r\n return $this->horaentrega;\r\n }", "function obtener_hora($fecha) {\r\nreturn(substr($fecha,11,2));\r\n}", "function hoje() {\n $data_hoje = date(\"Y-m-d H:i:s\");\n return $data_hoje;\n }", "function setHour($h)\r\n {\r\n if($h > 23 || $h < 0) {\r\n $this->hora = 0;\r\n } else {\r\n $this->hora = $h;\r\n }\r\n }", "public function __construct(DiaTrabalho $oDiaTrabalho) {\n\n $this->setDiaTrabalho($oDiaTrabalho);\n parent::__construct();\n\n $this->oExtra50Diurna = $this->getHoraZerada();\n $this->oExtra50Noturna = $this->getHoraZerada();\n $this->oExtra50 = $this->getHoraZerada();\n $this->oMaximoExtra75 = new \\DateTime(\n $this->getDiaTrabalho()->getData()->getDate() .' '. $this->getConfiguracoesLotacao()->getHoraExtra75()\n );\n }", "public function calcularSueldo(){\n $this->horas_trabajadas * 540;\n }", "function horas_em_mintutos($hora)\n{\n\n if ($hora == '') {\n $hora = '00:00';\n }\n\n $h1 = explode(\":\", $hora);\n\n\n $minuto = $h1[1];\n $horas = $h1[0];\n\n\n if ($horas > 0) {\n\n if (substr($horas, 0, 1) == 0) {\n $horas = substr($horas, 1, 1);\n }\n\n $horas = $horas * 60;\n\n $minuto = $minuto + $horas;\n }\n\n\n\n\n return $minuto;\n}", "public function testSetHabs9() {\n\n $obj = new HistoPrepPaie();\n\n $obj->setHabs9(10.092018);\n $this->assertEquals(10.092018, $obj->getHabs9());\n }", "public function puestaACero()\n {\n $this->hh = 0;\n $this->mm = 0;\n $this->ss = 0;\n }", "public static function hora ($archivo)\n {\n /**\n * Valido la estructura de horas\n */\n //hora por la cual inicia el archivo\n $actual=$archivo->excel->sheets[0]['cells'][5][1];\n// $actual=0;\n $contador=0;\n //Cuantos segundos\n $regAprox=1500*$archivo->excel->sheets[0]['cells']['numRows'][1];\n\n $segundos=$regAprox/2.8;\n $segundos=substr($segundos,0,4);\n //Aumento el tiempo de ejecucion\n ini_set('memory_limit', -1);\n ini_set('max_execution_time', $segundos);\n for ($i=5; $i<$archivo->excel->sheets[0]['numRows']; $i++)\n { \n if($archivo->excel->sheets[0]['cells'][$i][1]!=\"Total\" && $archivo->excel->sheets[0]['cells'][$i][1]!=\"Date\" && $archivo->excel->sheets[0]['cells'][$i][1]!=\"Hour\")\n {\n //Verifico que sean secuenciales las horas\n if($actual <= $archivo->excel->sheets[0]['cells'][$i][1])\n {\n if($actual==$archivo->excel->sheets[0]['cells'][$i][1])\n {\n $contador=$contador+1;\n }\n elseif($actual==$archivo->excel->sheets[0]['cells'][$i][1]-1)\n {\n if($contador<=1)\n {\n self::$error=ValidationsArchCapt::ERROR_ESTRUC;\n return false;\n }\n else\n {\n $contador=0;\n $actual=$archivo->excel->sheets[0]['cells'][$i][1];\n }\n }\n else\n {\n self::$error=ValidationsArchCapt::ERROR_ESTRUC;\n return false; \n }\n }\n }\n }\n \n //Cuantos segundos\n $regAprox=1500*$archivo->excel->sheets[0]['cells']['numRows'][1];\n $segundos=$regAprox/2.8;\n $segundos=substr($segundos,0,4);\n //Aumento el tiempo de ejecucion\n ini_set('max_execution_time', $segundos);\n// ini_set(\"memory_limit\",\"128M\");\n\n \n /**\n * Verifico que la fecha del archivo sea correcta\n */\n $date_balance_time=Utility::formatDate($data->sheets[0]['cells'][1][5]);\n \n /**\n * Comienzo a leer el archivo\n */\n $valuesNew='';\n $var=array();\n for($i=5;$i<=$archivo->excel->sheets[0]['numRows'];$i++)\n {\n for($j=1;$j<=$archivo->excel->sheets[0]['numCols'];$j++)\n {\n switch($j)\n {\n case 1:\n //Obtengo la hora del registro\n if($archivo->excel->sheets[0]['cells'][$i][$j]=='Total')\n {\n //si es total es que se termino el archivo\n break 3;\n }\n else\n {\n $time=$archivo->excel->sheets[0]['cells'][$i][$j];\n }\n break;\n case 2:\n //Obtengo el nombre del destino\n if($archivo->excel->sheets[0]['cells'][$i][$j]=='Total')\n {\n //si es total no lo voy a guardar en base de datos\n break 2;\n }\n else\n {\n // $name_destination=utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]);\n $name_destination=Destination::getId(utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]));\n }\n break;\n case 3:\n //Obtengo el nombre del customer\n if($archivo->excel->sheets[0]['cells'][$i][$j]=='Total')\n {\n //si es total no lo voy a guardar en base de datos\n break 2;\n }\n else\n {\n //Aqui encodeo el nombre del carrier a utf-8\n // $name_customer=utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]);\n $name_customer=Carrier::getId(utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]));\n\n }\n break;\n case 4:\n if($archivo->excel->sheets[0]['cells'][$i][$j]=='Total')\n {\n //si es total no lo voy guardar en base de datos\n break 2;\n }\n else\n {\n // $name_supplier=utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]);\n $name_supplier=Carrier::getId(utf8_encode($archivo->excel->sheets[0]['cells'][$i][$j]));\n }\n break;\n case 5;\n //minutos\n $minutes=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n case 6;\n //ACD \n $acd=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 7;\n //ASR\n $asr=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 8;\n //Margin %\n $margin_percentage=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 9;\n //Margin per Min\n $margin_per_minute=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 10;\n //Cost per Min\n $cost_per_minute=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 11;\n //Revenue per Min\n $revenue_per_minute=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 12;\n //PDD\n $pdd=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 13;\n //Imcomplete Calls\n $incomplete_calls=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 14;\n //Imcomplete Calls Ner\n $incomplete_calls_ner=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 15;\n //Complete Calls Ner\n $complete_calls_ner=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 16;\n //Complete Calls\n $complete_calls=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 17;\n //Calls Attempts\n $calls_attempts=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 18;\n //Duration Real\n $duration_real=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 19;\n //Duration Cost\n $duration_cost=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 20;\n //NER02 Efficient\n $ner02_efficient=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 21;\n //NER02 Seizure\n $ner02_seizure=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 22;\n //PDDCalls\n $pdd_calls=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 23;\n //Revenue\n $revenue=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 24;\n //Cost\n $cost=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 25;\n //Margin\n $margin=Utility::notNull($archivo->excel->sheets[0]['cellsInfo'][$i][$j]['raw']);\n break;\n case 26;\n $valuesNew.=\"(\";\n $valuesNew.=\"'\".$date_balance_time.\"',\";\n $valuesNew.=$time.\",\";\n $valuesNew.=$minutes.\",\";\n $valuesNew.=$acd.\",\";\n $valuesNew.=$asr.\",\";\n $valuesNew.=$margin_percentage.\",\";\n $valuesNew.=$margin_per_minute.\",\";\n $valuesNew.=$cost_per_minute.\",\";\n $valuesNew.=$revenue_per_minute.\",\";\n $valuesNew.=$pdd.\",\";\n $valuesNew.=$incomplete_calls.\",\";\n $valuesNew.=$incomplete_calls_ner.\",\";\n $valuesNew.=$complete_calls_ner.\",\";\n $valuesNew.=$complete_calls.\",\";\n $valuesNew.=$calls_attempts.\",\";\n $valuesNew.=$duration_real.\",\";\n $valuesNew.=$duration_cost.\",\";\n $valuesNew.=$ner02_efficient.\",\";\n $valuesNew.=$ner02_seizure.\",\";\n $valuesNew.=$pdd_calls.\",\";\n $valuesNew.=$revenue.\",\";\n $valuesNew.=$cost.\",\";\n $valuesNew.=$margin.\",\";\n $valuesNew.=\"'\".date(\"Y-m-d\").\"',\";\n $valuesNew.=\"'\".date(\"H:i:s\").\"',\";\n $valuesNew.=\"'\".$name_supplier.\"',\";\n $valuesNew.=\"'\".$name_customer.\"',\";\n $valuesNew.=\"'\".$name_destination.\"')\";\n break; \n }\n }\n if($i<=$archivo->excel->sheets[0]['numRows']-1)\n {\n $valuesNew.=\",\";\n }\n }\n $barra = substr($valuesNew, -1, 1);\n if($barra==\",\") \n {\n $valuesNew=substr($valuesNew, 0, - 1); \n }\n if($valuesNew!=\"\")\n {\n $var['regHora']=$valuesNew;\n $var['hora']=$time;\n }\n else\n {\n $var=\"\";\n }\n return $var;\n }", "function get_hora_meridiano($hora){\n\t$hora = explode(\":\",$hora);\n\t$h = $hora[0];\n\t$m = $hora[1];\n\tif($h > 12){\n\t\t$h = $h - 12;\n\t\tif($h < 10){\n\t\t\t$h = '0'.$h;\n\t\t}\n\t\t$h = $h.':'.$m.' pm';\t\t\n\t}else{\n\t\tif($h == 12){\n\t\t\t$h = $h.':'.$m.' m';\n\t\t}else{\n\t\t\t$h = $h.':'.$m.' am';\n\t\t}\t\t\n\t}\n\treturn $h;\n}", "function DataHora($data_hora, $time = false, $prefixo = false){\n\t\n\tif (is_null($data_hora)) {\n\t\treturn NULL;\n\t}\n\tif ($data_hora == \"\") {\n\t\treturn \"\";\n\t}\n\t \n\t$data = substr($data_hora, 0, 10);\n\t$hora = \"\";\n\tif (strlen($data_hora) > 10){\n\t\t$hora = \" \".substr($data_hora, 11, 5);\n\t}\n\tif (strstr($data, \"-\")){\n\t\t$arr_data = explode(\"-\", $data);\n\t\t$data = $arr_data[2].\"/\".$arr_data[1].\"/\".$arr_data[0];\n\t}else{\n\t\t$arr_data = explode(\"/\", $data);\n\t\t$data = $arr_data[2].\"-\".$arr_data[1].\"-\".$arr_data[0];\n\t}\n\tif ($prefixo) {\n\t\t$var = \" &agrave;s \";\n\t}else {\n\t\t$var = \"\";\n\t}\n\t \n\tif ($time) {\n\t\treturn $data.$var.$hora;\n\t}else{\n\t\treturn $data;\n\t}\n}", "function DataHoraAtual(){\n\t$datetime = new DateTime();\n\treturn $datetime->format(\"Y-m-d H:i:s\");\n}", "function divHoras($hora,$registros) {\n\t$h1=substr($hora,0,-3);\n $m1=substr($hora,3,2);\n $minutos=(($h1*60)*60)+($m1*60);\n $dif=$minutos/$registros;\n $difm=floor($dif/60);\n\treturn $difm;\n\t \n}", "public function getTimeFinHora()\n {\n return $this->timeFinHora;\n }" ]
[ "0.63527995", "0.621379", "0.6173004", "0.59786916", "0.5961799", "0.5739565", "0.5738341", "0.57108605", "0.5662221", "0.5559837", "0.5542525", "0.553579", "0.54892397", "0.5485083", "0.53911245", "0.53775966", "0.5363104", "0.5359308", "0.5358249", "0.53052557", "0.53049755", "0.52951205", "0.52532864", "0.52480596", "0.52269435", "0.5218918", "0.5204495", "0.5166916", "0.51581466", "0.5141914" ]
0.68417
0
Define o valor do atributo bMostraCabecalhoMes
public function setMostraCabecalhoMes($bMostraCabecalhoMes) { $this->bMostraCabecalhoMes = $bMostraCabecalhoMes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testConteoSmsPorMes() {\n $this->assertInternalType( 'integer', $this->ConteoSms->buscarConteoMes( date( 'n' ) ), \"El tipo de valor debe ser entero\" );\n $this->assertLessThanOrEqual( 8, $this->ConteoSms->buscarConteoMes( date( 'n' ) ), \"No corresponde la cantidad contabilizada del mes\" );\n $this->assertEqual( $this->ConteoSms->buscarConteoMes( 0 ), 0, \"No corresponde la cantida devuelta cuando el mes es incorrecto\" );\n $this->assertEqual( $this->ConteoSms->buscarConteoMes(), 0, \"No corresponde la cantida devuelta cuando el mes es nulo\" );\n }", "function modificarCuentaBancaria(){\n\t\t$this->procedimiento='tes.f_cuenta_bancaria_ime';\n\t\t$this->transaccion='TES_CTABAN_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cuenta_bancaria','id_cuenta_bancaria','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('fecha_baja','fecha_baja','date');\n\t\t$this->setParametro('nro_cuenta','nro_cuenta','varchar');\n\t\t$this->setParametro('fecha_alta','fecha_alta','date');\n\t\t$this->setParametro('id_institucion','id_institucion','int4');\n\t\t$this->setParametro('id_moneda','id_moneda','int4');\n\t\t$this->setParametro('denominacion','denominacion','varchar');\n\t\t$this->setParametro('centro','centro','varchar');\n\t\t\n\t\t$this->setParametro('id_finalidads','id_finalidads','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function saveBaixaCompra($param) { \n $CB16PEDIDO = CB16PEDIDO::find()->where(\"CB16_ID = \".$param['pedido'].\" and CB16_STATUS >= 30\")->all()[0];\n if ($CB16PEDIDO) {\n $CB16PEDIDO->setAttribute('CB16_STATUS', 20);\n $CB16PEDIDO->save(); \n }\n }", "public function getMesCalendario(){\n return $this->mesCalendario;\n }", "function modificarCuentaBancaria(){\n\t\t$this->procedimiento='sigep.ft_cuenta_bancaria_ime';\n\t\t$this->transaccion='SIGEP_CUEN_BAN_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cuenta_bancaria','id_cuenta_bancaria','int4');\n\t\t$this->setParametro('id_cuenta_bancaria_boa','id_cuenta_bancaria_boa','int4');\n\t\t$this->setParametro('desc_cuenta','desc_cuenta','varchar');\n\t\t$this->setParametro('moneda','moneda','int4');\n\t\t$this->setParametro('cuenta','cuenta','varchar');\n\t\t$this->setParametro('tipo_cuenta','tipo_cuenta','bpchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('estado_cuenta','estado_cuenta','bpchar');\n\t\t$this->setParametro('banco','banco','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function criarBloco_1_Vazio()\n {\n $this->Sped->criarLinha('1', '1001', \"|1001|0|\");\n $this->Sped->criarLinha('1', '1010', \"|1010|N|N|N|N|N|N|N|N|N|N|N|N|N|\");\n $this->Sped->criarEncerramentoBloco('1', '1990', \"1990\");\n }", "function FicheMemo()\n{\n\t$this->type_moi = \"fiche_memo\";\n}", "function cargar_data_libro_banco($c_a_cuenta_banco, $limit, $nombre_mes='' , $cc='') {\n\t//$nombre_mes='DICIEMBRE';\n $sql = \"SELECT\n prosic_comprobante.id_comprobante\n , prosic_comprobante.codigo_comprobante\n , prosic_comprobante.emision_comprobante\n , prosic_comprobante.total_comprobante\n , prosic_comprobante.status_comprobante\n , prosic_anexo.codigo_anexo\n , prosic_subdiario.id_subdiario\n , prosic_subdiario.codigo_subdiario\n , prosic_subdiario.nombre_subdiario\n , prosic_anio.nombre_anio\n , prosic_mes.nombre_mes\n , prosic_tipo_comprobante.codigo_tipo_comprobante\n , prosic_tipo_comprobante.nombre_tipo_comprobante\n ,prosic_comprobante.nro_comprobante\n ,prosic_moneda.codigo_moneda\n FROM\n prosic_comprobante\n INNER JOIN prosic_anexo \tON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n INNER JOIN prosic_mes \tON (prosic_comprobante.id_mes = prosic_mes.id_mes)\n INNER JOIN prosic_anio \tON (prosic_comprobante.id_anio = prosic_anio.id_anio)\n INNER JOIN prosic_subdiario \tON (prosic_comprobante.id_subdiario = prosic_subdiario.id_subdiario)\n INNER JOIN prosic_tipo_comprobante\tON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n INNER JOIN prosic_plan_contable ON (prosic_comprobante.cuenta_banco = prosic_plan_contable.id_plan_contable)\n INNER JOIN prosic_moneda\t ON (prosic_comprobante.id_moneda= prosic_moneda.id_moneda)\n WHERE prosic_comprobante.id_subdiario=8 AND prosic_comprobante.c_a_cuenta_banco='\" . $c_a_cuenta_banco . \"' \";\t\n\tif ($nombre_mes != '') $sql.= \" AND prosic_mes.nombre_mes = '\" . $nombre_mes . \"' \";\n\tif ($cc != '') $sql.=\" AND prosic_comprobante.codigo_comprobante = '\" . $cc . \"' \";\n\t$sql.=\" ORDER BY MONTH(prosic_comprobante.emision_comprobante) DESC , prosic_comprobante.codigo_comprobante*10000 DESC\";\n\t//$sql.=\" ORDER BY prosic_comprobante.status_comprobante DESC, MONTH(prosic_comprobante.emision_comprobante), prosic_comprobante.emision_comprobante\";\n\tif ($limit != '')$sql.=\" \" . $limit . \" \";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "function cabecera($cedula, $ano, $mes){\r\n\t$cuerpo = \"\";\r\n\t$db = \"sidial\";\r\n\t$sql = \"SELECT * FROM VW_CABECERA_HISTORICO WHERE CE_TRABAJADOR = $cedula AND ANO = $ano AND MES = $mes\";\r\n\t$ds = new DataStore($db, $sql);\r\n\tif($ds->getNumRows()==0){\r\n\t\t$cuerpo .= \"<h4>No hay datos para la consulta</h4>\";;\r\n\t} else {\r\n\t\t$fila = $ds->getValues(0);\r\n\t $cuerpo .= '<table class=\"consulta\">';\r\n//\t $cuerpo .= '<tr class=\"par\"><th>Apellidos y nombres</th><td>' . $fila[\"NOMBRES\"] . \"</td></tr>\";\r\n\t $cuerpo .= '<tr class=\"par\"><th>Ubicaci&oacute;n</th><td>' . $fila[\"UBICACION\"] . \"</td></tr>\";\r\n\t $cuerpo .= '<tr class=\"par\"><th>Tipo de personal</th><td>' . $fila[\"TIPPER\"] . \"</td></tr>\";\r\n\t $cuerpo .= '<tr class=\"par\"><th>Dedicaci&oacute;n</th><td>' . $fila[\"DEDICACION\"] . \"</td></tr>\";\r\n\t $cuerpo .= '<tr class=\"par\"><th>Categor&iacute;a o cargo</th><td>' . $fila[\"CATEGORIA\"] . \"</td></tr>\";\r\n//\t $cuerpo .= '<tr class=\"par\"><th>Fecha de Ingreso</th><td>' . $fila[\"FE_INGRESO\"] . \"</td></tr>\";\r\n//\t $cuerpo .= '<tr class=\"par\"><th>Fecha de Jubilaci�n</th><td>' . $fila[\"FE_JUBILACION\"] . \"</td></tr>\";\r\n\t $cuerpo .= \"</table>\";\r\n\t}\r\n\treturn $cuerpo;\r\n}", "public function getMontacargasBaja()\n {\n\n return $this->montacargas_baja;\n }", "public function getMes() {\n return $this->iMes;\n }", "public function get_boton($metodo, $usuario, $form,$cMet=\"N\") {\n $this->rows = \"\";\n $this->query = \"\";\n $this->query = \" SELECT fbArmaBoton($form,$usuario,'\".$cMet.\"') as boton; \";\n $this->get_results_from_query();\n if (count($this->rows) >= 1) {\n foreach ($this->rows as $pro => $va) {\n $this->_boton[] = $va;\n if ($this->_boton[0]['boton'] == '') {\n #mensaje de error: warning, danger, success, info\n $mensjBto = '';\n $this->_boton[0] = array('boton' => $mensjBto);\n }\n }\n }\n }", "public function setEmprestimos_Bancarios($object){\n\t\tif(substr($object->getrelacao_cr_db()->getCr(), 0, -3) == '2.1.2') {\n\t\t\t$this->Emprestimos_Bancarios += $object->getvalor();\n\t\t}\n\t\t\n\t\t// Debita do emprestimo (Efetua o pagamento total ou parcial do emprestimo).\n\t\tif(substr($object->getrelacao_cr_db()->getDb(), 0, -3) == '2.1.2') {\n\t\t\t$this->Emprestimos_Bancarios -= $object->getvalor();\n\t\t}\n\t}", "function BuscarMensagem()\r\n {\r\n $this->Model->setId($_POST[\"Chat\"]);\r\n\r\n $ret = $this->DAO->BuscarMensagem($this->Model);\r\n $Count = 0;\r\n\r\n foreach($ret as $Item)\r\n {\r\n if($Item[\"USUARIO\"] != $_SESSION[\"DadosUser\"][\"Id\"])\r\n {\r\n $ret[$Count][\"CLASS\"] = \"userDestino\";\r\n $ret[$Count][\"STYLE\"] = \"color: red;\";\r\n }\r\n else\r\n {\r\n $ret[$Count][\"CLASS\"] = \"userLogado\";\r\n $ret[$Count][\"STYLE\"] = \"color: black; width: 50%; padding: 2%; margin-left: 1%; margin-right: 1%; margin-top: 1.5%; margin-bottom: 1.5%; border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-left-radius: 10px;\";\r\n }\r\n $Count++;\r\n }\r\n\r\n if(!empty($ret))\r\n {\r\n echo json_encode($ret);\r\n }\r\n else\r\n {\r\n echo 0;\r\n }\r\n }", "public function getMesNacimiento() {\n\t\treturn $this->mesNacimiento;\n\t}", "public function getCodigoBarras()\n {\n if (!empty($this->campoCodigoBarras)) {\n return $this->campoCodigoBarras;\n }\n\n if (!$this->isValid($messages)) {\n throw new \\Exception('Campos requeridos pelo banco, aparentam estar ausentes ' . $messages);\n }\n\n $codigo = Util::numberFormatGeral($this->getCodigoBanco(), 3)\n . $this->getMoeda()\n . Util::fatorVencimento($this->getDataVencimento())\n . Util::numberFormatGeral($this->getValor(), 10)\n . $this->getCampoLivre();\n\n $dv = CalculoDV::unicredCodigoBarra($codigo);\n return $this->campoCodigoBarras = substr($codigo, 0, 4) . $dv . substr($codigo, 4);\n }", "function Consulta_Informacion_Metas()\n {\n $sql=\"SELECT b.id,b.uid,year(b.fecha_inicio) AS ano, month(b.fecha_inicio) AS mes,b.no_dias,count(substr(b.fecha_inicio,1,7)) AS no_regs,\n sum(b.cantidad) AS total,a.name\n FROM crm_proyeccion as b LEFT JOIN users as a ON b.uid = a.uid\n WHERE b.active = 1 AND year(b.fecha_inicio) ='\".$this->ano_id.\"' AND b.gid='\".$this->gid.\"' \".$this->filtro.\"\n GROUP BY substr(b.fecha_inicio,1,7)\n ORDER BY substr(b.fecha_inicio,1,7)\";\n $res=$this->db->sql_query($sql) or die (\"Error en la consulta: \".$sql);\n if($this->db->sql_numrows($res) > 0)\n {\n while(list($id,$_uid,$ano,$mes,$no_dias,$no_reg,$cantidad,$name) = $this->db->sql_fetchrow($res))\n {\n $this->array_metas[$mes]= $cantidad;\n }\n }\n }", "public function possuiCalculoPorDiaDoMes() {\n return $this->lControleDiasNoMes;\n }", "public function ActualizarMesas()\n\t{\n\n\t\tself::SetNames();\n\t\tif(empty($_POST[\"codmesa\"]) or empty($_POST[\"codsala\"]) or empty($_POST[\"nombremesa\"]))\n\t\t{\n\t\t\techo \"1\";\n\t\t\texit;\n\t\t}\n\t\t$sql = \" select codsala, nombremesa from mesas where codmesa != ? and codsala = ? and nombremesa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_POST[\"codmesa\"], $_POST[\"codsala\"], $_POST[\"nombremesa\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n\t\t\t$sql = \" update mesas set \"\n\t\t\t.\" codsala = ?, \"\n\t\t\t.\" nombremesa = ?, \"\n\t\t\t.\" statusmesa = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codmesa = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $codsala);\n\t\t\t$stmt->bindParam(2, $nombremesa);\n\t\t $stmt->bindParam(3, $statusmesa);\n\t\t\t$stmt->bindParam(4, $codmesa);\n\n\t\t\t$codmesa = strip_tags($_POST[\"codmesa\"]);\n\t\t\t$codsala = strip_tags($_POST[\"codsala\"]);\n\t\t\t$nombremesa = strip_tags($_POST[\"nombremesa\"]);\n\t\t\t$statusmesa = strip_tags($_POST[\"statusmesa\"]);\n\t\t\t$stmt->execute();\n\n\t\techo \"<div class='alert alert-info'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<span class='fa fa-check-square-o'></span> LA MESA EN SALA DEL RESTAURANT FUE ACTUALIZADA EXITOSAMENTE\";\n\t\techo \"</div>\";\t\t\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"2\";\n\t\t\texit;\n\t\t}\n\t}", "public function getIdMembre()\n {\n return $this->idMembre;\n }", "function guardarCabecera($cabecera){\n\n\t\t$post['_put_movimientointerno'] = $cabecera;\n\t\tlog_message('DEBUG','#TRAZA|TRAZ-COMP-ALMACEN|MOVIMIENTODEPOSITOSRECEP|guardarCabecera($cabecera) $post: >> '.json_encode($post));\n\t\t$url = AJST.'/services/asp/ALMDataService/movimientoInterno';\n\t\t$aux = $this->rest->callAPI(\"PUT\", $url, $post);\n\t\t$aux =json_decode($aux[\"status\"]);\n\t\treturn $aux;\n\t}", "public function totCadastrosMes(){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT ifnull(count(*),0) as total FROM tbclientes a WHERE MONTH(a.data_cadastro) = Month(now());\";\n $rsclimes = $this->conexao->query($sql);\n $result = $rsclimes->fetch_array();\n $rstotclimes = $result['total'];\n\n return $rstotclimes;\n }", "public function getDiaMesAno()\n {\n return $this->diaMesAno;\n }", "protected function buscoAtributo($claveZp) {\n $retorno = '';\n foreach ($this->arrayMapeoCarac as $mapeo) {\n if ($mapeo['id_zpcarac'] == $claveZp) {\n $arrayPartes = explode('.', $mapeo['objeto']);\n if ($arrayPartes[0] == 'caracteristicas') {\n if ($arrayPartes[1] != '') {\n $carac = new CaracteristicaBSN($arrayPartes[1]);\n $retorno = $carac->getObjeto()->getTitulo();\n } else {\n $retorno = $this->textoAtributo($mapeo['atributos']);\n }\n } else {\n $retorno = $this->textoAtributo($mapeo['atributos']);\n }\n break;\n }\n }\n return $retorno;\n }", "public function setMes($iMes) {\n $this->iMes = $iMes;\n }", "public function getQuantidadeMesesDepreciados() {\n\n if (empty($this->iQuantidadeMesesDepreciado)) {\n\n if (!empty($this->iCodigoBem)) {\n\n $oDaoBensHistoricoCalculo = db_utils::getDao(\"benshistoricocalculobem\");\n $sWhereHistorico = \" t57_ativo is true and \";\n $sWhereHistorico .= \"t57_processado is true and \";\n $sWhereHistorico .= \"t58_bens = {$this->getCodigoBem()} \";\n $sCamposHistorico = \"t58_bens, t58_benstipodepreciacao\";\n $sSqlBensHistoricoCalculo = $oDaoBensHistoricoCalculo->sql_query_calculo(null,\n $sCamposHistorico,\n \"t57_datacalculo\",\n $sWhereHistorico);\n $rsBensHistoricoCalculo = $oDaoBensHistoricoCalculo->sql_record($sSqlBensHistoricoCalculo);\n $iTotalMeses = 0;\n $iTotalDepreciacoes = $oDaoBensHistoricoCalculo->numrows;\n for ($i = 0; $i < $iTotalDepreciacoes; $i++) {\n\n $oDadosCalculo = db_utils::fieldsMemory($rsBensHistoricoCalculo, $i);\n $iTotalMeses++;\n if ($oDadosCalculo->t58_benstipodepreciacao == 6) {\n $iTotalMeses = 0;\n }\n }\n }\n $this->iQuantidadeMesesDepreciados = $iTotalMeses;\n }\n\n return $this->iQuantidadeMesesDepreciados;\n }", "function getBloqueado() {\n return $this->bloqueado;\n }", "function insertarCuentaBancaria(){\n\t\t$this->procedimiento='tes.f_cuenta_bancaria_ime';\n\t\t$this->transaccion='TES_CTABAN_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('fecha_baja','fecha_baja','date');\n\t\t$this->setParametro('nro_cuenta','nro_cuenta','varchar');\n\t\t$this->setParametro('fecha_alta','fecha_alta','date');\n\t\t$this->setParametro('id_institucion','id_institucion','int4');\n\t\t$this->setParametro('id_moneda','id_moneda','int4');\n\t\t$this->setParametro('denominacion','denominacion','varchar');\n\t\t$this->setParametro('centro','centro','varchar');\n\t\t$this->setParametro('id_depto_lb','id_depto_lb','int4');\n\t\t\n\t\t$this->setParametro('id_finalidads','id_finalidads','varchar');\n\t\t\n\t\t\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function hola($valor){\n\t\t$data = $this->Facturar_model->buscar_mediciones_para_una_conexion($valor);\n\t\t\n\t\tvar_dump($data );\n\t}", "public function carga_cuentas_bancarias($sender,$param)\n {\n $cod_organizacion = usuario_actual('cod_organizacion');\n $id_banco=$this->drop_bancos->SelectedValue;\n $sql = \"select * from presupuesto.bancos_cuentas\n where (cod_organizacion = '$cod_organizacion') and (id_banco = '$id_banco')\";\n $datos = cargar_data($sql,$this);\n $this->DataGrid->Datasource = $datos;\n $this->DataGrid->dataBind();\n }" ]
[ "0.57665944", "0.55229163", "0.5513831", "0.5474009", "0.54590523", "0.5432926", "0.5420104", "0.53375906", "0.5332814", "0.5326102", "0.5289684", "0.5265873", "0.52597535", "0.5255795", "0.52419394", "0.5240704", "0.5232482", "0.52143496", "0.52034795", "0.51920176", "0.51901734", "0.5171436", "0.51690626", "0.51595074", "0.5158962", "0.5157149", "0.51435757", "0.51379734", "0.5132643", "0.512403" ]
0.7105792
0
Define o valor do atributo bMostraLinksSemana
public function setMostraLinksSemana($bMostraLinksSemana) { $this->bMostraLinksSemana = $bMostraLinksSemana; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setLinks($links) \r\n {\r\n\r\n $this->activity_list->setLinks($links); \r\n \t\t \r\n// \t\t echo print_r($this->linkValues,true);\t \r\n \t parent::setLinks($links);\r\n \r\n }", "function setLinks($link) \n {\n $this->links = $link;\n }", "public function setLink($link);", "public function setMostraNumerosSemana($bMostraNumerosSemana) {\n $this->bMostraNumerosSemana = $bMostraNumerosSemana;\n }", "protected function pakHrefAttr(): string\n {\n return \"href='{$this->link}'\";\n }", "public function linkAttributes()\n {\n return ['icon' => 'fa fa-code-fork'];\n }", "public function set_link($link) \n\t{\n\t\tif($this->version == RSS2 || $this->version == RSS1)\n\t\t{\n\t\t\t$this->add_element('link', $link);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->add_element('link','',array('href'=>$link));\n\t\t\t$this->add_element('id', zajlib_feed::uuid($link,'urn:uuid:'));\n\t\t} \n\t\t\n\t}", "public function getPhotoLinkMiniAttribute()\n {\n return $this->attributes['photo_link_mini'] = ($this->photo)?Storage::disk('public')->url($this->photo_mini):config('values.noPhotoMini');\n }", "function setLink($link) {\r\n $this->_link = $link;\r\n }", "function setLink($link) {\r\n $this->_link = $link;\r\n }", "public function setLink($link){\n\t\t$this->link = $link;\n\t}", "function UstawLinkRezygnacji($Link) {\n\t\t$this->LinkRezygnacji = $Link;\n\t}", "function setUrlLink(){\n if( $this->id == 0 ) return;\n $url = $this->aFields[\"url\"]->toString();\n if( $url == \"\" ) return;\n $url = strip_tags( preg_replace( \"/[\\\"']/\", \"\", $url ) );\n if( !$this->aFields[\"url\"]->editable ) $this->aFields[\"url\"]->display = false;\n $this->aFields[\"url_link\"]->display = true;\n $this->aFields[\"url_link\"]->value = \"<a href=\\\"\".$url.\"\\\">\".$url.\"</a>\";\n }", "public function uploadlink() {\n $defaults = array();\n\n $defaults[\"straat\"] = \"straatnaam of de naam van de buurt\";\n $defaults[\"huisnummer\"] = \"huisnummer\";\n $defaults[\"maker\"] = \"maker\";\n $defaults[\"personen\"] = \"namen\";\n $defaults[\"datum\"] = \"datum of indicatie\";\n $defaults[\"titel\"] = \"titel\";\n $defaults[\"naam\"] = \"Je naam\";\n $defaults[\"email\"] = \"Je e-mailadres\";\n $defaults[\"tags\"] = \"\";\n\n $this->set('defaults', $defaults);\n }", "public function setLinks($value)\n {\n return $this->setProperty(\"Links\", $value, true);\n }", "public function setMostraPerspectivaSemana($bMostraPerspectivaSemana) {\n $this->bMostraPerspectivaSemana = $bMostraPerspectivaSemana;\n }", "function getLink() {return $this->_link;}", "function getLink() {return $this->_link;}", "public function getLink(){\n return $this->link;\n }", "public function getLink():string;", "protected function setLinksBar()\n {\n $mysidia = Registry::get(\"mysidia\");\n $this->linksBar = new Paragraph;\n $linkTitle = new Comment(\"{$mysidia->user->username}'s Links:\");\n $linkTitle->setBold();\n $this->linksBar->add($linkTitle);\n \n $linksList = new LinksList(\"ul\");\n $this->setLinks($linksList);\n \n $this->linksBar->add($linksList);\n $this->setDivision($this->linksBar);\n }", "public function getLink() {}", "public function getBancoUrl()\t{\n\t\treturn 'https://geraboleto.sicoobnet.com.br/geradorBoleto/GerarBoleto.do';\n\t}", "function plugin_settings_link($links) { //插件页面 名为设置标签 的指向。\n\t\t\t$settings_link = '<a href=\"options-general.php?page=WP_Canvas_Best\">设置</a>'; //a标签url\n\t\t\tarray_unshift($links, $settings_link); // 将$settings_link 插入$links第一位\n\t\t\treturn $links;\n\t\t}", "function define_link(){\n\t\t\t$link = \"javascript:set_values(\";\n\t\t\t#print_r($this->column);\n\t\t\tfor($i=0;$i<count($this->column);$i++){\n\t\t\t\t$link .= \"'%$i',\";\t\t\t\t\n\t\t\t}\n\t\t\t$link = substr($link,0,strlen($link)-1);\n\t\t\t$link .= \")\";\n\t\t\treturn $link;\n\t\t}", "abstract public function links(): JsonApiParser\\Collections\\Links;", "function setFieldLinks2($fieldLinks2) {\n if ($fieldLinks2 !== ($oldFieldLinks2 = $this->fieldLinks2)) {\n if ($this->immutable) throw self::immutableException();\n if (is_array($fieldLinks2)) {\n if (!$fieldLinks2) throw new Ac_E_InvalidCall(\"\\$fieldLinks2 must not be empty\");\n $this->fieldLinksRev2 = array_flip($fieldLinks2);\n } elseif ($fieldLinks2 === false) {\n $this->fieldLinksRev2 = false;\n } else {\n throw Ac_E_InvalidCall::wrongType('fieldLinks2', $fieldLinks2, array('array', 'false'));\n }\n $this->destNNIdsRelation = false;\n $this->fieldLinks2 = $fieldLinks2;\n }\n }", "function minorite_menu_link__links(array $variables) {\n $element = $variables['element'];\n $options = $variables['element']['#original_link']['options'];\n return '<option value=\"' . url($element['#href']) . '\">' . $element['#title'] . \"</option>\\n\";\n}", "public function getSettingsLinks()\n {\n $links = array();\n\t\t\n\t\t$modulevars = ModUtil::getVar('Mediasharex');\n\n\t\tif (SecurityUtil::checkPermission('Mediasharex::', '::', ACCESS_ADMIN)) {\n $links[] = array('url' => ModUtil::url($this->name, 'admin', 'settings_general'), 'text' => $this->__('General settings'), 'class' => 'z-icon-es-confi');\n }\n\n if (SecurityUtil::checkPermission('Mediasharex::', '::', ACCESS_ADMIN)) {\n $links[] = array('url' => ModUtil::url($this->name, 'admin', 'settings_display'), 'text' => $this->__('Display'), 'class' => 'z-icon-es-displa');\n }\n\t\tif (SecurityUtil::checkPermission('Mediasharex::', '::', ACCESS_ADMIN)) {\n $links[] = array('url' => ModUtil::url($this->name, 'admin', 'settings_albums'), 'text' => $this->__('Albums'), 'class' => 'z-icon-es-displa');\n }\n \t\t\n if (SecurityUtil::checkPermission('Mediasharex::', '::', ACCESS_ADMIN)) {\n $links[] = array('url' => ModUtil::url($this->name, 'admin', 'settings_media'), 'text' => $this->__('Media'), 'class' => 'z-icon-es-displa');\n }\n\t\tif (SecurityUtil::checkPermission('Mediasharex::', '::', ACCESS_ADMIN)) {\n $links[] = array('url' => ModUtil::url($this->name, 'admin', 'settings_access'), 'text' => $this->__('Access'), 'class' => 'z-icon-es-displa');\n }\t\t\n\t\tif (SecurityUtil::checkPermission('Mediasharex::', '::', ACCESS_ADMIN)) {\n $links[] = array('url' => ModUtil::url($this->name, 'admin', 'settings_storage'), 'text' => $this->__('Storage'), 'class' => 'z-icon-es-displa');\n } \n\t\tif (SecurityUtil::checkPermission('Mediasharex::', '::', ACCESS_ADMIN)) {\n $links[] = array('url' => ModUtil::url($this->name, 'admin', 'settings_handlers'), 'text' => $this->__('Handlers'), 'class' => 'z-icon-es-displa');\n }\n \tif (SecurityUtil::checkPermission('Mediasharex::', '::', ACCESS_ADMIN)) {\n $links[] = array('url' => ModUtil::url($this->name, 'admin', 'settings_sources'), 'text' => $this->__('Sources'), 'class' => 'z-icon-es-displa');\n }\n \tif (SecurityUtil::checkPermission('Mediasharex::', '::', ACCESS_ADMIN)) {\n $links[] = array('url' => ModUtil::url($this->name, 'admin', 'settings_import'), 'text' => $this->__('Import'), 'class' => 'z-icon-es-displa');\n } \n\t\t\t\t\n return $links;\n }", "public function link($links)\n {\n $links['settings'] = sprintf(\n '<a href=\"%1$s\">%2$s</a>',\n admin_url(\"options-{$this->page}.php\"),\n esc_html__('Settings', 'simple-login-lockdown')\n );\n\n return $links;\n }" ]
[ "0.5711696", "0.56505364", "0.55113524", "0.5417439", "0.5282814", "0.5268027", "0.526792", "0.52406216", "0.52318764", "0.52318764", "0.5159135", "0.51465476", "0.5141731", "0.5137109", "0.5071575", "0.505625", "0.5044605", "0.5044605", "0.49842566", "0.4933276", "0.49265265", "0.49241138", "0.49113992", "0.49070668", "0.4890666", "0.48691192", "0.48665783", "0.48636398", "0.48473915", "0.48413333" ]
0.6181669
0
Define o valor do atributo bMostraNumerosSemana
public function setMostraNumerosSemana($bMostraNumerosSemana) { $this->bMostraNumerosSemana = $bMostraNumerosSemana; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNumeroAemInitiale() {\n return $this->numeroAemInitiale;\n }", "function getNumero() {\n return $this->numero;\n }", "function setNota_num($inota_num = '')\n {\n $this->inota_num = $inota_num;\n }", "function contaNumeroCadastros(){\n if ($GLOBALS['cadastros'] == null) {//se não tiver nenhum cadastro\n $GLOBALS['quantidadeCadastros'] = 0;//numero de pessoas cadastradas = 0\n }else{\n $GLOBALS['quantidadeCadastros'] = count($GLOBALS['cadastros']);//salva na variavel global quantidadeCadastros o número de cadastros\n }\n }", "public function getNumeroSem(): ?int {\n return $this->numeroSem;\n }", "public function getNossoNumero();", "public function getMontacargasNumserie()\n {\n\n return $this->montacargas_numserie;\n }", "function getSemanadoAno()\r\n {\r\n return Data_Calc::semanaDoAno($this->dia, $this->mes, $this->ano);\r\n }", "public function getNumero() {\n return $this->sNumero;\n }", "public function getNumero()\n {\n return $this->numero;\n }", "public function getNumero() {\n return $this->numero;\n }", "function setNota_max($inota_max = '')\n {\n $this->inota_max = $inota_max;\n }", "function setNota_max($inota_max = '')\n {\n $this->inota_max = $inota_max;\n }", "public function getMesNacimiento() {\n\t\treturn $this->mesNacimiento;\n\t}", "function getNota_num()\n {\n if (!isset($this->inota_num) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->inota_num;\n }", "function getNota_num()\n {\n if (!isset($this->inota_num) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->inota_num;\n }", "public function selecMaximoNumero2($empresa_id, $tipo_documento_id, $serie){\n $sql = \"SELECT MAX(CAST(numero AS UNSIGNED)) numero FROM comprobantes WHERE 1 = 1 AND empresa_id = $empresa_id AND tipo_documento_id = $tipo_documento_id AND serie = '\".$serie.\"'\";\n $query = $this->db->query($sql);\n $rowNumero = $query->row_array();\n\n if($rowNumero['numero'] == null){\n //BUSQUEDA DE NUMERO 12-01-2021\n $rsNumero = $this->db->from('ser_nums')\n ->where('empresa_id',$empresa_id)\n ->where('tipo_documento_id',$tipo_documento_id)\n ->where('serie',$serie)\n ->where('estado',ST_ACTIVO)\n ->get()\n ->row();\n $rowNumero['numero'] = ($rsNumero->numero == null) ? 1 : $rsNumero->numero;\n }else{\n $rowNumero['numero']++;\n }\n\n return $rowNumero;\n }", "function setNota_num($inota_num = '')\n {\n // adminto ',' como separador decimal.\n $inota_num = str_replace(\",\", \".\", $inota_num);\n $this->inota_num = $inota_num;\n }", "public function getNumero_chambre()\n{\nreturn $this->numero_chambre;\n}", "public function setNumeroSem(?int $numeroSem): HoraireTheorique {\n $this->numeroSem = $numeroSem;\n return $this;\n }", "public function valordelospasajesplus();", "public function getNUMEROINT()\r\n {\r\n return $this->NUMERO_INT;\r\n }", "public function setMontacargasNumserie($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->montacargas_numserie !== $v) {\n $this->montacargas_numserie = $v;\n $this->modifiedColumns[] = MontacargasPeer::MONTACARGAS_NUMSERIE;\n }\n\n\n return $this;\n }", "function get_nbre_conso(){\n\t\tglobal $bd;\n\t\t$req = $bd->query(\"SELECT SUM(nbre) as nbre FROM consommateur WHERE etat = 'present' \");\n\t\t$data = $req->fetch();\n\t\treturn $data['nbre'];\n\t}", "public function setNumero_chambre($numero_chambre)\n{\n$this->numero_chambre = $numero_chambre;\n\nreturn $this;\n}", "function getDatosNota_num()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'nota_num'));\n $oDatosCampo->setEtiqueta(_(\"nota num\"));\n return $oDatosCampo;\n }", "function getDatosNota_num()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'nota_num'));\n $oDatosCampo->setEtiqueta(_(\"nota num\"));\n return $oDatosCampo;\n }", "public function puestaACero() {\n $this -> horas = 0;\n $this -> minutos = 0;\n $this -> segundos = 0;\n }", "function setValorNota($nValorNota) {\n \n $this->nValorNota = $nValorNota;\n }", "public function getSemillero_id(){\n return $this->semillero_id;\n }" ]
[ "0.56343174", "0.56319416", "0.56262803", "0.56261873", "0.556691", "0.55277663", "0.54985994", "0.5434428", "0.5404708", "0.540444", "0.5399531", "0.53648704", "0.53648704", "0.53565127", "0.5350957", "0.5350957", "0.5343495", "0.53418344", "0.53158736", "0.529761", "0.5297334", "0.5277897", "0.5267535", "0.5255833", "0.52397513", "0.5229758", "0.5229758", "0.52143717", "0.52044356", "0.51907504" ]
0.67478967
0
find all account of current user
public function findAccount() { // get current user id $loginUser = $_SESSION["loginUser"]; $userId = $loginUser->getId(); // search accounts from database $accountList = $this->accountHandler->findAccount($userId); require_once ('view/UserHome.php'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findAccounts() {\n\t\t\n\t}", "public function getAccounts();", "function user_accounts() {\n $mysqli = $this->mysqli;\n $sql = \"SELECT `users`.`user_id`, `users`.`email_id`,`users`.`emp_id`, `employee`.`emp_name`,`employee`.`emp_type`,`employee`.`emp_cntct`,`employee`.`doj` FROM employee INNER JOIN users on `employee`.`emp_id`=`users`.`emp_id`\";\n $val = $mysqli->query($sql);\n return $val;\n }", "public static function getAllAccounts(){\n\t\t$stmt = Dbh::connect()->query(\"SELECT * FROM accounts\");\n\t\t$accounts = array();\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){\n $accounts[] = new Account($row['account_id'], $row['email'], $row['first_name'], $row['last_name'], $row['account_type'], $row['password']);\n }\n return $accounts;\n\t}", "public function findUsers();", "public function findUsers();", "public function getAccount();", "public function all_user()\n {\n $this->res->SetObject(RCD::SC, RCD::SC, FALSE, $this->db->get('user')->result());\n }", "function get_all_accounts() {\n\t\t$status = status();\n\t\t$command = \"\";\n\t\t\n\t\tif($status) {\n\t\t\tif($status === 2) {\n\t\t\t\t$command = \"SELECT username, first_name, last_name, admin FROM accounts;\";\n\t\t\t} else {\n\t\t\t\t$command = \"SELECT username, first_name, last_name FROM accounts;\";\n\t\t\t}\n\t\t} else {\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t$connection = new mysqli(IP, USER, PASSWORD, DATABASE);\n\t\tif ($connection->connect_errno)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\t\n\t\t$results = $connection->query($command);\n\t\t$connection->close();\n\t\t\t\n\t\t$users = array();\n\t\t\t\n\t\tfor($i = 0; $i < $results->num_rows; $i++)\n\t\t{\n\t\t\t$results->data_seek($i);\n\t\t\t$users[$i] = $results->fetch_assoc();\n\t\t}\n\t\treturn $users;\n\t}", "public function allUser(){\n\n\t\t\t$data=$this->all('oops');\n\t\t\treturn $data;\n\t\t}", "function user_details() {\r\n\t\t\t$query = $this->pdo->prepare(\"select * from user_account\");\r\n\t\t\t$query->execute();\r\n\t\t\treturn $query->fetchAll();\r\n\t\t}", "public function getAccounts()\n {\n }", "public function allUsers()\n {\n // $sql = 'SELECT * FROM '.$db_name;\n return $this->queryAll();\n }", "public static function accounts() {\n\t\t\treturn self::get('accounts');\n\t\t}", "public function findUsers(): iterable;", "public static function allUser()\n {\n $self = new self();\n\n $sql = \"SELECT * FROM user\";\n\n $result = $self->db->query($sql);\n\n $result = $result->fetchAll();\n\n return $result;\n }", "public function getAllActiveUsers()\n {\n $connection = Db::getConnection();\n\n $userDataRecords = $connection->fetchAll(\n \"SELECT id, name, email \n FROM {$this->tableName} \n WHERE active = ?\", \n [1]\n );\n \n $userObjects = [];\n \n foreach($userDataRecords as $userData) {\n $userObjects[] = $this->initializeObject($userData);\n }\n\n return $userObjects;\n }", "protected function queryUserAll()\n {\n $queryBuilder = $this->db->createQueryBuilder();\n\n return $queryBuilder->select('*')\n ->from('User', 'u')\n ->innerJoin('u', 'Role','r','u.Role_ID = r.Role_ID' );\n }", "public function listAccounts()\n {\n return $this->execute('listaccts', []);\n }", "public function getUsers();", "public function getUsers();", "public function getUsers();", "public function index()\n {\n return $this->user->all();\n }", "public function allupgraders(){\n // SQL statement\n $sql = \"SELECT * FROM user WHERE special = 1 AND (role = 'account' OR role = 'administrator') \";\n $result = $this->con->query($sql);\n\n // check if there is a user\n $count = $result->num_rows;\n if ($count != 0) {\n while ($row = $result->fetch_assoc()){\n $array[] = $row;\n }\n return $array;\n }\n }", "public static function find_all(){\n\n return static::find_by_query(\"SELECT * FROM \" . static::$table_users);\n\n }", "function get_all_user($koneksi){\n\t\t$query = \"SELECT * FROM v_user\";\n\n\t\t$statement = $koneksi->prepare($query);\n\t\t$statement->execute();\n\t\t$result = $statement->fetchAll();\n\n\t\treturn $result;\n\t}", "public function getAllUser(){\n $users = $this->bdd->query('SELECT * FROM users');\n $users->execute();\n\t\treturn $users->fetchALL(\\PDO::FETCH_ASSOC);\n }", "public function getAllUsers(){\n\t\treturn $this->user;\n\t}", "public function allForUser($userId);", "public function allForUser($userId);" ]
[ "0.7289068", "0.7103661", "0.6822665", "0.68043005", "0.6781049", "0.6781049", "0.6780329", "0.6709087", "0.6707635", "0.668833", "0.66652244", "0.66408104", "0.65831184", "0.657737", "0.65223885", "0.65126747", "0.65115744", "0.6507559", "0.6499972", "0.64794546", "0.64794546", "0.64794546", "0.6478516", "0.647195", "0.6464768", "0.64577603", "0.64449674", "0.6443377", "0.6442651", "0.6442651" ]
0.73797363
0
This test checks if call of a method not implemented in helper is correctly passed via WebAPI client to soapClient (extended by WebAPI request param just one is tested here, as all required params are tested in ClientTest)
public function testDirectWebapiCallFromSoapClient() { $this->soapClient->expects($this->once()) ->method('doQuerySysStatus') ->willReturn((object)['verKey' => 'someVersionKey']); $this->soapClient->expects($this->once()) ->method('doLogin') ->willReturn((object)['sessionHandlePart' => 'foo', 'userId' => 'bar']); $this->soapClient->expects($this->once()) ->method('doSomethingNotImplementedInHelper') ->with( $this->callback(function($params){ return array_key_exists('param1', $params) && array_key_exists('webapiKey', $params) && $params['param1'] == 1337 && $params['webapiKey'] == 'someApiKey'; }) ) ->willReturn(42); $apiClient = new Client($this->config, $this->soapClient); $helper = new Helper($apiClient); $result = $helper->doSomethingNotImplementedInHelper([ 'param1' => 1337 ]); $this->assertSame(42, $result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function invalid_calls_are_not_proxied()\n {\n // Arrange\n $method = 'nonExistingHttpVerb';\n $url = 'users/me';\n $client = Mockery::mock('GuzzleHttp\\Client');\n $service = (new Service)->setClient($client);\n\n // Act\n $result = $service->$method($url);\n\n // Assert\n }", "public function testValidRequest()\n {\n $this->client->{$this->method}(\n $this->endpoint,\n $this->getValidData(),\n $this->requestHeaders\n );\n $this->assertResponseCode(200, 299);\n }", "public function testPrepareApiRequest()\n {\n /** @var array $billingData */\n $billingData = [\n 'firstname' => 'Someone',\n 'lastname' => 'Somebody',\n 'telephone' => '555-555-5555',\n 'street' => '630 Allendale Rd',\n 'city' => 'King of Prussia',\n 'region_code' => 'PA',\n 'country' => 'US',\n 'postcode' => '19604',\n ];\n /** @var Mage_Sales_Model_Order_Address $shippingAddress */\n $shippingAddress = Mage::getModel('sales/order_address', ['id' => 1]);\n /** @var Mage_Sales_Model_Order_Address $billingAddress */\n $billingAddress = Mage::getModel('sales/order_address', array_merge($billingData, ['id' => 2]));\n /** @var Mage_Sales_Model_Order $order */\n $order = Mage::getModel('sales/order', [\n 'is_virtual' => true\n ]);\n $order->setShippingAddress($shippingAddress)\n ->setBillingAddress($billingAddress);\n /** @var Mage_Sales_Model_Order_Payment $orderPayment */\n $orderPayment = Mage::getModel('sales/order_payment', ['cc_exp_year' => 2023, 'cc_exp_month' => 8])->setOrder($order);\n\n $mockMethods = [\n 'setIsEncrypted' => null,\n 'setRequestId' => null,\n 'setOrderId' => null,\n 'setPanIsToken' => null,\n 'setCardNumber' => null,\n 'setExpirationDate' => null,\n 'setCardSecurityCode' => null,\n 'setAmount' => null,\n 'setCurrencyCode' => null,\n 'setEmail' => null,\n 'setIp' => null,\n 'setBillingFirstName' => $billingData['firstname'],\n 'setBillingLastName' => $billingData['lastname'],\n 'setBillingPhone' => $billingData['telephone'],\n 'setBillingLines' => $billingData['street'],\n 'setBillingCity' => $billingData['city'],\n 'setBillingMainDivision' => $billingData['region_code'],\n 'setBillingCountryCode' => $billingData['country'],\n 'setBillingPostalCode' => $billingData['postcode'],\n // Expecting shipping setter methods for the request payload to be\n // fill-out with billing data.\n 'setShipToFirstName' => $billingData['firstname'],\n 'setShipToLastName' => $billingData['lastname'],\n 'setShipToPhone' => $billingData['telephone'],\n 'setShipToLines' => $billingData['street'],\n 'setShipToCity' => $billingData['city'],\n 'setShipToMainDivision' => $billingData['region_code'],\n 'setShipToCountryCode' => $billingData['country'],\n 'setShipToPostalCode' => $billingData['postcode'],\n ];\n /** @var ICreditCardAuthRequest $request **/\n $request = $this->getMockForAbstractClass('\\eBayEnterprise\\RetailOrderManagement\\Payload\\Payment\\ICreditCardAuthRequest', [], '', true, true, true, array_keys($mockMethods));\n foreach ($mockMethods as $method => $with) {\n if (is_null($with)) {\n $request->expects($this->once())\n ->method($method)\n ->will($this->returnSelf());\n } else {\n // Using \"with\" only when there's an actual value\n $request->expects($this->once())\n ->method($method)\n ->with($this->identicalTo($with))\n ->will($this->returnSelf());\n }\n }\n /** @var IBidirectionalApi $api */\n $api = $this->getMockForAbstractClass('\\eBayEnterprise\\RetailOrderManagement\\Api\\IBidirectionalApi', [], '', true, true, true, ['getRequestBody']);\n $api->expects($this->once())\n ->method('getRequestBody')\n ->will($this->returnValue($request));\n\n /** @var Radial_CreditCard_Model_Method_Ccpayment $payment */\n $payment = Mage::getModel('radial_creditcard/method_ccpayment');\n\n $this->assertSame($payment, EcomDev_Utils_Reflection::invokeRestrictedMethod($payment, '_prepareAuthRequest', [$api, $orderPayment]));\n }", "public function testGetBookingsNoParams(){\t\n\t\t$this->mockSoap = $this->getMockBuilder( 'airshipwebservices\\soapapi\\AirshipBooking' )\n\t\t\t\t\t\t ->setMethods( array('soapCall', \n\t\t\t\t\t\t\t\t\t\t\t'prepareInput',\n\t\t\t\t\t\t\t\t\t\t\t'validateResponse') )\n\t\t\t\t\t\t ->getMock();\n\n\t\t$params = array();\n\t\t$no_params_error = new stdClass();\n\t\t$no_params_error->status = false;\n\t\t$no_params_error->error_number = 500;\n\t\t$no_params_error->error_message = 'No search params were sent to booking request. Stopped to prevent all bookings being returned';\n\t\t$no_params_error->error_customer = 'An error has occured';\n\n\t\t$this->assertEquals( $no_params_error, $this->mockSoap->getBookings( $params ) );\n\t}", "public function testSimpleCall()\n {\n Soap::fake();\n Soap::assertNothingSent();\n $response = Soap::baseWsdl('https://laravel-soap.wsdl')\n ->call('Get_Users');\n self::assertTrue($response->ok());\n Soap::assertSent(function (Request $request) {\n return $request->action() === 'Get_Users';\n });\n Soap::assertNotSent(function (Request $request) {\n return $request->action() === 'Get_User';\n });\n Soap::assertActionCalled('Get_Users');\n }", "public function testImproperApiMethod()\n {\n $this->testedDao->fetchImproperDataName();\n }", "public function testGetServiceCall()\n {\n $this->_markTestAsRestOnly();\n $itemId = 1;\n $name = 'Test';\n $serviceInfo = [\n 'rest' => [\n 'resourcePath' => '/V1/testmodule4/' . $itemId,\n 'httpMethod' => \\Magento\\Webapi\\Model\\Rest\\Config::HTTP_METHOD_GET,\n ],\n ];\n $item = $this->_webApiCall($serviceInfo, [], null, null, $this->integration);\n $this->assertEquals($itemId, $item['entity_id'], 'id field returned incorrectly');\n $this->assertEquals($name, $item['name'], 'name field returned incorrectly');\n }", "public function test_send_returnsSelf_ifNoService()\n\t{\n\t\t$request = new Request\\Get('http://x.x.x.x');\n\t\t\n\t\t$client = new Client();\n\t\t\n\t\t$this->assertSame($client, $client->send($request));\n\t\t\n\t\treturn;\t\n\t}", "abstract public function testInvokeOnExistingModelWithoutTemplateIdent();", "public function testIfRequestWithoutAuthenticationWorks()\n {\n $invoker = self::getPrivateMethod('rawCall');\n $result = $invoker->invokeArgs($this->api, array(\n 'GET',\n '/conversiontypes',\n array(\n 'inputformat' => 'pdf',\n 'outputformat' => 'pdf',\n ),\n false,\n ));\n $this->assertNotEmpty($result);\n }", "public function testReturnsFalseIfNotExistingEndpointRequested()\n {\n $result = $this->apiCaller->retrieve('some-incorrect-endpoint');\n $this->assertFalse($result);\n }", "public function testGetEnrollmentRequest()\n {\n }", "public function testReportsBouncedGet()\n {\n }", "public function testGetMethodWithoutID()\n {\n $api = new Mollie('test_testapikey');\n $api->method()->get();\n }", "public function testMethodReturnsRightStuff()\n\t{\n\t\t// Defaults method to CLI now.\n\t\t$this->assertEquals('cli', $this->request->getMethod());\n\t\t$this->assertEquals('CLI', $this->request->getMethod(true));\n\t}", "function checkAPICall()\r\n{\r\n $request = [];\r\n $request['method'] = $_SERVER['REQUEST_METHOD'];\r\n $request['url'] = rtrim($_SERVER['REQUEST_URI'], '/');\r\n \r\n $trimmed_url = ltrim($_SERVER['REQUEST_URI'], '/');\r\n $url_parts = explode('/', $trimmed_url);\r\n\r\n $request['url_parts'] = $url_parts;\r\n\r\n if (in_array($_SERVER['REQUEST_METHOD'], ['POST', 'PUT'])) {\r\n $request['body'] = json_decode(file_get_contents('php://input'), true);\r\n }\r\n \r\n if ($url_parts[0] === 'api') {\r\n array_shift($url_parts);\r\n if (count($url_parts) >= 1) {\r\n $api_function_name = array_shift($url_parts);\r\n $params = $url_parts;\r\n $request['params'] = $params;\r\n array_unshift($params, $request);\r\n\r\n $request_uri = $request['method'] . ' /' . $api_function_name;\r\n if (array_key_exists($request_uri, API_FN)) {\r\n call_user_func_array(API_FN[$request_uri], $params);\r\n } else {\r\n http_response_code(405);\r\n echo json_encode([\"message\" => \"Method Not Allowed\"]);\r\n }\r\n } else {\r\n http_response_code(405);\r\n echo json_encode([\"message\" => \"Method Not Allowed\"]);\r\n }\r\n die();\r\n }\r\n}", "public function testHandlersHandlerTypeCitiesCityIdOfficesGet()\n {\n }", "abstract public function testInvokeOnExistingModelWithBadTemplateIdent();", "public function testInboundDocumentGet()\n {\n }", "public function test_api_path_validation_1()\n {\n $this->expectExceptionMessageMatches('/No path is provided/');\n //\\Kenashkov\\BillyDk\\BillyDk::validate_api_path('');//the method is no longer public\n new class() extends \\Kenashkov\\BillyDk\\BillyDk {\n public function __construct()\n {\n self::validate_api_path('');\n }\n };\n }", "public function testMagicMethodThrowsException()\n {\n $grid = new Grid($this->app);\n $stub = new FormBuilder($grid);\n $stub->someInvalidRequest;\n }", "public function testValidateWithoutSenderCodeExceptions()\n {\n $invoice = new Invoice();\n $invoice->setDescription('TEST Zkaz');\n $invoice->setRecipientName('Test');\n $invoice->setMobilePhone('+79274269594');\n\n $invoice->setPostamatNumber('5602-009');\n $invoice->setEmail('[email protected]');\n $invoice->setGettingType('sc');\n\n $invoice->setSum(0); // IMPORTANT\n $invoice->setPrepaymentSum(10);\n $invoice->setDeliveryMode('standard');\n\n $packageSize = new PackageSize(20, 20, 20);\n $invoice->setPackageSize($packageSize);\n\n $product = new Product('number 234', 'Test', 2, 100);\n\n $invoice->setProducts([$product]);\n $this->expectException(\\PickPointSdk\\Exceptions\\ValidateException::class);\n\n $response = $this->client->createShipment($invoice);\n\n }", "public function test_getDuplicateLegacyLowstockContactById() {\n\n }", "public function testAuthenticationsInweboIdGet()\n {\n }", "public function test_getLegacyLowstockContactByFilter() {\n\n }", "abstract public function testInvokeOnExistingModelWithMissingTemplateController();", "public function testClassname()\n {\n $input = Request::all();\n\n //path params validation\n\n\n //not path params validation\n if (!isset($input['client'])) {\n throw new \\InvalidArgumentException('Missing the required parameter $client when calling testClassname');\n }\n $client = $input['client'];\n\n\n return response('How about implementing testClassname as a patch method ?');\n }", "public function createInternalRequestClient();", "public function testDeleteServiceData()\n {\n\n }", "public function test_addLegacyLowstockContact() {\n\n }" ]
[ "0.59928775", "0.5964218", "0.591617", "0.56776655", "0.5676565", "0.55722433", "0.55510557", "0.5529052", "0.5516021", "0.55062884", "0.5505545", "0.55035347", "0.55011153", "0.54859686", "0.5447597", "0.54422486", "0.543645", "0.54330105", "0.54174197", "0.5413029", "0.54082716", "0.5399488", "0.539505", "0.5377476", "0.5373833", "0.5367131", "0.53617656", "0.5357134", "0.5355876", "0.53539383" ]
0.76072216
0
Shortcode to render all custom type products Way to use > [carolinaspa_products number=int]
function carolinaspa_products_shortcode($products){ if (empty($products['number'])){ $numberOfProducts = 10; }else{ $numberOfProducts = $products['number']; } $args = array( 'posts_per_page' => $numberOfProducts, 'post_type' => 'products_post_type', 'orderby' => 'date', 'order' => 'ASC', ); $products = new WP_Query($args); echo '<div class="card-columns w-100">'; while ($products->have_posts()): $products->the_post();?> <div class="card"> <a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail('product-thumbnail', array('class' => 'card-img-top img-fluid'));?> </a> <div class="card-body"> <h3 class="card-title text-center text-uppercase"><?php the_title(); ?></h3> <p class="card-text text-uppercase"><?php the_field('descripcion_corta'); ?></p> <p class="lead text-center product-pricing mb-0">$<?php the_field('precio'); ?></p> </div> </div> <?php endwhile; wp_reset_postdata(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function all_products()\n\t{\n\t\t$data['product_list']=$this->tbl_product->get_all_product();\n\t\t$data['page']='All Products';\n\t\t$view = 'Admin/collection/admin_all_product_list';\n\t\techo Modules::run('Template/admin_template', $view, $data);\t\n\t}", "public function product()\n {\n $titlePage = \"Thêm Loại Sản Phẩm\";\n $types = Type::where('level', Type::PRODUCT)->orderBy('id', 'DESC')->paginate(10);\n return view('add.type_product',compact('titlePage', 'types'));\n }", "function twentytwelve_store_on_sale_products() {\n if ( is_woocommerce_activated() ) {\n $args = apply_filters( 'twentytwelve_store_on_sale_products_args', array(\n 'limit' => 3,\n 'columns' => 3,\n 'title' => __( 'On Sale', 'twentytwelve-store' ),\n ) );\n ?>\n <article class=\"entry-meta\">\n <div class=\"entry-header\">\n <h2 class=\"entry-title\"><?php echo wp_kses_post( $args['title'] ); ?></h2>\n </div>\n <div class=\"entry-content\">\n <?php echo twentytwelve_store_do_shortcode( 'sale_products', array(\n 'per_page' => intval( $args['limit'] ),\n 'columns' => intval( $args['columns'] ),\n ) ); ?>\n </div>\n </article>\n <?php\n }\n}", "public function index()\n {\n $products = Product::productWithCategoriesTags()->get(); // scope utiliser dans model Product\n //$products = Product::withCount('category')->with('category.type')->get();\n return view('backend.products.index',compact('products'));\n }", "public function index()\n\t{\n\t\t// $product_types = $this->product_type->all();\n\t\t$product_types = ProductType::paginate(50);\n\n\t\treturn View::make('scaffolds.product_types.index', compact('product_types'));\n\t}", "public function show( $products)\n { \n // var_dump($products);die;\n \n }", "function setwood_on_sale_products( $args ) {\n\n if ( is_woocommerce_activated() ) {\n\n $args = apply_filters( 'setwood_on_sale_products_args', array(\n 'limit' => 4,\n 'columns' => 4,\n 'title' => __( 'On Sale', 'setwood' ),\n ) );\n\n echo '<section class=\"setwood-product-section setwood-on-sale-products\">';\n\n do_action( 'setwood_homepage_before_on_sale_products' );\n\n echo '<h2 class=\"section-title\">' . wp_kses_post( $args['title'] ) . '</h2>';\n\n do_action( 'setwood_homepage_after_on_sale_products_title' );\n\n echo setwood_do_shortcode( 'sale_products', array(\n 'per_page' => intval( $args['limit'] ),\n 'columns' => intval( $args['columns'] ),\n ) );\n\n do_action( 'setwood_homepage_after_on_sale_products' );\n\n echo '</section>';\n }\n }", "public function productsAction()\n {\n $this->_initCoursedoc();\n $this->loadLayout();\n $this->getLayout()->getBlock('coursedoc.edit.tab.product')\n ->setCoursedocProducts($this->getRequest()->getPost('coursedoc_products', null));\n $this->renderLayout();\n }", "public function index(){\n\t\t\n\t\t//\tview separate elements will be loaded into\n\t\t$aggregated_view = 'product/product_index';\n\t\t\n\t\t//\tcollect separate elements\n\t\t$data['product_list'] = $this->productList(TRUE);\n\t\t$data['controls'] = $this->techniart->loadControls($aggregated_view);\n\t\t$data['content'] = $this->load->view($aggregated_view, $data, TRUE);\n\t\t$data['js'] = array('product_index.js');\n\t\t$data['title'] = 'Products';\n\t\t\n\t\t//\tload main template\n\t\t$this->techniart->load( $data );\n\t}", "public function displayAllProducts()\n {\n return $this->paginate(['category', 'subcategory', 'brand', 'reviews'], false, 12);\n }", "function dustrial_loop_shop_per_page( $products ) {\n if( function_exists( 'dustrial_framework_init' ) ) {\n $shop_posts_per_page = dustrial_get_option('shop_posts_per_page');\n if (!empty($shop_posts_per_page)) {\n $shop_posts_per_page = $shop_posts_per_page;\n } else {\n $shop_posts_per_page = '8';\n }\n } else {\n $shop_posts_per_page = '8';\n }\n $products = $shop_posts_per_page;\n return $products;\n}", "function Show_NomoreProducts()\n\t\t{\n\t\t\tglobal $Captions_arr;\n\t\t\t$Captions_arr['SHOP_DETAILS'] \t= getCaptions('SHOP_DETAILS');\n\t\t?>\n\t\t\t<div class=\"nomoreproducts\"><?php echo $Captions_arr['SHOP_DETAILS']['NOMORE_PROD_MSG']?></div>\n\t\t\t \t\n\t\t<?php\t\n\t\t}", "function product()\n {\n if (($data['logedUser'] = $this->_admin_pages()))\n { \n \n $product['content'] = Modules::run('product/_index'); \n \n $data['header'] = '';\n $data['titelHeader'] = $this->lang->line('product');\n $data['content'] = Modules::run('ajaxme/ajaxmeAdminProduct',$product);\n \n \n $this->load->view('general',$data);\n \n }\n }", "function woo_bundles_loop_price_9() {\n\t\tglobal $product;\n\n\t\tif ( $product->is_type( 'bundle' ) && $product->is_priced_per_product() )\n\t\t\t$product->microdata_display = true;\n\t}", "function kms_pands_products_render($subtype, $conf, $args, $contexts) {\n $form = drupal_get_form('kms_pands_product_list_form');\n $block = new stdClass();\n $block->content = drupal_render($form);\n return $block;\n}", "function create_picontent_shortcode($atts) {\n\t// Attributes\n\t$atts = shortcode_atts(\n\t\tarray(\n\t\t\t'ids' => '',\n\t\t),\n\t\t$atts,\n\t\t'pi_content'\n\t);\n\n\t$ids = array_filter( explode(',', $atts['ids'] ) );\n $the_query = new WP_Query( array( 'post_type' => 'product', 'post__in' => $ids ) );\n\n $output = '';\n\n if ( $the_query->have_posts() ) {\n $output .= '<ul class=\"pi-content-products\">';\n while ( $the_query->have_posts() ) {\n $the_query->the_post();\n $output .= '<li><a href=\"'. get_permalink() .'\" title=\"'.the_title_attribute( 'echo=0' ).'\" rel=\"bookmark\">';\n $output .= get_the_post_thumbnail( $post_id, array(100, 100), array( 'class' => 'alignleft' ) );\n $output .= get_the_title();\n $rprice = get_post_meta( get_the_ID(), '_regular_price', true );\n $sprice = get_post_meta( get_the_ID(), '_sale_price', true );\n\n $html_price = ($sprice!=='') ? '<del>'.wc_price($rprice).'</del>'.wc_price($sprice) : wc_price($rprice);\n\n $output .= '<span class=\"pi-content-price\">'.$html_price.'</span>';\n $output .= '</a></li>';\n }\n $output .= '</ul>';\n } else {\n $output .= 'no posts found';\n }\n\n wp_reset_postdata();\n\n return $output;\n\n}", "public function index()\n {\n $products = Product::with(['translate'=>function ($q) {\n $q->where('code','hy')->where('type',config('type.products'));\n } ])->paginate(10);\n return view('admin.products.index')->with('products',$products);\n }", "public function index()\n {\n $products = ['Produto 1', 'Produto 2', 'Produto 3'];\n \n return $products;\n }", "public function index()\n {\n $products = ProductType::paginate();\n return view('webshop.productList', compact('products'));\n }", "public function actionIndex() {\n $products = (new ProductRepository())->getLimit(8);\n echo $this->render(\"site/index\", ['products' => $products]);\n }", "public function index()\n {\n $items = Product::all();\n\n return view('shop::product.index', get_defined_vars());\n }", "public function getIndex()\n {\n\t\t\n\n $products = $this->product->getExecuteFormSearch();\n $products->load('brand','variants','styleTypes');\n\n\t\t$this->theme->setTitle('Variant Management');\n\n\t\t$view_data = compact('products');\n return $this->theme->of('variants.index', $view_data)->render();\n }", "function dcs_dropship_product_page_shortcode($atts, $content=null)\r\n{\r\n\t$pageNumber = 1;\r\n\tif( isset($_GET['pageNumber']) ) \r\n\t{\r\n\t\t$pageNumber = $_GET['pageNumber'];\r\n\t}\r\n\r\n\t$category = \"all\";\r\n\tif( isset($_GET['category']) )\r\n\t{\r\n\t\t$category = $_GET['category'];\r\n\t}\r\n\r\n\t$searchTerms = \"\";\r\n\tif( isset($_GET['searchTerms']) )\r\n\t{\r\n\t\t$searchTerms = $_GET['searchTerms'];\r\n\t}\r\n\r\n\t$retval = dcs_dropship_product_page($pageNumber, $category, $searchTerms);\r\n\r\n\treturn $retval;\r\n}", "public function index()\n {\n $producttype = ProductType::paginate(5);\n return view('product_type.index', compact('producttype'));\n }", "public function htheme_top_ten(){\r\n\r\n\t\t//SETUP VC MAP\r\n\t\tvc_map(\r\n\t\t\tarray(\r\n\t\t\t\t\"name\" => esc_html__( \"Product Promotions\", \"js_composer\" ),\r\n\t\t\t\t\"base\" => \"htheme_topten_slug\",\r\n\t\t\t\t\"class\" => \"\",\r\n\t\t\t\t'icon' => 'htheme_topten_icon',\r\n\t\t\t\t\"category\" => esc_html__( \"WooCommerce\", \"js_composer\"),\r\n\t\t\t\t'description' => esc_html__( \"Add a promo slider to your content.\", \"js_composer\" ),\r\n\t\t\t\t\"params\" => array(\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'type' => 'autocomplete',\r\n\t\t\t\t\t\t'heading' => esc_html__( 'List of products', 'js_composer' ),\r\n\t\t\t\t\t\t'param_name' => 'htheme_topten_ids',\r\n\t\t\t\t\t\t'settings' => array(\r\n\t\t\t\t\t\t\t'multiple' => true,\r\n\t\t\t\t\t\t\t'sortable' => true,\r\n\t\t\t\t\t\t\t'values' => $this->htheme_get_product_autocomplete(),\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'save_always' => true,\r\n\t\t\t\t\t\t'description' => esc_html__( 'Add a few products to create a top ten layout.', 'js_composer' ),\r\n\t\t\t\t\t),\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t}", "public function actionIndex()\n {\n $this->setMeta('E-SHOPER');\n\n $query = Product::find();\n $countQuery = clone $query;\n $pages = new Pagination(['totalCount' => $countQuery->count(), 'pageSize' => 6, 'forcePageParam' => false, 'pageSizeParam' => false]);\n $hits = $query->offset($pages->offset)\n ->limit($pages->limit)\n ->all();\n\n return $this->render('index', compact('hits', 'pages'));\n }", "public function listProducts()\n \t{\n \t\t$data = LemonService::listProducts();\n\n \t\treturn View::make('displayProducts')->with('data',$data);\n\n\n\n \t}", "public function getProductsFromType($type) {\n\n // Get product Type\n $productType = ProductType::findOrFail($type);\n \n // Get product from type\n $products = $productType->products()->paginate(8);\n\n // Get first category of product\n $category = $productType->categories->first();\n\n // Manipulate product\n $products->map(function ($product) {\n $product->payment = number_format((float)$product->payment, 2, '.', '');\n \n return $product;\n });;\n\n\n \n\n return view('frontoffice.pages.products', ['products' => $products, 'type' => $productType->name, 'category' => $category]);\n }", "public function index()\n {\n $products=Productvariation::where(['deleted'=>0])->paginate(5);\n return view('productvariations',compact('products'))->with('no', 1);\n }", "public function all_products()\n\t{\n\t\t$data['product_list']=$this->tbl_product->get_all_product();\n\t\t$data['page']='All Products';\n\t\tif (!$this->input->is_ajax_request()) {\n\t\t\t$view = 'admin/collection/admin_all_product_list';\n\t\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t\t}else{\n\n\t\t}\n\t\t\n\t}" ]
[ "0.6414306", "0.6406778", "0.6236633", "0.6203151", "0.6175119", "0.61744", "0.61736166", "0.61659837", "0.613798", "0.61303186", "0.6126463", "0.61244017", "0.6111681", "0.6101974", "0.6100486", "0.6069424", "0.6068004", "0.60515684", "0.60385805", "0.60376984", "0.6035192", "0.602332", "0.60171807", "0.6012304", "0.6000742", "0.5992899", "0.5979705", "0.5974565", "0.5970719", "0.59690815" ]
0.68601114
0
Check if request should be prerendered.
protected function shouldPrerender(Request $request) { $userAgent = strtolower($request->server->get('HTTP_USER_AGENT')); $bufferAgent = $request->server->get('X-BUFFERBOT'); $shouldPrerender = false; if ( ! $userAgent) return false; if ( ! $request->isMethod('GET')) return false; // prerender if _escaped_fragment_ is in the query string if ($request->query->has('_escaped_fragment_')) $shouldPrerender = true; // prerender if a crawler is detected foreach ($this->crawlerUserAgents as $crawlerUserAgent) { if (str_contains($userAgent, strtolower($crawlerUserAgent))) { $shouldPrerender = true; } } if ($bufferAgent) $shouldPrerender = true; return $shouldPrerender; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _shouldRender()\n {\n return (!$this->getFrontController()->getParam('noViewRenderer')\n && !$this->_neverRender\n && !$this->_noRender\n && (null !== $this->_actionController)\n && $this->getRequest()->isDispatched()\n && !$this->getResponse()->isRedirect()\n );\n }", "public function is_render_partials_request()\n {\n }", "public function shouldCacheRequest (Request $request): bool {\n\t\tif ($request->ajax()) {\n\t\t\treturn false;\n\t\t}\n\t\tif ($this->isRunningInConsole()) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $request->isMethod('get');\n\t}", "public function isRendering()\n {\n return $this->_is_rendering;\n }", "protected function shouldRender()\n {\n return true;\n }", "public function shouldRender()\n {\n if ($this->totalPages > 1) {\n \n return true;\n }\n \n return false;\n }", "protected function requestIsConditional()\n {\n return $this->getCurrentRoute()->requestIsConditional();\n }", "public function should_render() {\n\t\t\t\treturn is_singular();\n\t\t\t}", "public function isIntended()\n {\n return $this->isGet() || $this->isPost();\n }", "private function not_page_reload() {\n\n\t\tif ( isset( $_SERVER['HTTP_REFERER'] ) ) {\n\n\t\t\t// return portion before query string\n\t\t\t$request_uri = str_replace( strstr( $_SERVER['REQUEST_URI'], '?' ), '', $_SERVER['REQUEST_URI'] );\n\n\t\t\tif ( stripos( $_SERVER['HTTP_REFERER'], $request_uri ) === false )\n\t\t\t\treturn true;\n\t\t}\n\n\t\treturn true;\n\t}", "public function hasRequest()\n {\n return $this->request ? true : false;\n }", "private function isFrontEndRequest() {\n\t\treturn ! \\is_admin();\n\t}", "static function is_requested()\n {\n $retval = FALSE;\n if (self::is_requested_page()) {\n $retval = self::is_requested_page();\n } elseif (self::is_requested_post_type()) {\n $retval = self::is_requested_post_type();\n }\n return apply_filters('is_ngg_admin_page', $retval);\n }", "public function shouldRender(): bool\n {\n return $this->breadcrumbs->has($this->route);\n }", "private function shouldDepict(Request $request): bool\n {\n return app()->environment(config('depictr.environments', []))\n && $this->comesFromCrawler($request)\n && $request->isMethod('GET')\n && ! $request->header('X-Inertia')\n && ! $this->urlIsExcluded($request);\n }", "protected function executePreRenderHook() {}", "public function isUncacheableRequestMethod()\n {\n if (($is = &$this->staticKey(__FUNCTION__)) !== null) {\n return $is; // Already cached this.\n }\n if (!empty($_POST)) {\n return $is = true;\n } elseif (!empty($_SERVER['REQUEST_METHOD']) && mb_strtoupper($_SERVER['REQUEST_METHOD']) !== 'GET') {\n return $is = true;\n }\n return $is = false;\n }", "public function viewCanBeRendered()\r\n {\r\n return true;\r\n }", "private function decide(): bool\n {\n if ($this->cloudflare && isset($_SERVER['HTTP_CF_CONNECTING_IP'])) {\n $this->cache = false;\n $this->addMessage('request from cloudflare');\n }\n // don't cache if user is logged in\n if (strpos('test ' . implode(' ', array_keys($_COOKIE)), 'wordpress_logged_in')) {\n $this->cache = false;\n $this->loggedin = true;\n $this->addMessage('Loggedin user');\n }\n // don't cache post requests\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n $this->cache = false;\n $this->addMessage('Post request');\n }\n // don't cache requests to wordpress php files\n if (preg_match('%(/wp-admin|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)%',\n $this->path)) {\n $this->cache = false;\n $this->addMessage('This is a WordPress file ');\n }\n\n // don't cache if url has a query string\n // TODO verify that this is reasonable\n if (parse_url($this->url, PHP_URL_QUERY)) {\n $this->cache = false;\n $this->addMessage('Not caching query strings');\n }\n\n return $this->cache;\n }", "public function getDynamicRendering() : bool\n {\n return $this->dynamicRendering;\n }", "protected function _shouldRenderProductPage()\n {\n return !($this->getIsOnCatalogProductPage() && !$this->_getConfigFlag(self::VISIBLE_PRODUCT));\n }", "public function beforeCacheResponse()\n {\n return true;\n }", "protected function isValid()\n {\n return !app('request') instanceof Request;\n }", "function canProcessRequests()\n\t{\n\t\tif ($this->getRequestMode() != -1) return true;\n\t\treturn false;\n\t}", "private function hasUrlChanged($request)\n {\n }", "public function isRequest(): bool {\n return $this->options['request'] ?? false;\n }", "private function _isResource() {\n $Info = explode('.', $_SERVER[\"REQUEST_URI\"]);\n $rVal = false;\n\n if ( count($Info) > 1 ) { $rVal = true; }\n\n // Return the Boolean Response\n return $rVal;\n }", "public function beforeRender() {\r\n\t}", "protected abstract function beforeRendering(): void;", "protected function isPageSliderContext()\n\t{\n\t\treturn $this->request->get('IFRAME') === 'Y';\n\t}" ]
[ "0.66752464", "0.65382284", "0.6432343", "0.6327087", "0.63021", "0.61993617", "0.5976503", "0.59615296", "0.58880913", "0.58692056", "0.5860077", "0.5824455", "0.58055824", "0.5793511", "0.578749", "0.57850075", "0.5760411", "0.5751262", "0.56999713", "0.5694178", "0.5688167", "0.5666349", "0.5664126", "0.5661007", "0.56569594", "0.5610651", "0.56078434", "0.5606946", "0.5601502", "0.5583793" ]
0.7742392
1
Enable the query log on the connection.
public function enableQueryLog() { $this->loggingQueries = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function enableQueryLog()\n {\n }", "public function enableQueryLog()\n\t{\n\t\t$this->neoeloquent->enableQueryLog();\n\t}", "public function enableLogging()\n {\n global $log;\n if (! $this->logger)\n {\n // create a log channel\n $this->logger = new \\Monolog\\Logger('SQL');\n $this->logger->pushHandler($log);\n }\n }", "public function enableLogging() {\n $this->debug = true;\n }", "public function __construct(){\n DB::enableQueryLog();\n }", "public function __construct()\n {\n DB::enableQueryLog();\n }", "public function enableRequestLog()\n {\n $this->loggingRequests = true;\n }", "public static function disableQueryLog()\n {\n }", "public function logQueries()\n {\n // DbLoJack Helper\n $helper = app('db_lojack');\n\n // Log database queries for the request\n foreach ($helper->connections() as $connection) {\n $queries = DB::connection($connection)->getQueryLog();\n $helper->logQueries($queries, $connection );\n }\n }", "public function get_query_log()\n {\n }", "public function disableQueryLog()\n\t{\n\t\t$this->neoeloquent->disableQueryLog();\n\t}", "public static function getQueryLog()\n {\n }", "public function logQueries(bool $value = true): self\n {\n $this->logQueries = $value;\n return $this;\n }", "public function log_query()\n\t{\n\t\t$query = $this->get_query();\n\n\t\tif ( ! $query ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! is_array( $query ) && ! is_object( $query ) ) {\n\t\t\t$query = [ $query ];\n\t\t}\n\n\t\t$log = new Charcoal_Log;\n\t\t$log->event_type = $this->event_type;\n\t\t$log->data = $query;\n\t\t$log->save();\n\t}", "public function flushQueryLog()\n {\n $this->queryLog = array();\n }", "public function LogQueries($q){\n\t\t$this->queries = $q;\n\t\treturn $this;\n\t}", "public function LogQueries($q){\n\t\t$this->queries = $q;\n\t\treturn $this;\n\t}", "public function enableLogging($path) {\n\t\t$this->_logger = new Zend_Log(new Zend_Log_Writer_Stream($path.'simpleDb.log'));\n\t}", "public static function flushQueryLog()\n {\n }", "public final function withLog ()\n {\n\n $this->withLog = true;\n\n }", "public function testLoggerQueryLogger()\n {\n $logger = $this->getMockBuilder('Cake\\Database\\Log\\QueryLogger')->setMethods(['log'])->getMock();\n $logger->expects($this->once())->method('log');\n\n $query = new LoggedQuery;\n $query->query = json_encode([\n 'method' => 'GET',\n 'path' => '_stats',\n 'data' => []\n ], JSON_PRETTY_PRINT);\n\n $logger->expects($this->once())->method('log')->with($query);\n\n $connection = ConnectionManager::get('test');\n $connection->setLogger($logger);\n $connection->logQueries(true);\n $result = $connection->request('_stats');\n $connection->logQueries(false);\n\n $this->assertNotEmpty($result);\n }", "public function testQueryLoggingWithLog()\n {\n Log::setConfig('elasticsearch', [\n 'engine' => 'Array',\n ]);\n\n $connection = ConnectionManager::get('test');\n $connection->enableQueryLogging();\n $connection->setLogger(Log::engine('elasticsearch'));\n\n $result = $connection->request('_stats');\n $connection->disableQueryLogging();\n\n $this->assertNotEmpty($result);\n\n $logs = Log::engine('elasticsearch')->read();\n $this->assertCount(1, $logs);\n\n $message = json_encode([\n 'method' => 'GET',\n 'path' => '_stats',\n 'data' => [],\n ], JSON_PRETTY_PRINT);\n $this->assertSame('debug: ' . $message, $logs[0]);\n }", "public function flushQueryLog()\n\t{\n\t\t$this->neoeloquent->flushQueryLog();\n\t}", "public function enableQueryStats($enable = true) {\n\t\t$this->_debug = $enable ? true : false;\n\t\t$this->zendDb()->getProfiler()->setEnabled($this->_debug);\n\t}", "public function run()\n {\n DB::disableQueryLog();\n parent::run();\n }", "function log_query($query)\n\t\t{\n\t\t\t// Log how the last function was called\n\t\t\t$this->func_call = $query;\n\t\t\t\n\t\t\t// Keep an running Log of all functions called\n\t\t\tarray_push($this->all_func_calls, $this->func_call);\n\t\t}", "public function testLoggerQueryLogger()\n {\n Log::setConfig('elasticsearch', [\n 'engine' => 'Array',\n ]);\n $logger = new QueryLogger();\n\n $query = new LoggedQuery();\n $query->query = json_encode([\n 'method' => 'GET',\n 'path' => '_stats',\n 'data' => [],\n ], JSON_PRETTY_PRINT);\n\n $connection = ConnectionManager::get('test');\n $connection->setLogger($logger);\n $connection->enableQueryLogging();\n\n $result = $connection->request('_stats');\n $connection->disableQueryLogging();\n\n $logs = Log::engine('elasticsearch')->read();\n $this->assertCount(1, $logs);\n $this->assertStringStartsWith('debug: ', $logs[0]);\n $this->assertStringContainsString('duration=', $logs[0]);\n $this->assertStringContainsString('rows=', $logs[0]);\n }", "public function setLogInstance(): void\n {\n $this->log_instance = QueryLogger::initializeQueryChainLog($this);\n }", "function trace_sql()\n {\n if (!defined('OCTOBER_NO_EVENT_LOGGING')) {\n define('OCTOBER_NO_EVENT_LOGGING', 1);\n }\n\n if (!defined('OCTOBER_TRACING_SQL')) {\n define('OCTOBER_TRACING_SQL', 1);\n }\n else {\n return;\n }\n\n Event::listen('illuminate.query', function ($query, $bindings, $time, $name) {\n $data = compact('bindings', 'time', 'name');\n\n foreach ($bindings as $i => $binding) {\n if ($binding instanceof \\DateTime) {\n $bindings[$i] = $binding->format('\\'Y-m-d H:i:s\\'');\n } elseif (is_string($binding)) {\n $bindings[$i] = \"'$binding'\";\n }\n }\n\n $query = str_replace(['%', '?'], ['%%', '%s'], $query);\n $query = vsprintf($query, $bindings);\n\n traceLog($query);\n });\n }", "public function logging($what = null)\n {\n if (is_null($what)) {\n return $this->loggingQueries;\n }\n\n $this->loggingQueries = (bool) $what;\n }" ]
[ "0.8501042", "0.8350139", "0.7539824", "0.7162307", "0.69864655", "0.694962", "0.68933713", "0.6802872", "0.6782387", "0.65112114", "0.6488177", "0.6378712", "0.63591266", "0.6348143", "0.63405514", "0.6302678", "0.6302678", "0.6262357", "0.62497103", "0.6189126", "0.6112168", "0.60671616", "0.6035724", "0.60307956", "0.6022042", "0.59431976", "0.58734596", "0.5813443", "0.5808275", "0.5781142" ]
0.8874808
0
Lists all CatalogDocument models.
public function actionIndex() { $searchModel = new CatalogDocumentSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionIndex()\n {\n $searchModel = new DocumentSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getDocuments();", "public function actionIndex()\n {\n $searchModel = new DocumentoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function models()\n {\n $this->_display('models');\n }", "function findAll() {\n return Documents::find(array(\n 'order' => 'created_on DESC',\n ));\n }", "public function indexAction()\n {\n $dm = $this->getDocumentManager();\n\n $documents = $dm->getRepository('OPMediaBundle:Document')->findAll();\n\n return array('documents' => $documents);\n }", "public function index(Request $request) {\n return $this->documentRepository->findAll();\n }", "public function index()\n {\n $documents = Document::orderBy('id')->paginate(10);\n\n $data = [\n 'classes' => Classes::all(),\n 'documentTypes' => DocumentType::all()\n ];\n\n return view('documents.index')->withDocuments($documents)->with($data);\n }", "public function listModels() {\n\n $config = $this->initConfig($version = AnalyzeModel::VERSION);\n\n $config->setQuery( [ 'version' => $version ] );\n\n $config->setMethod(HttpClientConfiguration::METHOD_GET);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n $config->setURL(self::BASE_URL.\"/models\");\n\n return $this->sendRequest($config);\n }", "public function getModels();", "public function getModels();", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Document::find()->where(['com_id' => \\Yii::$app->user->getId()]),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $documents = Document::all();\n return view('documents', compact('documents'));\n }", "public function actionIndex()\n {\n $searchModel = new Catalog2Search();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $basic_documents = BasicDocument::orderBy('name')->paginate(50);\n\n return view('lists.basic_documents.index', [\n 'basic_documents' => $basic_documents,\n ]);\n }", "public function index()\n {\n $documents = Document::all();\n return view(\"documents\", [\"documents\" => $documents]);\n }", "public function index()\n {\n $data = Document::all();\n return view('backend.document.index', compact('data'));\n }", "public function getAll()\n {\n return DB::table('product_models')->get()->all();\n }", "public function getCatalogues()\n {\n return Catalogue::all();\n }", "public function allBooks ()\n {\n $books = $this->book->findAll();\n $this->show('admin/allbooks', ['books' => $books]);\n }", "abstract public function getDocuments();", "private function getAllModels()\n {\n return (object)ModelRegistry::getAllObjects();\n }", "public function indexAction()\n {\n $cleanTypes = $this->_getTypesList();\n $this->view->documentTypes = $cleanTypes;\n \n $this->view->dateTypes = array(\n array('id' => 'all', 'name' => 'All'),\n array('id' => '3month', 'name' => 'Past 3 Months'),\n array('id' => '6month', 'name' => 'Past 6 Months'),\n array('id' => 'year', 'name' => 'Past Year')\n );\n \n // Retrieve any request parameter for filtering:\n $params = $this->getRequest()->getParams();\n \n // Set some filter defaults:\n if (empty($params['doc_type'])) {\n $params['doc_type'] = 0;\n }\n if (empty($params['doc_date'])) {\n $params['doc_date'] = '3month';\n }\n \n $this->view->form = $this->_getDocumentFilterForm();\n $this->view->form->populate($params);\n\n $manager = new Lightman_Managers_Document();\n $select = $manager->fetchSelect($params);\n $paginator = new Zend_Paginator(new Zend_Paginator_Adapter_DbSelect($select));\n $paginator->setItemCountPerPage(10)\n ->setCurrentPageNumber($this->_getParam('page', 1));\n $this->view->paginator = $paginator;\n }", "function index() {\n $data['masters_documents'] = $this->Masters_document_model->get_all_masters_documents();\n\n $data['_view'] = 'masters_document/index';\n $this->load->view('layouts/main', $data);\n }", "public function getAllModels()\n {\n try {\n return AppModelList::models();\n }\n catch (Throwable $t) {\n throw new Exception('Parse Error: AppModelList.php has been corrupted.');\n }\n }", "public function index(Request $request)\n {\n $this->authorize('list documents', Document::class);\n $search = $request->get('search', '');\n\n $documents = Document::search($search)\n ->latest()\n ->paginate();\n \n return view('admin.document.index', compact('documents', 'search'));\n }", "public function alls()\r\n {\r\n $all = ShopCatalog::find()\r\n ->where([\r\n 'id' => 12355\r\n ])\r\n ->asArray()\r\n ->all();\r\n\r\n vd($all);\r\n }", "public function findAll() {\n\t\treturn $this->getCatalog();\n\t}", "public function index()\n {\n return $this->model->getAll();\n }", "public function documentsAction()\n {\n // Les modèles\n $model_commission = new Model_DbTable_Commission();\n\n $commission = $model_commission->find($this->_request->id_commission)->current();\n\n // On récupère la liste des membres de la commission\n $this->view->name_document_cr = $commission->DOCUMENT_CR;\n }" ]
[ "0.63009024", "0.6178566", "0.61719954", "0.61033046", "0.6081459", "0.60605943", "0.60524976", "0.60498667", "0.5914422", "0.59078455", "0.59078455", "0.5843777", "0.5829481", "0.57786274", "0.57765913", "0.5758959", "0.5756529", "0.57526815", "0.5745486", "0.57382923", "0.5706867", "0.5700328", "0.5689625", "0.5688004", "0.5656904", "0.56492233", "0.5648011", "0.563816", "0.56260484", "0.5613399" ]
0.7315632
0
Finds the CatalogDocument model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = CatalogDocument::findOne($id)) !== null) { return $model; } throw new NotFoundHttpException(Yii::t('catalog', 'The requested page does not exist.')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function find($primary_key, $model);", "public function loadModel($id)\r\n\t{\r\n\t\t$model=StudentDocument::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,Yii::t('app','The requested page does not exist.'));\r\n\t\treturn $model;\r\n\t}", "protected function findModel($id)\n {\n if (($model = Catalog2::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public static function find( $primaryKey )\n\t{\n\t\tself::init();\n\t\t\n\t\t// Select one item by primary key in Database\n\t\t$result = Database::selectOne(\"SELECT * FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $primaryKey);\t\t\n\t\tif( $result == null )\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Create & return new object of Model\n\t\treturn self::newItem($result);\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=CerDoc::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Documento::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = ToquvDocumentItems::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }", "public function loadModel($id)\n\t{\n\t\t$model=Knowledgecatalogue::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=CollectionShop::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function find($primary)\n {\n if (isset($this->models[$primary])) {\n return $this->models[$primary];\n }\n\n return;\n }", "protected function findModel($id)\n {\n if (($model = Document::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Docingresados::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'El enlace o direccion solicitado no existe');\n\t\treturn $model;\n\t}", "private function findModel($key)\n {\n if (null === $key) {\n throw new BadRequestHttpException('Key parameter is not defined in findModel method.');\n }\n\n $modelObject = $this->getNewModel();\n\n if (!method_exists($modelObject, 'findOne')) {\n $class = (new\\ReflectionClass($modelObject));\n throw new UnknownMethodException('Method findOne does not exists in ' . $class->getNamespaceName() . '\\\\' .\n $class->getShortName().' class.');\n }\n\n $result = call_user_func([\n $modelObject,\n 'findOne',\n ], $key);\n\n if ($result !== null) {\n return $result;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }", "public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}", "public static function getById($id) {\n\n $id = intval($id);\n\n if ($id < 1) {\n return null;\n }\n\n $cacheKey = \"document_\" . $id;\n\n try {\n $document = \\Zend_Registry::get($cacheKey);\n if(!$document){\n throw new \\Exception(\"Document in registry is null\");\n }\n }\n catch (\\Exception $e) {\n try {\n if (!$document = Cache::load($cacheKey)) {\n $document = new Document();\n $document->getResource()->getById($id);\n\n $mappingClass = \"\\\\Pimcore\\\\Model\\\\Document\\\\\" . ucfirst($document->getType());\n\n // this is the fallback for custom document types using prefixes\n // so we need to check if the class exists first\n if(!\\Pimcore\\Tool::classExists($mappingClass)) {\n $oldStyleClass = \"Document_\" . ucfirst($document->getType());\n if(\\Pimcore\\Tool::classExists($oldStyleClass)) {\n $mappingClass = $oldStyleClass;\n }\n }\n $typeClass = Tool::getModelClassMapping($mappingClass);\n\n if (Tool::classExists($typeClass)) {\n $document = new $typeClass();\n \\Zend_Registry::set($cacheKey, $document);\n $document->getResource()->getById($id);\n\n Cache::save($document, $cacheKey);\n }\n }\n else {\n \\Zend_Registry::set($cacheKey, $document);\n }\n }\n catch (\\Exception $e) {\n \\Logger::warning($e->getMessage());\n return null;\n }\n }\n\n if(!$document) {\n return null;\n }\n\n return $document;\n }", "protected function findModel($id)\n {\n if (($model = Document::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('Страница не существует.');\n }", "public function getDocumentByName($name) {\n\t\tif ($name == \"\") {\n\t\t\tthrow new ParameterException(\"name is empty\");\n\t\t}\n\t\t$model = $this->repository->getDocumentByName($name);\n\t\tif ($model == null) {\n\t\t\tthrow new NotFoundException($name);\n\t\t}\n\t\treturn $model;\n\t}", "protected function findModel($masterlist_id)\n\t{\n\t\tif (($model = WiMasterlist::findOne($masterlist_id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "public function findModel($clz, $key);", "public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$this->_model=LicenceApplication::model()->findbyPk($_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}", "protected function findModel($id)\n {\n if (($model = Offer::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = UtilitiesBook::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Publisher::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "function find($id)\n{\n\t$model = $this->newModel(null);\n\treturn $model->find($id);\n}", "public function find($model, $id);", "public function loadModel($id)\n {\n $model=Product::model()->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id)\n {\n\t\t$p = $this->primaryModel;\n if (($model = $p::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = Trailer::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "public function loadModel($id) {\n $model = ClinicStoreproduct::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }" ]
[ "0.69838893", "0.66981095", "0.6450445", "0.64365137", "0.64340955", "0.63662195", "0.63651925", "0.62230474", "0.62089753", "0.6206121", "0.6204331", "0.6168292", "0.6167839", "0.61518353", "0.6141411", "0.61328506", "0.6129874", "0.61237043", "0.61163634", "0.61103296", "0.6093999", "0.60666585", "0.6066636", "0.606148", "0.6053387", "0.60201836", "0.6004852", "0.60041213", "0.59829384", "0.5982818" ]
0.6951869
1
Show the form for creating a new Siteprice.
public function create() { return view('siteprices.create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return view('admin.price.create');\n }", "public function create()\n\t{\n\t\treturn View::make('pages.Prices.create');\n\t}", "public function create()\n {\n return view('dashboard.price.create')->with('branches',Branch::get())->with('stages',Stage::get());\n\n }", "public function create()\n {\n return view('spec_product_prices.create');\n }", "public function create()\n {\n return view('admin.zonePrice.zonePrices.create');\n }", "public function create()\n {\n $prices = Price::all();\n return view('pages.price')->with(['prices'=>$prices]);\n }", "public function create()\n {\n return view('admin.pricelist._create');\n }", "public function create()\n {\n return view('avored-framework::system.site-currency.create');\n }", "public function create()\n {\n return view('layouts.pricing.admin.create');\n }", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function actionCreate()\n {\n $model = new PricefallsProducts();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function showForm(){\n return view('marketItem.itemCreateForm');\n }", "public function create()\n {\n $title = \"New Service Rates Form\";\n return view('rates.create', compact('title') );\n }", "public function create()\n {\n $admin = AdminProfile::all()->last();\n //Return the view\n return view('admin.price.add.index' , ['admin'=>$admin] );\n }", "public function store(CreateSitepriceRequest $request)\n {\n $input = $request->all();\n\n $siteprice = $this->sitepriceRepository->create($input);\n\n Flash::success('Siteprice saved successfully.');\n\n return redirect(route('siteprices.index'));\n }", "public function create()\n {\n $products = Product::pluck('name', 'id');\n return view('prices.create', compact('products'));\n }", "public function actionCreate()\n {\n $model = new Currency();\n\n if ($model->load(request()->post()) && $model->save()) {\n notify()->addSuccess(t('app','Your action is complete.'));\n return $this->redirect(['view', 'id' => $model->currency_id]);\n } else {\n return $this->render('form', [\n 'action'=> 'create',\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n $funded_institutions = FundedInstitution::orderBy('name')->where('status', 1)->get();\n $months = Month::all();\n return view('admin.expensePrice.create', compact('funded_institutions', 'months'));\n\n }", "public function createAction()\n {\n $entity = new Pricelist();\n $request = $this->getRequest();\n $form = $this->createForm(new PricelistType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('Price_show', array('id' => $entity->getId())));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function create()\n {\n\n return view('currency.create');\n \n }", "public function actionCreate()\n {\n $model = new InfoSpares;\n // Uncomment the following line if AJAX validation is needed\n $this->performAjaxValidation($model);\n\n if (isset($_POST['InfoSpares'])) {\n $model->attributes = $_POST['InfoSpares'];\n $model->date_in = date('Y-m-d', strtotime($model->date_in));\n $model->status = \"Approve\";\n if ($model->car_or_spare_status_id == 1) {\n $model->branch_from_share = NULL;\n }\n if ($model->car_or_spare_status_id == 2 && empty($model->branch_from_share)) {\n Yii::app()->user->setFlash('error', \"ກະ​ລຸ​ນາ​ເລືອກ​ສາ​ຂາ\");\n } else {\n if ($model->save())\n $this->redirect(array('index'));\n }\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function create()\n {\n return view('produto.form_produto');\n }", "protected function form()\n {\n return Form::make(new CostProduct(), function (Form $form) {\n $form->disableViewButton();\n $form->display('id')->disable();\n $form->text('amount')->rules('min:0');\n $form->text('product_id')->rules('required|unique:cost_products');\n $form->hidden('status');\n //$form->display('created_at');\n //$form->display('updated_at');\n });\n }", "public function create()\n {\n return view('Admin.product_management.offer.create');\n }", "public function create()\n {\n return view('Backend.pages.product.createproduct');\n }", "public function newAction()\n {\n $entity = new Pricelist();\n $form = $this->createForm(new PricelistType(), $entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function create()\n {\n if(Session::get('group') == 'admin'){ \n\n if(Session::get('lang') == 'en'){\n return view('en.price.price-create');\n } \n return view('price.price-create');\n }\n else return Redirect('/');\n }", "public function PriceNewAction($id, Request $request)\n {\n \t$menu = array('Season','price');\n \t$price = new Price();\n \t$val = false;\n \t$type = 'new';\n \tif($id)\n \t{\n \t\t$repository_price= $this->getDoctrine()->getRepository('KmcKmcBundle:Price');\n \t\t$price = $repository_price->findOneById($id);\n \t\t$type='edit';\n \t}\n \t$form = $this->createForm(PriceFormType::class, $price);\n \t$form->handleRequest($request);\n \tif ($form->isValid()) {\n \t\t$val = true;\n \t\t$price->setActive(0);\n \t\t$em = $this->getDoctrine()->getManager();\n \t\t$em->persist($price);\n \t\t$em->flush();\n \t}\n \treturn $this->render('KmcAdminBundle:Admin:PriceNew.html.twig',array('menu'=>$menu,'form'=>$form->createView(),'val'=>$val,'type'=>$type));\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }" ]
[ "0.7599176", "0.7534403", "0.7247009", "0.7238054", "0.69676316", "0.6930718", "0.6917279", "0.690656", "0.68919164", "0.67396873", "0.66733265", "0.6552607", "0.65484715", "0.6525759", "0.65248835", "0.65033793", "0.650063", "0.6439921", "0.6425267", "0.64230686", "0.6412086", "0.640831", "0.6404908", "0.6404531", "0.6369944", "0.63440543", "0.634245", "0.6336068", "0.633451", "0.63291883" ]
0.7743742
0
Store a newly created Siteprice in storage.
public function store(CreateSitepriceRequest $request) { $input = $request->all(); $siteprice = $this->sitepriceRepository->create($input); Flash::success('Siteprice saved successfully.'); return redirect(route('siteprices.index')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save()\n {\n $this->save_meta_value('_sim_service_price', $this->service_price);\n $this->save_meta_value('_sim_service_price_registered', $this->service_price_registered);\n $this->save_meta_value('_sim_service_hide_price', $this->service_hide_price);\n }", "public function store()\n\t{\n\t\t$input = Input::all();\n\t\t$validation = Validator::make($input, Price::$rules);\n\n\t\tif ($validation->passes()) {\n\t\t\tPrice::create($input);\n\t\t\tSession::flash('message', 'Created new pricepoint successfully');\n\t\t\treturn Redirect::route('prices.index');\n\t\t}\n\n\t\treturn Redirect::route('prices.create')\n\t\t\t->withInput()\n\t\t\t->withErrors($validation)\n\t\t\t->with('message', 'Could not complete due to validation errors.');\n\t}", "public function saved(Price $price)\n {\n PriceItem::where('price_id', $price->id)->delete();\n\n $productId = request()->input('product_id');\n\n foreach (request()->input('prices', []) as $priceInput) {\n $priceCategoryAttributes = [\n 'product_id' => $productId,\n ];\n\n foreach (config('app.locales') as $lang => $locale) {\n $priceCategoryAttributes[\"title_{$lang}\"] = $priceInput['category'][$lang];\n }\n\n $priceCategory = PriceCategory::firstOrCreate($priceCategoryAttributes);\n\n $priceItemAttributes = [\n 'price_id' => $price->id,\n 'price_category_id' => $priceCategory->id,\n ];\n foreach ($priceInput['items'] as $item) {\n $priceItemAttributes['price'] = $item['price'];\n $priceItemAttributes['date_start'] = $item['date_start'];\n $priceItemAttributes['date_end'] = $item['date_end'];\n\n foreach (config('app.locales') as $lang => $locale) {\n $priceItemAttributes[\"title_{$lang}\"] = $item['title'][$lang];\n }\n }\n\n PriceItem::create($priceItemAttributes);\n }\n }", "public function store(Request $request)\n {\n $save_price = new Price($request->all());\n try {\n $save_price->save();\n return \"Saved successfully\";\n } catch (\\Exception $e) {}\n }", "public function savePrice(FipeVehiclePrice $price){\n $em = $this->getEntityManager();\n $em->persist($price);\n $em->flush();\n }", "public function store(Request $request)\n {\n $product = ProductPrice::create($request->all());\n }", "public function store(Request $request)\n {\n $this->price->fill($request->all())->save();\n return redirect()->route('prices.show', $this->price);\n }", "public function store(Request $request)\n {\n $user = $request->user();\n $currentCompany = $user->currentCompany();\n\n // Redirect back\n // $canAdd = $currentCompany->subscription('main')->canUseFeature('products');\n // if (!$canAdd) {\n // session()->flash('alert-danger', __('messages.you_have_reached_the_limit'));\n // return redirect()->route('products', ['company_uid' => $currentCompany->uid]);\n // }\n // $price = preg_replace('~\\D~', '', $request->price);\n \n // dd($price);\n // Create Product and Store in Database\n $st1 = '';\n if ($request->hasFile('attachment')) {\n $limage = $request->attachment;\n $limage_new_name = time().$limage->getClientOriginalName();\n $st1= $limage->move('assets/images', $limage_new_name);\n }\n $supplier = Supplier::create([\n 'name' => $request->name,\n 'email' => $request->email,\n 'company' => $request->company,\n 'phone' =>$request->phone,\n 'company_id' => $currentCompany->id,\n 'display_name' => $request->display_name,\n 'website' => $request->website,\n 'address' => $request->address,\n 'state' => $request->state,\n 'city' => $request->city,\n 'country' => $request->country,\n 'pin_code' =>$request->pin_code,\n 'billing_rate' => $request->billing_rate,\n 'pan_number' => $request->pan_number,\n 'attachment' => $st1,\n 'tds_entity' => $request->tds_entity,\n 'tds_section' => $request->tds_section,\n 'notes' => $request->notes,\n 'balance' => $request->balance,\n 'balance_date' => $request->balance_date,\n 'account_number' =>$request->account_number,\n 'gst_type' => $request->gst_type,\n 'gstin' => $request->gstin,\n 'tax_reg_number' => $request->tax_reg_number,\n 'effective_date' => $request->effective_date,\n ]);\n \n \n\n // Record product \n $currentCompany->subscription('main')->recordFeatureUsage('products');\n\n session()->flash('alert-success', __('messages.product_added'));\n return redirect()->route('suppliers', ['company_uid' => $currentCompany->uid]);\n \n }", "public function store(Request $request)\n {\n $price = $this->validate(request(), [\n 'product_id' => 'required|numeric', \n 'name' => 'required',\n 'price' => 'required|regex:/^\\d*([\\,\\.]\\d{2})?$/|max:8'\n ]);\n \n $price['price'] = str_replace(',', \".\", $price['price']);\n Price::create($price);\n\n return back()->with('success', 'Cena dodana');\n }", "public function store();", "public function store();", "public function store();", "public function store(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'name' => 'required|unique:prices,name',\n 'order' => 'required|unique:prices,order'\n ]);\n if ($validator->fails()) {\n $message = '';\n foreach ($validator->errors()->all() as $error) {\n $message .= $error . ' | ';\n }\n Session::flash('message', $message);\n Session::flash('alert-class', 'alert-error');\n return Redirect::back()->withInput();\n }\n\n $dataUser = Auth::user();\n $price = new Price;\n $price->name = Input::get('name');\n $price->pct = Input::get('pct');\n $price->pct_min = Input::get('pct_min');\n $price->amount = Input::get('amount');\n $price->amount_min = Input::get('amount_min');\n $price->cant_min = Input::get('cant_min');\n $price->cant_max = Input::get('cant_max');\n $price->date_min = Input::get('date_min');\n $price->date_max = Input::get('date_max');\n $price->order = Input::get('order');\n $price->main = Input::get('main');\n $price->active = Input::get('active');\n $price->created_by = $dataUser->id;\n $price->updated_by = $dataUser->id;\n $price->save();\n\n $price->pagos()->sync($request->input('pagos', []));\n $price->items()->sync($request->input('items', []));\n\n\n Session::flash('message', 'Precio insertado correctamente');\n return Redirect::to('prices');\n }", "public function store(ProductStoreRequest $request)\n {\n //\n $product = new Product(); \n $product->name = $request->name; \n $product->description = $request->description; \n $product->category_id = $request->category_id; \n $product->save(); \n\n $price = new Price(); \n $price->price = $request->price; \n $price->effdate = Carbon::now(); \n $price->product_id = $product->id; \n $price ->save(); \n\n return redirect()->route('products.index')->with('status', 'Product Toegevoegd'); \n }", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.7175263", "0.66030836", "0.6424205", "0.63320243", "0.6319473", "0.63069737", "0.61832917", "0.6168941", "0.616738", "0.61648256", "0.61648256", "0.61648256", "0.6113378", "0.60926634", "0.6071317", "0.6071317", "0.6071317", "0.60651946", "0.60318494", "0.60318494", "0.60318494", "0.60318494", "0.60318494", "0.60318494", "0.60318494", "0.60318494", "0.60318494", "0.60318494", "0.60318494", "0.60318494" ]
0.7153086
1
linkback for Tumblrlike posts
function tumblrLinkBacks( $content ) { global $wp_query, $post; $post_id = get_post( $post->ID ); $posttitle = $post_id->post_title; $permalink = get_permalink( get_post( $post->ID ) ); $tumblr_keys = get_post_custom_keys( $post->ID ); if( get_post_meta( $wp_query->post->ID, 'TumblrURL', true ) ) { if( $tumblr_keys ) { foreach( $tumblr_keys as $tumblr_key ) { if( $tumblr_key == 'TumblrURL' ) { $tumblr_vals = get_post_custom_values( $tumblr_key ); } } if( $tumblr_vals ) { if( is_feed() ) { $content .= '<p><a href="'.$tumblr_vals[0].'" title="Direct link to featured article">Direct Link to Article</a> &#8212; '; $content .= '<a href="'.$permalink.'">Permalink</a></p>'; return $content; } else { return $content; } } } } else { $content = $content; return $content; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function link() { return site_url().'/'.$this->post->post_name; }", "function antica_next_prev_post_link ($output, $format, $link, $post, $adjacent) {\n $previous = $adjacent;\n\n // Only applies changes if EDDis active\n if ( ! class_exists('EDD_Download') ) {\n return $output;\n }\n if ( ! is_single() || ! get_post_type() == \"download\" ) {\n return $output;\n }\n\n /**\n * Saving the initial Referrer\n * To allow scroll the posts and\n * return to the original caller\n * Option 2 - onclick=\"history.back()\" Easier\n * The page should verify $_GET['back_refr']\n */\n\n $url_back_refr = '';\n // If GET is set the same Template\n if ( isset( $_GET['back_refr'] ) ) {\n $url_back_refr = $_GET['back_refr'];\n // echo '<br>Original: ' . $url_back_refr;\n\n } else {\n if ( isset( $_SERVER['HTTP_REFERER'] ) ) {\n // $back_pth = parse_url( $_SERVER['HTTP_REFERER'], PHP_URL_PATH );\n // $back_qry = parse_url( $_SERVER['HTTP_REFERER'], PHP_URL_QUERY );\n // echo '<br>Initial: ' . $back_qry;\n // $url_back_refr = add_query_arg( 'back_refr' , base64_encode ( $back_pth . $back_qry ) );\n // $url_back_refr = base64_encode ( $back_pth . $back_qry );\n $url_back_refr = base64_encode ( $_SERVER['HTTP_REFERER'] );\n // echo '<br>Aditional: ' . $url_back_refr ;\n }\n }\n\n // echo '<br>encoded: ' . $url_back_refr . '<----';\n // echo '<br>decoded: ' . base64_decode($url_back_refr) . '<----';\n /**\n * https://developer.wordpress.org/reference/functions/get_adjacent_post_link/\n */\n if ( ! $post ) {\n $output = '';\n } else {\n $title = $post->post_title;\n\n if ( empty( $post->post_title ) ) {\n $title = $previous ? __( 'Previous Post' ) : __( 'Next Post' );\n }\n\n /** This filter is documented in wp-includes/post-template.php */\n $title = apply_filters( 'the_title', $title, $post->ID );\n\n $date = mysql2date( get_option( 'date_format' ), $post->post_date );\n $rel = $previous ? 'prev' : 'next';\n\n $string = '<a href=\"';\n $string .= get_permalink( $post ) ;\n $string .= '?back_refr=' . $url_back_refr;\n $string .= '\" rel=\"' . $rel . '\">';\n $inlink = str_replace( '%title', $title, $link );\n $inlink = str_replace( '%date', $date, $inlink );\n $inlink = $string . $inlink . '</a>';\n\n $output = str_replace( '%link', $inlink, $format );\n }\n\n return $output;\n}", "function adjacent_posts_rel_link_wp_head()\n {\n }", "function previous_posts_link($label = \\null)\n {\n }", "function permalink_link()\n {\n }", "function post_permalink($post = 0)\n {\n }", "function dvs_change_blog_links($post_link, $id=0){\n\n $post = get_post($id);\n\n if( is_object($post) && $post->post_type == 'post'){\n return home_url('/my-prefix/'. $post->post_name.'/');\n }\n\n return $post_link;\n}", "function smarty_function_mtlink($args, &$ctx) {\n // status: incomplete\n // parameters: template, entry_id\n static $_template_links = array();\n $curr_blog = $ctx->stash('blog');\n if (isset($args['template'])) {\n if (!empty($args['blog_id']))\n $blog = $ctx->mt->db()->fetch_blog($args['blog_id']);\n else\n $blog = $ctx->stash('blog');\n\n $name = $args['template'];\n $cache_key = $blog->id . ';' . $name;\n if (isset($_template_links[$cache_key])) {\n $link = $_template_links[$cache_key];\n } else {\n $tmpl = $ctx->mt->db()->load_index_template($ctx, $name, $blog->id);\n $site_url = $blog->site_url();\n if (!preg_match('!/$!', $site_url)) $site_url .= '/';\n $link = $site_url . $tmpl->template_outfile;\n $_template_links[$cache_key] = $link;\n }\n if (!$args['with_index']) {\n $link = _strip_index($link, $curr_blog);\n }\n return $link;\n } elseif (isset($args['entry_id'])) {\n $arg = array('entry_id' => $args['entry_id']);\n list($entry) = $ctx->mt->db()->fetch_entries($arg);\n $ctx->localize(array('entry'));\n $ctx->stash('entry', $entry);\n $link = $ctx->tag('EntryPermalink',$args);\n $ctx->restore(array('entry'));\n if ($args['with_index'] && preg_match('/\\/(#.*)$/', $link)) {\n $index = $ctx->mt->config('IndexBasename');\n $ext = $curr_blog->blog_file_extension;\n if ($ext) $ext = '.' . $ext; \n $index .= $ext;\n $link = preg_replace('/\\/(#.*)?$/', \"/$index\\$1\", $link);\n }\n return $link;\n }\n return '';\n}", "function trackback_url_list($tb_list, $post_id)\n {\n }", "public function post_link($post) {\n\n if ($this->template->is_ajax()) {\n\n $post['post_to_groups'] = array($this->profile->id);\n\n $post['title'] = 'from '.get_instance()->config->config['OCU_site_name'];\n\n $this->bitly_load();\n\n\n\n // add http://\n\n if (!empty($post['url']) && !preg_match(\"~^(?:f|ht)tps?://~i\", $post['url'])) {\n\n $post['url'] = \"http://\" . $post['url'];\n\n }\n\n\n\n $post['timezone'] = User_timezone::get_user_timezone($this->c_user->id);\n\n $errors = Social_post::validate_post($post);\n\n\n\n if (empty($errors)) {\n\n\n\n try {\n\n if (!isset($post['post_id'])) {\n\n\n\n if (!empty($post['url'])) {\n\n\n\n if ($this->bitly) {\n\n $bitly_data = $this->bitly->shorten($post['url']);\n\n if (strlen($bitly_data['url']) < strlen($post['url'])) {\n\n $post['url'] = $bitly_data['url'];\n\n //ddd($post['url']);\n\n }\n\n\n\n }\n\n }\n\n\n\n }\n\n\n\n $this->load->library('Socializer/socializer');\n\n Social_post::add_new_post($post, $this->c_user->id, $this->profile->id);\n\n\n\n $result['success'] = true;\n\n $result['message'] = lang('post_was_successfully_added');\n\n } catch(Exception $e) {\n\n $result['success'] = false;\n\n $result['errors']['post_to_groups[]'] = '<span class=\"message-error\">' . $e->getMessage() . '</span>';\n\n }\n\n\n\n } else {\n\n $result['success'] = false;\n\n $result['errors'] = $errors;\n\n }\n\n echo json_encode($result);\n\n }\n\n exit();\n\n }", "protected function prepare_links($post)\n {\n }", "protected function prepare_links($post)\n {\n }", "function register_block_core_post_navigation_link()\n {\n }", "public static function previous_post_link () : void\n {\n add_filter(\"previous_post_link\", function ($output) {\n $previousPost = get_adjacent_post();\n \n if ($previousPost !== '') {\n $previousPostTitle = strlen(get_the_title($previousPost)) > 30 ? substr(get_the_title($previousPost), 0, 30) . \"...\" : get_the_title($previousPost);\n\n $output = '<div class=\"thumb\">';\n $output .= '<a href=\"' . get_the_permalink($previousPost). '\">' . get_the_post_thumbnail($previousPost, \"pagination_between_post\", [\"class\" => \"img-fluid\"]) . '</a>';\n $output .= '</div>';\n \n $output .= '<div class=\"arrow\">';\n $output .= '<a href=\"' . get_the_permalink($previousPost). '\"><span class=\"lnr text-white ti-arrow-left\"></span></a>';\n $output .= '</div>';\n \n $output .= '<div class=\"detials\">';\n $output .= '<p>' . __(\"Prev Post\", \"dingo\") . '</p>';\n $output .= '<a href=\"' . get_the_permalink($previousPost). '\"><h4>' . $previousPostTitle . '</h4></a>';\n $output .= '</div>';\n } else {\n $output = '';\n }\n \n return $output;\n });\n }", "function pingback($content, $post)\n {\n }", "function bbpress_crumbs() {\n\t\t\n\t\t// Setup the trail\n\t\t$bbp_trail = array();\n\t\t\n\t\t// If it is the forum root, just display \"Forums\"\n\t\tif ( bbp_is_forum_archive() ) {\n\t\t\t$bbp_trail[] = 'Forums';\n\t\t\treturn $bbp_trail;\n\t\t}\n\t\t\t\t\t\n\t\t// Otherwise link to the root forums\n\t\t$bbp_trail[] = '<a href=\"' . get_post_type_archive_link( 'forum' ) . '\">Forums</a>';\n\t\t\n\t\t// Recent topics page \n\t\tif ( bbp_is_topic_archive() ) :\n\t\t\t$bbp_trail[] = 'Recent Topics';\n\t\t\n\t\t// Topic tag archives \n\t\telseif ( bbp_is_topic_tag() ) :\n\t\t\t$bbp_trail[] = bbp_get_topic_tag_name();\n\t\t\n\t\t// Editing a topic tag\n\t\telseif ( bbp_is_topic_tag_edit() ) :\n\t\t\t$bbp_trail[] = '<a href=\"' . bbp_get_topic_tag_link() . '\">' . bbp_get_topic_tag_name() . '</a>';\n\t\t\t$bbp_trail[] = 'Edit';\n\t\t\n\t\t// Single topic \n\t\telseif ( bbp_is_single_topic() ) :\t\n\t\t\t$topic_id = get_queried_object_id();\n\t\t\t$bbp_trail = array_merge( $bbp_trail, $this->trail_parents( bbp_get_topic_forum_id( $topic_id ) ) );\n\t\t\t$bbp_trail[] = bbp_get_topic_title( $topic_id );\n\t\t\t\t\n\t\t// If it's a split, merge, or edit, link back to the topic \n\t\telseif ( bbp_is_topic_split() || bbp_is_topic_merge() || bbp_is_topic_edit() ) :\n\t\t\t$topic_id = get_queried_object_id();\n\t\t\t$bbp_trail = array_merge( $bbp_trail, $this->trail_parents( $topic_id ) );\n\t\t\n\t\t\tif ( bbp_is_topic_split() ) \t\t: $bbp_trail[] = 'Split Topic';\n\t\t\telseif ( bbp_is_topic_merge() ) \t: $bbp_trail[] = 'Merge Topic';\n\t\t\telseif ( bbp_is_topic_edit() ) \t\t: $bbp_trail[] = 'Edit Topic';\n\t\t\tendif;\n\t\t\t\n\t\t// Single reply \n\t\telseif ( bbp_is_single_reply() ) :\n\t\t\t$reply_id = get_queried_object_id();\n\t\t\t$bbp_trail = array_merge( $bbp_trail, $this->trail_parents( bbp_get_reply_topic_id( $reply_id ) ) );\n\t\t\t$bbp_trail[] = bbp_get_reply_title( $reply_id );\n\t\t\n\t\t// Single reply edit \n\t\telseif ( bbp_is_reply_edit() ) :\n\t\t\t$reply_id = get_queried_object_id();\n\t\t\t$bbp_trail = array_merge( $bbp_trail, $this->trail_parents( bbp_get_reply_topic_id( $reply_id ) ) );\n\t\t\t$bbp_trail[] = 'Edit Reply';\n\t\t\t\n\t\t// Single forum \n\t\telseif ( bbp_is_single_forum() ) :\n\t\t\n\t\t\t// Get the queried forum ID and its parent forum ID. \n\t\t\t$forum_id \t\t\t= get_queried_object_id();\n\t\t\t$forum_parent_id \t= bbp_get_forum_parent_id( $forum_id );\n\t\t\t\n\t\t\t// Get the forum parents\n\t\t\tif ( 0 != $forum_parent_id) \n\t\t\t\t$bbp_trail = array_merge( $bbp_trail, $this->trail_parents( $forum_parent_id ) );\n\t\t\t\t\n\t\t\t// Give the forum title\n\t\t\t$bbp_trail[] = bbp_get_forum_title( $forum_id );\n\t\t\n\t\tendif;\n\t\t\n\t\t// Return the bbPress trail \n\t\treturn $bbp_trail;\n\t}", "public function generate_past_post_links()\n {\n\n // get all the posts, as wordpress does not currently support the use is null on the meta query\n $options = get_field('fpt_bitly_show_on', 'options');\n\n $args = array(\n\n 'post_type' => $options,\n 'meta_key' => 'fpt_bitlylink',\n 'order_by' => 'meta_value',\n 'order' => 'DESC',\n 'numberposts' => -1,\n 'meta_key' => '',\n\n );\n\n $past_posts = get_posts($args);\n\n foreach ($past_posts as $p) {\n\n if (!get_post_meta($p->ID, 'fpt_bitlylink', true)) {\n\n $url = get_permalink($p->ID);\n $shortlink = $this->shorten_link($url);\n $this->update_bitly_shortlink($shortlink, $p->ID);\n continue;\n\n }\n\n }\n\n }", "function post_reply_link($args = array(), $post = \\null)\n {\n }", "function previous_post_link($format = '&laquo; %link', $link = '%title', $in_same_term = \\false, $excluded_terms = '', $taxonomy = 'category')\n {\n }", "function no_more_jumping($post) {\n\t\treturn '&nbsp;<a href=\"'.get_permalink($post->ID).'\" class=\"read-more\">'.'Continue Reading'.'</a>';\n\t}", "function adjacent_post_link($format, $link, $in_same_term = \\false, $excluded_terms = '', $previous = \\true, $taxonomy = 'category')\n {\n }", "function render_block_core_post_navigation_link($attributes, $content)\n {\n }", "function _get_page_link($post = \\false, $leavename = \\false, $sample = \\false)\n {\n }", "function travomath_post_navigation(){\n\t\n\t$nav = '<div class=\"row\">';\n\t\n\t$prev = get_previous_post_link( '<div class=\"post-link-nav\"><span class=\"sunset-icon sunset-chevron-left\" aria-hidden=\"true\"></span> %link</div>', '%title' );\n\t$nav .= '<div class=\"col-xs-12 col-sm-6\">' . $prev . '</div>';\n\t\n\t$next = get_next_post_link( '<div class=\"post-link-nav\">%link <span class=\"sunset-icon sunset-chevron-right\" aria-hidden=\"true\"></span></div>', '%title' );\n\t$nav .= '<div class=\"col-xs-12 col-sm-6 text-right\">' . $next . '</div>';\n\t\n\t$nav .= '</div>';\n\t\n\treturn $nav;\n\t\n}", "function smarty_function_page_back($params, &$smarty)\n{\n\t$message_2196 = $smarty->get_template_vars(message_2196);\n\treturn '<a id=\"linkbacktop_back\" href=\"javascript:history.go(-1)\" title=\"' . $message_2196 . '\">' . $message_2196 . '</a>';\n}", "public function attachPostToBlogAtTheEnd() {}", "function social_bookmarks()\n {\n // remove the next line if you want to show the buttons\n return; \n \n echo '<span class=\"socbook\">';\n echo '<a href=\"' . str_replace(array('%title%', '%permalink%', ), array(urlencode($GLOBALS['post']->post_title), urlencode(apply_filters('the_permalink', get_permalink())), ), 'http://reddit.com/submit?title=%title%&amp;url=%permalink%') . '\" target=\"_blank\"><img src=\"' . get_bloginfo('template_directory') . '/images/reddit_be.gif\" alt=\"Reddit\" title=\"Reddit\"/></a>';\n echo '<a href=\"' . str_replace(array('%title%', '%permalink%', ), array(urlencode($GLOBALS['post']->post_title), urlencode(apply_filters('the_permalink', get_permalink())), ), 'http://www.facebook.com/share.php?title=%title%&amp;u=%permalink%') . '\" target=\"_blank\"><img src=\"' . get_bloginfo('template_directory') . '/images/facebook_be.gif\" alt=\"Facebook\" title=\"Facebook\"/></a>';\n echo '<a href=\"' . str_replace(array('%title%', '%permalink%', ), array(urlencode($GLOBALS['post']->post_title), urlencode(apply_filters('the_permalink', get_permalink())), ), 'http://www.stumbleupon.com/submit?title=%title%&amp;url=%permalink%') . '\" target=\"_blank\"><img src=\"' . get_bloginfo('template_directory') . '/images/stumbleupon_be.gif\" alt=\"Stumbleupon\" title=\"Stumbleupon\"/></a>'; \n echo '<a href=\"' . str_replace(array('%title%', '%permalink%', ), array(urlencode($GLOBALS['post']->post_title), urlencode(apply_filters('the_permalink', get_permalink())), ), 'http://digg.com/submit?phase=2&amp;title=%title%&amp;url=%permalink%') . '\" target=\"_blank\"><img src=\"' . get_bloginfo('template_directory') . '/images/digg_be.gif\" alt=\"Digg\" title=\"Digg\"/></a>'; \n echo '<a href=\"' . str_replace(array('%title%', '%permalink%', ), array(urlencode($GLOBALS['post']->post_title), urlencode(apply_filters('the_permalink', get_permalink())), ), 'http://del.icio.us/post?title=%title%&amp;url=%permalink%') . '\" target=\"_blank\" ><img src=\"' . get_bloginfo('template_directory') . '/images/del_be.gif\" id=\"del_be\" alt=\"Del.icio.us\" title=\"Del.icio.us\" /></a>'; \n echo '</span>';\n }", "function get_page_link($post = \\false, $leavename = \\false, $sample = \\false)\n {\n }", "function post_trackback_meta_box($post)\n {\n }", "function next_post_link($format = '%link &raquo;', $link = '%title', $in_same_term = \\false, $excluded_terms = '', $taxonomy = 'category')\n {\n }" ]
[ "0.64582175", "0.6300716", "0.6287317", "0.6286248", "0.61936206", "0.61920905", "0.6169207", "0.61544895", "0.6149232", "0.61160517", "0.61133784", "0.61133784", "0.60771376", "0.602152", "0.6003049", "0.5996477", "0.5991384", "0.5967364", "0.59616613", "0.5935982", "0.59253114", "0.5905133", "0.5863454", "0.5809189", "0.580709", "0.579282", "0.57878065", "0.57723004", "0.5767144", "0.5752808" ]
0.75995094
0
Rather than use a data provider and make thousands of snapshot files, we'll build up one big snapshot file and assert it. The snapshot file for this test was created using Intl.NumberFormat in NodeJS, in order to ensure parity. The script that generated the snapshot is currency_test.js.
public function testFormat(): void { $tests = $this->currencyPermutationsWithLocales(); $results = []; foreach ($tests as $test => $parameters) { $locale = new Locale($parameters['locale']); $formatOptions = new NumberFormatOptions($parameters['options']); $formatter = new NumberFormat($locale, $formatOptions); $results[$test] = [ 'result' => $formatter->format(self::NUMBER), ]; } $this->assertMatchesJsonSnapshot($results); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCurrencyCode(): void\n {\n $cur = StringHelper::getCurrencyCode();\n StringHelper::setCurrencyCode('€');\n $fmt1 = '#,##0.000\\ [$]';\n $rslt = NumberFormat::toFormattedString(12345.679, $fmt1);\n self::assertEquals($rslt, '12,345.679 €');\n $fmt2 = '$ #,##0.000';\n $rslt = NumberFormat::toFormattedString(12345.679, $fmt2);\n self::assertEquals($rslt, '$ 12,345.679');\n StringHelper::setCurrencyCode($cur);\n }", "public function testGettingCurrencyAsDecimalWithVariousMinorUnits(): void\n {\n self::assertSame('12345', (new Formatter('12345.062', 'JPY'))->decimal());\n self::assertSame('12345.07', (new Formatter('12345.0686', 'AUD'))->decimal());\n self::assertSame('12345.01234569', (new Formatter('12345.012345686', 'XBT'))->decimal());\n\n self::assertSame('-12345.07', (new Formatter('-12345.0686', 'AUD'))->decimal());\n }", "public function testSkeleton(): void\n {\n $localeToTest = 'en';\n\n $tests = $this->currencyPermutationsWithLocales();\n $results = [];\n\n $localeTests = [];\n foreach ($tests as $test => $parameters) {\n if ($parameters['locale'] === $localeToTest) {\n $localeTests[$test] = $parameters['options'];\n }\n }\n\n foreach ($localeTests as $test => $options) {\n $locale = new Locale($localeToTest);\n $formatOptions = new NumberFormatOptions($options);\n $formatter = new NumberFormat($locale, $formatOptions);\n\n $results[$test] = [\n 'skeleton' => $formatter->getSkeleton(),\n ];\n }\n\n $this->assertMatchesJsonSnapshot($results);\n }", "public function testFileSizeFormatter()\n {\n $formatter = function ($bytes, $precision = 2) {\n $units = array('B', 'KB', 'MB', 'GB', 'TB');\n\n $bytes = max($bytes, 0);\n $pow = floor(($bytes ? log($bytes) : 0) / log(1024));\n $pow = min($pow, count($units) - 1);\n\n // Uncomment one of the following alternatives\n // $bytes /= pow(1024, $pow);\n // $bytes /= (1 << (10 * $pow));\n return round($bytes, $precision) . ' ' . $units[$pow];\n };\n\n $valueSet = [[0], [1000], [500050], [323241234], [5000000]];\n\n $this->assertRecompilesCorrectly($formatter, $valueSet);\n }", "public function testGetMainCurrencyNotExists()\n {\n $data = [\n [\n 'name' => 'US Dollar',\n 'iso_code' => 'USD',\n 'convert_nominal' => 1,\n 'convert_rate' => 62.83,\n 'sort_order' => 1,\n 'format_string' => '$ #',\n 'thousands_sep' => '.',\n 'dec_point' => ',',\n 'is_main' => 0,\n ],\n 'Euro' => [\n 'name' => 'Euro',\n 'iso_code' => 'EUR',\n 'convert_rate' => 71.32,\n 'format_string' => '&euro; #',\n 'is_main' => 0,\n ],\n ];\n $storage = (new Currency())->getStorage();\n FunctionalHelper::flushStorage($storage);\n $this->assertFileNotExists($storage);\n CurrencyStorageHelper::generateStorage($data, $storage, Currency::className());\n $this->assertFileExists($storage);\n $c = CurrencyHelper::getMainCurrency();\n $this->assertNull($c);\n FunctionalHelper::flushCurrencyStorage();\n }", "public function testFormatWithCurrency()\n {\n // test de-AT with currency € as prefix\n $formatted = $this->priceFormatter->format(123.45, 3, 'de-AT', '€', PriceFormatter::CURRENCY_LOCATION_PREFIX);\n\n $this->assertEquals('€ 123,450', $formatted, 'price format with currency for \"de-AT\" does not match');\n\n // test en-US with currency $ as suffix\n $formatted = $this->priceFormatter->format(123.45, 2, 'en-US', '$', PriceFormatter::CURRENCY_LOCATION_SUFFIX);\n\n $this->assertEquals('123.45 $', $formatted, 'price format with currency for \"en-US\" does not match');\n\n\n // test en-US with currency 'null' as suffix - should throw exception\n $this->setExpectedException('Sulu\\Bundle\\PricingBundle\\Pricing\\Exceptions\\PriceFormatterException');\n\n $this->priceFormatter->format(123.45, 2, 'en-US', null, PriceFormatter::CURRENCY_LOCATION_SUFFIX);\n }", "public function testParseCurrency()\n {\n $gbp = $this->moneyParser->parse('£8.05');\n $this->assertEquals(805, $gbp->amount());\n $this->assertEquals('£8.05', $gbp->formatted());\n\n $eur = $this->moneyParser->parse('€5');\n $this->assertEquals(500, $eur->amount());\n $this->assertEquals('€5.00', $eur->formatted());\n\n $usd = $this->moneyParser->parse('$0.01');\n $this->assertEquals(1, $usd->amount());\n $this->assertEquals('US$0.01', $usd->formatted());\n }", "public function testInitialization()\n {\n $ruble = Currency::fromArray([\n 'fullname' => 'Рубли',\n 'title' => 'RUR',\n 'date' => '23.08.2022',\n 'description' => '5.53',\n 'quant' => '1',\n 'index' => 'DOWN',\n 'change' => '-0.01'\n ]);\n\n $this->assertTrue($ruble instanceof Currency);\n }", "public function testAddCurrencyMismatch()\n {\n $a = Money::create('0.00', 'LTL');\n $b = Money::create('1.00', 'EUR');\n\n $result = $a->add($b);\n\n $expectedResult = Money::create('1.00', 'EUR')->convertTo('LTL');\n\n $this->assertTrue($result->isEqual($expectedResult), $a->asString() . ' + ' . $b->asString() . ' = ' . $result->asString() . ', expected: ' . $expectedResult->asString());\n }", "public function run(): BigDecimal\n {\n $taxRates = TaxRates::readFromFile(__DIR__ . '/../accounts.tsv');\n\n $reader = new BookEntryReader($this->filename);\n $revenueParser = new RevenueParser($reader, $taxRates);\n\n $generator = new Generator($taxRates);\n if ($this->quarter !== null)\n $generator->setRevenueFilter(new QuarterRevenueFilter($this->quarter));\n $taxLines = $generator->generate($revenueParser);\n\n $this->write($taxLines);\n\n return array_reduce($taxLines, function (BigDecimal $sum, TaxLine $taxLine) {\n return $sum->plus($taxLine->getTaxAmount());\n }, BigDecimal::zero());\n }", "public function testFormattingCurrencyForDisplayEightMinorUnits(): void\n {\n // Format Bitcoin, ensure all locales return eight minor units, rounded decimal value\n $formatter = new Formatter('12345.012345686', 'XBT');\n self::assertSame(\n \"\\u{661}\\u{662}\\u{66C}\\u{663}\\u{664}\\u{665}\\u{66B}\\u{660}\\u{661}\\u{662}\\u{663}\\u{664}\\u{665}\\u{666}\" .\n \"\\u{669} \\u{e3f}\",\n $formatter->currency('ar_OM')\n );\n self::assertSame(\"\\u{e3f} 12345.01234569\", $formatter->currency('zh_CN'));\n self::assertSame(\"\\u{e3f}12,345.01234569\", $formatter->currency('en_AU'));\n self::assertSame(\"12 345,01234569 \\u{e3f}\", $formatter->currency('fr_FR'));\n self::assertSame(\"\\u{e3f} 12345.01234569\", $formatter->currency('ja_JP'));\n self::assertSame(\"\\u{e3f} 12.345,01234569\", $formatter->currency('nl_NL'));\n }", "public function testFormat()\n {\n // test de-AT\n $formatted = $this->priceFormatter->format(123.45, 3, 'de-AT');\n\n $this->assertEquals('123,450', $formatted, 'price format for \"de-AT\" does not match');\n\n // test en-US\n $formatted = $this->priceFormatter->format(123.45, 2, 'en-US');\n\n $this->assertEquals('123.45', $formatted, 'price format for \"en-US\" does not match');\n }", "public function testIecStandard()\n {\n $formatter = new Formatter();\n\n $this->assertEquals('64 KiB', $formatter->format(65536));\n $this->assertEquals('512 B', $formatter->format(512));\n $this->assertEquals('1.5 KiB', $formatter->format(1536));\n $this->assertEquals('1.21 KiB', $formatter->format(1234));\n $this->assertEquals('976.56 KiB', $formatter->format(1000000));\n $this->assertEquals('1 MiB', $formatter->format(1048576));\n $this->assertEquals('4.38 GiB', $formatter->format(4707319808)); // DVD-R(W)\n $this->assertEquals('4.38 GiB', $formatter->format(4700372992)); // DVD+R(W)\n }", "public function testGetBalanceConvertPrice()\n {\n $this->_helperMock->expects($this->once())->method('isEnabled')->will($this->returnValue(true));\n $amount = rand(1, 100);\n $convertedAmount = $amount * 2;\n\n $this->_balanceInstance->expects($this->once())->method('getAmount')->will($this->returnValue($amount));\n $this->priceCurrency->expects($this->once())\n ->method('convert')\n ->with($this->equalTo($amount))\n ->willReturn($convertedAmount);\n $result = $this->_className->getBalance(true);\n $this->assertEquals($convertedAmount, $result);\n }", "public function testDifferentCurrencyDontWork():void {\n $fiat = new Money(1, new Currency('USD'), false);\n $bitcoin = new Money(4, new Currency('BTC'), false);\n\n $this->expectExceptionMessage('The currency on the money objects are not the same!');\n $fiat->add($bitcoin);\n\n $this->expectExceptionMessage('The currency on the money objects are not the same!');\n $fiat->subtract($bitcoin);\n\n $this->expectExceptionMessage('The currency on the money objects are not the same!');\n $fiat->equals($bitcoin);\n\n $this->expectExceptionMessage('The currency on the money objects are not the same!');\n $fiat->greaterThan($bitcoin);\n\n $this->expectExceptionMessage('The currency on the money objects are not the same!');\n $fiat->greaterThanOrEqual($bitcoin);\n\n $this->expectExceptionMessage('The currency on the money objects are not the same!');\n $fiat->lessThan($bitcoin);\n\n $this->expectExceptionMessage('The currency on the money objects are not the same!');\n $fiat->lessThanOrEqual($bitcoin);\n }", "public function testDefaultCurrency()\n {\n $money = $this->moneyParser->parse('15');\n $this->assertEquals('£15.00', $money->formatted());\n }", "public function testIfStockManagementPrepareStockInfoHasProperFormat()\n {\n $this->assertEquals($this->stock->prepareStockInfo(), $this->stockSample);\n }", "public function testFormattingCurrencyNumericallyEightMinorUnits(): void\n {\n // Format Bitcoin, ensure all locales return eight minor units, rounded decimal value\n $formatter = new Formatter('12345.012345686', 'XBT');\n self::assertSame(\n \"\\u{661}\\u{662}\\u{66C}\\u{663}\\u{664}\\u{665}\\u{66B}\\u{660}\\u{661}\\u{662}\\u{663}\\u{664}\\u{665}\\u{666}\\u{669}\",\n $formatter->numeric('ar_OM')\n );\n self::assertSame('12345.01234569', $formatter->numeric('zh_CN'));\n self::assertSame('12,345.01234569', $formatter->numeric('en_AU'));\n self::assertSame('12 345,01234569', $formatter->numeric('fr_FR'));\n self::assertSame('12345.01234569', $formatter->numeric('ja_JP'));\n self::assertSame('12.345,01234569', $formatter->numeric('nl_NL'));\n }", "public function testTransactionWrongCurrency() {\n /** @var \\Drupal\\commerce_giftcard\\Entity\\GiftcardInterface $giftcard */\n $giftcard = Giftcard::create([\n 'type' => 'example',\n 'code' => 'ABC',\n 'balance' => new Price(50, 'USD'),\n ]);\n $giftcard->save();\n\n $this->expectException(EntityStorageException::class);\n $this->expectExceptionMessage('The provided prices have mismatched currencies: 50 USD, -50 CHF.');\n\n $transaction1 = GiftcardTransaction::create([\n 'giftcard' => $giftcard,\n 'amount' => new Price(-50, 'CHF')\n ]);\n $violations = $transaction1->validate();\n $this->assertEquals(1, count($violations));\n $this->assertEquals('amount.0.currency_code', $violations[0]->getPropertyPath());\n $this->assertEquals('The transaction amount currency (<em class=\"placeholder\">CHF</em>) does not match the giftcard currency (<em class=\"placeholder\">USD</em>).', $violations[0]->getMessage());\n\n $transaction1->save();\n }", "public function testLinearInterpolation2DecimalPoints()\n {\n $calculator = new FeeCalculator();\n\n $application = new LoanApplication(24, 2750.56);\n\n $fee = $calculator->calculate($application);\n\n // Fee = 119.44, Amount = 2750.56, Total = 2870\n $this->assertEquals(119.44, $fee);\n }", "public function testFormatNumber()\n {\n $target_value = 1.67583978;\n $initial_value = 1.675839781223232323223232323;\n \n $this->assertEquals($target_value, format_number($initial_value));\n }", "public function testBillingDownloadInvoice()\n {\n }", "public function do_structure_test($format, $xml) {\n\n $this->set_xml_content_a($xml);\n\n // 1) Build a database from definition A\n $this->build_db($format);\n\n // 2) Extract database schema to definition B\n $conn = $this->get_connection($format);\n $this->xml_content_b = $format::extract_schema($conn->get_dbhost(), $conn->get_dbport(), $conn->get_dbname(), $conn->get_dbuser(), $conn->get_dbpass());\n \n $this->write_xml_definition_to_disk();\n\n // 3) Compare and expect zero differences between A and B\n $this->apply_options($format);\n $format::build_upgrade($this->xml_file_a, $this->xml_file_b);\n \n $upgrade_stage1_schema1_sql = $this->get_script_compress(__DIR__ . '/testdata/upgrade_stage1_schema1.sql');\n $upgrade_stage2_data1_sql = $this->get_script_compress(__DIR__ . '/testdata/upgrade_stage2_data1.sql');\n $upgrade_stage3_schema1_sql = $this->get_script_compress(__DIR__ . '/testdata/upgrade_stage3_schema1.sql');\n $upgrade_stage4_data1_sql = $this->get_script_compress(__DIR__ . '/testdata/upgrade_stage4_data1.sql');\n\n // check for no differences as expressed in DDL / DML\n $this->assertEquals(\n 0,\n preg_match('/ALTER TABLE/i', $upgrade_stage1_schema1_sql),\n \"ALTER TABLE token found in upgrade_stage1_schema1_sql\"\n );\n\n $this->assertEquals(\n 0,\n preg_match('/INSERT INTO/i', $upgrade_stage2_data1_sql),\n \"INSERT INTO token found in upgrade_stage2_data1_sql\"\n );\n\n $this->assertEquals(\n 0,\n preg_match('/ALTER TABLE/i', $upgrade_stage3_schema1_sql),\n \"ALTER TABLE token found in upgrade_stage3_schema1_sql\"\n );\n \n $this->assertEquals(\n 0,\n preg_match('/DELETE FROM/i', $upgrade_stage4_data1_sql),\n \"DELETE FROM token found in upgrade_stage4_data1_sql\"\n );\n \n \n // 4) Check for and validate tables in resultant XML definiton\n $this->compare_xml_definition();\n }", "public function testFormattingCurrencyForDisplayTwoMinorUnits(): void\n {\n // Format Australian Dollar, ensure all locales return two minor units, rounded decimal value\n $formatter = new Formatter('12345.0686', 'AUD');\n self::assertSame(\n \"\\u{661}\\u{662}\\u{66C}\\u{663}\\u{664}\\u{665}\\u{66B}\\u{660}\\u{667} \\u{24}\",\n $formatter->currency('ar_OM')\n );\n self::assertSame(\"\\u{24} 12345.07\", $formatter->currency('zh_CN'));\n self::assertSame(\"\\u{24}12,345.07\", $formatter->currency('en_AU'));\n self::assertSame(\"12 345,07 \\u{24}\", $formatter->currency('fr_FR'));\n self::assertSame(\"\\u{24} 12345.07\", $formatter->currency('ja_JP'));\n self::assertSame(\"\\u{24} 12.345,07\", $formatter->currency('nl_NL'));\n }", "public function testGetPackingPlanFiles()\n {\n }", "public function testConvertMethodWrongAmount()\n {\n \t$currencyExchangeRateMock = $this->getMockBuilder(\"App\\Models\\CurrencyExchangeRateService\")->getMock();\n\t\t$currencyExchangeRateMock->expects($this->any())\n \t\t->method(\"getExchangeRate\")\n \t\t->will($this->returnValue(1.0));\n\n\t\t$currencyConverter = new DefaultCurrencyConverter($currencyExchangeRateMock);\n\n\t\t$this->assertFalse($currencyConverter->convert('€','any'));\n\n }", "public function testBillingInvoices()\n {\n }", "public function conversionTestingDataProvider() {}", "public function testBillingSources()\n {\n }", "public function testTotalMonthlyPrice()\n {\n }" ]
[ "0.5964622", "0.5870878", "0.5851829", "0.56087345", "0.5564031", "0.53346336", "0.5330392", "0.52736604", "0.5258975", "0.5249891", "0.5247122", "0.52373534", "0.52170336", "0.5155863", "0.51388574", "0.5113374", "0.5096453", "0.5091185", "0.50792253", "0.5064575", "0.50594026", "0.5034979", "0.50185066", "0.50093454", "0.499467", "0.4991392", "0.49799275", "0.49612403", "0.49535736", "0.49335676" ]
0.59457326
1
Use only one locale to test the skeleton output.
public function testSkeleton(): void { $localeToTest = 'en'; $tests = $this->currencyPermutationsWithLocales(); $results = []; $localeTests = []; foreach ($tests as $test => $parameters) { if ($parameters['locale'] === $localeToTest) { $localeTests[$test] = $parameters['options']; } } foreach ($localeTests as $test => $options) { $locale = new Locale($localeToTest); $formatOptions = new NumberFormatOptions($options); $formatter = new NumberFormat($locale, $formatOptions); $results[$test] = [ 'skeleton' => $formatter->getSkeleton(), ]; } $this->assertMatchesJsonSnapshot($results); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function determine_locale()\n {\n }", "public function locale();", "public function testLocale()\n {\n $f = new Formatter(['locale' => 'en-US']);\n $this->assertEquals('en-US', $f->locale);\n\n // if not, take from application\n $f = new Formatter();\n $this->assertEquals('ru-RU', $f->locale);\n }", "function getDefaultLocale();", "public function isTestLocale() {\n return false;\n }", "public function settingLocale() {}", "public function testRenderWithNonDefaultLocale()\n {\n $result = $this->render();\n $this->assertMatchesRegularExpression('/<span>Nordamerikanische Westküsten-Normalzeit/', $result);\n }", "public function getDefaultLocale();", "public function testRenderWithDefaultLocale()\n {\n $result = $this->render();\n $this->assertMatchesRegularExpression('/<span>Pacific Standard Time/', $result);\n }", "function is_locale_switched()\n {\n }", "public function testSystemLocalization()\n {\n foreach ($this->testLocales as $locale) {\n Localization::changeLocale($locale);\n\n foreach ($this->testAddresses as $data) {\n $country = $this->getCountryNameWithLocale(\n $data['source']['country'],\n $locale\n );\n $expected = $this->getExpectedFormatWithLocale(\n $data,\n 'text',\n $locale\n );\n\n $formatted = $this->addressFormat->format(\n $data['source'],\n 'text'\n );\n\n $this->assertEquals($expected, $formatted);\n }\n }\n\n Localization::changeLocale(Localization::BASE_LOCALE);\n }", "public function getLocale() {}", "function getLocale();", "abstract public function getLocaleName();", "function default_locale()\n{\n return Config::getDefaultLocale();\n}", "public function initWriter( $locale );", "private function initLocale()\n {\n if (!$this->initialised) {\n putenv(\"LANG=$this->locale\");\n setlocale(LC_ALL, $this->locale);\n\n $this->initialised = true;\n }\n }", "public function getLocale();", "public function getLocale();", "public function displayCorrectLocale()\n {\n $message = new CustomerMessage('de_DE');\n $this->assertEquals('de_DE', $message->getLocale());\n }", "public function displayDefaultMessageOutputEn()\n {\n // initialize the class with defaults (en_US locale, library path).\n $message = new CustomerMessage();\n\n // we expect the default message, because error 987.654.321 might not exist\n // in the default locale file en_US.csv.\n $this->assertEquals(\n 'An unexpected error occurred. Please contact us to get further information.',\n $message->getMessage('987.654.321')\n );\n }", "protected function initializeL10nLocales() {}", "function switch_to_locale($locale)\n {\n }", "public function getLocale(): string;", "public function getLocale(): string;", "public function getLocale(): string;", "public function testLanguageConsistency(): void\n\t{\n\t\tstatic::assertEquals('en', app()->getLocale());\n\t\tstatic::assertEquals('OK', __('lychee.SUCCESS'));\n\n\t\t$msgSection = (new ConsoleOutput())->section();\n\n\t\t$englishDictionary = include base_path('lang/en/lychee.php');\n\t\t$availableDictionaries = config('app.supported_locale');\n\t\t$failed = false;\n\n\t\tforeach ($availableDictionaries as $locale) {\n\t\t\t$dictionary = include base_path('lang/' . $locale . '/lychee.php');\n\t\t\t$missingKeys = array_diff_key($englishDictionary, $dictionary);\n\t\t\tforeach ($missingKeys as $key => $value) {\n\t\t\t\t$msgSection->writeln(sprintf('<comment>Error:</comment> Locale %s misses the following key: %s', str_pad($locale, 8), $key));\n\t\t\t\t$failed = true;\n\t\t\t}\n\n\t\t\t$extraKeys = array_diff_key($dictionary, $englishDictionary);\n\t\t\tforeach ($extraKeys as $key => $value) {\n\t\t\t\t$msgSection->writeln(sprintf('<comment>Error:</comment> Locale %s has the following extra key: %s', str_pad($locale, 8), $key));\n\t\t\t\t$failed = true;\n\t\t\t}\n\t\t}\n\t\tstatic::assertFalse($failed);\n\t}", "public function testFindSingleLocale(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->addBehavior('Translate', ['fields' => ['title', 'body']]);\n\n $table->setLocale('eng');\n $results = $table->find()->all()->combine('title', 'body', 'id')->toArray();\n $expected = [\n 1 => ['Title #1' => 'Content #1'],\n 2 => ['Title #2' => 'Content #2'],\n 3 => ['Title #3' => 'Content #3'],\n ];\n $this->assertSame($expected, $results);\n\n $entity = $table->newEntity(['author_id' => 2, 'title' => 'Title 4', 'body' => 'Body 4']);\n $table->save($entity);\n\n $results = $table->find('all', locale: 'cze')\n ->select(['id', 'title', 'body'])\n ->disableHydration()\n ->orderByAsc('Articles.id')\n ->toArray();\n $expected = [\n ['id' => 1, 'title' => 'Titulek #1', 'body' => 'Obsah #1', '_locale' => 'cze'],\n ['id' => 2, 'title' => 'Titulek #2', 'body' => 'Obsah #2', '_locale' => 'cze'],\n ['id' => 3, 'title' => 'Titulek #3', 'body' => 'Obsah #3', '_locale' => 'cze'],\n ['id' => 4, 'title' => null, 'body' => null, '_locale' => 'cze'],\n ];\n $this->assertSame($expected, $results);\n }", "function restore_current_locale()\n {\n }", "function locale_emulation()\r\n\t{\r\n\t\tglobal $EMULATEGETTEXT;\r\n\t\treturn $EMULATEGETTEXT;\r\n\t}" ]
[ "0.6591897", "0.6445888", "0.6383849", "0.6293422", "0.60938704", "0.6076018", "0.6069189", "0.60458046", "0.60306793", "0.60245323", "0.59586793", "0.5957089", "0.5869202", "0.58655906", "0.5857572", "0.5853094", "0.58461004", "0.58086514", "0.58086514", "0.5803839", "0.576747", "0.5717783", "0.5716147", "0.57097197", "0.57097197", "0.57097197", "0.56598055", "0.56400937", "0.5627356", "0.5619366" ]
0.70959556
0
Enables query and result cache by setting maximum number of cached results. Default cached queries limit is 20.
public function enableCashing(int $maxCachedQueries = 20): void { $this->maxCachedQueries = $maxCachedQueries; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setMaxResults($maxResults);", "public static function setQueryLimit($limit){\t\t\n\t\t//reset the queryCount\n\t\tself::$queryCount = 0;\n\t\t\n\t\tself::$queryLimit = $limit;\n }", "public function setQueryLimit($limit) {\n\t\t$this->queryLimit = (integer) $limit;\n\t}", "public function setLimit($x) { $this->limit = $x; }", "public function set_limit($limit);", "private function setNumResults()\n\t{\n\t\t$this->numResults = (int) count($this->data);\n\t}", "private function selectLimit(){\n $result=parent::selectSomething('*', 'config');\n $row=mysqli_fetch_object($result);\n $this->limit=$row->answersperpage;\n }", "function allWithLimit() {\n\n }", "public function hasMaxCache(){\n return $this->_has(2);\n }", "function updateLimitEnabled()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }", "public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }", "public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }", "public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }", "public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }", "public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }", "public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }", "public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }", "public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }", "public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }", "public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }", "public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }", "public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }", "public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }", "public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }", "public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }", "public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }", "public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }", "public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }", "public function setMaxResults($value)\n {\n return $this->set('MaxResults', $value);\n }" ]
[ "0.6346632", "0.61457974", "0.58302087", "0.5726852", "0.5671152", "0.5654038", "0.5644081", "0.5609065", "0.5536352", "0.5520787", "0.5504827", "0.5504827", "0.550429", "0.550429", "0.550429", "0.550429", "0.5503615", "0.5503615", "0.5503615", "0.5503615", "0.55024916", "0.55024916", "0.55024916", "0.55024916", "0.55024916", "0.55024916", "0.55024916", "0.55024916", "0.55024916", "0.55024916" ]
0.66093946
0
/ Private functions Creates SQL/PDO task to execute nad runs it.
private function createTask() { $query = $this->createQuery(); echo $query; $task = $this->database->prepare($query); $task->execute($this->queryProperty->getWhereArgs()); return $task; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function executeTasks() {}", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "function createTask($taskName, $task_status, $task_time, $list_id) {\n if (isset($taskName)) {\n $dbconn = DBconnection();\n \n // prepares the statement to create the tasks\n $query = $dbconn->prepare(\"INSERT INTO Tasks (task_name, list_id, task_time, task_status) VALUES (:task_name, :list_id, :task_time, :task_status)\");\n $query->bindParam(':task_name', $taskName);\n $query->bindParam(':list_id', $list_id);\n $query->bindParam(':task_time', $task_time);\n $query->bindParam(':task_status', $task_status);\n $query->execute();\n }\n return $query;\n\n}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}" ]
[ "0.681511", "0.6628601", "0.6628601", "0.6628601", "0.6628601", "0.6628601", "0.6628601", "0.6628601", "0.6628601", "0.6628601", "0.6628601", "0.6628601", "0.6628601", "0.6628601", "0.6628601", "0.6628601", "0.66015124", "0.65369254", "0.65369254", "0.65369254", "0.65369254", "0.65369254", "0.65369254", "0.65367913", "0.65367913", "0.65367913", "0.65367913", "0.65367913", "0.65367913", "0.65367913" ]
0.73869437
0
Add state with the premise that the country has to be added already
public function addState(CountryInterface $country, $stateCode, $stateName);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addstate() {\n $clang = Yii::app()->lang;\n\n if (!Permission::model()->hasGlobalPermission('Regions', 'create')) {\n Yii::app()->setFlashMessage($clang->gT(\"You do not have sufficient rights to access this page.\"), 'error');\n $this->getController()->redirect(array(\"admin/index\"));\n }\n $new_state = flattenText(Yii::app()->request->getPost('new_state'), false, true);\n $country_name = (int) Yii::app()->request->getPost(\"country_name\");\n $zonelist = Yii::app()->request->getPost(\"zonelist\");\n $aData = array();\n if (empty($new_state)) {\n $aViewUrls['message'] = array('title' => $clang->gT(\"Failed to add State\"), 'message' => $clang->gT(\"A state was not supplied or the state is invalid.\"), 'class' => 'warningheader');\n } elseif ($country_name == 0) {\n $aViewUrls['message'] = array('title' => $clang->gT(\"Failed to add State\"), 'message' => $clang->gT(\"A country was not supplied or the country is invalid.\"), 'class' => 'warningheader');\n } elseif ($zonelist == 'zoneselect') {\n $aViewUrls['message'] = array('title' => $clang->gT(\"Failed to add State\"), 'message' => $clang->gT(\"A zone was not supplied or the zone is invalid.\"), 'class' => 'warningheader');\n } elseif ($zonelist == '0') {\n $aViewUrls['message'] = array('title' => $clang->gT(\"Failed to add State\"), 'message' => $clang->gT(\"A zone was not supplied or the zone is invalid.\"), 'class' => 'warningheader');\n } elseif (State::model()->findByAttributes(array('state_Name' => $new_state, 'zone_id' => $zonelist))) {\n $aViewUrls['message'] = array('title' => $clang->gT(\"Failed to add State\"), 'message' => $clang->gT(\"The State already exists.\"), 'class' => 'warningheader');\n } else {\n $iNewUID = State::model()->instState($new_state, $zonelist);\n if ($iNewUID) {\n Yii::app()->setFlashMessage($clang->gT(\"State added successfully\"));\n $this->getController()->redirect(array(\"admin/state/index\"));\n } else {\n $aViewUrls['mboxwithredirect'][] = $this->_messageBoxWithRedirect($clang->gT(\"Failed to add state\"), $clang->gT(\"The state already exists.\"), 'warningheader');\n }\n }\n\n $this->_renderWrappedTemplate('region/state', $aViewUrls, $aData);\n }", "private function addUsStates(CountryInterface $country)\r\n {\r\n $states = array(\r\n 'AL' => 'Alabama',\r\n 'AK' => 'Alaska',\r\n 'AZ' => 'Arizona',\r\n 'AR' => 'Arkansas',\r\n 'CA' => 'California',\r\n 'CO' => 'Colorado',\r\n 'CT' => 'Connecticut',\r\n 'DE' => 'Delaware',\r\n 'DC' => 'District Of Columbia',\r\n 'FL' => 'Florida',\r\n 'GA' => 'Georgia',\r\n 'HI' => 'Hawaii',\r\n 'ID' => 'Idaho',\r\n 'IL' => 'Illinois',\r\n 'IN' => 'Indiana',\r\n 'IA' => 'Iowa',\r\n 'KS' => 'Kansas',\r\n 'KY' => 'Kentucky',\r\n 'LA' => 'Louisiana',\r\n 'ME' => 'Maine',\r\n 'MD' => 'Maryland',\r\n 'MA' => 'Massachusetts',\r\n 'MI' => 'Michigan',\r\n 'MN' => 'Minnesota',\r\n 'MS' => 'Mississippi',\r\n 'MO' => 'Missouri',\r\n 'MT' => 'Montana',\r\n 'NE' => 'Nebraska',\r\n 'NV' => 'Nevada',\r\n 'NH' => 'New Hampshire',\r\n 'NJ' => 'New Jersey',\r\n 'NM' => 'New Mexico',\r\n 'NY' => 'New York',\r\n 'NC' => 'North Carolina',\r\n 'ND' => 'North Dakota',\r\n 'OH' => 'Ohio',\r\n 'OK' => 'Oklahoma',\r\n 'OR' => 'Oregon',\r\n 'PA' => 'Pennsylvania',\r\n 'RI' => 'Rhode Island',\r\n 'SC' => 'South Carolina',\r\n 'SD' => 'South Dakota',\r\n 'TN' => 'Tennessee',\r\n 'TX' => 'Texas',\r\n 'UT' => 'Utah',\r\n 'VT' => 'Vermont',\r\n 'VA' => 'Virginia',\r\n 'WA' => 'Washington',\r\n 'WV' => 'West Virginia',\r\n 'WI' => 'Wisconsin',\r\n 'WY' => 'Wyoming'\r\n );\r\n\r\n $this->addProvinces($country, $states); \r\n }", "function insert_state($state) {\n if (!RefineData::isStateExists($state)) {\n RefineData::insertState(remove_numbers($state));\n }\n}", "public static function add_country_code() {\n\n $taxamo = taxedd_get_country_code();\n\n if ( $taxamo && isset( $taxamo->country_code ) ) {\n ?>\n <input class=\"edd-country\" type=\"hidden\" name=\"edd_country\" id=\"edd-country\" value=\"<?php echo $taxamo->country_code; ?>\"/>\n <?php\n }\n }", "public function insertStatesAction() {\n $repository = $this->get('doctrine_mongodb')->getRepository('ProductBundle:Country');\n $name = 'INDIA';\n $india = $repository->findOneByName($name);\n $name = 'USA';\n $usa = $repository->findOneByName($name);\n $name = 'UK';\n $uk = $repository->findOneByName($name);\n \n $cal = new States();\n $cal->setState('Karnataka');\n $cal->setCountry($india);\n $dm = $this->get('doctrine_mongodb')->getManager();\n $dm->persist($cal);\n $dm->flush();\n \n return new Response('Created state with id: '. $cal->getId());\n }", "public function actionAddCountryCode()\n {\n Loads::addCountryCode();\n }", "public function add_state()\n {\n $w = $this->session->userdata('ware');\n $admin = $this->session->userdata('admin');\n\n if (empty($admin))\n redirect('admin');\n\n $addState_country_name = $_POST['addState_country1'];\n $addState_state = $_POST['addState_state1'];\n\n\n $name = $this->common_model->singleRowSpecificTwoCondition('sett_country','p_id',$addState_country_name,'name',$addState_state,'name');\n if($name == $addState_state){\n echo 2;\n }else{\n $data = array(\n \"name\" => $addState_state,\n \"p_id\" => $addState_country_name,\n \"type\" => 2,\n \"ware\" => $w,\n \"pby\" => $admin,\n );\n $this->db->insert('sett_country', $data);\n echo 1;\n }\n }", "function wc_ru_regions_add_counties( $states ) {\n\n $states['RU'] = array(\n 'AD' => 'Республика Адыгея (Адыгея)',\n 'BA' => 'Республика Башкортостан',\n 'BU' => 'Республика Бурятия',\n 'AL' => 'Республика Алтай',\n 'DA' => 'Республика Дагестан',\n 'IN' => 'Республика Ингушетия',\n 'KABA' => 'Кабардино-Балкарская Республика',\n 'KA' => 'Республика Калмыкия',\n 'KACH' => 'Карачаево-Черкесская Республика',\n 'KAR' => 'Республика Карелия',\n 'KOM' => 'Республика Коми',\n 'MAR' => 'Республика Марий Эл',\n 'MOR' => 'Республика Мордовия',\n 'SAH' => 'Республика Саха (Якутия)',\n 'SEV' => 'Республика Северная Осетия - Алания',\n 'TAT' => 'Республика Татарстан (Татарстан)',\n 'TI' => 'Республика Тыва',\n 'UD' => 'Удмуртская Республика',\n 'HA' => 'Республика Хакасия',\n 'CHE' => 'Чеченская Республика',\n 'CHU' => 'Чувашская Республика - Чувашия',\n 'ALT' => 'Алтайский край',\n 'KRD' => 'Краснодарский край',\n 'KRY' => 'Красноярский край',\n 'PRI' => 'Приморский край',\n 'STA' => 'Ставропольский край',\n 'HAB' => 'Хабаровский край',\n 'AM' => 'Амурская область',\n 'AR' => 'Архангельская область',\n 'AS' => 'Астраханская область',\n 'BE' => 'Белгородская область',\n 'BR' => 'Брянская область',\n 'VL' => 'Владимирская область',\n 'VG' => 'Волгоградская область',\n 'VOG' => 'Вологодская область',\n 'VR' => 'Воронежская область',\n 'IV' => 'Ивановская область',\n 'IR' => 'Иркутская область',\n 'KON' => 'Калининградская область',\n 'KLG' => 'Калужская область',\n 'KM' => 'Камчатский край',\n 'KE' => 'Кемеровская область',\n 'KI' => 'Кировская область',\n 'KO' => 'Костромская область',\n 'KU' => 'Курганская область',\n 'KUR' => 'Курская область',\n 'LEO' => 'Ленинградская область',\n 'LI' => 'Липецкая область',\n 'MA' => 'Магаданская область',\n 'MO' => 'Московская область',\n 'MU' => 'Мурманская область',\n 'NI' => 'Нижегородская область',\n 'NO' => 'Новгородская область',\n 'NOV' => 'Новосибирская область',\n 'OM' => 'Омская область',\n 'OR' => 'Оренбургская область',\n 'ORL' => 'Орловская область',\n 'PEN' => 'Пензенская область',\n 'PER' => 'Пермский край',\n 'PS' => 'Псковская область',\n 'RO' => 'Ростовская область',\n 'RY' => 'Рязанская область',\n 'SA' => 'Самарская область',\n 'SAR' => 'Саратовская область',\n 'SHL' => 'Сахалинская область',\n 'SV' => 'Свердловская область',\n 'SM' => 'Смоленская область',\n 'TA' => 'Тамбовская область',\n 'TV' => 'Тверская область',\n 'TO' => 'Томская область',\n 'TU' => 'Тульская область',\n 'TY' => 'Тюменская область',\n 'UL' => 'Ульяновская область',\n 'CH' => 'Челябинская область',\n 'ZA' => 'Забайкальский край',\n 'YA' => 'Ярославская область',\n 'DC' => 'г. Москва',\n 'LE' => 'Санкт-Петербург',\n 'EV' => 'Еврейская автономная область',\n 'NE' => 'Ненецкий автономный округ',\n 'HAN' => 'Ханты-Мансийский автономный округ - Югра',\n 'CHK' => 'Чукотский автономный округ',\n 'YM' => 'Ямало-Ненецкий автономный округ',\n 'KRM' => 'Республика Крым',\n 'SVS' => 'Севастополь',\n 'OTH' => 'Иные территории, включая город и космодром Байконур',\n );\n return $states;\n\n}", "public function addProvince(StateInterface $state, $provinceCode, $provinceName);", "private function Geolocation_RegisterCountry( $country ) {\n\t\tif ( array_key_exists( $country, $this->countries ) ) {\n\t\t\t// 3b. otherwise increase that city and country's value by 1\n\t\t\t$this->countries[$country] ++;\n\t\t} else {\n\t\t\t// 3a. if that city and country doesn't exist, create a key in an array for that city and country, and set its number to 1\n\t\t\t$this->countries[$country] = 1;\n\t\t}\n\t}", "protected function addCountry($form, $country = null) {\n $form->add('country', 'entity', array(\n 'class' => 'DaVinci\\TaxiBundle\\Entity\\Admin\\CountryCity',\n 'property' => 'country',\n 'empty_value' => 'form.please_select',\n 'translation_domain' => 'FOSUserBundle',\n //'property_path' => 'country',\n 'mapped' => false,\n 'data' => $country, \n 'query_builder' => function(EntityRepository $er) use ($country){\n \n if($country) \n {\n //use passed to post country\n $cc = $country->getCountryCode();\n $ci = $country->getId();\n \n return $er->createQueryBuilder('c')->select('c')->where('c.status = 1')->andWhere('(c.countryCode != ?1 OR c.id = ?2)')->groupBy('c.countryCode')->orderBy('c.countryCode', 'ASC')->setParameters(array(1 => $cc, 2 => $ci));\n }\n else\n return $er->createQueryBuilder('c')->select('c')->where('c.status = 1')->groupBy('c.countryCode')->orderBy('c.countryCode', 'ASC');\n }));\n }", "abstract public function country();", "public function setCountry($newCountry){\n\t}", "function addInstitution($name, $country){\n\n\t\t$this->connection->query(\"INSERT INTO institution (inst_name, inst_country) VALUES ('$name','$country')\", true);\n\t\tif($_SESSION['query']){\n\t\t\treturn \"Institution Successfully Added\";\n\t\t}else{\n\t\t\treturn \"Failed to add institution!\";\t\t\n\t\t}\t\n\n\t}", "function insert_district($state, $district) {\n if (!RefineData::isDistrictExists($district)) {\n $stid = RefineData::getStateId(substr($state, 0, 5));\n RefineData::insertDistrict($stid, $district);\n }\n}", "function addstates($stateid,$statedescription,$statusstate)\n\t{\n\t\t$names = array('name' => $stateid ,'description' => $statedescription, 'status' => $statusstate);\n\t\t$add_query = $this->insert( 'states', $names );\n\t\tif( $add_query )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function additionCountry()\n {\n global $dbh;\n $sql = $dbh->prepare(\"INSERT INTO `country`(`nameya`, `nameye`, `delety`)VALUES('$this->nameya' ,'$this->nameye' ,'$this->delety')\");\n $result = $sql->execute();\n $idy = $dbh->lastInsertId();\n return array ($result,$idy);\n }", "protected function integrateStates()\n {\n $states = [\n ['_id' => 1, 'name' => 'Andalucía'],\n ['_id' => 2, 'name' => 'Aragón'],\n ['_id' => 3, 'name' => 'Principado de Asturias'],\n ['_id' => 4, 'name' => 'Islas Baleares'],\n ['_id' => 5, 'name' => 'Canarias'],\n ['_id' => 6, 'name' => 'Cantabria'],\n ['_id' => 7, 'name' => 'Castilla y León'],\n ['_id' => 8, 'name' => 'Castilla - La Mancha'],\n ['_id' => 9, 'name' => 'Cataluña'],\n ['_id' => 10, 'name' => 'Comunitat Valenciana'],\n ['_id' => 11, 'name' => 'Extremadura'],\n ['_id' => 12, 'name' => 'Galicia'],\n ['_id' => 13, 'name' => 'Comunidad de Madrid'],\n ['_id' => 14, 'name' => 'Región de Murcia'],\n ['_id' => 15, 'name' => 'Comunidad Foral de Navarra'],\n ['_id' => 16, 'name' => 'País Vasco'],\n ['_id' => 17, 'name' => 'La Rioja'],\n ['_id' => 18, 'name' => 'Ceuta'],\n ['_id' => 19, 'name' => 'Melilla'],\n ];\n\n foreach ($states as $sData) {\n $state = new State([\n 'name' => $sData['name'],\n 'country_id' => $this->countryId\n ]);\n if ($state->save() === false) {\n throw new SaveException($state);\n }\n }\n }", "public function country_add() {\n\n $post = $this->input->post();\n \n $this->form_validation->set_rules('country', 'country' , 'required|is_unique[country.country]');\n $this->form_validation->set_rules('territory', 'territory' , 'required');\n $this->form_validation->set_error_delimiters('<span class=\"text-danger\">','</span>');\n\n\t\tif(!empty($post) && $this->form_validation->run() ==FALSE) {\n\t\t\t \n\t\t\t $this->session->set_flashdata('error', 'Validation error. Please check the form.');\n\t\t\t $this->load->model('Datype_model');\n\t\t\t\t$data[\"admins\"] = $this->Datype_model->getCountry();\n\t\t\t\t$this->load->view('header');\n\t\t\t\t$this->load->view('masters/country', $data);\n\t\t\t\t$this->load->view('footer');\n \n\t\t} else {\n \n\t\t\t$table_array = array(\"country\" =>$_POST[\"country\"], \"territory\" =>$_POST[\"territory\"]);\n\t\t\t$this->db->insert('country' , $table_array);\n\t\t\t$inserted = $this->db->insert_id();\n\t\t\tif(!empty($inserted)) {\n\t\t\t\t$this->session->set_flashdata('success', 'Country added successfully!.');\n\t\t\t\treturn redirect(base_url().'masters/country');\n\t\t\t} else {\n\t\t\t\t$this->session->set_flashdata('error', 'Technical error!.');\n\t\t\t\treturn redirect(base_url().'masters/country');\n\t\t\t}\n\t\t}\n\n\n\n\n\t\t\n\t}", "public function addState(StateInterface $state): void;", "public static function AddCountry($arFields)\n\t{\n\t\tglobal $DB;\n\n\t\tif (!CSaleLocation::CountryCheckFields(\"ADD\", $arFields))\n\t\t\treturn false;\n\n\t\tif(self::isLocationProMigrated())\n\t\t{\n\t\t\treturn self::AddLocationUnattached('COUNTRY', $arFields);\n\t\t}\n\n\t\tforeach (GetModuleEvents('sale', 'OnBeforeCountryAdd', true) as $arEvent)\n\t\t{\n\t\t\tif (ExecuteModuleEventEx($arEvent, array($arFields))===false)\n\t\t\t\treturn false;\n\t\t}\n\n\t\t$arInsert = $DB->PrepareInsert(\"b_sale_location_country\", $arFields);\n\t\t$strSql =\n\t\t\t\"INSERT INTO b_sale_location_country(\".$arInsert[0].\") \".\n\t\t\t\"VALUES(\".$arInsert[1].\")\";\n\t\t$DB->Query($strSql, false, \"File: \".__FILE__.\"<br>Line: \".__LINE__);\n\n\t\t$ID = intval($DB->LastID());\n\n\t\t$db_lang = CLangAdmin::GetList('sort', 'asc', array(\"ACTIVE\" => \"Y\"));\n\t\twhile ($arLang = $db_lang->Fetch())\n\t\t{\n\t\t\tif ($arFields[$arLang['LID']])\n\t\t\t{\n\t\t\t\t$arInsert = $DB->PrepareInsert(\"b_sale_location_country_lang\", $arFields[$arLang[\"LID\"]]);\n\t\t\t\t$strSql =\n\t\t\t\t\t\"INSERT INTO b_sale_location_country_lang(COUNTRY_ID, \".$arInsert[0].\") \".\n\t\t\t\t\t\"VALUES(\".$ID.\", \".$arInsert[1].\")\";\n\t\t\t\t$DB->Query($strSql, false, \"File: \".__FILE__.\"<br>Line: \".__LINE__);\n\t\t\t}\n\t\t}\n\n\t\tforeach (GetModuleEvents('sale', 'OnCountryAdd', true) as $arEvent)\n\t\t\tExecuteModuleEventEx($arEvent, array($ID, $arFields));\n\n\t\treturn $ID;\n\t}", "function _addresses_validate_top_countries($element, &$form_state) {\n if (isset($element['#parents'][0])) {\n $field_name = $element['#parents'][0];\n }\n else {\n $field_name = 'addresses';\n }\n if (isset($form_state['values'][$field_name]['0']['country']) && $form_state['values'][$field_name]['0']['country'] == 'separator') {\n // the user selected the separator!\n $form_state['values'][$field_name]['0']['country'] = '';\n }\n elseif ($form_state['values'][$field_name]['country'] == 'separator') {\n // the user selected the separator!\n $form_state['values'][$field_name]['country'] = '';\n }\n elseif (isset($form_state['values'][$field_name]['0']['country']) && substr($form_state['values'][$field_name]['0']['country'], 0, 4) == 'top_') {\n $form_state['values'][$field_name]['0']['country'] = substr($form_state['values'][$field_name]['0']['country'], 4);\n }\n elseif (substr($form_state['values'][$field_name]['country'], 0, 4) == 'top_') {\n $form_state['values'][$field_name]['country'] = substr($form_state['values'][$field_name]['country'], 4);\n }\n}", "function wc_uk_counties_add_counties( $states ) {\n\n $states['GB'] = array(\n 'AV' => 'Avon',\n 'BE' => 'Bedfordshire',\n 'BK' => 'Berkshire',\n 'BU' => 'Buckinghamshire',\n 'CA' => 'Cambridgeshire',\n 'CH' => 'Cheshire',\n 'CL' => 'Cleveland',\n 'CO' => 'Cornwall',\n 'CD' => 'County Durham',\n 'CU' => 'Cumbria',\n 'DE' => 'Derbyshire',\n 'DV' => 'Devon',\n 'DO' => 'Dorset',\n 'ES' => 'East Sussex',\n 'EX' => 'Essex',\n 'GL' => 'Gloucestershire',\n 'HA' => 'Hampshire',\n 'HE' => 'Herefordshire',\n 'HT' => 'Hertfordshire',\n 'IW' => 'Isle of Wight',\n 'KE' => 'Kent',\n 'LA' => 'Lancashire',\n 'LE' => 'Leicestershire',\n 'LI' => 'Lincolnshire',\n 'LO' => 'London',\n 'ME' => 'Merseyside',\n 'MI' => 'Middlesex',\n 'NO' => 'Norfolk',\n 'NH' => 'North Humberside',\n 'NY' => 'North Yorkshire',\n 'NS' => 'Northamptonshire',\n 'NL' => 'Northumberland',\n 'NT' => 'Nottinghamshire',\n 'OX' => 'Oxfordshire',\n 'SH' => 'Shropshire',\n 'SO' => 'Somerset',\n 'SM' => 'South Humberside',\n 'SY' => 'South Yorkshire',\n 'SF' => 'Staffordshire',\n 'SU' => 'Suffolk',\n 'SR' => 'Surrey',\n 'TW' => 'Tyne and Wear',\n 'WA' => 'Warwickshire',\n 'WM' => 'West Midlands',\n 'WS' => 'West Sussex',\n 'WY' => 'West Yorkshire',\n 'WI' => 'Wiltshire',\n 'WO' => 'Worcestershire',\n 'ABD' => 'Scotland / Aberdeenshire',\n 'ANS' => 'Scotland / Angus',\n 'ARL' => 'Scotland / Argyle & Bute',\n 'AYR' => 'Scotland / Ayrshire',\n 'CLK' => 'Scotland / Clackmannanshire',\n 'DGY' => 'Scotland / Dumfries & Galloway',\n 'DNB' => 'Scotland / Dunbartonshire',\n 'DDE' => 'Scotland / Dundee',\n 'ELN' => 'Scotland / East Lothian',\n 'EDB' => 'Scotland / Edinburgh',\n 'FIF' => 'Scotland / Fife',\n 'GGW' => 'Scotland / Glasgow',\n 'HLD' => 'Scotland / Highland',\n 'LKS' => 'Scotland / Lanarkshire',\n 'MLN' => 'Scotland / Midlothian',\n 'MOR' => 'Scotland / Moray',\n 'OKI' => 'Scotland / Orkney',\n 'PER' => 'Scotland / Perth and Kinross',\n 'RFW' => 'Scotland / Renfrewshire',\n 'SB' => 'Scotland / Scottish Borders',\n 'SHI' => 'Scotland / Shetland Isles',\n 'STI' => 'Scotland / Stirling',\n 'WLN' => 'Scotland / West Lothian',\n 'WIS' => 'Scotland / Western Isles',\n 'AGY' => 'Wales / Anglesey',\n 'GNT' => 'Wales / Blaenau Gwent',\n 'CP' => 'Wales / Caerphilly',\n 'CF' => 'Wales / Cardiff',\n 'CAE' => 'Wales / Carmarthenshire',\n 'CR' => 'Wales / Ceredigion',\n 'CW' => 'Wales / Conwy',\n 'DEN' => 'Wales / Denbighshire',\n 'FLN' => 'Wales / Flintshire',\n 'GLA' => 'Wales / Glamorgan',\n 'GWN' => 'Wales / Gwynedd',\n 'MT' => 'Wales / Merthyr Tydfil',\n 'MON' => 'Wales / Monmouthshire',\n 'PT' => 'Wales / Neath Port Talbot',\n 'NP' => 'Wales / Newport',\n 'PEM' => 'Wales / Pembrokeshire',\n 'POW' => 'Wales / Powys',\n 'RT' => 'Wales / Rhondda Cynon Taff',\n 'SS' => 'Wales / Swansea',\n 'TF' => 'Wales / Torfaen',\n 'WX' => 'Wales / Wrexham',\n 'ANT' => 'Northern Ireland / County Antrim',\n 'ARM' => 'Northern Ireland / County Armagh',\n 'DOW' => 'Northern Ireland / County Down',\n 'FER' => 'Northern Ireland / County Fermanagh',\n 'LDY' => 'Northern Ireland / County Londonderry',\n 'TYR' => 'Northern Ireland / County Tyrone',\n );\n return $states;\n\n}", "public function requestCountry();", "function get_state_options_by_country($country) {\r\n\r\n /* $states = [\"India\" =>[ \"Tamil Nadu\",\"Kerala\", \"Andra Pradesh\" , \"Telungana\", \"Karnataka\"]];\r\n $options = $states[$country]; \r\n\treturn $options; */\r\n}", "public function addZipCode($postal) {\n // $postalc = new PostalCode();\n // $postalc = $postal;\n // $date = date_create($postal->getDate_create());\n // $date_new_create = date_format($date, \"Y-m-d H:m:s\");\n //print \"<pre>\";\n //print_r($obj);\n //print \"</pre>\";\n //exit();\n /* * *\n * Add new address to state_sp\n */\n $result = $this->db->insert('state_sp', array(\n 'postalcode' => $postal->getPostalcode(),\n 'street' => $postal->getStreet(),\n 'complement' => $postal->getComplement(),\n 'district' => $postal->getDistrict(),\n 'city' => $postal->getCity(),\n 'state' => $postal->getState(),\n 'country' => $postal->getCountry(),\n 'date_create' => $postal->getDate_create()\n ));\n //\n return $result;\n }", "function addNewCountry()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n else\n {\n $this->load->library('form_validation');\n \n $this->form_validation->set_rules('name','Name','trim|required|max_length[128]');\n \n if($this->form_validation->run() == FALSE)\n {\n $this->addNew();\n }\n else\n {\n $name = ucwords(strtolower($this->input->post('name')));\n \n $countryInfo = array('name'=> $name, 'status'=> 1, 'deleted'=> 2, 'created_by'=>$this->vendorId, 'create_time'=>date('Y-m-d H:i:s'));\n \n $this->load->model('country_model');\n $result = $this->country_model->addNewCountry($countryInfo);\n \n if($result > 0)\n {\n $this->session->set_flashdata('success', 'New Country created successfully');\n }\n else\n {\n $this->session->set_flashdata('error', 'Country creation failed');\n }\n \n redirect('admin/Country/addNew');\n }\n }\n }", "public function add_country_to_estimate($case_number = '')\n {\n $this->load->model('cases_model', 'cases');\n $this->load->model('estimates_model', 'estimates');\n $this->load->model('associates_model', 'associates');\n $array_of_country_id = explode(',', $_POST['new_estimate_country_id']);\n $this->associates->add_new_associates_to_case($case_number, $array_of_country_id);\n $case = $this->cases->find_case_by_number($case_number);\n if($case['is_intake'] =='1'){\n $this->cases->add_country_to_tracker($case_number,$array_of_country_id);\n }\n foreach ($array_of_country_id as $key => $country_id) {\n $_POST['new_estimate_country_id'] = $country_id;\n $this->estimates->add_country_to_estimate($case_number);\n $this->estimates->set_pm_save_time($case_number, NULL);\n }\n\n redirect('/cases/view/' . $case_number);\n }", "static function states()\n {\n return array(\n 'USA' => array('name' => 'United States',\n 'states' => array(\n 'AL'=>'ALABAMA',\n 'AK'=>'ALASKA',\n 'AZ'=>'ARIZONA',\n 'AR'=>'ARKANSAS',\n 'CA'=>'CALIFORNIA',\n 'CO'=>'COLORADO',\n 'CT'=>'CONNECTICUT',\n 'DE'=>'DELAWARE',\n 'DC'=>'DISTRICT OF COLUMBIA',\n 'FL'=>'FLORIDA',\n 'GA'=>'GEORGIA',\n 'HI'=>'HAWAII',\n 'ID'=>'IDAHO',\n 'IL'=>'ILLINOIS',\n 'IN'=>'INDIANA',\n 'IA'=>'IOWA',\n 'KS'=>'KANSAS',\n 'KY'=>'KENTUCKY',\n 'LA'=>'LOUISIANA',\n 'ME'=>'MAINE',\n 'MD'=>'MARYLAND',\n 'MA'=>'MASSACHUSETTS',\n 'MI'=>'MICHIGAN',\n 'MN'=>'MINNESOTA',\n 'MS'=>'MISSISSIPPI',\n 'MO'=>'MISSOURI',\n 'MT'=>'MONTANA',\n 'NE'=>'NEBRASKA',\n 'NV'=>'NEVADA',\n 'NH'=>'NEW HAMPSHIRE',\n 'NJ'=>'NEW JERSEY',\n 'NM'=>'NEW MEXICO',\n 'NY'=>'NEW YORK',\n 'NC'=>'NORTH CAROLINA',\n 'ND'=>'NORTH DAKOTA',\n 'OH'=>'OHIO',\n 'OK'=>'OKLAHOMA',\n 'OR'=>'OREGON',\n 'PA'=>'PENNSYLVANIA',\n 'PR'=>'PUERTO RICO',\n 'RI'=>'RHODE ISLAND',\n 'SC'=>'SOUTH CAROLINA',\n 'SD'=>'SOUTH DAKOTA',\n 'TN'=>'TENNESSEE',\n 'TX'=>'TEXAS',\n 'UT'=>'UTAH',\n 'VT'=>'VERMONT',\n 'VA'=>'VIRGINIA',\n 'WA'=>'WASHINGTON',\n 'WV'=>'WEST VIRGINIA',\n 'WI'=>'WISCONSIN',\n 'WY'=>'WYOMING'\n )\n ),\n 'CAN' => array('name' => 'Canada',\n 'states' => array(\n \"BC\"=>\"British Columbia\", \n \"ON\"=>\"Ontario\", \n \"NL\"=>\"Newfoundland and Labrador\", \n \"NS\"=>\"Nova Scotia\", \n \"PE\"=>\"Prince Edward Island\", \n \"NB\"=>\"New Brunswick\", \n \"QC\"=>\"Quebec\", \n \"MB\"=>\"Manitoba\", \n \"SK\"=>\"Saskatchewan\", \n \"AB\"=>\"Alberta\", \n \"NT\"=>\"Northwest Territories\", \n \"NU\"=>\"Nunavut\",\n \"YT\"=>\"Yukon Territory\"\n )\n )\n );\n }", "public function addState(StateInterface $state);" ]
[ "0.6905804", "0.65976435", "0.64965063", "0.63934594", "0.6323928", "0.6323273", "0.61978704", "0.60011256", "0.5988661", "0.59711146", "0.5956881", "0.593808", "0.5867185", "0.5817282", "0.5797978", "0.57608277", "0.57472676", "0.57372206", "0.57142234", "0.5654052", "0.5609199", "0.5590439", "0.5589151", "0.5580266", "0.55495846", "0.55381185", "0.5529918", "0.5508154", "0.549101", "0.5474851" ]
0.7326078
0
Add province with the premise that the state has to be added already
public function addProvince(StateInterface $state, $provinceCode, $provinceName);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function state($province=null)\n {\n\n $tblProvince = new App_Model_Db_Table_State();\n $row = $tblProvince->fetchAll();\n\n $select_province = \"<select name=\\\"province\\\" id=\\\"province\\\">\\n\";\n if ($province) {\n $rowProvince = $tblProvince->find($province)->current();\n $select_province .= \"<option value='$rowProvince->pid' selected>$rowProvince->pname</option>\";\n $select_province .= \"<option value =''>Choose:</option>\";\n } else {\n $select_province .= \"<option value ='' selected>Choose:</option>\";\n }\n\n foreach ($row as $rowset) {\n if (($province) and ($rowset->pid == $rowProvince->pid)) {\n continue;\n } else {\n $select_province .= \"<option value='$rowset->pid'>$rowset->pname</option>\";\n }\n }\n\n $select_province .= \"</select>\\n\\n\";\n return $select_province;\n }", "function _addresses_province_validate($form, &$form_state) {\n // Check if its a valid province.\n // It should be the Province code listed on the\n // given COUNTRY.inc file\n $province = $form['province']['#value'];\n $country = $form['country']['#value'];\n if (substr($country, 0, 4) == 'top_') {\n $country = substr($country, 4);\n }\n if ($country && $province) {\n $provinces = _addresses_province_get($country);\n if (empty($provinces[drupal_strtoupper($province)])) {\n\n // Get the province fieldname\n $field_name = $form['province']['#name'];\n $field_name = drupal_substr($field_name, 0, -1);\n $field_name = preg_replace('/([^]])\\[/', '\\1][', $field_name);\n\n $countries = _addresses_country_get();\n form_set_error($field_name, t('Could not find %province as a province from %country. Try to use the province abbreviation or number.', array(\n '%province' => $form['province']['#value'],\n '%country' => $countries[$country])));\n }\n }\n}", "function _addresses_province_field_validate($form, &$form_state) {\n // If province is not required and empty then prevent validation\n if (!$form['province']['#required'] && $form['province']['#value'] == '') {\n return;\n }\n\n $province = _addresses_province_valid(\n $form['country']['#value'],\n $form['province']['#value']\n );\n\n // If province is valid or if the country does not have any provinces\n if ($province || is_null($province)) {\n // Find array's key path to province field's value in $form_state\n $form_state_province =& $form_state['values'];\n foreach ($form['province']['#parents'] as $v) {\n $form_state_province =& $form_state_province[$v];\n }\n\n // Set province to ISO-3166-2 code (properly uppercased)\n $form_state_province = $province;\n }\n // Prevent inability to alter CCK fields in some instances\n elseif ($form_state['values']['form_id'] != 'content_field_edit_form') {\n // Get the province fieldname\n $field_name = $form['province']['#name'];\n $field_name = drupal_substr($field_name, 0, -1);\n $field_name = preg_replace('/([^]])\\[/', '\\1][', $field_name);\n\n $countries = _addresses_country_get();\n form_set_error($field_name, t('Could not find %province as a province from %country. Try to use the province abbreviation or number.', array(\n '%province' => $form['province']['#value'],\n '%country' => $countries[$form['country']['#value']])));\n }\n}", "function adstrue_vendor_add_provice() {\n return build_form_province();\n}", "public function addCity(ProvinceInterface $province, $cityName);", "public function setStateProvince($state_province)\n {\n $this->json()->state_province = $state_province;\n }", "function _addresses_province_ajax() {\n global $language;\n\n // ISO 3166-1 alpha-2 code of a country.\n $country = $_GET['country'];\n if (substr($country, 0, 4) == 'top_') {\n $country = substr($country, 4);\n }\n // HTML id attribute of select field.\n $field_id = $_GET['field_id'];\n // HTML name attribute of select field.\n $field_name = $_GET['field_name'];\n // HTML id attribute of province's wrapper.\n $passback = $_GET['passback'];\n // ISO-3166-2 code for the province or state to mark as selected.\n $province = $_GET['province'];\n\n // Check that required fields are supplied\n if (empty($field_id) || empty($field_name) || empty($passback)) {\n return drupal_json(array('error' => 'Invalid call'));\n }\n\n // $element is a form element we build below to get the needed HTML\n $element = array();\n // No need to use drupal_strtoupper() as ISO-3166-2 codes are latin based\n $element['#value'] = drupal_strtoupper($province);\n $element['#options'] = array();\n $provinces = array();\n $output = '';\n $hide = FALSE;\n\n if (!empty($country)) {\n module_load_include('inc', 'addresses');\n $provinces = _addresses_province_get($country);\n $element['#options'] = _addresses_province_get($country);\n }\n\n if (empty($provinces)) {\n $hide = TRUE;\n }\n\n // Generate province field HTML\n $output .= '<label for=\"'. $field_id .'\">'. t('State / Province: ') . '</label>';\n $output .= '<select id=\"'. $field_id .'\" name=\"'. $field_name\n .'\" class=\"addresses-province-field\">'\n . form_select_options($element) .'</select>';\n\n return drupal_json(array(\n 'field' => $output,\n 'passback' => $passback,\n 'hide' => $hide,\n ));\n}", "function addstate() {\n $clang = Yii::app()->lang;\n\n if (!Permission::model()->hasGlobalPermission('Regions', 'create')) {\n Yii::app()->setFlashMessage($clang->gT(\"You do not have sufficient rights to access this page.\"), 'error');\n $this->getController()->redirect(array(\"admin/index\"));\n }\n $new_state = flattenText(Yii::app()->request->getPost('new_state'), false, true);\n $country_name = (int) Yii::app()->request->getPost(\"country_name\");\n $zonelist = Yii::app()->request->getPost(\"zonelist\");\n $aData = array();\n if (empty($new_state)) {\n $aViewUrls['message'] = array('title' => $clang->gT(\"Failed to add State\"), 'message' => $clang->gT(\"A state was not supplied or the state is invalid.\"), 'class' => 'warningheader');\n } elseif ($country_name == 0) {\n $aViewUrls['message'] = array('title' => $clang->gT(\"Failed to add State\"), 'message' => $clang->gT(\"A country was not supplied or the country is invalid.\"), 'class' => 'warningheader');\n } elseif ($zonelist == 'zoneselect') {\n $aViewUrls['message'] = array('title' => $clang->gT(\"Failed to add State\"), 'message' => $clang->gT(\"A zone was not supplied or the zone is invalid.\"), 'class' => 'warningheader');\n } elseif ($zonelist == '0') {\n $aViewUrls['message'] = array('title' => $clang->gT(\"Failed to add State\"), 'message' => $clang->gT(\"A zone was not supplied or the zone is invalid.\"), 'class' => 'warningheader');\n } elseif (State::model()->findByAttributes(array('state_Name' => $new_state, 'zone_id' => $zonelist))) {\n $aViewUrls['message'] = array('title' => $clang->gT(\"Failed to add State\"), 'message' => $clang->gT(\"The State already exists.\"), 'class' => 'warningheader');\n } else {\n $iNewUID = State::model()->instState($new_state, $zonelist);\n if ($iNewUID) {\n Yii::app()->setFlashMessage($clang->gT(\"State added successfully\"));\n $this->getController()->redirect(array(\"admin/state/index\"));\n } else {\n $aViewUrls['mboxwithredirect'][] = $this->_messageBoxWithRedirect($clang->gT(\"Failed to add state\"), $clang->gT(\"The state already exists.\"), 'warningheader');\n }\n }\n\n $this->_renderWrappedTemplate('region/state', $aViewUrls, $aData);\n }", "public function setProvince($var)\n {\n GPBUtil::checkString($var, True);\n $this->province = $var;\n\n return $this;\n }", "public function setProvince($province)\r\n {\r\n $this->province = $province;\r\n\r\n return $this;\r\n }", "public function province()\n {\n \treturn $this->belongsTo(Province::class);\n }", "public function getProvince()\n {\n return $this->hasOne(Provinces::className(), ['id' => 'province_id']);\n }", "public function getProvince() {\n return $this->hasOne(Provinces::className(), ['id' => 'province_id']);\n }", "public function actionCreate()\n {\n\t\t\tif (Yii::$app->user->can('create-countries'))\n\t\t\t{\n\t\t\t\t$model = new Mtprovinces();\n\n if ($model->load(Yii::$app->request->post())) {\n\t\t\t\t\t$model->province_created = date('Y-m-d h:i:s');\n\t\t\t\t\t$model->province_status = 'ACTIVE';\n\t\t\t\t\t$model->province_updated = date('Y-m-d h:i:s');\n\t\t\t\t\t$model->save();\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new ForbiddenHttpException; \n\t\t\t}\n \n }", "function _addresses_province_valid($country, $province) {\n if (substr($country, 0, 4) == 'top_') {\n $country = substr($country, 4);\n }\n\n // Ensure that country code provided is valid\n if (!_addresses_country_valid($country)) {\n return FALSE;\n }\n\n $provinces = _addresses_province_get($country);\n\n // If the country chosen does not contain any provinces\n if (empty($provinces)) {\n return NULL;\n }\n\n // If $province provided matches ISO-3166-2 code.\n if ($provinces[strtoupper($province)]) {\n // Province supplied is ISO-3166-2 code.\n return $province;\n }\n\n // Flip array and change to lowercase to match names in key, can not use\n // array_search() or in_array() as they are case-sensitive.\n $provinces = array_change_key_case(array_flip($provinces));\n if ($provinces[strtolower($province)]) {\n // Return the ISO-3166-2 province code.\n return $provinces[strtolower($province)];\n }\n\n // $province provided did not return any valid matches.\n return FALSE;\n}", "public function getProvince()\n {\n return $this->hasOne(Province::className(), ['id' => 'province_id']);\n }", "private function setRegion()\n {\n if ( ! isset( $this->data['country'] ) ) {\n return;\n }\n \n if ( ! isset( $_POST['region'] ) ) {\n $this->data['error']['region'] = \"Please provide your province or state.\";\n $this->error = true;\n return;\n }\n \n $r = trim( $_POST['region'] );\n \n if ( $this->data['country'] == 'CA' ) {\n $regions = $this->regions->get('provinces');\n if ( ! array_key_exists($r, $regions ) ) {\n $this->data['error']['region'] = \"Please select your province.\";\n $this->error = true;\n return;\n }\n }\n elseif ( $this->data['country'] == 'US' ) {\n $regions = $this->regions->get('states');\n if ( ! array_key_exists($r, $regions ) ) {\n $this->data['error']['region'] = \"Please select your state.\";\n $this->error = true;\n return;\n }\n }\n \n $this->data['region'] = $r;\n }", "public function province(Province $province): StationDetailsBuilder;", "public function store(ProvinceCreateRequest $request)\n {\n\n $province = Province::create([\n 'name' => $request->name,\n ]);\n return (new ProvinceResource($province))->additional([\n 'errors' => null,\n ])->response()->setStatusCode(201);\n }", "public function getProvince($cod_regione)\n\t{\n\t\t//Avendo già specificato una regione, scegli tutte le provincie che\n\t\t//appartengono a quella regione (avendo il cod_regione)\n\t\t$query = \"SELECT * FROM province WHERE cod_regione = '\".$cod_regione.\"'\";\n\t\tif($result = parent::query($query))\n\t\t{\n\t\t\t//Se il risultato non è vuoto\n\t\t\tif($result->num_rows > 0)\n\t\t\t{\n\t\t\t\twhile($row = $result->fetch_array())\n\t\t\t\t{\n\t\t\t\t\t//Crea un array associativo delle provincie\n\t\t\t\t\t//due campi, codice della provincia e il nome\n\t\t\t\t\t$province[] = array(\n\t\t\t\t\t\t'codice' => $row['cod_provincia'],\n\t\t\t\t\t\t'nome' => $row['provincia']\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t//Ritorna il risultato\n\t\t\t\treturn $province;\n\t\t\t}\n\t\t}\n\t}", "public function run()\n {\n $provinces = array(\n array(\n 'id'=>1,\n 'name_en'=>'Banteay Meanchey',\n 'name_kh'=>'បន្ទាយមានជ័យ',\n 'name_fr'=>'Banteay Meanchey',\n 'code'=>'បជ',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 1,\n ),\n array(\n 'id'=>2,\n 'name_en'=>'Battambang',\n 'name_kh'=>'បាត់ដំបង',\n 'name_fr'=>'Battambang',\n 'code'=>'បប',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 2,\n ),\n array(\n 'id'=>3,\n 'name_en'=>'Kampong Cham',\n 'name_kh'=>'កំពង់ចាម',\n 'name_fr'=>'Kampong Cham',\n 'code'=>'កច',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 3,\n ),\n array(\n 'id'=>4,\n 'name_en'=>'Kampong Chhnang',\n 'name_kh'=>'កំពង់ឆ្នាំង',\n 'name_fr'=>'Kampong Chhnang',\n 'code'=>'កឆ្ន',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 4,\n ),\n array(\n 'id'=>5,\n 'name_en'=>'Kampong Speu',\n 'name_kh'=>'កំពង់ស្ពឺ',\n 'name_fr'=>'Kampong Speu',\n 'code'=>'កស្ព',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 5,\n ),\n array(\n 'id'=>6,\n 'name_en'=>'Kampong Thom',\n 'name_kh'=>'កំពង់ធំ',\n 'name_fr'=>'Kampong Thom',\n 'code'=>'កធ',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 6,\n ),\n array(\n 'id'=>7,\n 'name_en'=>'Kampot',\n 'name_kh'=>'កំពត',\n 'name_fr'=>'Kampot',\n 'code'=>'កព',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 7,\n ),\n array(\n 'id'=>8,\n 'name_en'=>'Kandal',\n 'name_kh'=>'កណ្តាល',\n 'name_fr'=>'Kandal',\n 'code'=>'កណ',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 8,\n ),\n array(\n 'id'=>9,\n 'name_en'=>'Koh Kong',\n 'name_kh'=>'កោះកុង',\n 'name_fr'=>'Koh Kong',\n 'code'=>'កក',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 9,\n ),\n array(\n 'id'=>10,\n 'name_en'=>'Kratie',\n 'name_kh'=>'ក្រចេះ',\n 'name_fr'=>'Kratié',\n 'code'=>'ក្រច',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 10,\n ),\n array(\n 'id'=>11,\n 'name_en'=>'Mondulkiri',\n 'name_kh'=>'មណ្ឌលគីរី',\n 'name_fr'=>'Mondulkiri',\n 'code'=>'មរ',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 11,\n ),\n array(\n 'id'=>12,\n 'name_en'=>'Phnom Penh',\n 'name_kh'=>'ភ្នំពេញ',\n 'name_fr'=>'Phnom Penh',\n 'code'=>'ភព',\n 'prefix'=>'រាជធានី',\n 'is_province' => true,\n 'locp_code' => 12,\n ),\n array(\n 'id'=>13,\n 'name_en'=>'Preah Vihear',\n 'name_kh'=>'ព្រះវិហារ',\n 'name_fr'=>'Preah Vihear',\n 'code'=>'ពហ',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 13,\n ),\n array(\n 'id'=>14,\n 'name_en'=>'Prey Veng',\n 'name_kh'=>'ព្រៃវែង',\n 'name_fr'=>'Prey Veng',\n 'code'=>'ពវ',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 14,\n ),\n array(\n 'id'=>15,\n 'name_en'=>'Pursat',\n 'name_kh'=>'ពោធិ៍សាត់',\n 'name_fr'=>'Pursat',\n 'code'=>'ពស',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 15,\n ),\n array(\n 'id'=>16,\n 'name_en'=>'Ratanakiri',\n 'name_kh'=>'រតនគីរី',\n 'name_fr'=>'Ratanakiri',\n 'code'=>'ររ',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 16,\n ),\n array(\n 'id'=>17,\n 'name_en'=>'Siem Reap',\n 'name_kh'=>'សៀមរាប',\n 'name_fr'=>'Siem Reap',\n 'code'=>'សរ',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 17,\n ),\n array(\n 'id'=>18,\n 'name_en'=>'Preah Sihanouk',\n 'name_kh'=>'ព្រះសីហនុ',\n 'name_fr'=>'Preah Sihanouk',\n 'code'=>'សនុ',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 18,\n ),\n array(\n 'id'=>19,\n 'name_en'=>'Stung Treng',\n 'name_kh'=>'ស្ទឹងត្រែង',\n 'name_fr'=>'Stung Treng',\n 'code'=>'សត',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 19,\n ),\n array(\n 'id'=>20,\n 'name_en'=>'Svay Rieng',\n 'name_kh'=>'ស្វាយរៀង',\n 'name_fr'=>'Svay Rieng',\n 'code'=>'ស្វរ',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 20,\n ),\n array(\n 'id'=>21,\n 'name_en'=>'Takeo',\n 'name_kh'=>'តាកែវ',\n 'name_fr'=>'Takéo',\n 'code'=>'តក',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 21,\n ),\n array(\n 'id'=>22,\n 'name_en'=>'Kep',\n 'name_kh'=>'កែប',\n 'name_fr'=>'Kep',\n 'code'=>'កែប',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 22,\n ),\n array(\n 'id'=>23,\n 'name_en'=>'Pailin',\n 'name_kh'=>'បៃលិន',\n 'name_fr'=>'Pailin',\n 'code'=>'បល',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 23,\n ),\n array(\n 'id'=>24,\n 'name_en'=>'Oddar Meanchey',\n 'name_kh'=>'ឧត្តរមានជ័យ',\n 'name_fr'=>'Oddar Meanchey',\n 'code'=>'ឧជ',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 24,\n ),\n array(\n 'id'=>25,\n 'name_en'=>'Tbong Khmum',\n 'name_kh'=>'ត្បូងឃ្មុំ',\n 'name_fr'=>'Tbong Khmum',\n 'code'=>'តឃ',\n 'prefix'=>'ខេត្ត',\n 'is_province' => true,\n 'locp_code' => 25,\n ),\n array(\n 'id'=>26,\n 'name_en'=>'Ministry of Education',\n 'name_kh'=>'ក្រសួងអប់រំយុវជន និង កីឡា',\n 'name_fr'=>'Ministère éducation',\n 'code'=>'អយក',\n 'prefix'=>'ក្រសួង',\n 'is_province' => false,\n 'locp_code' => 26,\n ),\n array(\n 'id'=>27,\n 'name_en'=>'',\n 'name_kh'=>'កម្ពុជាក្រោម',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'',\n 'is_province' => false,\n 'locp_code' => 27,\n ),\n array(\n 'id'=>31,\n 'name_en'=>'',\n 'name_kh'=>'ខាវអ៊ីដាង',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ជំរុំ',\n 'is_province' => false,\n 'locp_code' => 31,\n ),\n array(\n 'id'=>32,\n 'name_en'=>'',\n 'name_kh'=>'ព្រះត្រពាំង',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ខេត្ត',\n 'is_province' => false,\n 'locp_code' => 32,\n ),\n array(\n 'id'=>33,\n 'name_en'=>'',\n 'name_kh'=>'សូរិន្ទ',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ខេត្ត',\n 'is_province' => false,\n 'locp_code' => 33,\n ),\n array(\n 'id'=>34,\n 'name_en'=>'',\n 'name_kh'=>'ជាយដែនកម្ពុជា-ថៃ',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ជំរុំ',\n 'is_province' => false,\n 'locp_code' => 34,\n ),\n array(\n 'id'=>35,\n 'name_en'=>'',\n 'name_kh'=>'ដងរែក',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ជំរុំ',\n 'is_province' => false,\n 'locp_code' => 35,\n ),\n array(\n 'id'=>36,\n 'name_en'=>'',\n 'name_kh'=>'តាទុំ',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ជំរុំ',\n 'is_province' => false,\n 'locp_code' => 36,\n ),\n array(\n 'id'=>37,\n 'name_en'=>'',\n 'name_kh'=>'ណងច័ន្ទ',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ជំរុំ',\n 'is_province' => false,\n 'locp_code' => 37,\n ),\n array(\n 'id'=>38,\n 'name_en'=>'',\n 'name_kh'=>'ណងឯក',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ជំរុំ',\n 'is_province' => false,\n 'locp_code' => 38,\n ),\n array(\n 'id'=>39,\n 'name_en'=>'',\n 'name_kh'=>'បាំងភូ',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ជំរុំ',\n 'is_province' => false,\n 'locp_code' => 39,\n ),\n array(\n 'id'=>40,\n 'name_en'=>'',\n 'name_kh'=>'ឈុនបូរី',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ខេត្ត',\n 'is_province' => false,\n 'locp_code' => 40,\n ),\n array(\n 'id'=>41,\n 'name_en'=>'',\n 'name_kh'=>'ភ្នំម៉ាឡៃ',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ជំរុំ',\n 'is_province' => false,\n 'locp_code' => 41,\n ),\n array(\n 'id'=>42,\n 'name_en'=>'',\n 'name_kh'=>'ភ្នំឆ័ត្រ',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ជំរុំ',\n 'is_province' => false,\n 'locp_code' => 42,\n ),\n array(\n 'id'=>43,\n 'name_en'=>'',\n 'name_kh'=>'សន្តិសុខ',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ជំរុំ',\n 'is_province' => false,\n 'locp_code' => 43,\n ),\n array(\n 'id'=>44,\n 'name_en'=>'',\n 'name_kh'=>'សម្តេចឪ',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ជំរុំ',\n 'is_province' => false,\n 'locp_code' => 44,\n ),\n array(\n 'id'=>45,\n 'name_en'=>'',\n 'name_kh'=>'សាយធូ',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ជំរុំ',\n 'is_province' => false,\n 'locp_code' => 45,\n ),\n array(\n 'id'=>46,\n 'name_en'=>'',\n 'name_kh'=>'សាយប៊ី',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ជំរុំ',\n 'is_province' => false,\n 'locp_code' => 46,\n ),\n array(\n 'id'=>47,\n 'name_en'=>'',\n 'name_kh'=>'សាយអេក',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ជំរុំ',\n 'is_province' => false,\n 'locp_code' => 47,\n ),\n array(\n 'id'=>48,\n 'name_en'=>'',\n 'name_kh'=>'សុខសាន្ត',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ជំរុំ',\n 'is_province' => false,\n 'locp_code' => 48,\n ),\n array(\n 'id'=>49,\n 'name_en'=>'',\n 'name_kh'=>'អំពិល',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ជំរុំ',\n 'is_province' => false,\n 'locp_code' => 49,\n ),\n array(\n 'id'=>50,\n 'name_en'=>'',\n 'name_kh'=>'ឫទ្ធិសែន',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ជំរុំ',\n 'is_province' => false,\n 'locp_code' => 50,\n ),\n array(\n 'id'=>51,\n 'name_en'=>'',\n 'name_kh'=>'ទី៧',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ជំរុំ',\n 'is_province' => false,\n 'locp_code' => 51,\n ),\n array(\n 'id'=>52,\n 'name_en'=>'',\n 'name_kh'=>'ទី៨',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ជំរុំ',\n 'is_province' => false,\n 'locp_code' => 52,\n ),\n array(\n 'id'=>53,\n 'name_en'=>'',\n 'name_kh'=>'ចិន',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ប្រទេស',\n 'is_province' => false,\n 'locp_code' => 53,\n ),\n array(\n 'id'=>54,\n 'name_en'=>'',\n 'name_kh'=>'ថៃ',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ប្រទេស',\n 'is_province' => false,\n 'locp_code' => 54,\n ),\n array(\n 'id'=>55,\n 'name_en'=>'',\n 'name_kh'=>'អាឡឺម៉ង់',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ប្រទេស',\n 'is_province' => false,\n 'locp_code' => 55,\n ),\n array(\n 'id'=>56,\n 'name_en'=>'ប៊ុលហ្គារី',\n 'name_kh'=>'',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ប្រទេស',\n 'is_province' => false,\n 'locp_code' => 56,\n ),\n array(\n 'id'=>57,\n 'name_en'=>'',\n 'name_kh'=>'វៀតណាម',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ប្រទេស',\n 'is_province' => false,\n 'locp_code' => 57,\n ),\n array(\n 'id'=>58,\n 'name_en'=>'',\n 'name_kh'=>'រុស្សី',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'សហព័ន្ធ',\n 'is_province' => false,\n 'locp_code' => 55,\n ),\n array(\n 'id'=>59,\n 'name_en'=>'',\n 'name_kh'=>'កូរ៉េខាងត្បូង',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ប្រទេស',\n 'is_province' => false,\n 'locp_code' => 59,\n ),\n array(\n 'id'=>60,\n 'name_en'=>'',\n 'name_kh'=>'អាមេរិក',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'សហរដ្ធ',\n 'is_province' => false,\n 'locp_code' => 60,\n ),\n array(\n 'id'=>61,\n 'name_en'=>'',\n 'name_kh'=>'អេហ្ស៊ីប',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ប្រទេស',\n 'is_province' => false,\n 'locp_code' => 61,\n ),\n array(\n 'id'=>62,\n 'name_en'=>'',\n 'name_kh'=>'អូស្ត្រាលី',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ប្រទេស',\n 'is_province' => false,\n 'locp_code' => 62,\n ),\n array(\n 'id'=>63,\n 'name_en'=>'',\n 'name_kh'=>'កាណាដា',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ប្រទេស',\n 'is_province' => false,\n 'locp_code' => 63,\n ),\n array(\n 'id'=>64,\n 'name_en'=>'',\n 'name_kh'=>'ញូវហ៊្សេឡង់',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ប្រទេស',\n 'is_province' => false,\n 'locp_code' => 64,\n ),\n array(\n 'id'=>65,\n 'name_en'=>'',\n 'name_kh'=>'អង់គ្លេស',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ចក្រភព',\n 'is_province' => false,\n 'locp_code' => 65,\n ),\n array(\n 'id'=>66,\n 'name_en'=>'',\n 'name_kh'=>'ជប៉ុន',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ប្រទេស',\n 'is_province' => false,\n 'locp_code' => 66,\n ),\n array(\n 'id'=>67,\n 'name_en'=>'',\n 'name_kh'=>'បារាំង',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ប្រទេស',\n 'is_province' => false,\n 'locp_code' => 67,\n ),\n array(\n 'id'=>69,\n 'name_en'=>'',\n 'name_kh'=>'ឡាវ',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ប្រទេស',\n 'is_province' => false,\n 'locp_code' => 69,\n ),\n array(\n 'id'=>70,\n 'name_en'=>'',\n 'name_kh'=>'ហុងកុង',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'',\n 'is_province' => false,\n 'locp_code' => 70,\n ),\n array(\n 'id'=>71,\n 'name_en'=>'',\n 'name_kh'=>'តៃវ៉ាន់',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'',\n 'is_province' => false,\n 'locp_code' => 71,\n ),\n array(\n 'id'=>72,\n 'name_en'=>'',\n 'name_kh'=>'អ៊ុយក្រែន',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ប្រទេស',\n 'is_province' => false,\n 'locp_code' => 72,\n ),\n array(\n 'id'=>73,\n 'name_en'=>'',\n 'name_kh'=>'ឥណ្ឌា',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'ប្រទេស',\n 'is_province' => false,\n 'locp_code' => 73,\n ),\n array(\n 'id'=>85,\n 'name_en'=>'',\n 'name_kh'=>'ផ្សេងៗ( ក្រៅប្រទេស)',\n 'name_fr'=>'',\n 'code'=>'',\n 'prefix'=>'',\n 'is_province' => false,\n 'locp_code' => 85,\n )\n\n\n );\n\n $origins = array();\n foreach($provinces as $province){\n $origin = array(\n 'id'=>$province['id'],\n 'name_kh' => $province['name_kh'],\n 'name_en' => $province['name_en'],\n 'name_fr' => $province['name_fr'],\n 'code' => $province['code'],\n 'prefix' => $province['prefix'],\n 'is_province' => $province['is_province']\n );\n\n array_push($origins,$origin);\n }\n\n foreach($origins as $origin){\n DB::table('origins')->insert($origin);\n }\n }", "public function provinces (Request $request){\n $country = Country::where('country',$request->country)->get();\n\n if ($country){\n $provinces = Province::where('country_id',$country[0]->id)->get();\n $provinceArray = [];\n foreach ($provinces as $province) {\n array_push($provinceArray, $province->province);\n }\n if ($provinceArray){\n return response()->json([\"Status\"=>\"Ok\",\"data\"=>$provinceArray],200);\n }else{\n return response()->json([\"Status\"=>\"no_province\"],204);\n }\n }else{\n return response()->json([\"Status\"=>\"no_country\"],204);\n }\n }", "public function setProvince($province)\n {\n $this->province = $province;\n\n return $this;\n }", "public function setProvince($province)\n {\n $this->province = $province;\n\n return $this;\n }", "public function statesProvinces()\n {\n return $this->hasMany('App\\StateProvince');\n }", "function getProvincesNew() {\n //die($this->_ext);\n $query = \" SELECT ID,Name FROM #__ssprovinces WHERE ID LIKE 'WebSite%' \";\n $this->_db->setQuery($query);\n return $this->_db->loadAssocList();\n }", "public function store(ProvinceRequest $request)\n { \n $validator = Validator::make($request->all(), Province::VALIDATION_RULE_STORE);\n if ($validator->fails()) {\n return response()->json([\n 'success' => false,\n 'data' => $validator->messages(),\n ], 400);\n }\n \n \n $province= new Province;\n $province->user_id =$user_id;\n $province->country_id = $request->country_id;\n $province->province_name = $request->province_name;\n $province->province_name_ar = $request->province_name_ar;\n $province->save();\n return response()->json([\n 'success' => true,\n 'data' => 'done',\n ], 200);\n\n }", "public function getProvinceCode()\n {\n return $this->province_code;\n }", "public function addZipCode($postal) {\n // $postalc = new PostalCode();\n // $postalc = $postal;\n // $date = date_create($postal->getDate_create());\n // $date_new_create = date_format($date, \"Y-m-d H:m:s\");\n //print \"<pre>\";\n //print_r($obj);\n //print \"</pre>\";\n //exit();\n /* * *\n * Add new address to state_sp\n */\n $result = $this->db->insert('state_sp', array(\n 'postalcode' => $postal->getPostalcode(),\n 'street' => $postal->getStreet(),\n 'complement' => $postal->getComplement(),\n 'district' => $postal->getDistrict(),\n 'city' => $postal->getCity(),\n 'state' => $postal->getState(),\n 'country' => $postal->getCountry(),\n 'date_create' => $postal->getDate_create()\n ));\n //\n return $result;\n }", "public function addressDetail(){\n $province = array('0'=>'กรุงเทพมหานคร','1'=>'กระบี่','2'=>'กาญจนบุรี','3'=>'กาฬสินธุ์','4'=>'กำแพงเพชร','5'=>'ขอนแก่น','6'=>'จันทบุรี','7'=>'ฉะเชิงเทรา','8'=>'ชลบุรี','9'=>'ชัยนาท','10'=>'ชัยภูมิ','11'=>'ชุมพร','12'=>'เชียงราย','13'=>'เชียงใหม่','14'=>'ตรัง','15'=>'ตราด','16'=>'ตาก','17'=>'นครนายก','18'=>'นครปฐม','19'=>'นครพนม','20'=>'นครราชสีมา','21'=>'นครศรีธรรมราช','22'=>'นครสวรรค์','23'=>'นนทบุรี','24'=>'นราธิวาส','25'=>'น่าน','26'=>'บึงกาฬ','27'=>'บุรีรัมย์','28'=>'ปทุมธานี','29'=>'ประจวบคีรีขันธ์','30'=>'ปราจีนบุรี','31'=>'ปัตตานี','32'=>'พระนครศรีอยุธยา','33'=>'พังงา','34'=>'พัทลุง','35'=>'พิจิตร','36'=>'พิษณุโลก','37'=>'เพชรบุรี','38'=>'เพชรบูรณ์','39'=>'แพร่','40'=>'พะเยา','41'=>'ภูเก็ต','42'=>'มหาสารคาม','43'=>'มุกดาหาร','44'=>'แม่ฮ่องสอน','45'=>'ยะลา','46'=>'ยโสธร','47'=>'ร้อยเอ็ด','48'=>'ระนอง','49'=>'ระยอง','50'=>'ราชบุรี','51'=>'ลพบุรี','52'=>'ลำปาง','53'=>'ลำพูน','54'=>'เลย','55'=>'ศรีสะเกษ','56'=>'สกลนคร','57'=>'สงขลา','58'=>'สตูล','59'=>'สมุทรปราการ','60'=>'สมุทรสงคราม','61'=>'สมุทรสาคร','62'=>'สระแก้ว','63'=>'สระบุรี','64'=>'สิงห์บุรี','65'=>'สุโขทัย','66'=>'สุพรรณบุรี','67'=>'สุราษฎร์ธานี','68'=>'สุรินทร์','69'=>'หนองคาย','70'=>'หนองบัวลำภู','71'=>'อ่างทอง','72'=>'อุดรธานี','73'=>'อุทัยธานี','74'=>'อุตรดิตถ์','75'=>'อุบลราชธานี','76'=>'อำนาจเจริญ');\n\n $tmp = explode(\",,\", $this->address);\n $arr['addressNo'] = $tmp[0];\n $arr['moo'] = $tmp[1];\n $arr['street'] = $tmp[2];\n $arr['subdistrict'] = $tmp[3];\n $arr['district'] = $tmp[4];\n $arr['province'] = $province[$tmp[5]];\n $arr['zipcode'] = $tmp[6];\n $arr['provinceNo'] = $tmp[5];\n return $arr;\n }" ]
[ "0.6325191", "0.6201344", "0.6183753", "0.61542463", "0.6075722", "0.6055882", "0.6007619", "0.5911047", "0.5902562", "0.5751536", "0.5619218", "0.5605563", "0.5598254", "0.55853134", "0.5579313", "0.55748", "0.5507533", "0.5501459", "0.549906", "0.5486766", "0.5483851", "0.54821926", "0.54800504", "0.54800504", "0.54648453", "0.54537874", "0.5450959", "0.5446229", "0.5439912", "0.54288936" ]
0.7440003
0
Add a city with the premise that the province has to be added already
public function addCity(ProvinceInterface $province, $cityName);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function addCity($inputCity) {\n if($inputCity == '')\n return; \n $userCity = $this->cityName($inputCity); \n \n # always add Vacation qualities\n $this->perfectCity = array_merge($this->perfectCity, \n $this->cities[$userCity]['Vacation']); \n \n # add Permanent qualities if purpose is Permanent \n if($this->purposeForTravel == 'Permanent')\n $this->perfectCity = array_merge($this->perfectCity, \n $this->cities[$userCity]['Permanent']); \n }", "public function addNewPersonToCity()\n {\n }", "public function addNewCity($latitude,$lng,$detail_city){\r\n\t\t}", "public function setCity($newCity){\n\t}", "public function addProvince(StateInterface $state, $provinceCode, $provinceName);", "public function addPostalCode(CityInterface $city, $postalCodeCode);", "function Add_City(){\n\t\t\n\t\t//when click on button\n\t\tif(isset($_POST['citybtn'])){\n\t\t\t\n\t\t\t//for insert values into table\n\t\t\t$values = \"'\".$_POST[\"city\"].\"'\";\n\t\t\t\n\t\t\t//add city into table\n\t\t\t$this->Add('city',$values,'Add-City?m');\n\t\t\t\n\t\t} // ifisset close\n\t}", "function add_cities($text)\n {\n $query=$this->db2->query(\"INSERT INTO master_cities VALUES ('','$text')\");\n if($query)\n return 1;\n else\n return 0;\n }", "function addcities($cityname,$statename,$citydescription,$statuscity)\n\t{\n\t\t$names = array('name' => $cityname ,'state_id' =>$statename,'description' => $citydescription, 'status' => $statuscity);\n\t\t$add_query = $this->insert( 'cities', $names );\n\t\tif( $add_query )\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function addForSelect() {\n\n\t\t//Prevent users from accessing it directly.\n\t\tif (!$this->request->is('ajax')) {\n\t\t\treturn $this->redirect(['action' => 'index']);\n\t\t}\n\t\t$this->City->create();\n\t\tif (!$this->City->save($this->request->data)) {\n\t\t\tthrow new Exception('The city could not be saved');\n\t\t}\n\t\t$cities = $this->City->findByStateId('list', $this->request->data('City.state_id'));\n\t\t$this->set(compact('cities'));\n\t}", "public function add_city()\n {\n if (Session::has('userid')) {\n $adminheader = view('siteadmin.includes.admin_header')->with(\"routemenu\", \"settings\");\n $adminleftmenus = view('siteadmin.includes.admin_left_menus');\n $adminfooter = view('siteadmin.includes.admin_footer');\n $country_details = City::view_country_details();\n return view('siteadmin.add_city')->with('adminheader', $adminheader)->with('adminleftmenus', $adminleftmenus)->with('adminfooter', $adminfooter)->with('country_details', $country_details);\n } else {\n return Redirect::to('siteadmin');\n }\n }", "public function addCity(array $params)\n {\n $countryId = (int)trim($_SERVER['REQUEST_URI'], '/countries/');\n $city = ucfirst($_POST['name']);\n $db = Database::getInstance()->connection();\n $countryName = $db->select('countries', '*', [\n 'id[=]' => [$countryId]\n ])[0]['name'];\n $db->insert('cities', [\n 'name' => $city,\n 'country' => $countryName\n ]);\n\n $this->show($params);\n }", "protected static function addOrUpdateCity($city)\n {\n $city_id = 0;\n if (is_array($city) && !empty($city)) {\n $city_id = (int)$city['id'];\n DB::insert(\n 'REPLACE INTO apimo_city SET city_id = ?, name = ?, zipcode = ?',\n [$city['id'], $city['name'], $city['zipcode']]\n );\n }\n\n return $city_id;\n }", "public function store(CountryCityRequest $request)\n {\n $countryCity = new City();\n $availablelocales = \\Localization::getLocales();\n foreach ($availablelocales as $locale => $value){\n $countryCity->translateOrNew($locale)->name = $request['name_'.$locale];\n }//end for each\n $countryCity->parent_id = $request->parent_id;\n $countryCity->save();\n session()->flash('message', trans('sweet_alert.added_successfully'));\n return redirect(route('countries-cities.index'));\n }", "public function setCity($city = \"\");", "function insertCity($name)\r\n {\r\n try\r\n {\r\n $name=clean_data($name);\r\n $name = ucfirst(strtolower($name));\r\n $duplicate=checkForDuplicateCity($name);\r\n \r\n if(validateForNull($name) && !$duplicate)\r\n {\r\n $admin_id=$_SESSION['edmsAdminSession']['admin_id'];\r\n $sql=\"INSERT INTO\r\n\t\t edms_city (city_name, created_by, last_updated_by, date_added, date_modified)\r\n\t\t\t VALUES\r\n\t\t\t ('$name', $admin_id, $admin_id, NOW(), NOW())\";\r\n $result=dbQuery($sql);\r\n return \"success\";\r\n }\r\n else\r\n {\r\n return \"error\";\r\n }\r\n\r\n }\r\n\r\n catch(Exception $e)\r\n {\r\n }\r\n\r\n }", "public function addAction(Request $request)\n {\n if (! $request->isXmlHttpRequest()) {\n throw new NotFoundHttpException();\n }\n $entity = new City();\n $em = $this->getDoctrine()->getManager();\n $name = $request->query->get('city_name');\n $state = $request->query->get('city_state'); \n $error=false;\n if (!$name) {\n $result='Error: Debe seleccionar un nombre de ciudad';\n return new JsonResponse($result);\n }\n if (!$state) {\n $result='Error:Debe seleccionar un estado/provincia para la ciudad';\n return new JsonResponse($result);\n }\n $thestate = $em->getRepository('NvCargaBundle:State')->find($state);\n if (!$thestate) {\n $result='Error: El estado/provincia seleccionado no existe';\n return new JsonResponse($result);\n }\n $city = $em->getRepository('NvCargaBundle:City')->findOneBy(array('state' => $state, 'name' => $name));\n if ($city) {\n $result='Error: Existe una ciudad con ese nombre en ese estado';\n return new JsonResponse($result);\n }\n $entity->setName($name);\n $entity->setState($thestate);\n $entity->setActive(false);\n $em->persist($entity);\n $em->flush();\n $result='La ciudad ha sido creada satisfactoriamente';\n return new JsonResponse($result); \n }", "public function addCity(\\obiba\\mica\\LocalizedStringDto $value) {\n return $this->_add(2, $value);\n }", "public function addAction()\n {\n if ($this->getRequest()->isPost()) {\n $user = $this->tokenPayload;\n //Create New Form City\n $form = new CityForm('create', $this->entityManager);\n\n $form->setData($this->getRequestData());\n\n //validate form\n if ($form->isValid()) {\n // get filtered and validated data\n $data = $form->getData();\n // add user.\n $city = $this->cityManager->addCity($data,$user);\n \n $this->apiResponse['message'] = \"ADD_SUCCESS_CITIES!\";\n } else {\n $this->error_code = 0;\n $this->apiResponse['message'] = $form->getMessages(); \n \n } \n } \n\n return $this->createResponse();\n }", "abstract public function city();", "private function createCity()\r\n {\r\n // Checks/Creates a new CITY\r\n $nameCity = $_POST[\"name_city\"];\r\n if ((CityDAO::findOneBy(\"name_city\", $nameCity)) == null) {\r\n $city = new City;\r\n $city->setName_city($_POST[\"name_city\"]);\r\n if (($city->getValid_city()) == true) {\r\n CityDAO::createCity($city);\r\n $city = CityDAO::findOneBy(\"name_city\", $nameCity);\r\n }\r\n } else {\r\n $city = CityDAO::findOneBy(\"name_city\", $nameCity);\r\n }\r\n\r\n return $city;\r\n }", "public function postCity($cityDetail)\n {\n \n }", "public function getWesternCapeCities($province_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, m.municipality_id,\n\t\t\t\t\t\t p.province_id, p.province_name \n\t\t\t\t\t\t FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t LEFT JOIN provinces p\n\t\t\t\t\t\t ON m.province_id = p.province_id\n\t\t\t\t\t\t WHERE p.province_id = '$province_id'\n\t\t\t\t\t\t AND p.province_id = '3'\n\t\t\t\t\t\t ORDER BY city_name ASC\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create province object\n\t\t\t\t\t\t$province = new Province();\n\t\t\t\t\t\t$province->setProvinceID($row['province_id']);\n\t\t\t\t\t\t$province->setProvinceName($row['province_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setProvince($province);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\n\t\t\t\t\t\tarray_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "function geowidget_maybeyourcity_form_set_city_callback($form, $form_state) {\n if ($form['city_id'] != null) {\n $city = city_load($form['city_id']['#value']);\n if ($city) {\n $_SESSION['geowidget'] = array(\n 'id' => $city->id,\n 'title' => $city->title,\n );\n $form['text_maybe_city']['#value'] = $city->title;\n $form['text_maybe_city']['#suffix'] = '';\n unset($form['maybe_you_city']);\n }\n }\n return $form;\n}", "public function setCity(Request $request, int $id): JsonResponse\n {\n $zone = ExpressZone::find($id);\n $request->validate([\n 'city_id' => 'required|unique:city_expresses,city_id,'.$request->city_id.',id,express_company_id,'.$zone->company->id\n ]);\n $zone->cities()->attach($request->city_id, ['express_company_id' => $zone->company->id]);\n return response()->json(['success' => 'ok']);\n }", "protected function updateCities()\n {\n $this->execute(<<<SQL\nUPDATE jl_loc_city jlc \n INNER JOIN jl_loc_region jlr ON jlr.id = jlc.region_id\n INNER JOIN jl_loc_state jls ON jls.id = jlr.state_id\n INNER JOIN jl_loc_country jlco ON jlco.id = jls.country_id\n SET jlc.country_id = jlco.id, jlc.state_id = jls.id;\nSQL\n );\n }", "public function store(CityRequest $request)\n\t{\n\t\tCity::create([\n\t\t\t'country_id' => $request->country_id,\n\t\t\t'name' => $request->name,\n\t\t\t'phonecode' => $request->phonecode\n\t\t]);\n\n\t\tflash()->success('Город успешно добавлен.');\n\t\treturn redirect()->route('admin.cities.index');\n\t}", "public function actionCountries()\n {\n $salys = Yii::$app->db_prod->createCommand(\"SELECT * FROM salys\")->queryAll();\n foreach ($salys as $salis) {\n $city = new City([\n 'name' => $salis['pavadinimas_lt'],\n 'ansi_name' => $salis['pavadinimas_lt'],\n 'alt_name' => $this->formatCountryAltName($salis),\n 'latitude' => $salis['latitude'],\n 'longitude' => $salis['longitude'],\n 'country_code' => strtoupper($salis['kodas']),\n 'population' => null,\n 'elevation' => null,\n 'timezone' => null,\n 'modification_date' => null,\n ]);\n $city->save();\n }\n\n Cities::addCountries();\n }", "public function actionCreate()\n {\n $model = new City();\n $model->status = 'Active';\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n Yii::$app->session->setFlash('success', 'Governorate info created successfully!');\n return $this->redirect(['index']);\n\n } else {\n\n $countries = Country::loadcountry();\n $country = ArrayHelper::map($countries, 'country_id', 'country_name');\n\n return $this->render('create', [\n 'model' => $model, 'country' => $country,\n ]);\n }\n\n }", "function setCity($city) {\r\r\n\t\t$this->city = $city;\r\r\n\t}" ]
[ "0.7182254", "0.7104158", "0.67245895", "0.6528631", "0.65125173", "0.64910495", "0.6488488", "0.64337486", "0.64106745", "0.6393945", "0.63826734", "0.63524616", "0.6146576", "0.6134758", "0.6133513", "0.6065262", "0.59993565", "0.59527475", "0.594308", "0.5908465", "0.5842507", "0.581572", "0.5813375", "0.5811982", "0.58063734", "0.5799881", "0.5763066", "0.5762778", "0.5721646", "0.5716318" ]
0.7796505
0
Add a postalcode with the premise that the city has to be added already
public function addPostalCode(CityInterface $city, $postalCodeCode);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addPostalCode($postalCode);", "public function addZipCode($postal) {\n // $postalc = new PostalCode();\n // $postalc = $postal;\n // $date = date_create($postal->getDate_create());\n // $date_new_create = date_format($date, \"Y-m-d H:m:s\");\n //print \"<pre>\";\n //print_r($obj);\n //print \"</pre>\";\n //exit();\n /* * *\n * Add new address to state_sp\n */\n $result = $this->db->insert('state_sp', array(\n 'postalcode' => $postal->getPostalcode(),\n 'street' => $postal->getStreet(),\n 'complement' => $postal->getComplement(),\n 'district' => $postal->getDistrict(),\n 'city' => $postal->getCity(),\n 'state' => $postal->getState(),\n 'country' => $postal->getCountry(),\n 'date_create' => $postal->getDate_create()\n ));\n //\n return $result;\n }", "abstract public function postalCode();", "private function setPostalCode()\n {\n \tif ( ! isset( $_POST['postal_code'] ) ) {\n \t\t$this->data['error']['postal_code'] = 'Please provide your postal or zip code.';\n $this->error = true;\n return;\n }\n \n $pc = trim( $_POST['postal_code'] );\n\t\n \n // Make sure the country is set\n if ( ! isset( $this->data['country'] ) ) {\n $pc_obj = new PostalCode( $pc );\n if ( $pc_obj->isValid() ) {\n $this->data['postal_code'] = $pc_obj->get();\n return;\n }\n \n $zip_obj = new ZipCode( $pc );\n if ( $zip_obj->isValid() ) {\n $this->data['postal_code'] = $zip_obj->get();\n return;\n }\n }\n \n if ( $this->data['country'] == 'CA' ) {\n $pc_obj = new PostalCode( $pc );\n if ( ! $pc_obj->isValid() ) {\n\t\t\t\t$this->data['error']['postal_code'] = 'Please provide a valid postal code.';\n $this->error = true;\n return;\n }\n $this->data['postal_code'] = $pc_obj->get();\n }\n elseif ( $this->data['country'] == 'US' ) {\n $zip_obj = new ZipCode( $pc );\n if ( ! $zip_obj->isValid() ) {\n\t\t\t\t$this->data['error']['postal_code'] = 'Please provide a valid zip code.';\n $this->error = true;\n return;\n }\n $this->data['postal_code'] = $zip_obj->get();\n }\n }", "public function setPostalcode($postalcode);", "public function setCodePostal($valeur)\n {\n $this->codepostal = $valeur;\n }", "public function getPostalcode();", "public function addAddress($address);", "public static function add_country_code() {\n\n $taxamo = taxedd_get_country_code();\n\n if ( $taxamo && isset( $taxamo->country_code ) ) {\n ?>\n <input class=\"edd-country\" type=\"hidden\" name=\"edd_country\" id=\"edd-country\" value=\"<?php echo $taxamo->country_code; ?>\"/>\n <?php\n }\n }", "public function postalCode($value)\n {\n $this->setProperty('postalCode', $value);\n return $this;\n }", "public function postalCode($postal_code) {\n $this->data['attachment']['payload']['address']['postal_code'] = $postal_code;\n\n return $this;\n }", "public function getPostalCode();", "public function getPostalCode();", "function hook_commerce_adyen_shopper_address_alter(\\Commerce\\Adyen\\Payment\\Composition\\Address $address, \\EntityDrupalWrapper $profile, array $checkout_values, \\EntityDrupalWrapper $order) {\n if ('Dnipropetrovsk' === $address->getCity()) {\n $address->setCity('Dnipro');\n }\n}", "public static function addressPostalCode()\n {\n return new TextNode('address_postal_code');\n }", "public function setPostalCode(string $postal_code): void\n {\n $this->_postal_code = $postal_code;\n }", "public function setPostcode($value) {\n\t\tself::$_postCode = $value;\n\t}", "public function addAddress($data){\n\t\tglobal $dbh;\n\t\t$fields = array(\n\t\t\t\"nombre\",\n\t\t\t\"receptorNombre\",\n\t\t\t\"receptorApellido\",\n\t\t\t\"nombreEmpresa\",\n\t\t\t\"facturacion\",\n\t\t\t\"principal\",\n\t\t\t\"idCliente\",\n\t\t\t\"direccion\",\n\t\t\t\"fono\",\n\t\t\t\"cel\",\n\t\t\t\"idZona\"\n\t\t);\n\t\t$query = \"INSERT INTO direccion(nombre,receptorNombre,receptorApellido,nombreEmpresa,facturacion,principal,idCliente,direccion,fono,cel,idZona) VALUES(?,?,?,?,?,?,?,?,?,?,?)\";\n\t\t$update = array();\n\t\tif( $data!=null && is_array($data) ){\n\t\t\tforeach( $fields as $field ){\n\t\t\t\tif( $field == 'idCliente' ){\n\t\t\t\t\t$update[$field] = $this->id;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$update[$field] = null;\n\t\t\t\tif( isset($data[$field]) && !empty($data[$field]) ){\n\t\t\t\t\t$update[$field] = $data[$field];\n\t\t\t\t} else {\n\t\t\t\t\t//$update[$field] = $old[$field];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$res = $dbh->query($query,$update);\n\t\t\treturn $res;\n\t\t}\n\t\treturn false;\n\t}", "function addAddressBookEntry($customer_id, $address_question_arr, $make_default = false) {\n // first get the zone id's from the 2 digit iso codes\n // country first\n $country_query = tep_db_query('SELECT countries_id, address_format_id\n FROM ' . TABLE_COUNTRIES . '\n WHERE countries_name = \\'' . $address_question_arr['country'] . '\\'\n LIMIT 1');\n\n // see if we found a record, if not default to American format\n if (tep_db_num_rows($country_query) > 0) {\n $country = tep_db_fetch_array($country_query);\n // grab the country id and address format\n $country_id = $country['countries_id'];\n $address_format_id = $country['address_format_id'];\n } else {\n // default\n $country_id = '223';\n $address_format_id = '2'; //2 is the American format\n }\n\n // see if the country code has a state\n $country_zone_check_query = tep_db_query('SELECT zone_country_id\n FROM ' . TABLE_ZONES . '\n WHERE zone_country_id = \\'' . $country_id . '\\'\n LIMIT 1');\n if (tep_db_num_rows($country_zone_check_query) > 0) {\n $check_zone = true;\n } else {\n $check_zone = false;\n }\n\n // now try and find the zone_id (state/province code)\n // use the country id above\n if ($check_zone) {\n $zone_query = tep_db_query('SELECT zone_id\n FROM ' . TABLE_ZONES . '\n WHERE zone_country_id = \\'' . $country_id . '\\' AND\n zone_code = \\'' . $address_question_arr['state'] . '\\'\n LIMIT 1');\n if (tep_db_num_rows($zone_query) > 0) {\n // grab the id\n $zone = tep_db_fetch_array($zone_query);\n $zone_id = $zone['zone_id'];\n } else {\n $check_zone = false;\n }\n }\n\n // now run the insert\n // this isnt the best way but it will get the majority of cases\n list($fname, $lname) = explode(' ', $address_question_arr['name']);\n if ($check_zone) {\n tep_db_query('INSERT INTO ' . TABLE_ADDRESS_BOOK . '\n (address_book_id, customers_id, entry_gender, entry_firstname, entry_lastname,\n entry_street_address, entry_suburb, entry_postcode, entry_city, entry_country_id,\n entry_zone_id)\n VALUES\n (NULL, \\'' . $customer_id . '\\', \\'\\', \\'' . $fname . '\\', \\'' . $lname . '\\',\n \\'' . $address_question_arr['street_address'] . '\\', \\'' . $address_question_arr['suburb'] . '\\',\n \\'' . $address_question_arr['postcode'] . '\\', \\'' . $address_question_arr['city'] . '\\',\n \\'' . $country_id . '\\', \\'' . $zone_id . '\\')');\n } else {\n tep_db_query('INSERT INTO ' . TABLE_ADDRESS_BOOK . '\n (address_book_id, customers_id, entry_gender, entry_firstname, entry_lastname,\n entry_street_address, entry_suburb, entry_postcode, entry_city, entry_country_id)\n VALUES\n (NULL, \\'' . $customer_id . '\\', \\'\\', \\'' . $fname . '\\', \\'' . $lname . '\\',\n \\'' . $address_question_arr['street_address'] . '\\', \\'' . $address_question_arr['suburb'] . '\\',\n \\'' . $address_question_arr['postcode'] . '\\', \\'' . $address_question_arr['city'] . '\\',\n \\'' . $country_id . '\\')');\n }\n $address_book_id = tep_db_insert_id();\n\n // make default if set, update\n if ($make_default) {\n tep_db_query('UPDATE '. TABLE_CUSTOMERS . '\n SET customers_default_address_id = \\'' . $address_book_id . '\\'\n WHERE customers_id = \\'' . $customer_id . '\\'');\n $_SESSION['customer_default_address_id'] = $address_book_id;\n }\n\n // set the sendto\n $_SESSION['sendto'] = $address_book_id;\n\n // return the address_id\n return $address_book_id;\n }", "public function addNewPersonToCity()\n {\n }", "public function setPostalCode($postal_code)\n {\n $this->json()->postal_code = $postal_code;\n }", "public static function zipcodeNew(string $zipcode, $city = null)\n {\n $query = Core::query('zipcode-new');\n $query->bindValue(':zipcode', $zipcode);\n $query->bindValue(':city', $city);\n $query->execute();\n return Configuration::read('db.link')->lastInsertId();\n }", "protected function checkAndCreateNewLocation(Postcode $postcode)\n {\n $correction = new Correction();\n $correction->setMunicipalityManager($this->municipalityManager);\n $correction->setZipCodeManager($this->zipcodeManager);\n $correction->setCityManager($this->cityManager);\n $correction->setProvinceManager($this->provinceManager);\n\n if ($postcode->getCity() === 'Geffen' && $postcode->getProvinceCode() === 'NB') {\n $postcode->setMunicipality('Oss');\n } else if (($postcode->getCity() === 'Vinkel' || $postcode->getCity() === 'Nuland') && $postcode->getProvinceCode() === 'NB') {\n $postcode->setMunicipality('\\'s‑Hertogenbosch');\n }\n\n $slug = $this->slugifier->manipulate($postcode->getCity());\n $municipality = $this->municipalityManager->getRepository()->findOneByTitle($postcode->getMunicipality());\n\n $entity = $this->cityManager->getRepository()->findOneBy(['municipality' => $municipality, 'title' => $postcode->getCity()]);\n\n if ($entity != null) {\n return false;\n }\n\n $entity = $this->cityManager->getRepository()->findOneBySlug($slug);\n\n if ($entity != null) {\n $slug = $this->slugifier->manipulate($postcode->getCity() . '-' . $postcode->getProvinceCode());\n\n $entity = $this->cityManager->getRepository()->findOneBySlug($slug);\n\n if ($entity != null) {\n return false;\n }\n }\n\n /**\n * @var $c City\n */\n $c = $this->copyFields(new City(), $postcode);\n $c->setTitle($postcode->getCity());\n\n $c->setSlug($slug);\n $c->setSourceLocationTypeId($postcode->getCityId());\n $c->setMunicipality($municipality);\n\n $c = $correction->correct($c, $postcode);\n\n if ($municipality != null) {\n $this->cityManager->persistAndFlush($c);\n } else {\n return false;\n }\n\n return true;\n }", "function add_cities($text)\n {\n $query=$this->db2->query(\"INSERT INTO master_cities VALUES ('','$text')\");\n if($query)\n return 1;\n else\n return 0;\n }", "function additional_paragraph_after_billing_address_1( $field, $key, $args, $value ){\r\n if ( is_checkout() && $key == 'billing_address_1' ) {\r\n $field .= '<p class=\"form-row red_text\" style=\"color:red;\">\r\n Ingresa tu dirección y pon \"Buscar\" o usa el mapa para ubicar tu dirección de envío</p>\r\n ';\r\n \r\n }\r\n return $field;\r\n}", "function fixPostalCode($str = \"\") {\n\t$str = strtoupper($str);\n\t// Remove anything but uppercase letters and numbers.\n\t$str = preg_replace(\"/[^A-Z\\d]/\", \"\", $str);\n\t// Format: A9A 9A9\n\t// Leaves non-postal-code content alone.\n\t$str = preg_replace(\"/([A-Z]\\d[A-Z])(\\d[A-Z]\\d)/\", \"$1 $2\", $str);\n\treturn($str);\n//fixPostalCode\n}", "function estUnCp($codePostal)\n{\n return strlen($codePostal)== 5 && estEntier($codePostal);\n}", "function clean_postcode ($postcode) {\n\n\t\t$postcode = str_replace(' ','',$postcode);\n\t\t$postcode = strtoupper($postcode);\n\t\t$postcode = trim($postcode);\n\t\t$postcode = preg_replace('/(\\d[A-Z]{2})/', ' $1', $postcode);\n\t\n\t\treturn $postcode;\n\n\t}", "private function formatAddress()\n\t{\n\t\t$address = '';\n\n\t\t// street + number\n\t\t$address .= $this->street;\n\t\tif ($this->number)\n\t\t{\n\t\t\tif ($this->language === 'cs')\n\t\t\t{\n\t\t\t\t$address .= ' ' . $this->number;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$address = $this->number . ' ' . $address;\n\t\t\t}\n\t\t}\n\n\t\t// use \"Praha 1\" instead of \"Praha 1, Praha\"\n\t\tif (substr($this->quarter, 0, strlen($this->town)) === $this->town)\n\t\t{\n\t\t\t$useQuarter = TRUE;\n\t\t}\n\n\t\tif (!$address)\n\t\t{\n\t\t\t// [neighborhood]\n\t\t\t$address .= $this->neighborhood;\n\n\t\t\t// [quarter]\n\t\t\tif (!isset($useQuarter))\n\t\t\t{\n\t\t\t\t$address .= $this->quarter;\n\t\t\t}\n\t\t}\n\n\t\t// town [+ zip]\n\t\tif ($address)\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\tif ($this->language === 'cs' && $this->postalCode)\n\t\t{\n\t\t\t$address .= $this->postalCode . ' ';\n\t\t}\n\t\t$address .= isset($useQuarter) ? $this->quarter : $this->town;\n\n\t\t// [district]\n\t\tif (!$address)\n\t\t{\n\t\t\t$address .= $this->district;\n\t\t}\n\n\t\t// [region]\n\t\tif (!$address)\n\t\t{\n\t\t\t$address .= $this->region;\n\t\t}\n\n\t\t// state\n\t\tif ($address && ($this->state || $this->stateCode))\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\t$address .= $this->stateCode ?: $this->state;\n\n\t\t// [zip]\n\t\tif ($address && $this->language !== 'cs' && $this->postalCode)\n\t\t{\n\t\t\tif (!$this->state && !$this->stateCode)\n\t\t\t{\n\t\t\t\t$address .= ',';\n\t\t\t}\n\t\t\t$address .= ' ' . $this->postalCode;\n\t\t}\n\n\t\t// country\n\t\tif ($address)\n\t\t{\n\t\t\t$address .= ', ';\n\t\t}\n\t\t$address .= $this->country;\n\n\t\t$this->formatedAddress = $address;\n\t}", "public function getcodePostal() \n {\n return $this->codePostal;\n }" ]
[ "0.7813068", "0.71782875", "0.7163949", "0.7070533", "0.64887136", "0.61355746", "0.6086631", "0.6005364", "0.59882647", "0.5983254", "0.59779006", "0.5972252", "0.5972252", "0.5923307", "0.58764356", "0.58664334", "0.58158827", "0.57967526", "0.5766173", "0.57283694", "0.5717253", "0.57106036", "0.56961715", "0.5676338", "0.562635", "0.5620337", "0.5607977", "0.5598006", "0.5597619", "0.5586768" ]
0.753308
1
Task Item Completed Date Get formatted date string for completed item, supports temporary placeholder for designing layout. The field name is passed in as a string so can check if it exists before trying to access it's value, this is mostly need for designing layout before fields have been added to table.
function get_item_date($row=NULL, $field, $placeholder=false) { $return = ''; if ($placeholder) $return = '[%'.$field.'%]'; if (isset($row->$field)) { $item_date = $row->$field; if ($item_date != NULL_DATE) $return = date('m/d/Y h:i A',strtotime($item_date)); } return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function string_format_complete_date( $p_date ) {\r\n\t$t_timestamp = db_unixtimestamp( $p_date );\r\n\treturn date( config_get( 'complete_date_format' ), $t_timestamp );\r\n}", "private function processDateField(string $name, array $varType, bool $isRequired): string\n {\n $snaked = $this->camelToSnakeCase($name);\n $this->jsonFields[] = [$snaked, $varType];\n $this->processedFields[] = $name;\n\n return sprintf(\n self::TPL_FIELD_DATE,\n $snaked,\n $isRequired ? 'true' : 'false',\n $this->getLabel($name),\n $snaked\n );\n }", "public function column_due( $request ) {\n\t\t$due = get_post_meta( $request->ID, '_camppayments_due_by', true );\n\t\treturn $due ? date( 'Y-m-d', $due ) : '';\n\t}", "public function column_date_sent( $item ) {\n\n\t\t$date = null;\n\n\t\ttry {\n\t\t\t$date = $item->get_date_sent();\n\t\t} catch ( \\Exception $e ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch\n\t\t\t// We don't handle this exception as we define a default value above.\n\t\t}\n\n\t\tif ( empty( $date ) ) {\n\t\t\treturn esc_html__( 'N/A', 'wp-mail-smtp-pro' );\n\t\t}\n\n\t\treturn esc_html( date_i18n( WP::datetime_format(), strtotime( get_date_from_gmt( $date->format( WP::datetime_mysql_format() ) ) ) ) );\n\t}", "function _elastic_email_format_date($date_field) {\n $data = sprintf('%d/%d/%d', $date_field['month'], $date_field['day'], $date_field['year']);\n $time = sprintf('%s:%s %s', $date_field['hour'], $date_field['minute'], $date_field['ampm']);\n\n return $data . ' ' . $time;\n}", "function getDateCompleted() {\n\t\treturn $this->getData('dateCompleted');\n\t}", "function column_date( $item ) {\r\n\t\tglobal $post;\r\n\r\n\t\tif ( '0000-00-00 00:00:00' == $item->post_date ) {\r\n\t\t\t$h_time = __( 'Unpublished', 'media-library-assistant' );\r\n\t\t} else {\r\n\t\t\t$post = $item; // Resolve issue with \"The Events Calendar\"\r\n\t\t\t$m_time = $item->post_date;\r\n\t\t\t$time = get_post_time( 'G', true, $item, false );\r\n\r\n\t\t\tif ( ( abs( $t_diff = time() - $time ) ) < 86400 ) {\r\n\t\t\t\tif ( $t_diff < 0 ) {\r\n\t\t\t\t\t/* translators: 1: upload/last modified date and time */\r\n\t\t\t\t\t$h_time = sprintf( __( '%1$s from now', 'media-library-assistant' ), human_time_diff( $time ) );\r\n\t\t\t\t} else {\r\n\t\t\t\t\t/* translators: 1: upload/last modified date and time */\r\n\t\t\t\t\t$h_time = sprintf( __( '%1$s ago', 'media-library-assistant' ), human_time_diff( $time ) );\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t/* translators: format for upload/last modified date */\r\n\t\t\t\t$h_time = mysql2date( __( 'Y/m/d', 'media-library-assistant' ), $m_time );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $h_time;\r\n\t}", "public function getDueDate()\n {\n if (array_key_exists(\"dueDate\", $this->_propDict)) {\n return $this->_propDict[\"dueDate\"];\n } else {\n return null;\n }\n }", "function column_job($item){\n return sprintf('%1$s',\n /*$1%s*/ $item['job']\n );\n }", "public function getDateformatPl() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(4, $this->_result)) return (string) $this->_result[4];\n\t\t\telse parent::throwGetColException('Not set ProjectsListingsModel::getDateformatPl', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From ProjectsListingsModel::getDateformatPl', __LINE__, __FILE__);\n\t}", "public function get_last_billed_due_date( $context = 'view' ) {\n\t\treturn $this->get_prop( 'last_billed_due_date', $context ) ;\n\t}", "protected function column_review_date( $item ) {\n\n\t\t// Build my markup.\n\t\t$setup = '';\n\n\t\t// Set the review date markup.\n\t\t$setup .= '<span class=\"woo-better-reviews-admin-table-display woo-better-reviews-admin-table-review-date\">';\n\t\t\t$setup .= '<abbr title=\"' . date( 'Y/m/d g:i:s a', $item['review_stamp'] ) . '\">' . date( 'Y/m/d', $item['review_stamp'] ) . '</abbr>';\n\t\t$setup .= '</span>';\n\n\t\t// Return my formatted product name.\n\t\treturn apply_filters( Core\\HOOK_PREFIX . 'review_table_column_review_date', $setup, $item );\n\t}", "function theme_date(&$item) {\n\n\t\t$retval = $this->theme_select($item[\"year\"])\n\t\t\t. \" \"\n\t\t\t. $this->theme_select($item[\"month\"])\n\t\t\t. \" \"\n\t\t\t. $this->theme_select($item[\"day\"])\n\t\t\t. \" \"\n\t\t\t;\n\n\t\treturn($retval);\n\n\t}", "function format_field_value($field_name,$field_value,$field_type)\n\t{\n\t\tif($field_type == \"datetime\")\n\t\t{\n\t\t\tif($field_name == 'dob')\n\t\t\t{\n\t\t\t\t$field_value = date('l\\, F jS\\, Y',strtotime($field_value));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$field_value = date('g:ia \\o\\n l\\, F jS\\, Y', strtotime($field_value));\n\t\t\t}\n\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($field_name == 'event_name')\n\t\t\t{\n\t\t\t\tif($field_value == 'resume')\n\t\t\t\t{\n\t\t\t\t\t$field_value = \"resumed working\";\n\t\t\t\t}\n\t\t\t\telse if($field_value == 'qbreak')\n\t\t\t\t{\n\t\t\t\t\t$field_value = \"took a break\";\n\t\t\t\t}\n\t\t\t\telse if($field_value == 'pause')\n\t\t\t\t{\n\t\t\t\t\t$field_value = \"paused work\";\n\t\t\t\t}\n\t\t\t\telse if($field_value == 'work')\n\t\t\t\t{\n\t\t\t\t\t$field_value = \"continued working\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$field_value = $field_value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\t\n\t\treturn $field_value;\n\t}", "public function formFld(string $field): string\n\t{\n\t\treturn Formatter::setTimeDate(self::fld($field));\n\t}", "protected function formatEmailColumn(\n \\Sys25\\RnBase\\Domain\\Model\\DataInterface $item\n ) {\n $lastModifyDateTime = $item->getLastModifyDateTime();\n $creationDateTime = $item->getCreationDateTime();\n\n return sprintf(\n '<span title=\"UID: %3$d %1$sCreation: %4$s %1$sLast Change: %5$s\">%2$s</span>',\n CRLF,\n $item->getEmail(),\n $item->getProperty('uid'),\n $creationDateTime ? $creationDateTime->format(\\DateTime::ATOM) : '-',\n $lastModifyDateTime ? $lastModifyDateTime->format(\\DateTime::ATOM) : '-'\n );\n }", "public function getDepandTaskName()\n {\n return $this->get(self::DEPAND_TASK_NAME);\n }", "private function _getDueDate()\n {\n $iDueDate = trim($this->getNovalnetConfigValue('iDueDate' . $this->sCurrentPayment));\n if ($this->sCurrentPayment == 'novalnetinvoice') {\n $iDueDate = (!empty($iDueDate) && is_numeric($iDueDate)) ? $iDueDate : '';\n } elseif($this->sCurrentPayment == 'novalnetsepa') {\n $iDueDate = (empty($iDueDate) || $iDueDate <= 6) ? 7 : $iDueDate;\n } else {\n $iDueDate = (!empty($iDueDate) && is_numeric($iDueDate)) ? $iDueDate : '';\n }\n\n return ($iDueDate) ? date('Y-m-d', strtotime('+' . $iDueDate . ' days')) : false;\n }", "function getDateDue() {\n\t\treturn $this->getData('dateDue');\n\t}", "public function delegateGetDateFieldSql(string $field, bool $string_date) : string;", "public function getDueDate()\r\n {\r\n return $this->dueDate;\r\n }", "public function getDateTask()\n {\n return $this->date_task;\n }", "public function getFormattedPaymentDate(): string;", "public function getDueDate()\n {\n return $this->due_date;\n }", "public function getDueDate()\n {\n return $this->due_date;\n }", "public function getDueDate(){\n return $this->getParameter('due_date');\n }", "function tripal_jobs_get_submit_date($job){\n return format_date($job->submit_date);\n}", "public function getDueDateAttribute($input)\n {\n $zeroDate = str_replace(['Y', 'm', 'd'], ['0000', '00', '00'], config('app.date_format'));\n\n if ($input != $zeroDate && $input != null) {\n return Carbon::createFromFormat('Y-m-d', $input)->format(config('app.date_format'));\n } else {\n return '';\n }\n }", "function show_estimated_ship_date_new_subscription_orders_email( $order ) { \n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}", "public function getDayName(string $field = 'created_at'): string\n {\n return $this->parseCarbon($this->$field)->formatLocalized('%A');\n }" ]
[ "0.58529013", "0.5821863", "0.5531689", "0.55033153", "0.5434342", "0.5424297", "0.5360952", "0.5291862", "0.5222559", "0.52097297", "0.5158482", "0.51448786", "0.51129246", "0.50998497", "0.50648344", "0.505912", "0.5054263", "0.50495493", "0.5030116", "0.50272614", "0.50088954", "0.499981", "0.49781385", "0.49713856", "0.49713856", "0.49699384", "0.49209443", "0.4909761", "0.4907193", "0.49028516" ]
0.64322084
0
Get HTML Checked Attribute If the field has indicated value checked then return html checked attribute
function get_checked_attribute($row=NULL, $field, $checked_value=NULL) { $return = ''; if (isset($row->$field)) { $field_value = $row->$field; if (isset($checked_value)) { if ($field_value == $checked_value) $return = INPUT_CHECKED; } else { if ($field_value) $return = INPUT_CHECKED; } } return $return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getChecked()\n {\n return $this->getValue();\n }", "function get_checked($value)\n{\n\treturn ($value == TRUE) ? 'checked': ''; \n}", "public function getChecked($key)\n {\n\n if (isset($this->data[$key]) && $this->data[$key] && 'f' != $this->data[$key])\n return ' checked=\"checked\" ';\n else\n return '';\n\n }", "public function getCheckedValue()\n {\n return $this->checkedValue;\n }", "public function GetCheckedValue()\n {\n return $this->checkedValue;\n }", "public function GetChecked () {\n\t\treturn $this->checked;\n\t}", "public function getChecked(){\n\t\treturn $this->_checked;\n\t}", "function get_form_field_checked($field, $value) {\n if (!empty($_REQUEST[$field]) && $_REQUEST[$field] == $value) {\n return \"checked\";\n }\n return null;\n}", "public function getValue()\n {\n return $this->checked;\n }", "function acf_get_checkbox_input($attrs = array())\n{\n}", "function checked($field, $value = null) {\n if ( is_string($field) ) {\n if ( $this->setting($field) == $value ) {\n echo 'checked=\"checked\"';\n }\n } else if ( (bool) $field ) {\n echo 'checked=\"checked\"';\n }\n }", "function pixelgrade_get_comments_toggle_checked_attribute() {\n\t\treturn apply_filters( 'pixelgrade_get_comments_toggle_checked_attribute', 'checked=\"checked\"' );\n\t}", "public function checked($checked = 0)\n {\n return (isset($checked) && $checked == 1) ? 'checked=\"checked\"' : '';\n }", "public function getControlHtml()\n {\n if ( isset( $this->_arrProperties['value'] ) \n && $this->_arrProperties['value'] == 1 ) {\n $this->arrAttributes['checked'] = 'checked';\n }\n \n $this->arrAttributes['type'] = 'checkbox';\n \n return parent::getControlHtml();\n }", "protected function getCheckedState()\n\t{\n\t\treturn $this->get('checked');\n\t}", "function checkBoxChecked($chkName, $optional){\n\t\t$checkBoxString = '';\n\t\t$chkText = '';\n\t\t\tif ( $_GET[$chkName->value]== 'on'){\n\t\t\t\t$chkText = 'checked';\n\t\t\t}\n\t\t\t $checkBoxString = $checkBoxString . '<input ' .$chkText. ' type=\"checkbox\" id=\"' .$chkName->value. '\" name=\"' .$chkName->value. '\" class=\"' .$chkName->class. '\" ' . $optional . '>' .$chkName->label. ' ';\n\t\t\n\t\treturn $checkBoxString;\n\t}", "public function checkValue($field, $value){\n if($this->value($field) == $value){\n return \"checked\";\n } \n return \"\";\n }", "public function checked($value) {\n if ($this->convertToString == 'Yes') {\n $list = explode(',', $this->value);\n } else if (is_array($this->value)) {\n $list = $this->value;\n } else if (is_string($this->value)) {\n $list = [$this->value];\n } else {\n $list = [];\n }\n\n return in_array($value, $list) ? 'checked=\"checked\"' : '';\n }", "function input_radiocheck($type, $element_name, $values, $element_value) {\r\n print '<input type=\"' . $type . '\" name=\"' . $element_name .'\"id=\"'.$element_name.'\" value=\"' . $element_value . '\" ';\r\n if ($element_value == $values[$element_name]) {\r\n print ' checked=\"checked\"';\r\n }\r\n print '/>';\r\n}", "function mswCheckedArrItem($arr,$value) {\n return (in_array($value,$arr) ? ' checked=\"checked\"' : '');\n}", "function getFieldEnglishAssistanceFlag($value = null){\n\t\t$form_ret = '';\n\t\t$dataField = get_option('axceleratelink_srms_opt_EnglishAssistanceFlag');\n\t\t$dataTitle = get_option('axceleratelink_srms_opt_tit_EnglishAssistanceFlag');\n\t\t$tooltip = setToolTipNotification(\"EnglishAssistanceFlag\");\n\t\tif ($dataField == 'true'){\n\t\t\t$form_ret .= \"</br><label>\".$dataTitle.(get_axl_req_fields('eng_assist') === 'eng_assist' ? '<span class=\"red\">*</span>' : '').$tooltip.\"</label></br>\";\n\t\t\t$form_ret .= '<input class=\"EnglishAssistanceFlag\" name=\"EnglishAssistanceFlag\" id=\"EnglishAssistanceFlagT\" tabindex=\"55\" '.($value? 'checked' : '').' value=\"1\" type=\"radio\" data-value=\"Yes\"><label for=\"EnglishAssistanceFlagT\">&nbsp;Yes</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';\n\t\t\t$form_ret .= '<input class=\"EnglishAssistanceFlag\" name=\"EnglishAssistanceFlag\" id=\"EnglishAssistanceFlagF\" tabindex=\"56\" '.(!$value? 'checked' : '').' value=\"0\" type=\"radio\" data-value=\"No\" checked><label for=\"EnglishAssistanceFlagF\">&nbsp;No</label></br>';\n\t\t}\n\t\treturn $form_ret;\n\t}", "public function isChecked($active , $value)\n {\n return $active === $value? ' checked=\"checked\" ':'';\n }", "public function checkbox($name, $value = NULL, $checked = FALSE, array $attributes = NULL) {\n $this->load_values($name, $value, $attributes);\n $result = '<li>'.Kohana_Form::checkbox($name, $value, $checked, $attributes);\n // add error span\n if (isset($this->errors[$name])) {\n $result .= '<span class=\"error\">'.ucfirst($this->errors[$name]).'</span>';\n } else if (isset($attributes['info'])) {\n // else add info span\n $result .= '<span class=\"info\">'.$attributes['info'].'</span>';\n }\n $result .= '</li>';\n return $result;\n\t}", "private function display_checkbox_field($name, $value) {\n?>\n<input type=\"checkbox\" name=\"<?php echo htmlspecialchars($this->group); ?>[<?php echo htmlspecialchars($name); ?>]\" id=\"http_authentication_<?php echo htmlspecialchars($name); ?>\"<?php if ($value) echo ' checked=\"checked\"' ?> value=\"1\" /><br />\n<?php\n }", "function pixelgrade_comments_toggle_checked_attribute() {\n\t\t// If the outcome is not falsy, output the attribute.\n\t\tif ( pixelgrade_get_comments_toggle_checked_attribute() ) {\n\t\t\techo 'checked=\"checked\"';\n\t\t}\n\t}", "function GetCheckBoxField($title, $value)\r\n\t{\r\n\t\t$AddStr = \"\";\r\n\t\tif($value==\"1\")\r\n\t\t{\r\n\t\t\t$AddStr = \"checked\";\r\n\t\t}\r\n\t\treturn \"<input name=\\\"$title\\\" type=\\\"checkbox\\\" $AddStr value=\\\"1\\\" size=\\\"40\\\">\";\r\n\t}", "public static function checkbox ( $fieldname )\n {\n return array_key_exists($fieldname, $_POST) &&\n ($_POST[$fieldname] == '1' || $_POST[$fieldname] == 'on') ?\n '1' : '0';\n\n }", "public static function checkbox_tag($name, $value = \"1\", $checked = false, $html_attributes = array())\n {\n $checked = $checked ? \"checked\" : null;\n\n return TagHelper::tag('input', array_merge(array('type' => 'checkbox', 'name' => $name, 'value' => $value, 'checked' => $checked, 'id' => self::sanitize_id($name)), $html_attributes));\n }", "function set_CheckedValue($name)\n {\n if (isset($_POST[$name]) && $_POST[$name] == \"Include\") {\n return 1;\n }\n return 0;\n }", "public function createCheckBox($name, $value = false, $checked = false, $attr = array())\r\n {\r\n $checked = ($this->getFieldValue($name) !== false && in_array($value, (array)$this->getFieldValue($name)) ? true : ($this->getFieldValue($name) !== false ? false : $checked));\r\n if ($checked == true) {\r\n $attr = array_merge((array)$attr, array('checked' => 'checked'));\r\n }\r\n return $this->input($name, $value, $attr);\r\n }" ]
[ "0.7332958", "0.71624815", "0.69046575", "0.69011", "0.6798455", "0.67749405", "0.6771182", "0.67297214", "0.66545963", "0.66417485", "0.6623358", "0.65751827", "0.648659", "0.6436243", "0.6381616", "0.6321739", "0.63181496", "0.62336534", "0.6213341", "0.61842555", "0.6184053", "0.61335504", "0.61275816", "0.6125299", "0.61091053", "0.6100939", "0.6075758", "0.60630935", "0.601596", "0.6014748" ]
0.76100135
0
This method handles parsing the keycode and showing the proper product
function key($keycode=null){ $this->Attachment->recursive = 2; $this->layout = 'client_review'; if (!$keycode && empty($this->data)) { $this->Session->setFlash(__('Invalid keycode', true)); $this->redirect('/'); } $attachment = $this->Attachment->find('first',array('conditions'=>array('Attachment.keycode'=>$keycode))); if(empty($attachment)){ $this->Session->setFlash(__('Invalid keycode', true)); $this->redirect('/'); } $this->set(compact('attachment')); $this->set('string', $this->String); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function displayKeyboard()\n\t{\n\n\t\t$keyrow1 = array('q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p');\n\t\t$keyrow2 = array('a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l');\n\t\t$keyrow3 = array('z', 'x', 'c', 'v', 'b', 'n', 'm');\n\n\t\t$keys = '<div id=\"qwerty\" class=\"section\">'; //Keyboard div start \n\t\t$keys .= '<div class=\"keyrow\">'; //Keyrow 1 start\n\t\tforeach ($keyrow1 as $letter) {\n\t\t\t$keys .= $this->checkKey($letter);\n\t\t}\n\t\t$keys .= '</div>'; //Keyrow 2 end\n\t\t$keys .= '<div class=\"keyrow\">'; //Keyrow 2 start\n\t\tforeach ($keyrow2 as $letter) {\n\t\t\t$keys .= $this->checkKey($letter);\n\t\t}\n\t\t$keys .= '</div>'; //Keyrow 2 end\n\n\t\t$keys .= '<div class=\"keyrow\">'; //Keyrow 3 start\n\t\tforeach ($keyrow3 as $letter) {\n\t\t\t$keys .= $this->checkKey($letter);\n\t\t}\n\t\t$keys .= '</div>'; //Keyrow 3 end\n\n\t\t$keys .= '</div>'; //Keyboard div end \n\n\t\treturn $keys;\n\n\t}", "function CreateKeyCodeBox($keyCode, $enabled)\n\t{\n\t\tCreateRowHeader();\n\t\techo \"\t<div class=\\\"col-6\\\">\\n\";\n\t\techo \"\t\t<p class=\\\"lead\\\">ESE Code:</p>\\n\";\n\t\techo \"\t</div>\\n\";\n\t\techo \"\t<div class=\\\"col-6\\\">\\n\";\n\t\techo \"\t\t<input class=\\\"form-control\\\" type=\\\"text\\\" id=\\\"keyCode\\\" name=\\\"keyCode\\\" value=\\\"\" . $keyCode . \"\\\" required\";\n\t\tif (!$enabled)\n\t\t\techo \" readonly\";\n\t\techo \"/>\\n\";\n\t\techo \"\t</div>\\n\";\n\t\techo \"</div>\\n\";\n\t}", "function CreateKeyDropDownBox($keyData, $keyCode)\n\t{\n\t\tCreateRowHeader();\n\t\techo \"\t<div class=\\\"col-6\\\">\\n\";\n\t\techo \"\t\t<p class=\\\"lead\\\">ESE Code:</p>\\n\";\n\t\techo \"\t</div>\\n\";\n\t\techo \"\t<div class=\\\"col-6\\\">\\n\";\n\t\techo \"\t\t<select class=\\\"form-control\\\" id=\\\"keyCode\\\" name=\\\"keyCode\\\" required>\\n\";\n\t\tforeach ($keyData as $key => $value) {\n\t\t\techo \"\t\t\t<option value=\\\"\". $value['KeyId'] .\"\\\" \";\n\t\t\tif ($keyCode != \"\" && $keyCode == $value['KeyId']) {\n\t\t\t\techo \"selected=\\\"selected\\\"\";\n\t\t\t}\n\t\t\techo \">\".$value['KeyId'].\"</option>\\n\";\n\t\t}\n\t\techo \" </select>\\n\";\n\t\t//echo \"\t\t<input class=\\\"form-control\\\" type=\\\"text\\\" id=\\\"keyCode\\\" name=\\\"keyCode\\\" value=\\\"\" . $keyCode . \"\\\" required\";\n\t\techo \"\t</div>\\n\";\n\t\techo \"</div>\\n\";\n\t}", "function ncurses_keyok($keycode, $enable)\n{\n}", "protected function getPreviewInputCode() {}", "function Code39 ($Asc)\n{\n switch ($Asc)\n {\n case ' ':\n return \"011000100\"; \n case '$':\n return \"010101000\"; \n case '%':\n return \"000101010\"; \n case '*':\n return \"010010100\"; // * Start/Stop\n case '+':\n return \"010001010\"; \n case '|':\n return \"010000101\"; \n case '.':\n return \"110000100\"; \n case '/':\n return \"010100010\"; \n\t\t\t\tcase '-':\n\t\t\t\t\t\treturn \"010000101\";\n case '0':\n return \"000110100\"; \n case '1':\n return \"100100001\"; \n case '2':\n return \"001100001\"; \n case '3':\n return \"101100000\"; \n case '4':\n return \"000110001\"; \n case '5':\n return \"100110000\"; \n case '6':\n return \"001110000\"; \n case '7':\n return \"000100101\"; \n case '8':\n return \"100100100\"; \n case '9':\n return \"001100100\"; \n case 'A':\n return \"100001001\"; \n case 'B':\n return \"001001001\"; \n case 'C':\n return \"101001000\";\n case 'D':\n return \"000011001\";\n case 'E':\n return \"100011000\";\n case 'F':\n return \"001011000\";\n case 'G':\n return \"000001101\";\n case 'H':\n return \"100001100\";\n case 'I':\n return \"001001100\";\n case 'J':\n return \"000011100\";\n case 'K':\n return \"100000011\";\n case 'L':\n return \"001000011\";\n case 'M':\n return \"101000010\";\n case 'N':\n return \"000010011\";\n case 'O':\n return \"100010010\";\n case 'P':\n return \"001010010\";\n case 'Q':\n return \"000000111\";\n case 'R':\n return \"100000110\";\n case 'S':\n return \"001000110\";\n case 'T':\n return \"000010110\";\n case 'U':\n return \"110000001\";\n case 'V':\n return \"011000001\";\n case 'W':\n return \"111000000\";\n case 'X':\n return \"010010001\";\n case 'Y':\n return \"110010000\";\n case 'Z':\n return \"011010000\";\n default:\n return \"011000100\"; \n }\n}", "public function processSymbols() {\r\n\t\t$layers = array ();\r\n\t\t$layers [] = array ('map' => 'amenazas', 'layer' => 'Comunas', 'clsprefix' => 'Comuna ', 'clsdisplay' => 'num_comuna', 'clsitem' => 'num_comuna' );\r\n\t\t$layers [] = array ('map' => 'amenazas', 'layer' => 'Areas Homogeneas', 'clsprefix' => '', 'clsdisplay' => 'nombre', 'clsitem' => 'id_area' );\r\n\t\t$layers [] = array ('map' => 'amenazas', 'layer' => 'Amenazas', 'clsprefix' => '', 'clsdisplay' => 'descripcion', 'clsitem' => 'codamenaza' );\r\n\t\t\r\n\t\t$this->addSymbols ( $layers );\r\n\t}", "public function _e( $sKey ) {\r\n $this->output( $sKey );\r\n }", "function keyPressed(KeyEvent $event);", "function keypad($pad){\r\n\t\t\t\t\t\tglobal $arr;\r\n\t\t\t\t\t\t$key = $arr[27]; //in arr[27] wordt de pincode opgeslagen van vorige iteraties.\r\n\t\t\t\t\t\tif($pad == \"Enter\"){ //Wanneer de toets \"Enter\" is ingedrukt wordt de huidige code door deur.cpp uitgelezen en gecontroleerd op validiteit. de Raspberry pi zal bij een correcte code de deur openen.\r\n\t\t\t\t\t\t\twrite(\"28,1\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if($pad == \"Reset\"){ //Wanneer de toets \"Reset\" wordt ingedrukt wordt de $key leeg gemaakt voor een nieuwe poging.\r\n\t\t\t\t\t\t\t$key = \"\";\r\n\t\t\t\t\t\t\twrite(\"27,$key\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(strlen($key) == 4){ //Wanneer $key een grote van 4 characters bereikt worden er geen nieuwe cijfers geaccepteerd. Een reset is nodig voor een nieuwe poging. of enter kan gebruikt worden om de code te valideren.\r\n\t\t\t\t\t\t\t//Don't add key.\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t$key = $key . $pad; //Wanneer tpets 0 tot 9 wordt gebruikt wordt deze toegevoegd aan de string. \r\n\t\t\t\t\t\t\twrite(\"27,$key\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trefresh(0); //pagina verversen om huidige in beeld te brengen.\r\n\t\t\t\t\t}", "public function cli_keyboardInput() {}", "function Code39($x, $y, $code, $ext = true, $cks = false, $w = 0.4, $h = 20, $wide = true) {\n\n //Display code\n $this->SetFont('Arial', '', 10);\n $this->Text($x, $y+$h+4, $code);\n\n if($ext) {\n //Extended encoding\n $code = $this->encode_code39_ext($code);\n }\n else {\n //Convert to upper case\n $code = strtoupper($code);\n //Check validity\n if(!preg_match('|^[0-9A-Z. $/+%-]*$|', $code))\n $this->Error('Invalid barcode value: '.$code);\n }\n\n //Compute checksum\n if ($cks)\n $code .= $this->checksum_code39($code);\n\n //Add start and stop characters\n $code = '*'.$code.'*';\n\n //Conversion tables\n $narrow_encoding = array (\n '0' => '101001101101', '1' => '110100101011', '2' => '101100101011', \n '3' => '110110010101', '4' => '101001101011', '5' => '110100110101', \n '6' => '101100110101', '7' => '101001011011', '8' => '110100101101', \n '9' => '101100101101', 'A' => '110101001011', 'B' => '101101001011', \n 'C' => '110110100101', 'D' => '101011001011', 'E' => '110101100101', \n 'F' => '101101100101', 'G' => '101010011011', 'H' => '110101001101', \n 'I' => '101101001101', 'J' => '101011001101', 'K' => '110101010011', \n 'L' => '101101010011', 'M' => '110110101001', 'N' => '101011010011', \n 'O' => '110101101001', 'P' => '101101101001', 'Q' => '101010110011', \n 'R' => '110101011001', 'S' => '101101011001', 'T' => '101011011001', \n 'U' => '110010101011', 'V' => '100110101011', 'W' => '110011010101', \n 'X' => '100101101011', 'Y' => '110010110101', 'Z' => '100110110101', \n '-' => '100101011011', '.' => '110010101101', ' ' => '100110101101', \n '*' => '100101101101', '$' => '100100100101', '/' => '100100101001', \n '+' => '100101001001', '%' => '101001001001' );\n\n $wide_encoding = array (\n '0' => '101000111011101', '1' => '111010001010111', '2' => '101110001010111', \n '3' => '111011100010101', '4' => '101000111010111', '5' => '111010001110101', \n '6' => '101110001110101', '7' => '101000101110111', '8' => '111010001011101', \n '9' => '101110001011101', 'A' => '111010100010111', 'B' => '101110100010111', \n 'C' => '111011101000101', 'D' => '101011100010111', 'E' => '111010111000101', \n 'F' => '101110111000101', 'G' => '101010001110111', 'H' => '111010100011101', \n 'I' => '101110100011101', 'J' => '101011100011101', 'K' => '111010101000111', \n 'L' => '101110101000111', 'M' => '111011101010001', 'N' => '101011101000111', \n 'O' => '111010111010001', 'P' => '101110111010001', 'Q' => '101010111000111', \n 'R' => '111010101110001', 'S' => '101110101110001', 'T' => '101011101110001', \n 'U' => '111000101010111', 'V' => '100011101010111', 'W' => '111000111010101', \n 'X' => '100010111010111', 'Y' => '111000101110101', 'Z' => '100011101110101', \n '-' => '100010101110111', '.' => '111000101011101', ' ' => '100011101011101', \n '*' => '100010111011101', '$' => '100010001000101', '/' => '100010001010001', \n '+' => '100010100010001', '%' => '101000100010001');\n\n $encoding = $wide ? $wide_encoding : $narrow_encoding;\n\n //Inter-character spacing\n $gap = ($w > 0.29) ? '00' : '0';\n\n //Convert to bars\n $encode = '';\n for ($i = 0; $i< strlen($code); $i++)\n $encode .= $encoding[$code[$i]].$gap;\n\n //Draw bars\n $this->draw_code39($encode, $x, $y, $w, $h);\n}", "public function onKeyPressed( Streamwide_Engine_Events_Event $event )\n {\n $key = $event->getParam( 'receivedKey' );\n $promptType = $event->getContextParam( 'promptType' );\n if ( $this->_isEndKey( $key ) ) {\n $this->_timer->reset();\n $this->_mediaPlayer->reset();\n $this->_dtmfHandler->reset();\n $event = new Streamwide_Engine_Events_Event( Streamwide_Engine_Events_Event::FINISHED );\n $event->setParam( 'number', $this->_number );\n $this->dispatchEvent( $event );\n } else {\n $this->_number .= $key;\n $this->_rearmTimer();\n if ( null !== $promptType ) {\n if ( self::PROMPT_INVITE === $promptType ) {\n if ( $this->_shouldStopPromptingOnDtmf() ) {\n $this->_mediaPlayer->stop();\n }\n } else {\n $this->_mediaPlayer->stop();\n }\n }\n }\n }", "public function getContextMenuCode() {}", "public function getKeystroke() {}", "private static function buildSYLKCharacters()\n {\n self::$SYLKCharacters = array(\n \"\\x1B 0\" => chr(0),\n \"\\x1B 1\" => chr(1),\n \"\\x1B 2\" => chr(2),\n \"\\x1B 3\" => chr(3),\n \"\\x1B 4\" => chr(4),\n \"\\x1B 5\" => chr(5),\n \"\\x1B 6\" => chr(6),\n \"\\x1B 7\" => chr(7),\n \"\\x1B 8\" => chr(8),\n \"\\x1B 9\" => chr(9),\n \"\\x1B :\" => chr(10),\n \"\\x1B ;\" => chr(11),\n \"\\x1B <\" => chr(12),\n \"\\x1B :\" => chr(13),\n \"\\x1B >\" => chr(14),\n \"\\x1B ?\" => chr(15),\n \"\\x1B!0\" => chr(16),\n \"\\x1B!1\" => chr(17),\n \"\\x1B!2\" => chr(18),\n \"\\x1B!3\" => chr(19),\n \"\\x1B!4\" => chr(20),\n \"\\x1B!5\" => chr(21),\n \"\\x1B!6\" => chr(22),\n \"\\x1B!7\" => chr(23),\n \"\\x1B!8\" => chr(24),\n \"\\x1B!9\" => chr(25),\n \"\\x1B!:\" => chr(26),\n \"\\x1B!;\" => chr(27),\n \"\\x1B!<\" => chr(28),\n \"\\x1B!=\" => chr(29),\n \"\\x1B!>\" => chr(30),\n \"\\x1B!?\" => chr(31),\n \"\\x1B'?\" => chr(127),\n \"\\x1B(0\" => '€', // 128 in CP1252\n \"\\x1B(2\" => '‚', // 130 in CP1252\n \"\\x1B(3\" => 'ƒ', // 131 in CP1252\n \"\\x1B(4\" => '„', // 132 in CP1252\n \"\\x1B(5\" => '…', // 133 in CP1252\n \"\\x1B(6\" => '†', // 134 in CP1252\n \"\\x1B(7\" => '‡', // 135 in CP1252\n \"\\x1B(8\" => 'ˆ', // 136 in CP1252\n \"\\x1B(9\" => '‰', // 137 in CP1252\n \"\\x1B(:\" => 'Š', // 138 in CP1252\n \"\\x1B(;\" => '‹', // 139 in CP1252\n \"\\x1BNj\" => 'Œ', // 140 in CP1252\n \"\\x1B(>\" => 'Ž', // 142 in CP1252\n \"\\x1B)1\" => '‘', // 145 in CP1252\n \"\\x1B)2\" => '’', // 146 in CP1252\n \"\\x1B)3\" => '“', // 147 in CP1252\n \"\\x1B)4\" => '”', // 148 in CP1252\n \"\\x1B)5\" => '•', // 149 in CP1252\n \"\\x1B)6\" => '–', // 150 in CP1252\n \"\\x1B)7\" => '—', // 151 in CP1252\n \"\\x1B)8\" => '˜', // 152 in CP1252\n \"\\x1B)9\" => '™', // 153 in CP1252\n \"\\x1B):\" => 'š', // 154 in CP1252\n \"\\x1B);\" => '›', // 155 in CP1252\n \"\\x1BNz\" => 'œ', // 156 in CP1252\n \"\\x1B)>\" => 'ž', // 158 in CP1252\n \"\\x1B)?\" => 'Ÿ', // 159 in CP1252\n \"\\x1B*0\" => ' ', // 160 in CP1252\n \"\\x1BN!\" => '¡', // 161 in CP1252\n \"\\x1BN\\\"\" => '¢', // 162 in CP1252\n \"\\x1BN#\" => '£', // 163 in CP1252\n \"\\x1BN(\" => '¤', // 164 in CP1252\n \"\\x1BN%\" => '¥', // 165 in CP1252\n \"\\x1B*6\" => '¦', // 166 in CP1252\n \"\\x1BN'\" => '§', // 167 in CP1252\n \"\\x1BNH \" => '¨', // 168 in CP1252\n \"\\x1BNS\" => '©', // 169 in CP1252\n \"\\x1BNc\" => 'ª', // 170 in CP1252\n \"\\x1BN+\" => '«', // 171 in CP1252\n \"\\x1B*<\" => '¬', // 172 in CP1252\n \"\\x1B*=\" => '­', // 173 in CP1252\n \"\\x1BNR\" => '®', // 174 in CP1252\n \"\\x1B*?\" => '¯', // 175 in CP1252\n \"\\x1BN0\" => '°', // 176 in CP1252\n \"\\x1BN1\" => '±', // 177 in CP1252\n \"\\x1BN2\" => '²', // 178 in CP1252\n \"\\x1BN3\" => '³', // 179 in CP1252\n \"\\x1BNB \" => '´', // 180 in CP1252\n \"\\x1BN5\" => 'µ', // 181 in CP1252\n \"\\x1BN6\" => '¶', // 182 in CP1252\n \"\\x1BN7\" => '·', // 183 in CP1252\n \"\\x1B+8\" => '¸', // 184 in CP1252\n \"\\x1BNQ\" => '¹', // 185 in CP1252\n \"\\x1BNk\" => 'º', // 186 in CP1252\n \"\\x1BN;\" => '»', // 187 in CP1252\n \"\\x1BN<\" => '¼', // 188 in CP1252\n \"\\x1BN=\" => '½', // 189 in CP1252\n \"\\x1BN>\" => '¾', // 190 in CP1252\n \"\\x1BN?\" => '¿', // 191 in CP1252\n \"\\x1BNAA\" => 'À', // 192 in CP1252\n \"\\x1BNBA\" => 'Á', // 193 in CP1252\n \"\\x1BNCA\" => 'Â', // 194 in CP1252\n \"\\x1BNDA\" => 'Ã', // 195 in CP1252\n \"\\x1BNHA\" => 'Ä', // 196 in CP1252\n \"\\x1BNJA\" => 'Å', // 197 in CP1252\n \"\\x1BNa\" => 'Æ', // 198 in CP1252\n \"\\x1BNKC\" => 'Ç', // 199 in CP1252\n \"\\x1BNAE\" => 'È', // 200 in CP1252\n \"\\x1BNBE\" => 'É', // 201 in CP1252\n \"\\x1BNCE\" => 'Ê', // 202 in CP1252\n \"\\x1BNHE\" => 'Ë', // 203 in CP1252\n \"\\x1BNAI\" => 'Ì', // 204 in CP1252\n \"\\x1BNBI\" => 'Í', // 205 in CP1252\n \"\\x1BNCI\" => 'Î', // 206 in CP1252\n \"\\x1BNHI\" => 'Ï', // 207 in CP1252\n \"\\x1BNb\" => 'Ð', // 208 in CP1252\n \"\\x1BNDN\" => 'Ñ', // 209 in CP1252\n \"\\x1BNAO\" => 'Ò', // 210 in CP1252\n \"\\x1BNBO\" => 'Ó', // 211 in CP1252\n \"\\x1BNCO\" => 'Ô', // 212 in CP1252\n \"\\x1BNDO\" => 'Õ', // 213 in CP1252\n \"\\x1BNHO\" => 'Ö', // 214 in CP1252\n \"\\x1B-7\" => '×', // 215 in CP1252\n \"\\x1BNi\" => 'Ø', // 216 in CP1252\n \"\\x1BNAU\" => 'Ù', // 217 in CP1252\n \"\\x1BNBU\" => 'Ú', // 218 in CP1252\n \"\\x1BNCU\" => 'Û', // 219 in CP1252\n \"\\x1BNHU\" => 'Ü', // 220 in CP1252\n \"\\x1B-=\" => 'Ý', // 221 in CP1252\n \"\\x1BNl\" => 'Þ', // 222 in CP1252\n \"\\x1BN{\" => 'ß', // 223 in CP1252\n \"\\x1BNAa\" => 'à', // 224 in CP1252\n \"\\x1BNBa\" => 'á', // 225 in CP1252\n \"\\x1BNCa\" => 'â', // 226 in CP1252\n \"\\x1BNDa\" => 'ã', // 227 in CP1252\n \"\\x1BNHa\" => 'ä', // 228 in CP1252\n \"\\x1BNJa\" => 'å', // 229 in CP1252\n \"\\x1BNq\" => 'æ', // 230 in CP1252\n \"\\x1BNKc\" => 'ç', // 231 in CP1252\n \"\\x1BNAe\" => 'è', // 232 in CP1252\n \"\\x1BNBe\" => 'é', // 233 in CP1252\n \"\\x1BNCe\" => 'ê', // 234 in CP1252\n \"\\x1BNHe\" => 'ë', // 235 in CP1252\n \"\\x1BNAi\" => 'ì', // 236 in CP1252\n \"\\x1BNBi\" => 'í', // 237 in CP1252\n \"\\x1BNCi\" => 'î', // 238 in CP1252\n \"\\x1BNHi\" => 'ï', // 239 in CP1252\n \"\\x1BNs\" => 'ð', // 240 in CP1252\n \"\\x1BNDn\" => 'ñ', // 241 in CP1252\n \"\\x1BNAo\" => 'ò', // 242 in CP1252\n \"\\x1BNBo\" => 'ó', // 243 in CP1252\n \"\\x1BNCo\" => 'ô', // 244 in CP1252\n \"\\x1BNDo\" => 'õ', // 245 in CP1252\n \"\\x1BNHo\" => 'ö', // 246 in CP1252\n \"\\x1B/7\" => '÷', // 247 in CP1252\n \"\\x1BNy\" => 'ø', // 248 in CP1252\n \"\\x1BNAu\" => 'ù', // 249 in CP1252\n \"\\x1BNBu\" => 'ú', // 250 in CP1252\n \"\\x1BNCu\" => 'û', // 251 in CP1252\n \"\\x1BNHu\" => 'ü', // 252 in CP1252\n \"\\x1B/=\" => 'ý', // 253 in CP1252\n \"\\x1BN|\" => 'þ', // 254 in CP1252\n \"\\x1BNHy\" => 'ÿ', // 255 in CP1252\n );\n }", "public function renderKeys()\n\t{\n\t}", "public function getABdata($key) {\n $ans=\"\";\n #$table = \"{$this->getParms->dict}ab\";\n $table = $this->dal_ab->tabname;\n $result = $this->dal_ab->getgeneral($key,$table);\n $dbg=false;\n dbgprint($dbg,\"getABdata: length of result=\" . count($result) . \"\\n\");\n if (count($result) == 1) {\n list($key1,$data) = $result[0];\n if (preg_match('/<disp>(.*?)<\\/disp>/',$data,$matches)) {\n $ans = $matches[1];\n /* This taken from mw code; but is probably obsolete.\n It permitted <s>X</s> coding within the abbreviation expansion\n and conversion to the user's choice of 'filter'\n global $dispfilter;\n $temp = strtolower($dispfilter);\n $filterflag = (preg_match('/deva/',$temp) || preg_match('/roman/',$temp));\n if ($filterflag) {\n\t$ans = preg_replace('/<s>/','<SA>',$ans);\n\t$ans = preg_replace('/<\\/s>/','</SA>',$ans);\n }\n */\n }\n }\n return $ans;\n}", "function key();", "function decode($value,$key){\n \techo \"$key : $value\".\"\\n\";\n }", "function displaySymbol($randomValue, $pos){\n \n \n switch($randomValue){\n case 0: $symbol = \"seven\";\n break;\n case 1: $symbol = \"cherry\";\n break;\n case 2: $symbol = \"lemon\";\n break;\n case 3: $symbol = \"grapes\";\n \n }\n \n echo \"<img id = 'reel$pos' src = 'img/$symbol.png' alt = '$symbol' title ='\".ucfirst($symbol). \"' width = '70' >\";\n }", "static function try_modify_key($key)\n\t{\n\t\t//compatibility for the old iconfont that was based on numeric values\n\t\tif(is_numeric($key)) \n\t\t{\n\t\t\t$key = self::get_char_from_fallback($key);\n\t\t}\n\t\n\t\t//chars that are based on multiple chars like \\ueXXX\\ueXXX; need to be modified before passed\n\t\tif(!empty($key) && strpos($key, 'u',1) !== false)\n\t\t{\n\t\t\t$key = explode('u', $key);\n\t\t\t$key = implode('\\u',$key);\n\t\t\t$key = substr($key, 1);\n\t\t}\n\t\n\t\treturn $key;\n\t}", "public function getGlyphIndex($charCode) {}", "public function getGlyphIndex($charCode) {}", "public function getGlyphIndex($charCode) {}", "public function getGlyphIndex($charCode) {}", "public function getGlyphIndex($charCode) {}", "protected function value_char()\n {\n }", "private function determainclaimType()\r\n {\r\n // 9 digits\r\n if (preg_match($this->keycodeRegex, $this->keycode) == false)\r\n {\r\n $this->claimType = \"invaild-keycode\";\r\n }\r\n \r\n // if keycode is NOT null, then search in the database\r\n else if ($this->keycode != null)\r\n {\r\n $result = mysql_query(\"SELECT Keycode, Claimable, Repairable, WarrantyMonths\r\n FROM Product \r\n WHERE Product.Keycode = $this->keycode\");\r\n\r\n $array = mysql_fetch_array($result);\r\n\r\n // if keycode is null, item does not exist in the database\r\n //if ($array[\"Keycode\"] == false)\r\n if (empty($array))\r\n {\r\n $this->claimType = \"keycode-not-found\";\r\n }\r\n // if product is claimable and repairable\r\n else if ($array[\"Claimable\"] == 1 && $array[\"Repairable\"] == 1)\r\n { \r\n // checks make sure transaction number was found, if number\r\n // rows are about zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) \r\n {\r\n //// check warranty period\r\n $this->claimType = \"repair-warranty\";\r\n }\r\n else\r\n {\r\n // check warranty period\r\n $this->claimType = \"repair-no-warranty\";\r\n }\r\n }\r\n else // transactionResult number rows is zero, this means no transaction was founds\r\n { \r\n $this->claimType = \"repair-no-transaction\";\r\n }\r\n }\r\n // if product offers a finanical claim\r\n else if ($array[\"Claimable\"] == 1 && $array[\"Repairable\"] == 0)\r\n {\r\n // checks make sure transaction number was found, if number\r\n // rows are about zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) // true means inside warranty period\r\n {\r\n $this->claimType = \"finanical-warranty\";\r\n }\r\n else // false means outside warranty period\r\n {\r\n $this->claimType = \"finanical-outside-warranty\";\r\n }\r\n }\r\n else // transactionResult's rows was zero so no tranaction number was found\r\n {\r\n $this->claimType = \"finanical-no-transaction\";\r\n }\r\n }\r\n // if a product is NOT claimable with supplier\r\n else if ($array[\"Claimable\"] == 0)\r\n {\r\n // checks make sure transaction number was found, if number\r\n // rows are above zero this means the query found a result\r\n if (!empty($this->transactionResult))\r\n {\r\n // checks product is within warrant period based on purchase date\r\n // returns true if it is and false if it is not\r\n $warrantyBoolean = $this->withinWarrantyPeriod($this->transactionResult[\"PurchaseDate\"], $array[\"WarrantyMonths\"]);\r\n\r\n if ($warrantyBoolean == true) // true means inside warranty period\r\n {\r\n $this->claimType = \"not-claimable-refund\";\r\n }\r\n else // false means outside warranty period\r\n {\r\n $this->claimType = \"not-claimable-outside-warranty\";\r\n }\r\n }\r\n else // no vaild transaction number provided\r\n {\r\n $this->claimType = \"not-claimable-no-transaction\";\r\n }\r\n }\r\n }\r\n \r\n }", "private function zarinpalTranslate($key)\n {\n // key format: ex. payment_error for payment error\n $key = 'PLG_K2STORE_PAYMENTS_ZARINPALWG_' . strtoupper($key);\n return JText::_($key);\n }" ]
[ "0.57965845", "0.55319184", "0.54826087", "0.5397432", "0.5294287", "0.52261156", "0.5202727", "0.5185638", "0.51517165", "0.5146095", "0.5100144", "0.50981647", "0.507155", "0.504491", "0.5027801", "0.5019897", "0.50176287", "0.500732", "0.50062764", "0.5004911", "0.49979502", "0.49831977", "0.4978801", "0.4978801", "0.49785352", "0.49785352", "0.49770364", "0.49697933", "0.49590716", "0.49560264" ]
0.5647901
1
Throws a runtime exception of the last socket error
function throw_socket_error() { $code = socket_last_error(); $str = socket_strerror($code); throw new \RuntimeException(sprintf( '(%s) - %s', $code, $str )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function trigger_socket_error($socket = null)\n {\n $code = $socket ? socket_last_error($socket) : socket_last_error();\n debug_print_backtrace();\n trigger_error(\"[${code}] \" . socket_strerror($code), E_USER_ERROR);\n }", "private function getLastSocketError() {\n $errStr = '-1: Unknown error';\n\n if (function_exists('socket_import_stream')) {\n $socket = socket_import_stream($this->socket);\n $errCode = socket_last_error($socket);\n $errStr = $errCode . ': ' . socket_strerror($errCode);\n }\n\n return $errStr;\n }", "private function socketLastError() : string\n {\n return socket_strerror( socket_last_error( $this->socket ) );\n }", "private function getLastError() {\n $errorCode = socket_last_error();\n return socket_strerror($errorCode);\n }", "public function testGetSocketWithInvalidSocketMetadata()\n {\n $client = new Client;\n $method = $this->getMethod('getSocket');\n\n try {\n $method->invoke($client, 'tcp://0.0.0.0:0', array());\n $this->fail('Expected exception not thrown');\n } catch (Exception $e) {\n $this->assertEquals(Exception::ERR_CONNECTION_ATTEMPT_FAILED, $e->getCode());\n $this->assertStringStartsWith(\n 'Unable to connect to remote tcp://0.0.0.0:0: socket error ',\n $e->getMessage()\n );\n }\n }", "function assertSocket( $retval, $msg ) {\n\tif ( $retval === false ) {\n\t\t$errno = socket_last_error();\n\t\t$err = socket_strerror( $errno );\n\t\tdie( \"$msg: ($errno) $err.\\n\" );\n\t}\n\n\treturn $retval;\n}", "public static function getLastSocketErrno($socket = null): int|false {}", "function msgsrv_last_error () {}", "public function getErrno(){\n\t\treturn $this->connection->errno;\n\t}", "function lastErrno();", "private function mpowerConnect()\n {\n $errno = 0;\n $errstr = \"\";\n $this->_socket = @fsockopen($this->_server, $this->_port, $errno, $errstr, $this->_connectionTimeout);\n if (!$this->_socket) {\n @fclose($this->_socket);\n throw new \\Exception(\n sprintf(\n \"[MPServer::mpowerConnect]Failed to connect to %s:%s.Errno:%d:%s\",\n $this->_server, $this->_port, $errno, $errstr\n )\n );\n }\n\n }", "public static function serverError(): self {\n\t\treturn new static(102);\n\t}", "function lastError();", "private function mpowerDisconnect()\n {\n if (!fclose($this->_socket)) {\n //Would like to know why this failed but how will php tell me?\n throw new \\Exception(\n sprintf(\n \"[MPServer::mpowerDisconnect]Failed to disconnect from %s:%s.\" .\n \" Unfortunately the reason is unknown\",\n $this->_server, $this->_port\n )\n );\n }\n }", "public function error() {\n\t\t$connection = $this -> connect();\n\t\treturn $connection -> error;\n\t}", "protected abstract function send_error($ex=null) ;", "private function checkResult($result) {\n if ($result === false) {\n throw new Exception(\n 'Socket operation failed: ' . $this->getLastError()\n );\n }\n }", "public function onFailure() {\n\t\tif ($this->onConnected) {\n\t\t\t$this->onConnected->executeAll($this);\n\t\t\t$this->onConnected = null;\n\t\t}\n\t}", "public function errno()\n {\n return (int) $this->conn->errorCode();\n }", "abstract public function getLastError();", "abstract public function getLastError();", "public static function catchShutdownError(): void {\n $error = error_get_last();\n\n if ($error === null) {\n return;\n }\n\n if ($error['type'] === E_ERROR) {\n self::catchException(null, $error['message'], $error['file'], $error['line']);\n }\n }", "public function init() {\n\t\t$errno = \"\";\n\t\t$errstr = \"\";\n\t\t\n\t\t//Si la socket est un fichier\n\t\tif (file_exists ( $this->nom_socket )) {\n\t\t\t@unlink ( $this->nom_socket );\n\t\t}\n\t\t\n\t\t$nom_complet = $this->type_socket . \"://\" . $this->nom_socket;\n\t\tif ($this->port_socket != \"\") {\n\t\t\t$nom_complet .= \":\" . $this->port_socket;\n\t\t}\n\t\t$this->socket = stream_socket_server ( $nom_complet, $errno, $errstr );\n\t\t$this->onDebug ( $errstr . \" (\" . $errno . \") sur \" . $nom_complet, 1 );\n\t\t\n\t\tif (! $this->socket) {\n\t\t\treturn $this->onError ( $errstr . \" (\" . $errno . \") sur \" . $nom_complet );\n\t\t\tif ($errstr == \"Address already in use\") {\n\t\t\t\t$CODE_RETOUR = 2;\n\t\t\t} else {\n\t\t\t\t$CODE_RETOUR = 0;\n\t\t\t}\n\t\t} else {\n\t\t\t$CODE_RETOUR = 1;\n\t\t}\n\t\t\n\t\treturn $CODE_RETOUR;\n\t}", "public static function serverError(): self\n {\n return new self(500, 599);\n }", "protected function socketPerform() {}", "public function throwError();", "protected function request_rescue($e)\n {\n if (\n $this->params[\"rescue\"] &&\n $this->params[\"client_id\"] &&\n $this->params[\"client_key\"]\n ) {\n if ($this->params[\"rescued\"]) {\n throw $e; // Prevent recursion\n } else {\n $this->params([\"rescued\" => true]);\n $this->server = new Connection([\n \"host\" => $this->params[\"rescue\"][\"host\"],\n \"port\" => $this->params[\"rescue\"][\"port\"],\n \"verify_cert\" => $this->params[\"verify_cert\"],\n ]);\n $this->server->connect();\n }\n }\n }", "public function error() {\n $connection = $this -> connect();\n return $connection -> error;\n }", "function pg_socket($connection)\n{\n error_clear_last();\n $result = \\pg_socket($connection);\n if ($result === false) {\n throw PgsqlException::createFromPhpError();\n }\n return $result;\n}", "public function error() {\n $connection = $this -> connect();\n return $connection -> error;\n }" ]
[ "0.74690366", "0.710616", "0.7054681", "0.67295015", "0.64258456", "0.6271294", "0.61298865", "0.599408", "0.5984312", "0.5980148", "0.591567", "0.58781844", "0.58147323", "0.579264", "0.5750981", "0.57174844", "0.5684886", "0.56821096", "0.5640841", "0.56379145", "0.56379145", "0.5637417", "0.56217116", "0.56008816", "0.56007", "0.55406415", "0.5539187", "0.55274105", "0.5527301", "0.5494091" ]
0.7958063
0
show all the invalid properties with reasons.
public function listInvalidProperties() { $invalid_properties = []; $allowed_values = ["CREDIT_CARD", "CASH", "THIRD_PARTY_CARD", "NO_SALE", "SQUARE_WALLET", "SQUARE_GIFT_CARD", "UNKNOWN", "OTHER"]; if (!in_array($this->container['event_type'], $allowed_values)) { $invalid_properties[] = "invalid value for 'event_type', must be one of #{allowed_values}."; } $allowed_values = ["OTHER_BRAND", "VISA", "MASTERCARD", "AMERICAN_EXPRESS", "DISCOVER", "DISCOVER_DINERS", "JCB", "CHINA_UNIONPAY", "SQUARE_GIFT_CARD"]; if (!in_array($this->container['card_brand'], $allowed_values)) { $invalid_properties[] = "invalid value for 'card_brand', must be one of #{allowed_values}."; } $allowed_values = ["MANUAL", "SCANNED", "SQUARE_CASH", "SQUARE_WALLET", "SWIPED", "WEB_FORM", "OTHER"]; if (!in_array($this->container['entry_method'], $allowed_values)) { $invalid_properties[] = "invalid value for 'entry_method', must be one of #{allowed_values}."; } return $invalid_properties; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listInvalidProperties();", "public function listInvalidProperties()\n {\n $invalidProperties = parent::listInvalidProperties();\n $allowedValues = $this->getStyleIdentifierAllowableValues();\n if (!in_array($this->container['style_identifier'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'style_identifier', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getTextEffectAllowableValues();\n if (!in_array($this->container['text_effect'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'text_effect', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getUnderlineAllowableValues();\n if (!in_array($this->container['underline'], $allowedValues)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'underline', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = array();\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = array();\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = array();\n return $invalid_properties;\n }", "public function listInvalidProperties() {\n\t\treturn array();\n\t}", "public function listInvalidProperties()\n {\n $invalid_properties = parent::listInvalidProperties();\n\n return $invalid_properties;\n }", "public function listInvalidProperties() {\n\n $invalidProperties = [];\n\n /*\n * Any needed validation goes here. If a property requires no validation\n * (e.g. it's OK for it to be empty) then it may be omitted.\n */\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n $allowedValues = $this->getLevelAllowableValues();\n if (!is_null($this->container['level']) && !in_array($this->container['level'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'level', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n $allowedValues = $this->getStatusAllowableValues();\n if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) {\n $invalidProperties[] = sprintf(\n \"invalid value for 'status', must be one of '%s'\",\n implode(\"', '\", $allowedValues)\n );\n }\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n $invalidProperties = [];\n\n\n return $invalidProperties;\n }", "public function listInvalidProperties()\n {\n return [];\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n $allowed_values = $this->getBootOrderAllowableValues();\n if (!in_array($this->container['boot_order'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'boot_order', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n $allowed_values = $this->getFirewallAllowableValues();\n if (!in_array($this->container['firewall'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'firewall', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n $allowed_values = $this->getVideoModelAllowableValues();\n if (!in_array($this->container['video_model'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'video_model', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n $allowed_values = $this->getVncAllowableValues();\n if (!in_array($this->container['vnc'], $allowed_values)) {\n $invalid_properties[] = sprintf(\n \"invalid value for 'vnc', must be one of '%s'\",\n implode(\"', '\", $allowed_values)\n );\n }\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }", "public function listInvalidProperties()\n {\n $invalid_properties = [];\n\n return $invalid_properties;\n }" ]
[ "0.7885589", "0.7691335", "0.76856136", "0.76856136", "0.76856136", "0.7683929", "0.76756734", "0.7666285", "0.7653707", "0.7653707", "0.76334393", "0.7632623", "0.7632623", "0.7632623", "0.7632623", "0.7632623", "0.7632623", "0.76262254", "0.7612341", "0.75995564", "0.75995564", "0.75995564", "0.75995564", "0.75995564", "0.75995564", "0.75995564", "0.75995564", "0.75995564", "0.75995564", "0.75995564" ]
0.7704446
1
Dynamic property handling for '_layer2_assignments'
public function dynamic_property_callback_layer2_assignment(array $p_row) { global $g_comp_database; $l_dao = isys_cmdb_dao_category_s_net::instance($g_comp_database); $l_res = $l_dao->get_assigned_layer_2($p_row['isys_obj__id']); $l_list = []; if ($l_res->num_rows() > 0) { $l_quicklink = new isys_ajax_handler_quick_info(); $i = 0; while ($l_row = $l_res->get_row()) { if ($i++ == isys_tenantsettings::get('cmdb.limits.port-lists-vlans', 10)) { $l_list[] = '...'; break; } if (empty($l_row['isys_obj__id'])) { $l_row['vlan'] = '-'; } // if $l_list[] = $l_quicklink->get_quick_info( $l_row['isys_obj__id'], $l_row['isys_obj__title'], C__LINK__OBJECT ); } // while $l_res->free_result(); } // if if (count($l_list)) { return '<ul class="fl"><li>' . implode('</li><li>', $l_list) . '</li></ul>'; } else { return isys_tenantsettings::get('gui.empty_value', '-'); } // if }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProperty2Name() {}", "public function setAssignments($val)\n {\n $this->_propDict[\"assignments\"] = $val;\n return $this;\n }", "abstract protected function propertyGet($name);", "abstract protected function get_properties();", "public function getProperty1Name() {}", "abstract public function property($propertyIdent);", "public function setAssignments($val)\n {\n $this->_propDict[\"assignments\"] = $val;\n return $this;\n }", "public function __get($propertyName){\n if(array_key_exists($propertyName, $this->properties)){\n\n return $this->properties[$propertyName];\n }\n \n }", "private function mapProperties(): void\n {\n $this->properties = Collect::keyBy($this->collection->getProperties()->getValues(), 'identifier');\n }", "abstract public function getObjectDefinitionProperty();", "public function getAssignments()\n {\n if (array_key_exists(\"assignments\", $this->_propDict)) {\n return $this->_propDict[\"assignments\"];\n } else {\n return null;\n }\n }", "protected function dynamic_properties()\n {\n return [\n '_address_range' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET__ADDRESS_RANGE',\n C__PROPERTY__INFO__DESCRIPTION => 'Address range'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_obj__id'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_address_range'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true,\n C__PROPERTY__PROVIDES__REPORT => true\n ]\n ],\n '_address_with_suffix' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET__ADDRESS_WITH_SUFFIX',\n C__PROPERTY__INFO__DESCRIPTION => 'Net address with suffix'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_obj__id'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_address_with_suffix'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true,\n C__PROPERTY__PROVIDES__REPORT => true\n ]\n ],\n '_address' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET',\n C__PROPERTY__INFO__DESCRIPTION => 'Net address'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_address'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true\n ]\n ],\n '_free_addresses' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATG__NETWORK__ASS_IP',\n C__PROPERTY__INFO__DESCRIPTION => 'Assigned addresses and free addresses'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_obj__id'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_free_addresses'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true,\n C__PROPERTY__PROVIDES__REPORT => true\n ]\n ],\n '_netmask' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CATP__IP__SUBNETMASK',\n C__PROPERTY__INFO__DESCRIPTION => 'Subnetmask'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_netmask'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true\n ]\n ],\n '_layer2_assignments' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET__LAYER2_NET',\n C__PROPERTY__INFO__DESCRIPTION => 'Layer-2-net assignments'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_layer2_assignment'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true\n ]\n ]\n ];\n }", "public function GetClassSCPropertiesInArray_Advance(DataSource $DS)\n {\n $rtnval = array();\n $propref = new \\ReflectionProperty(get_class($this), 'id');\n $propref->setAccessible(true);\n $PropValue = $propref->getValue($this);\n $rtnval['id'] = $PropValue;\n\n foreach ($DS->getFields() as $f) {\n\n if ($f == 'id') continue;\n $fieldName = $f->getFieldName();\n /*$fieldName=str_replace('_', '\\\\', $fieldName);\n $fieldName=urldecode($fieldName);\n if(strpos($fieldName, '\\\\')>-1) $fieldName=substr($fieldName, strpos($fieldName, '.')+1);\n */\n /*$fieldName=str_replace('.', '->', $fieldName);\n $fieldName='$this->'.$fieldName;\n print_r($fieldName.' TO EVAL . ');\n print_r($this->Title);\n $ap='';\n $b='$this->Title';\n $a=eval($b);\n print_r('eval1='.$a);\n print_r('eval1='.$ap);\n */\n try {\n $fieldName = \\ApplicationHelpers::TranslateFieldName_From_Client2Server($fieldName);\n $parts = explode('.', $fieldName);\n $PropValue = $this;\n $propref = null;\n //print_r($fieldName.':');\n //print_r($parts);\n try {\n for ($i = 0; $i < count($parts); $i++) {\n $_clsname = get_class($PropValue);\n if (\\ApplicationHelpers::IsORMProxyClass($_clsname)) $PropValue->DoctrineLoad();\n $propref = new \\ReflectionProperty(get_class($PropValue), $parts[$i]);\n\n\n //print_r(' | Class:'.$propref->class.' prop:'. $propref->name.' | ');\n $propref->setAccessible(true);\n if (isset($PropValue))\n $PropValue = $propref->getValue($PropValue);\n else {\n $PropValue = NULL;\n //print_r('Break at '.$parts[$i]);\n break;\n }\n /*echo gettype($PropValue);\n if(gettype($PropValue)=='object') echo 'Class:'.get_class($PropValue);\n echo '***';*/\n\n }\n } catch (\\Exception $e) {\n //print_r($e);\n $PropValue = NULL;\n } catch (\\ReflectionException $ec) {\n //print_r($e);\n $PropValue = NULL;\n }\n //print_r($PropValue);\n $rtnval[$f->getFieldName()] = $PropValue;\n } catch (Exception $e) {\n $rtnval[$f->getFieldName()] = null;\n }\n }\n return $rtnval;\n }", "function assignProperties() {\n\t\t$hash = $this->__action;\n\t\tforeach ($hash as $key => $value) {\n\t\t\tif (!isset($value)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (preg_match('/^_.*/i', $key)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$this->assignProperty($key, $value);\n\t\t}\n\t}", "public function getAssignments(): array;", "protected function getPropertyValue() {}", "abstract protected function properties();", "protected function property_map() { return array(); }", "abstract protected function propertySet($name, $value);", "public function __set($propertyName, $propertyValue){\n \t$this->properties[$propertyName] = $propertyValue;\n }", "public function GetAdvancedConfigProperty ($propertyName);", "public function initMutateProperty()\n {\n foreach ( $this->initMutateProperties as $property ) {\n $this->mutateProperties[ $property ] = $this->{$property};\n }\n $this->view->addParams( [\n 'mutateProperties' => $this->mutateProperties\n ] );\n }", "protected function buildPropertyInfoAlter() {\n }", "abstract public function getResultObjectProperty();", "function setProperty() {\n $instance = $this->CI->ciwy->current_instance[$this->component_name];\n $properties = func_get_arg(0);\n if (is_array($properties)) {\n foreach($properties as $key => $val) {\n if ( ! isset($this->component_property[$key])) {\n $message = '[' . $this->CI->ciwy->library_name . '] '. $key . ' is not a '.$this->component_name .' Property.';\n log_message('error', $message);\n show_error($message);\n } else {\n $this->CI->ciwy->component_config[$instance]['Config'][$key] = $val;\n }\n }\n }\n }", "abstract protected function defineMapping();", "public function getAssignments()\n {\n if (array_key_exists(\"assignments\", $this->_propDict)) {\n if (is_a($this->_propDict[\"assignments\"], \"\\Beta\\Microsoft\\Graph\\Model\\PlannerFieldRules\") || is_null($this->_propDict[\"assignments\"])) {\n return $this->_propDict[\"assignments\"];\n } else {\n $this->_propDict[\"assignments\"] = new PlannerFieldRules($this->_propDict[\"assignments\"]);\n return $this->_propDict[\"assignments\"];\n }\n }\n return null;\n }", "public function add_layer2_assignment($p_layer2_id, $p_obj_id)\n {\n $l_insert = 'INSERT INTO isys_cats_layer2_net_2_layer3 (isys_cats_layer2_net_list__id, isys_obj__id) VALUES';\n\n if (is_numeric($p_layer2_id))\n {\n $l_insert .= ' (' . $this->convert_sql_id($p_layer2_id) . ', ' . $this->convert_sql_id($p_obj_id) . ')';\n }\n elseif (is_array($p_layer2_id) && count($p_layer2_id) > 0)\n {\n foreach ($p_layer2_id AS $l_id)\n {\n $l_insert .= ' (' . $this->convert_sql_id($l_id) . ', ' . $this->convert_sql_id($p_obj_id) . '), ';\n }\n $l_insert = rtrim($l_insert, ', ');\n } // if\n return ($this->update($l_insert) && $this->apply_update());\n }", "public function setAssignments(AssignmentExpression ...$assignments): void;", "function __set($name, $value) {\n $this->nmap[$name]=$value;\n }" ]
[ "0.55039567", "0.52901477", "0.51802933", "0.51430297", "0.5113019", "0.50638765", "0.50397426", "0.5029932", "0.49954534", "0.4995313", "0.49923748", "0.49911729", "0.49719784", "0.49710912", "0.49174008", "0.48575914", "0.4842657", "0.48406374", "0.4811634", "0.48111734", "0.4800616", "0.478454", "0.4782193", "0.47511065", "0.47111374", "0.46899825", "0.46880752", "0.46343148", "0.4630408", "0.46008384" ]
0.5505802
0
function Dynamic property handling for getting the (shortened) net address with suffix.
public function dynamic_property_callback_address_with_suffix(array $p_row) { global $g_comp_database; // $this will not work, because the method is called like a static method. $l_row = isys_cmdb_dao_category_s_net::instance($g_comp_database) ->get_data(null, $p_row['isys_obj__id']) ->get_row(); // When we handle a IPv4 address, we don't need to shorten. if ($l_row['isys_cats_net_list__isys_net_type__id'] == C__CATS_NET_TYPE__IPV4) { return '<span data-sort="' . str_pad( $l_row['isys_cats_net_list__address_long'], 10, 0, STR_PAD_LEFT ) . '">' . $l_row['isys_cats_net_list__address'] . ' /' . $l_row['isys_cats_net_list__cidr_suffix'] . '</span>'; } // if if ($l_row['isys_cats_net_list__cidr_suffix'] == 0) { $l_row['isys_cats_net_list__cidr_suffix'] = '-'; } // if return Ip::validate_ipv6($l_row['isys_cats_net_list__address'], true) . ' /' . $l_row['isys_cats_net_list__cidr_suffix']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPropertyFullAddressAttribute()\n {\n $address = [];\n if ($this->house_no) {\n $address[] = '#' . $this->house_no;\n }\n if ($this->street_no) {\n $address[] = 'St.' . $this->street_no;\n }\n\n $fullAddress = optional($this->khAddress)->FullAddress;\n if ($fullAddress) {\n $address[] = trim($fullAddress);\n }\n return implode(', ', $address);\n }", "function alias_expand_net($name) {\n\n\tglobal $aliastable;\n\n\tif (isset($aliastable[$name]) && is_subnet($aliastable[$name]))\n\treturn $aliastable[$name];\n\telse if (is_subnet($name))\n\treturn $name;\n\telse\n\treturn null;\n}", "public function getNameAddr()\n {\n $addr = $this->long_name;\n\n if ($this->street1) {\n if ($addr) $addr .= ', ';\n $addr .= $this->street1;\n }\n \n if ($this->street2) {\n if ($addr) $addr .= ', ';\n $addr .= $this->street2;\n }\n \n if ($this->city) {\n if ($addr) $addr .= ', ';\n $addr .= $this->city;\n }\n \n if ($this->state) {\n if ($addr) $addr .= ', ';\n $addr .= $this->state;\n }\n \n if ($this->zip) {\n if ($addr) $addr .= ' ';\n $addr .= $this->zip;\n }\n \n return $addr;\n }", "public function getExpandedAddress(): string\n {\n if ($this->ipVersion == 4) {\n return $this->addrStr;\n } else {\n if (!self::ipv6Support()) {\n throw new NotImplementedException('PHP must be compiled with IPv6 support');\n }\n $hexdigits = unpack('H*', inet_pton($this->addrStr))[1];\n $result = substr($hexdigits, 0, 4);\n for ($i = 1; $i < 8; $i++) {\n $result .= ':' . substr($hexdigits, $i * 4, 4);\n }\n return $result;\n }\n }", "protected function dynamic_properties()\n {\n return [\n '_address_range' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET__ADDRESS_RANGE',\n C__PROPERTY__INFO__DESCRIPTION => 'Address range'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_obj__id'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_address_range'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true,\n C__PROPERTY__PROVIDES__REPORT => true\n ]\n ],\n '_address_with_suffix' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET__ADDRESS_WITH_SUFFIX',\n C__PROPERTY__INFO__DESCRIPTION => 'Net address with suffix'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_obj__id'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_address_with_suffix'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true,\n C__PROPERTY__PROVIDES__REPORT => true\n ]\n ],\n '_address' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET',\n C__PROPERTY__INFO__DESCRIPTION => 'Net address'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_address'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true\n ]\n ],\n '_free_addresses' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATG__NETWORK__ASS_IP',\n C__PROPERTY__INFO__DESCRIPTION => 'Assigned addresses and free addresses'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_obj__id'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_free_addresses'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true,\n C__PROPERTY__PROVIDES__REPORT => true\n ]\n ],\n '_netmask' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CATP__IP__SUBNETMASK',\n C__PROPERTY__INFO__DESCRIPTION => 'Subnetmask'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_netmask'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true\n ]\n ],\n '_layer2_assignments' => [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATS__NET__LAYER2_NET',\n C__PROPERTY__INFO__DESCRIPTION => 'Layer-2-net assignments'\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n $this,\n 'dynamic_property_callback_layer2_assignment'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => true\n ]\n ]\n ];\n }", "public function getAddr() : string\n {\n return $this->addr;\n }", "public function getSuffixFieldDefault ()\n {\n $suffixDefault = $this->scopeConfig->getValue(\n 'customer/address/suffix_show',\n ScopeInterface::SCOPE_STORE\n );\n return $suffixDefault;\n }", "public function getGivenIpWithPrefixlen()\n\t{\n\t\treturn $this->given_ip . \"/\" . $this->prefix;\n\t}", "public function getSuffix() {}", "public function getAddress() {}", "protected function _getUrlSuffix()\n\t{\n\t\treturn self::getUrlSuffix();\n\t\treturn trim(Mage::getStoreConfig('landingpage/seo/url_suffix'));\n\t}", "public function getFullAddressAttribute(): string\n {\n return \"$this->address\" . ($this->address2 ? ' #' . $this->address2 : '') . \", $this->city $this->state, $this->zip\";\n }", "public function getNodeSuffix(): string\n {\n return $this->nodeSuffix;\n }", "abstract public function getPropertyShort();", "public function getAddress();", "public function getAddress();", "public function getCustomerSuffix();", "static public function getUrlSuffix() {\n return trim(Mage::getStoreConfig('landingpage/seo/url_suffix'));\n }", "function merge_ipv6_delegated_prefix($prefix, $suffix, $len = 64) {\n\t$suffix_list = explode(':', $suffix);\n\tif (is_ipaddrv4($suffix_list[count($suffix_list) - 1])) {\n\t\t$hexsuffix = dechex(ip2long($suffix_list[count($suffix_list) - 1]));\n\t\t$suffix_list[count($suffix_list) - 1] = substr($hexsuffix, 0, 4);\n\t\t$suffix_list[] = substr($hexsuffix, 4, 8);\n\t\t$suffix = implode(':', $suffix_list);\n\t}\t\n\t$prefix = Net_IPv6::uncompress($prefix, true);\n\t$suffix = Net_IPv6::uncompress($suffix, true);\n\n\t/*\n\t * xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx\n\t * ^^^^ ^\n\t * |||| \\-> 64\n\t * |||\\---> 63, 62, 61, 60\n\t * ||\\----> 56\n\t * |\\-----> 52\n\t * \\------> 48\n\t */\n\n\tswitch ($len) {\n\tcase 48:\n\t\t$prefix_len = 15;\n\t\tbreak;\n\tcase 52:\n\t\t$prefix_len = 16;\n\t\tbreak;\n\tcase 56:\n\t\t$prefix_len = 17;\n\t\tbreak;\n\tcase 59:\n\tcase 60:\n\t\t$prefix_len = 18;\n\t\tbreak;\n\t/*\n\t * XXX 63, 62 and 61 should use 18 but PD can change and if\n\t * we let user chose this bit it can end up out of PD network\n\t *\n\t * Leave this with 20 for now until we find a way to let user\n\t * chose it. The side-effect is users with PD with one of these\n\t * lengths will not be able to setup DHCP server range for full\n\t * PD size, only for last /64 network\n\t */\n\tcase 63:\n\tcase 62:\n\tcase 61:\n\tdefault:\n\t\t$prefix_len = 20;\n\t\tbreak;\n\t}\n\n\treturn text_to_compressed_ip6(substr($prefix, 0, $prefix_len) .\n\t substr($suffix, $prefix_len));\n}", "public function getDns02() : string\n {\n return $this->getValue('nb_domain_zone_dns_02');\n }", "public static function domainSuffix()\n {\n return self::pickOne(array('com', 'biz', 'info', 'name', 'net', 'org'));\n }", "public function getCustomNetHost() {\n return (string) $this->getValue('customnethost');\n }", "public function getAddress(): string\n {\n return $this->address;\n }", "public function get_internal_email( $suffix = '' ) {\n $addr = 'billypennnews';\n if ( $suffix ) {\n $addr .= '+' . $suffix;\n }\n $addr .= '@gmail.com';\n return $addr;\n }", "function getServiceAddress();", "public static function generateAddress($property)\n {\n global $mainframe, $configClass;\n $configClass = OSPHelper::loadConfig();\n $address = array();\n $languages = self::getLanguages();\n $translatable = JLanguageMultilang::isEnabled() && count($languages);\n if($translatable){\n $property_address = self::getLanguageFieldValue($property,'address');\n }else{\n $property_address = $property->address;\n }\n\n if ((trim($property_address) != \"\") and ($property_address != \"&nbsp;\")) {\n $address[0] = trim($property_address);\n } else {\n $address[0] = \"\";\n }\n $address[1] = self::loadCityName($property->city);\n $address[2] = self::loadSateCode($property->state);\n $address[3] = $property->region;\n $address[4] = $property->postcode;\n\n $address_format = $configClass['address_format'];\n if ($address_format == \"\") { //default value\n $address_format = \"0,1,2,3,4\";\n }\n //echo $address_format;\n //echo $address_format;\n $returnAddress = array();\n $address_formatArr = explode(\",\", $address_format);\n for ($i = 0; $i < count($address_formatArr); $i++) {\n $item = $address_formatArr[$i];\n if ($address[$item] != \"\") {\n $returnAddress[] = $address[$item];\n }\n }\n if (HelperOspropertyCommon::checkCountry()) {\n $returnAddress[] = self::loadCountryName($property->country);\n }\n if (count($returnAddress) > 0) {\n return implode(\", \", $returnAddress);\n } else {\n return \"\";\n }\n }", "protected function getSuffixUrl()\n {\n return $this->_suffixUrl;\n }", "public function getFullAddressAttribute(){\n\n \treturn \"{$this->street} {$this->number}. {$this->dept}{$this->floor} - ({$this->postal_code}). {$this->city} - {$this->country}\";\n }", "function rest_get_url_prefix()\n {\n }", "public function suffix(): EffectiveTopLevelDomain;" ]
[ "0.5975795", "0.5869684", "0.5812901", "0.5727265", "0.5701773", "0.5655261", "0.5621721", "0.5603956", "0.5593198", "0.55762076", "0.55598277", "0.5523727", "0.54783994", "0.5472056", "0.54695845", "0.54695845", "0.5469303", "0.54314333", "0.5431007", "0.54254556", "0.5386315", "0.5377862", "0.53558445", "0.53275365", "0.5322465", "0.53071964", "0.529616", "0.5290019", "0.5283027", "0.52748895" ]
0.59632975
1
function Finds the responsible supernet(s) of the given object.
public function find_responsible_supernet($p_obj_id) { $l_l3_net = $this->get_data(null, $p_obj_id) ->get_row(); if ($l_l3_net['isys_cats_net_list__isys_net_type__id'] == C__CATS_NET_TYPE__IPV4) { $l_sql = 'SELECT * FROM isys_cats_net_list LEFT JOIN isys_obj ON isys_obj__id = isys_cats_net_list__isys_obj__id WHERE isys_obj__isys_obj_type__id = ' . $this->convert_sql_id(C__OBJTYPE__SUPERNET) . ' AND isys_cats_net_list__address_range_from_long <= ' . $this->convert_sql_text($l_l3_net['isys_cats_net_list__address_range_from_long']) . ' AND isys_cats_net_list__address_range_to_long >= ' . $this->convert_sql_text($l_l3_net['isys_cats_net_list__address_range_to_long']) . ';'; } else { $l_sql = 'SELECT * FROM isys_cats_net_list LEFT JOIN isys_obj ON isys_obj__id = isys_cats_net_list__isys_obj__id WHERE isys_obj__isys_obj_type__id = ' . $this->convert_sql_id(C__OBJTYPE__SUPERNET) . ' AND isys_cats_net_list__address_range_from <= ' . $this->convert_sql_text($l_l3_net['isys_cats_net_list__address_range_from']) . ' AND isys_cats_net_list__address_range_to >= ' . $this->convert_sql_text($l_l3_net['isys_cats_net_list__address_range_to']) . ';'; } // if return $this->retrieve($l_sql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find($obj){\n\t}", "private function getParents($obj)\r\n\t{\r\n\t\t/**\r\n\t\t * @var $class_name string full qualified name of class ex. fhibox\\jeeves\\application\\commands\\deploy\\CommandDeploy\r\n\t\t */\r\n\t\t$class_name = (is_string($obj)) ? $obj : get_class($obj);\r\n\t\t$class = new \\ReflectionClass($class_name);\r\n\t\t$parents = array();\r\n\r\n\t\twhile ($parent = $class->getParentClass())\r\n\t\t{\r\n\t\t\t$parents[] = $parent->getName();\r\n\t\t\t$class = $parent;\r\n\t\t}\r\n\t\treturn $parents;\r\n\t}", "public function find($class);", "function v1_get_owners($object, &$error) {\n\n\t// XML functions\n\trequire_once \"php/funcs/xml_funcs.php\";\n\t// DB functions\n\trequire_once \"php/funcs/db_funcs.php\";\n\t// Static list of owners.. to reset owners-array when first called\n\tstatic $owners_list=array();\n\t\n\t// Global list of general owners\n\tglobal $gen_owners, $developer, $user_upload;\n\t\n\t// Prepare result\n\t$owners=array();\n\t$error=array();\n\t\n\t// Array of attributes name\n\t$owner_att_names=array(\"OWNER1\", \"OWNER2\", \"OWNER3\");\n\t\n\t// Get owners\n\tforeach ($owner_att_names as $owner_att_name) {\n\t\t$code=xml_get_att($object, $owner_att_name);\n\t\tif (!empty($code)) {\n\t\t\t$owner=array();\n\t\t\t$owner['code']=$code;\n\t\t\t$found=FALSE;\n\t\t\t// Check if code was already searched before\n\t\t\tforeach ($owners_list as $owner_listed) {\n\t\t\t\tif ($code!=$owner_listed['code']) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// Get ID\n\t\t\t\t$id=$owner_listed['id'];\n\t\t\t\t$owner['id']=$id;\n\t\t\t\t$found=TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// If not found in list, query DB\n\t\t\tif (!$found) {\n\t\t\t\t$id=db_get_cc_id($code);\n\t\t\t\tif (empty($id)) {\n\t\t\t\t\t$error['code']=9;\n\t\t\t\t\t$error['message']=\"There is no owner with such code: \\\"\".$code.\"\\\"\";\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t\t$owner['id']=$id;\n\t\t\t\t// Add to list of owners\n\t\t\t\tarray_push($owners_list, $owner);\n\t\t\t}\n\t\t\t// Add to owners array\n\t\t\tarray_push($owners, $owner);\n\t\t}\n\t}\n\n\t// If loader is not a developer, check permission to upload data for these owners\n\tif (!$developer && !empty($owners)) {\n\t\t// Local variables\n\t\t$found=array();\n\t\tforeach ($owners as $owner) {\n\t\t\tarray_push($found, FALSE);\n\t\t}\n\t\t// Loop on array of users who permitted user to upload data for them\n\t\tfor ($i=0; $i<count($user_upload['id']); $i++) {\n\t\t\t// For each owner\n\t\t\tforeach ($owners as $key => $owner) {\n\t\t\t\tif ($user_upload['id'][$i]==$owner) {\n\t\t\t\t\t$found[$key]=TRUE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Check owners were found\n\t\tforeach ($found as $key => $found_owner) {\n\t\t\t// Check boolean\n\t\t\tif (!$found_owner) {\n\t\t\t\t$error['code']=3;\n\t\t\t\t$error['message']=\"You do not have the rights to upload for '\".$owners[$key].\"'. If you wish to be granted this permission, please contact them directly.\";\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// Store owners in list\n\tarray_unshift($gen_owners, $owners);\n\t\n\treturn TRUE;\n}", "function get_object_subtype($object_type, $object_id)\n {\n }", "public function getClassSupertypes($class);", "public function testProfilePrototypeFindByIdOwnedGroups()\n {\n\n }", "function find_by_email($h, $email ){\n \n $sql = \"SELECT * FROM \" . TABLE_USERS . \" WHERE user_email=%s LIMIT 1\";\n $query = $h->db->prepare($sql, $email);\n \n\treturn $parents = $h->db->get_results($query);; \n }", "protected static function getClassPedegree($object) {\n\t\t\t$pedegree = array();\n\t\t\tif (is_string($object)) {\n\t\t\t\t$pedegree[] = $object;\n\t\t\t\t$class = new \\ReflectionClass($object);\n\t\t\t\twhile ($class = $class->getParentClass()) {\n\t\t\t\t $pedegree[] = $class->getName();\n\t\t\t\t}\n\t\t\t\treturn array_reverse($pedegree);\n\t\t\t} else {\n\t\t\t\t$class = get_class($object);\n\t\t\t do {\n\t\t\t\t\t$pedegree[] = $class;\n\t\t\t\t} while (($class = get_parent_class($class)) !== false);\n\t\t\t\treturn array_reverse($pedegree);\n\t\t\t}\n\t\t}", "function get_object_subtype($rule)\n {\n }", "public abstract function getObjectMembers(string $sObject):?object;", "function getAllSupervisors( $sup_id, $type ){\n\t\t$res = array();\n\t\t\n\t\t$add_q = '';\n\t\tif( $type > 5 )\n\t\t\t$add_q = \"AND deptID_fk={$this->getDeptNum()} \";\n\t\t\t\n\t\t\t\n\t\t$result = $this->db->selectQuery(\"users\", \"userID, CONCAT( firstName, ' ', lastName) AS supName, userType_fk, supervisor\", \"userType_fk < {$type} {$add_q} ORDER BY userType_fk\" );\n\t\t\t\t\n\t\t$uType = '';\n\t\tforeach($result AS $r):\n\t\t\tif($r['userID'] == $sup_id){ \n\t\t\t\t$uType = $r['userType_fk'];\n\t\t\t\t$sup = $r['supervisor'];\n\t\t\t}\t\t\n\t\tendforeach;\n\t\t\n\t\t\n\t\tif($uType!=''){\n\t\t\tforeach($result AS $rr){\n\t\t\t\tif( $rr['userType_fk'] < $uType || ( $rr['userType_fk'] == $uType && $rr['userID']==$sup_id ) ){\n\t\t\t\t\t$res[] = $rr;\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t\t\t\t\n\t}", "function discoverCandidateClasses($recursive = FALSE);", "function getAbsClassName($object) {\n $classNameWithNamespace = get_class($object);\n\n if(substr($classNameWithNamespace, strrpos($classNameWithNamespace, '\\\\')+1) == \"SendEmailCCMUserController\") {\n return \"Send Emails\";\n }\n\n return substr($classNameWithNamespace, strrpos($classNameWithNamespace, '\\\\')+1);\n }", "public abstract function find();", "public function find();", "public function findExtends($class);", "public abstract function findHolderBy(array $criteria);", "public function subclassesOf($superClass);", "function suppr_tache_dossier($id_dossier)\r\n{\r\n\tglobal $objet;\r\n\tif(droit_acces($objet[\"tache_dossier\"],$id_dossier)==3 && $id_dossier>1)\r\n\t{\r\n\t\t// on créé la liste des dossiers & on supprime chaque dossier\r\n\t\t$liste_dossiers_suppr = arborescence($objet[\"tache_dossier\"], $id_dossier, \"tous\");\r\n\t\tforeach($liste_dossiers_suppr as $infos_dossier)\r\n\t\t{\r\n\t\t\t// On supprime chaque tache du dossier puis le dossier en question\r\n\t\t\t$liste_taches = db_tableau(\"SELECT * FROM gt_tache WHERE id_dossier='\".$infos_dossier[\"id_dossier\"].\"'\");\r\n\t\t\tforeach($liste_taches as $infos_tache)\t\t{ suppr_tache($infos_tache[\"id_tache\"]); }\r\n\t\t\tsuppr_objet($objet[\"tache_dossier\"], $infos_dossier[\"id_dossier\"]);\r\n\t\t}\r\n\t}\r\n}", "function get_related($obj, $exception=array())// retreive related objects\r\n\t{\r\n\t\t$arr = object_2_array($obj);\r\n\t\t$objs = array();\r\n\t\tforeach ($arr as $k=>$v)\r\n\t\t{\r\n\t\t\tif (strstr($k, '_id') && !in_array($k, $exception))// if it's foreign key\r\n\t\t\t{\r\n\t\t\t\t$field = explode('_', $k);\r\n\t\t\t\tarray_pop($field);\r\n\t\t\t\t$f = count($field) ? implode('_', $field) : $field[0];\r\n\t\t\t\t$objs[$f] = $this->Retrieve(ucwords($this->get_db_name($f)), $v, true, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count($objs) ? $objs : false;\r\n\t}", "public function findAccounts() {\n\t\t\n\t}", "function isSubTypeOf ($object, $className)\r\n{\r\n\treturn $object instanceof $className;\r\n}", "public function testProfilePrototypeGetOwnedGroups()\n {\n\n }", "function v1_set_owners(&$object) {\n\t\n\t// Global list of general owners\n\tglobal $gen_owners;\n\t\n\t// Loop on owners\n\tforeach ($gen_owners as $owners) {\n\t\tif (!empty($owners)) {\n\t\t\t$object['results']['owners']=$owners;\n\t\t\treturn TRUE;\n\t\t}\n\t}\n\t\n\treturn FALSE;\n}", "function getClasses( $owner )\n\t\t{\n\t\t\t$return = NULL;\n\t\t\t\n\t\t\t$conn = mysql_connect($dbHost, $dbUser, $dbPass) or die(mysql_error());\n\t\t\tmysql_select_db($dbName) or die(mysql_error());\n\t\n\t\t\t// Select this test from the database and its information\n\t\t\t$query_result = mysql_query(\"SELECT ClassID, ClassName FROM Class WHERE CreatorID = \".$owner)\n\t\t\t\tor die(mysql_error()); \n\t\t\t\n\t\t\tfor( $i = 0; $i < mysql_num_rows($query_result); ++$i)\n\t\t\t{\n\t\t\t\t$row = mysql_fetch_array($query_result);\n\t\t\t\t$return[$i] = $row; \n\t\t\t}\n\t\t\t\n\t\t\tmysql_close($conn);\n\t\t\t\n\t\t\treturn $return;\n\t\t}", "public function getSufficient()\n\t{\n\t\t$ans = array();\n\t\t$users = User::model()->findAll();\n\t\tforeach($users as $auser)\n\t\t{\t\n\t\t\tif($this->cid == $auser->bestClient())\n\t\t\t{\n\t\t\t\tarray_push($ans,$auser->uid);\n\t\t\t}\n\t\t}\n\t\treturn $ans;\n\t}", "public function class_parentage($obj, $class)\n {\n global $$obj;\n\n if (is_subclass_of($GLOBALS[$obj], $class)) {\n echo \"Object $obj belongs to class \" . get_class($GLOBALS[$obj]);\n echo \", a subclass of $class\\n\";\n } else {\n echo \"Object $obj does not belong to a subclass of $class\\n\";\n }\n }", "function get_ancestors($object_id = 0, $object_type = '', $resource_type = '')\n {\n }", "protected function filter_found_item($object) {\n\t\treturn $object;\t\t\n\t}" ]
[ "0.5505731", "0.5153295", "0.514622", "0.50959724", "0.50470006", "0.50259227", "0.49686107", "0.49021417", "0.48893547", "0.48703158", "0.48086223", "0.47920164", "0.4766277", "0.4740557", "0.47405547", "0.46865258", "0.46812686", "0.46803448", "0.46736905", "0.46519598", "0.46481103", "0.46400845", "0.46240014", "0.4620663", "0.46142673", "0.4614249", "0.46066552", "0.4595585", "0.45913574", "0.4574738" ]
0.64958614
0
function This method finds a free IPv6 by a given IP assignment from the "isys_ipv6_assignment" table.
public function find_free_ipv6_by_assignment($p_net_obj, $p_ip_assignment) { global $g_comp_database; $l_ip_dao = new isys_cmdb_dao_category_g_ip($g_comp_database); $l_dhcp_dao = new isys_cmdb_dao_category_s_net_dhcp($g_comp_database); // Because the values of the assignments differ between our two tables, we need this mapping. switch ($p_ip_assignment) { case C__CMDB__CATG__IP__DHCPV6_RESERVED: $p_ip_assignment = C__NET__DHCPV6__DHCPV6_RESERVED; break; case C__CMDB__CATG__IP__DHCPV6: $p_ip_assignment = C__NET__DHCPV6__DHCPV6; break; case C__CMDB__CATG__IP__SLAAC: return ''; // For SLAAC & DHCPv6 we have to check if there is an entry in the DHCP category. case C__CMDB__CATG__IP__SLAAC_AND_DHCPV6: $l_rows = $l_dhcp_dao->get_data( null, $p_net_obj, 'AND isys_cats_net_dhcp_list__isys_net_dhcpv6_type__id = ' . C__NET__DHCPV6__SLAAC_AND_DHCPV6, null, C__RECORD_STATUS__NORMAL ) ->num_rows(); if ($l_rows > 0) { return ''; } // if return $l_ip_dao->get_free_ipv6($p_net_obj); case -1: case C__CMDB__CATG__IP__STATIC: default: return $l_ip_dao->get_free_ipv6($p_net_obj); } $l_dhcp_res = $l_dhcp_dao->get_data( null, $p_net_obj, 'AND isys_cats_net_dhcp_list__isys_net_dhcpv6_type__id = ' . $l_dhcp_dao->convert_sql_id($p_ip_assignment) ); while ($l_dhcp_row = $l_dhcp_res->get_row()) { $l_free_ip = $l_ip_dao->get_free_ipv6( $p_net_obj, $l_dhcp_row['isys_cats_net_dhcp_list__range_from'], $l_dhcp_row['isys_cats_net_dhcp_list__range_to'] ); if ($l_free_ip) { return $l_free_ip; } } return $l_ip_dao->get_free_ipv6($p_net_obj); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find_free_v6()\n {\n global $g_comp_database;\n\n $l_net_dao = new isys_cmdb_dao_category_s_net($g_comp_database);\n\n return $l_net_dao->find_free_ipv6_by_assignment($_POST['net_obj_id'], $_POST['ip_assignment']);\n }", "public static function cmpIPv6DataProviderMatching() {}", "public function get_global_ipv6_net()\n {\n $l_sql = 'SELECT isys_cats_net_list__isys_obj__id FROM isys_cats_net_list\n\t\t\tINNER JOIN isys_obj ON isys_obj__id = isys_cats_net_list__isys_obj__id\n\t\t\tLEFT JOIN isys_net_type ON isys_cats_net_list__isys_net_type__id = isys_net_type__id\n\t\t\tWHERE isys_obj__const = \"C__OBJ__NET_GLOBAL_IPV6\"\n\t\t\tAND isys_obj__undeletable = 1;';\n\n return $this->retrieve($l_sql)\n ->get_row();\n }", "public static function cmpIPv6DataProviderNotMatching() {}", "public static function check_ipv6($ip)\n {\n }", "public static function check_ipv6($ip)\n {\n }", "private function get_ipv6Nets()\n\t{\n\t\treturn $this->m_ipv6Nets;\n\t}", "public function calculate_ipv6_range()\n {\n return Ip::calc_ip_range_ipv6($_POST['ip'], $_POST['cidr']);\n }", "public static function expandIPv6Address($ip) {\n\t\t$hex = bin2hex(self::inet_pton($ip));\n\t\t$ip = wfWAFUtils::substr(preg_replace(\"/([a-f0-9]{4})/i\", \"$1:\", $hex), 0, -1);\n\t\treturn $ip;\n\t}", "public function ip_v6 () {\n\t\t\treturn $this->ip_v6_address();\n\t\t}", "function gethostbynamel6($host, $try_a = false) {\n // if $try_a is true, if AAAA fails, it tries for A\n // results are returned in an array of ips found matching type\n // otherwise returns false\n\n $dns6 = dns_get_record($host, DNS_AAAA);\n if ($try_a == true) {\n $dns4 = dns_get_record($host, DNS_A);\n $dns = array_merge($dns4, $dns6);\n }\n else { $dns = $dns6; }\n $ip6 = array();\n $ip4 = array();\n foreach ($dns as $record) {\n if ($record[\"type\"] == \"A\") {\n $ip4[] = $record[\"ip\"];\n }\n if ($record[\"type\"] == \"AAAA\") {\n $ip6[] = $record[\"ipv6\"];\n }\n }\n if (count($ip6) < 1) {\n if ($try_a == true) {\n if (count($ip4) < 1) {\n return false;\n }\n else {\n return $ip4;\n }\n }\n else {\n return false;\n }\n }\n else {\n return $ip6;\n }\n}", "public function getIpv6(): string;", "public function ip_v6_address () {\n\t\t\treturn sprintf(\n\t\t\t\t'%x:%x:%x:%x:%x:%x:%x:%x',\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535)\n\t\t\t);\n\t\t}", "protected function filterIpv6Host($str)\n {\n if (preg_match(',^\\[(.*)\\]$,', $str, $matches)) {\n if (! filter_var($matches[1], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n throw new InvalidArgumentException('Invalid IPV6 format');\n }\n return $matches[1];\n }\n\n return filter_var($str, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);\n }", "public static function isIPv6() {\n\t\t$ip = static::ip();\n\t\treturn strpos($ip, ':') !== false;\n\t}", "public static function filterIpv6($attrValue)\n\t{\n\t\treturn filter_var($attrValue, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);\n\t}", "function ints_to_ip6($a) {\n\t$b = array();\n\tforeach ($a as $i) {\n\t\t$b[] = dechex($i);\n\t}\n\t$s = implode(':', $b);\n\t$s = preg_replace('/(^|:)0(:0)+(:|$)/', '::', $s, 1);\n\treturn $s;\n}", "protected static function fixIpv6($ip){\n\t\t\t// fix double colon\n\t\t\tif(strpos($ip,'::')!==false)$ip=str_replace('::',str_repeat(':',9-substr_count($ip,':')),$ip);\n\t\t\t// fix each slot\n\t\t\t$ip=explode(':',$ip);\n\t\t\tforeach($ip as $k=>$v){\n\t\t\t\t// fix empty/compressed slots\n\t\t\t\t$ip[$k]=$v=str_pad($v,4,'0',STR_PAD_LEFT);\n\t\t\t\t// fix ipv4-style slot\n\t\t\t\tif(strpos($v,'.')!==false){\n\t\t\t\t\t// initially empty buffer\n\t\t\t\t\t$ip[$k]='';\n\t\t\t\t\t// replace each number(byte) with a two-digit hex representation\n\t\t\t\t\tforeach(explode('.',$v) as $v2){\n\t\t\t\t\t\t$v=dechex(min((int)$v2,255));\n\t\t\t\t\t\tif(strlen($v)==1)$v='0'.$v;\n\t\t\t\t\t\t$ip[$k].=$v;\n\t\t\t\t\t}\n\t\t\t\t\t// add colon in between two pairs(bytes) (FFFFFFFF=>FFFF:FFFF)\n\t\t\t\t\t$ip[$k]=implode(':',str_split($ip[$k],4));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn strtoupper(implode(':',$ip));\n\t\t}", "public function x_AVM_DE_GetIPv6DNSServer()\n {\n $result = $this->client->X_AVM_DE_GetIPv6DNSServer();\n if ($this->errorHandling($result, 'Could not ... from/to FRITZ!Box')) {\n return;\n }\n\n return $result;\n }", "public function x_AVM_DE_GetExternalIPv6Address()\n {\n $result = $this->client->X_AVM_DE_GetExternalIPv6Address();\n if ($this->errorHandling($result, 'Could not ... from/to FRITZ!Box')) {\n return;\n }\n\n return $result;\n }", "public function x_AVM_DE_GetIPv6Prefix()\n {\n $result = $this->client->X_AVM_DE_GetIPv6Prefix();\n if ($this->errorHandling($result, 'Could not ... from/to FRITZ!Box')) {\n return;\n }\n\n return $result;\n }", "public function GetAllowIPv6 () {\n\t\treturn $this->allowIPv6;\n\t}", "function gethostbyname6($host, $try_a = false) {\n // if $try_a is true, if AAAA fails, it tries for A\n // the first match found is returned\n // otherwise returns false\n\n $dns = gethostbynamel6($host, $try_a);\n if ($dns == false) { return false; }\n else { return $dns[0]; }\n}", "function short_ipv6($ip, $length)\n{\n\tif ($length < 1)\n\t{\n\t\treturn '';\n\t}\n\n\t// extend IPv6 addresses\n\t$blocks = substr_count($ip, ':') + 1;\n\tif ($blocks < 9)\n\t{\n\t\t$ip = str_replace('::', ':' . str_repeat('0000:', 9 - $blocks), $ip);\n\t}\n\tif ($ip[0] == ':')\n\t{\n\t\t$ip = '0000' . $ip;\n\t}\n\tif ($length < 4)\n\t{\n\t\t$ip = implode(':', array_slice(explode(':', $ip), 0, 1 + $length));\n\t}\n\n\treturn $ip;\n}", "public static function is_ip6($ip) {\r\n\t\t$ret = false;\r\n\t\tif (function_exists('filter_var')) {\r\n\t\t\t// This regards :: as valid, also ::0 or ::0.0.0.0 as OK, which is wrong\r\n\t\t\t$ret = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// This regards :: as invalid, but ::0 or ::0.0.0.0 as OK, which is wrong\r\n\t\t\t// Taken from here: http://regexlib.com/REDetails.aspx?regexp_id=1000\r\n\t\t\t$regex = \"@^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|(([0-9A-Fa-f]{1,4}:){1,5}:((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|(([0-9A-Fa-f]{1,4}:){1}:([0-9A-Fa-f]{1,4}:){0,4}((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|(([0-9A-Fa-f]{1,4}:){0,2}:([0-9A-Fa-f]{1,4}:){0,3}((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|(([0-9A-Fa-f]{1,4}:){0,3}:([0-9A-Fa-f]{1,4}:){0,2}((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|(([0-9A-Fa-f]{1,4}:){0,4}:([0-9A-Fa-f]{1,4}:){1}((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b)\\.){3}(\\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$@\";\r\n\t\t\t$ret = preg_match($regex, $ip);\r\n\t\t}\t\r\n\t\tif ($ret) {\r\n\t\t\t// :: in any combination (::, ::0, 0::0:0.0.0.0) is invalid!\r\n\t\t\t$regex = '@^[0.:]*$@'; // Contains only ., :, and 0\r\n\t\t\t$ret = !preg_match($regex, $ip);\r\n\t\t}\r\n\t\treturn $ret;\r\n\t}", "public static function normalizeCompressIPv6DataProviderCorrect() {}", "function range6_to_cidr6($a, $b) {\n\t$ip6 = array();\n\t$cidr = 0;\n\t$state = 0; # 0=network, 1=address\n\tforeach ($a as $i=>$x) {\n\t\tswitch ($state) {\n\t\tcase 0:\n\t\t\t// in the network\n\t\t\t$y = $b[$i];\n\t\t\tif ($x == $y) {\n\t\t\t\t// this hextet matches\n\t\t\t\t$ip6[] = $x;\n\t\t\t\t$cidr += 16;\n\t\t\t} else {\n\t\t\t\t// first non-identical hextet\n\t\t\t\tlist($ip4, $cidr4) = range_to_cidr($x, $y);\n\t\t\t\tif ($ip4 === null) {\n\t\t\t\t\t// no common prefix in this hextet\n\t\t\t\t\tif ($i == 0) {\n\t\t\t\t\t\t// no network prefix at all = no cidr\n\t\t\t\t\t\treturn array(null, 128);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$ip6[] = 0;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// there is a common prefix in this hextet\n\t\t\t\t\t$ip6[] = $ip4 & 0xffff;\n\t\t\t\t\t$cidr += ($cidr4 - 16);\n\t\t\t\t}\n\t\t\t\t$state ++;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t// in the address\n\t\t\t$ip6[] = 0;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn array($ip6, $cidr);\n}", "public function isIPv6()\n {\n return $this->version == 6;\n }", "public static function hasIPv6Support() {\n\t\treturn defined('AF_INET6');\n\t}", "public static function IPv6Hex2BinDataProviderCorrect() {}" ]
[ "0.8235722", "0.60066944", "0.5923821", "0.58840746", "0.5706141", "0.5705568", "0.57038325", "0.5502891", "0.542809", "0.5360367", "0.53234977", "0.5267414", "0.5235169", "0.5038733", "0.49958214", "0.49727923", "0.49607086", "0.49538073", "0.49422103", "0.4936256", "0.49340963", "0.4924213", "0.49223506", "0.49204424", "0.49196696", "0.49109486", "0.49030727", "0.48668897", "0.48661277", "0.48199847" ]
0.80262685
1
function Method for getting the GLOBAL layer3 IPv4 net object. The ID of the global layer3 net should also be available via C__OBJ__NET_GLOBAL_IPV4.
public function get_global_ipv4_net() { $l_sql = 'SELECT * FROM isys_cats_net_list INNER JOIN isys_obj ON isys_obj__id = isys_cats_net_list__isys_obj__id LEFT JOIN isys_net_type ON isys_cats_net_list__isys_net_type__id = isys_net_type__id WHERE isys_obj__const = "C__OBJ__NET_GLOBAL_IPV4" AND isys_obj__undeletable = 1;'; return $this->retrieve($l_sql) ->get_row(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function get_ipv4Nets()\n\t{\n\t\treturn $this->m_ipv4Nets;\n\t}", "public function get_global_ipv6_net()\n {\n $l_sql = 'SELECT isys_cats_net_list__isys_obj__id FROM isys_cats_net_list\n\t\t\tINNER JOIN isys_obj ON isys_obj__id = isys_cats_net_list__isys_obj__id\n\t\t\tLEFT JOIN isys_net_type ON isys_cats_net_list__isys_net_type__id = isys_net_type__id\n\t\t\tWHERE isys_obj__const = \"C__OBJ__NET_GLOBAL_IPV6\"\n\t\t\tAND isys_obj__undeletable = 1;';\n\n return $this->retrieve($l_sql)\n ->get_row();\n }", "public function getNetworkIPv4()\n\t{\n\t\tif( !$this->valid ) { return null; }\n\t\tif( \\gmp_cmp( '4294967295', $this->net_addr_long ) > 0 )\n\t\t{\n\t\t\treturn \\gmp_strval( $this->net_addr_long );\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn '4294967295';\n\t\t}\n\t}", "public function getGcId3()\n {\n return $this->gc_id_3;\n }", "public function ipv4()\n\t{\n\t\treturn $this->ipv4;\n\t}", "function get_main_network_id()\n {\n }", "public function getNetworkId(){\n\t\treturn self::NETWORK_ID;\n\t}", "public function getMainNet()\n {\n return $this->main_net;\n }", "Public Function NetworkId() {\n\t\treturn $this->networkId;\n\t\n\t}", "public function getIpv4();", "public function ip_v4 () {\n\t\t\treturn $this->ip_v4_address();\n\t\t}", "public function getBroadcastIPv4()\n\t{\n\t\tif( !$this->valid ) { return null; }\n\t\tif( \\gmp_cmp( '4294967295', $this->net_broadcast_long ) > 0 )\n\t\t{\n\t\t\treturn \\gmp_strval( $this->net_broadcast_long );\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn '4294967295';\n\t\t}\n\t}", "final public function getNetworkId(): int\n {\n return static::NETWORK_ID;\n }", "function get_current_network_id()\n {\n }", "public function GetAllowIPv4 () {\n\t\treturn $this->allowIPv4;\n\t}", "public function getEtblAdresse3() {\n return $this->etblAdresse3;\n }", "public function getNetwork( $full = false )\n\t{\n\t\tif( !$this->valid ) { return null; }\n\t\tif( !$full ) \n\t\t{\n\t\t\treturn inet_ntop( $this->net_addr );\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn $this->inet_gmptofull( $this->net_addr_long );\n\t\t}\n\t}", "public function getActiveNetwork()\n {\n return $this->active_network;\n }", "function get_layer_connection($layer_id) {\n\t\t# $layer_id < 0 Rollenlayer else normal layer\n\t\t$sql = \"\n\t\t\tSELECT\n\t\t\t\t`connection_id`,\n\t\t\t\t\" . ($layer_id < 0 ? \"'\" . CUSTOM_SHAPE_SCHEMA . \"' AS \" : \"\") . \"`schema`\n\t\t\tFROM\n\t\t\t\t\" . ($layer_id < 0 ? \"rollenlayer\" : \"layer\") . \"\n\t\t\tWHERE\n\t\t\t\t\" . ($layer_id < 0 ? \"-id\" : \"Layer_ID\") . \" = \" . $layer_id . \" AND\n\t\t\t\t`connectiontype` = 6\n\t\t\";\n\t\t$this->debug->write(\"<p>file:kvwmap class:db_mapObj->get_layer_connection - Lesen der connection Daten des Layers:<br>\" . $sql, 4);\n\t\t$this->db->execSQL($sql);\t\t\n\t\tif ($this->db->success) {\n\t\t\treturn $this->db->result->fetch_assoc();\n\t\t}\n\t\telse {\n\t\t\t$this->debug->write(\"<br>Abbruch beim Lesen der Layer connection in get_layer_connection, Zeile: \" . __LINE__ . \"<br>\" . $this->db->mysqli->error, 4);\n\t\t\treturn array();\n\t\t}\n\t}", "public static function ip__get( $ip_type_to_get = 'real', $v4_only = true, $headers = array() )\n {\n $out = null;\n\n switch( $ip_type_to_get ){\n\n // Cloud Flare\n case 'cloud_flare':\n $headers = $headers ?: self::http__get_headers();\n if( isset( $headers['Cf-Connecting-Ip'], $headers['Cf-Ipcountry'], $headers['Cf-Ray'] ) ){\n $tmp = strpos( $headers['Cf-Connecting-Ip'], ',' ) !== false\n ? explode( ',', $headers['Cf-Connecting-Ip'] )\n : (array) $headers['Cf-Connecting-Ip'];\n $ip_version = self::ip__validate( trim( $tmp[0] ) );\n if( $ip_version ){\n $out = $ip_version === 'v6' && ! $v4_only ? self::ip__v6_normalize( trim( $tmp[0] ) ) : trim( $tmp[0] );\n }\n }\n break;\n\n // GTranslate\n case 'gtranslate':\n $headers = $headers ?: self::http__get_headers();\n if( isset( $headers['X-Gt-Clientip'], $headers['X-Gt-Viewer-Ip'] ) ){\n $ip_version = self::ip__validate( $headers['X-Gt-Viewer-Ip'] );\n if( $ip_version ){\n $out = $ip_version === 'v6' && ! $v4_only ? self::ip__v6_normalize( $headers['X-Gt-Viewer-Ip'] ) : $headers['X-Gt-Viewer-Ip'];\n }\n }\n break;\n\n // ezoic\n case 'ezoic':\n $headers = $headers ?: self::http__get_headers();\n if( isset( $headers['X-Middleton'], $headers['X-Middleton-Ip'] ) ){\n $ip_version = self::ip__validate( $headers['X-Middleton-Ip'] );\n if( $ip_version ){\n $out = $ip_version === 'v6' && ! $v4_only ? self::ip__v6_normalize( $headers['X-Middleton-Ip'] ) : $headers['X-Middleton-Ip'];\n }\n }\n break;\n\n // Sucury\n case 'sucury':\n $headers = $headers ?: self::http__get_headers();\n if( isset( $headers['X-Sucuri-Clientip'] ) ){\n $ip_version = self::ip__validate( $headers['X-Sucuri-Clientip'] );\n if( $ip_version ){\n $out = $ip_version === 'v6' && ! $v4_only ? self::ip__v6_normalize( $headers['X-Sucuri-Clientip'] ) : $headers['X-Sucuri-Clientip'];\n }\n }\n break;\n\n // X-Forwarded-By\n case 'x_forwarded_by':\n $headers = $headers ?: self::http__get_headers();\n if( isset( $headers['X-Forwarded-By'], $headers['X-Client-Ip'] ) ){\n $ip_version = self::ip__validate( $headers['X-Client-Ip'] );\n if( $ip_version ){\n $out = $ip_version === 'v6' && ! $v4_only ? self::ip__v6_normalize( $headers['X-Client-Ip'] ) : $headers['X-Client-Ip'];\n }\n }\n break;\n\n // Stackpath\n case 'stackpath':\n $headers = $headers ?: self::http__get_headers();\n if( isset( $headers['X-Sp-Edge-Host'], $headers['X-Sp-Forwarded-Ip'] ) ){\n $ip_version = self::ip__validate( $headers['X-Sp-Forwarded-Ip'] );\n if( $ip_version ){\n $out = $ip_version === 'v6' && ! $v4_only ? self::ip__v6_normalize( $headers['X-Sp-Forwarded-Ip'] ) : $headers['X-Sp-Forwarded-Ip'];\n }\n }\n break;\n\n // Ico-X-Forwarded-For\n case 'ico_x_forwarded_for':\n $headers = $headers ?: self::http__get_headers();\n if( isset( $headers['Ico-X-Forwarded-For'], $headers['X-Forwarded-Host'] ) ){\n $ip_version = self::ip__validate( $headers['Ico-X-Forwarded-For'] );\n if( $ip_version ){\n $out = $ip_version === 'v6' && ! $v4_only ? self::ip__v6_normalize( $headers['Ico-X-Forwarded-For'] ) : $headers['Ico-X-Forwarded-For'];\n }\n }\n break;\n\n // OVH\n case 'ovh':\n $headers = $headers ?: self::http__get_headers();\n if( isset( $headers['X-Cdn-Any-Ip'], $headers['Remote-Ip'] ) ){\n $ip_version = self::ip__validate( $headers['Remote-Ip'] );\n if( $ip_version ){\n $out = $ip_version === 'v6' && ! $v4_only ? self::ip__v6_normalize( $headers['Remote-Ip'] ) : $headers['Remote-Ip'];\n }\n }\n break;\n\n // Incapsula proxy\n case 'incapsula':\n $headers = $headers ?: self::http__get_headers();\n if( isset( $headers['Incap-Client-Ip'], $headers['X-Forwarded-For'] ) ){\n $ip_version = self::ip__validate( $headers['Incap-Client-Ip'] );\n if( $ip_version ){\n $out = $ip_version === 'v6' && ! $v4_only ? self::ip__v6_normalize( $headers['Incap-Client-Ip'] ) : $headers['Incap-Client-Ip'];\n }\n }\n break;\n\n // Remote addr\n case 'remote_addr':\n $ip_version = self::ip__validate( Server::get( 'REMOTE_ADDR' ) );\n if( $ip_version ){\n $out = $ip_version === 'v6' && ! $v4_only ? self::ip__v6_normalize( Server::get( 'REMOTE_ADDR' ) ) : Server::get( 'REMOTE_ADDR' );\n }\n break;\n\n // X-Forwarded-For\n case 'x_forwarded_for':\n $headers = $headers ?: self::http__get_headers();\n if( isset( $headers['X-Forwarded-For'] ) ){\n $tmp = explode( ',', trim( $headers['X-Forwarded-For'] ) );\n $tmp = trim( $tmp[0] );\n $ip_version = self::ip__validate( $tmp );\n if( $ip_version ){\n $out = $ip_version === 'v6' && ! $v4_only ? self::ip__v6_normalize( $tmp ) : $tmp;\n }\n }\n break;\n\n // X-Real-Ip\n case 'x_real_ip':\n $headers = $headers ?: self::http__get_headers();\n if(isset($headers['X-Real-Ip'])){\n $tmp = explode(\",\", trim($headers['X-Real-Ip']));\n $tmp = trim($tmp[0]);\n $ip_version = self::ip__validate($tmp);\n if($ip_version){\n $out = $ip_version === 'v6' && ! $v4_only ? self::ip__v6_normalize($tmp) : $tmp;\n }\n }\n break;\n\n // Real\n // Getting real IP from REMOTE_ADDR or Cf_Connecting_Ip if set or from (X-Forwarded-For, X-Real-Ip) if REMOTE_ADDR is local.\n case 'real':\n\n // Detect IP type\n $out = self::ip__get( 'cloud_flare', $v4_only, $headers );\n $out = $out ?: self::ip__get( 'sucury', $v4_only, $headers );\n $out = $out ?: self::ip__get( 'gtranslate', $v4_only, $headers );\n $out = $out ?: self::ip__get( 'ezoic', $v4_only, $headers );\n $out = $out ?: self::ip__get( 'stackpath', $v4_only, $headers );\n $out = $out ?: self::ip__get( 'x_forwarded_by', $v4_only, $headers );\n $out = $out ?: self::ip__get( 'ico_x_forwarded_for', $v4_only, $headers );\n $out = $out ?: self::ip__get( 'ovh', $v4_only, $headers );\n $out = $out ?: self::ip__get( 'incapsula', $v4_only, $headers );\n\n $ip_version = self::ip__validate( $out );\n\n // Is private network\n if(\n ! $out ||\n ($out &&\n (\n self::ip__is_private_network( $out, $ip_version ) ||\n self::ip__mask_match(\n $out,\n Server::get( 'SERVER_ADDR' ) . '/24',\n $ip_version\n )\n ))\n ){\n //@todo Remove local IP from x-forwarded-for and x-real-ip\n $out = $out ?: self::ip__get( 'x_forwarded_for', $v4_only, $headers );\n $out = $out ?: self::ip__get( 'x_real_ip', $v4_only, $headers );\n }\n\n $out = $out ?: self::ip__get( 'remote_addr', $v4_only, $headers );\n\n break;\n\n default:\n $out = self::ip__get( 'real', $v4_only, $headers );\n }\n\n // Final validating IP\n $ip_version = self::ip__validate( $out );\n\n if( ! $ip_version ){\n return null;\n\n }elseif( $ip_version === 'v6' && $v4_only ){\n return null;\n\n }else{\n return $out;\n }\n }", "function req_is_ipv4() {\n static $is_ipv4 = null;\n if ($is_ipv4 === null) \n $is_ipv4 = \\preg_match('#^\\d{1,3}(\\.\\d{1,3}){3,3}$#', $_SERVER[\"SERVER_ADDR\"]) != 0;\n return $is_ipv4;\n}", "public function getCategory4()\n {\n if (array_key_exists(\"category4\", $this->_propDict)) {\n return $this->_propDict[\"category4\"];\n } else {\n return null;\n }\n }", "private function _getVisitorIP() {\n $rVal = \"\";\n\n if ( isset($_SERVER[\"HTTP_CF_CONNECTING_IP\"]) ) {\n $rVal = $_SERVER[\"HTTP_CF_CONNECTING_IP\"];\n } else {\n if (getenv('HTTP_X_FORWARDED_FOR')) {\n $rVal = getenv('HTTP_X_FORWARDED_FOR');\n } else {\n $rVal = getenv('REMOTE_ADDR');\n }\n }\n\n // Return the IPv4 Address\n return NoNull($rVal);\n }", "public static function getGlobalip() {\n\n return \\Request::ip();\n }", "public function getNetwork() {\n return $this->_network;\n }", "public function getNetwork()\n {\n return $this->network;\n }", "public function getNetwork()\n {\n return $this->network;\n }", "public function ip_v4_address () {\n\t\t\treturn sprintf(\n\t\t\t\t'%d.%d.%d.%d',\n\t\t\t\tmt_rand(2,255),\n\t\t\t\tmt_rand(2,255),\n\t\t\t\tmt_rand(2,255),\n\t\t\t\tmt_rand(2,255)\n\t\t\t);\n\t\t}", "public function getC3()\r\n {\r\n return $this->C3;\r\n }", "function network(){\n return (long2ip((ip2long($this->address))\n & (ip2long($this->netmask()))));\n }" ]
[ "0.5961948", "0.593959", "0.576473", "0.541781", "0.52891994", "0.51555026", "0.5152047", "0.5061661", "0.5004251", "0.50002646", "0.49157494", "0.49005365", "0.47842112", "0.4762458", "0.46713027", "0.46535495", "0.462228", "0.46024153", "0.45765895", "0.45748144", "0.4571063", "0.45665964", "0.45183268", "0.4511371", "0.44970557", "0.4494388", "0.4494388", "0.4494336", "0.44937715", "0.44923365" ]
0.7621462
0
function Method for getting the GLOBAL layer3 IPv6 net object. The ID of the global layer3 net should also be available via C__OBJ__NET_GLOBAL_IPV6.
public function get_global_ipv6_net() { $l_sql = 'SELECT isys_cats_net_list__isys_obj__id FROM isys_cats_net_list INNER JOIN isys_obj ON isys_obj__id = isys_cats_net_list__isys_obj__id LEFT JOIN isys_net_type ON isys_cats_net_list__isys_net_type__id = isys_net_type__id WHERE isys_obj__const = "C__OBJ__NET_GLOBAL_IPV6" AND isys_obj__undeletable = 1;'; return $this->retrieve($l_sql) ->get_row(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_global_ipv4_net()\n {\n $l_sql = 'SELECT * FROM isys_cats_net_list\n\t\t\tINNER JOIN isys_obj ON isys_obj__id = isys_cats_net_list__isys_obj__id\n\t\t\tLEFT JOIN isys_net_type ON isys_cats_net_list__isys_net_type__id = isys_net_type__id\n\t\t\tWHERE isys_obj__const = \"C__OBJ__NET_GLOBAL_IPV4\"\n\t\t\tAND isys_obj__undeletable = 1;';\n\n return $this->retrieve($l_sql)\n ->get_row();\n }", "private function get_ipv6Nets()\n\t{\n\t\treturn $this->m_ipv6Nets;\n\t}", "public function find_free_v6()\n {\n global $g_comp_database;\n\n $l_net_dao = new isys_cmdb_dao_category_s_net($g_comp_database);\n\n return $l_net_dao->find_free_ipv6_by_assignment($_POST['net_obj_id'], $_POST['ip_assignment']);\n }", "public function x_AVM_DE_GetIPv6Prefix()\n {\n $result = $this->client->X_AVM_DE_GetIPv6Prefix();\n if ($this->errorHandling($result, 'Could not ... from/to FRITZ!Box')) {\n return;\n }\n\n return $result;\n }", "public function x_AVM_DE_GetExternalIPv6Address()\n {\n $result = $this->client->X_AVM_DE_GetExternalIPv6Address();\n if ($this->errorHandling($result, 'Could not ... from/to FRITZ!Box')) {\n return;\n }\n\n return $result;\n }", "public function getIpv6(): string;", "public function ip_v6 () {\n\t\t\treturn $this->ip_v6_address();\n\t\t}", "function getCellNetwork($if)\n {\n \t$arlines = array();\t\t//Store result of ifconfig command\n \texec('ifconfig '.escapeshellarg($if).' '.'2>&1 ', $arlines);\t//execute ifconfig\n \tdebug('(cell_controller.inc|getCellNetwork()) admin client api command: ifconfig '.escapeshellarg($if).' '.'2>&1 '); \t//DEBUG\n \tdebug('(cell_controller.inc|getCellNetwork()) admin client api command output: $arlines', $arlines); \t\t\t\t\t//DEBUG\n \t\n \t//convert array into single line of text\n \t$str='';\n \tforeach($arlines as $line)\n \t{\n \t\t$str=$str.$line;\n \t}\n \t\n \t//run regex on string and find: IP, Gateway, Subnet\n \t$regex=array();\n \tpreg_match(\"/^([A-z]*\\d)\\s+Link\\s+encap:([A-z-]*)\\s.*\\sinet addr:([0-9.]+)\\s*P-t-P:([0-9.]+)\\s*Mask:([0-9.]+)/ims\", $str, $regex);\n \t\n \t$interface = array();\n \tif( !empty($regex) ){\n \t\t$interface['name'] = $regex[1];\n \t\t$interface['type'] = $regex[2];\n \t\t$interface['ip'] = $regex[3];\n \t\t$interface['broadcast'] = $regex[4];\n \t\t$interface['mask'] = $regex[5];\n \t}\n \tdebug('(cell_controller.inc|getCellNetwork()) $interface array '.$interface); \t\t\t\t//DEBUG\n \t\n \treturn $interface;\n }", "public function GetAllowIPv6 () {\n\t\treturn $this->allowIPv6;\n\t}", "public function x_AVM_DE_GetIPv6DNSServer()\n {\n $result = $this->client->X_AVM_DE_GetIPv6DNSServer();\n if ($this->errorHandling($result, 'Could not ... from/to FRITZ!Box')) {\n return;\n }\n\n return $result;\n }", "public function ip_v6_address () {\n\t\t\treturn sprintf(\n\t\t\t\t'%x:%x:%x:%x:%x:%x:%x:%x',\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535)\n\t\t\t);\n\t\t}", "public function getMainNet()\n {\n return $this->main_net;\n }", "public function getCategory6()\n {\n if (array_key_exists(\"category6\", $this->_propDict)) {\n return $this->_propDict[\"category6\"];\n } else {\n return null;\n }\n }", "public function find_free_ipv6_by_assignment($p_net_obj, $p_ip_assignment)\n {\n global $g_comp_database;\n\n $l_ip_dao = new isys_cmdb_dao_category_g_ip($g_comp_database);\n $l_dhcp_dao = new isys_cmdb_dao_category_s_net_dhcp($g_comp_database);\n\n // Because the values of the assignments differ between our two tables, we need this mapping.\n switch ($p_ip_assignment)\n {\n case C__CMDB__CATG__IP__DHCPV6_RESERVED:\n $p_ip_assignment = C__NET__DHCPV6__DHCPV6_RESERVED;\n break;\n\n case C__CMDB__CATG__IP__DHCPV6:\n $p_ip_assignment = C__NET__DHCPV6__DHCPV6;\n break;\n\n case C__CMDB__CATG__IP__SLAAC:\n return '';\n\n // For SLAAC & DHCPv6 we have to check if there is an entry in the DHCP category.\n case C__CMDB__CATG__IP__SLAAC_AND_DHCPV6:\n $l_rows = $l_dhcp_dao->get_data(\n null,\n $p_net_obj,\n 'AND isys_cats_net_dhcp_list__isys_net_dhcpv6_type__id = ' . C__NET__DHCPV6__SLAAC_AND_DHCPV6,\n null,\n C__RECORD_STATUS__NORMAL\n )\n ->num_rows();\n\n if ($l_rows > 0)\n {\n return '';\n } // if\n\n return $l_ip_dao->get_free_ipv6($p_net_obj);\n\n case -1:\n case C__CMDB__CATG__IP__STATIC:\n default:\n return $l_ip_dao->get_free_ipv6($p_net_obj);\n }\n\n $l_dhcp_res = $l_dhcp_dao->get_data(\n null,\n $p_net_obj,\n 'AND isys_cats_net_dhcp_list__isys_net_dhcpv6_type__id = ' . $l_dhcp_dao->convert_sql_id($p_ip_assignment)\n );\n\n while ($l_dhcp_row = $l_dhcp_res->get_row())\n {\n $l_free_ip = $l_ip_dao->get_free_ipv6(\n $p_net_obj,\n $l_dhcp_row['isys_cats_net_dhcp_list__range_from'],\n $l_dhcp_row['isys_cats_net_dhcp_list__range_to']\n );\n\n if ($l_free_ip)\n {\n return $l_free_ip;\n }\n }\n\n return $l_ip_dao->get_free_ipv6($p_net_obj);\n }", "public function getC6()\r\n {\r\n return $this->C6;\r\n }", "public function isIPv6()\n {\n return $this->version == 6;\n }", "public function getGcId3()\n {\n return $this->gc_id_3;\n }", "function get_main_network_id()\n {\n }", "public static function hasIPv6Support() {\n\t\treturn defined('AF_INET6');\n\t}", "public function forceIpV6(): self\n {\n $new = clone $this;\n $new->forceIpV4 = false;\n $new->forceIpV6 = true;\n\n return $new;\n }", "function network(){\n return (long2ip((ip2long($this->address))\n & (ip2long($this->netmask()))));\n }", "protected function getConfig6()\n\t{\n\t\trequire_once 'config.6.php';\n\t\trequire_once 'mysql.4.php';\n\n\t\t$stat_host = ECash::getConfig()->STAT_MYSQL_HOST;\n\t\t$stat_user = ECash::getConfig()->STAT_MYSQL_USER;\n\t\t$stat_pass = ECash::getConfig()->STAT_MYSQL_PASS;\n\n\t\t$scdb = new MySQL_4($stat_host, $stat_user, $stat_pass);\n\t\t$scdb->Connect();\n\n\t\t// The following is a quirk in how Config_6 is using MySQL_4\n\t\t$scdb->db_info['db'] = 'management';\n\n\t\t$scdb->Select('management');\n\t\t$config_6 = new Config_6($scdb);\n\t\treturn $config_6;\n\t}", "public static function isIPv6() {\n\t\t$ip = static::ip();\n\t\treturn strpos($ip, ':') !== false;\n\t}", "public function getNetworkId(){\n\t\treturn self::NETWORK_ID;\n\t}", "public function getIfu_client()\n {\n return $this->ifu_client;\n }", "private function get_ipv4Nets()\n\t{\n\t\treturn $this->m_ipv4Nets;\n\t}", "protected function getLayer()\n {\n if (Mage::helper('enterprise_search')->getIsEngineAvailableForNavigation()) {\n return Mage::getSingleton('enterprise_search/catalog_layer');\n } else {\n return Mage::getSingleton('catalog/layer');\n }\n }", "public static function isIpv6($str = '') {\n if($str == '') {\n $str = self::ip();\n }\n return filter_var($str, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);\n }", "function getBridgeNetmask() {\n return $this->bridgeNetmask;\n }", "private function setIPv6( $addr, $mask )\n\t{\n\t\t$this->net_addr = @inet_pton($addr);\n\t\tif( $this->net_addr == false )\n\t\t{\n\t\t\tthrow new \\Exception( \"invalid ip address {$addr}\" );\n\t\t} \n\t\t$this->valid = true;\n\t\t$this->net_addr_long = $this->inet_ntogmp( $this->net_addr );\n\t\t//$this->inet_gmpton( $this->net_addr_long );\n\t\t\t\n\t\t// set the netmask\n\t\tif( preg_match( '/^[0-9]+$/', $mask ))\n\t\t{\n\t\t\t$this->net_mask_bits = intval( $mask );\n\t\t\tif( $this->ipv4 && $this->net_mask_bits != 0 ){\n\t\t\t\t$this->net_mask_bits += 96;\n\t\t\t}\n\t\t\t$this->net_mask_long = \\gmp_mul( \\gmp_sub( gmp_pow( 2, $this->net_mask_bits ), 1 ), \\gmp_pow( 2, 128-$this->net_mask_bits ));\n\t\t\t//\t\t\techo gmp_strval( $this->net_mask_long, 2 ).\"<br />\\n\";\n\t\t\t$this->net_mask = $this->inet_gmpton($this->net_mask_long);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->net_mask = inet_pton($mask);\n\t\t\t$this->net_mask_long = $this->inet_ntogmp($this->netmask);\n\t\t\t$this->net_mask_bits = \\gmp_scan0( $this->net_mask_long, 0 );\n\t\t}\n\t\t\t\n\t\t// normalize it...\n\t\t$this->net_addr_long = \\gmp_and( $this->net_addr_long, $this->net_mask_long );\n\t\t$this->net_addr = $this->inet_gmpton( $this->net_addr_long );\n\t\t$this->net_broadcast_long = \\gmp_or( $this->net_addr_long, \\gmp_sub( \\gmp_pow( 2, 128-$this->net_mask_bits ), 1 ));\n\t\t$this->net_broadcast = $this->inet_gmpton($this->net_broadcast_long );\n\t}" ]
[ "0.6750115", "0.64675796", "0.5838748", "0.5605258", "0.5550961", "0.5527551", "0.5372299", "0.5346776", "0.52024347", "0.5162671", "0.50833666", "0.505658", "0.49397048", "0.48762432", "0.48431733", "0.48042744", "0.4789408", "0.47284657", "0.4726236", "0.46404412", "0.4615586", "0.45915616", "0.45728582", "0.45469934", "0.45264158", "0.44921285", "0.4490015", "0.44796067", "0.44564238", "0.4410762" ]
0.7959759
0
function Method for retrieving assigned hosts from an object.
public function get_assigned_hosts($p_obj_id, $p_condition = '', $p_record_status = C__RECORD_STATUS__NORMAL, $p_sort = null) { if (empty($p_obj_id)) { return false; } // if $l_sql = 'SELECT isys_catg_ip_list__isys_ip_assignment__id, isys_catg_ip_list__isys_ipv6_assignment__id, isys_catg_ip_list__isys_cats_net_ip_addresses_list__id, isys_cats_net_ip_addresses_list__isys_ip_assignment__id, isys_catg_ip_list__id, isys_obj__id, isys_obj__title, isys_obj_type__title, isys_cats_net_ip_addresses_list__title, isys_catg_ip_list__hostname FROM isys_catg_ip_list LEFT JOIN isys_cats_net_ip_addresses_list ON isys_catg_ip_list__isys_cats_net_ip_addresses_list__id = isys_cats_net_ip_addresses_list__id LEFT JOIN isys_obj ON isys_obj__id = isys_catg_ip_list__isys_obj__id LEFT JOIN isys_obj_type ON isys_obj_type__id = isys_obj__isys_obj_type__id WHERE isys_cats_net_ip_addresses_list__isys_obj__id = ' . $this->convert_sql_id($p_obj_id) . ' ' . $p_condition . ' AND isys_obj__status = ' . $this->convert_sql_int($p_record_status) . ' AND isys_catg_ip_list__status = ' . $this->convert_sql_int($p_record_status) . ' '; if ($p_sort === null) { $l_sql .= 'ORDER BY isys_cats_net_ip_addresses_list__title ASC;'; } else { $l_sql .= $p_sort; } // if return $this->retrieve($l_sql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_assigned_hosts($p_objectID)\n {\n $l_return = [];\n $l_dataRes = isys_cmdb_dao_category_g_nagios_refs_services_backwards::instance($this->get_database_component())\n ->get_data(null, $p_objectID);\n\n if (count($l_dataRes) > 0)\n {\n while ($l_row = $l_dataRes->get_row())\n {\n $l_tmp = $this->get_object_by_id($l_row['isys_catg_nagios_refs_services_list__isys_obj__id__host'], true)\n ->get_row();\n\n /**\n * @var $l_dao isys_cmdb_dao_object_type\n */\n $l_dao = isys_cmdb_dao_object_type::factory($this->get_database_component());\n if ($l_dao->has_cat($l_tmp['isys_obj__isys_obj_type__id'], ['C__CATG__NAGIOS_HOST_FOLDER']))\n {\n $l_return[$l_row['isys_catg_nagios_refs_services_list__id']] = $l_tmp['isys_obj__title'];\n } // if\n } // while\n } // if\n\n return $l_return;\n }", "public function get_assigned_hosts_with_dns($p_obj_id, $p_record_status = C__RECORD_STATUS__NORMAL)\n {\n if (empty($p_obj_id))\n {\n return false;\n } // if\n\n $l_sql = 'SELECT\n\t\t\tmain.isys_catg_ip_list__isys_ip_assignment__id,\n\t\t\tmain.isys_catg_ip_list__isys_ipv6_assignment__id,\n\t\t\tmain.isys_catg_ip_list__isys_cats_net_ip_addresses_list__id,\n\t\t\tisys_cats_net_ip_addresses_list__isys_ip_assignment__id,\n\t\t\tmain.isys_catg_ip_list__id,\n\t\t\tisys_obj__id,\n\t\t\tisys_obj__title,\n\t\t\tisys_obj_type__title,\n\t\t\tisys_cats_net_ip_addresses_list__title,\n\t\t\tmain.isys_catg_ip_list__hostname,\n\t\t\tdnstable.isys_net_dns_domain__id,\n\t\t\tdnstable.isys_net_dns_domain__title\n\t\t\tFROM isys_catg_ip_list AS main\n\t\t\tLEFT JOIN isys_cats_net_ip_addresses_list ON main.isys_catg_ip_list__isys_cats_net_ip_addresses_list__id = isys_cats_net_ip_addresses_list__id\n\t\t\tLEFT JOIN isys_obj ON isys_obj__id = main.isys_catg_ip_list__isys_obj__id\n\t\t\tLEFT JOIN isys_obj_type ON isys_obj_type__id = isys_obj__isys_obj_type__id\n\t\t\tLEFT JOIN isys_catg_ip_list_2_isys_net_dns_domain AS sub ON sub.isys_catg_ip_list__id = main.isys_catg_ip_list__id\n\t\t\tLEFT JOIN isys_net_dns_domain AS dnstable ON sub.isys_net_dns_domain__id = dnstable.isys_net_dns_domain__id\n\t\t\tWHERE isys_cats_net_ip_addresses_list__isys_obj__id = ' . $this->convert_sql_id($p_obj_id) . '\n\t\t\tAND isys_obj__status = ' . $this->convert_sql_int($p_record_status) . '\n\t\t\tAND main.isys_catg_ip_list__status = ' . $this->convert_sql_int($p_record_status) . '\n\t\t\tORDER BY isys_cats_net_ip_addresses_list__ip_address_long ASC;';\n\n return $this->retrieve($l_sql);\n }", "public function getHosts()\n {\n return isset($this->Hosts) ? $this->Hosts : null;\n }", "public function getHosts() {\n $hosts = array();\n foreach ($this->shareData[\"hosts\"] as $nick => $sessionID) {\n $hosts[$nick] = new Client($this->memcache, $sessionID);\n }\n return $hosts;\n }", "public function getHosts() {\r\n \t\ttry {\r\n \t\t\t$pdo = $this->db->generatePDO();\r\n\r\n \t\t\t$sql = \"SELECT DISTINCT(client_addr) FROM temperature\";\r\n\r\n\t\t\t$hosts = array();\r\n\r\n \t\t\t$getTemp = $pdo->prepare($sql);\r\n \t\t\t$getTemp->execute();\r\n\t\t\t$data = $getTemp->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\t\tforeach($data as $key => $value)\r\n\t\t\t\tarray_push($hosts, $value['client_addr']);\r\n \t\t\treturn $hosts;\r\n\r\n \t\t} catch (PDOException $e) {\r\n \t\t\t$this->throwError($e->getMessage());\r\n \t\t}\r\n \t}", "public function findHosts(): array;", "public function charge_hosts(){\n\t\t$this->onDebug ( \"On charge la liste des hosts.\", 1 );\n\t\t//fonction de l'API cacti : lib/api_automation_tools.php\n\t\t$this->setHosts ( getHosts () );\n\t\t\n\t\t$this->onDebug ( \"getAddresses\", 1 );\n\t\t//fonction de l'API cacti : lib/api_automation_tools.php\n\t\t$this->setHostsByIPs ( getAddresses () );\n\t\t\n\t\treturn $this;\n\t}", "private function getHosts()\n {\n foreach ($this->events as $event) {\n $this->hosts = array_unique(array_merge($this->hosts, array_map(function ($host) { return $host->host_name; }, $event->hosts)));\n }\n }", "function certificateapi_get_hosts() {\n global $CFG, $DB;\n return $DB->get_records_sql('SELECT\n h.id,\n h.ip_address,\n h.wwwroot,\n h.fullname,\n h.last_connect_time,\n h.clientid,\n h.public_key,\n h.public_key_validfrom,\n h.public_key_expires,\n h.permissions\n FROM\n {certificateapi_host} AS h' );\n}", "public function hosts()\n {\n return $this->morphedByMany('App\\Models\\Event\\Person\\EventHost', 'persona', 'pivot_persona_org', 'organization_id', 'persona_id');\n }", "function _getUsedHostPorts($scenariosetup_id){\r\n $usedHosts = $this->UsedHost->find('all', array('conditions'=>'scenariosetup_id='.$scenariosetup_id));\r\n $hosts = array();\r\n if (!empty($usedHosts)){\r\n foreach($usedHosts as $host) {\r\n $h = $this->Host->read(null, $host['UsedHost']['host_id']);\r\n $port = $h['Host']['id'] + START_PORT;\r\n $hosts[$port] = $h['Host']['description'];\r\n }\r\n } \r\n return $hosts;\r\n }", "function parseHosts(Request $request);", "public function hosts() {\n // Query each HttpRequest object sequentially, and add to a master list.\n $hosts = array();\n foreach ($this->requests as $request) {\n $url = $request->url;\n $hostname = parse_url($url, PHP_URL_HOST);\n if (!in_array($hostname, $hosts)) {\n $hosts[] = $hostname;\n }\n }\n return $hosts;\n }", "function get_viewed_hosts($perm, $groupid = 0, $options = array(), $nodeid = null, $sql = array()) {\n\tglobal $USER_DETAILS, $page;\n\n\t$userid = $USER_DETAILS['userid'];\n\n\t$def_sql = array(\n\t\t// hostname to avoid confusion with node name\n\t\t'select' => array('h.hostid','h.name as hostname'),\n\t\t'from' => array('hosts h'),\n\t\t'where' => array(),\n\t\t'order' => array()\n\t);\n\n\t$def_options = array(\n\t\t'deny_all' =>\t\t\t\t\t\t0,\n\t\t'allow_all' =>\t\t\t\t\t\t0,\n\t\t'select_first_host' =>\t\t\t\t0,\n\t\t'select_first_host_if_empty' =>\t\t0,\n\t\t'do_not_select' =>\t\t\t\t\t0,\n\t\t'do_not_select_if_empty' =>\t\t\t0,\n\t\t'monitored_hosts' =>\t\t\t\t0,\n\t\t'templated_hosts' =>\t\t\t\t0,\n\t\t'real_hosts' =>\t\t\t\t\t\t0,\n\t\t'not_proxy_hosts' =>\t\t\t\t0,\n\t\t'with_items' =>\t\t\t\t\t\t0,\n\t\t'with_monitored_items' =>\t\t\t0,\n\t\t'with_historical_items' =>\t\t\t0,\n\t\t'with_triggers' =>\t\t\t\t\t0,\n\t\t'with_monitored_triggers' =>\t\t0,\n\t\t'with_httptests' =>\t\t\t\t\t0,\n\t\t'with_monitored_httptests' =>\t\t0,\n\t\t'with_graphs' =>\t\t\t\t\t0,\n\t\t'only_current_node' =>\t\t\t\t0\n\t);\n\n\t$def_options = zbx_array_merge($def_options, $options);\n\n\t$config = select_config();\n\n\t$dd_first_entry = $config['dropdown_first_entry'];\n\tif ($def_options['allow_all']) {\n\t\t$dd_first_entry = ZBX_DROPDOWN_FIRST_ALL;\n\t}\n\tif ($def_options['deny_all']) {\n\t\t$dd_first_entry = ZBX_DROPDOWN_FIRST_NONE;\n\t}\n\n\t$result = array('original' => -1, 'selected' => 0, 'hosts' => array(), 'hostids' => array());\n\t$hosts = &$result['hosts'];\n\t$hostids = &$result['hostids'];\n\n\t$first_entry = ($dd_first_entry == ZBX_DROPDOWN_FIRST_NONE) ? _('not selected') : _('all');\n\n\t$hosts['0'] = $first_entry;\n\n\tif (!is_array($groupid) && ($groupid == 0)) {\n\t\tif ($dd_first_entry == ZBX_DROPDOWN_FIRST_NONE) {\n\t\t\treturn $result;\n\t\t}\n\t}\n\telse {\n\t\tzbx_value2array($groupid);\n\n\t\t$def_sql['from'][] = 'hosts_groups hg';\n\t\t$def_sql['where'][] = dbConditionInt('hg.groupid',$groupid);\n\t\t$def_sql['where'][] = 'hg.hostid=h.hostid';\n\t}\n\n\t$_REQUEST['hostid'] = $result['original'] = get_request('hostid', -1);\n\n\tif (is_null($nodeid)) {\n\t\tif (!$def_options['only_current_node']) {\n\t\t\t$nodeid = get_current_nodeid();\n\t\t}\n\t\telse {\n\t\t\t$nodeid = get_current_nodeid(false);\n\t\t}\n\t}\n\n\tif (USER_TYPE_SUPER_ADMIN != $USER_DETAILS['type']) {\n\t\t$userGroups = getUserGroupsByUserId($userid);\n\n\t\t$def_sql['where'][] = 'EXISTS ('.\n\t\t\t\t'SELECT NULL'.\n\t\t\t\t' FROM hosts_groups hgg'.\n\t\t\t\t\t' JOIN rights r'.\n\t\t\t\t\t\t' ON r.id=hgg.groupid'.\n\t\t\t\t\t\t\t' AND '.dbConditionInt('r.groupid', $userGroups).\n\t\t\t\t' WHERE h.hostid=hgg.hostid'.\n\t\t\t\t' GROUP BY hgg.hostid'.\n\t\t\t\t' HAVING MIN(r.permission)>='.$perm.\n\t\t\t\t')';\n\t}\n\n\t// nodes\n\tif (ZBX_DISTRIBUTED) {\n\t\t$def_sql['select'][] = 'n.name';\n\t\t$def_sql['from'][] = 'nodes n';\n\t\t$def_sql['where'][] = 'n.nodeid='.DBid2nodeid('h.hostid');\n\t\t$def_sql['order'][] = 'n.name';\n\t}\n\n\t// hosts\n\tif ($def_options['monitored_hosts']) {\n\t\t$def_sql['where'][] = 'h.status='.HOST_STATUS_MONITORED;\n\t}\n\telseif ($def_options['real_hosts']) {\n\t\t$def_sql['where'][] = 'h.status IN('.HOST_STATUS_MONITORED.','.HOST_STATUS_NOT_MONITORED.')';\n\t}\n\telseif ($def_options['templated_hosts']) {\n\t\t$def_sql['where'][] = 'h.status='.HOST_STATUS_TEMPLATE;\n\t}\n\telseif ($def_options['not_proxy_hosts']) {\n\t\t$def_sql['where'][] = 'h.status<>'.HOST_STATUS_PROXY;\n\t}\n\n\t// items\n\tif ($def_options['with_items']) {\n\t\t$def_sql['where'][] = 'EXISTS (SELECT NULL FROM items i WHERE h.hostid=i.hostid )';\n\t}\n\telseif ($def_options['with_monitored_items']) {\n\t\t$def_sql['where'][] = 'EXISTS (SELECT NULL FROM items i WHERE h.hostid=i.hostid AND i.status='.ITEM_STATUS_ACTIVE.')';\n\t}\n\telseif ($def_options['with_historical_items']) {\n\t\t$def_sql['where'][] = 'EXISTS (SELECT NULL FROM items i WHERE h.hostid=i.hostid AND (i.status='.ITEM_STATUS_ACTIVE.' OR i.status='.ITEM_STATUS_NOTSUPPORTED.') AND i.lastvalue IS NOT NULL)';\n\t}\n\n\t// triggers\n\tif ($def_options['with_triggers']) {\n\t\t$def_sql['where'][] = 'EXISTS (SELECT NULL'.\n\t\t\t\t\t\t\t\t\t\t' FROM items i,functions f,triggers t'.\n\t\t\t\t\t\t\t\t\t\t' WHERE i.hostid=h.hostid'.\n\t\t\t\t\t\t\t\t\t\t\t' AND i.itemid=f.itemid'.\n\t\t\t\t\t\t\t\t\t\t\t' AND f.triggerid=t.triggerid)';\n\t}\n\telseif ($def_options['with_monitored_triggers']) {\n\t\t$def_sql['where'][] = 'EXISTS (SELECT NULL'.\n\t\t\t\t\t\t\t\t\t\t' FROM items i,functions f,triggers t'.\n\t\t\t\t\t\t\t\t\t\t' WHERE i.hostid=h.hostid'.\n\t\t\t\t\t\t\t\t\t\t\t' AND i.status='.ITEM_STATUS_ACTIVE.\n\t\t\t\t\t\t\t\t\t\t\t' AND i.itemid=f.itemid'.\n\t\t\t\t\t\t\t\t\t\t\t' AND f.triggerid=t.triggerid'.\n\t\t\t\t\t\t\t\t\t\t\t' AND t.status='.TRIGGER_STATUS_ENABLED.')';\n\t}\n\n\t// httptests\n\tif ($def_options['with_httptests']) {\n\t\t$def_sql['where'][] = 'EXISTS (SELECT NULL'.\n\t\t\t\t\t\t\t\t\t\t' FROM applications a,httptest ht'.\n\t\t\t\t\t\t\t\t\t\t' WHERE a.hostid=h.hostid'.\n\t\t\t\t\t\t\t\t\t\t\t' AND ht.applicationid=a.applicationid)';\n\t}\n\telseif ($def_options['with_monitored_httptests']) {\n\t\t$def_sql['where'][] = 'EXISTS (SELECT NULL'.\n\t\t\t\t\t\t\t\t\t\t' FROM applications a,httptest ht'.\n\t\t\t\t\t\t\t\t\t\t' WHERE a.hostid=h.hostid'.\n\t\t\t\t\t\t\t\t\t\t\t' AND ht.applicationid=a.applicationid'.\n\t\t\t\t\t\t\t\t\t\t\t' AND ht.status='.HTTPTEST_STATUS_ACTIVE.')';\n\t}\n\n\t// graphs\n\tif ($def_options['with_graphs']) {\n\t\t$def_sql['where'][] = 'EXISTS (SELECT NULL'.\n\t\t\t\t\t\t\t\t\t\t' FROM items i,graphs_items gi'.\n\t\t\t\t\t\t\t\t\t\t' WHERE i.hostid=h.hostid'.\n\t\t\t\t\t\t\t\t\t\t\t' AND i.itemid=gi.itemid)';\n\t}\n\n\t$def_sql['order'][] = 'h.name';\n\n\tforeach ($sql as $key => $value) {\n\t\tzbx_value2array($value);\n\n\t\tif (isset($def_sql[$key])) {\n\t\t\t$def_sql[$key] = zbx_array_merge($def_sql[$key], $value);\n\t\t}\n\t\telse {\n\t\t\t$def_sql[$key] = $value;\n\t\t}\n\t}\n\n\t$def_sql['select'] = array_unique($def_sql['select']);\n\t$def_sql['from'] = array_unique($def_sql['from']);\n\t$def_sql['where'] = array_unique($def_sql['where']);\n\t$def_sql['order'] = array_unique($def_sql['order']);\n\n\t$sql_select = '';\n\t$sql_from = '';\n\t$sql_where = '';\n\t$sql_order = '';\n\tif (!empty($def_sql['select'])) {\n\t\t$sql_select .= implode(',', $def_sql['select']);\n\t}\n\tif (!empty($def_sql['from'])) {\n\t\t$sql_from .= implode(',', $def_sql['from']);\n\t}\n\tif (!empty($def_sql['where'])) {\n\t\t$sql_where .= ' AND '.implode(' AND ', $def_sql['where']);\n\t}\n\tif (!empty($def_sql['order'])) {\n\t\t$sql_order .= implode(',', $def_sql['order']);\n\t}\n\n\t$res = DBselect(\n\t\t'SELECT DISTINCT '.$sql_select.\n\t\t' FROM '.$sql_from.\n\t\t' WHERE '.DBin_node('h.hostid', $nodeid).\n\t\t\t$sql_where.\n\t\t' ORDER BY '.$sql_order\n\t);\n\twhile ($host = DBfetch($res)) {\n\t\t$hosts[$host['hostid']] = $host['hostname'];\n\t\t$hostids[$host['hostid']] = $host['hostid'];\n\n\t\tif (bccomp($_REQUEST['hostid'], $host['hostid']) == 0) {\n\t\t\t$result['selected'] = $host['hostid'];\n\t\t}\n\t}\n\n\t$profile_hostid = CProfile::get('web.'.$page['menu'].'.hostid');\n\n\tif ($def_options['do_not_select']) {\n\t\t$_REQUEST['hostid'] = $result['selected'] = 0;\n\t}\n\telseif ($def_options['do_not_select_if_empty'] && $_REQUEST['hostid'] == -1) {\n\t\t$_REQUEST['hostid'] = $result['selected'] = 0;\n\t}\n\telseif ($def_options['select_first_host']\n\t\t\t\t|| ($def_options['select_first_host_if_empty'] && $_REQUEST['hostid'] == -1 && is_null($profile_hostid))) {\n\t\t$first_hostid = next($hostids);\n\t\treset($hostids);\n\n\t\tif ($first_hostid !== false) {\n\t\t\t$_REQUEST['hostid'] = $result['selected'] = $first_hostid;\n\t\t}\n\t\telse {\n\t\t\t$_REQUEST['hostid'] = $result['selected'] = 0;\n\t\t}\n\t}\n\telse {\n\t\tif ($config['dropdown_first_remember']) {\n\t\t\tif ($_REQUEST['hostid'] == -1) {\n\t\t\t\t$_REQUEST['hostid'] = is_null($profile_hostid) ? '0' : $profile_hostid;\n\t\t\t}\n\n\t\t\tif (isset($hostids[$_REQUEST['hostid']])) {\n\t\t\t\t$result['selected'] = $_REQUEST['hostid'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$_REQUEST['hostid'] = $result['selected'];\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$_REQUEST['hostid'] = $result['selected'];\n\t\t}\n\t}\n\n\treturn $result;\n}", "static function getAllHosts( $domain ) {\n\t\tglobal $wgAuth;\n\n\t\tOpenStackNovaLdapConnection::connect();\n\n\t\t$hosts = array();\n\t\t$result = LdapAuthenticationPlugin::ldap_search( $wgAuth->ldapconn, $domain->domainDN, '(dc=*)' );\n\t\tif ( $result ) {\n\t\t\t$entries = LdapAuthenticationPlugin::ldap_get_entries( $wgAuth->ldapconn, $result );\n\t\t\tif ( $entries ) {\n\t\t\t\t# First entry is always a count\n\t\t\t\tarray_shift( $entries );\n\t\t\t\tforeach ( $entries as $entry ) {\n\t\t\t\t\t$hosts[] = new OpenStackNovaHost( $entry['dc'][0], $domain );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $hosts;\n\t}", "public static function HostGroup(){\n return bzhyCBase::getInstanceByObject('hostgroup',[]);\n }", "static function getHostsByIP( $ip ) {\n\t\tglobal $wgAuth;\n\t\tglobal $wgOpenStackManagerLDAPInstanceBaseDN;\n\n\t\t$result = LdapAuthenticationPlugin::ldap_search( $wgAuth->ldapconn, $wgOpenStackManagerLDAPInstanceBaseDN, '(arecord=' . $ip . ')' );\n\t\t$hostsInfo = LdapAuthenticationPlugin::ldap_get_entries( $wgAuth->ldapconn, $result );\n\t\tif ( $hostsInfo[\"count\"] == \"0\" ) {\n\t\t\treturn array();\n\t\t} else {\n\t\t\t$hosts = array();\n\t\t\tarray_shift( $hostsInfo );\n\t\t\tforeach ( $hostsInfo as $host ) {\n\t\t\t\t$hostname = $host['dc'][0];\n\t\t\t\t$domainname = explode( '.', $host['associateddomain'][0] );\n\t\t\t\t$domainname = $domainname[1];\n\t\t\t\t$domain = OpenStackNovaDomain::getDomainByName( $domainname );\n\t\t\t\t$hostObject = OpenStackNovaHost::getHostByName( $hostname, $domain );\n\t\t\t\tif ( $hostObject ) {\n\t\t\t\t\t$hosts[] = $hostObject;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $hosts;\n\t\t}\n\t}", "public function getTbrHosts() {\n\treturn $this->GTB_SERVER['host']; \n }", "function fetchHostInfo() {\n\t\tglobal $wgAuth;\n\n\t\t$this->searchvalue = $wgAuth->getLdapEscapedString( $this->searchvalue );\n\t\t$fqdn = $this->searchvalue . '.' . $this->domain->getFullyQualifiedDomainName();\n\t\t$result = LdapAuthenticationPlugin::ldap_search( $wgAuth->ldapconn, $this->domain->domainDN, '(|(associateddomain=' . $fqdn . ')(cnamerecord=' . $fqdn . ')(dc=' . $this->searchvalue . '))' );\n\t\t$this->hostInfo = LdapAuthenticationPlugin::ldap_get_entries( $wgAuth->ldapconn, $result );\n\t\tif ( $this->hostInfo[\"count\"] == \"0\" ) {\n\t\t\t$this->hostInfo = null;\n\t\t} else {\n\t\t\t$this->hostDN = $this->hostInfo[0]['dn'];\n\t\t}\n\t}", "function get_hostgroup_data()\n{\n\tglobal $NagiosData;\n\tglobal $NagiosUser; \n\n\t$hostgroups = $NagiosData->getProperty('hostgroups');\n\t$hosts = $NagiosData->getProperty('hosts');\n\n\t$hostgroup_data = array();\n\tforeach ($hostgroups as $group => $members) \n\t{\n\t\t\n\t\t\n\t\t$hostgroup_data[$group] = array(\n\t\t\t'member_data' => array(),\n\t\t\t'host_counts' => get_state_of('hosts', build_hostgroup_details($members)),\n\t\t\t'service_counts' => get_state_of('services', build_host_servicegroup_details($members))\n\t\t\t);\n\t\t\n\t\t//skip ahead if there are no authorized hosts\t\t\t\n\t\tif(array_sum($hostgroup_data[$group]['host_counts'])==0) continue; //skip empty groups \n\t\t\t\n\t\tforeach ($members as $member) \n\t\t{\n\t\t\n\t\t\tif(!$NagiosUser->is_authorized_for_host($member)) continue; //user-level filtering \t\t\n\t\t\n\t\t\t$host = $hosts[$member];\n\t\t\tprocess_host_status_keys($host); \n\t\t\t$hostgroup_data[$group]['member_data'][$member]['host_name'] = $host['host_name'];\n\t\t\t$hostgroup_data[$group]['member_data'][$member]['host_state'] = $host['current_state'];\n\t\t\t$hostgroup_data[$group]['member_data'][$member]['state_class'] = get_color_code($host);\n\t\t\t$hostgroup_data[$group]['member_data'][$member]['services'] = array();\n\t\t\t$hostgroup_data[$group]['member_data'][$member]['host_url'] = \n\t\t\t\tBASEURL.'index.php?type=hostdetail&name_filter='.urlencode($host['host_name']);\n\n\t\t\t\n\t\t\tif (isset($host['services'])) {\n\t\t\t\tforeach($host['services'] as $service) {\n\t\t\t\t\n\t\t\t\t\tif(!$NagiosUser->is_authorized_for_service($member,$service['service_description'])) continue; //user-level filtering \t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tprocess_service_status_keys($service);\n\t\t\t\t\t$service_data = array(\n\t\t\t\t\t\t'state_class' => get_color_code($service),\n\t\t\t\t\t\t'description' => $service['service_description'],\n\t\t\t\t\t\t'service_url' => htmlentities(BASEURL.'index.php?type=servicedetail&name_filter='.$service['service_id']),\n\t\t\t\t\t);\n\t\t\t\t\t$hostgroup_data[$group]['member_data'][$member]['services'][] = $service_data;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}\n\treturn $hostgroup_data;\n}", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "static protected function _get_host()\n {\n return array(\n self::$_hosts[array_rand(self::$_hosts)],\n self::$_ports[array_rand(self::$_ports)],\n );\n }", "public function GetAllowedHostnames () {\n\t\treturn $this->allowedHostnames;\n\t}", "public function getHostInfo()\n {\n $host_info = [];\n\n $host_info['name'] = $this->getDataItem($this->ns_host, 'name');\n $host_info['roid'] = $this->getDataItem($this->ns_host, 'roid');\n $host_info['status'] = $this->getArrayElementsResponse($this->ns_host, 'status', null, true, 's');\n $host_info['clID'] = $this->getDataItem($this->ns_host, 'clID');\n $host_info['crID'] = $this->getDataItem($this->ns_host, 'crID');\n $host_info['crDate'] = $this->getDataItem($this->ns_host, 'crDate');\n\n return $host_info;\n }", "function _hosts()\n{\n $c = \"# Generated with beatnik on \" . date('Y-m-d h:i:s') . \" by \" . $GLOBALS['username'] . \"\\n\\n\";\n foreach ($GLOBALS['domains'] as $domain) {\n\n $zonename = $domain['zonename'];\n $tld = substr($zonename, strrpos($zonename, '.')+1);\n $domain = substr($zonename, 0, strrpos($zonename, '.'));\n\n foreach ($zonedata['cname'] as $id => $values) {\n extract($values);\n if (!empty($hostname)) {\n $hostname .= '.';\n }\n $c .= \"$pointer $hostname.$domain.$tld\\n\";\n }\n }\n\n return $c;\n}" ]
[ "0.66970825", "0.64421314", "0.6347893", "0.6300464", "0.6269129", "0.6267965", "0.6170565", "0.6131146", "0.6093775", "0.58610743", "0.57820654", "0.5755891", "0.56144214", "0.55563915", "0.5555589", "0.55555654", "0.5477946", "0.547738", "0.5471819", "0.54594636", "0.5444478", "0.5444478", "0.5444478", "0.5444478", "0.5444478", "0.5444478", "0.54356456", "0.540778", "0.54072213", "0.5393598" ]
0.6467666
1
function Method for retrieving assigned hosts and their DNS data from an object (This might result in multiple rows).
public function get_assigned_hosts_with_dns($p_obj_id, $p_record_status = C__RECORD_STATUS__NORMAL) { if (empty($p_obj_id)) { return false; } // if $l_sql = 'SELECT main.isys_catg_ip_list__isys_ip_assignment__id, main.isys_catg_ip_list__isys_ipv6_assignment__id, main.isys_catg_ip_list__isys_cats_net_ip_addresses_list__id, isys_cats_net_ip_addresses_list__isys_ip_assignment__id, main.isys_catg_ip_list__id, isys_obj__id, isys_obj__title, isys_obj_type__title, isys_cats_net_ip_addresses_list__title, main.isys_catg_ip_list__hostname, dnstable.isys_net_dns_domain__id, dnstable.isys_net_dns_domain__title FROM isys_catg_ip_list AS main LEFT JOIN isys_cats_net_ip_addresses_list ON main.isys_catg_ip_list__isys_cats_net_ip_addresses_list__id = isys_cats_net_ip_addresses_list__id LEFT JOIN isys_obj ON isys_obj__id = main.isys_catg_ip_list__isys_obj__id LEFT JOIN isys_obj_type ON isys_obj_type__id = isys_obj__isys_obj_type__id LEFT JOIN isys_catg_ip_list_2_isys_net_dns_domain AS sub ON sub.isys_catg_ip_list__id = main.isys_catg_ip_list__id LEFT JOIN isys_net_dns_domain AS dnstable ON sub.isys_net_dns_domain__id = dnstable.isys_net_dns_domain__id WHERE isys_cats_net_ip_addresses_list__isys_obj__id = ' . $this->convert_sql_id($p_obj_id) . ' AND isys_obj__status = ' . $this->convert_sql_int($p_record_status) . ' AND main.isys_catg_ip_list__status = ' . $this->convert_sql_int($p_record_status) . ' ORDER BY isys_cats_net_ip_addresses_list__ip_address_long ASC;'; return $this->retrieve($l_sql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function certificateapi_get_hosts() {\n global $CFG, $DB;\n return $DB->get_records_sql('SELECT\n h.id,\n h.ip_address,\n h.wwwroot,\n h.fullname,\n h.last_connect_time,\n h.clientid,\n h.public_key,\n h.public_key_validfrom,\n h.public_key_expires,\n h.permissions\n FROM\n {certificateapi_host} AS h' );\n}", "function fetchHostInfo() {\n\t\tglobal $wgAuth;\n\n\t\t$this->searchvalue = $wgAuth->getLdapEscapedString( $this->searchvalue );\n\t\t$fqdn = $this->searchvalue . '.' . $this->domain->getFullyQualifiedDomainName();\n\t\t$result = LdapAuthenticationPlugin::ldap_search( $wgAuth->ldapconn, $this->domain->domainDN, '(|(associateddomain=' . $fqdn . ')(cnamerecord=' . $fqdn . ')(dc=' . $this->searchvalue . '))' );\n\t\t$this->hostInfo = LdapAuthenticationPlugin::ldap_get_entries( $wgAuth->ldapconn, $result );\n\t\tif ( $this->hostInfo[\"count\"] == \"0\" ) {\n\t\t\t$this->hostInfo = null;\n\t\t} else {\n\t\t\t$this->hostDN = $this->hostInfo[0]['dn'];\n\t\t}\n\t}", "public function get_assigned_hosts($p_obj_id, $p_condition = '', $p_record_status = C__RECORD_STATUS__NORMAL, $p_sort = null)\n {\n if (empty($p_obj_id))\n {\n return false;\n } // if\n\n $l_sql = 'SELECT isys_catg_ip_list__isys_ip_assignment__id, isys_catg_ip_list__isys_ipv6_assignment__id, isys_catg_ip_list__isys_cats_net_ip_addresses_list__id, isys_cats_net_ip_addresses_list__isys_ip_assignment__id, isys_catg_ip_list__id, isys_obj__id, isys_obj__title, isys_obj_type__title, isys_cats_net_ip_addresses_list__title, isys_catg_ip_list__hostname\n\t\t\tFROM isys_catg_ip_list\n\t\t\tLEFT JOIN isys_cats_net_ip_addresses_list ON isys_catg_ip_list__isys_cats_net_ip_addresses_list__id = isys_cats_net_ip_addresses_list__id\n\t\t\tLEFT JOIN isys_obj ON isys_obj__id = isys_catg_ip_list__isys_obj__id\n\t\t\tLEFT JOIN isys_obj_type ON isys_obj_type__id = isys_obj__isys_obj_type__id\n\t\t\tWHERE isys_cats_net_ip_addresses_list__isys_obj__id = ' . $this->convert_sql_id($p_obj_id) . '\n\t\t\t' . $p_condition . '\n\t\t\tAND isys_obj__status = ' . $this->convert_sql_int($p_record_status) . '\n\t\t\tAND isys_catg_ip_list__status = ' . $this->convert_sql_int($p_record_status) . ' ';\n\n if ($p_sort === null)\n {\n $l_sql .= 'ORDER BY isys_cats_net_ip_addresses_list__title ASC;';\n }\n else\n {\n $l_sql .= $p_sort;\n } // if\n\n return $this->retrieve($l_sql);\n }", "public function get_assigned_hosts($p_objectID)\n {\n $l_return = [];\n $l_dataRes = isys_cmdb_dao_category_g_nagios_refs_services_backwards::instance($this->get_database_component())\n ->get_data(null, $p_objectID);\n\n if (count($l_dataRes) > 0)\n {\n while ($l_row = $l_dataRes->get_row())\n {\n $l_tmp = $this->get_object_by_id($l_row['isys_catg_nagios_refs_services_list__isys_obj__id__host'], true)\n ->get_row();\n\n /**\n * @var $l_dao isys_cmdb_dao_object_type\n */\n $l_dao = isys_cmdb_dao_object_type::factory($this->get_database_component());\n if ($l_dao->has_cat($l_tmp['isys_obj__isys_obj_type__id'], ['C__CATG__NAGIOS_HOST_FOLDER']))\n {\n $l_return[$l_row['isys_catg_nagios_refs_services_list__id']] = $l_tmp['isys_obj__title'];\n } // if\n } // while\n } // if\n\n return $l_return;\n }", "function get_hostgroup_data()\n{\n\tglobal $NagiosData;\n\tglobal $NagiosUser; \n\n\t$hostgroups = $NagiosData->getProperty('hostgroups');\n\t$hosts = $NagiosData->getProperty('hosts');\n\n\t$hostgroup_data = array();\n\tforeach ($hostgroups as $group => $members) \n\t{\n\t\t\n\t\t\n\t\t$hostgroup_data[$group] = array(\n\t\t\t'member_data' => array(),\n\t\t\t'host_counts' => get_state_of('hosts', build_hostgroup_details($members)),\n\t\t\t'service_counts' => get_state_of('services', build_host_servicegroup_details($members))\n\t\t\t);\n\t\t\n\t\t//skip ahead if there are no authorized hosts\t\t\t\n\t\tif(array_sum($hostgroup_data[$group]['host_counts'])==0) continue; //skip empty groups \n\t\t\t\n\t\tforeach ($members as $member) \n\t\t{\n\t\t\n\t\t\tif(!$NagiosUser->is_authorized_for_host($member)) continue; //user-level filtering \t\t\n\t\t\n\t\t\t$host = $hosts[$member];\n\t\t\tprocess_host_status_keys($host); \n\t\t\t$hostgroup_data[$group]['member_data'][$member]['host_name'] = $host['host_name'];\n\t\t\t$hostgroup_data[$group]['member_data'][$member]['host_state'] = $host['current_state'];\n\t\t\t$hostgroup_data[$group]['member_data'][$member]['state_class'] = get_color_code($host);\n\t\t\t$hostgroup_data[$group]['member_data'][$member]['services'] = array();\n\t\t\t$hostgroup_data[$group]['member_data'][$member]['host_url'] = \n\t\t\t\tBASEURL.'index.php?type=hostdetail&name_filter='.urlencode($host['host_name']);\n\n\t\t\t\n\t\t\tif (isset($host['services'])) {\n\t\t\t\tforeach($host['services'] as $service) {\n\t\t\t\t\n\t\t\t\t\tif(!$NagiosUser->is_authorized_for_service($member,$service['service_description'])) continue; //user-level filtering \t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tprocess_service_status_keys($service);\n\t\t\t\t\t$service_data = array(\n\t\t\t\t\t\t'state_class' => get_color_code($service),\n\t\t\t\t\t\t'description' => $service['service_description'],\n\t\t\t\t\t\t'service_url' => htmlentities(BASEURL.'index.php?type=servicedetail&name_filter='.$service['service_id']),\n\t\t\t\t\t);\n\t\t\t\t\t$hostgroup_data[$group]['member_data'][$member]['services'][] = $service_data;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}\n\treturn $hostgroup_data;\n}", "public function getHosts() {\r\n \t\ttry {\r\n \t\t\t$pdo = $this->db->generatePDO();\r\n\r\n \t\t\t$sql = \"SELECT DISTINCT(client_addr) FROM temperature\";\r\n\r\n\t\t\t$hosts = array();\r\n\r\n \t\t\t$getTemp = $pdo->prepare($sql);\r\n \t\t\t$getTemp->execute();\r\n\t\t\t$data = $getTemp->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\t\tforeach($data as $key => $value)\r\n\t\t\t\tarray_push($hosts, $value['client_addr']);\r\n \t\t\treturn $hosts;\r\n\r\n \t\t} catch (PDOException $e) {\r\n \t\t\t$this->throwError($e->getMessage());\r\n \t\t}\r\n \t}", "function get_host_data($host_id)\n{\n global $dbh;\n $host_data = null;\n\n $result = $dbh->query(\"SELECT * FROM hosts WHERE id = $host_id\");\n if ($result)\n $host_data = $result->fetch(PDO::FETCH_ASSOC);\n\n return $host_data;\n}", "public function get_all_net_information_by_obj_id($p_obj_id)\n {\n $l_net_row = [];\n\n if (class_exists('isys_cmdb_dao_category_s_net_ip_addresses'))\n {\n $l_dao_ip_list = new isys_cmdb_dao_category_s_net_ip_addresses($this->get_database_component());\n $l_ip_list_res = $l_dao_ip_list->get_data(null, $p_obj_id, '', [], C__RECORD_STATUS__NORMAL);\n\n $l_ip_list_data = [];\n while ($l_ip_list_row = $l_ip_list_res->get_row())\n {\n $l_ip_list_data[] = Ip::ip2long($l_ip_list_row['isys_cats_net_ip_addresses_list__title']);\n } // while\n\n $l_net_row['used_ips'] = $l_ip_list_data;\n }\n else\n {\n $l_net_row['used_ips'] = [];\n }\n\n $l_dao_dhcp = new isys_cmdb_dao_category_s_net_dhcp($this->get_database_component());\n $l_dao_ip = new isys_cmdb_dao_category_g_ip($this->get_database_component());\n\n $l_net_row = $this->get_data(null, $p_obj_id)\n ->get_row();\n $l_objtype = _L($this->get_objtype_name_by_id_as_string($l_net_row['isys_obj__isys_obj_type__id']));\n $l_net_row['object_browser_title'] = $l_objtype . ' >> ' . $l_net_row['isys_obj__title'];\n\n // Get DNS Server from net.\n $l_assigned_dns_server = $this->get_assigned_dns_server($l_net_row['isys_cats_net_list__id']);\n for ($i = 0;$i < count($l_assigned_dns_server);$i++)\n {\n $l_assigned_dns_server[$i] = [\n 'id' => $l_assigned_dns_server[$i],\n 'details' => $l_dao_ip->format_selection($l_assigned_dns_server[$i], true)\n ];\n } // for\n\n $l_net_row['assigned_dns_server'] = $l_assigned_dns_server;\n\n // Get DNS Domain from net.\n $l_domain_arr = [];\n $l_res_dns_domain = $this->get_assigned_dns_domain(null, $l_net_row['isys_cats_net_list__id']);\n if ($l_res_dns_domain)\n {\n while ($l_dns_domain_row = $l_res_dns_domain->get_row())\n {\n $l_domain_arr[] = [\n 'caption' => $l_dns_domain_row['isys_net_dns_domain__title'],\n 'value' => $l_dns_domain_row['isys_net_dns_domain__id']\n ];\n } // while\n } // if\n\n $l_net_row['assigned_dns_domain'] = $l_domain_arr;\n\n $l_dhcp_types_res = $this->get_dialog('isys_net_dhcp_type');\n $l_dhcp_types = [];\n while ($l_dhcp_type_row = $l_dhcp_types_res->get_row())\n {\n $l_dhcp_types[$l_dhcp_type_row['isys_net_dhcp_type__const']] = $l_dhcp_type_row['isys_net_dhcp_type__id'];\n } // while\n\n if (count($l_dhcp_types) > 0)\n {\n $l_dhcp_arr = [];\n foreach ($l_dhcp_types AS $l_dhcp_key => $l_dhcp_type_id)\n {\n $l_dhcp_res = $l_dao_dhcp->get_data(\n null,\n $p_obj_id,\n ' AND isys_net_dhcp_type__id = ' . $this->convert_sql_id($l_dhcp_type_id),\n null,\n C__RECORD_STATUS__NORMAL\n );\n while ($l_dhcp_row = $l_dhcp_res->get_row())\n {\n $l_dhcp_arr[$l_dhcp_key][] = [\n 'from' => Ip::ip2long($l_dhcp_row['isys_cats_net_dhcp_list__range_from']),\n 'to' => Ip::ip2long($l_dhcp_row['isys_cats_net_dhcp_list__range_to'])\n ];\n } // while\n } // foreach\n $l_net_row['dhcp_ranges'] = $l_dhcp_arr;\n }\n\n return $l_net_row;\n }", "public function get_assigned_dns_server($p_cat_id = null, $p_obj_id = null)\n {\n if (empty($p_cat_id) && empty($p_connected_obj_id))\n {\n return [];\n } // if\n\n $l_arr = [];\n $l_sql = 'SELECT * FROM isys_cats_net_list_2_isys_catg_ip_list ';\n\n if (!empty($p_cat_id) && empty($p_obj_id))\n {\n $l_sql .= 'WHERE isys_cats_net_list__id = ' . $this->convert_sql_id($p_cat_id) . ';';\n }\n else if (empty($p_cat_id) && !empty($p_obj_id))\n {\n $l_sql .= 'WHERE isys_cats_net_list__id = (SELECT isys_cats_net_list__id FROM isys_cats_net_list WHERE isys_cats_net_list__isys_obj__id = ' . $this->convert_sql_id(\n $p_obj_id\n ) . ');';\n } // if\n\n $l_res = $this->retrieve($l_sql);\n\n if (count($l_res) > 0)\n {\n while ($l_row = $l_res->get_row())\n {\n $l_arr[] = $l_row['isys_catg_ip_list__id'];\n } // while\n } // if\n\n return $l_arr;\n }", "function domainbox_GetDNS($params)\n{\n $authParameters = getAuthParameters($params);\n $apiEndpoint = $params[\"TestMode\"] ? \"https://sandbox.domainbox.net/?WSDL\" : \"https://live.domainbox.net/?WSDL\";\n\n $queryDnsRecordsParameters = new QueryDnsRecordsParameters();\n $queryDnsRecordsParameters->Zone = $params[\"sld\"] . '.' . $params[\"tld\"];\n\n $hostRecords = array();\n\n try\n {\n $parameters = array('AuthenticationParameters' => $authParameters, 'CommandParameters' => $queryDnsRecordsParameters);\n $client = new SoapClient($apiEndpoint, array('soap_version' => SOAP_1_2));\n $result = $client->QueryDnsRecords($parameters);\n\n $result = $result->QueryDnsRecordsResult;\n\n if ($result->ResultCode == 100)\n {\n if ($result->TotalResults > 1)\n {\n foreach ($result->Records->DnsRecordQueryResult as $dnsRecord)\n {\n $hostRecords[] = array('hostname' => $dnsRecord->HostName, 'type' => $dnsRecord->RecordType, 'address' => $dnsRecord->Content, 'priority' => $dnsRecord->Priority);\n }\n }\n else\n {\n foreach ($result->Records as $dnsRecord)\n {\n $hostRecords[] = array('hostname' => $dnsRecord->HostName, 'type' => $dnsRecord->RecordType, 'address' => $dnsRecord->Content, 'priority' => $dnsRecord->Priority);\n }\n }\n }\n }\n catch (Exception $e)\n {\n //TODO: Find out a way to return error to WHMCS.\n }\n\n return $hostRecords;\n}", "function _hosts()\n{\n $c = \"# Generated with beatnik on \" . date('Y-m-d h:i:s') . \" by \" . $GLOBALS['username'] . \"\\n\\n\";\n foreach ($GLOBALS['domains'] as $domain) {\n\n $zonename = $domain['zonename'];\n $tld = substr($zonename, strrpos($zonename, '.')+1);\n $domain = substr($zonename, 0, strrpos($zonename, '.'));\n\n foreach ($zonedata['cname'] as $id => $values) {\n extract($values);\n if (!empty($hostname)) {\n $hostname .= '.';\n }\n $c .= \"$pointer $hostname.$domain.$tld\\n\";\n }\n }\n\n return $c;\n}", "public function getHostInfo()\n {\n $host_info = [];\n\n $host_info['name'] = $this->getDataItem($this->ns_host, 'name');\n $host_info['roid'] = $this->getDataItem($this->ns_host, 'roid');\n $host_info['status'] = $this->getArrayElementsResponse($this->ns_host, 'status', null, true, 's');\n $host_info['clID'] = $this->getDataItem($this->ns_host, 'clID');\n $host_info['crID'] = $this->getDataItem($this->ns_host, 'crID');\n $host_info['crDate'] = $this->getDataItem($this->ns_host, 'crDate');\n\n return $host_info;\n }", "static function getAllHosts( $domain ) {\n\t\tglobal $wgAuth;\n\n\t\tOpenStackNovaLdapConnection::connect();\n\n\t\t$hosts = array();\n\t\t$result = LdapAuthenticationPlugin::ldap_search( $wgAuth->ldapconn, $domain->domainDN, '(dc=*)' );\n\t\tif ( $result ) {\n\t\t\t$entries = LdapAuthenticationPlugin::ldap_get_entries( $wgAuth->ldapconn, $result );\n\t\t\tif ( $entries ) {\n\t\t\t\t# First entry is always a count\n\t\t\t\tarray_shift( $entries );\n\t\t\t\tforeach ( $entries as $entry ) {\n\t\t\t\t\t$hosts[] = new OpenStackNovaHost( $entry['dc'][0], $domain );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $hosts;\n\t}", "public function get_assigned_dns_domain($p_obj_id = null, $p_id = null)\n {\n if (empty($p_obj_id) && empty($p_id))\n {\n return false;\n } // if\n $l_condition = '';\n\n $l_sql = 'SELECT dnstable.isys_net_dns_domain__id, dnstable.isys_net_dns_domain__title\n\t\t\tFROM isys_cats_net_list_2_isys_net_dns_domain AS main\n\t\t\tINNER JOIN isys_net_dns_domain dnstable ON main.isys_net_dns_domain__id = dnstable.isys_net_dns_domain__id';\n\n if ($p_obj_id > 0)\n {\n $l_condition = ' WHERE main.isys_cats_net_list__id = (SELECT isys_cats_net_list__id FROM isys_cats_net_list WHERE isys_cats_net_list__isys_obj__id = ' . $this->convert_sql_id(\n $p_obj_id\n ) . ')';\n } // if\n\n if ($p_id > 0)\n {\n $l_condition = ' WHERE main.isys_cats_net_list__id = ' . $this->convert_sql_id($p_id);\n } // if\n\n return $this->retrieve($l_sql . $l_condition . ';');\n }", "private function getHosts($record, $merged = TRUE) {\n\n preg_match('/name:(.*)/', $record, $names);\n\n if( is_array($names) ):\n array_shift($names);\n for($i=0;$i<count($names); $i++):\n $names[$i] = trim($names[$i]);\n endfor;\n $hostnames['default'] = array_shift($names);\n else:\n $hostnames['default'] = NULL;\n endif;\n\n preg_match('/alias:(.*)/s', $record, $aliases);\n\n if( is_array($aliases) && !empty($aliases) ):\n array_shift($aliases);\n $aliases = explode(',', explode('type:', $aliases[0])[0]);\n\n foreach($aliases as $key => $alias):\n $aliases[$key] = trim($aliases[$key]);\n endforeach;\n\n $hostnames['aliases'] = $aliases;\n endif;\n\n if($merged):\n if(isset($hostnames['aliases'])):\n return array_merge( array($hostnames['default']), $hostnames['aliases']);\n else:\n return array($hostnames['default']);\n endif;\n else:\n return $hostnames;\n endif;\n }", "public function findHosts(): array;", "private function getHosts()\n {\n foreach ($this->events as $event) {\n $this->hosts = array_unique(array_merge($this->hosts, array_map(function ($host) { return $host->host_name; }, $event->hosts)));\n }\n }", "function resolve_host($hostname, $family) {\n if ($family == WIN_AF_INET) {\n $dns_family = DNS_A;\n } elseif ($family == WIN_AF_INET6) {\n $dns_family = DNS_AAAA;\n } else {\n my_print('invalid family, must be AF_INET or AF_INET6');\n return NULL;\n }\n\n $dns = dns_get_record($hostname, $dns_family);\n if (empty($dns)) {\n return NULL;\n }\n\n $result = array(\"family\" => $family);\n $record = $dns[0];\n if ($record[\"type\"] == \"A\") {\n $result[\"address\"] = $record[\"ip\"];\n }\n if ($record[\"type\"] == \"AAAA\") {\n $result[\"address\"] = $record[\"ipv6\"];\n }\n $result[\"packed_address\"] = inet_pton($result[\"address\"]);\n return $result;\n}", "public function addDomainNameIntoHosts()\n {\n $this->addToHosts();\n $this->addToHostprofiles();\n }", "public function charge_hosts(){\n\t\t$this->onDebug ( \"On charge la liste des hosts.\", 1 );\n\t\t//fonction de l'API cacti : lib/api_automation_tools.php\n\t\t$this->setHosts ( getHosts () );\n\t\t\n\t\t$this->onDebug ( \"getAddresses\", 1 );\n\t\t//fonction de l'API cacti : lib/api_automation_tools.php\n\t\t$this->setHostsByIPs ( getAddresses () );\n\t\t\n\t\treturn $this;\n\t}", "public function hosts()\n {\n return $this->morphedByMany('App\\Models\\Event\\Person\\EventHost', 'persona', 'pivot_persona_org', 'organization_id', 'persona_id');\n }", "function get_viewed_hosts($perm, $groupid = 0, $options = array(), $nodeid = null, $sql = array()) {\n\tglobal $USER_DETAILS, $page;\n\n\t$userid = $USER_DETAILS['userid'];\n\n\t$def_sql = array(\n\t\t// hostname to avoid confusion with node name\n\t\t'select' => array('h.hostid','h.name as hostname'),\n\t\t'from' => array('hosts h'),\n\t\t'where' => array(),\n\t\t'order' => array()\n\t);\n\n\t$def_options = array(\n\t\t'deny_all' =>\t\t\t\t\t\t0,\n\t\t'allow_all' =>\t\t\t\t\t\t0,\n\t\t'select_first_host' =>\t\t\t\t0,\n\t\t'select_first_host_if_empty' =>\t\t0,\n\t\t'do_not_select' =>\t\t\t\t\t0,\n\t\t'do_not_select_if_empty' =>\t\t\t0,\n\t\t'monitored_hosts' =>\t\t\t\t0,\n\t\t'templated_hosts' =>\t\t\t\t0,\n\t\t'real_hosts' =>\t\t\t\t\t\t0,\n\t\t'not_proxy_hosts' =>\t\t\t\t0,\n\t\t'with_items' =>\t\t\t\t\t\t0,\n\t\t'with_monitored_items' =>\t\t\t0,\n\t\t'with_historical_items' =>\t\t\t0,\n\t\t'with_triggers' =>\t\t\t\t\t0,\n\t\t'with_monitored_triggers' =>\t\t0,\n\t\t'with_httptests' =>\t\t\t\t\t0,\n\t\t'with_monitored_httptests' =>\t\t0,\n\t\t'with_graphs' =>\t\t\t\t\t0,\n\t\t'only_current_node' =>\t\t\t\t0\n\t);\n\n\t$def_options = zbx_array_merge($def_options, $options);\n\n\t$config = select_config();\n\n\t$dd_first_entry = $config['dropdown_first_entry'];\n\tif ($def_options['allow_all']) {\n\t\t$dd_first_entry = ZBX_DROPDOWN_FIRST_ALL;\n\t}\n\tif ($def_options['deny_all']) {\n\t\t$dd_first_entry = ZBX_DROPDOWN_FIRST_NONE;\n\t}\n\n\t$result = array('original' => -1, 'selected' => 0, 'hosts' => array(), 'hostids' => array());\n\t$hosts = &$result['hosts'];\n\t$hostids = &$result['hostids'];\n\n\t$first_entry = ($dd_first_entry == ZBX_DROPDOWN_FIRST_NONE) ? _('not selected') : _('all');\n\n\t$hosts['0'] = $first_entry;\n\n\tif (!is_array($groupid) && ($groupid == 0)) {\n\t\tif ($dd_first_entry == ZBX_DROPDOWN_FIRST_NONE) {\n\t\t\treturn $result;\n\t\t}\n\t}\n\telse {\n\t\tzbx_value2array($groupid);\n\n\t\t$def_sql['from'][] = 'hosts_groups hg';\n\t\t$def_sql['where'][] = dbConditionInt('hg.groupid',$groupid);\n\t\t$def_sql['where'][] = 'hg.hostid=h.hostid';\n\t}\n\n\t$_REQUEST['hostid'] = $result['original'] = get_request('hostid', -1);\n\n\tif (is_null($nodeid)) {\n\t\tif (!$def_options['only_current_node']) {\n\t\t\t$nodeid = get_current_nodeid();\n\t\t}\n\t\telse {\n\t\t\t$nodeid = get_current_nodeid(false);\n\t\t}\n\t}\n\n\tif (USER_TYPE_SUPER_ADMIN != $USER_DETAILS['type']) {\n\t\t$userGroups = getUserGroupsByUserId($userid);\n\n\t\t$def_sql['where'][] = 'EXISTS ('.\n\t\t\t\t'SELECT NULL'.\n\t\t\t\t' FROM hosts_groups hgg'.\n\t\t\t\t\t' JOIN rights r'.\n\t\t\t\t\t\t' ON r.id=hgg.groupid'.\n\t\t\t\t\t\t\t' AND '.dbConditionInt('r.groupid', $userGroups).\n\t\t\t\t' WHERE h.hostid=hgg.hostid'.\n\t\t\t\t' GROUP BY hgg.hostid'.\n\t\t\t\t' HAVING MIN(r.permission)>='.$perm.\n\t\t\t\t')';\n\t}\n\n\t// nodes\n\tif (ZBX_DISTRIBUTED) {\n\t\t$def_sql['select'][] = 'n.name';\n\t\t$def_sql['from'][] = 'nodes n';\n\t\t$def_sql['where'][] = 'n.nodeid='.DBid2nodeid('h.hostid');\n\t\t$def_sql['order'][] = 'n.name';\n\t}\n\n\t// hosts\n\tif ($def_options['monitored_hosts']) {\n\t\t$def_sql['where'][] = 'h.status='.HOST_STATUS_MONITORED;\n\t}\n\telseif ($def_options['real_hosts']) {\n\t\t$def_sql['where'][] = 'h.status IN('.HOST_STATUS_MONITORED.','.HOST_STATUS_NOT_MONITORED.')';\n\t}\n\telseif ($def_options['templated_hosts']) {\n\t\t$def_sql['where'][] = 'h.status='.HOST_STATUS_TEMPLATE;\n\t}\n\telseif ($def_options['not_proxy_hosts']) {\n\t\t$def_sql['where'][] = 'h.status<>'.HOST_STATUS_PROXY;\n\t}\n\n\t// items\n\tif ($def_options['with_items']) {\n\t\t$def_sql['where'][] = 'EXISTS (SELECT NULL FROM items i WHERE h.hostid=i.hostid )';\n\t}\n\telseif ($def_options['with_monitored_items']) {\n\t\t$def_sql['where'][] = 'EXISTS (SELECT NULL FROM items i WHERE h.hostid=i.hostid AND i.status='.ITEM_STATUS_ACTIVE.')';\n\t}\n\telseif ($def_options['with_historical_items']) {\n\t\t$def_sql['where'][] = 'EXISTS (SELECT NULL FROM items i WHERE h.hostid=i.hostid AND (i.status='.ITEM_STATUS_ACTIVE.' OR i.status='.ITEM_STATUS_NOTSUPPORTED.') AND i.lastvalue IS NOT NULL)';\n\t}\n\n\t// triggers\n\tif ($def_options['with_triggers']) {\n\t\t$def_sql['where'][] = 'EXISTS (SELECT NULL'.\n\t\t\t\t\t\t\t\t\t\t' FROM items i,functions f,triggers t'.\n\t\t\t\t\t\t\t\t\t\t' WHERE i.hostid=h.hostid'.\n\t\t\t\t\t\t\t\t\t\t\t' AND i.itemid=f.itemid'.\n\t\t\t\t\t\t\t\t\t\t\t' AND f.triggerid=t.triggerid)';\n\t}\n\telseif ($def_options['with_monitored_triggers']) {\n\t\t$def_sql['where'][] = 'EXISTS (SELECT NULL'.\n\t\t\t\t\t\t\t\t\t\t' FROM items i,functions f,triggers t'.\n\t\t\t\t\t\t\t\t\t\t' WHERE i.hostid=h.hostid'.\n\t\t\t\t\t\t\t\t\t\t\t' AND i.status='.ITEM_STATUS_ACTIVE.\n\t\t\t\t\t\t\t\t\t\t\t' AND i.itemid=f.itemid'.\n\t\t\t\t\t\t\t\t\t\t\t' AND f.triggerid=t.triggerid'.\n\t\t\t\t\t\t\t\t\t\t\t' AND t.status='.TRIGGER_STATUS_ENABLED.')';\n\t}\n\n\t// httptests\n\tif ($def_options['with_httptests']) {\n\t\t$def_sql['where'][] = 'EXISTS (SELECT NULL'.\n\t\t\t\t\t\t\t\t\t\t' FROM applications a,httptest ht'.\n\t\t\t\t\t\t\t\t\t\t' WHERE a.hostid=h.hostid'.\n\t\t\t\t\t\t\t\t\t\t\t' AND ht.applicationid=a.applicationid)';\n\t}\n\telseif ($def_options['with_monitored_httptests']) {\n\t\t$def_sql['where'][] = 'EXISTS (SELECT NULL'.\n\t\t\t\t\t\t\t\t\t\t' FROM applications a,httptest ht'.\n\t\t\t\t\t\t\t\t\t\t' WHERE a.hostid=h.hostid'.\n\t\t\t\t\t\t\t\t\t\t\t' AND ht.applicationid=a.applicationid'.\n\t\t\t\t\t\t\t\t\t\t\t' AND ht.status='.HTTPTEST_STATUS_ACTIVE.')';\n\t}\n\n\t// graphs\n\tif ($def_options['with_graphs']) {\n\t\t$def_sql['where'][] = 'EXISTS (SELECT NULL'.\n\t\t\t\t\t\t\t\t\t\t' FROM items i,graphs_items gi'.\n\t\t\t\t\t\t\t\t\t\t' WHERE i.hostid=h.hostid'.\n\t\t\t\t\t\t\t\t\t\t\t' AND i.itemid=gi.itemid)';\n\t}\n\n\t$def_sql['order'][] = 'h.name';\n\n\tforeach ($sql as $key => $value) {\n\t\tzbx_value2array($value);\n\n\t\tif (isset($def_sql[$key])) {\n\t\t\t$def_sql[$key] = zbx_array_merge($def_sql[$key], $value);\n\t\t}\n\t\telse {\n\t\t\t$def_sql[$key] = $value;\n\t\t}\n\t}\n\n\t$def_sql['select'] = array_unique($def_sql['select']);\n\t$def_sql['from'] = array_unique($def_sql['from']);\n\t$def_sql['where'] = array_unique($def_sql['where']);\n\t$def_sql['order'] = array_unique($def_sql['order']);\n\n\t$sql_select = '';\n\t$sql_from = '';\n\t$sql_where = '';\n\t$sql_order = '';\n\tif (!empty($def_sql['select'])) {\n\t\t$sql_select .= implode(',', $def_sql['select']);\n\t}\n\tif (!empty($def_sql['from'])) {\n\t\t$sql_from .= implode(',', $def_sql['from']);\n\t}\n\tif (!empty($def_sql['where'])) {\n\t\t$sql_where .= ' AND '.implode(' AND ', $def_sql['where']);\n\t}\n\tif (!empty($def_sql['order'])) {\n\t\t$sql_order .= implode(',', $def_sql['order']);\n\t}\n\n\t$res = DBselect(\n\t\t'SELECT DISTINCT '.$sql_select.\n\t\t' FROM '.$sql_from.\n\t\t' WHERE '.DBin_node('h.hostid', $nodeid).\n\t\t\t$sql_where.\n\t\t' ORDER BY '.$sql_order\n\t);\n\twhile ($host = DBfetch($res)) {\n\t\t$hosts[$host['hostid']] = $host['hostname'];\n\t\t$hostids[$host['hostid']] = $host['hostid'];\n\n\t\tif (bccomp($_REQUEST['hostid'], $host['hostid']) == 0) {\n\t\t\t$result['selected'] = $host['hostid'];\n\t\t}\n\t}\n\n\t$profile_hostid = CProfile::get('web.'.$page['menu'].'.hostid');\n\n\tif ($def_options['do_not_select']) {\n\t\t$_REQUEST['hostid'] = $result['selected'] = 0;\n\t}\n\telseif ($def_options['do_not_select_if_empty'] && $_REQUEST['hostid'] == -1) {\n\t\t$_REQUEST['hostid'] = $result['selected'] = 0;\n\t}\n\telseif ($def_options['select_first_host']\n\t\t\t\t|| ($def_options['select_first_host_if_empty'] && $_REQUEST['hostid'] == -1 && is_null($profile_hostid))) {\n\t\t$first_hostid = next($hostids);\n\t\treset($hostids);\n\n\t\tif ($first_hostid !== false) {\n\t\t\t$_REQUEST['hostid'] = $result['selected'] = $first_hostid;\n\t\t}\n\t\telse {\n\t\t\t$_REQUEST['hostid'] = $result['selected'] = 0;\n\t\t}\n\t}\n\telse {\n\t\tif ($config['dropdown_first_remember']) {\n\t\t\tif ($_REQUEST['hostid'] == -1) {\n\t\t\t\t$_REQUEST['hostid'] = is_null($profile_hostid) ? '0' : $profile_hostid;\n\t\t\t}\n\n\t\t\tif (isset($hostids[$_REQUEST['hostid']])) {\n\t\t\t\t$result['selected'] = $_REQUEST['hostid'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$_REQUEST['hostid'] = $result['selected'];\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$_REQUEST['hostid'] = $result['selected'];\n\t\t}\n\t}\n\n\treturn $result;\n}", "public function getHosts() {\n $hosts = array();\n foreach ($this->shareData[\"hosts\"] as $nick => $sessionID) {\n $hosts[$nick] = new Client($this->memcache, $sessionID);\n }\n return $hosts;\n }", "public function getHosts()\n {\n return isset($this->Hosts) ? $this->Hosts : null;\n }", "function _getNodeMappingAccessInfo($fqhostname)\n{\n\t// the NODE, NODE_MAPPING and OO_REMOTE_LOCATION table to \n\t// determine which CaaS HPSA nodes to use for access the CaaS node\n\t//\n\t// Input: $fqhostname - fully qualified hostname of node being monitored\n\t// Output: $hpsaNodes - array containing the following HPSA access info:\n\t//\t\t\t\t\t\t- PRIORITY_CD - priority for access. 1 = first, 2 = second\n\t//\t\t\t\t\t\t- SERVER_IP\t- HPSA server IP\n\t//\t\t\t\t\t\t- SERVER_PORT - HPSA server port\n\t//\t\t\t\t\t\t- USERNAME - username for HPSA connection\n\t//\t\t\t\t\t\t- PASSWORD - password for HPSA connection\n\t//\t\t\t\t\t\t- ROSH_USER\t- username for ogsh/rosh operations within HPSA\n\t//\n\t_log(\"getNodeMappingAccessInfo: Starting.\",\"info\");\n\t_log(\"getNodeMappingAccessInfo: Looking up HPSA server(s) for fqhostname = $fqhostname.\",\"info\");\n\tglobal $dwhDbConn, $caasnode;\n\t\t\n\t$sql = \"SELECT RA.PRIORITY_CD, RA.SERVER_IP, RA.SERVER_PORT, RA.USERNAME, RA.PASSWORD, NVL(NM.SA_USER_NAME, 'none') ROSH_USER \";\n\t$sql .= \"FROM TMSFPDW1.NODE N \";\n\t$sql .= \"JOIN TMSFPDW1.NODE_MAPPING NM on NM.NODE_ID = N.NODE_ID \";\n\t$sql .= \"JOIN TMSFPDW1.OO_REMOTE_ACCESS_LOCATION RA ON RA.MESH_ID = NM.MESH_ID \";\n\t$sql .= \"WHERE N.END_DATE IS NULL \";\n $sql .= \"AND RA.SERVER_PORT = '2222' \";\n\t$sql .= \"AND RA.PRIORITY_CD IS NOT NULL \";\n $sql .= \"AND N.NODE_NAME = '$fqhostname' \";\n\t$sql .= \"order by RA.priority_cd asc \";\n\n\t_log(\"getNodeMappingAccessInfo: sql: $sql\",\"info\");\n\t$stmt = oci_parse($dwhDbConn, $sql);\n\toci_execute($stmt);\n\t$hpsaNodes = array();\n\twhile ($r = oci_fetch_array($stmt, OCI_ASSOC+OCI_RETURN_LOBS))\n\t{\n\t array_push($hpsaNodes, $r);\n\t}\n\n\t_log(\"getNodeMappingAccessInfo: Exiting.\",\"info\");\n\treturn $hpsaNodes;\n}", "function _getNodeAccessInfo($fqhostname)\n{\n\t// the OO_REMOTE_ACCESS_LOCATION table to determine which CaaS\n\t// HPSA nodes to use for access the CaaS node \n\t//\n\t// Input: $fqhostname - fully qualified hostname of node being monitored\n\t// Output: $hpsaNodes - array containing the following HPSA access info:\n\t//\t\t\t\t\t\t- PRIORITY_CD - priority for access. 1 = first, 2 = second\n\t//\t\t\t\t\t\t- SERVER_IP\t- HPSA server IP\n\t//\t\t\t\t\t\t- SERVER_PORT - HPSA server port\n\t//\t\t\t\t\t\t- USERNAME - username for HPSA connection\n\t//\t\t\t\t\t\t- PASSWORD - password for HPSA connection\n\t//\t\t\t\t\t\t- ROSH_USER\t- username for ogsh/rosh operations within HPSA\n\t//\n\t_log(\"getNodeAccessInfo: Starting.\",\"info\");\n\t_log(\"getNodeAccessInfo: Looking up HPSA server(s) for fqhostname = $fqhostname.\",\"info\");\n\tglobal $dwhDbConn, $caasnode;\n\t\t\n\tif (preg_match(\"/[a-z0-9]+\\.[a-z0-9]+\\.([a-z0-9]+)\\.vzbi\\.caas/\", $fqhostname, $matches))\n\t{\n\t\t$caasLoc = \"$matches[1]\";\n\t\t_log(\"getNodeAccessInfo: caasLoc = $caasLoc.\",\"info\");\n\t} \n\telse\n\t{\n\t\t_log(\"-----Failed to process node ($caasnode): Unable to determine CaaS facility from fqhostname.\",\"SUMMARY\");\n\t\t_logProvsionEndToDb(0,\"Failed to process node: Unable to determine CaaS facility from fqhostname.\");\n\t\t_exit1(\"Exiting at getNodeAccessInfo: Unable to determine CaaS facility from fqhostname.\",\"info\");\n\t}\n\n\t$sql = \"SELECT RA.PRIORITY_CD, RA.SERVER_IP, RA.SERVER_PORT, RA.USERNAME, RA.PASSWORD, 'none' ROSH_USER \";\n\t$sql .= \"FROM TMSFPDW1.OO_REMOTE_ACCESS_LOCATION RA \";\n\t$sql .= \"WHERE RA.SERVER_PORT = '2222' \";\n\t$sql .= \"AND RA.PRIORITY_CD IS NOT NULL \";\n\t$sql .= \"AND RA.MESH_ID = '$caasLoc' \";\n\t$sql .= \"ORDER BY RA.PRIORITY_CD ASC\";\n\n\t_log(\"getNodeAccessInfo: sql: $sql\",\"info\");\n\t$stmt = oci_parse($dwhDbConn, $sql);\n\toci_execute($stmt);\n\t$hpsaNodes = array();\n\twhile ($r = oci_fetch_array($stmt, OCI_ASSOC+OCI_RETURN_LOBS))\n\t{\n\t\tarray_push($hpsaNodes, $r);\n\t}\n\t$num = count($hpsaNodes);\n\tif ($num > 0)\n\t{\n\t\t_log(\"getNodeAccessInfo: num HPSA servers returned: $num.\",\"debug\");\n\t}\n\telse\n\t{\n\t\t_log(\"-----Failed to process node ($caasnode): Unable to find HPSA access info for server.\",\"SUMMARY\");\n\t\t_logProvsionEndToDb(0,\"Failed to process node: Unable to find HPSA access info for server.\");\n\t\t_exit1(\"Exiting at getNodeAccessInfo: Unable to find HPSA access info for server.\",\"info\");\n\t}\n\n\t_log(\"getNodeAccessInfo: Exiting.\",\"info\");\n\treturn $hpsaNodes;\n}", "function virtual_hosting_db_gethostnames($vroot = NULL)\n{\n $PHORUM = $GLOBALS[\"PHORUM\"];\n\n $sql = \"\n SELECT hostname,vroot\n FROM {$PHORUM[\"virtual_hosts_table\"]}\n \";\n if ($vroot !== NULL) {\n settype($vroot, \"int\");\n $sql .= \" WHERE vroot = $vroot\";\n }\n\n $return = phorum_db_interact(DB_RETURN_ROWS, $sql, 0);\n foreach ($return as $id => $row) $return[$id] = $row[1];\n\n return $return;\n}", "function get_domain_properties ($domain)\n{\n $list = \"\";\n \n $result = db_query (\"SELECT * FROM alias WHERE domain='$domain'\");\n $list['alias_count'] = $result['rows'];\n \n $result = db_query (\"SELECT * FROM mailbox WHERE domain='$domain'\");\n $list['mailbox_count'] = $result['rows'];\n $list['alias_count'] = $list['alias_count'] - $list['mailbox_count'];\n \n $result = db_query (\"SELECT * FROM domain WHERE domain='$domain'\");\n $row = mysql_fetch_array ($result['result']);\n $list['description'] = $row['description'];\n $list['aliases'] = $row['aliases'];\n $list['mailboxes'] = $row['mailboxes'];\n $list['maxquota'] = $row['maxquota'];\n $list['created'] = $row['created'];\n $list['modified'] = $row['modified'];\n $list['active'] = $row['active'];\n\n return $list;\n}", "function gethostbyname($hostname)\n{\n}", "static function getHostsByIP( $ip ) {\n\t\tglobal $wgAuth;\n\t\tglobal $wgOpenStackManagerLDAPInstanceBaseDN;\n\n\t\t$result = LdapAuthenticationPlugin::ldap_search( $wgAuth->ldapconn, $wgOpenStackManagerLDAPInstanceBaseDN, '(arecord=' . $ip . ')' );\n\t\t$hostsInfo = LdapAuthenticationPlugin::ldap_get_entries( $wgAuth->ldapconn, $result );\n\t\tif ( $hostsInfo[\"count\"] == \"0\" ) {\n\t\t\treturn array();\n\t\t} else {\n\t\t\t$hosts = array();\n\t\t\tarray_shift( $hostsInfo );\n\t\t\tforeach ( $hostsInfo as $host ) {\n\t\t\t\t$hostname = $host['dc'][0];\n\t\t\t\t$domainname = explode( '.', $host['associateddomain'][0] );\n\t\t\t\t$domainname = $domainname[1];\n\t\t\t\t$domain = OpenStackNovaDomain::getDomainByName( $domainname );\n\t\t\t\t$hostObject = OpenStackNovaHost::getHostByName( $hostname, $domain );\n\t\t\t\tif ( $hostObject ) {\n\t\t\t\t\t$hosts[] = $hostObject;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $hosts;\n\t\t}\n\t}" ]
[ "0.62887985", "0.62135774", "0.61559325", "0.6122984", "0.6037537", "0.6022453", "0.5998098", "0.56702334", "0.5631588", "0.56258726", "0.56205183", "0.5604602", "0.55636513", "0.549985", "0.549935", "0.54893917", "0.54100984", "0.5390518", "0.53769034", "0.53568274", "0.5338064", "0.5330843", "0.5311088", "0.52936053", "0.5259021", "0.5255606", "0.5237191", "0.52135", "0.5192454", "0.51837176" ]
0.7252987
0
Gets assigned dns domains for the transferred object id
public function get_assigned_dns_domain($p_obj_id = null, $p_id = null) { if (empty($p_obj_id) && empty($p_id)) { return false; } // if $l_condition = ''; $l_sql = 'SELECT dnstable.isys_net_dns_domain__id, dnstable.isys_net_dns_domain__title FROM isys_cats_net_list_2_isys_net_dns_domain AS main INNER JOIN isys_net_dns_domain dnstable ON main.isys_net_dns_domain__id = dnstable.isys_net_dns_domain__id'; if ($p_obj_id > 0) { $l_condition = ' WHERE main.isys_cats_net_list__id = (SELECT isys_cats_net_list__id FROM isys_cats_net_list WHERE isys_cats_net_list__isys_obj__id = ' . $this->convert_sql_id( $p_obj_id ) . ')'; } // if if ($p_id > 0) { $l_condition = ' WHERE main.isys_cats_net_list__id = ' . $this->convert_sql_id($p_id); } // if return $this->retrieve($l_sql . $l_condition . ';'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_assigned_hosts_with_dns($p_obj_id, $p_record_status = C__RECORD_STATUS__NORMAL)\n {\n if (empty($p_obj_id))\n {\n return false;\n } // if\n\n $l_sql = 'SELECT\n\t\t\tmain.isys_catg_ip_list__isys_ip_assignment__id,\n\t\t\tmain.isys_catg_ip_list__isys_ipv6_assignment__id,\n\t\t\tmain.isys_catg_ip_list__isys_cats_net_ip_addresses_list__id,\n\t\t\tisys_cats_net_ip_addresses_list__isys_ip_assignment__id,\n\t\t\tmain.isys_catg_ip_list__id,\n\t\t\tisys_obj__id,\n\t\t\tisys_obj__title,\n\t\t\tisys_obj_type__title,\n\t\t\tisys_cats_net_ip_addresses_list__title,\n\t\t\tmain.isys_catg_ip_list__hostname,\n\t\t\tdnstable.isys_net_dns_domain__id,\n\t\t\tdnstable.isys_net_dns_domain__title\n\t\t\tFROM isys_catg_ip_list AS main\n\t\t\tLEFT JOIN isys_cats_net_ip_addresses_list ON main.isys_catg_ip_list__isys_cats_net_ip_addresses_list__id = isys_cats_net_ip_addresses_list__id\n\t\t\tLEFT JOIN isys_obj ON isys_obj__id = main.isys_catg_ip_list__isys_obj__id\n\t\t\tLEFT JOIN isys_obj_type ON isys_obj_type__id = isys_obj__isys_obj_type__id\n\t\t\tLEFT JOIN isys_catg_ip_list_2_isys_net_dns_domain AS sub ON sub.isys_catg_ip_list__id = main.isys_catg_ip_list__id\n\t\t\tLEFT JOIN isys_net_dns_domain AS dnstable ON sub.isys_net_dns_domain__id = dnstable.isys_net_dns_domain__id\n\t\t\tWHERE isys_cats_net_ip_addresses_list__isys_obj__id = ' . $this->convert_sql_id($p_obj_id) . '\n\t\t\tAND isys_obj__status = ' . $this->convert_sql_int($p_record_status) . '\n\t\t\tAND main.isys_catg_ip_list__status = ' . $this->convert_sql_int($p_record_status) . '\n\t\t\tORDER BY isys_cats_net_ip_addresses_list__ip_address_long ASC;';\n\n return $this->retrieve($l_sql);\n }", "function get_domains() {\n\t\tif ( !empty( $this->_config['cname'] ) ) {\n\t\t\treturn (array) $this->_config['cname'];\n\t\t} elseif ( !empty( $this->_config['id'] ) ) {\n\t\t\t$domain = sprintf( '%s.cloudfront.net', $this->_config['id'] );\n\n\t\t\treturn array(\n\t\t\t\t$domain\n\t\t\t);\n\t\t}\n\n\t\treturn array();\n\t}", "public function get_assigned_dns_server($p_cat_id = null, $p_obj_id = null)\n {\n if (empty($p_cat_id) && empty($p_connected_obj_id))\n {\n return [];\n } // if\n\n $l_arr = [];\n $l_sql = 'SELECT * FROM isys_cats_net_list_2_isys_catg_ip_list ';\n\n if (!empty($p_cat_id) && empty($p_obj_id))\n {\n $l_sql .= 'WHERE isys_cats_net_list__id = ' . $this->convert_sql_id($p_cat_id) . ';';\n }\n else if (empty($p_cat_id) && !empty($p_obj_id))\n {\n $l_sql .= 'WHERE isys_cats_net_list__id = (SELECT isys_cats_net_list__id FROM isys_cats_net_list WHERE isys_cats_net_list__isys_obj__id = ' . $this->convert_sql_id(\n $p_obj_id\n ) . ');';\n } // if\n\n $l_res = $this->retrieve($l_sql);\n\n if (count($l_res) > 0)\n {\n while ($l_row = $l_res->get_row())\n {\n $l_arr[] = $l_row['isys_catg_ip_list__id'];\n } // while\n } // if\n\n return $l_arr;\n }", "function getAssociatedDomains() {\n\t\t$associateddomain = array();\n\t\tif ( isset( $this->hostInfo[0]['associateddomain'] ) ) {\n\t\t\t$associateddomain = $this->hostInfo[0]['associateddomain'];\n\t\t\tarray_shift( $associateddomain );\n\t\t}\n\n\t\treturn $associateddomain;\n\t}", "public function get_domains()\n\t{\n\t\treturn $this->domains;\n\t}", "public function getAllDomains();", "public function get_domains_list() {\n \n }", "function GetDomains()\n{\n global $oDB;\n $arr = array();\n $oDB->Query( 'SELECT id,title FROM '.TABDOMAIN.' ORDER BY titleorder' );\n while ( $row = $oDB->Getrow() )\n {\n $arr[$row['id']] = $row['title'];\n }\n // search translation\n $arrL = cLang::GetName('domain',$_SESSION[QT]['lang_iso'],'*');\n if ( count($arrL)>0)\n {\n foreach ($arr as $id => $str)\n {\n if ( array_key_exists('d'.$id,$arrL) )\n {\n if ( !empty($arrL['d'.$id]) ) $arr[$id]=$arrL['d'.$id];\n }\n }\n }\n return $arr;\n}", "public function getDomainList()\r\n\t{\r\n\t\t$request = Requests::get($this->url . '/api/domain/list', array('Api-Session-Token' => $this->session_token));\r\n\t\t$data = json_decode($request->body, TRUE);\t\r\n\t\treturn $data['domains'];\r\n\t}", "function domains() {\n $parameters = array(\n 'method' => __FUNCTION__\n );\n return $this->get_data($parameters);\n }", "public function getDomain($id)\n {\n return $this->_execute('/domain/' . $id . '/', self::METHOD_GET);\n }", "public function get_assigned_hosts($p_objectID)\n {\n $l_return = [];\n $l_dataRes = isys_cmdb_dao_category_g_nagios_refs_services_backwards::instance($this->get_database_component())\n ->get_data(null, $p_objectID);\n\n if (count($l_dataRes) > 0)\n {\n while ($l_row = $l_dataRes->get_row())\n {\n $l_tmp = $this->get_object_by_id($l_row['isys_catg_nagios_refs_services_list__isys_obj__id__host'], true)\n ->get_row();\n\n /**\n * @var $l_dao isys_cmdb_dao_object_type\n */\n $l_dao = isys_cmdb_dao_object_type::factory($this->get_database_component());\n if ($l_dao->has_cat($l_tmp['isys_obj__isys_obj_type__id'], ['C__CATG__NAGIOS_HOST_FOLDER']))\n {\n $l_return[$l_row['isys_catg_nagios_refs_services_list__id']] = $l_tmp['isys_obj__title'];\n } // if\n } // while\n } // if\n\n return $l_return;\n }", "public function getDomains(): array\n {\n return $this->domainsArray;\n }", "function get_dns_servers() {\n\treturn get_dns_nameservers(false, true);\n}", "function all_domain(){\n\t\t$domainlist = array();\n\t\t//设置缓存失效\n\t\t$key = Cache::key('cdomain');\n\t\t$domainlist = $this->_cache->hGetAll($key);\n\t\tif (empty($domainlist)) {\n\t\t\t$temparr = $this->_db->getAll(\"SELECT c.`domain`,cm.* FROM `company` c LEFT JOIN `company_mysql` cm ON c.`comp_id`=cm.`comp_id` WHERE c.`status`='1'\");\t\n\t\t\t$this->_cache->multi($key);\n\t\t\tforeach ($temparr as $value) {\n\t\t\t\t$resutl = $this->_cache->hset($key,$value['domain'],$value);\n\t\t\t\t$domainlist[$value['domain']] = serialize($value);\n\t\t\t}\n\t\t\t$this->_cache->exec($key);\n\t\t}\n\t\treturn $domainlist;\n\t}", "public function getDomains()\r\n\t{\r\n\t\t$res = $this->doRequest(MogileFS::GET_DOMAINS);\r\n\r\n\t\t$domains = Array();\r\n\t\tfor($i=1; $i <= $res['domains']; $i++)\r\n\t\t{\r\n\t\t\t$dom = 'domain'.$i;\r\n\t\t\t$classes = Array();\r\n\t\t\tfor($j=1; $j <= $res[$dom.'classes']; $j++)\r\n\t\t\t$classes[$res[$dom.'class'.$j.'name']] = $res[$dom.'class'.$j.'mindevcount'];\r\n\t\t\t$domains[] = Array('name' => $res[$dom],'classes' => $classes);\r\n\t\t}\r\n\t\treturn $domains;\r\n\t}", "function getDomainList( $config ) {\n\ttry {\n\t\t$command = Namecheap\\Api::factory( $config, 'domains.getList' );\n\t\t$command->dispatch();\n\t} catch ( \\Exception $e ) {\n\t\tdie( $e->getMessage() );\n\t}\n\n\treturn $command->domains;\n}", "public function getDomains($viewId) {\n\t\tif ($this->settings['includeCHServices'] && $this->settings['eCHcommunityID'] !== '00-00') {\n\t\t\t$domainsCommunity = $this->_getDomains($viewId, FALSE);\n\t\t\t$domains = $domainsCommunity;\n\t\t\t$domainsCH = $this->_getDomains($viewId, TRUE);\n\n\t\t\tif (is_array($domainsCH)) {\n\t\t\t\tforeach ($domainsCH as $domain) {\n\t\t\t\t\t\t// Key used to remove duplicates\n\t\t\t\t\t$domains[$domain['id']] = $domain;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$domains = $this->_getDomains($viewId, FALSE);\n\t\t}\n\n\t\t$domains = is_array($domains) ? $domains : array();\n\n\t\t\t// Sort topics by (localized) name\n\t\t$this->sort($domains, 'name');\n\n\t\t$this->callHooks(\n\t\t\t'domains',\n\t\t\tarray(\n\t\t\t\t'viewId' => $viewId,\n\t\t\t),\n\t\t\t$domains\n\t\t);\n\n\t\treturn $domains;\n\t}", "public function get_dns_domains($p_filter = '')\n {\n return $this->retrieve(\n 'SELECT * FROM isys_net_dns_domain WHERE isys_net_dns_domain__status = ' . $this->convert_sql_int(C__RECORD_STATUS__NORMAL) . ' ' . $p_filter . ';'\n );\n }", "function domains() {\n\t \treturn $this->hook(\"/{$this->subject_slug}/v1/domains.xml?api_key={$this->api_key}\",\"domain\");\n\t}", "private function getDomainList() {\n\t\t$rawDomain = GetGlobalData(\"GoogleDomain\", \"\");\n\t\t$domainList = explode(',', $rawDomain);\n\t\t$result = array();\n\t\tforeach($domainList as $domain) {\n\t\t\t$trimDomain = trim($domain);\n\t\t\tif ( $trimDomain ) {\n\t\t\t\t$result[] = $trimDomain; \n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "function getDomain()\n {\n }", "function get_branded_domain_id_option() {\n $options = get_option('sbrb_settings');\n $domain = $options['sbrb_domain_id'];\n\n if( isset($domain) || $domain != '') {\n return array('id' => $domain);\n } else {\n return;\n }\n }", "function domains_list($how){\n $res = array();\n switch($how){\n case 0: return array_keys($this->domains);\n case 1: \n foreach($this->domains as $key=>$dom) $res[$key] = get_class($dom);\n return $res;\n\n case 2: \n foreach($this->domains as $key=>$dom) $res[$key] = $dom->connected();\n return $res;\n\n case 3: \n foreach($this->domains as $key=>$dom) $res[$key] = $dom->label();\n return $res;\n\n }\n }", "public function load()\n {\n return $this->domains;\n }", "function list_domains ()\n{\n $list = \"\";\n \n $result = db_query (\"SELECT * FROM domain ORDER BY domain\");\n if ($result['rows'] > 0)\n {\n $i = 0;\n while ($row = mysql_fetch_array ($result['result']))\n {\n $list[$i] = $row['domain'];\n $i++;\n }\n }\n return $list;\n}", "public function callback_property_dns_domain(isys_request $p_request)\n {\n $l_cat_list = [];\n $l_res_dns_domain = $this->get_dns_domains();\n\n while ($l_row_dns_domain = $l_res_dns_domain->get_row())\n {\n $l_cat_list[] = [\n \"caption\" => $l_row_dns_domain['isys_net_dns_domain__title'],\n \"value\" => $l_row_dns_domain['isys_net_dns_domain__id']\n ];\n } // while\n\n return $l_cat_list;\n }", "public function getDomain()\n {\n\n }", "public function getDomain()\n {\n if (!$this->_domain) {\n try {\n $this->_domain = \\Ca\\Db\\DomainMap::create()->find($this->getDomainId());\n } catch (\\Exception $e) {}\n }\n return $this->_domain;\n }", "function list_domains_for_admin ($username)\n{\n $list = \"\";\n \n $result = db_query (\"SELECT * FROM domain LEFT JOIN domain_admins ON domain.domain=domain_admins.domain WHERE domain_admins.username='$username' AND domain.active='1' ORDER BY domain_admins.domain\");\n if ($result['rows'] > 0)\n {\n $i = 0;\n while ($row = mysql_fetch_array ($result['result']))\n {\n $list[$i] = $row['domain'];\n $i++;\n }\n }\n return $list;\n}" ]
[ "0.64997476", "0.64413786", "0.640207", "0.6337254", "0.6218609", "0.6135152", "0.61317605", "0.60709184", "0.60122436", "0.585917", "0.58072436", "0.5803502", "0.57660216", "0.5724166", "0.571528", "0.5691511", "0.56851906", "0.568245", "0.56753904", "0.5635138", "0.5626083", "0.55982614", "0.55897856", "0.5558729", "0.5555422", "0.5524972", "0.55241597", "0.5518489", "0.547742", "0.5458329" ]
0.68044823
0
Gets all existing dns domains with a normal status.
public function get_dns_domains($p_filter = '') { return $this->retrieve( 'SELECT * FROM isys_net_dns_domain WHERE isys_net_dns_domain__status = ' . $this->convert_sql_int(C__RECORD_STATUS__NORMAL) . ' ' . $p_filter . ';' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllDomains();", "public function list($expired = false) \n\t{\n\t\treturn $this->api->call(['command' => ($expired ? 'GetExpiredDomains' : 'GetDomains')])->response();\n\t}", "public function getDomainList()\r\n\t{\r\n\t\t$request = Requests::get($this->url . '/api/domain/list', array('Api-Session-Token' => $this->session_token));\r\n\t\t$data = json_decode($request->body, TRUE);\t\r\n\t\treturn $data['domains'];\r\n\t}", "static function getDomainList()\n {\n $currentuser = ctrl_users::GetUserDetail();\n $res = array();\n $domains = self::ListDomains($currentuser['userid']);\n if (!fs_director::CheckForEmptyValue($domains)) {\n foreach ($domains as $row) {\n $status = self::getDomainStatusHTML($row['active'], $row['id']);\n $res[] = array('name' => $row['name'],\n 'directory' => $row['directory'],\n 'active' => $row['active'],\n 'status' => $status,\n 'id' => $row['id']);\n }\n return $res;\n } else {\n return false;\n }\n }", "public function get_domains_list() {\n \n }", "function all_domain(){\n\t\t$domainlist = array();\n\t\t//设置缓存失效\n\t\t$key = Cache::key('cdomain');\n\t\t$domainlist = $this->_cache->hGetAll($key);\n\t\tif (empty($domainlist)) {\n\t\t\t$temparr = $this->_db->getAll(\"SELECT c.`domain`,cm.* FROM `company` c LEFT JOIN `company_mysql` cm ON c.`comp_id`=cm.`comp_id` WHERE c.`status`='1'\");\t\n\t\t\t$this->_cache->multi($key);\n\t\t\tforeach ($temparr as $value) {\n\t\t\t\t$resutl = $this->_cache->hset($key,$value['domain'],$value);\n\t\t\t\t$domainlist[$value['domain']] = serialize($value);\n\t\t\t}\n\t\t\t$this->_cache->exec($key);\n\t\t}\n\t\treturn $domainlist;\n\t}", "public function getAllDomainsByLocale();", "public function listDomains() {\n \n $domains = $this->_listDomains(100);\n while($this->nextToken) {\n $ndomains = $this->listDomains(100, true);\n if ($ndomains) $domains = array_merge($domains, $ndmomains);\n }\n return $domains;\n }", "function domains() {\n $parameters = array(\n 'method' => __FUNCTION__\n );\n return $this->get_data($parameters);\n }", "function GetDomains()\n{\n global $oDB;\n $arr = array();\n $oDB->Query( 'SELECT id,title FROM '.TABDOMAIN.' ORDER BY titleorder' );\n while ( $row = $oDB->Getrow() )\n {\n $arr[$row['id']] = $row['title'];\n }\n // search translation\n $arrL = cLang::GetName('domain',$_SESSION[QT]['lang_iso'],'*');\n if ( count($arrL)>0)\n {\n foreach ($arr as $id => $str)\n {\n if ( array_key_exists('d'.$id,$arrL) )\n {\n if ( !empty($arrL['d'.$id]) ) $arr[$id]=$arrL['d'.$id];\n }\n }\n }\n return $arr;\n}", "public function getAll(?string $domain = null): array;", "public static function getDomainStatusList(){\n $droptions = DomainStatusRecord::find()->asArray()->all();\n return Arrayhelper::map($droptions, 'value', 'name');\n }", "function get_dns_servers() {\n\treturn get_dns_nameservers(false, true);\n}", "public function all(string $domain = null): array;", "public function testListDomains()\n {\n $api = new DynadotApi('_API_KEY_GOES_HERE_');\n\n $mockHandler = new MockHandler([\n new Response(\n 200,\n [],\n file_get_contents(\n dirname(__FILE__) . DIRECTORY_SEPARATOR .\n 'MockHttpResponses/validListDomainResponse.txt'\n )\n ),\n ]);\n\n $api->setGuzzleOptions(['handler' => $mockHandler]);\n $response = $api->getDomainList();\n\n $this->assertTrue(is_array($response));\n $this->assertContainsOnlyInstancesOf(Domain::class, $response);\n }", "function getDomainList( $config ) {\n\ttry {\n\t\t$command = Namecheap\\Api::factory( $config, 'domains.getList' );\n\t\t$command->dispatch();\n\t} catch ( \\Exception $e ) {\n\t\tdie( $e->getMessage() );\n\t}\n\n\treturn $command->domains;\n}", "function printDNSDomains($dns) {\n // Get the domain list\n $domains = $dns->domainList();\n if ( count($domains ) > 0 ) {\n print \"\\n\";\n print \"Domain List\\n\";\n print \"---------------------\\n\";\n // Iterate through the collection\n while ( $domain = $domains->next() ) {\n print \"$domain->name\\n\";\n }\n print \"\\n\";\n }\n}", "function domains() {\n\t \treturn $this->hook(\"/{$this->subject_slug}/v1/domains.xml?api_key={$this->api_key}\",\"domain\");\n\t}", "public function get_domains()\n\t{\n\t\treturn $this->domains;\n\t}", "function get_domains() {\n\t\tif ( !empty( $this->_config['cname'] ) ) {\n\t\t\treturn (array) $this->_config['cname'];\n\t\t} elseif ( !empty( $this->_config['id'] ) ) {\n\t\t\t$domain = sprintf( '%s.cloudfront.net', $this->_config['id'] );\n\n\t\t\treturn array(\n\t\t\t\t$domain\n\t\t\t);\n\t\t}\n\n\t\treturn array();\n\t}", "public function GetActiveDomains($ARGS = false)\n {\n $Q = $this->DB->GET('MUP.domains.domains', ['status__IN' => [0, 1, 2, 4], 'nsReady' => 1], ['domain'], 100000);\n foreach ($Q as $i => $q) \n $this->SetDomains[] = $q['domain'];\n }", "public function getDomains()\r\n\t{\r\n\t\t$res = $this->doRequest(MogileFS::GET_DOMAINS);\r\n\r\n\t\t$domains = Array();\r\n\t\tfor($i=1; $i <= $res['domains']; $i++)\r\n\t\t{\r\n\t\t\t$dom = 'domain'.$i;\r\n\t\t\t$classes = Array();\r\n\t\t\tfor($j=1; $j <= $res[$dom.'classes']; $j++)\r\n\t\t\t$classes[$res[$dom.'class'.$j.'name']] = $res[$dom.'class'.$j.'mindevcount'];\r\n\t\t\t$domains[] = Array('name' => $res[$dom],'classes' => $classes);\r\n\t\t}\r\n\t\treturn $domains;\r\n\t}", "static function getAllHosts( $domain ) {\n\t\tglobal $wgAuth;\n\n\t\tOpenStackNovaLdapConnection::connect();\n\n\t\t$hosts = array();\n\t\t$result = LdapAuthenticationPlugin::ldap_search( $wgAuth->ldapconn, $domain->domainDN, '(dc=*)' );\n\t\tif ( $result ) {\n\t\t\t$entries = LdapAuthenticationPlugin::ldap_get_entries( $wgAuth->ldapconn, $result );\n\t\t\tif ( $entries ) {\n\t\t\t\t# First entry is always a count\n\t\t\t\tarray_shift( $entries );\n\t\t\t\tforeach ( $entries as $entry ) {\n\t\t\t\t\t$hosts[] = new OpenStackNovaHost( $entry['dc'][0], $domain );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $hosts;\n\t}", "function list_domains ()\n{\n $list = \"\";\n \n $result = db_query (\"SELECT * FROM domain ORDER BY domain\");\n if ($result['rows'] > 0)\n {\n $i = 0;\n while ($row = mysql_fetch_array ($result['result']))\n {\n $list[$i] = $row['domain'];\n $i++;\n }\n }\n return $list;\n}", "private function getDomainList() {\n\t\t$rawDomain = GetGlobalData(\"GoogleDomain\", \"\");\n\t\t$domainList = explode(',', $rawDomain);\n\t\t$result = array();\n\t\tforeach($domainList as $domain) {\n\t\t\t$trimDomain = trim($domain);\n\t\t\tif ( $trimDomain ) {\n\t\t\t\t$result[] = $trimDomain; \n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "function list_domains_for_admin ($username)\n{\n $list = \"\";\n \n $result = db_query (\"SELECT * FROM domain LEFT JOIN domain_admins ON domain.domain=domain_admins.domain WHERE domain_admins.username='$username' AND domain.active='1' ORDER BY domain_admins.domain\");\n if ($result['rows'] > 0)\n {\n $i = 0;\n while ($row = mysql_fetch_array ($result['result']))\n {\n $list[$i] = $row['domain'];\n $i++;\n }\n }\n return $list;\n}", "public function getDomains(): array\n {\n return $this->domainsArray;\n }", "function domainbox_GetDNS($params)\n{\n $authParameters = getAuthParameters($params);\n $apiEndpoint = $params[\"TestMode\"] ? \"https://sandbox.domainbox.net/?WSDL\" : \"https://live.domainbox.net/?WSDL\";\n\n $queryDnsRecordsParameters = new QueryDnsRecordsParameters();\n $queryDnsRecordsParameters->Zone = $params[\"sld\"] . '.' . $params[\"tld\"];\n\n $hostRecords = array();\n\n try\n {\n $parameters = array('AuthenticationParameters' => $authParameters, 'CommandParameters' => $queryDnsRecordsParameters);\n $client = new SoapClient($apiEndpoint, array('soap_version' => SOAP_1_2));\n $result = $client->QueryDnsRecords($parameters);\n\n $result = $result->QueryDnsRecordsResult;\n\n if ($result->ResultCode == 100)\n {\n if ($result->TotalResults > 1)\n {\n foreach ($result->Records->DnsRecordQueryResult as $dnsRecord)\n {\n $hostRecords[] = array('hostname' => $dnsRecord->HostName, 'type' => $dnsRecord->RecordType, 'address' => $dnsRecord->Content, 'priority' => $dnsRecord->Priority);\n }\n }\n else\n {\n foreach ($result->Records as $dnsRecord)\n {\n $hostRecords[] = array('hostname' => $dnsRecord->HostName, 'type' => $dnsRecord->RecordType, 'address' => $dnsRecord->Content, 'priority' => $dnsRecord->Priority);\n }\n }\n }\n }\n catch (Exception $e)\n {\n //TODO: Find out a way to return error to WHMCS.\n }\n\n return $hostRecords;\n}", "public function getAllDomainsLocale()\n {\n $data = TranslationKeyQuery::create()\n ->joinWithTranslationContent()\n ->select(array('Domain', 'TranslationContent.Locale'))\n ->useTranslationContentQuery()\n ->filterByLocale($this->managedLocales)\n ->endUse()\n ->distinct('Domain')\n ->find();\n\n $return = array();\n foreach ($data as $line) {\n $return[] = array(\n 'locale' => $line['TranslationContent.Locale'],\n 'domain' => $line['Domain']\n );\n }\n\n return $return;\n }", "public function actualDomainsWithPorts()\n {\n return collect($this->shouldRespondToWithPorts())->reject(function ($domain) {\n return Str::contains($domain, 'laravel.build');\n })->values()->all();\n }" ]
[ "0.72103506", "0.6946658", "0.66654956", "0.658658", "0.654227", "0.6462294", "0.64236027", "0.6418587", "0.62896246", "0.6286229", "0.6268825", "0.6259706", "0.6247715", "0.6239939", "0.6239157", "0.62193733", "0.620805", "0.6205417", "0.61430216", "0.6129646", "0.6108604", "0.6085282", "0.6082059", "0.60783917", "0.60574204", "0.60183257", "0.59977037", "0.58829814", "0.58803", "0.58381325" ]
0.7305636
0
function Retrieve a matching layer 3 net by an inherited ipv4 address
public function get_matching_net_by_ipv4_address($p_ip_address) { if ($p_ip_address) { return $this->retrieve( 'SELECT isys_cats_net_list__isys_obj__id AS netID, isys_cats_net_list__address_range_from AS rangeFrom, isys_cats_net_list__address_range_to AS rangeTo ' . 'FROM isys_cats_net_list ' . 'WHERE (' . Ip::ip2long( $p_ip_address ) . ' BETWEEN isys_cats_net_list__address_range_from_long AND isys_cats_net_list__address_range_to_long)' . ' AND (isys_cats_net_list__isys_obj__id != ' . (int) C__OBJ__NET_GLOBAL_IPV4 . ') ' . // Order by the smallest possible range (which should be the most exact one) 'ORDER BY (isys_cats_net_list__address_range_to_long - isys_cats_net_list__address_range_from_long) ASC ' . 'LIMIT 1' ) ->get_row(); } return [ 'netID' => null, 'rangeFrom' => '', 'rangeTo' => '' ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function network(){\n return (long2ip((ip2long($this->address))\n & (ip2long($this->netmask()))));\n }", "public function get_global_ipv4_net()\n {\n $l_sql = 'SELECT * FROM isys_cats_net_list\n\t\t\tINNER JOIN isys_obj ON isys_obj__id = isys_cats_net_list__isys_obj__id\n\t\t\tLEFT JOIN isys_net_type ON isys_cats_net_list__isys_net_type__id = isys_net_type__id\n\t\t\tWHERE isys_obj__const = \"C__OBJ__NET_GLOBAL_IPV4\"\n\t\t\tAND isys_obj__undeletable = 1;';\n\n return $this->retrieve($l_sql)\n ->get_row();\n }", "function alias_expand_net($name) {\n\n\tglobal $aliastable;\n\n\tif (isset($aliastable[$name]) && is_subnet($aliastable[$name]))\n\treturn $aliastable[$name];\n\telse if (is_subnet($name))\n\treturn $name;\n\telse\n\treturn null;\n}", "function get_entity_ids_ip_by_network($entity_type, $network, $add_where = '')\n{\n\n // Recursive query for array of networks\n if (is_array($network))\n {\n $ids = array();\n foreach ($network as $entry)\n {\n if ($entry_ids = get_entity_ids_ip_by_network($entity_type, $entry, $add_where))\n {\n $ids = array_merge($ids, $entry_ids);\n }\n }\n\n return $ids;\n }\n\n // Parse for valid network string\n $network_array = parse_network($network);\n //print_vars($network_array);\n if (!$network_array)\n {\n // Incorrect network/address string passed\n return FALSE;\n }\n\n $query = 'SELECT ';\n $join = '';\n $where = ' WHERE 1 ';\n switch ($entity_type)\n {\n case 'ipv4':\n // Force request IPv6 address\n $network_array['ip_type'] = 'ipv4';\n $query .= ' `ipv4_address_id`';\n break;\n case 'ipv6':\n // Force request IPv6 address\n $network_array['ip_type'] = 'ipv6';\n $query .= ' `ipv6_address_id`';\n break;\n case 'ip':\n $query .= ($network_array['ip_version'] == 4) ? ' `ipv4_address_id`' : ' `ipv6_address_id`';\n break;\n\n case 'device':\n case 'devices':\n $query .= ' DISTINCT `device_id`';\n break;\n\n case 'port':\n case 'ports':\n $query .= ' DISTINCT `port_id`';\n break;\n }\n\n switch ($network_array['ip_type'])\n {\n case 'ipv4':\n $query .= ' FROM `ipv4_addresses`';\n if ($network_array['query_type'] == 'single')\n {\n // Exactly IP match\n $where .= ' AND `ipv4_binary` = ?';\n $param[] = $network_array['address_binary'];\n }\n else if ($network_array['query_type'] == 'network')\n {\n // Match IP in network\n $where .= ' AND `ipv4_binary` >= ? AND `ipv4_binary` <= ?';\n $param[] = $network_array['network_start_binary'];\n $param[] = $network_array['network_end_binary'];\n } else {\n // Match IP addresses by part of string\n $where .= generate_query_values($network_array['address'], 'ipv4_address', $network_array['query_type']);\n }\n break;\n case 'ipv6':\n $query .= ' FROM `ipv6_addresses`';\n if ($network_array['query_type'] == 'single')\n {\n // Exactly IP match\n $where .= ' AND `ipv6_binary` = ?';\n $param[] = $network_array['address_binary'];\n }\n else if ($network_array['query_type'] == 'network')\n {\n // Match IP in network\n $where .= ' AND `ipv6_binary` >= ? AND `ipv6_binary` <= ?';\n $param[] = $network_array['network_start_binary'];\n $param[] = $network_array['network_end_binary'];\n } else {\n // Match IP addresses by part of string\n $where .= ' AND (' . generate_query_values($network_array['address'], 'ipv6_address', $network_array['query_type'], FALSE) .\n ' OR ' . generate_query_values($network_array['address'], 'ipv6_compressed', $network_array['query_type'], FALSE) . ')';\n }\n break;\n }\n\n if (FALSE)\n {\n // Ignore disabled/deleted/ignored\n $where .= ' AND `device_id` NOT IN (SELECT `device_id` FROM `devices` WHERE `disabled` = \"1\" OR `ignore` = \"1\")';\n $where .= ' AND `port_id` NOT IN (SELECT `port_id` FROM `ports` WHERE `deleted` = \"1\" OR `ignore` = \"1\")';\n } else {\n // Always ignore deleted ports\n $join = ' LEFT JOIN `ports` USING (`device_id`, `port_id`) ';\n // IS NULL allow to search addresses without associated port\n $where .= ' AND (`ports`.`deleted` != \"1\" OR `ports`.`deleted` IS NULL)';\n }\n $query .= $join;\n $where .= $add_where; // Additional query, ie limit by device_id or port_id\n\n $ids = dbFetchColumn($query . $where, $param);\n //$ids = dbFetchColumn($query . $where, $param);\n //print_vars($ids);\n\n return $ids;\n}", "function findNet($ip,$sm) {\n\n $res = \"\";\n\n // divido gli ottetti\n $exip = explode('.',$ip);\n $exsm = explode('.',$sm);\n\n for($i=0; $i<4; $i++) {\n\n $subip=$exip[$i]; // ottetto del IP\n $subsm=$exsm[$i]; // ottetto della SM\n\n for($k=0; $k<8; $k++) {\n \n if($subip[$k] & $subsm[$k]) {\n $res.=\"1\";\n }\n else {\n $res.=\"0\";\n }\n }\n\n // rimetto i punti (tranne alla fine)\n if($i<3) {\n $res.=\".\";\n }\n \n }\n\n return $res;\n}", "function common_get_network_config($net){\r\n\t$file = '/etc/network/interfaces';\r\n\t$curr = file_get_contents($file);\r\n\tif($net == 'ip'){\t\t\r\n\t\t$curr_ip = explode('#ip',$curr);\r\n\t\t$curr_ip = $curr_ip[1];\r\n\t\t$curr_ip = explode(' ', $curr_ip);\r\n\t\t$curr_ip = trim($curr_ip[1]);\r\n\t\t\r\n\t\treturn $curr_ip;\r\n\t}\r\n\telse if($net == 'subnet'){\r\n\t\t$curr_subnet = explode('#subnet',$curr);\r\n\t\t$curr_subnet = $curr_subnet[1];\r\n\t\t$curr_subnet= explode(' ', $curr_subnet);\r\n\t\t$curr_subnet = trim($curr_subnet[1]);\r\n\t\t\r\n\t\treturn $curr_subnet;\r\n\t}\r\n\telse if($net == 'gw'){\r\n\t\t$curr_gw = explode('#gw',$curr);\r\n\t\t$curr_gw = $curr_gw[1];\r\n\t\t$curr_gw= explode(' ', $curr_gw);\r\n\t\t$curr_gw = trim($curr_gw[1]);\r\n\t\t\r\n\t\treturn $curr_gw;\r\n\t}\r\n\telse if($net == 'dns'){\r\n\t\t$curr_dns = explode('#dns',$curr);\r\n\t\t$curr_dns = $curr_dns[1];\r\n\t\t$curr_dns= explode(' ', $curr_dns);\r\n\t\t$curr_dns = trim($curr_dns[1]);\r\n\t\t\r\n\t\treturn $curr_dns;\r\n\t}\t\r\n\t\r\n\treturn null;\r\n}", "public function getGivenIpWithNetmask()\n\t{\n\t\treturn $this->given_ip . \"/\" . $this->getMask();\n\t}", "function listNetworkAdd($searchadd){\n #sends the deconstructed IP to the networkAdd function\n\n\t\t$iplist = explode(\".\", $searchadd);\n\n\t\t$networkList = [];\n\n\t\tfor($i = 8; $i < 33; $i++){\n\t\t\t$ipvar = explode(\".\", $searchadd);\n\t\t\t$temp = networkAdd($ipvar, $i);\n\t\t\t$networkList[] = $temp;\n\t\t}\n\n\t\t#echo\"All network addresses</br>\";\n\n\t\treturn $networkList;\n\t}", "function getCellNetwork($if)\n {\n \t$arlines = array();\t\t//Store result of ifconfig command\n \texec('ifconfig '.escapeshellarg($if).' '.'2>&1 ', $arlines);\t//execute ifconfig\n \tdebug('(cell_controller.inc|getCellNetwork()) admin client api command: ifconfig '.escapeshellarg($if).' '.'2>&1 '); \t//DEBUG\n \tdebug('(cell_controller.inc|getCellNetwork()) admin client api command output: $arlines', $arlines); \t\t\t\t\t//DEBUG\n \t\n \t//convert array into single line of text\n \t$str='';\n \tforeach($arlines as $line)\n \t{\n \t\t$str=$str.$line;\n \t}\n \t\n \t//run regex on string and find: IP, Gateway, Subnet\n \t$regex=array();\n \tpreg_match(\"/^([A-z]*\\d)\\s+Link\\s+encap:([A-z-]*)\\s.*\\sinet addr:([0-9.]+)\\s*P-t-P:([0-9.]+)\\s*Mask:([0-9.]+)/ims\", $str, $regex);\n \t\n \t$interface = array();\n \tif( !empty($regex) ){\n \t\t$interface['name'] = $regex[1];\n \t\t$interface['type'] = $regex[2];\n \t\t$interface['ip'] = $regex[3];\n \t\t$interface['broadcast'] = $regex[4];\n \t\t$interface['mask'] = $regex[5];\n \t}\n \tdebug('(cell_controller.inc|getCellNetwork()) $interface array '.$interface); \t\t\t\t//DEBUG\n \t\n \treturn $interface;\n }", "public function get_global_ipv6_net()\n {\n $l_sql = 'SELECT isys_cats_net_list__isys_obj__id FROM isys_cats_net_list\n\t\t\tINNER JOIN isys_obj ON isys_obj__id = isys_cats_net_list__isys_obj__id\n\t\t\tLEFT JOIN isys_net_type ON isys_cats_net_list__isys_net_type__id = isys_net_type__id\n\t\t\tWHERE isys_obj__const = \"C__OBJ__NET_GLOBAL_IPV6\"\n\t\t\tAND isys_obj__undeletable = 1;';\n\n return $this->retrieve($l_sql)\n ->get_row();\n }", "private function get_ipv4Nets()\n\t{\n\t\treturn $this->m_ipv4Nets;\n\t}", "function get_networks($args = array())\n {\n }", "public function get_networks()\n {\n }", "public function getNetwork( $full = false )\n\t{\n\t\tif( !$this->valid ) { return null; }\n\t\tif( !$full ) \n\t\t{\n\t\t\treturn inet_ntop( $this->net_addr );\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn $this->inet_gmptofull( $this->net_addr_long );\n\t\t}\n\t}", "function fann_get_network_type($ann)\n{\n}", "public function getIpv4();", "function wp_get_network($network)\n {\n }", "public function getIpv6(): string;", "public function find_net_collision($p_from, $p_to, $p_net_type = C__CATS_NET_TYPE__IPV4, $p_obj_id = null)\n {\n $l_obj_id = null;\n $l_from = $this->convert_sql_text(Ip::ip2long($p_from));\n $l_to = $this->convert_sql_text(Ip::ip2long($p_to));\n\n if ($p_obj_id !== null && $this->convert_sql_id($p_obj_id) !== 'NULL')\n {\n $l_obj_id = $this->convert_sql_id($p_obj_id);\n } // if\n\n $l_condition = 'AND isys_obj__isys_obj_type__id = ' . $this->convert_sql_id(C__OBJTYPE__LAYER3_NET) . '\n\t\t\tAND (\n\t\t\t\t((' . $l_from . ' BETWEEN isys_cats_net_list__address_range_from_long AND isys_cats_net_list__address_range_to_long) OR (' . $l_to . ' BETWEEN isys_cats_net_list__address_range_from_long AND isys_cats_net_list__address_range_to_long))\n\t\t\t\tOR\n\t\t\t\t(' . $l_from . ' <= isys_cats_net_list__address_range_from_long AND isys_cats_net_list__address_range_to_long <= ' . $l_to . ')\n\t\t\t\tOR\n\t\t\t\t(isys_cats_net_list__address_range_from_long <= ' . $l_from . ' AND ' . $l_to . ' <= isys_cats_net_list__address_range_to_long)\n\t\t\t)\n\t\t\tAND isys_cats_net_list__isys_net_type__id = ' . $this->convert_sql_id($p_net_type) . '\n\t\t\tAND isys_obj__id ' . $this->prepare_in_condition(\n [\n C__OBJ__NET_GLOBAL_IPV4,\n C__OBJ__NET_GLOBAL_IPV6,\n $l_obj_id\n ],\n true\n );\n\n return $this->get_data(null, null, $l_condition, null, C__RECORD_STATUS__NORMAL);\n }", "function findBroad($sn,$net) {\n\n $ob = \"\";\n $ip = \"\";\n\n $oct = explode('.',$net);\n\n foreach($oct as $o) {\n \n for($i=0; $i < strlen($o); $i++) {\n\n if($sn > 0) {\n $ob[$i]= $o[$i]; // ottetto broadcast in copia\n $sn--;\n }\n else {\n $ob[$i]= \"1\";\n }\n }\n $ip.= $ob.\".\";\n }\n\n $ip = rtrim($ip, \".\");\n\n return $ip;\n\n}", "public function getSubnetwork()\n {\n return $this->subnetwork;\n }", "function get_main_network_id()\n {\n }", "public function getNetwork() {\n return $this->getValue('network');\n }", "public function getMainNet()\n {\n return $this->main_net;\n }", "function findNetwork($id, $networks) {\n\tforeach ($networks as $network) {\n\t\tif($id == $network->id)\n\t\t\treturn $network;\n\t}\n}", "public function getLayer($name);", "function gethostbynamel6($host, $try_a = false) {\n // if $try_a is true, if AAAA fails, it tries for A\n // results are returned in an array of ips found matching type\n // otherwise returns false\n\n $dns6 = dns_get_record($host, DNS_AAAA);\n if ($try_a == true) {\n $dns4 = dns_get_record($host, DNS_A);\n $dns = array_merge($dns4, $dns6);\n }\n else { $dns = $dns6; }\n $ip6 = array();\n $ip4 = array();\n foreach ($dns as $record) {\n if ($record[\"type\"] == \"A\") {\n $ip4[] = $record[\"ip\"];\n }\n if ($record[\"type\"] == \"AAAA\") {\n $ip6[] = $record[\"ipv6\"];\n }\n }\n if (count($ip6) < 1) {\n if ($try_a == true) {\n if (count($ip4) < 1) {\n return false;\n }\n else {\n return $ip4;\n }\n }\n else {\n return false;\n }\n }\n else {\n return $ip6;\n }\n}", "public function getNetwork()\n {\n return $this->network;\n }", "public function getNetwork()\n {\n return $this->network;\n }", "function networkAdd($ipvar, $subnet){\n\t\t# $octetbit array is used in computing on how many '1' bits are in a specific octet of the IP address\n\t\t$octetbit = [128, 64, 32, 16, 8, 4, 2, 1];\n\n\t\t#To check which octet is the subnet mask located(in terms of count of 8),\n \t#which will help in computing for the network address of the IP address\n\t\t$octetindex = floor((int)$subnet/8);\n\n\t #To check the bits that overflowed from the biggest 8 count from the previous variable\n\t #i.e. if the subnet is /25, 3 octets from the left are all 1s and in the 4th octet,\n\t #the first bit from the left is set to 1 while the rest are set to 0 \n\t\t$octetrem = (int)$subnet%8;\n\n\t\tif ($octetindex == 4)\n\t\t\treturn (implode(\".\", $ipvar));\n\n\t #modresult is to maintain count for which bits will be set to '1' to get the value\n\t #i.e. if the value is 3, then the 2nd bit from the right will be set to '1' and a value of\n\t #1 will remain, making the 1st bit from the right, be set to '1' as well for a total value of 3\n\t\t$modresult = (int)$ipvar[$octetindex];\n\t\t$netconstant = 0;\n\t\t$i = 0;\n\n\t\tif ($octetrem == 0)\n\t\t\tfor ($i = $octetindex; $i < 4; $i++ )\n\t\t\t\t$ipvar[$i] = \"0\";\n\n\t\telse if ($octetrem > 0){\n\t\t\twhile ($i < $octetrem){\n\t\t\t\tif ($modresult >= $octetbit[$i]){\n\t\t\t\t\t$netconstant += $octetbit[$i];\n\t\t\t\t\t$modresult = $modresult % $octetbit[$i];\n\t\t\t\t}\n\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\t$ipvar[$octetindex] = (string)$netconstant;\n\n\t\t\tfor($j = $octetindex+1; $j < 4; $j++)\n\t\t\t\t$ipvar[$j] = \"0\";\n\t\t}\n\n\t\t$netadd = implode(\".\", $ipvar);\n\n\t\treturn $netadd;\n\n\t}" ]
[ "0.61779344", "0.6000845", "0.59024155", "0.5693698", "0.5681165", "0.5570441", "0.5553246", "0.55219805", "0.55043364", "0.5496473", "0.5462301", "0.5457222", "0.5442574", "0.54377174", "0.5425395", "0.54167134", "0.54066116", "0.53591645", "0.53280884", "0.5313634", "0.53061527", "0.52585477", "0.52465606", "0.52288985", "0.52162516", "0.5193498", "0.51770955", "0.51528835", "0.51528835", "0.5114661" ]
0.6018271
1
function Gets all information about the net by the specified object id.
public function get_all_net_information_by_obj_id($p_obj_id) { $l_net_row = []; if (class_exists('isys_cmdb_dao_category_s_net_ip_addresses')) { $l_dao_ip_list = new isys_cmdb_dao_category_s_net_ip_addresses($this->get_database_component()); $l_ip_list_res = $l_dao_ip_list->get_data(null, $p_obj_id, '', [], C__RECORD_STATUS__NORMAL); $l_ip_list_data = []; while ($l_ip_list_row = $l_ip_list_res->get_row()) { $l_ip_list_data[] = Ip::ip2long($l_ip_list_row['isys_cats_net_ip_addresses_list__title']); } // while $l_net_row['used_ips'] = $l_ip_list_data; } else { $l_net_row['used_ips'] = []; } $l_dao_dhcp = new isys_cmdb_dao_category_s_net_dhcp($this->get_database_component()); $l_dao_ip = new isys_cmdb_dao_category_g_ip($this->get_database_component()); $l_net_row = $this->get_data(null, $p_obj_id) ->get_row(); $l_objtype = _L($this->get_objtype_name_by_id_as_string($l_net_row['isys_obj__isys_obj_type__id'])); $l_net_row['object_browser_title'] = $l_objtype . ' >> ' . $l_net_row['isys_obj__title']; // Get DNS Server from net. $l_assigned_dns_server = $this->get_assigned_dns_server($l_net_row['isys_cats_net_list__id']); for ($i = 0;$i < count($l_assigned_dns_server);$i++) { $l_assigned_dns_server[$i] = [ 'id' => $l_assigned_dns_server[$i], 'details' => $l_dao_ip->format_selection($l_assigned_dns_server[$i], true) ]; } // for $l_net_row['assigned_dns_server'] = $l_assigned_dns_server; // Get DNS Domain from net. $l_domain_arr = []; $l_res_dns_domain = $this->get_assigned_dns_domain(null, $l_net_row['isys_cats_net_list__id']); if ($l_res_dns_domain) { while ($l_dns_domain_row = $l_res_dns_domain->get_row()) { $l_domain_arr[] = [ 'caption' => $l_dns_domain_row['isys_net_dns_domain__title'], 'value' => $l_dns_domain_row['isys_net_dns_domain__id'] ]; } // while } // if $l_net_row['assigned_dns_domain'] = $l_domain_arr; $l_dhcp_types_res = $this->get_dialog('isys_net_dhcp_type'); $l_dhcp_types = []; while ($l_dhcp_type_row = $l_dhcp_types_res->get_row()) { $l_dhcp_types[$l_dhcp_type_row['isys_net_dhcp_type__const']] = $l_dhcp_type_row['isys_net_dhcp_type__id']; } // while if (count($l_dhcp_types) > 0) { $l_dhcp_arr = []; foreach ($l_dhcp_types AS $l_dhcp_key => $l_dhcp_type_id) { $l_dhcp_res = $l_dao_dhcp->get_data( null, $p_obj_id, ' AND isys_net_dhcp_type__id = ' . $this->convert_sql_id($l_dhcp_type_id), null, C__RECORD_STATUS__NORMAL ); while ($l_dhcp_row = $l_dhcp_res->get_row()) { $l_dhcp_arr[$l_dhcp_key][] = [ 'from' => Ip::ip2long($l_dhcp_row['isys_cats_net_dhcp_list__range_from']), 'to' => Ip::ip2long($l_dhcp_row['isys_cats_net_dhcp_list__range_to']) ]; } // while } // foreach $l_net_row['dhcp_ranges'] = $l_dhcp_arr; } return $l_net_row; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function networkDetail($networkid) {\n $url ='/v2.0/networks/'.$networkid;\n\n return $this->_req->get($url, [], []);\n }", "private function get_object_resources($p_obj_id)\n {\n $l_quick_info = new isys_ajax_handler_quick_info();\n $l_dao_memory = new isys_cmdb_dao_category_g_memory($this->get_database_component());\n $l_dao_cpu = new isys_cmdb_dao_category_g_cpu($this->get_database_component());\n $l_dao_port = new isys_cmdb_dao_category_g_network_port($this->get_database_component());\n $l_dao_drive = new isys_cmdb_dao_category_g_drive($this->get_database_component());\n\n $l_memory_res = $l_dao_memory->get_data(null, $p_obj_id, \"\", null, C__RECORD_STATUS__NORMAL);\n $l_cpu_res = $l_dao_cpu->get_data(null, $p_obj_id, \"\", null, C__RECORD_STATUS__NORMAL);\n\n $l_memory = 0;\n $l_disc_space = 0;\n $l_cpu = 0;\n\n $l_obj_title = $this->get_obj_name_by_id_as_string($p_obj_id);\n\n if (strlen($l_obj_title) >= 20)\n {\n $l_obj_title = substr($l_obj_title, 0, 20);\n $l_obj_title .= \"...\";\n } // if\n\n $l_member[\"link\"] = $l_quick_info->get_quick_info($p_obj_id, $l_obj_title, C__LINK__OBJECT);\n\n if ($p_obj_id == $_GET[C__CMDB__GET__OBJECT])\n {\n $l_member[\"type\"] = _L($this->get_objtype_name_by_id_as_string($this->get_objTypeID($p_obj_id)));\n }\n else\n {\n $l_member[\"type\"] = _L(\"LC__CMDB__CATG__VIRTUAL_MACHINE\");\n } // if\n\n /**\n * MEMORY\n */\n while ($l_memory_row = $l_memory_res->get_row())\n {\n // @todo Check if \"round()\" does work correctly... Because some of the convert methods use \"number_format()\".\n $l_memory += round(isys_convert::memory($l_memory_row[\"isys_catg_memory_list__capacity\"], \"C__MEMORY_UNIT__MB\", C__CONVERT_DIRECTION__BACKWARD), 2);\n } // while\n\n $l_member[\"memory\"] = $l_memory + 0;\n $l_member[\"memory_rest\"] = $l_memory + 0;\n $l_member[\"memory_unit\"] = \"MB\";\n\n /**\n * CPU\n */\n while ($l_cpu_row = $l_cpu_res->get_row())\n {\n // @todo Check if \"round()\" does work correctly... Because some of the convert methods use \"number_format()\".\n $l_cpu += round(isys_convert::frequency($l_cpu_row[\"isys_catg_cpu_list__frequency\"], C__FREQUENCY_UNIT__GHZ, C__CONVERT_DIRECTION__BACKWARD), 2);\n } // while\n\n $l_member[\"cpu\"] = $l_cpu + 0;\n $l_member[\"cpu_rest\"] = $l_cpu + 0;\n $l_member[\"cpu_unit\"] = \"GHz\";\n\n /**\n * BANDWIDTH\n */\n $l_max_speed = round($l_dao_port->get_max_speed($p_obj_id, \"C__PORT_SPEED__MBIT_S\"), 2);\n\n $l_member[\"bandwidth\"] = $l_max_speed + 0;\n $l_member[\"bandwidth_rest\"] = $l_max_speed + 0;\n $l_member[\"bandwidth_unit\"] = $this->retrieve('SELECT isys_port_speed__title FROM isys_port_speed WHERE isys_port_speed__const = \"C__PORT_SPEED__MBIT_S\";')\n ->get_row_value('isys_port_speed__title');\n\n /**\n * DRIVES\n */\n $l_system_drive_res = $l_dao_drive->get_system_drives($p_obj_id);\n\n while ($l_system_drive_row = $l_system_drive_res->get_row())\n {\n // @todo Check if \"round()\" does work correctly... Because some of the convert methods use \"number_format()\".\n $l_disc_space += round(isys_convert::memory($l_system_drive_row[\"isys_catg_drive_list__capacity\"], \"C__MEMORY_UNIT__GB\", C__CONVERT_DIRECTION__BACKWARD), 2);\n } // while\n\n $l_member[\"disc_space\"] = $l_disc_space + 0;\n $l_member[\"disc_space_rest\"] = $l_disc_space + 0;\n $l_member[\"disc_space_unit\"] = \"GB\";\n\n return $l_member;\n }", "public function details($id)\n {\n return SupuestoObra::where('id', $id)->get();\n }", "function show ($id) {\n\n\tglobal $conn;\n\n\t$object = array();\n\t// Query to select the object.\n\t$sql = 'SELECT * FROM request WHERE id =' . $id;\n\n\tif(!$r = $conn->prepare($sql)){\n\t\techo 'Prepare statement failed';\n\t\tdie();\n\t}\n\n\tif(!$r->execute()) {\n\t\techo 'Execute failed.';\n\t\tdie();\n\t}\n\n\t$r = $r->get_result();\n\n\tif(!$r->num_rows) {\n\t\techo 'No data found.';\n\t\tdie();\n\t}\n\n\t$object = $r->fetch_assoc();\n\n\t// while ($d = $r->fetch_assoc()) {\n\t// \t$object[] = $d;\n\t// }\n\n\t$r->free();\n\t// echo '<pre>';\n\t// print_r($object);\n\t// echo '</pre>';\n\n\t// Load the view file.\n\n\tinclude 'request-show-view.php';\n}", "public function info($id)\r\n {\r\n }", "public function show($id)\n {\n return Orden::with('archivos','cotizaciones','cotizacion.cliente','condicion','asesor','cotizaciones.articulo')->find($id);\n }", "public function getNetworkInfo(): \\stdClass\n {\n return $this->get('net_info');\n }", "function getTerminalObjectFromStreamID($id) {\n\t\t$url = 'https://hestia.speckle.works/api/';\n\t\t$data = json_decode(file_get_contents($url.'streams/'.$id));\n\t\t//echo '<h1>'.$data->resource->name.'</h1>';\n\t\t\n\t\t// get number of variables\n\t\t$o_len = count($data->resource->layers);\n\t\t\n\t\t// get a list of the variables\n\t\t\n\t\t for ($x = 0; $x < $o_len; $x++) \n\t\t{\n\t\t\t// talk about them - get their names etc.\n\t\t\t$name = $data->resource->layers[$x]->name;\n\t\t\t$o_id = $data->resource->objects[$x]->_id;\n\t\t\t$value = $data->resource->layers[$x]->objectCount;\n\t\t\techo '<h3>'.$name.' = '.$value.' data objects</h3>';\n\t\t\t// this is the object id\n\t\t\t//echo $o_id.'<br>';\n\t\t\t\n\t\t}\n\t\techo '<br>'; \n\t}", "public function getDetail($id) {\n\t\treturn $this->getData('/objekt/detail/objekt_id/' . $id);\n\t}", "public function getDetail($id)\n {\n return $this->topologi->find($id);\n }", "function particularnativitylist($id)\n\t{\n\t\t$getparnativity=\"SELECT * from nativity where id = $id\";\n\t\t$nativity_data=$this->get_results( $getparnativity );\n\t\treturn $nativity_data;\n\t}", "public function show($id)\n {\n $ethnic = Ethnic::findOrFail($id);\n return response()->json($ethnic);\n }", "function getObjectFromStreamID($id) {\n\t\t$url = 'https://hestia.speckle.works/api/';\n\t\t$data = json_decode(file_get_contents($url.'streams/'.$id));\n\t\techo '<h2>GH Object: '.$data->resource->name.'</h2>';\n\t\t\n\t\t// get number of objects...\n\t\t$o_len = count($data->resource->layers);\n\t\t\n\t\t// get a list of the objects...\n\t\t\n\t\tfor ($x = 0; $x < $o_len; $x++) \n\t\t{\n\t\t\tgetSubObject($url,$data,$x);\n\t\t}\n\t\techo '<br>';\n\t}", "function getInfo($id){\r\n\t\t$this->getQuestion($id);\r\n\t}", "public function get($id) {\n\t}", "public function get( $id ){}", "function getDetails($nws_id)\n {\n $stmt = \"SELECT\n *\n FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"news\n WHERE\n nws_id=\" . Misc::escapeInteger($nws_id);\n $res = DB_Helper::getInstance()->getRow($stmt, DB_FETCHMODE_ASSOC);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return \"\";\n } else {\n // get all of the project associations here as well\n $res['projects'] = array_keys(self::getAssociatedProjects($res['nws_id']));\n $res['nws_message'] = nl2br(htmlspecialchars($res['nws_message']));\n return $res;\n }\n }", "public function getDetail(int $id)\n {\n }", "public function get($id)\n\t{\n\t\t$id = (int)$id;\n\t\t$sql = \"SELECT * FROM `group` AS p WHERE p.id = :id LIMIT 1\";\n\t\t$stmt = $this->pdo->prepare($sql);\n\t\t$stmt->bindValue(\":id\", $id, \\PDO::PARAM_INT);\n\t\treturn $this->requestSingleObj($stmt);\n\t}", "public function get_members_and_main_object($p_obj_id)\n {\n $l_quick_info = new isys_ajax_handler_quick_info();\n $l_dao_resource = new isys_cmdb_dao_category_g_computing_resources($this->get_database_component());\n\n $l_apps_vms = $this->get_data(null, $p_obj_id, \"\", null, C__RECORD_STATUS__NORMAL);\n\n $l_main_obj[$p_obj_id] = $this->get_object_resources($p_obj_id);\n\n while ($l_row = $l_apps_vms->get_row())\n {\n if ($l_row[\"isys_obj_type__isys_obj_type_group__id\"] == C__OBJTYPE_GROUP__SOFTWARE)\n {\n // Objects from group software.\n $l_resources_res = $l_dao_resource->get_data(null, $l_row[\"isys_obj__id\"], \"\", null, C__RECORD_STATUS__NORMAL);\n\n $l_row2 = $l_resources_res->get_row();\n\n if ($l_resources_res->num_rows() > 0)\n {\n if (strlen($l_row2[\"isys_obj__title\"]) > 17)\n {\n $l_obj_title = substr($l_row2[\"isys_obj__title\"], 0, 14);\n $l_obj_title .= \"...\";\n }\n else\n {\n $l_obj_title = $l_row2[\"isys_obj__title\"];\n } // if\n\n $l_member[$l_row2[\"isys_obj__id\"]][\"link\"] = $l_quick_info->get_quick_info($l_row2[\"isys_obj__id\"], $l_obj_title, C__LINK__OBJECT);\n\n $l_member[$l_row2[\"isys_obj__id\"]][\"type\"] = _L($this->get_objtype_name_by_id_as_string($this->get_objTypeID($l_row2[\"isys_obj__id\"])));\n\n $l_member[$l_row[\"isys_obj__id\"]][\"memory\"] = round(\n isys_convert::memory($l_row2[\"isys_catg_computing_resources_list__ram\"], \"C__MEMORY_UNIT__MB\", C__CONVERT_DIRECTION__BACKWARD),\n 2\n );\n $l_member[$l_row[\"isys_obj__id\"]][\"memory_rest\"] = $l_member[$l_row[\"isys_obj__id\"]][\"memory\"];\n $l_member[$l_row[\"isys_obj__id\"]][\"memory_unit\"] = \"MB\";\n\n $l_member[$l_row[\"isys_obj__id\"]][\"cpu\"] = round(\n isys_convert::frequency($l_row2[\"isys_catg_computing_resources_list__cpu\"], \"C__FREQUENCY_UNIT__GHZ\", C__CONVERT_DIRECTION__BACKWARD),\n 2\n );\n $l_member[$l_row[\"isys_obj__id\"]][\"cpu_rest\"] = $l_member[$l_row[\"isys_obj__id\"]][\"cpu\"];\n $l_member[$l_row[\"isys_obj__id\"]][\"cpu_unit\"] = \"GHz\";\n\n $l_member[$l_row[\"isys_obj__id\"]][\"bandwidth\"] = round(\n isys_convert::speed($l_row2[\"isys_catg_computing_resources_list__network_bandwidth\"], \"C__PORT_SPEED__MBIT_S\", C__CONVERT_DIRECTION__BACKWARD),\n 2\n );\n $l_member[$l_row[\"isys_obj__id\"]][\"bandwidth_rest\"] = $l_member[$l_row[\"isys_obj__id\"]][\"bandwidth\"];\n $l_member[$l_row[\"isys_obj__id\"]][\"bandwidth_unit\"] = $this->retrieve(\n \"SELECT isys_port_speed__title FROM isys_port_speed WHERE isys_port_speed__const LIKE 'C__PORT_SPEED__MBIT_S'\"\n )\n ->get_row_value('isys_port_speed__title');\n\n $l_member[$l_row[\"isys_obj__id\"]][\"disc_space\"] = round(\n isys_convert::memory($l_row2[\"isys_catg_computing_resources_list__disc_space\"], \"C__MEMORY_UNIT__GB\", C__CONVERT_DIRECTION__BACKWARD),\n 2\n );\n $l_member[$l_row[\"isys_obj__id\"]][\"disc_space_rest\"] = $l_member[$l_row[\"isys_obj__id\"]][\"disc_space\"];\n $l_member[$l_row[\"isys_obj__id\"]][\"disc_space_unit\"] = \"GB\";\n } // if\n }\n else\n {\n /**\n * Virtual machines\n */\n $l_member[$l_row[\"isys_obj__id\"]] = $this->get_object_resources($l_row[\"isys_obj__id\"]);\n } // if\n } // while\n\n $this->calculate_consumption_and_resources($l_member, $l_main_obj);\n\n $l_arr = [\n \"members\" => $l_member,\n \"main_obj\" => $l_main_obj,\n ];\n\n return $l_arr;\n }", "public function show(Request $request, $id)\n {\n $object = Insumo::find($id);\n\n if(!$object){\n return Response::json(['error' => \"No se encuentra el recurso que esta buscando.\"], HttpResponse::HTTP_NOT_FOUND);\n }\n if($object->tipo == \"ME\"){\n $object->medicamento;\n }\n if($object->tipo == \"MC\"){\n $object->materialCuracion;\n }\n //$object = $object->load(\"detalles.insumoConDescripcion.informacion\",\"detalles.insumoConDescripcion.generico.grupos\");\n\n return Response::json([ 'data' => $object ], HttpResponse::HTTP_OK);\n }", "public function actionView($id)\n {\n $OpcSearchModel = new DescNetworkSearch();\n $OpcDataProvider = $OpcSearchModel->searchId(Yii::$app->request->queryParams, $id);\n $MscSearchModel = new MscSearch();\n $MscDataProvider = $MscSearchModel->searchId(Yii::$app->request->queryParams, $id);\n $BcuidSearchModel = new BcuIdSearch();\n $BcuidDataProvider = $BcuidSearchModel->searchId(Yii::$app->request->queryParams, $id);\n $RncSearchModel = new RncReferenceSearch();\n $RncDataProvider = $RncSearchModel->searchId(Yii::$app->request->queryParams, $id);\n $TVSearchModel = new TrunkVoipSearch();\n $TVDataProvider = $TVSearchModel->searchId(Yii::$app->request->queryParams, $id);\n $msrnSearchModel = new MsrnProposedlistSearch();\n $BscSearchModel = new BscSearch();\n $BscDataProvider = $BscSearchModel->searchId(Yii::$app->request->queryParams, $id);\n\n $model = $this->findModel($id);\n $msrn = null;\n if ($model->msrn !== null)\n $msrn = $model->msrn->New_MSRN;\n\n $dataprovider = null;\n $flag = null;\n $mscmodel = null;\n \n\n if ($BcuidDataProvider->totalCount > 0)\n {\n $dataprovider = $BcuidDataProvider;\n $flag = 'BCU ID List';\n }\n\n else if ($MscDataProvider->totalCount > 0)\n {\n $dataprovider = $MscDataProvider;\n $flag = 'MSC Pool Specification';\n $mscmodel = Msc::findOne($id);\n }\n\n return $this->render('view', [\n 'model' => $model,\n 'msrn' => $msrn,\n 'OpcDataProvider' => $OpcDataProvider,\n 'dataProvider' => $dataprovider,\n 'flag' => $flag,\n 'mscmodel' => $mscmodel,\n 'TVDataProvider' => $TVDataProvider,\n 'BscDataProvider' => $BscDataProvider,\n 'RncDataProvider' => $RncDataProvider,\n ]);\n\n }", "public function show_list($p_obj_id)\n {\n $l_sql = 'SELECT isys_catg_relation_list__isys_obj__id__master, isys_catg_relation_list__isys_obj__id__slave, obj.isys_obj__isys_obj_type__id, obj.isys_obj__title AS title\n FROM isys_catg_relation_list\n INNER JOIN isys_obj AS obj ON isys_catg_relation_list__isys_obj__id__slave = obj.isys_obj__id\n INNER JOIN isys_obj AS relObj ON isys_catg_relation_list__isys_obj__id = relObj.isys_obj__id\n WHERE isys_catg_relation_list__isys_obj__id__master = ' . $this->m_dao_rel->convert_sql_id($p_obj_id) . '\n AND obj.isys_obj__status = ' . $this->m_dao_rel->convert_sql_int(C__RECORD_STATUS__NORMAL) . '\n AND isys_catg_relation_list__status = ' . $this->m_dao_rel->convert_sql_int(C__RECORD_STATUS__NORMAL) . '\n AND relObj.isys_obj__status = ' . $this->m_dao_rel->convert_sql_int(C__RECORD_STATUS__NORMAL) . '\n GROUP BY isys_catg_relation_list__isys_obj__id__slave ';\n\n $l_res = $this->m_dao_rel->retrieve($l_sql);\n\n while ($l_row = $l_res->get_row()) {\n if ($l_row[\"isys_catg_relation_list__isys_obj__id__master\"] == $p_obj_id &&\n (is_null($this->m_obj_arr) || !in_array($l_row[\"isys_catg_relation_list__isys_obj__id__slave\"], $this->m_obj_arr))) {\n if ($l_row[\"isys_obj__isys_obj_type__id\"] == defined_or_default('C__OBJTYPE__IT_SERVICE')) {\n $this->m_its_arr[$l_row[\"isys_catg_relation_list__isys_obj__id__slave\"]] = $l_row[\"title\"];\n }\n\n if (in_array($this->m_dao_rel->get_objTypeID($l_row['isys_catg_relation_list__isys_obj__id__slave']), $this->m_software_obj_types)) {\n $l_sql = 'SELECT isys_catg_relation_list__isys_obj__id\n FROM isys_catg_relation_list\n INNER JOIN isys_obj ON isys_obj__id = isys_catg_relation_list__isys_obj__id\n WHERE isys_catg_relation_list__isys_obj__id__master = ' . $this->m_dao_rel->convert_sql_id($p_obj_id) . '\n AND isys_catg_relation_list__isys_obj__id__slave = ' . $this->m_dao_rel->convert_sql_id($l_row['isys_catg_relation_list__isys_obj__id__slave']) . '\n AND isys_obj__status = ' . $this->m_dao_rel->convert_sql_int(C__RECORD_STATUS__NORMAL) . '\n AND isys_catg_relation_list__status = ' . $this->m_dao_rel->convert_sql_int(C__RECORD_STATUS__NORMAL) . '\n GROUP BY isys_catg_relation_list__isys_obj__id';\n\n $l_res_app = $this->m_dao_rel->retrieve($l_sql);\n\n while ($l_row_app = $l_res_app->get_row()) {\n $l_its_data = $this->m_dao_its_comp\n ->get_data(null, null, \"AND isys_connection__isys_obj__id = \" . $this->m_dao_rel->convert_sql_id($l_row_app[\"isys_catg_relation_list__isys_obj__id\"]), null, C__RECORD_STATUS__NORMAL)\n ->get_row();\n\n // Check in it service components\n if (isset($l_its_data['isys_obj__id']) &&\n $this->m_dao_rel->get_objTypeID($l_its_data['isys_obj__id']) == defined_or_default('C__OBJTYPE__IT_SERVICE')) {\n if (!array_key_exists($l_its_data['isys_obj__id'], $this->m_its_arr)) {\n $this->m_its_arr[$l_its_data['isys_obj__id']] = $l_its_data['isys_obj__title'];\n }\n }\n }\n }\n\n $this->m_obj_arr[] = $l_row[\"isys_catg_relation_list__isys_obj__id__slave\"];\n $this->new_recurse_relation($l_row[\"isys_catg_relation_list__isys_obj__id__slave\"], $p_obj_id);\n unset($this->m_obj_arr);\n }\n }\n\n return $this;\n }", "public function get_layer_2_id_by_obj_id($p_obj_id)\n {\n $l_sql = 'SELECT isys_cats_layer2_net_list__id FROM isys_cats_layer2_net_list WHERE isys_cats_layer2_net_list__isys_obj__id ';\n $l_arr = [];\n\n if (is_numeric($p_obj_id) && $p_obj_id > 0)\n {\n $l_sql .= ' = ' . $this->convert_sql_id($p_obj_id);\n }\n elseif (is_string($p_obj_id) || is_array($p_obj_id))\n {\n $l_obj_ids = (is_string($p_obj_id)) ? isys_format_json::decode($p_obj_id) : $p_obj_id;\n\n if (is_array($l_obj_ids) && count($l_obj_ids) > 0)\n {\n $l_sql .= ' IN (' . implode(',', $l_obj_ids) . ')';\n }\n else\n {\n return null;\n } // if\n }\n else\n {\n return null;\n } // if\n\n $l_res = $this->retrieve($l_sql);\n if ($l_res->num_rows() > 0)\n {\n while ($l_row = $l_res->get_row())\n {\n $l_arr[] = $l_row['isys_cats_layer2_net_list__id'];\n } // while\n } // if\n return $l_arr;\n }", "public function get_info($id)\n\t{\n\n\t\t$sel=$this->db->prepare(\"SELECT * from shop where id='$id'\");\n\n $sel->execute();\n\n return ($sel->fetchAll(PDO::FETCH_ASSOC));\n\t\t\n\n\n\n }", "public function getkondisi($id)\n {\n //Query untuk mengambil data kondisi berdasarkan id_kondisi untuk dilakukan edit\n $query = $this->db->query(\"SELECT * FROM kondisi WHERE id_kondisi = '$id'\");\n return $query;\n }", "static public function mdlMostrarInventarioById( $obj ){\n\n\t$stmt = Conexion::conectar()\n\t->prepare(\"SELECT\n\t\t\t\ti.nombre,\n\t\t\t\tifnull(it.fecha,'-') fecha,\n\t\t\t\tit.tipo_movimiento,\n\t\t\t\tit.cantidad_inicial,\n\t\t\t\tit.monto_inicial,\n\t\t\t\tit.cantidad_movimiento,\n\t\t\t\tit.monto_movimiento,\n\t\t\t\tit.observacion\n\t\t\tFROM\n\t\t\t\tinventario i\n\t\t\t\tINNER JOIN inventario_transaccion it ON it.id_inventario = i.id\n\t\t\tWHERE i.estado <> '2' AND i.id = :id\n\t\t\");\n\t\t$stmt -> bindParam(\":id\" , $obj -> idInventario, PDO::PARAM_INT);\n\n\t$stmt -> execute();\n\n\treturn $stmt -> fetchAll();\n\n\n$stmt-> close();\n\n$stmt = null;\n\n}", "public function show($oid)\n {\n //\n }", "function load($p_id='') {\n global $DB;\n\n parent::load($p_id);\n $this->ifaddrs = $this->getIfaddrsDB();\n $this->ports = $this->getPortsDB();\n\n $query = \"SELECT `ID`\n FROM `glpi_plugin_fusioninventory_networking`\n WHERE `FK_networking` = '\".$this->getValue('ID').\"';\";\n if ($result = $DB->query($query)) {\n if ($DB->numrows($result) != 0) {\n $fusioninventory = $DB->fetch_assoc($result);\n $this->oFusionInventory_networking->load($fusioninventory['ID']);\n $this->ptcdLinkedObjects[]=$this->oFusionInventory_networking;\n }\n }\n }", "public function getInformation(int $id)\n {\n $data = $this->doGet(sprintf('compute/%d/info', $id));\n return $data['__data']['instances'];\n }" ]
[ "0.6377451", "0.60383636", "0.5972441", "0.5748513", "0.571606", "0.55897725", "0.5578445", "0.55751216", "0.553547", "0.5515632", "0.55015635", "0.5501546", "0.547696", "0.54558444", "0.5452822", "0.5417061", "0.54170436", "0.54029655", "0.5382568", "0.5360003", "0.53436047", "0.53429294", "0.5337564", "0.5336531", "0.53263575", "0.5325439", "0.5321353", "0.532112", "0.52987516", "0.529381" ]
0.7284949
0
function Retrieves all L3 nets, which may collide with the given range.
public function find_net_collision($p_from, $p_to, $p_net_type = C__CATS_NET_TYPE__IPV4, $p_obj_id = null) { $l_obj_id = null; $l_from = $this->convert_sql_text(Ip::ip2long($p_from)); $l_to = $this->convert_sql_text(Ip::ip2long($p_to)); if ($p_obj_id !== null && $this->convert_sql_id($p_obj_id) !== 'NULL') { $l_obj_id = $this->convert_sql_id($p_obj_id); } // if $l_condition = 'AND isys_obj__isys_obj_type__id = ' . $this->convert_sql_id(C__OBJTYPE__LAYER3_NET) . ' AND ( ((' . $l_from . ' BETWEEN isys_cats_net_list__address_range_from_long AND isys_cats_net_list__address_range_to_long) OR (' . $l_to . ' BETWEEN isys_cats_net_list__address_range_from_long AND isys_cats_net_list__address_range_to_long)) OR (' . $l_from . ' <= isys_cats_net_list__address_range_from_long AND isys_cats_net_list__address_range_to_long <= ' . $l_to . ') OR (isys_cats_net_list__address_range_from_long <= ' . $l_from . ' AND ' . $l_to . ' <= isys_cats_net_list__address_range_to_long) ) AND isys_cats_net_list__isys_net_type__id = ' . $this->convert_sql_id($p_net_type) . ' AND isys_obj__id ' . $this->prepare_in_condition( [ C__OBJ__NET_GLOBAL_IPV4, C__OBJ__NET_GLOBAL_IPV6, $l_obj_id ], true ); return $this->get_data(null, null, $l_condition, null, C__RECORD_STATUS__NORMAL); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function parseCIDR( $range ) {\n if ( self::isIPv6( $range ) ) {\n return self::parseCIDR6( $range );\n }\n $parts = explode( '/', $range, 2 );\n if ( count( $parts ) != 2 ) {\n return array( false, false );\n }\n list( $network, $bits ) = $parts;\n $network = ip2long( $network );\n if ( $network !== false && is_numeric( $bits ) && $bits >= 0 && $bits <= 32 ) {\n if ( $bits == 0 ) {\n $network = 0;\n } else {\n $network &= ~( ( 1 << ( 32 - $bits ) ) - 1);\n }\n # Convert to unsigned\n if ( $network < 0 ) {\n $network += pow( 2, 32 );\n }\n } else {\n $network = false;\n $bits = false;\n }\n return array( $network, $bits );\n }", "private function get_ipv4Nets()\n\t{\n\t\treturn $this->m_ipv4Nets;\n\t}", "public static function get_net_where_intersect($nets = array()) \n {\n if (count($nets) > 0) \n {\n // Merge\n return (self::get_net_where()) ? self::get_net_where().\" AND asset_id IN (UNHEX('\".implode(\"'), UNHEX('\",$nets).\"'))\" : \"UNHEX('\".implode(\"'), UNHEX('\",$nets).\"')\";\n } \n else \n {\n // Only allowed\n return self::get_net_where();\n }\n }", "public function getNNearestPoisInRange(float $lat, float $lng, float $range, int $N): array\n {\n //step 1: get all pois in the defined range\n $items = $this->db->query(\"SELECT id, lat, lng FROM pois WHERE type!=3\")->fetchAll();\n $pois = [];\n for ($i = 0; $i < count($items); $i++) {\n $item = $items[$i];\n $distance = $this->distance($lat, $lng, $item->lat, $item->lng, \"N\");\n if ($distance <= $range) {\n //get missions\n $req = \"SELECT\n missions.id,\n missions.caption,\n missions.title,\n missions.type,\n missions.reward,\n sailaway_users.name AS creator\n FROM missions\n INNER JOIN assoc_pois_missions ON missions.id=assoc_pois_missions.mission\n INNER JOIN cve_users ON missions.creator=cve_users.id\n INNER JOIN sailaway_users ON cve_users.sw_user_id=sailaway_users.id\n WHERE assoc_pois_missions.poi=$item->id\";\n $missionItems = $this->db->query($req)->fetchAll();\n $missions = [];\n foreach ($missionItems as $missionItem) {\n $missions[] = [\n \"id\" => $missionItem->id,\n \"title\" => utf8_encode($missionItem->title),\n \"caption\" => utf8_encode($missionItem->caption),\n \"reward\" => $missionItem->reward,\n \"type\" => $missionItem->type,\n \"creator\" => $missionItem->creator\n ];\n }\n $poi = ($this->getPoiById($item->id))->toJson();\n $poi[\"missions\"] = $missions;\n $poi[\"distance\"] = $distance;\n $pois[] = $poi;\n }\n }\n // step 2: select N nearest pois in the list\n $distComp = function ($poi1, $poi2) use ($lat, $lng) {\n $dist1 = $this->distance($lat, $lng, $poi1['lat'], $poi1['lng'], \"N\");\n $dist2 = $this->distance($lat, $lng, $poi2['lat'], $poi2['lng'], \"N\");\n if ($dist1 == $dist2) {\n return 0;\n } else if ($dist1 < $dist2) {\n return -1;\n } else {\n return 1;\n }\n };\n usort($pois, $distComp);\n $output = [];\n if ($N > sizeof($pois)) {\n $N = sizeof($pois);\n }\n for ($i = 0; $i < $N; $i++) {\n $output[] = $pois[$i];\n }\n return $output;\n }", "private static function parseCIDR6( $range ) {\n # Explode into <expanded IP,range>\n $parts = explode( '/', IP::sanitizeIP( $range ), 2 );\n if ( count( $parts ) != 2 ) {\n return array( false, false );\n }\n list( $network, $bits ) = $parts;\n $network = self::IPv6ToRawHex( $network );\n if ( $network !== false && is_numeric( $bits ) && $bits >= 0 && $bits <= 128 ) {\n if ( $bits == 0 ) {\n $network = \"0\";\n } else {\n # Native 32 bit functions WONT work here!!!\n # Convert to a padded binary number\n $network = wfBaseConvert( $network, 16, 2, 128 );\n # Truncate the last (128-$bits) bits and replace them with zeros\n $network = str_pad( substr( $network, 0, $bits ), 128, 0, STR_PAD_RIGHT );\n # Convert back to an integer\n $network = wfBaseConvert( $network, 2, 10 );\n }\n } else {\n $network = false;\n $bits = false;\n }\n return array( $network, (int)$bits );\n }", "public function getVilasProximas($range)\n {\n $vilas = Vila::where('x', '<=', ($this->x + $range))\n ->where('x', '>=', ($this->x - $range))\n ->where('y', '>=', ($this->y - $range))\n ->where('y', '<=', ($this->y + $range))->get();\n\n return $vilas;\n }", "public static function parseRange( $range ) {\n // CIDR notation\n if ( strpos( $range, '/' ) !== false ) {\n if ( self::isIPv6( $range ) ) {\n return self::parseRange6( $range );\n }\n list( $network, $bits ) = self::parseCIDR( $range );\n if ( $network === false ) {\n $start = $end = false;\n } else {\n $start = sprintf( '%08X', $network );\n $end = sprintf( '%08X', $network + pow( 2, ( 32 - $bits ) ) - 1 );\n }\n // Explicit range\n } elseif ( strpos( $range, '-' ) !== false ) {\n list( $start, $end ) = array_map( 'trim', explode( '-', $range, 2 ) );\n if ( self::isIPv6( $start ) && self::isIPv6( $end ) ) {\n return self::parseRange6( $range );\n }\n if ( self::isIPv4( $start ) && self::isIPv4( $end ) ) {\n $start = self::toUnsigned( $start );\n $end = self::toUnsigned( $end );\n if ( $start > $end ) {\n $start = $end = false;\n } else {\n $start = sprintf( '%08X', $start );\n $end = sprintf( '%08X', $end );\n }\n } else {\n $start = $end = false;\n }\n } else {\n # Single IP\n $start = $end = self::toHex( $range );\n }\n if ( $start === false || $end === false ) {\n return array( false, false );\n } else {\n return array( $start, $end );\n }\n }", "public function getAllowedNetworks() {\n $networks = CachedConferenceApi::getNetworks();\n if ((SettingsApi::getSetting(SettingsApi::ALLOW_NETWORK_CHAIRS_TO_SEE_ALL_NETWORKS) <> 1)\n && !LoggedInUserDetails::isCrew()\n ) {\n return NetworkApi::getOnlyNetworksOfChair($networks, LoggedInUserDetails::getUser());\n }\n return $networks;\n }", "function multipleLayerNeurons($start) {\n\t\tfor($i = 0; $i < 10; $i++) \n\t\t\t$this->layerNeurons( $start + $i , 0 );\n\t}", "public function networks()\n {\n return $this->request('get', '/api/teams/'.Helpers::config('team').'/networks');\n }", "public static function allowedNets($user = '') \n {\n # Get network allowed from ctx's\n \n $db = new ossim_db();\n $conn = $db->connect();\n \n if ($user == '')\n { \n $user = self::get_session_user();\n }\n \n if (self::is_admin($conn, $user))\n { \n return '';\n }\n \n $nets = '';\n $query = 'SELECT HEX(id) AS id FROM net';\n \n if (self::get_ctx_where($user) != '') \n {\n $query .= \" WHERE ctx in (\".self::get_ctx_where($user).\")\";\n } \n \n $rs = $conn->Execute($query); \n \n if (!$rs) \n {\n Av_exception::write_log(Av_exception::DB_ERROR, $conn->ErrorMsg());\n \n return $nets; \n } \n \n while (!$rs->EOF) \n {\n $nets .= ($nets != '') ? ','.$rs->fields['id'] : $rs->fields['id'];\n \n $rs->MoveNext();\n }\n \n $db->close();\n \n return $nets;\n }", "public function rangeToArray($range) {\n $ip_range = $range;\n $ip_arr = explode('/', $ip_range);\n\n $bin = '';\n for ($i = 1; $i <= 32; $i++) {\n $bin .= $ip_arr[1] >= $i ? '1' : '0';\n }\n $ip_arr[1] = bindec($bin);\n\n $ip = ip2long($ip_arr[0]);\n $nm = ip2long($ip_arr[1]);\n $nw = ($ip & $nm);\n $bc = $nw | (~$nm);\n\n\n\n for ($zm = 1; ($nw + $zm) <= ($bc - 1); $zm++) {\n $array[$zm] = long2ip($nw + $zm);\n }\n return $array;\n }", "public function networkList($filter = array())\n {\n return $this->collection('OpenCloud\\Compute\\Resource\\Network');\n }", "public function get_networks()\n {\n }", "public function getNItems3()\n {\n return $this->hasMany(NItem::className(), ['cogs_gl_acc_id' => 'account_id']);\n }", "public function testInRange()\n {\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->inRange('127.0.0.44', '127.0.0.0/24');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('127.0.250.44', '127.0.250.250/24');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('127.0.1.44', '127.0.0.0/24');\n $this->assertEquals(false, $t);\n\n // Single Ip\n $t = $ipComponent->inRange('127.0.0.1', '127.0.0.1');\n $this->assertEquals(true, $t);\n\n // Test 2. Check IP is if in C class subnet.\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->inRange('127.0.33.33', '127.0.0.0/16');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('127.0.33.33', '127.0.250.0/16');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('127.1.33.33', '127.0.0.0/16');\n $this->assertEquals(false, $t);\n\n // Test 3. Check IP is if in B class subnet.\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->inRange('127.33.250.33', '127.0.0.0/8');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('127.33.33.33', '127.0.0.0/8');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('128.33.250.33', '127.0.0.0/8');\n $this->assertEquals(false, $t);\n\n // Test 4. Check IPv6\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->inRange('2001:db8:ffff:ffff:ffff:ffff:ffff:ffff', '2001:db8::/32');\n $this->assertEquals(true, $t);\n\n $t = $ipComponent->inRange('2001:db8:ffff:ffff:ffff:ffff:ffff:ffff', '2001:db8::0/32');\n $this->assertEquals(false, $t);\n\n // Test 5. Check Invalid IP\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->inRange('127.0.333.33', '127.0.250.0/16');\n $this->assertEquals(false, $t);\n }", "function get_networks( $args = array() ) {\n\t$query = new WP_Network_Query();\n\n\treturn $query->query( $args );\n}", "public static function range_to_cidrlist($start, $end)\n {\n $ver = (false === filter_var($start, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) ? 6 : 4;\n $start = IP::inet_ptod($start);\n $end = IP::inet_ptod($end);\n\n $len = $ver == 4 ? 32 : 128;\n $log2 = $ver == 4 ? log(2) : BC::bclog(2);\n\n $list = array();\n while (BC::cmp($end, $start) >= 0) { // $end >= $start\n $prefix = self::max_prefix(IP::inet_dtop($start), $len);\n if ($ver == 4) {\n $diff = $len - floor( log($end - $start + 1) / $log2 );\n } else {\n // this is not as accurate due to the bclog function\n $diff = bcsub($len, BC::bcfloor(bcdiv(BC::bclog(bcadd(bcsub($end, $start), '1')), $log2)));\n }\n\n if ($prefix < $diff) {\n $prefix = $diff;\n }\n\n $list[] = IP::inet_dtop($start) . \"/\" . $prefix;\n\n if ($ver == 4) {\n $start += pow(2, $len - $prefix);\n } else {\n $start = bcadd($start, bcpow(2, $len - $prefix));\n }\n }\n return $list;\n }", "public function intersects(self $network)\n {\n return $this->comparator->intersects($network);\n }", "function ip_in_range($ip, $range) {\r\n if (strpos($ip, '.') !== false) { // regular IPv4\r\n if (strpos($range, '/') !== false) {\r\n // $range is in IP/NETMASK format\r\n list($range, $netmask) = explode('/', $range, 2);\r\n if (strpos($netmask, '.') !== false) {\r\n // $netmask is a 255.255.0.0 format, or 255.*\r\n $nets = explode('.', $netmask);\r\n while(count($nets) < 4) $nets[] = '*';\r\n $netmask = implode('.', $nets);\r\n // by now we have ensured that we have 4 octets of the netmask a.b.c.d\r\n $netmask = str_replace('*', '0', $netmask);\r\n $netmask_dec = ip2float($netmask);\r\n#printf(\"%-10s: %s\\n\", \"Netmask\", $netmask);\r\n#printf(\"%-10s: %-032b\\n\", \"Netmaskbin\", $netmask_dec);\r\n\r\n } else {\r\n // $netmask is a CIDR size block\r\n // fix the range argument\r\n $x = explode('.', $range);\r\n while(count($x)<4) $x[] = '0';\r\n #list($a,$b,$c,$d) = $x;\r\n #$range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\r\n $range = implode('.', $x);\r\n\r\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\r\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\r\n\r\n # Strategy 2 - Use math to create it\r\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\r\n $netmask_dec = ~ $wildcard_dec;\r\n $netmask_dec = (float)(pow(2,32) - pow(2, (32-$netmask)));\r\n\r\n }\r\n#printf(\"%-10s: %s\\n\", \"IP\", $ip);\r\n#printf(\"%-10s: %-032b\\n\", \"IPbin\", ip2float($ip));\r\n#printf(\"%-10s: %s\\n\", \"Range\", $range);\r\n#printf(\"%-10s: %-032b\\n\", \"Rangebin\", ip2float($range));\r\n#printf(\"%-10s: %-032b\\n\", \"Netmask\", $netmask_dec);\r\n# $a = float_and(ip2float($ip), $netmask_dec);\r\n# $b = float_and(ip2float($range), $netmask_dec);\r\n#printf(\"%-10s: %-032b\\n\", \"IP&MASK\", $a);\r\n#printf(\"%-10s: %-032b\\n\", \"Range&MASK\", $b);\r\n return ( float_and(ip2float($ip), $netmask_dec) == float_and(ip2float($range), $netmask_dec) );\r\n } else {\r\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\r\n if (strpos($range, '*') !==false) { // a.b.*.* format\r\n // Just convert to A-B format by setting * to 0 for A and 255 for B\r\n $lower = str_replace('*', '0', $range);\r\n $upper = str_replace('*', '255', $range);\r\n $range = \"$lower-$upper\";\r\n }\r\n\r\n if (strpos($range, '-')!==false) { // A-B format\r\n list($lower, $upper) = explode('-', $range, 2);\r\n $lower_dec = ip2float($lower);\r\n $upper_dec = ip2float($upper);\r\n $ip_dec = ip2float($ip);\r\n return ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\r\n }\r\n\r\n echo 'Range argument is not in 1.2.3.4/24 or 1.2.3.4/255.255.255.0 format';\r\n return false;\r\n }\r\n }\r\n if (strpos($ip, ':') !== false) { // IPv6\r\n ini_set(\"display_errors\", 1);\r\n error_reporting(E_ALL);\r\n // Parse out the $range\r\n if (strpos($range, '/') !== false) {\r\n // $range is in IPv6/NETMASK format\r\n list($range, $netbits) = explode('/', $range, 2);\r\n $netmask_binstr = str_pad('', $netbits, '1') . str_pad('', 128-$netbits, '0');\r\n }\r\n if (preg_match('/::$/', $range)) {\r\n $range = preg_replace('/::$/', '', $range);\r\n $x = explode(':', $range);\r\n while(count($x) < 8) $x[] = '0';\r\n $range = implode(':', $x);\r\n }\r\n return ( largearray_and(ip6floatA($ip), largebin2floatA($netmask_binstr)) == largearray_and(ip6floatA($range), largebin2floatA($netmask_binstr)) );\r\n }\r\n\r\n}", "public function getNetworksList() {\n return $this->_get(1);\n }", "private function get_ipv6Nets()\n\t{\n\t\treturn $this->m_ipv6Nets;\n\t}", "public function getNetworksList() {\n return $this->_get(4);\n }", "public function kick($range){\n $key = (10*round($range/10))+'y';\n $roll = mt_rand(1,6);\n return $this->kick_results_relationship[$key][$roll];\n }", "public function getCurrencies3()\n {\n return $this->hasMany(Currency::className(), ['ar_disc_gl_acc_id' => 'account_id']);\n }", "private function calcIpRange($ip_range)\n {\n// $subnet = new SubnetCalculator($network[0], $network[1]);\n\n if(preg_match(\"/\\-/\",$ip_range)){\n $address_range = explode(\"-\",$ip_range);\n return [\n 'from' => trim($address_range[0]),\n 'to' => trim($address_range[1])\n ];\n }\n\n $subnet = SubnetCalculator::factory($ip_range);\n\n // [192.168.112.0, 192.168.113.255]\n $address_range = $subnet->getIPAddressRange();\n return [\n 'from' => $address_range[0],\n 'to' => $address_range[1]\n ];\n }", "protected function get_network_ids()\n {\n }", "public function getRanges(): UnitRangesCollection;", "public function getNetworks() {\n\n //GET NETWORK TABLE\n $tableNetwork = Engine_Api::_()->getDbtable('networks', 'network');\n\n //MAKE QUERY\n $select = $tableNetwork->select()\n ->from($tableNetwork->info('name'), array('network_id', 'title'))\n ->order('title');\n $result = $tableNetwork->fetchAll($select);\n\n $everyone = Zend_Registry::get('Zend_Translate')->_('Everyone');\n\n //MAKE DATA ARRAY\n $networksOptions = array('0' => $everyone);\n foreach ($result as $value) {\n $networksOptions[$value->network_id] = $value->title;\n }\n\n //RETURN\n return $networksOptions;\n }", "Function ip_in_range($ip, $range) {\r\n if (strpos($range, '/') !== false) {\r\n // $range is in IP/NETMASK format\r\n list($range, $netmask) = explode('/', $range, 2);\r\n if (strpos($netmask, '.') !== false) {\r\n // $netmask is a 255.255.0.0 format\r\n $netmask = str_replace('*', '0', $netmask);\r\n $netmask_dec = ip2long($netmask);\r\n return ( (ip2long($ip) & $netmask_dec) == (ip2long($range) & $netmask_dec) );\r\n } else {\r\n // $netmask is a CIDR size block\r\n // fix the range argument\r\n $x = explode('.', $range);\r\n while(count($x)<4) $x[] = '0';\r\n list($a,$b,$c,$d) = $x;\r\n $range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\r\n $range_dec = ip2long($range);\r\n $ip_dec = ip2long($ip);\r\n\r\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\r\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\r\n\r\n # Strategy 2 - Use math to create it\r\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\r\n $netmask_dec = ~ $wildcard_dec;\r\n\r\n return (($ip_dec & $netmask_dec) == ($range_dec & $netmask_dec));\r\n }\r\n } else {\r\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\r\n if (strpos($range, '*') !==false) { // a.b.*.* format\r\n // Just convert to A-B format by setting * to 0 for A and 255 for B\r\n $lower = str_replace('*', '0', $range);\r\n $upper = str_replace('*', '255', $range);\r\n $range = \"$lower-$upper\";\r\n }\r\n\r\n if (strpos($range, '-')!==false) { // A-B format\r\n list($lower, $upper) = explode('-', $range, 2);\r\n $lower_dec = (float)sprintf(\"%u\",ip2long($lower));\r\n $upper_dec = (float)sprintf(\"%u\",ip2long($upper));\r\n $ip_dec = (float)sprintf(\"%u\",ip2long($ip));\r\n return ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\r\n }\r\n\r\n echo 'Range argument is not in 1.2.3.4/24 or 1.2.3.4/255.255.255.0 format';\r\n return false;\r\n }\r\n\r\n}" ]
[ "0.53009653", "0.48055413", "0.47640368", "0.47581008", "0.47338706", "0.4614225", "0.46067715", "0.45933735", "0.45929423", "0.4505015", "0.448563", "0.44697803", "0.44612807", "0.44349718", "0.44125316", "0.440759", "0.43697932", "0.43572888", "0.43568417", "0.43425846", "0.43067712", "0.42988586", "0.42848963", "0.4282203", "0.42713702", "0.42711323", "0.42593366", "0.42580113", "0.4246345", "0.42460835" ]
0.58039576
0
function Gets assigned layer 2 net ids
public function get_assigned_layer_2_ids($p_obj_id, $p_as_obj_id = false) { $l_sql = 'SELECT isys_cats_layer2_net_list__id FROM isys_cats_layer2_net_2_layer3 '; if ($p_as_obj_id) { $l_sql = 'SELECT isys_cats_layer2_net_list__isys_obj__id FROM isys_cats_layer2_net_2_layer3 ' . 'INNER JOIN isys_cats_layer2_net_list AS l2 ON l2.isys_cats_layer2_net_list__id = isys_cats_layer2_net_2_layer3.isys_cats_layer2_net_list__id '; } // if $l_sql .= 'WHERE isys_obj__id = ' . $this->convert_sql_id($p_obj_id); $l_res = $this->retrieve($l_sql); $l_return = null; if ($l_res->num_rows() > 0) { while ($l_row = $l_res->get_row()) { if ($p_as_obj_id) { $l_return[] = $l_row['isys_cats_layer2_net_list__isys_obj__id']; } else { $l_return[] = $l_row['isys_cats_layer2_net_list__id']; } // if } // while } // if return $l_return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function get_network_ids()\n {\n }", "public static function getNewtorkIds()\n {\n return array_keys(self::$networks);\n }", "function get_main_network_id()\n {\n }", "Public Function NetworkId() {\n\t\treturn $this->networkId;\n\t\n\t}", "function get_current_network_id()\n {\n }", "public function getIds() {\n $sources = array();\n \n $sources[] = $this->id;\n \n foreach ($this->points as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->lines as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->polygons as &$g) {\n $sources[] = $g->id;\n }\n if ( !empty($this->address) ) {\n $sources[] = $this->address->id;\n }\n foreach ($this->relationships as &$r) {\n $sources[] = $r->id;\n }\n \n return array_filter($sources);\n }", "public function IDs($layer = null) {\n return array_keys($this->getData());\n }", "function taminoGetIds() {\n $rval = $this->tamino->xquery($this->xquery);\n if ($rval) { // tamino Error\n print \"<p>LinkCollection Error: failed to retrieve linkRecord id list.<br>\";\n print \"(Tamino error code $rval)</p>\";\n } else { \n // convert xml ids into a php array \n $this->ids = array();\n $this->xml_result = $this->tamino->xml->getBranches(\"ino:response/xq:result\");\n if ($this->xml_result) {\n\t// Cycle through all of the branches \n\tforeach ($this->xml_result as $branch) {\n\t if ($att = $branch->getTagAttribute(\"id\", \"xq:attribute\")) {\n\t array_push($this->ids, $att);\n\t }\n\t} /* end foreach */\n } \n }\n\n }", "public function getNetworkId(){\n\t\treturn self::NETWORK_ID;\n\t}", "public function getIdFactorNetwork()\n {\n return $this->id_factor_network;\n }", "public function getIds();", "public function getIds();", "final public function getNetworkId(): int\n {\n return static::NETWORK_ID;\n }", "public function getIds()\n {\n\n }", "public function getLoopsId();", "public abstract function get_ids();", "public function utilityIds()\n {\n $this->attributes['utilityIds'] = $this->utilities->pluck('id');\n }", "public function get_all_ships_id() {\n\t\t// only update if not already present in instance\n\t\tif( !isset($this->ships_id) ) {\n\t\t\t$sql = \" SELECT s.id\";\n\t\t\t$sql = $sql . \" FROM \" . EVO_PREFIX . \"_ships s\";\n\t\t\t\n\t\t\tif( $result = $this->db->query($sql) ) {\n\t\t\t\twhile( $row = $result->fetch_object() ) {\n\t\t\t\t\t$this->ships_id[] = $row->id;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->db->error;\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t\treturn $this->ships_id;\n\t}", "public function get_networks()\n {\n }", "public function groupIds();", "public function getReferenceIdsList(){\n return $this->_get(2);\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "function getReferences()\n\t{\n\t\tif ($nodes = $this->getElementsByTagname(\"LO\"))\n\t\t{\n\t\t\tforeach ($nodes as $node)\n\t\t\t{\n\t\t\t\t$attr[] = $node->get_attribute(\"id\");\n\t\t\t}\n\t\t}\n\n\t\treturn $attr;\n\t}" ]
[ "0.7359028", "0.6211", "0.61826926", "0.59350395", "0.5822989", "0.5800292", "0.57590985", "0.5746658", "0.57354647", "0.5640538", "0.556216", "0.556216", "0.55519265", "0.55079824", "0.55045605", "0.5492997", "0.54627204", "0.54120487", "0.53762454", "0.5361463", "0.53223896", "0.5316374", "0.5316374", "0.5316374", "0.5316374", "0.5316374", "0.5316374", "0.5316374", "0.5316374", "0.53118396" ]
0.6468641
1
function Retrieves layer2 assignments as result set or as array with object informations
public function get_assigned_layer_2($p_obj_id, $p_as_array = false) { $l_sql = 'SELECT isys_obj.isys_obj__id, isys_obj.isys_obj__title, isys_obj.isys_obj__isys_obj_type__id, isys_obj.isys_obj__status FROM isys_cats_layer2_net_2_layer3 INNER JOIN isys_cats_layer2_net_list AS l2 ON l2.isys_cats_layer2_net_list__id = isys_cats_layer2_net_2_layer3.isys_cats_layer2_net_list__id INNER JOIN isys_obj ON isys_obj.isys_obj__id = l2.isys_cats_layer2_net_list__isys_obj__id WHERE isys_cats_layer2_net_2_layer3.isys_obj__id = ' . $this->convert_sql_id( $p_obj_id ); $l_res = $this->retrieve($l_sql); if ($p_as_array) { $l_return = []; while ($l_row = $l_res->get_row()) { $l_return[] = $l_row; } // while } else { $l_return = $l_res; } // if return $l_return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAssignments(): array;", "function turnitintooltwo_get_assignments_from_tii($courseid, $returnformat = \"json\") {\n global $DB;\n\n $return = array();\n if ($returnformat == \"json\") {\n $return[\"aaData\"] = array();\n }\n\n $turnitincomms = new turnitintooltwo_comms();\n $turnitincall = $turnitincomms->initialise_api();\n\n $assignment = new TiiAssignment();\n $assignment->setClassId($courseid);\n\n $assignmentids = array();\n try {\n $response = $turnitincall->findAssignments( $assignment );\n $findassignment = $response->getAssignment();\n $assignmentids = $findassignment->getAssignmentIds();\n } catch (Exception $e) {\n $turnitincomms->handle_exceptions($e, 'getassignmenterror', false);\n }\n\n $assignment = new TiiAssignment();\n $assignment->setAssignmentIds($assignmentids);\n\n $currentassignments = array();\n if (count($assignmentids) > 0) {\n list($insql, $inparams) = $DB->get_in_or_equal($assignmentids);\n\n $currentassignments['TT'] = $DB->get_records_select(\"turnitintooltwo_parts\",\n \" tiiassignid \".$insql, $inparams, '', 'tiiassignid');\n\n $dbman = $DB->get_manager();\n if ($dbman->table_exists('plagiarism_turnitin_config')) {\n $currentassignments['PP'] = $DB->get_records_select(\"plagiarism_turnitin_config\", \" name = 'turnitin_assignid' \".\n \" AND value \".$insql, $inparams, '', 'value');\n } else {\n $currentassignments['PP'] = array();\n }\n }\n\n try {\n $response = $turnitincall->readAssignments( $assignment );\n $readassignments = $response->getAssignments();\n foreach ($readassignments as $readassignment) {\n if (empty($currentassignments['TT'][$readassignment->getAssignmentId()]) &&\n empty($currentassignments['PP'][$readassignment->getAssignmentId()])) {\n $checkbox = html_writer::checkbox('assignmentids[]', $readassignment->getAssignmentId(), false, '',\n array(\"id\" => \"assignmentid_\".$readassignment->getAssignmentId(),\n \"disabled\" => \"disabled\", \"class\" => \"assignmentids_check\"));\n if ($returnformat == \"json\") {\n $return[\"aaData\"][] = array($checkbox, $readassignment->getTitle(), $readassignment->getMaxGrade(),\n $readassignment->getAssignmentId());\n } else {\n $return[$readassignment->getAssignmentId()] = array(\"tii_id\" => $readassignment->getAssignmentId(),\n \"tii_title\" => $readassignment->getTitle());\n }\n } else {\n // Double check that migration has completed for this assignment.\n // If not then there has been an error so we delete the previously migrated assignment attempt.\n if ($part = $DB->get_record('turnitintooltwo_parts',\n array('tiiassignid' => $readassignment->getAssignmentId(), 'migrated' => -1))) {\n $DB->delete_records('turnitintooltwo_parts',\n array('tiiassignid' => $readassignment->getAssignmentId(), 'migrated' => -1));\n turnitintooltwo_activitylog(\"Deleted failed migration assignment part - id (\".\n $readassignment->getAssignmentId().\")\", \"REQUEST\");\n\n // Remove the Turnitintool if it contains no other parts.\n if ($DB->count_records('turnitintooltwo_parts', array('turnitintooltwoid' => $part->turnitintooltwoid)) == 0) {\n $DB->delete_records(\"turnitintooltwo\", array(\"id\" => $part->turnitintooltwoid));\n turnitintooltwo_activitylog(\"Deleted tool instance - id (\".$part->turnitintooltwoid.\")\", \"REQUEST\");\n }\n }\n }\n }\n } catch (Exception $e) {\n turnitintooltwo_activitylog(get_string('migrationassignmentgeterror', 'turnitintooltwo').' - Class: '.$courseid, \"REQUEST\");\n }\n\n return $return;\n}", "public function resultaSet(){\n $this->execute();\n return $this->statemet->fetchAll(PDO::FETCH_OBJ);\n }", "public function resultset(){\n\t\t$this->execute() ;\n\t\treturn $this->statement->fetchAll(PDO::FETCH_ASSOC) ;\n\t}", "public function resultSet(){\n\t\t$this->execute();\n\t\treturn $this->stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "public function resultSet(){\n $this->execute();\n return $this->statement->fetchAll(PDO::FETCH_OBJ);\n }", "public function fetchResult();", "function get_operator1()\n \t{\n\t\t$sql=$this->db2->query(\"select travel_id,operator_title from registered_operators \");\n $data=array(); \n foreach ($sql->result() as $rows)\n {\n \t$data[$rows->travel_id]=$rows->operator_title;\n }\n\t\treturn $data;\n }", "public function getStudentsAssignment()\n {\n $where = [];\n foreach ($this->request->getQuery() as $key => $value) {\n if(!empty($value))\n $where[$key] = $value;\n }\n $response=$this->StudentHealths->StudentInfos->find()\n ->select(['name'=>'Students.name','id'=>'Students.id'])\n ->contain(['Students'])\n ->where($where) \n ->where(['is_deleted'=>'N'])\n ->where(['StudentInfos.session_year_id'=>$this->Auth->user('session_year_id')]);\n foreach ($response as $key => $value) {\n $option[$value->id]=$value->name;\n } \n if(!empty($option)){\n foreach ($option as $key => $value) {\n echo \"<option value='\".$key.\"'>\".$value.\"</option>\";\n }\n }\n exit;\n \n }", "public function result() : array;", "public static function get_coursedata_returns() {\n return new external_multiple_structure(\n new external_single_structure(\n array(\n 'courseid' => new external_value(PARAM_INT, 'Course ID'),\n 'coursename' => new external_value(PARAM_TEXT, 'The course module type name'),\n 'selected' => new external_value(PARAM_BOOL, 'if the course is selected'),\n 'shortname' => new external_value(PARAM_TEXT, 'Clipped course module name'),\n )\n )\n );\n }", "public function results()\n\t{\n\t\t// using any existing $resource, process the results into a stdClass object:\n\t\t$out = array();\n\n\t\t// if the resource exists, proceed:\n\t\tif (isset(self::$resource))\n\t\t{\n\t\t\t// loop through the results and add them to the object:\n\t\t\twhile ($row = mysql_fetch_assoc(self::$resource))\n\t\t\t{\n\t\t\t\t$out[] = (object)$row;\n\t\t\t}\n\t\t}\n\n\t\t// return $out as an object:\n\t\treturn (object)$out;\n\t}", "public function results(): array;", "public function resultSet()\n\t{\n\t\t$this->execute();\n\t\treturn $this->stm->fetchAll(PDO::FETCH_OBJ);\n\t}", "public function get_result_arr()\n {\n return $this->result_object;\n }", "public function fetch(): array\n {\n }", "public function get_assignments(){\n if($this->ID != NULL){\n $sql = \"SELECT ID FROM assignment WHERE Task=\".$this->ID.\";\";\n $myAssignmentIDs = $this->get_by_query($sql);\n $myAssignmentsList = array();\n foreach ($myAssignmentIDs as &$aID) {\n $myAssignment = new Assignment();\n $myAssignment = $myAssignment->get_by_ID($aID['ID']);\n array_push($myAssignmentsList, $myAssignment);\n }\n return $myAssignmentsList;\n }\n }", "public function fetchResults(){\n $resultsValues = $this->data;\n return $resultsValues;\n }", "public function getResult(): array;", "public function getResult(): array;", "public function getResult() {\n $this->execute();\n return $this->statement->fetchAll(PDO::FETCH_OBJ);\n }", "function &getIncompleteReviewAssignments() {\n\t\t$reviewAssignments = array();\n\t\t$reviewRoundJoinString = $this->getReviewRoundJoin();\n\t\tif ($reviewRoundJoinString) {\n\t\t\t$result =& $this->retrieve(\n\t\t\t\t\t\t'SELECT\tr.*, r2.review_revision, u.first_name, u.last_name\n\t\t\t\t\t\tFROM\treview_assignments r\n\t\t\t\t\t\t\tLEFT JOIN users u ON (r.reviewer_id = u.user_id)\n\t\t\t\t\t\t\tLEFT JOIN review_rounds r2 ON (' . $reviewRoundJoinString . ')\n\t\t\t\t\t\tWHERE' . $this->getIncompleteReviewAssignmentsWhereString() .\n\t\t\t\t\t\t' ORDER BY r.submission_id'\n\t\t\t);\n\n\t\t\twhile (!$result->EOF) {\n\t\t\t\t$reviewAssignments[] =& $this->_fromRow($result->GetRowAssoc(false));\n\t\t\t\t$result->MoveNext();\n\t\t\t}\n\n\t\t\t$result->Close();\n\t\t\tunset($result);\n\t\t} else {\n\t\t\tassert(false);\n\t\t}\n\n\t\treturn $reviewAssignments;\n\t}", "function _fetch_object()\n\t{\n\t\treturn sqlsrv_fetch_object($this->result_id);\n\t}", "public function toArray()\n {\n return $this->fetchData;\n }", "public function getResult()\n {\n return $this->toArray();\n }", "public function fetch_array() {\n\t\treturn $this->FetchArray();\n\t}", "public function fetchAssoc();", "public function fetchAssoc();", "public function fetch_all(){\n $data = array();\n while( ($obj = oci_fetch_object($this->result)) != false ){\n $data[] = $obj;\n }\n return $data;\n }", "function get_assignment($assignID)\n {\n return $this->db->get_where('assignments',array('assignID'=>$assignID))->row_array();\n }" ]
[ "0.6079891", "0.5775245", "0.56779313", "0.5524798", "0.5524584", "0.5456906", "0.54508907", "0.5371566", "0.5369513", "0.536701", "0.53639233", "0.5360753", "0.5358782", "0.5357101", "0.53388214", "0.5312464", "0.5295264", "0.529437", "0.5271157", "0.5271157", "0.5266292", "0.52336794", "0.5232216", "0.5186428", "0.5181655", "0.5172207", "0.516916", "0.516916", "0.5157035", "0.5153617" ]
0.59524477
1
Adds an assignment to a layer 2 net
public function add_layer2_assignment($p_layer2_id, $p_obj_id) { $l_insert = 'INSERT INTO isys_cats_layer2_net_2_layer3 (isys_cats_layer2_net_list__id, isys_obj__id) VALUES'; if (is_numeric($p_layer2_id)) { $l_insert .= ' (' . $this->convert_sql_id($p_layer2_id) . ', ' . $this->convert_sql_id($p_obj_id) . ')'; } elseif (is_array($p_layer2_id) && count($p_layer2_id) > 0) { foreach ($p_layer2_id AS $l_id) { $l_insert .= ' (' . $this->convert_sql_id($l_id) . ', ' . $this->convert_sql_id($p_obj_id) . '), '; } $l_insert = rtrim($l_insert, ', '); } // if return ($this->update($l_insert) && $this->apply_update()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected /*int*/ function addAssignment(/*int*/ $m, /*int*/ $d, /*int*/ $y, /*string*/ $description, /*int*/ $section)\n\t{\n\t\treturn $this->updateAssignment(null, $m, $d, $y, $description, $section);\n\t}", "public function createassignment()\n {\n $material = new material();\n\n }", "function sb_assignment_insert ($node) {\n\n db_query(\"INSERT INTO {eto_assignments}\n (\" . $node->key_field . \", \" . $node->target_field . \")\n VALUES\n (%d, %d)\",\n\t $node->uid, $node->selected_uid);\n\n}", "function addReviewAssignment($reviewAssignment) {\r\n\t\tif ($reviewAssignment->getDecisionId() == null) {\r\n\t\t\t$reviewAssignment->setDecisionId($this->getId());\r\n\t\t}\r\n\r\n\t\tif (isset($this->reviewAssignments)) {\r\n\t\t\t$reviewAssignments = $this->reviewAssignments;\r\n\t\t} else {\r\n\t\t\t$reviewAssignments = Array();\r\n\t\t}\r\n\t\tarray_push($reviewAssignments, $reviewAssignment);\r\n\r\n\t\treturn $this->reviewAssignments = $reviewAssignments;\r\n\t}", "public function creating(assignment $assignment)\n {\n //code...\n }", "function tutor_assignment_add($username, $type) {\n $type = rtrim($type, \"s\");\n\n $title = \"Add a $type to $username\";\n drupal_set_title($title);\n $output = \"<h2>$title</h2>\";\n\n $user = eto_user_load(array('name' => $username));\n\n $node = (object) array ('uid' => $user->uid,\n\t\t\t 'type' => $type);\n\n $output .= drupal_get_form('add_assignment_form', $node);\n\n return $output;\n}", "function add_assignment($params)\n {\n $this->db->insert('assignments',$params);\n return $this->db->insert_id();\n }", "public function addAssignedProductAction() {\n\n $view = new ZendModel\\JsonModel(array(\n 'state' => 'ok'\n ));\n\n $productId = $this->params()->fromRoute('value', null);\n $linkedProductId = $this->params()->fromRoute('value2', null);\n $productRelation = $this->params()->fromRoute('param2');\n\n // get model(s)\n $productModel = new Model\\ProductModel($this->getServiceLocator(), $this->logger);\n\n try {\n /* @var $product \\Ffb\\Backend\\Entity\\ProductEntity */\n /* @var $assignedProduct \\Ffb\\Backend\\Entity\\ProductEntity */\n $product = $productModel->findById($productId);\n $assignedProduct = $productModel->findById($linkedProductId);\n\n // productService\n /* @var $productService Service\\ProductService */\n $productService = $this->_getService('Ffb\\Backend\\Service\\ProductService');\n\n switch ($productRelation) {\n case Entity\\ProductEntity::TYPE_LINKED_PRODUCT:\n $hasLinkedProduct = $product->getLinkedProducts()->contains($assignedProduct);\n if (!$hasLinkedProduct) {\n // add linkedProduct\n $product->getLinkedProducts()->add($assignedProduct);\n }\n break;\n\n case Entity\\ProductEntity::TYPE_ACCESSORY_PRODUCT:\n $hasAccessoryProduct = $product->getAccessoryProducts()->contains($assignedProduct);\n if (!$hasAccessoryProduct) {\n // add accessoryProduct\n $product->getAccessoryProducts()->add($assignedProduct);\n }\n break;\n\n default:\n break;\n }\n\n // update\n $productModel->update($product);\n\n $view->setVariable('assignedProductsList', $productService->getAssignedProductsList($product, $productRelation));\n\n } catch (Exception $e) {\n $this->_displayException($view, $e);\n }\n\n return $view;\n }", "public function saving(assignment $assignment)\n {\n //code...\n }", "public function addLayer(LayerInterface $layer);", "public function saved(assignment $assignment)\n {\n //code...\n }", "function add_assignment($userid) {\n global $CFG;\n $assign = new stdClass;\n $assign->userid = $userid;\n $assign->ticketid = $this->id;\n $rval = insert_record('helpdesk_ticket_assignments', $assign, false);\n if (!$rval) {\n return false;\n }\n\n // Now lets add an update for what changed. We want to track things like\n // this from now on.\n $urecord = get_record('user', 'id', $userid);\n $dat = new stdClass;\n $dat->ticketid = $this->id;\n $dat->notes = fullname($urecord) . ' '\n . get_string('wasassigned', 'block_helpdesk');\n $dat->status = HELPDESK_NATIVE_UPDATE_ASSIGN;\n $dat->type = HELPDESK_UPDATE_TYPE_DETAILED;\n if(!$this->add_update($dat)) {\n notify(get_string('cantaddupdate', 'block_helpdesk'));\n }\n\n $this->fetch();\n $this->store();\n return true;\n }", "public function addAction() {\n\t\tlist(, $groups) = Resource_Service_Pgroup::getAllPgroup();\n\t\t$this->assign('groups', $groups);\n\t\t$this->assign('ntype', $this->ntype);\n\t\t$this->assign('btype', $this->btype);\n\t}", "public function updating(assignment $assignment)\n {\n //code...\n }", "function add_vehicle_geofence_assignment($params) {\n $params['status'] = 1;\n $this->db->insert('vehicle_geofence_assignment', $params);\n return $this->db->insert_id();\n }", "public function addLayer(ImageLayerInterface $layer, $name = null);", "public function addIndividual()\n {\n }", "function addAssignmentToDatabase($name, $code, $teacher_id) {\n\t\t# Inserts user into database\n\t\t$result = mysql_query(\"INSERT INTO Assignments (Assignment_Code, Name, Teacher_ID) VALUES ( '$code', '$name', '$teacher_id' )\")\n\t\t\tor die(\"<p>Error inserting into the database: \" .\n\t\t\t\t\tmysql_error() . \"</p>\");\n\t}", "function create_binding() {\r\n\t\ttry {\r\n\t\t\t$conn = db_connect::getInstance();\r\n\t\t\t$result = $conn->db->query(\"SELECT OLT_ID from OLT_IP_POOLS where OLT_ID = '$this->olt_id'\");\r\n\t\t} catch (PDOException $e) {\r\n\t\t\t$error = \"Connection Failed:\" . $e->getMessage() . \"\\n\";\r\n\t\t\treturn $error;\r\n\t\t}\r\n\t\twhile ($row = $result->fetch(PDO::FETCH_ASSOC)) {\r\n\t\t\tif ($row[\"OLT_ID\"])\r\n\t\t\t\t$error = (\"ERROR: THIS OLT have been ASSIGNED pool ALREADY, Please remove any existing bindings and try to create again!\");\r\n\t\t\t\treturn $error;\t\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$conn = db_connect::getInstance();\r\n\t\t\t$result = $conn->db->query(\"INSERT INTO OLT_IP_POOLS (OLT_ID, IP_POOL_ID) VALUES ('$this->olt_id', '$this->id')\");\r\n\t\t} catch (PDOException $e) {\r\n\t\t\t$error = \"Connection Failed:\" . $e->getMessage() . \"\\n\";\r\n\t\t\treturn $error;\r\n\t\t}\r\n\t}", "function add_network_option($network_id, $option, $value)\n {\n }", "public function addAction() {\r\n \t$this->checkRight();\r\n \t$gid = $this->getInput('gid');\r\n \t$title = \"添加收货人地址\";\r\n \t$this->assign('title', $title);\r\n \t$this->assign('gid', $gid);\r\n }", "public function updated(assignment $assignment)\n {\n //code...\n }", "public function add_requirement( sn\\base\\requirement\\I_Requirement $requirement );", "public function setAssignments($val)\n {\n $this->_propDict[\"assignments\"] = $val;\n return $this;\n }", "public function setAssignments(AssignmentExpression ...$assignments): void;", "public function Add(&$entity)\n {\n \n }", "public function addAction() {\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}", "public function addAction() {\r\n\t\t$this->assign('channels', $this->channels);\r\n\t}", "function assignObject()\n\t{\n\t\tif ($this->id != 0)\n\t\t{\n\t\t\tif ($this->call_by_reference)\n\t\t\t{\n\t\t\t\t$this->object =& new ilObjAICCLearningModule($this->id, true);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->object =& new ilObjAICCLearningModule($this->id, false);\n\t\t\t}\n\t\t}\n\t}", "function assignment_functions(&$reference) {\n\n // make the main library object available\n $this->mainobject = $reference;\n // must be the same as the DB modulename\n $this->type = 'assignment';\n $this->capability = 'mod/assignment:grade';\n $this->icon = 'mod/assignment/icon.gif';\n // this array is used to match the types which are returned from the nodes\n // being clicked in the ajax tree to the functions which return the next\n // level of the tree. The initial course->assessment node one is built in,\n // so you just need to add the second and possibly third level connections.\n // Groups nodes asre also added aoutomatically. If your module just has two\n // levels, leave the array empty.\n $this->functions = array(\n 'assignment' => 'submissions'\n );\n $this->levels = 3;\n\n }" ]
[ "0.5456431", "0.528159", "0.5230708", "0.5214009", "0.51222724", "0.4987853", "0.49876687", "0.494615", "0.49454787", "0.49289206", "0.4928357", "0.49164444", "0.4906988", "0.4850088", "0.48349604", "0.48049197", "0.47950748", "0.47542822", "0.47101262", "0.4702016", "0.4687277", "0.46786237", "0.46671963", "0.4661705", "0.46277466", "0.46249437", "0.45591718", "0.4548634", "0.4540165", "0.4530575" ]
0.6353559
0
function Removes an assignment to a layer 2 net
public function remove_layer2_assignment($p_layer2_id, $p_obj_id) { $l_delete = 'DELETE FROM isys_cats_layer2_net_2_layer3 WHERE isys_obj__id = ' . $this->convert_sql_id($p_obj_id) . ' AND '; if (is_numeric($p_layer2_id)) { $l_delete .= ' isys_cats_layer2_net_list__id = ' . $this->convert_sql_id($p_layer2_id); } elseif (is_array($p_layer2_id) && count($p_layer2_id) > 0) { $l_delete .= ' isys_cats_layer2_net_list__id IN (' . implode(',', $p_layer2_id) . ')'; } else { $l_delete .= ' isys_cats_layer2_net_list__id = FALSE'; } // if return ($this->update($l_delete) && $this->apply_update()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeLayer($name);", "public function remove_operator_from_work() {\n $this->operator_on_work = null;\n }", "public function removeLabel(): void\n {\n $this->labelName = null;\n $this->label = false;\n }", "function tearDown() {\n // delete your instance\n unset($this->layer0);\n }", "abstract public function remove();", "abstract public function remove();", "abstract public function remove();", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "private function desabilitaPoolIdsObjetosManipulados()\n {\n \t// setando para null o atributo _arrayObjetosManipulados\n \t$this->_arrayObjetosManipulados = null;\n }", "public function detachRule($tname)\n {\n if(isset($this->rules_objects_list[$tname]))\n $this->rules_objects_list[$tname] = null;\n }", "public function action_remove(){\n $abuse = ORM::factory('BoardAbuse', $this->request->param('id'));\n if($abuse->loaded()){\n if($abuse->ad->loaded())\n $abuse->ad->delete();\n $abuse->delete();\n }\n $this->redirect('admin/boardAbuses' . URL::query());\n }", "public function __unset($_name);", "public function __unset($name);", "public function undoFinalDeny()\n {\n $this->finalDeny = null;\n $this->decisionViewed = null;\n $this->decisionLetter = null;\n }", "public function remove_assignment($objToAssign){\n if($this->ID != NULL and\n $objToAssign instanceof Employee and\n $objToAssign->ID != NULL){\n $myAssignment = new Assignment();\n $myAssignment = $myAssignment->get_by_task_DEV($this->ID, $objToAssign->ID);\n $myAssignment->delete();\n return $myAssignment;\n }\n }", "public function remove() {}", "public static function commandUnAssign(){\n\n self::$console->register('tasks:unassign')\n ->setDescription('Remove assigned user from a task')\n ->setDefinition(array(\n new InputArgument('taskid', InputArgument::REQUIRED, \"Task ID\"),\n new InputArgument('user', InputArgument::REQUIRED, \"User ID\")\n ))\n ->setCode(function (InputInterface $input, OutputInterface $output) {\n $taskid = (int) $input->getArgument(\"taskid\");\n $user = $input->getArgument(\"user\");\n\n if(!is_numeric($user)){\n //user didn't enter an id, search for the id by string:\n $usr = new UserCommands();\n $user = $usr->getUseridFromString($user);\n }\n\n $params = array(\n \"taskid\" => $taskid,\n \"userid\" => $user,\n \"modifyrecurrency\" => 0,\n \"isassignee\" => false,\n );\n $re = Task::AssignUserTask($params);\n print_r($re);\n\n });\n }", "abstract public function mass_remove();", "public function remove() {}", "public function removeAssignments()\n {\n return Yii::$app->authManager->revokeAll($this->user->id);\n }", "public function __unset($label) {\n\t\t$this->remove($label);\n\t}", "private function resetnsAction(){\n\t\t\n\t\t$this -> adminNS -> __unset('bikeAds');\n\t\t$this -> adminNS -> __unset('bikePhoto');\n\t\t$this -> adminNS -> __unset('bikeInsert');\t\t\n\t}", "public function __unset($name)\n {\n $this->var_holder->remove($name);\n }", "public function __unset($name)\n {\n // Dont' allow to unset attributes Ruts\n }", "function action_remove() {\n\t\t\t$data = UTIL::get_post('data');\n\t\t\t$id = (int)$data['rem_id'];\n\t\t\t$table = $data['rem_table'];\n\t\t\t\n\t\t\t$choosen = $this->SESS->get('objbrowser', 'choosen');\n\t\t\tunset($choosen[$table][$id]);\n\t\t\tif (count($choosen[$table]) == 0) unset($choosen[$table]);\n\t\t\t\n\t\t\t$this->SESS->set('objbrowser', 'choosen', $choosen);\n\t\t}", "public function deactivate( $network_wide ){\n\n\t}", "public function deactivate( $network_wide ){\n\n\t}" ]
[ "0.5997162", "0.56624967", "0.5405586", "0.5310008", "0.52660835", "0.52660835", "0.52660835", "0.5262007", "0.5262007", "0.5262007", "0.5262007", "0.5227345", "0.5225083", "0.51141924", "0.5104677", "0.5099703", "0.5096705", "0.5073066", "0.5050881", "0.5050053", "0.5049905", "0.5049572", "0.5027147", "0.50210327", "0.5013987", "0.5011651", "0.49885076", "0.49876556", "0.49873832", "0.49873832" ]
0.6610109
0
function Merges posted ipv6 and ipv4 data into one address so that the addresses are stored in only one database field.
private function merge_posted_ip_data($p_net_type) { $l_subnet = $l_gw = $l_from = $l_to = $l_net = ""; switch ($p_net_type) { case 1001: case C__CATS_NET_TYPE__IPV4: $l_subnet = $_POST['C__CATS__NET__MASK_V4']; $l_from = $_POST['C__CATS__NET__ADDRESS_RANGE_FROM_V4']; $l_to = $_POST['C__CATS__NET__ADDRESS_RANGE_TO_V4']; $l_net = $_POST['C__CATS__NET__NET_V4']; break; case C__CATS_NET_TYPE__IPV6: $l_gw = $_POST['C__CATS__NET__DEF_GW_V6']; $l_subnet = $_POST['C__CATS__NET__MASK_V6']; $l_from = $_POST['C__CATS__NET__ADDRESS_RANGE_FROM']; $l_to = $_POST['C__CATS__NET__ADDRESS_RANGE_TO']; $l_net = $_POST['C__CATS__NET__NET_V6']; break; } // switch return [ C__IP__SUBNET => $l_subnet, C__IP__GATEWAY => $l_gw, C__IP__NET => $l_net, "ADDRESS_FROM" => $l_from, "ADDRESS_TO" => $l_to ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inet6_expand($addr)\r\n{\r\n /* Check if there are segments missing, insert if necessary */\r\n if (strpos($addr, '::') !== false) {\r\n $part = explode('::', $addr);\r\n $part[0] = explode(':', $part[0]);\r\n $part[1] = explode(':', $part[1]);\r\n $missing = array();\r\n for ($i = 0; $i < (8 - (count($part[0]) + count($part[1]))); $i++)\r\n array_push($missing, '0000');\r\n $missing = array_merge($part[0], $missing);\r\n $part = array_merge($missing, $part[1]);\r\n } else {\r\n $part = explode(\":\", $addr);\r\n } // if .. else\r\n /* Pad each segment until it has 4 digits */\r\n foreach ($part as &$p) {\r\n while (strlen($p) < 4) $p = '0' . $p;\r\n } // foreach\r\n unset($p);\r\n /* Join segments */\r\n $result = implode(':', $part);\r\n /* Quick check to make sure the length is as expected */ \r\n if (strlen($result) == 39) {\r\n return $result;\r\n } else {\r\n return false;\r\n } // if .. else\r\n}", "function post_getFromDB () {\n\n // Be sure to remove addresses, otherwise reusing will provide old objects for getAddress, ...\n unset($this->address);\n unset($this->netmask);\n unset($this->gateway);\n\n if (isset($this->fields[\"address\"])\n && isset($this->fields[\"netmask\"])) {\n if ($this->fields[\"version\"] == 4) {\n $this->fields[\"network\"] = sprintf(__('%1$s / %2$s'), $this->fields[\"address\"],\n $this->fields[\"netmask\"]);\n } else { // IPv6\n $this->fields[\"network\"] = sprintf(__('%1$s / %2$s'), $this->fields[\"address\"],\n $this->fields[\"netmask\"]);\n }\n }\n\n }", "public static function normalizeCompressIPv6DataProviderCorrect() {}", "function ints_to_ip6($a) {\n\t$b = array();\n\tforeach ($a as $i) {\n\t\t$b[] = dechex($i);\n\t}\n\t$s = implode(':', $b);\n\t$s = preg_replace('/(^|:)0(:0)+(:|$)/', '::', $s, 1);\n\treturn $s;\n}", "public function findAddress()\n {\n $regex = '/.{1,100}[A-Z]{1,2}[0-9]{1}[A-Z0-9]*\\s+[0-9]{1}[A-Z]{2}/si';\n\n if (preg_match_all($regex, $this->data, $matches)) {\n $uniques = array_values(array_unique($matches[0]));\n foreach ($uniques as $key => $address) {\n $uniques[$key] = preg_replace(\"/[\\s\\r\\n]*[|]+[\\s\\r\\n]*/\", \", \", $address);\n }\n $this->address = $uniques;\n }\n }", "function uncompress($ip) {\n\t\t\tif (!($type = IPv6::validate_ip($ip)))\n\t\t\t\treturn false;\n\n\t\t\t// Add additional colon's, until 7 (or 6 in case of an IPv4 (mapped) address\n\t\t\twhile (substr_count($ip, \":\") < (substr_count($ip, \".\") == 3 ? 6 : 7))\n\t\t\t\t$ip = substr_replace($ip, \"::\", strpos($ip, \"::\"), 1);\n\n\t\t\t$ip = explode(\":\", $ip);\n\n\t\t\t// Replace the IPv4 address with hexadecimals if needed\n\t\t\tif (in_array($type, array(\"ipv4\", \"ipv4_mapped\"))) {\n\t\t\t\t$ipv4 = $ip[count($ip)-1];\n\t\t\t\t$ipv4hex = IPv4::iptohex($ipv4);\n\t\t\t\t$hex = sprintf(\"%08s\", IPv4::iptohex($ipv4));\n\t\t\t\t$ip[count($ip)-1] = substr($hex, 0, 4);\n\t\t\t\t$ip[] = substr($hex, 4, 4);\n\t\t\t}\n\n\t\t\t// Add leading 0's in every part, up until 4 characters\n\t\t\tforeach ($ip as $index => $part)\n\t\t\t\t$ip[$index] = sprintf(\"%04s\", $part);\n\n\t\t\treturn implode(\":\", $ip);\n\t\t}", "protected static function fixIpv6($ip){\n\t\t\t// fix double colon\n\t\t\tif(strpos($ip,'::')!==false)$ip=str_replace('::',str_repeat(':',9-substr_count($ip,':')),$ip);\n\t\t\t// fix each slot\n\t\t\t$ip=explode(':',$ip);\n\t\t\tforeach($ip as $k=>$v){\n\t\t\t\t// fix empty/compressed slots\n\t\t\t\t$ip[$k]=$v=str_pad($v,4,'0',STR_PAD_LEFT);\n\t\t\t\t// fix ipv4-style slot\n\t\t\t\tif(strpos($v,'.')!==false){\n\t\t\t\t\t// initially empty buffer\n\t\t\t\t\t$ip[$k]='';\n\t\t\t\t\t// replace each number(byte) with a two-digit hex representation\n\t\t\t\t\tforeach(explode('.',$v) as $v2){\n\t\t\t\t\t\t$v=dechex(min((int)$v2,255));\n\t\t\t\t\t\tif(strlen($v)==1)$v='0'.$v;\n\t\t\t\t\t\t$ip[$k].=$v;\n\t\t\t\t\t}\n\t\t\t\t\t// add colon in between two pairs(bytes) (FFFFFFFF=>FFFF:FFFF)\n\t\t\t\t\t$ip[$k]=implode(':',str_split($ip[$k],4));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn strtoupper(implode(':',$ip));\n\t\t}", "private function setIPv6( $addr, $mask )\n\t{\n\t\t$this->net_addr = @inet_pton($addr);\n\t\tif( $this->net_addr == false )\n\t\t{\n\t\t\tthrow new \\Exception( \"invalid ip address {$addr}\" );\n\t\t} \n\t\t$this->valid = true;\n\t\t$this->net_addr_long = $this->inet_ntogmp( $this->net_addr );\n\t\t//$this->inet_gmpton( $this->net_addr_long );\n\t\t\t\n\t\t// set the netmask\n\t\tif( preg_match( '/^[0-9]+$/', $mask ))\n\t\t{\n\t\t\t$this->net_mask_bits = intval( $mask );\n\t\t\tif( $this->ipv4 && $this->net_mask_bits != 0 ){\n\t\t\t\t$this->net_mask_bits += 96;\n\t\t\t}\n\t\t\t$this->net_mask_long = \\gmp_mul( \\gmp_sub( gmp_pow( 2, $this->net_mask_bits ), 1 ), \\gmp_pow( 2, 128-$this->net_mask_bits ));\n\t\t\t//\t\t\techo gmp_strval( $this->net_mask_long, 2 ).\"<br />\\n\";\n\t\t\t$this->net_mask = $this->inet_gmpton($this->net_mask_long);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->net_mask = inet_pton($mask);\n\t\t\t$this->net_mask_long = $this->inet_ntogmp($this->netmask);\n\t\t\t$this->net_mask_bits = \\gmp_scan0( $this->net_mask_long, 0 );\n\t\t}\n\t\t\t\n\t\t// normalize it...\n\t\t$this->net_addr_long = \\gmp_and( $this->net_addr_long, $this->net_mask_long );\n\t\t$this->net_addr = $this->inet_gmpton( $this->net_addr_long );\n\t\t$this->net_broadcast_long = \\gmp_or( $this->net_addr_long, \\gmp_sub( \\gmp_pow( 2, 128-$this->net_mask_bits ), 1 ));\n\t\t$this->net_broadcast = $this->inet_gmpton($this->net_broadcast_long );\n\t}", "function int64_to_inet6($val)\r\n{\r\n /* Make sure input is an array with 2 numerical strings */\r\n $result = false;\r\n if ( ! is_array($val) || count($val) != 2) return $result;\r\n $p1 = gmp_strval(gmp_init($val[0]), 16);\r\n $p2 = gmp_strval(gmp_init($val[1]), 16);\r\n while (strlen($p1) < 16) $p1 = '0' . $p1;\r\n while (strlen($p2) < 16) $p2 = '0' . $p2;\r\n $addr = $p1 . $p2;\r\n for ($i = 0; $i < 8; $i++) {\r\n $result .= substr($addr, $i * 4, 4);\r\n if ($i != 7) $result .= ':';\r\n } // for\r\n return inet6_compress($result);\r\n}", "private function ipToHex($ipAddress)\n {\n $hex = '';\n if (strpos($ipAddress, ',') !== false)\n {\n $splitIp = explode(',', $ipAddress);\n $ipAddress = trim($splitIp[0]);\n }\n $isIpV6 = false;\n $isIpV4 = false;\n if (filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false)\n {\n $isIpV6 = true;\n }\n elseif (filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false)\n {\n $isIpV4 = true;\n }\n if (! $isIpV4 && ! $isIpV6)\n {\n return false;\n }\n // IPv4 format\n if ($isIpV4)\n {\n $parts = explode('.', $ipAddress);\n for ($i = 0; $i < 4; $i++)\n {\n $parts[ $i ] = str_pad(dechex($parts[ $i ]), 2, '0', STR_PAD_LEFT);\n }\n $ipAddress = '::' . $parts[0] . $parts[1] . ':' . $parts[2] . $parts[3];\n $hex = implode('', $parts);\n } // IPv6 format\n else\n {\n $parts = explode(':', $ipAddress);\n // If this is mixed IPv6/IPv4, convert end to IPv6 value\n if (filter_var($parts[ count($parts) - 1 ], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false)\n {\n $partsV4 = explode('.', $parts[ count($parts) - 1 ]);\n for ($i = 0; $i < 4; $i++)\n {\n $partsV4[ $i ] = str_pad(dechex($partsV4[ $i ]), 2, '0', STR_PAD_LEFT);\n }\n $parts[ count($parts) - 1 ] = $partsV4[0] . $partsV4[1];\n $parts[] = $partsV4[2] . $partsV4[3];\n }\n $numMissing = 8 - count($parts);\n $expandedParts = [];\n $expansionDone = false;\n foreach ($parts as $part)\n {\n if (! $expansionDone && $part == '')\n {\n for ($i = 0; $i <= $numMissing; $i++)\n {\n $expandedParts[] = '0000';\n }\n $expansionDone = true;\n }\n else\n {\n $expandedParts[] = $part;\n }\n }\n foreach ($expandedParts as &$part)\n {\n $part = str_pad($part, 4, '0', STR_PAD_LEFT);\n }\n $ipAddress = implode(':', $expandedParts);\n $hex = implode('', $expandedParts);\n }\n // Validate the final IP\n if (! filter_var($ipAddress, FILTER_VALIDATE_IP))\n {\n return false;\n }\n\n return strtolower(str_pad($hex, 32, '0', STR_PAD_LEFT));\n }", "function inet6_compress($addr)\r\n{\r\n /* PHP provides a shortcut for this operation */\r\n $result = inet_ntop(inet_pton($addr));\r\n return $result;\r\n}", "function verifyAndCleanAddresses($data, $subnets_allowed = 'subnets-allowed') {\n\t/** Remove extra spaces */\n\t$data = preg_replace('/\\s\\s+/', ' ', $data);\n\t\n\t/** Swap delimiters for ; */\n\t$data = str_replace(array(\"\\n\", ';', ' ', ','), ',', $data);\n\t$data = str_replace(',,', ',', $data);\n\t$data = trim($data, ',');\n\t\n\t$addresses = explode(',', $data);\n\tforeach ($addresses as $ip_address) {\n\t\t$cidr = null;\n\n\t\t$ip_address = rtrim(trim($ip_address), '.');\n\t\tif (!strlen($ip_address)) continue;\n\t\t\n\t\t/** Handle negated addresses */\n\t\tif (strpos($ip_address, '!') === 0) {\n\t\t\t$ip_address = substr($ip_address, 1);\n\t\t}\n\t\t\n\t\tif (strpos($ip_address, '/') !== false && $subnets_allowed == 'subnets-allowed') {\n\t\t\t$cidr_array = explode('/', $ip_address);\n\t\t\tlist($ip_address, $cidr) = $cidr_array;\n\t\t}\n\t\t\n\t\t/** IPv4 checks */\n\t\tif (strpos($ip_address, ':') === false) {\n\t\t\t/** Valid CIDR? */\n\t\t\tif ($cidr && !checkCIDR($cidr, 32)) return sprintf(__('%s is not valid.'), \"$ip_address/$cidr\");\n\t\t\t\n\t\t\t/** Create full IP */\n\t\t\t$ip_octets = explode('.', $ip_address);\n\t\t\tif (count($ip_octets) < 4) {\n\t\t\t\t$ip_octets = array_merge($ip_octets, array_fill(count($ip_octets), 4 - count($ip_octets), 0));\n\t\t\t}\n\t\t\t$ip_address = implode('.', $ip_octets);\n\t\t} else {\n\t\t\t/** IPv6 checks */\n\t\t\tif ($cidr && !checkCIDR($cidr, 128)) return sprintf(__('%s is not valid.'), \"$ip_address/$cidr\");\n\t\t}\n\t\t\n\t\tif (verifyIPAddress($ip_address) === false) return sprintf(__('%s is not valid.'), $ip_address);\n\t}\n\t\n\treturn $data;\n}", "public static function IPv6Hex2BinDataProviderCorrect() {}", "public function parseAddressesProvider() {}", "function ip_is_local($ip){\r\n\t\r\n\t $ipv4array = explode('.',$ip); $ipv6array = explode(':',$ip);\r\n\t $lenipv4 = count($ipv4array) ; $lenipv6 = count($ipv6array); \r\n\t $ipint = array(); \r\n\t if($lenipv4 > 0 ){//We have an ipv4 address\r\n\t\t for ($i = 0 ; $i<$lenipv4 ; $i++){\r\n\t\t\t $ipint[$i] = intval($ipv4array[$i]) ; //Generating integera values for the ips\r\n\t\t }\r\n\t\t \r\n\t\t\t//Let's see if our IP is riv ate\r\n\t\t\tif ($ipint[0] == 10) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else if ($ipint[0] == 172 && $ipint[1] > 15 && $ipint[1] < 32) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else if ($ipint[0] == 192 && $ipint[1] == 168) {\r\n\t\t\t\treturn true;\r\n\t\t\t}else return false ;\r\n\t }else{\r\n\t //Either something went wrong, or we are in IPV6 format.\t \r\n\t\t \r\n\t\t if( $lenipv6 > 0){//We are having a big IPV6 address here !\r\n\t\t\t //We are in IPV4. Haven't implemented IPV6 yet\r\n\t\t\t \r\n\t\t }\r\n\t\t return false ;\r\n\t }\r\n\t \r\n\t \r\n\t return false;\r\n}", "function mswIPAddresses() {\n $ip = array();\n if (!empty($_SERVER['HTTP_CLIENT_IP'])) {\n $ip[] = $_SERVER['HTTP_CLIENT_IP'];\n } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'],',')!==FALSE) {\n $split = explode(',',$_SERVER['HTTP_X_FORWARDED_FOR']);\n foreach ($split AS $value) {\n $ip[] = $value;\n }\n } else {\n $ip[] = $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n } else {\n $ip[] = (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '');\n }\n return (!empty($ip) ? implode(', ',$ip) : '');\n}", "public static function IPv6Bin2HexDataProviderCorrect() {}", "public static function ip2Address($ip){\n\n //Could we return from recently fetched ones?\n if(array_key_exists($ip,self::$RECENT_IP2ADDRESSES)){\n return self::$RECENT_IP2ADDRESSES[$ip];\n }\n\n \n //$ip_database_path=//self::basePath().'/database/geoip2';\n \n $city_database=base_path().'/'.ltrim(config('laradmin.geoip.db_city_filename','\\\\/'));//$ip_database_path.'/GeoLite2-City.mmdb';\n //$country_database=$ip_database_path.'/GeoLite2-Country.mmdb';\n\n // This creates the Reader object, which should be reused across\n // lookups.\n $reader = new \\GeoIp2\\Database\\Reader($city_database);\n\n // Replace \"city\" with the appropriate method for your database, e.g.,\n // \"country\".\n\n $record = $reader->city($ip);\n $address=[];\n\n $address['latitude']=$record->location->latitude;\n $address['longitude']=$record->location->longitude;\n $address['city_name']=$record->city->name; \n $address['country_name']=$record->country->name;\n //$address['country_iso_code']=$record->country->isoCode; NOTE: OPEN THIS IF NEEDED\n\n\n // Save some recent address: TODO: Change this to proper catching so that it can be used across sessions.\n self::$RECENT_IP2ADDRESSES[$ip]=$address;\n if(count(self::$RECENT_IP2ADDRESSES)>3){\n array_shift(self::$RECENT_IP2ADDRESSES);\n }\n\n return $address;\n \n }", "public static function sanitizeIP( $ip ) {\n $ip = trim( $ip );\n if ( $ip === '' ) {\n return null;\n }\n if ( self::isIPv4( $ip ) || !self::isIPv6( $ip ) ) {\n return $ip; // nothing else to do for IPv4 addresses or invalid ones\n }\n // Remove any whitespaces, convert to upper case\n $ip = strtoupper( $ip );\n // Expand zero abbreviations\n $abbrevPos = strpos( $ip, '::' );\n if ( $abbrevPos !== false ) {\n // We know this is valid IPv6. Find the last index of the\n // address before any CIDR number (e.g. \"a:b:c::/24\").\n $CIDRStart = strpos( $ip, \"/\" );\n $addressEnd = ( $CIDRStart !== false )\n ? $CIDRStart - 1\n : strlen( $ip ) - 1;\n // If the '::' is at the beginning...\n if ( $abbrevPos == 0 ) {\n $repeat = '0:';\n $extra = ( $ip == '::' ) ? '0' : ''; // for the address '::'\n $pad = 9; // 7+2 (due to '::')\n // If the '::' is at the end...\n } elseif ( $abbrevPos == ( $addressEnd - 1 ) ) {\n $repeat = ':0';\n $extra = '';\n $pad = 9; // 7+2 (due to '::')\n // If the '::' is in the middle...\n } else {\n $repeat = ':0';\n $extra = ':';\n $pad = 8; // 6+2 (due to '::')\n }\n $ip = str_replace( '::',\n str_repeat( $repeat, $pad - substr_count( $ip, ':' ) ) . $extra,\n $ip\n );\n }\n // Remove leading zereos from each bloc as needed\n $ip = preg_replace( '/(^|:)0+(' . RE_IPV6_WORD . ')/', '$1$2', $ip );\n return $ip;\n }", "function inet6_to_range($addr, $prefix)\r\n{\r\n $size = 128 - $prefix;\r\n $addr = gmp_init('0x' . str_replace(':', '', inet6_expand($addr)));\r\n $mask = gmp_init('0x' . str_replace(':', '', inet6_expand(inet6_prefix_to_mask($prefix))));\r\n $prefix = gmp_and($addr, $mask);\r\n $start = gmp_strval(gmp_add($prefix, '0x1'), 16);\r\n $end = '0b';\r\n for ($i = 0; $i < $size; $i++) $end .= '1';\r\n $end = gmp_strval(gmp_add($prefix, gmp_init($end)), 16);\r\n for ($i = 0; $i < 8; $i++) {\r\n $start_result .= substr($start, $i * 4, 4);\r\n if ($i != 7) $start_result .= ':';\r\n } // for\r\n for ($i = 0; $i < 8; $i++) {\r\n $end_result .= substr($end, $i * 4, 4);\r\n if ($i != 7) $end_result .= ':';\r\n } // for\r\n $result = array(inet6_compress($start_result), inet6_compress($end_result));\r\n return $result;\r\n}", "protected function _updateIpData()\n {\n if (!empty($this->_extraData['ipAddress']))\n {\n $ipAddress = $this->_extraData['ipAddress'];\n }\n else\n {\n $ipAddress = null;\n }\n\n $ipId = XenForo_Model_Ip::log(\n $this->get('user_id'), $this->getContentType(), $this->getContestId(), 'insert', $ipAddress\n );\n $this->set('ip_id', $ipId, '', array('setAfterPreSave' => true));\n\n $this->_db->update($this->getContestTableName(), array(\n 'ip_id' => $ipId\n ), 'photo_contest_id = ' . $this->_db->quote($this->getContestId()));\n }", "function validate_ip($ip) {\n\t\t\t// Define all IPv6 address types\n\t\t\t$ipv6regexes = array(\n\t\t\t\t\"preferred\" => array(\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}$/i\"\n\t\t\t\t),\n\t\t\t\t\"compressed\" => array(\n\t\t\t\t\t\"/^[a-f0-9]{0,4}::$/i\",\n\t\t\t\t\t\"/^:(?::[a-f0-9]{1,4}){1,6}$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){1,6}:$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:)(?::[a-f0-9]{1,4}){1,6}$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){2}(?::[a-f0-9]{1,4}){1,5}$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){3}(?::[a-f0-9]{1,4}){1,4}$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){4}(?::[a-f0-9]{1,4}){1,3}$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){5}(?::[a-f0-9]{1,4}){1,2}$/i\",\n\t\t\t\t\t\"/^(?:[a-f0-9]{1,4}:){6}(?::[a-f0-9]{1,4})$/i\"\n\t\t\t\t),\n\t\t\t\t\"ipv4\" => array(\n\t\t\t\t\t\"/^::(?:\\d{1,3}\\.){3}\\d{1,3}$/\",\n\t\t\t\t\t\"/^(?:0:){6}(?:\\d{1,3}\\.){3}\\d{1,3}$/i\"\n\t\t\t\t),\n\t\t\t\t\"ipv4_mapped\" => array(\n\t\t\t\t\t\"/^(?:0:){5}ffff:(?:\\d{1,3}\\.){3}\\d{1,3}$/i\",\n\t\t\t\t\t\"/^::ffff:(?:\\d{1,3}\\.){3}\\d{1,3}$/\"\n\t\t\t\t)\n\t\t\t);\n\t\t\t// Search the address types and return the name if it matches\n\t\t\tforeach ($ipv6regexes as $type => $regexes) {\n\t\t\t\tforeach ($regexes as $regex)\n\t\t\t\t\tif (preg_match($regex, $ip)) {\n\t\t\t\t\t\tif (in_array($type, array(\"ipv4\", \"ipv4_mapped\"))) {\n\t\t\t\t\t\t\t$ipparts = explode(\":\", $ip);\n\t\t\t\t\t\t\t$ipv4part = $ipparts[count($ipparts)-1];\n\t\t\t\t\t\t\tif (IPv4::validate_ip($ipv4part))\n\t\t\t\t\t\t\t\treturn $type;\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\treturn $type;\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Return false if we didn't match an address type\n\t\t\treturn false;\n\t\t}", "function range6_to_cidr6($a, $b) {\n\t$ip6 = array();\n\t$cidr = 0;\n\t$state = 0; # 0=network, 1=address\n\tforeach ($a as $i=>$x) {\n\t\tswitch ($state) {\n\t\tcase 0:\n\t\t\t// in the network\n\t\t\t$y = $b[$i];\n\t\t\tif ($x == $y) {\n\t\t\t\t// this hextet matches\n\t\t\t\t$ip6[] = $x;\n\t\t\t\t$cidr += 16;\n\t\t\t} else {\n\t\t\t\t// first non-identical hextet\n\t\t\t\tlist($ip4, $cidr4) = range_to_cidr($x, $y);\n\t\t\t\tif ($ip4 === null) {\n\t\t\t\t\t// no common prefix in this hextet\n\t\t\t\t\tif ($i == 0) {\n\t\t\t\t\t\t// no network prefix at all = no cidr\n\t\t\t\t\t\treturn array(null, 128);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$ip6[] = 0;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// there is a common prefix in this hextet\n\t\t\t\t\t$ip6[] = $ip4 & 0xffff;\n\t\t\t\t\t$cidr += ($cidr4 - 16);\n\t\t\t\t}\n\t\t\t\t$state ++;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t// in the address\n\t\t\t$ip6[] = 0;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn array($ip6, $cidr);\n}", "public function addAddress($data){\n\t\tglobal $dbh;\n\t\t$fields = array(\n\t\t\t\"nombre\",\n\t\t\t\"receptorNombre\",\n\t\t\t\"receptorApellido\",\n\t\t\t\"nombreEmpresa\",\n\t\t\t\"facturacion\",\n\t\t\t\"principal\",\n\t\t\t\"idCliente\",\n\t\t\t\"direccion\",\n\t\t\t\"fono\",\n\t\t\t\"cel\",\n\t\t\t\"idZona\"\n\t\t);\n\t\t$query = \"INSERT INTO direccion(nombre,receptorNombre,receptorApellido,nombreEmpresa,facturacion,principal,idCliente,direccion,fono,cel,idZona) VALUES(?,?,?,?,?,?,?,?,?,?,?)\";\n\t\t$update = array();\n\t\tif( $data!=null && is_array($data) ){\n\t\t\tforeach( $fields as $field ){\n\t\t\t\tif( $field == 'idCliente' ){\n\t\t\t\t\t$update[$field] = $this->id;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$update[$field] = null;\n\t\t\t\tif( isset($data[$field]) && !empty($data[$field]) ){\n\t\t\t\t\t$update[$field] = $data[$field];\n\t\t\t\t} else {\n\t\t\t\t\t//$update[$field] = $old[$field];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$res = $dbh->query($query,$update);\n\t\t\treturn $res;\n\t\t}\n\t\treturn false;\n\t}", "function fetchMultipleAddress()\n{\n\t$cf = new addressData();\n\t\n\t$data = array();\n\t$data['app_id'] = isset($_POST['app_id']) ? $_POST['app_id'] : '';\n\t$data['auth_token'] = isset($_POST['auth_token']) ? $_POST['auth_token'] : '';\n\t$data['domain_id'] = isset($_POST['domain_id']) ? $_POST['domain_id'] : '';\n \n\t$cf->fetchMultipleAddress($data);\n}", "public function setMainAddress($data){\n\t\tglobal $dbh;\n\t\t$fields = array(\n\t\t\t\"nombre\",\n\t\t\t\"receptorNombre\",\n\t\t\t\"receptorApellido\",\n\t\t\t\"nombreEmpresa\",\n\t\t\t\"facturacion\",\n\t\t\t\"principal\",\n\t\t\t\"idCliente\",\n\t\t\t\"direccion\",\n\t\t\t\"fono\",\n\t\t\t\"cel\",\n\t\t\t\"idZona\",\n\t\t\t\"id\"\n\t\t);\n\t\t$query = \"UPDATE direccion SET nombre=?,receptorNombre=?,receptorApellido=?,nombreEmpresa=?,facturacion=?,principal=?,idCliente=?,direccion=?,fono=?,cel=?,idZona=? WHERE id=?;\";\n\t\t$update = array();\n\t\t$old = $this->getMainAddress();\n\t\tif( $data!=null && is_array($data) ){\n\t\t\tforeach( $fields as $field ){\n\t\t\t\t$update[$field] = null;\n\t\t\t\tif( isset($data[$field]) && !empty($data[$field]) ){\n\t\t\t\t\t$update[$field] = $data[$field];\n\t\t\t\t} else {\n\t\t\t\t\t$update[$field] = $old[$field];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$res = $dbh->query($query,$update);\n\t\t\treturn $res;\n\t\t}\n\t\treturn false;\n\t}", "private static function ip2addr($intIp) {\n $arrUnknown = array(\n \"region\" => \"(unknown)\",\n \"address\" => \"(unknown)\"\n );\n $fileIp = fopen(__DIR__ . self::IPFILE, \"rb\");\n if (!$fileIp) return 1;\n $strBuf = fread($fileIp, 4);\n $intFirstRecord = self::bin2dec($strBuf);\n $strBuf = fread($fileIp, 4);\n $intLastRecord = self::bin2dec($strBuf);\n $intCount = floor(($intLastRecord - $intFirstRecord) / 7);\n if ($intCount < 1) return 2;\n $intStart = 0;\n $intEnd = $intCount;\n while ($intStart < $intEnd - 1) {\n $intMid = floor(($intStart + $intEnd) / 2);\n $intOffset = $intFirstRecord + $intMid * 7;\n fseek($fileIp, $intOffset);\n $strBuf = fread($fileIp, 4);\n $intMidStartIp = self::bin2dec($strBuf);\n if ($intIp == $intMidStartIp) {\n $intStart = $intMid;\n break;\n }\n if ($intIp > $intMidStartIp) $intStart = $intMid;\n else $intEnd = $intMid;\n }\n $intOffset = $intFirstRecord + $intStart * 7;\n fseek($fileIp, $intOffset);\n $strBuf = fread($fileIp, 4);\n $intStartIp = self::bin2dec($strBuf);\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n fseek($fileIp, $intOffset);\n $strBuf = fread($fileIp, 4);\n $intEndIp = self::bin2dec($strBuf);\n if ($intIp < $intStartIp || $intIp > $intEndIp) return $arrUnknown;\n $intOffset += 4;\n while (($intFlag = ord(fgetc($fileIp))) == 1) {\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n if ($intOffset < 12) return $arrUnknown;\n fseek($fileIp, $intOffset);\n }\n switch ($intFlag) {\n case 0:\n return $arrUnknown;\n break;\n case 2:\n $intOffsetAddr = $intOffset + 4;\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n if ($intOffset < 12) return $arrUnknown;\n fseek($fileIp, $intOffset);\n while (($intFlag = ord(fgetc($fileIp))) == 2 || $intFlag == 1) {\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n if ($intOffset < 12) return $arrUnknown;\n fseek($fileIp, $intOffset);\n }\n if (!$intFlag) return $arrUnknown;\n $arrAddr = array(\n \"region\" => chr($intFlag)\n );\n while (ord($c = fgetc($fileIp))) $arrAddr[\"region\"] .= $c;\n fseek($fileIp, $intOffsetAddr);\n while (($intFlag = ord(fgetc($fileIp))) == 2 || $intFlag == 1) {\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n if ($intOffset < 12) {\n $arrAddr[\"address\"] = \"(unknown)\";\n return $arrAddr;\n }\n fseek($fileIp, $intOffset);\n }\n if (!$intFlag) {\n $arrAddr[\"address\"] = \"(unknown)\";\n return $arrAddr;\n }\n $arrAddr[\"address\"] = chr($intFlag);\n while (ord($c = fgetc($fileIp))) $arrAddr[\"address\"] .= $c;\n return $arrAddr;\n break;\n default:\n $arrAddr = array(\"region\" => chr($intFlag));\n while (ord($c = fgetc($fileIp))) $arrAddr[\"region\"] .= $c;\n while (($intFlag = ord(fgetc($fileIp))) == 2 || $intFlag == 1) {\n $strBuf = fread($fileIp, 3);\n $intOffset = self::bin2dec($strBuf);\n if ($intOffset < 12) {\n $arrAddr[\"address\"] = \"(unknown)\";\n return $arrAddr;\n }\n fseek($fileIp, $intOffset);\n }\n if (!$intFlag) {\n $arrAddr[\"address\"] = \"(unknown)\";\n return $arrAddr;\n }\n $arrAddr[\"address\"] = chr($intFlag);\n while (ord($c = fgetc($fileIp))) $arrAddr[\"address\"] .= $c;\n return $arrAddr;\n }\n }", "public function ip_v6_address () {\n\t\t\treturn sprintf(\n\t\t\t\t'%x:%x:%x:%x:%x:%x:%x:%x',\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535),\n\t\t\t\tmt_rand(0,65535)\n\t\t\t);\n\t\t}", "protected function processAddressEntity($data)\n {\n if (isset($data['addresses']) && is_array($data['addresses'])) {\n\n $properties = $this->getEntityPropertyNames();\n\n foreach ($data['addresses'] as $key => $addressDetails) {\n if (!in_array($key, $properties)) {\n continue;\n }\n\n $addressService = $this->getService('Address');\n\n // If we are updating an address\n if (isset($addressDetails['id']) && !empty($addressDetails['id'])) {\n $addressService->update($addressDetails['id'], $addressDetails);\n\n $data[$key] = $addressDetails['id'];\n } else {\n $data[$key] = $addressService->create($addressDetails);\n }\n }\n\n unset($data['addresses']);\n }\n\n return $data;\n }", "protected function FixAddress()\n {\n $rows = db::Query(\"SELECT min(id) as id, uid, (SELECT wallet FROM finances.accounts WHERE accounts.uid=quests.uid) FROM finances.quests GROUP BY uid ORDER BY uid ASC;\");\n $wallet = LoadModule('api', 'wallet');\n $bitcoin = LoadModule('api', 'bitcoin');\n $ret = array();\n foreach ($rows as $row)\n {\n if ($row['wallet'] === null)\n {\n array_push($ret, $row['uid']);\n echo \"<hr>{$row['uid']}<br>\";\n echo $tx = $wallet->GetFirstSourceTxid($row['id']);\n echo \"<br>\";\n echo $source = $bitcoin->GetSourceByTransaction($tx);\n if (strlen($source))\n db::Query(\"INSERT INTO finances.accounts(uid, wallet) VALUES ($1, $2)\",\n array($row['uid'], $source));\n }\n }\n return $ret;\n }" ]
[ "0.5818516", "0.56212425", "0.54867524", "0.53958726", "0.53643227", "0.53327894", "0.5273937", "0.52435017", "0.52337587", "0.5191513", "0.5176747", "0.51679575", "0.5153298", "0.5148534", "0.5136653", "0.5132775", "0.5127582", "0.51250297", "0.5104766", "0.5094819", "0.50859505", "0.50753784", "0.50744885", "0.50497246", "0.50458497", "0.49677983", "0.49526626", "0.49422818", "0.49369666", "0.4932623" ]
0.56243294
1
function Helper method which checks if cidr suffix or the ip range is set and updates them if they are not set.
private function check_missing_net_params($p_typeID, $p_address, $p_netmask, &$p_cidr_suffix, &$p_from, &$p_to) { if ($p_typeID == C__CATS_NET_TYPE__IPV4) { if (empty($p_cidr_suffix) && $p_netmask != '') { $p_cidr_suffix = Ip::calc_cidr_suffix($p_netmask); } // if if (empty($p_from) || empty($p_to)) { $l_range = Ip::calc_ip_range($p_address, $p_netmask); $p_from = $l_range['from']; $p_to = $l_range['to']; } // if } elseif ($p_typeID == C__CATS_NET_TYPE__IPV6) { if (empty($p_cidr_suffix) && $p_netmask != '') { $p_cidr_suffix = Ip::calc_cidr_suffix_ipv6($p_netmask); } // if if (empty($p_from) || empty($p_to)) { $l_range = Ip::calc_ip_range_ipv6($p_address, $p_cidr_suffix); $p_from = $l_range['from']; $p_to = $l_range['to']; } // if } // if }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ip_in_range($ip, $range) {\r\n if (strpos($ip, '.') !== false) { // regular IPv4\r\n if (strpos($range, '/') !== false) {\r\n // $range is in IP/NETMASK format\r\n list($range, $netmask) = explode('/', $range, 2);\r\n if (strpos($netmask, '.') !== false) {\r\n // $netmask is a 255.255.0.0 format, or 255.*\r\n $nets = explode('.', $netmask);\r\n while(count($nets) < 4) $nets[] = '*';\r\n $netmask = implode('.', $nets);\r\n // by now we have ensured that we have 4 octets of the netmask a.b.c.d\r\n $netmask = str_replace('*', '0', $netmask);\r\n $netmask_dec = ip2float($netmask);\r\n#printf(\"%-10s: %s\\n\", \"Netmask\", $netmask);\r\n#printf(\"%-10s: %-032b\\n\", \"Netmaskbin\", $netmask_dec);\r\n\r\n } else {\r\n // $netmask is a CIDR size block\r\n // fix the range argument\r\n $x = explode('.', $range);\r\n while(count($x)<4) $x[] = '0';\r\n #list($a,$b,$c,$d) = $x;\r\n #$range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\r\n $range = implode('.', $x);\r\n\r\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\r\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\r\n\r\n # Strategy 2 - Use math to create it\r\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\r\n $netmask_dec = ~ $wildcard_dec;\r\n $netmask_dec = (float)(pow(2,32) - pow(2, (32-$netmask)));\r\n\r\n }\r\n#printf(\"%-10s: %s\\n\", \"IP\", $ip);\r\n#printf(\"%-10s: %-032b\\n\", \"IPbin\", ip2float($ip));\r\n#printf(\"%-10s: %s\\n\", \"Range\", $range);\r\n#printf(\"%-10s: %-032b\\n\", \"Rangebin\", ip2float($range));\r\n#printf(\"%-10s: %-032b\\n\", \"Netmask\", $netmask_dec);\r\n# $a = float_and(ip2float($ip), $netmask_dec);\r\n# $b = float_and(ip2float($range), $netmask_dec);\r\n#printf(\"%-10s: %-032b\\n\", \"IP&MASK\", $a);\r\n#printf(\"%-10s: %-032b\\n\", \"Range&MASK\", $b);\r\n return ( float_and(ip2float($ip), $netmask_dec) == float_and(ip2float($range), $netmask_dec) );\r\n } else {\r\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\r\n if (strpos($range, '*') !==false) { // a.b.*.* format\r\n // Just convert to A-B format by setting * to 0 for A and 255 for B\r\n $lower = str_replace('*', '0', $range);\r\n $upper = str_replace('*', '255', $range);\r\n $range = \"$lower-$upper\";\r\n }\r\n\r\n if (strpos($range, '-')!==false) { // A-B format\r\n list($lower, $upper) = explode('-', $range, 2);\r\n $lower_dec = ip2float($lower);\r\n $upper_dec = ip2float($upper);\r\n $ip_dec = ip2float($ip);\r\n return ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\r\n }\r\n\r\n echo 'Range argument is not in 1.2.3.4/24 or 1.2.3.4/255.255.255.0 format';\r\n return false;\r\n }\r\n }\r\n if (strpos($ip, ':') !== false) { // IPv6\r\n ini_set(\"display_errors\", 1);\r\n error_reporting(E_ALL);\r\n // Parse out the $range\r\n if (strpos($range, '/') !== false) {\r\n // $range is in IPv6/NETMASK format\r\n list($range, $netbits) = explode('/', $range, 2);\r\n $netmask_binstr = str_pad('', $netbits, '1') . str_pad('', 128-$netbits, '0');\r\n }\r\n if (preg_match('/::$/', $range)) {\r\n $range = preg_replace('/::$/', '', $range);\r\n $x = explode(':', $range);\r\n while(count($x) < 8) $x[] = '0';\r\n $range = implode(':', $x);\r\n }\r\n return ( largearray_and(ip6floatA($ip), largebin2floatA($netmask_binstr)) == largearray_and(ip6floatA($range), largebin2floatA($netmask_binstr)) );\r\n }\r\n\r\n}", "function ip_in_range($ip, $range) {\n if ( is_string($range) ) $ranges = explode(',',$range);\n else $ranges = $range;\n if (strpos($ip,':') !== false) {\n return in_array($ip,$ranges);\n } else {\n $in = false;\n foreach($ranges as $range) {\n if ($in) return $in;\n if (strpos($range,':') !== false) continue;\n # If IP has the 4 blocks is a host, but we need the prefix, so put it\n if (strpos($range,'/') === false && strpos($range,'-') === false && strpos($range,'*') === false) $range .= '/32';\n if (strpos($range, '/') !== false) {\n // $range is in IP/NETMASK format\n list($range, $netmask) = explode('/', $range, 2);\n if (strpos($netmask, '.') !== false) {\n // $netmask is a 255.255.0.0 format\n $netmask = str_replace('*', '0', $netmask);\n $netmask_dec = ip2long($netmask);\n return ( (ip2long($ip) & $netmask_dec) == (ip2long($range) & $netmask_dec) );\n } else {\n // $netmask is a CIDR size block\n // fix the range argument\n $x = explode('.', $range);\n while(count($x)<4) $x[] = '0';\n list($a,$b,$c,$d) = $x;\n $range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\n $range_dec = ip2long($range);\n $ip_dec = ip2long($ip);\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\n # Strategy 2 - Use math to create it\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\n $netmask_dec = ~ $wildcard_dec;\n $in = (($ip_dec & $netmask_dec) == ($range_dec & $netmask_dec));\n }\n } else {\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\n if (strpos($range, '*') !==false) { // a.b.*.* format\n // Just convert to A-B format by setting * to 0 for A and 255 for B\n $lower = str_replace('*', '0', $range);\n $upper = str_replace('*', '255', $range);\n $range = \"$lower-$upper\";\n }\n if (strpos($range, '-')!==false) { // A-B format\n list($lower, $upper) = explode('-', $range, 2);\n $lower_dec = (float)sprintf(\"%u\",ip2long($lower));\n $upper_dec = (float)sprintf(\"%u\",ip2long($upper));\n $ip_dec = (float)sprintf(\"%u\",ip2long($ip));\n $in = ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\n }\n }\n }\n return $in;\n }\n}", "Function ip_in_range($ip, $range) {\n if (strpos($range, '/') !== false) {\n // $range is in IP/NETMASK format\n list($range, $netmask) = explode('/', $range, 2);\n if (strpos($netmask, '.') !== false) {\n // $netmask is a 255.255.0.0 format\n $netmask = str_replace('*', '0', $netmask);\n $netmask_dec = ip2long($netmask);\n return ( (ip2long($ip) & $netmask_dec) == (ip2long($range) & $netmask_dec) );\n } else {\n // $netmask is a CIDR size block\n // fix the range argument\n $x = explode('.', $range);\n while(count($x)<4) $x[] = '0';\n list($a,$b,$c,$d) = $x;\n $range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\n $range_dec = ip2long($range);\n $ip_dec = ip2long($ip);\n\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\n\n # Strategy 2 - Use math to create it\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\n $netmask_dec = ~ $wildcard_dec;\n\n return (($ip_dec & $netmask_dec) == ($range_dec & $netmask_dec));\n }\n } else {\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\n if (strpos($range, '*') !==false) { // a.b.*.* format\n // Just convert to A-B format by setting * to 0 for A and 255 for B\n $lower = str_replace('*', '0', $range);\n $upper = str_replace('*', '255', $range);\n $range = \"$lower-$upper\";\n }\n\n if (strpos($range, '-')!==false) { // A-B format\n list($lower, $upper) = explode('-', $range, 2);\n $lower_dec = (float)sprintf(\"%u\",ip2long($lower));\n $upper_dec = (float)sprintf(\"%u\",ip2long($upper));\n $ip_dec = (float)sprintf(\"%u\",ip2long($ip));\n return ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\n }\n\n //echo 'Range argument is not in 1.2.3.4/24 or 1.2.3.4/255.255.255.0 format';\n return false;\n }\n\n}", "Function ip_in_range($ip, $range) {\r\n if (strpos($range, '/') !== false) {\r\n // $range is in IP/NETMASK format\r\n list($range, $netmask) = explode('/', $range, 2);\r\n if (strpos($netmask, '.') !== false) {\r\n // $netmask is a 255.255.0.0 format\r\n $netmask = str_replace('*', '0', $netmask);\r\n $netmask_dec = ip2long($netmask);\r\n return ( (ip2long($ip) & $netmask_dec) == (ip2long($range) & $netmask_dec) );\r\n } else {\r\n // $netmask is a CIDR size block\r\n // fix the range argument\r\n $x = explode('.', $range);\r\n while(count($x)<4) $x[] = '0';\r\n list($a,$b,$c,$d) = $x;\r\n $range = sprintf(\"%u.%u.%u.%u\", empty($a)?'0':$a, empty($b)?'0':$b,empty($c)?'0':$c,empty($d)?'0':$d);\r\n $range_dec = ip2long($range);\r\n $ip_dec = ip2long($ip);\r\n\r\n # Strategy 1 - Create the netmask with 'netmask' 1s and then fill it to 32 with 0s\r\n #$netmask_dec = bindec(str_pad('', $netmask, '1') . str_pad('', 32-$netmask, '0'));\r\n\r\n # Strategy 2 - Use math to create it\r\n $wildcard_dec = pow(2, (32-$netmask)) - 1;\r\n $netmask_dec = ~ $wildcard_dec;\r\n\r\n return (($ip_dec & $netmask_dec) == ($range_dec & $netmask_dec));\r\n }\r\n } else {\r\n // range might be 255.255.*.* or 1.2.3.0-1.2.3.255\r\n if (strpos($range, '*') !==false) { // a.b.*.* format\r\n // Just convert to A-B format by setting * to 0 for A and 255 for B\r\n $lower = str_replace('*', '0', $range);\r\n $upper = str_replace('*', '255', $range);\r\n $range = \"$lower-$upper\";\r\n }\r\n\r\n if (strpos($range, '-')!==false) { // A-B format\r\n list($lower, $upper) = explode('-', $range, 2);\r\n $lower_dec = (float)sprintf(\"%u\",ip2long($lower));\r\n $upper_dec = (float)sprintf(\"%u\",ip2long($upper));\r\n $ip_dec = (float)sprintf(\"%u\",ip2long($ip));\r\n return ( ($ip_dec>=$lower_dec) && ($ip_dec<=$upper_dec) );\r\n }\r\n\r\n echo 'Range argument is not in 1.2.3.4/24 or 1.2.3.4/255.255.255.0 format';\r\n return false;\r\n }\r\n\r\n}", "function subnet ($ip=NULL, $subnet=NULL)\n\t{\n\n\t\t// assign defaults\n\t\tif (is_null($ip))\n\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\n\t\t// default to REMOTE_ADDR\n\t\tif (!is_null($subnet))\n\t\t{\n\t\t\t$explodeip = explode('.', $ip);\n\t\t\t$subnetip = explode('.', substr($subnet, 0, strpos($subnet, '/')));\n\t\t\t$subnetmask = substr($subnet, strpos($subnet, '/') + 1);\n\t\t\tif ($subnetmask == 32)\n\t\t\t{\n\t\t\t\tif (substr($subnet, 0, strpos($subnet, '/')) == $ip)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} elseif ($subnetmask < 32 && $subnetmask >= 24)\n\t\t\t{\n\t\t\t\t$start = $subnetip[3];\n\t\t\t\t$check = 32;\n\t\t\t\t$top = 254;\n\t\t\t\t$checkip = $explodeip[3];\n\t\t\t} elseif ($subnetmask < 24 && $subnetmask >= 16)\n\t\t\t{\n\t\t\t\t$start = $subnetip[2];\n\t\t\t\t$check = 24;\n\t\t\t\t$top = 255;\n\t\t\t\t$checkip = $explodeip[2];\n\t\t\t} elseif ($subnetmask < 16 && $subnetmask >= 8)\n\t\t\t{\n\t\t\t\t$start = $subnetip[1];\n\t\t\t\t$check = 16;\n\t\t\t\t$top = 255;\n\t\t\t\t$checkip = $explodeip[1];\n\t\t\t} elseif ($subnetmask < 8)\n\t\t\t{\n\t\t\t\t$start = $subnetip[0];\n\t\t\t\t$check = 8;\n\t\t\t\t$top = 254;\n\t\t\t\t$checkip = $explodeip[0];\n\t\t\t}\n\t\t\t$end = $start + pow(2, ($check - $subnetmask));\n\t\t\tif ($end > $top) $end = $top;\n\t\t\tif ($checkip >= $start && $checkip <= $end)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t\t\n\t\t} else {\t\t\t\t\n\t\t\t\t\n\t\t\t// wow hard\n\t\t\t$subnet = substr($ip, 0, strrpos($ip, '.')).\".0/24\";\n\t\n\t\t\treturn $subnet;\n\t\t}\n\t}", "private function isIPAddressMeetRange() {\n\t\tif(get_option(\"wp_broadbean_iprange\") == \"\") {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn ip_in_range($this->ip_request, get_option(\"wp_broadbean_iprange\"));\n\t\t}\n\t}", "function checkCIDRBlacklist($ip)\n{\n $us_backlist = array(\n //'23','24','50','63','64','65','66','67','68','69','70','71','72','73','74','75','76','96','97',\n //'98','99','100','104','107','108','142','162','163','172','173','174','184','192','198','199','204','205','206','207','208','209','216'\n );\n $cidr = substr($ip, 0, strpos($ip, '.')); // xxx\n if(!empty($us_backlist) && in_array($cidr, $us_backlist))\n return true;\n\n $blacklist = array(\n //'27.67',\n //'27.74',\n //'171.253',\n //'171.249',\n //'59.153',\n //'113.185',\n //'113.161',\n //'115.84',\n //'115.73',\n //'117.0',\n //'117.1',\n //'117.2',\n //'117.3',\n //'117.4',\n //'117.5',\n //'125.212',\n //'123.31',\n //'123.24',\n //'101.99',\n //'58.187', // FPT\n //'183.80', // FPT\n //'183.81', // FPT\n //'42.112', // FPT\n //'42.117', // FPT\n //'1.52', // FPT\n //'1.53', // FPT\n );\n //$cidr = substr($ip, 0, strrpos($ip, '.')); // xxx.xxx.xxx\n $cidr = substr($ip, 0, strpos($ip, '.', strpos($ip, '.') + 1)); // xxx.xxx\n if(!empty($blacklist) && in_array($cidr, $blacklist))\n return true;\n else\n return false;\n}", "public function __validate_mask() {\n if (isset($this->initial_data['mask'])) {\n # Check that our mask is within range (between 0-32) for IPv4 network.\n if ($this->ip_version === 4 and $this->initial_data[\"mask\"] >= 0 and $this->initial_data[\"mask\"] <= 32) {\n $this->validated_data[\"mask\"] = $this->initial_data['mask'];\n }\n elseif ($this->ip_version === 6 and $this->initial_data[\"mask\"] >= 0 and $this->initial_data[\"mask\"] <= 128) {\n $this->validated_data[\"mask\"] = $this->initial_data['mask'];\n }\n else {\n $this->errors[] = APIResponse\\get(2070);\n }\n } else {\n $this->errors[] = APIResponse\\get(2071);\n }\n }", "public function set_real_ip() {\r\n\t\t// only run this logic if the REMOTE_ADDR is populated, to avoid causing notices in CLI mode.\r\n\t\tif ( ! isset( $_SERVER['HTTP_CF_CONNECTING_IP'], $_SERVER['REMOTE_ADDR'] ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$cf_ips_values = $this->cloudflare->get_cloudflare_ips();\r\n\t\t$cf_ip_ranges = $cf_ips_values->result->ipv6_cidrs;\r\n\t\t$ip = sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) );\r\n\t\t$ipv6 = get_rocket_ipv6_full( $ip );\r\n\t\tif ( false === strpos( $ip, ':' ) ) {\r\n\t\t\t// IPV4: Update the REMOTE_ADDR value if the current REMOTE_ADDR value is in the specified range.\r\n\t\t\t$cf_ip_ranges = $cf_ips_values->result->ipv4_cidrs;\r\n\t\t}\r\n\r\n\t\tforeach ( $cf_ip_ranges as $range ) {\r\n\t\t\tif (\r\n\t\t\t\t( strpos( $ip, ':' ) && rocket_ipv6_in_range( $ipv6, $range ) )\r\n\t\t\t\t||\r\n\t\t\t\t( false === strpos( $ip, ':' ) && rocket_ipv4_in_range( $ip, $range ) )\r\n\t\t\t) {\r\n\t\t\t\t$_SERVER['REMOTE_ADDR'] = sanitize_text_field( wp_unslash( $_SERVER['HTTP_CF_CONNECTING_IP'] ) );\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function withRange($ip){\n\n\t\t$ipadd = explode(\".\", $ip);\n\t\t$withRange = false;\n\n\t\tfor ($i = 0; $i < sizeof($ipadd); $i++){\n\t\t\tif((strpos(($ipadd[$i]), \"-\") == true) || (strpos($ipadd[$i], \"~\") == true))\n\t\t\t\t$withRange = true; \n\t\t}\n\t\t\n\n\t\treturn $withRange;\n\n\t}", "function cidr_match($ip, $range){\n list ($subnet, $bits) = explode('/', $range);\n $ip = ip2long($ip);\n $subnet = ip2long($subnet);\n $mask = -1 << (32 - $bits);\n $subnet &= $mask; # nb: in case the supplied subnet wasn't correctly aligned\n return ($ip & $mask) == $subnet;\n}", "public function setCidr($cidr)\n {\n if (strpos($cidr, '-') !== false) {\n return $this->setRange($cidr);\n }\n\n list($ip, $bits) = array_pad(array_map('trim', explode('/', $cidr, 2)), 2, null);\n if (false === filter_var($ip, FILTER_VALIDATE_IP)) {\n throw new \\InvalidArgumentException(\"Invalid IP address \\\"$cidr\\\"\");\n }\n\n // determine version (4 or 6)\n $this->version = (false === filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) ? 6 : 4;\n\n $this->start = $ip;\n $this->istart = IP::inet_ptod($ip);\n\n if ($bits !== null and $bits !== '') {\n $this->prefix = $bits;\n } else {\n $this->prefix = $this->version == 4 ? 32 : 128;\n }\n\n if (($this->prefix < 0)\n || ($this->prefix > 32 and $this->version == 4)\n || ($this->prefix > 128 and $this->version == 6)) {\n throw new \\InvalidArgumentException(\"Invalid IP address \\\"$cidr\\\"\");\n }\n\n $this->end = $this->getBroadcast();\n $this->iend = IP::inet_ptod($this->end);\n\n $this->cache = array();\n }", "private function set_real_ip() {\n\n\t\t$is_cf = ( isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) ) ? true : false;\n\t\tif ( ! $is_cf ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// only run this logic if the REMOTE_ADDR is populated, to avoid causing notices in CLI mode.\n\t\tif ( isset( $_SERVER['REMOTE_ADDR'] ) ) {\n\n\t\t\t// Grab the Current Cloudflare Address Range\n\t\t\t$cf_ips_values = $this->get_ips();\n\t\t\tif ( false == $cf_ips_values || empty($cf_ips_values) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Check if the we getting a IPv4 or IPv6 Address\n\t\t\tif ( strpos( $_SERVER['REMOTE_ADDR'], ':' ) === false ) {\n\t\t\t\t$cf_ip_ranges = $cf_ips_values['ipv4'] ?? '';\n\n\t\t\t\t// IPv4: Update the REMOTE_ADDR value if the current REMOTE_ADDR value is in the specified range.\n\t\t\t\tforeach ( $cf_ip_ranges as $range ) {\n\t\t\t\t\tif ( IP::ipv4_in_range( $_SERVER['REMOTE_ADDR'], $range ) ) {\n\t\t\t\t\t\tif ( $_SERVER['HTTP_CF_CONNECTING_IP'] ) {\n\t\t\t\t\t\t\t$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t// IPv6: Update the REMOTE_ADDR value if the current REMOTE_ADDR value is in the specified range.\n\t\t\t\t$cf_ip_ranges = $cf_ips_values['ipv6'];\n\t\t\t\t$ipv6 = IP::get_ipv6_full( $_SERVER['REMOTE_ADDR'] );\n\t\t\t\tforeach ( $cf_ip_ranges as $range ) {\n\t\t\t\t\tif ( IP::ipv6_in_range( $ipv6, $range ) ) {\n\t\t\t\t\t\tif ( $_SERVER['HTTP_CF_CONNECTING_IP'] ) {\n\t\t\t\t\t\t\t$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function parseRangeUsingCidr($input, &$range): void\n {\n $input = explode('/', $input);\n $this->fillAddress($input[0], '0');\n\n $range['min'] = $input[0];\n $isAddressMask = strpos($input[1], '.') !== false;\n\n if ($isAddressMask && $this->verifyAddress($input[1])) {\n $range['mask'] = sprintf('%032b', ip2long($input[1]));\n return;\n }\n\n if ($isAddressMask || $input[1] < 8 || $input[1] > 30) {\n throw new ComponentException('Invalid network mask');\n }\n\n $range['mask'] = sprintf('%032b', ip2long(long2ip(~(2 ** (32 - $input[1]) - 1))));\n }", "public function testInRange()\n {\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->inRange('127.0.0.44', '127.0.0.0/24');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('127.0.250.44', '127.0.250.250/24');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('127.0.1.44', '127.0.0.0/24');\n $this->assertEquals(false, $t);\n\n // Single Ip\n $t = $ipComponent->inRange('127.0.0.1', '127.0.0.1');\n $this->assertEquals(true, $t);\n\n // Test 2. Check IP is if in C class subnet.\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->inRange('127.0.33.33', '127.0.0.0/16');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('127.0.33.33', '127.0.250.0/16');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('127.1.33.33', '127.0.0.0/16');\n $this->assertEquals(false, $t);\n\n // Test 3. Check IP is if in B class subnet.\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->inRange('127.33.250.33', '127.0.0.0/8');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('127.33.33.33', '127.0.0.0/8');\n $this->assertEquals(true, $t);\n $t = $ipComponent->inRange('128.33.250.33', '127.0.0.0/8');\n $this->assertEquals(false, $t);\n\n // Test 4. Check IPv6\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->inRange('2001:db8:ffff:ffff:ffff:ffff:ffff:ffff', '2001:db8::/32');\n $this->assertEquals(true, $t);\n\n $t = $ipComponent->inRange('2001:db8:ffff:ffff:ffff:ffff:ffff:ffff', '2001:db8::0/32');\n $this->assertEquals(false, $t);\n\n // Test 5. Check Invalid IP\n $ipComponent = new \\Shieldon\\Firewall\\Component\\Ip();\n $t = $ipComponent->inRange('127.0.333.33', '127.0.250.0/16');\n $this->assertEquals(false, $t);\n }", "public function updateBlockedIpRanges()\n {\n if ($this->systemSettings->block_clouds->getValue()) {\n $this->blockedIpRanges->updateBlockedIpRanges();\n } else {\n $this->blockedIpRanges->unsetAllIpRanges();\n }\n }", "function scan_iprange($batch_id, $start_ip, $end_ip) {\n global $config;\n\n //validate input\n $pattern = '/\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b/';\n if (!preg_match($pattern, $start_ip))\n hs_ajax_result(false, \"BAD start ip.\", null);\n if (!preg_match($pattern, $end_ip))\n hs_ajax_result(false, \"BAD start ip.\", null);\n\n //check ip address range\n $ip_list = explode( '.', $start_ip, 4 );\n unset($ip_list[3]);\n $ip_range_start = bindec(decbin(ip2long(join('.', $ip_list ) . '.1')));\n $ip_range_end = bindec(decbin(ip2long(join('.', $ip_list ) . '.255')));\n $ip_end_long = bindec(decbin(ip2long($end_ip)));\n\n if ($ip_end_long < $ip_range_start || $ip_end_long > $ip_range_end) {\n hs_ajax_result(false, \"BAD ip address, start & end ip address must in same subnet.\", null);\n }\n\n //first save to database with init status\n $start_ip_num = explode( '.', $start_ip, 4)[3];\n $end_ip_num = explode( '.', $end_ip, 4)[3];\n $server_list = array();\n for ($i=$start_ip_num; $i<=$end_ip_num; $i++) {\n array_push($server_list, join('.', $ip_list) . '.' . $i);\n }\n\n if (count($server_list) == 0) {\n hs_ajax_result(false, \"BAD ip address range.\", null);\n }\n\n //save to database, status 0\n hs_save_import_server_list($batch_id, $server_list);\n\n //ping server in background\n $debug_str = \"\"; //\" -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=192.168.31.240 \";\n $command_string = read_config_option(\"path_php_binary\");\n exec_background($command_string, $debug_str. \"\\\"\" . $config[\"base_path\"] . \"/plugins/hwserver/includes/jobs.php\\\" --action=scan_server --batch_id=\" .$batch_id);\n hs_ajax_result(true, \"please waiting scan finish\", null);\n}", "function verifyAndCleanAddresses($data, $subnets_allowed = 'subnets-allowed') {\n\t/** Remove extra spaces */\n\t$data = preg_replace('/\\s\\s+/', ' ', $data);\n\t\n\t/** Swap delimiters for ; */\n\t$data = str_replace(array(\"\\n\", ';', ' ', ','), ',', $data);\n\t$data = str_replace(',,', ',', $data);\n\t$data = trim($data, ',');\n\t\n\t$addresses = explode(',', $data);\n\tforeach ($addresses as $ip_address) {\n\t\t$cidr = null;\n\n\t\t$ip_address = rtrim(trim($ip_address), '.');\n\t\tif (!strlen($ip_address)) continue;\n\t\t\n\t\t/** Handle negated addresses */\n\t\tif (strpos($ip_address, '!') === 0) {\n\t\t\t$ip_address = substr($ip_address, 1);\n\t\t}\n\t\t\n\t\tif (strpos($ip_address, '/') !== false && $subnets_allowed == 'subnets-allowed') {\n\t\t\t$cidr_array = explode('/', $ip_address);\n\t\t\tlist($ip_address, $cidr) = $cidr_array;\n\t\t}\n\t\t\n\t\t/** IPv4 checks */\n\t\tif (strpos($ip_address, ':') === false) {\n\t\t\t/** Valid CIDR? */\n\t\t\tif ($cidr && !checkCIDR($cidr, 32)) return sprintf(__('%s is not valid.'), \"$ip_address/$cidr\");\n\t\t\t\n\t\t\t/** Create full IP */\n\t\t\t$ip_octets = explode('.', $ip_address);\n\t\t\tif (count($ip_octets) < 4) {\n\t\t\t\t$ip_octets = array_merge($ip_octets, array_fill(count($ip_octets), 4 - count($ip_octets), 0));\n\t\t\t}\n\t\t\t$ip_address = implode('.', $ip_octets);\n\t\t} else {\n\t\t\t/** IPv6 checks */\n\t\t\tif ($cidr && !checkCIDR($cidr, 128)) return sprintf(__('%s is not valid.'), \"$ip_address/$cidr\");\n\t\t}\n\t\t\n\t\tif (verifyIPAddress($ip_address) === false) return sprintf(__('%s is not valid.'), $ip_address);\n\t}\n\t\n\treturn $data;\n}", "function is_ip_banned($ip, $banned_ips)\n {\n foreach($banned_ips as $banned_ip) // go through every $banned_ip\n {\n if(strpos($banned_ip,'*')!==false) // $banned_ip contains \"*\" = > IP range\n {\n $ip_range = substr($banned_ip, 0, strpos($banned_ip, '*')); // fetch part before \"*\"\n if(strpos($ip, $ip_range)===0) // check if IP begins with part before \"*\"\n {\n return true;\n }\n }\n elseif(strpos($banned_ip,'/')!==false && preg_match(\"/(([0-9]{1,3}\\.){3}[0-9]{1,3})\\/([0-9]{1,2})/\", $banned_ip, $regs)) // $banned_ip contains \"/\" => CIDR notation (the regular expression is only used if $banned_ip contains \"/\")\n {\n // convert IP into bit pattern:\n $n_user_leiste = '00000000000000000000000000000000'; // 32 bits\n $n_user_ip = explode('.',trim($ip));\n for ($i = 0; $i <= 3; $i++) // go through every byte\n {\n for ($n_j = 0; $n_j < 8; $n_j++) // ... check every bit\n {\n if($n_user_ip[$i] >= pow(2, 7-$n_j)) // set to 1 if necessary\n {\n $n_user_ip[$i] = $n_user_ip[$i] - pow(2, 7-$n_j);\n $n_user_leiste[$n_j + $i*8] = '1';\n }\n }\n }\n // analyze prefix length:\n $n_byte_array = explode('.',trim($regs[1])); // IP -> 4 Byte\n $n_cidr_bereich = $regs[3]; // prefix length\n // bit pattern:\n $n_bitleiste = '00000000000000000000000000000000';\n for ($i = 0; $i <= 3; $i++) // go through every byte\n {\n if ($n_byte_array[$i] > 255) // invalid\n {\n $n_cidr_bereich = 0;\n }\n for ($n_j = 0; $n_j < 8; $n_j++) // ... check every bit\n {\n if($n_byte_array[$i] >= pow(2, 7-$n_j)) // set to 1 if necessary\n {\n $n_byte_array[$i] = $n_byte_array[$i] - pow(2, 7-$n_j);\n $n_bitleiste[$n_j + $i*8] = '1';\n }\n }\n }\n // check if bit patterns match on the first n chracters:\n if (strncmp($n_bitleiste, $n_user_leiste, $n_cidr_bereich) == 0 && $n_cidr_bereich > 0)\n {\n return true;\n }\n }\n else // neither \"*\" nor \"/\" => simple comparison:\n {\n if($ip == $banned_ip)\n {\n return true;\n }\n }\n }\n return false;\n }", "public static function checkIPSubnet( $ipAddress ){\n\t\t\tglobal $wpdb;\n\n\t\t\t/*\n\t\t\t\tGrabs allowed subnets from the \n\t\t\t\tcurrent blog.\n\t\t\t*/\n\t\t\tif( is_multisite() ){\n\t\t\t\t$currentBlogID = get_current_blog_id();\n\n\t\t\t\tglobal $switched;\n\t\t\t\tswitch_to_blog(1);\n\n\t\t\t\t$subnets = $wpdb->get_results( $wpdb->prepare(\n\t\t\t\t\t\"SELECT *\n\t\t\t\t\t FROM \".$wpdb->prefix.\"wps_subnets\n\t\t\t\t\t WHERE blog_id = '%d'\",\n\t\t\t\t\t $currentBlogID\n\t\t\t\t), ARRAY_A );\n\n\t\t\t\trestore_current_blog();\n\t\t\t}else{\n\t\t\t\t$subnets = $wpdb->get_results( \"SELECT * FROM \".$wpdb->prefix.\"wps_subnets\", ARRAY_A );\n\t\t\t}\n\n\t\t\t/*\n\t\t\t\tIterates through subnets and checks to see\n\t\t\t\tif the IP address is within the range.\n\t\t\t*/\n\t\t\tforeach( $subnets as $subnet ){\n\t\t\t\t$subnetParts \t= explode( '.', $subnet['start_ip'] );\n\n\t\t\t\t$firstOctet \t= $subnetParts[0];\n\t\t\t\t$secondOctet \t= $subnetParts[1];\n\t\t\t\t$thirdOctet \t= $subnetParts[2];\n\t\t\t\t$fourthOctet \t= $subnetParts[3];\n\n\t\t\t\t$newFirstOctet \t= '';\n\t\t\t\t$newSecondOctet\t= '';\n\t\t\t\t$newThirdOctet \t= '';\n\t\t\t\t$newFourthOctet = '';\n\n\t\t\t\t/*\n\t\t\t\t\tChecks from the largest networks\n\t\t\t\t\tfirst down to the smallest.\n\t\t\t\t*/\n\t\t\t\tif( $subnet['subnet'] <= 8 ){\n\t\t\t\t\tif( ( $firstOctet + $subnet['subnet'] ) > 255 ){\n\t\t\t\t\t\t$newFirstOctet = 255;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$newFirstOctet = $firstOctet + $subnet['subnet'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$min \t= ip2long( $subnet['start_ip'] );\n\t\t\t\t\t$max \t= ip2long( $newFirstOctet.'.255.255.254' );\n\t\t\t\t\t$needle = ip2long( $ipAddress );\n\n\t\t\t\t\tif( ( $needle >= $min ) AND ( $needle <= $max ) ){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}else if( ( $subnet['subnet'] > 8 ) && ( $subnet['subnet'] <= 16 ) ){\n\t\t\t\t\tif( ( $secondOctet + $subnet['subnet'] ) > 255 ){\n\t\t\t\t\t\t$newScondOctet = ( $secondOctet + $subnet['subnet'] ) - 255;\n\t\t\t\t\t\t$newFirstOctet = $firstOctet + 1;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$newFirstOctet = $firstOctet;\n\t\t\t\t\t\t$newSecondOctet = $secondOctet + $subnet['subnet'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$min = ip2long( $subnet['start_ip'] );\n\t\t\t\t\t$max = ip2long( $newFirstOctet.'.255.255.254' );\n\t\t\t\t\t$needle = ip2long( $ipAddress ); \n\n\t\t\t\t\tif( ( $needle >= $min ) AND ( $needle <= $max ) ){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}else if( ( $subnet['subnet'] > 16 ) && ( $subnet['subnet'] <= 24 ) ){\n\t\t\t\t\tif( ( $thirdOctet + $subnet['subnet'] ) > 255 ){\n\t\t\t\t\t\t$newThirdOctet \t= ( $thirdOctet + $subnet['subnet'] ) - 255;\n\t\t\t\t\t\t$newSecondOctet = $secondOctet + 1;\n\t\t\t\t\t\t$newFirstOctet \t= $firstOctet;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$newSecondOctet = $secondOctet;\n\t\t\t\t\t\t$newThirdOctet \t= $thirdOctet + $subnet['subnet'];\n\t\t\t\t\t\t$newFirstOctet \t= $firstOctet;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$min = ip2long( $subnet['start_ip'] );\n\t \t\t$max = ip2long( $newFirstOctet.'.255.255.254' );\n\t \t\t$needle = ip2long( $ipAddress ); \n\n\t \t\tif( ( $needle >= $min ) AND ( $needle <= $max ) ){\n\t \t\t\treturn true;\n\t \t\t}\n\t\t\t\t}else if( $subnet['subnet'] > 24 ){\n\t\t\t\t\tif( ( $fourthOctet + $subnet['subnet'] ) > 255 ){\n\t\t\t\t\t\t$newFourthOctet = ( $fourthOctet + $subnet['subnet'] ) - 255;\n\t\t\t\t\t\t$newThirdOctet \t= $thirdOctet + 1;\n\t\t\t\t\t\t$newSecondOctet = $secondOctet;\n\t\t\t\t\t\t$newFirstOctet \t= $firstOctet;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$newFourthOctet = $fourthOctet + $subnet['subnet'];\n\t\t\t\t\t\t$newSecondOctet = $secondOctet;\n\t\t\t\t\t\t$newThirdOctet \t= $thirdOctet;\n\t\t\t\t\t\t$newFirstOctet \t= $firstOctet;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t$min = ip2long( $subnet['start_ip'] );\n\t \t\t$max = ip2long( $newFirstOctet.'.255.255.254' );\n\t \t\t$needle = ip2long( $ipAddress ); \n\n\t \t\tif( ( $needle >= $min ) AND ( $needle <= $max ) ){\n\t \t\t\treturn true;\n\t \t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n\t\t\t\tOnly reachable if nothing was returned\n\t\t\t\tmeaning that the IP is NOT in the subnet.\n\t\t\t*/\n\t\t\treturn false;\n\t\t}", "function where_is_ipaddr_configured($ipaddr, $ignore_if = \"\", $check_localip = false, $check_subnets = false, $cidrprefix = \"\") {\n\t$where_configured = array();\n\n\t$pos = strpos($ignore_if, '_virtualip');\n\tif ($pos !== false) {\n\t\t$ignore_vip_id = substr($ignore_if, $pos+10);\n\t\t$ignore_vip_if = substr($ignore_if, 0, $pos);\n\t} else {\n\t\t$ignore_vip_id = -1;\n\t\t$ignore_vip_if = $ignore_if;\n\t}\n\n\t$isipv6 = is_ipaddrv6($ipaddr);\n\n\tif ($isipv6) {\n\t\t$ipaddr = text_to_compressed_ip6($ipaddr);\n\t}\n\n\tif ($check_subnets) {\n\t\t$cidrprefix = intval($cidrprefix);\n\t\tif ($isipv6) {\n\t\t\tif (($cidrprefix < 1) || ($cidrprefix > 128)) {\n\t\t\t\t$cidrprefix = 128;\n\t\t\t}\n\t\t} else {\n\t\t\tif (($cidrprefix < 1) || ($cidrprefix > 32)) {\n\t\t\t\t$cidrprefix = 32;\n\t\t\t}\n\t\t}\n\t\t$iflist = get_configured_interface_list();\n\t\tforeach ($iflist as $if => $ifname) {\n\t\t\tif ($ignore_if == $if) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($isipv6) {\n\t\t\t\t$if_ipv6 = get_interface_ipv6($if);\n\t\t\t\t$if_snbitsv6 = get_interface_subnetv6($if);\n\t\t\t\t/* do not check subnet overlapping on 6rd interfaces,\n\t\t\t\t * see https://redmine.pfsense.org/issues/12371 */ \n\t\t\t\tif ($if_ipv6 && $if_snbitsv6 &&\n\t\t\t\t ((config_get_path(\"interfaces/{$if}/ipaddrv6\") != '6rd') || ($cidrprefix > $if_snbitsv6)) &&\n\t\t\t\t check_subnetsv6_overlap($ipaddr, $cidrprefix, $if_ipv6, $if_snbitsv6)) {\n\t\t\t\t\t$where_entry = array();\n\t\t\t\t\t$where_entry['if'] = $if;\n\t\t\t\t\t$where_entry['ip_or_subnet'] = get_interface_ipv6($if) . \"/\" . get_interface_subnetv6($if);\n\t\t\t\t\t$where_configured[] = $where_entry;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$if_ipv4 = get_interface_ip($if);\n\t\t\t\t$if_snbitsv4 = get_interface_subnet($if);\n\t\t\t\tif ($if_ipv4 && $if_snbitsv4 && check_subnets_overlap($ipaddr, $cidrprefix, $if_ipv4, $if_snbitsv4)) {\n\t\t\t\t\t$where_entry = array();\n\t\t\t\t\t$where_entry['if'] = $if;\n\t\t\t\t\t$where_entry['ip_or_subnet'] = get_interface_ip($if) . \"/\" . get_interface_subnet($if);\n\t\t\t\t\t$where_configured[] = $where_entry;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif ($isipv6) {\n\t\t\t$interface_list_ips = get_configured_ipv6_addresses();\n\t\t} else {\n\t\t\t$interface_list_ips = get_configured_ip_addresses();\n\t\t}\n\n\t\tforeach ($interface_list_ips as $if => $ilips) {\n\t\t\tif ($ignore_if == $if) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (strcasecmp($ipaddr, $ilips) == 0) {\n\t\t\t\t$where_entry = array();\n\t\t\t\t$where_entry['if'] = $if;\n\t\t\t\t$where_entry['ip_or_subnet'] = $ilips;\n\t\t\t\t$where_configured[] = $where_entry;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ($check_localip) {\n\t\tif (strcasecmp($ipaddr, text_to_compressed_ip6(config_get_path('l2tp/localip', \"\"))) == 0) {\n\t\t\t$where_entry = array();\n\t\t\t$where_entry['if'] = 'l2tp';\n\t\t\t$where_entry['ip_or_subnet'] = config_get_path('l2tp/localip');\n\t\t\t$where_configured[] = $where_entry;\n\t\t}\n\t}\n\n\treturn $where_configured;\n}", "public function __construct($ip_or_cidr, $prefix = '')\n\t{\n\t\t$this->given_ip = $ip_or_cidr;\n\t\tif ( strpos($ip_or_cidr, '/') !== false ) {\n\t\t\tlist($this->given_ip, $prefix) = explode('/', $ip_or_cidr, 2);\n\t\t}\n\n\t\tif ( ! $this->given_ip instanceof IP ) {\n\t\t\t$this->given_ip = new $this->ip_class($this->given_ip);\n\t\t}\n\n\t\t$this->checkPrefix($prefix);\n\t\t$this->prefix = (int) $prefix;\n\n\t\t$this->first_ip = $this->given_ip->bit_and($this->getMask());\n\t\t$this->last_ip = $this->first_ip->bit_or($this->getDelta());\n\t}", "function parse_range($r) {\n\tglobal $IP1BYTE, $IP2BYTE, $IP3BYTE, $IP4BYTE, $IPRANGE, $CIDR, $CIDR1BYTE, $CIDR2BYTE, $CIDR3BYTE, $IP6ADDR, $IP6CIDR;\n\tif (preg_match($IP1BYTE, $r, $m)) {\n\t\t$a = digits_to_int($m[1], 0, 0, 0);\n\t\t$b = digits_to_int($m[1], 255, 255, 255);\n\t} elseif (preg_match($IP2BYTE, $r, $m)) {\n\t\t$a = digits_to_int($m[1], $m[2], 0, 0);\n\t\t$b = digits_to_int($m[1], $m[2], 255, 255);\n\t} elseif (preg_match($IP3BYTE, $r, $m)) {\n\t\t$a = digits_to_int($m[1], $m[2], $m[3], 0);\n\t\t$b = digits_to_int($m[1], $m[2], $m[3], 255);\n\t} elseif (preg_match($IP4BYTE, $r, $m)) {\n\t\t$a = digits_to_int($m[1], $m[2], $m[3], $m[4]);\n\t\t$b = $a;\n\t} elseif (preg_match($IPRANGE, $r, $m)) {\n\t\t$a = digits_to_int($m[1], $m[2], $m[3], $m[4]);\n\t\t$b = digits_to_int($m[5], $m[6], $m[7], $m[8]);\n\t} elseif (preg_match($CIDR, $r, $m)) {\n\t\t$ip = digits_to_int($m[1], $m[2], $m[3], $m[4]);\n\t\t$bits = intval($m[5]);\n\t\t$lobits = pow(2, 32-$bits) - 1;\n\t\t$hibits = 0xffffffff ^ $lobits;\n\n\t\t$a = $ip & $hibits;\n\t\t$b = $a | $lobits;\n\t} elseif (preg_match($CIDR3BYTE, $r, $m)) {\n\t\t$ip = digits_to_int($m[1], $m[2], $m[3], 0);\n\t\t$bits = intval($m[4]);\n\t\t$lobits = pow(2, 32-$bits) - 1;\n\t\t$hibits = 0xffffffff ^ $lobits;\n\n\t\t$a = $ip & $hibits;\n\t\t$b = $a | $lobits;\n\t} elseif (preg_match($CIDR2BYTE, $r, $m)) {\n\t\t$ip = digits_to_int($m[1], $m[2], 0, 0);\n\t\t$bits = intval($m[3]);\n\t\t$lobits = pow(2, 32-$bits) - 1;\n\t\t$hibits = 0xffffffff ^ $lobits;\n\n\t\t$a = $ip & $hibits;\n\t\t$b = $a | $lobits;\n\t} elseif (preg_match($CIDR1BYTE, $r, $m)) {\n\t\t$ip = digits_to_int($m[1], 0, 0, 0);\n\t\t$bits = intval($m[2]);\n\t\t$lobits = pow(2, 32-$bits) - 1;\n\t\t$hibits = 0xffffffff ^ $lobits;\n\n\t\t$a = $ip & $hibits;\n\t\t$b = $a | $lobits;\n\t} elseif (preg_match($IP6ADDR, $r, $m)) {\n\t\t$a = $b = ip6_to_ints($m[1]);\n\t} elseif (preg_match($IP6CIDR, $r, $m)) {\n\t\t$a = $b = ip6_to_ints($m[1]);\n\t\t$bits = intval($m[2]);\n\n\t\tfor ($i = 0; $i < 128; $i += 16) {\n\t\t\t$idx = ($i / 16);\n\t\t\tif ($bits >= ($i+16)) {\n\t\t\t\t# this idx is all network\n\t\t\t} elseif ($bits > $i) {\n\t\t\t\t# this idx is partial\n\t\t\t\t$lobits = pow(2, 16-($bits-$i)) - 1;\n\t\t\t\t$hibits = 0xffff ^ $lobits;\n\t\t\t\t$a[$idx] &= $hibits;\n\t\t\t\t$b[$idx] = $a[$idx] | $lobits;\n\t\t\t} else {\n\t\t\t\t# this idx is all address\n\t\t\t\t$a[$idx] = 0x0000;\n\t\t\t\t$b[$idx] = 0xffff;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tthrow new Exception(\"can't parse IP range '$r'\");\n\t}\n\treturn array($a, $b);\n}", "public function setRange($ip, $end = null)\n {\n if (strpos($ip, '-') !== false) {\n list($ip, $end) = array_map('trim', explode('-', $ip, 2));\n }\n\n if (false === filter_var($ip, FILTER_VALIDATE_IP) ||\n false === filter_var($end, FILTER_VALIDATE_IP)) {\n throw new \\InvalidArgumentException(\"Invalid IP range \\\"$ip-$end\\\"\");\n }\n\n // determine version (4 or 6)\n $this->version = (false === filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) ? 6 : 4;\n\n $this->istart = IP::inet_ptod($ip);\n $this->iend = IP::inet_ptod($end);\n\n // fix order\n if (bccomp($this->istart, $this->iend) == 1) {\n list($this->istart, $this->iend) = array($this->iend, $this->istart);\n list($ip, $end) = array($end, $ip);\n }\n\n $this->start = $ip;\n $this->end = $end;\n\n // calculate real prefix\n $len = $this->version == 4 ? 32 : 128;\n $this->prefix = $len - strlen(BC::bcdecbin(BC::bcxor($this->istart, $this->iend)));\n }", "public static function sanitizeIP( $ip ) {\n $ip = trim( $ip );\n if ( $ip === '' ) {\n return null;\n }\n if ( self::isIPv4( $ip ) || !self::isIPv6( $ip ) ) {\n return $ip; // nothing else to do for IPv4 addresses or invalid ones\n }\n // Remove any whitespaces, convert to upper case\n $ip = strtoupper( $ip );\n // Expand zero abbreviations\n $abbrevPos = strpos( $ip, '::' );\n if ( $abbrevPos !== false ) {\n // We know this is valid IPv6. Find the last index of the\n // address before any CIDR number (e.g. \"a:b:c::/24\").\n $CIDRStart = strpos( $ip, \"/\" );\n $addressEnd = ( $CIDRStart !== false )\n ? $CIDRStart - 1\n : strlen( $ip ) - 1;\n // If the '::' is at the beginning...\n if ( $abbrevPos == 0 ) {\n $repeat = '0:';\n $extra = ( $ip == '::' ) ? '0' : ''; // for the address '::'\n $pad = 9; // 7+2 (due to '::')\n // If the '::' is at the end...\n } elseif ( $abbrevPos == ( $addressEnd - 1 ) ) {\n $repeat = ':0';\n $extra = '';\n $pad = 9; // 7+2 (due to '::')\n // If the '::' is in the middle...\n } else {\n $repeat = ':0';\n $extra = ':';\n $pad = 8; // 6+2 (due to '::')\n }\n $ip = str_replace( '::',\n str_repeat( $repeat, $pad - substr_count( $ip, ':' ) ) . $extra,\n $ip\n );\n }\n // Remove leading zereos from each bloc as needed\n $ip = preg_replace( '/(^|:)0+(' . RE_IPV6_WORD . ')/', '$1$2', $ip );\n return $ip;\n }", "function checkIPorRange ($ip_address) {\r\n\t if (ereg(\"-\",$ip_address)) {\r\n\t // Range\r\n\t $ar = explode(\"-\",$ip_address);\r\n\t $your_long_ip = ip2long($_SERVER[\"REMOTE_ADDR\"]);\r\n\t if ( ($your_long_ip >= ip2long($ar[0])) && ($your_long_ip <= ip2long($ar[1])) ) {\r\n\t return TRUE;\r\n\t }\r\n\t } else {\r\n\t // Single IP\r\n\t if ($_SERVER[\"REMOTE_ADDR\"] == $ip_address) {\r\n\t return TRUE;\r\n\t }\r\n\t }\r\n\t return FALSE;\r\n\t}", "function is_ipaddr_configured($ipaddr, $ignore_if = \"\", $check_localip = false, $check_subnets = false, $cidrprefix = \"\") {\n\tif (count(where_is_ipaddr_configured($ipaddr, $ignore_if, $check_localip, $check_subnets, $cidrprefix))) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "function PMA_ipMaskTest($testRange, $ipToTest)\n{\n $result = true;\n\n if (preg_match('|([0-9]+)\\.([0-9]+)\\.([0-9]+)\\.([0-9]+)/([0-9]+)|', $testRange, $regs)) {\n // performs a mask match\n $ipl = ip2long($ipToTest);\n $rangel = ip2long($regs[1] . '.' . $regs[2] . '.' . $regs[3] . '.' . $regs[4]);\n\n $maskl = 0;\n\n for ($i = 0; $i < 31; $i++) {\n if ($i < $regs[5] - 1) {\n $maskl = $maskl + PMA_pow(2, (30 - $i));\n } // end if\n } // end for\n\n if (($maskl & $rangel) == ($maskl & $ipl)) {\n return true;\n } else {\n return false;\n }\n } else {\n // range based\n $maskocts = explode('.', $testRange);\n $ipocts = explode('.', $ipToTest);\n\n // perform a range match\n for ($i = 0; $i < 4; $i++) {\n if (preg_match('|\\[([0-9]+)\\-([0-9]+)\\]|', $maskocts[$i], $regs)) {\n if (($ipocts[$i] > $regs[2])\n || ($ipocts[$i] < $regs[1])) {\n $result = false;\n } // end if\n } else {\n if ($maskocts[$i] <> $ipocts[$i]) {\n $result = false;\n } // end if\n } // end if/else\n } //end for\n } //end if/else\n\n return $result;\n}", "function cidrips($cidr) {\n\t\t\tif (!IPv6::validate_cidr($cidr))\n\t\t\t\treturn false;\n\n\t\t\treturn pow(2, (128-$cidr));\n\t\t}", "public static function ipaddress_or_cidr(string $input): bool {\r\n return preg_match('/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/(\\d|[1-2]\\d|3[0-2]))?$/', $input) === 1;\r\n }" ]
[ "0.63334244", "0.6101853", "0.6023332", "0.5998086", "0.59848195", "0.5941606", "0.5839484", "0.5810836", "0.5805277", "0.573716", "0.56510144", "0.5627705", "0.56241304", "0.56180316", "0.55836403", "0.5582278", "0.55793315", "0.5561933", "0.55152565", "0.5451722", "0.5425992", "0.53426284", "0.5332203", "0.531368", "0.52148473", "0.5195605", "0.51897883", "0.51461995", "0.5141737", "0.5136122" ]
0.62581164
1
Executes the operation to be retried.
public function doWithRetry(RetryContext $context);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __invoke(...$arguments)\n {\n $this->retries = 0;\n\n do {\n try {\n return call_user_func_array($this->operation, $arguments);\n } catch (\\Throwable $e) {\n call_user_func($this->exceptionHandler, $e);\n\n $this->retries++;\n }\n } while (true);\n }", "public function execute() {\r\n $url = $this->getUrl() . $this->actions['execute'];\r\n\r\n Utils::log(sprintf(\"Reindexing all on '%s'...\", $url));\r\n $res = $this->curl($url);\r\n \r\n if ($res == 404) {\r\n Utils::log(\\Logger\\ILogger::ERROR, sprintf(\"REINDEX: Cannot 'reindex all'. Remote script '%s' does not exists.\", $url));\r\n } else {\r\n Utils::log(\"REINDEX: Reindexed all.\");\r\n }\r\n \r\n return $res;\r\n }", "private function retryExec()\n {\n $i=0;\n while ($i++ <CURL_EXEC_RETRY_MAX) {\n fwrite(STDERR, 'Attempt #' . $i . '...' . PHP_EOL);\n $this->response=curl_exec($this->ch);\n if ($this->response) break;\n if ($i<CURL_EXEC_RETRY_MAX) sleep($i);\n }\n }", "public function execute()\n\t{\n\t\t$this->executeCall();\n\t\t$this->executeReminder();\n\t}", "public function retry()\n {\n if ($this->acknowledged)\n $this->log->error(\"PubSubRequest::retry() called after acknowledge()\");\n $this->wantsRetry = true;\n }", "public function retryAll()\n {\n foreach ($this->getFailedFiles() as $file) {\n // Rename the file first\n $tmpFile = dirname($file) . '/retrying-' . basename($file);\n rename($file, $tmpFile);\n\n $fp = @fopen($tmpFile, 'r');\n if ($fp === false) {\n fwrite(\n STDERR,\n sprintf('Could not open the file: %s' . PHP_EOL, $tmpFile)\n );\n continue;\n }\n while ($line = fgets($fp)) {\n $jsonDecodedValue = json_decode($line);\n // Check if data json_encoded after serialization\n if ($jsonDecodedValue !== null || $jsonDecodedValue !== false) {\n $line = $jsonDecodedValue;\n }\n $a = unserialize($line);\n $idNum = key($a);\n $job = $this->runner->getJobFromIdNum($idNum);\n if (! $job->callFunc($a[$idNum])) {\n $this->handleFailure($idNum, $a[$idNum]);\n }\n }\n @fclose($fp);\n @unlink($tmpFile);\n }\n }", "public function execute() {\n if ( $this->mInternalMode ) {\n $this->executeAction();\n } else {\n $this->executeActionWithErrorHandling();\n }\n }", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute()\n {\n throw new Exception('Method not implemented');\n }", "public function execute() { }" ]
[ "0.5896219", "0.58634007", "0.58553016", "0.5854514", "0.5563528", "0.55551976", "0.5512323", "0.5440749", "0.5440749", "0.544069", "0.544069", "0.544069", "0.544069", "0.544069", "0.544069", "0.5440657", "0.5440657", "0.5440657", "0.5440657", "0.5440657", "0.5440657", "0.5440657", "0.5440657", "0.5440657", "0.5440657", "0.5440657", "0.5440657", "0.5440657", "0.5310615", "0.5298136" ]
0.613116
0
function to display user data in databale using ajax Function for get users data use in ajax datatable pagination.
function ajaxloadUser(){ $length = Input::get('length'); $start = Input::get('start'); $search = Input::get('search'); $totaldata = AdminUser::CountUsers(); // function counts records in user table. $total_filtered_data = $totaldata; $search = $search['value']; $order = Input::get('order'); $column_id = $order[0]['column']; $column_order = $order[0]['dir']; if($search != null){ $userdetails = AdminUser::GetUsers($search,$start,$length,$column_id,$column_order); // calls function for getting users data. }else{ $userdetails = AdminUser::GetUsers($search="",$start,$length,$column_id,$column_order); } $table_data = array(); return view('admin.pages.users.indexajax', ['userdetails' => $userdetails,'total_data' => $totaldata ,'total_filtered_data' => $total_filtered_data ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listuser(){\n\t\t\tif(!empty($_GET['paginado'])){\n\t\t\t\t$pag = $_GET['paginado'];\n\t\t\t\t$list = $this -> model -> selectuser($pag);\n\t\t\t}else{\n\t\t\t\t$list = $this -> model -> selectuser();\n\t\t\t}\n\t\t\t$this -> ajax_set($list);\n\t\t}", "public function active_users_datatable()\n\t\t{\n\t\t\t$list = $this->Users->get_datatables();\n\t\t\t$data = array();\n\t\t\t$no = $_POST['start'];\n\t\t\t\n\t\t\tforeach ($list as $user) {\n\t\t\t\t$no++;\n\t\t\t\t$row = array();\n\t\t\t\t\n\t\t\t\t$thumbnail = '';\n\t\t\t\t$filename = FCPATH.'uploads/users/'.$user->id.'/'.$user->avatar;\n\n\t\t\t\tif($user->avatar == '' || $user->avatar == null || !file_exists($filename)){\n\t\t\t\t\t$thumbnail = '<img src=\"'.base_url().'assets/images/icons/avatar.jpg\" class=\"img-responsive img-circle avatar-view\" width=\"40\" height=\"50\"/>';\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$thumbnail = '<img src=\"'.base_url().'uploads/users/'.$user->id.'/'.$user->avatar.'\" class=\"img-responsive img-rounded\" width=\"40\" height=\"50\"/>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$row[] = '<div class=\"checkbox checkbox-primary pull-left\" style=\"margin:8% auto;\"><input type=\"checkbox\" name=\"cb[]\" class=\"cb\" onclick=\"enableButton(this)\" value=\"'.$user->id.'\"><label for=\"cb\"></label></div><div class=\"\" style=\"margin-left:45%; margin-right:25%;\">'.$thumbnail.'</div>';\n\t\t\t\t\n\t\t\t\t$details_url = 'admin/user_details';\n\t\t\t\t\n\t\t\t\t$row[] = '<a href=\"!#\" data-toggle=\"modal\" data-target=\"#viewModal\" class=\"link\" onclick=\"viewUser('.$user->id.',\\''.$details_url.'\\');\" title=\"View '.$user->first_name .' '.$user->last_name.'\">'.$user->first_name .' '.$user->last_name.'</a>';\n\t\t\t\t\n\t\t\t\t$address = $user->address_line_1.', '.$user->city.' '.$user->postcode.', '.$user->state.', '.$user->country;\n\t\t\t\tif($user->address_line_2 != ''){\n\t\t\t\t\t$address = $user->address_line_1.', '.$user->address_line_2.', '.$user->city.' '.$user->postcode.', '.$user->state.', '.$user->country;\n\t\t\t\t}\n\t\t\t\t//USER PROFILE COMPLETION PERCENTAGE\n\t\t\t\t$profile_completion = $this->Users->profile_completion($user->email_address);\n\t\t\t\t//display progress bar\n\t\t\t\t$row[] = '<div class=\"project_progress\"><div class=\"progress progress_sm\">\n <div class=\"progress-bar bg-green\" role=\"progressbar\" aria-valuenow=\"'.$profile_completion.'\"\n aria-valuemin=\"0\" aria-valuemax=\"100\" style=\"width:'.$profile_completion.'%\"></div>\n </div><br/><small>'.$profile_completion.'% Complete</small></div>';\n\t\t\t\t\t\t\n\t\t\t\t//$row[] = substr($address, 0, 25).'...';\n\t\t\t\t\n\t\t\t\t//$account_balance = number_format($user->account_balance, 2);\n\t\t\t\t//$row[] = $account_balance;\n\t\t\t\t\n\t\t\t\t//$row[] = $member->username;\n\t\t\t\t//$row[] = $user->account_number;\n\t\t\t\t//count reviews\n\t\t\t\t$count_reviews = $this->Reviews->count_user_reviews($user->id);\n\t\t\t\tif($count_reviews == '' || $count_reviews == null || $count_reviews < 1 ){\n\t\t\t\t\t$count_reviews = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//get product ratings\n\t\t\t\t$rating = $this->db->select_avg('rating')->from('reviews')->where('\tseller_email', $user->email_address)->get()->result();\n\t\t\t\t\t\n\t\t\t\t$rating_box = '';\n\t\t\t\t\n\t\t\t\tif($rating[0]->rating == '' || $rating[0]->rating == null || $rating[0]->rating < 1){\n\t\t\t\t\t$ratings = 0;\n\t\t\t\t\t$rating_box = '<div class=\"starrr stars-existing\" data-rating=\"'.round($rating[0]->rating).'\"></div> <span class=\"\">No reviews yet</span>';\n\t\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t$rating_box = '<div class=\"starrr stars-existing\" data-rating=\"'.round($rating[0]->rating).'\"></div> <span class=\"stars-count-existing\">'.round($rating[0]->rating).'</span> star(s) (<span class=\"review-count\">'.$count_reviews.'</span>)';\n\t\t\t\t}\n\t\t\t\t$row[] = $rating_box;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$last_updated = $user->last_updated;\n\t\t\t\tif($last_updated == '0000-00-00 00:00:00' || $last_updated == ''){ \n\t\t\t\t\t\t$last_updated = 'Never'; \n\t\t\t\t}else{ \n\t\t\t\t\t$last_updated = date(\"d M y\", strtotime($last_updated)).' at '.date(\"h:i A\", strtotime($last_updated)); \n\t\t\t\t\t//date(\"d M y h:i A\", strtotime($last_updated))\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\t\n\t\t\t\t$row[] = $last_updated;\n\t\t\t\t\n\t\t\t\t$last_login = $user->last_login;\n\t\t\t\tif($last_login == '0000-00-00 00:00:00' || $last_login == ''){ \n\t\t\t\t\t\t$last_login = 'Never'; \n\t\t\t\t}else{ \n\t\t\t\t\t$last_login = date(\"d M y\", strtotime($last_login)).' at '.date(\"h:i A\", strtotime($last_login)); \n\t\t\t\t\t//date(\"d M y h:i A\", strtotime($last_login))\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\t\n\t\t\t\t$row[] = $last_login;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t//\t$row[] = date(\"F j, Y\", strtotime($user->date_created));\n\t\t\t\t\n\t\t\t\t$model = 'users';\n\t\t\t\t\n\t\t\t\t$url = 'message/new_message_detail';\n\t\t\t\t\n\t\t\t\t//prepare buttons\n\t\t\t\t\n\t\t\t\t$row[] = '<a data-toggle=\"modal\" data-target=\"#messageModal\" class=\"btn btn-primary btn-xs\" onclick=\"sendDirectMessage('.$user->id.',\\''.$model.'\\',\\''.$url.'\\')\" title=\"Send Message to '.$user->first_name .' '.$user->last_name.'\"><i class=\"fa fa-envelope\"></i> Send Message</a>\n\t\t\t\t\n\t\t\t\t<a data-toggle=\"modal\" data-target=\"#addUserModal\" class=\"btn btn-warning btn-xs\" onclick=\"editUser('.$user->id.',\\''.$details_url.'\\');\" title=\"Edit '.$user->first_name .' '.$user->last_name.'\"><i class=\"fa fa-edit\"></i> Edit</a>\n\t\t\t\t\n\t\t\t\t<a data-toggle=\"modal\" class=\"btn btn-danger btn-xs\" data-target=\"#suspendModal\" onclick=\"suspendUser('.$user->id.',\\''.$details_url.'\\');\" title=\"Suspend '.$user->first_name .' '.$user->last_name.'\"><i class=\"fa fa-ban\"></i> Suspend</a>\n\t\t\t\t';\n\t\t\t\t//<a data-toggle=\"modal\" data-target=\"#editModal\" class=\"btn btn-primary btn-xs\" onclick=\"editUser('.$user->id.');\" id=\"'.$user->id.'\" title=\"Edit '.$user->first_name .' '.$user->last_name.'\"><i class=\"fa fa-edit\"></i></a>\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t\t\t\t//\n\t\t\t\t\n\t\t\t$output = array(\n\t\t\t\t\n\t\t\t\t\"draw\" => $_POST['draw'],\n\t\t\t\t\"recordsTotal\" => $this->Users->count_all(),\n\t\t\t\t\"recordsFiltered\" => $this->Users->count_filtered(),\n\t\t\t\t\"data\" => $data,\n\t\t\t);\n\t\t\t//output to json format\n\t\t\techo json_encode($output);\n\t\t}", "public function ajax_listPaging()\n\t{\n\t\t// grab getings\n\t\t$datatable_varibles = helper_datatable_varibles($this->input->get());\n\n\t\t// generate the JSON going to return to AJAX\n\t\t$returnAJAX = $this->members_model->read_datatable(0, get_user_id(), $datatable_varibles);\n\n\n\t\t//=============================插入计算后的数据\n\n $newData = $returnAJAX[\"data\"];\n\n foreach($newData as $key=>$sub){\n\n //0:picture, 1:name\n $newData[$key][\"member_position_picture\"] = $this->tags_model->read_images($sub[\"member_position\"]);\n // $newData[$key][\"member_position_name\"] = $this->tags_model->read_names($sub[\"member_position\"]);\n }\n $returnAJAX[\"data\"] = $newData;\n\n //=============================\n\t\techo json_encode($returnAJAX);\n\t}", "public function data_fetch()\n\t{\t\n\t\t\n\t\tif(!$this->set_data->is_logged_in()){\n\t\t\tredirect('user/index');\n\t\t}\n\t\telse{ \t\t\n\t\t\t\n\t\t\t\n\t\t\t/* Auto load pagination library */\n\t\t\t/* Set the pagination configs */\n \t\t$config['base_url'] = '/user/data_fetch';\n \t\t$config['total_rows'] = $this->db->get('UserDetails')->num_rows();\n \t\t$config['per_page'] = '10'; \n \t\t$this->pagination->initialize($config); \n\n\t\t\t$data['query'] = $this->user_model->retrieve(null,$config['per_page']);\n\t\t\t$this->layout->view('user/display_view',$data);\t\n\t\t\t\n\t\t}\n\t}", "public function temp_users_datatable()\n\t\t{\n\t\t\t$list = $this->Temp_users->get_datatables();\n\t\t\t$data = array();\n\t\t\t$no = $_POST['start'];\n\t\t\t\n\t\t\tforeach ($list as $user) {\n\t\t\t\t$no++;\n\t\t\t\t$row = array();\n\t\t\t\t$row[] = '<div class=\"checkbox checkbox-primary\"><input type=\"checkbox\" name=\"cb[]\" class=\"cb\" onclick=\"enableButton(this)\" value=\"'.$user->id.'\"><label for=\"cb\"></label></div>';\n\t\t\t\t\n\t\t\t\t$row[] = $user->first_name .' '.$user->last_name;\n\t\t\t\t\n\t\t\t\t$row[] = $user->email_address;\n\t\t\t\t$row[] = $user->telephone;\n\t\t\t\t\n\t\t\t\t$ip_details = '<p><strong>IP: </strong>'.$user->ip_address.'</p>';\n\t\t\t\t$ip_details .= $user->ip_details;\n\t\t\t\t\n\t\t\t\t$row[] = $user->ip_address;\n\t\t\t\t\n\t\t\t\t$row[] = date(\"F j, Y\", strtotime($user->date_created));\n\t\t\t\t\n\t\t\t\t$url = 'admin/temp_user_details';\n\t\t\t\t\n\t\t\t\t$row[] = '<a data-toggle=\"modal\" class=\"btn btn-success btn-xs\" data-target=\"#activateModal\" onclick=\"activateUser('.$user->id.',\\''.$url.'\\');\" id=\"'.$user->id.'\" title=\"Activate '.$user->first_name .' '.$user->last_name.'\"><i class=\"fa fa-check-circle fa-lg\" aria-hidden=\"true\"></i> Activate User</a>';\n\t\t\t\t\n\t\t\t\t$model = 'temp_users';\n\t\t\t\t\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t \n\t\t\t$output = array(\n\t\t\t\t\n\t\t\t\t\"draw\" => $_POST['draw'],\n\t\t\t\t\"recordsTotal\" => $this->Temp_users->count_all(),\n\t\t\t\t\"recordsFiltered\" => $this->Temp_users->count_filtered(),\n\t\t\t\t\"data\" => $data,\n\t\t\t);\n\t\t\t//output to json format\n\t\t\techo json_encode($output);\n\t\t}", "public function admin_users_datatable()\n\t\t{\n\t\t\t$list = $this->Admin->get_datatables();\n\t\t\t$data = array();\n\t\t\t$no = $_POST['start'];\n\t\t\t\n\t\t\tforeach ($list as $user) {\n\t\t\t\t$no++;\n\t\t\t\t$row = array();\n\t\t\t\t\n\t\t\t\t$thumbnail = '';\n\t\t\t\t$filename = FCPATH.'uploads/admins/'.$user->id.'/'.$user->avatar;\n\n\t\t\t\tif($user->avatar == '' || $user->avatar == null || !file_exists($filename)){\n\t\t\t\t\t$thumbnail = '<div class=\"\" style=\"margin-left:25%; margin-right:25%;\"><img src=\"'.base_url().'assets/images/icons/avatar.jpg\" class=\"img-responsive img-circle avatar-view\" width=\"40\" height=\"50\"/></div>';\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$thumbnail = '<div class=\"\" style=\"margin-left:25%; margin-right:25%;\"><img src=\"'.base_url().'uploads/admins/'.$user->id.'/'.$user->avatar.'\" class=\"img-responsive img-circle\" width=\"40\" height=\"50\"/></div>';\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t$row[] = '<div class=\"checkbox checkbox-primary pull-left\" style=\"margin:8% auto;\"><input type=\"checkbox\" name=\"cb[]\" class=\"cb\" onclick=\"enableButton(this)\" value=\"'.$user->id.'\"><label for=\"cb\"></label></div><div class=\"\" style=\"margin-left:45%; margin-right:25%;\">'.$thumbnail.'</div>';\n\t\t\t\t\n\t\t\t\t//$row[] = '<input type=\"checkbox\" name=\"cb[]\" class=\"cb\" onclick=\"enableButton(this)\" value=\"'.$user->id.'\">';\n\t\t\t\t$url = 'admin/admin_details';\n\t\t\t\t\n\t\t\t\t$row[] = '<a href=\"#!\" data-toggle=\"modal\" data-target=\"#viewModal\" class=\"link\" id=\"'.$user->id.'\" title=\"View '.ucwords($user->admin_name).'\" onclick=\"viewAdmin('.$user->id.',\\''.$url.'\\')\">'.ucwords($user->admin_name).' ('.$user->admin_username.')</a>';\n\t\t\t\t\n\t\t\t\t$row[] = $user->access_level;\n\t\t\t\n\t\t\t\t//'last_updated' => date('Y-m-d H:i:s'),\n\t\t\t\t$last_updated = $user->last_updated;\n\t\t\t\tif($last_updated == '0000-00-00 00:00:00' || $last_updated == ''){ \n\t\t\t\t\t$last_updated = 'Never'; \n\t\t\t\t}else{ \n\t\t\t\t\t$last_updated = date(\"F j, Y, g:i a\", strtotime($last_updated)); \n\t\t\t\t}\n\t\t\t\t$row[] = $last_updated;\n\t\t\t\t\n\t\t\t\t$last_login = $user->last_login;\n\t\t\t\tif($last_login == '0000-00-00 00:00:00' || $last_login == ''){ \n\t\t\t\t\t$last_login = 'Never'; \n\t\t\t\t}else{ \n\t\t\t\t\t$last_login = date(\"F j, Y, g:i a\", strtotime($last_login)); \n\t\t\t\t}\n\t\t\t\t$row[] = $last_login;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$row[] = date(\"F j, Y\", strtotime($user->date_created));\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//prepare buttons\n\t\t\t\t$model = 'admin_users';\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$row[] = '<a data-toggle=\"modal\" data-target=\"#messageModal\" class=\"btn btn-success btn-xs\" onclick=\"sendDirectMessage('.$user->id.',\\''.$model.'\\',\\''.$url.'\\')\" id=\"'.$user->id.'\" title=\"Send Message to '.ucwords($user->admin_name).'\"><i class=\"fa fa-envelope\"></i> Message</a>\n\t\t\t\t<a data-toggle=\"modal\" data-target=\"#editModal\" class=\"btn btn-primary btn-xs\" title=\"Click to Edit\" onclick=\"editAdmin('.$user->id.',\\''.$url.'\\')\"><i class=\"fa fa-pencil\"></i> Edit</a>';\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t \n\t\t\t$output = array(\n\t\t\t\t\n\t\t\t\t\"draw\" => $_POST['draw'],\n\t\t\t\t\"recordsTotal\" => $this->Admin->count_all(),\n\t\t\t\t\"recordsFiltered\" => $this->Admin->count_filtered(),\n\t\t\t\t\"data\" => $data,\n\t\t\t);\n\t\t\t//output to json format\n\t\t\techo json_encode($output);\n\t\t}", "function userListing()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n else\n { \n $searchText = $this->security->xss_clean($this->input->post('searchText'));\n $data['searchText'] = $searchText;\n \n $this->load->library('pagination');\n \n $count = $this->user_model->userListingCount($searchText);\n\n\t\t\t$returns = $this->paginationCompress ( \"userListing/\", $count, 5 );\n \n $data['userRecords'] = $this->user_model->userListing($searchText, $returns[\"page\"], $returns[\"segment\"]);\n \n $this->global['pageTitle'] = 'Garuda Informatics : User Listing';\n \n $this->loadViews($this->view.\"users\", $this->global, $data, NULL);\n }\n }", "public function fetch_user()\n\t{\n\n\t\t//echo '<pre>';print_r($_POST);die;\n\t\t$fetch_data = $this->user_model->datatables();\n\t\t$data = array();\n\t\t// echo '<pre>';print_r($fetch_data);die;\n\t\t\n\t\t$i = 1;\n\t\tforeach ($fetch_data as $row)\n\t\t{\n\t\t\t$html = '';\n\t\t\t$html .= '<button data-id=\"'.$row->id.'\" type=\"button\" class=\"btn btn-primary btn-sm edit_user_btn\" href=\"javascript:void(0)\">\n Edit</button>\n <a href=\"'.base_url().'delete-user/ '.$row->id.'\" class=\"btn btn-danger btn-sm\">Delete</a>';\n $test = array();\n $test[] = $i;\n $test[] = $row->name;\n $test[] = $row->email;\n $test[] = $row->user_mobile;\n $test[] = $row->user_address;\n $test[] = $row->user_type;\n $test[] = '<img height=\"50\" weidtht=\"50\" src=\"'.base_url().'uploads/'.$row->user_image.'\">';\n $test[] = $html;\n\n $data[] = $test;\n $i++;\n //echo '<pre>';print_r($data);die;\n }\n $output = array(\n\t\t\t\"draw\" => intval($_POST[\"draw\"]),\n\t\t\t\"recordsTotal\" => $this->user_model->get_all_data(),\n\t\t\t\"rescordsFiltered\" => $this->user_model->get_filtered_data(),\n\t\t\t\"data\" => $data\n\n\t\t);\n \n\t\techo json_encode($output);\n\t\t//echo '<pre>';print_r($output);die;\n\t}", "public function show_alluser_datatbl()\n {\n $model = new mainModel();\n $UserId = session()->get('userid');\n $responese = $model->getAllUserDetails($UserId);\n return Datatables::of($responese)\n ->addIndexColumn()\n ->addColumn('master_roleId', function ($query) {\n $masterROles = $query->master_roleId;\n $sql = \"SELECT GROUP_CONCAT(MASTER_ROLE_NAME ,'') as 'MASTER_ROLE_NAME' FROM mst_tbl_master_role WHERE MASTER_ROLE_ID IN($masterROles) \";\n $info = DB::select(DB::raw($sql));\n // print_r();\n return $info[0]->MASTER_ROLE_NAME;\n })\n ->addColumn('REPORTING_MANGERS', function ($query) {\n $REPORTING = $query->REPORTING_MANGERS;\n $sql = \"SELECT GROUP_CONCAT(username ,'') as 'REPORTING_MANGERS' FROM mst_user_tbl WHERE userId IN($REPORTING) \";\n $info = DB::select(DB::raw($sql));\n // print_r();\n return $info[0]->REPORTING_MANGERS;\n })\n ->addColumn('PRIMARY_MANGER', function ($query) {\n if ($query->PRIMARY_MANGER != null) {\n $assinedusers = DB::table('mst_user_tbl')->where(['Flag' => 'Show', 'userId' => $query->PRIMARY_MANGER])->get()->first();\n return $assinedusers->username;\n } else {\n return 'Not Assinded';\n }\n })->addColumn('SHIFT_ID', function ($query) {\n if ($query->SHIFT_ID != 0) {\n $assinedShift = DB::table('mst_tbl_shifts')->where(['Flag' => 'Show', 'SHIFT_ID' => $query->SHIFT_ID])->get()->first();\n return $assinedShift->SHIFT_NAME;\n } else {\n return 'No Shifts';\n }\n })\n ->addColumn('action', function ($query) {\n $id = Crypt::encrypt($query->userId);\n return '<a href=\"' . action('Admin\\UserController@editUser', Crypt::encrypt($query->userId)) . '\" id=\"userform' . $query->userId . '\"><img src=\"/asset/css/zondicons/zondicons/edit-pencil.svg\" style=\"width: 15px;margin-right: 20px; filter: invert(0.5);\" alt=\"\"></a>\n <a href=\"javascript:void(0)\" onclick=\"deleteUser(' . \"'$id'\" . ',event)\"><img src=\"/asset/css/zondicons/zondicons/close.svg\"\n style=\"width: 15px; filter: invert(0.5);\" alt=\"\"></a>\n ';\n })\n ->rawColumns(['action', 'PRIMARY_MANGER', 'master_roleId', 'REPORTING_MANGERS'])\n ->make(true);\n\n }", "public function userlist()\n {\n $config = array();\n $config['base_url'] = 'http://localhost/task1/ci/Index.php/index/userlist';\n $config['total_rows'] = $this->ModelOfUser->total_number_of_records_in_user_table();\n $config['per_page'] = 5;\n $config['uri_segment'] = 3;\n $config['next_link'] = 'Next';\n $config['prev_link'] = 'Previous';\n \n // initializing the library\n $this->pagination->initialize($config);\n \n $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;\n $data[\"results\"] = $this->ModelOfUser->get_all_user_data_from_user_table($config[\"per_page\"], $page);\n // echo $data[\"results\"];die();\n $data[\"links\"] = $this->pagination->create_links();\n \n $this->load->view(\"userlist\", $data);\n // echo $this->uri->segment(4);\n }", "public function adminAjaxList($order_by = \"id\", $sort_order = \"asc\", $search = \"all\", $offset = 0) {\n\n $aColumns = array('id', 'first_name', 'email_address', 'status', '');\n $grid_data = Helper::get_search_data($aColumns);\n\n\n $sort_order = $grid_data['sort_order'];\n $order_by = $grid_data['order_by'];\n if ($grid_data['sort_order'] == '' && $grid_data['order_by'] == '') {\n $order_by = 'id';\n $sort_order = 'DESC';\n }\n\n /*\n * Paging\n */\n $limit = $grid_data['per_page'];\n $offset = $grid_data['offset'];\n\n\n $SearchType = $grid_data['SearchType'];\n $search_data = $grid_data['search_data'];\n\n\n $data = $this->trim_serach_data($search_data, $SearchType);\n\n $query = 'select tbl_adminuser.* from tbl_adminuser';\n\n if ($SearchType == 'ORLIKE') {\n $likeStr = Helper::or_like_search($data);\n }\n if ($SearchType == 'ANDLIKE') {\n $likeStr = Helper::and_like_search($data);\n }\n\n if ($likeStr) {\n $query .= ' Where ' . $likeStr;\n }\n\n $query .= ' order by ' . $order_by . ' ' . $sort_order;\n $query .= ' limit ' . $limit . ' OFFSET ' . $offset;\n\n\n $result = DB::select($query);\n\n\n $data = array();\n if (count($result) > 0) {\n $data['result'] = $result;\n $data['totalRecord'] = $this->count_all_customer_grid($search_data, $SearchType);\n }\n\n $output = array(\n \"sEcho\" => intval($_GET['sEcho']),\n \"iTotalRecords\" => 0,\n \"iTotalDisplayRecords\" => 0,\n \"aaData\" => array()\n );\n if (isset($data) && !empty($data)) {\n if (isset($data['result']) && !empty($data['result'])) {\n $output = array(\n \"sEcho\" => intval($_GET['sEcho']),\n \"iTotalRecords\" => $data['totalRecord'],\n \"iTotalDisplayRecords\" => $data['totalRecord'],\n \"aaData\" => array()\n );\n foreach ($data['result'] AS $result_row) {\n $row = array();\n $row[] = $result_row->id;\n $row[] = $result_row->first_name;\n $row[] = $result_row->email_address;\n $row[] = $result_row->status;\n $row[] = array();\n $output['aaData'][] = $row;\n }\n }\n }\n //print_r(json_encode($output));exit;\n echo json_encode($output);\n }", "public function User()\n\t{\n\t\t$config['base_url'] = site_url(\"admin/User?per_page={$this->input->get('per_page')}&query={$this->input->get('q')}\");\n\n\t\t$config['per_page'] = 10;\n\t\t$config['total_rows'] = $this->madmin->getAllUser(null, null, 'num');\n\t\t$config['full_tag_open'] = '<ul class=\"pagination\">';\n\t\t$config['full_tag_close'] = '</ul>';\n\t\t$config['first_link'] = \"&larr; Pertama\";\n\t\t$config['first_tag_open'] = '<li class=\"\">';\n\t\t$config['first_tag_close'] = '</li>';\n\t\t$config['last_link'] = \"Terakhir &raquo\";\n\t\t$config['last_tag_open'] = '<li class=\"\">';\n\t\t$config['last_tag_close'] = '</li>';\n\t\t$config['next_link'] = \"Selanjutnya &rarr;\";\n\t\t$config['next_tag_open'] = '<li class=\"\">';\n\t\t$config['next_tag_close'] = '</li>';\n\t\t$config['prev_link'] = \"&larr; Sebelumnya\"; \n\t\t$config['prev_tag_open'] = '<li class=\"\">';\n\t\t$config['prev_tag_close'] = '</li>';\n\t\t$config['cur_tag_open'] = '<li class=\"active\"><a href=\"\">';\n\t\t$config['cur_tag_close'] = '</a></li>';\n\t\t$config['num_tag_open'] = '<li class=\"\">';\n\t\t$config['num_tag_close'] = '</li>'; \n\t\t$config['page_query_string'] = TRUE;\n\t\t$config['query_string_segment'] = 'page';\n\t\t\n\t\t$this->pagination->initialize($config);\n\t\t\n\t\t\n\t\t$this->data = array(\n\t\t\t'title' => \"Data User\",\n\t\t\t'reklame' => $this->madmin->getAllUser($config['per_page'], $this->input->get('page'), 'result')\n\t\t);\n\n\n\t\t$this->load->view('admin/data-user', $this->data);\n\t}", "function fetch_users(){ \n\n\t $fetch_data = $this->crud_model->make_datatables_users(); \n\t $data = array(); \n\t $etat =''; \n\t foreach($fetch_data as $row) \n\t { \n\t \t\tif ($row->idrole == 1) {\n\t \t\t\t$etat ='<span class=\"badge badge-success\">Admin</span>';\n\t \t\t}\n\t \t\telse if ($row->idrole == 2) {\n\t \t\t\t$etat ='<span class=\"badge badge-danger\">Client</span>';\n\t \t\t}\n\t \t\telse if ($row->idrole == 3) {\n\t \t\t\t$etat ='<span class=\"badge badge-info\">Membre</span>';\n\t \t\t}\n\t \t\telse{\n\t \t\t\t$etat ='<span class=\"badge badge-danger\">User</span>';\n\t \t\t}\n\n\t $sub_array = array(); \n\t $sub_array[] = '<img src=\"'.base_url().'upload/photo/'.$row->image.'\" class=\"table-user-thumb\" style=\"border-radius: 50%; width: 50px; height: 30px;\" />'; \n\t $sub_array[] = nl2br(substr($row->first_name, 0,50)).'...'; \n\t $sub_array[] = nl2br(substr($row->last_name, 0,50)).'...'; \n\n\t $sub_array[] = nl2br(substr($row->sexe, 0,50)).'';\n\n\t $sub_array[] = nl2br(substr($row->email, 0,50));\n\n\t $sub_array[] = nl2br(substr($row->telephone, 0,50));\n\t $sub_array[] = $etat;\n\n\t \n\t \n\t $sub_array[] = '<button type=\"button\" name=\"update\" id=\"'.$row->id.'\" class=\"btn btn-warning btn-circle btn-sm update\"><i class=\"fa fa-edit\"></i></button>'; \n\n\t $sub_array[] = '<button type=\"button\" name=\"delete\" id=\"'.$row->id.'\" class=\"btn btn-danger btn-circle btn-sm delete\"><i class=\"fa fa-trash\"></i></button>';\n\t \n\t $data[] = $sub_array; \n\t } \n\t $output = array( \n\t \"draw\" => intval($_POST[\"draw\"]), \n\t \"recordsTotal\" => $this->crud_model->get_all_data_users(), \n\t \"recordsFiltered\" => $this->crud_model->get_filtered_data_users(), \n\t \"data\" => $data \n\t ); \n\t echo json_encode($output); \n\t }", "public function userlist()\n {\n $users = array('users' => UserModel::getPublicProfilesOfAllUsers(),'dynatable'=>'userlist');\n $this->View->render('user/userlist',$users);\n }", "public function index(Request $request)\n {\n if ($request->ajax()) {\n \n $data = User::latest()->get();\n \n return Datatables::of($data)\n ->addIndexColumn()\n ->filter(function ($instance) use ($request) {\n if (!empty($request->get('email'))) {\n $instance->collection = $instance->collection->filter(function ($row) use ($request) {\n return Str::contains($row['email'], $request->get('email')) ? true : false;\n });\n }\n \n if (!empty($request->get('search'))) {\n $instance->collection = $instance->collection->filter(function ($row) use ($request) {\n if (Str::contains(Str::lower($row['email']), Str::lower($request->get('search')))){\n return true;\n }else if (Str::contains(Str::lower($row['name']), Str::lower($request->get('search')))) {\n return true;\n }\n \n return false;\n });\n }\n \n })\n ->addColumn('action', function($row){\n \n $btn = '<a href=\"javascript:void(0)\" class=\"edit btn btn-primary btn-sm\">View</a>';\n \n return $btn;\n })\n ->rawColumns(['action'])\n ->make(true);\n }\n \n // return view('users');\n $peserta = User::where('level', 'peserta')->count();\n $prog = User::where('id_divisions', '1')->count();\n $mmd = User::where('id_divisions', '2')->count();\n $skj = User::where('id_divisions', '3')->count();\n $pendaftar = User::whereIn('level', ['peserta', 'nonaktif'])->count();\nreturn view('users', compact('peserta', 'pendaftar', 'prog', 'mmd', 'skj'));\n }", "public function getAjaxData($request)\n {\n if ($this->selectedViewType == 'simple') {\n // Remove action column for query\n if (in_array('action', $this->listViewSimple))\n $this->listViewSimple = array_diff($this->listViewSimple, array('action'));\n $columns = $this->listViewSimple;\n\t\t\t$users = Admin::select($columns);\n } else\n // All and Custom Case\n $columns = ['*'];\n\t\t$users = Admin::select($columns);\n //$users = Admin::select($columns);\n $table = DataTables::of($users);\n $table->editColumn('avatar', function ($user) {\n return getAvatar($user->avatar, $user->name);\n });\n $table->addColumn('action', function ($user) {\n return '<a href=\"' . route('admin-member-edit', $user->user_id) . '\" class=\"btn btn-xs btn-primary\"><i class=\"glyphicon glyphicon-edit\"></i></a>\n <a href=\"' . route('admin-member-detail', $user->user_id) . '\" class=\"btn btn-xs bg-color-pink txt-color-white\"><i class=\"glyphicon glyphicon-th-list\"></i></a>\n <a href=\"javascript:void(0)\" class=\"btn btn-xs btn-danger txt-color-white\" onclick=\"confirmBox(\\'' . route('admin-member-delete', $user->user_id) . '\\')\"><i class=\"glyphicon glyphicon-remove\" ></i></a>';\n });\n $table->editColumn('created_timestamp', function ($user) {\n return my_date($user->created_timestamp, '', '');\n });\n $table->filterColumn('created_timestamp', function ($query, $keyword) {\n $query->whereRaw(\"DATE_FORMAT(FROM_UNIXTIME(created_timestamp),'%d-%m-%Y %h:%i:%s') like ?\", [\"%$keyword%\"]);\n });\n $table->editColumn('updated_timestamp', function ($user) {\n return my_date($user->updated_timestamp, '', '');\n });\n $table->filterColumn('updated_timestamp', function ($query, $keyword) {\n $query->whereRaw(\"DATE_FORMAT(FROM_UNIXTIME(updated_timestamp),'%d-%m-%Y %h:%i:%s') like ?\", [\"%$keyword%\"]);\n });\n\n $table->rawColumns(['avatar', 'action']);\n\n //If custom Filter Added.\n if ($this->advanceFilters)\n setAdvanceFilter($request, $table);\n\n return $table->make(true);\n }", "public function getMyCustomers() { \n if (!$this->input->is_ajax_request()) {\n exit('No direct script access allowed');\n } \n\n $obj = new Customer();\n $coach_uid = $this->session->userdata('user_id');\n $requestData = $_REQUEST;\n $search = [];\n\n // sort by\n $columns = array(\n // datatable column index => database column name\n 1 => 'id',\n 2 => 'username',\n 3 => 'first_name',\n 4 => 'last_name',\n 5 => 'email'\n );\n\n // DEALER NAME FILTER\n if (!empty($requestData['life_id'])) {\n $search['life_id'] = $requestData['life_id'];\n }\n if (!empty($requestData['first_name'])) {\n $search['first_name'] = $requestData['first_name'];\n }\n if (!empty($requestData['last_name'])) {\n $search['last_name'] = $requestData['last_name'];\n }\n if (!empty($requestData['email'])) {\n $search['email'] = $requestData['email'];\n }\n $search = (object) $search;\n\n $obj->sort_by = $columns[$requestData['iSortCol_0']];\n $obj->sort_order = $requestData['sSortDir_0'];\n\n // start\n $obj->offset = intval($requestData['iDisplayStart']);\n\n // limit \n $records_count = $obj->get_my_customers_count($coach_uid, $search);\n\n $iTotalRecords = $records_count;\n $iDisplayLength = intval($requestData['iDisplayLength']);\n $obj->limit = $iDisplayLength < 0 ? $iTotalRecords : $iDisplayLength;\n\n $records = $obj->get_my_customers($coach_uid, $search, $obj->sort_by, $obj->sort_order, $obj->limit, $obj->offset);\n\n $sEcho = intval($_REQUEST['sEcho']);\n\n // INITIALISE RETURN JSONDATA\n $jsondata = array();\n $jsondata[\"aaData\"] = array();\n\n $i = 1;\n foreach ($records as $record) {\n $html = '';\n $get_last_login = \"\";\n\n $html .='&nbsp;<a data-toggle=\"modal\" class=\"view_details btn btn-sm btn-warning\" rel=\"' . $record->id . '\" title=\"View\" href=\"' . base_url() . 'coach/customer-details/' . $record->id . '\">\n <i class=\"fa fa-eye\"></i> '.lang(\"common_view\").'</a>';\n if ($record->last_login != \"0000-00-00 00:00:00\" && $record->last_login != \"NULL\") {\n $get_login_time = getAgoDateTime($record->last_login);\n foreach ($get_login_time as $key => $value) {\n $get_last_login .= $get_login_time[$key];\n }\n } else {\n $get_last_login .= '<span style=\"color:#BB2413;\">Not loggedin yet</span>';\n }\n\n $jsondata[\"aaData\"][] = array(\n $i,\n $record->life_id,\n $record->first_name,\n $record->last_name,\n $record->email,\n $get_last_login,\n $html,\n );\n $i++;\n }\n if (isset($_REQUEST[\"sAction\"]) && $_REQUEST[\"sAction\"] == \"group_action\") {\n $jsondata[\"sStatus\"] = \"OK\"; // pass custom message(useful for getting status of group actions)\n $jsondata[\"sMessage\"] = \"Group action successfully has been completed. Well done!\"; // pass custom message(useful for getting status of group actions)\n }\n\n $jsondata[\"sEcho\"] = $sEcho;\n $jsondata[\"iTotalRecords\"] = $iTotalRecords;\n $jsondata[\"iTotalDisplayRecords\"] = $iTotalRecords;\n\n echo json_encode($jsondata);\n }", "public function ctrShowTableUser(){\n\n $item = null;\n $valor = null;\n\n $usuarios = ControllerUser::ctrShowUsers($item, $valor);\n\n $datosJson = '\n {\n \"data\":[';\n\n for($i = 0; $i < count($usuarios); $i++){\n \n $datosJson .= '[\n \"'.($i+1).'\",\n \"'.$usuarios[$i][\"id_institucion\"].'\",\n \"'.$usuarios[$i][\"acceso\"].'\",\n \"'.$usuarios[$i][\"nombre\"].'\",\n \"'.$usuarios[$i][\"labor\"].'\",\n \"'.$usuarios[$i][\"grupo\"].'\",\n \"'.$usuarios[$i][\"password\"].'\",\n \"'.$usuarios[$i][\"email\"].'\",\n \"'.$usuarios[$i][\"foto\"].'\",\n \"'.$usuarios[$i][\"verificacion\"].'\",\n \"'.$usuarios[$i][\"emailEncriptado\"].'\",\n \"'.$usuarios[$i][\"fecha\"].'\"\n ],';\n\n }\n\n $datosJson = substr($datosJson, 0, -1);\n\n $datosJson .= ']\n\n }\n\n ';\n\n echo $datosJson;\n\n }", "public function getDataUser(Request $request)\n {\n if ($request->ajax())\n {\n $accessCheck = $this->accessCheck('view',$this->route);\n\n if ($accessCheck['status'] !== '01' || $accessCheck['status'] == '02' )\n {\n $sql = \" SELECT B.fullname, B.email, A.username, A.id as encrypt_id, C.departement as departement_name\n FROM users A\n INNER JOIN employees B\n ON B.id = A.employee_id\n INNER JOIN departements C\n ON C.id = B.departement_id\";\n $user_data = DB::select($sql);\n foreach ($user_data as $key => $user)\n {\n $user->encrypt_id = $this->encrypt($user->encrypt_id);\n }\n return Datatables::of($user_data)\n ->addIndexColumn()\n ->rawColumns(['action','status'])\n ->make(true);\n }\n else\n {\n return $accessCheck;\n }\n }\n }", "public function adm() {\r\n $this->output->set_content_type('json');\r\n\r\n $ret['recordsTotal'] = $this->user_m->get_count();\r\n $ret['recordsFiltered'] = $ret['recordsTotal'];\r\n //Used so DataTables know which data arrived\r\n $ret['draw'] = $this->input->get('draw');\r\n\r\n if (!empty($this->input->get('search')['value'])) {\r\n $search_value = $this->input->get('search')['value'];\r\n $param['like'] = [\r\n 'email' => [$search_value, 'both'],\r\n 'name' => [$search_value, 'both']\r\n ];\r\n $ret['recordsFiltered'] = $this->user_m->get_count($param);\r\n }\r\n $result = $this->user_m->get($this->input->get('length'), $this->input->get('start'), $param);\r\n\r\n if ($ret['recordsFiltered'] > 0) {\r\n foreach ($result as $value) {\r\n $ret['data'][] = [\r\n 'id' => $value->id,\r\n 'name' => $value->name.($value->adm ? '*' : ''),\r\n 'email' => $value->email,\r\n 'last_login' => date('M d, Y H:i:s', strtotime($value->last_login)),\r\n 'created' => date('M d, Y H:i:s', strtotime($value->created)),\r\n 'modified' => date('M d, Y H:i:s', strtotime($value->modified)),\r\n //TODO: Offload it to js file instead\r\n 'actions' => '<button type=\"button\" class=\"btn btn-warning edit-btn\" data-id=\"' . $value->id . '\">'\r\n . 'Edit'\r\n . '</button> '\r\n . '<button type=\"button\" class=\"btn btn-danger delete-btn\" data-id=\"' . $value->id . '\">'\r\n . 'Delete'\r\n . '</button>'\r\n ];\r\n }\r\n } else {\r\n $ret['data'] = [];\r\n }\r\n\r\n $this->output->set_output(json_encode($ret));\r\n return $ret;\r\n }", "public function ajax_get_users() {\n\n\t\t// Get list of users.\n\t\t$users = get_users( [ 'orderby' => 'display_name' ] );\n\t\tif ( ! empty( $users ) ) {\n\n\t\t\t// Build user data.\n\t\t\t$user_data = [\n\t\t\t\t'selected' => 0,\n\t\t\t\t'users' => $users,\n\t\t\t];\n\n\t\t\t/*\n\t\t\t * If we passed a speaker post ID, get the\n\t\t\t * user ID assigned to the speaker post ID.\n\t\t\t */\n\t\t\t$speaker_post_id = isset( $_GET['speaker_post_id'] ) ? $_GET['speaker_post_id'] : 0;\n\t\t\tif ( $speaker_post_id > 0 ) {\n\n\t\t\t\t// Get the assigned user ID for the speaker.\n\t\t\t\t$speaker_user_id = get_post_meta( $speaker_post_id, 'conf_sch_speaker_user_id', true );\n\t\t\t\tif ( $speaker_user_id > 0 ) {\n\t\t\t\t\t$user_data['selected'] = $speaker_user_id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Print the user data.\n\t\t\techo json_encode( $user_data );\n\n\t\t}\n\n\t\twp_die();\n\t}", "function userListing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $searchText = $this->input->post('searchText');\n $searchStatus = $this->input->post('searchStatus');\n\n $this->load->library('pagination');\n\n $count = $this->user_model->userListingCount($this->global['level'], $searchText);\n\n $returns = $this->paginationCompress(\"userListing/\", $count, 5);\n\n $data['userRecords'] = $this->user_model\n ->userListing($this->global['level'], $searchText, $searchStatus, $returns[\"page\"], $returns[\"segment\"]);\n\n $this->global['pageTitle'] = '人员管理';\n $data['searchText'] = $searchText;\n $data['searchStatus'] = $searchStatus;\n\n $this->loadViews(\"systemusermanage\", $this->global, $data, NULL);\n }\n }", "public function fetchAllUser() {\n try {\n // Select all users\n $query = \"\n select * \n from tb_user \n \";\n // Create object to connect to MySQL using PDO\n $mysqlPDO = new MySQLPDO();\n // Prepare the query\n $statement = $mysqlPDO->getConnection()->prepare($query);\n // Execute the query without paramters\n $statement->execute();\n // Get affect rows in associative array\n $rows = $statement->fetchAll();\n // Foreach row in array\n foreach ($rows as $row) {\n // Create a User object\n $user = new User($row);\n //Create datatable row\n $tmp_data[] = array(\n $user->getEmail(),\n $user->getUsername(),\n \"********\",\n \"<div style='text-align:center'>\".$user->getAccess().\"</div>\",\n $user->getState() == \"0\" ? '<div style=\"text-align:center\"><i class=\"fas fa-times\" style=\"color:red\"></i></div>' : '<div style=\"text-align:center\"><i class=\"fas fa-check\" style=\"text-align: center; color:green;\"></i></div>',\n \"<div style='text-align:center'><a href='javascript:update(\".json_encode($user).\")' class='btn btn-info'><i class='fas fa-edit'></i></a></div>\",\n \"<div style='text-align:center'><a href='javascript:remove(\".$user->getId().\")' class='btn btn-danger'><i class='far fa-trash-alt'></i></a></div>\"\n );\n }\n // Export into DataTable json format if there's any record in $tmp_data\n if (isset($tmp_data) && count($tmp_data) > 0) {\n $data = array(\n \"data\" => $tmp_data\n );\n } else {\n $data = array(\n \"data\" => array()\n );\n }\n return $data;\n } catch (PDOException $e) {\n die(\"Error message: \" . $e->getMessage());\n }\n }", "function getUsers($per_page){\n // this function for get all users from database to users.php\n global $con;\n if(isset($_GET['page']))\n $page = $_GET['page'];\n else\n $page = 1;\n \n $start = ($page - 1) * $per_page;\n try{\n $query = $con->prepare(\"SELECT * FROM users ORDER BY 1 DESC LIMIT $start,$per_page\");\n $query->execute();\n if($query->rowCount() > 0){\n while($result = $query->fetch(PDO::FETCH_ASSOC)){\n $user_id = $result['user_id'];\n $user_name = $result['username'];\n $user_image = $result['user_image'];\n $user_location = $result['user_location'];\n if($user_location == ''){\n $user_location = 'غير معروف';\n }\n $last_login = $result['last_login'];\n $class = 'offline';\n $status = 'غير متصل';\n // for check if user is connect now\n if($last_login > time()){\n $class = 'online';\n $status = 'متصل';\n }\n \n echo \"\n <div class='col-md-6 col-lg-4'>\n <div class='item'>\n <div class='user-img img-box'\"; if($user_image != \"\") echo 'style=background-color:transparent'; echo \">\"; \n if($user_image != \"\"){\n echo \"<img src='Profile/Layout/Images/users-images/$user_image' class='img-responsive' alt='$user_image'>\";\n }\n else{\n preg_match(\"/./u\",$user_name,$first_char);\n $first_char = strtoupper($first_char[0]);\n echo \"<span>$first_char</span>\";\n }\n //<img src='profile/Layout/Images/users-images/$user_image' class='img-responsive' alt='$user_image'>\n echo\" </div>\n <div class='username'>\n <h5>$user_name</h5>\n <div>\n <span><i class='fa fa-map-marker'></i> $user_location</span>\n <span><i class='fa fa-circle user-connection $class'></i> $status</span>\n </div>\n </div>\n <div class='user-profile'>\n <a class='btn btn-primary btn-block' href='Profile/user-profile.php?user_id=$user_id&page=1'>الملف الشخصي</a>\n </div>\n </div>\n </div>\n \";\n }\n }\n }\n catch(PDOException $e){\n echo $e->getMessage();\n }\n\n}", "public function paginatedListAction() {\n $logger = $this->get('logger');\n if (!$this->get('request')->isXmlHttpRequest()) { // Is the request an ajax one?\n return new Response(\"<b>Not an ajax call!!!\" . \"</b>\");\n }\n try {\n //Get parameters\n $request = $this->get('request');\n $limit = $request->get('limit');\n $offset = $request->get('offset');\n $order = $request->get('order');\n $search = $request->get('search');\n $sort = $request->get('sort');\n $em = $this->getDoctrine()->getManager();\n $usr= $this->get('security.context')->getToken()->getUser();\n $paginator = $em->getRepository('TecnotekAsiloBundle:User')\n ->getListWithFilter($offset, $limit, $search, $sort, $order, $usr->getId());\n\n $results = array();\n foreach($paginator as $user){\n array_push($results, array('id' => $user->getId(),\n 'name' => $user->getName(),\n 'lastname' => $user->getLastname(),\n 'username' => $user->getUsername(),\n 'email' => $user->getEmail(),\n 'cellPhone' => $user->getCellPhone(),\n 'isActive' => $user->isActive(),\n 'username' => $user->getUsername()));\n }\n return new Response(json_encode(array('total' => count($paginator),\n 'rows' => $results)));\n } catch (Exception $e) {\n $info = toString($e);\n $logger->err('User::paginatedListAction [' . $info . \"]\");\n return new Response(json_encode(array('error' => true, 'message' => $info)));\n }\n }", "function get_all_customer() { //datatable server side, colom sesuaikan dgn tabel jgn di lebihi id saja\n $this->datatables->from('users u');\n //select kolom yang dimunculkan di tabel saja, bila tidak search|sort tidak akan berjalan\n $this->datatables->select('nama, no_ktp, level, email, handphone, alamat, user_id');\n $this->datatables->where(\"level =\", \"member\");\n $this->datatables->add_column('action', \n \t\t'<a href=\"'.base_url().'users/ubah/$1\" class=\"btn btn-primary btn-flat btn-addon btn-sm m-b-10 m-l-5\" title=\"Lihat Data\"><i class=\"fa fa-eye\"></i></a>\n \t\t<a class=\"edit-link btn btn-warning btn-flat btn-addon btn-sm m-b-10 m-l-5\" title=\"Edit Data\" href=\"'.base_url().'users/ubah/$1\"><i class=\"fa fa-edit\"></i></a>\n \t\t<a class=\"hapus-link btn btn-danger btn-flat btn-addon btn-sm m-b-10 m-l-5\" title=\"Hapus Data\" onClick=del(\"$1\")><i class=\"fa fa-trash\"></i></a>'\n \t, 'user_id');\n return $this->datatables->generate();\n }", "public function ajax_get_users() {\n\n\t\t// Get list of users.\n\t\t$users = get_users( array( 'orderby' => 'display_name' ) );\n\t\tif ( ! empty( $users ) ) {\n\n\t\t\t// Build user data.\n\t\t\t$user_data = array(\n\t\t\t\t'selected' => 0,\n\t\t\t\t'users' => $users,\n\t\t\t);\n\n\t\t\t/*\n\t\t\t * If we passed a speaker post ID, get the\n\t\t\t * user ID assigned to the speaker post ID.\n\t\t\t */\n\t\t\t$speaker_post_id = isset( $_GET['speaker_post_id'] ) ? $_GET['speaker_post_id'] : 0;\n\t\t\tif ( $speaker_post_id > 0 ) {\n\n\t\t\t\t// Get the assigned user ID for the speaker.\n\t\t\t\t$speaker_user_id = get_post_meta( $speaker_post_id, 'conf_sch_speaker_user_id', true );\n\t\t\t\tif ( $speaker_user_id > 0 ) {\n\t\t\t\t\t$user_data['selected'] = $speaker_user_id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Print the user data.\n\t\t\techo json_encode( $user_data );\n\n\t\t}\n\n\t\twp_die();\n\t}", "public function getdata(){\n\n $type = \\Request::query('only');\n\n $user = DB::table('users');\n $user->select('*');\n\n if($type=='admins'){\n $user->where('usertype', '=', 'Admin');\n }elseif($type=='staff'){\n $user->where('usertype', '=', 'Staff');\n }elseif($type=='banned'){\n $user->where('usertype','=', 'banned');\n }\n\n\n\n return Datatables::of($user)\n\n ->addColumn('icon', function ($user) {\n\n return view('._admin._particles.datatable.userlist.icon', compact('user'))->render();\n\n })->addColumn('username', function ($user) {\n\n return view('._admin._particles.datatable.userlist.username', compact('user'))->render();\n\n })->addColumn('email', function ($user) {\n\n return view('._admin._particles.datatable.userlist.email', compact('user'))->render();\n\n })->addColumn('status', function ($user) {\n\n return view('._admin._particles.datatable.userlist.status', compact('user'))->render();\n\n })->addColumn('created_at', function ($user) {\n\n return view('._admin._particles.datatable.userlist.created_at', compact('user'))->render();\n\n })->addColumn('updated_at', function ($user) {\n\n return view('._admin._particles.datatable.userlist.updated_at', compact('user'))->render();\n\n })->addColumn('action', function ($user) {\n\n return view('._admin._particles.datatable.userlist.action', compact('user'))->render();\n\n })->make(true);\n\n }", "public function cardList()\n {\n // $pageIndex = 0;\n // $pageSize = 20;\n $pageIndex = I('get.pageIndex');\n $pageSize = I('get.pageSize');\n $where = I('get.where');\n $orderBy = I('get.orderBy');\n\n $where = htmlspecialchars_decode($where);\n\n $data = array(\n \"userAccount\" => self::USERACCOUNT,\n \"pageIndex\" => $pageIndex,\n \"pageSize\" => $pageSize,\n \"where\" => $where,\n \"orderBy\" => $orderBy,\n );\n $response_data = $this->client->CallHttpPost(\"Get_MembersPagedV2\", $data);\n $this->ajaxReturn($response_data);\n }", "public function all_users() {\n\t\tif($this->input->is_ajax_request()) {\n\t\t\techo json_encode($this->users->get_all());\n\t\t} else {\n\t\t\tredirect('cms/users', 'refresh');\n\t\t}\n\t}" ]
[ "0.7668475", "0.74126935", "0.73711145", "0.7321071", "0.72842884", "0.7167021", "0.7146747", "0.7073471", "0.6986613", "0.6934406", "0.69325924", "0.69315135", "0.6909658", "0.68809414", "0.6867183", "0.6867087", "0.68645626", "0.6854365", "0.6822632", "0.6822233", "0.68148404", "0.6810552", "0.68006915", "0.67851204", "0.6781827", "0.6774246", "0.6771578", "0.6766797", "0.67444307", "0.6742122" ]
0.78632456
0
Modifies the current Form Component by changing any properties that were passed in $structure. If a component supports special indices in $structure (for example a "fields" property) then that component may specify its own `modify()` method and manually process each of the specially supported keywords. For example, the AbstractFormContainer supports passing "fields" and each field is then attempted fetched from children. If not found, it is created (and the structure passed to the `create()` function which uses the same structure syntax). If it already exists, the `modify()` method is called on that object to trigger the recursive modification of all child components.
public function modify(array $structure);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(Structure $structure = null)\n {\n\n }", "public function setDataStructure($structure)\n {\n }", "public function setStructure($structure) {\n\t\t$this->structure = $structure;\n\t\treturn $this;\n\t}", "public function modify($nested=false) {\n $action = ($nested) ? 'modifyNested' : 'modify';\n if (isset($this->values[$this->object->primary])) {\n $primary = $this->object->primary;\n $idItem = (isset($this->values[$primary.'_oldId'])) ? $this->values[$primary.'_oldId'] : $this->values[$primary];\n $this->object = $this->object->readObject($idItem);\n }\n $formClass = $this->type.'_Form';\n $form = new $formClass($this->object->values, array(), $this->object);\n $form->addValues($this->values);\n $object = $this->object;\n $errors = $form->isValid();\n if (empty($errors)) {\n try {\n $object->modify($this->values);\n } catch (Exception $e) {\n $html = '<div class=\"message messageError\">\n '.str_replace('<pre>', '', $e->getMessage()).'\n </div>\n '.Form::createForm($form->createFormFields(false, $nested), array('action'=>url($this->type.'/'.$action.'/'.$this->id, true), 'submit'=>__('save'), 'class'=>'formAdmin formAdminModify', 'nested'=>$nested));\n return array('success'=>'0', 'html'=>$html);\n }\n $multipleChoice = (count((array)$this->object->info->info->form->multipleActions) > 0) ? true : false;\n $html = $object->showUi('Admin', array('userType'=>$this->login->get('type'), 'multipleChoice'=>$multipleChoice, 'nested'=>$nested));\n return array('success'=>'1', 'id'=>$object->id(), 'html'=>$html);\n } else {\n $form = new $formClass($this->values, $errors);\n $html = Form::createForm($form->createFormFields(false, $nested), array('action'=>url($this->type.'/'.$action.'/'.$this->id, true), 'submit'=>__('save'), 'class'=>'formAdmin formAdminModify', 'nested'=>$nested));\n return array('success'=>'0', 'html'=>$html);\n }\n }", "public function setStructure($structure)\n {\n $this->structure = $structure;\n\n return $this;\n }", "public function updated(Structure $structure)\n {\n\t\t\t$structure->updated_by = Auth::id();\n }", "public function overrideStructure(array $structure): self\n {\n $this->structure = $structure;\n\n return $this;\n }", "function structure()\n {\n $form = new Apeform(0, 0, false);\n $form->hidden(\"structure\", \"method\");\n $form->hidden($this->table->tablename(), \"table\");\n $field = &$form->hidden($this->GET('method') == \"structure\" ? $this->GET('field') : \"\");\n $newField = &$form->text(\"<u>F</u>ield name\", \"\", $field);\n\n foreach ($this->table->fields as $key)\n $positions[$key] = \"After \" . $key;\n $keys = array_keys($positions);\n $defaultValue = ($field && in_array($field, $keys)) ? $keys[array_search($field, $keys) - 1] : \"\";\n if ($field)\n unset($positions[$field]);\n array_pop($positions);\n $positions[''] = \"At end of table\";\n $label = $field ? \"Move to <u>p</u>osition\" : \"Add at <u>p</u>osition\";\n $afterField = $form->select($label, \"\", $positions, $defaultValue);\n\n $button = $field ? \"Rename/move field\" : \"Add new field\";\n $form->submit($button);\n\n if ($form->isValid()) {\n if (! $field) {\n if ($this->table->add_field($newField, $afterField))\n $this->table->write();\n else\n $form->error(\"Invalid field name\", 3);\n } else {\n while ($row = $this->table->each()) {\n // Copy all the moved values to their new field name.\n $this->table->data[$row['id']][$newField] = $row[$field];\n }\n $newFields = array();\n foreach ($this->table->fields as $oldField) {\n // Copy any unchanged field to the new fields array.\n if ($oldField != $field)\n $newFields[] = $oldField;\n if ($oldField == $afterField)\n $newFields[] = $newField;\n }\n // Add field if position '' (\"At end of table\") was selected.\n if (! $afterField)\n $newFields[] = $newField;\n $this->table->fields = $newFields;\n $this->table->write();\n }\n $field = \"\";\n $newField = \"\";\n }\n\n $formOrder = new Apeform(0, 0, \"order\", false);\n $formOrder->hidden(\"structure\", \"method\");\n $formOrder->hidden($this->table->tablename(), \"table\");\n $order = $formOrder->select(\"Permanently <u>o</u>rder table by\", \"\", $this->table->fields);\n $formOrder->submit(\"Order\");\n\n if ($formOrder->isValid()) {\n $this->table->sort($this->table->fields[$order]);\n $this->table->write();\n }\n\n $this->displayHead();\n\n echo '<table>';\n echo '<tr><th>Field</th><th><small>Guessed type</small></th><th colspan=\"2\">Action</th></tr>';\n foreach ($this->table->fields as $i => $f) {\n echo '<tr><td';\n if (! $i)\n echo ' class=\"primary\" title=\"Row identifier\"';\n echo '>' . $f . '</td>';\n echo '<td><small>' . (isset($this->types[$f]) ? $this->types[$f] : \"\") . '</small></td>';\n echo '<td>';\n if ($i && $this->priv & PRIV_ALTER)\n echo '<a href=\"' . $this->SELF . '?method=structure&table=' . $this->table->tablename() . '&field=' . $f . '\">Change</a>';\n echo '</td><td>';\n if ($i && $this->priv & PRIV_ALTER)\n echo '<a class=\"danger\" href=\"' . $this->SELF . '?method=drop&table=' . $this->table->tablename() . '&field=' . $f . '\">Drop</a>';\n echo '</td></tr>';\n }\n echo '</table>';\n\n if ($this->priv & PRIV_ALTER)\n $form->display();\n if ($this->priv & PRIV_UPDATE)\n $formOrder->display();\n\n echo '<p><table>';\n echo '<tr><th>Statement</th><th>Value</th></tr>';\n echo '<tr><td>Rows</td><td align=\"right\">' . $this->table->num_rows() . '</td></tr>';\n echo '<tr><td>Next autoindex</td><td align=\"right\">' . ($this->table->num_rows() ? max($this->table->ids()) + 1 : 1) . '</td></tr>';\n $filesize = $this->table->exists() ? filesize($this->table->filename) : 0;\n $filemtime = $this->table->exists() ? date(\"Y-m-d H:i\", filemtime($this->table->filename)) : \"\";\n echo '<tr><td>File size</td><td align=\"right\">' . number_format($filesize) . ' Bytes</td></tr>';\n $size = $this->table->num_rows() ? (int) round(($filesize - strlen(implode(\",\", $this->table->fields)) - 2) / $this->table->num_rows()) : 0;\n echo '<tr><td>Average row size</td><td align=\"right\">' . $size . ' Bytes</td></tr>';\n echo '<tr><td>Delimiter</td><td align=\"right\">' . $this->table->delimiter . '</td></tr>';\n echo '<tr><td>Last update</td><td align=\"right\">' . $filemtime . '</td></tr>';\n echo '</table>';\n }", "public static function getStructure(\\XF\\Mvc\\Entity\\Structure $structure) {\n\t\t$structure = parent::getStructure($structure);\n\n\t\tforeach (Setup::$tables1['xf_user_field'] as $column => $details) {\n\t\t\t$structure->columns[ $column ] = ['type'=>$details['entity_type'], 'default' => $details['entity_default']];\n\t\t}\n\n\t\treturn $structure;\n\t}", "public function defineStructure( array $structure ) : self\n {\n\t $count = count( $structure);\n //add additional index so that params can be accessed by index and name\n for( $i = 0; $i < $count; $i++ ){\n $this->nodes[ $structure[$i] ] = $this->nodes[$i];\n }\n\n return $this;\n\t\t\n }", "protected function getForm( StructureInterface $structure )\n {\n /* @var $form \\Zend\\Form\\Form */\n /* @var $type \\Zend\\Form\\Form */\n $service = $this->getServiceLocator()\n ->get( 'Form' );\n $form = $service->create( 'Grid\\Menu\\Meta\\Base' );\n $meta = $service->get( 'Grid\\Menu\\Meta\\Type' );\n $type = $structure->getType();\n\n if ( $meta->has( $type ) )\n {\n foreach ( $meta->get( $type ) as $element )\n {\n $form->add( clone $element );\n }\n }\n\n $form->add( array(\n 'type' => 'Zork\\Form\\Element\\Submit',\n 'name' => 'save',\n 'attributes' => array(\n 'value' => 'menu.form.submit',\n ),\n ) );\n\n $form->setHydrator( $this->getModel()->getMapper() )\n ->bind( $structure );\n\n return $form;\n }", "public function parseStructure(array $structure)\n {\n $this->context->populateNodes($structure);\n }", "public function structure(IChartStructure $structure)\n {\n $this->structure = $structure;\n }", "public static function update_custom_data ($postId, $structure) {\n if ($postId) {\n foreach ($structure as $attributeId => $conf) {\n if (array_key_exists($attributeId, $_POST)) {\n update_post_meta($postId, $attributeId, $_POST[$attributeId]);\n }\n }\n }\n }", "public function wrapStructure($type, StructureMetadata $structure);", "public function setStructures($structures);", "function initControlStructureForm()\n\t{\n\t\tinclude_once (\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n $form = new ilPropertyFormGUI();\n\n\t\t$form->setId(\"control_structure\");\n\t\t$form->setTitle($this->lng->txt(\"ctrl_structure\"));\n\t\t$form->setFormAction(\"setup.php?cmd=gateway\");\n\n\t\t$ilDB = $this->setup->getClient()->db;\n\t\t$cset = $ilDB->query(\"SELECT count(*) as cnt FROM ctrl_calls\");\n\t\t$crec = $ilDB->fetchAssoc($cset);\n\n\t\t$item = new ilCustomInputGUI($this->lng->txt(\"ctrl_structure_reload\"));\n\t\tif ($crec[\"cnt\"] == 0)\n\t\t{\n\t\t\t$item->setInfo($this->lng->txt(\"ctrl_missing_desc\"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$item->setInfo($this->lng->txt(\"ctrl_structure_desc\"));\n\t\t}\n\t\t$form->addItem($item);\n\n\t\t$form->addCommandButton(\"reloadStructure\", $this->lng->txt(\"reload\"));\n\t\treturn $form;\n\t}", "public static function childToStruct(stdClass $object, stdClass $structure, bool $isChild = false, bool $isValidateFull = false)\n\t{\n\t\t$stdObject \t= new stdClass;\n\t\tforeach($object as $name => $element)\n\t\t{\n\t\t\tif($element instanceof stdClass) {\n\t\t\t\t$stdObject->{$name} = self::childToStruct($element, $structure->{$name}, true, $isValidateFull);\n\t\t\t} else {\n\t\t\t\t$stdObject->{$name} = $element;\n\t\t\t}\n\t\t}\n\t\treturn ($isChild)? new DataTypes\\Struct($stdObject, $structure, $isValidateFull) :$stdObject; \n\t}", "public function set_permalink_structure($structure = '')\n {\n global $wp_rewrite;\n\n $wp_rewrite->init();\n $wp_rewrite->set_permalink_structure($structure);\n $wp_rewrite->flush_rules();\n }", "public function modify(Container $di);", "public function setStructureRef($structureRef)\n {\n $this->structureRef = $structureRef;\n return $this;\n }", "public static function getStructure(Structure $structure)\r\n {\r\n $structure = parent::getStructure($structure);\r\n $structure->columns['custom_title_type'] = ['type' => self::STR, 'default' => 'user_set', 'allowedValues' => [\r\n 'user_set', 'admin_set'\r\n ]\r\n ];\r\n return $structure;\r\n }", "public function modify(Fieldset $fieldset);", "public function modify($modify);", "public function LoadStructure($Structure) {\n\n $AllowedSegments= array('Name','Attributes','Controls','Hidden','Buttons');\n foreach($AllowedSegments as $Segment) {\n if (isset($Structure[$Segment])) {\n $this->$Segment= $Structure[$Segment];\n }\n }\n $this->Builded= false;\n }", "public function setStructure($url, $structure);", "protected function handleCustomField()\n {\n // If this field is a custom field we'll assume it has it's child fields\n // under the `fields` key. Then we are gonna modify those child fields'\n // attribute `name`, `label` & `conditional_logics` properties using\n // the parent field. The current implementation will modify those\n // properties in a way so that we can use dot notation to access.\n $customFields = Arr::get($this->field, 'fields');\n\n if ($customFields) {\n $parentAttribute = Arr::get($this->field, 'attributes.name');\n\n $parentConditionalLogics = Arr::get($this->field, 'settings.conditional_logics', []);\n\n $isAddressOrNameField = in_array(Arr::get($this->field, 'element'), ['address', 'input_name']);\n\n $isRepeatField = Arr::get($this->field, 'element') === 'input_repeat' || Arr::get($this->field, 'element') == 'repeater_field';\n\n foreach ($customFields as $index => $customField) {\n // If the current field is in fact `address` || `name` field\n // then we have to only keep the enabled child fields\n // by the user from the form editor settings.\n if ($isAddressOrNameField) {\n if (!Arr::get($customField, 'settings.visible', false)) {\n unset($customFields[$index]);\n continue;\n }\n }\n\n // Depending on whether the parent field is a repeat field or not\n // the modified attribute name of the child field will vary.\n if ($isRepeatField) {\n $modifiedAttribute = $parentAttribute.'['.$index.'].*';\n } else {\n $modifiedAttribute = $parentAttribute.'['.Arr::get($customField, 'attributes.name').']';\n }\n\n $modifiedLabel = $parentAttribute.'['.Arr::get($customField, 'settings.label').']';\n\n $customField['attributes']['name'] = $modifiedAttribute;\n\n $customField['settings']['label'] = $modifiedLabel;\n\n // Now, we'll replace the `conditional_logics` property\n $customField['settings']['conditional_logics'] = $parentConditionalLogics;\n\n // Now that this field's properties are handled we can pass\n // it to the extract field method to extract it's data.\n $this->extractField($customField);\n }\n }\n\n return $this;\n }", "public function modify();", "public function testHydrateNewStructure(): void\n {\n $this->hydrateEvent->getDocument()->willReturn($this->document->reveal());\n $this->hydrateEvent->getNode()->willReturn($this->node->reveal());\n $this->hydrateEvent->getLocale()->willReturn('fr');\n $this->hydrateEvent->getOption('load_ghost_content', false)->willReturn(true);\n $this->hydrateEvent->getOption('rehydrate')->willReturn(false);\n $this->hydrateEvent->getOption('structure_type')->willReturn(null);\n\n // set the structure type\n $this->encoder->contentName('template')->willReturn('i18n:fr-template');\n $this->node->getPropertyValueWithDefault('i18n:fr-template', null)->willReturn(null);\n\n $this->document->setStructureType(null)->shouldBeCalled();\n $this->document->getStructure()->willReturn(null);\n\n // set the property container\n $this->subscriber->handleHydrate($this->hydrateEvent->reveal());\n $this->accessor->set('structure', Argument::type(Structure::class))->shouldHaveBeenCalled();\n }", "function os2forms_nemid_webform_edit_component($component) {\n $form = array();\n $form['value'] = array(\n '#type' => 'textfield',\n '#title' => t('Default value'),\n '#default_value' => $component['value'],\n '#description' => t('The default value of the field.') . ' ' . theme('webform_token_help'),\n '#size' => 60,\n '#maxlength' => 1024,\n '#weight' => 0,\n );\n $form['display']['placeholder'] = array(\n '#type' => 'textfield',\n '#title' => t('Placeholder'),\n '#default_value' => $component['extra']['placeholder'],\n '#description' => t('The placeholder will be shown in the field until the user starts entering a value.'),\n '#weight' => 10,\n '#parents' => array('extra', 'placeholder'),\n );\n $form['display']['disabled'] = array(\n '#type' => 'checkbox',\n '#title' => t('Readonly'),\n '#default_value' => $component['extra']['disabled'],\n '#description' => t('Make this field non-editable. Useful for setting an unchangeable default value.'),\n '#weight' => 20,\n '#parents' => array('extra', 'disabled'),\n );\n $form['display']['element_hidden'] = array(\n '#type' => 'checkbox',\n '#title' => t('Hidden'),\n '#default_value' => $component['extra']['hidden'],\n '#description' => t('Make this field hidden.'),\n '#weight' => 10,\n '#parents' => array('extra', 'hidden'),\n );\n return $form;\n}" ]
[ "0.6147368", "0.5987541", "0.59657854", "0.57873654", "0.57715195", "0.54476374", "0.5380078", "0.5350614", "0.51539475", "0.51234716", "0.508409", "0.5083332", "0.49369153", "0.48850787", "0.48491663", "0.47941446", "0.4789302", "0.47484148", "0.4731295", "0.46949214", "0.4664182", "0.45858014", "0.4532731", "0.45037106", "0.44490147", "0.44438446", "0.44248143", "0.44155326", "0.4411042", "0.44079393" ]
0.7054034
0
Reads a file of issue credits to add to an issue.
protected function getCreditTexts($file_path) { // Remove all new lines and replace any double commas with a single one. $credit = file_get_contents($file_path); $credit = str_replace(array("\r", "\n"), ',', $credit); $credit = preg_replace('/,+/', ',', $credit); // Trim the string and include commas. $credit = trim($credit, " \t\n\r\0\x0B,"); $credit_texts = []; // Chop the string up into an array of things to post since the add_credit // field only accept static::MAX_LENGTH characters. $length = mb_strlen($credit); while ($length > 0) { if ($length > static::MAX_LENGTH) { $chunk = mb_substr($credit, 0, static::MAX_LENGTH); // Find the last comma in the chunk. $chunk = mb_substr($chunk, 0, mb_strrpos($chunk, ',')); } else { // Get the last set of credit to add. $chunk = $credit; } // Remove the chunk from the original credit. $credit = mb_substr($credit, mb_strlen($chunk)); $credit_texts[] = $chunk; // Trim and get the new length. $credit = trim($credit, " \t\n\r\0\x0B,"); $length = mb_strlen($credit); } return $credit_texts; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getCreditBreakdown(){return file_get_contents('queries/creditbreakdown.txt');}", "public function getCredits();", "abstract public function grabReputationFromFile();", "public function getCredits() {\n\t\tif(!$this->_configId) throw new Exception(lang('error_126'));\n\t\tif(!$this->_identifier) throw new Exception(lang('error_127'));\n\t\t\n\t\t// get configs\n\t\t$config = $this->showConfigs(true);\n\t\t\n\t\t// choose database\n\t\t$database = $config['config_database'] == \"MuOnline\" ? $this->muonline : $this->memuonline;\n\t\t\n\t\t// build query\n\t\t$data = array(\n\t\t\t'identifier' => $this->_identifier\n\t\t);\n\t\t$variables = array('{TABLE}','{COLUMN}','{USER_COLUMN}');\n\t\t$values = array($config['config_table'], $config['config_credits_col'], $config['config_user_col']);\n\t\t$query = str_replace($variables, $values, \"SELECT {COLUMN} FROM {TABLE} WHERE {USER_COLUMN} = :identifier\");\n\t\t\n\t\t// add credits\n\t\t$getCredits = $database->queryFetchSingle($query, $data);\n\t\tif(!is_array($getCredits)) throw new Exception(lang('error_143'));\n\t\t\n\t\treturn $getCredits[$config['config_credits_col']];\n\t}", "public function action_credits()\n\t{\n\t\tglobal $txt, $context;\n\n\t\t// We need a little help from our friends\n\t\trequire_once(SUBSDIR . '/Membergroups.subs.php');\n\t\trequire_once(SUBSDIR . '/Who.subs.php');\n\t\trequire_once(SUBSDIR . '/Admin.subs.php');\n\n\t\t// You have to be able to do at least one of the below to see this page.\n\t\tisAllowedTo(array('admin_forum', 'manage_permissions', 'moderate_forum', 'manage_membergroups', 'manage_bans', 'send_mail', 'edit_news', 'manage_boards', 'manage_smileys', 'manage_attachments'));\n\n\t\t// Find all of this forum's administrators...\n\t\tif (listMembergroupMembers_Href($context['administrators'], 1, 32) && allowedTo('manage_membergroups'))\n\t\t{\n\t\t\t// Add a 'more'-link if there are more than 32.\n\t\t\t$context['more_admins_link'] = '<a href=\"' . getUrl('moderate', ['action' => 'moderate', 'area' => 'viewgroups', 'sa' => 'members', 'group' => 1]) . '\">' . $txt['more'] . '</a>';\n\t\t}\n\n\t\t// Load credits.\n\t\t$context[$context['admin_menu_name']]['tab_data'] = array(\n\t\t\t'title' => $txt['support_credits_title'],\n\t\t\t'help' => '',\n\t\t\t'description' => '',\n\t\t);\n\t\tTxt::load('Who');\n\t\t$context += prepareCreditsData();\n\n\t\t// This makes it easier to get the latest news with your time format.\n\t\t$context['time_format'] = urlencode($this->user->time_format);\n\t\t$context['forum_version'] = FORUM_VERSION;\n\n\t\t// Get a list of current server versions.\n\t\t$context['current_versions'] = getServerVersions($this->_checkFor);\n\t\t$context['can_admin'] = allowedTo('admin_forum');\n\t\t$context['sub_template'] = 'credits';\n\t\t$context['page_title'] = $txt['support_credits_title'];\n\n\t\t// Load in the admin quick tasks\n\t\t$context['quick_admin_tasks'] = getQuickAdminTasks();\n\n\t\t$index = 'new_in_' . str_replace(array('ElkArte ', '.'), array('', '_'), FORUM_VERSION);\n\t\tif (isset($txt[$index]))\n\t\t{\n\t\t\t$context['latest_updates'] = replaceBasicActionUrl($txt[$index]);\n\t\t\trequire_once(SUBSDIR . '/Themes.subs.php');\n\n\t\t\tupdateThemeOptions(array(1, $this->user->id, 'dismissed_' . $index, 1));\n\t\t}\n\t}", "public function getRemainingCredits() {\n\t\t$result = $this->tipimail->getData($this->url . '/credits');\n\t\treturn new AccountCredits($result);\n\t}", "public function read($file) {\n\t}", "public function readFile($file) {\n\t\t$input_array = array();\n\n\t\ttry {\n\t\t\tif(file_exists($file) && is_readable($file)) {\n\t\t\t\t$file_handle = fopen($file, \"r\");\n\t\t\t while (!feof($file_handle)) {\n\t\t\t $line = fgets($file_handle);\n\t\t\t \n\t\t\t // skip empty lines\n\t\t\t if (strlen(trim($line)) > 0) {\n\t\t\t //echo $line, ' <=> ', intval($line), ' <=> ', (int)$line, '<br/>';\n\t\t\t array_push($input_array, (int)$line);\n\t\t\t }\n\t\t\t }\n\t\t }\n\t\t else {\n\t\t echo \"File not found.<br/>\";\n\t\t }\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t echo 'Exception: ', $e->getMessage();\n\t\t}\n\t\tif (isset($file_handle)) {\n\t\t\t//echo \"closed input file\";\n\t\t fclose($file_handle);\n\t\t}\n\t\treturn $input_array;\n\t}", "function cc_progress_total() {\n $campaign_total = file_get_contents(__DIR__ . '/../../../includes/total.txt');\n\n print $campaign_total;\n}", "private function readFile($file)\n {\n if ($this->fileSystem()->exists($file)) {\n $lines = file($file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n\n return $this->makeArrayOfIps($lines);\n }\n\n return [];\n }", "public function get_contents($file)\n {\n }", "public function get_contents($file)\n {\n }", "public function get_contents($file)\n {\n }", "public function get_contents($file)\n {\n }", "public function get_contents($file)\n {\n }", "private static function _readCacheFile() {\r\n if (!self::$_hasCacheFile) {\r\n self::_createCacheFile();\r\n }\r\n\r\n $paths = array();\r\n require(ZEEYE_TMP_PATH . self::CACHE_FILE_PATH);\r\n self::$_paths = $paths;\r\n }", "public function addCredits($input) {\n\t\tif(!Validator::UnsignedNumber($input)) throw new Exception(lang('error_128'));\n\t\tif(!$this->_configId) throw new Exception(lang('error_126'));\n\t\tif(!$this->_identifier) throw new Exception(lang('error_127'));\n\t\t\n\t\t// get configs\n\t\t$config = $this->showConfigs(true);\n\t\t\n\t\t// check online\n\t\tif($config['config_checkonline']) {\n\t\t\tif($this->_isOnline($config['config_user_col_id'])) throw new Exception(lang('error_28'));\n\t\t}\n\t\t\n\t\t// check current credits\n\t\t$currentCredits = $this->getCredits();\n\t\t\n\t\t// choose database\n\t\t$database = $config['config_database'] == \"MuOnline\" ? $this->muonline : $this->memuonline;\n\t\t\n\t\t// build query\n\t\t$data = array(\n\t\t\t'credits' => $input,\n\t\t\t'identifier' => $this->_identifier\n\t\t);\n\t\t$variables = array('{TABLE}','{COLUMN}','{USER_COLUMN}');\n\t\t$values = array($config['config_table'], $config['config_credits_col'], $config['config_user_col']);\n\t\t\n\t\tif(check($currentCredits)) {\n\t\t\t$query = str_replace($variables, $values, \"UPDATE {TABLE} SET {COLUMN} = {COLUMN} + :credits WHERE {USER_COLUMN} = :identifier\");\n\t\t} else {\n\t\t\t$query = str_replace($variables, $values, \"UPDATE {TABLE} SET {COLUMN} = :credits WHERE {USER_COLUMN} = :identifier\");\n\t\t}\n\t\t\n\t\t// add credits\n\t\t$addCredits = $database->query($query, $data);\n\t\tif(!$addCredits) throw new Exception(lang('error_129'));\n\t\t\n\t\t$this->_addLog($config['config_title'], $input, \"add\");\n\t}", "public function getContents($file);", "public function read_file() {\t\t\r\n\t\t$file = $this->filepath;\r\n\t\t\r\n\t\tif(file_exists($file)) {\r\n\t\t\t$this->_content = file_get_contents($file);\t\r\n\t\t} \r\n\t}", "protected static function retrieve_credits($unitID)\n\t{\t\t\n\t\tglobal $DB;\n\t\t$sql = \"SELECT credits FROM {block_bcgt_unit} WHERE id = ?\";\n\t\treturn $DB->get_record_sql($sql, array($unitID));\n\t}", "private function NewFile() : array\n {\n $file = fopen(__DIR__ . '/../cache/deals.txt', \"r\");\n\n $deals = $this->decoratee->GetDeals();\n if($file == false) return $deals;\n\n //converim l'array a json\n $deals_encoded = json_encode($deals);\n //convertim el json a fitxer\n file_put_contents(__DIR__ . '/../cache/deals.txt', $deals_encoded);\n\n return $deals;\n \n }", "function pnh_add_credits()\r\n\t{\r\n\t\t$user=$this->auth(PNH_ADD_CREDIT);\r\n\t\t$data['page']=\"pnh_add_credit\";\r\n\t\t$this->load->view(\"admin\",$data);\r\n\t}", "private function loadOpenModuleFile()\r\n\t{\r\n\t\tif(file_exists($this->filename))\r\n\t\t{\r\n\t\t\t$file = file_get_contents($this->filename);\r\n\t\t\t$file = preg_replace(\"/\".preg_quote(\"----------- BEGIN CTM.MODULE LICENSE FOR [\").\"(.*?)\".preg_quote(\"] -----------\").\"/i\", NULL, trim($file));\r\n\t\t\t$file = preg_replace(\"/\".preg_quote(\"----------- END CTM.MODULE LICENSE FOR [\").\"(.*?)\".preg_quote(\"] -----------\").\"/i\", NULL, trim($file));\r\n\t\t\t$file = str_replace(array(\"\\r\", \"\\n\"), NULL, $file);\r\n\t\t\t\r\n\t\t\t$data = CTM_Crypt::stringNewDecoder(base64_decode($file), $this->cryptKey);\r\n\t\t\tpreg_match(\"/\\[--(.*?)--\\]/i\", str_replace(array(\"\\r\", \"\\n\"), NULL, $data), $token);\r\n\t\t\tpreg_match(\"/\\[\\*\\*(.*?)\\*\\*\\]/i\", str_replace(array(\"\\r\", \"\\n\"), NULL, $data), $license);\r\n\t\t\tpreg_match(\"/\\[%%(.*?)%%\\]/i\", str_replace(array(\"\\r\", \"\\n\"), NULL, $data), $apiKey);\r\n\t\t\t\r\n\t\t\t$this->token = $token[1];\r\n\t\t\t$this->license = $license[1];\r\n\t\t\t$this->API_Key = $apiKey[1];\r\n\t\t}\r\n\t}", "public function read($file);", "protected function readFile(string $cacheFile): string\n {\n return file_get_contents($cacheFile);\n }", "abstract protected function grabReportListFromFile( $quantity );", "function _getFileContents( $file )\r\n {\r\r\n if (function_exists('file_get_contents')) {\r\n $content = @file_get_contents( $file );\r\n } else {\r\n $content = implode('', file($file));\r\n }\r\n\r\n /**\r\n * store the file name\r\n */\r\n array_push($this->_files, $file);\r\n\r\n return $content;\r\n }", "public function credit()\n\t{\n\t\t\\IPS\\Dispatcher::i()->checkAcpPermission( 'invoices_edit' );\n\t\t\n\t\t/* Load Invoice */\n\t\ttry\n\t\t{\n\t\t\t$invoice = \\IPS\\nexus\\Invoice::load( \\IPS\\Request::i()->id );\n\t\t}\n\t\tcatch ( \\OutOfRangeException $e )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'node_error', '2X190/A', 404, '' );\n\t\t}\n\t\t\t\t\n\t\t/* Can we do this? */\n\t\tif ( $invoice->status !== \\IPS\\nexus\\Invoice::STATUS_PENDING )\n\t\t{\n\t\t\t\\IPS\\Output::i()->error( 'invoice_status_err', '2X190/B', 403, '' );\n\t\t}\n\t\t\n\t\t/* How much can we do? */\n\t\t$amountToPay = $invoice->amountToPay()->amount;\n\t\t$credits = $invoice->member->cm_credits;\n\t\t$credit = $credits[ $invoice->currency ]->amount;\n\t\t$maxCanCharge = ( $credit->compare( $amountToPay ) === -1 ) ? $credit : $amountToPay;\n\n\t\t/* Build Form */\n\t\t$form = new \\IPS\\Helpers\\Form( 'amount', 'invoice_charge_to_credit' );\n\t\t$form->add( new \\IPS\\Helpers\\Form\\Number( 't_amount', $maxCanCharge, TRUE, array( 'min' => 0.01, 'max' => (string) $maxCanCharge, 'decimals' => TRUE ), NULL, NULL, $invoice->currency ) );\n\t\t\n\t\t/* Handle submissions */\n\t\tif ( $values = $form->values() )\n\t\t{\t\t\t\n\t\t\t$transaction = new \\IPS\\nexus\\Transaction;\n\t\t\t$transaction->member = $invoice->member;\n\t\t\t$transaction->invoice = $invoice;\n\t\t\t$transaction->amount = new \\IPS\\nexus\\Money( $values['t_amount'], $invoice->currency );\n\t\t\t$transaction->ip = \\IPS\\Request::i()->ipAddress();\n\t\t\t$transaction->extra = array( 'admin' => \\IPS\\Member::loggedIn()->member_id );\n\t\t\t$transaction->save();\n\t\t\t$transaction->approve( NULL );\n\t\t\t$transaction->sendNotification();\n\t\t\t\n\t\t\t$credits[ $invoice->currency ]->amount = $credits[ $invoice->currency ]->amount->subtract( $transaction->amount->amount );\n\t\t\t$invoice->member->cm_credits = $credits;\n\t\t\t$invoice->member->save();\n\t\t\t\n\t\t\t$invoice->member->log( 'transaction', array(\n\t\t\t\t'type'\t\t\t=> 'paid',\n\t\t\t\t'status'\t\t=> \\IPS\\nexus\\Transaction::STATUS_PAID,\n\t\t\t\t'id'\t\t\t=> $transaction->id,\n\t\t\t\t'invoice_id'\t=> $invoice->id,\n\t\t\t\t'invoice_title'\t=> $invoice->title,\n\t\t\t) );\n\t\t\t\n\t\t\t$this->_redirect( $invoice );\n\t\t}\n\t\t\n\t\t/* Display */\n\t\t\\IPS\\Output::i()->title = \\IPS\\Member::loggedIn()->language()->addToStack( 'invoice_charge_to_credit' );\n\t\t\\IPS\\Output::i()->output = $form;\n\t}", "private function read_lines()\n {\n return $array = file($this->filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n }", "public function getFileContents($file)\n\t{\n\t\treturn file_get_contents($file);\n\t}" ]
[ "0.5726623", "0.5170298", "0.50242525", "0.50182575", "0.492811", "0.48286855", "0.47085768", "0.46407107", "0.4602177", "0.45760193", "0.45707583", "0.45707583", "0.4570477", "0.4570477", "0.4570243", "0.4569504", "0.45668986", "0.45630634", "0.45618623", "0.45430538", "0.45369288", "0.45204377", "0.45160282", "0.45110413", "0.45007706", "0.44915962", "0.4472386", "0.44686177", "0.4461715", "0.4457264" ]
0.56117266
1
Lists all Pincode models.
public function actionIndex() { $searchModel = new PincodeSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModels();", "public function getModels();", "public function getAll()\n {\n return DB::table('product_models')->get()->all();\n }", "public function postcodes()\n {\n return $this->hasMany('App\\Postcode');\n }", "public function actionIndex()\n {\n $searchModel = new DetailPinjamSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionList()\r\n {\r\n $this->_userAutehntication();\r\n switch($_GET['model'])\r\n {\r\n case 'posts': \r\n $models = Post::model()->findAll();\r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Error: Mode <b>list</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n if(is_null($models)) {\r\n $this->_sendResponse(200, sprintf('No Post found for model <b>%s</b>', $_GET['model']) );\r\n } else {\r\n $rows = array();\r\n foreach($models as $model)\r\n $rows[] = $model->attributes;\r\n\r\n $this->_sendResponse(200, CJSON::encode($rows));\r\n }\r\n }", "public function index()\n {\n //\n\n return Pais::all();\n }", "public function index()\n {\n return Address::all();\n }", "public function index()\n {\n return $this->model->all();\n }", "public function index(){\n return $this->model->all();\n }", "public function actionList() {\n $models = Post::model()->findAll();\n $rows = array();\n foreach($models as $model) \n $rows[] = $model->attributes;\n\t\t$data_response = array(\n\t\t\t'error'=> array('status'=>200, 'message'=>''),\n\t\t\t'datas'=>$rows\n\t\t);\n $this->response($data_response);\n }", "public function index()\n {\n return Place::all();\n }", "public function index() {\n //$validPostcodes = ValidPostcode::all();\n $validPostcodes = ValidPostcode::orderby('postcode', 'asc')->paginate(50);\n return view('admin.postcode.index', compact('validPostcodes'));\n }", "public function index()\n {\n $providers = $this->repository->orderBy('id')->relationships('address')->paginate(5);\n \n return view('admin.providers.index', compact('providers'));\n\n }", "public function index()\n {\n return $this->list->setQuery($this->repository->index())->setAddAction('commerce/promocodes/create')->render(function ($item) {\n return [\n trans('mconsole::tables.id') => $item->id,\n null => view('mconsole::indicators.state', [\n 'enabled' => $item->enabled(),\n ]),\n trans('mconsole::commerce.promocodes.form.code') => sprintf('<code>%s</code>', $item->code),\n trans('mconsole::commerce.promocodes.form.discount') => $item->type == 'perc' ? sprintf('%s%%', $item->amount) : currency_format($item->amount) . ' руб.',\n ];\n });\n }", "public function index()\n {\n $info = Qrcodes::all();\n return QrcoderResource::collection($info);\n }", "public function index()\n {\n $shopAPostcodes = Shop::find(1)->postcode;\n $shopBPostcodes = Shop::find(2)->postcode;\n \n $data = array (\n 'shopAPostcodes' => $shopAPostcodes,\n 'shopBPostcodes' => $shopBPostcodes\n );\n return View('postcode.index')->with('postcodes', $data);\n }", "public function GetAll()\n {\n return $this->model->all();\n }", "public function index()\n {\n return Model::all();\n }", "public function actionAddressListAll() \r\n {\r\n return $this->listing(0, true, Yii::$app->request->get('area_id'));\r\n }", "public function index()\n {\n return $this->model->getAll();\n }", "public static function getList()\n {\n $models = self::find()->all();\n $list = ArrayHelper::map($models, 'id', 'name');\n return $list;\n }", "private function getAllModels()\n {\n return (object)ModelRegistry::getAllObjects();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public function getAll()\n {\n return $this->model->all();\n }", "public static function all_promo_codes() {\n return PromoCode::with('user')->get()->toArray();\n }", "public function getAllPoliklinik()\n {\n return $this->findAll();\n }", "public function getAll()\n {\n return $this->model->orderBy('id', 'DESC')->get();\n }", "function get_all_pinjam()\n {\n $this->db->order_by('no_po', 'desc');\n return $this->db->get('pinjam')->result_array();\n }" ]
[ "0.5968903", "0.5968903", "0.5888494", "0.5716667", "0.5692317", "0.5669492", "0.56660056", "0.565783", "0.56405425", "0.5630492", "0.56043476", "0.560041", "0.55737084", "0.5513757", "0.5447942", "0.54417723", "0.5439676", "0.54387426", "0.54276806", "0.54246444", "0.54227316", "0.54150975", "0.5413316", "0.54100543", "0.54100543", "0.54100543", "0.54035145", "0.54017335", "0.5392561", "0.53833246" ]
0.68689054
0
Find the hosts for each event so that they can be excluded later.
private function getHosts() { foreach ($this->events as $event) { $this->hosts = array_unique(array_merge($this->hosts, array_map(function ($host) { return $host->host_name; }, $event->hosts))); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hosts() {\n // Query each HttpRequest object sequentially, and add to a master list.\n $hosts = array();\n foreach ($this->requests as $request) {\n $url = $request->url;\n $hostname = parse_url($url, PHP_URL_HOST);\n if (!in_array($hostname, $hosts)) {\n $hosts[] = $hostname;\n }\n }\n return $hosts;\n }", "public function hosts()\n {\n return $this->morphedByMany('App\\Models\\Event\\Person\\EventHost', 'persona', 'pivot_persona_org', 'organization_id', 'persona_id');\n }", "public function getHosts() {\r\n \t\ttry {\r\n \t\t\t$pdo = $this->db->generatePDO();\r\n\r\n \t\t\t$sql = \"SELECT DISTINCT(client_addr) FROM temperature\";\r\n\r\n\t\t\t$hosts = array();\r\n\r\n \t\t\t$getTemp = $pdo->prepare($sql);\r\n \t\t\t$getTemp->execute();\r\n\t\t\t$data = $getTemp->fetchAll(PDO::FETCH_ASSOC);\r\n\r\n\t\t\tforeach($data as $key => $value)\r\n\t\t\t\tarray_push($hosts, $value['client_addr']);\r\n \t\t\treturn $hosts;\r\n\r\n \t\t} catch (PDOException $e) {\r\n \t\t\t$this->throwError($e->getMessage());\r\n \t\t}\r\n \t}", "public function findHosts(): array;", "public function getHosts() {\n $hosts = array();\n foreach ($this->shareData[\"hosts\"] as $nick => $sessionID) {\n $hosts[$nick] = new Client($this->memcache, $sessionID);\n }\n return $hosts;\n }", "public function getHosts()\n {\n return isset($this->Hosts) ? $this->Hosts : null;\n }", "static protected function _get_host()\n {\n return array(\n self::$_hosts[array_rand(self::$_hosts)],\n self::$_ports[array_rand(self::$_ports)],\n );\n }", "public function getActiveHostings()\n {\n $result = array();\n foreach ($this->customHostings as $cHost) {\n if ($cHost->isHosting()) {\n $result[] = $cHost->getIdentifier();\n }\n }\n return $result;\n }", "static function getAllHosts( $domain ) {\n\t\tglobal $wgAuth;\n\n\t\tOpenStackNovaLdapConnection::connect();\n\n\t\t$hosts = array();\n\t\t$result = LdapAuthenticationPlugin::ldap_search( $wgAuth->ldapconn, $domain->domainDN, '(dc=*)' );\n\t\tif ( $result ) {\n\t\t\t$entries = LdapAuthenticationPlugin::ldap_get_entries( $wgAuth->ldapconn, $result );\n\t\t\tif ( $entries ) {\n\t\t\t\t# First entry is always a count\n\t\t\t\tarray_shift( $entries );\n\t\t\t\tforeach ( $entries as $entry ) {\n\t\t\t\t\t$hosts[] = new OpenStackNovaHost( $entry['dc'][0], $domain );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $hosts;\n\t}", "function _hosts()\n{\n $c = \"# Generated with beatnik on \" . date('Y-m-d h:i:s') . \" by \" . $GLOBALS['username'] . \"\\n\\n\";\n foreach ($GLOBALS['domains'] as $domain) {\n\n $zonename = $domain['zonename'];\n $tld = substr($zonename, strrpos($zonename, '.')+1);\n $domain = substr($zonename, 0, strrpos($zonename, '.'));\n\n foreach ($zonedata['cname'] as $id => $values) {\n extract($values);\n if (!empty($hostname)) {\n $hostname .= '.';\n }\n $c .= \"$pointer $hostname.$domain.$tld\\n\";\n }\n }\n\n return $c;\n}", "public static function getRegisteredHostnames() {\n return [ 'vbox7.com', '*.vbox7.com' ];\n }", "static function getHostsByIP( $ip ) {\n\t\tglobal $wgAuth;\n\t\tglobal $wgOpenStackManagerLDAPInstanceBaseDN;\n\n\t\t$result = LdapAuthenticationPlugin::ldap_search( $wgAuth->ldapconn, $wgOpenStackManagerLDAPInstanceBaseDN, '(arecord=' . $ip . ')' );\n\t\t$hostsInfo = LdapAuthenticationPlugin::ldap_get_entries( $wgAuth->ldapconn, $result );\n\t\tif ( $hostsInfo[\"count\"] == \"0\" ) {\n\t\t\treturn array();\n\t\t} else {\n\t\t\t$hosts = array();\n\t\t\tarray_shift( $hostsInfo );\n\t\t\tforeach ( $hostsInfo as $host ) {\n\t\t\t\t$hostname = $host['dc'][0];\n\t\t\t\t$domainname = explode( '.', $host['associateddomain'][0] );\n\t\t\t\t$domainname = $domainname[1];\n\t\t\t\t$domain = OpenStackNovaDomain::getDomainByName( $domainname );\n\t\t\t\t$hostObject = OpenStackNovaHost::getHostByName( $hostname, $domain );\n\t\t\t\tif ( $hostObject ) {\n\t\t\t\t\t$hosts[] = $hostObject;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $hosts;\n\t\t}\n\t}", "function _getUsedHostPorts($scenariosetup_id){\r\n $usedHosts = $this->UsedHost->find('all', array('conditions'=>'scenariosetup_id='.$scenariosetup_id));\r\n $hosts = array();\r\n if (!empty($usedHosts)){\r\n foreach($usedHosts as $host) {\r\n $h = $this->Host->read(null, $host['UsedHost']['host_id']);\r\n $port = $h['Host']['id'] + START_PORT;\r\n $hosts[$port] = $h['Host']['description'];\r\n }\r\n } \r\n return $hosts;\r\n }", "public function PHP_getVirtualHosts()\n\t{\n\t\t$docRoot\t= $this->_doc_root;\n\t\t$vhosts\t\t= array();\n\n\t\tif ($handle = opendir($docRoot)) {\n\t\t\twhile (false !== ($directory = readdir($handle))) {\n\t\t\t\tif ($this->_is_valid_dir($docRoot . DIRECTORY_SEPARATOR . $directory) && $directory != '.' && $directory != '..') {\n\n\t\t\t\t\t$vhosts[] = array(\n\t\t\t\t\t\t'name'\t\t=> $directory,\n\t\t\t\t\t\t'domain'\t=> $directory .'.' . $this->_tld,\n\t\t\t\t\t\t'href'\t\t=> 'http://' . $directory . '.' . $this->_tld\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $vhosts;\n\t}", "public function getMultiHostServers() {\n $publicKey = md5(microtime());\n\n $hosts = array('http://imbo0', 'http://imbo1/prefix', 'http://imbo2:81', 'http://imbo3:81/prefix', 'http://imbo4:80');\n\n return array(\n array($hosts, $publicKey, 'd1afdbe2950dc1e9fa134d8c91cd1a8b', 'http://imbo4'),\n array($hosts, $publicKey, '5fda26a928c9b0b90ef7b2db0031bfcf', 'http://imbo0'),\n array($hosts, $publicKey, '5d028794b32c2b127875a336b1220dab', 'http://imbo3:81/prefix'),\n array($hosts, $publicKey, 'f7dc62518f2967dacbc4c0eead5fabe5', 'http://imbo2:81'),\n array($hosts, $publicKey, '7a4cac9e82c06010293cd6d23708e147', 'http://imbo2:81'),\n array($hosts, $publicKey, '609c8d8350d3b6b294a628835b8e9b59', 'http://imbo1/prefix'),\n array($hosts, $publicKey, '1e68c888fbe0a27276141a1e6fb576f4', 'http://imbo0'),\n array($hosts, $publicKey, '67e45db3a472a90a26bda000c0818bfc', 'http://imbo3:81/prefix'),\n array($hosts, $publicKey, '3ad35117949c5a17b9df82c343b4f763', 'http://imbo3:81/prefix'),\n );\n }", "function certificateapi_get_hosts() {\n global $CFG, $DB;\n return $DB->get_records_sql('SELECT\n h.id,\n h.ip_address,\n h.wwwroot,\n h.fullname,\n h.last_connect_time,\n h.clientid,\n h.public_key,\n h.public_key_validfrom,\n h.public_key_expires,\n h.permissions\n FROM\n {certificateapi_host} AS h' );\n}", "public function _getExistedHost($list_triggerid){\n global $dbconn_zabbix;\n $rows = array();\n\t\t\t$sql = \"SELECT DISTINCT h.*,f.triggerid FROM \n\t\t\thosts h ,functions f,items i \n\t\t\tWHERE (f.triggerid IN ({$list_triggerid})) AND h.hostid=i.hostid AND f.itemid=i.itemid AND h.status IN (0,1,3)\";\n if(MODE_DEBUG == true){\n echo $sql;\n echo \"<br>\";\n }\n $result = mysql_query($sql,$dbconn_zabbix);\n while($row = mysql_fetch_assoc($result)){\n $rows[] = $row;\n }\n mysql_free_result($result);\n return $rows;\n }", "public function getGlobals()\n {\n $hostname = $this->container->get('request')->getHost();\n $host = $this->container->get('doctrine.orm.entity_manager')->getRepository('SandboxWebsiteBundle:Host')\n ->findOneBy(['name' => $hostname]);\n return array('host' => $host);\n }", "function get_hostgroup_data()\n{\n\tglobal $NagiosData;\n\tglobal $NagiosUser; \n\n\t$hostgroups = $NagiosData->getProperty('hostgroups');\n\t$hosts = $NagiosData->getProperty('hosts');\n\n\t$hostgroup_data = array();\n\tforeach ($hostgroups as $group => $members) \n\t{\n\t\t\n\t\t\n\t\t$hostgroup_data[$group] = array(\n\t\t\t'member_data' => array(),\n\t\t\t'host_counts' => get_state_of('hosts', build_hostgroup_details($members)),\n\t\t\t'service_counts' => get_state_of('services', build_host_servicegroup_details($members))\n\t\t\t);\n\t\t\n\t\t//skip ahead if there are no authorized hosts\t\t\t\n\t\tif(array_sum($hostgroup_data[$group]['host_counts'])==0) continue; //skip empty groups \n\t\t\t\n\t\tforeach ($members as $member) \n\t\t{\n\t\t\n\t\t\tif(!$NagiosUser->is_authorized_for_host($member)) continue; //user-level filtering \t\t\n\t\t\n\t\t\t$host = $hosts[$member];\n\t\t\tprocess_host_status_keys($host); \n\t\t\t$hostgroup_data[$group]['member_data'][$member]['host_name'] = $host['host_name'];\n\t\t\t$hostgroup_data[$group]['member_data'][$member]['host_state'] = $host['current_state'];\n\t\t\t$hostgroup_data[$group]['member_data'][$member]['state_class'] = get_color_code($host);\n\t\t\t$hostgroup_data[$group]['member_data'][$member]['services'] = array();\n\t\t\t$hostgroup_data[$group]['member_data'][$member]['host_url'] = \n\t\t\t\tBASEURL.'index.php?type=hostdetail&name_filter='.urlencode($host['host_name']);\n\n\t\t\t\n\t\t\tif (isset($host['services'])) {\n\t\t\t\tforeach($host['services'] as $service) {\n\t\t\t\t\n\t\t\t\t\tif(!$NagiosUser->is_authorized_for_service($member,$service['service_description'])) continue; //user-level filtering \t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tprocess_service_status_keys($service);\n\t\t\t\t\t$service_data = array(\n\t\t\t\t\t\t'state_class' => get_color_code($service),\n\t\t\t\t\t\t'description' => $service['service_description'],\n\t\t\t\t\t\t'service_url' => htmlentities(BASEURL.'index.php?type=servicedetail&name_filter='.$service['service_id']),\n\t\t\t\t\t);\n\t\t\t\t\t$hostgroup_data[$group]['member_data'][$member]['services'][] = $service_data;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}\n\treturn $hostgroup_data;\n}", "public function findHostsByIdsForNonAdminUser(array $hostIds): array;", "private function getAllowedBypassHostnames(): array\n {\n $allowedHostnames = $this->scopeConfigInterface->getValue(self::XML_PATH_ALLOWED_BYPASS_HOSTNAMES);\n if (empty($allowedHostnames)) {\n return [];\n }\n return $allowedHostnames;\n }", "public static function get_host_where_intersect($hosts = array()) \n { \n if (count($hosts) > 0) \n { \n // Merge \n return (self::get_host_where()) ? self::get_host_where().\" AND asset_id IN (UNHEX('\".implode(\"'), UNHEX('\",$hosts).\"'))\" : \"UNHEX('\".implode(\"'), UNHEX('\",$hosts).\"')\";\n } \n else\n {\n return self::get_host_where();\n }\n }", "function wp_internal_hosts()\n {\n }", "function parseHosts(Request $request);", "public function getTbrHosts() {\n\treturn $this->GTB_SERVER['host']; \n }", "private function getHostConfigurations($hosts)\n {\n $hostConfigurations = [];\n foreach ($hosts as $name => $settings) {\n $host = $settings['host'];\n // Set the key of the host as id.\n $hostConfigurations[$host]['id'] = $name;\n\n foreach ($settings as $setting => $data) {\n if ($setting === 'locales') {\n $hostConfigurations[$host]['locales_extra'] = $this->getLocalesExtra($data);\n $data = $this->getHostLocales($data);\n $hostConfigurations[$host]['reverse_locales'] = array_flip($data);\n }\n $hostConfigurations[$host][$setting] = $data;\n }\n }\n\n return $hostConfigurations;\n }", "public function traceRouteHost()\n {\n $datas = [];\n\n $hosts = config('traceroute_hosts');\n\n if(empty($hosts))\n $hosts = [ 'google.com' ];\n\n foreach ($hosts as $key => $host){\n exec('traceroute ' . $host . ' | awk \\'/a/ { print ($all) }\\'' , $output);\n\n array_push($datas, [\n 'traceroute_to' => $host,\n 'hosts' => []\n ]);\n\n foreach($output as $value){\n\n preg_match_all(\"'\\((.*?)\\)'\",$value,$ip);\n\n array_push($datas[$key]['hosts'], $this->ipDetails($ip[1][0]));\n\n }\n }\n\n echo json_encode($datas);\n }", "public function load()\n {\n $configFilePath = $this->configFilePath();\n if (!file_exists($configFilePath)) {\n $this->hosts = [];\n } else {\n $this->hosts = $this->parser->parse(file_get_contents($configFilePath));\n }\n return $this->hosts();\n }", "public function findHostsByIdsForAdminUser(array $hostIds): array;", "function wp_dependencies_unique_hosts()\n {\n }" ]
[ "0.7058571", "0.70169204", "0.6617256", "0.6465032", "0.6335695", "0.6220404", "0.602014", "0.5994093", "0.59110224", "0.59044397", "0.57700473", "0.5685068", "0.5678926", "0.5649511", "0.56350493", "0.56253076", "0.55366266", "0.5420782", "0.54169184", "0.53667855", "0.5349608", "0.534156", "0.53216195", "0.52889794", "0.5277461", "0.5275052", "0.52321213", "0.5225808", "0.52251244", "0.52197987" ]
0.8320707
0
Calculates the number of new requests made per minute.
public function getRate() { // Get number of requests made in the last minute $count = 0; $Test = new DateTime('-1 min -23 sec'); foreach ($this->Stats['NewConnections'] as $k => $Time) { // Time is not expired? Add to count if ($Time > $Test) { $count ++; // Time too old? Remove from list } else { unset($this->Stats['NewConnections'][$k]); } } // Reindex $this->Stats['NewConnections'] = array_values($this->Stats['NewConnections']); // Convert result to float return floatval($count); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNumberOfRequests()\n {\n return array_sum($this->numberOfRequestsByPattern);\n }", "function count_new_messages() {\n $last_visit = UserConfigOptions::getValue('status_update_last_visited', $this->logged_user);\n echo StatusUpdates::countNewMessagesForUser($this->logged_user, $last_visit);\n die();\n }", "public function getTotalRequests() {\n return $this->debug_total_url_requests + $this->debug_total_cache_requests;\n }", "public function count()\n {\n return count($this->requests);\n }", "protected function updateRequestTime()\n {\n $this->requestTimestamp = microtime(true);\n }", "public function sessionAge()\n {\n if (!isset($_SESSION[PMF_SESSION_ID_TIMESTAMP])) {\n return 0;\n }\n\n return ($_SERVER['REQUEST_TIME'] - $_SESSION[PMF_SESSION_ID_TIMESTAMP]) / 60;\n }", "protected function get_request_counts()\n {\n }", "public function request_manager( )\n\t{\n\t\t$last_request = $this->php_session->get('last_request');\n\t\t//5 second interval\n\t\tif( $last_request+5 >= time() )\n\t\t{\n\t\t\t$req_count = $this->php_session->get('request_count');\n\t\t\t$req_count += 1;\n\t\t\t$this->php_session->set('request_count' , $req_count);\n\t\t\tif( $req_count >= 20 )\n\t\t\t\t$this->error('Too many HTTP requests from your session.');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->php_session->set('request_count' , 0 );\n\t\t}\n\t\t$this->php_session->set('last_request' , time( ) );\n\t\t\t\n\t}", "public function requestCount()\n {\n return DB::table('userlinkrequests')\n ->where('them', $this->id)\n ->count();\n }", "public function countByMinutes($request, $model, $column = 'created_at')\n {\n return $this->count($request, $model, Trend::BY_MINUTES, $column);\n }", "public function getRefreshRate() { return 0; }", "public static function apiCounts(Request $r) {\n\t\t\n\t\t$totalsCache = new Cache(Cache::RUN_COUNTS, \"\");\n\t\t$totals = $totalsCache->get();\n\t\t\n\t\tif (is_null($totals)) {\n\t\t\t$totals = array();\n\t\t\t$totals[\"total\"] = array();\n\t\t\t$totals[\"ac\"] = array();\n\t\t\ttry {\n\n\t\t\t\t// I don't like this approach but adodb didn't like too much to execute\n\t\t\t\t// store procedures. anyways we will cache the totals\n\t\t\t\t$date = date('Y-m-d', strtotime('1 days'));\n\t\t\t\tfor ($i = 0; $i < 30 * 6; $i++) {\n\t\t\t\t\t$totals[\"total\"][$date] = RunsDAO::GetRunCountsToDate($date);\n\t\t\t\t\t$totals[\"ac\"][$date] = RunsDAO::GetAcRunCountsToDate($date);\n\t\t\t\t\t$date = date('Y-m-d', strtotime('-'.$i.' days'));\n\t\t\t\t}\n\t\t\t} catch (Exception $e) {\n\t\t\t\tthrow new InvalidDatabaseOperationException($e);\n\t\t\t}\n\t\t\t\n\t\t\t$totalsCache->set($totals, 24*60*60);\n\t\t}\n\t\t\t\t\t\t\n\t\treturn $totals;\n\t}", "public function get_request_duration()\n {\n }", "public function getTtl(): int\n {\n return 10;\n }", "public function getRequestCount()\n {\n return $this->requestCount;\n }", "public function calculateTimeForTokens(int $tokens): int\n {\n $cyclesRequired = ceil($tokens / $this->refillAmount);\n\n return TimeUtil::dateIntervalToSeconds($this->refillTime) * $cyclesRequired;\n }", "public function calculateNewTokensDuringInterval(float $duration): int\n {\n $cycles = floor($duration / TimeUtil::dateIntervalToSeconds($this->refillTime));\n\n return $cycles * $this->refillAmount;\n }", "public static function simulate_new_request() {\n self::$now += 0.1;\n self::$purgetoken = null;\n }", "function search_requests_count()\n {\n $count=$this->db->count_all_results('lic_requests');\n\t\t$this->db->flush_cache();\n\t\treturn $count;\n }", "function bump_request_timeout() {\n\t\treturn 60;\n\t}", "protected function countRequest($pattern)\n {\n if (!isset($this->numberOfRequestsByPattern[$pattern])) {\n $this->numberOfRequestsByPattern[$pattern] = 0;\n }\n $this->numberOfRequestsByPattern[$pattern]++;\n }", "function count_site_visit($from_admin_overview=false) {\r\n\tif (file_exists(COUNTER_FILE)) {\r\n\t\t$ignore = false;\r\n\t\t$current_agent = (isset($_SERVER['HTTP_USER_AGENT'])) ? addslashes(trim($_SERVER['HTTP_USER_AGENT'])) : \"no agent\";\r\n\t\t$current_time = time();\r\n\t\t$current_ip = $_SERVER['REMOTE_ADDR']; \r\n\t \r\n\t\t// daten einlesen\r\n\t\t$c_file = array();\r\n\t\t$handle = fopen(COUNTER_FILE, \"r\");\r\n\t \r\n\t \tif ($handle) {\r\n\t\t\twhile (!feof($handle)) {\r\n\t\t\t\t$line = trim(fgets($handle, 4096)); \r\n\t\t\t\tif ($line != \"\") {\r\n\t\t\t\t\t$c_file[] = $line;\r\n\t\t\t\t}\t\t \r\n\t\t\t}\r\n\t\t\tfclose ($handle);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$ignore = true;\r\n\t\t}\r\n\t \r\n\t\t// bots ignorieren \r\n\t\tif (substr_count($current_agent, \"bot\") > 0) {\r\n\t\t\t$ignore = true;\r\n\t\t}\r\n\t\t \r\n\t \r\n\t\t// hat diese ip einen eintrag in den letzten expire sec gehabt, dann igornieren?\r\n\t\tfor ($i = 1; $i < sizeof($c_file); $i++) {\r\n\t\t\tlist($counter_ip, $counter_time) = explode(\"||\", $c_file[$i]);\r\n\t\t\t$counter_time = trim($counter_time);\r\n\t\t \r\n\t\t\tif ($counter_ip == $current_ip && $current_time-COUNTER_IP_EXPIRE < $counter_time) {\r\n\t\t\t\t// besucher wurde bereits gezählt, daher hier abbruch\r\n\t\t\t\t$ignore = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t \r\n\t\t// counter hochzählen\r\n\t\tif (!$ignore) {\r\n\t\t\tif (sizeof($c_file) == 0) {\r\n\t\t\t\t// wenn counter leer, dann füllen \r\n\t\t\t\t$add_line1 = date(\"z\") . \":1||\" . date(\"W\") . \":1||\" . date(\"n\") . \":1||\" . date(\"Y\") . \":1||1||1||\" . $current_time . \"\\n\";\r\n\t\t\t\t$add_line2 = $current_ip . \"||\" . $current_time . \"\\n\";\r\n\t\t\t \r\n\t\t\t\t// daten schreiben\r\n\t\t\t\t$fp = fopen(COUNTER_FILE,\"w+\");\r\n\t\t\t\tif ($fp) {\r\n\t\t\t\t\tflock($fp, LOCK_EX);\r\n\t\t\t\t\tfwrite($fp, $add_line1);\r\n\t\t\t\t\tfwrite($fp, $add_line2);\r\n\t\t\t\t\tflock($fp, LOCK_UN);\r\n\t\t\t\t\tfclose($fp);\r\n\t\t\t\t}\r\n\t\t\t \r\n\t\t\t\t// werte zur verfügung stellen\r\n\t\t\t\t$day = $week = $month = $year = $all = $record = 1;\r\n\t\t\t\t$record_time = $current_time;\r\n\t\t\t\t$online = 1;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// counter hochzählen\r\n\t\t\t\tlist($day_arr, $week_arr, $month_arr, $year_arr, $all, $record, $record_time) = explode(\"||\", $c_file[0]);\r\n\t\t\t \r\n\t\t\t\t// day\r\n\t\t\t\t$day_data = explode(\":\", $day_arr);\r\n\t\t\t\t$day = $day_data[1];\r\n\t\t\t\tif ($day_data[0] == date(\"z\")) $day++; else $day = 1;\r\n\t\t\t \r\n\t\t\t\t// week\r\n\t\t\t\t$week_data = explode(\":\", $week_arr);\r\n\t\t\t\t$week = $week_data[1];\r\n\t\t\t\tif ($week_data[0] == date(\"W\")) $week++; else $week = 1;\r\n\t\t\t \r\n\t\t\t\t// month\r\n\t\t\t\t$month_data = explode(\":\", $month_arr);\r\n\t\t\t\t$month = $month_data[1];\r\n\t\t\t\tif ($month_data[0] == date(\"n\")) $month++; else $month = 1;\r\n\t\t\t \r\n\t\t\t\t// year\r\n\t\t\t\t$year_data = explode(\":\", $year_arr);\r\n\t\t\t\t$year = $year_data[1];\r\n\t\t\t\tif ($year_data[0] == date(\"Y\")) $year++; else $year = 1;\r\n\t\t\t \r\n\t\t\t\t// all\r\n\t\t\t\t$all++;\r\n\t\t\t \r\n\t\t\t\t// neuer record?\r\n\t\t\t\t$record_time = trim($record_time);\r\n\t\t\t\tif ($day > $record) {\r\n\t\t\t\t\t$record = $day;\r\n\t\t\t\t\t$record_time = $current_time;\r\n\t\t\t\t}\r\n\t\t\t \r\n\t\t\t\t// speichern und aufräumen und anzahl der online leute bestimmten\r\n\t\t\t \r\n\t\t\t\t$online = 1;\r\n\t\t\t \t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// daten schreiben\r\n\t\t\t\t$fp = fopen(COUNTER_FILE,\"w+\");\r\n\t\t\t\tif ($fp) {\r\n\t\t\t\t\tflock($fp, LOCK_EX);\r\n\t\t\t\t\t$add_line1 = date(\"z\") . \":\" . $day . \"||\" . date(\"W\") . \":\" . $week . \"||\" . date(\"n\") . \":\" . $month . \"||\" . date(\"Y\") . \":\" . $year . \"||\" . $all . \"||\" . $record . \"||\" . $record_time . \"\\n\";\t\t \r\n\t\t\t\t\tfwrite($fp, $add_line1);\r\n\r\n\t\t\t\t\tfor ($i = 1; $i < sizeof($c_file); $i++) {\r\n\t\t\t\t\t\tlist($counter_ip, $counter_time) = explode(\"||\", $c_file[$i]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// übernehmen\r\n\t\t\t\t\t\tif ($current_time-COUNTER_IP_EXPIRE < $counter_time) {\r\n\t\t\t\t\t\t\t$counter_time = trim($counter_time);\r\n\t\t\t\t\t\t\t$add_line = $counter_ip . \"||\" . $counter_time . \"\\n\";\r\n\t\t\t\t\t\t\tfwrite($fp, $add_line);\r\n\t\t\t\t\t\t\t$online++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$add_line = $current_ip . \"||\" . $current_time . \"\\n\";\r\n\t\t\t\t\tfwrite($fp, $add_line);\r\n\t\t\t\t\tflock($fp, LOCK_UN);\r\n\t\t\t\t\tfclose($fp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "public static function getUpdateInterval() {\n return 20;\n }", "public function computeCount() {\n if ($str = elis_consumer_http_request($this->url_pattern . '&rows=0', array('Accept' => 'application/json'))) {\n if ($json = json_decode($str)) {\n $this->totalCount = $json->response->numFound;\n }\n }\n return $this->totalCount;\n }", "public function getTimesToCharge()\n\t{\n\t\t$intTimesToCharge = @($this->minCharge / $this->recursionCharge);\n\t\ttry\n\t\t{\n\t\t\tFlex::assert($intTimesToCharge !== false, 'Recurring_Charge::getTimesToCharge() caused a divide-by-zero error', print_r($this->toArray(), true), \"Recurring_Charge::getTimesToCharge() -- Division by Zero\");\n\t\t}\n\t\tcatch (Exception_Assertion $oException)\n\t\t{\n\t\t\t// Do nothing -- we just want to report it\n\t\t}\n\t\t\n\t\t$intTimesToCharge\t= round($intTimesToCharge);\n\t\tif (($intTimesToCharge * $this->recursionCharge) < ($this->minCharge - $this->getMinChargeMarginOfError()))\n\t\t{\n\t\t\t// We must add one more time to charge to meet the minimum charge (this could possibly be a partial charge, if the recurring charge isn't continuable)\n\t\t\t$intTimesToCharge = $intTimesToCharge + 1;\n\t\t}\n\t\t\n\t\treturn $intTimesToCharge;\n\t}", "public function update_requests() {\n\t\tif (!isset($_POST['time']) || !isset($_POST['hash'])) exit('0');\n\n\t\t// If the response is invalid return a zero response\n\t\t$received = $_POST['time'] . '|' . $_POST['hash'];\n\t\t$expected = $this->time_marker(hash('crc32', $this->required_delay), $_POST['time']);\n\t\tif ($received !== $expected) exit('0');\n\n\t\t// If response if premature return a zero response\n\t\t$now = time();\n\t\t$earliest = absint($_POST['time']) + $this->required_delay;\n\t\tif ($now < $earliest) exit('0');\n\n\t\t// Seems ok ... respond with new hash\n\t\t$response = hash('md5', $_POST['hash'] . $this->base_key);\n\t\texit($response);\n\t}", "public function getHeartbeatInterval(): int\n {\n }", "public function getTotalSumNbReminderSent()\n {\n $nbSent = Mage::getModel('abandonment/stats')->getResource()\n ->getSumReminderSent();\n return $nbSent;\n }", "public function requests() : int;", "public function newTimer(): int\n {\n $index = count($this->timers);\n $this->timers[$index] = microtime(true);\n return $index;\n }" ]
[ "0.62863785", "0.58068776", "0.5777564", "0.5631723", "0.56140244", "0.5571207", "0.5566276", "0.555838", "0.5549194", "0.55460215", "0.55120146", "0.5511028", "0.55016637", "0.54953843", "0.5480695", "0.5474713", "0.5363728", "0.5358628", "0.5318494", "0.5281771", "0.5261617", "0.5246048", "0.5239085", "0.52373856", "0.5235307", "0.52332133", "0.5229917", "0.5212158", "0.5210226", "0.5208663" ]
0.7019287
0
Processes a SQL statement by quoting table and column names that are enclosed within double brackets. Tokens enclosed within double curly brackets are treated as table names, while tokens enclosed within double square brackets are column names. They will be quoted accordingly. Also, the percentage character "%" at the beginning or ending of a table name will be replaced with [[tablePrefix]].
public function quoteSql($sql) { return str_replace('#__', $this->tablePrefix, $sql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function formatQuery($sql) {\r\n\t\t//regex work with a lookahead to avoid splitting things inside single quotes\r\n\t\t$sql = preg_replace(\r\n\t\t\t\t\"/(WHERE|FROM|GROUP BY|HAVING|ORDER BY|LIMIT|OFFSET|UNION|DUPLICATE KEY)(?=(?:(?:[^']*+'){2})*+[^']*+\\z)/\", \"\\n$0\", $sql\r\n\t\t);\r\n\t\t$sql = preg_replace(\r\n\t\t\t\t\"/(INNER|LEFT|RIGHT|CASE|WHEN|END|ELSE|AND)(?=(?:(?:[^']*+'){2})*+[^']*+\\z)/\", \"\\n $0\", $sql);\r\n\t\treturn $sql;\r\n\t}", "abstract protected function parseSql();", "public function tableName( $name, $format = 'quoted' ) {\n\t\tglobal $wgSharedDB, $wgSharedPrefix, $wgSharedTables, $wgSharedSchema;\n\t\t# Skip the entire process when we have a string quoted on both ends.\n\t\t# Note that we check the end so that we will still quote any use of\n\t\t# use of `database`.table. But won't break things if someone wants\n\t\t# to query a database table with a dot in the name.\n\t\tif ( $this->isQuotedIdentifier( $name ) ) {\n\t\t\treturn $name;\n\t\t}\n\n\t\t# Lets test for any bits of text that should never show up in a table\n\t\t# name. Basically anything like JOIN or ON which are actually part of\n\t\t# SQL queries, but may end up inside of the table value to combine\n\t\t# sql. Such as how the API is doing.\n\t\t# Note that we use a whitespace test rather than a \\b test to avoid\n\t\t# any remote case where a word like on may be inside of a table name\n\t\t# surrounded by symbols which may be considered word breaks.\n\t\tif ( preg_match( '/(^|\\s)(DISTINCT|JOIN|ON|AS)(\\s|$)/i', $name ) !== 0 ) {\n\t\t\treturn $name;\n\t\t}\n\n\t\t# Split database and table into proper variables.\n\t\t# We reverse the explode so that database.table and table both output\n\t\t# the correct table.\n\t\t$dbDetails = explode( '.', $name, 2 );\n\t\tif ( count( $dbDetails ) == 3 ) {\n\t\t\tlist( $database, $schema, $table ) = $dbDetails;\n\t\t\t# We don't want any prefix added in this case\n\t\t\t$prefix = '';\n\t\t} elseif ( count( $dbDetails ) == 2 ) {\n\t\t\tlist( $database, $table ) = $dbDetails;\n\t\t\t# We don't want any prefix added in this case\n\t\t\t# In dbs that support it, $database may actually be the schema\n\t\t\t# but that doesn't affect any of the functionality here\n\t\t\t$prefix = '';\n\t\t\t$schema = null;\n\t\t} else {\n\t\t\tlist( $table ) = $dbDetails;\n\t\t\tif ( $wgSharedDB !== null # We have a shared database\n\t\t\t\t&& $this->mForeign == false # We're not working on a foreign database\n\t\t\t\t&& !$this->isQuotedIdentifier( $table ) # Prevent shared tables listing '`table`'\n\t\t\t\t&& in_array( $table, $wgSharedTables ) # A shared table is selected\n\t\t\t) {\n\t\t\t\t$database = $wgSharedDB;\n\t\t\t\t$schema = $wgSharedSchema === null ? $this->mSchema : $wgSharedSchema;\n\t\t\t\t$prefix = $wgSharedPrefix === null ? $this->mTablePrefix : $wgSharedPrefix;\n\t\t\t} else {\n\t\t\t\t$database = null;\n\t\t\t\t$schema = $this->mSchema; # Default schema\n\t\t\t\t$prefix = $this->mTablePrefix; # Default prefix\n\t\t\t}\n\t\t}\n\n\t\t# Quote $table and apply the prefix if not quoted.\n\t\t# $tableName might be empty if this is called from Database::replaceVars()\n\t\t$tableName = \"{$prefix}{$table}\";\n\t\tif ( $format == 'quoted' && !$this->isQuotedIdentifier( $tableName ) && $tableName !== '' ) {\n\t\t\t$tableName = $this->addIdentifierQuotes( $tableName );\n\t\t}\n\n\t\t# Quote $schema and merge it with the table name if needed\n\t\tif ( $schema !== null ) {\n\t\t\tif ( $format == 'quoted' && !$this->isQuotedIdentifier( $schema ) ) {\n\t\t\t\t$schema = $this->addIdentifierQuotes( $schema );\n\t\t\t}\n\t\t\t$tableName = $schema . '.' . $tableName;\n\t\t}\n\n\t\t# Quote $database and merge it with the table name if needed\n\t\tif ( $database !== null ) {\n\t\t\tif ( $format == 'quoted' && !$this->isQuotedIdentifier( $database ) ) {\n\t\t\t\t$database = $this->addIdentifierQuotes( $database );\n\t\t\t}\n\t\t\t$tableName = $database . '.' . $tableName;\n\t\t}\n\n\t\treturn $tableName;\n\t}", "private function escapeTable($name)\n {\n if (strpos($name, '.') || strpos($name, '`') || strpos($name, ' ')) {\n return $name;\n }\n\n return '`'.$name.'`';\n }", "public function quoteInto($sql) {\n\t\t$args = func_get_args();\n\n\t\tif (count($args) < 2 || (count($args) == 2 && !is_array($args[1]))) {\n\t\t\t// Nothing special happening here, pass it through to the default method.\n\t\t\t// We do this instead of calling $this->_zendDb->quoteInto($sql, $args[1])\n\t\t\t// because we're not sure if args[1] is there or not.\n\t\t\treturn call_user_func_array(array($this->_db, 'quoteInto'), $args);\n\t\t}\n\n\t\t// We are going to run our own replacement method.\n\t\t$replacements = $args;\n\t\tarray_shift($replacements);\n\n\t\tif (is_array($replacements[0])) {\n\t\t\t// Here, we are passed an array of replacements with key/value combos\n\t\t\t// that correspond to \":key\" => \"sqlValueToBeEscaped\".\n\t\t\t$replacements = $replacements[0];\n\t\t}\n\n\t\t// If we are using \"?\" placeholders, we need to change them over to indexed-placeholders.\n\t\t$pieces = explode('?', $sql);\n\t\t$sql = '';\n\n\t\tforeach ($pieces as $i => $piece) {\n\t\t\t$sql .= $piece;\n\n\t\t\tif ($i == count($pieces) -1) {\n\t\t\t\t// We are on the last one, skip.\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$sql .= ':'.$i;\n\t\t}\n\n\t\t// At this point, we are using \":key\" placeholders.\n\t\t$pieces = preg_split('/:(\\w+)\\b/', $sql, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);\n\t\t$sql = '';\n\n\t\tforeach ($pieces as $key => $piece) {\n\t\t\tif ($key % 2 == 0) {\n\t\t\t\t// We are on a piece of the query.\n\t\t\t\t$sql .= $piece;\n\t\t\t} else {\n\t\t\t\t// We are on a placeholder.\n\t\t\t\t$sql .= $this->_db->quote($replacements[$piece]);\n\t\t\t}\n\t\t}\n\n\t\treturn $sql;\n\t}", "abstract public function table_sql($tableName);", "public function quoteTableName($tableName);", "final public function replacePrefix($sql, $prefix='?') {\n\n $sql = trim($sql);\n\n $escaped = false;\n $quoteChar = '';\n\n $n = strlen($sql);\n\n $startPos = 0;\n $literal = '';\n while ($startPos < $n) {\n $ip = strpos($sql, $prefix, $startPos);\n\n if ($ip === false) {\n break;\n }\n $j = strpos($sql, \"'\", $startPos);\n $k = strpos($sql, '\"', $startPos);\n\n if (($k !== FALSE) && (($k < $j) || ($j === FALSE))) {\n $quoteChar = '\"';\n $j = $k;\n } else {\n $quoteChar = \"'\";\n }\n\n if ($j === false) {\n $j = $n; //the length of the sting\n }\n\n $literal .= str_replace($prefix, $this->prefix, substr($sql, $startPos, $j - $startPos));\n $startPos = $j;\n\n $j = $startPos + 1;\n\n if ($j >= $n) {\n break;\n }\n\n // THe last bit of the statement\n // quote comes first, find end of quote\n while (TRUE) {\n $k = strpos($sql, $quoteChar, $j);\n $escaped = false;\n if ($k === false) {\n break;\n }\n $l = $k - 1;\n while ($l >= 0 && $sql{$l} == '\\\\') {\n $l--;\n $escaped = !$escaped;\n }\n if ($escaped) {\n $j = $k + 1;\n continue;\n }\n break;\n }\n if ($k === FALSE) {\n // error in the query - no end quote; ignore it\n break;\n }\n $literal .= substr($sql, $startPos, $k - $startPos + 1);\n $startPos = $k + 1;\n }\n if ($startPos < $n) {\n $literal .= substr($sql, $startPos, $n - $startPos);\n }\n return $literal;\n }", "function parsingSql()\r\n\t{\r\n\t\tif ( preg_match(\"/{(.*?)}/\",$this->sql,$match) )\r\n\t\t{\r\n\t\t\t$this->valueToReplace = $match[0]; // {blabla}\r\n\t\t\t$this->fieldToSelect = $match[1]; // nama field yang akan di cek\r\n\t\t}else{\r\n\t\t\tdie(\"SQL query yg anda masukan harus mengandung {}\");\r\n\t\t\treturn ;\r\n\t\t}\r\n\t}", "function ParseInsertIntoStatement($strSQL)\n//returns an associative array of info\n//return table name keyed to qpre . \"tablename\"\n{\n\t$strSQL=deMultiple($strSQL, \" \");\n\t$arrOut=Array();\n\t$strLen=strlen($strSQL);\n\t$firstparenloc=strpos($strSQL, \"(\");\n\t$secondparenloc=strpos($strSQL, \")\", $firstparenloc);\n\t$thirdparenloc=strpos($strSQL, \"(\", $secondparenloc);\n\t$fourthparenloc=strpos($strSQL, \")\", $thirdparenloc);\n\t$strRawFieldnames=substr($strSQL, $firstparenloc+1, $secondparenloc-$firstparenloc-1);\n\t$strRawFieldvalues=substr($strSQL, $thirdparenloc+1, $fourthparenloc-(1+$thirdparenloc));\n\t$spacebeforefirstparen=strrpos($strSQL, \" \", -($strLen- $firstparenloc));\n\t//echo $firstparenloc . \"=\" . $spacebeforefirstparen . \"=<br>\";\n\tif($spacebeforefirstparen+1==$firstparenloc)\n\t{\n\t\t$spacebeforefirstparen=strrpos($strSQL, \" \", -($strLen- (1+ $firstparenloc)));\n\t\t\n\t}\n\t$tablename=substr($strSQL, $spacebeforefirstparen+1, ($firstparenloc-$spacebeforefirstparen-1));\n\t//echo $tablename . \"*<br>\";\n\t//echo \"*\" . $thirdparenloc . \" \" .$fourthparenloc . \" \" . $strRawFieldvalues. \"*<br>\";\n\t$strRawFieldnames=str_replace(\" \", \"\", $strRawFieldnames);\n\t$arrFieldNames=ParseStringToArraySkippingQuotedRegions($strRawFieldnames, \"'\\\"\", \",\");\n\t$arrValues=ParseStringToArraySkippingQuotedRegions($strRawFieldvalues, \"'\\\"\", \",\");\n\t$i=0;\n\tforeach($arrFieldNames as $thisfieldname)\n\t{\n\t \tif($thisfieldname!=\"\")\n\t\t{\n\t\t\t$arrOut[$thisfieldname]=trim($arrValues[$i]);\n\t\t\t$i++;\n\t\t}\n\t}\n\t$arrOut[qpre . \"table\"]=$tablename;\n\treturn $arrOut;\n}", "private static function escapeSql($s) // {{{\n {\n $matches = array(\"\\\\\", \"'\", \"\\\"\" /*,\"\\0\", \"\\b\", \"\\n\", \"\\r\", \"\\t\"*/);\n $replacements = array(\"\\\\\\\\\", \"\\\\'\", \"\\\\\\\"\", /*\"\\\\0\", \"\\\\b\", \"\\\\n\", \"\\\\r\",\n \"\\\\t\"*/);\n $st = str_replace($matches, $replacements, $s);\n return $st;\n }", "function mkSQL() {\n $n = func_num_args();\n if ($n < 1) {\n Fatal::internalError('Not enough arguments given to mkSQL().');\n }\n $i = 1;\n $SQL = \"\";\n $fmt = func_get_arg(0);\n while (strlen($fmt)) {\n $p = strpos($fmt, \"%\");\n if ($p === false) {\n $SQL .= $fmt;\n break;\n }\n $SQL .= substr($fmt, 0, $p);\n if (strlen($fmt) < $p+2) {\n Fatal::internalError('Bad mkSQL() format string.');\n }\n if ($fmt{$p+1} == '%') {\n $SQL .= \"%\";\n } else {\n if ($i >= $n) {\n Fatal::internalError('Not enough arguments given to mkSQL().');\n }\n $arg = func_get_arg($i++);\n switch ($fmt{$p+1}) {\n case '!':\n /* very dangerous, but sometimes very useful -- be careful */\n $SQL .= $arg;\n break;\n case 'B':\n if ($arg) {\n $SQL .= \"'Y'\";\n } else {\n $SQL .= \"'N'\";\n }\n break;\n case 'C':\n $a = array();\n foreach (explode('.', $arg) as $ident) {\n array_push($a, '`'.$this->_ident($ident).'`');\n }\n $SQL .= implode('.', $a);\n break;\n case 'I':\n $SQL .= '`'.$this->_ident($arg).'`';\n break;\n case 'i':\n $SQL .= $this->_ident($arg);\n break;\n case 'N':\n $SQL .= $this->_numstr($arg);\n break;\n case 'Q':\n //$SQL .= \"'\".mysqli_real_escape_string($arg, $this->_link).\"'\";\n $SQL .= \"'\".mysqli_real_escape_string($this->_link, $arg).\"'\";\n break;\n case 'q':\n //$SQL .= \"'\".mysqli_real_escape_string($arg, $this->_link).\"'\";\n $SQL .= \"'\".mysqli_real_escape_string($this->_link, $arg).\"'\";\n break;\n default:\n Fatal::internalError('Bad mkSQL() format string.');\n }\n }\n $fmt = substr($fmt, $p+2);\n }\n if ($i != $n) {\n Fatal::internalError('Too many arguments to mkSQL().');\n }\n return $SQL;\n }", "public function formatSql($sql)\n {\n // Replace disturbing selected fields by an *\n $sql = preg_replace('/SELECT (.*) FROM/', 'SELECT <span style=\"display: none;\" class=\"select\">$1</span> FROM', $sql);\n\n // Add colors\n $sql = preg_replace('/\\b(SELECT|LIMIT|ASC|COUNT|DESC|IN|LIKE|DISTINCT)\\b/', '<span class=\"sfWebDebugLogInfo\">\\\\1</span>', $sql);\n\n // Add colors and line breaks\n $sql = preg_replace('/\\b(UPDATE|SET|FROM|WHERE|LEFT JOIN|INNER JOIN|RIGHT JOIN|ORDER BY|GROUP BY|DELETE|INSERT|INTO|VALUES)\\b/', '<br/><span class=\"sfWebDebugLogInfo\">\\\\1</span>', $sql);\n \n return $sql;\n }", "function SQLFormat ($query)\r{\r\t$lowercase = array ('select ', ' max', ' min', ' count', ' avg', ' sum',\r\t\t\t\t\t\t'from ', ' as ',\r\t\t\t\t\t\t'join ', \"left \\nJOIN \", \"right \\nJOIN \", \"inner \\nJOIN \", \"outer \\nJOIN \", ' on ',\r\t\t\t\t\t\t'where ', ' like ', ' and ', ' or ',\r\t\t\t\t\t\t'group by ',\r\t\t\t\t\t\t'order by ', ' asc', ' desc', 'ASC, ', 'DESC, ',\r\t\t\t\t\t\t'limit ',\r\t\t\t\t\t\t\"\\n\\n\");\r\t$uppercase = array ('SELECT ', ' MAX', ' MIN', ' COUNT', ' AVG', ' SUM',\r\t\t\t\t\t\t\"\\nFROM \", ' AS ',\r\t\t\t\t\t\t\"\\nJOIN \", \"\\nLEFT JOIN \", \"\\nRIGHT JOIN \", \"\\nINNER JOIN\", \"OUTER JOIN\", \"\\n\\tON \",\r\t\t\t\t\t\t\"\\nWHERE \", ' LIKE ', ' AND ', ' OR ',\r\t\t\t\t\t\t\"\\nGROUP BY \",\r\t\t\t\t\t\t\"\\nORDER BY\\n\\t\", ' ASC', ' DESC', \"ASC,\\n\\t\", \"DESC,\\n\\t\",\r\t\t\t\t\t\t\"\\nLIMIT \",\r\t\t\t\t\t\t\"\\n\");\r\r\treturn str_replace ($lowercase, $uppercase, $query);;\r}", "function convertFromSqlLikeValue($input) {\n $result = $input;\n\n $pattern1a = '/(?<!\\\\\\)(%)/i';\n $result = preg_replace($pattern1a, '*', $result);\n $pattern1b = '/(?<!\\\\\\)(\\_)/i';\n $result = preg_replace($pattern1b, '?', $result);\n\n $pattern2a = '/(\\\\\\%)/i';\n $result = preg_replace($pattern2a, '%', $result);\n $pattern2b = '/(\\\\\\\\_)/i';\n $result = preg_replace($pattern2b, '_', $result);\n\n return $result;\n }", "public function prettySql() {\n\t\t$sql = $this->sql();\n\t\t$sql = preg_replace(\"#([\\w_\\(\\)]+)([ \\t]+)([\\w_\\(\\)]+)#s\", \"$1 $3\", $sql);\n\t\t$sql = str_replace(\" \", \" \", $sql);\n\t\treturn $sql;\n\t}", "public function quoteTable($table)\n\t{\n\t\t// Identifiers are escaped by repeating them\n\t\t$escaped_identifier = $this->_identifier.$this->_identifier;\n\t\tif (is_array($table))\n\t\t{\n\t\t\tlist($table, $alias) = $table;\n\t\t\t$alias = str_replace($this->_identifier, $escaped_identifier, $alias);\n\t\t}\n\n\t\tif ($table instanceof Expression)\n\t\t{\n\t\t\t$table = $table->value();\n\t\t}\n\t\telseif ($table instanceof Query)\n\t\t{\n\t\t\t$table = '('.$table->compile($this).') ';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Convert to a string\n\t\t\t$table = (string) $table;\n\n\t\t\t$table = str_replace($this->_identifier, $escaped_identifier, $table);\n\n\t\t\tif (strpos($table, '.') !== FALSE)\n\t\t\t{\n\t\t\t\t$parts = explode('.', $table);\n\n\t\t\t\tif ($prefix = $this->table_prefix())\n\t\t\t\t{\n\t\t\t\t\t// Get the offset of the table name, last part\n\t\t\t\t\t$offset = count($parts) - 1;\n\n\t\t\t\t\t// Add the table prefix to the table name\n\t\t\t\t\t$parts[$offset] = $prefix.$parts[$offset];\n\t\t\t\t}\n\n\t\t\t\tforeach ($parts as & $part)\n\t\t\t\t{\n\t\t\t\t\t// Quote each of the parts\n\t\t\t\t\t$part = $this->_identifier.$part.$this->_identifier;\n\t\t\t\t}\n\n\t\t\t\t$table = implode('.', $parts);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Add the table prefix\n\t\t\t\t$table = $this->_identifier.$this->table_prefix().$table.$this->_identifier;\n\t\t\t}\n\t\t}\n\n\t\tif (isset($alias))\n\t\t{\n\t\t\t// Attach table prefix to alias\n\t\t\t$table .= ' AS '.$this->_identifier.$this->table_prefix().$alias.$this->_identifier;\n\t\t}\n\n\t\treturn $table;\n\t}", "function setQuery( $sql, $prefix='#__' ) {\n $sql = trim( $sql );\n\n $inQuote = false;\n $escaped = false;\n $quoteChar = '';\n\n $n = strlen( $sql );\n $np = strlen( $prefix );\n $literal = '';\n\n for ($j=0; $j < $n; $j++ ) {\n $c = $sql{$j};\n $test = substr( $sql, $j, $np );\n\n # If not already in a string, look for the start of one.\n if (!$inQuote) {\n if ($c == '\"' || $c == \"'\") {\n $inQuote = true;\n $escaped = false;\n $quoteChar = $c;\n }\n } else {\n # Already in a string, look for end and copy characters.\n if ($c == $quoteChar && !$escaped) {\n $inQuote = false;\n } else if ($c == \"\\\\\" && !$escaped) {\n $escaped = true;\n } else {\n $escaped = false;\n }\n }\n if ($test == $prefix && !$inQuote) {\n $literal .= $this->_table_prefix;\n $j += $np-1;\n } else {\n $literal .= $c;\n }\n }\n $this->_sql = $literal;\n }\n \n /**\n * @return string The current value of the internal SQL vairable\n */\n function getQuery() {\n return \"<pre>\" . htmlspecialchars( $this->_sql ) . \"</pre>\";\n }\n\n /**\n * Execute the query\n * @return mixed A database resource if successful, FALSE if not.\n */\n function query() {\n $this->_errorNum = 0;\n $this->_errorMsg = '';\n $this->_cursor = mysql_query( $this->_sql, $this->_resource );\n if (!$this->_cursor) {\n $this->_errorNum = mysql_errno( $this->_resource );\n $this->_errorMsg = mysql_error( $this->_resource ).\" SQL=$this->_sql\";\n if ($this->_debug) {\n handle_error(mysql_error( $this->_resource ), E_USER_NOTICE);\n }\n return false;\n }\n return $this->_cursor;\n }\n\n\t/**\n\t* Executes a batch of queries within a single transaction\n\t* \n\t* @return the error state\n\t*/\n\tfunction query_batch( $abort_on_error=true, $p_transaction_safe = false) {\n $this->_errorNum = 0;\n $this->_errorMsg = '';\n if ($p_transaction_safe) {\n $si = mysql_get_server_info();\n preg_match_all( \"/(\\d+)\\.(\\d+)\\.(\\d+)/i\", $si, $m );\n if ($m[1] >= 4) {\n $this->_sql = 'START TRANSACTION;' . $this->_sql . '; COMMIT;';\n } else if ($m[2] >= 23 && $m[3] >= 19) {\n $this->_sql = 'BEGIN WORK;' . $this->_sql . '; COMMIT;';\n } else if ($m[2] >= 23 && $m[3] >= 17) {\n $this->_sql = 'BEGIN;' . $this->_sql . '; COMMIT;';\n }\n }\n\n $query_split = preg_split (\"/[;]+/\", $this->_sql);\n $error = 0;\n $counter = 0;\n foreach ($query_split as $command_line) {\n $counter++;\n $command_line = trim( $command_line );\n if ($command_line != '') {\n $this->_cursor = mysql_query( $command_line, $this->_resource );\n if (!$this->_cursor) {\n $error = 1;\n $this->_errorNum .= mysql_errno( $this->_resource ) . ' ';\n $this->_errorMsg .= mysql_error( $this->_resource ).\" SQL=$command_line <br />\";\n\n if ($abort_on_error) {\n handle_error($this->getPrettyErrorMessage());\n return $this->_cursor;\n }\n }\n }\n }\n return $error ? false : true;\n\t}\n\n\t/**\n\t* Diagnostic function\n\t*/\n\tfunction explain() {\n\t\t$temp = $this->_sql;\n\t\t$this->_sql = \"EXPLAIN $this->_sql\";\n\t\t$this->query();\n\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$first = true;\n\n\t\t$buf = \"<table cellspacing=\\\"1\\\" cellpadding=\\\"2\\\" border=\\\"0\\\" bgcolor=\\\"#000000\\\" align=\\\"center\\\">\";\n\t\t$buf .= $this->getQuery();\n\t\twhile ($row = mysql_fetch_assoc( $cur )) {\n\t\t\tif ($first) {\n\t\t\t\t$buf .= \"<tr>\";\n\t\t\t\tforeach ($row as $k=>$v) {\n\t\t\t\t\t$buf .= \"<th bgcolor=\\\"#ffffff\\\">$k</th>\";\n\t\t\t\t}\n\t\t\t\t$buf .= \"</tr>\";\n\t\t\t\t$first = false;\n\t\t\t}\n\t\t\t$buf .= \"<tr>\";\n\t\t\tforeach ($row as $k=>$v) {\n\t\t\t\t$buf .= \"<td bgcolor=\\\"#ffffff\\\">$v</td>\";\n\t\t\t}\n\t\t\t$buf .= \"</tr>\";\n\t\t}\n\t\t$buf .= \"</table><br />&nbsp;\";\n\t\tmysql_free_result( $cur );\n\n\t\t$this->_sql = $temp;\n\n\t\treturn \"<div style=\\\"background-color:#FFFFCC\\\" align=\\\"left\\\">$buf</div>\";\n\t}\n\n\t/**\n\t* @return int The number of rows returned from the most recent query.\n\t*/\n\tfunction getNumRows( $cur=null ) {\n\t\treturn mysql_num_rows( $cur ? $cur : $this->_cursor );\n\t}\n\n\t/**\n\t* This method loads the first field of the first row returned by the query.\n\t*\n\t* @return The value returned in the query or null if the query failed.\n\t*/\n\tfunction loadResult() {\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$ret = null;\n\t\tif ($row = mysql_fetch_row( $cur )) {\n\t\t\t$ret = $row[0];\n\t\t}\n\t\tmysql_free_result( $cur );\n\t\treturn $ret;\n\t}\n\t/**\n\t* Load an array of single field results into an array\n\t*/\n\tfunction loadResultArray($numinarray = 0) {\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$array = array();\n\t\twhile ($row = mysql_fetch_row( $cur )) {\n\t\t\t$array[] = $row[$numinarray];\n\t\t}\n\t\tmysql_free_result( $cur );\n\t\treturn $array;\n\t}\n\t/**\n\t* Load a assoc list of database rows\n\t* @param string The field name of a primary key\n\t* @return array If <var>key</var> is empty as sequential list of returned records.\n\t*/\n\tfunction loadAssocList( $key='' ) {\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$array = array();\n\t\twhile ($row = mysql_fetch_assoc( $cur )) {\n\t\t\tif ($key) {\n\t\t\t\t$array[$row->$key] = $row;\n\t\t\t} else {\n\t\t\t\t$array[] = $row;\n\t\t\t}\n\t\t}\n\t\tmysql_free_result( $cur );\n\t\treturn $array;\n\t}\n\t\n\t/**\n\t* This global function loads the first row of a query into an object\n\t*\n\t* If an object is passed to this function, the returned row is bound to the existing elements of <var>object</var>.\n\t* If <var>object</var> has a value of null, then all of the returned query fields returned in the object.\n\t* @param string The SQL query\n\t* @param object The address of variable\n\t*/\n\tfunction loadObject( &$object ) {\n\t\tif ($object != null) {\n\t\t\tif (!($cur = $this->query())) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ($array = mysql_fetch_assoc( $cur )) {\n\t\t\t\tmysql_free_result( $cur );\n\t\t\t\tmosBindArrayToObject( $array, $object, null, null, false );\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tif ($cur = $this->query()) {\n\t\t\t\tif ($object = mysql_fetch_object( $cur )) {\n\t\t\t\t\tmysql_free_result( $cur );\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\t$object = null;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t/**\n\t* Load a list of database objects\n\t* @param string The field name of a primary key\n\t* @return array If <var>key</var> is empty as sequential list of returned records.\n\t* If <var>key</var> is not empty then the returned array is indexed by the value\n\t* the database key. Returns <var>null</var> if the query fails.\n\t*/\n\tfunction loadObjectList( $key='' ) {\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$array = array();\n\t\twhile ($row = mysql_fetch_object( $cur )) {\n\t\t\tif ($key) {\n\t\t\t\t$array[$row->$key] = $row;\n\t\t\t} else {\n\t\t\t\t$array[] = $row;\n\t\t\t}\n\t\t}\n\t\tmysql_free_result( $cur );\n\t\treturn $array;\n\t}\n\t\n\t/**\n\t* @return The first row of the query.\n\t*/\n\tfunction loadRow() {\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$ret = null;\n\t\tif ($row = mysql_fetch_row( $cur )) {\n\t\t\t$ret = $row;\n\t\t}\n\t\tmysql_free_result( $cur );\n\t\treturn $ret;\n\t}\n\t/**\n\t* Load a list of database rows (numeric column indexing)\n\t* @param string The field name of a primary key\n\t* @return array If <var>key</var> is empty as sequential list of returned records.\n\t* If <var>key</var> is not empty then the returned array is indexed by the value\n\t* the database key. Returns <var>null</var> if the query fails.\n\t*/\n\tfunction loadRowList( $key='' ) {\n\t\tif (!($cur = $this->query())) {\n\t\t\treturn null;\n\t\t}\n\t\t$array = array();\n\t\twhile ($row = mysql_fetch_array( $cur )) {\n\t\t\tif ($key) {\n\t\t\t\t$array[$row[$key]] = $row;\n\t\t\t} else {\n\t\t\t\t$array[] = $row;\n\t\t\t}\n\t\t}\n\t\tmysql_free_result( $cur );\n\t\treturn $array;\n\t}\n\t/**\n\t* Document::db_insertObject()\n\t*\n\t* { Description }\n\t*\n\t* @param [type] $keyName\n\t* @param [type] $verbose\n\t*/\n\tfunction insertObject( $table, &$object, $keyName = NULL, $verbose=false ) {\n\t\t$fmtsql = \"INSERT INTO $table ( %s ) VALUES ( %s ) \";\n\t\t$fields = array();\n\t\t\n\t\tforeach (get_object_vars( $object ) as $k => $v) {\n\n\t\t\tif (is_array($v) or is_object($v)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($k[0] == '_') { // internal field\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$fields[] = \"`$k`\";\n\t\t\t$values[] = \"'\" . $this->getEscaped( $v ) . \"'\";\n\t\t}\n\t\t$sSQL = sprintf( $fmtsql, implode( \",\", $fields ) , implode( \",\", $values ) ) ;\n\t\t$this->setQuery($sSQL);\n\t\t($verbose) && print \"$sql<br />\\n\";\n\t\tif (!$this->query()) {\n\t\t\treturn false;\n\t\t}\n\t\t$id = mysql_insert_id();\n\t\t($verbose) && print \"id=[$id]<br />\\n\";\n\t\tif ($keyName && $id) {\n\t\t\t$object->$keyName = $id;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t* Document::db_updateObject()\n\t*\n\t* { Description }\n\t*\n\t* @param [type] $updateNulls\n\t*/\n\tfunction updateObject( $table, &$object, $keyName, $updateNulls=true ) {\n\t\t$fmtsql = \"UPDATE $table SET %s WHERE %s\";\n\t\t$tmp = array();\n\t\tforeach (get_object_vars( $object ) as $k => $v) {\n\t\t\tif( is_array($v) or is_object($v) or $k[0] == '_' ) { // internal or NA field\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif( $k == $keyName ) { // PK not to be updated\n\t\t\t\t$where = \"$keyName='\" . $this->getEscaped( $v ) . \"'\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($v === NULL && !$updateNulls) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif( $v == '' ) {\n\t\t\t\t$val = \"''\";\n\t\t\t} else {\n\t\t\t\t$val = \"'\" . $this->getEscaped( $v ) . \"'\";\n\t\t\t}\n\t\t\t$tmp[] = \"`$k`=$val\";\n\t\t}\n\t\t$this->setQuery( sprintf( $fmtsql, implode( \",\", $tmp ) , $where ) );\n\t\treturn $this->query();\n\t}\n\n\t/**\n\t* @param boolean If TRUE, displays the last SQL statement sent to the database\n\t* @return string A standised error message\n\t*/\n\tfunction stderr( $showSQL = false ) {\n\t\treturn \"DB function failed with error number $this->_errorNum\"\n\t\t.\"<br /><font color=\\\"red\\\">$this->_errorMsg</font>\"\n\t\t.($showSQL ? \"<br />SQL = <pre>$this->_sql</pre>\" : '');\n\t}\n\n\tfunction show_error($class){\n\t\t$msg = $this->stderr(true);\n\t\tdebug(\"[ERROR]\");\n\t\tdebug(\"[class]$class\");\n\t\tdebug(\"[database error number]\" . $this->_errorNum);\n\t\tdebug(\"[database error messsage]\" . $this->_errorMsg);\n\t\tdebug(\"[last sql]\" . $this->_sql);\n\t}\n\t\t\n\tfunction insertid()\n\t{\n\t\treturn mysql_insert_id();\n\t}\n\n\tfunction getVersion()\n\t{\n\t\treturn mysql_get_server_info();\n\t}\n\n\t/**\n\t* Fudge method for ADOdb compatibility\n\t*/\n\tfunction GenID( $foo1=null, $foo2=null ) {\n\t\treturn '0';\n\t}\n\t/**\n\t* @return array A list of all the tables in the database\n\t*/\n\tfunction getTableList() {\n\t\t$this->setQuery( 'SHOW tables' );\n\t\t$this->query();\n\t\treturn $this->loadResultArray();\n\t}\n\t/**\n\t* @param array A list of table names\n\t* @return array A list the create SQL for the tables\n\t*/\n\tfunction getTableCreate( $tables ) {\n\t\t$result = array();\n\n\t\tforeach ($tables as $tblval) {\n\t\t\t$this->setQuery( 'SHOW CREATE table ' . $tblval );\n\t\t\t$this->query();\n\t\t\t$result[$tblval] = $this->loadResultArray( 1 );\n\t\t}\n\n\t\treturn $result;\n\t}\n\t/**\n\t* @param array A list of table names\n\t* @return array An array of fields by table\n\t*/\n\tfunction getTableFields( $tables ) {\n\t\t$result = array();\n\n\t\tforeach ($tables as $tblval) {\n\t\t\t$this->setQuery( 'SHOW FIELDS FROM ' . $tblval );\n\t\t\t$this->query();\n\t\t\t$fields = $this->loadObjectList();\n\t\t\tforeach ($fields as $field) {\n\t\t\t\t$result[$tblval][$field->Field] = preg_replace(\"/[(0-9)]/\",'', $field->Type );\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}\n\n\n\tpublic function schema_version_okay(){\n return (Setting::get(\"db_schema_version\") == DATABASE_SCHEMA_VERSION);\n\t}\n\t\n\t/**\n\t * upgrades the database to the required schema\n\t * @return boolean the success of the opetation\n\t */\n\tpublic function execute_db_install_step($schema_to_install){\n $file_name = dirname(__FILE__) . \"/../../database/upgrade_to_$schema_to_install.sql\";\n return $this->execute_db_file($file_name, $schema_to_install);\n\t}\n\n\tpublic function execute_db_uninstall_step($schema_to_install){\n $file_name = dirname(__FILE__) . \"/../../database/downgrade_to_$schema_to_install.sql\";\n return $this->execute_db_file($file_name, $schema_to_install);\n\t}\n\n\t/**\n\t * This function will execute as a query batch the SQL contained in an\n\t * upgrade or down grade file. These files are found in the /db folder\n\t * @param $file_name String the absolute path to the file to execute\n\t * @param $new_version the version number that the databse schema will be if the file exwecutes correctly.\n\t * @return Boolean the success status\n\t */\n\tprivate function execute_db_file($file_name, $new_version){\n if (!file_exists($file_name)){\n return false;\n }\n\n $file = fopen( $file_name,\"r+\");\n $size = filesize($file_name);\n\t\tif ($size == 0){\n \t Setting::put(\"db_schema_version\", $new_version );\n return true;\n\t\t}\n\t\t$SQL = fread($file,$size);\n\t\t$this->setQuery ( $SQL );\n if ($this->query_batch()){\n Setting::put(\"db_schema_version\", $new_version );\n return true;\n }\n\t\telse{\n handle_error($this->getPrettyErrorMessage() . \" cannot execute $SQL\");\n return false;\n\t\t}\n\t}\n\n\tpublic function upgrade_to_db_schema_version(){\n\t\tdebug(\"upgrade to db schema version \");\n\n\t\t$schema_version = Setting::get(\"db_schema_version\");\n\t\tif ($schema_version==NULL){\n $schema_to_install = 0;\n\t\t}\n\t\telse{\n $schema_to_install = $schema_version + 1;\n\t\t}\n\n\t\twhile ($schema_to_install<=DATABASE_SCHEMA_VERSION){\n $this->execute_db_install_step($schema_to_install);\n $schema_to_install = Setting::get(\"db_schema_version\") + 1;\n\t\t}\n\t}\n\n\t/**\n\t * Determins from the settings if the database has been installed corerctly.\n\t *\n\t * @return Boolean true if the database is installed to the correct version\n\t */\n\tpublic static function database_installed(){\n if (Setting::get(\"db_schema_version\")==NULL){\n return false;\n }\n if (Setting::get(\"db_schema_version\")!= DATABASE_SCHEMA_VERSION){\n return false;\n }\n return true;\n\t}\n\n\n\n\n}", "public function quote_table($value)\n {\n // Assign the table by reference from the value\n if (is_array($value))\n {\n $table =& $value[0];\n\n // Attach table prefix to alias\n $value[1] = $this->table_prefix($value[1]);\n }\n else\n {\n $table =& $value;\n }\n\n // deal with the sub-query objects first\n //if ($table instanceof Database_Query)\n //{\n //// Create a sub-query\n //$table = '('.$table->compile($this).')';\n //}\n if (is_string($table))\n {\n if (strpos($table, '.') === false)\n {\n // Add the table prefix for tables\n $table = $this->quote_identifier($this->table_prefix($table));\n }\n else\n {\n // Split the identifier into the individual parts\n $parts = explode('.', $table);\n\n if ($prefix = $this->table_prefix())\n {\n // Get the offset of the table name, 2nd-to-last part\n // This works for databases that can have 3 identifiers (Postgre)\n if (($offset = count($parts)) == 2)\n {\n $offset = 1;\n }\n else\n {\n $offset = $offset - 2;\n }\n\n // Add the table prefix to the table name\n $parts[$offset] = $this->table_prefix($parts[$offset]);\n }\n\n // Quote each of the parts\n $table = implode('.', array_map(array($this, 'quote_identifier'), $parts));\n }\n }\n\n // process the alias if present\n if (is_array($value))\n {\n // Separate the column and alias\n list($value, $alias) = $value;\n\n return $value.' AS '.$this->quote_identifier($alias);\n }\n else\n {\n // return the value\n return $value;\n }\n }", "private function buildQuery(): void\n {\n $this->query = self::CREATE_TABLE;\n\n if ($this->ifNotExists) {\n $this->query .= self::IF_NOT_EXISTS;\n }\n\n $this->query .= $this->table . self::OPENING_BRACKET;\n\n $this->query .= join(', ', $this->columns);\n\n if (!empty($this->keys)) {\n $this->query .= ',' . join(',', $this->keys);\n }\n\n $this->query .= self::CLOSING_BRACKET;\n\n if (!empty($this->engine)) {\n $this->query .= self::ENGINE . $this->engine;\n }\n\n if (!empty($this->charset)) {\n $this->query .= self::CHARSET . $this->charset;\n }\n }", "static function generalizeSQL( $sql ) {\n\t\t# This does the same as the regexp below would do, but in such a way\n\t\t# as to avoid crashing php on some large strings.\n\t\t# $sql = preg_replace( \"/'([^\\\\\\\\']|\\\\\\\\.)*'|\\\"([^\\\\\\\\\\\"]|\\\\\\\\.)*\\\"/\", \"'X'\", $sql );\n\n\t\t$sql = str_replace( \"\\\\\\\\\", '', $sql );\n\t\t$sql = str_replace( \"\\\\'\", '', $sql );\n\t\t$sql = str_replace( \"\\\\\\\"\", '', $sql );\n\t\t$sql = preg_replace( \"/'.*'/s\", \"'X'\", $sql );\n\t\t$sql = preg_replace( '/\".*\"/s', \"'X'\", $sql );\n\n\t\t# All newlines, tabs, etc replaced by single space\n\t\t$sql = preg_replace( '/\\s+/', ' ', $sql );\n\n\t\t# All numbers => N\n\t\t$sql = preg_replace( '/-?\\d+(,-?\\d+)+/s', 'N,...,N', $sql );\n\t\t$sql = preg_replace( '/-?\\d+/s', 'N', $sql );\n\n\t\treturn $sql;\n\t}", "private function split_sql_file($sql, $delimiter)\n {\n // Split up our string into \"possible\" SQL statements.\n $tokens = explode($delimiter, $sql);\n \n // try to save mem.\n $sql = \"\";\n $output = array();\n \n // we don't actually care about the matches preg gives us.\n $matches = array();\n \n // this is faster than calling count($oktens) every time thru the loop.\n $token_count = count($tokens);\n for ($i = 0; $i < $token_count; $i++)\n {\n // Don't wanna add an empty string as the last thing in the array.\n if (($i != ($token_count - 1)) || (strlen($tokens[$i] > 0)))\n {\n // This is the total number of single quotes in the token.\n $total_quotes = preg_match_all(\"/'/\", $tokens[$i], $matches);\n // Counts single quotes that are preceded by an odd number of backslashes,\n // which means they're escaped quotes.\n $escaped_quotes = preg_match_all(\"/(?<!\\\\\\\\)(\\\\\\\\\\\\\\\\)*\\\\\\\\'/\", $tokens[$i], $matches);\n \n $unescaped_quotes = $total_quotes - $escaped_quotes;\n \n // If the number of unescaped quotes is even, then the delimiter did NOT occur inside a string literal.\n if (($unescaped_quotes % 2) == 0)\n {\n // It's a complete sql statement.\n $output[] = $tokens[$i];\n // save memory.\n $tokens[$i] = \"\";\n }\n else\n {\n // incomplete sql statement. keep adding tokens until we have a complete one.\n // $temp will hold what we have so far.\n $temp = $tokens[$i] . $delimiter;\n // save memory..\n $tokens[$i] = \"\";\n \n // Do we have a complete statement yet?\n $complete_stmt = false;\n \n for ($j = $i + 1; (!$complete_stmt && ($j < $token_count)); $j++)\n {\n // This is the total number of single quotes in the token.\n $total_quotes = preg_match_all(\"/'/\", $tokens[$j], $matches);\n // Counts single quotes that are preceded by an odd number of backslashes,\n // which means they're escaped quotes.\n $escaped_quotes = preg_match_all(\"/(?<!\\\\\\\\)(\\\\\\\\\\\\\\\\)*\\\\\\\\'/\", $tokens[$j], $matches);\n \n $unescaped_quotes = $total_quotes - $escaped_quotes;\n \n if (($unescaped_quotes % 2) == 1)\n {\n // odd number of unescaped quotes. In combination with the previous incomplete\n // statement(s), we now have a complete statement. (2 odds always make an even)\n $output[] = $temp . $tokens[$j];\n \n // save memory.\n $tokens[$j] = \"\";\n $temp = \"\";\n \n // exit the loop.\n $complete_stmt = true;\n // make sure the outer loop continues at the right point.\n $i = $j;\n }\n else\n {\n // even number of unescaped quotes. We still don't have a complete statement.\n // (1 odd and 1 even always make an odd)\n $temp .= $tokens[$j] . $delimiter;\n // save memory.\n $tokens[$j] = \"\";\n }\n \n } // for..\n } // else\n }\n }\n \n return $output;\n }", "function dbprep() {\n global $kProtectFunction, $kFormatOptions, $kDebugQueries;\n\n\t$args = func_get_args();\n\t$format = array_shift($args);\n\n\t// generate final query\n\tif (empty($args)) {\n\t\t$format = str_replace(\"%%\", \"%\", $format);\n\t\t$query = $format;\n } else if (empty($kFormatOptions)) {\n $asargs = array_map($kProtectFunction, $args); // protect arguments\n $query = vsprintf($format, $asargs);\n\t} else {\n $format = str_replace(\"%%\", PERCENT_PLACEHOLDER, $format);\n if ($kDebugQueries) {\n $format = dbtestquery($format, $args);\n }\n\n $specs = preg_match_all(\"/%[${kFormatOptions}]/\", $format, $matches);\n $asargs = array_map($kProtectFunction, $matches[0], $args); // protect arguments\n\t\t$allspecs = array_map('prefixPercent', str_split($kFormatOptions));\n\t\t$format = vsprintf(str_replace($allspecs, \"%s\", $format), $asargs);\n\t\t$query = str_replace(PERCENT_PLACEHOLDER, \"%\", $format);\n }\n \n\treturn $query;\n}", "public function toInterpolatedSql() {\n $query = $this->toSql();\n $params = $this->values;\n\n $keys = array();\n $values = $params;\n\n # build a regular expression for each parameter\n foreach ($params as $key => $value) {\n if (is_string($key)) {\n $keys[] = '/:'.$key.'/';\n } else {\n $keys[] = '/[?]/';\n }\n\n if (is_string($value))\n $values[$key] = \"'\" . self::quoteValue($value) . \"'\";\n\n if (is_array($value))\n $values[$key] = \"'\" . implode(\"','\", self::quoteValue($value)) . \"'\";\n\n if (is_null($value))\n $values[$key] = 'NULL';\n }\n\n $query = preg_replace($keys, $values, $query, 1, $count);\n\n return $query;\n }", "public function testMakeSQLUnsafe()\n {\n $string = '`databaseName`.`tableName`.`more`';\n\n $result = $this->testObject->makeSQLUnsafe($string);\n\n $this->assertEquals('databaseName.tableName.more', $result);\n }", "function getSQL(?GrammarInterface $grammar): string {\n if($grammar !== null) {\n $table = $grammar->quoteTable($this->table->getTable());\n \n $alias = $this->table->getAlias();\n if(!empty($alias)) {\n $table .= ' AS '.$alias;\n }\n } else {\n $table = $this->table;\n }\n \n $ons = (\n !empty($this->ons) ?\n ' ON '.\\implode(' AND ', $this->ons) :\n ''\n );\n \n return ($this->type ? $this->type.' ' : '').'JOIN '.$table.$ons;\n }", "public static function removeTableCurlyBraces ($qry, $fromTables = true) {\n\t\t\tif (is_array($fromTables)) {\n\t\t\t\t$qry = preg_replace('/([^_])({)(' . implode('|', $fromTables) . ')(})([^_]|$)/', '$1$3$5', $qry);\n\t\t\t}\n\t\t\t# Remove braces from ALL table names... TODO\n\t\t\telse {\n\t\t\t\n\t\t\t}\n\n\t\t\treturn $qry;\n\t\t}", "private function Sql($term) {\r\n $query = trim($term);\r\n $query = trim(preg_replace(\"/(\\\\s+)+/\", \" \", $query));\r\n $keywords = array_unique(explode(' ', $query));\r\n\r\n // Array containing a list of all field names\r\n $all = array();\r\n // Get a full list of field names\r\n foreach($this->config as $item) {\r\n $all = array_merge($all, array_keys($item['select']));\r\n }\r\n $all = array_unique($all);\r\n // Generate the SQL\r\n $unions = array();\r\n $params = array();\r\n foreach($this->config as $table => $item) {\r\n $selects = array('? AS `__table`');\r\n $params[] = $table;\r\n $ifs = array();\r\n // Select clause\r\n foreach($all as $fieldName) {\r\n if (!array_key_exists($fieldName, $item['select'])) {\r\n $selects[] = sprintf('NULL AS `%s`', $fieldName);\r\n continue;\r\n } elseif (empty($item['select'][$fieldName]['subquery'])) {\r\n $selects[] = sprintf('`%s`', $fieldName);\r\n } else {\r\n $selects[] = sprintf('(%s) AS `%s`', $item['select'][$fieldName]['subquery'], $fieldName);\r\n $params = array_merge($params, $item['select'][$fieldName]['params']);\r\n }\r\n }\r\n foreach($all as $fieldName) {\r\n // Search score\r\n if (!array_key_exists($fieldName, $item['index'])) continue;\r\n if (empty($item['select'][$fieldName]['subquery'])) {\r\n // Exact match\r\n $ifs[] = \"IF(LOWER(`{$fieldName}`) = LOWER(?), ?, 0)\";\r\n $params[] = $query;\r\n $params[] = $item['index'][$fieldName]['exactWeight'];\r\n // Matching full occurrences\r\n if (count($keywords) > 1) {\r\n $ifs[] = \"IF(LOWER(`{$fieldName}`) LIKE LOWER(?), ROUND((LENGTH(`{$fieldName}`) - LENGTH(REPLACE(LOWER(`{$fieldName}`), LOWER(?), ''))) / LENGTH(?)) * ?, 0)\";\r\n $params[] = '%' . $query . '%';\r\n $params[] = $query;\r\n $params[] = $query;\r\n $params[] = $item['index'][$fieldName]['fullWeight'];\r\n }\r\n // Matching keywords\r\n foreach($keywords as $kw) {\r\n if (strlen($kw) < $this->minWordLength) continue;\r\n $ifs[] = \"IF(LOWER(`{$fieldName}`) LIKE LOWER(?), ROUND((LENGTH(`{$fieldName}`) - LENGTH(REPLACE(LOWER(`{$fieldName}`), LOWER(?), ''))) / LENGTH(?)) * ?, 0)\";\r\n $params[] = '%' . $kw . '%';\r\n $params[] = $kw;\r\n $params[] = $kw;\r\n $params[] = $item['index'][$fieldName]['wordWeight'];\r\n }\r\n } else {\r\n // Exact match\r\n $subquery = sprintf('(%s)', $item['select'][$fieldName]['subquery']);\r\n $subparams = $item['select'][$fieldName]['params'];\r\n $ifs[] = \"IF(LOWER({$subquery}) = LOWER(?), ?, 0)\";\r\n $params = array_merge($params, $subparams);\r\n $params[] = $query;\r\n $params[] = $item['index'][$fieldName]['exactWeight'];\r\n // Matching full occurrences\r\n if (count($keywords) > 1) {\r\n $ifs[] = \"IF(LOWER({$subquery}) LIKE LOWER(?), ROUND((LENGTH({$subquery}) - LENGTH(REPLACE(LOWER({$subquery}), LOWER(?), ''))) / LENGTH(?)) * ?, 0)\";\r\n $params = array_merge($params, $subparams);\r\n $params[] = '%' . $query . '%';\r\n $params = array_merge($params, $subparams);\r\n $params = array_merge($params, $subparams);\r\n $params[] = $query;\r\n $params[] = $query;\r\n $params[] = $item['index'][$fieldName]['fullWeight'];\r\n }\r\n // Matching keywords\r\n foreach($keywords as $kw) {\r\n if (strlen($kw) < $this->minWordLength) continue;\r\n $ifs[] = \"IF(LOWER({$subquery}) LIKE LOWER(?), ROUND((LENGTH({$subquery}) - LENGTH(REPLACE(LOWER({$subquery}), LOWER(?), ''))) / LENGTH(?)) * ?, 0)\";\r\n $params = array_merge($params, $subparams);\r\n $params[] = '%' . $kw . '%';\r\n $params = array_merge($params, $subparams);\r\n $params = array_merge($params, $subparams);\r\n $params[] = $kw;\r\n $params[] = $kw;\r\n $params[] = $item['index'][$fieldName]['wordWeight'];\r\n }\r\n }\r\n }\r\n $unions[] = sprintf('SELECT %s, %s AS `__score` FROM `%s`', implode(', ', $selects), (empty($ifs) ? '0' : implode(' + ', $ifs)), $table);\r\n }\r\n $this->sql[$term] = implode(' UNION ', $unions);\r\n $this->params = $params;\r\n }", "private function escapeColumn($name)\n {\n if (strpos($name, '.') || strpos($name, '`') || strpos($name, ' ')) {\n return $name;\n }\n\n if ($name == '*') {\n return $name;\n }\n\n return '`'.$name.'`';\n }", "public function prepareQuery($sql) {\n if (preg_match('/^\\s*DELETE\\s+FROM\\s+(\\S+)\\s*$/i', $sql)) {\n $sql = preg_replace(\"/^\\s*DELETE\\s+FROM\\s+(\\S+)\\s*$/\", \"DELETE FROM \\\\1 WHERE 1=1\", $sql);\n }\n return $sql;\n }" ]
[ "0.5838375", "0.5506034", "0.5498252", "0.54760414", "0.5445395", "0.5441685", "0.54333884", "0.5386416", "0.53666127", "0.53258586", "0.52970165", "0.5236013", "0.5233338", "0.52088076", "0.5185712", "0.5136085", "0.51125807", "0.5102178", "0.5034042", "0.5000333", "0.4988714", "0.49727538", "0.49671134", "0.49514085", "0.49456608", "0.49406242", "0.4925699", "0.49251577", "0.49173886", "0.4909508" ]
0.58024436
1
Render cart totals xml
protected function _toHtml() { /** @var $totalsXmlObj Mage_XmlConnect_Model_Simplexml_Element */ $totalsXmlObj = Mage::getModel('xmlconnect/simplexml_element', '<totals></totals>'); foreach ($this->getQuote()->getTotals() as $total) { $code = $total->getCode(); if ($code == 'giftwrapping') { continue; } $title = ''; $value = null; $renderer = $this->_getTotalRenderer($code)->setTotal($total); switch ($code) { case 'subtotal': if ($renderer->displayBoth()) { $title = $this->__('Subtotal (Excl. Tax)'); $this->_addTotalDataToXmlObj( $totalsXmlObj, $code . '_excl_tax', $title, $total->getValueExclTax() ); $code = $code . '_incl_tax'; $title = $this->__('Subtotal (Incl. Tax)'); $value = $total->getValueInclTax(); } break; case 'shipping': if ($renderer->displayBoth()) { $title = $renderer->getExcludeTaxLabel(); $this->_addTotalDataToXmlObj( $totalsXmlObj, $code . '_excl_tax', $title, $renderer->getShippingExcludeTax() ); $code = $code . '_incl_tax'; $title = $renderer->getIncludeTaxLabel(); $value = $renderer->getShippingIncludeTax(); } else if ($renderer->displayIncludeTax()) { $value = $renderer->getShippingIncludeTax(); } else { $value = $renderer->getShippingExcludeTax(); } break; case 'grand_total': $grandTotalExlTax = $renderer->getTotalExclTax(); $displayBoth = $renderer->includeTax() && $grandTotalExlTax >= 0; if ($displayBoth) { $title = $this->__('Grand Total (Excl. Tax)'); $this->_addTotalDataToXmlObj( $totalsXmlObj, $code . '_excl_tax', $title, $grandTotalExlTax ); $code = $code . '_incl_tax'; $title = $this->__('Grand Total (Incl. Tax)'); } break; case 'giftwrapping': foreach ($renderer->getValues() as $title => $value) { $this->_addTotalDataToXmlObj($totalsXmlObj, $code, $title, $value); } continue 2; case 'giftcardaccount': $cards = $renderer->getTotal()->getGiftCards(); if (!$cards) { $cards = $renderer->getQuoteGiftCards(); } if ($renderer->getTotal()->getValue()) { foreach ($cards as $cardCode) { $title = $this->__('Gift Card (%s)', $cardCode['c']); $value = $cardCode['c']; $totalXmlObj = $totalsXmlObj->addChild($code); $totalXmlObj->addChild('title', $totalsXmlObj->escapeXml($title)); $totalXmlObj->addChild('value', $value); $value = Mage::helper('xmlconnect')->formatPriceForXml($cardCode['a']); $formattedValue = $this->getQuote()->getStore()->formatPrice($value, false); $totalXmlObj->addChild('formated_value', '-' . $formattedValue); } } continue 2; default: break; } if (empty($title)) { $title = $total->getTitle(); } if (null === $value) { $value = $total->getValue(); } if (null !== $value) { $this->_addTotalDataToXmlObj($totalsXmlObj, $code, $title, $value); } } return $this->getReturnObjectFlag() ? $totalsXmlObj : $totalsXmlObj->asNiceXml(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCartHtml()\n\t{\n\t\t$cart = $this->cart->contents();\n\t\t$cart['cnt_items'] = count($cart['products']);\n\t\t\n\t\t$user = $this->data['user'];\n\t\t\n\t\t$total = 0;\n\t\t\n\t\t$html = '';\n\t\tif ( ! count($cart['products'])){\n\t\t\t$html .= '\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-3\"></div>\n\t\t\t\t<div class=\"col-3 center\">\n\t\t\t\t\t<h2 class=\"center\">Ваша корзина пуста.</h2>\n\t\t\t\t\t<a class=\"btn btn-white\" href=\"/\">&larr; продолжить покупки</a>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"col-3\"></div>\n\t\t\t</div>';\n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t\t$html .= '\n\t\t\t<ul class=\"cart-list\" data-cart=\"items\">';\n\t\t\tforeach (array_reverse($cart['products']) as $k=>$i){\n\t\t\t\t$html .= '\n\t\t\t\t<li data-cart-item=\"\">\n\t\t\t\t\t<div class=\"ci-box\">\n\t\t\t\t\t\t<div class=\"pp-block-image\">\n\t\t\t\t\t\t\t<a href=\"'. htmlspecialchars($i['_url']) .'\">\n\t\t\t\t\t\t\t\t<img src=\"'.htmlspecialchars($i['image']) .'\" alt=\"'.htmlspecialchars($i['name']).'\">\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"pp-block-price\">\n\t\t\t\t\t\t\t<div class=\"gd gd-name\"><a class=\"c-pink\" href=\"'. htmlspecialchars($i['_url']) .'\">'. $i['name'] .'</a></div>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div class=\"gd gd-manufacturer\">Производитель: '. (isset($i['manufacturer']) ? $i['manufacturer'] : '&mdash;') .'</div>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($i['prices']){\n\t\t\t\t\t\t\t$cnt_opt = isset($i['prices']['cnt_opt']) ? $i['prices']['cnt_opt'] : '';\n\t\t\t\t\t\t\t$cnt_roz = isset($i['prices']['cnt_roz']) ? $i['prices']['cnt_roz'] : '';\n\t\t\t\t\t\t\t$html .= '\n\t\t\t\t\t\t\t<div class=\"gd gd-size\">Размер: '. $i['prices']['name'] .' ('. $i['prices']['prefix'] .')</div>\n\t\t\t\t\t\t\t<div class=\"gd gd-packing\">Упаковка: '. ($i['options']['type'] ? 'опт - '.($cnt_opt) : 'розница - '.($cnt_roz)) .' шт.</div>';\t\t\n\t\t\t\t\t\t\tunset($cnt_opt);\n\t\t\t\t\t\t\tunset($cnt_roz);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$html .= '\n\t\t\t\t\t\t\t<div class=\"gd gd-price\">\n\t\t\t\t\t\t\t\tЦена:';\n\t\t\t\t\t\t\t\tif ($i['discount']*1){\n\t\t\t\t\t\t\t\t$html .= '\n\t\t\t\t\t\t\t\t<span class=\"gd-new-price\">'. number_format(($i['price']-($i['price']*$i['discount']/100)), 2, ',', \"'\") .' грн.</span>';\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$html .= '\n\t\t\t\t\t\t\t\t<span class=\"gd-new-price\">'. number_format($i['price'], 2, ',', \"'\") .' грн.</span>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$html .= '\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div class=\"gd gd-qty\">Количество: <b>&times;</b> '. $i['qty'] .'</div>\n\n\t\t\t\t\t\t\t<div class=\"gd gd-subtotal\">\n\t\t\t\t\t\t\t\tСумма: ';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t# скидка User\n\t\t\t\t\t\t\t\t$discount = isset($user->discount) ? $user->discount*1 : 0;\n\t\t\t\t\t\t\t\t# если нет цена + размер\n\t\t\t\t\t\t\t\tif ( ! $i['prices']){\n\t\t\t\t\t\t\t\t\t# если USER скидка больше чем скидка на товар\n\t\t\t\t\t\t\t\t\tif ($discount > $i['discount']*1){\n\t\t\t\t\t\t\t\t\t\t$summa = $i['qty'] * $i['price'];\n\t\t\t\t\t\t\t\t\t\t$html .= number_format($summa, 2, ',', \"'\").' грн.';\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$summa = $i['qty'] * ($i['price'] - round($i['price'] * $i['discount']/ 100, 2));\n\t\t\t\t\t\t\t\t\t\t$html .= number_format($summa, 2, ',', \"'\").' грн.';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t# если USER скидка больше чем скидка на товар\n\t\t\t\t\t\t\t\t\tif ($discount > $i['discount']){\n\t\t\t\t\t\t\t\t\t\tif ($i['options']['type'] == 0){\n\t\t\t\t\t\t\t\t\t\t\t$roz = isset($i['prices']['roz']) ? $i['prices']['roz'] : 0;\n\t\t\t\t\t\t\t\t\t\t\t$summa = round($i['qty'] * $roz, 2);\n\t\t\t\t\t\t\t\t\t\t\t$html .= number_format($summa, 2, ',', \"'\").' грн.';\n\t\t\t\t\t\t\t\t\t\t\tunset($roz);\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t$opt = isset($i['prices']['opt']) ? $i['prices']['opt'] : 0;\n\t\t\t\t\t\t\t\t\t\t\t$summa = round($i['qty'] * $opt, 2);\n\t\t\t\t\t\t\t\t\t\t\t$html .= number_format($summa, 2, ',', \"'\").' грн.';\n\t\t\t\t\t\t\t\t\t\t\tunset($opt);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\tif ($i['options']['type'] == 0){\n\t\t\t\t\t\t\t\t\t\t\t$roz = isset($i['prices']['roz']) ? $i['prices']['roz'] : 0;\n\t\t\t\t\t\t\t\t\t\t\t$summa = $i['qty'] * ($roz - round($roz * $i['discount']/ 100, 2));\n\t\t\t\t\t\t\t\t\t\t\t$html .= number_format($summa, 2, ',', \"'\").' грн.';\n\t\t\t\t\t\t\t\t\t\t\tunset($roz);\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t$opt = isset($i['prices']['opt']) ? $i['prices']['opt'] : 0;\n\t\t\t\t\t\t\t\t\t\t\t$summa = $i['qty'] * ($opt - round($opt * $i['discount']/ 100, 2));\n\t\t\t\t\t\t\t\t\t\t\t$html .= number_format($summa, 2, ',', \"'\").' грн.';\n\t\t\t\t\t\t\t\t\t\t\tunset($opt);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$html .= '\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div class=\"gd-counted\">\n\t\t\t\t\t\t\t\t<div class=\"quant\">\n\t\t\t\t\t\t\t\t\t<button data-quantity-button=\"minus\" class=\"quant-button minus\"><span>−</span></button>\n\t\t\t\t\t\t\t\t\t<input class=\"quant-box\" type=\"text\" name=\"quantity['. $k .']\" value=\"'. $i['qty'] .'\" data-quantity=\"box\" autocomplete=\"off\">\n\t\t\t\t\t\t\t\t\t<button data-quantity-button=\"plus\" class=\"quant-button plus\"><span>+</span></button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<div class=\"gd-counted\" data-btn=\"update\" style=\"display:none;\">\n\t\t\t\t\t\t\t\t<button class=\"btn btn-pink\" type=\"submit\">Пересчитать</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t<a class=\"gd gd-delete uppercase\" data-cart-delete=\"'. $k .'\" href=\"/cart?del='. $k .'\">Удалить</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>';\n\t\t\t\t\n\t\t\t\t$total += $summa; \n\t\t\t}\n\t\t\t\t$html .= '\n\t\t\t\t<li>\n\t\t\t\t\t<div class=\"gd-total\">\n\t\t\t\t\t\t<div class=\"gd-label\">\n\t\t\t\t\t\t\t<div class=\"gd-label-name\">Всего:</div>\n\t\t\t\t\t\t\t<div class=\"gd-label-box\" data-cart=\"subtotal\">'. number_format($total, 2, ',', \"'\") .' грн.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"gd-label\">\n\t\t\t\t\t\t\t<div class=\"gd-label-name\">Ваша скидка:</div>\n\t\t\t\t\t\t\t<div class=\"gd-label-box\" data-cart=\"discount\">'. $discount .' %</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"gd-label\">\n\t\t\t\t\t\t\t<div class=\"gd-label-name\">Итого:</div>\n\t\t\t\t\t\t\t<div class=\"gd-label-box\" data-cart=\"total\">';\n\t\t\t\t\t\t\tif ($discount){\n\t\t\t\t\t\t\t\t$total = 0;\n\t\t\t\t\t\t\t\tforeach ($cart['products'] as $k){\n\t\t\t\t\t\t\t\t\t# какая скидка больше\n\t\t\t\t\t\t\t\t\t$_discount = $discount > $k['discount']*1 ? $discount : $k['discount']*1;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t# если нет цена + размер\n\t\t\t\t\t\t\t\t\tif ( ! $k['prices']){ \n\t\t\t\t\t\t\t\t\t\t$total += $k['qty'] * ($k['price'] - round($k['price'] * $_discount/ 100, 2));\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\tif ($k['options']['type'] == 0){\n\t\t\t\t\t\t\t\t\t\t\t$roz = isset($k['prices']['roz']) ? $k['prices']['roz'] : 0;\n\t\t\t\t\t\t\t\t\t\t\t$total += round($k['qty'] * ($roz - $roz * $_discount / 100), 2);\n\t\t\t\t\t\t\t\t\t\t\tunset($roz);\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t$opt = isset($k['prices']['opt']) ? $k['prices']['opt'] : 0;\n\t\t\t\t\t\t\t\t\t\t\t$total += round($k['qty'] * ($opt - $opt * $_discount / 100), 2);\n\t\t\t\t\t\t\t\t\t\t\tunset($opt);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$html .= number_format($total, 2, ',', \"'\").' грн.';\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$html .= number_format($total, 2, ',', \"'\").' грн.';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$html .= '\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t</ul>';\t\n\t\t}\n\t\t\n\t\t# убираем пробелы (сжимаем)\n\t\t$cart['html'] = preg_replace('/\\s+/', ' ', $html);\n\t\t\n\t\t$cart['cart_total'] = number_format($total, 2, ',', \"'\");\n\t\t\n\t\t# Для корзины в подвале\n\t\t$bott = '';\n\t\tif ( ! count($cart['products'])){\n\t\t\t$bott .= '\n\t\t\t<div class=\"cbt-content\">\n\t\t\t\t<div class=\"cbt-empty\">Ваша корзина пуста</div>\n\t\t\t</div>';\n\t\t}else{\n\t\t\t$bott .= '\n\t\t\t<div class=\"cbt-content\">\n\t\t\t\t<div class=\"cbt-content-left\">\n\t\t\t\t\t<div class=\"owl-carousel\" data-cart-bt=\"owlCarusel\">';\n\t\t\t\t\tforeach (array_reverse($cart['products']) as $k=>$v){\n\t\t\t\t\t\t$bott .= '<div class=\"item\">\n\t\t\t\t\t\t\t<div class=\"cbt-item\">\n\t\t\t\t\t\t\t\t<div class=\"cbt-item-right\">\n\t\t\t\t\t\t\t\t\t<div class=\"gd gd-name\">\n\t\t\t\t\t\t\t\t\t\t<a href=\"'.htmlspecialchars($v['_url']).'\">'.$v['name'].'</a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"gd gd-manufacturer\">Производитель: '.(isset($v['manufacturer']) ? $v['manufacturer'] : '&mdash;').'</div>';\n\t\t\t\t\t\t\t\t\tif ($v['prices']){\n\t\t\t\t\t\t\t\t\t$cnt_roz = isset($v['prices']['cnt_roz']) ? $v['prices']['cnt_roz'] : '';\n\t\t\t\t\t\t\t\t\t$cnt_opt = isset($v['prices']['cnt_opt']) ? $v['prices']['cnt_opt'] : '';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$bott .= '\n\t\t\t\t\t\t\t\t\t<div class=\"gd gd-size\">Размер: '.$v['prices']['name'].' ('.$v['prices']['prefix'].')</div>\n\t\t\t\t\t\t\t\t\t<div class=\"gd gd-packing\">Упаковка: '. ($v['options']['type'] ? 'опт - '.($cnt_opt) : 'розница - '.($cnt_roz)) .' шт.</div>';\n\t\t\t\t\t\t\t\t\tunset($cnt_roz);\n\t\t\t\t\t\t\t\t\tunset($cnt_opt);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$bott .= '\n\t\t\t\t\t\t\t\t\t<div class=\"gd gd-price\">Цена:';\n\t\t\t\t\t\t\t\t\tif ($v['discount']*1){\n\t\t\t\t\t\t\t\t\t\t$bott .= '\n\t\t\t\t\t\t\t\t\t\t<span class=\"gd-old-price\">'.number_format($v['price'], 2, ',', \"'\").' грн.</span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"gd-new-price\">'.number_format(($v['price']-($v['price']*$v['discount']/100)), 2, ',', \"'\").' грн.</span>';\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$bott .= '\n\t\t\t\t\t\t\t\t\t\t<span class=\"gd-new-price\">'.number_format($v['price'], 2, ',', \"'\").' грн.</span>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$bott .= '\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"gd gd-qty\">Количество: <b>&times;</b> '.$v['qty'].'</div>\n\t\t\t\t\t\t\t\t\t<div class=\"gd gd-subtotal\">Сумма: '.number_format($v['subtotal'], 2, ',', \"'\").' грн.</div>\n\n\t\t\t\t\t\t\t\t\t<a class=\"gd gd-edit\" href=\"'. htmlspecialchars($v['_url']) . ($v['prices'] ? ('#size='.$v['options']['size'].';packing='.$v['options']['type']) : '').'\">Редактировать</a>\n\t\t\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t\t\t\t<a class=\"gd gd-delete\" href=\"/cart?del='.$k.'>\" data-cart-delete=\"'.$k.'\">Удалить</a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"cbt-item-left\">\n\t\t\t\t\t\t\t\t\t<img src=\"'.htmlspecialchars($v['image']).'\" alt=\"'.htmlspecialchars($v['name']).'\">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>';\n\t\t\t\t\t}\n\t\t\t$bott .= '\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"cbt-content-right\">\n\t\t\t\t\t<a class=\"btn btn-pink\" href=\"/cart\">Оформить</a>\n\t\t\t\t</div>\n\t\t\t</div>';\n\t\t}\n\t\t# убираем пробелы (сжимаем)\n\t\t$cart['html_bottom'] = preg_replace('/\\s+/', ' ', $bott);\n\t\t\n\t\t\n\t\tunset($cart['products']);\n\t\t\n\t\treturn $cart;\n\t}", "public function Render() {\n\t$nQtyOrd = $this->Qty();\n\tif ($nQtyOrd > 0) {\n\t $htLineQty = $nQtyOrd;\n\n\t $mnyPrice = $this->Price();\t\t// item price\n\t $mnyPerItm = $this->SH_perItem();\t\t// per-item shipping\n\t $mnyPerPkg = $this->SH_perPackage();\t// per-pkg minimum shipping\n\t $mnyPriceQty = $mnyPrice * $nQtyOrd;\t// line total sale\n\t $mnyPerItmQty = $mnyPerItm * $nQtyOrd;\t// line total per-item shipping\n\t $mnyLineTotal = $mnyPriceQty + $mnyPerItmQty;\t// line total overall (does not include per-pkg minimum)\n\n\t $strCatNum\t\t= $this->CatNum();\n\t $strPrice\t\t= cCartLine_form::FormatMoney($mnyPrice);\n\t $strPerItm\t\t= cCartLine_form::FormatMoney($mnyPerItm);\n\t $strPriceQty\t= cCartLine_form::FormatMoney($mnyPriceQty);\n\t $strPerItmQty\t= cCartLine_form::FormatMoney($mnyPerItmQty);\n\t $strLineTotal\t= cCartLine_form::FormatMoney($mnyLineTotal);\n\t $strShipPkg\t\t= cCartLine_form::FormatMoney($mnyPerPkg);\n\n\t $htDesc = $this->Descrip();\n\n\t $htDelBtn = '';\n\t $sClass = __CLASS__;\n\t $out = <<<__END__\n<tr phpclass=\"$sClass\">\n<td>$htDelBtn$strCatNum</td>\n<td>$htDesc</td>\n<td class=cart-price align=right>$strPrice</td>\n<td class=shipping align=right>$strPerItm</td>\n<td class=qty align=right>$htLineQty</td>\n<td class=cart-price align=right>$strPriceQty</td>\n<td class=shipping align=right>$strPerItmQty</td>\n<td class=total align=right>$strLineTotal</td>\n<td class=shipping align=right>$strShipPkg</td>\n</tr>\n__END__;\n\t return $out;\n\t}\n }", "public function renderCart() {\n return trim(self::getInstance()->renderCart());\n }", "public function getCartHTML() {\n\t\t$productLines = $this->cart->getProductLines();\n\t\t$sum = $this->cart->getSumSEK();\n\t\t$html = \"<ul>\";\n\n\t\t\n\n\t\tforeach ($productLines as $productLine) {\n\t\t\t$product = $productLine->getProduct();\n\t\t\t$name = $product->getName();\n\t\t\t$costSEK = $product->getCostSEK();\n\t\t\t$amount = $productLine->getAmount();\n\t\t\t$totalSEK = $productLine->getTotalSEK();\n\n\t\t\t\n\t\t\t$linkHTML = $this->productListView->getBuyProductLink($product, \"+\");\n\t\t\t$removeLink = $this->productListView->getRemoveProductLink($product, \"-\");\n\t\t\t$buttons = \"[$linkHTML][$removeLink]\";\n\t\t\t\n\t\t\t$html .= \"<li>$name $amount x $costSEK = $totalSEK SEK $buttons</li>\";\n\n\t\t}\n\t\t$html .= \"</ul>\";\n\t\t\n\n\t\tif (isset($_SESSION[self::$messageHolder])) {\n\t\t\tif ($_SESSION[self::$messageHolder] == self::$addProductSucceded) {\n\t\t\t\t$html .= \"Grattis till ditt köp, kommer göra dig gott!</br>\";\t\n\t\t\t} else {\n\t\t\t\t$html .= \"Du tog bort en produkt! </br>\";\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tunset($_SESSION[self::$messageHolder]);\n\t\t}\n\n\n\t\tif ($this->cart->containsItems()) {\n\t\t\t$checkout = $this->navigationView->getCheckoutLink();\n\t\t\t\n\t\t} else {\n\t\t\t$checkout = \"Inga produkter i varukorgen\";\n\t\t}\n\t\treturn \"<h2>Cart</h2> $html Summa : $sum kr $checkout\";\n\t}", "public function getCartContentAsHtml($hidetotal=0){\r\n $content='<ul id=\"cartcontent\">'; $total=0; $count = 0;\r\n $cpt=1;\r\n if(!empty($this->items)){foreach($this->items as $item){\r\n $amount = $item['quantity']*$item['price'];\r\n $content.='<li class=\"cartitem\">'.$item['quantity'].' x \"'.$item['name'].'\" at '.$this->cursymbol.''.$item['price'];\r\n if($item['shipping']>0)$content.= ' + '.$this->cursymbol.''.$item['shipping'].' shipping ';\r\n $content.=' for '.$this->cursymbol.''.$amount;\r\n $content.='</li>';\r\n $total+=$amount;\r\n $count+=$item['quantity'];\r\n $cpt++;\r\n }}\t\r\n if($hidetotal!=1){ $content.='<li class=\"carttotal\">Total: '.$count.' Items for '.$this->cursymbol.''.$total.'</li>'; }\r\n $content.='</ul>';\r\n return $content;\r\n }", "public function getCartTotal()\n {\n }", "public function get_total_items(){\n\t \t$total = 0;\n\t \t//Si no esta vacio va sumando la cantidad de articulos\n\t \tif(!empty($this->cart)){\n\t \t\tforeach ($this->cart as $linea){\n\t\t\t\t\t$total += $linea['amount'];\n\t\t\t\t}\n\t \t}\n\t \techo $total;\n\t }", "function show_cart(){\n \t$output = '';\n \t$no = 0;\n \tforeach ($this->cart->contents() as $items) {\n \t\t$no++;\n \t\t$output .='\n \t\t<tr>\n \t\t<td>'.$items['name'].'</td>\n \t\t<td>'.number_format($items['price']).'</td>\n \t\t<td>'.$items['qty'].'</td>\n \t\t<td>'.number_format($items['subtotal']).'</td>\n \t\t<td><button type=\"button\" id=\"'.$items['rowid'].'\" class=\"hapus_cart btn btn-danger btn-xs\">Batal</button></td>\n \t\t</tr>\n \t\t';\n \t}\n \t$output .= '\n \t<tr>\n \t<th colspan=\"3\">Total</th>\n \t<th colspan=\"2\">'.'Rp '.number_format($this->cart->total()).'</th>\n \t</tr>\n \t';\n \treturn $output;\n }", "public function total(){\n return $this->cart_contents['cart_total'];\n }", "function thb_woocomerce_ajax_cart_update($fragments) {\n\tob_start();\n\t?>\n\t\t<span class=\"float_count\"><?php echo WC()->cart->cart_contents_count; ?></span>\n\t<?php\n\t$fragments['.float_count'] = ob_get_clean();\n\treturn $fragments;\n}", "public function showCart()\n\t{\n\t\t $session_name = \"c_product\";\n\n\t\t// if (!isset($_SESSION[\"$session_name\"]) || !in_array($p, $_SESSION[\"$session_name\"]))\n\t\t// {\n\t\t// \t$_SESSION[\"$session_name\"][] = $p;\t\t\n\t\t// }\n\t\t$total = 0;\n\t\tforeach ($_SESSION[\"$session_name\"] as $id)\n\t\t{\n\t\t\t$total += $this->showProductInCart($id);\n\t\t}\n\t\t$total = number_format($total);\n\t\t$totalprice = <<<DELIMITER\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-3\">\n\t\t\t\t\t<h4> TOTAL PRICE: </h4>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"col-6\" style=\"text-align:right\">\n\t\t\t\t\t<h3 style= \"color:red\">{$total}₫</h3>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<hr>\n\t\tDELIMITER;\n\t\techo $totalprice;\n\t}", "public function getTotal()\n {\n $cart = $this->getContent();\n\n $sum = array_reduce($cart->all(), function ($a, ItemCollection $item) {\n return $a += $item->getPrice(false);\n }, 0);\n\n return Helpers::formatValue(floatval($sum), $this->config['format_numbers'], $this->config);\n }", "public function calculate_cart_total()\r\n\t{\r\n\t\t$cart_total = 0;\r\n\t\t$cart_total += $this->flexi->cart_contents['summary']['item_summary_total'];\r\n\t\t$cart_total += $this->flexi->cart_contents['summary']['shipping_total'];\r\n\t\t$cart_total += $this->flexi->cart_contents['summary']['surcharge_total'];\r\n\t\t$cart_total += (! $this->flexi_cart->cart_prices_inc_tax()) ? $this->flexi->cart_contents['summary']['tax_total'] : 0; \r\n\t\t\r\n\t\t$this->flexi->cart_contents['summary']['total'] = $this->format_calculation($cart_total);\r\n\t\t\t\t\r\n\t\treturn TRUE; \r\n\t}", "function dripdeals_add_to_cart_fragment($fragments)\n{\n \n global $woocommerce;\n $count = $woocommerce->cart->cart_contents_count;\n \n $fragments['.cart-count'] = \"<div class='cart-count'>\".$count.\"</div>\";\n return $fragments;\n \n}", "public function printCart()\n {\n if ( !(isEmpty() ) )\n {\n foreach( $this->cartItems as $item )\n {\n echo $item->getModelNumber();\n echo \"\\r\" ;\n }\n }\n else\n {\n echo \"Cart is empty in Cart.php\";\n }\n }", "public function RenderItems() {\n\t$out = NULL;\n\tif (!is_array($this->arItems)) {\n\t throw new exception('Internal error: no items in cart array.');\n\t}\n\tforeach ($this->arItems as $sName => $oTotal) {\n\t $out .= $oTotal->Render();\n\t}\n\treturn $out;\n }", "public function totals()\n {\n return $this->get(self::BASE_PATH.'/totals');\n }", "function drawCart(){\n\t\t//start form and table tags\n\t\techo '<form name=\"cart\" action=\"\" method=\"POST\">';\n\t\techo '<h1>Cart</h1>';\n\t\techo '<table>';\n\t\techo '<tr><th>Name</th><th>Price</th><th>Quantity</th><th>Total</th><th>Remove</th></tr>';\n \t\n\t\t//hold the cumulative total price\n\t\t$totalPrice = 0;\n\t\t\n\t\t//display each item in the cart in a new table row \n\t\tforeach($_SESSION['cart']->items as $cartItem){\t\n\t\t\t\n\t\t\t//generate the total price for this item, and add it to the total price\n\t\t\t$itemTotalPrice = $cartItem['price'] * $cartItem['quantity'];\n\t\t\t$totalPrice += $itemTotalPrice;\n\t\t\t\n\t\t\t//item information\n\t\t\techo '<tr>';\n\t\t\techo \t'<td>' . $cartItem['name'] . '</td>';\n\t\t\techo \t'<td>' . number_format($cartItem['price'],2) . '</td>';\n\t\t\techo \t'<td>' . $cartItem['quantity'] . '</td>';\n\t\t\techo \t'<td>' . number_format($itemTotalPrice,2) . '</td>';\n\t\t\techo \t'<td>' . '<button type=\"submit\" name=\"removeItem\" value=\"'.$cartItem['name'].'\" >Remove Item</button>' . '</td>';\n\t\t\techo '</tr>';\n\t\t\t\n\t\t}\n\t\t//draw overall Total\n\t\techo '<tr>';\n\t\techo \t'<th>Overall Total</th><td></td><td></td>';\n\t\techo \t'<td>' . number_format($totalPrice,2) . '</td>';\n\t\techo '</tr>';\n\t\t\n\t\t//close the table and form tags\n\t\techo '</table><br>';\n\t\techo '</form>';\n\t\t\n\t}", "public function renderBuy(){\n $lst = $this->hlp->sess(\"listing\");\n $this->template->finalPriceBTC = $lst->finalPriceBTC;\n $this->template->finalPriceCZK = $lst->finalPriceCZK;\n }", "function totals()\n\t{\n\t\treturn $this->_tour_voucher_contents['totals'];\n\t}", "public function run()\n {\n \t\n return view('widgets.ajax_cart')->with([\n \t\t\t\t\t\t\t\t\t\t'total'=>Cart::total(),\n \t\t\t\t\t\t\t\t\t\t'count'=>Cart::count()\n \t\t\n ]); \n }", "public function formattedTotal(): string;", "public function renderBigCart() {\n\n $L = Mage::getSingleton('core/layout');\n\n\n $totals = $L\n ->createBlock('checkout/cart_totals')\n ->setTemplate('checkout/cart/totals.phtml')\n ;\n $shipping = $L\n ->createBlock('checkout/cart_shipping')\n ->setTemplate('checkout/cart/shipping.phtml')\n ;\n\n $coupon = $L\n ->createBlock('checkout/cart_coupon')\n ->setTemplate('checkout/cart/coupon.phtml')\n ;\n\n // top methods\n\n $t_onepage = $L\n ->createBlock('checkout/onepage_link')\n ->setTemplate('checkout/onepage/link.phtml')\n ;\n $t_methods = $L\n ->createBlock('core/text_list')\n ->append($t_onepage, 'top_methods');\n\n\n //methods\n $onepage = $L\n ->createBlock('checkout/onepage_link')\n ->setTemplate('checkout/onepage/link.phtml')\n ;\n\n $multishipping = $L\n ->createBlock('checkout/multishipping_link')\n ->setTemplate('checkout/multishipping/link.phtml')\n ;\n\n\n\n\n $methods = \t$L\n ->createBlock('core/text_list')\n ->append($onepage, \"onepage\")\n ->append($multishipping, \"multishipping\");\n\n\n // Cross-sales etc\n\n $crossel = $L\n ->createBlock('checkout/cart_crosssell')\n ->setTemplate('checkout/cart/crosssell.phtml')\n ;\n\n\n Mage::getSingleton('checkout/session')->setCartWasUpdated(true);\n\n $cart1 = $L\n ->createBlock('checkout/cart')\n ->setEmptyTemplate('checkout/cart/noItems.phtml')\n ->setCartTemplate('checkout/cart.phtml')\n ->addItemRender('simple', 'checkout/cart_item_renderer', 'checkout/cart/item/default.phtml')\n ->addItemRender('configurable', 'checkout/cart_item_renderer_configurable', 'checkout/cart/item/default.phtml')\n ->addItemRender('grouped', 'checkout/cart_item_renderer_grouped', 'checkout/cart/item/default.phtml')\n ->addItemRender('downloadable', 'downloadable/checkout_cart_item_renderer', 'downloadable/checkout/cart/item/default.phtml')\n ->addItemRender('bundle', 'bundle/checkout_cart_item_renderer', 'checkout/cart/item/default.phtml')\n ->addItemRender('subscription_simple', 'sarp/checkout_cart_item_renderer_simple', 'checkout/cart/item/default.phtml')\n ->addItemRender('bookable', 'booking/checkout_cart_item_renderer', 'checkout/cart/item/default.phtml')\n ->setTemplate('checkout/cart.phtml')\n ->setChild('top_methods',$t_methods)\n ->setChild('totals', $totals)\n ->setChild('shipping', $shipping)\n ->setChild('coupon', $coupon)\n ->setChild('methods', $methods)\n ->setChild('crosssell', $crossel)\n ;\n $cart1\n ->chooseTemplate();\n \n $readyCart = trim($cart1->renderView());\n\n /* Checkout Promo compatibility */\n $checkoutPromoName = 'AW_Checkoutpromo';\n if ($this->extensionEnabled($checkoutPromoName))\n {\n $CPcart = '';\n if (version_compare($this->getExtensionVersion($checkoutPromoName), '1.2.0') >= 0)\n {\n $appliedBlockIds = Mage::app()->getLayout()->createBlock('checkoutpromo/checkoutpromo')->getAppliedBlockIds();\n }\n else\n {\n $appliedBlockIds = Mage::helper('checkoutpromo')->getAppliedBlockIds();\n }\n if (is_array($appliedBlockIds) && array_key_exists('shoppingcartpromo', $appliedBlockIds))\n {\n foreach ($appliedBlockIds['shoppingcartpromo'] as $appliedBlockId)\n {\n $CPcart .= $L->createBlock('cms/block')\n ->setBlockId($appliedBlockId)\n ->toHtml();\n }\n }\n $readyCart = $CPcart.$readyCart;\n }\n\n return $readyCart;\n }", "function getTotalsForDisplay()\n {\n $amount = $this->getSource()->formatPriceTxt($this->getAmount());\n\n if ($this->getAmountPrefix()) {\n $amount = $this->getAmountPrefix() . $amount;\n }\n\n $title = __($this->getTitle());\n if ($this->getTitleSourceField()) {\n $label = $title . ' (' . $this->getTitleDescription() . '):';\n } else {\n $label = $title . ':';\n }\n\n $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;\n $total = ['amount' => $amount, 'label' => $label, 'font_size' => $fontSize];\n return [$total];\n }", "protected function _initTotals()\n {\n $this->_totals = array();\n $this->_totals['subtotal'] = new Varien_Object(array(\n 'code' => 'subtotal',\n 'value' => $this->getSource()->getSubtotal(),\n 'base_value' => $this->getSource()->getBaseSubtotal(),\n 'bluesnap_value' => $this->getSource()->getBluesnapSubtotal(),\n 'label' => $this->helper('sales')->__('Subtotal')\n ));\n\n /**\n * Add shipping\n */\n if (!$this->getSource()->getIsVirtual() && ((float)$this->getSource()->getShippingAmount() || $this->getSource()->getShippingDescription())) {\n $this->_totals['shipping'] = new Varien_Object(array(\n 'code' => 'shipping',\n 'value' => $this->getSource()->getShippingAmount(),\n 'base_value' => $this->getSource()->getBaseShippingAmount(),\n 'bluesnap_value' => $this->getSource()->getBluesnapShippingAmount(),\n 'label' => $this->helper('sales')->__('Shipping & Handling')\n ));\n }\n\n /**\n * Add discount\n */\n if (((float)$this->getSource()->getDiscountAmount()) != 0) {\n if ($this->getSource()->getDiscountDescription()) {\n $discountLabel = $this->helper('sales')->__('Discount (%s)', $this->getSource()->getDiscountDescription());\n } else {\n $discountLabel = $this->helper('sales')->__('Discount');\n }\n $this->_totals['discount'] = new Varien_Object(array(\n 'code' => 'discount',\n 'value' => $this->getSource()->getDiscountAmount(),\n 'base_value' => $this->getSource()->getBaseDiscountAmount(),\n 'bluesnap_value' => $this->getSource()->getBluesnapDiscountAmount(),\n 'label' => $discountLabel\n ));\n }\n\n $this->_totals['grand_total'] = new Varien_Object(array(\n 'code' => 'grand_total',\n 'strong' => true,\n 'value' => $this->getSource()->getGrandTotal(),\n 'base_value' => $this->getSource()->getBaseGrandTotal(),\n 'bluesnap_value' => $this->getSource()->getBluesnapGrandTotal(),\n 'label' => $this->helper('sales')->__('Grand Total'),\n 'area' => 'footer'\n ));\n\n\n //end parent totals\n\n $this->_totals['paid'] = new Varien_Object(array(\n 'code' => 'paid',\n 'strong' => true,\n 'value' => $this->getSource()->getTotalPaid(),\n 'base_value' => $this->getSource()->getBaseTotalPaid(),\n 'bluesnap_value' => $this->getSource()->getBluesnapTotalPaid(),\n 'label' => $this->helper('sales')->__('Total Paid'),\n 'area' => 'footer'\n ));\n $this->_totals['refunded'] = new Varien_Object(array(\n 'code' => 'refunded',\n 'strong' => true,\n 'value' => $this->getSource()->getTotalRefunded(),\n 'base_value' => $this->getSource()->getBaseTotalRefunded(),\n 'bluesnap_value' => $this->getSource()->getBluesnapTotalRefunded(),\n 'label' => $this->helper('sales')->__('Total Refunded'),\n 'area' => 'footer'\n ));\n $this->_totals['due'] = new Varien_Object(array(\n 'code' => 'due',\n 'strong' => true,\n 'value' => $this->getSource()->getTotalDue(),\n 'base_value' => $this->getSource()->getBaseTotalDue(),\n 'bluesnap_value' => $this->getSource()->getBluesnapTotalDue(),\n\n 'label' => $this->helper('sales')->__('Total Due'),\n 'area' => 'footer'\n ));\n return $this;\n }", "public function view_cart()\n {\n $this->layout = 'cart';\n $cart = $this->Session->read('cart'); //doc session va gui session len tren view\n $payment = $this->Session->read('payment');\n $this->set(compact('cart','payment')); //gửi nhiều biến cùng 1 lúc lên view\n $this->set('title_for_layout', 'Giỏ hàng - ChickenRainShop');\n\n }", "function my_header_add_to_cart_fragment( $fragments ) {\n \n ob_start();\n $count = WC()->cart->cart_contents_count;\n ?><a class=\"cart-contents\" href=\"<?php echo wc_get_cart_url(); ?>\" title=\"<?php _e( 'View your shopping cart' ); ?>\"><span class=\"cart-header-icon\"></span><?php\n \n ?>\n <span class=\"cart-contents-count\"><?php echo esc_html( $count ); ?></span>\n </a><?php\n \n $fragments['a.cart-contents'] = ob_get_clean();\n \n return $fragments;\n}", "public function total()\n\t{\n\t\treturn array_get($this->cart_contents, $this->cart_name . '.cart_total', 0);\n\t}", "protected function _beforeToHtml()\n {\n $this->_initTotals();\n foreach ($this->getChild() as $child) {\n if (method_exists($child, 'initTotals')) {\n $child->initTotals();\n }\n }\n return parent::_beforeToHtml();\n }", "public function get_total()\n\t{\n\t\treturn $this->EE->cartthrob->cart->total();\n\t}" ]
[ "0.6232162", "0.6195841", "0.60718715", "0.60703266", "0.60665107", "0.6015603", "0.5982205", "0.5936813", "0.59343606", "0.5883854", "0.5874273", "0.58673143", "0.58531916", "0.5850493", "0.58134484", "0.5796766", "0.57731044", "0.5759694", "0.57401687", "0.5726277", "0.5716747", "0.5712472", "0.5711028", "0.57051694", "0.5699609", "0.562258", "0.56045514", "0.5596024", "0.55911416", "0.5587805" ]
0.6198458
1
/ Run some queries. Provide the raw path, a starting offset for result documents, and the maximum number of result documents to return. You can also use a fourth parameter to control how results are sorted, among other options.
function search($offset,$limit,$queries){ // Example: $queries = array('blog_tags: '.$_GET['q']); foreach ( $queries as $query ) { $response = $this->connection->search( $query, $offset, $limit ); if ( $response->getHttpStatus() == 200 ) { print_r( $response->getRawResponse() ); if ( $response->response->numFound > 0 ) { echo "$query <br />"; foreach ( $response->response->docs as $doc ) { echo "$doc->partno $doc->name <br />"; } echo '<br />'; } } else { echo $response->getHttpStatusMessage(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function query($offset, $row_count=1) {\n\t\treturn $this->db->query(\"SELECT {$this->expr} FROM {$this->synt} LIMIT {$offset}, {$row_count}\");\n\t}", "function query() {}", "function findAllDocuments($dbName, $collectionName, $max = null, $offset = null) {\n $argv = func_get_args();\n if (count($argv) == 2) {\n Util::throwExceptionIfNullOrBlank($dbName, \"DataBase Name\");\n Util::throwExceptionIfNullOrBlank($collectionName, \"Collection Name\");\n $encodedDbName = Util::encodeParams($dbName);\n $encodedCollectionName = Util::encodeParams($collectionName);\n $objUtil = new Util($this->apiKey, $this->secretKey);\n try {\n\t\t\t $params = null;\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $signParams['dbName'] = $dbName;\n $signParams['collectionName'] = $collectionName;\n $signature = urlencode($objUtil->sign($signParams)); //die();\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL . \"/findAll\" . \"/dbName\" . \"/\" . $encodedDbName . \"/collectionName\" . \"/\" . $encodedCollectionName;\n $response = RestClient::get($baseURL, $params, null, null, $contentType, $accept, $headerParams);\n $storageResponseObj = new StorageResponseBuilder();\n $storageObj = $storageResponseObj->buildResponse($response->getResponse());\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $storageObj;\n } else {\n /**\n * Find all documents stored in given database and collection.\n *\n * @params dbName\n * - Unique handler for storage name\n * @params collectionName\n * - Name of collection under which JSON doc needs to be searched\n * @params max\n * - Maximum number of records to be fetched\n * @params offset\n * - From where the records are to be fetched\n *\n * @return Storage object\n\n */\n Util::throwExceptionIfNullOrBlank($dbName, \"DataBase Name\");\n Util::throwExceptionIfNullOrBlank($collectionName, \"Collection Name\");\n Util::throwExceptionIfNullOrBlank($max, \"Max\");\n Util::throwExceptionIfNullOrBlank($offset, \"Offset\");\n Util::validateMax($max);\n $encodedDbName = Util::encodeParams($dbName);\n $encodedCollectionName = Util::encodeParams($collectionName);\n $encodedMax = Util::encodeParams($max);\n $encodedOffset = Util::encodeParams($offset);\n $objUtil = new Util($this->apiKey, $this->secretKey);\n try {\n\t\t\t $params = null;\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $signParams['dbName'] = $dbName;\n $signParams['collectionName'] = $collectionName;\n $signParams['max'] = $max;\n $signParams['offset'] = $offset;\n $signature = urlencode($objUtil->sign($signParams)); //die();\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL . \"/findAll\" . \"/dbName\" . \"/\" . $encodedDbName . \"/collectionName\" . \"/\" . $encodedCollectionName . \"/\" . $encodedMax . \"/\" . $encodedOffset;\n $response = RestClient::get($baseURL, $params, null, null, $contentType, $accept, $headerParams);\n $storageResponseObj = new StorageResponseBuilder();\n $storageObj = $storageResponseObj->buildResponse($response->getResponse());\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $storageObj;\n }\n }", "public function runQuery(){\n \n $query = $this->getQuery();\n $pager = $this->getPager();\n $modify_result = $this->getModifyResult();\n\n // set default number of results so that we don't output NULL as \n // total_results if there are errors\n $pager->setTotalResults( 0 );\n $results = array();\n \n if( !$this->getResponse()->hasErrors() ){\n \t\n \t $count_query = clone $query;\n\t $pager->setTotalResults( $count_query->count() );\n \t $pager->decorateQuery( $query );\n \n\t if( $pager->getPageSize() > 0 ){\n\t $db_results = $query->find();\n\t foreach( $db_results as $model ){\n\t $result_object = array();\n\t $modify_result( $model, $result_object );\n\t $results[] = $result_object;\n\t }\n\t }\n\t \n }\n \n $api_response_body = $this->getResponse()->getResponseBody();\n $api_response_body->setBody($results);\n \n }", "abstract public function query();", "public function executeQuery() {\r\n\t\t$query = $this->query;\r\n\t\t$query->matching($query->logicalAnd($this->queryConstraints));\r\n//$parser = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\Storage\\\\Typo3DbQueryParser'); \r\n//$queryParts = $parser->parseQuery($query); \r\n//\\TYPO3\\CMS\\Core\\Utility\\DebugUtility::debug($queryParts, 'Query Content');\r\n\t\t$queryResult = $query->execute()->toArray();\r\n\t\t$this->setSelectedPageUids($queryResult);\r\n\t\t$this->resetQuery(); \r\n\t\treturn $queryResult;\r\n\t}", "abstract function query($queryString, $page = 1);", "final public function execute() {\n if (!$this->viewer) {\n throw new Exception(\"Call setViewer() before execute()!\");\n }\n\n $results = array();\n\n $filter = new PhabricatorPolicyFilter();\n $filter->setViewer($this->viewer);\n\n if (!$this->capabilities) {\n $capabilities = array(\n PhabricatorPolicyCapability::CAN_VIEW,\n );\n } else {\n $capabilities = $this->capabilities;\n }\n $filter->requireCapabilities($capabilities);\n $filter->raisePolicyExceptions($this->raisePolicyExceptions);\n\n $offset = (int)$this->getOffset();\n $limit = (int)$this->getLimit();\n $count = 0;\n\n if ($limit) {\n $need = $offset + $limit;\n } else {\n $need = 0;\n }\n\n $this->willExecute();\n\n do {\n if ($need) {\n $this->rawResultLimit = min($need - $count, 1024);\n } else {\n $this->rawResultLimit = 0;\n }\n\n $page = $this->loadPage();\n\n $visible = $this->willFilterPage($page);\n $visible = $filter->apply($visible);\n foreach ($visible as $key => $result) {\n ++$count;\n\n // If we have an offset, we just ignore that many results and start\n // storing them only once we've hit the offset. This reduces memory\n // requirements for large offsets, compared to storing them all and\n // slicing them away later.\n if ($count > $offset) {\n $results[$key] = $result;\n }\n\n if ($need && ($count >= $need)) {\n // If we have all the rows we need, break out of the paging query.\n break 2;\n }\n }\n\n if (!$this->rawResultLimit) {\n // If we don't have a load count, we loaded all the results. We do\n // not need to load another page.\n break;\n }\n\n if (count($page) < $this->rawResultLimit) {\n // If we have a load count but the unfiltered results contained fewer\n // objects, we know this was the last page of objects; we do not need\n // to load another page because we can deduce it would be empty.\n break;\n }\n\n $this->nextPage($page);\n } while (true);\n\n $results = $this->didLoadResults($results);\n\n return $results;\n }", "public static function query();", "public function test_queries()\n\t{\n\t\t$this->setup_options_obj($input);\n\t\t$rpt = new Reports_Model($this->options);\n\t\t$rpt->set_option('start_time', 0);\n\t\t$rpt->set_option('end_time', time());\n\t\t$result = $rpt->test_summary_queries();\n\t\techo \"<pre>\\n\";\n\t\t$cnt = count($result);\n\t\techo $cnt . \" total different queries\\n\";\n\t\t$total_rows = 0.0;\n\t\tforeach ($result as $query => $ary) {\n\t\t\techo $query . \"\\n\";\n\t\t\tprint_r($ary);\n\t\t\t$total_rows += $ary['rows'];\n\t\t}\n\t\t$avg_rows = $total_rows / $cnt;\n\t\techo \"Average row-count: $avg_rows\\n\";\n\t\techo \"</pre>\\n\";\n\t\tdie;\n\t}", "public function testFindByQWithOffsetAndLimit()\n {\n $dataLoader = $this->getDataLoader();\n $all = $dataLoader->getAll();\n $filters = ['q' => $all[0]['name'], 'offset' => 0, 'limit' => 1];\n $this->filterTest($filters, [$all[0]]);\n $filters = ['q' => 'desc', 'offset' => 1, 'limit' => 1];\n $this->filterTest($filters, [$all[1]]);\n }", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();" ]
[ "0.5807764", "0.5744301", "0.5670148", "0.5647921", "0.56476116", "0.5588279", "0.55493623", "0.5503231", "0.5498306", "0.5493416", "0.54929495", "0.54836184", "0.54836184", "0.54836184", "0.54836184", "0.54836184", "0.54836184", "0.54836184", "0.54836184", "0.54836184", "0.54836184", "0.54836184", "0.54836184", "0.54836184", "0.54836184", "0.54836184", "0.54836184", "0.54836184", "0.54836184", "0.54836184" ]
0.5744832
1
/ Curl function to add data to the Sorl server.
function add($data){ $post_string = '<add><doc>'; foreach ($data as $key => $value){ $post_string = '<field name="$key">$value</field>'; } $post_string = ' </doc></add>'; $header = array("Content-type:text/xml; charset=utf-8"); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, SOLR_UPDATE_URL); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string); curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($ch, CURLINFO_HEADER_OUT, 1); $data = curl_exec($ch); if (curl_errno($ch)) { //print "curl_error:" . curl_error($ch); } else { curl_close($ch); //print "curl exited okay\n"; // echo "Data returned...\n"; //echo "------------------------------------\n"; //echo $data; //echo "------------------------------------\n"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rest_put_data($url, $data)\n{\n if (is_array($data)) {\n $data = json_encode($data);\n }\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}", "function http_put_data($url, $data = null, ?array $options = null, ?array &$info = null) {}", "private function curl_put($url, $data)\n {\n $json_str = file_get_contents($this->cil_config_file);\n $json = json_decode($json_str);\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($doc)));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n curl_setopt($ch, CURLOPT_POSTFIELDS,$data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n }", "public function add($curl_handle, $data = null)\n {\n $node = new CurlNode;\n $node->handle = $curl_handle;\n $node->data = $data;\n $this->request_queue->enqueue($node);\n }", "public function addData(string $data);", "function put($url, $fields, $headers)\n{\n $ch = curl_init($url); //initialize and set url\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\"); //set as put request\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); //set fields, ensure they are properly encoded\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // set headers pass encoding here and tokens.\n $response = curl_exec($ch); // save the response\n curl_close ($ch);\n return $response;\n}", "function put($url, $data = \"\", $http_options = array()) {\n $http_options = $http_options + $this->http_options;\n $http_options[CURLOPT_CUSTOMREQUEST] = \"PUT\";\n $http_options[CURLOPT_POSTFIELDS] = $data;\n $this->handle = curl_init($url);\n\n if (!curl_setopt_array($this->handle, $http_options)) {\n throw new RestClientException(\"Error setting cURL request options.\");\n }\n\n $this->response_object = curl_exec($this->handle);\n $this->http_parse_message($this->response_object);\n\n curl_close($this->handle);\n return $this->response_object;\n }", "function h_POST(string $url, $data = []) {\n // if URL doesn't start with \"http\", prepend API_URL\n if (!preg_match('/^http/', $url, $matches)) {\n $url = API_URL . $url;\n }\n\n $payload = json_encode($data);\n\n // Prepare new cURL resource\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLINFO_HEADER_OUT, true);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n \n // Set HTTP Header for POST request \n curl_setopt(\n $ch,\n CURLOPT_HTTPHEADER,\n [\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($payload)\n ]\n );\n \n // Submit the POST request\n $response = curl_exec($ch);\n curl_close($ch);\n\n return $response;\n}", "public function add_data($data)\n {\n }", "public function curlPutCall( $url, $postData ) \n {\n // prx($postData);\n $fields = array();\n foreach ($postData as $postKey => $postVal){\n $fields[$postKey] = urlencode($postVal);\n }\n //url-ify the data for the POST\n foreach($fields as $key=>$value) { \n $fields_string .= $key.'='.$value.'&';\n }\n \n rtrim($fields_string, '&');\n\n try\n {\n // $requestTime = date('r');\n #CURL REQUEST PROCESS-START#\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n //execute post\n $result = curl_exec($ch);\n \n //close connection\n curl_close($ch);\n }\n catch( Exception $e)\n {\n $strResponse = \"\";\n $strErrorCode = $e->getCode();\n $strErrorMessage = $e->getMessage();\n die('Connection Failure with API');\n }\n \n $responseArr = json_decode($result, true);\n return $responseArr;\n }", "function CallAPI($method, $url, $data = false){\n\t\t$curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_PUT, 1);\t\t\n\t\t$update_json = json_encode($data);\t\n\t\tcurl_setopt($curl, CURLOPT_URL, $url . \"?\" . http_build_query($data));\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($curl, CURLOPT_SSLVERSION, 4);\n\t\t$result = curl_exec($curl); \n\t\t$api_response_info = curl_getinfo($curl);\n\t\tcurl_close($curl);\n\t\treturn $result;\n}", "private function curl_post($url, $data)\n {\n $json_str = file_get_contents($this->cil_config_file);\n $json = json_decode($json_str);\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($doc)));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\n curl_setopt($ch, CURLOPT_POSTFIELDS,$data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n }", "public function addBody(string $data)\n {\n $this->body .= $data;\n }", "public function add($data)\n {\n }", "public function addData(string $data): IRequest;", "public static function urlPUT($url, $data, $headers=null) {\n\n $isJsonForm = false;\n if ($headers == null){\n $headers = array(\"Content-type: application/json\");\n $isJsonForm = true;\n }\n else {\n $stringFromHeaders = implode(\" \",$headers);\n if (preg_match(\"/Content\\-type:/i\",$stringFromHeaders)){\n \n if (preg_match(\"/Content\\-type:\\ {0,4}application\\/json/i\",$stringFromHeaders)){\n $isJsonForm = true; \n array_push($headers,\"Content-type: application/json\");\n }\n\n }\n else{\n $isJsonForm = true; \n array_push($headers,\"Content-type: application/json\");\n }\n }\n\n if ($isJsonForm){\n $data = json_encode($data);\n $dataString = $data;\n }\n else{\n\n $dataString = '';\n $arrKeys = array_keys($data);\n foreach ($data as $key => $value){\n if (preg_match(\"/[a-zA-Z_]{2,100}/\",$key))\n $dataString .= $key . \"=\" . $value .\"&\";\n }\n $dataString .= \"\\n\";\n }\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n array_push($headers,'Content-Length: ' . strlen($dataString));\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n \n\n if($headers != null && in_array('Custom-SSL-Verification:false',$headers)){\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); \n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n }\n\n $contents = curl_exec($ch);\n\n\n if($errno = curl_errno($ch)) {\n $error_message = curl_strerror($errno);\n //echo \"cURL error ({$errno}):\\n {$error_message}\";\n $contents = \"cURL error ({$errno}):\\n {$error_message}\";\n }\n\n\n curl_close($ch);\n\n return utf8_encode($contents);\n }", "public function addTag($id){\n\t\t$crl = curl_init();\n\t\tcurl_setopt($crl, CURLOPT_URL, $this->buildTagUrl($id) );\n\t\tcurl_setopt($crl, CURLOPT_CUSTOMREQUEST, \"PUT\"); \n\t\tcurl_setopt($crl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($crl, CURLOPT_HTTPHEADER, array( \n\t\t\t\t'Authorization: Bearer '.$this->getToken(), \n\t\t\t 'Content-Type: application/json',\n\t\t\t 'Accept: application/vnd.vimeo.*+json;version=3.4'\n\t\t\t) \n\t\t);\n\t\tcurl_setopt($crl, CURLOPT_SSL_VERIFYPEER, true); \n\t\t$result = curl_exec($crl);\n\t}", "function addstate($userid,$state){\n\t$cSession = curl_init();\n\t// Step 2\n\tcurl_setopt($cSession,CURLOPT_URL,\"http://1.179.187.126/linegps/addstate.php?userid=$userid&state=$state\");\n\tcurl_setopt($cSession,CURLOPT_RETURNTRANSFER,true);\n\tcurl_setopt($cSession,CURLOPT_HEADER, false);\n\t// Step 3\n\t$result=curl_exec($cSession);\n\t// Step 4\n\tcurl_close($cSession);\n\t// ====\n\treturn $result;\n\n}", "public function store_test()\n {\n $post_data = array('device' => '233dce4dead3dbee',\n 'external' => '27.0',\n 'internal' => '28.0');\n\n $post_data = json_encode($post_data);\n\n $url = 'http://localhost:8080/uni/index.php?controller=sensor&action=store';\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($post_data))\n );\n\n $response = curl_exec( $ch );\n }", "protected function appendData($data)\n {\n $this->sha1 = null;\n $this->data.=$data;\n }", "function restPut($url, $content) {\n\t$ch = curl_init();\n\t// Uses the URL passed in that is specific to the API used\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t// When posting to a Fuel API, content-type has to be explicitly set to application/json\n\t$headers = [\"Content-Type: application/json\", \"User-Agent: \" . getSDKVersion()];\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t// The content is the JSON payload that defines the request\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $content);\n\t//Need to set ReturnTransfer to True in order to store the result in a variable\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t//Need to set the request to be a PATCH\n\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n\t// Disable VerifyPeer for SSL\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t$outputJSON = curl_exec($ch);\n\t$responseObject = new \\stdClass();\n\t$responseObject->body = $outputJSON;\n\t$responseObject->httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\treturn $responseObject;\n}", "function put($url, $data = null, $options = array()) {\n\t\treturn $this->request($url, array_merge(array('method' => 'PUT', 'body' => $data), $options));\n\t}", "function zbase_remote_post_json($url, $data, $options = [])\n{\n\t$dataString = '';\n\tforeach ($data as $key => $value)\n\t{\n\t\t$dataString .= $key . '=' . $value . '&';\n\t}\n\trtrim($dataString, '&');\n\t$ch = curl_init($url);\n\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n\tcurl_setopt($ch, CURLOPT_POST, count($data));\n\tcurl_setopt($ch, CURLOPT_COOKIEJAR, zbase_storage_path() . 'cookie.txt');\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t\t'Content-Type: application/json',\n\t\t'Content-Length: ' . strlen($dataString))\n\t);\n\t$result = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $result;\n}", "function airtableCallByCurlSave($url, $headers, $params) {\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_TIMEOUT, 10);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));\n $entries = curl_exec($ch);\n curl_close($ch);\n $airtableResponse = json_decode($entries, TRUE);\n\n return $airtableResponse;\n}", "function mi_http_request($url, $data)\r\n{\r\n\r\n $curl = curl_init($url);\r\n curl_setopt($curl, CURLOPT_POST, true);\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\r\n $response = curl_exec($curl);\r\n curl_close($curl);\r\n return $response;\r\n}", "function new_post($request,$url) {\n ##Data Post\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $request);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n return curl_exec($ch);\n}", "public function add_client(array $data);", "public function addTag( $data = array() ) { \t\n\n $url = $this->_base_url . 'tags';\n $options['data']['tag'] = $data;\n $options['post'] = true;\n $this->_callAPI($url, $options);\n }", "function rest_post_data($url, $data)\n{\n if (is_array($data)) {\n $data = json_encode($data);\n }\n\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}", "function adddata_api($bit_data, $user, $password){\n\t\t$ret['result'] = 0;\n\t\tglobal $ct_config;\n\n\n\t\t$usern = ereg_replace( \"[^A-Za-z0-9]\", \"\", $user);\n\t\t$pass = addslashes($password);\n\n\t\tif(strlen($pass) && strlen($usern)){\n\t\t\t//input params\n\t\t\t\t$param = array('user' => base64_encode($usern), 'host' => base64_encode($ct_config['soap_host']), 'service'=>base64_encode('chemtools'), 'password' => base64_encode($pass), 'soton_ldap_only' => '0', 'ip' => $_SERVER['REMOTE_ADDR']);\n\t\t\t\t$client = new nu_soap_client($ct_config['soap_login'].'index.php?wsdl', true);\n\t\t\t\t$result = $client->call('chemlogin', $param);\n\t\t\t\t$_SESSION['user_name'] = $result['user'];\n $_SESSION['user_fname'] = $result['name'];\n $_SESSION['user_admin'] = $result['access'];\n $_SESSION['user_email'] = $result['email'];\n $_SESSION['user_uid'] = $result['uid'];\n\n\n\t\t\tif($result['result']==1){\n\t\t\t\t\t$ret['result'] = 1;\n\t\t\t\t\t$ret['error'] = \"none: {$result['user']}\";\n\t\t\t\t}else{\n\t\t\t\t\t$ret['result'] = 0;\n\t\t\t\t\t$ret['error'] = \"Login Failed\";\n\t\t\t}\n\t\t}\n\n\t\t\n\t\tif($ret['result'] == 1 && $bit_data){\n\t\t\n\t\t$metada = readxml($bit_data);\n\n\t\tif($metada['METADATA']['TYPE']){\n\t\t\t$dtype = $metada['METADATA']['TYPE'];\n\t\t}else{\n\t\t\t$dtype = 'img_meta';\n\t\t}\t\n\t\t\n\t\t$metad = $metada;\n\t\tforeach($metad['METADATA'] as $key=>$value){\n\t\n\t\t\tif(substr($key,0,5) == 'DATA_'){\n\t\n\t\t\t\tif($value['TYPE']==\"inline\" && strlen($value['DATA'])){\n\t\t\t\t\t\t$sql = \"INSERT INTO blog_data (data_id, data_datetime, data_type, data_data) VALUES (NULL, NOW(), '\".strtolower(substr($key,5)).\"', '\".addslashes(base64_decode($value['DATA'])).\"');\";\n\t\t\t\t\trunQuery($sql,'add inline data');\n\t\t\t\t\t$id = db_insert_id();\n\t\t\t\t\t$metada['METADATA'][$key]['TYPE']=\"local\";\n\t\t\t\t\tunset($metada['METADATA'][$key]['DATA']);\n\t\t\t\t\t$metada['METADATA'][$key]['ID']=$id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t$metad = writexml($metada);\n\n\t\t$sql = \"INSERT INTO blog_data (data_id, data_datetime, data_type, data_data) VALUES (NULL, NOW(), '\".addslashes($dtype).\"', '\".addslashes($metad).\"');\";\n\n\t\trunQuery($sql,'Blogs');\n\n\t\t$ret['data_id'] = db_insert_id(); \n\n\n\t\t}\n\n\t\treturn $ret;\n\t}" ]
[ "0.6189675", "0.6130741", "0.61258537", "0.597298", "0.5789855", "0.5770206", "0.56657046", "0.56241834", "0.550278", "0.54600435", "0.54211146", "0.54006416", "0.53731763", "0.5364308", "0.5358269", "0.5350588", "0.5349042", "0.5335722", "0.5334158", "0.53030235", "0.52984816", "0.52964276", "0.5296136", "0.52949077", "0.52922773", "0.52922136", "0.52908105", "0.52763003", "0.5267601", "0.5265239" ]
0.62923163
0
Detect Archive URLs Get list of archive URLs ie
public static function detect() : array { global $wpdb; $archive_urls = []; $archive_urls_with_markup = ''; $yearly_archives = wp_get_archives( [ 'type' => 'yearly', 'echo' => 0, ] ); $archive_urls_with_markup .= is_string( $yearly_archives ) ? $yearly_archives : ''; $monthly_archives = wp_get_archives( [ 'type' => 'monthly', 'echo' => 0, ] ); $archive_urls_with_markup .= is_string( $monthly_archives ) ? $monthly_archives : ''; $daily_archives = wp_get_archives( [ 'type' => 'daily', 'echo' => 0, ] ); $archive_urls_with_markup .= is_string( $daily_archives ) ? $daily_archives : ''; $url_matching_regex = '#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#'; preg_match_all( $url_matching_regex, $archive_urls_with_markup, $matches ); return $matches[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_scan_urls() {\r\n\t\t// Calculate URLs to Check.\r\n\t\t$args = array(\r\n\t\t\t'orderby' => 'rand',\r\n\t\t\t'posts_per_page' => '1',\r\n\t\t\t'ignore_sticky_posts' => true,\r\n\t\t\t'post_status' => 'publish',\r\n\t\t);\r\n\r\n\t\t$urls = array();\r\n\r\n\t\t$urls[] = home_url();\r\n\r\n\t\t$post_types = get_post_types();\r\n\t\t$post_types = array_diff( $post_types, array( 'attachment', 'nav_menu_item', 'revision' ) );\r\n\r\n\t\tforeach ( $post_types as $post_type ) {\r\n\t\t\t$args['post_type'] = $post_type;\r\n\t\t\t$posts = get_posts( $args );\r\n\t\t\tif ( $posts ) {\r\n\t\t\t\t$urls[] = get_permalink( $posts[0] );\r\n\t\t\t}\r\n\r\n\t\t\t$archive_link = get_post_type_archive_link( $post_type );\r\n\t\t\tif ( $archive_link ) {\r\n\t\t\t\t$urls[] = $archive_link;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$post = get_post( get_option( 'page_for_posts' ) );\r\n\t\tif ( get_option( 'show_on_front' ) && $post ) {\r\n\t\t\t$urls[] = get_permalink( $post->ID );\r\n\t\t}\r\n\r\n\t\t$urls = array_unique( $urls );\r\n\r\n\t\t$urls_list = array();\r\n\t\t// Duplicate every URL 3 times. This will be enough to generate all the files for most of the sites.\r\n\t\tfor ( $i = 0; $i < 3; $i++ ) {\r\n\t\t\t$urls_list = array_merge( $urls_list, $urls );\r\n\t\t}\r\n\r\n\t\tsort( $urls_list );\r\n\t\treturn $urls_list;\r\n\t}", "public function getUrls(): array;", "public function getUrls(): array;", "public function getUriList();", "function wp_extract_urls($content)\n {\n }", "public function get_url_list() {\n\t\t$home_no_www = str_replace( '://www.', '://', get_option( 'home' ) );\n\t\t$home_yes_www = str_replace( '://', '://www.', $home_no_www );\n\n\t\t// Build the search links.\n\t\t$search = array(\n\t\t\tstr_replace( 'https://', 'http://', $home_yes_www ),\n\t\t\tstr_replace( 'https://', 'http://', $home_no_www ),\n\t\t\t\"src='http://\",\n\t\t\t'src=\"http://',\n\t\t);\n\n\t\treturn array(\n\t\t\t'search' => $search, // The search links.\n\t\t\t'replace' => str_replace( 'http://', 'https://', $search ), // The replace links.\n\t\t);\n\t}", "function findPageUrls();", "public function getURLs()\n {\n $retVal = [];\n\n // Which fields/subfields should we check for URLs?\n $fieldsToCheck = [\n '856' => ['y', 'z'], // Standard URL\n '555' => ['a'] // Cumulative index/finding aids\n ];\n\n foreach ($fieldsToCheck as $field => $subfields) {\n $urls = $this->marcRecord->getFields($field);\n if ($urls) {\n foreach ($urls as $url) {\n // Is there an address in the current field?\n $address = $url->getSubfield('u');\n if ($address) {\n $address = $address->getData();\n\n // Is there a description? If not, just use the URL itself.\n foreach ($subfields as $current) {\n $desc = $url->getSubfield($current);\n if ($desc) {\n break;\n }\n }\n if ($desc) {\n $desc = $desc->getData();\n } else {\n $desc = $address;\n }\n\n $retVal[] = ['url' => $address, 'desc' => $desc];\n }\n }\n }\n }\n\n return $retVal;\n }", "public function all(): array\n {\n $html = file_get_contents(static::RELEASES_URL);\n if (false === $html) {\n throw new RuntimeException('Failed to download ' . static::RELEASES_URL);\n }\n\n preg_match_all(\n '/<a[^>]*href=\"(?<releaseUrl>https:\\/\\/[\\S]+\\/wordpress-[4-9]\\S+[^IIS]\\.zip)\\.sha1\"[^>]*>/',\n $html,\n $matches\n );\n $releaseUrls = $matches['releaseUrl'] ?? [];\n\n static::failIfReleaseUrlsNotFound($releaseUrls);\n\n $releases = array_map(function (string $releaseUrl): ?Release {\n return Release::parse($releaseUrl);\n }, $releaseUrls);\n $releases = array_filter($releases);\n\n $this->failIfReleaseCannotBeParsed($releases);\n\n return $releases;\n }", "function get_announce_urls($dict){\n\tif ($dict['value']['announce'] && !$dict['value']['announce-list']) {$anarray[0] = $dict['value']['announce']['value']; return $anarray; }\n\n\tif ($dict['value']['announce-list']) {\n\n\t\tif (!$dict['value']['announce-list']['value']) return false;\n\t\t$retrackers = get_retrackers(true);\n\t\tforeach ($dict['value']['announce-list']['value'] as $urls) {\n\t\t\tif (!in_array($urls['value'][0]['value'],$retrackers))\n\t\t\t$anarray[] = $urls['value'][0]['value'];\n\t\t}\n\n\t\treturn $anarray;\n\n\t}\n}", "public function testGetArchiveList()\n {\n $href = '/fotoweb/me/archives/';\n\n $response = $this->client->getArchives(['href' => $href]);\n $this->assertInstanceOf(ResultInterface::class, $response,\n 'The response is not a proper Guzzle result.');\n $this->assertGreaterThan(0, $response->offsetGet('data'),\n 'The asset response should include a data property.');\n $this->assertArrayHasKey('paging', $response->getData(),\n 'The asset response should include a paging property.');\n }", "public function get_all_archives() {\n\t\t\t\n\t\t\t$archives = TableRegistry::get('Administrator.Archives');\n\n\t\t\t$imagesConditions = [ 'AND' => [\n\t\t\t\t\t\t\t\t\t [\n\t\t\t\t\t\t\t\t\t\t\t 'OR' => [\n\t\t\t\t\t\t\t\t\t\t\t\t ['mimetype' => 'image/png'],\n\t\t\t\t\t\t\t\t\t\t\t\t ['mimetype' => 'image/jpeg'],\n\t\t\t\t\t\t\t\t\t\t\t\t ['mimetype' => 'image/jpg'],\n\t\t\t\t\t\t\t\t\t\t\t\t ['mimetype' => 'image/gif'],\n\t\t\t\t\t\t\t\t\t\t\t\t ['mimetype' => 'application/stream'],\n\t\t\t\t\t\t\t\t\t\t\t\t ['mimetype' => 'application/pdf'],\n\t\t\t\t\t\t\t\t\t \t\t\t]\n\t\t\t\t\t\t\t\t\t \t],\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t \t]\n\t\t\t\t\t\t\t\t];\n\n\n\t\t\t//$this->set('images', $archives->find('all', ['conditions' => $imagesConditions]) );\n\t\t\treturn $archives->find('all', ['conditions' => $imagesConditions, 'order' => ['id' => 'DESC'] ]);\n\n\t}", "function get_urls(){\n\tglobal $urllist;\n\t$list = file($urllist);\n\t//print_r($list);\n\treturn $list;\n}", "function comic_archive($filter = 'default') { echo get_comic_url('archive', null, $filter); }", "function thinkup_extract_urls_filter ( $tu_post ) {\n\n $regex = '/[a-z]+:\\/\\/[a-z0-9-_]+\\.[a-z0-9-_@:~%&\\?\\+#\\/.=]+[^:\\.,\\)\\s*$]/i';\n\n if ( preg_match_all($regex, $tu_post->wp_post->post_content, $matches) ) {\n\n $tu_post->links = array_merge($tu_post->links, $matches[0]);\n\n }\n\n return $tu_post;\n\n}", "public function getUrls()\r\n {\r\n }", "public function getPageUris();", "public function getAllUrls()\n {\n $urls = [];\n $stores = $this->storeManager->getStores(false);\n foreach($stores as $store) {\n $urls[] = $store->getBaseUrl();\n }\n\n return $urls;\n }", "function get_internal_links($array){\r\n $result = array();\r\n $count = count($array);\r\n for($i=0;$i<$count;$i++){\r\n if(!empty($array[$i])){ \r\n if(strpos($array[$i],\"www\",0) === false){\r\n if(strpos($array[$i],\"http\",0) === false){ \r\n array_push($result,$array[$i]);\r\n }\r\n }\r\n }\r\n }\r\n return $result;\r\n}", "abstract public function getArchiveInformation();", "protected function is_date_archive_url( $url ) {\n\t\t$path = \\wp_parse_url( $url, \\PHP_URL_PATH );\n\t\t$path = \\ltrim( $path, '/' );\n\n\t\t$wp_rewrite = $this->wp_rewrite_wrapper->get();\n\t\t$date_rewrite = $wp_rewrite->generate_rewrite_rules( $wp_rewrite->get_date_permastruct(), \\EP_DATE );\n\t\t$date_rewrite = \\apply_filters( 'date_rewrite_rules', $date_rewrite );\n\n\t\tforeach ( (array) $date_rewrite as $match => $query ) {\n\t\t\tif ( \\preg_match( \"#^$match#\", $path ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function matchUrl( $url ) {\n\t\t$urlPattern = '/'.str_replace($this->urlPattern, '', $url);\n\t\t$aUrl = pathinfo( str_replace($this->urlPattern, '', $urlPattern) );\n\t\tif ( in_array($aUrl['filename'], Array('rss2', 'atom')) and $aUrl['extension'] == 'xml') {\n\t\t\treturn $aUrl;\n\t\t}\n\t\treturn Array();\n }", "public function downloadArchive() {\n\t\t$parsedUrl = parse_url($this->archive);\n\t\t$prefix = 'package';\n\t\t\n\t\t// file transfer via hypertext transfer protocol.\n\t\tif ($parsedUrl['scheme'] == 'http') {\n\t\t\t$this->archive = FileUtil::downloadFileFromHttp($this->archive, $prefix);\n\t\t}\n\t\t// file transfer via file transfer protocol.\n\t\telseif ($parsedUrl['scheme'] == 'ftp') {\n\t\t\t$this->archive = FTPUtil::downloadFileFromFtp($this->archive, $prefix);\n\t\t}\n\t\t\n\t\t// unzip tar\n\t\t$this->archive = self::unzipPackageArchive($this->archive);\n\t\t\n\t\treturn $this->archive;\n\t}", "function getDownloadLinks($source_links){\n\t\t$content = file_get_contents($source_links);\n\t\t$download_links = $this->findMatches($content);\n\t\treturn $download_links;\n\t}", "function get_archives($type = '', $limit = '', $format = 'html', $before = '', $after = '', $show_post_count = \\false)\n {\n }", "public function getRedirects();", "function extract_hotlinks($content) {\n\n\n\n\t}", "public function extractAllUrls($baseUrl)\n\t{\n\t\t$allUrls = array();\n\t\t\n\t\tif ($this->isHtml() && preg_match_all('/' . str_replace('/', '\\/', $baseUrl) . '[^\"\\'#\\? ]+/i', $this->_response['body'], $matches))\n\t\t{\n\t\t\t$allUrls = array_unique($matches[0]);\n\t\t}\n\t\t\n\t\treturn $allUrls;\n\t}", "public function getFileUrls($filename)\n {\n if ($file = $this->findFile($filename)) {\n $parser = new Rails\\Assets\\Parser\\Base($file);\n $parser->parse(Rails\\Assets\\Parser\\Base::PARSE_TYPE_GET_PATHS);\n $urls = [];\n foreach ($parser->urlPaths() as $url) {\n $urls[] = $url . '?body=1';\n }\n return $urls;\n }\n return false;\n }", "function urls($data)\r\n{\r\n $result = array();\r\n if (is_array($data)) {\r\n if (isset($data['href']))\r\n $result[] = $data['href']; else\r\n foreach ($data as $d)\r\n if (is_array($d))\r\n $result[] = $d['href']; else\r\n $result[] = $d;\r\n } else $result[] = $data;\r\n\r\n // Make URLs full\r\n $result2 = array();\r\n global $last_url, $last_base;\r\n $last_domain = substr($last_url, 0, strpos($last_url, '/', 10));\r\n if ($p = strpos($last_url,'?'))\r\n $last_php = substr($last_url,0,$p);\r\n else $last_php = $last_url;\r\n\r\n foreach ($result as $url) {\r\n $url = trim($url);\r\n if (!$url)\r\n continue;\r\n $url = str_replace('./','',$url);\r\n if (substr($url,0,2)=='//') $url = 'http:'.$url;\r\n if (strpos($url, '://') === false)\r\n if ($url[0] == '/')\r\n $url = $last_domain . $url;\r\n elseif ($url[0] == '?') $url = $last_php . $url;\r\n else $url = $last_base . $url;\r\n // Check for right donor\r\n //if (strpos(domain($url),$GLOBALS['instruction']['host'])===false) continue;\r\n $result2[] = $url;\r\n }\r\n $r = $result2;\r\n\r\n if (DEV)\r\n xlogc('urls', $r, $data);\r\n\r\n return $r;\r\n}" ]
[ "0.60054785", "0.59981877", "0.59981877", "0.58989465", "0.5842823", "0.5830648", "0.5781017", "0.57387936", "0.5728988", "0.56817114", "0.5667066", "0.5634258", "0.56116", "0.55779374", "0.5553984", "0.55254227", "0.5517351", "0.5467853", "0.5437017", "0.5364133", "0.53339046", "0.53208184", "0.5314223", "0.53001094", "0.5289591", "0.5288636", "0.52879983", "0.5270122", "0.52432084", "0.5236693" ]
0.7094688
0
Is the message associated with the specified headers a text type?
public static function isText(array $hHeaders = []) { if (isset($hHeaders['content-type']) && preg_match("#text/(plain|html)#", $hHeaders['content-type'], $aMatch)) { return $aMatch[1] == 'html' ? 'html' : 'text'; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isText() {}", "public function isText()\n {\n $mime_type = $this->getMimeType() ?: $this->detectMimeType();\n\n return (strpos($mime_type, 'text') === 0);\n }", "public function isText() {\n\t\treturn MimeType::isText($this);\n\t}", "public function isText()\n {\n return $this->isBinary() === false;\n }", "public function isPlain()\n\t{\n\t\treturn Str::contains($this->getHeaderLine('Content-Type'), '/plain');\n\t}", "public function isText(): bool\n\t{\n\t\treturn $this->isOfType( static::TYPE_TEXT );\n\t}", "public function isText()\n {\n return $this->getName() === 'text';\n }", "function isTextFile($fileName = '')\n{\n $finfo = new finfo(FILEINFO_MIME_TYPE);\n $mime = $finfo->file($fileName);\n return 0 === strncmp($mime, 'text', 4);\n}", "public function isTextType()\n {\n return $this->getModel()->isPlain();\n }", "public function isTextType()\n {\n return PropelTypes::isTextType($this->getType());\n }", "public abstract function isTextPart();", "function isTextType($type)\n{\n return($type == \"string\" or $type == \"varchar\" or $type == \"tinytext\" or $type == \"password\" or\n $type == \"set\" or $type == \"enum\" or $type == \"char\" or $type == \"file\" or isTextAreaType($type));\n}", "public static function isTextType($type, array $text_types = array('text')) {\n return in_array($type, $text_types);\n }", "private function isText($string)\n {\n if (preg_match('~[A-Za-z:/,]~', $string)) {\n return true;\n }\n return false;\n }", "public static function findCharsetFromHeaders( $headers )\n\t{\n\t\tif( array_key_exists('content-type', $headers) ){\n\t\t\treturn self::findCharsetFromContent( $headers['content-type'] );\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function getBodyIsText()\n {\n return $this->bodyIsText;\n }", "public function getBodyIsText()\n {\n return $this->bodyIsText;\n }", "public function hasText()\n {\n return !is_null($this->update->message) &&\n !empty($this->update->message->text);\n }", "public function getIsString() {\n return $this->getType() == \"string\";\n }", "public function hasText()\n {\n if ($this->_text) {\n return true;\n } else {\n return false;\n }\n }", "public function getMessageBodyHeaders($type = 'text')\r\n\t{\r\n\t\t$headers = false;\r\n\t\t$mime_types = array(\r\n\t\t\t'text' => 'text/plain',\r\n\t\t\t'html' => 'text/html'\r\n\t\t);\r\n\t\tif (in_array($type, array_keys($mime_types))) {\r\n\t\t\tforeach ($this->parts as $part) {\r\n\t\t\t\tif ($this->getPartContentType($part) == $mime_types[$type]) {\r\n\t\t\t\t\t$headers = $this->getPartHeaders($part);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tthrow new RuntimeException('Invalid type specified for Parser::getMessageBody. \"type\" can either be text or html.');\r\n\t\t}\r\n\t\treturn $headers;\r\n\t}", "public function isHeader($header);", "private function is_heading( $string ) {\n\t\t$string = trim( $string );\n\t\t// For The Red Beans:.\n\t\tif ( ':' === substr( $string, -1, 1 ) ) {\n\t\t\treturn true;\n\t\t}\n\t\t// <strong>For The Red Beans</strong>.\n\t\tif ( '<strong>' === substr( $string, 0, 8 ) && '</strong>' === substr( $string, -9, 9 ) ) {\n\t\t\treturn true;\n\t\t}\n\t\t// <h3>For The Red Beans</h3>.\n\t\tif ( preg_match( '#^<h[1-6]>.+<\\/h[1-6]>$#', $string ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public abstract function isMime();", "private function isHeader(): bool\n {\n return $this->translation->getOriginal() === '' && $this->translation->getContext() === null;\n }", "static function hasMessage()\n {\n foreach (self::TYPES as $type)\n {\n if (self::has($type)) return true;\n }\n return false;\n }", "abstract public function hasUTF();", "public function hasExplicitText(): bool\n {\n return isset($this->text);\n }", "public function setHeaderAddsCharsetToMediaTypeIfNoneWasSpecifiedAndTypeIsText()\n {\n $message = $this->getAbstractMessageMock();\n\n $message->setHeader('Content-Type', 'text/plain', true);\n $this->assertEquals('text/plain; charset=UTF-8', $message->getHeader('Content-Type'));\n\n $message->setHeader('Content-Type', 'text/plain', true);\n $message->setCharset('Shift_JIS');\n $this->assertEquals('text/plain; charset=Shift_JIS', $message->getHeader('Content-Type'));\n $this->assertEquals('Shift_JIS', $message->getCharset());\n\n $message->setHeader('Content-Type', 'image/jpeg', true);\n $message->setCharset('Shift_JIS');\n $this->assertEquals('image/jpeg', $message->getHeader('Content-Type'));\n }", "public static function isTextFormatterUsed($text_formatter_handle)\n {\n $fields = Symphony::Database()->fetchCol('type', \"SELECT DISTINCT `type` FROM `tbl_fields` WHERE `type` NOT IN ('author', 'checkbox', 'date', 'input', 'select', 'taglist', 'upload')\");\n\n if (!empty($fields)) {\n foreach ($fields as $field) {\n try {\n $table = Symphony::Database()->fetchVar('count', 0, sprintf(\n \"SELECT COUNT(*) AS `count`\n FROM `tbl_fields_%s`\n WHERE `formatter` = '%s'\",\n Symphony::Database()->cleanValue($field),\n $text_formatter_handle\n ));\n } catch (DatabaseException $ex) {\n // Table probably didn't have that column\n }\n\n if ($table > 0) {\n return true;\n }\n }\n }\n\n return false;\n }" ]
[ "0.692273", "0.6901829", "0.6888901", "0.6571261", "0.65481013", "0.64570147", "0.64306873", "0.6398995", "0.6364831", "0.6198548", "0.60552645", "0.60186076", "0.5898842", "0.57575345", "0.5746007", "0.5696775", "0.5696775", "0.5695806", "0.5686755", "0.56797075", "0.56173724", "0.5536112", "0.5528349", "0.55051327", "0.54946893", "0.54694766", "0.54686594", "0.5448372", "0.54371864", "0.5424092" ]
0.7309512
0
Is the message associated with the specified headers an attachment?
public static function isAttachment($hHeaders) { if (isset($hHeaders['content-disposition']) && preg_match("#attachment; filename=\"(.*?)\"#", $hHeaders['content-disposition'], $aMatch)) { return $aMatch[1]; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isAttachment() : bool\n {\n return $this->getDisposition() == 'attachment';\n }", "public function isAttachment(): bool\n\t{\n\t\treturn $this->isOfType( static::TYPE_ATTACHMENT );\n\t}", "protected function _isHeadersRequired()\r\n {\r\n if(count($this->getAttachments()) > 0 || $this->use_headers )\r\n {\r\n return true;\r\n }\r\n return false;\r\n }", "public function attachmentExists()\n {\n foreach ($this->attachment as $attachment) {\n if ($attachment[6] == 'attachment') {\n return true;\n }\n }\n return false;\n }", "public function hasAttachments() {\n return $this->_has(14);\n }", "public function hasAttachments()\n {\n return $this->isMultipart() && $this->countParts() > 0;\n }", "public function is_attachment($attachment = '')\n {\n }", "public static function isMultiPart($hHeaders)\n {\n if (isset($hHeaders['content-type']) && preg_match(\"#multipart/.*?; boundary=\\\"(.*?)\\\"#\", $hHeaders['content-type'], $aMatch))\n {\n return $aMatch[1];\n }\n\n return false;\n }", "public function hasAttachments() {\n return $this->_has(20);\n }", "public function hasAttachments(): bool\n {\n return $this->attachments->isNotEmpty();\n }", "public function hasAttachments() {\n return $this->_has(10);\n }", "public function hasAttachments()\n {\n return !empty($this->_attachments);\n }", "function hasAttachments() {\n\t\t$attachments =& $this->getAttachments();\n\t\treturn ($attachments != null && count($attachments) != 0);\n\t}", "public function getIsMessageAttachment()\n {\n return $this->isMessageAttachment;\n }", "public function attachmentExists()\n {\n }", "public function is_attachment_with_mime_type($attachment, $mime_type)\n {\n }", "public function isHeader($header);", "public function is_attached_to($object_id, $type = ContentObject ::ATTACHMENT_NORMAL)\n {\n $conditions = array();\n $conditions[] = new EqualityCondition(\n new PropertyConditionVariable(\n ContentObjectAttachment::class_name(),\n ContentObjectAttachment::PROPERTY_ATTACHMENT_ID\n ),\n new StaticConditionVariable($object_id)\n );\n $conditions[] = new EqualityCondition(\n new PropertyConditionVariable(\n ContentObjectAttachment::class_name(),\n ContentObjectAttachment::PROPERTY_CONTENT_OBJECT_ID\n ),\n new StaticConditionVariable($this->get_id())\n );\n $conditions[] = new EqualityCondition(\n new PropertyConditionVariable(\n ContentObjectAttachment::class_name(), ContentObjectAttachment::PROPERTY_TYPE\n ),\n new StaticConditionVariable($type)\n );\n $condition = new AndCondition($conditions);\n\n return DataManager::count(ContentObjectAttachment::class_name(), new DataClassCountParameters($condition)) > 0;\n }", "public function supports_attachments()\n {\n return $this instanceof AttachmentSupport;\n }", "public abstract function isMime();", "public function getHasAttachments()\n {\n return $this->hasAttachments;\n }", "function isAttachmentImage($id_attach)\n{\n\t$db = database();\n\n\t// Make sure this attachment is on this board.\n\t$attachmentData = array();\n\t$db->fetchQuery('\n\t\tSELECT\n\t\t\ta.filename, a.fileext, a.id_attach, a.attachment_type, a.mime_type, a.approved, \n\t\t\ta.downloads, a.size, a.width, a.height, m.id_topic, m.id_board\n\t\tFROM {db_prefix}attachments as a\n\t\t\tINNER JOIN {db_prefix}messages AS m ON (m.id_msg = a.id_msg)\n\t\t\tINNER JOIN {db_prefix}boards AS b ON (b.id_board = m.id_board AND {query_see_board})\n\t\tWHERE id_attach = {int:attach}\n\t\t\tAND attachment_type = {int:type}\n\t\t\tAND a.approved = {int:approved}\n\t\tLIMIT 1',\n\t\tarray(\n\t\t\t'attach' => $id_attach,\n\t\t\t'approved' => 1,\n\t\t\t'type' => 0,\n\t\t)\n\t)->fetch_callback(\n\t\tfunction ($row) use (&$attachmentData) {\n\t\t\t$attachmentData = $row;\n\t\t\t$attachmentData['is_image'] = substr($attachmentData['mime_type'], 0, 5) === 'image';\n\t\t\t$attachmentData['size'] = byte_format($attachmentData['size']);\n\t\t}\n\t);\n\n\treturn !empty($attachmentData) ? $attachmentData : false;\n}", "public function is_bounce_message()\n\t{\n\t\t// check Return-Path header line\n\t\t// for \"no return path\" indicator <>\n\t\t// but, Return-Path is changed\n\t\t// if message is Redirected... hmmmn\n\t\t// also should check the Delivery-Status part\n\t\t// if there is one to determine if it is a bounce\n\t\t$rp = $this->preg_match_header_array_key(array('Return-Path','<>'));\n\t\t//pe($this->header_string);\n\t\t// order subject matches in order of likelihood\n\t\t$subject_patterns = array('/Returned mail:/i');\n\t\tforeach ($subject_patterns as $p)\n\t\t{\n\t\t\t// return on the first match\n\t\t\tif ($this->preg_match_subject($p))\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\treturn FALSE;\n\t}", "public function matches(MessageReceived $message): bool\n {\n if ($this->type === null) {\n return $message->getAttachment() !== null;\n }\n\n return hash_equals($message->getAttachment()->getType(), $this->type);\n }", "private function smtpAttach()\n {\n $attachment = array();\n $attachmentCount = count($this->attachment);\n for ($i = 0; $i < $attachmentCount; $i++)\n {\n $filename = $this->attachment[$i];\n\n // Not exist?\n if (!file_exists($filename))\n {\n $this->debugMessages[] = 'Error: Attachment '.$filename.' not found' ;\n return false;\n }\n \n $fileContent = '';\n $fp = fopen($filename, \"r\");\n $fileContent = fread($fp, filesize($filename));\n fclose($fp);\n \n $attachment[$i] = '--'.$this->boundary.$this->breakLine\n .'Content-type: '.mime_content_type($filename).'; name='.basename($filename).$this->breakLine\n .'Content-Disposition: attachment; filename='.basename($filename).$this->breakLine\n .'Content-Transfer-Encoding: base64'.$this->breakLine.$this->breakLine;\n $attachment[$i] .= chunk_split(base64_encode($fileContent));\n }\n \n $attachmentBody = implode($this->breakLine, $attachment).$this->breakLine.'--'.$this->boundary.'--';\n $this->writeCommand($attachmentBody . $this->breakLine);\n return true;\n }", "public function isMessageBodySet()\n {\n return ($this->isHeaderSet(self::CONTENT_LENGTH_HEADER) && \n (strlen($this->getMessageBody()) == $this->getHeader(self::CONTENT_LENGTH_HEADER)));\n }", "public function hasMimeType() {\n return $this->_has(8);\n }", "public function hasHeader(string $name): bool;", "function wp_attachment_is($type, $post = \\null)\n {\n }", "protected function _isEmbeddedBlobAttachment($content, $name) {\n\t\tforeach ($this->getAttachments() as $filename => $fileInfo) {\n\t\t\tif ($filename !== $name) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\treturn $fileInfo['contentId'];\n\t\t}\n\n\t\treturn false;\n\t}" ]
[ "0.7130498", "0.6986624", "0.6970534", "0.68640196", "0.6858158", "0.67706287", "0.6768062", "0.66123694", "0.6503366", "0.648582", "0.64770997", "0.64494306", "0.624622", "0.6107512", "0.6020075", "0.58978534", "0.5841888", "0.57844156", "0.5764501", "0.5762732", "0.57338667", "0.56742215", "0.5649958", "0.56436956", "0.5625593", "0.56162405", "0.55416065", "0.55035204", "0.5484036", "0.5425393" ]
0.79741603
0
Is the message associated with the specified headers a multipart message?
public static function isMultiPart($hHeaders) { if (isset($hHeaders['content-type']) && preg_match("#multipart/.*?; boundary=\"(.*?)\"#", $hHeaders['content-type'], $aMatch)) { return $aMatch[1]; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isMultipart()\n {\n return true;\n }", "public function isMultipart()\n {\n return $this->getAttribute('enctype') === 'multipart/form-data';\n }", "protected function _isHeadersRequired()\r\n {\r\n if(count($this->getAttachments()) > 0 || $this->use_headers )\r\n {\r\n return true;\r\n }\r\n return false;\r\n }", "public function hasAttachments()\n {\n return $this->isMultipart() && $this->countParts() > 0;\n }", "protected function isMultipartRequest(Request $request)\n {\n $header = $request->getHeaderLine('Content-Type');\n return strpos($header, 'multipart/form-data') !== false;\n }", "public static function isAttachment($hHeaders)\n {\n if (isset($hHeaders['content-disposition']) && preg_match(\"#attachment; filename=\\\"(.*?)\\\"#\", $hHeaders['content-disposition'], $aMatch))\n {\n return $aMatch[1];\n }\n\n return false;\n }", "public function isMessageBodySet()\n {\n return ($this->isHeaderSet(self::CONTENT_LENGTH_HEADER) && \n (strlen($this->getMessageBody()) == $this->getHeader(self::CONTENT_LENGTH_HEADER)));\n }", "public function hasFileUpload()\n\t{\n\t\treturn stripos($this->server->get('CONTENT_TYPE'),'multipart/form-data')!==false;\n\t}", "public abstract function isMime();", "public function isFormRequest()\n {\n return str_contains($this->header('CONTENT_TYPE'), '/form-data');\n }", "public function hasAttachments() {\n return $this->_has(14);\n }", "public function isInlineContent($part)\r\n\t{\r\n\t\t$dis = $this->getPartContentDisposition($part);\r\n\t\tif ($dis)//ture\r\n\t\t{\r\n\t\t\tif ($dis == 'inline' || $dis == 'infile') // Add 'infile' as a hack for some stupid emails\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t\t//maybe need it in the future.\r\n\t\t\t\t// if (isset($part['disposition-filename']) && isset($part['content-name']))\r\n\t\t\t\t// {\r\n\t\t\t\t// \t$filename = end(explode('.', $part['disposition-filename']));\r\n\t\t\t\t// \t$name = end(explode('.', isset($part['content-name']);\r\n\t\t\t\t// \tif ($filename == 'html' || $filename == 'htm' || $name == 'html' || $name == 'htm')))\r\n\t\t\t\t// \t{\r\n\t\t\t\t// \t\treturn true;\r\n\t\t\t\t// \t}\r\n\t\t\t\t// \telse\r\n\t\t\t\t// \t{\r\n\t\t\t\t// \t\treturn false;\r\n\t\t\t\t// \t}\r\n\t\t\t\t// }\r\n\t\t\t\t// else if(isset($part['disposition-filename']))\r\n\t\t\t\t// {\r\n\t\t\t\t// \techo $part['disposition-filename'];\r\n\t\t\t\t// \tif (end(explode('.', $part['disposition-filename'])) == 'htm' || end(explode('.', $part['disposition-filename'])) == 'html' )\r\n\t\t\t\t// \t{\r\n\t\t\t\t// \t\treturn true;\r\n\t\t\t\t// \t}\r\n\t\t\t\t// \telse\r\n\t\t\t\t// \t{\r\n\t\t\t\t// \t\treturn false;\r\n\t\t\t\t// \t}\r\n\t\t\t\t// }\r\n\t\t\t\t// else if (isset($part['content-name']))\r\n\t\t\t\t// {\r\n\t\t\t\t// \tif (end(explode('.', $part['content-name'])) == 'html')\r\n\t\t\t\t// \t{\r\n\t\t\t\t// \t\treturn true;\r\n\t\t\t\t// \t}\r\n\t\t\t\t// \telse\r\n\t\t\t\t// \t{\r\n\t\t\t\t// \t\treturn false;\r\n\t\t\t\t// \t}\r\n\t\t\t\t// }\r\n\t\t\t\t// else\r\n\t\t\t\t// {\r\n\t\t\t\t// \treturn true;\r\n\t\t\t\t// }\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function isHeader($header);", "public function isUploadedFile($media)\n {\n if( ! $media instanceof MediaInterface )\n {\n return false;\n }\n \n return $media->getFile() instanceof UploadedFile;\n }", "public function isAttachment() : bool\n {\n return $this->getDisposition() == 'attachment';\n }", "abstract public function supportsMessageIDHeader();", "abstract public function supportsMessageIDHeader();", "abstract public function supportsMessageIDHeader();", "public function isAttachment(): bool\n\t{\n\t\treturn $this->isOfType( static::TYPE_ATTACHMENT );\n\t}", "public function hasAttachments()\n {\n return !empty($this->_attachments);\n }", "public function hasAttachments() {\n return $this->_has(20);\n }", "public function isUploadedFile($params){\n\t\t$val = array_shift($params);\n\t\tif ((isset($val['error']) && $val['error'] == 0) ||\n\t\t\t(!empty( $val['tmp_name']) && $val['tmp_name'] != 'none')\n\t\t) {\n\t\t\treturn is_uploaded_file($val['tmp_name']);\n\t\t}\n\t\treturn false;\n\t}", "public function isUploaded() {\n return ($this->getErrorCode() == UPLOAD_ERR_OK);\n }", "public function isPartial(): bool\n {\n return Server::UPLOAD_TYPE_PARTIAL === $this->header('Upload-Concat');\n }", "public function isUploadedFile() {}", "public function isAllowedMIMEType()\n {\n if (!empty($this->allowed_upload_mime_type)) {\n if (!is_array($this->allowed_upload_mime_type)) {\n NUCLEUS_Exceptions::catcher(MIME_TYPE_LIST_ERROR);\n return false;\n }\n else {\n if (!in_array($this->_file_info['type'], $this->allowed_upload_mime_type)) {\n NUCLEUS_Exceptions::catcher(UPLOAD_MIME_TYPE_DENIED);\n return false;\n }\n }\n }\n\n return true;\n }", "public function hasAttachments(): bool\n {\n return $this->attachments->isNotEmpty();\n }", "public function isUploadedFile($params) {\r\n $val = array_shift($params);\r\n if ((isset($val['error']) && $val['error'] == 0) ||\r\n (!empty( $val['tmp_name']) && $val['tmp_name'] != 'none')\r\n ) {\r\n return is_uploaded_file($val['tmp_name']);\r\n }\r\n return false;\r\n }", "protected function encodeMultipart($parts, $contentType, $headers = array()) {\n\t\t$separator = \"----=_NextPart_\" . preg_replace('/[^0-9]/', '', rand() * 10000000000);\n\n\t\t$headers[\"MIME-Version\"] = \"1.0\";\n\t\t$headers[\"Content-Type\"] = \"$contentType; boundary=\\\"$separator\\\"\";\n\t\t$headers[\"Content-Transfer-Encoding\"] = \"7bit\";\n\n\t\tif($contentType == \"multipart/alternative\") {\n\t\t\t// $baseMessage = \"This is an encoded HTML message. There are two parts: a plain text and an HTML message,\n\t\t\t// open whatever suits you better.\";\n\t\t\t$baseMessage = \"\\nThis is a multi-part message in MIME format.\";\n\t\t} else {\n\t\t\t// $baseMessage = \"This is a message containing attachments. The e-mail body is contained in the first\n\t\t\t// attachment\";\n\t\t\t$baseMessage = \"\\nThis is a multi-part message in MIME format.\";\n\t\t}\n\n\t\t$separator = \"\\n--$separator\\n\";\n\t\t$body = \"$baseMessage\\n\" .\n\t\t\t$separator . implode(\"\\n\".$separator, $parts) . \"\\n\" . trim($separator) . \"--\";\n\n\t\treturn array($body, $headers);\n\t}", "public function hasAttachments() {\n return $this->_has(10);\n }" ]
[ "0.7171997", "0.6818947", "0.64269274", "0.63786787", "0.6342468", "0.6266773", "0.6187231", "0.5930904", "0.5681379", "0.5655106", "0.5620213", "0.55696714", "0.55247223", "0.5487686", "0.5480219", "0.54320806", "0.54320806", "0.54320806", "0.5386963", "0.5379833", "0.53565556", "0.5354621", "0.5342528", "0.5337592", "0.53325725", "0.53275317", "0.5320711", "0.5307728", "0.52963835", "0.529507" ]
0.78154904
0
Initialises all Products with a default value of deleted = 0
public function init() { parent::init(); $this->deleted = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setEmptyProducts(){\n foreach ($this->products as $i => $product) {\n $counts = $product->variant->maxCounts;\n //print_R($product);\n $allCount=0;\n foreach ($counts as $count){\n $allCount = $allCount+$count->count;\n }\n if($allCount<=0 || $product->variant->status==0 || $product->product->status==0 ){\n $product->status=0;\n $product->save(true);\n }\n if($product->count > $allCount){\n $product->count = $allCount;\n $product->save(true);\n }\n if($product->count==0){\n\n //unset($this->products[$i]);\n //$product->status=0;\n //$product->save(true);\n $this->removeProduct($product->id);\n }\n }\n foreach ($this->emptyProducts as $i => $emptyProduct) {\n $emptyCounts = $emptyProduct->variant->maxCounts;\n $emptyAllCount=0;\n foreach ($emptyCounts as $emptyCount){\n $emptyAllCount = $emptyAllCount+$emptyCount->count;\n }\n if($emptyAllCount>0 && $emptyProduct->variant->status==1 && $emptyProduct->product->status==1){\n $emptyProduct->status=1;\n $emptyProduct->save(true);\n }\n }\n }", "private function setupProducts()\n {\n $products = [\n ['name' => 'Product 1'],\n ['name' => 'Product 2'],\n ['name' => 'Product 3'],\n ['name' => 'Product 4'],\n ];\n\n $container = $this->setupData($products, Product::class);\n\n $this->products = $container;\n }", "function admin_init() {\n\t\t$conditions = array('Product.supplier_id' => array(4, 5)); // Alliance - updatovat sukl a pdk\n\t\t\n\t\t// chci nastavit, ze chci updatovat active a dostupnost\n\t\t$products = $this->ProductPropertiesProduct->Product->find('all', array(\n\t\t\t'conditions' => $conditions,\n\t\t\t'contain' => array(),\n\t\t\t'fields' => array('Product.id')\n\t\t));\n\n\t\t$productIds = Set::extract('/Product/id', $products);\n\n\t\t$properties = $this->ProductPropertiesProduct->ProductProperty->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'OR' => array(\n\t\t\t\t\tarray('ProductProperty.name' => 'Product.sukl'),\n\t\t\t\t\tarray('ProductProperty.name' => 'Product.pdk_code')\n\t\t\t\t)\n\t\t\t),\n\t\t\t'contain' => array(),\n\t\t\t'fields' => array('ProductProperty.id')\n\t\t));\n\n\t\t$save = array();\n\t\t\n\t\tforeach ($products as $product) {\n\t\t\tforeach ($properties as $property) {\n\t\t\t\t$update = true;\n\t\t\t\t$save[] = array(\n\t\t\t\t\t'product_id' => $product['Product']['id'],\n\t\t\t\t\t'product_property_id' => $property['ProductProperty']['id'],\n\t\t\t\t\t'update' => $update\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$this->ProductPropertiesProduct->saveAll($save);\n\t\t\n\t\tdie('hotovo');\n\t}", "public function product_delete()\n\t\t\t\t{\n\t\t\t\t}", "private function createInitialProducts()\n {\n $this->product = $this->createProduct();\n $this->product2 = $this->createProduct();\n\n $this->category = $this->createCategory();\n $this->product->addCategory($this->category);\n $this->product2->addCategory($this->category);\n }", "function mockCreateInitialProducts() {\n $listaProdutos = &obterListaProdutos();\n\n $produto = createProduct(\"Caneca de Vidro\", \"Caneca\", \"Suporta 350 ml\", 100, 50.00, \"camiseta.png\");\n $listaProdutos[$produto['id']] = $produto;\n\n $produto = createProduct(\"Caneca de Plastico\", \"Caneca\", \"Suporta 500 ml\", 200, 20.00, \"camiseta.png\");\n $listaProdutos[$produto['id']] = $produto;\n}", "private function initProductDao()\n {\n if(empty($this->productDao))\n {\n $pdo = new PDO(\"sqlite:\".self::PRODUCTION_DATABASE_FILE);\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n \n $this->productDao = new ProductDao($pdo);\n }\n }", "private function setup_products() {\n\t\tglobal $wpdb;\n\n\t\t$ids = [];\n\t\t$d = $wpdb->get_results( \"SELECT distinct `products` FROM `{$wpdb->prefix}thespa_data`\", ARRAY_A );\n\t\tforeach ( $d as $datum ) {\n\t\t\t$prs = explode( \",\", $datum['products'] );\n\t\t\tforeach ( $prs as $pr ) {\n\t\t\t\tif ( !isset( $ids[$pr] ) ) {\n\t\t\t\t\tarray_push($ids, $pr );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$i = 0;\n\t\tforeach ( $ids as $id ) {\n\t\t\t$product = wc_get_product( $id );\n\t\t\tif ( is_object( $product ) ) {\n\t\t\t\t$this->products[$i] = [\n\t\t\t\t\t'id' => $id,\n\t\t\t\t\t'name' => $product->get_title(),\n\t\t\t\t\t'url' => $product->get_permalink(),\n\t\t\t\t\t'img' => wp_get_attachment_image_src( get_post_thumbnail_id( $id ), 'medium', true )[0],\n\t\t\t\t\t'cost' => $product->get_price_html(),\n\t\t\t\t];\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t}", "function Products() {\n\t\t$this->log =LoggerManager::getLogger('product');\n\t\t$this->log->debug(\"Entering Products() method ...\");\n\t\t$this->db = & getSingleDBInstance();\n\t\t$this->column_fields = getColumnFields('Products');\n\t\t$this->log->debug(\"Exiting Product method ...\");\n\t}", "public function clearProducts()\n\t{\n\t\t$sql=\"SET FOREIGN_KEY_CHECKS = 0\";\n\t\t$this->exec_stmt($sql);\n\t\t$tables=array(\"catalog_product_bundle_option\",\n\t\t\t\t\t \"catalog_product_bundle_option_value\",\n\t\t\t\t\t \"catalog_product_bundle_selection\",\n\t\t\t\t\t \"catalog_product_entity_datetime\",\n\t\t\t\t\t \"catalog_product_entity_decimal\",\n\t\t\t\t\t \"catalog_product_entity_gallery\",\n\t\t\t\t\t \"catalog_product_entity_int\",\n\t\t\t\t\t \"catalog_product_entity_media_gallery\",\n\t\t\t\t\t \"catalog_product_entity_media_gallery_value\",\n\t\t\t\t\t \"catalog_product_entity_text\",\n\t\t\t\t\t \"catalog_product_entity_tier_price\",\n\t\t\t\t\t \"catalog_product_entity_varchar\",\n\t\t\t\t\t \"catalog_product_entity\",\n\t\t\t\t\t \"catalog_product_option\",\n\t\t\t\t\t \"catalog_product_option_price\",\n\t\t\t\t\t \"catalog_product_option_title\",\n\t\t\t\t\t \"catalog_product_option_type_price\",\n\t\t\t\t\t \"catalog_product_option_type_title\",\n\t\t\t\t\t \"catalog_product_option_type_value\",\t\t\n\t\t\t\t\t \"catalog_product_super_attribute_label\",\n\t\t\t\t\t \"catalog_product_super_attribute_pricing\",\n\t\t\t\t\t \"catalog_product_super_attribute\",\n\t\t\t\t\t \"catalog_product_super_link\",\n\t\t\t\t\t \"catalog_product_relation\",\n\t\t\t\t\t \"catalog_product_enabled_index\",\n\t\t\t\t\t \"catalog_product_website\",\n\t\t\t\t\t \"catalog_category_product_index\",\n\t\t\t\t\t \"catalog_category_product\",\n\t\t\t\t\t \"cataloginventory_stock_item\",\n\t\t\t\t\t \"cataloginventory_stock_status\");\n\n\n\t\tforeach($tables as $table)\n\t\t{\n\t\t\t$this->exec_stmt(\"TRUNCATE TABLE `\".$this->tablename($table).\"`\");\n\t\t}\n\n\t\t$sql=\"SET FOREIGN_KEY_CHECKS = 1\";\n\n\t\t$this->exec_stmt($sql);\n\t}", "public function removeAll(){\n\t\treturn $this->db->empty_table('products');\n\t}", "private function initProducts()\n {\n $productIds = $this->getRequestProductIds();\n if ($productIds) {\n try {\n return $this->productCollectionFactory\n ->create()\n ->addIdFilter($productIds)\n ->addAttributeToFilter(ProductInterface::TYPE_ID, ConfigurableModel::TYPE_CODE);\n } catch (NoSuchEntityException $e) {\n return false;\n }\n }\n\n return false;\n }", "public function manageOrderProducts()\n {\n }", "public function setUpBeforeTests()\n {\n $initialProductCount = $this->_getProductCount();\n if ($initialProductCount < self::MINIMUM_PRODUCT_COUNT) {\n $this->loginAdminUser();\n// var_dump(\"createProducts()\");\n// $this->_createProducts(10 - $initialProductCount);\n for($i = $initialProductCount; $i < self::MINIMUM_PRODUCT_COUNT; $i++) {\n $this->_createSimpleProduct();\n }\n $initialProductCount = $i;\n }\n }", "public function products()\n {\n\n }", "private function initialiseProductListCollection()\n {\n $numberOfProductsToShow = $this->helper->getNumberOfProductsToShow();\n if ($numberOfProductsToShow) {\n $this->productCollection\n ->addAttributeToSelect('*')\n ->addAttributeToFilter(InstallData::PRODUCT_LIST_ATTRIBUTE, 1)\n ->setPageSize($numberOfProductsToShow)\n ->load();\n } else {\n $this->productCollection\n ->addFieldToFilter('entity_id', 0)\n ->load();\n }\n }", "public function __construct()\n\t{\n\t\t$this->modelProducts = new ProductsModel();\n\t\t/* ********** fin initialisation Model ********** */\n\t}", "public function initShoppingCarts()\n\t{\n\t\t$this->collShoppingCarts = array();\n\t}", "public function __construct(Products $_products = null)\n {\n \n $this->products = $_products;\n }", "public function __construct()\n {\n $this->soft_deletes = true;\n \n parent::__construct();\n }", "public function clear()\n {\n if (null !== $this->aTblEra) {\n $this->aTblEra->removeTblProdInfo($this);\n }\n if (null !== $this->aTblGeneral) {\n $this->aTblGeneral->removeTblProdInfo($this);\n }\n if (null !== $this->aTblMenus) {\n $this->aTblMenus->removeTblProdInfo($this);\n }\n if (null !== $this->aTblProdPhotos) {\n $this->aTblProdPhotos->removeTblProdInfo($this);\n }\n if (null !== $this->aTblProdPrices) {\n $this->aTblProdPrices->removeTblProdInfo($this);\n }\n if (null !== $this->aTblProdPricing) {\n $this->aTblProdPricing->removeTblProdInfo($this);\n }\n if (null !== $this->aTblProdSmaller) {\n $this->aTblProdSmaller->removeTblProdInfo($this);\n }\n if (null !== $this->aTblShippingCategories) {\n $this->aTblShippingCategories->removeTblProdInfo($this);\n }\n $this->prod_id = null;\n $this->prod_price_id = null;\n $this->prod_name = null;\n $this->prod_alt1 = null;\n $this->prod_alt2 = null;\n $this->prod_alt3 = null;\n $this->prod_alt4 = null;\n $this->prod_code = null;\n $this->prod_category = null;\n $this->prod_category_shipping = null;\n $this->prod_writeup = null;\n $this->prod_length = null;\n $this->prod_wingspan = null;\n $this->prod_height = null;\n $this->prod_scale = null;\n $this->prod_links = null;\n $this->prod_linkdescription = null;\n $this->prod_front = null;\n $this->prod_keywords = null;\n $this->prod_keywords_writeup = null;\n $this->prod_title = null;\n $this->prod_description = null;\n $this->prod_general = null;\n $this->prod_era = null;\n $this->prod_company = null;\n $this->prod_related = null;\n $this->prod_related_pa = null;\n $this->prod_related_m3 = null;\n $this->prod_related2 = null;\n $this->prod_saveas = null;\n $this->prod_aircraftreg = null;\n $this->mb = null;\n $this->pa = null;\n $this->m3 = null;\n $this->alreadyInSave = false;\n $this->clearAllReferences();\n $this->resetModified();\n $this->setNew(true);\n $this->setDeleted(false);\n }", "public function __construct(Product $products)\n {\n $this->products = $products;\n }", "public static function productLists()\n {\n array_push(self::$products, \n [\n CART::ID => self::$id,\n CART::NAME => self::$name,\n CART::PRICE => self::$price,\n CART::QUANTITY => self::$quantity\n ]);\n }", "public function indexProducts() {\n // $prods = Product::all() -> where('deleted', false);\n //secondo modo (ORM Eloquent)\n //$prods = Product::where('deleted', false) -> get();\n // terzo modo (Query builder)\n $prods = DB::table('products') -> where('deleted', false) -> get();\n return view('products.index', compact('prods'));\n }", "private function deleteOldProducts(): void\n {\n DB::table('products')\n ->whereIn('id', array_keys($this->databaseProducts))\n ->delete();\n }", "protected function init()\n {\n $this->totais = [\n 'liquidados' => 0,\n 'entradas' => 0,\n 'baixados' => 0,\n 'protestados' => 0,\n 'erros' => 0,\n 'alterados' => 0,\n ];\n }", "public function productsAction()\n {\n $this->_initCoursedoc();\n $this->loadLayout();\n $this->getLayout()->getBlock('coursedoc.edit.tab.product')\n ->setCoursedocProducts($this->getRequest()->getPost('coursedoc_products', null));\n $this->renderLayout();\n }", "public function _construct()\n {\n $this->_initProductCollection();\n parent::_construct();\n }", "public static function loadProductsNew()\n {\n $ret = array();\n $sql = \"select * from products ORDER BY DayAdd DESC limit 0,10\";\n $list = DataProviderMain::execQuery($sql);\n\n while ($row = mysqli_fetch_array($list)) {\n $proId = $row[\"ProID\"];\n $proName = $row[\"ProName\"];\n $tinyDes = $row[\"TinyDes\"];\n $fullDes = $row[\"FullDes\"];\n $price = $row[\"Price\"];\n $quantity = $row[\"Quantity\"];\n $catId = $row[\"CatID\"];\n $view = $row[\"NView\"];\n $dayAdd = $row[\"DayAdd\"];\n $classify = $row[\"Classify\"];\n\n $p = new Products($proId, $proName, $tinyDes, $fullDes, $price, $quantity, $catId, $view, $dayAdd, $classify);\n array_push($ret, $p);\n }\n\n return $ret;\n }", "public function __construct()\n\t{\n $this->soft_deletes = TRUE;\n\t\t$this->return_as = 'array';\n\t\tparent::__construct();\n\t}" ]
[ "0.6920019", "0.62152773", "0.6190046", "0.6120807", "0.6090547", "0.5986478", "0.5965782", "0.59361845", "0.591935", "0.59152794", "0.5780156", "0.57670677", "0.5745913", "0.5745289", "0.5704253", "0.56711525", "0.5609646", "0.5594672", "0.55848855", "0.5563586", "0.5553911", "0.5512895", "0.550635", "0.5505985", "0.55026764", "0.5495825", "0.5492354", "0.5480152", "0.5478711", "0.5463467" ]
0.6457713
1
Checks if product exists in the database based on its name
public function checkProductExistsByName() { $category = $this::find() ->select('id') ->where(['name' => $this->name]) ->one(); if($category !== NULL) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _check_product_in_db($product){\n if (in_array($product, $this->db)){\n // echo 'Product already in the database.';\n return True;\n }\n // echo 'Product not in the database.';\n return False;\n }", "public function productExist()\n {\n if ($this->product) {\n $ret = true;\n } else {\n $ret = false;\n }\n \n return $ret;\n }", "public function checkProductExist($data)\n {\n return $this->db->get_where('products', array('pro_name' => $data['pro_name']));\n }", "function exist($name, $db) {\n $resultSet = $db -> query(\"SELECT * from Pokedex WHERE name = '$name'\");\n $count = $resultSet->rowCount();\n return (!$count == 0);\n }", "public function check_duplicate_product()\n\t{\n\t\t$key=$this->input->post('keyword');\n\t\t$check=$this->db->query(\"SELECT `pr_name` from `products` where `pr_name`='\".$key.\"' AND `pr_deleted`='0'\");\n\t\tif($check->num_rows()>0)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function product_exists($id)\n\t{\n\t\tif($stmt = $this->Database->prepare(\"SELECT id FROM $this->db_table WHERE id = ?\"))\n\t\t{\n\t\t\t$stmt->bind_param('i', $id);\n\t\t\t$stmt->execute();\n\t\t\t$stmt->store_result();\n\t\t\t$stmt->bind_result($prod_id);\n\t\t\t$stmt->fetch();\n\n\t\t\tif($stmt->num_rows > 0)\n\t\t\t{\n\t\t\t\t$stmt->close();\n\t\t\t\treturn TRUE;\n\t\t\t}else\n\t\t\t{\n\t\t\t\t$stmt->close();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "function recordExists()\n {\n global $objDatabase;\n\n $query = \"\n SELECT 1\n FROM \".DBPREFIX.\"module_shop\".MODULE_INDEX.\"_products\n WHERE id=$this->id\";\n $objResult = $objDatabase->Execute($query);\n if (!$objResult || $objResult->EOF) return false;\n return true;\n }", "function assert_product_exists ($product_id) {\n $db = getDb();\n $statement = $db->prepare(\"\n SELECT EXISTS(\n SELECT\n *\n FROM\n product\n WHERE\n product_id = :product_id\n ) AS `exists`\n \");\n\n $statement->execute([\"product_id\"=>$product_id]);\n $result = $statement->fetchObject();\n if (!$result || !$result->exists) {\n throw new RowNotFoundException(\"Product not found\");\n }\n}", "public function checkProducto(){\n $sql='SELECT * FROM producto where nombre = ?';\n $params=array($this->nombre);\n return Database::getRow($sql, $params);\n }", "private function exist() {\n $stmt = $this->pdo->prepare(\"SELECT * FROM $this->table WHERE \"\n . \"product_category_id= :cat_id and product_id= :prod_id \");\n $stmt->bindValue(\":cat_id\", $this->product_category_id, \\PDO::PARAM_INT);\n $stmt->bindValue(\":prod_id\", $this->product_id, \\PDO::PARAM_INT);\n $stmt->execute();\n return $stmt->fetch();\n }", "public function checkProductifExists() {\n if (func_num_args() > 0) {\n $user_id = func_get_arg(0);\n $product_id = func_get_arg(1);\n $hotel_id = func_get_arg(2);\n\n try {\n $select = $this->select()\n ->where('user_id = ?', $user_id)\n ->where('hotel_id = ?', $hotel_id)\n ->where('product_id = ?', $product_id);\n\n $result = $this->getAdapter()->fetchRow($select);\n\n if ($result) {\n return $result;\n } else {\n return null;\n }\n } catch (Exception $ex) {\n throw new Exception(\"argument not passed: \" . $ex);\n }\n } else {\n throw new Exception(\"argument not passed\");\n }\n }", "function _checkIfSkuExists($sku, $connection_read){ \n $sql = \"SELECT COUNT(*) AS count_no FROM catalog_product_entity WHERE sku = ?\";\n $count = $connection_read->fetchOne($sql, array($sku));\n if($count > 0){\n return true;\n }else{\n return false;\n }\n}", "function checkAvailableProduct($prodNum )\n\t\t{\n\t\t\t$db = dbConnect::getInstance();\n \t\t $mysqli = $db->getConnection();\n\t\t\t$query = \" select * from products_tb where id= '\".$prodNum.\"' and status ='1' \"; \n $res = $mysqli->query($query) or die (mysqli_error($mysqli));\n\t\t\tif(mysqli_num_rows($res) > 0)\n\t\t\t{\n\t\t\t\treturn true;\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function check_software_name()\n {\n $q = $this->db\n ->where('action_type', \"install\")\n ->where('computer_ser', $this->input->post('computer'))\n ->where('name', $this->input->post('sw_name'))\n ->where('company_id', $this->session->userdata('company_id'))\n ->limit(1)->get('software');\n\n if ($q->num_rows == 1)\n {\n return true;\n\n } else {\n\n return false;\n }\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function containsProduct(Product $product): bool;", "function exist($name, $table) {\n\t$dbh = db_connect(); #DATABASE CONNEXION\n\n\t$name = strtolower($name); // ex: 'Pop' -> 'pop'\n\n\t# TABLE - CAT / SUB-CAT / ARTIST -----------------------\n\t$sql = \"SELECT EXISTS( SELECT * FROM \" . $table . \" WHERE NAME = '\" . $name . \"')\";\n\t$stmt = $dbh->prepare($sql);\n\t$stmt->execute() or die(error);\n\n\tforeach ($stmt as $variable) {\n\t\treturn($variable[0]);\n\t}\n}", "public function findDuplicateProducts($id, $productname)\n {\n $query = $this->getEntityManager()\n ->createQuery(\n \"SELECT count(ut.id) as cnt\n FROM Vlreleases\\UserBundle\\Entity\\Product ut \n WHERE ut.productname = ('$productname') AND ut.id != $id\"\n );\n try {\n if ($query->getSingleScalarResult() > 0) {\n return true;\n }\n } catch (\\Doctrine\\ORM\\NoResultException $e) {\n return null;\n }\n }", "public function exists($name);", "public function exists($name);", "public function exists($name);", "public function exists($name);", "public function exists($name);", "public function exists($name);", "public function getProductID($name){\n try{\n $sql = \"Select * from product where product_name = ?\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute([$name]);\n\n $result = $stm->fetch();\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), 'Inventory|listProduct');\n $result = 2;\n }\n\n return $result->id_product;\n }", "public function getByProductName($name)\n {\n return DB::table('product_models')\n ->where('name',$name)\n ->first();\n }" ]
[ "0.76533973", "0.7240629", "0.71316373", "0.6875869", "0.68157244", "0.6765152", "0.6738141", "0.6593235", "0.6587415", "0.65115285", "0.64469236", "0.6420865", "0.6396978", "0.63568074", "0.6334977", "0.6334977", "0.6334977", "0.6334977", "0.6334977", "0.6328212", "0.63247377", "0.6229839", "0.6225849", "0.6225849", "0.6225849", "0.6225849", "0.6225849", "0.6225849", "0.6224214", "0.6159107" ]
0.77978873
0