query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
sequencelengths
0
30
negative_scores
sequencelengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Set min id value
public function setMinId($min) { $this->_minId = intval($min); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMinId()\n {\n return $this->_minId;\n }", "public function getMinimumId() {\n return $this->minimumId;\n }", "public function setMinimumId($minimumId) {\n $this->minimumId = $minimumId;\n return $this;\n }", "public function setMin(int $min): self;", "function setMin($min) {\n $this->min = $min;\n }", "function setMinimum($min) {\n\t\t$this->min = $min;\n\t}", "function update_min_id($new_min_id)\n\t{\n\t\t$this->openDb();\n\t\t\n\t\t$query = \"UPDATE persistEntries SET min_id ='\".$new_min_id.\"';\";\n\t\t$result = mysql_query($query);\n\t\tfile_put_contents('activity.log', \"Update Query: \".$query.\"\\r\\n\", FILE_APPEND);\n\t\tif (!$result) {file_put_contents('activity.log', \"UpdateMinID Query Failed\\r\\n\", FILE_APPEND); }\n\t\telse {file_put_contents('activity.log', \"UpdateMinID Query Succeeded\\r\\n\", FILE_APPEND); }\t\t\n\t\t$this->closeDb();\n\t}", "function min_id()\n\t{\n\t\t$this->openDb();\n\t\t$query = \"SELECT min_id FROM persistEntries;\";\n\t\t$result = mysql_query($query);\n\t\t$tbl = mysql_fetch_array($result);\n\t\t$min_id = $tbl['min_id'];\n\t\t$this->closeDb();\n\t\treturn $min_id;\n\t}", "protected function setId($value)\n {\n $this->_id = (int)$value;\n }", "public function setId($id){\n\t if(filter_var($id, FILTER_VALIDATE_INT)){\n //valore id valido\n $this->id = $id;\n }\n\t}", "public function setMin(int $min): Number\n {\n return $this->setData(self::MIN, $min);\n }", "public function set_ID($int) {\n\t\tif (is_numeric($int) && $int > 0) {\n\t\t\t$this -> id = \"= $int\";\n\t\t} else {$this -> id = \"> 0\";\n\t\t}\n\t}", "function MINid($path, $tabla){\n \n // Inclusion de archivos necesarios\n require_once $path.'core/db.class.core.php';\n require_once $path.'includes/config.inc.php';\n \n $debug = DEBUG;\n \n // Crear la instancia y conectar a la BD\n $conec = new db();\n $conec->dbConexion(); \n \n $sql_minid = \"SELECT MIN(id) AS id FROM \".$tabla;\n $query_minid = $conec->dbQuery($sql_minid, $debug);\n $datos_minid = $conec->dbFetchArray($query_minid);\n $minid = $datos_minid['id'];\n \n return $minid;\n }", "private function setId($id) {\r\n\r\n\t\t$this->id = isset($id) && is_numeric($id) && $id > 0 ? (int) $id : NULL;\r\n\t\treturn $this;\r\n\t}", "function setId($id = -1) \n\t{\n\t\t$this->id = $id;\n\t}", "public function setMinValue($value) {\n\t\t$value = JsonFormBuilder::forceNumber($value);\n\t\tif($this->_maxValue!==NULL && $this->_maxValue<$value){\n\t\t\tJsonFormBuilder::throwError('[Element: '.$this->_id.'] Cannot set minimum value to \"'.$value.'\" when maximum value is \"'.$this->_maxValue.'\"');\n\t\t}else{\n\t\t\t$this->_minValue = JsonFormBuilder::forceNumber($value);\n\t\t}\n\t}", "private function definirId($id)\n {\n $this->id = (int)$id;\n }", "public function setMinRequired($minRequired)\n\t{\n\t\t$this->_minRequired = (int)$minRequired;\n\t}", "private function __validate_id() {\n if (isset($this->initial_data[\"id\"])) {\n $id = (is_numeric($this->initial_data[\"id\"])) ? intval($this->initial_data[\"id\"]) : null;\n if (array_key_exists($id, $this->config[\"schedules\"][\"schedule\"][$this->parent_id][\"timerange\"])) {\n # Don't allow client to delete the last time range\n if (count($this->config[\"schedules\"][\"schedule\"][$this->parent_id][\"timerange\"]) !== 1) {\n $this->id = intval($id);\n $this->validated_data = $this->config[\"schedules\"][\"schedule\"][$this->parent_id][\"timerange\"][$this->id];\n } else {\n $this->errors[] = APIResponse\\get(4165);\n }\n } else {\n $this->errors[] = APIResponse\\get(4164);\n }\n } else {\n $this->errors[] = APIResponse\\get(4163);\n }\n }", "function setId($value){\n\t\t$this->id = $value;\n\t}", "public function set_id ($id){\n $this->id = (int) $id;\n }", "public function min(int $min): Variable\n\t{\n\t\tif($this->state !== self::STATE_IGNORE && $this->getSize() < $min)\n\t\t{\n\t\t\t$this->addError('min.' . $this->getType(), compact('min'));\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "protected function set_id( $a )\r\n\t\t{\r\n\t\t\tif ( is_array( $a ) && isset( $a[ $this->prefix . \"id\" ] ) )\r\n\t\t\t\t$a = (int)$a[ $this->prefix . \"id\" ];\r\n\t\t\tif ( is_string( $a ) && !Database::get_total( $this->table, \"WHERE \" . $this->prefix . \"id = '\" . addslashes( $a ) . \"'\" ) )\r\n\t\t\t\ttrigger_error( \"Row #\" . $a . \" in table `\" . $this->table . \"` does not exist.\", E_USER_ERROR );\r\n\t\t\telse\r\n\t\t\t\treturn $this->id = $a;\r\n\t\t}", "public function setMinValue($minValue);", "private function checkId()\n {\n if (empty($this->id)) {\n $this->id = $this->getNextId(null);\n }\n }", "public function setIdRange($min, $max)\n {\n $this->_minId = (int)$min;\n $this->_maxId = (int)$max;\n }", "public function setMin($start) {\n $this->attrs()->set('data-min', $start);\n return $this;\n }", "public function setMin($var)\n {\n GPBUtil::checkInt32($var);\n $this->min = $var;\n\n return $this;\n }", "function SetMinimum($minimum) {\n\t\tif (mysql_query('UPDATE kags SET minimum=' . ((int) $minimum) . ' WHERE id=' . $this->id, $this->db)) {\n\t\t\t$this->UpdateCache();\n\t\t\t$this->UpdatePoints(1);\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function getUniqueID(){\n\n $maxID = $this->Model->maxFrom('id','tbl_sukarelawan');\n\n return (int) $maxID;\n }" ]
[ "0.7404561", "0.71901256", "0.67962694", "0.65821195", "0.65816873", "0.6524921", "0.6501405", "0.64912814", "0.60998607", "0.597368", "0.5936418", "0.5928937", "0.5923196", "0.5917392", "0.59152013", "0.58958834", "0.58793354", "0.5863824", "0.58530325", "0.5812306", "0.5809812", "0.57936454", "0.57881117", "0.5778591", "0.57724583", "0.57722354", "0.5763584", "0.5732728", "0.5718347", "0.5677364" ]
0.8433793
0
Check is id range setted
public function getIsIdRangeSetted() { return is_int($this->_minId) && is_int($this->_maxId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkID()\n\t{\n\t\t$ids = $this->getCronIDs();\n\t\treturn in_array($this->_id, $ids);\n\t}", "private function __validate_id() {\n if (isset($this->initial_data[\"id\"])) {\n $id = (is_numeric($this->initial_data[\"id\"])) ? intval($this->initial_data[\"id\"]) : null;\n if (array_key_exists($id, $this->config[\"schedules\"][\"schedule\"][$this->parent_id][\"timerange\"])) {\n # Don't allow client to delete the last time range\n if (count($this->config[\"schedules\"][\"schedule\"][$this->parent_id][\"timerange\"]) !== 1) {\n $this->id = intval($id);\n $this->validated_data = $this->config[\"schedules\"][\"schedule\"][$this->parent_id][\"timerange\"][$this->id];\n } else {\n $this->errors[] = APIResponse\\get(4165);\n }\n } else {\n $this->errors[] = APIResponse\\get(4164);\n }\n } else {\n $this->errors[] = APIResponse\\get(4163);\n }\n }", "protected function is_valid_id()\n\t{\n\t\treturn\t!empty($this -> id);\n\t}", "public function setIdRange($min, $max)\n {\n $this->_minId = (int)$min;\n $this->_maxId = (int)$max;\n }", "private function validateId($id) { return (isset($id) && (int) $id > 0) ? true : false; }", "public function valid(){\n\t\t\t\treturn (isset($this->ids[$this->position]));\n\t\t\t}", "private function check_ids(): bool\n {\n foreach (explode(',', $this->id) as $id)\n if (!$this->field_name_exists($id))\n throw new Exception(sprintf('Id not set as field: %s', $id));\n\n return true;\n }", "function isSlotAvailable($date, $start, $end, $id = null) {\n // FIRST GAME START\n $firstTime = DateTime::createFromFormat('H:i:s', \"09:00:00\");\n // LAST GAME START\n $lastTime = DateTime::createFromFormat('H:i:s', \"20:00:00\");\n \n $startTime = DateTime::createFromFormat('H:i:s', $start);\n \n if( $startTime < $firstTime || $lastTime < $startTime) {\n // out side work hours\n return false;\n }\n \n if($id) {\n $avail = $this->db->prepare('select count(id) from booking where schedule = ? and not(end <= ? or `start` >= ?) and id != ?');\n $avail->execute(array($date, $start, $end, $id));\n } else {\n $avail = $this->db->prepare('select count(id) from booking where schedule = ? and not(end <= ? or `start` >= ?)');\n $avail->execute(array($date, $start, $end));\n }\n \n $result = intval($avail->fetchColumn());\n \n return $result == 0;\n }", "public function hasUniqueid(){\n return $this->_has(13);\n }", "private function checkId()\n {\n if (empty($this->id)) {\n $this->id = $this->getNextId(null);\n }\n }", "public function hasFromid(){\n return $this->_has(6);\n }", "public function hasId(){\n return $this->_has(5);\n }", "public function hasId(){\n return $this->_has(4);\n }", "public function hasId(){\n return $this->_has(9);\n }", "public function hasSearchrange(){\n return $this->_has(16);\n }", "function validateLocation($location_id)\n{\n $connect = sqlConnect();\n\n // check to make sure no ranges exist in the location\n $result = mysqli_query($connect, sprintf(\n 'SELECT count(*) as total_ranges from stacks_%s',\n mysqli_real_escape_string($connect, $location_id)\n ));\n\n $total_ranges = mysqli_fetch_array($result)[0];\n\n if ($total_ranges > 1) {\n // more than 1 range, don't mess with it\n return false;\n } elseif ($total_ranges == 1) {\n // if there's 1 range, make sure it's not assign to a specific\n // call number range\n $result = mysqli_query($connect, sprintf(\n 'SELECT beginning_call_number, ending_call_number from stacks_%s',\n mysqli_real_escape_string($connect, $location_id)\n ));\n\n $row = mysqli_fetch_array($result);\n\n if ($row['beginning_call_number'] != '*'\n || $row['ending_call_number'] != '*') {\n return false;\n }\n }\n\n // Returns true, it's either 0 range or 1 range with all\n // call numbers range assign to one single location\n return true;\n}", "public function checkId(){\n\n }", "public static function isLabBooked($id, $start, $end) {\n $query = DB::connection()->prepare('SELECT * FROM TimeSlot WHERE (starttime < :end AND :start < endtime) AND (freeslots < maxreservations OR maxreservations = 0) AND laboratory_id = :id');\n $query->execute(array('id' => $id, 'start' => $start, 'end' => $end));\n $rows = $query->fetchAll();\n if (empty($rows)) {\n return false;\n } else {\n return true;\n }\n }", "abstract protected function validateId($id): bool;", "private function __validate_id() {\n if ($this->validate_id === false) {\n } elseif (isset($this->initial_data[\"id\"])) {\n if (array_key_exists($this->initial_data[\"id\"], $this->config[\"unbound\"][\"hosts\"])) {\n $this->id = $this->initial_data[\"id\"];\n } else {\n $this->errors[] = APIResponse\\get(2016);\n }\n } else {\n $this->errors[] = APIResponse\\get(2015);\n }\n }", "public function hasRangeAllowed(): bool\n {\n return $this->has(ConfigUtil::ALLOW_RANGE);\n }", "function isId($id)\n{\n\t// and the integer is > 0, then it's a valid ID.\n\tif(app_is_int($id) && $id > 0) {\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}", "function checkId($id)\n\t{\n\t\tif( $id < 0 )\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t\tif( (intVal($id) == 0 && $id != 0) || (intVal($id) == 1 && $id != 1) )\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn 1;\n\t}", "abstract public static function hasIdProperty(): bool;", "public function checkId()\n {\n if (!$this->config->getEnable()) {\n return true;\n }\n if(!$this->getPaymentResource()->checkSeller($this->config->getId()))\n {\n $this->config->addError(new IdException());\n }\n }", "public function hasRegionId(){\n return $this->_has(7);\n }", "public function hasRowRanges(){\n return $this->_has(2);\n }", "public function hasId()\n\t{\n\t\treturn ($this->id > 0);\n\t}", "public function hasId()\n\t{\n\t\treturn ($this->id > 0);\n\t}", "public function inRange($attr, $from, $to);" ]
[ "0.663614", "0.66188216", "0.61312276", "0.61087245", "0.61078835", "0.60503834", "0.59937805", "0.5967768", "0.59649277", "0.5933955", "0.59292895", "0.5917811", "0.5886184", "0.5885825", "0.58746135", "0.5835862", "0.5826901", "0.58163106", "0.58065176", "0.5792774", "0.57808673", "0.5765444", "0.57596457", "0.5739204", "0.5714035", "0.57046115", "0.5658467", "0.56468475", "0.56468475", "0.5616399" ]
0.8063446
0
The standard IDF (Inverse Document Frequency) calculation may cause undesired keyword penalization effects in the BM25 weighting functions. Either 'normalized' (default) or 'plain'
public function setIdf($idf) { if ($idf != 'normalized' && $idf != 'plain') { throw new ESphinxException('Invalid value for idf flag'); } $this->_idf = $idf; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findNormalizedQuery($qVector,$TfIdf,$queryFinal,$tokeIndex){\r\n\t//length of the query vector\r\n\t$lengthQV = 0;\r\n\t\r\n\t//find the tf-idf score for the query\r\n\tfor($i=0;$i<count($queryFinal);$i++){\r\n\t\t$freqVal = $qVector[$tokeIndex[$queryFinal[$i]]];\r\n\t\t$qVector[$tokeIndex[$queryFinal[$i]]] = $freqVal*$TfIdf[$queryFinal[$i]][0];\r\n\t\t$score = $qVector[$tokeIndex[$queryFinal[$i]]];\r\n\t\t$lengthQV = $lengthQV+$score*$score;\r\n\t}\r\n\t\r\n\t//normalize the query\r\n\tif($lengthQV != 0){\r\n\t\tfor($i=0;$i<count($queryFinal);$i++){\t\t\r\n\t\t\t$qVector[$tokeIndex[$queryFinal[$i]]] = $qVector[$tokeIndex[$queryFinal[$i]]]/$lengthQV;\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $qVector;\r\n}", "function normalizer_normalize($input, $form = Normalizer::FORM_C) {}", "public function idfFreq($docFreq, $numDocs)\n {\n return log($numDocs/(float)($docFreq+1)) + 1.0;\n }", "function normalizer_is_normalized($input, $form = Normalizer::FORM_C) {}", "function recognized_font_weights() {\n return apply_filters( 'recognized_font_weights', array(\n 'normal' => 'Normal',\n 'bold' => 'Bold',\n 'bolder' => 'Bolder',\n 'lighter' => 'Lighter',\n '100' => '100',\n '200' => '200',\n '300' => '300',\n '400' => '400',\n '500' => '500',\n '600' => '600',\n '700' => '700',\n '800' => '800',\n '900' => '900',\n 'inherit' => 'Inherit'\n ) );\n}", "public function getFrequency() : float {\n return $this->fFrequency;\n }", "public function normalize();", "public function normalize();", "function QDSimilarityVector($queryFinal,$TfIdf,$tokeIndex,$qVector,$N){\r\n\t$QDsimilarity = array_fill(1,$N,0);\r\n\tfor($i=0;$i<count($queryFinal);$i++){\r\n\t\t$token = $TfIdf[$queryFinal[$i]];\r\n\t\t//find document index and add the partial values from dot product\r\n\t\tforeach($token as $key => $value){\r\n\t\t\tif($key > 0 && $key<=$N){\r\n\t\t\t\t$QDsimilarity[$key] = $QDsimilarity[$key]+$value*$qVector[$tokeIndex[$queryFinal[$i]]];\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t}\r\n\t}\r\n\treturn $QDsimilarity;\r\n}", "function normalisasi($normal){\n\t\t$total = array_sum($normal);\n\t\tforeach($normal as $c){\n\t\t\t$normalized[] = $c/$total;\n\t\t}\n\t\t\t$normalisasi['total'] \t = $total;\n\t\t\t$normalisasi['normalized'] = $normalized;\n\n\t\treturn $normalized;\n\t\t}", "function getFTIwords() {\n\t\t$bits = $this->words;\n\t\tforeach ($this->phrases as $p) {\n\t\t\t$bits[] = '('.implode ('&', explode (' ', $p)).')';\n\t\t}\n\t\tif ($this->isExact) {\n\t\t\t$query = implode('&', $bits);\n\t\t} else {\n\t\t\t$query = implode('|', $bits);\n\t\t}\n\t\treturn $query;\n\t}", "public function getMltMinDocFrequency() {}", "public static function normalize($input, $form = Normalizer::FORM_C) {}", "function qtype_correctwriting_compute_kerning($a, $b) {\r\n // Since we switched to monospace rendering, we do not need the kerning\r\n return 0;\r\n}", "function get_standard_deviations() {\n $d = $this->midterm_arr;\n $carry = 0.0;\n $n = count($d);\n\n foreach($d AS $index=>$value) {\n $d[$index] = ((double)$value) - $this->ave_midterm;\n }\n\n foreach($d as &$value) {\n $value = $value * $value;\n $carry = $carry + $value; \n //echo \"each carry is \".$carry.\"\\n\";\n }\n $this->sd_midterm = sqrt($carry /((int)($n-1)));\n\n //for final\n $d = $this->final_arr;\n\n foreach($d AS $index=>$value) {\n $d[$index] = ((double)$value) - $this->ave_final;\n }\n\n foreach($d as &$value) {\n $value = $value * $value;\n $carry = $carry + $value; \n //echo \"each carry is \".$carry.\"\\n\";\n }\n $this->sd_final = sqrt($carry /((int)($n-1))); \n }", "function norm($normal){\n\t\t$total = max($normal);\n\t\tforeach($normal as $c){\n\t\t\t$normalized[] = $c/$total;\n\t\t}\n\t\t\t$normalisasi['total'] \t = $total;\n\t\t\t$normalisasi['normalized'] = $normalized;\n\n\t\treturn $normalized;\n\t\t}", "function setFrequency($val){ return $this->setField('frequency',$val); }", "private function process_frequency_table() {\n arsort($this->table);\n $count = count($this->table);\n $diffcount = ($this->max_count - $this->min_count) != 0 ? ($this->max_count - $this->min_count) : 1;\n $diffsize = ($this->max_font_size - $this->min_font_size) != 0 ? ($this->max_font_size - $this->min_font_size) : 1;\n $slope = $diffsize / $diffcount;\n $yintercept = $this->max_font_size - ($slope * $this->max_count); \n \n //cut the table so we have only $this->words_limit\n $this->table = array_slice($this->table, 0, $this->words_limit);\n \n foreach($this->table as $key => $val) { \t\n $font_size = (integer)($slope * $this->table[$key]->count + $yintercept);\n\n // Set min/max val for font size\n if ($font_size < $this->min_font_size) {\n $font_size = $this->min_font_size;\n } elseif ($font_size > $this->max_font_size) {\n $font_size = $this->max_font_size;\n }\n $this->table[$key]->size = $font_size;\n\n $this->table[$key]->angle = 0;\n if (rand(1, 10) <= $this->vertical_freq) $this->table[$key]->angle = 90;\n $this->table[$key]->box = imagettfbbox ($this->table[$key]->size * $this->padding_size, $this->table[$key]->angle - $this->padding_angle, $this->font, $key);\n }\n }", "function SetNormal ( &$pdf ) {\n $pdf->SetFont( MRUPDF_REGULAR_FONT_FACE, '', MRUPDF_REGULAR_FONT_SIZE );\n}", "public static function getRawDecomposition(string $input, int $form = Normalizer::FORM_C) {}", "public function getFInic()\n {\n return $this->f_inic;\n }", "public function applySnowballStemmer(){\n\t $this->tokenDoc->applyStemmer($this->snowballStemmer, true);\n\t}", "public function get_validation_stem_numeration()\n {\n return $this->validation_stem_numeration;\n }", "public static function tfIdf(string $matchinfoOut)\n {\n $arrInt32 = unpack('L*', $matchinfoOut);\n\n // note: returned array starts at index 1, not 0\n $numPhrases = array_pop($arrInt32);\n $numCols = array_pop($arrInt32);\n $numRows = array_pop($arrInt32);\n\n $score = 0;\n $tf = 0;\n foreach ($arrInt32 as $i => $int) {\n $remainder = ($i - 1) % 3;\n if ($remainder === 0) {\n $tf = $int; // term frequency\n } elseif ($remainder === 2) {\n // $int = document frequency\n $idf = $int > 0 ? log10($numCols * $numRows / $int) : 0;\n $score += $tf * $idf;\n }\n }\n\n return $score;\n }", "public function getNormalizedMeasure()\n {\n return $this->_normalizedMeasure;\n }", "public function set_frequency(float $newval): int\n {\n $rest_val = strval(round($newval * 65536.0));\n return $this->_setAttr(\"frequency\", $rest_val);\n }", "public function getFieldWeights() {\n $keywordFilter = (!empty($_GET['keyword']));\n $perfFilter = (!empty($_GET['performance']));\n if ($keywordFilter && $perfFilter) {\n // ranker=proximity_bm25.\n return \"field_weights=(perftitleclean=110, performancetitle=120, \" .\n \"commentpclean=75, commentcclean=75, roleclean=100, \" .\n \"performerclean=100, authnameclean=100), \" .\n \"ranker=proximity_bm25\";\n // \"ranker=expr('sum((lcs*hit_count+bm25)*user_weight)')\";\n } elseif ($keywordFilter) {\n return \"field_weights=(perftitleclean=100, commentpclean=75, \" .\n \"commentcclean=75, roleclean=100, performerclean=100, \" .\n \"authnameclean=100), ranker=sph04\";\n // \"ranker=expr('sum((lcs*hit_count+bm25)*user_weight)')\";\n } elseif ($perfFilter) {\n return \"field_weights=(perftitleclean=150, performancetitle=100), \" .\n \"ranker=wordcount\";\n }\n return FALSE;\n }", "public function testNormalization() {\n FilterFormat::create([\n 'format' => 'filter_html_enabled',\n 'name' => 'Filter HTML enabled',\n 'filters' => [\n 'filter_html' => [\n 'status' => 1,\n 'settings' => [\n 'allowed_html' => '<strong>',\n ],\n ],\n ],\n ])->save();\n FilterFormat::create([\n 'format' => 'filter_htmlcorrector_enabled',\n 'name' => 'Filter HTML corrector enabled',\n 'filters' => [\n 'filter_htmlcorrector' => [\n 'status' => 1,\n ],\n ],\n ])->save();\n FilterFormat::create([\n 'format' => 'neither_filter_enabled',\n 'name' => 'Neither filter enabled',\n 'filters' => [],\n ])->save();\n\n $filtered_markup = FilteredMarkup::create('<div><strong><span>Hello World</span></strong></div>');\n // With either HTML filter enabled, text_summary() will normalize the text\n // using HTML::normalize().\n $summary = text_summary($filtered_markup, 'filter_html_enabled', 30);\n $this->assertStringContainsString('<div><strong><span>', $summary);\n $this->assertStringContainsString('</span></strong></div>', $summary);\n $summary = text_summary($filtered_markup, 'filter_htmlcorrector_enabled', 30);\n $this->assertStringContainsString('<div><strong><span>', $summary);\n $this->assertStringContainsString('</span></strong></div>', $summary);\n // If neither filter is enabled, the text will not be normalized.\n $summary = text_summary($filtered_markup, 'neither_filter_enabled', 30);\n $this->assertStringContainsString('<div><strong><span>', $summary);\n $this->assertStringNotContainsString('</span></strong></div>', $summary);\n }", "private function _calculateConfidenceIndicator(){\n if($this->weights_total != 0){\n $temp_float = ($this->item_score / $this->weights_total);\n $this->textbook_confidence_indicator = round($temp_float,2,PHP_ROUND_HALF_DOWN);\n }\n }", "function word_frequency($content) {\n //What analysis are we doing\n // (int # of words to analyze per phrase) => (string label for that phrase)\n $analysis = array(\n 1 => \"Single-Word Analysis\"\n );\n \n //strip out bad charecters, just the words, ma'am\n $content = htmlspecialchars_decode($content);\n $content = preg_replace(\"/(,|\\\"|\\.|\\?|:|!|;| - )/\", \" \", $content);\n $content = preg_replace(\"/http/\", \" \", $content);\n $content = preg_replace(\"/\\n/\", \" \", $content);\n $content = preg_replace(\"/\\s\\s+/\", \" \", $content);\n $content = preg_replace(\"/\\|/\", \" \", $content);\n $content = preg_replace(\"/\\'/\", \" \", $content);\n \n \n //split content on words\n $content = explode(\" \", $content);\n \n $results = array();\n \n //loop through each analysis group and run our test\n foreach ($analysis as $id => $title) {\n $stats = build_stats($content, $id);\n $results = array_merge($results, $stats);\n }\n \n \n \n $clean_results = array();\n //format results in a similar way to Open Calais\n \n foreach ($results as $key => $value) {\n \n $frequency = $value; \n $temp = array(\n 'term' => $key,\n 'frequency' => $frequency, \n 'source' => 'keywords',\n 'type' => ''\n );\n \n if (strlen($key)> 2 && $frequency > 1) { \n $clean_results[] = $temp;\n } \n }\n \n \n return $clean_results;\n}" ]
[ "0.5515698", "0.49527007", "0.49167264", "0.49138778", "0.48202634", "0.48000604", "0.47847778", "0.47847778", "0.47237638", "0.4662558", "0.4598118", "0.45945486", "0.4583835", "0.4580914", "0.4562931", "0.4562899", "0.45033294", "0.4447632", "0.44285908", "0.4425877", "0.4417071", "0.4410657", "0.44084206", "0.4379058", "0.4376874", "0.4347691", "0.433649", "0.42983225", "0.42370886", "0.42300698" ]
0.55522376
0
Adds a pair of Yes/No Radio Buttons
function skin_form_yes_no( $name, $default_val="", $sep="&nbsp;&nbsp;&nbsp;" ) { $yes = "<input type='radio' name='$name' value='1' />&nbsp;Yes"; $no = "<input type='radio' name='$name' value='0' />&nbsp;No"; if ($default_val == 'true' || $default_val == '1') { $yes = "<input type='radio' name='$name' value='1' checked />&nbsp;Yes"; } else { $no = "<input type='radio' name='$name' value='0' checked />&nbsp;No"; } return $yes.$sep.$no; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function yesnoRadioList($tag_name, $tag_attribs, $selected, $yes = _CMN_YES, $no = _CMN_NO)\n\t{\n\t\t$arr = array(mosHTML::makeOption('0', $no), mosHTML::makeOption('1', $yes));\n\t\treturn mosHTML::radioList($arr, $tag_name, $tag_attribs, $selected);\n\t}", "public function setCheckedYes()\n\t{\n\t\t$this->setAttribute( \"checked\");\n\t}", "public static function editFieldYesNo($name, $selected = false, $extra = '') {\n\t\treturn self::radioButtons(\n\t\t\t$name, array(I18N::translate('no'), I18N::translate('yes')), $selected, $extra\n\t\t);\n\t}", "function _addRadioButton($tag) {\n if (! isset($this->_widgets[$tag->getName()])) {\n $this->_widgets[$tag->getName()] = &new SimpleRadioGroup();\n }\n $this->_widgets[$tag->getName()]->addWidget($tag);\n }", "function get_yes_no(){\n\t\treturn array(\n\t\t\t'yes' => 'Yes',\n\t\t\t'no' => 'No',\n\t\t);\n\t}", "function show_boolean_yes_no()\n\t{\n\t\t$this->show_enum(\n\t\t\tarray(\n\t\t\t\tarray(\"value\"=>\"TRUE\",\"display_name\"=>gettext(\"Yes\")),\n\t\t\t\tarray(\"value\"=>\"FALSE\",\"display_name\"=>gettext(\"No\"))\n\t\t\t\t)\n\t\t\t);\n\t}", "public function addRadioButton(RadioButtonInterface $radioButton): void;", "function generate_yesno_radio($string , $val)\n{\n\t// Would you say this was helpful?\n\t// True [ ] False [ ]\n\techo \"Not implemented yet\";\n}", "public function getRadioButtons(): array;", "function radios($_array, $_name, $_value, $_required, $_label){\n foreach($_array as $rb){\n echo \"<label><input type='radio' name='$_name' value='\".replace($_value,$rb).\"'\";\n if(isset($rb['on']) ? $rb['on'] : false){\n echo \" checked\";\n }\n echo \"> \".replace($_label,$rb).\"</label>\";\n }\n}", "private function create_radio()\n\t{\n\t\t$this->default = ($this->value != '') ? $this->value : $this->default;\n\n\t\tif ($this->table)\n\t\t{\n\t\t\t$this->pair .= '<table summary=\"question\" class=\"rrow\">';\n\t\t\t\t$this->pair .= '<tbody>';\n\n\t\t}\n//\t\telse\n//\t\t{\n//\t\t\t$this->pair .= \"<div class=\\\"rrow\\\">\";\n//\t\t}\n\t\t$i = 1;\n\t\tforeach ($this->label as $label=>$value)\n\t\t{\n\n\t\t\t# this is a fix for core grammar because the where the label is in the value because in some labels the\n\t\t\t# only difference is in capitialization which is causing the values to be overwritten\n\t\t\tif ($this->table)\n\t\t\t{\n\t\t\t\t$data = $this->set_data_radio($label);\n\t\t\t\t$this->value = $label;\n\t\t\t\tif ($i % 2 == 0)\n\t\t\t\t{\n\t\t\t\t\t$this->pair .= '<td>';\n\t\t\t\t\t$this->create_pair($data,$value);\n\t\t\t\t\t$this->pair .='</td></tr>';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->pair .= '<tr><td>';\n\t\t\t\t\t$this->create_pair($data,$value);\n\t\t\t\t\t$this->pair .='</td>';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data = $this->set_data_radio($value);\n\t\t\t\t$this->value = $value;\n\t\t\t\t$this->create_pair($data,$label);\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\tif ($this->table)\n\t\t{\n\t\t\t\t$this->pair .= '</tbody>';\n\t\t\t$this->pair .= '</table>';\n\n\t\t}\n//\t\telse\n//\t\t{\n//\t\t\t$this->pair .= \"</div>\";\n//\t\t}\n\t}", "function form_radios($title, $name, $value, $options, $description = NULL, $required = FALSE, $attributes = NULL) {\n if (count($options) > 0) {\n $choices = '';\n foreach ($options as $key => $choice) {\n $choices .= '<label class=\"option\"><input type=\"radio\" class=\"form-radio\" name=\"edit['. $name .']\" value=\"'. $key .'\"'. ($key == $value ? ' checked=\"checked\"' : ''). drupal_attributes($attributes) .' /> '. $choice .'</label><br />';\n }\n return theme('form_element', $title, $choices, $description, NULL, $required, _form_get_error($name));\n }\n}", "function get_no_yes(){\n\t\treturn array(\n\t\t\t'' => '',\n\t\t\t'no' => 'No',\n\t\t\t'yes' => 'Yes',\n\t\t);\n\t}", "function agc_custom_xprofile_radio_button($html, $option, $field_id, $selected, $index )\n{\n\tglobal $field;\n\t$field_data = bp_get_profile_field_data( array('field' => $field_id, 'user_id' => bp_loggedin_user_id()));\n\t$selected = ( $option->name == $field_data )?' checked=\"checked\"':'';\n\t$required = ($field->is_required)?'required':'';\n\treturn '<label class=\"radio\"><input' . $selected . ' type=\"radio\" class=\"'.$required.'\" name=\"field_' . $field_id . '\" id=\"option_' . $option->id . '\" value=\"' . esc_attr( stripslashes( $option->name ) ) . '\"> ' . esc_attr( stripslashes( $option->name ) ) . '</label>';\n}", "function add_button($label, $value, $is_checked=HAW_NOTCHECKED)\r\n {\r\n if (!is_string($label) || !is_string($value))\r\n die(\"invalid argument in add_button()\");\r\n\r\n $this->buttons[$this->number_of_buttons][\"label\"] = $label;\r\n $this->buttons[$this->number_of_buttons][\"value\"] = $value;\r\n $this->buttons[$this->number_of_buttons][\"is_checked\"] = $is_checked;\r\n\r\n if ((strlen($this->value) == 0) || ($is_checked == HAW_CHECKED))\r\n $this->value = $value;\r\n\r\n $this->number_of_buttons++;\r\n }", "public static function radio_field( $selected, $name_field = 'radio_field', $options = [ 'yes' => 'Yes', 'no' => 'No' ]){\n foreach ($options as $value => $option): ?>\n <input type=\"radio\" name=\"<?php echo $name_field ?>\" value=\"<?php echo $value; ?>\" <?php checked($value == $selected); ?> style=\"width: 15px;\">\n <?php echo $option; ?>\n <br/>\n <?php endforeach;\n }", "function add_radios($name, $optionlist, $valuelist=false, $vertical=false, $default_option='', $class='', $style='', $display_toggles=false)\n\t{\n\t\tif($this->is_reposted)\n\t\t{\n\t\t\t$default_option = $this->get_repost_value($name, $default_option);\n\t\t\t$style = $this->restyle_if_failed($name, $style);\n\t\t}\n\t\t$class = ($class != '' ? ' class=\"' . $class . '\"' : '');\n\t\t$style = ($style != '' ? ' style=\"' . $style . '\"' : '');\n\t\t$count = count($optionlist);\n\t\tif(is_array($valuelist))\n\t\t{\n\t\t\tif($count != count($valuelist))\n\t\t\t{\n\t\t\t\t$valuelist = $optionlist;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$valuelist = $optionlist;\n\t\t}\n\t\tfor($i = 0; $i < $count; $i ++)\n\t\t{\n\t\t\t$checked = ($default_option === $optionlist[$i] ? ' checked' : '');\n\t\t\t$onclick = (isset($display_toggles[$i]) ? ' onclick=\"' . $this->external_js['radio_display_toggle'] . \"('\" . $display_toggles[$k] . \"'\" . ');\"' : '');\n\t\t\t$this->xecho('<input type=\"radio\" name=\"' . $name . '\" value=\"' . $thisvalue . '\"' . $checked . $class . $style . $onclick . '>');\n\t\t\t$this->label($thisvalue);\n\t\t\tif($vertical)\n\t\t\t{\n\t\t\t\t$this->br();\n\t\t\t}\n\t\t}\n\t}", "function BOOL($titre,$nomDB){\r\n echo \"<p>$titre :</p>\";\r\n echo \"<input name='$nomDB' type='radio' value='oui'>OUI\";\r\n echo \"<input name='$nomDB' type='radio' value='non'>NON\";\r\n}", "function radio($attributes = array()){\r\n $attr = array(); //default empty\r\n $col = \"6\"; //default col\r\n $class=\"input-group\"; //default class\r\n extract($attributes);\r\n \r\n $html = $this->divbegin($col,$class);\r\n $html.='<span class=\"input-group-addon\"><i class=\"glyphicon glyphicon-' . $icon . '\"></i></span>';\r\n $checked=\"checked\"; //first radio button is checked\r\n foreach($option as $k=>$v){\r\n $html .= '<label class=\"radio-inline\">';\r\n $html .= '<input type=\"radio\" value=\"'.$k .'\" name=\"data['.$field.']\" '. $checked.' />';\r\n $html .= $v;\r\n $html .= '</label>';\r\n $checked=\"\"; //only first radio button is checked\r\n }\r\n $html .= $this->divend();\r\n return $html;\r\n }", "function radio($name, $options) {\n\t$radio = '';\n\tforeach($options as $value => $text) {\n\t\tif(isset($_SESSION['POST'][$name]) && $_SESSION['POST'][$name] == $value) {\n\t\t\tunset($_SESSION['POST'][$name]);\n\t\t\t$checked = 'checked=\"checked\"';\n\t\t} else {\n\t\t\t$checked = '';\n\t\t}\n\t\t$radio .=\"<label><input type=\\\"radio\\\"name=\\\"$name\\\" value=\\\"$value\\\" $checked />$text</label>\";\n\t}\n\treturn $radio;\n}", "function wha_dialog_radiolist(&$out, &$err, $text, $height, $width, \n $radiolist_height, $items, $common_options = array())\n{ \n $radiolist_options = array('--radiolist', $text, $height, $width, \n $radiolist_height);\n $radiolist_items = array();\n foreach($items as $key => $pair) {\n $radiolist_items[] = $key;\n $radiolist_items[] = $pair[0];\n $radiolist_items[] = $pair[1];\n }\n $args = array_merge($common_options, $radiolist_options, $radiolist_items);\n $result = wha_dialog($args, $out, $err);\n return $result;\n}", "function form_radio($title, $name, $value = 1, $checked = FALSE, $description = NULL, $attributes = NULL, $required = FALSE) {\n $element = '<input type=\"radio\" class=\"'. _form_get_class('form-radio', $required, _form_get_error($name)) .'\" name=\"edit['. $name .']\" value=\"'. $value .'\"'. ($checked ? ' checked=\"checked\"' : '') . drupal_attributes($attributes) .' />';\n if (!is_null($title)) {\n $element = '<label class=\"option\">'. $element .' '. $title .'</label>';\n }\n return theme('form_element', NULL, $element, $description, $name, $required, _form_get_error($name));\n}", "public function getYesNo()\n {\n static $data;\n\n if (! $data) {\n $data = array(1 => $this->_('Yes'), 0 => $this->_('No'));\n }\n\n return $data;\n }", "function tpl_form_radiobutton($name, $selected, $value = 1, $id = null, $attrib = null) {\n\t$result = \n\t\t'<input type=\"radio\" name=\"'.$name.'\" value=\"'.tpl_attribute($value).\n\t\t'\" id=\"'.tpl_attribute(null!=$id?$id:$name.\"[$value]\").'\"';\n\tif (null != $attrib)\n\t\t$result .= ' '.tpl_html_implode($attrib);\n\tif ($value == $selected)\n\t\t$result .= ' checked=\"checked\"';\n\treturn $result.' />';\n}", "public function radio($options = [], $enclosedByLabel = true)\n {\n $this->_offset = true;\n return parent::radio($options, $enclosedByLabel);\n }", "public static function dropdownYesNo()\r\n\t{\r\n\t\treturn [1 => Yii::t('app', 'Yes'), 0 => Yii::t('app', 'No')];\r\n\t}", "function pyis_dpd_helpscout_do_field_radio( $args = array() ) {\n\tpyis_dpd_helpscout_fieldhelpers()->fields->do_field_radio( $args['name'], $args );\n}", "function get_correct_radio_buttons($input_name_id, $input_id, $type, $read_only) {\n \n global $current_user;\n $notification_setting = $current_user->notification_setting;\n $daily = 'daily_email';\n $weekly = 'weekly_email';\n $monthly = 'monthly_email';\n $system = 'system_email';\n $daily_decription = '<span class=\"slightly-larger-font\">\n <strong>Daily: \\'The Green Laser\\'</strong> Get notified each day of news, events and projects happening near you\n </span>';\n $weekly_decription = '<span class=\"slightly-larger-font\">\n <strong>Weekly: \\'The Green Razor\\'</strong> The best of your environmental movement in a weekly email\n </span>';\n $monthly_decription = '<span class=\"slightly-larger-font\">\n <strong>Monthly: \\'The Green Phaser\\'</strong> The best of the Green Pages Community of the month\n </span>';\n $system_decription = '<span class=\"slightly-larger-font\">\n <strong>Rare: \\'System Messages Only\\'</strong>\n </span>';\n \n switch ($notification_setting) {\n case 'daily_email':\n $check_daily_email = ' checked=\"checked\"';\n $check_weekly_email = '';\n $check_monthly_email = '';\n $check_system_email = '';\n break;\n case 'weekly_email':\n $check_daily_email = '';\n $check_weekly_email = ' checked=\"checked\"';\n $check_monthly_email = '';\n $check_system_email = '';\n break;\n case 'monthly_email':\n $check_daily_email = '';\n $check_weekly_email = ''; \n $check_monthly_email = ' checked=\"checked\"';\n $check_system_email = '';\n break;\n case 'system_email':\n $check_daily_email = '';\n $check_weekly_email = ''; \n $check_monthly_email = '';\n $check_system_email = ' checked=\"checked\"';\n break;\n }\n \n // Currently only offering weekly and rare system only options\n $correct_input = '<div class=\"ginput_container\">\n <input name=\"input_'. $input_name_id .'\" id=\"'. $weekly .'\" '. $type .' \n value=\"'. $weekly .'\" '. $check_weekly_email .' tabindex=\"5\"> \n '. $weekly_decription .' \n </div>\n <div class=\"ginput_container\">\n <input name=\"input_'. $input_name_id .'\" id=\"'. $system .'\" '. $type .' \n value=\"'. $system .'\" '. $check_system_email .' tabindex=\"5\"> \n '. $system_decription .'\n </div>';\n\n return $correct_input;\n}", "function RADIO_ADD($name, $optvals, $value, $scr = '') {\n if (count($optvals) == 0) {\n throw new Exception('Optvals has no elements', 0);\n }\n $optout = array();\n $val = $this->general->get_arrval($value, $name, '');\n\n foreach($optvals as $n => $v) {\n $sel = ($v == $val) ? \"checked=\\\"checked\\\" \" : '';\n $sendid = substr($name, 0, 3);\n\n $optout[] = \"<input style=\\\"margin: 0 4px 0 6px;\\\" type=\\\"radio\\\" name=\\\"{$name}\\\" \" .\n \"id=\\\"{$name}_{$n}\\\" value=\\\"{$v}\\\" {$sel} {$scr}>\" .\n \" <label class=\\\"il\\\" for=\\\"{$name}_{$n}\\\">{$n}</label> \";\n }\n $optout[] = ($val != '') ? '' : \"<img id=\\\"{$name}_icon\\\" src=\\\"{$this->baseurl}/cancel-on.png\\\" />\";\n $out = implode(\"\\n\", $optout);\n return $out;\n }", "function makeRadio($values='',$onclick='',$style='',$title='',$id=''){\n\t$output = '';\n\tforeach($values as $key=>$value){\n\t\t$output .= '<input type=radio value=\"'.$key.'\" style=\"'.$style.'\" title=\"'.$title.'\" onclick=\"'.$onclick.'\" id=\"'.$id.'\" name=\"'.$id.'\">'.$value;\n\t}\n\treturn $output;\n}" ]
[ "0.6457472", "0.60635763", "0.6056167", "0.600825", "0.5968494", "0.59571975", "0.59393555", "0.5833183", "0.57534885", "0.5718359", "0.5716988", "0.5694381", "0.5598867", "0.5572502", "0.5562937", "0.55354196", "0.5532833", "0.5475761", "0.54694587", "0.5411822", "0.5355964", "0.53368396", "0.5329462", "0.5329281", "0.5316174", "0.5312206", "0.5291139", "0.52889717", "0.5251227", "0.5245336" ]
0.64512223
1
Get the email subject line to be used for the reset link email.
protected function getEmailSubject() { return isset($this->subject) ? $this->subject : 'Your Password Reset Link'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getEmailSubject()\n {\n return property_exists($this, 'subject') ? $this->subject : 'Your Password Reset Link';\n }", "protected function getEmailSubject()\n {\n return property_exists($this, 'subject') ? $this->subject : 'Your Password Reset Link';\n }", "public function get_subject()\n\t{\n\t\treturn $this->_email_subject;\n\t}", "public function getMailSubject();", "function ecse_get_email_subject() {\n\tglobal $ecse_email_subject;\n\tif(!is_string($ecse_email_subject)) $ecse_email_subject=''; //just to make sure it's a string\n\treturn $ecse_email_subject;\n}", "private function getSubject() {\n\t\treturn $this->ticket->getSubject();\n\t}", "public function getSubject(): string\n {\n return $this->message->getSubject();\n }", "public function getMessageSubject() {\n\t\treturn($this->messageSubject);\n\t}", "private function getSubject()\n {\n $subject = 'email.ebsr-failed-no-bus-reg.subject';\n\n if (!is_array($this->template)) {\n $subject = 'email.' . $this->template . '.subject';\n } elseif ($this->regNo) {\n $subject = 'email.ebsr-failed.subject';\n }\n\n return $subject;\n }", "public static function getNewsletterSubject()\n\t{ \n\t\treturn (string)self::get('newsletter_subject');\n\t}", "function getSubject() {\n return $this->getFieldValue('subject');\n }", "public function getSubjectAttribute()\n {\n if ($firstSubject = $this->subjects()->first()) {\n return $firstSubject->value;\n }\n return $this->email_subject;\n }", "final public function getSubject(): ?string\n {\n $subject = $this->getHeaders()->get('subject');\n \\assert(null === $subject || \\is_string($subject));\n\n return $subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "function getSubject() {\n\t\t\treturn $this->subject;\n\t\t}", "public function getSubject() {\n return $this->subject;\n }", "public function getSubject() {\n return $this->subject;\n }", "public function getSubject() {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->record['subject'];\n }", "public function getSubject() {\n\t\treturn $this->subject;\n\t}" ]
[ "0.78119457", "0.78119457", "0.7345696", "0.7262165", "0.69877577", "0.698048", "0.6921447", "0.68957245", "0.67917085", "0.6776078", "0.6739667", "0.67232436", "0.6716001", "0.6715397", "0.6715397", "0.6715397", "0.6715397", "0.6715397", "0.6715397", "0.6715397", "0.6715397", "0.6715397", "0.6715397", "0.6715397", "0.6698255", "0.66965646", "0.66965646", "0.66965646", "0.66825134", "0.66816247" ]
0.7893468
0
Gets the default collection name for the passed in Morph_Object
public static function collectionName(Morph_Object $object) { return str_replace(array('_','\\'), '.', get_class($object)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function getCollectionName();", "public function collectionName($collection = null)\n {\n return $this->collection;\n }", "function tainacan_get_the_collection_name() {\n\t$collection = tainacan_get_collection();\n\t$name = '';\n\tif ( $collection ) {\n\t\t$name = $collection->get_name();\n\t}\n\treturn apply_filters('tainacan-get-collection-name', $name, $collection);\n}", "public function getCollectionName(): string\n {\n if (!$this->collection) {\n throw new NoCollectionNameException();\n }\n\n return $this->collection ? $this->collection : $this->getSchema()->collection;\n }", "public function getDefaultVuexCollectionKey()\n {\n if (property_exists($this, 'vuex') && isset($this->vuex['collection'])) {\n return $this->vuex['collection'];\n } else {\n return config('vuex.collection', 'all');\n }\n }", "function tainacan_the_collection_name() {\n\techo tainacan_get_the_collection_name();\n}", "protected function getClassName() {\r\n\t\tif (empty($this->tcaObjectName)) {\r\n\t\t\t// assuming that \"fooCollection\" contains \"foo\" objects\n\t\t\t$this->tcaObjectName = str_replace('Collection', '', get_class($this));\r\n\t\t}\r\n\t\treturn $this->tcaObjectName;\r\n\t}", "public function yieldCollection(string $collection, string $default = \"\"): string\n {\n if (isset($this->collections[$collection])) {\n return $this->collections[$collection];\n }\n\n return $default;\n }", "public static function collectionName()\n {\n return 'messageTemplate';\n }", "protected function getCacheCollectionName()\n {\n return strtolower('array_cache_' . get_class($this));\n }", "public function getName()\n {\n return $this->activeCollection->getName();\n }", "function _getObjectClassName(){\n\t\treturn String4::ToObject($this->getReferredTable())->singularize()->camelize()->toString(); // \"galleries\" -> \"Gallery\"\n\t}", "public function getCollectionTitle()\n {\n return $this->collectionTitle;\n }", "public function getCollectionName()\n {\n return 'news.images';\n }", "public function getCollection()\n {\n if ($this->isEmbeddable()) {\n return null;\n }\n\n $collection = $this->property('collection');\n\n if (empty($collection)) {\n if ($this->parentSchema()) {\n //Using parent collection\n return $this->parentSchema()->getCollection();\n }\n\n $collection = Inflector::camelize($this->getShortName());\n $collection = Inflector::pluralize($collection);\n }\n\n return $collection;\n }", "abstract public function getCollectionType(): string;", "public function getCollectionName() {\n return 'documents';\n }", "public static function collectionName()\n {\n return 'store';\n }", "public function getAllCollectionName() {\n return $this->_collection->where ( 'is_active', 1 )->select ( 'id', StringLiterals::TITLE )->get ();\n }", "public function getCollectionName()\r\n {\r\n return 'News';\r\n }", "private function getCollectionName(Query $collection): string\n {\n return data_get($this->getFrom($collection), 'collectionId');\n }", "public function getOutputCollectionName()\n {\n return $this->output_collection_name;\n }", "public function getCollectionName()\n {\n return 'user.photo';\n }", "public function getCollectionName(string $collection): string\n {\n if (!in_array($collection, $this->collections, true)) {\n $aliases = $this->getCollectionAliases();\n if (!empty($aliases && array_key_exists($collection, $aliases))) {\n return $aliases[$collection];\n }\n throw new ZookeeperException(\"Solr collection with name '$collection' not found.'\");\n }\n\n return $collection;\n }", "public function setCollectionName($name);", "public static function collectionName()\n {\n return 'storeGoods';\n }", "public static function collectionName()\n {\n return 'promotionCode';\n }", "public function getInputCollectionName()\n {\n return $this->input_collection_name;\n }", "public static function collectionName()\n {\n return 'statsMemberGrowthQuarterly';\n }", "public function getCollectionClass ()\n {\n return Doctrine_Manager::getInstance()->getAttribute(Doctrine::ATTR_COLLECTION_CLASS);\n }" ]
[ "0.7318638", "0.69899666", "0.69577515", "0.68375164", "0.67461973", "0.66777486", "0.6322259", "0.6148078", "0.6094727", "0.6094209", "0.6093676", "0.6043331", "0.60267395", "0.59928966", "0.5973145", "0.59648544", "0.5943429", "0.59426594", "0.5929653", "0.59155476", "0.5902312", "0.5874464", "0.5802873", "0.5763787", "0.5754032", "0.5736466", "0.56880045", "0.56572276", "0.5641343", "0.5627766" ]
0.738522
0
View problem Area details
public function viewAction() { // param ID $ProblemAreaId = Colla_App::getInstance()->getProblemArea(); $PA = new ProblemArea(); $problemArea = $PA->getProblemArea($ProblemAreaId); $this->view->pa = $problemArea; $this->view->changes = $problemArea->getChanges(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function selectAction()\r\n {\r\n \t$ProblemArea = new ProblemArea();\r\n \t$this->view->areas = $ProblemArea->getProblemAreas();\r\n }", "public function show( Area $area )\n {\n //\n }", "function area_show_specific_area($areadata = NULL, $inventory_id = NULL) {\n\tassert(!empty($areadata));\n\tdrupal_add_css(drupal_get_path('module', 'area') . '/css/area.css');\n\tdrupal_add_js('misc/form.js');\n\tdrupal_add_js('misc/collapse.js');\n\tdrupal_set_title(t('area').' '.$areadata['name']);\n\t\n\tglobal $base_url;\n\t\n\t//load js for observation table/map\n\t$observation_path = drupal_get_path('module', 'observation');\n\tdrupal_add_js($observation_path . '/js/observation.js');\n\tdrupal_add_library('system', 'ui.dialog');\n\n\t$output['message'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '\n\t\t\t<div id=\"message\" style=\"display: none; height: auto;\">\n\t\t\t\t<div class=\"messages status\"></div>\n\t\t\t</div>'\n\t);\n\t\n\t/* Create a fieldset for the tabular data */\n\t$output['area'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Area details'),\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'id' => 'area-show-details' // required for CSS\n\t\t\t),\n\t\t\t'#weight' => 1\n\t);\n\t\n\t/* Build the content of the table, leave out empty fields */\n\t$output['area']['table'] = area_get_infotable_of_specific_area($areadata);\n\n\t/* Create a fieldset for the static google maps */\n\t$output['area_map'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Map'),\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'id' => 'area-show-map', // required for CSS\n\t\t\t\t\t'name' => 'map' //used for anchor\n\t\t\t)\n\t);\n\t\n\t$iconBaseUrl = '/' . path_to_theme() . '/images/icons/enabled/';\n\t$output['area_map']['zoom'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '<img style=\"cursor:pointer;\" src=\"' . $iconBaseUrl . 'Zoom in.png\" alt=\"' . t('zoomin') . '\" title=\"' . t('zoomin') . '\" onclick=\"javascript:observationmap.zoomIn(event, ' .$areadata['id'] . ');\" /> '.t('zoomin') \n\t);\n\t\n\t//if user has RED_WRITE Permission and area is not a child, user can add a subarea\n\tif(area_check_access($areadata, 'ACL_RED_WRITE') && empty($areadata['parent_id'])) {\n\t\t$output['area_map']['create_sub_area'] = array(\n\t\t\t\t'#type' => 'markup',\n\t\t\t\t'#prefix' => '</br>',\n\t\t\t\t'#markup' => '<img style=\"cursor:pointer;\" onclick=\"window.location.href=\\''.$base_url . '/area/new/'.$areadata['id'].'\\'\" src=\"'.$iconBaseUrl.'Site map.png\" style=\"cursor:pointer;\" alt=\"' .t('Create a subarea') . '\" title=\"' . t('Create a subarea') . '\"/> '. t('Create a subarea')\n\t\t);\n\t}\n\t\n\t$output['area_map']['map'] = array(\n\t\t\t'#theme' => 'area',\n\t\t\t'#mapid' => 'observationmap',\n\t\t\t'#ch1903' => true,\n\t\t\t'#showall' => false,\n\t\t\t'#scalecontrol' => true,\n\t\t\t'#action' => 'show',\n\t\t\t'#reticle' => false,\n\t\t\t'#geometry_edit_id' => (int) $areadata['id'],\n\t\t\t'#defaultzoom' => '15',\n\t\t\t'#infowindow_content_fetch_url_area' => base_path()\n\t\t\t. 'area/{ID}/areaoverview/ajaxform',\n\t\t\t'#infowindow_content_fetch_url_observation' => base_path()\n\t\t\t. 'observation/{ID}/overview/ajaxform',\n\t\t\t'#geometries_fetch_url' => base_path() . 'area/' . $areadata['id'] . '/json',\n\t);\n\t\n\t/* Create a fieldset for the comment text field */\n\t$output['area_description'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Description'),\n\t\t\t'#collapsible' => true,\n\t\t\t'#collapsed' => false,\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'id' => 'area-show-comment',\n\t\t\t\t\t'class' => array(\n\t\t\t\t\t\t\t'collapsible'\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t'#weight' => 2\n\t);\n\t\n\t/* add the comments for the area as an editable textarea */\n\t$output['area_description']['comment'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#markup' => \"<div class='area-description'>\"\n\t\t\t. (empty($areadata['comment']) ? t(\"None available\")\n\t\t\t\t\t: check_plain($areadata['comment'])) . \"</div>\"\n\t);\n\t\n\t/* Create a fieldset for the linked habitats */\n\t$output['area_inventories'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('inventories').' & '.t('observations'),\n\t\t\t'#collapsible' => true,\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'class' => array(\n\t\t\t\t\t\t\t'collapsible'\n\t\t\t\t\t),\n\t\t\t\t\t'id' => 'area-show-comment' // required for CSS\n\t\t\t),\n\t\t\t'#weight' => 3\n\t);\n\tif(area_check_access($areadata, 'ACL_RED_WRITE') && user_access(CREATE_INVENTORY)) {\n\t\tglobal $base_url;\n\t\t$iconBaseUrl = '/' . path_to_theme() . '/images/icons/enabled/';\n\t\t\n\t\t$output['area_inventories']['add_inventory'] = array(\n\t\t\t\t'#type' => 'markup',\n\t\t\t\t'#markup' => '<a href=\"'.$base_url.'/inventory/area/'.$areadata['id'].'/new\"> <img src=\"' . $iconBaseUrl . 'Add.png\" alt=\"' . t('Add Inventory') . '\" title=\"' . t('Add Inventory') . '\" />'.t('Add Inventory').'</a>',\n\t\t);\n\t}\n\t\n\t$output['area_inventories']['inventories'] = inventory_show_area_inventories($areadata);\n\t$output['area_inventories']['space'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '<br><br>'\n\t);\n\t\n\t$output['area_inventories']['observations'] = inventory_show_observations($areadata['id'], $inventory_id);\n\t\n\t/* Create a fieldset for the strategies text fields */\n\t$output['area_concept'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Area concept'),\n\t\t\t'#collapsible' => true,\n\t\t\t'#collapsed' => false,\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'class' => array(\n\t\t\t\t\t\t\t'collapsible',\n\t\t\t\t\t\t\t'collapsed'\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t'#weight' => 4\n\t);\n\n\t/* add the protectiont target textarea */\n\t$output['area_concept']['protection_target'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#title' => t('Protection target'),\n\t\t\t'#markup' => \"<pre>\"\n\t\t\t\t\t. (empty($areadata['protection_target'])\n\t\t\t\t\t\t\t? t(\"None available\")\n\t\t\t\t\t\t\t: check_plain($areadata['protection_target']))\n\t\t\t\t\t. \"</pre>\"\n\t);\n\n\t/* add the tending strategies target textarea */\n\t$output['area_concept']['tending_strategies'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#title' => t('Tending strategies'),\n\t\t\t'#markup' => \"<pre>\"\n\t\t\t\t\t. (empty($areadata['tending_strategies'])\n\t\t\t\t\t\t\t? t(\"None available\")\n\t\t\t\t\t\t\t: check_plain($areadata['tending_strategies']))\n\t\t\t\t\t. \"</pre>\"\n\t);\n\n\t/* add the tending strategies target textarea */\n\t$output['area_concept']['safety_precautions'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#title' => t('Safety precautions'),\n\t\t\t'#markup' => \"<pre>\"\n\t\t\t\t\t. (empty($areadata['safety_precautions'])\n\t\t\t\t\t\t\t? t(\"None available\")\n\t\t\t\t\t\t\t: check_plain($areadata['safety_precautions'])) . \"</pre>\"\n\t);\n\n\t/* Create a fieldset for the linked habitats */\n\t$output['area_habitats'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Linked habitats'),\n\t\t\t'#collapsible' => true,\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'class' => array(\n\t\t\t\t\t\t\t'collapsible',\n\t\t\t\t\t\t\t'collapsed'\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t'#weight' => 5\n\t);\n\n\tif (function_exists('gallery_list_renderer')) {\n\t\t$output['area_videos'] = gallery_list_renderer(\n\t\t\t'videos',\n\t\t\t'area',\n\t\t\t$areadata['id']);\n\t\t$output['area_images'] = gallery_list_renderer(\n\t\t\t'images',\n\t\t\t'area',\n\t\t\t$areadata['id']);\n\t}\n\n\t/* add the linked habitats */\n\t$results = db_query(\n\t\t'SELECT\n\t\t\tlabel,\n\t\t\tname\n\t\tFROM\n\t\t\t{area_habitat} ah\n\t\t\tJOIN {habitat} h ON ah.habitat_id = h.id\n\t\tWHERE\n\t\t\tah.area_id = ?;',\n\t\tarray($areadata['id']));\n\n\t$habitats = array();\n\tforeach ($results->fetchAll() as $habitat) {\n\t\t$habitats[] = (array) $habitat;\n\t}\n\tif(!empty($habitats)) {\n\t\t$output['area_habitats']['habitats'] = array(\n\t\t\t\t'#theme' => 'datatable',\n\t\t\t\t'#header' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'name' => t('Label'),\n\t\t\t\t\t\t\t\t'width' => 300\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'name' => t('Name'),\n\t\t\t\t\t\t\t\t'width' => 300\n\t\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'#tableWidth' => 900,\n\t\t\t\t'#rows' => $habitats,\n\t\t\t\t'#id_table' => DATATABLE_HABITATS\n\t\t);\n\t} else {\n\t\t$output['area_habitats']['habitats'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#markup' => \"<pre>\".t(\"None available\").\"</pre>\",\n\t\t\t);\n\t}\n\n\t$output['area_files'] = area_files($areadata);\n\t$output['area_files']['#weight'] = 6;\n\n\treturn $output;\n}", "public function getArea(){\r\n\t\t\r\n\t}", "function area_show_all_areas() {\n\tglobal $user;\n\t\n\tdrupal_add_library('system', 'ui.dialog');\n\t$observation_path = drupal_get_path('module', 'area');\n\tdrupal_add_css($observation_path . '/css/area.css');\n\t\n\t$output['message'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '\n\t\t\t<div id=\"message\" style=\"display: none; height: auto;\">\n\t\t\t\t<div class=\"messages status\"></div>\n\t\t\t</div>'\n\t);\n\n\t$output['map'] = array(\n\t\t\t'#mapid' => 'areamap',\n\t\t\t'#search' => true,\n\t\t\t'#ch1903' => true,\n\t\t\t'#geometries_fetch_url' => base_path() . 'areas/json',\n\t\t\t'#geometries_autoload' => false,\n\t\t\t'#infowindow_content_fetch_url_area' => base_path()\n\t\t\t\t\t. 'area/{ID}/areaoverview/ajaxform',\n\t\t\t'#theme' => 'area'\n\t);\n\n\t$output['space'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '<p/>'\n\t);\n\t\n\tif(user_access(AREA_CREATE)) {\n\t\tglobal $base_url;\n\t\t$iconBaseUrl = '/' . path_to_theme() . '/images/icons/enabled/';\n\t\t\n\t\t$output['create'] = array(\n\t\t\t\t'#type' => 'markup',\n\t\t\t\t'#markup' => '<a href=\"'.$base_url.'/area/new\"> <img src=\"' . $iconBaseUrl . 'Add.png\" alt=\"' . t('Create a new area') . '\" title=\"' . t('Create a new area') . '\" />'.t('Create a new area').'</a>',\n\t\t);\n\t}\n\t\n\t$output['area_table'] = array(\n\t\t'#theme' => 'datatable',\n\t\t'#header' => area_get_standard_datatable_headers(12,\n\t\t'DESC'),\n\t\t'#title' => t('Areas'),\n\t\t'#id_table' => DATATABLE_AREA,\n\t\t'#options' => array(\n\t\t\t\t\t'jsonUrl' => base_path() . \"areas/get/all\",\n\t\t\t\t\t'rowClick' => 'rowClick',\n\t\t\t\t\t'rowClickHandler' \t\t=> \"function rowClick(celDiv, id) {\n\t\t\t\t\t\tjQuery(celDiv).click(\n\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\tareamap.selectGeometry(id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t)\n\t\t\t\t\t}\",\n\t\t\t'rpShowAll' => true,\n\t\t\t'preProcessHandler' => 'area.tablePreProcess',\n \t\t\t'onSuccessHandler' => ( ($user->uid == 0) ? '' : 'area.onTableSuccess' ),\t/* only show the delete and export buttons if user is logged in */\n\t\t\t'gallery_enabled' => true,\n\t\t\t'gallery_image_sources' => false,\n\t\t\t// Filters to add to the filterDiv above the table. The gallery image source\n\t\t\t// filter has a weight of 10, the table/gallery buttons 4 and 5 respectively.\n\t\t\t'custom_filter' => array(\n\t\t\t\t'acl_filter' => array(\n\t\t\t\t\t'#type' => 'select',\n\t\t\t\t\t'#name' => 'acl_filter',\n\t\t\t\t\t'#title' => t('Areas') . ':',\n\t\t\t\t\t'#options' => array(\n\t\t\t\t\t\t'all' => t('Public'),\n\t\t\t\t\t\t'own' => t('Own'),\n\t\t\t\t\t\t'writeable' => t('Editables')),\n\t\t\t\t\t'#attributes' => array(\n\t\t\t\t\t\t'class' => array('acl_filter')),\n\t\t\t\t\t'#weight' => 8\n\t\t\t\t),\n\t\t\t),\n\t\t 'date' => array(\n\t\t \t'dbDateField' => \"date\",\n\t\t \t'dbDateFieldType' => DBDateFieldType::TIMESTAMP)\t\t\t\t\t\n\t\t)\n\t\t\n\t);\t\n\t\n\treturn $output;\n}", "public function show(Area $area)\n {\n //\n // return view('areas.index');\n }", "public function area() {\r\n }", "public function obtenerAreas();", "public function getArea()\n {\n return $this->area;\n }", "public function getInfo(){\n\t\treturn \"<div style='width:600px;height:70px;padding:10px;border:0px solid yellowgreen;'><div align= justify>\n \t\tArea is the quantity that expresses the extent of a two-dimensional figure or shape, or planar lamina, in the plane. Surface area is its analog on the two-dimensional surface of a three-dimensional object.\n \t\t<br/><b>Metric system</b> units are: <b>square meter</b>, <b>square kilometers</b>, <b>hecktar</b>.\n \t\t<br/><b>Imperial system</b> units are: <b>square inch</b>, <b>square foot</b>, <b>square yard</b>, <b>square mile</b>, <b>acre</b>. \n \t\t<hr></div></center>\";\n\t}", "public function reservationArea()\n {\n $area = Area::all();\n return view('reservation.area', compact('area'));\n }", "public function usage_area() {\n\n\t\tCheckAdminLoginSession();\n\t\t$per_page = 20;\n if($this->uri->segment(4)) {\n \t$page = ($this->uri->segment(4)) ;\n }\n else {\n \t$page = 1;\n }\n \n $start = ($page-1)*$per_page;\n $limit = $per_page;\n $totalCount = $this->admin_model->totalRecord($this->usage_area);\n\t\t$data[\"dataCollection\"] = $this->admin_model->getDataCollection($this->usage_area,$limit,$start);\n $totalResult = count($data['dataCollection']);\n\t\t$data[\"pagination\"] = Jpagination($totalCount,$limit,$start);\n\t\t$this->load->view('admin/include/head');\n\t\t$this->load->view('admin/include/header');\n\t\t$this->load->view('admin/include/sidebar');\n\t\t$this->load->view('admin/vehicle/usage_area',$data);\n\t\t$this->load->view('admin/include/footer');\n\t\t$this->load->view('admin/include/foot');\n\t}", "public function getArea()\n {\n return $this->area;\n }", "public function getArea()\n {\n return $this->area;\n }", "public function getArea()\n\t{\n\t\treturn $this->_area;\n\t}", "public function readAreas() {\n\t\t$this->load->helper('form');\n\t\t$this->load->helper('url');\n\t\t$this->load->model('adminmodel');\n\t\t$areas = $this->adminmodel->readAreasOfDelivery();\n\t\tif ($areas != NULL) {\n\t\t\tforeach ($areas as $row) {\n\t\t\t\t$area = array('zipcode' => $row->zipcode, 'price' => $row->price);\n\t\t\t\t$data[] = $area;\n\t\t\t}\n\t\t\t$data['areas'] = $data;\n\t\t\t//print_r($data);\n\t\t\t$data_aid = array_diff_key($data, array('areas' => $data['areas']));\n\t\t\t//print_r($data_aid);\n\t\t\t$data = array_diff_key($data, $data_aid);\n\t\t\t$this->load->view('adminareaofdelivery', $data);\n\t\t} else {\n\t\t\t$this->load->view('adminareaofdelivery');\n\t\t}\n\t}", "public function show(Tarea $tarea)\n {\n //\n }", "public function get_living_areas_view() {\n\t\t\t$data = array();\n\t\t\t$res = $this->get_it(2);\n\t\t\tforeach($res as $key=>$row) {\n\t\t\t\t$data[] = $row;\n\t\t\t\tif($row['area_cat_building'] == '0') { // AREA FOR SALE\n\t\t\t\t\t$data[$key]['view'] = 'area_zero_view';\n\t\t\t\t}\n\t\t\t\tif($row['area_sold'] == '1') { // IF THE AREA IS SOLD TO LOAD area_sold_view\n\t\t\t\t\t$data[$key]['view'] = 'area_sold_view';\n\t\t\t\t}\n\t\t\t\tif($row['area_cat_building'] == '1') { // MANSIONS VIEW\n\t\t\t\t\t$q_mansions = $this->db->get_where('building_apartments', array('ba_area_id' => $row['area_id']))->row_array();\n\t\t\t\t\t$data[$key]['apartment_level'] = $q_mansions['b_apartment_level'];\n\t\t\t\t\t$data[$key]['view'] = 'area_mansions_view';\n\t\t\t\t}\n\t\t\t\tif($row['area_cat_building'] == '2') { // BANK VIEW\n\t\t\t\t\t$q_bank = $this->db->get_where('building_bank', array('b_bank_area_id' => $row['area_id']))->row_array();\n\t\t\t\t\t$data[$key]['bank_id']\t= $q_bank['b_bank_id'];\n\t\t\t\t\t$data[$key]['view'] = 'area_bank_view';\n\t\t\t\t}\n\t\t\t\tif($row['area_cat_building'] == '3') { // CASINO VIEW\n\t\t\t\t\t$q_casino = $this->db->get_where('building_casino', array('bc_area_id' => $row['area_id']))->row_array();\n\t\t\t\t\t$data[$key]['casino_id'] = $q_casino['b_casino_id'];\n\t\t\t\t\t$data[$key]['view'] = 'area_casino_view';\n\t\t\t\t}\n\t\t\t\tif($row['area_cat_building'] == '5') { // UNIVERSITY VIEW\n\t\t\t\t\t$q_uni = $this->db->get_where('universities', array('uni_area_id' => $row['area_id']))->row_array();\n\t\t\t\t\t$data[$key]['uni_id'] = $q_uni['university_id'];\n\t\t\t\t\t$data[$key]['view'] = 'area_university_view';\n\t\t\t\t}\n\t\t\t\tif($row['area_cat_building'] == '7') { // RESTAURANT VIEW\n\t\t\t\t\t$q_restaurant = $this->db->get_where('building_restaurants', array('br_area_id' => $row['area_id']))->row_array();\t\t\t\t\t\n\t\t\t\t\t$data[$key]['restaurant_id']\t\t= $q_restaurant['restaurant_id'];\n\t\t\t\t\t$data[$key]['b_restaurant_level']\t= $q_restaurant['b_restaurant_level'];\n\t\t\t\t\t$data[$key]['view'] \t= 'area_restaurant_view';\n\t\t\t\t}\n\t\t\t\tif($row['area_cat_building'] == '8') { // SHOP VIEW\n\t\t\t\t\t//$q_restaurant = $this->db->get_where('building_restaurants', array('br_area_id' => $row['area_id']))->row_array();\t\t\t\t\t\n\t\t\t\t\t//$data[$key]['restaurant_id']\t\t= $q_restaurant['restaurant_id'];\n\t\t\t\t\t//$data[$key]['b_restaurant_level']\t= $q_restaurant['b_restaurant_level'];\n\t\t\t\t\t$data[$key]['view'] \t= 'area_shop_view';\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $data;\n\t\t}", "function area2()\n\t{\n\t\t$this->border = 1;\n\t\t$this->title = \"Screenshots\";\n\t\treturn $this->fetch(\"screenshots.tmpl.php\");\n\t}", "public function edit(Area $area)\n {\n //\n $localities = Locality::all();\n// dd($area);\n return view('delivery.areas.edit', compact('area', 'localities'));\n }", "public function index()\n {\n $areas = area::withTrashed() ->get();\n \n return view('auth.dash.areas.index', compact('areas'));\n }", "public function show(Issue $issue)\n {\n\n }", "public function index()\n {\n $datas = Area::all();\n return view('admin.areas.index', compact('datas'));\n }", "public function index($ID_area)\n {\n $Monitoring = $this->ShiftModel->getAreaByID($ID_area);\n // dd($Monitoring);\n $session = session();\n $session->get('user_name');\n\n $Lokasi = $this->LokasiModel->area($ID_area);\n // $History = $this->HistoryPelanggaran->findAll();\n $History = $this->HistoryPelanggaran->getNama();\n // $data['siswa'] = $model->getSiswa();\n $data = [\n 'Lokasi' => $Lokasi,\n 'History' => $History,\n 'Monitoring' => $Monitoring\n ];\n // dd($data);\n return view('Dashboard/d_2', $data);\n }", "public function index()\n {\n // if admin find all problem maps\n if ($this->Auth->user('admin') == 1) {\n $this->set(\"admin\", 1);\n $ProblemMaps = $this->ProblemMap->find('all', array('recursive' => 0));\n } else {\n $this->set(\"admin\", 0);\n // get all the problem maps belonging to the user\n $ProblemMaps = $this->ProblemMap->find('all', array(\n 'conditions' => array(\n 'ProblemMap.user_id' => $this->Auth->user('id')\n )\n ));\n }\n\n // set them in a variable accessible in the view\n $this->set(compact('ProblemMaps'));\n\n // save them in a format accessible from JSON / XML\n $this->set('_serialize', array(\n 'ProblemMaps'\n ));\n }", "public function show(AgentAreaMappingDetails $agentAreaMappingDetails)\n {\n //\n }", "public function index()\n\t{\n\t\t$problems = $this->problem->where('status', 'Close')->get();\n\n\t\treturn View::make('problems.index', compact('problems'));\n\t}", "public function detailsAction() {\n $request = $this->getRequest();\n $post_id = $request->getParam('post_id');\n $location_id = $request->getParam('location_id');\n\n $location = new Default_Model_DbTable_BlogPostLocation($this->db);\n if ($location->loadForPost($post_id, $location_id)) {\n $details = $location->details;\n } else {\n $details = $this->Translate('Ошибка получения подробной информации по географической координате');\n $details = '<div class=\"error\">' . $details . '</div>';\n }\n\n $this->view->details = $details;\n }", "public function view($id = null) {\r\n$this->set('colors', $colors = array('#d4aa00', '#008080', '#000080', '#ff0000', '#68e15a','#aa1ac7', '#32b1fd', '#5665d5', '#c9ff11', '#f3a45d', '#68fa35'));\r\n\tif (!$id) {\r\n\t\tthrow new NotFoundException(__('Invalid area'));\r\n }\r\n\t$area = $this->Area->find($type = 'first',\r\n\tarray(\r\n 'conditions' => array(' site_subdiv_id' => $id), //array of conditions\r\n 'contain' => array(\r\n \t\t\t\t'Site' => array('SiteCoord', 'fields' => array('SITE_ABBRV_CD','SITE_NM')),\r\n \t\t\t\t'AreaMap',\r\n\t\t\t\t\t\t\t\t'ArchLevel' => array(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'fields' => array('id','SITE_SUBDIV_NM','SITE_SUBDIV_ID', 'DISPLAY_SEQ1_NBR', 'DISPLAY_SEQ2_NBR', 'DISPLAY_SEQ3_NBR'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'order' => array('DISPLAY_SEQ1_NBR', 'DISPLAY_SEQ2_NBR', 'DISPLAY_SEQ3_NBR'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'LocusCoord'=> array('Locus' =>array(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'fields' => array('id','SITE_SUBDIV_NM','SITE_SUBDIV_ID', 'SQ_H_COORD', 'SQ_V_COORD', 'LOCUS_NBR', 'DISPLAY_SEQ1_NBR', 'DISPLAY_SEQ2_NBR', 'DISPLAY_SEQ3_NBR'))),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'ArchLevelMap',\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Floor' =>\tarray(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'fields' => array('id','SITE_SUBDIV_NM','SITE_SUBDIV_ID', 'DISPLAY_SEQ1_NBR', 'DISPLAY_SEQ2_NBR', 'DISPLAY_SEQ3_NBR'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'LocusCoord'=>\tarray('Locus' => array(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'fields' => array('id','SITE_SUBDIV_NM','SITE_SUBDIV_ID', 'SQ_H_COORD', 'SQ_V_COORD', 'LOCUS_NBR', 'DISPLAY_SEQ1_NBR', 'DISPLAY_SEQ2_NBR', 'DISPLAY_SEQ3_NBR'))),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'ArchLevelMap')\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t)\r\n\t\t);\r\n\r\n\tif (!$area) {\r\n\t\tthrow new NotFoundException(__('Invalid area'));\r\n\t\t}\r\n\t$this->set('area', $area);\r\n\t\t$this->set('title', 'Area '.$area['Area']['SITE_SUBDIV_NM'].' of '.$area['Site']['SITE_NM']);\r\n\t}", "function index () {\n\n $areas = Area_model::withTrashed()->get();\n $this->load->template('areas/areas',compact('areas'),'areas/js_areas');\n }" ]
[ "0.67347723", "0.6423982", "0.63819563", "0.62918586", "0.59912175", "0.5934712", "0.5905126", "0.57791626", "0.5776256", "0.573735", "0.56993103", "0.5651017", "0.56507826", "0.56507826", "0.5639561", "0.5613748", "0.5585774", "0.55675036", "0.55633247", "0.5532159", "0.5518448", "0.5509855", "0.5498922", "0.5485683", "0.5471006", "0.54685414", "0.54481876", "0.5445355", "0.54427457", "0.54339755" ]
0.71736276
0
Add new problem area
public function addAction() { $this->checkAllowed('PROBLEMAREA', 'ADD'); // check if user is logged in if (!$this->hasIdentity()) { $this->_helper->FlashMessenger->addMessage('You need to be logged in to perform actions.'); $this->_redirect('/auth/login'); return; } // new form $form = new Form_ProblemArea(); if ($this->getRequest()->isPost()) { if ($form->isValid($_POST)) { $ProblemArea = new ProblemArea(); $data = $form->getValues(); $data['CreatedBy'] = $this->view->user->Id; $ProblemArea->saveNew($data); $this->_helper->FlashMessenger->addMessage($this->translate('Problem area has been created.')); $this->_redirect('/problemarea/view'); } } $this->view->form = $form; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addproblemAction()\r\n {\r\n \t// check if user is logged in\r\n \tif (!$this->hasIdentity()) {\r\n \t\t$this->_helper->FlashMessenger->addMessage('Pre pridávanie nového problému musíte byť najskôr prihlásený.');\r\n \t\t$this->_redirect('/auth/login?redirect=/problemarea/addproblem');\r\n \t\treturn;\r\n \t}\r\n \t\r\n \t$this->checkAllowed('PROBLEM', 'DEFINE');\r\n \t\r\n \t// ID for the new problem\r\n \t$ProblemAreaId = Colla_App::getInstance()->getProblemArea();\r\n \t$form = new Form_Problem();\r\n \tif ($this->getRequest()->isPost()) {\r\n \t\tif ($form->isValid($_POST)) {\r\n \t\t\t$data = array();\r\n \t\t\t$data = $form->getValues();\r\n \t\t\t$data['CreatedBy'] = Zend_Registry::get('User')->Id;\r\n \t\t\t$data['ProblemAreaId'] = $ProblemAreaId;\r\n \t\t\t$problem = new Problem();\r\n\t\t\t\t$problem->createNew($data);\r\n\t\t\t\t$this->_helper->FlashMessenger->addMessage('Problém bol vytvorený');\r\n\t\t\t\t$this->_redirect('/problem/list/filter/acceptance');\r\n\t\t\t\treturn;\r\n \t\t}\r\n \t}\r\n \t$this->view->form = $form;\r\n }", "public function addProblem()\n {\n $cat = $this->problem_model->get_category();\n \n foreach ($cat as $value) {\n $it = 0;\n $sec_c = $this->problem_model->get_a_section($value['category_id']);\n $sections[$value['category_id']] = $sec_c;\n }\n $data['cat'] = $cat;\n $data['sections'] = $sections;\n \n\n $this->load->view('addProblem',$data);\n }", "public function selectAction()\r\n {\r\n \t$ProblemArea = new ProblemArea();\r\n \t$this->view->areas = $ProblemArea->getProblemAreas();\r\n }", "public function run() {\n\n $areas = [\n [\"code\" => \"F1\", \"name\" => \"1st Floor\"],\n [\"code\" => \"F2\", \"name\" => \"2nd Floor\"],\n [\"code\" => \"F3\", \"name\" => \"3rd Floor\"],\n [\"code\" => \"F4\", \"name\" => \"4th Floor\"]\n ];\n\n Area::insert($areas);\n }", "public function add(){\n\t\t\n\t\t$this->form_validation->set_rules('area', 'AREA', 'trim|required|is_unique['.AREA.'.area]');\n $this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\n\n if ($this->form_validation->run() == true) {\t\n\t\t\t\n\t\t\t$data = array(\n\t\t\t\t'state_id' => $this->input->post('state_id'),\n\t\t\t\t'city_id' => $this->input->post('city_id'),\n\t\t\t\t'area' => $this->input->post('area'),\n\t\t\t\t'zipcode' => $this->input->post('zipcode'),\n\t\t\t\t'created_at'=>date(\"Y-m-d H:i:s\")\t,\t\n\t\t\t\t'created_by'=>$this->session->userdata('id')\t\t\t\t\t\n\t\t\t);\n\t\t\n\t\t\t$result = $this->db->insert(AREA,$data);\n\t\t\tif($result){\n\t\t\t\t$msg = \"Area added Sucessfully!!!\";\n\t\t\t\t$this->session->set_flashdata('message',alert('success',$msg));\t\t\t\t\n\t\t\t\tredirect('area');\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$msg = \"Error in adding!!!\";\n\t\t\t\t$this->session->set_flashdata('message',alert('danger',$msg));\t \n\t\t\t\tredirect('area');\n\t\t\t}\t\n\t\t}\n\t\t\n\t\t$data['state'] = $this->Area_model->getState();\t\n\t\t$data['city'] = $this->Area_model->getCity();\n\t\t$data['Title']=\"Add Area\";\n\t\t$this->load->view('add' ,$data);\n\t}", "public function usage_area_add() {\n CheckAdminLoginSession();\t\t\n\t\t$post_data=$this->input->post();\n\t\tif(!empty($post_data)) { \n\t\t\t$this->form_validation->set_error_delimiters('<span class=\"text-danger\">', '</span>');\n\t\t\t$this->form_validation->set_rules('name', 'Name', 'required|trim');\t\t\n\t\t\t$this->form_validation->set_rules('description', 'Description', 'required|trim');\t\t\t\t\n\t\t\tif($this->form_validation->run() == FALSE) { } else {\n $slug = strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $slug_str)));\n\t\t\t\t$data = array(\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t'name' => $this->input->post('name'),\n\t\t\t\t\t'description' => $this->input->post('description'),\n\t\t\t\t\t'status' => $this->input->post('status'),\n\t\t\t\t\t'created_date' => date('Y-m-d H:i:s'),\n\t\t\t\t\t'modified_date' => date('Y-m-d H:i:s')\n\t\t\t\t); \n\t\t\t\t\n\t\t\t\t$id = $this->admin_model->setInsertData($this->usage_area,$data);\n\t\t\t\t$this->session->set_flashdata('message','Your Vehicle usage area has been added successfully');\n\t\t redirect('admin/vehicle/usage-area','refresh');\n\t\t }\n }\n\t\t$this->load->view('admin/include/head');\n\t\t$this->load->view('admin/include/header');\n\t\t$this->load->view('admin/include/sidebar');\n\t\t$this->load->view('admin/vehicle/usage_area_add');\n\t\t$this->load->view('admin/include/footer');\n\t\t$this->load->view('admin/include/foot');\n\t}", "public function store(AddAreaRequest $request)\n {\n Area::create($request->all());\n Session::flash('flash_admin', 'エリアが追加されました');\n return redirect('/admin/areas');\n }", "public function area() {\r\n }", "public function actionCreate()\n {\n $model = new Area();\n\n if ($this->request->isPost) {\n if ($model->load($this->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } else {\n $model->loadDefaultValues();\n }\n\n return $this->render('/addres/area/create', [\n 'model' => $model,\n ]);\n }", "function area_show_specific_area($areadata = NULL, $inventory_id = NULL) {\n\tassert(!empty($areadata));\n\tdrupal_add_css(drupal_get_path('module', 'area') . '/css/area.css');\n\tdrupal_add_js('misc/form.js');\n\tdrupal_add_js('misc/collapse.js');\n\tdrupal_set_title(t('area').' '.$areadata['name']);\n\t\n\tglobal $base_url;\n\t\n\t//load js for observation table/map\n\t$observation_path = drupal_get_path('module', 'observation');\n\tdrupal_add_js($observation_path . '/js/observation.js');\n\tdrupal_add_library('system', 'ui.dialog');\n\n\t$output['message'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '\n\t\t\t<div id=\"message\" style=\"display: none; height: auto;\">\n\t\t\t\t<div class=\"messages status\"></div>\n\t\t\t</div>'\n\t);\n\t\n\t/* Create a fieldset for the tabular data */\n\t$output['area'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Area details'),\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'id' => 'area-show-details' // required for CSS\n\t\t\t),\n\t\t\t'#weight' => 1\n\t);\n\t\n\t/* Build the content of the table, leave out empty fields */\n\t$output['area']['table'] = area_get_infotable_of_specific_area($areadata);\n\n\t/* Create a fieldset for the static google maps */\n\t$output['area_map'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Map'),\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'id' => 'area-show-map', // required for CSS\n\t\t\t\t\t'name' => 'map' //used for anchor\n\t\t\t)\n\t);\n\t\n\t$iconBaseUrl = '/' . path_to_theme() . '/images/icons/enabled/';\n\t$output['area_map']['zoom'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '<img style=\"cursor:pointer;\" src=\"' . $iconBaseUrl . 'Zoom in.png\" alt=\"' . t('zoomin') . '\" title=\"' . t('zoomin') . '\" onclick=\"javascript:observationmap.zoomIn(event, ' .$areadata['id'] . ');\" /> '.t('zoomin') \n\t);\n\t\n\t//if user has RED_WRITE Permission and area is not a child, user can add a subarea\n\tif(area_check_access($areadata, 'ACL_RED_WRITE') && empty($areadata['parent_id'])) {\n\t\t$output['area_map']['create_sub_area'] = array(\n\t\t\t\t'#type' => 'markup',\n\t\t\t\t'#prefix' => '</br>',\n\t\t\t\t'#markup' => '<img style=\"cursor:pointer;\" onclick=\"window.location.href=\\''.$base_url . '/area/new/'.$areadata['id'].'\\'\" src=\"'.$iconBaseUrl.'Site map.png\" style=\"cursor:pointer;\" alt=\"' .t('Create a subarea') . '\" title=\"' . t('Create a subarea') . '\"/> '. t('Create a subarea')\n\t\t);\n\t}\n\t\n\t$output['area_map']['map'] = array(\n\t\t\t'#theme' => 'area',\n\t\t\t'#mapid' => 'observationmap',\n\t\t\t'#ch1903' => true,\n\t\t\t'#showall' => false,\n\t\t\t'#scalecontrol' => true,\n\t\t\t'#action' => 'show',\n\t\t\t'#reticle' => false,\n\t\t\t'#geometry_edit_id' => (int) $areadata['id'],\n\t\t\t'#defaultzoom' => '15',\n\t\t\t'#infowindow_content_fetch_url_area' => base_path()\n\t\t\t. 'area/{ID}/areaoverview/ajaxform',\n\t\t\t'#infowindow_content_fetch_url_observation' => base_path()\n\t\t\t. 'observation/{ID}/overview/ajaxform',\n\t\t\t'#geometries_fetch_url' => base_path() . 'area/' . $areadata['id'] . '/json',\n\t);\n\t\n\t/* Create a fieldset for the comment text field */\n\t$output['area_description'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Description'),\n\t\t\t'#collapsible' => true,\n\t\t\t'#collapsed' => false,\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'id' => 'area-show-comment',\n\t\t\t\t\t'class' => array(\n\t\t\t\t\t\t\t'collapsible'\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t'#weight' => 2\n\t);\n\t\n\t/* add the comments for the area as an editable textarea */\n\t$output['area_description']['comment'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#markup' => \"<div class='area-description'>\"\n\t\t\t. (empty($areadata['comment']) ? t(\"None available\")\n\t\t\t\t\t: check_plain($areadata['comment'])) . \"</div>\"\n\t);\n\t\n\t/* Create a fieldset for the linked habitats */\n\t$output['area_inventories'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('inventories').' & '.t('observations'),\n\t\t\t'#collapsible' => true,\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'class' => array(\n\t\t\t\t\t\t\t'collapsible'\n\t\t\t\t\t),\n\t\t\t\t\t'id' => 'area-show-comment' // required for CSS\n\t\t\t),\n\t\t\t'#weight' => 3\n\t);\n\tif(area_check_access($areadata, 'ACL_RED_WRITE') && user_access(CREATE_INVENTORY)) {\n\t\tglobal $base_url;\n\t\t$iconBaseUrl = '/' . path_to_theme() . '/images/icons/enabled/';\n\t\t\n\t\t$output['area_inventories']['add_inventory'] = array(\n\t\t\t\t'#type' => 'markup',\n\t\t\t\t'#markup' => '<a href=\"'.$base_url.'/inventory/area/'.$areadata['id'].'/new\"> <img src=\"' . $iconBaseUrl . 'Add.png\" alt=\"' . t('Add Inventory') . '\" title=\"' . t('Add Inventory') . '\" />'.t('Add Inventory').'</a>',\n\t\t);\n\t}\n\t\n\t$output['area_inventories']['inventories'] = inventory_show_area_inventories($areadata);\n\t$output['area_inventories']['space'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '<br><br>'\n\t);\n\t\n\t$output['area_inventories']['observations'] = inventory_show_observations($areadata['id'], $inventory_id);\n\t\n\t/* Create a fieldset for the strategies text fields */\n\t$output['area_concept'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Area concept'),\n\t\t\t'#collapsible' => true,\n\t\t\t'#collapsed' => false,\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'class' => array(\n\t\t\t\t\t\t\t'collapsible',\n\t\t\t\t\t\t\t'collapsed'\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t'#weight' => 4\n\t);\n\n\t/* add the protectiont target textarea */\n\t$output['area_concept']['protection_target'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#title' => t('Protection target'),\n\t\t\t'#markup' => \"<pre>\"\n\t\t\t\t\t. (empty($areadata['protection_target'])\n\t\t\t\t\t\t\t? t(\"None available\")\n\t\t\t\t\t\t\t: check_plain($areadata['protection_target']))\n\t\t\t\t\t. \"</pre>\"\n\t);\n\n\t/* add the tending strategies target textarea */\n\t$output['area_concept']['tending_strategies'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#title' => t('Tending strategies'),\n\t\t\t'#markup' => \"<pre>\"\n\t\t\t\t\t. (empty($areadata['tending_strategies'])\n\t\t\t\t\t\t\t? t(\"None available\")\n\t\t\t\t\t\t\t: check_plain($areadata['tending_strategies']))\n\t\t\t\t\t. \"</pre>\"\n\t);\n\n\t/* add the tending strategies target textarea */\n\t$output['area_concept']['safety_precautions'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#title' => t('Safety precautions'),\n\t\t\t'#markup' => \"<pre>\"\n\t\t\t\t\t. (empty($areadata['safety_precautions'])\n\t\t\t\t\t\t\t? t(\"None available\")\n\t\t\t\t\t\t\t: check_plain($areadata['safety_precautions'])) . \"</pre>\"\n\t);\n\n\t/* Create a fieldset for the linked habitats */\n\t$output['area_habitats'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Linked habitats'),\n\t\t\t'#collapsible' => true,\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'class' => array(\n\t\t\t\t\t\t\t'collapsible',\n\t\t\t\t\t\t\t'collapsed'\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t'#weight' => 5\n\t);\n\n\tif (function_exists('gallery_list_renderer')) {\n\t\t$output['area_videos'] = gallery_list_renderer(\n\t\t\t'videos',\n\t\t\t'area',\n\t\t\t$areadata['id']);\n\t\t$output['area_images'] = gallery_list_renderer(\n\t\t\t'images',\n\t\t\t'area',\n\t\t\t$areadata['id']);\n\t}\n\n\t/* add the linked habitats */\n\t$results = db_query(\n\t\t'SELECT\n\t\t\tlabel,\n\t\t\tname\n\t\tFROM\n\t\t\t{area_habitat} ah\n\t\t\tJOIN {habitat} h ON ah.habitat_id = h.id\n\t\tWHERE\n\t\t\tah.area_id = ?;',\n\t\tarray($areadata['id']));\n\n\t$habitats = array();\n\tforeach ($results->fetchAll() as $habitat) {\n\t\t$habitats[] = (array) $habitat;\n\t}\n\tif(!empty($habitats)) {\n\t\t$output['area_habitats']['habitats'] = array(\n\t\t\t\t'#theme' => 'datatable',\n\t\t\t\t'#header' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'name' => t('Label'),\n\t\t\t\t\t\t\t\t'width' => 300\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'name' => t('Name'),\n\t\t\t\t\t\t\t\t'width' => 300\n\t\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'#tableWidth' => 900,\n\t\t\t\t'#rows' => $habitats,\n\t\t\t\t'#id_table' => DATATABLE_HABITATS\n\t\t);\n\t} else {\n\t\t$output['area_habitats']['habitats'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#markup' => \"<pre>\".t(\"None available\").\"</pre>\",\n\t\t\t);\n\t}\n\n\t$output['area_files'] = area_files($areadata);\n\t$output['area_files']['#weight'] = 6;\n\n\treturn $output;\n}", "public function create()\n {\n return view('admin.addarea');\n }", "public function add(){\n\t\tif ($_POST) {\n\t\t\tif ($this->tareas->save('tareas', $_POST)) {\n\t\t\t\t$this->redirect(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'controller'=>'tareas',\n\t\t\t\t\t\t\t\t'action'=>'index'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t}else{\n\t\t\t\t$this->redirect(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'controller'=>'tareas',\n\t\t\t\t\t\t\t\t'action'=>'index'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\t$this->_view->categorias = $this->db->find('categorias','all');\n\t\t\t$this->_view->titulo = \"Agregar tarea\";\n\t\t\t$this->_view->renderizar('add');\n\t\t}\n\t}", "public function actionCreate()\n {\n $model = new Area();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function changeAction()\r\n {\r\n \t$this->checkAllowed('PROBLEMAREA', 'CHANGE');\r\n \t\r\n\t // param Id is required\r\n\t\t$problemAreaId = Colla_App::getInstance()->getProblemArea();\t\r\n\t\t$form = new Form_ProblemAreaChange($problemAreaId);\r\n\t\t$problemAreaTable = new ProblemArea();\r\n\t\tif ($this->getRequest()->isPost()) {\r\n\t\t\tif ($form->isValid($_POST)) {\r\n\t\t\t\t$problemAreaTable->changeDefinition($problemAreaId, $form->getValues());\r\n\t\t\t\t$this->_helper->FlashMessenger->addMessage('Problem Area has been changed.');\r\n \t\t\t$this->_redirect('/problemarea/view');\r\n\t\t\t}\t\t\t\r\n\t\t} else {\r\n\t\t\t// fill values\r\n\t\t\t$problemArea = $problemAreaTable->getProblemArea($problemAreaId);\r\n\t\t\t$form->getElement('Name')->setValue($problemArea->Name);\r\n\t\t\t$form->getElement('Definition')->setValue($problemArea->Definition);\r\n\t\t}\r\n\t\t\r\n\t\t$this->view->form = $form;\r\n }", "function fun_addAreas($country_id, $area_name, $area_desc, $latitude, $longitude, $zoom_level) {\n\t\tif($area_name == '' || $country_id == '') {\n\t\t\treturn false;\n\t\t} else {\n\t\t\t$map_thumb = '';\n\t\t\t$map_large = '';\n\t\t\t$strInsQuery = \"INSERT INTO \" . TABLE_AREA . \" \n\t\t\t(area_id, country_id, area_name, area_desc, map_thumb, map_large, latitude, longitude, zoom_level) \n\t\t\tVALUES(null, '\".$country_id.\"', '\".fun_db_input($area_name).\"', '\".fun_db_input($area_desc).\"', '\".$map_thumb.\"', '\".$map_large.\"', '\".$latitude.\"', '\".$longitude.\"', '\".$zoom_level.\"')\";\n\t\t\t$this->dbObj->fun_db_query($strInsQuery);\n\t\t\treturn $this->dbObj->getIdentity();\n\t\t}\n\t}", "function ProjectTheme_post_new_area_function()\n{\n\t\n\tglobal $wp_query, $projectOK, $current_user, $MYerror;\n\tget_currentuserinfo();\n\t\n\t$new_Project_step = $wp_query->query_vars['post_new_step'];\n\tif(empty($new_Project_step)) $new_Project_step = 1;\n\t\n\t$pid = $wp_query->query_vars['projectid'];\t\n\t$uid = $current_user->ID;\n\t\n?>\n \t<div id=\"content\" class=\"sonita\">\n \t\n <div class=\"my_box3\"> \n <div class=\"box_content\"> \n \n <?php\n\t\t\t\t\n\t\t\t\t$is_it_allowed = true;\n\t\t\t\t$is_it_allowed = apply_filters('ProjectTheme_is_it_allowed_place_bids', $is_it_allowed);\n\t\n\t\t\t\tif($is_it_allowed != true):\n\t\n\t\t\t\t\tdo_action('ProjectTheme_is_it_not_allowed_place_bids_action');\t\n\t\t\t\t\n\t\t\t\telse:\n\t\t\t\t\n\t\t\t\t?>\n \n \t\n \t\t\t<?php\n\t\t\t\t\n\t\t\t\t\techo '<div id=\"steps\">';\n\t\t\t\t\t\techo '<ul>';\n\t\t\t\t\t\t\techo '<li '.($new_Project_step == '1' ? \"class='active_step' \" : \"\").'>'.__(\"Project Info\", 'ProjectTheme').'</li>';\n\t\t\t\t\t\t\tdo_action('ProjectTheme_after_step1_show', $new_Project_step);\n\t\t\t\t\t\t\techo '<li '.($new_Project_step == '2' ? \"class='active_step' \" : \"\").'>'.__(\"Options\", 'ProjectTheme').'</li>';\n\t\t\t\t\t\t\techo '<li '.($new_Project_step == '3' ? \"class='active_step' \" : \"\").'>'.__(\"Preview\", 'ProjectTheme').'</li>';\n\t\t\t\t\t\t\techo '<li '.($new_Project_step == '4' ? \"class='active_step' \" : \"\").'>'.__(\"Payment & Finish\", 'ProjectTheme').'</li>';\n\t\t\t\t\t\t \n\t\t\t\t\t\techo '</ul>';\t\t\n\t\t\t\t\techo '</div>';\n\n\n//****************************************************************************************\n\n\nif($new_Project_step == \"1\")\n{\n\t//-----------------\n\t\n\t$location \t= wp_get_object_terms($pid, 'project_location', array('order' => 'ASC', 'orderby' => 'term_id' ));\n\t$cat \t\t= wp_get_object_terms($pid, 'project_cat', array('order' => 'ASC', 'orderby' => 'term_id' ));\n\t\n \n\t\n\tif(!empty($pid))\n\t$post \t\t= get_post($pid);\n\t\n\t\n\tif(is_array($MYerror))\n\tif($projectOK == 0)\n\t{\n\t\techo '<div class=\"errrs\">';\n\t\t\n\t\t\techo __('Your form has errors. Please check below, correct the errors, then submit again.','ProjectTheme');\n\t\n\t\techo '</div>';\n\t\t\n\t}\n\t\n\t?>\n <div class=\"sonita2\">\n <form method=\"post\" action=\"<?php echo ProjectTheme_post_new_with_pid_stuff_thg($pid, '1');?>\"> \n <ul class=\"post-new\">\n <?php do_action('ProjectTheme_step1_before_title'); ?>\n \t\n \n <li>\n \t<h3><?php _e('Project Main Information','ProjectTheme'); ?></h3>\n </li>\n \n <li class=\"<?php echo projecttheme_get_post_new_error_thing('project_title') ?>\">\n <?php echo projecttheme_get_post_new_error_thing_display('project_title') ?>\n \n \t<h2><?php echo __('Your project title', 'ProjectTheme'); ?></h2>\n \t<p><input type=\"text\" size=\"50\" class=\"do_input_new full_wdth_me\" name=\"project_title\" placeholder=\"<?php _e('eg: I need a website created very soon.','ProjectTheme') ?>\" value=\"<?php echo (empty($_POST['project_title']) ? \n\t\t\t($post->post_title == \"Auto Draft\" ? \"\" : $post->post_title) : $_POST['project_title']); ?>\" /></p>\n </li>\n \n <?php do_action('ProjectTheme_step1_before_description'); ?>\n <?php\n\t\t\n\t\t\t\n\t\t\t$pst = $post->post_content;\n\t\t\t$pst = str_replace(\"<br />\",\"\",$pst);\n\t\t\n\t\t?>\n <li class=\"<?php echo projecttheme_get_post_new_error_thing('project_description') ?>\">\n <?php echo projecttheme_get_post_new_error_thing_display('project_description') ?>\n \n \t<h2><?php echo __('Description', 'ProjectTheme'); ?></h2>\n <p><textarea rows=\"6\" cols=\"60\" class=\"full_wdth_me do_input_new description_edit\" placeholder=\"<?php _e('Describe here your project scope.','ProjectTheme') ?>\" name=\"project_description\"><?php echo trim($pst); ?></textarea></p>\n </li>\n\n\t\t\n <li>\n \t<h3><?php _e('Categories','ProjectTheme'); ?></h3>\n </li>\n \n <?php do_action('ProjectTheme_step1_before_category'); ?> \n \n <script>\n\t\t\t\n\t\t\t\t\t\t\t\t\tfunction display_subcat(vals)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tjQuery.post(\"<?php bloginfo('url'); ?>/?get_subcats_for_me=1\", {queryString: \"\"+vals+\"\"}, function(data){\n\t\t\t\t\t\t\t\t\t\t\tif(data.length >0) {\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\tjQuery('#sub_cats').html(data);\n\t\t\t\t\t\t\t\t\t\t\t\t \n\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\t\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\n\t\t\t\t\t\t\t\t\tfunction display_subcat2(vals)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tjQuery.post(\"<?php bloginfo('url'); ?>/?get_locscats_for_me=1\", {queryString: \"\"+vals+\"\"}, function(data){\n\t\t\t\t\t\t\t\t\t\t\tif(data.length >0) {\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\tjQuery('#sub_locs').html(data);\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery('#sub_locs2').html(\"&nbsp;\");\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery('#sub_locs').html(\"&nbsp;\");\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery('#sub_locs2').html(\"&nbsp;\");\t\n\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\t\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\tfunction display_subcat3(vals)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tjQuery.post(\"<?php bloginfo('url'); ?>/?get_locscats_for_me2=1\", {queryString: \"\"+vals+\"\"}, function(data){\n\t\t\t\t\t\t\t\t\t\t\tif(data.length >0) {\n\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t\t\tjQuery('#sub_locs2').html(data);\n\t\t\t\t\t\t\t\t\t\t\t\t \n\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\t\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</script>\n \n <li class=\"<?php echo projecttheme_get_post_new_error_thing('project_category') ?>\">\n <?php echo projecttheme_get_post_new_error_thing_display('project_category') ?>\n \n \t \n \t<p class=\"strom_100\">\n\t\t\t\n \n \n <?php if(get_option('ProjectTheme_enable_multi_cats') == \"yes\"): ?>\n\t\t\t<div class=\"multi_cat_placeholder_thing\">\n \n \t<?php \n\t\t\t\t\t\n\t\t\t\t\t$selected_arr = ProjectTheme_build_my_cat_arr($pid);\n\t\t\t\t\techo projectTheme_get_categories_multiple('project_cat', $selected_arr); \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t?>\n \n </div>\n \n <?php else: ?>\n \n\t\t\t<?php\t \n\t\t\t \n\t\t\t \techo projectTheme_get_categories_clck(\"project_cat\", \n !isset($_POST['project_cat_cat']) ? (is_array($cat) ? $cat[0]->term_id : \"\") : htmlspecialchars($_POST['project_cat_cat'])\n , __('Select Category','ProjectTheme'), \"do_input_new\", 'onchange=\"display_subcat(this.value)\"' );\n\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\techo '<br/><span id=\"sub_cats\">';\n\t\t\t \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif(!empty($cat[1]->term_id))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$args2 = \"orderby=name&order=ASC&hide_empty=0&parent=\".$cat[0]->term_id;\n\t\t\t\t\t\t\t\t\t\t\t\t$sub_terms2 = get_terms( 'project_cat', $args2 );\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$ret = '<select class=\"do_input_new\" name=\"subcat\">';\n\t\t\t\t\t\t\t\t\t\t\t\t$ret .= '<option value=\"\">'.__('Select Subcategory','ProjectTheme'). '</option>';\n\t\t\t\t\t\t\t\t\t\t\t\t$selected1 = $cat[1]->term_id;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $sub_terms2 as $sub_term2 )\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$sub_id2 = $sub_term2->term_id; \n\t\t\t\t\t\t\t\t\t\t\t\t\t$ret .= '<option '.($selected1 == $sub_id2 ? \"selected='selected'\" : \" \" ).' value=\"'.$sub_id2.'\">'.$sub_term2->name.'</option>';\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t$ret .= \"</select>\";\n\t\t\t\t\t\t\t\t\t\t\t\techo $ret;\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\techo '</span>';\t\t\t\n\t\t\t\n\t\t\t ?>\n <?php endif; ?>\n \n \n </p>\n </li>\n \n \t\n \n <?php do_action('ProjectTheme_step1_before_tags'); \n\t\t$project_tags = '';\n\t\t$t = wp_get_post_tags($post->ID);\n\t\tforeach($t as $tags)\n\t\t{\n\t\t\t$project_tags .= $tags->name . \", \";\t\t\n\t\t}\n\t\t\n\t\t\n\t\t?>\n\t\t<li>\n \t<h2><?php echo __('Tags', 'ProjectTheme'); ?></h2>\n <p><input type=\"text\" size=\"50\" class=\"full_wdth_me do_input_new\" name=\"project_tags\" placeholder=\"<?php _e('eg: something, comma, separated.','ProjectTheme') ?>\" value=\"<?php echo $project_tags; ?>\" /> </p>\n </li>\n \n \n <?php do_action('ProjectTheme_step1_after_tags'); ?>\n \n <li>\n \t<h3><?php _e('Skills','ProjectTheme'); ?></h3>\n </li>\n \n \n <li>\n <div class=\"multi_cat_placeholder_thing\">\n \n \t<?php \n\t\t\t\t\t\n\t\t\t\t\t$selected_arr = projectTheme_build_my_cat_arr2($pid);\n\t\t\t\t\techo projectTheme_get_categories_multiple2('project_skill', $selected_arr); \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t?>\n \n </div>\n </li>\n \n \n \n <li>\n \t<h3><?php _e('Pricing and Budget','ProjectTheme'); ?></h3>\n </li>\n \n <?php do_action('ProjectTheme_step1_before_price'); ?>\n \n <li><h2><?php echo __('Project Budget', 'ProjectTheme'); ?></h2>\n <p class=\"strom_100\">\n \n <?php\n\t \n\t $sel = get_post_meta($pid, 'budgets', true);\n\t echo ProjecTheme_get_budgets_dropdown($sel, 'do_input_new');\n\t \n\t ?>\n \n </p>\n </li>\n \n <?php do_action('ProjectTheme_step1_before_ending'); ?>\n \n <li>\n <h2>\n \n <script src=\"//ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/jquery-ui.min.js\"></script>\n \t\n \n <link rel=\"stylesheet\" media=\"all\" type=\"text/css\" href=\"<?php echo get_bloginfo('template_url'); ?>/css/ui_thing.css\" />\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"<?php echo get_bloginfo('template_url'); ?>/js/timepicker.js\"></script>\n \n\n <?php _e(\"Project Ending On\",'ProjectTheme'); ?></h2>\n <?php \n\t \n\t $dt = get_post_meta($pid,'ending',true);\n\t \n\t if(!empty($dt))\n\t $dt = date_i18n('d-m-Y H:i',$dt);\n\t \n\t ?>\n <p><input type=\"text\" name=\"ending\" id=\"ending\" class=\"full_wdth_me do_input_new\" value=\"<?php echo $dt; ?>\" /></p>\n </li>\n \n \t\t<script>\n\t\t<?php\n\t\t\n\t\t\t$dd = get_option('projectTheme_project_period');\n\t\t\tif(empty($dd)) $dd = 7;\n\t\t\n\t\t?>\n\t\t\n\t\t\tvar myDate=new Date();\n\t\t\tmyDate.setDate(myDate.getDate()+<?php echo $dd; ?>);\n\t\t\t\n\t\t\t$(document).ready(function() {\n\t\t\t\t $('#ending').datetimepicker({\n\t\t\t\tshowSecond: false,\n\t\t\t\ttimeFormat: 'hh:mm:ss',\n\t\t\t\t\n\t\t\t\t\tcurrentText: '<?php _e('Now','ProjectTheme'); ?>',\n\t\t\t\t\tcloseText: '<?php _e('Done','ProjectTheme'); ?>',\n\t\t\t\t\tampm: false,\n\t\t\t\t\tdateFormat: 'dd-mm-yy',\n\t\t\t\t\ttimeFormat: 'hh:mm tt',\n\t\t\t\t\ttimeSuffix: '',\n\t\t\t\t\tmaxDateTime: myDate,\n\t\t\t\t\ttimeOnlyTitle: '<?php _e('Choose Time','ProjectTheme'); ?>',\n\t\t\t\t\ttimeText: '<?php _e('Time','ProjectTheme'); ?>',\n\t\t\t\t\thourText: '<?php _e('Hour','ProjectTheme'); ?>',\n\t\t\t\t\tminuteText: '<?php _e('Minute','ProjectTheme'); ?>',\n\t\t\t\t\tsecondText: '<?php _e('Second','ProjectTheme'); ?>',\n\t\t\t\t\ttimezoneText: '<?php _e('Time Zone','ProjectTheme'); ?>'\n\t\t\t\n\t\t\t});});\n \n \t\t</script>\n \n \n \n\n \n \n <?php do_action('ProjectTheme_step1_before_location'); ?>\n <?php\n\t\t\n\t\t\t$ProjectTheme_enable_project_location = get_option('ProjectTheme_enable_project_location');\n\t\t\tif($ProjectTheme_enable_project_location == \"yes\"):\n\t\t\n\t\t?>\n \n <li>\n \t<h3><?php _e('Location','ProjectTheme'); ?></h3>\n </li>\n \n <li class=\"<?php echo projecttheme_get_post_new_error_thing('project_location') ?>\">\n <?php echo projecttheme_get_post_new_error_thing_display('project_location') ?>\n \n \t<h2><?php echo __('Location', 'ProjectTheme'); ?></h2>\n <p class=\"strom_100\"> \n \n \n \n <?php\t \n\t\t\t \n\t\t\t \techo projectTheme_get_categories_clck(\"project_location\", \n !isset($_POST['project_location_cat']) ? (is_array($location) ? $location[0]->term_id : \"\") : htmlspecialchars($_POST['project_location_cat'])\n , __('Select Location','ProjectTheme'), \"do_input_new\", 'onchange=\"display_subcat2(this.value)\"' );\n\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\techo '<br/><span id=\"sub_locs\">';\n\t\t\t \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif(!empty($location[1]->term_id))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$args2 = \"orderby=name&order=ASC&hide_empty=0&parent=\".$location[0]->term_id;\n\t\t\t\t\t\t\t\t\t\t\t\t$sub_terms2 = get_terms( 'project_location', $args2 );\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$ret = '<select class=\"do_input_new\" name=\"subloc\">';\n\t\t\t\t\t\t\t\t\t\t\t\t$ret .= '<option value=\"\">'.__('Select SubLocation','ProjectTheme'). '</option>';\n\t\t\t\t\t\t\t\t\t\t\t\t$selected1 = $location[1]->term_id;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $sub_terms2 as $sub_term2 )\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$sub_id2 = $sub_term2->term_id; \n\t\t\t\t\t\t\t\t\t\t\t\t\t$ret .= '<option '.($selected1 == $sub_id2 ? \"selected='selected'\" : \" \" ).' value=\"'.$sub_id2.'\">'.$sub_term2->name.'</option>';\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t$ret .= \"</select>\";\n\t\t\t\t\t\t\t\t\t\t\t\techo $ret;\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\techo '</span>';\t\t\n\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\techo '<br/><span id=\"sub_locs2\">';\n\t\t\t \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif(!empty($location[2]->term_id))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$args2 = \"orderby=name&order=ASC&hide_empty=0&parent=\".$location[1]->term_id;\n\t\t\t\t\t\t\t\t\t\t\t\t$sub_terms2 = get_terms( 'project_location', $args2 );\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t$ret = '<select class=\"do_input_new\" name=\"subloc2\">';\n\t\t\t\t\t\t\t\t\t\t\t\t$ret .= '<option value=\"\">'.__('Select SubLocation','ProjectTheme'). '</option>';\n\t\t\t\t\t\t\t\t\t\t\t\t$selected1 = $location[2]->term_id;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $sub_terms2 as $sub_term2 )\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$sub_id2 = $sub_term2->term_id; \n\t\t\t\t\t\t\t\t\t\t\t\t\t$ret .= '<option '.($selected1 == $sub_id2 ? \"selected='selected'\" : \" \" ).' value=\"'.$sub_id2.'\">'.$sub_term2->name.'</option>';\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t$ret .= \"</select>\";\n\t\t\t\t\t\t\t\t\t\t\t\techo $ret;\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\techo '</span>';\t\t\t\n\t\t\t\n\t\t\t ?>\n \n \n \n \n \n \n \n </p>\n </li>\n \n \n <?php do_action('ProjectTheme_step1_before_address'); ?> \n <?php\n\t \n\t $show_address = true;\n\t $show_address = apply_filters('ProjectTheme_show_address_filter', $show_address);\n\t \n\t if($show_address == true):\n\t \n\t ?> \n <li>\n \t<h2><?php echo __('Address','ProjectTheme'); ?></h2>\n <p><input type=\"text\" size=\"50\" class=\"full_wdth_me do_input_new\" placeholder=\"<?php _e('eg: New York, 13221','ProjectTheme'); ?>\" name=\"project_location_addr\" value=\"<?php echo !isset($_POST['project_location_addr']) ? \n\t\tget_post_meta($pid, 'Location', true) : $_POST['project_location_addr']; ?>\" /> </p>\n </li>\n <?php endif; endif; ?>\n \n <li>\n \t<h3><?php _e('Attach Images','ProjectTheme'); ?></h3>\n </li>\n \n <li>\n <div class=\"cross_cross\">\n\n \n \n \n \n \n <script>\n \n\t\n\tjQuery(function() {\n\nDropzone.autoDiscover = false; \t \nvar myDropzoneOptions = {\n maxFilesize: 15,\n addRemoveLinks: true,\n\tacceptedFiles:'image/*',\n clickable: true,\n\turl: \"<?php bloginfo('url') ?>/?my_upload_of_project_files2=1\",\n};\n \nvar myDropzone = new Dropzone('div#myDropzoneElement2', myDropzoneOptions);\n\nmyDropzone.on(\"sending\", function(file, xhr, formData) {\n formData.append(\"author\", \"<?php echo $cid; ?>\"); // Will send the filesize along with the file as POST data.\n formData.append(\"ID\", \"<?php echo $pid; ?>\"); // Will send the filesize along with the file as POST data.\n});\n\n \n <?php\n\n\t\t$args = array(\n\t'order' => 'ASC',\n\t'orderby' => 'menu_order',\n\t'post_type' => 'attachment',\n\t'post_parent' => $pid,\n\t'post_status' => null,\n\t'post_mime_type' => 'image',\n\t'numberposts' => -1,\n\t);\n\t$attachments = get_posts($args);\n\t\n\tif($pid > 0)\n\tif ($attachments) \n\t{\n\t foreach ($attachments as $attachment) \n\t\t{\n\t\t\t$url = $attachment->guid;\n\t\t\t$imggg = $attachment->post_mime_type; \n\t\t\t$url = wp_get_attachment_url($attachment->ID);\t \n\t\t\t\t\n\t\t\t\t?>\t\n\t\t\t\t\t\tvar mockFile = { name: \"<?php echo $attachment->post_title ?>\", size: 12345, serverId: '<?php echo $attachment->ID ?>' };\n\t\t\t\t\t\tmyDropzone.options.addedfile.call(myDropzone, mockFile);\n\t\t\t\t\t\tmyDropzone.options.thumbnail.call(myDropzone, mockFile, \"<?php echo projectTheme_generate_thumb($attachment->ID, 100, 100) ?>\");\t\t\t\t\t\t \n\t\t\t\t\n\t\t\t\t<?php\t\t\t\n\t \t}\n\t}\n\n\t?>\n \n\tmyDropzone.on(\"success\", function(file, response) {\n /* Maybe display some more file information on your page */\n\t file.serverId = response;\n\t file.thumbnail = \"<?php echo bloginfo('template_url') ?>/images/file_icon.png\";\n\t \n\t \n });\n \n \nmyDropzone.on(\"removedfile\", function(file, response) {\n /* Maybe display some more file information on your page */\n\t delete_this2(file.serverId);\n\t \n }); \t\n\t\n\t});\n\t\n\t</script>\n\n \n\n\t<?php _e('Click the grey area below to add project images. Other files are not accepted. Use the form below.','ProjectTheme') ?>\n <div class=\"dropzone dropzone-previews\" id=\"myDropzoneElement2\" ></div>\n \n \n\t</div>\n </li>\n \t\t\n <li>\n \t<h3><?php _e('Attach Files','ProjectTheme'); ?></h3>\n </li>\n \n \n <li>\n <div class=\"cross_cross\">\n\n\n\n\t<script type=\"text/javascript\" src=\"<?php echo get_bloginfo('template_url'); ?>/js/dropzone.js\"></script> \n\t<link rel=\"stylesheet\" href=\"<?php echo get_bloginfo('template_url'); ?>/css/dropzone.css\" type=\"text/css\" />\n \n \n \n \n <script>\n \n\t\n\tjQuery(function() {\n\nDropzone.autoDiscover = false; \t \nvar myDropzoneOptions = {\n maxFilesize: 15,\n addRemoveLinks: true,\n\tacceptedFiles:'.zip,.pdf,.rar,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.psd,.ai',\n clickable: true,\n\turl: \"<?php bloginfo('url') ?>/?my_upload_of_project_files_proj=1\",\n};\n \nvar myDropzone = new Dropzone('div#myDropzoneElement', myDropzoneOptions);\n\nmyDropzone.on(\"sending\", function(file, xhr, formData) {\n formData.append(\"author\", \"<?php echo $cid; ?>\"); // Will send the filesize along with the file as POST data.\n formData.append(\"ID\", \"<?php echo $pid; ?>\"); // Will send the filesize along with the file as POST data.\n});\n\n \n <?php\n\n\t\t$args = array(\n\t'order' => 'ASC',\n\t'orderby' => 'menu_order',\n\t'post_type' => 'attachment',\n\t'meta_key' \t\t=> 'is_prj_file',\n\t'meta_value' \t=> '1',\t\n\t'post_parent' => $pid,\n\t'post_status' => null,\n\t'numberposts' => -1,\n\t);\n\t$attachments = get_posts($args);\n\t\n\tif($pid > 0)\n\tif ($attachments) {\n\t foreach ($attachments as $attachment) {\n\t\t$url = $attachment->guid;\n\t\t$imggg = $attachment->post_mime_type; \n\t\t\n\t\tif('image/png' != $imggg && 'image/jpeg' != $imggg)\n\t\t{\n\t\t$url = wp_get_attachment_url($attachment->ID);\n \n\t\t\t\n\t\t\t?>\n\n\t\t\t\t\tvar mockFile = { name: \"<?php echo $attachment->post_title ?>\", size: 12345, serverId: '<?php echo $attachment->ID ?>' };\n\t\t\t\t\tmyDropzone.options.addedfile.call(myDropzone, mockFile);\n\t\t\t\t\tmyDropzone.options.thumbnail.call(myDropzone, mockFile, \"<?php echo bloginfo('template_url') ?>/images/file_icon.png\");\n\t\t\t\t\t \n\t\t\t\n\t\t\t<?php\n\t\t\t\n\t \n\t}\n\t}}\n\n\n\t?>\n \n\n\nmyDropzone.on(\"success\", function(file, response) {\n /* Maybe display some more file information on your page */\n\t file.serverId = response;\n\t file.thumbnail = \"<?php echo bloginfo('template_url') ?>/images/file_icon.png\";\n\t \n\t \n });\n \n \nmyDropzone.on(\"removedfile\", function(file, response) {\n /* Maybe display some more file information on your page */\n\t delete_this2(file.serverId);\n\t \n }); \t\n\t\n\t});\n\t\n\t</script>\n\n <script type=\"text/javascript\">\n\t\n\tfunction delete_this2(id)\n\t{\n\t\t jQuery.ajax({\n\t\t\t\t\t\tmethod: 'get',\n\t\t\t\t\t\turl : '<?php echo get_bloginfo('url');?>/index.php/?_ad_delete_pid='+id,\n\t\t\t\t\t\tdataType : 'text',\n\t\t\t\t\t\tsuccess: function (text) { jQuery('#image_ss'+id).remove(); }\n\t\t\t\t\t });\n\t\t //alert(\"a\");\n\t\n\t}\n\n\t\n \n\t\n\t\n\t</script>\n\n\t<?php _e('Click the grey area below to add project files. Images are not accepted.','ProjectTheme') ?>\n <div class=\"dropzone dropzone-previews\" id=\"myDropzoneElement\" ></div>\n \n \n\t</div>\n </li>\n \n <li>\n <h2>&nbsp;</h2>\n <p> \n <input type=\"submit\" name=\"project_submit1\" value=\"<?php _e(\"Next Step\", 'ProjectTheme'); ?> >>\" class=\"submit_bottom\" /></p>\n </li>\n \t\n <?php do_action('ProjectTheme_step1_after_submit'); ?>\n \n </ul>\n </form>\n </div>\n <?php\n\n}\n\nif($new_Project_step == \"2\")\n{\n\tglobal $MYerror, $projectOK;\n\t\n\t$cid \t= $current_user->ID;\n\tdo_action('ProjectTheme_post_new_step2_before_images'); \n\t\n\t\n\tif(is_array($MYerror))\n\tif($projectOK == 0)\n\t{\n\t\techo '<div class=\"errrs\">';\n\t\t\n\t\t\techo __('Your form has errors. Please check below, correct the errors, then submit again.','ProjectTheme');\n\t\n\t\techo '</div>';\n\t\t\n\t}\n\t\n\t?>\n \n \n \n \n \t<ul class=\"post-new\">\n \n \n\n \n <form method=\"post\" > \n <?php do_action('ProjectTheme_step2_before_project_files'); ?>\n \n \n \n \n \n \t<?php /*------- custom fields -------- */ ?>\n <?php\n\t\t\n\t\t$show_fields_in_step2 = true;\n\t\t$show_fields_in_step2 = apply_filters('ProjectTheme_show_fields_in_step2', $show_fields_in_step2);\n\t\t \n\t\t\n\t\tif($show_fields_in_step2 == true):\n\t\t\n\t\t\t$catid = ProjectTheme_get_project_primary_cat($pid);\n\t\t\t$arr = ProjectTheme_get_project_category_fields($catid, $pid);\n\t\t\t \n\t\t\t\n\t\t\t\tfor($i=0;$i<count($arr);$i++)\n\t\t\t\t{\n\t\t\t\t\t \n \n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\techo '<li class=\"'.projecttheme_get_post_new_error_thing('custom_field_' . $arr[$i]['id'] ).'\" >';\n\t\t\t\t\t\t\techo projecttheme_get_post_new_error_thing_display('custom_field_' . $arr[$i]['id']);\n\t\t\t\t\t\t\techo '<h2>'.$arr[$i]['field_name']. '</h2>';\n\t\t\t\t\t\t\techo '<p>'.$arr[$i]['value'].'</p>';\n\t\t\t\t\t\t\techo '</li>';\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\t\n\t\t\n\t\tendif;\n\t\t\n\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \t$ProjectTheme_enable_featured_option = get_option('ProjectTheme_enable_featured_option');\t\t\t\t\t\t \n\t\t\t\t\t\t \tif($ProjectTheme_enable_featured_option != \"no\"):\n\t\t\t\t\t\t \n\t\t\t\t\t\t ?>\n\t\t\n\t \n \n \n <li>\n <h2><?php _e(\"Feature project?\",'ProjectTheme'); ?></h2>\n <p><input type=\"checkbox\" class=\"do_input_new\" name=\"featured\" value=\"1\" \n\t\t<?php $feature = get_post_meta($pid, 'featured', true); echo ($feature == \"1\" ? \"checked='checked'\" : \"\"); ?> /> \n <?php \n\t\t\n\t\t\t\t\n\t\t$projectTheme_featured_fee = get_option('projectTheme_featured_fee');\n\t\t$sl = __('Extra fee is applied','ProjectTheme');\n\t\tif(empty($projectTheme_featured_fee) or $projectTheme_featured_fee <= 0) $sl = '';\n\t\t\n\t\t\n\t\tprintf(__(\"By clicking this checkbox you mark your project as featured. %s\", 'ProjectTheme'), $sl); ?></p>\n </li>\n \n <?php endif; ?>\n \n <?php do_action('ProjectTheme_step2_before_feature_project'); ?>\n \n \n <?php\n\t\t\t\t\t\t \n\t\t\t\t\t\t \t$ProjectTheme_enable_sealed_option = get_option('ProjectTheme_enable_sealed_option');\t\t\t\t\t\t \n\t\t\t\t\t\t \tif($ProjectTheme_enable_sealed_option != \"no\"):\n\t\t\t\t\t\t \n\t\t\t\t\t\t ?>\n \n <li>\n <h2><?php _e(\"Sealed Bidding?\",'ProjectTheme'); ?></h2>\n <p><input type=\"checkbox\" class=\"do_input_new\" name=\"private_bids\" value=\"1\"\n <?php $private_bids = get_post_meta($pid, 'private_bids', true); echo ($private_bids == \"1\" ? \"checked='checked'\" : \"\"); ?> /> \n <?php \n\t\t\n\t\t$projectTheme_sealed_bidding_fee = get_option('projectTheme_sealed_bidding_fee');\n\t\t$sl = __('Extra fee is applied','ProjectTheme');\n\t\tif(empty($projectTheme_sealed_bidding_fee) or $projectTheme_sealed_bidding_fee <= 0) $sl = '';\n\t\t\n\t\t\n\t\tprintf(__(\"By clicking this checkbox you hide your project's bids. %s\", 'ProjectTheme'), $sl); ?></p>\n </li>\n <?php endif; ?>\n \n <?php do_action('ProjectTheme_step2_before_sealed_bidding'); ?>\n \n <?php\n\t\t\t\t\t\t \n\t\t\t\t\t\t \t$ProjectTheme_enable_hide_option = get_option('ProjectTheme_enable_hide_option');\t\t\t\t\t\t \n\t\t\t\t\t\t \tif($ProjectTheme_enable_hide_option != \"no\"):\n\t\t\t\t\t\t \n\t\t\t\t\t\t ?> \n \n <li>\n <h2><?php _e(\"Hide Project from search engines\",'ProjectTheme'); ?></h2>\n <p><input type=\"checkbox\" class=\"do_input_new\" name=\"hide_project\" value=\"1\" \n <?php $hide_project = get_post_meta($pid, 'hide_project', true); echo ($hide_project == \"1\" ? \"checked='checked'\" : \"\"); ?>/> \n <?php \n\t\t\n\t\t$projectTheme_hide_project_fee = get_option('projectTheme_hide_project_fee');\n\t\t$sl = __('Extra fee is applied','ProjectTheme');\n\t\tif(empty($projectTheme_hide_project_fee) or $projectTheme_hide_project_fee <= 0) $sl = '';\n\t\t\n\t\techo sprintf(__(\"By clicking this checkbox you hide your project from search engines. %s\", 'ProjectTheme'), $sl); ?></p>\n </li>\n <?php endif; ?>\n \n\t\t<?php do_action('ProjectTheme_step2_before_hide_project'); ?>\n \n \n\n \n <li>\n <h2>&nbsp;</h2>\n <?php\n\t\t\n\t\t$stp = 1;\n\t\t$stp = apply_filters('ProjectTheme_filter_go_back_stp2', $stp);\n\t\t\n\t\t?>\n <p><a href=\"<?php echo ProjectTheme_post_new_with_pid_stuff_thg($pid, $stp); ?>\" class=\"go_back_btn\" ><?php _e('Go Back','ProjectTheme'); ?></a> \n <input type=\"submit\" name=\"project_submit2\" value=\"<?php _e(\"Next Step\", 'ProjectTheme'); ?> >>\" class=\"submit_bottom\" /></p>\n </li>\n \n \n </ul>\n </form>\n \n \n \n <?php\n}\n\n\ndo_action('ProjectTheme_see_if_we_can_add_steps', $new_Project_step, $pid );\n\nif($new_Project_step == \"3\")\n{\n\t\n\t\n\t\n?>\n\n<div class=\"padd10\">\n\n<a href=\"<?php echo ProjectTheme_post_new_with_pid_stuff_thg($pid, 2); ?>\" class=\"go_back_btn\" ><?php _e('Go Back','ProjectTheme'); ?></a> \n<a href=\"<?php echo ProjectTheme_post_new_with_pid_stuff_thg($pid, 4); ?>\" class=\"go_back_btn\" ><?php _e('Next Step','ProjectTheme'); ?> >></a> \n\n</div>\n<div class=\"clear10\"></div>\n\n<hr color=\"efefef\" />\n\n\n</div></div>\n\n\n<div><div>\n\n\n<?php\n \n\tglobal $current_user;\n\tget_currentuserinfo();\n\t$uid = $current_user->ID;\n\tglobal $wpdb;\n\t$post_AU = get_post($pid);\n\t$PID_PID = $pid;\n\n \n?>\n\n \n<link media=\"screen\" rel=\"stylesheet\" href=\"'.get_bloginfo('template_url').'/css/colorbox.css\" /> \n<script src=\"'.get_bloginfo('template_url').'/js/jquery.colorbox.js\"></script> \n<script>\n\n\t\t\n\t\t\tjQuery(document).ready(function(){\n\t\t\t\t\n\t\t\t\tjQuery(\"a[rel='image_gal1']\").colorbox();\n\t\t\t\tjQuery(\"a[rel='image_gal2']\").colorbox();\n\t\t\t\t\n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\tjQuery('.get_files').click( function () {\n\t\t\t\t\t\n\t\t\t\t\tvar myRel = jQuery(this).attr('rel');\n\t\t\t\t\tmyRel = myRel.split(\"_\");\n\t\t\t\t\t\n\t\t\t\t\tjQuery.colorbox({href: \"<?php bloginfo('url'); ?>/?get_files_panel=\" + myRel[0] +\"&uid=\" + myRel[1] });\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tjQuery(\"#report-this-link\").click( function() {\n\t\t\t\t\t\n\t\t\t\t\tif(jQuery(\"#report-this\").css('display') == 'none')\t\t\t\t\t\n\t\t\t\t\tjQuery(\"#report-this\").show('slow');\n\t\t\t\t\telse\n\t\t\t\t\tjQuery(\"#report-this\").hide('slow');\n\t\t\t\t\t\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tjQuery(\"#contact_seller-link\").click( function() {\n\t\t\t\t\t\n\t\t\t\t\tif(jQuery(\"#contact-seller\").css('display') == 'none')\t\t\t\t\t\n\t\t\t\t\tjQuery(\"#contact-seller\").show('slow');\n\t\t\t\t\telse\n\t\t\t\t\tjQuery(\"#contact-seller\").hide('slow');\n\t\t\t\t\t\n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t\t\n\t\t});\n</script> \n\n\n \n \n <?php\n\n\n\t$location \t\t= get_post_meta($PID_PID, \"Location\", true);\n\t$ending \t\t= get_post_meta($PID_PID, \"ending\", true);\n\t$featured \t\t= get_post_meta($PID_PID, \"featured\", true);\n\t$private_bids \t= get_post_meta($PID_PID, \"private_bids\", true);\n\t\n\t//---- increase views\n\t\n\t$views \t= get_post_meta($PID_PID, \"views\", true);\n\t$views \t\t= $views + 1;\n\tupdate_post_meta($PID_PID, \"views\", $views);\n\n\t\n\n?>\t \n \n\n \n\n\n<div class=\"content_dust\">\n\n\n\t\n\n<div id=\"report-this\" style=\"display:none\">\n<div class=\"my_box3\">\n <div class=\"padd10\">\n \n \t<div class=\"box_title\"><?php echo __(\"Report this project\",'ProjectTheme'); ?></div>\n <div class=\"box_content\">\n <?php\n\t\t\t\t\n\t\t\t\tif(!is_user_logged_in()):\n\t\t\t\t\n\t\t\t\t?>\n \n <?php echo sprintf(__('You need to be <a href=\"%s\">logged</a> in to use this feature.','ProjectTheme'), get_bloginfo('url').\"/wp-login.php\" ); ?>\n <?php else: ?>\n \n \n\t\t\t\t\t<form method=\"post\"><input type=\"hidden\" value=\"<?php echo $PID_PID; ?>\" name=\"pid_rep\" />\n <ul class=\"post-new3\">\n\n \n <li>\n \t<h2><?php echo __('Reason for reporting','ProjectTheme'); ?>:</h2>\n <p><textarea rows=\"4\" cols=\"40\" class=\"do_input\" name=\"reason_report\"></textarea></p>\n </li>\n \n \n \n \n <li>\n <h2>&nbsp;</h2>\n <p><input type=\"submit\" name=\"report_this\" value=\"<?php _e('Submit Report','ProjectTheme'); ?>\" /></p>\n </li>\n \n \n </ul>\n </form> <?php endif; ?>\n \n \n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t</div>\n \n <div class=\"clear10\"></div>\n\n</div>\n\n\n<!-- ######### -->\n\n\n\n\n\n\n \t\t\t<div class=\"project-signle-content-main\">\n \n\t\t\t \n\t\t\t\t\n <?php\n\t\t\t\t\n\t\t\t\t$closed \t = get_post_meta($PID_PID,'closed',true);\n\t\t\t\t\n\t\t\t\t?>\n \n\t\t\t\t<div class=\"project-page-details-holder\">\n <?php \n\t\t\t\tif($closed == \"0\") :\n\t\t\t\tif($bid_posted == \"0\"): ?> \n\t\t\n <div class=\"bid_panel_err\">\n <div class=\"padd10\">\n <?php _e(\"Your bid has not been posted. Please correct the errors and try again.\",'ProjectTheme');\n echo '<br/>';\n foreach($errors as $err)\n echo $err.'<br/>';\n ?>\n </div>\n </div>\n \n <?php endif; ?>\n \n \n <?php if($_GET['bid_posted'] == 1): ?>\n\t\t\n <div class=\"bid_panel_ok\">\n <div class=\"padd10\">\n <?php _e(\"Your bid has been posted.\",'ProjectTheme');\n \n ?>\n </div>\n </div>\n \n <?php endif; ?>\n\n \n \n \t<div class=\"bid_panel_front\">\n <div class=\"padd10\">\n \n <div class=\"small_buttons_div_left\">\n \t<ul class=\"project-details\">\n\t\t\t\t\t\t\t<li>\n \t<img src=\"<?php bloginfo('template_url') ?>/images/wallet_icon2.png\" width=\"18\" height=\"18\" alt=\"budget\" />\n\t\t\t\t\t\t\t\t<h3><?php echo __(\"Project Budget\",'ProjectTheme'); ?>:</h3>\n\t\t\t\t\t\t\t\t<p><?php echo ProjectTheme_get_budget_name_string_fromID(get_post_meta($PID_PID, 'budgets', true)); ?></p>\n\t\t\t\t\t\t\t</li>\n \n \n <li>\n \t<img src=\"<?php bloginfo('template_url') ?>/images/coins_icon.png\" width=\"18\" height=\"18\" alt=\"coins\" />\n\t\t\t\t\t\t\t\t<h3><?php echo __(\"Average Bid\",'ProjectTheme'); ?>:</h3>\n\t\t\t\t\t\t\t\t<p><?php echo ProjectTheme_average_bid($PID_PID); ?></p>\n\t\t\t\t\t\t\t</li>\n \n \n \n \n \t\t\t<?php\n\t\t\n\t\t\t\t\t\t$ProjectTheme_enable_project_location = get_option('ProjectTheme_enable_project_location');\n\t\t\t\t\t\tif($ProjectTheme_enable_project_location == \"yes\"):\n\t\t\n\t\t\t\t\t\t?> \n <li>\n\t\t\t\t\t\t\t\t<img src=\"<?php echo get_bloginfo('template_url'); ?>/images/loc_icon.png\" width=\"18\" height=\"18\" alt=\"location\" /> \n\t\t\t\t\t\t\t\t<h3><?php echo __(\"Location\",'ProjectTheme'); ?>:</h3>\n\t\t\t\t\t\t\t\t<p><?php echo get_the_term_list( $PID_PID, 'project_location', '', ', ', '' ); ?></p>\n\t\t\t\t\t\t\t</li>\n \n <?php endif; ?> \n \n \n <li>\n\t\t\t\t\t\t\t\t<img src=\"<?php echo get_bloginfo('template_url'); ?>/images/cate_icon.png\" width=\"18\" height=\"18\" alt=\"category\" /> \n\t\t\t\t\t\t\t\t<h3><?php echo __(\"Category\",'ProjectTheme'); ?>:</h3>\n\t\t\t\t\t\t\t\t<p><?php echo get_the_term_list( $PID_PID, 'project_cat', '', ', ', '' ); ?></p>\n\t\t\t\t\t\t\t</li>\n \n \n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<img src=\"<?php echo get_bloginfo('template_url'); ?>/images/cal_icon.png\" width=\"18\" height=\"18\" alt=\"calendar\" /> \n\t\t\t\t\t\t\t\t<h3><?php echo __(\"Posted on\",'ProjectTheme'); ?>:</h3>\n\t\t\t\t\t\t\t\t<p><?php echo get_the_time(\"jS F Y g:i A\", $PID_PID); ?></p>\n\t\t\t\t\t\t\t</li>\n \n <li>\n\t\t\t\t\t\t\t\t<img src=\"<?php echo get_bloginfo('template_url'); ?>/images/clock_icon.png\" width=\"18\" height=\"18\" alt=\"clock\" /> \n\t\t\t\t\t\t\t\t<h3><?php echo __(\"Time Left\",'ProjectTheme'); ?>:</h3>\n\t\t\t\t\t\t\t\t<p><?php echo ($closed == \"0\" ? ProjectTheme_prepare_seconds_to_words($ending - current_time('timestamp',0)) \n\t\t\t\t\t\t\t\t: __(\"Expired/Closed\",'ProjectTheme')); ?></p>\n\t\t\t\t\t\t\t</li>\n \n \n <li>\n \t<img src=\"<?php bloginfo('template_url') ?>/images/prop_icon.png\" width=\"18\" height=\"18\" alt=\"proposals\" />\n\t\t\t\t\t\t\t\t<h3><?php echo __(\"Proposals\",'ProjectTheme'); ?>:</h3>\n\t\t\t\t\t\t\t\t<p><?php echo projectTheme_number_of_bid($PID_PID); ?></p>\n\t\t\t\t\t\t\t</li>\n \n \t</ul>\n \n <div class=\"clear10\"></div>\n \n </div>\n <!-- ########### -->\n \n <div class=\"small_buttons_div\">\n \t<ul id=\"these-special-buttons\">\n \t<li><a href=\"<?php\n \t\n\t\t\t\t\t\t\t\t$post = get_post($PID_PID);\n\t\t\t\t\t\t\t\tif($current_user->ID == $post_AU->post_author)\n\t\t\t\t\t\t\t\techo '#';\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\techo ProjectTheme_get_priv_mess_page_url('send', '', '&uid='.$post_AU->post_author.'&pid='.$PID_PID);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t?>\" class=\"project-owner-contact\"><?php _e('Contact Project Owner','ProjectTheme') ?></a></li>\n <li><a href=\"#\" class=\"message_brd_cls project-owner-contact\"><?php _e('Project Message Board','ProjectTheme') ?></a></li>\n </ul>\n </div>\n \n </div>\n </div>\n \n \n <?php else: \n\t\t\t\t// project closed\n\t\t\t\t?>\n \n <div class=\"bid_panel\">\n <div class=\"padd10\">\n \n \t<?php\n\t\t\t\t\t\n\t\t\t\t\t$pid \t= $PID_PID;\n\t\t\t\t\t$winner = get_post_meta($PID_PID, 'winner', true);\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($winner))\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t$q = \"select bid from \".$wpdb->prefix.\"project_bids where pid='$pid' and winner='1'\";\n\t\t\t\t\t\t$r = $wpdb->get_results($q);\n\t\t\t\t\t\t$r = $r[0];\n\t\t\t\t\t\t\n\t\t\t\t\t\t_e(\"Project closed for price: \",'ProjectTheme');\n\t\t\t\t\t\techo ProjectTheme_get_show_price($r->bid);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t?>\n \n </div>\n </div>\n \n <?php endif; ?>\n \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t \n\t\t\t</div>\n\t\t\t\n\t\t\t\n\t\t\t<div class=\"clear10\"></div>\n\t\t\t\n\t\t\t<!-- ####################### -->\n\t\t\t\n\t\t\t<div class=\"my_box3\">\n \n \n \t<div class=\"box_title\"><?php echo __(\"Project Description\",'ProjectTheme'); ?></div>\n <div class=\"box_content\" id=\"project-single-page-content\">\n\t\t\t\t\t<?php echo $post_AU->post_content; \n\t\t\t\t\t\n\t\t\t\t\tdo_action('ProjectTheme_after_description_in_single_proj_page');\n\t\t\t\t\t\n\t\t\t\t\t ?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\n\t\t\t\n\t\t\t<div class=\"clear10\"></div>\n \n \n <!-- ####################### -->\n\t\t\t<?php \n\t\t\t\n\t\t\t$private_bids = get_post_meta($PID_PID, 'private_bids', true);\n\t\t\t\n\t\t\t?>\n\t\t\t<div class=\"my_box3\">\n \n \n \t<div class=\"box_title\"><?php echo __(\"Proposals\",'ProjectTheme'); ?> <?php\n\t\t\t\t\n\t\t\t\tif($private_bids == 'yes' or $private_bids == '1' or $private_bids == 1) _e('[project has private proposals]','ProjectTheme');\n\t\t\t\t\n\t\t\t\t ?></div>\n <div class=\"box_content\">\n\t\t\t\t<?php\n\t\t\t\t$ProjectTheme_enable_project_files = get_option('ProjectTheme_enable_project_files');\n\t\t\t\t$winner = get_post_meta($PID_PID, 'winner', true);\n\t\t\t\t$post = get_post($PID_PID);\n\t\t\t\tglobal $wpdb;\n\t\t\t\t$pid = $PID_PID;\n\t\t\t\t\n\t\t\t\t$bids = \"select * from \".$wpdb->prefix.\"project_bids where pid='$pid' order by id DESC\";\n\t\t\t\t$res = $wpdb->get_results($bids);\n\t\t\t\n\t\t\t\tif($post_AU->post_author == $uid) $owner = 1; else $owner = 0;\n\t\t\t\t\n\t\t\t\tif(count($res) > 0)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif($private_bids == 'yes' or $private_bids == '1' or $private_bids == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($owner == 1) $show_stuff = 1;\n\t\t\t\t\t\telse if(projectTheme_current_user_has_bid($uid, $res)) $show_stuff = 1;\n\t\t\t\t\t\telse $show_stuff = 0;\n\t\t\t\t\t}\n\t\t\t\t\telse $show_stuff = 1;\n\t\t\t\t\t\n\t\t\t\t\t//------------\n\t\t\t\t\t\n\t\t\t\t\tif($show_stuff == 1):\n\t\t\t\t\t\n\t\t\t\t\t\techo '<table id=\"my_bids\" width=\"100%\">';\n\t\t\t\t\t\techo '<thead><tr>';\n\t\t\t\t\t\t\techo '<th>'.__('Username','ProjectTheme').'</th>';\n\t\t\t\t\t\t\techo '<th>'.__('Bid','ProjectTheme').'</th>';\n\t\t\t\t\t\t\techo '<th>'.__('Date Made','ProjectTheme').'</th>';\n\t\t\t\t\t\t\techo '<th>'.__('Days to Complete','ProjectTheme').'</th>';\n\t\t\t\t\t\t\tif ($owner == 1): \n\t\t\t\t\t\t\t\tif(empty($winner))\n\t\t\t\t\t\t\t\t\techo '<th>'.__('Choose Winner','ProjectTheme').'</th>';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($ProjectTheme_enable_project_files != \"no\")\n\t\t\t\t\t\t\t\techo '<th>'.__('Bid Files','ProjectTheme').'</th>';\n\t\t\t\t\t\t\techo '<th>'.__('Messaging','ProjectTheme').'</th>';\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($closed == \"1\") echo '<th>'.__('Winner','ProjectTheme').'</th>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\techo '</tr></thead><tbody>';\n\t\t\t\t\t\n\t\t\t\t\tendif;\n\t\t\t\t\t\n\t\t\t\t\t//-------------\n\t\t\t\t\t\n\t\t\t\t\tforeach($res as $row)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($owner == 1) $show_this_around = 1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($private_bids == 'yes' or $private_bids == '1' or $private_bids == 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($uid == $row->uid) \t$show_this_around = 1;\n\t\t\t\t\t\t\t\telse $show_this_around = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$show_this_around = 1;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\tif($show_this_around == 1):\n\t\t\t\t\t\t\n\t\t\t\t\t\t$user = get_userdata($row->uid);\n\t\t\t\t\t\techo '<tr>';\n\t\t\t\t\t\techo '<th><a href=\"'.ProjectTheme_get_user_profile_link($user->ID).'\">'.$user->user_login.'</a></th>';\n\t\t\t\t\t\techo '<th>'.ProjectTheme_get_show_price($row->bid).'</th>';\n\t\t\t\t\t\techo '<th>'.date(\"d-M-Y H:i:s\", $row->date_made).'</th>';\n\t\t\t\t\t\techo '<th>'. $row->days_done .'</th>';\n\t\t\t\t\t\tif ($owner == 1 ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$nr = 7;\n\t\t\t\t\t\t\tif(empty($winner)) // == 0)\n\t\t\t\t\t\t\t\techo '<th><a href=\"'.get_bloginfo('url').'/?p_action=choose_winner&pid='.$PID_PID.'&bid='.$row->id.'\">'.__('Select','ProjectTheme').'</a></th>';\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($ProjectTheme_enable_project_files != \"no\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo '<th>';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(projecttheme_see_if_project_files_bid($PID_PID, $row->uid) == true)\n\t\t\t\t\t\t\t\techo '<a href=\"#\" class=\"get_files\" rel=\"'.$PID_PID.'_'.$row->uid.'\">'.__('Bid Files','ProjectTheme').'</a>';\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t_e('None','ProjectTheme');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\techo '</th>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\techo '<th><a href=\"'.ProjectTheme_get_priv_mess_page_url('send', '', '&uid='.$row->uid.'&pid='.$PID_PID).'\">'.__('Send Message','ProjectTheme').'</a></th>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse $nr = 4;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($closed == \"1\") { if($row->winner == 1) echo '<th>'.__('Yes','ProjectTheme').'</th>'; else echo '<th>&nbsp;</th>'; }\n\t\t\t\t\t\t\n\t\t\t\t\t\techo '</tr>';\n\t\t\t\t\t\t\n\t\t\t\t\t\techo '<tr>';\n\t\t\t\t\t\techo '<th colspan=\"'.$nr.'\" class=\"my_td_with_border\">'.$row->description.'</th>';\n\t\t\t\t\t\techo '</tr>';\n\t\t\t\t\t\tendif;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\techo '</tbody></table>';\n\t\t\t\t}\n\t\t\t\telse _e(\"No proposals placed yet.\",'ProjectTheme');\n\t\t\t\t?>\t\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t\n\t\t\t\n <?php\n\t\t\t\n\t\t\t\t$ProjectTheme_enable_images_in_projects = get_option('ProjectTheme_enable_images_in_projects');\n\t\t\t\t$ProjectTheme_enable_images_in_projects = apply_filters('ProjectTheme_enable_images_in_projects_hk', $ProjectTheme_enable_images_in_projects);\n\t\t\t \t\n\t\t\t\tif($ProjectTheme_enable_images_in_projects == \"yes\"):\n\t\t\t\n\t\t\t?>\n\t\t\t<div class=\"clear10\"></div>\n\t\t\t\n\t\t\t<!-- ####################### -->\n\t\t\t\n\t\t\t<div class=\"my_box3\">\n \n \n \t<div class=\"box_title\"><?php echo __(\"Image Gallery\",'ProjectTheme'); ?></div>\n <div class=\"box_content\">\n\t\t\t\t<?php\n\t\t\t\t\n\t\t\t\t$arr = ProjectTheme_get_post_images($PID_PID);\n\t\t\t\t$xx_w = 600;\n\t\t\t\t$projectTheme_width_of_project_images = get_option('projectTheme_width_of_project_images');\n\t\t\t\t\n\t\t\t\tif(!empty($projectTheme_width_of_project_images)) $xx_w = $projectTheme_width_of_project_images;\n\t\t\t\tif(!is_numeric($xx_w)) $xx_w = 600;\n\t\t\t\t\n\t\t\t\tif($arr)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\techo '<ul class=\"image-gallery\">';\n\t\t\t\tforeach($arr as $image)\n\t\t\t\t{\n\t\t\t\t\techo '<li><a href=\"'.ProjectTheme_generate_thumb($image, 900,$xx_w).'\" rel=\"image_gal2\"><img src=\"'.ProjectTheme_generate_thumb($image, 100,80).'\" width=\"100\" class=\"img_class\" /></a></li>';\n\t\t\t\t}\n\t\t\t\techo '</ul>';\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse { echo __('No images.','ProjectTheme') ;}\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</div>\n\t\t\t</div>\n\t\t\t<?php endif; ?>\n\t\t\t\n\t\t\t<div class=\"clear10\"></div>\n\t\t\t\n\t\t\t<!-- ####################### -->\n\t\t\t<?php\n\t\t\n\t\t\t$ProjectTheme_enable_project_location = get_option('ProjectTheme_enable_project_location');\n\t\t\tif($ProjectTheme_enable_project_location == \"yes\"):\n\t\t\n\t\t?>\n \n\t\t\t<div class=\"my_box3\">\n \n \n \t<div class=\"box_title\"><?php echo __(\"Map Location\",'ProjectTheme'); ?></div>\n <div class=\"box_content\">\n\t\n\t\t\t\t<div id=\"map\" style=\"width: 655px; height: 300px;border:2px solid #ccc;float:left\"></div>\n\t\t\t\t\n <script type=\"text/javascript\" src=\"http://maps.google.com/maps/api/js?sensor=false\"></script> \n \n <script type=\"text/javascript\"\n src=\"<?php echo get_bloginfo('template_url'); ?>/js/mk.js\"></script> \n <script type=\"text/javascript\"> \n \n\n\n\n\t var geocoder;\n var map;\n function initialize() {\n geocoder = new google.maps.Geocoder();\n var latlng = new google.maps.LatLng(-34.397, 150.644);\n var myOptions = {\n zoom: 13,\n center: latlng,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n }\n map = new google.maps.Map(document.getElementById(\"map\"), myOptions);\n }\n\n function codeAddress(address) {\n \n geocoder.geocode( { 'address': address}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n map.setCenter(results[0].geometry.location);\n var marker = new MarkerWithLabel({\n \n position: results[0].geometry.location,\n\t\t\tmap: map,\n labelContent: address,\n labelAnchor: new google.maps.Point(22, 0),\n labelClass: \"labels\", // the CSS class for the label\n labelStyle: {opacity: 1.0}\n\n });\n } else {\n //alert(\"Geocode was not successful for the following reason: \" + status);\n }\n });\n }\n\ninitialize();\n\ncodeAddress(\"<?php \n\n\tglobal $post;\n\t$pid = $post_AU->ID;\n\n\t$terms = wp_get_post_terms($pid,'project_location');\n\tforeach($terms as $term)\n\t{\n\t\techo $term->name.\" \";\n\t}\n\n\t$location = get_post_meta($pid, \"Location\", true);\t\n\techo $location;\n\t\n ?>\");\n\n </script> \n\t\t\t\t\n\t\t\t\n\t\t\t</div>\n\t\t\t</div> <?php endif; ?>\n\t\t\t\n\t\t\t<!-- ####################### -->\n\t\t\t\n \n\n\n\n</div>\n\n<?php\n\n\techo '<div id=\"right-sidebar\" class=\"page-sidebar\">';\n\techo '<ul class=\"xoxo\">';\n\t\n\t//---------------------\n\t// build the exclude list\n\t//---------------------\n\t// build the exclude list\n\t\t$exclude = array();\n\t\t\n\t$args = array(\n\t'order' => 'ASC',\n\t'post_type' => 'attachment',\n\t'post_mime_type' => 'image',\n\t'post_parent' => $pid,\n\t'numberposts' => -1,\n\t'post_status' => null,\n\t);\n\t\n\t$attachments = get_posts($args);\n \n\tforeach($attachments as $att) $exclude[] = $att->ID;\n\t\n\t//-0------------------\n\t\n\t\n\t\n\t$args = array(\n\t'order' => 'ASC',\n\t'post_type' => 'attachment',\n\t'meta_key' => 'is_bidding_file',\n\t'meta_value' => '1',\n\t'post_parent' => $pid,\n\t'numberposts' => -1,\n\t'post_status' => null,\n\t);\n\t\n\t$attachments = get_posts($args);\n \n\tforeach($attachments as $att) $exclude[] = $att->ID;\n\t\n\t//------------------\n\t\n\t$args = array(\n\t'order' => 'ASC',\n\t'post_type' => 'attachment',\n\t'post_parent' => $pid,\n\t'exclude' => $exclude, \n\t'numberposts' => -1,\n\t'post_status' => null,\n\t);\n\t$attachments = get_posts($args);\n\t\n\n\t \n\t?>\n <li class=\"widget-container widget_text\" id=\"ad-other-details\">\n\t\t<h3 class=\"widget-title\"><?php _e(\"Apply for this Project\",'ProjectTheme'); ?></h3>\n\t\t<p>\n <?php _e('You can use the button below to apply and submit a proposal for this project.','ProjectTheme') ?>\n </p>\n \n \n <p id='proposal_btn_p'>\n <?php\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tglobal $current_user;\n\t\t\t\t\t\t\t\tget_currentuserinfo();\n\t\t\t\t\t\t\t\t$uid = $current_user->ID;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($closed == \"0\" && ProjectTheme_is_user_provider($uid) == true):\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t?>\n \n\t\t\t\t\t\t\t\t<a href=\"#\" class=\"post_bid_btn_new\" id='submit-proposal-id' rel=\"<?php the_ID(); ?>\"><?php _e('Submit a Proposal','ProjectTheme'); ?></a>\n\t\t\t\t\t\t\t \n \t<?php endif; ?>\n \n </p> \n </li>\n \n \n \n \t<li class=\"widget-container widget_text\" id=\"ad-other-details\">\n\t\t<h3 class=\"widget-title\"><?php _e(\"Project Posted By\",'ProjectTheme'); ?></h3>\n\t\t\n <div class=\"avatar-op-wrap\">\n \t\n <div class=\"avatar-op-inner\"><img width=\"60\" height=\"60\" border=\"0\" class=\"project-single-avatar\" src=\"<?php echo ProjectTheme_get_avatar($post_AU->post_author, 60, 60); ?>\" /> </div>\n \t<div class=\"avatar-op-list\">\n \t\t<ul>\n \t<li><a class=\"avatar-posted-by-username\" href=\"<?php bloginfo('url'); ?>/?p_action=user_profile&post_author=<?php echo $post_AU->post_author; ?>\"><?php echo $post_AU->user_login; ?></a></li>\n \t<li><?php echo ProjectTheme_project_get_star_rating2($post_AU->post_author); ?></li>\n <li><a href=\"<?php echo ProjectTheme_get_user_feedback_link($post_AU->post_author); ?>\"><?php _e('View User Feedback','ProjectTheme'); ?></a></li>\n </ul>\n </div>\n \n </div>\n \n <p>\n <ul class=\"other-dets other-dets2\">\n\t\t\t\t \n <?php\n\t\t\t\t\t\n\t\t\t\t\t$has_created \t= projectTheme_get_total_number_of_created_Projects($post_AU->post_author);\n\t\t\t\t\t$has_closed \t= projectTheme_get_total_number_of_closed_Projects($post_AU->post_author);\n\t\t\t\t\t$has_rated \t\t= projectTheme_get_total_number_of_rated_Projects($post_AU->post_author);\n\t\t\t\t\n\t\t\t\t?>\n \n \n \n <li>\n\t\t\t\t\t<h3><?php _e(\"Has created:\",'ProjectTheme');?></h3>\n\t\t\t\t\t<p><?php echo sprintf(__(\"%s project(s)\",'ProjectTheme'), $has_created); ?></p> \n\t\t\t\t</li>\n \n \n <li>\n\t\t\t\t\t<h3><?php _e(\"Has closed:\",'ProjectTheme');?></h3>\n\t\t\t\t\t<p><?php echo sprintf(__(\"%s project(s)\",'ProjectTheme'), $has_closed); ?></p> \n\t\t\t\t</li>\n \n \n \t<li>\n\t\t\t\t\t<h3><?php _e(\"Has rated:\",'ProjectTheme');?></h3>\n\t\t\t\t\t<p><?php echo sprintf(__(\"%s provider(s)\",'ProjectTheme'), $has_rated); ?></p> \n\t\t\t\t</li>\n \n \n \t<br/><br/>\n <a href=\"<?php bloginfo('url'); ?>/?p_action=user_profile&post_author=<?php echo $post_AU->post_author; ?>\"><?php _e('See More Projects by this user','ProjectTheme'); ?></a><br/>\n \n \t\t\n\t\t\t</ul>\n \t\t</p>\n </li>\n \n <?php\n\t\t\t\t\t\t \n\t\t\t\t\t\t \t$ProjectTheme_enable_project_files = get_option('ProjectTheme_enable_project_files');\t\t\t\t\t\t \n\t\t\t\t\t\t \tif($ProjectTheme_enable_project_files != \"no\"):\n\t\t\t\t\t\t \n\t\t\t\t\t\t ?>\n \n \t<li class=\"widget-container widget_text\" id=\"ad-other-details\">\n\t\t<h3 class=\"widget-title\"><?php _e(\"Project Files\",'ProjectTheme'); ?></h3>\n\t\t<p>\n \n <ul class=\"other-dets other-dets2\">\n\t\t\t\t<?php\n\t\t\t\t\n\t\t\t\tif(count($attachments) == 0) echo __('No project files.','ProjectTheme');\n\t\t\t\t\n\t\t\t\tforeach($attachments as $at)\n\t\t\t\t{\n\t\t\t\t\t \n\t\t\t\n\t\t\t\t\t \n\t\t\t\t?>\n \n <li> <a href=\"<?php echo wp_get_attachment_url($at->ID); ?>\"><?php echo $at->post_title; ?></a>\n\t\t\t\t</li> \n\t\t\t<?php } ?>\t\t\n\t\t\t</ul>\n \t\t</p>\n </li>\n <?php endif; ?> \n \n \n\t<li class=\"widget-container widget_text\" id=\"ad-other-details\">\n\t\t<h3 class=\"widget-title\"><?php _e(\"Other Options\",'ProjectTheme'); ?></h3>\n\t\t<p>\n \n <div class=\"add-this\">\n\t\t\t\t\t\t<!-- AddThis Button BEGIN -->\n\t\t\t\t\t\t\t<div class=\"addthis_toolbox addthis_default_style addthis_32x32_style\">\n\t\t\t\t\t\t\t<a class=\"addthis_button_preferred_1\"></a>\n\t\t\t\t\t\t\t<a class=\"addthis_button_preferred_2\"></a>\n\t\t\t\t\t\t\t<a class=\"addthis_button_preferred_3\"></a>\n\t\t\t\t\t\t\t<a class=\"addthis_button_preferred_4\"></a>\n\t\t\t\t\t\t\t<a class=\"addthis_button_compact\"></a>\n\t\t\t\t\t\t\t<a class=\"addthis_counter addthis_bubble_style\"></a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<script type=\"text/javascript\" src=\"http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4df68b4a2795dcd9\"></script>\n\t\t\t\t\t\t\t<!-- AddThis Button END -->\n\t\t\t\t\t\t</div>\t\n \n \t\t</p>\n </li>\n \n \n\t<li class=\"widget-container widget_text\" id=\"ad-other-details\">\n\t\t<h3 class=\"widget-title\"><?php _e(\"Other Details\",'ProjectTheme'); ?></h3>\n\t\t<p>\n\t\t\t<ul class=\"other-dets other-dets2\">\n\t \n\t\t \n\t\t\t\t<?php\n\t\t\n\t\t\t$ProjectTheme_enable_project_location = get_option('ProjectTheme_enable_project_location');\n\t\t\tif($ProjectTheme_enable_project_location == \"yes\"):\n\t\t\n\t\t?>\n\t\t\t\t<li>\n\t\t\t\t\t<img src=\"<?php echo get_bloginfo('template_url'); ?>/images/location.png\" width=\"15\" height=\"15\" /> \n\t\t\t\t\t<h3><?php _e(\"Address\",'ProjectTheme');?>:</h3>\n\t\t\t\t\t<p><?php echo $location; ?></p> \n\t\t\t\t</li>\n\t\t\n \n <?php endif; ?>\n \n \t\t\n <?php\n\t\t\t\t\n\t\t\t\t$rt = get_option('projectTheme_show_project_views');\n\t\t\t\t\n\t\t\t\tif($rt != 'no'):\n\t\t\t\t?>\n\t\t\t\t\n\t\t\t\t<li>\n\t\t\t\t\t<img src=\"<?php echo get_bloginfo('template_url'); ?>/images/viewed.png\" width=\"15\" height=\"15\" /> \n\t\t\t\t\t<h3><?php _e(\"Viewed\",'ProjectTheme');?>:</h3>\n\t\t\t\t\t<p><?php echo $views; ?> <?php _e(\"times\",'ProjectTheme');?></p> \n\t\t\t\t</li>\n\t\t\t\t<?php endif; ?>\n\t\t\t\t\n \n <?php\n\t\t\t\t\n\t\t\t\t$my_arrms = true;\n\t\t\t\t$my_arrms = apply_filters('ProjectTheme_show_fields_in_sidebar', $my_arrms);\n\t\t\t\t\n\t\t\t\tif($my_arrms == true): \n\t\t\t\t\n\t\t\t\t$arrms = ProjectTheme_get_project_fields_values($PID_PID);\n\t\t\t\t\n\t\t\t\tif(count($arrms) > 0) \n\t\t\t\t\tfor($i=0;$i<count($arrms);$i++)\n\t\t\t\t\t{\n\t\t\t\t\n\t\t\t\t?>\n <li>\n\t\t\t\t\t<h3><?php echo $arrms[$i]['field_name'];?>:</h3>\n \t \t<p><?php echo $arrms[$i]['field_value'];?></p>\n </li>\n\t\t\t\t<?php } endif; ?>\n\t\t\t\t\n \n\t\t\t\t\n\t\t\t</ul>\n\t\t\t<?php\n\t\t\t\t\n\t\t\t\tif(ProjectTheme_is_owner_of_post())\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t?>\n\t\t\t\t\n\t\t\t<a href=\"<?php echo get_bloginfo('url'); ?>/?p_action=edit_project&pid=<?php the_ID(); ?>\" class=\"nice_link\"><?php _e(\"Edit\",'ProjectTheme'); ?></a> \n\t\t\t<a href=\"<?php echo get_bloginfo('url'); ?>/?p_action=repost_project&pid=<?php the_ID(); ?>\" class=\"nice_link\"><?php _e(\"Repost\",'ProjectTheme'); ?></a> \n\t\t<!--\t<a href=\"<?php echo get_bloginfo('url'); ?>/?p_action=delete_project&pid=<?php the_ID(); ?>\" class=\"nice_link\"><?php _e(\"Delete\",'ProjectTheme'); ?></a> -->\n\t\t\t\n\t\t\t<?php } else {?>\n\t\t\t\n\t\t\t<a href=\"#\" id=\"report-this-link\" class=\"nice_link\"><?php _e(\"Report\",'ProjectTheme'); ?></a>\n <a href=\"<?php\n $post = get_post($PID_PID);\n\t\t\t\n\t\t\t\n\t\t\techo ProjectTheme_get_priv_mess_page_url('send', '', '&uid='.$post_AU->post_author.'&pid='.$PID_PID);\n\t\t\t\n\t\t\t?>\" class=\"nice_link\"><?php _e(\"Contact Seller\",'ProjectTheme'); ?></a>\n\t\t\t\t\n <?php } ?>\n\t\t</p>\n\t</li>\n\t\n\t\n\t<?php\n\t\n\t\t\t\t\t\tdynamic_sidebar( 'project-widget-area' );\n\techo '</ul>';\n\techo '</div>';\n\n\n//===============================================================================================\n?>\n \n\n\n\n\n<?php\n}\n\n\nif($new_Project_step == \"4\")\n{\n\t$catid = ProjectTheme_get_project_primary_cat($pid);\n\t$ProjectTheme_get_images_cost_extra = ProjectTheme_get_images_cost_extra($pid);\n\t\n\n\t\n\t//--------------------------------------------------\n\t// hide project from search engines fee calculation\n\t\n\t$projectTheme_hide_project_fee = get_option('projectTheme_hide_project_fee');\n\tif(!empty($projectTheme_hide_project_fee))\n\t{\n\t\t$opt = get_post_meta($pid,'hide_project',true);\n\t\tif($opt == \"0\") $projectTheme_hide_project_fee = 0;\n\t\t\n\t\t\n\t} else $projectTheme_hide_project_fee = 0;\n\t\n\t\n\t//---------------------\n\t\n\t$made_me_date \t= get_post_meta($pid,'made_me_date',true);\n\t$tms \t\t\t= current_time('timestamp',0);\n\t$projectTheme_project_period = get_option('projectTheme_project_period');\n\tif(empty($projectTheme_project_period)) $projectTheme_project_period = 30;\n\t\n\t\n\tif(empty($made_me_date))\n\t{\n\t\t$ee = $tms + 3600*24*$projectTheme_project_period;\n\t\tupdate_post_meta($pid,'ending',$ee);\t\t\n\t}\n\telse\n\t{\n\t\t$ee = get_post_meta($pid, 'ending', true) + $tms - $made_me_date;\n\t\tupdate_post_meta($pid,'ending',$ee);\t\n\t}\n\t\n\n\t//-------------------------------------------------------------------------------\n\t// sealed bidding fee calculation\n\t\n\t$projectTheme_sealed_bidding_fee = get_option('projectTheme_sealed_bidding_fee');\n\tif(!empty($projectTheme_sealed_bidding_fee))\n\t{\n\t\t$opt = get_post_meta($pid,'private_bids',true);\n\t\tif($opt == \"0\") { $projectTheme_sealed_bidding_fee = 0; }\n\t\t\n\t\t \n\t} else $projectTheme_sealed_bidding_fee = 0;\n\n\t\n\t//-------\n\t\n\t$featured\t = get_post_meta($pid, 'featured', true);\n\t$feat_charge = get_option('projectTheme_featured_fee');\n\t\n\tif($featured != \"1\" ) $feat_charge = 0;\n\t\n\n\t\n\t\n\t$custom_set = get_option('projectTheme_enable_custom_posting');\n\tif($custom_set == 'yes')\n\t{\n\t\t$posting_fee = get_option('projectTheme_theme_custom_cat_'.$catid);\n\t\tif(empty($posting_fee)) $posting_fee = 0;\t\t\n\t}\n\telse\n\t{\n\t\t$posting_fee = get_option('projectTheme_base_fee');\n\t}\n\t\n\t$total = $feat_charge + $posting_fee + $projectTheme_sealed_bidding_fee + $projectTheme_hide_project_fee + $ProjectTheme_get_images_cost_extra;\n\t\n\t//-----------------------------------------------\n\t\n\t\t$payment_arr = array();\n\t\t\n\t\t$base_fee_paid \t= get_post_meta($pid, 'base_fee_paid', true);\n\t\t\n\t\tif($base_fee_paid != \"1\" and $posting_fee > 0)\n\t\t{\n\t\t\t$my_small_arr = array();\n\t\t\t$my_small_arr['fee_code'] \t\t= 'base_fee';\n\t\t\t$my_small_arr['show_me'] \t\t= true;\n\t\t\t$my_small_arr['amount'] \t\t= $posting_fee;\n\t\t\t$my_small_arr['description'] \t= __('Base Fee','ProjectTheme');\n\t\t\tarray_push($payment_arr, $my_small_arr);\n\t\t}\n\t\t//-----------------------\n\t\t\n\t\t\n\t\t$my_small_arr = array();\n\t\t$my_small_arr['fee_code'] \t\t= 'extra_img';\n\t\t$my_small_arr['show_me'] \t\t= true;\n\t\t$my_small_arr['amount'] \t\t= $ProjectTheme_get_images_cost_extra;\n\t\t$my_small_arr['description'] \t= __('Extra Images Fee','ProjectTheme');\n\t\tarray_push($payment_arr, $my_small_arr);\n\t\t//------------------------\n\t\t\n\t\t$featured_paid \t= get_post_meta($pid,'featured_paid',true);\n\t\t$opt \t\t\t\t= get_post_meta($pid,'featured',true);\n \n\t\t\n\t\tif($feat_charge > 0 and $featured_paid != 1 and $opt == 1)\n\t\t{\n\t\t\t$my_small_arr = array();\n\t\t\t$my_small_arr['fee_code'] \t\t= 'feat_fee';\n\t\t\t$my_small_arr['show_me'] \t\t= true;\n\t\t\t$my_small_arr['amount'] \t\t= $feat_charge;\n\t\t\t$my_small_arr['description'] \t= __('Featured Fee','ProjectTheme');\n\t\t\tarray_push($payment_arr, $my_small_arr);\n\t\t\t//------------------------\n\t\t}\n\t\t\n\t\t$private_bids_paid = get_post_meta($pid,'private_bids_paid',true);\n\t\t$opt \t\t\t\t= get_post_meta($pid,'private_bids',true);\n \n\t\t\n\t\tif($projectTheme_sealed_bidding_fee > 0 and $private_bids_paid != 1 and ($opt == 1 or $opt == \"yes\"))\n\t\t{\n\t\t\n\t\t\t$my_small_arr = array();\n\t\t\t$my_small_arr['fee_code'] \t\t= 'sealed_project';\n\t\t\t$my_small_arr['show_me'] \t\t= true;\n\t\t\t$my_small_arr['amount'] \t\t= $projectTheme_sealed_bidding_fee;\n\t\t\t$my_small_arr['description'] \t= __('Sealed Bidding Fee','ProjectTheme');\n\t\t\tarray_push($payment_arr, $my_small_arr);\n\t\t//------------------------\n\t\t}\n\t\t\n\t\t$hide_project_paid \t= get_post_meta($pid,'hide_project_paid',true);\n\t\t$opt \t\t\t\t= get_post_meta($pid,'hide_project',true);\n\t\t\n\t\tif($projectTheme_hide_project_fee > 0 and $hide_project_paid != \"1\" and ($opt == \"1\" or $opt == \"yes\"))\n\t\t{\n\t\t\n\t\t\t$my_small_arr = array();\n\t\t\t$my_small_arr['fee_code'] \t\t= 'hide_project';\n\t\t\t$my_small_arr['show_me'] \t\t= true;\n\t\t\t$my_small_arr['amount'] \t\t= $projectTheme_hide_project_fee;\n\t\t\t$my_small_arr['description'] \t= __('Hide Project From Search Engines Fee','ProjectTheme');\n\t\t\tarray_push($payment_arr, $my_small_arr);\n\t\t\n\t\t}\n\t\t\n\t\t$payment_arr \t= apply_filters('ProjectTheme_filter_payment_array', $payment_arr, $pid);\n\t\t$new_total \t\t= 0;\n\t\t\n\t\tforeach($payment_arr as $payment_item):\t\t\t\n\t\t\tif($payment_item['amount'] > 0):\t\t\t\t\n\t\t\t\t$new_total += $payment_item['amount'];\t\t\t\n\t\t\tendif;\t\t\t\n\t\tendforeach;\n\t\t\n\t//-----------------------------------------------\n\t\n\t$post \t\t\t= get_post($pid);\n\t$admin_email \t= get_bloginfo('admin_email');\n\n\t\n\t$total = apply_filters('ProjectTheme_filter_payment_total', $new_total, $pid);\n\t\n\t//----------------------------------------\n\t$finalize = isset($_GET['finalize']) ? true : false;\n\tupdate_post_meta($pid, 'finalised_posted', '1');\n \n\t//-----------\n\t\n\tif($total == 0)\n\t{\n\t\t\techo '<div >';\n\t\t\techo __('Thank you for posting your project with us.','ProjectTheme');\n\t\t\tupdate_post_meta($pid, \"paid\", \"1\");\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\tif(get_option('projectTheme_admin_approves_each_project') == 'yes')\n\t\t\t\t{\n\t\t\t\t\t$my_post = array();\n\t\t\t\t\t$my_post['ID'] = $pid;\n\t\t\t\t\t$my_post['post_status'] = 'draft';\n\t\n\t\t\t\t\twp_update_post( $my_post );\n\t\n\t\t\t\t\tif($finalize == true){\n\t\t\t\t\t\tProjectTheme_send_email_posted_project_not_approved($pid);\n\t\t\t\t\t\tProjectTheme_send_email_posted_project_not_approved_admin($pid);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\techo '<br/>'.__('Your project isn`t live yet, the admin needs to approve it.', 'ProjectTheme');\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$my_post = array();\n\t\t\t\t\t$my_post['ID'] = $pid;\n\t\t\t\t\t$my_post['post_status'] = 'publish';\n\t\t\t\t\t\n\t\t\t\t\tif($finalize == true){\n\t\t\t\t\t\n\t\t\t\t\t\twp_update_post( $my_post );\n\t\t\t\t\t\twp_publish_post( $pid );\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tProjectTheme_send_email_posted_project_approved($pid);\n\t\t\t\t\t\tProjectTheme_send_email_posted_project_approved_admin($pid);\n\t\t\t\t\t\t\n\t\t\t\t\t\tProjectTheme_send_email_subscription($pid);\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t \n\t\t\techo '</div>';\n\t\t\t\n\t\n\t}\n\telse\n\t{\n\t\t\tupdate_post_meta($pid, \"paid\", \"0\");\n\t\t\t\n\t\t\techo '<div >';\n\t\t\techo __('Thank you for posting your project with us. Below is the total price that you need to pay in order to put your project live.<br/>\n\t\t\tClick the pay button and you will be redirected...', 'ProjectTheme');\n\t\t\techo '</div>';\n\t\t\t\n\t \n\t}\n\t\n\t//----------------------------------------\n\t\n\techo '<table style=\"margin-top:25px\">';\n\t\n\t$show_payment_table = true;\n\t$show_payment_table = apply_filters('ProjectTheme_filter_payment_show_table', $show_payment_table, $pid);\n\t\n\tif($show_payment_table == true and $total > 0)\n\t{\n\t\t\n\n\t\tforeach($payment_arr as $payment_item):\n\t\t\t\n\t\t\tif($payment_item['amount'] > 0):\n\t\t\t\n\t\t\t\techo '<tr>';\n\t\t\t\techo '<td>'.$payment_item['description'].'&nbsp; &nbsp;</td>';\n\t\t\t\techo '<td>'.ProjectTheme_get_show_price($payment_item['amount'],2).'</td>';\n\t\t\t\techo '</tr>';\n\n\t\t\tendif;\n\t\t\t\n\t\tendforeach;\n\t\n\t\t\n\t\t\n\t\t\n\t\techo '<tr>';\n\t\techo '<td>&nbsp;</td>';\n\t\techo '<td></td>';\n\t\techo '</tr>';\n\t\t\n\t\t\n\t\techo '<tr>';\n\t\techo '<td><strong>'.__('Total to Pay','ProjectTheme').'</strong></td>';\n\t\techo '<td><strong>'.ProjectTheme_get_show_price($total,2).'</strong></td>';\n\t\techo '</tr>';\n\t\t\n\t\t$ProjectTheme_enable_credits_wallet = get_option('ProjectTheme_enable_credits_wallet');\n\t\tif($ProjectTheme_enable_credits_wallet != 'no'):\n\t\t\n\t\t\techo '<tr>';\n\t\t\techo '<td><strong>'.__('Your Total Credits','ProjectTheme').'</strong></td>';\n\t\t\techo '<td><strong>'.ProjectTheme_get_show_price(ProjectTheme_get_credits($uid),2).'</strong></td>';\n\t\t\techo '</tr>';\n\t\t\n\t\tendif;\n\t\t\n\t\techo '<tr>';\n\t\techo '<td>&nbsp;<br/>&nbsp;</td>';\n\t\techo '<td></td>';\n\t\techo '</tr>';\n\t\n\t}//endif show this table\n\t\n\tif($total == 0 && $finalize == true)\n\t{\n\t\tif(get_option('projectTheme_admin_approves_each_project') != 'yes'):\n\t\t\n\t\t\techo '<tr>';\n\t\t\techo '<td></td>';\n\t\t\techo '<td><div class=\"clear100\"></div><a href=\"'.get_permalink($pid).'\" class=\"go_back_btn\">'.__('See your project','ProjectTheme') .'</a></td>';\n\t\t\techo '</tr>';\t\n\t\t\n\t\telse:\n\t\t\t\n\t\t\techo '<tr>';\n\t\t\techo '<td></td>';\n\t\t\techo '<td><a href=\"'.get_permalink(get_option('ProjectTheme_my_account_page_id')).'\" class=\"go_back_btn\">'.__('Go to your account','ProjectTheme') .'</a></td>';\n\t\t\techo '</tr>';\t\n\t\t\t\t\n\t\tendif;\n\t\t\n\t\techo '</table>';\n\t}\n\telseif($total > 0)\n\t{\n\t\t\techo '</table>';\n\t\tupdate_post_meta($pid,'unpaid','1');\n\t\t\n\t\t\n\t\t\n\t\t\t\t\t\t$ProjectTheme_enable_credits_wallet = get_option('ProjectTheme_enable_credits_wallet');\n\t\t\t\t\t\tif($ProjectTheme_enable_credits_wallet != 'no'):\n\t\t\t\t\t\t\techo '<a href=\"'.get_bloginfo('url').'/?p_action=credits_listing&pid='.$pid.'\" class=\"edit_project_pay_cls\">'.__('Pay by Credits','ProjectTheme').'</a>';\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\n\t\t\t\t\t\tglobal $project_ID;\n\t\t\t\t\t\t$project_ID = $pid;\n\t\t\t\t\t\t\n\t\t\t\t\t\t//-------------------\n\t\t\t\t\t\n\t\t\t\t\t\t$ProjectTheme_paypal_enable \t\t= get_option('ProjectTheme_paypal_enable');\n\t\t\t\t\t\t$ProjectTheme_alertpay_enable \t\t= get_option('ProjectTheme_alertpay_enable');\n\t\t\t\t\t\t$ProjectTheme_moneybookers_enable \t= get_option('ProjectTheme_moneybookers_enable');\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($ProjectTheme_paypal_enable == \"yes\")\n\t\t\t\t\t\t\techo '<a href=\"'.get_bloginfo('url').'/?p_action=paypal_listing&pid='.$pid.'\" class=\"edit_project_pay_cls\">'.__('Pay by PayPal','ProjectTheme').'</a>';\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($ProjectTheme_moneybookers_enable == \"yes\")\n\t\t\t\t\t\t\techo '<a href=\"'.get_bloginfo('url').'/?p_action=mb_listing&pid='.$pid.'\" class=\"edit_project_pay_cls\">'.__('Pay by MoneyBookers/Skrill','ProjectTheme').'</a>';\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($ProjectTheme_alertpay_enable == \"yes\")\n\t\t\t\t\t\t\techo '<a href=\"'.get_bloginfo('url').'/?p_action=payza_listing&pid='.$pid.'\" class=\"edit_project_pay_cls\">'.__('Pay by Payza','ProjectTheme').'</a>';\n\t\t\t\t\t\t\n\t\t\t\t\t\tdo_action('ProjectTheme_add_payment_options_to_post_new_project', $pid);\n\t\t\t\t\t\t\n\t\n\t\n\t} else { echo '</table>'; }\n\t\n\t\n\techo '<div class=\"clear10\"></div>';\n\techo '<div class=\"clear10\"></div>';\n\techo '<div class=\"clear10\"></div>';\n\t\n\techo '<div class=\"padd10\">';\n\tif($finalize == false)\n\techo ' <a href=\"'. ProjectTheme_post_new_with_pid_stuff_thg($pid, '3') .'\" class=\"go_back_btn\" >'.__('Go Back','ProjectTheme').'</a>';\n\t\n\tif($total == 0 && $finalize == false)\n\techo ' <a href=\"'. ProjectTheme_post_new_with_pid_stuff_thg($pid, '4', 'finalize').'\" \n\tclass=\"go_back_btn\" >'.__('Finalize Project Posting','ProjectTheme').'</a>';\n\t\n\techo '</div>';\n\n}\n\n\n ?>\n \n <?php endif; ?>\n \n \n </div>\n </div>\n \n </div> <!-- end dif content -->\n \n \n \n\t\n<?php\t\n}", "public function create()\n {\n return view('military::military_areas.create');\n }", "public function create()\n\t{\n\t\treturn view ('areas.create');\n\t}", "public function addSection()\n {\n $categories = $this->problem_model->get_category();\n $data['cat'] =$categories;\n\n $this->load->view('addSection', $data);\n }", "public function add_question()\n {\n if ($this->input->post()) $this->save_question();\n $this->template->content = new View(\"add_question\");\n }", "public function newIssue()\n\t{\tsession_start();\n\t\t$crumbs['breadcrumb'] = array('Home' => $_SESSION[\"home_url\"] ,\n\t\t\t\t'New Issue' => '#');\n\t\t\n\t\t$this->staffData($crumbs);\n\t\t$this->load->model('Employee');\n\t\t$staff=new Employee();\n\t\t$all_locations = $staff->getLocations();\n\t\t$data[\"locations\"] = $all_locations;\n\t\t$this->load->view(\"newissue\", $data);\n\t}", "public function run()\n {\n Area::create([\n 'descricao' => 'Gestão e Negócios',\n ]);\n\n Area::create([\n 'descricao' => 'Informação e Comunicação',\n ]);\n }", "public function crear(){\n\t\t\t$usuario=Login::getUsuario();\n\t\t\tif(!$usuario->admin) throw new Exception('Operació vàlida només per Administradors');\n\t\t\tif(!empty($_POST['nueva'])){\n\t\t\t\t$area = new AreaModel();\n\t\t\t\t$area->nom = $_POST['nom'] ;\n\t\t\t\t// guardar el area en BBDD con el modelo\t\n\t\t\t\tif(!$area->guardar())\n\t\t\t\t\tthrow new Exception('No es va poder guardar l\\'àrea');\n\t\t\t\telse{\n\t\t\t\t\t//mostrar la vista de la lista exito\n\t\t\t\t\t$datos = array();\n\t\t\t\t\t$datos['usuario'] = Login::getUsuario();\n\t\t\t\t\t$datos['mensaje'] = '<h5>Àrea Creada:'.$area.'</h5>';\n\t\t\t\t\t$this->load_view('view/exito.php', $datos);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//mostrar la vista de Nuevo Area\t\t\t\t\n\t\t\t\t$datos = array();\n\t\t\t\t$datos['usuario'] = Login::getUsuario();\n\t\t\t\t$this->load_view('view/areas/nueva_area.php', $datos);\t\t\t\t\n\t\t\t}\t\t\t\t\t\t\n\t\t}", "public function create()\n {\n return view('admin.working-areas.create');\n }", "public function run()\n {\n $area = [\n [\n 'id' => 1,\n 'nombre' => 'SISTEMAS DE INFORMACION',\n ],\n [\n 'id' => 2,\n 'nombre' => 'FARMACIA Y Qx',\n ],\n [\n 'id' => 3,\n 'nombre' => 'INFRAESTRUCTURA ',\n ],\n [\n 'id' => 4,\n 'nombre' => 'GESTION AMBIENTAL',\n ],\n ];\n\n areaTable::insert($area);\n }", "public function insert($area_empresa);", "function area_show_all_areas() {\n\tglobal $user;\n\t\n\tdrupal_add_library('system', 'ui.dialog');\n\t$observation_path = drupal_get_path('module', 'area');\n\tdrupal_add_css($observation_path . '/css/area.css');\n\t\n\t$output['message'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '\n\t\t\t<div id=\"message\" style=\"display: none; height: auto;\">\n\t\t\t\t<div class=\"messages status\"></div>\n\t\t\t</div>'\n\t);\n\n\t$output['map'] = array(\n\t\t\t'#mapid' => 'areamap',\n\t\t\t'#search' => true,\n\t\t\t'#ch1903' => true,\n\t\t\t'#geometries_fetch_url' => base_path() . 'areas/json',\n\t\t\t'#geometries_autoload' => false,\n\t\t\t'#infowindow_content_fetch_url_area' => base_path()\n\t\t\t\t\t. 'area/{ID}/areaoverview/ajaxform',\n\t\t\t'#theme' => 'area'\n\t);\n\n\t$output['space'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '<p/>'\n\t);\n\t\n\tif(user_access(AREA_CREATE)) {\n\t\tglobal $base_url;\n\t\t$iconBaseUrl = '/' . path_to_theme() . '/images/icons/enabled/';\n\t\t\n\t\t$output['create'] = array(\n\t\t\t\t'#type' => 'markup',\n\t\t\t\t'#markup' => '<a href=\"'.$base_url.'/area/new\"> <img src=\"' . $iconBaseUrl . 'Add.png\" alt=\"' . t('Create a new area') . '\" title=\"' . t('Create a new area') . '\" />'.t('Create a new area').'</a>',\n\t\t);\n\t}\n\t\n\t$output['area_table'] = array(\n\t\t'#theme' => 'datatable',\n\t\t'#header' => area_get_standard_datatable_headers(12,\n\t\t'DESC'),\n\t\t'#title' => t('Areas'),\n\t\t'#id_table' => DATATABLE_AREA,\n\t\t'#options' => array(\n\t\t\t\t\t'jsonUrl' => base_path() . \"areas/get/all\",\n\t\t\t\t\t'rowClick' => 'rowClick',\n\t\t\t\t\t'rowClickHandler' \t\t=> \"function rowClick(celDiv, id) {\n\t\t\t\t\t\tjQuery(celDiv).click(\n\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\tareamap.selectGeometry(id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t)\n\t\t\t\t\t}\",\n\t\t\t'rpShowAll' => true,\n\t\t\t'preProcessHandler' => 'area.tablePreProcess',\n \t\t\t'onSuccessHandler' => ( ($user->uid == 0) ? '' : 'area.onTableSuccess' ),\t/* only show the delete and export buttons if user is logged in */\n\t\t\t'gallery_enabled' => true,\n\t\t\t'gallery_image_sources' => false,\n\t\t\t// Filters to add to the filterDiv above the table. The gallery image source\n\t\t\t// filter has a weight of 10, the table/gallery buttons 4 and 5 respectively.\n\t\t\t'custom_filter' => array(\n\t\t\t\t'acl_filter' => array(\n\t\t\t\t\t'#type' => 'select',\n\t\t\t\t\t'#name' => 'acl_filter',\n\t\t\t\t\t'#title' => t('Areas') . ':',\n\t\t\t\t\t'#options' => array(\n\t\t\t\t\t\t'all' => t('Public'),\n\t\t\t\t\t\t'own' => t('Own'),\n\t\t\t\t\t\t'writeable' => t('Editables')),\n\t\t\t\t\t'#attributes' => array(\n\t\t\t\t\t\t'class' => array('acl_filter')),\n\t\t\t\t\t'#weight' => 8\n\t\t\t\t),\n\t\t\t),\n\t\t 'date' => array(\n\t\t \t'dbDateField' => \"date\",\n\t\t \t'dbDateFieldType' => DBDateFieldType::TIMESTAMP)\t\t\t\t\t\n\t\t)\n\t\t\n\t);\t\n\t\n\treturn $output;\n}", "public function add() {\n validation_permission_role($this->module_sigla, 'permission_add');\n\n $data['title'] = 'Universidad Manuela Beltran, Aplicativo de Cuentas - Cortes.';\n $data['content'] = 'cut/add';\n $this->load->view('template/template', $data);\n }", "public function addProblem($pset, $problem) {\n if(gettype($pset) !== \"integer\" || gettype($problem) !== \"integer\") {\n echo \"pset or problem not integer\";\n exit();\n }\n $db = $this->db;\n $query_string =\n \"insert into problems (pset_id, problem_number)\n values ($pset, $problem);\";\n $result = $db->query($query_string);\n if ($result === False) exit();\n }", "public function addIssue()\n\t {\n\n\t \tif(@$_POST['add_issue'])\n\t\t{\n\t\t\t$data = $_POST['post'];\n\t\t\t$data['date_posted'] = date('Y-m-d H:i:s');\n\t\t\t$this->postissue->add($data);\n\t\t\t$this->session->set_flashdata('message',\"Issue submitted successfully\");\n\t\t\t$this->header();\n\t\t\t$this->load->view(\"issueForm\");\n\t\t\t$this->footer();\n\t\t}\n\n\t\telse{\n\t\t\t$this->header();\n\t\t\t$this->load->view(\"issueForm\");\n\t\t\t$this->footer();\n\t\t}\n\t }" ]
[ "0.7002866", "0.64015865", "0.5840637", "0.5674121", "0.5617918", "0.5608338", "0.55819297", "0.55674136", "0.5544098", "0.5518612", "0.5493212", "0.547856", "0.5454715", "0.5435601", "0.54325503", "0.5396376", "0.535977", "0.53432363", "0.5319417", "0.5280457", "0.5276326", "0.5267546", "0.5262324", "0.52529943", "0.52445894", "0.5230831", "0.52093726", "0.5193626", "0.5183743", "0.51758164" ]
0.74780405
0
Add new problem to problem area
public function addproblemAction() { // check if user is logged in if (!$this->hasIdentity()) { $this->_helper->FlashMessenger->addMessage('Pre pridávanie nového problému musíte byť najskôr prihlásený.'); $this->_redirect('/auth/login?redirect=/problemarea/addproblem'); return; } $this->checkAllowed('PROBLEM', 'DEFINE'); // ID for the new problem $ProblemAreaId = Colla_App::getInstance()->getProblemArea(); $form = new Form_Problem(); if ($this->getRequest()->isPost()) { if ($form->isValid($_POST)) { $data = array(); $data = $form->getValues(); $data['CreatedBy'] = Zend_Registry::get('User')->Id; $data['ProblemAreaId'] = $ProblemAreaId; $problem = new Problem(); $problem->createNew($data); $this->_helper->FlashMessenger->addMessage('Problém bol vytvorený'); $this->_redirect('/problem/list/filter/acceptance'); return; } } $this->view->form = $form; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addAction()\r\n {\r\n \t$this->checkAllowed('PROBLEMAREA', 'ADD');\r\n \t\r\n \t// check if user is logged in\r\n \tif (!$this->hasIdentity()) {\r\n \t\t$this->_helper->FlashMessenger->addMessage('You need to be logged in to perform actions.');\r\n \t\t$this->_redirect('/auth/login');\r\n \t\treturn;\r\n \t}\r\n \t\r\n \t// new form\r\n \t$form = new Form_ProblemArea();\r\n \tif ($this->getRequest()->isPost()) {\r\n \t\tif ($form->isValid($_POST)) {\r\n \t\t\t$ProblemArea = new ProblemArea();\r\n \t\t\t$data = $form->getValues();\r\n \t\t\t$data['CreatedBy'] = $this->view->user->Id;\r\n \t\t\t$ProblemArea->saveNew($data);\r\n \t\t\t$this->_helper->FlashMessenger->addMessage($this->translate('Problem area has been created.'));\r\n \t\t\t$this->_redirect('/problemarea/view');\r\n \t\t}\r\n \t}\r\n \t$this->view->form = $form;\r\n }", "public function addProblem()\n {\n $cat = $this->problem_model->get_category();\n \n foreach ($cat as $value) {\n $it = 0;\n $sec_c = $this->problem_model->get_a_section($value['category_id']);\n $sections[$value['category_id']] = $sec_c;\n }\n $data['cat'] = $cat;\n $data['sections'] = $sections;\n \n\n $this->load->view('addProblem',$data);\n }", "public function addProblem($pset, $problem) {\n if(gettype($pset) !== \"integer\" || gettype($problem) !== \"integer\") {\n echo \"pset or problem not integer\";\n exit();\n }\n $db = $this->db;\n $query_string =\n \"insert into problems (pset_id, problem_number)\n values ($pset, $problem);\";\n $result = $db->query($query_string);\n if ($result === False) exit();\n }", "function add()\n\t{\n\t\tJRequest::setVar('id',0); // Force new entry\n\t\t$this->edit(); // Delegate task to the edit() method\n\t}", "public function add_question()\n {\n if ($this->input->post()) $this->save_question();\n $this->template->content = new View(\"add_question\");\n }", "public function addSubmission($sunetid, $automata, $pset, $problem) {\n echo $pset;\n echo $problem;\n $db = $this->db;\n $sunetid = $db->real_escape_string($sunetid);\n $automata = $db->real_escape_string($automata);\n # get the problem id which matches the pset and problem combination\n $query_string_prob_id = \n \"select id\n from problems\n where pset_id=$pset and problem_number = $problem;\";\n $result = $db->query($query_string_prob_id);\n if ($result === False) exit();\n $problem_id = $this->fetchAll($result)[0][\"id\"];\n $query_string = \n \"insert into submissions (user_id, problem_id, automata)\n values (\\\"$sunetid\\\", $problem_id, \\\"$automata\\\")\n on duplicate key update automata=\\\"$automata\\\";\";\n $result = $db->query($query_string);\n if ($result === False) {\n echo \"exiting\";\n exit();\n }\n }", "function add()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n else\n {\n $this->load->model('question_model');\n $data['que_and'] = $this->question_model->getQuestions();\n \n $this->global['pageTitle'] = 'Add New Question';\n\n $this->loadViews(\"admin/manage_questions/add\", $this->global, $data, NULL);\n }\n }", "public function run()\n {\n //problems with level A for stages\n $problem = new problem();\n $problem->title = 'title1';\n $problem->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem->level = 'A';\n $problem->stage = 1;\n $problem->score = 10;\n $problem->save();\n\n $problem33 = new problem();\n $problem33->title = 'title33';\n $problem33->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem33->level = 'A';\n $problem33->stage = 1;\n $problem33->score = 10;\n $problem33->save();\n\n $problem->save();\n $problem1 = new Problem();\n $problem1->title = 'title2';\n $problem1->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem1->level = 'A';\n $problem1->stage = 2;\n $problem1->score = 10;\n $problem1->save();\n\n $problem2 = new Problem();\n $problem2->title = 'title3';\n $problem2->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem2->level = 'A';\n $problem2->stage = 3;\n $problem2->score = 10;\n $problem2->save();\n\n $problem3 = new Problem();\n $problem3->title = 'title4';\n $problem3->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem3->level = 'A';\n $problem3->stage = 4;\n $problem3->score = 10;\n $problem3->save();\n\n\n //problems with level B for stages\n $problem4 = new Problem();\n $problem4->title = 'title5';\n $problem4->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem4->level = 'B';\n $problem4->stage = 1;\n $problem4->score = 10;\n $problem4->save();\n\n $problem5 = new Problem();\n $problem5->title = 'title6';\n $problem5->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem5->level = 'B';\n $problem5->stage = 2;\n $problem5->score = 10;\n $problem5->save();\n\n $problem19 = new Problem();\n $problem19->title = 'title7';\n $problem19->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem19->level = 'B';\n $problem19->stage = 3;\n $problem19->score = 10;\n $problem19->save();\n\n $problem6 = new Problem();\n $problem6->title = 'title8';\n $problem6->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem6->level = 'B';\n $problem6->stage = 4;\n $problem6->score = 10;\n $problem6->save();\n\n\n //problems with level C for stages\n $problem7 = new Problem();\n $problem7->title = 'title9';\n $problem7->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem7->level = 'C';\n $problem7->stage = 1;\n $problem7->score = 10;\n $problem7->save();\n\n $problem8 = new Problem();\n $problem8->title = 'title10';\n $problem8->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem8->level = 'C';\n $problem8->stage = 2;\n $problem8->score = 10;\n $problem8->save();\n\n $problem9 = new Problem();\n $problem9->title = 'title11';\n $problem9->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem9->level = 'C';\n $problem9->stage = 3;\n $problem9->score = 10;\n $problem9->save();\n\n $problem10 = new Problem();\n $problem10->title = 'title12';\n $problem10->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem10->level = 'C';\n $problem10->stage = 4;\n $problem10->score = 10;\n $problem10->save();\n\n\n //problems with level D for stages\n $problem11 = new Problem();\n $problem11->title = 'title13';\n $problem11->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem11->level = 'D';\n $problem11->stage = 1;\n $problem11->score = 10;\n $problem11->save();\n\n $problem12 = new Problem();\n $problem12->title = 'title14';\n $problem12->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem12->level = 'D';\n $problem12->stage = 2;\n $problem12->score = 10;\n $problem12->save();\n\n $problem13 = new Problem();\n $problem13->title = 'title15';\n $problem13->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem13->level = 'D';\n $problem13->stage = 3;\n $problem13->score = 10;\n $problem13->save();\n\n $problem14 = new Problem();\n $problem14->title = 'title16';\n $problem14->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem14->level = 'D';\n $problem14->stage = 4;\n $problem14->score = 10;\n $problem14->save();\n\n\n //problems with level E for stages\n $problem15 = new Problem();\n $problem15->title = 'title17';\n $problem15->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem15->level = 'E';\n $problem15->stage = 1;\n $problem15->score = 10;\n $problem15->save();\n\n $problem16 = new Problem();\n $problem16->title = 'title18';\n $problem16->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem16->level = 'E';\n $problem16->stage = 2;\n $problem16->score = 10;\n $problem16->save();\n\n $problem17 = new Problem();\n $problem17->title = 'title19';\n $problem17->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem17->level = 'E';\n $problem17->stage = 3;\n $problem17->score = 10;\n $problem17->save();\n\n $problem18 = new Problem();\n $problem18->title = 'title20';\n $problem18->description = 'asdlkfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffj';\n $problem18->level = 'E';\n $problem18->stage = 4;\n $problem18->score = 10;\n $problem18->save();\n }", "public function addIssue()\n\t {\n\n\t \tif(@$_POST['add_issue'])\n\t\t{\n\t\t\t$data = $_POST['post'];\n\t\t\t$data['date_posted'] = date('Y-m-d H:i:s');\n\t\t\t$this->postissue->add($data);\n\t\t\t$this->session->set_flashdata('message',\"Issue submitted successfully\");\n\t\t\t$this->header();\n\t\t\t$this->load->view(\"issueForm\");\n\t\t\t$this->footer();\n\t\t}\n\n\t\telse{\n\t\t\t$this->header();\n\t\t\t$this->load->view(\"issueForm\");\n\t\t\t$this->footer();\n\t\t}\n\t }", "public function addTask()\n\t{\n\t\t$this->editTask();\n\t}", "function addQuestion($qid) {\n $this->loadAllNodes();\n\n //Check the same question has not been already inserted in the Adaquiz\n if ($this->checkNodePresent($qid)){\n return false;\n }\n\n //Create Node\n $n = Node::createDefaultNode();\n\n $n->adaquiz = $this->get_adaquizid();\n $n->position = count($this->nodes);\n $n->question = $qid;\n $n->grade = $n->getQuestion()->defaultmark;\n $n->save();\n $this->nodes[$n->position] = $n;\n\n //Assign a default Jump to this node\n $j = Jump::createDefaultJump($n->id);\n $j->save();\n\n $n->jump = $j;\n\n //change the previous node jump if it was the end jump.\n if(count($this->nodes)>1){\n $previous = $this->nodes[$n->position -1];\n $pjump = $previous->getJump();\n if($pjump->isFinalJump()){\n $pjump->deleteSingleJump(0);\n $pjump->addDefaultCase(Jump::TYPE_UNCONDITIONAL, $n->id);\n $pjump->save();\n }\n }\n\n }", "public function addExercise(\\HSE\\Labor\\Domain\\Model\\Exercise $exercise) {\n\t\t$exercise->setLab($this);\n\t\t$this->exercises->add($exercise);\n\t}", "private function addCourseTask() {\n if(is_null($this->link)) {\n return;\n }\n $task = new stdClass();\n $task->link = $this->link;\n $headline = array();\n foreach ($this->name as $translation) {\n $headlineInstance = new stdClass();\n $headlineInstance->name = $translation->value;\n $headlineInstance->language = $translation->language;\n array_push($headline, $headlineInstance);\n }\n $task->headline = $headline;\n array_push($this->tasks, new MumieProblem($task));\n }", "public function add ( Exercise $exercise )\n\t{\n\t\t$this->elements [ $exercise->name ] = $exercise;\n\t}", "public function newIssue()\n\t{\tsession_start();\n\t\t$crumbs['breadcrumb'] = array('Home' => $_SESSION[\"home_url\"] ,\n\t\t\t\t'New Issue' => '#');\n\t\t\n\t\t$this->staffData($crumbs);\n\t\t$this->load->model('Employee');\n\t\t$staff=new Employee();\n\t\t$all_locations = $staff->getLocations();\n\t\t$data[\"locations\"] = $all_locations;\n\t\t$this->load->view(\"newissue\", $data);\n\t}", "function assign_solution_to_ticket(int $solution_id, int $ticket_id)\n{\n $conn = meta_open_db();\n if ($stmt = $conn->prepare(\"INSERT INTO `ProblemSolutions` (`SolutionID`, `ProblemID`) VALUES (?, ?)\"))\n {\n $stmt->bind_param(\"ii\", $solution_id, $ticket_id);\n $stmt->execute();\n $stmt->close();\n }\n $conn->close();\n}", "function addNewTask($taskId, $agentId, $dependsOn, $kind, $implementorId,$alg)\n\t{\t\n\t\t//sanitizing the parameters we got\n\t\t$name = mysql_real_escape_string($agentId);\n\t\t$depends = mysql_real_escape_string($dependsOn);\n\t\t$kind = mysql_real_escape_string($kind);\n\t\t$password = mysql_real_escape_string($implementorId);\n\t\t$date = date(\"Y-m-d H:i:s\");\n\t\t\n\t\t//isert the answer into the database \n\t\t$str=\"INSERT INTO tasks VALUES (\".$taskId.\",\".$dependsOn.\", '$alg','\".$kind.\"', '\".$agentId.\"', '\".$implementorId.\"',NOW(),0)\";\n\t\t$ans=mysql_query($str);\n\t\t\n\t\treturn $taskId;\n\t}", "function taskNewI() {\r\n\t\t\t$this->obj_tasks->addNewItem();\r\n\t\t}", "public function add(){}", "function addIssue($name, $description, $status)\n\t\t{\n // escape the characters that are needed to be escaped to avoid sql injection\n $name = mysql_escape_string($name);\n $description = mysql_escape_string($description);\n \n\t\t\t// validate the name\n\t\t\t$nameError = $this -> validateName(null, $name);\n\t\t\t\n\t\t\t// validate the description\n\t\t\t$descriptionError = $this -> validateDescription($description);\n\t\t\t\n\t\t\t// check if the validation has passed\n\t\t\tif($nameError == null && $descriptionError == null)\n\t\t\t{\n\t\t\t\t// add the new category to the database\n\t\t\t\tmysql_query(\"INSERT INTO argus_issues(name, description, date_created, status) VALUES ('\".$name.\"', '\".$description.\"', '\".time().\"', '\".$status.\"')\") or die(mysql_error());\n\t\t\t\t\n\t\t\t\t// return a successful add\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// set the error\n\t\t\t\t$this -> errors = array(\"name\" => $nameError, \"description\" => $descriptionError);\n\t\t\t\t\n\t\t\t\t// return an unsuccessful add\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\treturn;\n\t\t}", "public function add(){\n\t\t$this->model('WorkoutModel');\n\t\t$selects = $this->model->getWorkouts();\n\t\t$this->view('workout'.'/'.'add.php',$selects);\n\t\t$this->view->render();\n\t}", "public function add() {\n\t\t$this->_add ();\n\t}", "public function addIssue(Issue $issue): void\n {\n $this->issues[] = $issue;\n }", "public function add(): void {\n\t\tif ( checkAuth( $this ) ) {\n\t\t\t$this->load->view( 'layout/header' );\n\t\t\t$this->load->view( 'question/add' );\n\t\t\t$this->load->view( 'layout/footer' );\n\t\t} else {\n\t\t\tredirect( base_url( 'auth/login' ) );\n\t\t}\n\t}", "public function create()\n\t{\n\t\t$circuits = Costumercircuit::lists('namasite', 'id');\n\t\t$pilih = ['Tidak Dipilih' => 'Silahkan Pilih'];\n\t\t$category = array_merge($pilih, Problemopt::lists('category', 'category'));\n\t\t$masalah = array_merge($pilih, Problemopt::lists('problem', 'problem'));\n\t\t$sub = array_merge($pilih, Problemopt::lists('sub', 'sub'));\n\n\t\treturn View::make('problems.create', ['circuits' => $circuits, 'category' => $category, 'masalah' => $masalah, 'sub' => $sub]);\n\t}", "public function add();", "public function insertNewQuestion($question) {\n\t\t$questionArray = get_object_vars($question);\n\n\t\t$this->queryBuilder->insert('questions', $questionArray);\n\t}", "public function create()\n\t{\n $bugTypes = BugType::getBugTypeList();\n $bugStatuses = BugStatus::getBugStatusList();\n $assignTo = User::getProgrammerDesigner()->getList();\n\n $this->layout->title=\"Add Bug\";\n \t$this->layout->content = View::make('bugs.create',compact('bugTypes','bugStatuses','assignTo','getAllBugs'));\n\t}", "function insert_into_project(&$project) {\n // Create a WRMS request for this step..\n $wrms = new qams_request();\n $wrms->chtype = \"create\";\n $_POST[\"submit\"] = \"create\";\n $_POST['send_no_email'] = \"on\"; // Stop WRMS spam\n\n // Some settings always in common with master project..\n $wrms->org_code = $project->org_code;\n $wrms->system_id = $project->system_id;\n $wrms->requester_id = $project->requester_id;\n $wrms->last_status = $project->last_status;\n $wrms->urgency = $project->urgency;\n $wrms->importance = $project->importance;\n $wrms->entered_by = $project->entered_by;\n $wrms->status_code = \"I\"; // In Progress\n\n // Give it our brief, plus the step decription..\n $wrms->brief = \"$project->brief: $this->qa_step_desc\";\n\n // Assemble the detailed blurb..\n $s = \"\";\n\n // Condign notes pertaining to this QA step. Hopefully the\n // QA gurus will have populated the database with some very\n // useful guidance here (hint, hint!) ;-)\n if ($this->qa_step_notes != \"\") {\n $s .= \"$this->qa_step_notes\";\n }\n\n // Para covering the document requirement..\n if ($this->qa_document_title != \"\") {\n $s .= \"\\n\\nThis QA step is concerned with a document entitled '$this->qa_document_title'. \"\n . \"Please attach any and all versions of that document to this work request \"\n . \"so that it is available for approval/review.\"\n ;\n if ($this->qa_document_desc != \"\") {\n $s .= \" $this->qa_document_desc\";\n }\n }\n\n // Boilerplate gumph..\n $s .= \"\\n\\nThis work request has been automatically created by QAMS, to \"\n . \"facilitate the '$this->qa_step_desc' quality assurance step, in the \"\n . \"'$this->qa_phase_desc' phase of the project.\"\n ;\n\n $wrms->detailed = $s;\n\n // Save our newly built QA step request..\n $wrms->save_request();\n\n if ($wrms->request_id > 0) {\n $this->request_id = $wrms->request_id;\n $wrms->chtype = \"update\";\n $_POST[\"submit\"] = \"update\";\n\n // Now link it to our main project WRMS..\n $_POST[\"link_type\"] = \"P\"; // Precedes\n $_POST[\"parent_request_id\"] = $project->request_id;\n $wrms->AddParent();\n\n // Make sure allocations are the same..\n if (count($project->allocated) > 0) {\n $_POST[\"new_allocations\"] = array_keys($project->allocated);\n $wrms->NewAllocations();\n }\n\n // Make sure interested users are the same..\n if (count($project->interested) > 0) {\n $_POST[\"new_subscription\"] = array_keys($project->interested);\n $wrms->NewSubscriptions();\n }\n\n // Finally, create the project step record itself..\n $q = \"INSERT INTO qa_project_step (\";\n $q .= \" project_id, qa_step_id, request_id \";\n $q .= \") \";\n $q .= \"VALUES(?, ?, ?);\";\n $qry = new PgQuery(\n $q,\n $project->request_id,\n $this->qa_step_id,\n $this->request_id\n );\n $qry->Exec(\"qa_project_step::insert_into_project\");\n\n\n // And its default project step approval records too..\n foreach ($this->approvals_default() as $qa_type_id => $qa_type_desc) {\n $q = \"INSERT INTO qa_project_step_approval (\";\n $q .= \" project_id, qa_step_id, qa_approval_type_id \";\n $q .= \") \";\n $q .= \"VALUES(?, ?, ?);\";\n $qry = new PgQuery(\n $q,\n $project->request_id,\n $this->qa_step_id,\n $qa_type_id\n );\n $qry->Exec(\"qa_project_step::insert_into_project\");\n } // foreach\n\n // The data is now valid..\n $this->valid = true;\n }\n // Clear out for next step..\n $_POST = array();\n\n }", "public function add()\n {\n if ($this->access->hasWriteAccess()) {\n $this->ctrl->saveParameter($this, self::IDENTIFIER);\n $xlcdLocationFormGUI = new xlcdLocationFormGUI($this, new xlcdLocation());\n $this->tpl->setContent($xlcdLocationFormGUI->getHTML());\n }\n }" ]
[ "0.6858959", "0.6635863", "0.6381484", "0.5775513", "0.57626796", "0.5733499", "0.56977856", "0.5674572", "0.56110054", "0.55514807", "0.55267185", "0.5519503", "0.5473541", "0.5458322", "0.54464304", "0.5429616", "0.5426436", "0.5420655", "0.5407386", "0.5383608", "0.5368836", "0.5366204", "0.53116316", "0.53078145", "0.52891606", "0.5238948", "0.52347326", "0.52274567", "0.5222453", "0.52128553" ]
0.7623129
0
Let you to choose the default problem Area
public function selectAction() { $ProblemArea = new ProblemArea(); $this->view->areas = $ProblemArea->getProblemAreas(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function area() {\r\n }", "public function getArea(){\r\n\t\t\r\n\t}", "public function testMinArea()\n {\n $obj = new MinArea([[1,1],[1,3],[3,1],[3,3],[4,1],[4,3]]);\n $obj->run();\n $obj->print();\n }", "function area_show_specific_area($areadata = NULL, $inventory_id = NULL) {\n\tassert(!empty($areadata));\n\tdrupal_add_css(drupal_get_path('module', 'area') . '/css/area.css');\n\tdrupal_add_js('misc/form.js');\n\tdrupal_add_js('misc/collapse.js');\n\tdrupal_set_title(t('area').' '.$areadata['name']);\n\t\n\tglobal $base_url;\n\t\n\t//load js for observation table/map\n\t$observation_path = drupal_get_path('module', 'observation');\n\tdrupal_add_js($observation_path . '/js/observation.js');\n\tdrupal_add_library('system', 'ui.dialog');\n\n\t$output['message'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '\n\t\t\t<div id=\"message\" style=\"display: none; height: auto;\">\n\t\t\t\t<div class=\"messages status\"></div>\n\t\t\t</div>'\n\t);\n\t\n\t/* Create a fieldset for the tabular data */\n\t$output['area'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Area details'),\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'id' => 'area-show-details' // required for CSS\n\t\t\t),\n\t\t\t'#weight' => 1\n\t);\n\t\n\t/* Build the content of the table, leave out empty fields */\n\t$output['area']['table'] = area_get_infotable_of_specific_area($areadata);\n\n\t/* Create a fieldset for the static google maps */\n\t$output['area_map'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Map'),\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'id' => 'area-show-map', // required for CSS\n\t\t\t\t\t'name' => 'map' //used for anchor\n\t\t\t)\n\t);\n\t\n\t$iconBaseUrl = '/' . path_to_theme() . '/images/icons/enabled/';\n\t$output['area_map']['zoom'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '<img style=\"cursor:pointer;\" src=\"' . $iconBaseUrl . 'Zoom in.png\" alt=\"' . t('zoomin') . '\" title=\"' . t('zoomin') . '\" onclick=\"javascript:observationmap.zoomIn(event, ' .$areadata['id'] . ');\" /> '.t('zoomin') \n\t);\n\t\n\t//if user has RED_WRITE Permission and area is not a child, user can add a subarea\n\tif(area_check_access($areadata, 'ACL_RED_WRITE') && empty($areadata['parent_id'])) {\n\t\t$output['area_map']['create_sub_area'] = array(\n\t\t\t\t'#type' => 'markup',\n\t\t\t\t'#prefix' => '</br>',\n\t\t\t\t'#markup' => '<img style=\"cursor:pointer;\" onclick=\"window.location.href=\\''.$base_url . '/area/new/'.$areadata['id'].'\\'\" src=\"'.$iconBaseUrl.'Site map.png\" style=\"cursor:pointer;\" alt=\"' .t('Create a subarea') . '\" title=\"' . t('Create a subarea') . '\"/> '. t('Create a subarea')\n\t\t);\n\t}\n\t\n\t$output['area_map']['map'] = array(\n\t\t\t'#theme' => 'area',\n\t\t\t'#mapid' => 'observationmap',\n\t\t\t'#ch1903' => true,\n\t\t\t'#showall' => false,\n\t\t\t'#scalecontrol' => true,\n\t\t\t'#action' => 'show',\n\t\t\t'#reticle' => false,\n\t\t\t'#geometry_edit_id' => (int) $areadata['id'],\n\t\t\t'#defaultzoom' => '15',\n\t\t\t'#infowindow_content_fetch_url_area' => base_path()\n\t\t\t. 'area/{ID}/areaoverview/ajaxform',\n\t\t\t'#infowindow_content_fetch_url_observation' => base_path()\n\t\t\t. 'observation/{ID}/overview/ajaxform',\n\t\t\t'#geometries_fetch_url' => base_path() . 'area/' . $areadata['id'] . '/json',\n\t);\n\t\n\t/* Create a fieldset for the comment text field */\n\t$output['area_description'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Description'),\n\t\t\t'#collapsible' => true,\n\t\t\t'#collapsed' => false,\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'id' => 'area-show-comment',\n\t\t\t\t\t'class' => array(\n\t\t\t\t\t\t\t'collapsible'\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t'#weight' => 2\n\t);\n\t\n\t/* add the comments for the area as an editable textarea */\n\t$output['area_description']['comment'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#markup' => \"<div class='area-description'>\"\n\t\t\t. (empty($areadata['comment']) ? t(\"None available\")\n\t\t\t\t\t: check_plain($areadata['comment'])) . \"</div>\"\n\t);\n\t\n\t/* Create a fieldset for the linked habitats */\n\t$output['area_inventories'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('inventories').' & '.t('observations'),\n\t\t\t'#collapsible' => true,\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'class' => array(\n\t\t\t\t\t\t\t'collapsible'\n\t\t\t\t\t),\n\t\t\t\t\t'id' => 'area-show-comment' // required for CSS\n\t\t\t),\n\t\t\t'#weight' => 3\n\t);\n\tif(area_check_access($areadata, 'ACL_RED_WRITE') && user_access(CREATE_INVENTORY)) {\n\t\tglobal $base_url;\n\t\t$iconBaseUrl = '/' . path_to_theme() . '/images/icons/enabled/';\n\t\t\n\t\t$output['area_inventories']['add_inventory'] = array(\n\t\t\t\t'#type' => 'markup',\n\t\t\t\t'#markup' => '<a href=\"'.$base_url.'/inventory/area/'.$areadata['id'].'/new\"> <img src=\"' . $iconBaseUrl . 'Add.png\" alt=\"' . t('Add Inventory') . '\" title=\"' . t('Add Inventory') . '\" />'.t('Add Inventory').'</a>',\n\t\t);\n\t}\n\t\n\t$output['area_inventories']['inventories'] = inventory_show_area_inventories($areadata);\n\t$output['area_inventories']['space'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '<br><br>'\n\t);\n\t\n\t$output['area_inventories']['observations'] = inventory_show_observations($areadata['id'], $inventory_id);\n\t\n\t/* Create a fieldset for the strategies text fields */\n\t$output['area_concept'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Area concept'),\n\t\t\t'#collapsible' => true,\n\t\t\t'#collapsed' => false,\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'class' => array(\n\t\t\t\t\t\t\t'collapsible',\n\t\t\t\t\t\t\t'collapsed'\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t'#weight' => 4\n\t);\n\n\t/* add the protectiont target textarea */\n\t$output['area_concept']['protection_target'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#title' => t('Protection target'),\n\t\t\t'#markup' => \"<pre>\"\n\t\t\t\t\t. (empty($areadata['protection_target'])\n\t\t\t\t\t\t\t? t(\"None available\")\n\t\t\t\t\t\t\t: check_plain($areadata['protection_target']))\n\t\t\t\t\t. \"</pre>\"\n\t);\n\n\t/* add the tending strategies target textarea */\n\t$output['area_concept']['tending_strategies'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#title' => t('Tending strategies'),\n\t\t\t'#markup' => \"<pre>\"\n\t\t\t\t\t. (empty($areadata['tending_strategies'])\n\t\t\t\t\t\t\t? t(\"None available\")\n\t\t\t\t\t\t\t: check_plain($areadata['tending_strategies']))\n\t\t\t\t\t. \"</pre>\"\n\t);\n\n\t/* add the tending strategies target textarea */\n\t$output['area_concept']['safety_precautions'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#title' => t('Safety precautions'),\n\t\t\t'#markup' => \"<pre>\"\n\t\t\t\t\t. (empty($areadata['safety_precautions'])\n\t\t\t\t\t\t\t? t(\"None available\")\n\t\t\t\t\t\t\t: check_plain($areadata['safety_precautions'])) . \"</pre>\"\n\t);\n\n\t/* Create a fieldset for the linked habitats */\n\t$output['area_habitats'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Linked habitats'),\n\t\t\t'#collapsible' => true,\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'class' => array(\n\t\t\t\t\t\t\t'collapsible',\n\t\t\t\t\t\t\t'collapsed'\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t'#weight' => 5\n\t);\n\n\tif (function_exists('gallery_list_renderer')) {\n\t\t$output['area_videos'] = gallery_list_renderer(\n\t\t\t'videos',\n\t\t\t'area',\n\t\t\t$areadata['id']);\n\t\t$output['area_images'] = gallery_list_renderer(\n\t\t\t'images',\n\t\t\t'area',\n\t\t\t$areadata['id']);\n\t}\n\n\t/* add the linked habitats */\n\t$results = db_query(\n\t\t'SELECT\n\t\t\tlabel,\n\t\t\tname\n\t\tFROM\n\t\t\t{area_habitat} ah\n\t\t\tJOIN {habitat} h ON ah.habitat_id = h.id\n\t\tWHERE\n\t\t\tah.area_id = ?;',\n\t\tarray($areadata['id']));\n\n\t$habitats = array();\n\tforeach ($results->fetchAll() as $habitat) {\n\t\t$habitats[] = (array) $habitat;\n\t}\n\tif(!empty($habitats)) {\n\t\t$output['area_habitats']['habitats'] = array(\n\t\t\t\t'#theme' => 'datatable',\n\t\t\t\t'#header' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'name' => t('Label'),\n\t\t\t\t\t\t\t\t'width' => 300\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'name' => t('Name'),\n\t\t\t\t\t\t\t\t'width' => 300\n\t\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'#tableWidth' => 900,\n\t\t\t\t'#rows' => $habitats,\n\t\t\t\t'#id_table' => DATATABLE_HABITATS\n\t\t);\n\t} else {\n\t\t$output['area_habitats']['habitats'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#markup' => \"<pre>\".t(\"None available\").\"</pre>\",\n\t\t\t);\n\t}\n\n\t$output['area_files'] = area_files($areadata);\n\t$output['area_files']['#weight'] = 6;\n\n\treturn $output;\n}", "public function getArea()\n {\n return $this->area;\n }", "public function setArea($area='')\n {\n $this->area = (string)str_replace(array('%20',' '),array('_','_'), trim($area));\n }", "public function getArea()\n {\n return $this->area;\n }", "public function getArea()\n {\n return $this->area;\n }", "public function changeAction()\r\n {\r\n \t$this->checkAllowed('PROBLEMAREA', 'CHANGE');\r\n \t\r\n\t // param Id is required\r\n\t\t$problemAreaId = Colla_App::getInstance()->getProblemArea();\t\r\n\t\t$form = new Form_ProblemAreaChange($problemAreaId);\r\n\t\t$problemAreaTable = new ProblemArea();\r\n\t\tif ($this->getRequest()->isPost()) {\r\n\t\t\tif ($form->isValid($_POST)) {\r\n\t\t\t\t$problemAreaTable->changeDefinition($problemAreaId, $form->getValues());\r\n\t\t\t\t$this->_helper->FlashMessenger->addMessage('Problem Area has been changed.');\r\n \t\t\t$this->_redirect('/problemarea/view');\r\n\t\t\t}\t\t\t\r\n\t\t} else {\r\n\t\t\t// fill values\r\n\t\t\t$problemArea = $problemAreaTable->getProblemArea($problemAreaId);\r\n\t\t\t$form->getElement('Name')->setValue($problemArea->Name);\r\n\t\t\t$form->getElement('Definition')->setValue($problemArea->Definition);\r\n\t\t}\r\n\t\t\r\n\t\t$this->view->form = $form;\r\n }", "public function getArea()\n\t{\n\t\treturn $this->_area;\n\t}", "public function getAreaConstrucao() {\n return $this->iAreaContrucao;\n }", "abstract protected function setDefault();", "abstract protected function options_layout();", "function _default() {\n\t\tif (count($this->URI)<3 || empty($this->URI[2])) {\n\t\t\t$this->show_map();\n\t\t} else {\n\t\t\t$this->show_cluster($this->URI[2]);\n\t\t}\n\t}", "public function testGetAdministrativeArea()\n {\n $this->assertEquals(\n self::$testAdministrativeArea,\n $this->researchGroup->getAdministrativeArea()\n );\n }", "function placeTrou($case){\n\tglobal $plateau, $chemin;\n\tlist($x,$y)=$chemin[$case-1];\n\t$plateau[$x][$y] = TROU;\n}", "public function setArea(Area $area)\n\t{\n\t\t$this->_area = $area;\n\t}", "public function obtenerAreas();", "function fitts_widget_areas() {\r\n\r\n\r\n\r\n}", "public function asignarNivelDeficiencia()\n\t{\n\t\tif($this->evaluacion_riesgo_nivel_deficiencia==1)\n\t\t{\n\t\t\t$this->evaluacion_riesgo_nivel_deficiencia=2;\n\t\t}\n\t\telseif($this->evaluacion_riesgo_nivel_deficiencia==2)\n\t\t{\n\t\t\t$this->evaluacion_riesgo_nivel_deficiencia=6;\n\t\t}\n\t\tif($this->evaluacion_riesgo_nivel_deficiencia==3)\n\t\t{\n\t\t\t$this->evaluacion_riesgo_nivel_deficiencia=10;\n\t\t}\n\t}", "function tccc_context_create_fixed_area($empty, $data = NULL, $conf = FALSE) {\n // which contains a group of string.\n $context = new ctools_context('string');\n $context->plugin = 'tccc_fixed_area';\n\n if ($empty) {\n return $context;\n }\n\n $context->data = 'fixed';\n return $context;\n}", "public function getCodigoArea( ){\n\t\treturn $this->codigoArea;\n\t}", "public function area()\n {\n return $this->belongsTo(Area::class, 'c_area')->withDefault();\n }", "public function area():float {\n return pi()*$this->radio*$this->radio;\n }", "function check_size($area) {\n global $min_i;\n global $max_i;\n return ($area <= $max_i && $area >= ($min_i * 2));\n}", "public function __default()\n \t{\n \t if( self::isArg( 'notifwindow') )\n \t {\n $this->view = \"common_notifwindow\";\n \t $this->viewArgs['table'] = self::getArg( \"table\", AT_posint, true );\n \t }\n \t else\n \t {\n $this->view = \"ladyandthetiger_ladyandthetiger\";\n self::trace( \"Complete reinitialization of board game\" );\n }\n \t}", "public function addAction()\r\n {\r\n \t$this->checkAllowed('PROBLEMAREA', 'ADD');\r\n \t\r\n \t// check if user is logged in\r\n \tif (!$this->hasIdentity()) {\r\n \t\t$this->_helper->FlashMessenger->addMessage('You need to be logged in to perform actions.');\r\n \t\t$this->_redirect('/auth/login');\r\n \t\treturn;\r\n \t}\r\n \t\r\n \t// new form\r\n \t$form = new Form_ProblemArea();\r\n \tif ($this->getRequest()->isPost()) {\r\n \t\tif ($form->isValid($_POST)) {\r\n \t\t\t$ProblemArea = new ProblemArea();\r\n \t\t\t$data = $form->getValues();\r\n \t\t\t$data['CreatedBy'] = $this->view->user->Id;\r\n \t\t\t$ProblemArea->saveNew($data);\r\n \t\t\t$this->_helper->FlashMessenger->addMessage($this->translate('Problem area has been created.'));\r\n \t\t\t$this->_redirect('/problemarea/view');\r\n \t\t}\r\n \t}\r\n \t$this->view->form = $form;\r\n }", "public function getArea():float ;", "public function getDefaultTypeNotMain()\n {\n return 2;\n }", "public function setAreaConstrucao($iAreaContrucao){\n $this->iAreaContrucao = $iAreaContrucao;\n }" ]
[ "0.5778802", "0.5556691", "0.53436524", "0.52964115", "0.52269894", "0.5142328", "0.51048434", "0.51048434", "0.509368", "0.5043546", "0.5032867", "0.49910536", "0.49439874", "0.49203116", "0.48578656", "0.48571464", "0.4806962", "0.47744513", "0.47623488", "0.472542", "0.47062138", "0.4702984", "0.46580833", "0.46101356", "0.4604142", "0.45943967", "0.4593681", "0.4593396", "0.45778304", "0.45706728" ]
0.59672326
0
Change the definition of the problem Area
public function changeAction() { $this->checkAllowed('PROBLEMAREA', 'CHANGE'); // param Id is required $problemAreaId = Colla_App::getInstance()->getProblemArea(); $form = new Form_ProblemAreaChange($problemAreaId); $problemAreaTable = new ProblemArea(); if ($this->getRequest()->isPost()) { if ($form->isValid($_POST)) { $problemAreaTable->changeDefinition($problemAreaId, $form->getValues()); $this->_helper->FlashMessenger->addMessage('Problem Area has been changed.'); $this->_redirect('/problemarea/view'); } } else { // fill values $problemArea = $problemAreaTable->getProblemArea($problemAreaId); $form->getElement('Name')->setValue($problemArea->Name); $form->getElement('Definition')->setValue($problemArea->Definition); } $this->view->form = $form; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function area() {\r\n }", "public function setArea($area='')\n {\n $this->area = (string)str_replace(array('%20',' '),array('_','_'), trim($area));\n }", "public function getArea(){\r\n\t\t\r\n\t}", "public function setArea(Area $area)\n\t{\n\t\t$this->_area = $area;\n\t}", "public function calculateArea()\n {\n //Implement calculateArea() method.\n }", "public function calculateArea()\n {\n //Implement calculateArea() method.\n }", "public function calculateArea(){\n }", "public function calculateArea();", "public function getArea():float ;", "public function getArea()\n {\n return $this->area;\n }", "function area_show_specific_area($areadata = NULL, $inventory_id = NULL) {\n\tassert(!empty($areadata));\n\tdrupal_add_css(drupal_get_path('module', 'area') . '/css/area.css');\n\tdrupal_add_js('misc/form.js');\n\tdrupal_add_js('misc/collapse.js');\n\tdrupal_set_title(t('area').' '.$areadata['name']);\n\t\n\tglobal $base_url;\n\t\n\t//load js for observation table/map\n\t$observation_path = drupal_get_path('module', 'observation');\n\tdrupal_add_js($observation_path . '/js/observation.js');\n\tdrupal_add_library('system', 'ui.dialog');\n\n\t$output['message'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '\n\t\t\t<div id=\"message\" style=\"display: none; height: auto;\">\n\t\t\t\t<div class=\"messages status\"></div>\n\t\t\t</div>'\n\t);\n\t\n\t/* Create a fieldset for the tabular data */\n\t$output['area'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Area details'),\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'id' => 'area-show-details' // required for CSS\n\t\t\t),\n\t\t\t'#weight' => 1\n\t);\n\t\n\t/* Build the content of the table, leave out empty fields */\n\t$output['area']['table'] = area_get_infotable_of_specific_area($areadata);\n\n\t/* Create a fieldset for the static google maps */\n\t$output['area_map'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Map'),\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'id' => 'area-show-map', // required for CSS\n\t\t\t\t\t'name' => 'map' //used for anchor\n\t\t\t)\n\t);\n\t\n\t$iconBaseUrl = '/' . path_to_theme() . '/images/icons/enabled/';\n\t$output['area_map']['zoom'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '<img style=\"cursor:pointer;\" src=\"' . $iconBaseUrl . 'Zoom in.png\" alt=\"' . t('zoomin') . '\" title=\"' . t('zoomin') . '\" onclick=\"javascript:observationmap.zoomIn(event, ' .$areadata['id'] . ');\" /> '.t('zoomin') \n\t);\n\t\n\t//if user has RED_WRITE Permission and area is not a child, user can add a subarea\n\tif(area_check_access($areadata, 'ACL_RED_WRITE') && empty($areadata['parent_id'])) {\n\t\t$output['area_map']['create_sub_area'] = array(\n\t\t\t\t'#type' => 'markup',\n\t\t\t\t'#prefix' => '</br>',\n\t\t\t\t'#markup' => '<img style=\"cursor:pointer;\" onclick=\"window.location.href=\\''.$base_url . '/area/new/'.$areadata['id'].'\\'\" src=\"'.$iconBaseUrl.'Site map.png\" style=\"cursor:pointer;\" alt=\"' .t('Create a subarea') . '\" title=\"' . t('Create a subarea') . '\"/> '. t('Create a subarea')\n\t\t);\n\t}\n\t\n\t$output['area_map']['map'] = array(\n\t\t\t'#theme' => 'area',\n\t\t\t'#mapid' => 'observationmap',\n\t\t\t'#ch1903' => true,\n\t\t\t'#showall' => false,\n\t\t\t'#scalecontrol' => true,\n\t\t\t'#action' => 'show',\n\t\t\t'#reticle' => false,\n\t\t\t'#geometry_edit_id' => (int) $areadata['id'],\n\t\t\t'#defaultzoom' => '15',\n\t\t\t'#infowindow_content_fetch_url_area' => base_path()\n\t\t\t. 'area/{ID}/areaoverview/ajaxform',\n\t\t\t'#infowindow_content_fetch_url_observation' => base_path()\n\t\t\t. 'observation/{ID}/overview/ajaxform',\n\t\t\t'#geometries_fetch_url' => base_path() . 'area/' . $areadata['id'] . '/json',\n\t);\n\t\n\t/* Create a fieldset for the comment text field */\n\t$output['area_description'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Description'),\n\t\t\t'#collapsible' => true,\n\t\t\t'#collapsed' => false,\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'id' => 'area-show-comment',\n\t\t\t\t\t'class' => array(\n\t\t\t\t\t\t\t'collapsible'\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t'#weight' => 2\n\t);\n\t\n\t/* add the comments for the area as an editable textarea */\n\t$output['area_description']['comment'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#markup' => \"<div class='area-description'>\"\n\t\t\t. (empty($areadata['comment']) ? t(\"None available\")\n\t\t\t\t\t: check_plain($areadata['comment'])) . \"</div>\"\n\t);\n\t\n\t/* Create a fieldset for the linked habitats */\n\t$output['area_inventories'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('inventories').' & '.t('observations'),\n\t\t\t'#collapsible' => true,\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'class' => array(\n\t\t\t\t\t\t\t'collapsible'\n\t\t\t\t\t),\n\t\t\t\t\t'id' => 'area-show-comment' // required for CSS\n\t\t\t),\n\t\t\t'#weight' => 3\n\t);\n\tif(area_check_access($areadata, 'ACL_RED_WRITE') && user_access(CREATE_INVENTORY)) {\n\t\tglobal $base_url;\n\t\t$iconBaseUrl = '/' . path_to_theme() . '/images/icons/enabled/';\n\t\t\n\t\t$output['area_inventories']['add_inventory'] = array(\n\t\t\t\t'#type' => 'markup',\n\t\t\t\t'#markup' => '<a href=\"'.$base_url.'/inventory/area/'.$areadata['id'].'/new\"> <img src=\"' . $iconBaseUrl . 'Add.png\" alt=\"' . t('Add Inventory') . '\" title=\"' . t('Add Inventory') . '\" />'.t('Add Inventory').'</a>',\n\t\t);\n\t}\n\t\n\t$output['area_inventories']['inventories'] = inventory_show_area_inventories($areadata);\n\t$output['area_inventories']['space'] = array(\n\t\t\t'#type' => 'markup',\n\t\t\t'#markup' => '<br><br>'\n\t);\n\t\n\t$output['area_inventories']['observations'] = inventory_show_observations($areadata['id'], $inventory_id);\n\t\n\t/* Create a fieldset for the strategies text fields */\n\t$output['area_concept'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Area concept'),\n\t\t\t'#collapsible' => true,\n\t\t\t'#collapsed' => false,\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'class' => array(\n\t\t\t\t\t\t\t'collapsible',\n\t\t\t\t\t\t\t'collapsed'\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t'#weight' => 4\n\t);\n\n\t/* add the protectiont target textarea */\n\t$output['area_concept']['protection_target'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#title' => t('Protection target'),\n\t\t\t'#markup' => \"<pre>\"\n\t\t\t\t\t. (empty($areadata['protection_target'])\n\t\t\t\t\t\t\t? t(\"None available\")\n\t\t\t\t\t\t\t: check_plain($areadata['protection_target']))\n\t\t\t\t\t. \"</pre>\"\n\t);\n\n\t/* add the tending strategies target textarea */\n\t$output['area_concept']['tending_strategies'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#title' => t('Tending strategies'),\n\t\t\t'#markup' => \"<pre>\"\n\t\t\t\t\t. (empty($areadata['tending_strategies'])\n\t\t\t\t\t\t\t? t(\"None available\")\n\t\t\t\t\t\t\t: check_plain($areadata['tending_strategies']))\n\t\t\t\t\t. \"</pre>\"\n\t);\n\n\t/* add the tending strategies target textarea */\n\t$output['area_concept']['safety_precautions'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#title' => t('Safety precautions'),\n\t\t\t'#markup' => \"<pre>\"\n\t\t\t\t\t. (empty($areadata['safety_precautions'])\n\t\t\t\t\t\t\t? t(\"None available\")\n\t\t\t\t\t\t\t: check_plain($areadata['safety_precautions'])) . \"</pre>\"\n\t);\n\n\t/* Create a fieldset for the linked habitats */\n\t$output['area_habitats'] = array(\n\t\t\t'#type' => 'fieldset',\n\t\t\t'#title' => t('Linked habitats'),\n\t\t\t'#collapsible' => true,\n\t\t\t'#attributes' => array(\n\t\t\t\t\t'class' => array(\n\t\t\t\t\t\t\t'collapsible',\n\t\t\t\t\t\t\t'collapsed'\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t'#weight' => 5\n\t);\n\n\tif (function_exists('gallery_list_renderer')) {\n\t\t$output['area_videos'] = gallery_list_renderer(\n\t\t\t'videos',\n\t\t\t'area',\n\t\t\t$areadata['id']);\n\t\t$output['area_images'] = gallery_list_renderer(\n\t\t\t'images',\n\t\t\t'area',\n\t\t\t$areadata['id']);\n\t}\n\n\t/* add the linked habitats */\n\t$results = db_query(\n\t\t'SELECT\n\t\t\tlabel,\n\t\t\tname\n\t\tFROM\n\t\t\t{area_habitat} ah\n\t\t\tJOIN {habitat} h ON ah.habitat_id = h.id\n\t\tWHERE\n\t\t\tah.area_id = ?;',\n\t\tarray($areadata['id']));\n\n\t$habitats = array();\n\tforeach ($results->fetchAll() as $habitat) {\n\t\t$habitats[] = (array) $habitat;\n\t}\n\tif(!empty($habitats)) {\n\t\t$output['area_habitats']['habitats'] = array(\n\t\t\t\t'#theme' => 'datatable',\n\t\t\t\t'#header' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'name' => t('Label'),\n\t\t\t\t\t\t\t\t'width' => 300\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'name' => t('Name'),\n\t\t\t\t\t\t\t\t'width' => 300\n\t\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'#tableWidth' => 900,\n\t\t\t\t'#rows' => $habitats,\n\t\t\t\t'#id_table' => DATATABLE_HABITATS\n\t\t);\n\t} else {\n\t\t$output['area_habitats']['habitats'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#markup' => \"<pre>\".t(\"None available\").\"</pre>\",\n\t\t\t);\n\t}\n\n\t$output['area_files'] = area_files($areadata);\n\t$output['area_files']['#weight'] = 6;\n\n\treturn $output;\n}", "public function buildPassengerArea() {\r\n\t}", "public function getArea()\n {\n return $this->area;\n }", "public function getArea()\n {\n return $this->area;\n }", "public function getArea()\n\t{\n\t\treturn $this->_area;\n\t}", "function placeTrou($case){\n\tglobal $plateau, $chemin;\n\tlist($x,$y)=$chemin[$case-1];\n\t$plateau[$x][$y] = TROU;\n}", "public function testMinArea()\n {\n $obj = new MinArea([[1,1],[1,3],[3,1],[3,3],[4,1],[4,3]]);\n $obj->run();\n $obj->print();\n }", "function fitts_widget_areas() {\r\n\r\n\r\n\r\n}", "public function areasAgregadas(){\n }", "public function fixSpatial()\n \t{\n \t}", "public function selectAction()\r\n {\r\n \t$ProblemArea = new ProblemArea();\r\n \t$this->view->areas = $ProblemArea->getProblemAreas();\r\n }", "function tccc_context_create_fixed_area($empty, $data = NULL, $conf = FALSE) {\n // which contains a group of string.\n $context = new ctools_context('string');\n $context->plugin = 'tccc_fixed_area';\n\n if ($empty) {\n return $context;\n }\n\n $context->data = 'fixed';\n return $context;\n}", "function setGraphArea($X1,$Y1,$X2,$Y2)\r\n\t{\r\n\t\t$this->GArea_X1 = $X1;\r\n\t\t$this->GArea_Y1 = $Y1;\r\n\t\t$this->GArea_X2 = $X2;\r\n\t\t$this->GArea_Y2 = $Y2;\r\n\t}", "public function setAreaConstrucao($iAreaContrucao){\n $this->iAreaContrucao = $iAreaContrucao;\n }", "public function getAreaConstrucao() {\n return $this->iAreaContrucao;\n }", "public function setCodigoArea( $codigoArea ){\n\t\t$this->codigoArea = $codigoArea;\n\t}", "public function addAction()\r\n {\r\n \t$this->checkAllowed('PROBLEMAREA', 'ADD');\r\n \t\r\n \t// check if user is logged in\r\n \tif (!$this->hasIdentity()) {\r\n \t\t$this->_helper->FlashMessenger->addMessage('You need to be logged in to perform actions.');\r\n \t\t$this->_redirect('/auth/login');\r\n \t\treturn;\r\n \t}\r\n \t\r\n \t// new form\r\n \t$form = new Form_ProblemArea();\r\n \tif ($this->getRequest()->isPost()) {\r\n \t\tif ($form->isValid($_POST)) {\r\n \t\t\t$ProblemArea = new ProblemArea();\r\n \t\t\t$data = $form->getValues();\r\n \t\t\t$data['CreatedBy'] = $this->view->user->Id;\r\n \t\t\t$ProblemArea->saveNew($data);\r\n \t\t\t$this->_helper->FlashMessenger->addMessage($this->translate('Problem area has been created.'));\r\n \t\t\t$this->_redirect('/problemarea/view');\r\n \t\t}\r\n \t}\r\n \t$this->view->form = $form;\r\n }", "function warPreHandling ( &$area ) {\n\n\t\treturn $area->agressivity/20 + ( $area->military/25 ) + $this->eventA [$key][chance] + $this->chanceMod[\"War\"];\n\t}", "function setGraphArea($X1, $Y1, $X2, $Y2) {\r\n\t\t$this->GArea_X1 = $X1;\r\n\t\t$this->GArea_Y1 = $Y1;\r\n\t\t$this->GArea_X2 = $X2;\r\n\t\t$this->GArea_Y2 = $Y2;\r\n\t}", "public function obtenerAreas();" ]
[ "0.6694504", "0.60976523", "0.60290664", "0.59475744", "0.57996476", "0.57996476", "0.57295215", "0.55746627", "0.55448025", "0.5519343", "0.5503148", "0.54326254", "0.53729886", "0.53729886", "0.53374827", "0.5292143", "0.52890253", "0.525938", "0.5251744", "0.522759", "0.5212196", "0.5196936", "0.51755685", "0.5158264", "0.51132685", "0.50603324", "0.50554234", "0.50495106", "0.50390595", "0.50342745" ]
0.6179239
1
the action (select or delete) to be performed on a file_id set (array of file_id)
protected function yiifileman_on_action($action, $file_ids){ extract($this->yiifileman_data()); if($action == 'select') return true; if(($action == 'delete') && ($allow_delete_files==true)){ //the remove_files method will remove only files if this files // belongs to the same provided $identity return $fileman->remove_files($identity, $file_ids); // return the removal counter } else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function process_bulk_action() {\n global $wpdb;\n $table_name = $wpdb->prefix . 'custom_db_tbl'; // do not forget about tables prefix\n\n if ('delete' === $this->current_action()) {\n $ids = isset($_REQUEST['id']) ? $_REQUEST['id'] : array();\n if (is_array($ids))\n $ids = implode(',', $ids);\n\n if (!empty($ids)) {\n $wpdb->query(\"DELETE FROM $table_name WHERE id IN($ids)\");\n }\n }\n }", "function process_bulk_action() {\n\t\tif ( 'delete' === $this->current_action() ) {\n\t\t\t$records_to_delete = array_map( 'sanitize_text_field', $_GET['transaction'] );\n\t\t\tif ( empty( $records_to_delete ) ) {\n\t\t\t\techo '<div id=\"message\" class=\"updated fade\"><p>Error! You need to select multiple records to perform a bulk action!</p></div>';\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tforeach ( $records_to_delete as $record_id ) {\n\t\t\t\tif ( ! is_numeric( $record_id ) ) {\n\t\t\t\t\twp_die( 'Error! ID must be numeric.' );\n\t\t\t\t}\n\t\t\t\tglobal $wpdb;\n\t\t\t\t$wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->prefix . 'swpm_payments_tbl WHERE id = %d', $record_id ) );\n\t\t\t}\n\t\t\techo '<div id=\"message\" class=\"updated fade\"><p>Selected records deleted successfully!</p></div>';\n\t\t}\n\t}", "function process_bulk_action() {\n global $wpdb;\n\n if ('bulk_delete' === $this->current_action()) {\n $records_to_delete = array_map( 'sanitize_text_field', $_REQUEST['ids'] );\n if (empty($records_to_delete)) {\n echo '<div id=\"message\" class=\"updated fade\"><p>Error! You need to select multiple records to perform a bulk action!</p></div>';\n return;\n }\n foreach ($records_to_delete as $record_id) {\n if( !is_numeric( $record_id )){\n wp_die('Error! ID must be numeric.');\n }\n $query = $wpdb->prepare(\"DELETE FROM \" . $wpdb->prefix . \"swpm_membership_tbl WHERE id = %d\", $record_id);\n $wpdb->query($query);\n }\n echo '<div id=\"message\" class=\"updated fade\"><p>Selected records deleted successfully!</p></div>';\n }\n }", "function delete_file() {\n\n $id = $this->request->getPost('id');\n $info = $this->General_files_model->get_one($id);\n\n if (!$info->bu_id) {\n app_redirect(\"forbidden\");\n }\n\n $this->can_access_this_intake($info->bu_id);\n\n if ($this->General_files_model->delete($id)) {\n\n //delete the files\n delete_app_files(get_general_file_path(\"bu\", $info->bu_id), array(make_array_of_file($info)));\n\n echo json_encode(array(\"success\" => true, 'message' => app_lang('record_deleted')));\n } else {\n echo json_encode(array(\"success\" => false, 'message' => app_lang('record_cannot_be_deleted')));\n }\n }", "public function multiDeleteAction() {\n if ($this->getRequest()->isPost()) {\n $values = $this->getRequest()->getPost();\n\n //IF ADMIN CLICK ON DELETE SELECTED BUTTON\n if (!empty($values['delete'])) {\n foreach ($values as $key => $value) {\n if ($key == 'delete_' . $value) {\n $importfile_id = (int) $value;\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n try {\n //IMPORT FILE OBJECT\n $importFile = Engine_Api::_()->getItem('sitegroup_importfile', $importfile_id);\n\n if (!empty($importFile)) {\n\n $first_import_id = $importFile->first_import_id;\n $last_import_id = $importFile->last_import_id;\n\n //MAKE QUERY FOR FETCH THE DATA\n $tableImport = Engine_Api::_()->getDbtable('imports', 'sitegroup');\n\n $sqlStr = \"import_id BETWEEN \" . \"'\" . $first_import_id . \"'\" . \" AND \" . \"'\" . $last_import_id . \"'\" . \"\";\n\n $select = $tableImport->select()\n ->from($tableImport->info('name'), array('import_id'))\n ->where($sqlStr);\n $importDatas = $select->query()->fetchAll();\n\n if (!empty($importDatas)) {\n foreach ($importDatas as $importData) {\n $import_id = $importData['import_id'];\n\n //DELETE IMPORT DATA BELONG TO IMPORT FILE\n $tableImport->delete(array('import_id = ?' => $import_id));\n }\n }\n\n //FINALLY DELETE IMPORT FILE DATA\n Engine_Api::_()->getDbtable('importfiles', 'sitegroup')->delete(array('importfile_id = ?' => $importfile_id));\n }\n\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n }\n }\n }\n }\n return $this->_helper->redirector->gotoRoute(array('action' => 'manage'));\n }", "public function actionBulkAction()\n {\n if (Yii::$app->request->post('action') == 'deleted') {\n foreach (Yii::$app->request->post('ids', []) as $id) {\n $this->findModel($id)->delete();\n }\n }\n }", "public function actionDeleteForIds()\n {\n Sources::deleteForIds($_POST['ids']);\n }", "public function delete(){\n $id = isset($_GET['id']) ? $_GET['id'] : '';\n $this->view->item = $this->db_order->selectOne($id);\n\n //Xoa 1 file hinh\n $old_image = ROOT_PATH . 'uploads/' . $this->view->item->image;\n if(file_exists($old_image)){\n unlink($old_image);\n }\n //Xoa 1 id\n if($id != '') {\n if($this->db_order->delete($id)){\n $url = BASE_PATH . 'index.php?module=admin&controller=order&action=index';\n header('location: ' . $url);\n }\n }\n\n\n //Xoa multi (ids + file hinh)\n if(isset($_POST['submit-multi-id']) && isset($_POST['ids'])) {\n $ids = $_POST['ids'];\n\n //Xoa nhieu file hinh\n foreach($ids as $val){\n $select['where'][0] = ['id','=',$val];\n $this->view->data = $this->db_order->selectAll($select);\n if($this->view->data) {\n foreach($this->view->data as $obj) {\n $old_image = ROOT_PATH . 'uploads/' . $obj->image;\n if(file_exists($old_image)){\n unlink($old_image);\n }\n }\n }\n }\n\n //Xóa nhiều id\n if($this->db_order->delete($ids)){\n $url = BASE_PATH . 'index.php?module=admin&controller=order&action=index';\n header('location: ' . $url);\n }\n }\n }", "public function performMultipleAction(){\r\n\t\tif(Request::ajax()){\r\n\t\t\t$actionType \t\t=\t((Input::get('type'))) ? Input::get('type') : '';\r\n\t\t\tif(!empty($actionType) && !empty(Input::get('ids'))){\r\n\t\t\t\tif($actionType\t==\t'delete'){\r\n\t\t\t\t\tNoCms::whereIn('id', Input::get('ids'))->delete();\r\n\t\t\t\t\tSession::flash('flash_notice',trans(\"messages.management.doc_all_delete_msg\")); \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function massDeleteAction()\n {\n $allIds = $this->getRequest()->getParam('id');\n if(!is_array($allIds)) {\n Mage::getSingleton('adminhtml/session')->addError(Mage::helper('customertier')->__('Please select.'));\n } else {\n\t\t\t foreach ($allIds as $allId) {\n\t\t\t\t $sourcecode = Mage::getModel('customertier/customertier')->load($allId);\n\t\t\t\t $sourcecode->delete();\n }\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('customertier')->__('Total of %d record(s) were deleted.', count($allIds))\n );\n }\n \n $this->_redirect('*/*/index');\n }", "function on_delete_file($button) {\n\t\tif($this->selected_file == \"\") {\n\t\t\t$this->on_no_file_selected($button);\n\t\t}\n\t\telse {\n\t\t\t$this->on_delete_confirm($button);\n\t\t}\n\t}", "function delete_process_post(){\n\t\t$id = explode(',',$this->post('id'));\n\t\t$error = false;\n\t\t$message = $success_message = \"\";\n\t\tif($id){\n\t\t\t$ec = 0; $sc = 0;\n\t\t\tforeach ($id as $key => $value) {\n\t\t\t\t$action_status = $this->Common_model->execute_sp(\n\t\t\t\t\tarray('sp_name'=>'mediagenda.actos_borrar',\n\t\t\t\t\t\t'params' => array('id'=>$value),\n\t\t\t\t\t\t'db_name' => 'default',\n\t\t\t\t\t\t'return_type' => \"dml\"\n\t\t\t\t\t)\n\t\t\t\t);\t\t\t\t\n\t\t\t\tif($action_status['code']!=0000){\n\t\t\t\t\t$ec++;\n\t\t\t\t\t$error = true;\n\t\t\t\t}else{\n\t\t\t\t\t$sc++;\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t$res = buildErrorResponse($error,$ec,$sc);\n\t\t\t$return_data_array = array('actos'=>$this->list_process_post(true));\n\t\t\t$message = \"Data deleted sucessfully\";\n\t\t\techo returnJsonResponse($message,$res['success'],$return_data_array);\t\t\t\n\t\t}else{\n\t\t\techo json_encode(array('success'=>false,'message'=>'Please select a atleast one for delete'));\n\t\t}\n\t}", "public function doMultiAction( array $a = array() ){\r\n\t\t$limit = count($a['contentIds']);\r\n\t\tif( $a['contentActionValue'] == '-1' ){\r\n\t\t\t\r\n\t\t\t/* Delete Mapped records */\r\n\t\t\t$this->oMysqli->query( \"START TRANSACTION\" );\r\n\t\t\t$this->sSql = \"UPDATE `event_mstr` SET `status`='\".(int)$a['contentActionValue'].\"' WHERE status!='-1' AND text_id IN(\".implode(',', $a['contentIds']).\") LIMIT $limit\";\r\n\t\t\tif( $this->oMysqli->query( $this->sSql ) ){\r\n\t\t\t\t$this->oMysqli->query( \"COMMIT\" );\r\n\t\t\t}else{\r\n\t\t\t\t$this->oMysqli->query( \"ROLLBACK\" );\r\n\t\t\t}\r\n\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\t$this->sSql = \"UPDATE `event_mstr` SET `status`='\".(int)$a['contentActionValue'].\"' WHERE status!='-1' AND text_id IN(\".implode(',', $a['contentIds']).\") LIMIT $limit\";\r\n\t\t\t$res = $this->oMysqli->query( $this->sSql );\r\n\t\t}\r\n\t\t\r\n\t}", "function mul_action()\n {\n $action_val= $_REQUEST['mul_val'];\n $arr_ids= $_REQUEST['mul_id'];\n $path='/contact';\n $table=CONTACT_US;\n multiple_action($arr_ids, $action_val, $table, $path);\n }", "public function bulk_actions( $which = '' ) {\n\n\t}", "public function uploadActions() {\n\t\t\n\t\t$result = 0;\n\t\t\n\t\t$upFile = $this->uploadCheck();\n\t\t\n\t\t$category = 0;\n\t\tif( isset($_POST['c']) ) {\n\t\t\t$category = (int)$_POST['c'];\n\t\t}\n\t\t$name = '';\n\t\tif( isset($_POST['n']) ) {\n\t\t\t$name = htmlspecialchars(strip_tags($_POST['n']), ENT_QUOTES);\n\t\t}\n\t\t\n\t\t/*\n\t\tCREATE TABLE `uploads` (\n\t\t`id` INT NOT NULL AUTO_INCREMENT ,\n\t\t`uid` INT NOT NULL ,\n\t\t`filename` VARCHAR( 250 ) NOT NULL ,\n\t\t`name` VARCHAR( 250 ) NOT NULL ,\n\t\t`category` INT NOT NULL ,\n\t\tPRIMARY KEY ( `id` )\n\t\t) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_polish_ci \n\t\t*/\n\t\tif( is_string($upFile) && !is_numeric($upFile) ) {\n\t\t$con = mysql_connect( 'mysql3.iq.pl', 'pihost_base', 'pibase2009' );\n\t\tmysql_select_db( 'pihost_base', $con );\n\t\t\tmysql_query('INSERT INTO desk_files (uid, filename, name, category) VALUES ('.(int)$this->getUserId().', \"'.addslashes($upFile).'\", \"'.$name.'\", '.(int)$category.');', $con);\n\t\t} else {\n\t\t\t$result = $upFile;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function deleteFile( Request $request ){\n foreach (explode(',', $request->get('ids')) as $id) {\n FileItem::destroy((int)$id);\n }\n\n return \"Success\";\n }", "protected function bulk_actions( $which = '' ) {\n\t}", "public function delete()\n {\n $options = $this->makeKeyValueArrayFromList(func_get_args());\n $selectFilter = $this->createSelector($options);\n\n $report = [];\n foreach ($this->listContent() as $file_header) {\n $file_header = (object)$file_header;\n // select by select rule\n if (call_user_func($selectFilter, $file_header->stored_filename,\n $file_header->filename, $file_header->index)\n === self::SELECT_FILTER_REFUSE) {\n // delete file from archive\n if ($this->archive->delete($file_header->stored_filename)) {\n // ok\n continue;\n }\n // deletion fails\n else {\n return 0;\n }\n }\n // unselected file add in report\n $report[] = $file_header;\n }\n\n foreach ($report as $i => $reportItem) {\n $report[$i] = (array)$reportItem;\n }\n\n return $report;\n }", "function admin_delete_multiple($id = null){\r\n $ids = array();\r\n foreach($this->data[$this->modelClass] as $record) {\r\n\t\t\tif($record != 0)\r\n\t\t\t\t$this->{$this->modelClass}->delete($record);\r\n\t}\r\n\t$this->redirect($this->referer());\r\n }", "public function actionButtonSelected($id_selected,$button_name) {\n\t\t//Your code here\n\t\t\t\n\t}", "function m_delete_file($table,$id) {\n $this->db->where('Id',$id);\n return $this->db->delete($table);\n \n }", "public function doAction( array $a = array() ){\r\n\t\tif( $a['contentActionValue'] == '-1' ){\r\n\t\t\t\r\n\t\t\t/* Delete Mapped records */\r\n\t\t\t$this->oMysqli->query( \"START TRANSACTION\" );\r\n\t\t\t$this->sSql = \"UPDATE `event_mstr` SET `status`='\".(int)$a['contentActionValue'].\"' WHERE status!='-1' AND event_id='\".(int)$a['contentId'].\"' LIMIT 1\";\r\n\t\t\tif( $this->oMysqli->query( $this->sSql ) ){\r\n\t\t\t\t$this->oMysqli->query( \"COMMIT\" );\r\n\t\t\t}else{\r\n\t\t\t\t$this->oMysqli->query( \"ROLLBACK\" );\r\n\t\t\t}\r\n\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t$this->sSql = \"UPDATE `event_mstr` SET `status`='\".(int)$a['contentActionValue'].\"' WHERE status!='-1' AND text_id='\".(int)$a['contentId'].\"' LIMIT 1\";\r\n\t\t$res = $this->oMysqli->query( $this->sSql );\r\n\t\t}\r\n\t}", "function process_bulk_action() {\n global $wpdb;\n $table_name = $wpdb->prefix . 'skip_volunteer';\n $entry_id = ( is_array( $_REQUEST['volunteer'] ) ) ? $_REQUEST['volunteer'] : array( $_REQUEST['volunteer'] );\n //Detect when a bulk action is being triggered...\n //var_dump($$_REQUEST);\n if( 'delete'===$this->current_action() ) {\n \n foreach ( $entry_id as $id ) {\n $id = absint( $id );\n echo $id;\n // $wpdb->query( \"DELETE FROM $this->entries_table_name WHERE entries_id = $id\" );\n }\n }\n if('export'===$this->current_action() ) {\n $selected = implode(\",\", $entry_id);\n //var_dump($entry_id);\n $query = \"SELECT * FROM $table_name WHERE id IN($selected)\" ;\n //echo $query;\n $row = $wpdb->get_results($query);\n $export = '';\n $export .= '<table><tr>';\n $export .= '<td>Project</td>';\n $export .= '<td>Club Name</td>';\n $export .= '<td>Project Date</td>';\n $export .= '<td>Adult</td>';\n $export .= '<td>Children</td>';\n $export .= '<td>Families</td>';\n $export .= '<td>Hours</td></tr>';\n foreach ($row as $value) {\n // var_dump($value->project);\n $export .= '<tr>'; \n $export .= '<td>'.$value->project.'</td>';\n $export .= '<td>'.$value->club.'</td>';\n $export .= '<td>'.$value->project_date.'</td>';\n $export .= '<td>'.$value->adult.'</td>';\n $export .= '<td>'.$value->children.'</td>';\n $export .= '<td>'.$value->families.'</td>';\n $export .= '<td>'.$value->hours.'</td>';\n $export .= '</tr>'; \n }\n $export .='</table>';\n $upload_dir = wp_upload_dir();\n\n $filename = \"skip_volunteer\";\n $handle = fopen($upload_dir['baseurl'].\"/export/$filename.xls\", \"w\");\n fwrite($handle, $export);\n // echo '<a href=\"'.$upload_dir['baseurl'].'/export/'.$filename.'xls\">';\n \n }\n \n }", "public function actionButtonSelected($id_selected, $button_name)\n {\n //Your code here\n\n }", "public function actionButtonSelected($id_selected, $button_name)\n {\n //Your code here\n\n }", "public function actionButtonSelected($id_selected,$button_name) {\n\t //Your code here\n\t \n\t }", "public function actionButtonSelected($id_selected,$button_name) {\n\t //Your code here\n\t \n\t }", "public function actionButtonSelected($id_selected,$button_name) {\n\t //Your code here\n\t \n\t }", "public function actionButtonSelected($id_selected,$button_name) {\n\t //Your code here\n\t \n\t }" ]
[ "0.624569", "0.59739256", "0.5930103", "0.583793", "0.58364075", "0.5799294", "0.5777267", "0.5751612", "0.57482505", "0.5748112", "0.5744164", "0.56861514", "0.5678651", "0.5639833", "0.56393987", "0.5614643", "0.5601745", "0.55767244", "0.55687076", "0.5558997", "0.5510133", "0.5483879", "0.5475429", "0.5471648", "0.5468928", "0.5468928", "0.5458934", "0.5458934", "0.5458934", "0.5458934" ]
0.6587157
0
Generate the template for async use of this UIType
public function generate_vue_template() { $v = new HTMLView("src/views/uitypes/async-checkbox.php","waboot-woo-product-filters"); $output = $v->get([ "input_name" => $this->input_name ]); return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generate()\n {\n echo '<';\n echo $this->tagName;\n echo ' type=\"'.$this->typeName.'\"';\n echo ' name=\"'.$this->name.'\"';\n echo ' id=\"'.$this->name.'\"';\n echo ' class=\"'.$this->className.'\"';\n echo ' placeholder=\"Type '.$this->name.' here...\"';\n echo ' required';\n echo '>';\n echo '</';\n echo $this->tagName;\n echo '>';\n }", "public function generate()\n {\n return sprintf('<%s %s=\"%s\" content=\"%s\">', static::$tag, static::$key, static::$name, $this->getContent());\n }", "private function template()\n {\n $template = File::get(__DIR__ . '/Templates/presenter.stub');\n $namespace = app()->getNamespace() . $this->folder;\n\n return str_replace(\n ['{{NAMESPACE}}', '{{CLASS}}', '{{METHOD}}'],\n [$namespace, $this->class, $this->method],\n $template\n );\n }", "public function render()\n {\n return <<<'blade'\n\t\t<div id='{{$id}}' class=\"spinner-border {{ $size }} {{ $color }}\" role=\"status\"></div>\nblade;\n }", "public function get_manual_authorisation_template() {\n\n\t\t$id = $this->get_id();\n\t\t$description = $this->get_description();\n\n\t\t$template = \"<div id='updraftplus_manual_authorisation_template_{$id}'>\";\n\t\t$template .= \"<strong>\".sprintf(__('%s authentication:', 'updraftplus'), $description).\"</strong>\";\n\t\t$template .= \"<p>\".sprintf(__('If you are having problems authenticating with %s you can manually authorize here.', 'updraftplus'), $description).\"</p>\";\n\t\t$template .= \"<p>\".__('To complete manual authentication, at the orange UpdraftPlus authentication screen select the \"Having problems authenticating?\" link, then copy and paste the code given here.', 'updraftplus').\"</p>\";\n\t\t$template .= \"<label for='updraftplus_manual_authentication_data_{$id}'>\".sprintf(__('%s authentication code:', 'updraftplus'), $description).\"</label> <input type='text' id='updraftplus_manual_authentication_data_{$id}' name='updraftplus_manual_authentication_data_{$id}'>\";\n\t\t$template .= \"<p id='updraftplus_manual_authentication_error_{$id}'></p>\";\n\t\t$template .= \"<button type='button' data-method='{$id}' class='button button-primary' id='updraftplus_manual_authorisation_submit_{$id}'>\".__('Complete manual authentication', 'updraftplus').\"</button>\";\n\t\t$template .= '<span class=\"updraftplus_spinner spinner\">' . __('Processing', 'updraftplus') . '...</span>';\n\t\t$template .= \"</div>\";\n\n\t\treturn $template;\n\t}", "public function getTemplateName() {\r\n\t\tglobal $log;\r\n\t\t$log->debug(\"ENTERING --> Joomlabridge_Multipicklist_UIType::getTemplateName() : uitypes/Multipicklist.tpl\");\r\n\t\treturn 'uitypes/MultiPicklist.tpl';\r\n\t}", "public function builder_module_template() {\n echo '<script type=\"text/html\" id=\"tmpl-cv-builder-' . $this->config['handle'] . '\">' . $this->builder_module_callback( $this->get_default_attributes(), $this->config['default_content'] ) . '</script>';\n }", "protected function actGettemplate() {\n $lName = $this -> getVal('name');\n \n $lPhraseTypes = CCor_Res::extract('code', 'eve_phrase', 'crpmaster');\n $lJobTyp = $lPhraseTypes[$this -> mSrc];\n \n echo Zend_Json::encode( CCms_Mod::getTemplate($lName, $this -> mJobId, $lJobTyp) );\n }", "public function getTemplate(): string;", "public function getTemplate(): string;", "public function generate()\n {\n if (TL_MODE == 'BE') {\n $objTemplate = new BackendTemplate('be_wildcard');\n $objTemplate->wildcard = '### MODULE MEMBER DATA NOTIFICATION ###';\n $objTemplate->title = $this->headline;\n $objTemplate->id = $this->id;\n $objTemplate->link = $this->name;\n $objTemplate->href = 'contao/main.php?do=themes&amp;table=tl_module&amp;act=edit&amp;id=' . $this->id;\n\n return $objTemplate->parse();\n }\n\n // return if the user is not logged in\n if(!FE_USER_LOGGED_IN)\n return;\n\n return parent::generate();\n\n }", "protected function actSettemplate(){\n $lCombos = json_decode( $this -> getVal('data'), true );\n $lName = $this -> getVal('name');\n $lMethod = $this -> getVal('method');\n \n $lPhraseTypes = CCor_Res::extract('code', 'eve_phrase', 'crpmaster');\n $lJobTyp = $lPhraseTypes[$this -> mSrc];\n\n echo Zend_Json::encode( CCms_Mod::setTemplate($lName, $lCombos, $lMethod, $lJobTyp) );\n }", "public function render()\n {\n $content = \"{\";\n $content .= \"title: '\" . htmlspecialchars($this->getTitle(), ENT_QUOTES) . \"',\";\n \n $content .= \"loader: {\n url: '\" . $this->getOption('url') . \"',\n contentType: 'html',\n scripts: true,\n loadMask: true\";\n\n if ($this->hasOption('autoLoad')) {\n $content .= \", autoLoad: \" . $this->getOption('autoLoad') . \",\";\n }\n \n $content .= \"},\";\n \n \n if ($this->hasListeners()) {\n $content .= \"listeners: {\";\n foreach ($this->getListeners() as $key => $function) {\n $content .= $key . \": \" . $function . \",\";\n }\n $content .= \"}\";\n }\n \n $content .= \"}\";\n \n return $content;\n }", "public function js_template() {\n\t\t?>\n <script id=\"js-builderius-setting-<?php echo $this->setting_key; ?>-tmpl\" type=\"text/template\">\n <div class=\"uni-modal-row uni-clear\">\n\t\t\t\t<?php echo $this->generate_field_label_html() ?>\n <div class=\"uni-modal-row-second\">\n\t\t\t\t\t<?php echo $this->generate_select_html() ?>\n </div>\n </div>\n </script>\n\t\t<?php\n\t}", "public function generate()\n {\n if (isset(self::$HTTP_STATUSES)) {\n $status_message = self::$HTTP_STATUSES[$this->_status];\n } else {\n $status_message = 'undefiend';\n }\n\n if ($this->_iframe_transport) {\n $this->addHeaderToPage('Content-Type', 'text/html');\n $this->_Result = '<textarea type=\"application/json\">' . $this-> _Result . '</textarea>';\n }\n $this->addHeaderToPage('HTTP/1.0 ' . $status_message);\n $this->__renderHeaders();\n return $this->_Result;\n\n }", "public function generate()\n {\n\n return parent::generate();\n }", "protected function getTemplate()\n {\n return 'repeated';\n }", "public function generate()\n {\n if (TL_MODE == 'BE') {\n $objTemplate = new \\BackendTemplate('be_wildcard');\n $objTemplate->wildcard = '###' . Utf8::strtoupper($GLOBALS['TL_LANG']['FMD']['propertylist'][0]) . '###';\n $objTemplate->title = $this->name;\n $objTemplate->id = $this->id;\n $objTemplate->link = $this->name;\n $objTemplate->href = 'contao/main.php?do=themes&amp;table=tl_module&amp;act=edit&amp;id=' . $this->id;\n\n return $objTemplate->parse();\n }\n return parent::generate();\n }", "public function generate()\n {\n return parent::generate();\n }", "public function generateMainImage()\n {\n $hasImages = $this->hasImages();\n\n if (!$hasImages && !$this->hasPlaceholderImage()) {\n return '';\n }\n\n /** @var Template|object $objTemplate */\n $objTemplate = new Template($this->strTemplate);\n\n $this->addImageToTemplate(\n $objTemplate,\n 'main',\n ($hasImages ? $this->arrFiles[0] : $this->getPlaceholderImage()),\n $hasImages\n );\n\n $objTemplate->javascript = '';\n\n if (Environment::get('isAjaxRequest')) {\n $strScripts = '';\n $arrTemplates = StringUtil::deserialize($this->lightbox_template, true);\n\n if (!empty($arrTemplates)) {\n foreach ($arrTemplates as $strTemplate) {\n $objScript = new Template($strTemplate);\n $strScripts .= $objScript->parse();\n }\n }\n\n $objTemplate->javascript = $strScripts;\n }\n\n return $objTemplate->parse();\n }", "public function content_template() {\n\t\t$control_uid = $this->get_control_uid();\n\t\t?>\n\t\t<div class=\"elementor-control-field\">\n\t\t\t<label for=\"<?php echo esc_attr( $control_uid ); ?>\" class=\"elementor-control-title\">{{{ data.label }}}</label>\n\t\t\t<div class=\"elementor-control-input-wrapper\">\n\t\t\t\t<a href=\"#\" class=\"scisco-select-file elementor-button elementor-button-success\" style=\"padding: 10px 15px;border:none !important;display: block;text-align: center;\" id=\"select-file-<?php echo esc_attr( $control_uid ); ?>\" ><?php echo esc_html__( \"Choose / Upload File\", 'scisco' ); ?></a> <br />\n\n\t\t\t\t<input type=\"text\" class=\"scisco-selected-fle-url\" id=\"<?php echo esc_attr( $control_uid ); ?>\" data-setting=\"{{ data.name }}\" placeholder=\"{{ data.placeholder }}\">\n\t\t\t</div>\n\t\t</div>\n\t\t<# if ( data.description ) { #>\n\t\t<div class=\"elementor-control-field-description\">{{{ data.description }}}</div>\n\t\t<# } #>\n\t\t<?php\n\t}", "public function generate()\n {\n if (TL_MODE === 'BE') {\n $objTemplate = new BackendTemplate('be_wildcard');\n $objTemplate->wildcard = '### '.Utf8::strtoupper($GLOBALS['TL_LANG']['FMD']['pkg'][0]).' ###';\n $objTemplate->title = $this->headline;\n $objTemplate->id = $this->id;\n $objTemplate->link = $this->name;\n $objTemplate->href = 'contao/main.php?do=themes&amp;table=tl_module&amp;act=edit&amp;id='.$this->id;\n\n return $objTemplate->parse();\n }\n\n return parent::generate();\n }", "protected function fetchTemplate() {\n\t\tif ($this->settings['output'] == 'javascript') {\n\t\t\t$file = 'javascript.html';\n\t\t} else {\n\t\t\t$file = 'image.html';\n\t\t}\n\n\t\treturn $this->cObj->fileResource($this->settings['templatePath'] . $file);\n\t}", "public function generate()\n {\n if (TL_MODE == 'BE') {\n $objTemplate = new \\BackendTemplate('be_wildcard');\n\n $objTemplate->wildcard = '### ISOTOPE ECOMMERCE: STORE CONFIG SWICHER ###';\n\n $objTemplate->title = $this->headline;\n $objTemplate->id = $this->id;\n $objTemplate->link = $this->name;\n $objTemplate->href = 'contao/main.php?do=themes&amp;table=tl_module&amp;act=edit&amp;id=' . $this->id;\n\n return $objTemplate->parse();\n }\n\n $this->iso_config_ids = deserialize($this->iso_config_ids);\n\n if (!is_array($this->iso_config_ids) || !count($this->iso_config_ids)) { // Can't use empty() because its an object property (using __get)\n return '';\n }\n\n if (\\Input::get('config') != '') {\n if (in_array(\\Input::get('config'), $this->iso_config_ids)) {\n Isotope::getCart()->config_id = \\Input::get('config');\n Isotope::getCart()->save();\n }\n\n \\Controller::redirect(preg_replace(('@[?|&]config=' . \\Input::get('config') . '@'), '', \\Environment::get('request')));\n }\n\n return parent::generate();\n }", "final public function getTemplate() {\n\t\treturn '';\n\t}", "public function compile() {\n $template = $this->get_template();\n if (!is_null($this->get_attr('id'))) {\n $template = str_replace('%label_id%', $this->get_attr('id'), $template);\n }\n else {\n $template = str_replace('%label_id%', '', $template);\n }\n if ($this->get_required()) {\n $template = str_replace('%required%', $this->get_required_template(), $template);\n }\n else {\n $template = str_replace('%required%', '', $template);\n }\n $template = str_replace('%type%', $this->get_type(), $template);\n $template = str_replace('%label%', $this->get_label(), $template);\n if ($this->get_type() !== 'file') {\n $template = str_replace('%value%', 'value=\"'.$this->get_default_value().'\"', $template);\n }\n else {\n $template = str_replace('%value%', '', $template);\n }\n $template = str_replace('%attr%', $this->get_attr_string(), $template);\n $template = str_replace('%wrapper_classes%', $this->get_wrapper_classes_string(), $template);\n return $template;\n }", "public function __toString()\n {\n return view($this->template, [$this->name => $this])->render();\n }", "public function __toString() {\n return $this->_template->getOutput($this->resource_name);\n }", "public function generate()\n {\n $container = System::getContainer();\n $values = [];\n\n // Can be an array\n if (!empty($this->varValue) && null !== ($nodes = NodeModel::findMultipleByIds((array) $this->varValue))) {\n /** @var DataContainerListener $eventListener */\n $eventListener = $container->get('terminal42_node.listener.data_container');\n\n /** @var NodeModel $node */\n foreach ($nodes as $node) {\n $values[$node->id] = strip_tags($eventListener->onLabelCallback($node->row(), $node->name, $this->objDca), '<img><span>');\n }\n }\n\n $return = '<input type=\"hidden\" name=\"'.$this->strName.'\" id=\"ctrl_'.$this->strId.'\" value=\"'.implode(',', array_keys($values)).'\">\n <input type=\"hidden\" name=\"'.$this->strOrderName.'\" id=\"ctrl_'.$this->strOrderId.'\" value=\"'.implode(',', array_keys($values)).'\">\n <div class=\"selector_container\">'.(\\count($values) > 1 ? '\n <p class=\"sort_hint\">'.$GLOBALS['TL_LANG']['MSC']['dragItemsHint'].'</p>' : '').'\n <ul id=\"sort_'.$this->strId.'\" class=\"'.($this->sorting ? 'sortable' : '').'\">';\n\n foreach ($values as $k => $v) {\n $return .= '<li style=\"cursor:move;\" data-id=\"'.$k.'\">'.$v.'</li>';\n }\n\n $return .= '</ul>';\n $pickerBuilder = $container->get('contao.picker.builder');\n\n if (!$pickerBuilder->supportsContext('node')) {\n $return .= '\n\t<p><button class=\"tl_submit\" disabled>'.$GLOBALS['TL_LANG']['MSC']['changeSelection'].'</button></p>';\n } else {\n $extras = ['fieldType' => $this->fieldType];\n\n if (\\is_array($this->rootNodes)) {\n $extras['rootNodes'] = array_values($this->rootNodes);\n }\n\n $return .= '\n\t<p><a href=\"'.StringUtil::ampersand($pickerBuilder->getUrl('node', $extras)).'\" class=\"tl_submit\" id=\"pt_'.$this->strName.'\">'.$GLOBALS['TL_LANG']['MSC']['changeSelection'].'</a></p>\n\t<script>\n\t $(\"pt_'.$this->strName.'\").addEvent(\"click\", function(e) {\n\t\te.preventDefault();\n\t\tBackend.openModalSelector({\n\t\t \"id\": \"tl_listing\",\n\t\t \"title\": \"'.StringUtil::specialchars(str_replace(\"'\", \"\\\\'\", $GLOBALS['TL_DCA'][$this->strTable]['fields'][$this->strField]['label'][0])).'\",\n\t\t \"url\": this.href + document.getElementById(\"ctrl_'.$this->strId.'\").value,\n\t\t \"callback\": function(table, value) {\n\t\t\tnew Request.Contao({\n\t\t\t evalScripts: false,\n\t\t\t onSuccess: function(txt, json) {\n\t\t\t\t$(\"ctrl_'.$this->strId.'\").getParent(\"div\").set(\"html\", json.content);\n\t\t\t\tjson.javascript && Browser.exec(json.javascript);\n\t\t\t }\n\t\t\t}).post({\"action\":\"reloadNodePickerWidget\", \"name\":\"'.$this->strId.'\", \"value\":value.join(\"\\t\"), \"REQUEST_TOKEN\":\"'.System::getContainer()->get('contao.csrf.token_manager')->getDefaultTokenValue().'\"});\n\t\t }\n\t\t});\n\t });\n\t</script>\n\t<script>Backend.makeMultiSrcSortable(\"sort_'.$this->strId.'\", \"ctrl_'.$this->strId.'\", \"ctrl_'.$this->strId.'\")</script>';\n }\n\n $return = '<div>'.$return.'</div></div>';\n\n return $return;\n }", "public function generate() {\n\t\t\t// Get the array with the result from fetching items from the db\n\t\t\tif( $this->properties['status'] == 'success' ) {\n\t\t\t\t$items_section = $this->generate_entries();\n\t\t\t\t# Default footer is paging\n\t\t\t\tif( !isset($this->properties['footer']) ) {\n\t\t\t\t\t$this->properties['footer'] = $this->generate_paging_controls();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Set the items to be the message\n\t\t\t\t$items_section = $this->properties['message'];\n\t\t\t}\n\t\t\t// generate a dummy entry for js and css\n\t\t\t$entry = new \\Widget\\Entry\\AppEntry( array() );\n\t\t\t$this->JS = array_merge( $this->JS, $entry->get_JS() );\n\t\t\t$this->CSS = array_merge( $this->CSS, $entry->get_CSS() );\n\t\t\t\n\t\t\t// Default title is dropdowns and search\n\t\t\tif( !isset($this->properties['header']) ) {\n\t\t\t\t// Add dropdowns\n\t\t\t\t$this->properties['header'] = $this->generate_dropdowns();\n\t\t\t}\n\t\t\t\n\t\t\t$this->HTML = $items_section;\n\t\t\tif( !$this->properties['no_box'] ) {\n\t\t\t\t$box = new \\Widget\\Box( array(\n\t\t\t\t\t'content'\t\t=> array( \n\t\t\t\t\t\t\t\t\t\tarray( 'title' => '-', 'content' => $items_section ),\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t'title'\t\t\t=> $this->properties['header'],\n\t\t\t\t\t'footer'\t\t=> $this->properties['footer'],\n\t\t\t\t) );\n\t\t\t\t$box->generate();\n\t\t\t\t$this->HTML = $box->get_HTML();\n\t\t\t\t$this->JS = array_merge( $this->JS, $box->get_JS() );\n\t\t\t\t$this->CSS = array_merge( $this->CSS, $box->get_CSS() );\n\t\t\t}\n\t\t\t\n\t\t\treturn $this->HTML;\n\t\t}" ]
[ "0.5748043", "0.56772083", "0.5654263", "0.5556455", "0.55287397", "0.55133337", "0.5494215", "0.546764", "0.539205", "0.539205", "0.53776884", "0.53604186", "0.5351632", "0.53284025", "0.5301417", "0.5300445", "0.5296589", "0.5292205", "0.5246226", "0.5227292", "0.5225233", "0.52208924", "0.5174772", "0.5173545", "0.51576734", "0.51489437", "0.51443666", "0.513869", "0.51228917", "0.51227826" ]
0.6018723
0
/ Set default condition used in SELECT queries
protected function default_condition() { $this->db->where($this->table . '.deleted_at !=', NULL); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDefaultFilterCondition()\r\n\t{\r\n\t\treturn '=';\r\n\t}", "protected function get_select_sql($condition, $order, $limit) {\n //Overwrite\n }", "private function add_default_conditions() {\n\t\tif ( ! $this->should_add_default_conditions ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif( ! $this->has_element_status_condition ) {\n\t\t\t$this->add( $this->has_available_elements() );\n\t\t}\n\n\t\tif( ! $this->has_active_relationship_condition ) {\n\t\t\t$this->add( $this->has_active_relationship() );\n\t\t}\n\t}", "public function v ($query, $default = '');", "public function buildConditionQuery($condition='')\n\t{\n\t\t$this->sql_condition = $condition;\n\t}", "public function buildConditionQuery($condition='')\n\t\t\t{\n\t\t\t\t$this->sql_condition = $condition;\n\t\t\t}", "public function prepareConditionSql()\n {\n return '';\n }", "public function getDefaultFilterQueries();", "public function do_not_add_default_conditions() {\n\t\t$this->should_add_default_conditions = false;\n\t\treturn $this;\n\t}", "public function getExpressionToSetDefaultValueForAColumn(): DbExpr;", "protected function add_where_on_select() : Database_model\n\t{\n\t\treturn $this->where_deleted()->where_can_read();\n\t}", "public function scopeDefault($query)\n {\n return $query->where('default', true);\n }", "protected function _queryAvailable($select, $value) {\n\t\t\n\t\tif($value === true || $value === 1 || $value === '1' || $value === 'true') {\n\t\t\t$select->where('e.published = 1 AND e.deleted = 0');\n\t\t} else if($value === false || $value === 0 || $value === '0' || $value === 'false') {\n\t\t\t$select->where('e.published = 0 OR e.deleted = 1');\n\t\t}\n\t\t\n\t\treturn $select;\t\n\t}", "public function getDefaultExpression();", "public function select( $condition )\n\t{\t\n\t\t$this->select = \"SELECT $condition FROM \";\n\t}", "function conditionSQL(&$parameters);", "public function condition($condition) {\n }", "protected function default_select() {\n\t\treturn '*';\n\t}", "function custom_conds( $conds = array())\n\t{\n\t\t// api_id condition\n\t\tif ( isset( $conds['id'] )) {\n\t\t\t\n\t\t\t$this->db->where( 'id', $conds['id'] );\n\t\t}\n\n\t\t// api_constant condition\n\t\tif ( isset( $conds['user_id'] )) {\n\t\t\t\n\t\t\t$this->db->where( 'user_id', $conds['user_id'] );\n\t\t}\n\n\t\t\t// api_constant condition\n\t\tif ( isset( $conds['shop_id'] )) {\n\t\t\t\n\t\t\t$this->db->where( 'shop_id', $conds['shop_id'] );\n\t\t}\n\t}", "public function get_where_clause() {\n\t\treturn ' 1 = 0 ';\n\t}", "private function whereClause()\n {\n\n $conf = $this->pObj->conf;\n $mode = $this->pObj->piVar_mode;\n $view = $this->pObj->view;\n\n $viewWiDot = $view . '.';\n\n\n\n// 3.3.7\n ////////////////////////////////////////////////////////////////////\n //\n // RETURN in case of override.where\n\n if ( $conf[ 'views.' ][ $viewWiDot ][ $mode . '.' ][ 'override.' ][ 'where' ] )\n {\n $where = $this->pObj->conf_sql[ 'where' ];\n if ( $this->pObj->b_drs_sql )\n {\n t3lib_div::devLog( '[INFO/SQL] override.where is true. views.' . $viewWiDot . $mode . '.where will be ignored!', $this->pObj->extKey, 0 );\n t3lib_div::devLog( '[INFO/SQL] all andWhere configuration will be ignored too!', $this->pObj->extKey, 0 );\n t3lib_div::devLog( '[INFO/SQL] WHERE ' . $where, $this->pObj->extKey, 0 );\n }\n return $where;\n }\n // RETURN in case of override.where\n// 3.3.7\n\n\n\n $whereClause = false;\n\n\n //////////////////////////////////////////////////////////////////////////\n //\n // Get enableFields like hiddden, deleted, starttime ... only for the localTable\n\n $str_enablefields = $this->str_enableFields( $this->pObj->localTable );\n // #11429, cweiske, 101219\n //if (strpos($whereClause, $str_enablefields) === false)\n if ( $str_enablefields !== '' && strpos( $whereClause, $str_enablefields ) === false )\n {\n $whereClause = $whereClause . \" AND \" . $str_enablefields;\n }\n // Get enableFields like hiddden, deleted, starttime ... only for the localTable\n ////////////////////////////////////////////////////////////////////\n //\n // Add localisation fields\n\n $str_local_where = $this->pObj->objLocalise3x->localisationFields_where( $this->pObj->localTable );\n if ( $str_local_where )\n {\n $whereClause = $whereClause . \" AND \" . $str_local_where;\n }\n // Add localisation fields\n// #41754.01, 1210101, dwildt, -\n// $this->pObj->arr_andWhereFilter isn't never allocated\n// //////////////////////////////////////////////////////////////////////////\n// //\n// // Is there a andWhere statement from the filter class?\n// if ( is_array( $this->pObj->arr_andWhereFilter ) )\n// {\n// $str_andFilter = implode(\" AND \", $this->pObj->arr_andWhereFilter);\n// $whereClause = $whereClause.\" AND \".$str_andFilter;\n// }\n// // Is there a andWhere statement from the filter class?\n// #41754.01, 1210101, dwildt, -\n //////////////////////////////////////////////////////////////////////////\n //\n // If we have a sword, allocates the global $arr_swordPhrasesTableField\n\n if ( $this->pObj->arr_swordPhrases && $this->pObj->csvSearch )\n {\n $arrSearchFields = explode( ',', $this->pObj->csvSearch );\n foreach ( $arrSearchFields as $arrSearchField )\n {\n list($str_before_as, $str_behind_as) = explode( ' AS ', $arrSearchField );\n list($table, $field) = explode( '.', $str_before_as );\n $tableField = trim( $table ) . '.' . trim( $field );\n foreach ( $this->pObj->arr_swordPhrases as $sword )\n {\n $this->pObj->arr_swordPhrasesTableField[ $tableField ][] = $sword;\n }\n }\n }\n // If we have a sword, allocates the global $arr_swordPhrasesTableField\n //////////////////////////////////////////////////////////////////////////\n //\n // Get SWORD, AND WHERE and JOINS\n\n if ( $view == 'list' )\n {\n $whereSword = $this->whereSearch();\n }\n $andWhere = $this->andWhere();\n $arr_result = $this->get_joins();\n $str_full_join = $arr_result[ 'data' ][ 'full_join' ];\n unset( $arr_result );\n // Get SWORD, AND WHERE and JOINS\n //////////////////////////////////////////////////////////////////////////\n //\n // Add a FULL JOIN\n\n if ( $str_full_join != '' )\n {\n $whereClause .= ' ' . $str_full_join;\n }\n // Add a FULL JOIN\n //////////////////////////////////////////////////////////////////////////\n //\n // Add an AND WHERE from TypoScript\n\n if ( $andWhere != '' )\n {\n $whereClause .= ' AND ' . $andWhere;\n }\n // Add an AND WHERE from TypoScript\n //////////////////////////////////////////////////////////////////////////\n //\n // Process depending on the view (LIST || SINGLE)\n\n switch ( $view )\n {\n case('single'):\n // Add the uid of the choosen record\n //$whereClause .= ' AND '.$this->pObj->arrLocalTable['uid'].' = '.$this->pObj->piVars['showUid'];\n $whereClause .= $this->pObj->objLocalise3x->localisationSingle_where( $this->pObj->localTable );\n break;\n case('list'):\n // Add the search clause, if there is a search (sword)\n if ( $whereSword != '' )\n {\n $whereClause .= ' ' . $whereSword;\n }\n break;\n }\n // Process depending on the view (LIST || SINGLE)\n //////////////////////////////////////////////////////////////////////////\n //\n // Add pid IN list\n\n $str_pidStatement = $this->str_andWherePid( $this->pObj->localTable );\n // Do we have a showUid not for the local table but for the foreign table? 3.3.3\n\n if ( strpos( $whereClause, $str_pidStatement ) === false )\n {\n $whereClause = $whereClause . \" AND \" . $str_pidStatement;\n }\n // Add pid IN list\n //////////////////////////////////////////////////////////////////////////\n //\n // BUGFIX\n // #11430, cweise, 101219\n //if (strpos(Clause, \" AND \") == 0)\n if ( substr( ltrim( $whereClause ), 0, 4 ) == 'AND ' )\n {\n //$whereClause = substr($whereClause, strlen(\" AND\"), strlen($whereClause));\n $whereClause = substr( ltrim( $whereClause ), 3 );\n }\n // BUGFIX\n //////////////////////////////////////////////////////////////////////////\n //\n // DRS - Development Reporting System\n// 3.3.7\n // Human readable format\n #10111\n $hr_whereClause = str_replace( ',', ', ', $whereClause );\n if ( $this->pObj->b_drs_sql )\n {\n t3lib_div::devLog( '[INFO/SQL] WHERE ' . $hr_whereClause, $this->pObj->extKey, 0 );\n t3lib_div::devlog( '[HELP/SQL] Change it? Use views.' . $viewWiDot . $mode . '.override.where', $this->pObj->extKey, 1 );\n }\n // DRS - Development Reporting System\n\n return $whereClause;\n }", "function AdvancedSearchWhere($Default = FALSE) {\n\t\tglobal $Security;\n\t\t$sWhere = \"\";\n\t\tif (!$Security->CanSearch()) return \"\";\n\t\t$this->BuildSearchSql($sWhere, $this->id, $Default, FALSE); // id\n\t\t$this->BuildSearchSql($sWhere, $this->id_actividad, $Default, FALSE); // id_actividad\n\t\t$this->BuildSearchSql($sWhere, $this->apellidopaterno, $Default, FALSE); // apellidopaterno\n\t\t$this->BuildSearchSql($sWhere, $this->apellidomaterno, $Default, FALSE); // apellidomaterno\n\t\t$this->BuildSearchSql($sWhere, $this->nombre, $Default, FALSE); // nombre\n\t\t$this->BuildSearchSql($sWhere, $this->nrodiscapacidad, $Default, FALSE); // nrodiscapacidad\n\t\t$this->BuildSearchSql($sWhere, $this->ci, $Default, FALSE); // ci\n\t\t$this->BuildSearchSql($sWhere, $this->fecha_nacimiento, $Default, FALSE); // fecha_nacimiento\n\t\t$this->BuildSearchSql($sWhere, $this->sexo, $Default, FALSE); // sexo\n\t\t$this->BuildSearchSql($sWhere, $this->nivelestudio, $Default, FALSE); // nivelestudio\n\t\t$this->BuildSearchSql($sWhere, $this->id_discapacidad, $Default, FALSE); // id_discapacidad\n\t\t$this->BuildSearchSql($sWhere, $this->id_tipodiscapacidad, $Default, FALSE); // id_tipodiscapacidad\n\t\t$this->BuildSearchSql($sWhere, $this->resultado, $Default, FALSE); // resultado\n\t\t$this->BuildSearchSql($sWhere, $this->resultadotamizaje, $Default, FALSE); // resultadotamizaje\n\t\t$this->BuildSearchSql($sWhere, $this->tapon, $Default, FALSE); // tapon\n\t\t$this->BuildSearchSql($sWhere, $this->tipo, $Default, FALSE); // tipo\n\t\t$this->BuildSearchSql($sWhere, $this->repetirprueba, $Default, FALSE); // repetirprueba\n\t\t$this->BuildSearchSql($sWhere, $this->observaciones, $Default, FALSE); // observaciones\n\t\t$this->BuildSearchSql($sWhere, $this->id_apoderado, $Default, FALSE); // id_apoderado\n\t\t$this->BuildSearchSql($sWhere, $this->id_referencia, $Default, FALSE); // id_referencia\n\n\t\t// Set up search parm\n\t\tif (!$Default && $sWhere <> \"\" && in_array($this->Command, array(\"\", \"reset\", \"resetall\"))) {\n\t\t\t$this->Command = \"search\";\n\t\t}\n\t\tif (!$Default && $this->Command == \"search\") {\n\t\t\t$this->id->AdvancedSearch->Save(); // id\n\t\t\t$this->id_actividad->AdvancedSearch->Save(); // id_actividad\n\t\t\t$this->apellidopaterno->AdvancedSearch->Save(); // apellidopaterno\n\t\t\t$this->apellidomaterno->AdvancedSearch->Save(); // apellidomaterno\n\t\t\t$this->nombre->AdvancedSearch->Save(); // nombre\n\t\t\t$this->nrodiscapacidad->AdvancedSearch->Save(); // nrodiscapacidad\n\t\t\t$this->ci->AdvancedSearch->Save(); // ci\n\t\t\t$this->fecha_nacimiento->AdvancedSearch->Save(); // fecha_nacimiento\n\t\t\t$this->sexo->AdvancedSearch->Save(); // sexo\n\t\t\t$this->nivelestudio->AdvancedSearch->Save(); // nivelestudio\n\t\t\t$this->id_discapacidad->AdvancedSearch->Save(); // id_discapacidad\n\t\t\t$this->id_tipodiscapacidad->AdvancedSearch->Save(); // id_tipodiscapacidad\n\t\t\t$this->resultado->AdvancedSearch->Save(); // resultado\n\t\t\t$this->resultadotamizaje->AdvancedSearch->Save(); // resultadotamizaje\n\t\t\t$this->tapon->AdvancedSearch->Save(); // tapon\n\t\t\t$this->tipo->AdvancedSearch->Save(); // tipo\n\t\t\t$this->repetirprueba->AdvancedSearch->Save(); // repetirprueba\n\t\t\t$this->observaciones->AdvancedSearch->Save(); // observaciones\n\t\t\t$this->id_apoderado->AdvancedSearch->Save(); // id_apoderado\n\t\t\t$this->id_referencia->AdvancedSearch->Save(); // id_referencia\n\t\t}\n\t\treturn $sWhere;\n\t}", "public function initOrderQueryOption($default=NULL)\r\n {\r\n if($order= $this->getOrderByFromCookie()) {\r\n $this->query_options['order_by']= $order;\r\n }\r\n else if($default) {\r\n $this->query_options['order_by']= $default;\r\n }\r\n }", "public function setDefaultQuery()\n {\n $this->defaultQuery = http_build_query([\n 'limit' => $this->limit,\n 'entity' => self::ENTITY,\n 'media' => self::MEDIA\n ]);\n }", "function select($condition) {\n $this->select = $condition;\n return $this; \n }", "function &getDefaultCriteria($start,$limit)\r\n\t{\r\n\t\t// このメソッドがフィルタがデフォルトで持っているソート条件などを返すようにします\r\n\r\n\t\t$criteria = parent::getDefaultCriteria($start,$limit);\r\n\t\t$criteria->setSort('cid');\r\n\r\n\t\treturn $criteria;\r\n\t}", "public function check_default($select)\r\n\t{\r\n\t\treturn $select == '0' ? FALSE : TRUE;\r\n }", "public function applyCondition($sql,$condition)\n\t{\n\t\tif($condition!='')\n\t\t\treturn $sql.' WHERE '.$condition;\n\t\telse\n\t\t\treturn $sql;\n\t}", "protected function initializeDatabaseQueryRestrictions()\n {\n // $this->whereClause is used only to select templates from sys_template.\n // $GLOBALS['SIM_ACCESS_TIME'] is used so that we're able to simulate a later time as a test...\n $this->whereClause = 'AND deleted=0 ';\n if (!$this->getTypoScriptFrontendController()->showHiddenRecords) {\n $this->whereClause .= 'AND hidden=0 ';\n }\n $this->whereClause .= 'AND (starttime<=' . $GLOBALS['SIM_ACCESS_TIME'] . ') AND (endtime=0 OR endtime>' . $GLOBALS['SIM_ACCESS_TIME'] . ')';\n\n // set up the query builder restrictions\n $this->queryBuilderRestrictions = GeneralUtility::makeInstance(DefaultRestrictionContainer::class);\n\n if ($this->getTypoScriptFrontendController()->showHiddenRecords) {\n $this->queryBuilderRestrictions\n ->removeByType(HiddenRestriction::class);\n }\n }", "public function customCondition()\n {\n // no action\n }" ]
[ "0.64148617", "0.6265464", "0.6257231", "0.614976", "0.60604906", "0.60205984", "0.60080636", "0.59251326", "0.5914634", "0.5770801", "0.57522094", "0.5723872", "0.5722333", "0.56859595", "0.5680192", "0.5671944", "0.5661823", "0.5657526", "0.5655896", "0.56456614", "0.56121516", "0.55963814", "0.558967", "0.5563885", "0.55595434", "0.5542876", "0.5541801", "0.55345833", "0.5521285", "0.5487047" ]
0.6887658
0
/ Permanently delete data by using `IN` clause $param array assoc array with two indexes 'key' and 'values' $return int No of effected records in db
public function delete_in($where = array()) { if(count($where) < 1) return false; $response = false; $is_condition_set = false; $key = (array_key_exists('key', $where) && isset($where['key']) ? $where['key'] : ''); $values = (array_key_exists('values', $where) && isset($where['values']) ? $where['values'] : ''); if(in_array($key, $this->columns) && isset($values)) { $this->db->where_in("$this->table.$key", $values); $is_condition_set = true; } if($is_condition_set) { if($this->db->delete($this->table)) $response = $this->db->affected_rows(); } return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function delete($tableName,$params){\n\t\t$values=array();\n\t\t$columns=array();\n\t\t\n\t\t$query = \"DELETE FROM $tableName WHERE \";\n\t\t$ctr=0;\n\t\t$counter = count($params)-1;\t\t\n\t\t\n\t\t$where = \"\";\n\t\tforeach($params as $datas){\n\t\t\t\n\t\t\tif($where !=\"\"){\n\t\t\t\t$where+=\" OR \";\n\t\t\t}\n\t\t\t$and = \"\";\n\t\t\tif(is_array($datas)){\n\t\t\t\t\n\t\t\t\tforeach($datas as $key=>$newDatas){\n\t\t\t\t\t\n\t\t\t\t\tif(is_array($newDatas)){\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(isset($newDatas[$key]['not'])){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(is_array($newDatas[$key]['not'])){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($and == \"\"){\n\t\t\t\t\t\t\t\t\t$and = \" \".$key.\" not in(\".implode(\",\",$newDatas[$key]['not']).\") \";\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$and = \" AND \".$key.\" in(\".implode(\",\",$newDatas[$key]['not']).\") \";\n\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}else{\n\t\t\t\t\t\t\t\tif($and == \"\"){\n\t\t\t\t\t\t\t\t\t$and = \" \".$key.\" in(\".implode(\",\",$newDatas[$key]['equal']).\") \";\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t$and = \" AND \".$key.\" in(\".implode(\",\",$newDatas[$key]['equal']).\") \";\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\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif($and == \"\"){\n\t\t\t\t\t\t\t$and = \" \".$key.\"=\".$newDatas;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$and = \" AND \".$key.\"=\".$newDatas;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t$where+=$and;\n\t\t}\n\t\t\n\t\t$query+=$where;\n\t\t\t\n\t\tif($conn->query($query) === TRUE){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t\t\n\t}", "function delete(){\r\n\t# DELETE */ column1, column2, column3, .... FROM tablename WHERE condition.\r\n\t\tfor ($i = 0; $i < func_num_args(); $i++) {\r\n\t\t #printf(\"Argument %d: %s\\n\", $i, func_get_arg($i));\r\n\t\t $param[$i]=func_get_arg($i);\r\n\t\t \r\n\t\t}\r\n\t\ttry {\r\n\t\t\t\t$param_len = count($param) ;\r\n\t\t\t\tif ( $param_len < 2 ) {\r\n\t\t\t\t\techo \"Insufficient Arguments!<br>\"; \r\n\t\t\t\t} elseif ($param_len == 2) {\r\n\t\t\t\t\t# code...\r\n\t\t\t\t\t$table_name = $param[0];\r\n\t\t\t\t\t$data = $param[1];\r\n\t\t\t\t\t$condition = \"\";\r\n\t\t\t\t\t//echo \"<br> select query with 2 param\";\t\t\t\r\n\t\t\t\t\trun_delete_query($table_name, $data, $condition);\t\t\r\n\r\n\t\t\t\t} elseif ($param_len == 3) {\r\n\t\t\t\t\t# code...\r\n\t\t\t\t\t$table_name = $param[0];\r\n\t\t\t\t\t$data = $param[1];\r\n\t\t\t\t\t$condition = $param[2] ;\r\n\t\t\t\t\t//echo \" <br> select query with 3 param\";\r\n\t\t\t\t\trun_delete_query($table_name, $data, $condition);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t} catch (Exception $e) {\r\n\t\t\t\t\treturn $e; \t\r\n\t\t\t\t}\r\n\t}", "function deleteQuery($table, $fields = [], $criteria = [], $placeHolders = [], $values = []){\n\n\t\t$length = count($values); // store the array length\t\t\n\n\t\t$criteriaString = ''; // store the crieria in a string\n\t\tfor ($i=0; $i < $length ; $i++) { // loop through the placeholders and criteria\n\t\t\t$criteriaString .= $criteria[$i] . ' = ' .$placeHolders[$i] . ' AND '; // criteria string\n\t\t}\n\t\t$criteriaString = rtrim($criteriaString, ' AND '); // remove trailing ' AND'\n\n\t\t$con = connectDB(); // connect to database\n\n\t\t// check value of limit to determine select statement to run\n\n\t\t$query = \"DELETE FROM {$table} WHERE {$criteriaString}\"; // preliminary query\t\t\n\t\t$stmt = $con->prepare($query); // prepare query\n\n\t\tfor ($i=0; $i < $length ; $i++) { \n\t\t\t$stmt->bindParam($placeHolders[$i], $values[$i]); // bind parameter\n\t\t}\n\n\t\t$stmt->execute(); // execute array\n\t\t$result = $stmt->rowCount(); // return 1 if row affected\n\n\t\t$con = null; // end connection\n\t\treturn $result;\t\n\t}", "public function deleteCond() {\n $where = func_get_args();\n $where = $this->trigger('beforeDeleteCallbacks', $where);\n $this->setWhereValues($where);\n $this->getQueryBuilder()->from($this->table); \n $result = $this->deleteRecords();\n $this->trigger('afterDeleteCallbacks', $result);\n return $result;\n }", "function dbRemoveEntries($filterParams, $table, $limit = null)\n{\n $sql = \"DELETE FROM $table \";\n\n $first = true;\n foreach($filterParams as $paramName => $paramValue){\n if ($first){ // start off qualifiers\n if ($paramValue != null){\n\t$sql .= \"WHERE $paramName = :$paramName \";\n } else {\n\t$sql .= \"WHERE $paramName is NULL \";\n }\n $first = false;\n }\n else { // subsequent qualifiers\n if ($paramValue != null){\n\t$sql .= \"AND $paramName = :$paramName \";\n } else {\n\t$sql .= \"AND $paramName is NULL \";\n }\n }\n $proxyFields[\":\" . $paramName] = $paramValue;\n }\n\n if ($limit != null){\n $sql .= \"LIMIT $limit\";\n }\n\n $result = db_query($sql, $proxyFields);\n\n return ($result != false);\n}", "function delete() \n\t{\n\t\t$strquery=\"DELETE FROM \".DB_PREFIX.\"field_condition WHERE field_condition_id in(\".$this->checkedids.\")\";\n\t\treturn mysql_query($strquery) or die(mysql_error());\n\t}", "function del($data = array(),$type = true)\n {\n\n $sql = \" DELETE FROM \".$this->table.\" WHERE \";\n\n /**\n * 判断是否存入主键参数\n */\n $sqlindex = '';\n if($data !=[]){\n $this->INDEX_PRI;\n $sqlindex = $this->INDEX_PRI.' IN ( ';\n foreach ($data as $k=>$v){\n $this->execute_bindValue[':del'.$k] = $v;\n $sqlindex .= ':del'.$k.',';\n }\n $sqlindex = rtrim($sqlindex,',');\n $sqlindex .= ') ';\n }\n /**\n * 拼接where\n */\n\n if($this->wheresql != ''){\n /**\n * 有 where条件\n */\n $this->sql = $sql.' '.$this->wheresql.' '.($sqlindex===''?'':' AND '.$sqlindex);\n\n }else{\n /**\n * 没有where sql\n */\n $this->sql = $sql.' ( '.$sqlindex.' ) ';\n }\n return $this->constructorSendUpdate();\n\n }", "function XoaDuLieu($data,$table,$where,$query=\"\") \n { \n if($query!=\"\")\n {\n $this->db->query($query);\n }else{\n for($i=0;$i<count($data);$i++)\n {\n $this->db->delete($table, array(\"$where\" => $data[$i]));\n }\n }\n }", "public function delete_batch()\n\t {\n\t\t \n\t\t \t$ids\t= ee()->input->post('delete');\n\t\t \n\t\t \t$delete_options\t= ee()->db->where_in('entry_id',$ids)->delete(ee()->shared->index_table);\n\t\t \t//$delete_idices\t\t= ee()->db->where_in('entry_id',$ids)->delete(ee()->shared->index_table);\n\t\t \n\t\t return TRUE;\n\t }", "public function delete(array $data) {\n $idcol = $this->tablename . \"_id\";\n $val = $data[$idcol];\n return $this->db->exec(\"DELETE FROM \".($this->tablename).\" WHERE `$idcol`=$val\");\n }", "public function delete($table,$where_colum_list,$where_value_list,$type_string){\n $where_colum_string='';\n $where_value_string='';\n ##組成where字串\n foreach($where_colum_list as $where_colum){\n $where_colum_string.=$where_colum.',';\n }\n foreach($where_value_list as $where_value){\n $where_value_string.='?,';\n }\n ##去逗號\n $where_colum_string=substr($where_colum_string,0,strlen($where_colum_string)-1);\n $where_value_string=substr($where_value_string,0,strlen($where_value_string)-1);\n $sql=\"delete from $table where ($where_colum_string) = ($where_value_string)\";\n // echo $sql;\n $pre=$this->mysqli->prepare($sql);\n $pre->bind_param($type_string,...$where_value_list);\n $pre->execute();\n return $pre->affected_rows;\n }", "function zen_db_delete($table, $parameters) {\r\n global $db;\r\n\r\n $db->Execute('delete from ' . $table . ' where ' . $parameters);\r\n\r\n return mysql_affected_rows();\r\n}", "function delete_list($item_kit_ids)\n\t{\n\t\t$this->db->where_in('item_kit_id',$item_kit_ids);\n\t\treturn $this->db->update('item_kits', array('deleted' => 1));\n \t}", "function delete($tbl,$cond='',$limit='',$drop=false){\r\n if(is_numeric($cond))$cond='rowid='.$cond;\r\n if($cond===true||$limit===true||$drop)return $this->drop($tbl);\r\n return @$this->query('DELETE FROM '.$tbl.($cond?' WHERE '.$cond:''));\r\n}", "function delete($table, $record) {\r\n\r\n $temp = array();\r\n\r\n foreach($record as $fieldName=>$field )\r\n {\r\n $tmpWhere[] = \" \" . $fieldName . \"=\" . $field;\r\n }\r\n $sql = \"delete from \" . $table . \" where \" . join(\" and \",$tmpWhere);\r\n {\r\n echo \"<hr>(\".$this->driver.\") $sql<hr>\";\r\n }\r\n return ($this->query($sql));\r\n\r\n }", "public function delete_by()\n {\n $where = func_get_args();\n $this->_set_where($where);\n\n // Run registered callbacks\n $data = $this->_run_before_callbacks('delete', array( $where ));\n\n $result = $this->{$this->_interface}->delete($this->_datasource);\n\n // Run registered callbacks\n $this->_run_after_callbacks('delete', array( $where, $result ));\n\n return $result;\n }", "function deleteride($k,$conn)\n{\n//[WHERE Clause]\n \n \n\n\t\n\t\n\t$sql=\"DELETE FROM `tbl_ride` WHERE `ride_id`= '$k'\";\n\t$result=$conn -> query($sql);\nreturn $sql;\n\n}", "public function deleteQuery($sql,$condition_arr1=null, $condition_arr2=null){\n $this->stmt = $this->dbh->prepare($sql);\n $condition_size=sizeof($condition_arr1);\n\n for ($i=0; $i <$condition_size; $i++) { \n // $this->stmt->bindParam($condition_arr1[$i], $condition_arr2[$i]);\n $this->stmt->bindParam($condition_arr1[$i], $condition_arr2[$i]);\n }\n\n $this->stmt->execute();\n return $this->stmt->rowCount();\n\n // return $this->stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function delete($what = array())\n\t{\n\t\t//delete by conditions\n\t\tif (( ! empty($what)) AND (is_array($what)))\n\t\t{\n\t\t\t//delete based on passed conditions\n\t\t\treturn $this->db->delete($this->table_name, $what);\n\t\t}\n\t\t//else delete current record\n\t\telseif (intval($this->data[$this->primary_key]) !== 0) \n\t\t{\n\t\t\t//if no conditions and data is loaded - delete current loaded data by ID\n\t\t\treturn $this->db->delete($this->table_name, array($this->primary_key => $this->data[$this->primary_key]));\n\t\t}\n\t}", "function deleteEns($id){\r\n\t\t//On met en forme la liste d'id pour la passer � la requ�te\r\n\t\t$inQuery = implode(',', array_fill(0, count($id), '?'));\r\n\t\t//Requ�te\r\n\t\t$bdd = connexionBase();\r\n\t\t$req = \"DELETE FROM enseignant WHERE num_ens IN (\".$inQuery.\")\";\r\n\t\t$result = $bdd->prepare($req);\r\n\t\tforeach ($id as $k => &$idDest){\r\n\t\t\t$result->bindParam($k+1, $idDest);//$k+1 car l'index commence � 1 pour bindParam\r\n\t\t}\r\n\t\t$result->execute();\r\n\t\t$count = $result->rowCount();\r\n\t\t$count = $count != 0 ? true : false;\r\n\t\treturn $count;\r\n\t}", "public function delete($sql,$params=[])\n\t{\n\t\t\treturn $this->rawQuery($sql,$params);\n\t}", "public function delete($val,$condition = false,$tbname = false){\n if(is_array($val)){\n $this->begin();\n $query = true;\n $result = '';\n foreach($val as $value){\n $rslt = $this->query($this->getSqlDelete($value,$condition,$tbname));\n if(!$rslt){\n $this->rollback();\n $query = false;\n }else\n $result = $rslt;\n }\n if($query){\n $this->commit();\n $query = $result;\n }else $query = false;\n }else{\n $sql = $this->getSqlDelete($val,$condition, $tbname);\n $query = $this->query($sql);\n }\n return $query;\n }", "function lingotek_keystore_delete_multiple($entity_type, $entity_ids, $lingokey, $condition = '=') {\n if (!is_array($entity_ids)) {\n $entity_ids = array($entity_ids);\n }\n\n $query = db_select('lingotek_entity_metadata', 'l') // Make sure that the variable exists in the table for every input nid\n ->fields('l', array('entity_id'))\n ->condition('entity_type', $entity_type)\n ->condition('entity_id', $entity_ids, 'IN')\n ->condition('entity_key', $lingokey, $condition);\n $delete_nids = $query->execute()->fetchCol();\n\n if (!empty($delete_nids)) {\n $delete = db_delete('lingotek_entity_metadata') // delete for every input nid where the variable exists\n ->condition('entity_type', $entity_type)\n ->condition('entity_id', $delete_nids, 'IN')\n ->condition('entity_key', $lingokey, $condition)\n ->execute();\n }\n}", "function delete_data($sel_ids,$id_field_name,$tbl_name)\n {\n\t\tif(is_array($sel_ids)){\n\t\t\t//Multiple Device Manufacturer Delete\n\t\t\tforeach($sel_ids as $selected_id)\n\t\t\t{\n\t\t\t\t\t$this->db->where($id_field_name,$selected_id);\n \t\t\t$this->db->delete($tbl_name);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Single Device Manufacturer Delete\n\t\t\t$this->db->where($id_field_name,$sel_ids);\n \t$this->db->delete($tbl_name);\n\t\t}\n\t\tif($this->db->affected_rows()>0)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}else{\n\t\t\treturn FALSE;\n\t\t}\n }", "public function check_delete_model($ids){\n \n if($this->db->where_in('id',$ids)->delete('email')){\n return true;\n }else{\n return false;\n }\n\n }", "function delete_list($item_ids)\n\t{\n\t\t$this->db->where_in('item_id',$item_ids);\n\t\treturn $this->db->update('items', array('deleted' => 1));\n \t}", "abstract public function delete(array $prm = array());", "function delete($table,$field, $id){\n global $con;\n $query=\"DELETE from {$table} where {$field}={$id}\";\n //prepare the query\n $stmt=$con->prepare($query);\n //execute the query\n $stmt->execute();\n //fetch all data\n if($stmt){\n return true;\n }\n else{\n return false;\n }\n }", "public function remove (){\n extract( $this->kernel->params );\n\n if( $id and preg_match('|^[\\d,]+$|', $id ) )\n $this->kernel->db->query(\"DELETE FROM {$this->table} WHERE id IN ($id)\");\n\n }", "public function delete($where,$table_name)\n{\n if(is_array($where)):\n $w = $this->convert_statement($where);\n $w = $w['where'] ;\n else:\n $w = $where;\n endif;\n return $this->query('DELETE FROM '.$table_name.' WHERE '.$w);\n}" ]
[ "0.6819342", "0.67607045", "0.6737224", "0.6712544", "0.6701263", "0.65999717", "0.65727276", "0.65122277", "0.6496109", "0.6425551", "0.6424496", "0.6380503", "0.63624257", "0.6356007", "0.6318343", "0.6276413", "0.62708104", "0.6269994", "0.6261424", "0.6202954", "0.61555326", "0.6152638", "0.6146596", "0.61371464", "0.61331064", "0.6125703", "0.6117978", "0.6117279", "0.6115853", "0.6112698" ]
0.67672175
1
Route notifications for the FCM channel.
public function routeNotificationForFcm() { return $this->devices()->where('is_login', '1')->pluck('reg_id')->toArray() ?: 'user123'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function routeNotificationForFcm() {\n return $this->device_token;\n }", "public function routeNotificationForDiscord(): string\n {\n return 'https://discordapp.com/api/webhooks/12345/super-secret';\n }", "public function routeNotificationFor($driver, $notification = null);", "function fcm($to,$data) {\n $apiKey = '';\n $fields = array('to' =>$to,'notification'=>$data);\n $headers = array('Authorization: key='.$apiKey,'Content-Type: application/json');\n \n $ch = curl_init();\n $url = 'http://fcm.googleapis.com/fcm/send';\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \\GuzzleHttp\\json_encode($fields));\n $result = curl_exec($ch);\n curl_close($ch);\n return json_decode($result,true);\n }", "public function push()\n\t{\t\t\n\t\ttry {\n\t\t\t$input = Input::all();\t\t\t\n\t\t\t$user = $this->user->findNonDeleted($input['to']);\n\t\t\t\n\t\t\tif(is_null($user)){\n\t\t\t return response()->json([\n\t\t\t\t\t'result' => 'error',\n\t\t\t\t\t'alerts' => 'Unknown destination.'\n\t\t\t\t], 400);\t\n\t\t\t}\n\t\t\tif(!isset($user->firebase_token)){\n\t\t\t return response()->json([\n\t\t\t\t\t'result' => 'error',\n\t\t\t\t\t'alerts' => 'Destination not ready to receive notification.'\n\t\t\t\t], 400);\n\t\t\t}\n\n\t\t\t$firebase_payload = $input;\n\t\t\t$firebase_payload['to'] = $user->firebase_token;\n\n\t\t\t//Triger Firebase to send notif to CFP using GuzzleHttp.\t\t\t\n\t\t\t$resp = sendPushNotifViaFCM($firebase_payload);\n\n return response()->json([\n\t\t\t\t'result' => 'success',\n\t\t\t\t'data' => $resp\n\t\t\t]);\n } catch (Exception $e) {\n return response()->json([\n\t\t\t\t\t'result' => 'error',\n\t\t\t\t\t'alerts' => $e->getMessage()\n\t\t\t],400);\n }\n\t}", "function send_notification($fcmtoken, $payload){ \n $ci =& get_instance();\n \n //log_event(json_encode($msg), $this->notify_log_file); //create log of notifcation\n $fields = array(\n 'registration_ids' => $fcmtoken, //firebase token array\n 'data' => $payload , //msg for andriod\n 'notification' => $payload //msg for ios\n );\n\n $headers = array(\n 'Authorization: key=' .FCM_KEY, //firebase API key\n 'Content-Type: application/json'\n );\n\n \n //curl request\n $ch = curl_init();\n curl_setopt( $ch, CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send' ); //firebase end url\n //curl_setopt( $ch,CURLOPT_URL, 'https://android.googleapis.com/gcm/send' );\n curl_setopt( $ch,CURLOPT_POST, true );\n curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );\n curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );\n curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );\n curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) );\n $result = curl_exec($ch );\n curl_close( $ch );\n // log_event($result, $this->notify_log_file); //create log of notifcation\n return $result;\n }", "public function routeNotificationForSlack()\n {\n if ($this->send_slack_messages) {\n return $this->slack_webhook_url;\n }\n }", "public function handle()\n {\n $notification = \\App\\Notification::where('send' , false)->where('sendDate' ,'<=', \\Carbon\\Carbon::now())->first();\n if ($notification) {\n foreach (\\App\\Token::get() as $token) {\n $tokens[] = $token->token;\n }\n $url = 'https://fcm.googleapis.com/fcm/send';\n $fields = array(\n 'registration_ids' => $tokens,\n 'notification' => array(\n \"body\" => $notification->body,\n \"title\" => $notification->title,\n \"icon\" => \"http://185.97.116.88/images/Asset.png\",\n \"sound\" => \"default\"\n ),\n \"android\" => array(\n \"ttl\"=>\"86400s\",\n \"notification\" => array(\n \"click_action\"=> $notification->link\n )\n ),\n 'data' => array(\n 'contents' => $notification->link\n )\n );\n $fields = json_encode($fields);\n $apiKey = 'AAAADz-MHLI=>APA91bEPHiHSksv1RM6SS0cVqthasozs3E_0BLNiFp95viZ4PwYwMNa9mVwNYHksdyOKX5T_w6M9oGnoGCEODoNYu8--D9vuWW27zfp0sQgSG_VULoa95ZBrinmLddwdDLocqQsT8JKQ';\n $headers = array(\n 'Authorization: key=' . $apiKey,\n 'Content-Type: application/json'\n );\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);\n \n $result = curl_exec($ch);\n curl_close($ch);\n $notification->update([\n 'send' => true\n ]); \n }\n else {\n return 'notification does not exists';\n }\n }", "function send_fcm_message_vender_new_integrate($user_id,$msg,$title='',$image_url='',$action='',$action_destination= '',$topic = '')\n {\n // get user id\n $check = $this->CI->custom_model->my_where('admin_users','*',array('id'=>$user_id,'fcm_no!=' => ''));\n\n // echo \"<pre>\";\n // print_r($check);\n // die;\n\n if(isset($title))\n {\n $notification = new Firebase_driver();\n\n $title = $title;\n $message = isset($msg)?$msg:'';\n $imageUrl = isset($image_url)?$image_url:'';\n $action = isset($action)?$action:'';\n \n $actionDestination = isset($_POST['action_destination'])?$_POST['action_destination']:'';\n\n if($actionDestination ==''){\n $action = '';\n }\n\n $notification->setTitle($title);\n $notification->setMessage($message);\n $notification->setImage($imageUrl);\n $notification->setAction($action);\n $notification->setActionDestination($actionDestination);\n \n $firebase_token = @$check[0]['fcm_no'];\n\n $firebase_api = \"AAAAZHYEess:APA91bH4LsxgmC1eSBz8-YQ2SpweLx6JN-Hn7WU1bU2gyzLJj8htSAvqbf8_530SVZHk2jhV4Of7RwcTZKXylH4JdD6RGfFomTbQYlqxv--NCMiH22kvwKdbTJMJMhl4NEV0H3eEfx21\";\n \n $topic = $topic;\n \n $requestData = $notification->getNotificatin();\n \n if(!empty($topic)){\n $fields = array(\n 'to' => '/topics/' . $topic,\n 'data' => $requestData,\n );\n \n }else{\n \n $fields = array(\n 'to' => $firebase_token,\n 'data' => $requestData,\n );\n }\n\n\n // Set POST variables\n $url = 'https://fcm.googleapis.com/fcm/send';\n\n $headers = array(\n 'Authorization: key=' . $firebase_api,\n 'Content-Type: application/json'\n );\n \n // Open connection\n $ch = curl_init();\n\n // Set the url, number of POST vars, POST data\n curl_setopt($ch, CURLOPT_URL, $url);\n\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n // Disabling SSL Certificate support temporarily\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));\n\n // Execute post\n $result = curl_exec($ch);\n if($result === FALSE){\n die('Curl failed: ' . curl_error($ch));\n }\n\n // Close connection\n curl_close($ch);\n \n // echo '<h2>Result</h2><hr/><h3>Request </h3><p><pre>';\n // echo json_encode($fields,JSON_PRETTY_PRINT);\n // echo '</pre></p><h3>Response </h3><p><pre>';\n // echo $result;\n // echo '</pre></p>';\n // die;\n }\n }", "function send_fcm_message_driver_new_integrate($user_id,$msg,$title='',$image_url='',$action='',$action_destination= '',$topic = '')\n {\n // get user id\n $check = $this->CI->custom_model->my_where('admin_users','*',array('id'=>$user_id,'fcm_no!=' => ''));\n\n // echo \"<pre>\";\n // print_r($check);\n // die;\n\n if(isset($title))\n {\n $notification = new Firebase_driver();\n\n $title = $title;\n $message = isset($msg)?$msg:'';\n $imageUrl = isset($image_url)?$image_url:'';\n $action = isset($action)?$action:'';\n \n $actionDestination = isset($_POST['action_destination'])?$_POST['action_destination']:'';\n\n if($actionDestination ==''){\n $action = '';\n }\n\n $notification->setTitle($title);\n $notification->setMessage($message);\n $notification->setImage($imageUrl);\n $notification->setAction($action);\n $notification->setActionDestination($actionDestination);\n \n $firebase_token = @$check[0]['fcm_no'];\n\n $firebase_api = \"AAAAZHYEess:APA91bH4LsxgmC1eSBz8-YQ2SpweLx6JN-Hn7WU1bU2gyzLJj8htSAvqbf8_530SVZHk2jhV4Of7RwcTZKXylH4JdD6RGfFomTbQYlqxv--NCMiH22kvwKdbTJMJMhl4NEV0H3eEfx21\";\n \n $topic = $topic;\n \n $requestData = $notification->getNotificatin();\n \n if(!empty($topic)){\n $fields = array(\n 'to' => '/topics/' . $topic,\n 'data' => $requestData,\n );\n \n }else{\n \n $fields = array(\n 'to' => $firebase_token,\n 'data' => $requestData,\n );\n }\n\n\n // Set POST variables\n $url = 'https://fcm.googleapis.com/fcm/send';\n\n $headers = array(\n 'Authorization: key=' . $firebase_api,\n 'Content-Type: application/json'\n );\n \n // Open connection\n $ch = curl_init();\n\n // Set the url, number of POST vars, POST data\n curl_setopt($ch, CURLOPT_URL, $url);\n\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n // Disabling SSL Certificate support temporarily\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));\n\n // Execute post\n $result = curl_exec($ch);\n if($result === FALSE){\n die('Curl failed: ' . curl_error($ch));\n }\n\n // Close connection\n curl_close($ch);\n \n // echo '<h2>Result</h2><hr/><h3>Request </h3><p><pre>';\n // echo json_encode($fields,JSON_PRETTY_PRINT);\n // echo '</pre></p><h3>Response </h3><p><pre>';\n // echo $result;\n // echo '</pre></p>';\n // die;\n }\n }", "public static function fcm($to, $notification=null, $data=null, $settings=null)\n {\n $bodydata = array();\n\n if (is_numeric($to)) { // a user id\n $row = db::link()->select($GLOBALS['_notify_config']['fcm_devices_table'], [\n $GLOBALS['_notify_config']['fcm_user_token_field']\n ], [\n $GLOBALS['_notify_config']['fcm_user_id_field'] => $to\n ]);\n if (isset($row[0])) {\n $to = $row[0][$GLOBALS['_notify_config']['fcm_user_token_field']];\n } else {\n $to = 'N/A';\n }\n } else if (is_array($to)) {\n $bodydata['registration_ids'] = $to;\n } else {\n $bodydata['to'] = $to;\n }\n\n if (isset($notification)) $bodydata['notification'] = $notification;\n if (isset($data)) $bodydata['data'] = $data;\n if (isset($settings)) {\n foreach ($settings as $key => $value) {\n $bodydata[$key] = $value;\n }\n }\n\n $bodydata = json_encode($bodydata);\n\n $server_key = '';\n if (isset($GLOBALS['_notify_config']['fcm_server_key'])) {\n $server_key = $GLOBALS['_notify_config']['fcm_server_key'];\n } else {\n $server_key = $GLOBALS['_notify_config']['FCM_ACCESS_KEY'];\n }\n $headers = array(\n 'Content-Type: application/json',\n 'Authorization: key='. $server_key\n );\n\n return load::location('http://fcm.googleapis.com/fcm/send', $bodydata, $headers);\n }", "public function via($notifiable)\n {\n return [FcmChannel::class];\n }", "public function via($notifiable)\n {\n $fcmToken = $notifiable->routeNotificationFor('fcm');\n\n if ($fcmToken !== null) {\n return [FcmChannel::class];\n }\n\n return [];\n }", "protected function getActionLink()\n {\n return route(config('health.routes.notification'));\n }", "public function send_a_notification_by_topic_in_fcm()\n {\n $this->mockPushNotification = Mockery::mock(PushNotification::class, ['fcm'])->makePartial()->shouldAllowMockingProtectedMethods();\n $response = $this->mockPushNotification->setMessage(['message' => 'Hello World'])\n ->setApiKey('asdfasdffasdfasdfasdf')\n ->setConfig(['dry_run' => false])\n ->sendByTopic('test')\n ->getFeedback();\n $this->assertInstanceOf('stdClass', $response);\n }", "public function broadcastOn()\n {\n //prefix laravel_database_message\n return new Channel('message');\n }", "public function sendNotifications()\n {\n $token = $this->getConfigValue('token');\n $client = new Client($token);\n\n foreach ($this->notifications as $notification) {\n $options = [\n 'as_user' => true,\n 'channel' => $notification['channel'],\n 'text' => $notification['message'],\n ];\n\n $client->postMessage($options);\n }\n }", "function send_notification($registatoin_ids, $message) {\r\n\r\n // Set POST variables\r\n $url = 'https://fcm.googleapis.com/fcm/send';\r\n\r\n $fields = array(\r\n 'registration_ids' => $registatoin_ids,\r\n 'data' => $message,\r\n );\r\n\r\n $headers = array(\r\n 'Authorization: key= AIzaSyBf-Qpd3MQc2X9Xi_EankK5NBnkudH0PCA',\r\n 'Content-Type: application/json'\r\n );\r\n // Open connection\r\n $ch = curl_init();\r\n\r\n // Set the url, number of POST vars, POST data\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n\r\n curl_setopt($ch, CURLOPT_POST, true);\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n\r\n // Disabling SSL Certificate support temporarly\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\r\n\r\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));\r\n\r\n // Execute post\r\n $result = curl_exec($ch);\r\n if ($result === FALSE) {\r\n//\t\tdie('Curl failed: ' . curl_error($ch));\r\n } else {\r\n echo 'send' . $result;\r\n }\r\n\r\n // Close connection\r\n curl_close($ch);\r\n\r\n //echo $result;\r\n }", "public function send($notifiable, Notification $notification)\n {\n // Get the token/s from the model\n if (! $notifiable->routeNotificationFor('fcm')) {\n return;\n }\n $tokens = (array) $notifiable->routeNotificationFor('fcm');\n\n if (empty($tokens)) {\n return;\n }\n\n // Get the message from the notification class\n $fcmMessage = $notification->toFcm($notifiable);\n\n if (empty($fcmMessage)) {\n return;\n }\n\n if (count($tokens) == 1) {\n // Do not use multicast if there is only one recipient\n $fcmMessage->setTo($tokens[0]);\n $this->sendToFcm($fcmMessage);\n } else {\n // Use multicast because there are multiple recipients\n $partialTokens = array_chunk($tokens, self::MAX_TOKEN_PER_REQUEST, false);\n foreach ($partialTokens as $tokens) {\n $fcmMessage->setRegistrationIds($tokens);\n $this->sendToFcm($fcmMessage);\n }\n }\n }", "function send_fcm_message_user_new_integrate($user_id,$msg,$title='',$image_url='',$action='',$action_destination= '',$topic = '')\n {\n // get user id\n $check = $this->CI->custom_model->my_where('users','*',array('id'=>$user_id,'fcm_no!=' => ''));\n\n // echo \"<pre>\";\n // print_r($user_id);\n // print_r($check);\n // die;\n\n if(isset($title))\n {\n $notification = new Firebase_user();\n\n $title = $title;\n $message = isset($msg)?$msg:'';\n $imageUrl = isset($image_url)?$image_url:'';\n $action = isset($action)?$action:'';\n \n $actionDestination = isset($_POST['action_destination'])?$_POST['action_destination']:'';\n\n if($actionDestination ==''){\n $action = '';\n }\n\n $notification->setTitle($title);\n $notification->setMessage($message);\n $notification->setImage($imageUrl);\n $notification->setAction($action);\n $notification->setActionDestination($actionDestination);\n \n $firebase_token = @$check[0]['fcm_no'];\n\n $firebase_api = \"AAAAEeD-tKE:APA91bE48jhgB1t590jy5gja193BVWPHBt1oUvCCG6i3qDJiaXAdlGcvFMTcSCtYqYJSaA7uiEsqockYSUDxmEgeinZl9cPlI9GjITcgrf63TZ3WLYYVlXFYmpK_t9XOfQHtc6tFEoYi\";\n \n $topic = $topic;\n \n $requestData = $notification->getNotificatin();\n \n if(!empty($topic)){\n $fields = array(\n 'to' => '/topics/' . $topic,\n 'data' => $requestData,\n );\n \n }else{\n\n\n $source = @$check[0]['source'];\n\n if ($source == 'android') \n {\n $fields = array(\n 'to' => $firebase_token,\n 'data' => $requestData,\n );\n }\n else\n {\n $fields = array(\n 'to' => $firebase_token,\n 'data' => $requestData,\n );\n } \n \n }\n\n\n // Set POST variables\n $url = 'https://fcm.googleapis.com/fcm/send';\n\n $headers = array(\n 'Authorization: key=' . $firebase_api,\n 'Content-Type: application/json'\n );\n \n // Open connection\n $ch = curl_init();\n\n // Set the url, number of POST vars, POST data\n curl_setopt($ch, CURLOPT_URL, $url);\n\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n // Disabling SSL Certificate support temporarily\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));\n\n // Execute post\n $result = curl_exec($ch);\n if($result === FALSE){\n die('Curl failed: ' . curl_error($ch));\n }\n\n // Close connection\n curl_close($ch);\n \n // echo '<h2>Result</h2><hr/><h3>Request </h3><p><pre>';\n // echo json_encode($fields,JSON_PRETTY_PRINT);\n // echo '</pre></p><h3>Response </h3><p><pre>';\n // echo $result;\n // echo '</pre></p>';\n // die;\n }\n }", "public function routeNotificationForMail($notification)\n {\n return [$this->EMAIL => $this->USER_NM];\n }", "static function sendNotification($title, $message, $id = 0) {\n define( 'API_ACCESS_KEY', 'AAAA3h7MrFc:APA91bE8cay1XJkaHfJgvY4_O-xupadoZPZOAIRLIVqGzvL_ZUOtBUYFa24dDqfwLZXbyBpQjbXU4LBEOeMVJt7vubdO_AsYkzHmb4omYGgA5iDwjVFgq2zUBUjSum5eKRL-BicJ05TO');\n //$id = ['dUy90D_3Lpg:APA91bE_2_cFFyB1oIQE46R6YKGGNZz12Pbl6mrPKWzuaDsZbaZe9ffBMm72SwmxIMth2r2DOQtL0EUw7_v1HRvl4YXIQVn_9t5Vdqij5brN_BZDoQCbC_r_mhc9egYj4cT2FaIBRZaS'];\n $registrationIds = [$id];\n $topic = $id;\n $url = 'https://fcm.googleapis.com/fcm/send';\n \n #prep the bundle\n $msg = [\n 'body' \t=> $message,\n 'title' => $title,\n ];\n\n $fields = [\n 'to' => '/topics/user-' . $topic,\n 'notification' => $msg\n ];\n \n $headers = [\n 'Authorization: key=' . API_ACCESS_KEY,\n 'Content-Type: application/json'\n ];\n\n #Send Reponse To FireBase Server\t\n $ch = curl_init();\n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch,CURLOPT_POST, true);\n curl_setopt($ch,CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch,CURLOPT_POSTFIELDS, json_encode($fields));\n\n $result = curl_exec($ch);\n\n curl_close($ch);\n\n if($result === false){\n echo 'Curl error: ' . curl_error($ch);\n }else{\n echo 'Notificacao enviada! - user:' . $topic;\n //echo \"RESULTADO<br>\";\n //echo $result;\n }\n }", "public function via($notifiable)\n {\n return ['broadcast', FcmChannel::class, ApnChannel::class];\n }", "public function notification($token, $body)\n {\n $fcmUrl = 'https://fcm.googleapis.com/fcm/send';\n $headers = [\n 'Authorization: key=AIzaSyCN7c7kBuH5sDAyaVVPKONAVGnkKx273jw',\n 'Content-Type: application/json'\n ];\n\n $notification = [\n 'title' => $body['title'],\n 'body' => $body['body'],\n 'color' => '#009cff',\n 'priority' => 'high',\n 'icon' => 'ic_launcher',\n 'show_in_foreground' => true,\n 'show_in_background' => true,\n ];\n\n // array_push($notification, ['notification' => $notification]);\n $fcmNotification = [\n 'registration_ids' => $token,\n // 'data' => $notification,\n 'notification' => $notification\n ];\n // array_push($fcmNotification, $notification);\n\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,$fcmUrl);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fcmNotification));\n $result = curl_exec($ch);\n curl_close($ch);\n\n return true;\n }", "function actionApn($data)\n{\n\t$api_access_key\t\t= 'AIzaSyCjnlqpmxulK6aJCxf7haLZFaweX_3c6h8';\n\t\n\t$registrationIds \t= $data['registrationIds'];\n\t$item_id\t\t\t= $data['item_id'];\n\t$notif_title\t\t= $data['notif_title'];\n\t$notif_message \t\t= $data['notif_message'];\n\n\t$path_to_firebase_cm = 'https://fcm.googleapis.com/fcm/send';\n\n\t$fields = array(\n\t\t'to' => $registrationIds,\n\t\t'notification' => array('title' => $notif_title, 'body' => $notif_message),\n\t\t'data' => array('item_id' => $item_id, 'notif_title' => $notif_title, 'notif_message' => $notif_message, 'alert' => $notif_title .\"\\n\\r\".$notif_message )\n\t);\n\n\t$headers = array(\n\t\t'Authorization:key=' . $api_access_key,\n\t\t'Content-Type:application/json'\n\t);\n\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $path_to_firebase_cm); \n\tcurl_setopt($ch, CURLOPT_POST, true);\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true); \n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\tcurl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 ); \n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));\n\t$result = curl_exec($ch);\n\tcurl_close($ch);\n\n\t/* echo '<pre>'; print($result); exit;*/\n\treturn $result;\n}", "public function routeNotificationForNexmo($notification)\n {\n return '8801726979426';\n }", "public function routeNotificationForMail()\n {\n return $this->email;\n }", "public function routeNotificationForMail()\n {\n return $this->email;\n }", "public function routeNotificationForMail()\n {\n return $this->email;\n }", "function push_notification_android($device_id, $title, $message){\n $url = 'https://fcm.googleapis.com/fcm/send';\n \n /*api_key available in:\n Firebase Console -> Project Settings -> CLOUD MESSAGING -> Server key*/ \n\t$api_key = 'xxxxxxxxxxxxxxxxxxx'; //Replace with yours\n\t\n\t$target = $device_id;\n\t\n\t$fields = array();\n\t$fields['priority'] = \"high\";\n\t$fields['notification'] = [ \"title\" => $title, \n\t\t\t\t \"body\" => $message, \n\t\t\t\t 'data' => ['message' => $message],\n\t\t\t\t \"sound\" => \"default\"];\n\tif (is_array($target)){\n\t $fields['registration_ids'] = $target;\n\t} else{\n\t $fields['to'] = $target;\n\t}\n \n //header includes Content type and api key\n $headers = array(\n 'Content-Type:application/json',\n 'Authorization:key='.$api_key\n );\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));\n $result = curl_exec($ch);\n if ($result === FALSE) {\n die('FCM Send Error: ' . curl_error($ch));\n }\n curl_close($ch);\n return $result;\n}" ]
[ "0.6867852", "0.61995447", "0.60422266", "0.6021525", "0.5855906", "0.5737734", "0.57277733", "0.57079554", "0.567157", "0.56105924", "0.55331665", "0.55039597", "0.5477149", "0.54681206", "0.54498136", "0.5369089", "0.5327482", "0.53123075", "0.5311088", "0.52603155", "0.5241452", "0.52133846", "0.5205581", "0.519768", "0.5190109", "0.51795244", "0.5169677", "0.5169677", "0.5169677", "0.51634645" ]
0.6309646
1
test registration failure with mismatched passwords
public function testBadRegisterPasswordMismatch() { $name = 'Bob'; $email = '[email protected]'; $password = 'password'; $badpass = 'passwdrd'; $this->visit('/') ->see('Register') ->click('Register') ->seePageIs('/register') ->type($name,'name') ->type($email,'email') ->type($password,'password') ->type($badpass,'password_confirmation') ->press('Register') ->seePageIs('/register'); # TODO make sure session is has right errors }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function shouldNotCreateUserIfPasswordMismatched(){\n\n // Missing email\n\n $faker = Faker::create();\n $parameters = [\n 'firstname' => $faker->firstname(),\n 'lastname' => $faker->lastname(),\n 'email' => $faker->email(),\n 'password' => 'mysecretlove',\n 'password_confirmation' => 'my.secret-love'\n ];\n\n $this->post('api/auth/register', $parameters, []);\n $this->seeStatusCode(422);\n $this->seeJson([\n \"password\" => [\n \"The password confirmation does not match.\"\n ]\n ]);\n }", "public function testIncorrectConfirmationPassword()\n {\n $this->visit('/register')\n ->type('blaa', 'name')\n ->type('[email protected]', 'email')\n ->type('secret1234', 'password')\n ->type('secret4321', 'password_confirmation')\n ->press('Register')\n ->see('The password confirmation does not match.');\n }", "public function shouldNotLoginWrongPassword(){\n $faker = Faker::create();\n $email = $faker->email();\n $password = 'mysecretlove';\n $reg_parameters = [\n 'firstname' => $faker->firstname(),\n 'lastname' => $faker->lastname(),\n 'email' => $email,\n 'password' => $password,\n 'password_confirmation' => $password\n ];\n $login_parameters = [\n 'email' => $email,\n 'password' => 'my-secret.love',\n ];\n\n $this->post('api/auth/register', $reg_parameters, []);\n $this->seeStatusCode(201);\n $this->post('api/auth/login', $login_parameters, []);\n $this->seeStatusCode(404);\n $this->seeJson([\n \"data\" => $email,\n \"message\" => \"incorrect login details.\"\n ]);\n }", "public function testRegistrationFail()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(new Register)\n ->within('form', function ($browser) {\n $browser->waitFor('@register-button')\n ->type('@name', $this->faker->name())\n ->type('@email', $this->faker->safeEmail())\n ->type('@password', 'password')\n ->type('@password_confirmation', 'drowssap')\n ->click('@register-button');\n })\n ->waitForText('Whoops! Something went wrong')\n ->assertSee('The password confirmation does not match');\n\n $browser->blank();\n });\n }", "public function testNewUserRegistrationValidation()\n {\n $this->visit('registrieren')\n ->type('max.', 'username')\n ->type('max.h.online', 'email')\n ->type('secretpw', 'password')\n ->type('wrongpw', 'password_confirmation')\n ->press('Registrieren');\n\n // expected validation error\n $this->see('<strong>Login</strong> ist nicht gültig.')\n ->see('<strong>E-Mail</strong> ist keine gültige E-Mail-Adresse.')\n ->see('<strong>Passwort</strong> und Passwort-Bestätigung müssen übereinstimmen.');\n }", "public function testNewPassword()\n {\n }", "public function testPasswordConfirmation(){\n\t\t$this->browse(function (Browser $browser) {\n\t\t\t$validationArray = $this->getValidationMessagesArray( 'register' );\n\n\t\t\t$password = Str::random( 7 );\n\t\t\t$password_confirmation = Str::random( 8 );\n\n\t\t\t$browser->visit( route( 'event-planner.register.show' ) )\n\t\t\t\t->type( 'password', $password )\n\t\t\t\t->type( 'password_confirmation', $password_confirmation )\n\t\t\t\t->assertSee( $validationArray[ 'password' ][ 'confirmed' ] )\n\t\t\t\t->press( 'Register' )\n\t\t\t\t->assertSee( $validationArray[ 'password' ][ 'confirmed' ] );\n\t\t\t$this->assertNull(User::first() );\n\t\t});\n\t}", "public function testPasswordCharacters(){\n\t\t$this->browse(function (Browser $browser) {\n\t\t\t$validationArray = $this->getValidationMessagesArray( 'register' );\n\n\t\t\t$password = 'password';\n\n\t\t\t$browser->visit( route( 'event-planner.register.show' ) )\n\t\t\t->type( 'password', $password )\n\t\t\t->type( 'password_confirmation', $password )\n\t\t\t->assertSee( $validationArray[ 'password' ][ 'regex' ] )\n\t\t\t->press( 'Register' )\n\t\t\t->assertSee( $validationArray[ 'password' ][ 'regex' ] );\n\t\t\t$this->assertNull(User::first() );\n\t\t});\n\t}", "public function testCorrectRegister()\n {\n $name = 'Bob';\n $email = '[email protected]';\n $password = 'password';\n $this->visit('/')\n ->see('Register')\n ->click('Register')\n ->seePageIs('/register')\n ->type($name,'name')\n ->type($email,'email')\n ->type($password,'password')\n ->type($password,'password_confirmation')\n ->press('Register')\n ->seePageIs('/verify')\n ->see($name);\n $u = User::where('email',$email)->first();\n $this->assertNotNull($u);\n $this->seeInDatabase('verification_tokens',[ 'user_id' => $u->user_id ]);\n }", "public function testRegister()\n {\n $response = $this->json('POST', '/' . config('app.api_version') . '/register', $this->data);\n $result = $response->getData();\n\n $user = $result->data;\n\n foreach ($this->data as $key => $value) {\n if ($key === 'password') {\n continue;\n }\n\n $this->assertEquals($value, $user->{$key});\n }\n }", "public function test_create_new_useraccount_password_confirmation_missing()\n {\n $response = $this->post('/api/v1/register',\n [\n \"name\" => \"Random name\",\n \"email\" => \"[email protected]\",\n \"password\" => \"password\"\n ],\n [\n \"Accept\" => \"application/json\"\n ]\n );\n\n $response->assertStatus(422);\n $response->assertJson(\n [\n 'errors' => [\n 'password' => [\n 'The password confirmation does not match.'\n ]\n ]\n ]\n );\n }", "public function testCheckPasswordNG() {\n\t\t$result = $this->User->checkPassword('1','abcdefgh'); //Wrong password\n\t\tdebug($result);\n\t\t// Password is not correct\n\t\t$expected = array();\n\t\n\t\t$this->assertEquals($expected, $result);\n\t}", "public function test_create_new_useraccount_password_missing()\n {\n $response = $this->post('/api/v1/register',\n [\n \"name\" => \"Random name\",\n \"email\" => \"[email protected]\",\n \"password_confirmation\" => \"password\"\n ],\n [\n \"Accept\" => \"application/json\"\n ]\n );\n\n $response->assertStatus(422);\n $response->assertJson(\n [\n 'errors' => [\n 'password' => [\n 'The password field is required.'\n ]\n ]\n ]\n );\n }", "public function testIsInvalidMismatchPassword() {\n\t\t$this->assertFalse($this->player->validate(array('password' => 'abc123456', 'password_confirmation' => 'abcasssss6')), 'Expected mismatched password to cause validation failure');\n\t\t$this->assertTrue($this->player->errors()->has('password'));\n\t\t$failures = $this->player->failures();\n\t\t$this->assertArrayHasKey('Confirmed', $failures['password']);\n\t}", "public function testRegisterReturnValidationFail()\n {\n \t$input = [\n \t\t'name' => 'qwedcvgh123luv98',\n 'email' => '[email protected]',\n 'password' => 'password',\n \t];\n \t$userRepository = new UserRepository();\n \t$userRepository->register($input);\n\n $this->assertFalse($userRepository->success);\n $this->assertTrue($userRepository->message === 'Validation Error.');\n }", "function test_user_gives_a_proper_hash_as_password(){\n\t\t$params = $this->params;\n\t\t$params[\"password\"] = '$2a$12$K9oI83nd6DHKaovZleAxcea3YbEuUmKZISehASGthpMzZweUqOhta'; // hash for secret\n\t\t$params[\"password_repeat\"] = '$2a$12$K9oI83nd6DHKaovZleAxcea3YbEuUmKZISehASGthpMzZweUqOhta';\n\t\t$controller = $this->client->post(\"users/create_new\",$params);\n\n\t\tif(defined(\"USER_REGISTRATION_ENABLED\") && !constant(\"USER_REGISTRATION_ENABLED\")){\n\t\t\t$this->assertEquals(404,$this->client->getStatusCode());\n\t\t\treturn;\n\t\t}\n\n\t\t$this->assertEquals(false,$controller->form->has_errors());\n\t\t$this->assertEquals(303,$this->client->getStatusCode()); // redirecting to $params[\"return_uri\"]...\n\t\t$this->assertContains('You have been successfully registered',(string)$controller->flash->success());\n\n\t\t$john = User::FindByLogin(\"john.doe.tester\");\n\t\t$this->assertNotEquals('$2a$12$K9oI83nd6DHKaovZleAxcea3YbEuUmKZISehASGthpMzZweUqOhta',$john->getPassword());\n\t\t$this->assertTrue(MyBlowfish::IsHash($john->getPassword()));\n\n\t\t$this->assertFalse($john->isPasswordCorrect(\"secret\"));\n\t\t$this->assertTrue($john->isPasswordCorrect('$2a$12$K9oI83nd6DHKaovZleAxcea3YbEuUmKZISehASGthpMzZweUqOhta'));\n\t}", "public function testValidateLoginPasswordIncorrect()\n {\n\n // Create a user.\n $this->__user();\n\n // Register with empty fields.\n $errors = $this->_usersTable->_validateLogin(\n 'username',\n 'incorrect');\n\n // Check for the error.\n $this->assertEquals(\n get_plugin_ini('NeatlineWebService', 'password_incorrect'),\n $errors['password']\n );\n\n }", "public function testAdminCreateUserPasswordError()\n {\n $crawler = $this->client->request('GET', '/users');\n\n $link = $crawler->selectLink('Créer un utilisateur')->link();\n $crawler = $this->client->click($link);\n\n $form = $crawler->selectButton('Ajouter')->form();\n $form['user[username]'] = 'usertest2';\n $form['user[password][first]'] = 'password';\n $form['user[password][second]'] = 'password2';\n $form['user[email]'] = '[email protected]';\n $form['user[roles]'][1]->tick();\n $crawler = $this->client->submit($form);\n\n static::assertEquals(200, $this->client->getResponse()->getStatusCode());\n static::assertEquals(1, $crawler->filter('html:contains(\"Les deux mots de passe doivent correspondre.\") ')->count());\n }", "public function testNormalPreset()\r\n {\r\n Yii::$app->user->passwordStrengthConfig = ['preset' => PasswordStrengthValidator::NORMAL];\r\n /* @var $form SignupForm */\r\n $form = Yii::createObject(Yii::$app->user->registerForm);\r\n $form->email = Commons::TEST_EMAIL;\r\n $form->password = 'nikolay';\r\n verify('Having only lower-case characters is not enough', $form->validate())->false();\r\n\r\n $errors = $form->getErrors('password');\r\n verify('There are errors on the password field', empty($errors))->false();\r\n verify('There are exactly three errors', count($errors))->equals(3);\r\n verify('An error for the upper-case exists', strpos($errors[0], 'upper'))->greaterThan(0);\r\n verify('An error for the digits exists', strpos($errors[1], 'digit'))->greaterThan(0);\r\n verify('An error for the special exists', strpos($errors[2], 'special'))->greaterThan(0);\r\n\r\n $form->password = 'Nikolay';\r\n verify('Having only lower and upper-case characters is not enough', $form->validate())->false();\r\n\r\n $errors = $form->getErrors('password');\r\n verify('There are errors on the password field', empty($errors))->false();\r\n verify('There are exactly two errors', count($errors))->equals(2);\r\n verify('An error for the digits exists', strpos($errors[0], 'digit'))->greaterThan(0);\r\n verify('An error for the special exists', strpos($errors[1], 'special'))->greaterThan(0);\r\n \r\n $form->password = 'Niko1ay';\r\n verify('Having only lower and upper-case characters, and a digit is not enough', $form->validate())->false();\r\n\r\n $errors = $form->getErrors('password');\r\n verify('There are errors on the password field', empty($errors))->false();\r\n verify('There is exactly one error', count($errors))->equals(1);\r\n verify('An error for the special exists', strpos($errors[0], 'special'))->greaterThan(0);\r\n\r\n // Adding a password that looks like an email\r\n $form->password = '[email protected]';\r\n verify('Having a password that looks like an email fails', $form->validate())->false();\r\n \r\n $errors = $form->getErrors('password');\r\n verify('There are errors on the password field', empty($errors))->false();\r\n verify('There is exactly one error', count($errors))->equals(1);\r\n verify('An error for the email exists', strpos($errors[0], 'email'))->greaterThan(0);\r\n \r\n $form->password = 'Nik@1ay';\r\n verify('This time everything works fine!', $form->validate())->true();\r\n }", "public function testIncorrectPasswordLength()\n {\n $this->visit('/register')\n ->type('blaa', 'name')\n ->type('[email protected]', 'email')\n ->type('secret', 'password')\n ->type('secret', 'password_confirmation')\n ->press('Register')\n ->see('The password must be at least 8 characters');\n }", "public function testPasswordWrong() {\n $user = $this->getToken($this);\n $response = $this->json('POST', '/auth/login', [\n 'id'=>$user['user']->id,\n 'password'=>Str::random(16)\n ]);\n $response->assertResponseStatus(401);\n }", "function verifyRegister() {\n $email = $_POST['email'];\n $password = $_POST['password'];\n $password2 = $_POST['password2'];\n\n //verifico datos ingresados\n if (empty($email) || empty($password) || empty($password2)) {\n $this->view->printFormRegister(\"Faltan datos obligatorios\");\n die();\n }\n\n //Verifica que no haya un usario con ese mail\n if ($this->model->getByEmail($email)) {\n $this->view->printFormRegister(\"El email ya está en uso\");\n die();\n }\n\n if ($password != $password2) {\n $this->view->printFormRegister(\"Las contraseñas ingresadas no coinciden\");\n die();\n }\n \n $this->registerUser($email, $password);\n }", "public function testVerifyPassword()\n {\n $this->assertEquals($this->user->verifyPassword(\"admin\", \"admin\"), true);\n }", "public function testAdminCreateAdminPasswordError()\n {\n $crawler = $this->client->request('GET', '/users');\n\n $link = $crawler->selectLink('Créer un utilisateur')->link();\n $crawler = $this->client->click($link);\n\n $form = $crawler->selectButton('Ajouter')->form();\n $form['user[username]'] = 'usertest2';\n $form['user[password][first]'] = 'password';\n $form['user[password][second]'] = 'password2';\n $form['user[email]'] = '[email protected]';\n $form['user[roles]'][1]->tick();\n $crawler = $this->client->submit($form);\n\n static::assertEquals(200, $this->client->getResponse()->getStatusCode());\n static::assertEquals(1, $crawler->filter('html:contains(\"Les deux mots de passe doivent correspondre.\") ')->count());\n }", "public function testCheckPasswordOK() {\n\t\t$result = $this->User->checkPassword('1','12345678');\n\t\tdebug($result);\n\t\t// Password is correct\n\t\t$expected = array('User' => array('id' => '1'));\n\t\n\t\t$this->assertEquals($expected, $result);\n\t}", "public function testRegisterReturnExceptionFail()\n {\n $userRepository = new UserRepository();\n TestHelper::createUser($userRepository);\n \t\n \t// register the same user again to catch unique users error\n TestHelper::createUser($userRepository);\n\n $this->assertFalse($userRepository->success);\n $this->assertTrue($userRepository->message === 'Error encountered when registering user.');\n\n // remove registered user in DB after test\n TestHelper::removeUser();\n }", "public function testPasswordToken()\n {\n\n }", "public function testUnmatchedConfirmationToChangePassword()\n {\n $user = User::storeUser([\n 'username' => 'testo1',\n 'email' => '[email protected]',\n 'password' => 'armne123456',\n ]);\n\n\n\n $token = auth()->login($user);\n $headers = [$token];\n\n $this->json('PATCH', 'api/v1/auth/changePassword', ['password' => 'armne123456',\n 'new_password' => 'newarmne123456', 'confirm_new_password' => 'nnewarmne123456'], $headers)\n ->assertStatus(404)\n ->assertJson([\n 'success' => 'false',\n 'error' => \"new password doesn't match the confirmation\"\n ]);\n\n $user->delete();\n }", "public function testUserRegistrationValidation()\n {\n $response = $this->json(\n 'POST',\n '/api/register',\n ['username' => 'akku', 'email' => '[email protected]', 'password' => '123456', 'rpassword' => '123456']\n );\n $response->assertStatus(210)->assertJsonValidationErrors(['email']);\n }", "public function testRegistrationFailsIfUserAlreadyExists() {\n // user model. I don't currently know, why that does not work properly!\n // Once we know why this happens, we can remove this and use the assert.\n $this->expectException(PDOException::class);\n\n Database::getInstance()->query(\"\n INSERT INTO `users` (id, username, password)\n VALUES (1, 'someuser', '\".PBKDF2::generate(\"password\").\"');\n \");\n\n $user = User::register(\"someuser\", \"password\");\n $this->assertNull($user);\n }" ]
[ "0.7932711", "0.7847394", "0.75772434", "0.7545065", "0.7502929", "0.74785364", "0.74628127", "0.74487734", "0.74229425", "0.7390768", "0.73548245", "0.73360294", "0.7249842", "0.7218313", "0.72052985", "0.71900874", "0.71329576", "0.71314114", "0.7096638", "0.703662", "0.70290846", "0.70249486", "0.69983053", "0.69595677", "0.6959167", "0.6948723", "0.6947954", "0.6941936", "0.6941825", "0.6911852" ]
0.81907064
0
test registration failure when email in use
public function testBadRegisterEmailInUse() { $name = 'Bob'; $email = '[email protected]'; $password = 'password'; // correctly register user // email should have error because already in use $this->visit('/') ->see('Register') ->click('Register') ->type($name,'name') ->type($this->user->email,'email') ->type($password,'password') ->type($password,'password_confirmation') ->press('Register') ->seePageIs('/register'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_visitor_can_register_with_email()\n {\n $response = $this->post(route('register'), [\n 'firstName' => \"Ahmed\",\n 'lastName' => \"Dokka\",\n 'birthDate' => '2020/12/11',\n \n 'username' => 'thatoneguy',\n 'login' => '[email protected]',\n 'password' => 'RRR%%%54ss',\n 'password_confirmation' => 'RRR%%%54ss',\n ]);\n $this->assertDatabaseHas('users', [\n \"email\" => '[email protected]'\n ]);\n $response->assertRedirect(route('verification.notice', 'email'));\n }", "public function testRegisterExistingEmail()\n {\n // Create a test user based on the User Factory\n $user = User::factory()->create(['password' => 'test123']);\n\n // then call the Register API using the same existing user\n // and check the following:\n // - Status code is 400\n // - Status message is \"Email already taken\"\n $this->json('POST', '/register', ['email' => $user->email, 'password' => 'test123'])\n ->seeStatusCode(400)\n ->seeJson(['message' => \"Email already taken\"]);\n }", "public function testRegisterEmail()\n {\n }", "public function testEmailHasTaken()\n {\n $this->visit('/register')\n ->type('blaa', 'name')\n ->type('[email protected]', 'email')\n ->type('secret1234', 'password')\n ->type('secret1234', 'password_confirmation')\n ->press('Register')\n ->see('The email has already been taken.');\n }", "public function test_create_new_useraccount_email_missing()\n {\n $response = $this->post('/api/v1/register',\n [\n \"name\" => \"Random name\",\n \"password\" => \"password\",\n \"password_confirmation\" => \"password\"\n ],\n [\n \"Accept\" => \"application/json\"\n ]\n );\n\n $response->assertStatus(422);\n $response->assertJson(\n [\n 'errors' => [\n 'email' => [\n 'The email field is required.'\n ]\n ]\n ]\n );\n }", "public function testRegisterExistingUser()\n {\n $response = $this->json('POST', '/' . config('app.api_version') . '/register', $this->data);\n $result = $response->getData();\n $this->assertEquals(422, $response->getStatusCode());\n $this->assertTrue(in_array('The email has already been taken.', $result->error->email));\n }", "public function shouldNotCreateUserWithIncorrectEmail(){\n\n // Missing email\n\n $faker = Faker::create();\n $parameters = [\n 'firstname' => $faker->firstname(),\n 'lastname' => $faker->lastname(),\n 'email' => 'foo.bar',\n 'password' => 'mysecretlove',\n 'password_confirmation' => 'mysecretlove'\n ];\n\n $this->post('api/auth/register', $parameters, []);\n $this->seeStatusCode(422);\n $this->seeJson([\n \"email\" => [\n \"The email must be a valid email address.\"\n ]\n ]);\n }", "public function test_create_new_useraccount_email_mustbe_unique()\n {\n $this->post('/api/v1/register',\n [\n \"name\" => \"Random name\",\n \"email\" => \"[email protected]\",\n \"password\" => \"password\",\n \"password_confirmation\" => \"password\"\n ],\n [\n \"Accept\" => \"application/json\"\n ]\n );\n $response = $this->post('/api/v1/register',\n [\n \"name\" => \"Random name\",\n \"email\" => \"[email protected]\",\n \"password\" => \"password\",\n \"password_confirmation\" => \"password\"\n ],\n [\n \"Accept\" => \"application/json\"\n ]\n );\n\n $response->assertStatus(422);\n $response->assertJson(\n [\n 'errors' => [\n 'email' => [\n 'The email has already been taken.'\n ]\n ]\n ]\n );\n }", "public function testRegisterInvalidEmail()\n {\n $response = $this->json('POST', '/' . config('app.api_version') . '/register', [\n 'first_name' => 'John',\n 'last_name' => 'Doe',\n 'email' => 'notAnEmail@',\n 'password' => '!p4ssW0rd',\n ]);\n\n $result = $response->getData();\n\n $this->assertEquals(422, $response->getStatusCode());\n\n $this->assertTrue(in_array('Invalid email address.', $result->error->email));\n }", "public function shouldNotCreateUserWithNoEmail(){\n\n // Missing email\n\n $faker = Faker::create();\n $parameters = [\n 'firstname' => $faker->firstname(),\n 'lastname' => $faker->lastname(),\n 'password' => 'mysecretlove',\n 'password_confirmation' => 'mysecretlove'\n ];\n\n $this->post('api/auth/register', $parameters, []);\n $this->seeStatusCode(422);\n $this->seeJson([\n \"email\" => [\n \"The email field is required.\"\n ]\n ]);\n }", "public function testNewUserRegistrationValidation()\n {\n $this->visit('registrieren')\n ->type('max.', 'username')\n ->type('max.h.online', 'email')\n ->type('secretpw', 'password')\n ->type('wrongpw', 'password_confirmation')\n ->press('Registrieren');\n\n // expected validation error\n $this->see('<strong>Login</strong> ist nicht gültig.')\n ->see('<strong>E-Mail</strong> ist keine gültige E-Mail-Adresse.')\n ->see('<strong>Passwort</strong> und Passwort-Bestätigung müssen übereinstimmen.');\n }", "public function testPasswordResetCreateEmailNotFound(): void {\n\t\t$user = $this->createUser();\n\t\t$response = $this->withHeaders([\n\t\t\t'Accept' => 'application/json',\n\t\t\t'Content-Type' => 'application/json',\n\t\t])->postJson($this->route.'/password/create', [\n\t\t\t'email' => '[email protected]',\n\t\t\t'url' => 'https://website.com/reset-password?token=vyhsv156s4vbsz'\n\t\t]);\n\t\t$response->assertStatus(HttpStatus::STATUS_BAD_REQUEST);\n\t\t$response->assertJson([\n\t\t\t'error' => 'We cannot find a user with that e-mail address.',\n\t\t]);\n\t\t$this->assertDatabaseMissing('password_resets',[\n\t\t\t'email' => '[email protected]',\n\t\t]);\n\t}", "public function testCheckEmailExistNG() {\n\t\t$result = $this->User->checkEmailExist('[email protected]');\n\t\tdebug($result);\n\t\t// Check Email fail\n\t\t$expected = CONSTANT_MESSAGE_MAIL_EXIST;\n\t\n\t\t$this->assertEquals($expected, $result['email']);\n\t}", "public function testEmailUsed(){\n $this->assertTrue(checkEmailUsed('[email protected]'));\n }", "public function testAdminCreateUserInvalidEmail()\n {\n $crawler = $this->client->request('GET', '/users');\n\n $link = $crawler->selectLink('Créer un utilisateur')->link();\n $crawler = $this->client->click($link);\n\n $form = $crawler->selectButton('Ajouter')->form();\n $form['user[username]'] = 'userAnon2';\n $form['user[password][first]'] = 'password';\n $form['user[password][second]'] = 'password';\n $form['user[email]'] = 'userAnon2';\n $crawler=$this->client->submit($form);\n\n static::assertEquals(0, $crawler->filter('div.alert.alert-success')->count());\n static::assertRegExp('/\\/users\\/create$/', $this->client->getRequest()->getUri());\n }", "public function testGetInvalidUserByEmail() : void {\n\n\t\t// grab an email that does not exist\n\t\t$user = User::getUserByUserEmail($this->getPDO(), \"[email protected]\");\n\t\t$this->assertNull($user);\n\t}", "function test_invalidUserProfileEmail() {\r\n\t\t$this->testData['userProfileEmail'] = '$\\xy^';\r\n\t\t$s1 = new UserProfileData($this->testData);\r\n\t\t$errorCount = $s1->getErrorCount();\r\n\t\t$this->assertTrue($errorCount > 0,\r\n\t\t\t\t\"Error count should be greater than 0 for invalid email, but was \".\r\n\t\t\t\t$errorCount);\r\n\t\t$errors = $s1->getErrors();\r\n\t\t$this->assertTrue(isset($errors['userProfileEmail']),\r\n\t\t\t\t\"Error message should be set for user profile email but was not\");\r\n\t\t$this->assertFalse(empty($s1->getError('userProfileEmail')));\r\n\t}", "public function test_email_exists_validation()\n {\n $payload = [\n 'email' => $this->faker->email,\n 'password' => $this->password,\n ];\n\n $this->json('post', 'api/login', $payload)\n ->assertStatus(Response::HTTP_FORBIDDEN)\n ->assertExactJson(\n [\n \"meta\" => [\n \"status\" => \"FAILED\",\n \"status_code\" => 403,\n \"current_page\" => 1,\n \"total_page\" => 1,\n ],\n \"error\" => [\n [\n \"key\" => \"email\",\n \"message\" => \"The selected email is invalid.\",\n ],\n ],\n ]\n );\n }", "public function testUserRegistrationValidation()\n {\n $response = $this->json(\n 'POST',\n '/api/register',\n ['username' => 'akku', 'email' => '[email protected]', 'password' => '123456', 'rpassword' => '123456']\n );\n $response->assertStatus(210)->assertJsonValidationErrors(['email']);\n }", "public function testCorrectRegister()\n {\n $name = 'Bob';\n $email = '[email protected]';\n $password = 'password';\n $this->visit('/')\n ->see('Register')\n ->click('Register')\n ->seePageIs('/register')\n ->type($name,'name')\n ->type($email,'email')\n ->type($password,'password')\n ->type($password,'password_confirmation')\n ->press('Register')\n ->seePageIs('/verify')\n ->see($name);\n $u = User::where('email',$email)->first();\n $this->assertNotNull($u);\n $this->seeInDatabase('verification_tokens',[ 'user_id' => $u->user_id ]);\n }", "public function testRegistrationFail()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(new Register)\n ->within('form', function ($browser) {\n $browser->waitFor('@register-button')\n ->type('@name', $this->faker->name())\n ->type('@email', $this->faker->safeEmail())\n ->type('@password', 'password')\n ->type('@password_confirmation', 'drowssap')\n ->click('@register-button');\n })\n ->waitForText('Whoops! Something went wrong')\n ->assertSee('The password confirmation does not match');\n\n $browser->blank();\n });\n }", "public function testStoreInvalidEmailValue()\n {\n\t\t $this->post('/recipients/store',['email' => 'Test Name'])\n ->assertSessionHasErrors('email');\n \t}", "public function test_create_new_useraccount_email_mustbe_string_and_valid()\n {\n $response = $this->post('/api/v1/register',\n [\n \"name\" => \"Random name\",\n \"email\" => 12345,\n \"password\" => \"password\",\n \"password_confirmation\" => \"password\"\n ],\n [\n \"Accept\" => \"application/json\"\n ]\n );\n\n $response->assertStatus(422);\n $response->assertJson(\n [\n 'errors' => [\n 'email' => [\n 'The email must be a string.',\n 'The email must be a valid email address.'\n ]\n ]\n ]\n );\n }", "public function test_creating_a_user_with_same_email()\n {\n $response = $this->postUser();\n\n $response = $this->postJson('/api/user', [\n 'type' => 0,\n 'name' => 'John Doe 2',\n 'cpf_cnpj' => '12345678901234',\n 'email' => '[email protected]',\n 'password' => '12345678'\n ]);\n\n $response\n ->assertStatus(400)\n ->assertExactJson(['message' => 'Já existe esse e-mail registrado.',]);\n }", "public function testRegisterReturnValidationFail()\n {\n \t$input = [\n \t\t'name' => 'qwedcvgh123luv98',\n 'email' => '[email protected]',\n 'password' => 'password',\n \t];\n \t$userRepository = new UserRepository();\n \t$userRepository->register($input);\n\n $this->assertFalse($userRepository->success);\n $this->assertTrue($userRepository->message === 'Validation Error.');\n }", "public function testAdminCreateAdminInvalidEmail()\n {\n $crawler = $this->client->request('GET', '/users');\n\n $link = $crawler->selectLink('Créer un utilisateur')->link();\n $crawler = $this->client->click($link);\n\n $form = $crawler->selectButton('Ajouter')->form();\n $form['user[username]'] = 'userAnon2';\n $form['user[password][first]'] = 'password';\n $form['user[password][second]'] = 'password';\n $form['user[email]'] = 'userAnon2';\n $form['user[roles]'][1]->tick();\n $crawler=$this->client->submit($form);\n\n static::assertEquals(0, $crawler->filter('div.alert.alert-success')->count());\n static::assertRegExp('/\\/users\\/create$/', $this->client->getRequest()->getUri());\n }", "public function test_email_exist() {\n $link = $this->_link.'users';\n $method = 'POST';\n $params = array(\n 'username' => 'tam04',\n 'password' => '123456',\n 'email' => '[email protected]',\n 'firstname' => 'tam',\n 'lastname' => 'pham',\n 'group' => 1,\n 'gender' => 1,\n 'avatar' => 'avatar.jpg',\n 'birthday' => '1988-12-13',\n 'address' => '111D Ly Chinh Thang',\n 'city' => 'HCMC',\n 'mobile' => '0909999999',\n );\n $res = $this->curl($link, $method, $params);\n\n $this->assertEquals(ERROR_EMAIL_EXIST, $res->meta->code);\n }", "public function test_existing_email()\n {\n $_SERVER[\"REQUEST_METHOD\"] = \"POST\";\n $_POST['username'] = \"TestPerson\";\n $_POST['password'] = \"password\";\n $_POST['email'] = \"[email protected]\";\n\n //Run file\n ob_start();\n include('register.php');\n $response = json_decode(ob_get_clean(), true);\n $this->assertTrue($response['error']);\n }", "public function emailParameterShouldBeAValidEmail()\n {\n // Arrange...\n $this->login();\n\n // Act...\n $this->json('put', \"users/{$this->user->id}\", array_merge($this->input, [\n 'email' => 'foowesterdals.no'\n ]));\n\n // Assert...\n $this->seeError('validation_failed', Response::HTTP_UNPROCESSABLE_ENTITY);\n }", "public function testGetValidUserByEmail() : void {\n\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"user\");\n\t\t$userId = generateUuidV4();\n\t\t$user = new User($userId, $this->VALID_ACTIVATION, $this->VALID_EMAIL, $this->VALID_FULLNAME, $this->VALID_HANDLE, $this->VALID_USER_HASH);\n\t\t$user->insert($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoUser = User::getUserByUserEmail($this->getPDO(), $user->getUserEmail());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"user\"));\n\t\t$this->assertEquals($pdoUser->getUserId(), $userId);\n\t\t$this->assertEquals($pdoUser->getUserActivationToken(), $this->VALID_ACTIVATION);\n\t\t$this->assertEquals($pdoUser->getUserEmail(), $this->VALID_EMAIL);\n\t\t$this->assertEquals($pdoUser->getUserFullName(), $this->VALID_FULLNAME);\n\t\t$this->assertEquals($pdoUser->getUserHandle(), $this->VALID_HANDLE2);\n\t\t$this->assertEquals($pdoUser->getUserHash(), $this->VALID_USER_HASH);\n\t}" ]
[ "0.8069055", "0.79023147", "0.78568065", "0.77042556", "0.7550892", "0.7537803", "0.74586076", "0.74552476", "0.74181354", "0.7408934", "0.74014956", "0.7361632", "0.734462", "0.7343035", "0.7322243", "0.73135567", "0.72984874", "0.7278273", "0.7271988", "0.72445935", "0.72258395", "0.72215086", "0.72069806", "0.71887857", "0.7152727", "0.7129513", "0.71060115", "0.706175", "0.7049747", "0.70258117" ]
0.8191186
0
Only run these tests if docker is available
public static function setUpBeforeClass(): void { $process = new Process(['docker', '-v']); $process->run(); if (!$process->isSuccessful()) { self::markTestSkipped("Unable to find docker daemon"); return; } // Copy the current source code to the release folder inside the build context $releaseDir = self::getReleaseDir(); @mkdir($releaseDir, 0777, true); copy(__DIR__ . "/../../composer.json", $releaseDir . "/../composer.json"); foreach ($iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator(__DIR__ . "/../../src", RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::SELF_FIRST ) as $item ) { if ($item->isDir()) { @mkdir($releaseDir . DIRECTORY_SEPARATOR . $iterator->getSubPathName()); } else { copy($item, $releaseDir . DIRECTORY_SEPARATOR . $iterator->getSubPathName()); } } // Build the registry image $process = new Process( [ "docker", "build", "-t", "acf-pro-installer/registry:latest", "." ], __DIR__ . "/images/registry" ); $process->mustRun(); // If any container exists, remove it first $process = new Process(["docker", "ps", "-f", "name=acf-pro-installer-registry"]); $process->mustRun(); if (strstr($process->getOutput(), 'acf-pro-installer-registry') !== false) { $process = new Process(["docker", "rm", "-f", "acf-pro-installer-registry"]); $process->mustRun(); } // If the network exists, remove it first $process = new Process(["docker", "network", "ls", "-f", "name=acf-pro-installer-test"]); $process->mustRun(); if (strstr($process->getOutput(), 'acf-pro-installer-test') !== false) { $process = new Process(["docker", "network", "rm", "acf-pro-installer-test"]); $process->mustRun(); } $process = new Process(["docker", "network", "create", "--driver", "bridge", "acf-pro-installer-test"]); $process->mustRun(); $process = new Process( [ "docker", "run", "-d", "-i", "--network=acf-pro-installer-test", "--network-alias=connect.advancedcustomfields.com", "--name", "acf-pro-installer-registry", "--rm", "acf-pro-installer/registry:latest" ] ); $process->mustRun(); foreach (self::$phpVersions as $shortPhpVersion => $fullPhpVersion) { foreach (self::$composerVersions as $shortComposerVersion => $fullComposerVersion) { // Build the app image $process = new Process( [ "docker", "build", "--build-arg", "PHP_VERSION={$fullPhpVersion}", "--build-arg", "COMPOSER_VERSION={$fullComposerVersion}", "-t", "acf-pro-installer/testapp:{$shortPhpVersion}-{$shortComposerVersion}", "." ], __DIR__ . "/images/app" ); $process->mustRun(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setUp()\n\t{\n\t\t$this->image = new DockerImage(str_replace('/tests/', '/', __DIR__), 'greencape/base:latest');\n\t\t$this->container = new DockerContainer($this->image);\n\t}", "public function isDockerToolbox()\n {\n return (bool) getenv('DOCKER_TOOLBOX_INSTALL_PATH');\n }", "public function test_init_command_creates_docker_compose_and_docker_files()\n {\n $this->artisan('init')\n ->expectsQuestion('Enter a name for your project', 'foobar')\n ->expectsQuestion('Enter a service name or press enter to quit', 'foo')\n ->expectsQuestion('Enter a service name or press enter to quit', 'bar')\n ->expectsQuestion('Enter a service name or press enter to quit', null)\n ->expectsOutput('Docker environment created run \"docker-compose up -d\" within the \".docker\" directory!')\n ->assertExitCode(0);\n\n $this->assertFileExists(__DIR__ . '/../fixtures/work_dir/.docker/docker-compose.yml');\n $this->assertFileExists(__DIR__ . '/../fixtures/work_dir/.docker/.env');\n $this->assertFileExists(__DIR__ . '/../fixtures/work_dir/.docker/env-example');\n $this->assertFileExists(__DIR__ . '/../fixtures/work_dir/.docker/foo/Dockerfile');\n $this->assertFileExists(__DIR__ . '/../fixtures/work_dir/.docker/bar/Dockerfile');\n $this->assertFileExists(__DIR__ . '/../fixtures/work_dir/.docker/bar/assets.txt');\n }", "protected function checkAdapterRequirements()\n {\n if (false == \\extension_loaded('mysqli') || false == \\function_exists('mysqli_connect')) {\n $this->markTestSkipped('Test skipped, because extension mysqli is not installed.');\n }\n }", "public function isDockerEnvSet()\n {\n return (bool) getenv('DOCKER_HOST');\n }", "protected function setUp()\n {\n $editor = new Editor();\n if (false === $editor->isAvailable()) {\n $this->markTestSkipped(\n 'PHP Imagick is not available.'\n );\n }\n }", "public function isContainerAvailable() : bool;", "protected function setUp() {\n if (!(module_exists('jquery_update'))) {\n $this->markTestSkipped('jQuery Update module is not installed/activated.');\n }\n }", "public function testAll()\n {\n foreach ($this->dependencies as $v) {\n $v->get();\n }\n\n return true;\n }", "public function testRunnerExistent()\n {\n $runner = new Runner();\n $result = $runner->from('/tmp')->run([ 'ls'] );\n\n $this->assertTrue($result->success());\n $this->assertTrue($result->code() == 0);\n }", "public function deleteAllTestContainers()\n {\n $containerInfos = $this->docker->getContainerManager()->findAll([\n 'filters' => json_encode([\n 'label' => ['lfs-server', 'is-testing'],\n ])\n ]);\n\n foreach ($containerInfos as $containerInfo) {\n if (in_array($containerInfo->getState(), ['running', 'restarting'])) {\n $this->stop($containerInfo->getId());\n }\n $this->delete($containerInfo->getId());\n }\n }", "protected static function checkSystemRequirements() {\n self::hasNginx();\n self::hasFroxlor();\n self::hasSake();\n }", "public function testContainerStructure()\n {\n $globalContainer = wprss_wp_container();\n $wpraContainer = wprss_hub_container();\n $coreContainer = wprss_core_container();\n\n $this->assertTrue(in_array($wpraContainer, $globalContainer->getContainers(), true), 'Global container does not container the WPRA container');\n $this->assertTrue(in_array($coreContainer, $wpraContainer->getContainers(), true), 'WPRA container does not contain the Core container');\n }", "private function checkApplication()\n {\n try {\n static::$kernel = static::createKernel(array());\n static::$kernel->boot();\n } catch (\\RuntimeException $ex) {\n $this->markTestSkipped('There does not seem to be a full application available (e.g. running tests on travis.org). So this test is skipped.');\n\n return;\n }\n }", "public function testBasic() {\n $escapedDir = escapeshellarg(__DIR__ . '');\n $options = '--prefix hydratest- --url-template ' . escapeshellarg('http://%SITE_NAME%.localhost');\n\n ProcessUtil::runOk($this->cmd(\"civihydra destroy $options\"));\n\n $result = ProcessUtil::runOk($this->cmd(\"civihydra create $options $escapedDir/dummy-tarballs/*\"));\n\n $this->assertFilesRegex(array(\n $this->getAbsPath('hydratest-backdrop', 'modules/civicrm/README.txt') => ';civicrm-core plus [email protected];',\n $this->getAbsPath('hydratest-drupal', 'sites/all/modules/civicrm/README.txt') => ';civicrm-core plus [email protected];',\n $this->getAbsPath('hydratest-wp', 'wp-content/plugins/civicrm/README.txt') => ';civicrm-core plus civicrm-wordpress;',\n ));\n\n $builds = array('hydratest-backdrop', 'hydratest-drupal', 'hydratest-wp');\n foreach ($builds as $build) {\n $this->assertRegExp('; - CMS_ROOT: [^\\n]+/build/' . preg_quote($build, ';') . ';', $result->getOutput());\n $this->assertRegExp('; - CIVI_DB_DSN: mysql://.*:.*@.*/.*;', $result->getOutput());\n $configFile = $this->getPrjDir() . \"/build/{$build}.sh\";\n $this->assertFileExists($configFile);\n $config = file_get_contents($configFile);\n $this->assertRegExp(';CMS_ROOT=[^\\n]+/build/' . preg_quote($build, ';') . ';', $config);\n $this->assertRegExp(';CIVI_DB_DSN=\\\"?mysql://.*:.*@.*/.*\\\"?;', $config);\n }\n }", "public function check()\n {\n\n $environment = $this->getContainer()->get('kernel')->getEnvironment();\n $classNameDebugContainer = sprintf('app%sDebugProjectContainer', ucwords($environment));\n $reflect = new \\ReflectionClass($classNameDebugContainer);\n $reflectionPropertyMethodMap = $reflect->getProperty('methodMap');\n $reflectionPropertyMethodMap->setAccessible(true);\n $services = array_keys($reflectionPropertyMethodMap->getValue($this->getContainer()));\n\n foreach ($services as $key => $serviceName) {\n if (0 !== strpos($serviceName, 'prefixService')) {\n continue;\n }\n try {\n $this->getContainer()->get($serviceName);\n } catch (ServiceNotFoundException $exception) {\n $this->fail(sprintf('Service Not Found: %s', $exception->getMessage()));\n } catch (ServiceCircularReferenceException $exception) {\n $this->fail(sprintf('Service Circular Reference: %s', $exception->getMessage()));\n } catch (Exception $exception) {\n $this->fail(sprintf('Service Error: %s', $exception->getMessage()));\n }\n }\n\n $this->assertTrue(true);\n }", "public function setUp()\n {\n $kernel = $this->createKernel();\n $kernel->boot();\n\n $this->downloader = $kernel->getContainer()\n ->get('ten24_marcato_integration.downloader');\n }", "public function stopAllTestContainers()\n {\n $containerInfos = $this->docker->getContainerManager()->findAll([\n 'filters' => json_encode([\n 'label' => ['lfs-server', 'is-testing'],\n 'status' => ['created', 'restarting', 'running', 'paused', 'exited', 'dead'],\n ])\n ]);\n\n foreach ($containerInfos as $containerInfo) {\n if (in_array($containerInfo->getState(), ['running', 'restarting'])) {\n $this->stop($containerInfo->getId());\n }\n }\n }", "private function getInstallableContainerSetup()\n {\n $app = $this->app;\n $app['env'] = 'production';\n $app['orchestra.installed'] = false;\n $acl = $app['orchestra.acl'];\n $config = $app['config'];\n $event = $app['events'];\n $mailer = $app['orchestra.mail'];\n $memory = $app['orchestra.memory'];\n $notifier = $app['orchestra.notifier'];\n $request = $app['request'];\n $translator = $app['translator'];\n $widget = $app['orchestra.widget'];\n\n $memoryProvider = m::mock('\\Orchestra\\Memory\\Provider');\n\n $memoryProvider->shouldReceive('get')->once()->with('site.name')->andReturn('Orchestra');\n\n $acl->shouldReceive('make')->once()->andReturn($acl)\n ->shouldReceive('attach')->once()->with($memoryProvider)->andReturn($acl);\n $mailer->shouldReceive('attach')->once()->with($memoryProvider)->andReturnNull();\n $memory->shouldReceive('make')->once()->andReturn($memoryProvider);\n $notifier->shouldReceive('setDefaultDriver')->once()->with('orchestra')->andReturnNull();\n $widget->shouldReceive('make')->once()->with('menu.orchestra')->andReturn($widget)\n ->shouldReceive('make')->once()->with('menu.app')->andReturn($widget)\n ->shouldReceive('add->title->link')->once()->andReturnNull();\n $translator->shouldReceive('get')->andReturn('foo');\n $event->shouldReceive('listen')->once()\n ->with('orchestra.ready: admin', 'Orchestra\\Foundation\\AdminMenuHandler')->andReturnNull()\n ->shouldReceive('fire')->once()->with('orchestra.started', array($memoryProvider))->andReturnNull();\n $config->shouldReceive('get')->once()->with('orchestra/foundation::handles', '/')->andReturn('admin');\n $request->shouldReceive('root')->andReturn('http://localhost')\n ->shouldReceive('secure')->andReturn(false);\n\n return $app;\n }", "protected function _before()\n {\n parent::_before();\n\n if (!extension_loaded('yaml')) {\n $this->markTestSkipped('Warning: yaml extension is not loaded');\n }\n\n if (!defined('TEST_BT_HOST') || !defined('TEST_BT_PORT')) {\n $this->markTestSkipped('TEST_BT_HOST and/or TEST_BT_PORT env variables are not defined');\n }\n\n $this->client = new Beanstalk([\n 'host' => TEST_BT_HOST,\n 'port' => TEST_BT_PORT\n ]);\n\n try {\n @$this->client->connect();\n } catch (\\Exception $e) {\n $this->markTestSkipped($e->getMessage());\n }\n }", "public function runningUnitTests()\n {\n return $this['env'] == 'testing';\n }", "public function runningUnitTests()\n {\n return $this['env'] == 'testing';\n }", "protected function testRedisAvailable() {\n\t\t\t// Check for file existance to see if we can run this backend\n\t\tif (!is_file(PATH_t3lib . 'cache/backend/class.t3lib_cache_backend_phpredisredisbackend.php')) {\n\t\t\tthrow t3lib_div::makeInstance('tx_enetcacheanalytics_exception_UnavailableBackend',\n\t\t\t\t'Phpredis backend not available with this TYPO3 version',\n\t\t\t\t1279584649\n\t\t\t);\n\t\t}\n\t\tif (!extension_loaded('redis')) {\n\t\t\tthrow t3lib_div::makeInstance('tx_enetcacheanalytics_exception_UnavailableBackend',\n\t\t\t\t'redis php extension was not available',\n\t\t\t\t1279584646\n\t\t\t);\n\t\t}\n\t\ttry {\n\t\t\tif (!@fsockopen(self::redisHost, self::redisPort)) {\n\t\t\t\tthrow t3lib_div::makeInstance('tx_enetcacheanalytics_exception_UnavailableBackend',\n\t\t\t\t\t'redis sever not available',\n\t\t\t\t\t1279584647\n\t\t\t\t);\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\tthrow t3lib_div::makeInstance('tx_enetcacheanalytics_exception_UnavailableBackend',\n\t\t\t\t'redis sever not available',\n\t\t\t\t1279584648\n\t\t\t);\n\t\t}\n\t}", "public function setUp()\n\t{\n\t\t$this->container = $this->createExecutionContainer();\n\t}", "public function testComleteTestSupport()\n {\n if (version_compare(PHP_VERSION, \"5.2.11\", '<')) {\n $this->markTestSkipped();\n\n }\n }", "protected function setUp(): void\n {\n $this->processRunner = new ProcessRunner('php', ['artisan', 'serve', '--host=127.0.0.1', '--port=8000']);\n\n $this->processRunner->run(false);\n }", "public function testContainer()\n {\n $extension = new BestItKitchensinkExtension();\n $container = new ContainerBuilder();\n\n $extension->load(\n [\n [\n 'template' => $template = uniqid(),\n 'data_provider' => $provider = uniqid(),\n 'template_engine' => $engine = uniqid(),\n ]\n ],\n $container\n );\n\n static::assertSame($template, $container->getParameter('best_it_kitchensink.template'));\n static::assertTrue($container->hasAlias('best_it_kitchensink.template_engine'));\n static::assertTrue($container->hasAlias('best_it_kitchensink.data_provider'));\n }", "public function setUp() {\n\t\t$this->requireEasyDeployClassesOrSkip();\n\t}", "public function testPlatformsWithDemo(): void\n {\n $app = $this->porter->importOne(new Import(new ScrapeAppDetails(206190)));\n\n self::assertTrue($app['windows']);\n self::assertTrue($app['mac']);\n self::assertTrue($app['linux']);\n }", "protected function initDocker(Docker $docker = null)\n {\n $this->docker = $docker;\n\n if (is_null($this->docker)) {\n $this->docker = new Docker();\n }\n }" ]
[ "0.6265243", "0.56785625", "0.5602613", "0.5533446", "0.5451501", "0.5308868", "0.52878666", "0.5197455", "0.51709205", "0.5152182", "0.51030654", "0.50884026", "0.5073254", "0.5062968", "0.5044167", "0.5038833", "0.5000987", "0.49993214", "0.49953058", "0.4986218", "0.49837634", "0.49837634", "0.4979925", "0.4977742", "0.49389255", "0.49267116", "0.4923765", "0.48913646", "0.4872739", "0.48703218" ]
0.7132665
0
Description This method will add a new email address to a customer. Arguments api_key: auth_token: tnid: The ID of the tenant the customer is attached to. customer_id: The ID of the customer to add the email address to. address: The email address to add. flags: The options for the email address. 0x01 Customer is allowed to login via the tenant website. This is used by the ciniki.web module. Returns
function ciniki_customers_emailAdd(&$ciniki) { // // Find all the required and optional arguments // ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs'); $rc = ciniki_core_prepareArgs($ciniki, 'no', array( 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), 'customer_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Customer'), 'address'=>array('required'=>'yes', 'blank'=>'no', 'trimblanks'=>'yes', 'name'=>'Email Address'), 'password'=>array('required'=>'no', 'blank'=>'no', 'default'=>'', 'name'=>'Password'), 'temp_password'=>array('required'=>'no', 'blank'=>'no', 'default'=>'', 'name'=>'Temporary Password'), 'temp_password_date'=>array('required'=>'no', 'blank'=>'no', 'default'=>'', 'name'=>'Temporary Password Date'), 'flags'=>array('required'=>'no', 'blank'=>'no', 'default'=>'0', 'name'=>'Options'), )); if( $rc['stat'] != 'ok' ) { return $rc; } $args = $rc['args']; $args['email'] = $args['address']; // // Make sure this module is activated, and // check permission to run this function for this tenant // ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'private', 'checkAccess'); $rc = ciniki_customers_checkAccess($ciniki, $args['tnid'], 'ciniki.customers.emailAdd', $args['customer_id']); if( $rc['stat'] != 'ok' ) { return $rc; } // // FIXME: Encrypt the password // // // Check if we allow multiple emails // if( ($ciniki['tenant']['modules']['ciniki.customers']['flags']&0x20000000) > 0 ) { $strsql = "SELECT COUNT(id) AS emails " . "FROM ciniki_customer_emails " . "WHERE customer_id = '" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . "' " . "AND tnid = '" . ciniki_core_dbQuote($ciniki, $args['tnid']) . "' " . ""; $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.customers', 'num'); if( $rc['stat'] != 'ok' ) { return $rc; } if( isset($rc['num']['emails']) && $rc['num']['emails'] > 0 ) { return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.72', 'msg'=>'There is already an email address for this customer.')); } } // // Add the address // ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd'); $rc = ciniki_core_objectAdd($ciniki, $args['tnid'], 'ciniki.customers.email', $args, 0x07); if( $rc['stat'] != 'ok' ) { return $rc; } // // Update the short_description // ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'private', 'customerUpdateShortDescription'); $rc = ciniki_customers_customerUpdateShortDescription($ciniki, $args['tnid'], $args['customer_id'], 0x07); if( $rc['stat'] != 'ok' ) { return $rc; } // // Update the web index if enabled // ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'hookExec'); ciniki_core_hookExec($ciniki, $args['tnid'], 'ciniki', 'web', 'indexObject', array('object'=>'ciniki.customers.customer', 'object_id'=>$args['customer_id'])); ciniki_core_hookExec($ciniki, $args['tnid'], 'ciniki', 'web', 'indexObject', array('object'=>'ciniki.customers.members', 'object_id'=>$args['customer_id'])); ciniki_core_hookExec($ciniki, $args['tnid'], 'ciniki', 'web', 'indexObject', array('object'=>'ciniki.customers.dealers', 'object_id'=>$args['customer_id'])); ciniki_core_hookExec($ciniki, $args['tnid'], 'ciniki', 'web', 'indexObject', array('object'=>'ciniki.customers.distributors', 'object_id'=>$args['customer_id'])); return array('stat'=>'ok'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addAddressAction() {\n $value = json_decode(file_get_contents('php://input'));\n //$this->check_method('POST');\n $customerid = $value->customerid;\n $country = $value->country;\n $zipcode = $value->zipcode;\n $city = $value->city;\n $telephone = $value->telephone;\n $fax = $value->fax;\n $company = $value->company;\n $street = $value->street;\n $state = $value->state;\n $default_billing = $value->default_billing;\n $default_shipping = $value->default_shipping;\n\n $customer = Mage::getModel('customer/customer')->load($customerid);\n\n $address = Mage::getModel(\"customer/address\");\n $address->setCustomerId($customer->getId())\n ->setFirstname($customer->getFirstname())\n ->setMiddleName($customer->getMiddlename())\n ->setLastname($customer->getLastname())\n ->setCountryId($country)\n ->setPostcode($zipcode)\n ->setCity($city)\n ->setRegion($state)\n ->setTelephone($telephone)\n ->setFax($fax)\n ->setCompany($company)\n ->setStreet($street)\n ->setSaveInAddressBook('1');\n\n if ($default_billing == 'Yes') {\n $address->setIsDefaultBilling('1');\n }\n if ($default_shipping == 'Yes') {\n $address->setIsDefaultShipping('1');\n }\n\n try {\n $address->save();\n $response = array('status' => 1, 'message' => 'Address added successfully!');\n } catch (Exception $e) {\n //Zend_Debug::dump($e->getMessage());\n $response = array('status' => 0, 'message' => $e->getMessage());\n }\n //\t$this->response($this->json( $response), 200);\n $jsonData = $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n }", "private function addCustomerData($options)\n {\n $this->post['CustomerEmail'] = $options['email'];\n }", "public function addaddress(Request $request){\n\t\tif(session('customers_create')==0){\n\t\t\tprint Lang::get(\"labels.You do not have to access this route\");\n\t\t}else{\t\n\t\t\n\t\t$title = array('pageTitle' => Lang::get(\"labels.AddAddress\"));\n\t\t\t\t\n\t\t$language_id \t\t\t\t= $request->language_id;\n\t\t$customers_id \t\t\t\t= $request->id;\t\t\n\t\t\n\t\t$customerData = array();\n\t\t$message = array();\n\t\t$errorMessage = array();\n\t\t\n\t\t$customer_addresses = DB::table('address_book')\n\t\t\t->leftJoin('zones', 'zones.zone_id', '=', 'address_book.entry_zone_id')\n\t\t\t->leftJoin('countries', 'countries.countries_id', '=', 'address_book.entry_country_id')\n\t\t\t->where('customers_id', '=', $customers_id)->get();\t\n\t\t\n\t\t$countries = DB::table('countries')->get();\t\n\t\t\n\t\t$customerData['message'] = $message;\n\t\t$customerData['errorMessage'] = $errorMessage;\n\t\t$customerData['customer_addresses'] = $customer_addresses;\t\n\t\t$customerData['countries'] = $countries;\n\t\t$customerData['customers_id'] = $customers_id;\t\n\t\t\n\t\treturn view(\"admin.addaddress\",$title)->with('data', $customerData);\n\t\t}\n\t}", "private function addAddress($options)\n {\n $billing_address = isset($options['billing_address'])\n ? $options['billing_address']\n : $options['address'];\n\n $this->post['CustomerAddress'] = join(', ', $billing_address);\n\n $this->post['CustomerPostcode'] = $billing_address['zip'];\n }", "function addAddressBookEntry($customer_id, $address_question_arr, $make_default = false) {\n global $db;\n $time = date('Y-m-d H:i:s');\n // debug\n $this->zcLog('addAddressBookEntry - 1', $time.\"\\t in \". __FILE__ . \" on line \" . __LINE__ . \" \\t\\n\". 'address to add: ' . \"\\n\" . print_r($address_question_arr, true));\n\n // set some defaults\n $country_id = '223';\n $address_format_id = 2; //2 is the American format\n\n // first get the zone id's from the 2 digit iso codes\n // country first\n $sql = \"SELECT countries_id, address_format_id\n FROM \" . TABLE_COUNTRIES . \"\n WHERE countries_iso_code_2 = :countryId\n OR countries_name = :countryId\n LIMIT 1\";\n $sql = $db->bindVars($sql, ':countryId', $address_question_arr['country']['title'], 'string');\n $country = $db->Execute($sql);\n\n // see if we found a record, if not default to American format\n if (!$country->EOF) {\n $country_id = $country->fields['countries_id'];\n $address_format_id = (int)$country->fields['address_format_id'];\n }\n\n // see if the country code has a state\n $sql = \"SELECT zone_id\n FROM \" . TABLE_ZONES . \"\n WHERE zone_country_id = :zoneId\n LIMIT 1\";\n $sql = $db->bindVars($sql, ':zoneId', $country_id, 'integer');\n $country_zone_check = $db->Execute($sql);\n $check_zone = $country_zone_check->RecordCount();\n\n // now try and find the zone_id (state/province code)\n // use the country id above\n if ($check_zone) {\n $sql = \"SELECT zone_id\n FROM \" . TABLE_ZONES . \"\n WHERE zone_country_id = :zoneId\n AND zone_code = :zoneCode\n OR zone_name = :zoneCode\n LIMIT 1\";\n $sql = $db->bindVars($sql, ':zoneId', $country_id, 'integer');\n $sql = $db->bindVars($sql, ':zoneCode', $address_question_arr['state'], 'string');\n $zone = $db->Execute($sql);\n if (!$zone->EOF) {\n // grab the id\n $zone_id = $zone->fields['zone_id'];\n } else {\n $zone_id = 0;\n }\n }\n\n // now run the insert\n\n // this isn't the best way to get fname/lname but it will get the majority of cases\n list($fname, $lname) = explode(' ', $address_question_arr['name']);\n\n $sql_data_array= array(array('fieldName'=>'entry_firstname', 'value'=>$fname, 'type'=>'string'),\n array('fieldName'=>'entry_lastname', 'value'=>$lname, 'type'=>'string'),\n array('fieldName'=>'entry_street_address', 'value'=>$address_question_arr['street_address'], 'type'=>'string'),\n array('fieldName'=>'entry_postcode', 'value'=>$address_question_arr['postcode'], 'type'=>'string'),\n array('fieldName'=>'entry_city', 'value'=>$address_question_arr['city'], 'type'=>'string'),\n array('fieldName'=>'entry_country_id', 'value'=>$country_id, 'type'=>'integer'),\n array('fieldName'=>'last_modify_time', 'value'=>date('Y-m-d H:i:s'), 'type'=>'date'),\n array('fieldName'=>'create_time', 'value'=>date('Y-m-d H:i:s'), 'type'=>'date')\n );\n $sql_data_array[] = array('fieldName'=>'entry_gender', 'value'=>$address_question_arr['payer_gender'], 'type'=>'enum:m|f');\n $sql_data_array[] = array('fieldName'=>'entry_suburb', 'value'=>$address_question_arr['suburb'], 'type'=>'string');\n if ($zone_id > 0) {\n $sql_data_array[] = array('fieldName'=>'entry_zone_id', 'value'=>$zone_id, 'type'=>'integer');\n $sql_data_array[] = array('fieldName'=>'entry_state', 'value'=>'', 'type'=>'string');\n } else {\n $sql_data_array[] = array('fieldName'=>'entry_zone_id', 'value'=>'0', 'type'=>'integer');\n $sql_data_array[] = array('fieldName'=>'entry_state', 'value'=>$address_question_arr['state'], 'type'=>'string');\n }\n $sql_data_array[] = array('fieldName'=>'customers_id', 'value'=>$customer_id, 'type'=>'integer');\n $db->perform(TABLE_ADDRESS_BOOK, $sql_data_array);\n\n $new_address_book_id = $db->Insert_ID();\n\n $this->notify('NOTIFY_HEADER_ADDRESS_BOOK_ADD_ENTRY_DONE');\n\n // make default if set, update\n if ($make_default) {\n $sql_data_array = array();\n $sql_data_array[] = array('fieldName'=>'customers_default_address_id', 'value'=>$new_address_book_id, 'type'=>'integer');\n $where_clause = \"customers_id = :customersID\";\n $where_clause = $db->bindVars($where_clause, ':customersID', $customer_id, 'integer');\n $db->perform(TABLE_CUSTOMERS, $sql_data_array, 'update', $where_clause);\n $_SESSION['customer_default_address_id'] = $new_address_book_id;\n }\n\n // set the sendto\n $_SESSION['sendto'] = $new_address_book_id;\n\n // debug\n $this->zcLog('addAddressBookEntry - 2', $time.\"\\t in \". __FILE__ . \" on line \" . __LINE__ . \" \\t\\n\". 'added address #' . $new_address_book_id. \"\\n\" . 'SESSION[sendto] is now set to ' . $_SESSION['sendto']);\n // return the address_id\n return $new_address_book_id;\n }", "function ciniki_customers_web_accountEmailUpdate($ciniki, $settings, $tnid, $email, $post_email) {\n\n //\n // Check to make sure a valid email\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'private', 'checkEmailValid');\n $rc = ciniki_customers_checkEmailValid($ciniki, $tnid, $post_email);\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.172', 'msg'=>\"The email address '$post_email' is invalid, please try again.\", 'err'=>$rc['err']));\n }\n\n //\n // Check to make sure that email address is unique\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'private', 'checkEmailExists');\n $rc = ciniki_customers_checkEmailExists($ciniki, $tnid, $post_email);\n if( $rc['stat'] == 'exists' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.173', 'msg'=>\"The email address '$post_email' is already has an account.\", 'err'=>$rc['err']));\n } elseif( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.174', 'msg'=>\"Unable to add the email address.\", 'err'=>$rc['err']));\n }\n\n //\n // Check to make sure this email does not already exist\n //\n $rc = ciniki_core_objectUpdate($ciniki, $tnid, 'ciniki.customers.email', $email['id'], array(\n 'email'=>$email,\n ));\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.175', 'msg'=>\"Unable to add the email address.\", 'err'=>$rc['err']));\n }\n\n return array('stat'=>'ok');\n}", "private function addAddress($options)\n {\n if ($address = $options['billing_address'] ?: $options['address']) {\n $this->post->addChild('ZipCode', $address['zip']);\n }\n }", "public function addAddress($request);", "public function addCustomerSignup($email, $listCode, $sourceCode, $attributes = null);", "public function createCustomer($customerExtId);", "public function createCustomer(\n $customer_id,\n $email,\n array $attributes = []\n ) {\n $endpoint = \"{$this->domain}/v1/customers/{$customer_id}\";\n $params = array_merge($attributes, ['email' => $email]);\n $params = http_build_query($params);\n\n $request = $this->buildRequestObject([\n \\CURLOPT_HTTPHEADER => [\n 'Content-Type' => 'application/x-www-form-urlencoded',\n ]\n ]);\n $response = $request->put($endpoint, $params);\n return $this->processResponse($response);\n }", "public function callCustomerAddressCreate(int $customerId, array $data)\n\t{\n\t\treturn $this->soapClient->customerAddressCreate($this->soapSessionId, $customerId, $data);\n\t}", "public function createCustomer()\n {\n //Data\n $userData = $this->loadData('generic_customer_account', null, 'email');\n $addressData = $this->loadData('all_fields_address');\n //Steps\n $this->navigate('manage_customers');\n $this->customerHelper()->createCustomer($userData, $addressData);\n //Verifying\n $this->assertMessagePresent('success', 'success_saved_customer');\n\n return $userData['email'];\n }", "function ciniki_customers_hooks_customerAdd(&$ciniki, $tnid, $args) {\n \n if( !isset($args['first']) ) { $args['first'] = ''; }\n if( !isset($args['last']) ) { $args['last'] = ''; }\n if( !isset($args['name']) ) { $args['name'] = ''; }\n if( !isset($args['company']) ) { $args['company'] = ''; }\n\n $args['short_description'] = '';\n\n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'private', 'checkAccess');\n $rc = ciniki_customers_checkAccess($ciniki, $tnid, 'ciniki.customers.hooks.customerAdd', 0); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $modules = $rc['modules'];\n\n //\n // Get the current settings\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'private', 'getSettings');\n $rc = ciniki_customers_getSettings($ciniki, $tnid);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $settings = $rc['settings'];\n\n //\n // They must specify either a firstname or lastname\n //\n if( (!isset($args['first']) || $args['first'] == '') \n && (!isset($args['last']) || $args['last'] == '')\n && (!isset($args['name']) || $args['name'] == '')\n && (!isset($args['company']) || $args['company'] == '')\n ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.9', 'msg'=>'You must specify a first or last name'));\n }\n\n //\n // Check for a start date, default to now\n //\n if( !isset($args['start_date']) || $args['start_date'] == '' ) {\n $args['start_date'] = gmdate('Y-m-d H:i:s');\n }\n\n //\n // Check to make sure eid is unique if specified\n //\n if( isset($args['eid']) && $args['eid'] != '' ) {\n $strsql = \"SELECT id \"\n . \"FROM ciniki_customers \"\n . \"WHERE eid = '\" . ciniki_core_dbQuote($ciniki, $args['eid']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.customers', 'parent');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( $rc['num_rows'] > 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.10', 'msg'=>'The customer ID already exists.'));\n }\n }\n\n //\n // Check if trying to make a child customer\n //\n if( isset($args['parent_id']) && $args['parent_id'] > 0 ) {\n // \n // Check to make sure the parent is not a child\n //\n $strsql = \"SELECT id, parent_id \"\n . \"FROM ciniki_customers \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $args['parent_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.customers', 'parent');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['parent']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.11', 'msg'=>'The parent does not exist.'));\n }\n if( isset($rc['parent']) && $rc['parent']['parent_id'] > 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.12', 'msg'=>'The parent is already a child.'));\n }\n }\n\n //\n // Check if name should be parsed\n //\n if( $args['first'] == '' && $args['last'] == '' && $args['name'] != '' ) {\n // Check for a comma to see if was entered, \"last, first\"\n if( preg_match('/^\\s*(.*),\\s*(.*)\\s*$/', $args['name'], $matches) ) {\n $args['last'] = $matches[1];\n $args['first'] = $matches[2];\n } elseif( preg_match('/^\\s*(.*)\\s([^\\s]+)\\s*$/', $args['name'], $matches) ) {\n $args['first'] = $matches[1];\n $args['last'] = $matches[2];\n } else {\n // Default to add name to first field instead of last field\n $args['first'] = $args['name'];\n }\n }\n //\n // Determine the display name\n //\n $space = '';\n $person_name = '';\n $args['sort_name'] = '';\n if( isset($args['prefix']) && $args['prefix'] != '' ) {\n $person_name .= $args['prefix'];\n }\n if( $space == '' && $person_name != '' ) { $space = ' '; }\n if( isset($args['first']) && $args['first'] != '' ) {\n $person_name .= $space . $args['first'];\n }\n if( $space == '' && $person_name != '' ) { $space = ' '; }\n if( isset($args['middle']) && $args['middle'] != '' ) {\n $person_name .= $space . $args['middle'];\n }\n if( $space == '' && $person_name != '' ) { $space = ' '; }\n if( isset($args['last']) && $args['last'] != '' ) {\n $person_name .= $space . $args['last'];\n }\n if( $space == '' && $person_name != '' ) { $space = ' '; }\n if( isset($args['suffix']) && $args['suffix'] != '' ) {\n $person_name .= ($space!=''?',':'') . $space . $args['suffix'];\n }\n $sort_person_name = '';\n if( isset($args['last']) && $args['last'] != '' ) {\n $sort_person_name = $args['last'];\n }\n if( isset($args['first']) && $args['first'] != '' ) {\n $sort_person_name .= ($sort_person_name!=''?', ':'') . $args['first'];\n }\n if( $args['type'] == 2 && $args['company'] != '' ) {\n // Find the format to use\n $format = 'company';\n if( isset($args['display_name_format']) && $args['display_name_format'] != '' ) {\n $format = $args['display_name_format'];\n } elseif( !isset($settings['display-name-business-format']) \n || $settings['display-name-business-format'] == 'company' ) {\n $format = 'company';\n } elseif( $settings['display-name-business-format'] != '' ) {\n $format = $settings['display-name-business-format'];\n }\n // Format the display_name\n if( $format == 'company' ) {\n $args['display_name'] = $args['company'];\n $args['sort_name'] = $args['company'];\n } \n elseif( $format == 'company - person' ) {\n $args['display_name'] = $args['company'] . ($person_name != ''?' - ' . $person_name:'');\n $args['sort_name'] = $args['company'];\n } \n elseif( $format == 'person - company' ) {\n $args['display_name'] = ($person_name!=''?$person_name . ' - ':'') . $args['company'];\n $args['sort_name'] = ($sort_person_name!=''?$sort_person_name.', ':'') . $args['company'];\n } \n elseif( $format == 'company [person]' ) {\n $args['display_name'] = $args['company'] . ($person_name!=''?' [' . $person_name . ']':'');\n $args['sort_name'] = $args['company'];\n } \n elseif( $format == 'person [company]' ) {\n if( $person_name == '' ) {\n $args['display_name'] = $args['company'];\n } else {\n $args['display_name'] = $person_name . ' [' . $args['company'] . ']';\n }\n $args['sort_name'] = ($sort_person_name!=''?$sort_person_name.', ':'') . $args['company'];\n }\n } else {\n $args['display_name'] = $person_name;\n $args['sort_name'] = $sort_person_name;\n }\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'makePermalink');\n $args['permalink'] = ciniki_core_makePermalink($ciniki, $args['display_name']);\n \n // \n // Turn off autocommit\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbInsert');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.customers');\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.customers.customer', $args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $customer_id = $rc['id'];\n\n //\n // Check if phone numbers to add\n //\n for($i=1;$i<5;$i++) {\n if( isset($args[\"phone_number_$i\"]) && $args[\"phone_number_$i\"] != '' ) {\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.customers.phone',\n array('customer_id'=>$customer_id,\n 'phone_label'=>$args[\"phone_label_$i\"],\n 'phone_number'=>$args[\"phone_number_$i\"],\n 'flags'=>(isset($args[\"phone_flags_$i\"])?$args[\"phone_flags_$i\"]:0)), 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return $rc;\n }\n }\n }\n\n //\n // Check if email address was specified, and add to customer emails\n //\n $email_id = 0;\n if( isset($args['email_address']) && $args['email_address'] != '' ) {\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.customers.email',\n array('customer_id'=>$customer_id,\n 'email'=>$args['email_address'],\n 'password'=>'',\n 'temp_password'=>'',\n 'temp_password_date'=>'',\n 'flags'=>(isset($args['flags'])?$args['flags']:1),\n ), 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return $rc;\n }\n $email_id = $rc['id'];\n }\n\n //\n // Check if there is an address to add\n //\n $address_id = 0;\n if( (isset($args['address1']) && $args['address1'] != '' ) \n || (isset($args['address2']) && $args['address2'] != '' )\n || (isset($args['city']) && $args['city'] != '' )\n || (isset($args['province']) && $args['province'] != '' )\n || (isset($args['postal']) && $args['postal'] != '' )\n ) {\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.customers.address',\n array('customer_id'=>$customer_id,\n 'flags'=>(isset($args['address_flags'])?$args['address_flags']:0x07),\n 'address1'=>$args['address1'],\n 'address2'=>$args['address2'],\n 'city'=>$args['city'],\n 'province'=>$args['province'],\n 'postal'=>$args['postal'],\n 'country'=>$args['country'],\n 'latitude'=>(isset($args['latitude'])?$args['latitude']:''),\n 'longitude'=>(isset($args['longitude'])?$args['longitude']:''),\n 'phone'=>(isset($args['phone'])?$args['phone']:''),\n 'notes'=>'',\n ), 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return $rc;\n }\n $address_id = $rc['id'];\n }\n\n if( isset($args['link_url_1']) && $args['link_url_1'] != '' ) {\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.customers.link',\n array('customer_id'=>$customer_id,\n 'name'=>$args['link_name_1'],\n 'url'=>$args['link_url_1'],\n 'webflags'=>$args['link_webflags_1'],\n 'description'=>'',\n ), 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return $rc;\n }\n }\n\n //\n // Check for subscriptions\n //\n if( isset($args['subscriptions']) || isset($args['unsubscriptions']) ) {\n // incase one of the args isn't set, setup with blank arrays\n if( !isset($args['subscriptions']) ) { $args['subscriptions'] = array(); }\n if( !isset($args['unsubscriptions']) ) { $args['unsubscriptions'] = array(); }\n ciniki_core_loadMethod($ciniki, 'ciniki', 'subscriptions', 'private', 'updateCustomerSubscriptions');\n $rc = ciniki_subscriptions_updateCustomerSubscriptions($ciniki, $tnid, \n $customer_id, $args['subscriptions'], $args['unsubscriptions']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n\n //\n // Update the categories\n //\n if( isset($args['customer_categories']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'tagsUpdate');\n $rc = ciniki_core_tagsUpdate($ciniki, 'ciniki.customers', 'tag', $tnid,\n 'ciniki_customer_tags', 'ciniki_customer_history',\n 'customer_id', $customer_id, 10, $args['customer_categories']);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return $rc;\n }\n }\n\n //\n // Update the tags\n //\n if( isset($args['customer_tags']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'tagsUpdate');\n $rc = ciniki_core_tagsUpdate($ciniki, 'ciniki.customers', 'tag', $tnid,\n 'ciniki_customer_tags', 'ciniki_customer_history',\n 'customer_id', $customer_id, 20, $args['customer_tags']);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return $rc;\n }\n }\n\n //\n // Update the member categories\n //\n if( isset($args['member_categories']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'tagsUpdate');\n $rc = ciniki_core_tagsUpdate($ciniki, 'ciniki.customers', 'tag', $tnid,\n 'ciniki_customer_tags', 'ciniki_customer_history',\n 'customer_id', $customer_id, 40, $args['member_categories']);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return $rc;\n }\n }\n\n //\n // Update the dealer categories\n //\n if( isset($args['dealer_categories']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'tagsUpdate');\n $rc = ciniki_core_tagsUpdate($ciniki, 'ciniki.customers', 'tag', $tnid,\n 'ciniki_customer_tags', 'ciniki_customer_history',\n 'customer_id', $customer_id, 60, $args['dealer_categories']);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return $rc;\n }\n }\n\n //\n // Update the distributor categories\n //\n if( isset($args['distributor_categories']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'tagsUpdate');\n $rc = ciniki_core_tagsUpdate($ciniki, 'ciniki.customers', 'tag', $tnid,\n 'ciniki_customer_tags', 'ciniki_customer_history',\n 'customer_id', $customer_id, 80, $args['distributor_categories']);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return $rc;\n }\n }\n\n //\n // Update the short_description\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'private', 'customerUpdateShortDescription');\n $rc = ciniki_customers_customerUpdateShortDescription($ciniki, $tnid, $customer_id, 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return $rc;\n }\n\n //\n // Update the season membership\n //\n if( ($modules['ciniki.customers']['flags']&0x02000000) > 0 ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'private', 'customerUpdateSeasons');\n $rc = ciniki_customers_customerUpdateSeasons($ciniki, $tnid, $customer_id);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return $rc;\n }\n }\n\n //\n // Commit the database changes\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.customers');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $tnid, 'ciniki', 'customers');\n\n $ciniki['syncqueue'][] = array('push'=>'ciniki.customers.customer', \n 'args'=>array('id'=>$customer_id));\n\n $rsp = array('stat'=>'ok', 'id'=>$customer_id);\n\n return $rsp;\n}", "public function agregarCliente()\n {\n $openpay = Openpay::getInstance('mdk69ifh7gkdr8czjl2o',\n 'sk_ed0e3f79120844769f6ca17959885783');\n\n $customerData = array(\n 'external_id' => '',\n 'name' => 'customer name',\n 'last_name' => '',\n 'email' => '[email protected]',\n 'requires_account' => false,\n 'phone_number' => '44209087654',\n 'address' => array(\n 'line1' => 'Calle 10',\n 'line2' => 'col. san pablo',\n 'line3' => 'entre la calle 1 y la 2',\n 'state' => 'Queretaro',\n 'city' => 'Queretaro',\n 'postal_code' => '76000',\n 'country_code' => 'MX'\n )\n );\n\n $customer = $openpay->customers->add($customerData);\n var_dump($customer);\n }", "private function createAddress(Customer $customer, array $ecster_address, $type)\n {\n $address = new Address();\n $address->firstname = $this->splitNames($ecster_address, 'firstname');\n $address->lastname = $this->splitNames($ecster_address, 'lastname');\n $address->address1 = $ecster_address['address'];\n $address->postcode = $ecster_address['zip'];\n $address->phone = $ecster_address['cellular'];\n $address->phone_mobile = $ecster_address['cellular'];\n $address->city = $ecster_address['city'];\n $address->id_country = (int)Country::getByIso('se');\n $address->id_customer = $customer->id;\n $address->alias = 'Ecster address';\n $address->add();\n if ($type == 'shipping') {\n $this->ecsterCart->id_address_delivery = $address->id;\n }\n if ($type == 'invoice') {\n $this->ecsterCart->id_address_invoice = $address->id;\n }\n }", "public function addAddress($aRequest)\n\t{\n\t}", "public function addCustomer($params= ['username'=>'[email protected]','passwd'=>'Addresss123','name'=>'Kevin Morgan','company'=>'Vertex Advertiisng','address-line-1'=>'address-line-1','city'=>'Liverpool','state'=>'NSW','country'=>'AU','zipcode'=>'2170','phone-cc'=>'20','phone'=>'01000433553','lang-pref'=>'en']){\n\n\t\t return $this->callResellerClubEndpoint('customers/signup', 'POST' , $params);\n\n\t}", "public function add_email( $fb_page_id, $name, $email_address ) {\n // We only want lowercase email addresses\n\t\t$email_address = strtolower( $email_address );\n\n // Get account\n $account = $this->get_account( $fb_page_id );\n\n\t\t// We need to get the email_id\n $email = new Email();\n $email->get_by_email( $account->id, $email_address );\n\n // The status needs to be 1 in either case of existence or lack thereof\n $email->status = 1;\n\n // Add or update email address\n\t\tif ( $email->id ) {\n $email->save();\n\t\t} else {\n $email->website_id = $account->id;\n $email->name = $name;\n $email->email = $email_address;\n $email->create();\n\t\t}\n\n\t\t// Get default email list id\n $email_list = new EmailList();\n $email_list->get_default_email_list( $account->id );\n\n // Add association\n $email->add_associations( array( $email_list->id ) );\n\t}", "function acteol_add_contact() {\n $first_name = (isset($_POST['first_name']) && $_POST['first_name'] != '') ? $_POST['first_name'] : null;\n $last_name = (isset($_POST['last_name']) && $_POST['last_name'] != '') ? $_POST['last_name'] : null;\n $email = (isset($_POST['email'])) ? $_POST['email'] : null;\n $supinfo_status = (isset($_POST['supinfo_status'])) ? $_POST['supinfo_status'] : null;\n $source_id = (isset($_POST['source_id'])) ? $_POST['source_id'] : null;\n $local_business = (isset($_POST['local_business']) && $_POST['local_business'] != '') ? $_POST['local_business'] : null;\n $local_business_code = (isset($_POST['local_business_code']) && $_POST['local_business_code'] != '') ? $_POST['local_business_code'] : null;\n \n // Declare response array to pass back to JS\n $response_arr = array(\n 'error' => false,\n );\n \n if ($first_name == null || $last_name == null || $email == null) {\n $response_arr['error'] = true;\n $response_arr['message'] = 'Users email or name details are not valid.';\n echo json_encode($response_arr);\n wp_die();\n }\n\n /**\n * Atreemo API details\n */\n $apiEndpoint = 'https://atreemo.mail.marugame.co.uk/';\n $user = '[email protected]';\n $pass = '1Gnite0livia2021!';\n\n \n /**\n * 1. Authorization\n */\n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_URL => $apiEndpoint . \"/token\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_SSL_VERIFYPEER => false,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => \"grant_type=password&username=\" . $user . \"&password=\" . $pass,\n CURLOPT_HTTPHEADER => array(\n \"cache-control: no-cache\",\n \"content-type: application/x-www-form-urlencoded\",\n ),\n ));\n\n $auth = curl_exec($curl);\n $err = curl_error($curl);\n curl_close($curl);\n\n // Retrieve the access token\n $auth = json_decode($auth);\n $access_token = $auth->{'access_token'};\n\n if ($access_token) {\n /**\n * 2. Check if user is already signed up\n */\n \n $curl = curl_init();\n \n curl_setopt_array($curl, array(\n CURLOPT_URL => $apiEndpoint . \"/api/Contact/GetContacts?criteria=\" . $email,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_HTTPHEADER => array(\n \"authorization: Bearer \" . $access_token,\n \"cache-control: no-cache\",\n \"content-type: application/json\",\n ),\n ));\n \n $response = curl_exec($curl);\n $err = curl_error($curl);\n curl_close($curl);\n \n if ($response != '[]') {\n $response_arr['user_data'] = json_decode($response);\n $response_arr['message'] = 'User already exists';\n echo json_encode($response_arr);\n wp_die();\n }\n\n /**\n * 3. If user is not signed up, add as a new contact\n */\n\n $content = array(\n 'FirstName' => $first_name,\n 'LastName' => $last_name,\n 'Email' => $email,\n 'SourceID' => $source_id,\n 'SupInfo' => array(\n array(\n 'FieldName' => 'status',\n 'FieldContent' => $supinfo_status,\n ),\n )\n );\n\n if ($local_business) {\n $content['SupInfo'][] = array(\n 'FieldName' => 'localbusiness',\n 'FieldContent' => $local_business,\n );\n }\n if ($local_business_code) {\n $content['SupInfo'][] = array(\n 'FieldName' => 'localbusinesscode',\n 'FieldContent' => $local_business_code,\n );\n }\n\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => $apiEndpoint . \"/api/Contact/PostContact\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_SSL_VERIFYPEER => false,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => json_encode($content),\n CURLOPT_HTTPHEADER => array(\n \"authorization: Bearer \" . $access_token,\n \"cache-control: no-cache\",\n \"content-type: application/json\",\n ),\n ));\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n \n // Get the Customer ID that has been assigned by Acteol\n $response = json_decode($response);\n $ctc_id = $response->{'CtcID'};\n $response_arr['CtcID'] = $ctc_id;\n \n\n /**\n * 4. Set the user's preferences as opted-in to emails\n */\n $content = array(\n 'CustomerID' => $ctc_id,\n 'EmailOptin' => true,\n );\n\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => $apiEndpoint . \"/api/CommunicationPreference/Post\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_SSL_VERIFYPEER => false,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => json_encode($content),\n CURLOPT_HTTPHEADER => array(\n \"authorization: Bearer \" . $access_token,\n \"cache-control: no-cache\",\n \"content-type: application/json\",\n ),\n ));\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n $response_arr['step_4'] = json_decode($response);\n\n\n /**\n * 5. Create a Member Number for the user. They will use this number to log in to the loyalty page.\n */\n\n // REMOVED AS NO LONGER NEEDED.\n // MEMBER # IS BEING ADDED BY THE ACTEOL GUYS\n \n // $curl = curl_init();\n \n // curl_setopt_array($curl, array(\n // CURLOPT_URL => $apiEndpoint . \"/api/Contact/AddMemberNumber?CtcID=\" . $ctc_id,\n // CURLOPT_RETURNTRANSFER => true,\n // CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n // CURLOPT_HTTPHEADER => array(\n // \"authorization: Bearer \" . $access_token,\n // \"cache-control: no-cache\",\n // \"content-type: application/json\",\n // ),\n // ));\n \n // $response = curl_exec($curl);\n // $err = curl_error($curl);\n // curl_close($curl);\n \n } else {\n $response_arr['error'] = true;\n $response_arr['message'] = 'API authorization failed';\n }\n \n echo json_encode($response_arr);\n wp_die();\n}", "public function fleetAddAddress( array $request_body )\n {\n\n $endpoint = '/fleet/add_address';\n $data = ['access_token' => $this->config['access_token']];\n\n // combine $data array and $addresses array into single $data array\n $data = $data + $request_body;\n\n // check to see if group_id key is in array, if not add default group_id from config class\n // @todo move into checkFleetAddress private function\n if(array_key_exists('group_id', $data)) {\n $group_id = ['groupId' => $this->config['group_id']];\n $data = $data = $group_id;\n }\n\n // Make API Call\n $result = samsara::callAPI('POST', $this->config['base_url'] . $endpoint, $data);\n\n return $result;\n\n }", "function addAddress()\n {\n $user = common_current_user();\n\n $screenname = $this->trimmed('screenname');\n $transport = $this->trimmed('transport');\n\n // Some validation\n\n if (!$screenname) {\n // TRANS: Message given saving IM address without having provided one.\n $this->showForm(_('No screenname.'));\n return;\n }\n\n if (!$transport) {\n // TRANS: Form validation error when no transport is available setting an IM address.\n $this->showForm(_('No transport.'));\n return;\n }\n\n Event::handle('NormalizeImScreenname', array($transport, &$screenname));\n\n if (!$screenname) {\n // TRANS: Message given saving IM address that cannot be normalised.\n $this->showForm(_('Cannot normalize that screenname.'));\n return;\n }\n $valid = false;\n Event::handle('ValidateImScreenname', array($transport, $screenname, &$valid));\n if (!$valid) {\n // TRANS: Message given saving IM address that not valid.\n $this->showForm(_('Not a valid screenname.'));\n return;\n } else if ($this->screennameExists($transport, $screenname)) {\n // TRANS: Message given saving IM address that is already set for another user.\n $this->showForm(_('Screenname already belongs to another user.'));\n return;\n }\n\n $confirm = new Confirm_address();\n\n $confirm->address = $screenname;\n $confirm->address_type = $transport;\n $confirm->user_id = $user->id;\n $confirm->code = common_confirmation_code(64);\n $confirm->sent = common_sql_now();\n $confirm->claimed = common_sql_now();\n\n $result = $confirm->insert();\n\n if ($result === false) {\n common_log_db_error($confirm, 'INSERT', __FILE__);\n // TRANS: Server error thrown on database error adding Instant Messaging confirmation code.\n $this->serverError(_('Could not insert confirmation code.'));\n return;\n }\n\n Event::handle('SendImConfirmationCode', array($transport, $screenname, $confirm->code, $user));\n\n // TRANS: Message given saving valid IM address that is to be confirmed.\n $msg = _('A confirmation code was sent '.\n 'to the IM address you added.');\n\n $this->showForm($msg, true);\n }", "private function fillRequestWithAccountData(string $email): void\n {\n $this->getRequest()\n ->setMethod(HttpRequest::METHOD_POST)\n ->setParam(CustomerInterface::FIRSTNAME, 'firstname1')\n ->setParam(CustomerInterface::LASTNAME, 'lastname1')\n ->setParam(CustomerInterface::EMAIL, $email)\n ->setParam('password', '_Password1')\n ->setParam('password_confirmation', '_Password1')\n ->setParam('telephone', '5123334444')\n ->setParam('street', ['1234 fake street', ''])\n ->setParam('city', 'Austin')\n ->setParam('postcode', '78701')\n ->setParam('country_id', 'US')\n ->setParam('default_billing', '1')\n ->setParam('default_shipping', '1')\n ->setParam('is_subscribed', '0')\n ->setPostValue('create_address', true);\n }", "public function hookActionCustomerAccountUpdate($params)\n {\n if ($this->api) {\n /** @var Customer|CustomerCore|null $customer */\n $customer = isset($params['customer']) ? $params['customer'] : null;\n\n if (empty($customer)) {\n return false;\n }\n\n /** @var Cart|CartCore|null $cart */\n $cart = isset($params['cart']) ? $params['cart'] : null;\n\n /** @var array $customerSend */\n $customerSend = RetailcrmOrderBuilder::buildCrmCustomer($customer);\n\n /** @var \\RetailcrmAddressBuilder $addressBuilder */\n $addressBuilder = new RetailcrmAddressBuilder();\n\n /** @var Address|\\AddressCore|array $address */\n $address = [];\n\n if (isset($customerSend['externalId'])) {\n $customerData = $this->api->customersGet($customerSend['externalId']);\n\n // Necessary part if we don't want to overwrite other phone numbers.\n if ($customerData instanceof RetailcrmApiResponse\n && $customerData->isSuccessful()\n && $customerData->offsetExists('customer')\n ) {\n $customerSend['phones'] = $customerData['customer']['phones'];\n }\n\n // Workaround: PrestaShop will return OLD address data, before editing.\n // In order to circumvent this we are using post data to fill new address object.\n if (Tools::getIsset('submitAddress')\n && Tools::getIsset('id_customer')\n && Tools::getIsset('id_address')\n ) {\n $address = new Address(Tools::getValue('id_address'));\n\n foreach (array_keys(Address::$definition['fields']) as $field) {\n if (property_exists($address, $field) && Tools::getIsset($field)) {\n $address->$field = Tools::getValue($field);\n }\n }\n } else {\n $addresses = $customer->getAddresses($this->default_lang);\n $address = array_shift($addresses);\n }\n\n if (!empty($address)) {\n $addressBuilder->setMode(RetailcrmAddressBuilder::MODE_CUSTOMER);\n\n if (is_object($address)) {\n $addressBuilder->setAddress($address);\n } else {\n $addressBuilder->setAddressId($address['id_address']);\n }\n\n $addressBuilder->build();\n } elseif (!empty($cart)) {\n $addressBuilder\n ->setMode(RetailcrmAddressBuilder::MODE_ORDER_DELIVERY)\n ->setAddressId($cart->id_address_invoice)\n ->build()\n ;\n }\n\n $customerSend = RetailcrmTools::mergeCustomerAddress($customerSend, $addressBuilder->getDataArray());\n\n $this->api->customersEdit($customerSend);\n\n return true;\n }\n }\n\n return false;\n }", "public function customer_new_account( $customer_id = 0, array $new_customer_data = array() ) {\n\t\tif ( ! self::is_feature_enabled() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $customer_id ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$new_account_email = new CustomerNewAccount( $this->package );\n\t\t$new_account_email->trigger( $customer_id, $new_customer_data );\n\t}", "public function addAddress($userId, $data) {\n\t $this->db->query(\"INSERT INTO \" . DB_PREFIX . \"address SET customer_id = '\" . $userId . \"', firstname = '\" . $this->db->escape($data['firstname']) . \"', lastname = '\" . $this->db->escape($data['lastname']) . \"', company = '\" . $this->db->escape($data['company']) . \"', company_id = '\" . $this->db->escape(isset($data['company_id']) ? $data['company_id'] : '') . \"', tax_id = '\" . $this->db->escape(isset($data['tax_id']) ? $data['tax_id'] : '') . \"', address_1 = '\" . $this->db->escape($data['address_1']) . \"', address_2 = '\" . $this->db->escape($data['address_2']) . \"', postcode = '\" . $this->db->escape($data['postcode']) . \"', city = '\" . $this->db->escape($data['city']) . \"', zone_id = '\" . (int)$data['zone_id'] . \"', country_id = '\" . (int)$data['country_id'] . \"'\");\n\t\n\t $address_id = $this->db->getLastId();\n\t\n\t if (!empty($data['default'])) {\n\t $this->db->query(\"UPDATE \" . DB_PREFIX . \"customer SET address_id = '\" . (int)$address_id . \"' WHERE customer_id = '\" . $userId . \"'\");\n\t }\n\t\n\t return $address_id;\n\t}", "private function addCustomerData($options)\n {\n $this->post->addChild('Customer_Ref', $options->customer);\n $this->post->addChild('Client_IP', $options->ip);\n $this->post->addChild('Client_Email', $options->email);\n }", "function ciniki_customers_customerAdd(&$ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'parent_id'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Parent'), \n 'eid'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Customer ID'), \n 'status'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Status'),\n 'type'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Customer Type'), \n// 'member_status'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Member Status'), \n// 'member_lastpaid'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'datetimetoutc', 'name'=>'Member Last Paid'),\n// 'membership_length'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Membership Length'),\n// 'membership_type'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Membership Type'),\n// 'dealer_status'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Dealer Status'), \n// 'distributor_status'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Distributor Status'), \n 'callsign'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Callsign'), \n 'prefix'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Name Prefix'), \n 'first'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'First Name'), \n 'middle'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Middle Name'), \n 'last'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Last Name'), \n 'suffix'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Name Suffix'), \n// 'display_name_format'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Display Name Format'), \n 'company'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Company'), \n 'department'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Company Department'), \n 'title'=>array('required'=>'no', 'blank'=>'yes', 'default'=>'', 'name'=>'Company Title'), \n 'phone_home'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Home Phone'), \n 'phone_work'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Work Phone'), \n 'phone_cell'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Cell Phone'), \n 'phone_fax'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Fax Number'), \n 'primary_email'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Primary Email Address'), \n 'primary_email_flags'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Primary Email Options'), \n 'secondary_email'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Secondary Email Address'), \n 'secondary_email_flags'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Secondary Email Options'), \n 'mailing_address1'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Mailing Address'),\n 'mailing_address2'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Mailing Address'),\n 'mailing_city'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Mailing City'),\n 'mailing_province'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Mailing Province'),\n 'mailing_postal'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Mailing Postal'),\n 'mailing_country'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Mailing Country'),\n 'mailing_flags'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Billing Address'),\n 'billing_address1'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Billing Address'),\n 'billing_address2'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Billing Address'),\n 'billing_city'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Billing City'),\n 'billing_province'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Billing Province'),\n 'billing_postal'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Billing Postal'),\n 'billing_country'=>array('required'=>'no', 'trimblanks'=>'yes', 'blank'=>'yes', 'name'=>'Billing Country'),\n 'notes'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Notes'), \n 'birthdate'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'date', 'name'=>'Birthday'), \n 'connection'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Connection'), \n 'language'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Language'), \n 'start_date'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'datetimetoutc', 'name'=>'Start Date'), \n 'subscriptions'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'idlist', 'name'=>'Subscriptions'),\n 'unsubscriptions'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'idlist', 'name'=>'Unsubscriptions'),\n// 'customer_categories'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Customer Categories'),\n// 'customer_tags'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Customer Tags'),\n// 'member_categories'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Member Categories'),\n// 'dealer_categories'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Dealer Categories'),\n// 'distributor_categories'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Distributor Categories'),\n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n\n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'private', 'checkAccess');\n $rc = ciniki_customers_checkAccess($ciniki, $args['tnid'], 'ciniki.customers.customerAdd'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $perms = $rc['perms'];\n\n //\n // Filter arguments\n //\n if( isset($args['callsign']) ) {\n $args['callsign'] = strtoupper($args['callsign']);\n }\n\n //\n // Separate out phone and email args so they don't get written to ciniki_customers table\n //\n $email_args = array();\n $phone_args = array();\n foreach(['primary_email', 'primary_email_flags', 'secondary_email', 'secondary_email_flags'] AS $field) {\n if( isset($args[$field]) ) {\n $email_args[$field] = $args[$field];\n unset($args[$field]);\n }\n }\n foreach(['phone_home', 'phone_work', 'phone_cell', 'phone_fax'] AS $field) {\n if( isset($args[$field]) ) {\n $phone_args[$field] = $args[$field];\n unset($args[$field]);\n }\n }\n\n //\n // Get the current settings\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'private', 'getSettings');\n $rc = ciniki_customers_getSettings($ciniki, $args['tnid']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $settings = $rc['settings'];\n\n //\n // Check to make sure eid is unique if specified\n //\n if( isset($args['eid']) && $args['eid'] != '' ) {\n $strsql = \"SELECT id \"\n . \"FROM ciniki_customers \"\n . \"WHERE eid = '\" . ciniki_core_dbQuote($ciniki, $args['eid']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.customers', 'eid');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( $rc['num_rows'] > 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.296', 'msg'=>'The customer ID already exists'));\n }\n }\n\n //\n // Check parent id is specified if child account\n //\n if( ($args['type'] == 21 || $args['type'] == 22) && (!isset($args['parent_id']) || $args['parent_id'] == '' || $args['parent_id'] <= 0) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.308', 'msg'=>'You must specifiy the family'));\n } elseif( ($args['type'] == 31 || $args['type'] == 32) && (!isset($args['parent_id']) || $args['parent_id'] == '' || $args['parent_id'] <= 0) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.309', 'msg'=>'You must specifiy the employer'));\n }\n\n //\n // Check if trying to make a child customer\n //\n if( isset($args['parent_id']) && $args['parent_id'] > 0 ) {\n // \n // Check to make sure the parent is not a child\n //\n $strsql = \"SELECT id, parent_id \"\n . \"FROM ciniki_customers \"\n . \"WHERE id = '\" . ciniki_core_dbQuote($ciniki, $args['parent_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.customers', 'parent');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['parent']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.297', 'msg'=>'The parent does not exist'));\n }\n if( isset($rc['parent']) && $rc['parent']['parent_id'] > 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.298', 'msg'=>'The parent is already a child'));\n }\n }\n\n // \n // Turn off autocommit\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbInsert');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.customers');\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Setup the display name, sort name and permalink\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'private', 'customerUpdateName');\n $rc = ciniki_customers_customerUpdateName($ciniki, $args['tnid'], $args, 0, $args);\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.412', 'msg'=>'Unable to update name', 'err'=>$rc['err']));\n }\n $args['display_name'] = $rc['display_name'];\n $args['sort_name'] = $rc['sort_name'];\n $args['permalink'] = $rc['permalink'];\n\n //\n // Add the customer\n //\n if( isset($args['first']) || isset($args['last']) || isset($args['company']) ) {\n\n //\n // Setup the display name, sort name and permalink\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'private', 'customerUpdateName');\n $rc = ciniki_customers_customerUpdateName($ciniki, $args['tnid'], $args, 0, $args);\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.411', 'msg'=>'Unable to update name', 'err'=>$rc['err']));\n }\n $args['display_name'] = $rc['display_name'];\n $args['sort_name'] = $rc['sort_name'];\n $args['permalink'] = $rc['permalink'];\n\n/* //\n // Build the persons name\n //\n $space = '';\n $person_name = '';\n $sort_person_name = '';\n if( isset($args['prefix']) && $args['prefix'] != '' ) {\n $person_name .= $args['prefix'];\n }\n if( $space == '' && $person_name != '' ) { $space = ' '; }\n if( isset($args['first']) && $args['first'] != '' ) {\n $person_name .= $space . $args['first'];\n }\n if( $space == '' && $person_name != '' ) { $space = ' '; }\n if( isset($args['middle']) && $args['middle'] != '' ) {\n $person_name .= $space . $args['middle'];\n }\n if( $space == '' && $person_name != '' ) { $space = ' '; }\n if( isset($args['last']) && $args['last'] != '' ) {\n $person_name .= $space . $args['last'];\n $sort_person_name = $args['last'];\n }\n if( $space == '' && $person_name != '' ) { $space = ' '; }\n if( isset($args['suffix']) && $args['suffix'] != '' ) {\n $person_name .= ($space!=''?',':'') . $space . $args['suffix'];\n }\n\n if( isset($args['first']) && $args['first'] != '' ) {\n $sort_person_name .= ($sort_person_name!=''?', ':'') . $args['first'];\n }\n //\n // Build the display_name\n //\n $type = $args['type'];\n $company = (isset($args['company'])?$args['company']:'');\n if( ($type == 2 || $type == 20 || $type = 30) && $company != '' ) {\n $format = 'company';\n if( !isset($settings['display-name-business-format']) || $settings['display-name-business-format'] == 'company' ) {\n $format = 'company';\n } elseif( $settings['display-name-business-format'] != '' ) {\n $format = $settings['display-name-business-format'];\n }\n // Format the display_name\n if( $format == 'company' ) {\n $args['display_name'] = $company;\n $args['sort_name'] = $company;\n } \n elseif( $format == 'company - person' ) {\n $args['display_name'] = $company . ($person_name!=''?' - ' . $person_name:'');\n $args['sort_name'] = $company;\n } \n elseif( $format == 'person - company' ) {\n $args['display_name'] = ($person_name!=''?$person_name . ' - ':'') . $company;\n $args['sort_name'] = ($sort_person_name!=''?$sort_person_name.', ':'') . $company;\n } \n elseif( $format == 'company [person]' ) {\n $args['display_name'] = $company . ($person_name!=''?' [' . $person_name . ']':'');\n $args['sort_name'] = $company;\n } \n elseif( $format == 'person [company]' ) {\n $args['display_name'] = ($person_name!=''?$person_name . ' [' . $company . ']':$company);\n $args['sort_name'] = ($sort_person_name!=''?$sort_person_name.', ':'') . $company;\n }\n } else {\n $args['display_name'] = $person_name;\n $args['sort_name'] = $sort_person_name;\n } */\n } else {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.299', 'msg'=>'You must specific a name', 'err'=>$rc['err']));\n }\n \n// ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'makePermalink');\n// $args['permalink'] = ciniki_core_makePermalink($ciniki, $args['display_name']);\n\n //\n // Check to make sure name is unique\n //\n if( $args['type'] == 10 || $args['type'] == 20 || $args['type'] == 30 ) {\n $strsql = \"SELECT COUNT(*) AS num \"\n . \"FROM ciniki_customers \"\n . \"WHERE permalink = '\" . ciniki_core_dbQuote($ciniki, $args['permalink']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n //\n // Child customers cannot have duplicate names within the same business/family\n //\n if( $args['type'] == 21 || $args['type'] == 22 || $args['type'] == 31 || $args['type'] == 32 ) {\n $strsql .= \"AND parent_id = '\" . ciniki_core_dbQuote($ciniki, $args['parent_id']) . \"' \";\n }\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbSingleCount');\n $rc = ciniki_core_dbSingleCount($ciniki, $strsql, 'ciniki.customers', 'num');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.306', 'msg'=>'Unable to check for duplicates', 'err'=>$rc['err']));\n }\n if( isset($rc['num']) && $rc['num'] > 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.307', 'msg'=>'You already have a customer with that name'));\n }\n }\n\n //\n // Check if individual and force parent_id to zero\n //\n if( isset($args['type']) && $args['type'] == 10 ) {\n $args['parent_id'] = 0;\n }\n\n //\n // Update the customer\n //\n $rc = ciniki_core_objectAdd($ciniki, $args['tnid'], 'ciniki.customers.customer', $args, 0x06);\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.302', 'msg'=>'Unable to updated customer', 'err'=>$rc['err']));\n }\n $customer_id = $rc['id'];\n\n //\n // Add for phone changes\n //\n foreach(['phone_home', 'phone_work', 'phone_cell', 'phone_fax'] as $field) {\n if( isset($phone_args[$field]) && $phone_args[$field] != '' ) {\n $label = ucfirst(str_replace('phone_', '', $field));\n $rc = ciniki_core_objectAdd($ciniki, $args['tnid'], 'ciniki.customers.phone', array(\n 'customer_id'=>$customer_id,\n 'phone_label'=>$label,\n 'phone_number'=>$phone_args[$field],\n 'flags'=>0,\n ), 0x04);\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.303', 'msg'=>'Unable to add phone number', 'err'=>$rc['err']));\n }\n }\n }\n\n //\n // Check for email changes\n //\n foreach(['primary_email', 'secondary_email'] as $field) {\n if( isset($email_args[$field]) && $email_args[$field] != '' ) {\n $email_args[$field . '_flags'] = (isset($email_args[$field . '_flags']) ? $email_args[$field . '_flags'] : 0);\n\n if( !preg_match(\"/^[^ ]+\\@[^ ]+\\.[^ ]+$/\", $email_args[$field]) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.304', 'msg'=>'Invalid email address format ' . $email_args[$field]));\n }\n $rc = ciniki_core_objectAdd($ciniki, $args['tnid'], 'ciniki.customers.email', array(\n 'customer_id'=>$customer_id,\n 'email'=>$email_args[$field],\n 'flags'=>(isset($email_args[$field . '_flags']) ? $email_args[$field . '_flags'] : 0),\n ), 0x04);\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.305', 'msg'=>'Unable to add email', 'err'=>$rc['err']));\n }\n }\n }\n\n //\n // Check if secondary address needs to be updated.\n // This must be done first incase any changes to mailing flags\n //\n $billing_address_id = 0;\n if( ($args['mailing_flags']&0x02) == 0 ) {\n $addr = array(\n 'customer_id' => $customer_id,\n 'address1' => (isset($args['billing_address1']) ? $args['billing_address1'] : ''),\n 'address2' => (isset($args['billing_address2']) ? $args['billing_address2'] : ''),\n 'city' => (isset($args['billing_city']) ? $args['billing_city'] : ''),\n 'province' => (isset($args['billing_province']) ? $args['billing_province'] : ''),\n 'postal' => (isset($args['billing_postal']) ? $args['billing_postal'] : ''),\n 'country' => (isset($args['billing_country']) ? $args['billing_country'] : ''),\n 'flags' => (isset($args['billing_flags']) ? $args['billing_flags'] : 0x02),\n );\n //\n // Only add if a field is filled in\n //\n if( $addr['address1'] != '' || $addr['address2'] != '' || $addr['city'] != '' || $addr['province'] != '' || $addr['postal'] != '' || $addr['country'] != '' ) {\n $rc = ciniki_core_objectAdd($ciniki, $args['tnid'], 'ciniki.customers.address', $addr, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.300', 'msg'=>'Unable to add address', 'err'=>$rc['err']));\n }\n $billing_address_id = $rc['id'];\n }\n } \n\n //\n // Check for mailing address\n //\n $addr = array(\n 'customer_id' => $customer_id,\n 'address1' => (isset($args['mailing_address1']) ? $args['mailing_address1'] : ''),\n 'address2' => (isset($args['mailing_address2']) ? $args['mailing_address2'] : ''),\n 'city' => (isset($args['mailing_city']) ? $args['mailing_city'] : ''),\n 'province' => (isset($args['mailing_province']) ? $args['mailing_province'] : ''),\n 'postal' => (isset($args['mailing_postal']) ? $args['mailing_postal'] : ''),\n 'country' => (isset($args['mailing_country']) ? $args['mailing_country'] : ''),\n // If billing address added, this is just mailing address\n 'flags' => ($billing_address_id > 0 ? 0x04 : 0x06), \n );\n //\n // Add the mailing address\n //\n if( $addr['address1'] != '' || $addr['address2'] != '' || $addr['city'] != '' || $addr['province'] != '' || $addr['postal'] != '' || $addr['country'] != '' ) {\n $rc = ciniki_core_objectAdd($ciniki, $args['tnid'], 'ciniki.customers.address', $addr, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.customers.301', 'msg'=>'Unable to add address', 'err'=>$rc['err']));\n }\n $mailing_address_id = $rc['id'];\n }\n\n\n //\n // Check for subscriptions\n //\n if( isset($args['subscriptions']) || isset($args['unsubscriptions']) ) {\n // incase one of the args isn't set, setup with blank arrays\n if( !isset($args['subscriptions']) ) { $args['subscriptions'] = array(); }\n if( !isset($args['unsubscriptions']) ) { $args['unsubscriptions'] = array(); }\n ciniki_core_loadMethod($ciniki, 'ciniki', 'subscriptions', 'private', 'updateCustomerSubscriptions');\n $rc = ciniki_subscriptions_updateCustomerSubscriptions($ciniki, $args['tnid'], \n $customer_id, $args['subscriptions'], $args['unsubscriptions']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n\n //\n // Update the customer categories\n //\n if( isset($args['customer_categories']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'tagsUpdate');\n $rc = ciniki_core_tagsUpdate($ciniki, 'ciniki.customers', 'tag', $args['tnid'],\n 'ciniki_customer_tags', 'ciniki_customer_history',\n 'customer_id', $customer_id, 10, $args['customer_categories']);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return $rc;\n }\n }\n\n //\n // Update the customer tags\n //\n if( isset($args['customer_tags']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'tagsUpdate');\n $rc = ciniki_core_tagsUpdate($ciniki, 'ciniki.customers', 'tag', $args['tnid'],\n 'ciniki_customer_tags', 'ciniki_customer_history',\n 'customer_id', $customer_id, 20, $args['customer_tags']);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return $rc;\n }\n }\n\n //\n // Update the member categories\n //\n if( isset($args['member_categories']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'tagsUpdate');\n $rc = ciniki_core_tagsUpdate($ciniki, 'ciniki.customers', 'tag', $args['tnid'],\n 'ciniki_customer_tags', 'ciniki_customer_history',\n 'customer_id', $customer_id, 40, $args['member_categories']);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return $rc;\n }\n }\n\n //\n // Update the member subcategories\n //\n if( isset($args['member_subcategories']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'tagsUpdate');\n $rc = ciniki_core_tagsUpdate($ciniki, 'ciniki.customers', 'tag', $args['tnid'],\n 'ciniki_customer_tags', 'ciniki_customer_history',\n 'customer_id', $customer_id, 45, $args['member_subcategories']);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return $rc;\n }\n }\n\n/* //\n // Update the dealer categories\n //\n if( isset($args['dealer_categories']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'tagsUpdate');\n $rc = ciniki_core_tagsUpdate($ciniki, 'ciniki.customers', 'tag', $args['tnid'],\n 'ciniki_customer_tags', 'ciniki_customer_history',\n 'customer_id', $customer_id, 60, $args['dealer_categories']);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return $rc;\n }\n }\n\n //\n // Update the distributor categories\n //\n if( isset($args['distributor_categories']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'tagsUpdate');\n $rc = ciniki_core_tagsUpdate($ciniki, 'ciniki.customers', 'tag', $args['tnid'],\n 'ciniki_customer_tags', 'ciniki_customer_history',\n 'customer_id', $customer_id, 80, $args['distributor_categories']);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return $rc;\n }\n } */\n\n //\n // Update the short_description\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'private', 'customerUpdateShortDescription');\n $rc = ciniki_customers_customerUpdateShortDescription($ciniki, $args['tnid'], $customer_id, 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return $rc;\n }\n\n //\n // Update the season membership\n //\n if( ciniki_core_checkModuleFlags($ciniki, 'ciniki.customers', 0x02000000) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'private', 'customerUpdateSeasons');\n $rc = ciniki_customers_customerUpdateSeasons($ciniki, $args['tnid'], $customer_id);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.customers');\n return $rc;\n }\n }\n\n //\n // Commit the database changes\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.customers');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n $rsp = array('stat'=>'ok', 'id'=>$customer_id);\n\n//\n// FIXME: Switch UI to use response for add/update to fill out details\n//\n// ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'private', 'customerDetails');\n// $rc = ciniki_customers__customerDetails($ciniki, $args['tnid'], $args['customer_id'], array('phones'=>'yes', 'emails'=>'yes', 'addresses'=>'yes', 'subscriptions'=>'no'));\n// if( $rc['stat'] == 'ok' && isset($rc['details']) ) {\n// $rsp['customer_details'] = $rc['details'];\n// }\n\n //\n // Update the web index if enabled\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'hookExec');\n ciniki_core_hookExec($ciniki, $args['tnid'], 'ciniki', 'web', 'indexObject', array('object'=>'ciniki.customers.customer', 'object_id'=>$customer_id));\n ciniki_core_hookExec($ciniki, $args['tnid'], 'ciniki', 'web', 'indexObject', array('object'=>'ciniki.customers.members', 'object_id'=>$customer_id));\n// ciniki_core_hookExec($ciniki, $args['tnid'], 'ciniki', 'web', 'indexObject', array('object'=>'ciniki.customers.dealers', 'object_id'=>$args['customer_id']));\n// ciniki_core_hookExec($ciniki, $args['tnid'], 'ciniki', 'web', 'indexObject', array('object'=>'ciniki.customers.distributors', 'object_id'=>$args['customer_id']));\n\n return $rsp;\n}", "public function create( $_, $assoc_args ) {\n\t\t$email = Utils\\get_flag_value( $assoc_args, 'email', '' );\n\n\t\tif ( empty( $email ) ) {\n\t\t\ttry {\n\n\t\t\t\t\\WP_CLI::error( __( 'A --email value must be specified to add a new customer.', 'affiliate-wp' ) );\n\n\t\t\t} catch( \\Exception $exception ) {}\n\t\t}\n\n\t\t$data['email'] = $email;\n\t\t$data['user_id'] = Utils\\get_flag_value( $assoc_args, 'user_id', '' );\n\t\t$data['first_name'] = Utils\\get_flag_value( $assoc_args, 'first_name', '' );\n\t\t$data['last_name'] = Utils\\get_flag_value( $assoc_args, 'last_name', '' );\n\t\t$data['affiliate_id'] = Utils\\get_flag_value( $assoc_args, 'affiliate_id', '' );\n\t\t$data['ip'] = Utils\\get_flag_value( $assoc_args, 'ip', '' );\n\n\t\t$created = affwp_add_customer( $data );\n\n\t\tif ( $created ) {\n\t\t\t$customer = affiliate_wp()->customers->get_by( 'email', $data['email'] );\n\t\t\t\\WP_CLI::success( sprintf( __( 'A customer with the ID %d has been successfully created.', 'affiliate-wp' ), $customer->customer_id ) );\n\t\t} else {\n\t\t\ttry {\n\n\t\t\t\t\\WP_CLI::error( __( 'The customer could not be created.', 'affiliate-wp' ) );\n\n\t\t\t} catch( \\Exception $exception ) {}\n\t\t}\n\t}", "public function addAddresses( array $request_body )\n {\n $endpoint = '/addresses';\n $data = ['access_token' => $this->config['access_token']];\n // combine $data array and $addresses array into single $data array\n $data = $data + $request_body;\n\n // Make API Call\n $result = samsara::callAPI('POST', $this->config['base_url'] . $endpoint, $data);\n\n return $result;\n }" ]
[ "0.61230457", "0.5977898", "0.5962453", "0.5936452", "0.5759517", "0.564009", "0.5586121", "0.55183655", "0.5510911", "0.5510087", "0.54833", "0.54463303", "0.54365623", "0.5390095", "0.532471", "0.53176665", "0.531481", "0.52907354", "0.52811223", "0.5277376", "0.52769285", "0.5268411", "0.52609885", "0.5257261", "0.5243902", "0.52433103", "0.5236737", "0.523491", "0.5222208", "0.518871" ]
0.63830924
0
Get reset password token
private function getResetPasswordToken() { $this->accountManagement->initiatePasswordReset( $this->getCustomerEmail(), AccountManagement::EMAIL_RESET, 1 ); $customerSecure = $this->customerRegistry->retrieveSecureData(1); return $customerSecure->getRpToken(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPasswordResetToken();", "public function generatePasswordResetToken();", "public function getPasswordResetToken()\n {\n return $this->passwordResetToken;\n }", "public function getNewPasswordResetToken()\n {\n $this->generatePasswordResetToken();\n return $this->getPasswordResetToken();\n }", "public function generatePasswordResetToken()\n\t{\n\t\t$this->password_reset_token = UserHelper::generatePasswordResetToken();\n\t}", "public function getResetToken($email){\n return PasswordResets::where('email','=', $email)->first()->token;\n }", "public function generatePasswordResetToken()\n\t{\n\t\t$this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n\t}", "public function getResetPasswordCode();", "public function generatePasswordResetToken() {\n $this->password_reset_token = Yii::$app->getSecurity()->generateRandomString() . '_' . time();\n }", "public function generatePasswordResetToken()\n {\n $this->password_reset_token = Yii::$app->getSecurity()->generateRandomKey() . '_' . time();\n }", "public function generatePasswordResetToken() {\n $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n }", "public function generatePasswordResetToken() {\n $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n }", "public function generatePasswordResetToken() {\r\n $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\r\n }", "public function generatePasswordResetToken()\n {\n $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n }", "public function generatePasswordResetToken()\n {\n $this->password_reset_token = Yii::$app->getSecurity()->generateRandomString() . '_' . time();\n }", "public function generatePasswordResetToken()\n {\n $this->password_reset_token = Yii::$app->security->generateRandomKey() . '_' . time();\n }", "public function generatePasswordResetToken()\n {\n $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n }", "public function generatePasswordResetToken()\n {\n $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n }", "public function generatePasswordResetToken()\n {\n $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n }", "public function generatePasswordResetToken()\n {\n $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n }", "public function generatePasswordResetToken()\n {\n $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n }", "public function generatePasswordResetToken()\n {\n $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n }", "public function generatePasswordResetToken()\n {\n $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n }", "public function generatePasswordResetToken()\n {\n $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n }", "public function generatePasswordResetToken()\n {\n $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n }", "public function generatePasswordResetToken()\n {\n $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n }", "public function generatePasswordResetToken()\n {\n $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n }", "public function generatePasswordResetToken()\n {\n $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n }", "public function generatePasswordResetToken()\n {\n $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n }", "public function generatePasswordResetToken()\n {\n $this->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n }" ]
[ "0.90624875", "0.8415968", "0.8393736", "0.82606316", "0.7767979", "0.769424", "0.74362653", "0.742667", "0.74162924", "0.7390824", "0.7381701", "0.7381701", "0.73709637", "0.7366332", "0.7354931", "0.73490566", "0.73221684", "0.73221684", "0.73221684", "0.73221684", "0.73221684", "0.73221684", "0.73221684", "0.73221684", "0.73221684", "0.73221684", "0.73221684", "0.73221684", "0.73221684", "0.73221684" ]
0.8640056
1
Get new password for customer account
private function getNewPassword() { return self::CUSTOMER_NEW_PASSWORD; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function create_new_password() {\n //1. get client id\n //2. create new password\n //$this->Service_account->create_new_password();\n //3. update to new password\n //$this->Service_account->update_password\n //4. send email to notice to new passowrd\n //5. redirect complete page\n }", "function getPassword();", "public function getPassword()\n {\n }", "public function getPassword()\n {\n }", "public function getPassword()\n {\n }", "public function getPassword()\n {\n }", "public function getPassword()\n {\n // TODO: Implement getPassword() method.\n }", "public function getPassword()\n {\n // TODO: Implement getPassword() method.\n }", "public function getPassword()\n {\n // TODO: Implement getPassword() method.\n }", "public function getPassword()\n {\n // TODO: Implement getPassword() method.\n }", "public function getNewPassword()\n {\n return $this->newPassword;\n }", "private function getPassword()\n {\n return $this->password;\n }", "public function getP12Password();", "public function generatePassword();", "public function getPassword() { return $this->password; }", "public function getPassword()\n {\n return $this->get('password');\n }", "function recuperaCredenziali() \n {\n return $this->recuperaValore('password');\n }", "public function get_password()\n\t{\n\t\treturn $this->password;\n\t}", "public static function getPassword()\n {\n return self::instance()->getPassword();\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword(): string\n {\n return $this->password;\n }", "public function getPassword(): string\n {\n return $this->password;\n }", "public function getPassword(): string\n {\n return $this->password;\n }", "public function getPassword() {\n\t\treturn $this -> data['password'];\n\t}", "function getPassword()\n {\n return $this->password ;\n }" ]
[ "0.74602556", "0.74602556", "0.74602556", "0.74602556", "0.74602556", "0.7355645", "0.73307794", "0.72546595", "0.72546595", "0.72546595", "0.72546595", "0.7203117", "0.7203117", "0.7203117", "0.7203117", "0.71803284", "0.7121912", "0.70917386", "0.7066633", "0.70441246", "0.70164454", "0.69923633", "0.69780207", "0.6956532", "0.6944834", "0.69379956", "0.69379956", "0.69379956", "0.6914961", "0.6913206" ]
0.8042807
0
Checks if the given 3letter value is a valid supplier type.
public static function isSupplierType($value) { return defined('static::SUPPLIER_'.$value) && constant('static::SUPPLIER_'.$value) === $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isQtType($type)\n{\n\treturn (strlen($type)>3 and $type[0]==\"Q\" and ctype_upper($type[1]));\n}", "public function validType($type, $f3)\n {\n return in_array($type, $f3->get('types'));\n }", "function validate_product_type($product_type){\n\tif(validate_integer_pattern($product_type))\n\t{\n\t\t//look up the enumeration in the db\n\t\t$query = \"SELECT COUNT(*) FROM Products WHERE ID = $product_type\";\n\t\t$result = mysql_query($query);\n\t\tif($result)\n\t\t{\n\t\t\t$row = mysql_fetch_row($result);\n\t\t\tif($row[0] > 0)\n\t\t\t{\n\t\t\t\tmysql_free_result($result);\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t}\n\n\tmysql_free_result($result);\n\treturn FALSE;\n}", "public static function Validate($plate) {\n\t\t$plate = strtoupper($plate);\t\t\t\t\t// Convert the string to uppercase\n\t\treturn(preg_match('/^K[A-Z]{2}[0-9]{3}[A-Z]$/', $plate));\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Check if the string is exactly 7 characters long, the 2nd, 3rd and 7th characters are letters, and the 4th, 5th and 6th characters are numbers\n\t}", "function VerifySupplierName($SupplierName, $i, $Errors) {\n\t\tif ((mb_strlen($SupplierName)<1) or (mb_strlen($SupplierName)>40)) {\n\t\t\t$Errors[$i] = IncorrectSupplierNameLength;\n\t\t}\n\t\treturn $Errors;\n\t}", "private static function assertValidPurchaseType(string $purchase_type){\n if(!in_array($purchase_type,DB\\paymentX::$PURCHASE_TYPE))\n Assert::throw(\"invalid purchase type\");\n }", "function validate_functionality_type($functionality_type){\n\tif(validate_integer_pattern($functionality_type))\n\t{\n\t\t//look up the enumeration in the db\n\t\t$query = \"SELECT COUNT(*) FROM Functionality WHERE ID = $functionality_type\";\n\t\t$result = mysql_query($query);\n\t\tif($result)\n\t\t{\n\t\t\t$row = mysql_fetch_row($result);\n\t\t\tif($row[0] > 0)\n\t\t\t{\n\t\t\t\tmysql_free_result($result);\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t}\n\n\tmysql_free_result($result);\n\treturn FALSE;\n}", "function validate_customer_type($customer_type)\n{\n\tif(validate_integer_pattern($customer_type))\n\t{\n\t\t//look up the enumeration in the db\n\t\t$query = \"SELECT COUNT(*) FROM CustomerTypes WHERE ID = $customer_type\";\n\t\t$result = mysql_query($query);\n\t\tif($result)\n\t\t{\n\t\t\t$row = mysql_fetch_row($result);\n\t\t\tif($row[0] > 0)\n\t\t\t{\n\t\t\t\tmysql_free_result($result);\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t}\n\n\tmysql_free_result($result);\n\treturn FALSE;\n}", "private function validateCardType() {\n\n\t\t//allowed card types\n\t\t$allowed = array(\n\t\t\t'VISA',\n\t\t\t'DELTA',\n\t\t\t'PURCHASING',\n\t\t\t'ELECTRON',\n\t\t\t'MAESTRO',\n\t\t\t'MASTERCARD',\n\t\t\t'MASTERCARDDEBIT',\n\t\t);\n\n\t\t//make sure it's a string\n\t\tValidate::string($this->cardType, $this->errorPrefix.'card type');\n\n\t\t//make sure it's allowed\n\t\tif(!in_array($this->cardType, $allowed)) {\n\t\t\tthrow new Exception($errorPrefix.\"card type is not valid.\");\n\t\t}\n\t}", "public function verify_field($value,$type=\"none\")\r\n {\r\n if(is_string($value))\r\n $l = strlen($value)==0?true:false;\r\n if($l)\r\n return false;\r\n switch($type) {\r\n case 'number': // check is its number\r\n return is_numeric($value);\r\n break;\r\n case 'alphabet': // check if its only alphabet\r\n preg_match(\"/[A-Za-z]+/s\",$value,$a);\r\n return (abs(strlen($value)-strlen($a[0]))>0)?false:true;\r\n break;\r\n case 'email': // check for email\r\n preg_match(\"/[A-Za-z0-9_]+@[A-Za-z0-9]+.[A-Za-z]+/s\",$value,$a);\r\n return (abs(strlen($value)-strlen($a[0]))>0)?false:true;\r\n break;\r\n case 'datetime':\r\n $a = date_parse($value);\r\n return ($a[\"error_count\"]>0)?false:true;\r\n break;\r\n default:\r\n throw new \\Exception(\"No type was specified\", 1);\r\n }\r\n return false;\r\n }", "function learndash_billing_cycle_field_frequency_validate( $price_billing_t3 = '' ) {\n\t$price_billing_t3 = strtoupper( $price_billing_t3 );\n\n\tif ( ! in_array( $price_billing_t3, array( 'D', 'W', 'M', 'Y' ), true ) ) {\n\t\t$price_billing_t3 = '';\n\t}\n\n\treturn $price_billing_t3;\n}", "protected function verifyFrance($value) : bool\n {\n return preg_match('/^[1,2][ ]?[0-9]{2}[ ]?[0,1,2,3,5][0-9][ ]?[0-9A-Z]{5}[ ]?[0-9]{3}[ ]?[0-9]{2}$/', $value) > 0;\n }", "function validate_nonce( $type, $value ) {\n\t\t$value = (string) $value;\n\t\treturn ( $value !== '' && $value === $this->get_nonce( $type ) );\n\t}", "function VerifySupplierNo($SupplierNumber, $i, $Errors, $db) {\n\t\tif ((mb_strlen($SupplierNumber)<1) or (mb_strlen($SupplierNumber)>10)) {\n\t\t\t$Errors[$i] = IncorrectDebtorNumberLength;\n\t\t}\n\t\t$Searchsql = \"SELECT count(supplierid)\n \t\t\t\t FROM suppliers\n\t\t\t\t WHERE supplierid='\".$SupplierNumber.\"'\";\n\t\t$SearchResult=DB_query($Searchsql);\n\t\t$answer = DB_fetch_row($SearchResult);\n\t\tif ($answer[0] != 0) {\n\t\t\t$Errors[$i] = SupplierNoAlreadyExists;\n\t\t}\n\t\treturn $Errors;\n\t}", "public function validateKundnr($str)\n\t{\n\t\tif (strlen($str) == 6 && is_numeric($str))\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "static public function existsProductSupplier(ProductSupplier $detail){\n\t\tif($detail->getId() == '123ABC')\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "function sanitize_one($var, $type){ \n switch($type){\n case 'int': // integer\n $var = (int)$var;\n break;\n \n case 'str': // trim string\n $var = trim($var);\n break;\n \n case 'nohtml': // trim string, no HTML allowed\n $var = htmlentities(trim($var),ENT_QUOTES);\n break;\n \n case 'plain': // trim string, no HTML allowed, plain text\n $var = htmlentities(trim($var),ENT_NOQUOTES) ;\n break;\n \n case 'sqlsafe': // make string safe from sql injection\n $var = filter_var($var, FILTER_SANITIZE_MAGIC_QUOTES);\n break;\n \n case 'upper_word': // trim string, upper case words\n $var = ucwords(strtolower(trim($var)));\n break;\n \n case 'ucfirst': // trim string, upper case first word\n $var = ucfirst(strtolower(trim($var)));\n break;\n \n case 'lower': // trim string, lower case words\n $var = strtolower(trim($var));\n break;\n \n case 'urle': // trim string, url encoded\n $var = urlencode(trim($var));\n break;\n \n case 'trim_urle': // trim string, url decoded\n $var = urldecode(trim($var));\n break;\n \n case 'telephone': // True/False for a telephone number\n $size = strlen($var) ;\n for ($x=0;$x<$size;$x++){\n if (!((ctype_digit($var[$x]) || ($var[$x]=='+') || ($var[$x]=='*') || ($var[$x]=='p') || ($var[$x]=='(') || ($var[$x]==')')))){\n return false;\n }\n }\n return true;\n break;\n \n case 'pin': // True/False for a PIN\n if ((strlen($var)!=13) || (ctype_digit($var)!=true)){\n return false;\n }\n return true;\n break;\n \n case 'id_card': // True/False for an ID CARD\n if ((ctype_alpha(substr($var,0,2))!= true) || (ctype_digit(substr($var,2,6))!=true) || (strlen($var)!=8)){\n return false;\n }\n return true;\n break;\n \n case 'sql': // True/False if the given string is SQL injection safe\n // insert code here, I usually use ADODB -> qstr() but depending on your needs you can use mysql_real_escape();\n return mysql_real_escape_string($var);\n break;\n } \n return $var; \n }", "function validatePopulation($population){\r\n\t// return if the name is valid or not based on if all the \r\n\t// characters are digits or valid exponential part and pos.\r\n\treturn (is_numeric($population) && $population >= 0); \r\n}", "function validate_field_is_not_numeric($field_value, &$field): bool\r\n{\r\n if (is_numeric($field_value)) {\r\n $field['error'] = 'Must be only alphabet letters!';\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "public function isValueValid($value) {\n\t\treturn $value instanceof DataType\\TextType;\n\t}", "public function isValueValid($value) {\n\t\treturn $value instanceof DataType\\TextType;\n\t}", "public static function getValidTypeFromSample($value) {\n $value = trim((string) $value);\n\n if (empty($value)) {\n return false;\n }\n\n foreach (self::$validators as $type => $validator) {\n if ($validator === null) {\n continue;\n }\n\n if (method_exists(__CLASS__, $validator) && self::$validator($value)) {\n return $type;\n }\n }\n\n return self::__DEFAULT;\n }", "private function validType($type)\n\t{\n\t\tif(!in_array(strtolower($type), $this->valid_types))\n\t\t{\n\t\t\tthrow new BCPAPIInvalidType($this, self::ERROR_INVALID_TYPE);\n\t\t} else {\n\t\t\treturn TRUE;\n\t\t}\n\t}", "public function validateUsernameType($value)\n {\n if (preg_match('/^[A-Za-z0-9_]*$/', $value) == FALSE) {\n $this->form_validation->set_message('validateUsernameType', _l(\"The {field} field must contain just English letters and underline only.\", $this));\n return FALSE;\n }\n if ($value=='' || preg_match('/^.{3,18}$/', $value) == FALSE) {\n $this->form_validation->set_message('validateUsernameType', _l(\"The {field} field must be between 3 und 18 characters in length.\", $this));\n return FALSE;\n }\n return TRUE;\n }", "public function isValid($value) {\n $value = htmlspecialchars($value);\n $value = str_replace(array(\"-\",\"_\"), \"\", $value);\n\n if (ctype_alnum($value)) {\n return true;\n }\n\n if (ctype_alpha($value)) {\n return true;\n }\n\n return false;\n }", "private function checkType($value, $type)\n {\n $isValid = false;\n\n if (!is_string($type) || strlen($type) < 1 || strlen($type) > $this->maxKeyLength) {\n return false;\n }\n\n switch ($type) {\n case 'string':\n if (is_string($value)) {\n $isValid = true;\n }\n break;\n\n case 'digit':\n if (is_int($value) || is_string($value)) {\n if (ctype_digit((string)$value)) {\n $isValid = true;\n }\n }\n break;\n\n case 'int':\n if (is_int($value)) {\n $isValid = true;\n }\n break;\n\n case 'float':\n if (is_float($value)) {\n $isValid = true;\n }\n break;\n\n case 'bool':\n case 'boolean':\n if (is_bool($value)) {\n $isValid = true;\n }\n break;\n\n case 'array':\n if (is_array($value)) {\n $isValid = true;\n }\n break;\n\n case 'object':\n if (is_object($value)) {\n $isValid = true;\n }\n break;\n }\n\n return $isValid;\n }", "public function isValueValid($value) {\n\t\treturn $value instanceof Type\\QualitativeValue;\n\t}", "public function isValidType($type);", "function vc_check_post_type_validation($value, $type) {\n\tif ($type == 'wpdance_htmlblock')\n\t\treturn true;\n\n\treturn $value;\n}", "public static function isMixed($value)\n {\n return preg_match('/^[A-Za-z0-9_-]+$/u', $value);\n }" ]
[ "0.5763031", "0.5753287", "0.5559547", "0.544775", "0.53536755", "0.53001946", "0.5291915", "0.5291661", "0.523681", "0.5200475", "0.5150511", "0.5147692", "0.51445264", "0.51325077", "0.50814754", "0.507533", "0.5073162", "0.5070807", "0.5058087", "0.5016002", "0.5016002", "0.5015937", "0.5011824", "0.50065625", "0.50032395", "0.49968857", "0.4994658", "0.49890393", "0.4985135", "0.49747664" ]
0.6696442
0
Checks if the given status is a valid constant's value.
public static function isStatus($value) { return defined('static::STATUS_'.$value) && constant('static::STATUS_'.$value) === $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isValidStatus($status);", "function valid_status($status) {\n return !empty($status) ;\n\t}", "static function isValidStatus($a_status)\n\t{\n\t\tif(in_array($a_status, array(self::STATUS_IN_USE, self::STATUS_CANCELLED)))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function checkStatus($status)\n\t{\n\t\tif (is_numeric($status) && ($status >= CClient::MIN_STATUS) && ($status <= CClient::MAX_STATUS))\n\t\t\treturn(true);\n\t\telse\n\t\t{\n\t\t\tinclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\t\t\t$this->addErrorMessage($I18N_clientStatusNumberInvalid.\" ($status)\");\n\t\t\treturn(false);\n\t\t}\n\t}", "function isValidHostileStatus($status) {\r\n\t\treturn in_array($status, [\"alive\",\"fled\", \"removed\"]);\r\n\t}", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_SUCCESSFUL,self::VALUE_FAILED,self::VALUE_PENDING,self::VALUE_CUSTOMCODE));\n\t}", "public static function isValidStatus($status)\n {\n return in_array($status, array_keys(self::getStatuses()));\n }", "protected function allowed_status( $status ){\n\t\tif( ! in_array( $status, array(\n\t\t\t'active',\n\t\t\t'pending',\n\t\t\t'trash'\n\t\t) ) ){\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function validate_account_status($status) {\r\n if ($status == 'a' || $status == 'A' || $status == 'd' || $status == 'D') {\r\n return true;\r\n }\r\n return false;\r\n}", "protected function checkStatus(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_string($this->_Status) && $this->_Status !== '' ) {\n\t\t\t$inMessage .= \"{$this->_Status} is not a valid value for Status\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\tif ( $isValid && $this->_Status != '' && !in_array($this->_Status, array(self::STATUS_NEW, self::STATUS_READ, self::STATUS_REPLIED, self::STATUS_DELETED)) ) {\n\t\t\t$inMessage .= \"Status must be one of STATUS_NEW, STATUS_READ\";\n\t\t\t$isValid = false;\n\t\t}\t\t\n\t\treturn $isValid;\n\t}", "protected function validateStatus($status)\n {\n // validate against none RCF codes\n if (null !== Reason::phrase($status = (int)$status)) {\n return $status;\n }\n\n throw new InvalidArgumentException(\n sprintf(\n 'Invalid http status or none RCF status code \"%s\".',\n is_scalar($status) ? (string)$status : gettype($status)\n )\n );\n }", "public static function isValidStatus($status) {\n\n switch ($status) {\n case self::STATUS_LEAD: return true;\n case self::STATUS_SAVED: return true;\n default: return false;\n }\n\n }", "static function isValidValue()\n {\n }", "public static function isValidValue($value)\n {\n $values = array_values(self::getConstants());\n return in_array($value, $values, true);\n }", "static function validatePaperStatus($status)\n {\n $stat = intval($status);\n if (floor($stat / 10) != 1 or floor($stat / 10) != 2 or floor($stat / 10) != 3) {\n return false;\n } else {\n if ($stat % 10 != 0 or $stat % 10 != 1 or $stat % 10 != 2) {\n return false;\n } else {\n return true;\n }\n }\n }", "protected function isValidStatus($status)\n {\n return in_array($status, ['my_textmaster', 'blacklisted', 'uncategorized'], true);\n }", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_SUCCESS,self::VALUE_BADREQUEST,self::VALUE_SERVERERROR));\n\t}", "private function constantValueExists($value): bool\n {\n return array_search($value, $this->getConstants()) !== false;\n }", "public function valid()\n {\n\n $allowed_values = $this->getStatusNameAllowableValues();\n if (!in_array($this->container['status_name'], $allowed_values)) {\n return false;\n }\n $allowed_values = $this->getStatusIdAllowableValues();\n if (!in_array($this->container['status_id'], $allowed_values)) {\n return false;\n }\n return true;\n }", "public function validate_filter_status($status)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if (! in_array($status, $this->filter_status))\n return lang('marketplace_filter_invalid');\n }", "public static function valueIsValid($_value)\r\n\t{\r\n\t\treturn in_array($_value,array(PayPalEnumFailedPaymentActionType::VALUE_CANCELONFAILURE,PayPalEnumFailedPaymentActionType::VALUE_CONTINUEONFAILURE));\r\n\t}", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_CLOSED,self::VALUE_WAITINGFORSELLERRESPONSE,self::VALUE_WAITINGFORBUYERRESPONSE,self::VALUE_CLOSEDFVFCREDITSTRIKE,self::VALUE_CLOSEDNOFVFCREDITSTRIKE,self::VALUE_CLOSEDFVFCREDITNOSTRIKE,self::VALUE_CLOSEDNOFVFCREDITNOSTRIKE,self::VALUE_STRIKEAPPEALEDAFTERCLOSING,self::VALUE_FVFCREDITREVERSEDAFTERCLOSING,self::VALUE_STRIKEAPPEALEDANDFVFCREDITREVERSED,self::VALUE_CLAIMOPENED,self::VALUE_NODOCUMENTATION,self::VALUE_CLAIMCLOSED,self::VALUE_CLAIMDENIED,self::VALUE_CLAIMINPROCESS,self::VALUE_CLAIMAPPROVED,self::VALUE_CLAIMPAID,self::VALUE_CLAIMRESOLVED,self::VALUE_CLAIMSUBMITTED,self::VALUE_UNPAIDITEMOPENED,self::VALUE_CUSTOMCODE));\n\t}", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_REALTIME,self::VALUE_DELAYED,self::VALUE_ONEMINUTE,self::VALUE_FIVEMINUTE,self::VALUE_TENMINUTE,self::VALUE_THIRTYMINUTE,self::VALUE_ONEHOUR,self::VALUE_PERIOD));\n\t}", "static function isSpecialStatus($status)\n {\n return in_array(\n $status,\n array(\n self::WAITING_CLIENT_PAYMENT,\n self::WAITING_FOR_IDENTIFICATION,\n self::STORED_WAITING_EXTERNAL_RESULT,\n self::INVALID_INCOMPLETE,\n )\n );\n }", "public static function valueIsValid($_value)\n\t{\n\t\treturn in_array($_value,array(self::VALUE_CANCELED,self::VALUE_PAID,self::VALUE_PENDING,self::VALUE_CUSTOMCODE));\n\t}", "public static function validateValue(int &$value): bool\n {\n $class = static::class;\n if (empty(self::$availableValues[$class])) {\n self::init($class);\n }\n\n return in_array($value, self::$availableValues[$class], true);\n }", "private function isConstantValue($value): bool\n {\n if (\\is_array($value)) {\n foreach ($value as $item) {\n if (!$this->isConstantValue($item)) {\n return false;\n }\n }\n\n return true;\n }\n\n return is_scalar($value) || \\is_null($value);\n }", "public static function existsValue(string $class, $typeValue): bool\n {\n $class = new ReflectionClass($class);\n\n return in_array($typeValue, $class->getConstants(), true);\n }", "function getStatus($status) {\n $status = intval($status);\n if ($status == 1) {\n $stat_type = 'Active';\n } else if ($status == 2) {\n $stat_type = 'Inactive';\n } else {\n $stat_type = 'N/A';\n }\n return $stat_type;\n }", "private function check_status($status) {\n if (empty($status)) return 'The status variable is emtpy!';\n if (strtoupper($status) == \"OK\") {\n return array();\n }\n if (strtoupper($status) == \"ZERO_RESULTS\") {\n return array();\n }\n if (strtoupper($status) == \"OVER_QUERY_LIMIT\") {\n return array(\"You are over your quota.\", 200);\n }\n if (strtoupper($status) == \"REQUEST_DENIED\") {\n return array(\"Your request was denied, generally because of lack of a sensor parameter.\", 300);\n }\n if (strtoupper($status) == \"INVALID_REQUEST\") {\n return array(\"The query (address) is missing.\", 400);\n }\n }" ]
[ "0.6858467", "0.6527243", "0.63455904", "0.6271707", "0.59596133", "0.5861434", "0.58109504", "0.5795948", "0.57459", "0.57403696", "0.5698594", "0.56875557", "0.56776625", "0.56746715", "0.5638377", "0.56249386", "0.56013185", "0.55938137", "0.5588868", "0.55802125", "0.55758685", "0.5573085", "0.5564581", "0.555928", "0.555027", "0.5511574", "0.5508913", "0.54847294", "0.5478239", "0.54666996" ]
0.6588883
1
Calls jobs to drop and recreate the table(s) for this template.
function recreateData() { // If this template calls #cargo_declare (as opposed to // #cargo_attach), drop and re-generate the Cargo DB table // for it.` if ( $this->mIsDeclared ) { // Call this directly, instead of as a job; so that // the re-creation of the table(s) always happens // before any of the rows are added. // Hopefully this will not ever cause the session to // time out. //$job = new CargoRecreateTablesJob( $this->mTemplateTitle ); //JobQueueGroup::singleton()->push( $job ); CargoRecreateTablesJob::recreateDBTablesForTemplate( $this->mTemplateTitle->getArticleID() ); } // Now create a job, CargoPopulateTable, for each page // that calls this template. $jobParams = array( 'dbTableName' => $this->mTableName, 'replaceOldRows' => !$this->mIsDeclared ); $this->callPopulateTableJobsForTemplate( $this->mTemplateTitle, $jobParams ); // If this template calls #cargo_declare, see if any templates // have attached themselves to this table, and if so, call // this job for their pages as well. if ( $this->mIsDeclared ) { $dbr = wfGetDB( DB_SLAVE ); $res = $dbr->select( 'page_props', array( 'pp_page' ), array( 'pp_value' => $this->mTableName, 'pp_propname' => 'CargoAttachedTable' ) ); while ( $row = $dbr->fetchRow( $res ) ) { $templateID = $row['pp_page']; $attachedTemplateTitle = Title::newFromID( $templateID ); $jobParams = array( 'dbTableName' => $this->mTableName, 'replaceOldRows' => false ); $this->callPopulateTableJobsForTemplate( $attachedTemplateTitle, $jobParams ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function safeDown()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{notification_templates}}\")){\n\t\t\t$this->dropTable(\"{{notification_templates}}\");\n\t\t}\n\t}", "public function run()\n {\n DB::table('cssTemplates')->delete();\n\n CSS_Template::create([\n 'name' => 'template 1',\n 'active' => '1',\n 'content' => 'body {background-color: #ccff99;',\n 'description' => 'Green Background',\n 'created_by' => 2,\n 'modified_by' => 2\n ]);\n\n CSS_Template::create([\n 'name' => 'template 2',\n 'active' => null,\n 'content' => 'body {background-color: #ff9966;',\n 'description' => 'Orange Background',\n 'created_by' => 2,\n 'modified_by' => 2\n ]);\n\n CSS_Template::create([\n 'name' => 'template 3',\n 'active' => null,\n 'content' => 'body {background-color: #66ccff;',\n 'description' => 'Blue Background',\n 'created_by' => 2,\n 'modified_by' => 2\n ]);\n }", "public function run()\n {\n $this->truncate_all_tables();\n factory(App\\Models\\Product::class, 1)->create();\n factory(App\\Models\\TripActivityTicket::class, 1)->create();\n factory(App\\User::class, 1)->create();\n factory(App\\Merchant\\Merchant::class, 1)->create();\n }", "public function tearDown()\n {\n\n if (is_array($this->tables_to_tear_down)) {\n $tables = array_reverse(array_unique($this->tables_to_tear_down));\n\n if (self::$verbose) {\n echo \"tear down plan: \" . join(', ', $tables) . \"\\n\";\n }\n\n foreach ($tables as $fixture_name) {\n $this->db->execute(\"DELETE FROM $fixture_name\");\n }\n }\n }", "public function run()\n {\n DB::statement(\"TRUNCATE TABLE \\\"project_task\\\" CASCADE\");\n factory(ProjectTask::class,20)->create();\n }", "private function truncateAllTables()\n {\n $tables = Yii::app()->db->getSchema()->getTableNames();\n $fixtureManager = new CDbFixtureManager();\n foreach ($tables as $tableName) {\n if ($tableName === 'tbl_migration')\n continue;\n $fixtureManager->resetTable($tableName);\n }\n }", "public function tear_down() {\n\n\t\tglobal $wpdb;\n\n\t\tparent::tear_down();\n\n\t\t$wpdb->query( \"DROP TABLE IF EXISTS {$wpdb->prefix}dbdelta_test\" );\n\t}", "public function run()\n {\n DB::table('review_tags')->delete();\n DB::table('reviews')->delete();\n DB::table('tags')->delete();\n DB::table('follows')->delete();\n DB::table('users')->delete();\n }", "public static function recreate(): void{\n echo \"[*] === Recreating Databases ===\".PHP_EOL;\n echo \"[*] Reading models...\".PHP_EOL;\n $modelList = classHelper::getClassNamesFromDir(__DIR__.\"/../../models\");\n echo PHP_EOL;\n foreach($modelList as $model){\n echo $model.PHP_EOL;\n }\n cliHelper::confirmation(\"Recreating the database will wipe all data.\", false);\n echo \"[*] Starting migration\".PHP_EOL;\n foreach($modelList as $model){\n $modelObj = new $model();\n $modelObj->drop();\n $modelObj->create();\n unset($modelObj); // Destroy finished object\n }\n echo cliColour::GREEN.\"[*] Completed without error\".cliColour::RESET.PHP_EOL;\n }", "public function tearDown()\n {\n $this->schema('default')->drop('users');\n $this->schema('default')->drop('channels');\n $this->schema('default')->drop('threads');\n }", "public function drop()\n {\n if (!$this->new) {\n $this->sql->setQuery(sprintf('DROP TABLE %s', $this->sql->escapeIdentifier($this->name)));\n }\n\n $this->new = true;\n $this->originalName = $this->name;\n $this->columnsExisting = [];\n $this->implicitOrder = [];\n $this->positions = [];\n $this->primaryKeyModified = !empty($this->primaryKey);\n }", "public function delete_tables() {\r\n\t\t//$result = pg_Exec($dbConn, \"delete from access_point;\");\r\n\t\t//$result = pg_Exec($dbConn, \"delete from describable_entity;\");\r\n\t\t$result = pg_Exec ( $this->dbConn, \"delete from pangea;\" );\r\n\t\r\n\t\t//Eliminar las relaciones\r\n\t//$result = pg_Exec($dbConn, \"delete from exemplifies;\");\r\n\t//$result = pg_Exec($dbConn, \"delete from materializes;\");\r\n\t//$result = pg_Exec($dbConn, \"delete from realizes;\");\r\n\t//$result = pg_Exec($dbConn, \"delete from document_type;\");\r\n\t/*$result = pg_Exec($dbConn, \"delete from is_inventory_of;\");\r\n $result = pg_Exec($dbConn, \"delete from is_collection_of;\");\r\n $result = pg_Exec($dbConn, \"delete from is_conservation_of;\");\r\n $result = pg_Exec($dbConn, \"delete from is_note;\");\r\n $result = pg_Exec($dbConn, \"delete from is_isbn_of;\");\r\n $result = pg_Exec($dbConn, \"delete from is_acquisition_way;\");\r\n $result = pg_Exec($dbConn, \"delete from is_title_proper;\");\r\n $result = pg_Exec($dbConn, \"delete from is_paralell_title;\");\r\n $result = pg_Exec($dbConn, \"delete from is_other_title_info;\");\r\n $result = pg_Exec($dbConn, \"delete from is_title;\");\r\n $result = pg_Exec($dbConn, \"delete from without_title;\");\r\n $result = pg_Exec($dbConn, \"delete from is_named_as;\");\r\n $result = pg_Exec($dbConn, \"delete from is_lastname;\");\r\n $result = pg_Exec($dbConn, \"delete from is_creator;\");\r\n $result = pg_Exec($dbConn, \"delete from is_creator;\");\r\n \r\n $result = pg_Exec($dbConn, \"delete from is_abstract_of;\");\r\n $result = pg_Exec($dbConn, \"delete from is_publication_place_of;\");\r\n $result = pg_Exec($dbConn, \"delete from is_impression_place_of;\");\r\n $result = pg_Exec($dbConn, \"delete from is_publishing_house_of;\");\r\n $result = pg_Exec($dbConn, \"delete from is_publication_date_of;\");\r\n $result = pg_Exec($dbConn, \"delete from is_part_of;\");\r\n $result = pg_Exec($dbConn, \"delete from is_subject;\");\r\n $result = pg_Exec($dbConn, \"delete from is_language_of;\");*/\r\n\t\r\n\t//Eliminar los atributos \r\n\t//$result = pg_Exec($dbConn, \"delete from controlled_access_point;\");\r\n\t//$result = pg_Exec($dbConn, \"delete from prefTerm;\");\r\n\t//$result = pg_Exec($dbConn, \"delete from manifestation_form;\");\r\n\t//$result = pg_Exec($dbConn, \"delete from title_proper;\");\r\n\t//$result = pg_Exec($dbConn, \"delete from title_parallel;\");\r\n\t\r\n\r\n\t/*$result = pg_Exec($dbConn, \"delete from inventories;\");\r\n $result = pg_Exec($dbConn, \"delete from isbn;\");\r\n $result = pg_Exec($dbConn, \"delete from object_sp;\");\r\n $result = pg_Exec($dbConn, \"delete from object_en;\");\r\n $result = pg_Exec($dbConn, \"delete from object_ru;\");\r\n $result = pg_Exec($dbConn, \"delete from object_it;\");\r\n $result = pg_Exec($dbConn, \"delete from objects;\");\r\n $result = pg_Exec($dbConn, \"delete from titles_sp;\");\r\n $result = pg_Exec($dbConn, \"delete from titles_en;\");\r\n $result = pg_Exec($dbConn, \"delete from titles_ru;\");\r\n $result = pg_Exec($dbConn, \"delete from titles_it;\");\r\n $result = pg_Exec($dbConn, \"delete from titles;\");\r\n $result = pg_Exec($dbConn, \"delete from auth_persons;\");\r\n $result = pg_Exec($dbConn, \"delete from persons;\");\r\n $result = pg_Exec($dbConn, \"delete from nomens;\");\r\n $result = pg_Exec($dbConn, \"delete from auth_coorporate_bodies;\");\r\n $result = pg_Exec($dbConn, \"delete from coorporate_bodies;\");\r\n $result = pg_Exec($dbConn, \"delete from auth_places;\");*/\r\n\t\r\n\t//Borra las tablas de entidades\r\n\t//$result = pg_Exec($dbConn, \"delete from item;\");\r\n\t//$result = pg_Exec($dbConn, \"delete from manifestation;\");\r\n\t//$result = pg_Exec($dbConn, \"delete from expression;\");\r\n\t//$result = pg_Exec($dbConn, \"delete from work;\"); \r\n\t/*$result = pg_Exec($dbConn, \"delete from subjects;\");\r\n $result = pg_Exec($dbConn, \"delete from places;\");\r\n $result = pg_Exec($dbConn, \"delete from dates;\");\r\n $result = pg_Exec($dbConn, \"delete from languages;\");*/\r\n\t}", "protected function tearDown()\n\t {\n\t\tunset($this->object);\n\t\t$this->_db->execUntilSuccessful(\"DROP TABLE IF EXISTS `FailedDocuments`\");\n\t\t$this->_db->execUntilSuccessful(\"DROP TABLE IF EXISTS `HTTPcache`\");\n\t }", "public function run()\n {\n \t// Tables without dependents\n DB::table('settings')->delete();\n DB::table('versions')->delete();\n DB::table('alias')->delete();\n DB::table('shares')->delete();\n\n // Dependent tables\n DB::table('files')->delete();\n DB::table('permission_types')->delete();\n DB::table('users')->delete();\n \tDB::table('user_types')->delete();\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n foreach($this->tables as $table){\n DB::table($table)->truncate();\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n\n\n // $this->call(UsersTableSeeder::class);\n }", "protected function truncateTables()\n {\n $this->progress->setMessage(\"Truncating tables\");\n\n try {\n $connection = $this->doctrine->getConnection();\n $connection->beginTransaction();\n $connection->query(\"SET FOREIGN_KEY_CHECKS = 0\");\n\n $connection->query(\"TRUNCATE user\");\n $connection->query(\"TRUNCATE location\");\n $connection->query(\"TRUNCATE event\");\n $connection->query(\"TRUNCATE event_subscription\");\n\n $connection->query(\"SET FOREIGN_KEY_CHECKS = 1\");\n $connection->commit();\n }\n catch (\\Exception $e) {\n $connection->rollBack();\n throw $e;\n }\n }", "public function run()\n {\n\n DB::table('user_roles')->truncate();\n DB::table('users')->truncate();\n DB::table('staff_master')->truncate();\n DB::table('student_master')->truncate();\n $this->createUsers();\n }", "public function deleteTables()\n {\n $query = 'DROP TABLE IF EXISTS accounts, countries, hashtags, tweets, tweet_hashtags, tweet_mentions';\n\n pg_query_params($this->connection, $query, []);\n echo 'Tables deleted<br/>';\n }", "public function preImport()\n {\n ProductQuery::create()->deleteAll();\n CategoryQuery::create()->deleteAll();\n\n FeatureTemplateQuery::create()->deleteAll();\n AttributeTemplateQuery::create()->deleteAll();\n\n TemplateQuery::create()->deleteAll();\n\n CategoryImageQuery::create()->deleteAll();\n CategoryDocumentQuery::create()->deleteAll();\n\n CategoryAssociatedContentQuery::create()->deleteAll();\n\n // Create T1 <-> T2 IDs correspondance tables\n $this->cat_corresp->reset();\n $this->tpl_corresp->reset();\n }", "public function run()\n {\n Model::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n foreach ($this->toTrancate as $table)\n {\n DB::table($table)->truncate();\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n $this->call(UserTableSeeder::class);\n\n $this->call(EventsTableSeeder::class);\n\n $this->call(ElectionTableSeeder::class);\n }", "protected function tearDown()\n {\n $manager = $this->getContainer()->get('akeneo_batch.job_repository')->getJobManager();\n $manager->rollback();\n $manager->getConnection()->close();\n\n $this->dropJobsRecords();\n\n parent::tearDown();\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n $this->call(PasienTableSeeder::class);\n $this->call(LayananTableSeeder::class);\n $this->call(InfoKesTableSeeder::class);\n $this->call(UserTableSeeder::class);\n\n Antrian::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "function end() {\n\t\tif (isset($this->_fixtures) && isset($this->db)) {\n\t\t\tforeach (array_reverse($this->_fixtures) as $fixture) {\n\t\t\t\t$query = $fixture->drop();\n\t\t\t\tif (isset($query) && $query !== false) {\n\t\t\t\t\t$this->db->execute($query);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function tearDown() {\n global $db_prefix;\n if ($this->created_temp_environment && preg_match('/simpletest\\d+/', $db_prefix)) {\n // Delete temporary files directory and reset files directory path.\n simpletest_clean_temporary_directory(file_directory_path());\n variable_set('file_directory_path', $this->original_file_directory);\n\n $schema = drupal_get_schema(NULL, TRUE);\n $ret = array();\n foreach ($schema as $name => $table) {\n db_drop_table($ret, $name);\n }\n $db_prefix = $this->db_prefix_original;\n }\n parent::tearDown();\n }", "public function run()\n {\n Model::unguard();\n $this->truncateTables([\n 'users', 'password_resets', 'categories', 'ticket_categories',\n 'ticket_comments', 'ticket_likes', 'ticket_votes', 'tickets', 'users'\n ]);\n $this->call(UserTableSeeder::class);\n $this->call(TicketTableSeeder::class);\n $this->call(Ticket_votesTableSeeder::class);\n $this->call(Ticket_commentsTableSeeder::class);\n }", "private function drop_rucss_database_tables() {\n\t\t// If the table exist, then drop the table.\n\t\t$this->drop_rucss_current_site_tables();\n\n\t\tif ( ! is_multisite() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforeach ( get_sites( [ 'fields' => 'ids' ] ) as $site_id ) {\n\t\t\tswitch_to_blog( $site_id );\n\n\t\t\t$this->drop_rucss_current_site_tables();\n\n\t\t\trestore_current_blog();\n\t\t}\n\n\t}", "private function truncateTables() {\n global $db;\n\n //Products XML\n $db->query('TRUNCATE TABLE products;');\n $db->query('TRUNCATE TABLE productsForCategories;');\n $db->query('TRUNCATE TABLE productCategories;');\n\n //Users Tables\n $db->query(\"TRUNCATE TABLE users\");\n $db->query(\"TRUNCATE TABLE userInGroups\");\n $db->query(\"TRUNCATE TABLE userSalts\");\n $db->query(\"TRUNCATE TABLE address\");\n $db->query(\"TRUNCATE TABLE addressForUser\");\n $db->query(\"TRUNCATE TABLE phone\");\n $db->query(\"TRUNCATE TABLE phoneForUser\");\n\n //Ajay's Script\n $db->query(\"TRUNCATE TABLE memberUpdateErrors\");\n $db->query(\"TRUNCATE TABLE memberUpdates\");\n\n //Orders XML\n $db->query(\"TRUNCATE TABLE orders\");\n\n //Purchases For Users XML\n $db->query(\"TRUNCATE TABLE purchasesForUser\");\n }", "public function flush()\n {\n $this->throwExceptionIfFrontendDoesNotExist();\n GeneralUtility::makeInstance(ConnectionPool::class)\n ->getConnectionForTable($this->cacheTable)\n ->truncate($this->cacheTable);\n GeneralUtility::makeInstance(ConnectionPool::class)\n ->getConnectionForTable($this->tagsTable)\n ->truncate($this->tagsTable);\n }", "public function run()\n {\n // foreach ($toTruncate as $table) {\n // DB::table($table)->truncate();\n // }\n\n $this->call(CategoryTableSeeder::class);\n $this->call(MethodTableSeeder::class);\n $this->call(ShiftTableSeeder::class);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n FinancialOrganization::truncate();\n BankAccount::truncate();\n\n factory(FinancialOrganization::class, 10)->create();\n factory(BankAccount::class, 100)->create();\n\n }" ]
[ "0.6313665", "0.63104707", "0.6291652", "0.62699497", "0.6243886", "0.6237699", "0.6214121", "0.61996627", "0.61773133", "0.61436737", "0.6135062", "0.61231464", "0.61208254", "0.6116742", "0.6102957", "0.60916877", "0.60693496", "0.6042659", "0.6027381", "0.60163707", "0.59989446", "0.5987292", "0.5984466", "0.5962283", "0.5958761", "0.5951452", "0.5946255", "0.59248084", "0.5909618", "0.5890168" ]
0.6578175
0
/ set_text set text for feature value using given language id.
function set_text($p_language_id, $p_text) { $c_language_id = (int) $p_language_id; $this->v_feature_value_text_array[$c_language_id] = $p_text; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setText($text);", "public function setText($text)\n {\n $this->text = $text;\n }", "public function setText($text)\n {\n $this->text = $text;\n }", "public function setText($text) {\n\n $this->text = $text;\n }", "public function setText($text) {\n $this->text = $text;\n }", "public function setText($text) {\n $this->text = $text;\n }", "public function setText($text) {\n $this->TEXT = $text;\n }", "public function setText($text)\n {\n $this->addText = true;\n $this->text = $text;\n }", "public function setText($text)\n {\n\n $this->text = $text;\n\n }", "function setText($text)\r\n {\r\n $this->_text = $text;\r\n }", "public function text($text)\n {\n $this->text = $text;\n }", "public function setText($text) \n {\n $this->_changed = true;\n $this->_text = $text;\n }", "public function setText(string $text)\n {\n $this->text = $text;\n\n \n }", "public function setText(string $text):void {\r\n\t\t$this->text = $text;\r\n\t}", "public function setText(string $text):void {\r\n\t\t$this->text = $text;\r\n\t}", "public function setText($Text);", "public function setText(string $text): void\n {\n $this->text = $text;\n }", "public function setText($text)\n\t{\n\t\t$this->text = urlencode($text);\n\t}", "public function setText($val) {\n $this->_text = $val;\n }", "public function addFreeText($title, $text, $languageId)\n {\n $ftext = new Text;\n\n $defaultResource = $this->getDefaultResource();\n\n $ftext->setResource($defaultResource);\n\n $ftext->setLocale(\n $this->em->find(\n Language::ENTITY_LANGUAGE,\n $languageId\n )\n );\n $ftext->setSource($title);\n\n if (strlen(trim($text))) {\n $ftext->setTarget($text);\n } else {\n $ftext->setTranslateMe(true);\n }\n\n $ftext->setUser($this->securityContext->getToken()->getUser());\n $ftext->setTranslationType(Text::TRANSLATION_TYPE_FTEXT);\n\n $this->em->persist($ftext);\n $this->em->flush();\n }", "public function setText($var)\n {\n GPBUtil::checkString($var, True);\n $this->text = $var;\n\n return $this;\n }", "public function setText($var)\n {\n GPBUtil::checkString($var, True);\n $this->text = $var;\n\n return $this;\n }", "public function setText ($text)\n {\n\n return $this->text = $text;\n }", "function setText(&$text)\n\t{\n\t\t$this->text = $text;\n\t\t$this->tpl->assign(\"text\", $text);\n\t}", "public function setText($text) {\n $this->text = $text;\n return $this;\n }", "public function set_lang ($lang)\n {\n $this->lang = $lang;\n if (isset($this->text))\n {\n $this->text->default_lang = $lang;\n }\n }", "public function set_text( $text )\n{\n $this->text = $text;\n}", "public function setText($text)\r\n {\r\n $this->text = $text;\r\n\r\n return $this;\r\n }", "public function setText($text)\n {\n $this->text = $text;\n return $this;\n }", "public function setText($text)\n {\n $this->text = $text;\n return $this;\n }" ]
[ "0.70066464", "0.68759066", "0.68759066", "0.6803663", "0.67925245", "0.67925245", "0.6780177", "0.675098", "0.67413855", "0.6729877", "0.6626103", "0.6522665", "0.6466773", "0.63709897", "0.63709897", "0.63503945", "0.634071", "0.6323381", "0.62941337", "0.628331", "0.62380946", "0.62380946", "0.618908", "0.61576307", "0.6155834", "0.6063175", "0.6026505", "0.6020885", "0.60027397", "0.60027397" ]
0.8378641
0
/ get_text get feature value text for a given language id.
function get_text($p_language_id) { $c_language_id = (int) $p_language_id; if (!isset($this->v_feature_value_text_array[$c_language_id])) { return false; } return $this->v_feature_value_text_array[$c_language_id]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getArticleText ($id, $lang)\t{\n\t\t\tif (strcasecmp($lang, \"de\") == 0)\t{\n\t\t\t\t$lang = \"de\";\n\t\t\t}\telse if (strcasecmp($lang, \"it\") == 0)\t{\n\t\t\t\t$lang = \"it\";\n\t\t\t}\telse if (strcasecmp($lang, \"en\") == 0)\t{\n\t\t\t\t$lang = \"en\";\n\t\t\t}\telse \t{\n\t\t\t\t$lang = \"de\";\n\t\t\t}\n\t\t\t\n\t\t\t$texts = $this->returnSQLQuery(\"SELECT * FROM vcms_articles WHERE ID=\".$id);\n\t\t\t\n\t\t\tif ($texts == NULL)\t{\n\t\t\t\t$text = \"Text nicht gefunden.\";\n\t\t\t}\telse\t{\n\t\t\t\t$text = $texts[0][$lang];\n\t\t\t}\n\t\t\treturn $text;\n\t\t}", "function set_text($p_language_id, $p_text)\n {\n $c_language_id = (int) $p_language_id;\n $this->v_feature_value_text_array[$c_language_id] = $p_text;\n return true;\n }", "function unicorn_get_custom_text()\n {\n $custom_text = get_post_meta( get_the_ID(),'_unicorn_custom_text_value_key',true);\n\n return $custom_text;\n }", "public function getText();", "public function getText();", "public function getText();", "public function getText();", "function get_text($key) {\n if (isset($this->text[$key])) {\n return $this->text[$key];\n }\n }", "public function getText($id) {\n $this->db->query('SELECT * FROM tbl_text WHERE PAGEID = :id');\n $this->db->bind(\":id\", $id);\n return $this->db->resultSet();\n }", "public function get_text ()\n {\n return $this->text;\n }", "public function getLanguageValue($languageID);", "function getFeatureValue($featureId, $featureAttr, $languageId = 0, tx_ms3commerce_db $db = null)\n\t{\n\t\t$db = $this->db; // intellisense\n\t\t$value = '';\n\t\tdo \n\t\t{\n\t\t\tif ($featureId <= 0)\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t$field = '';\n\t\t\t$emptyCheck = false;\n\t\t\t$featureAttr = strtolower($featureAttr);\n\t\t\tswitch ($featureAttr)\n\t\t\t{\n\t\t\t\tcase 'titleempty':\t$emptyCheck = true; //fallthrough\n\t\t\t\tcase 'title':\t\t$field = '`Title`'; break;\n\t\t\t\tcase 'infoempty':\t$emptyCheck = true; //fallthrough\n\t\t\t\tcase 'info':\t\t$field = '`Info`'; break;\n\t\t\t\tcase 'unitempty':\t$emptyCheck = true; //fallthrough\n\t\t\t\tcase 'unit':\t\t$field = '`UnitToken`'; break;\n\t\t\t\tcase 'prefixempty':\t$emptyCheck = true; //fallthrough\n\t\t\t\tcase 'prefix':\t\t$field = '`Prefix`'; break;\n\t\t\t\tcase 'dimensionempty':$emptyCheck = true; //fallthrough\n\t\t\t\tcase 'dimension':\t$field = '`Dimension`'; break;\n\t\t\t\t\n\t\t\t\tcase 'id':\t\t\t$field = '`FeatureId`'; break;\n\t\t\t\t\n\t\t\t\tcase 'name':\n\t\t\t\t\treturn $this->dbutils->getFeatureName($featureId);\n\t\t\t}\n\t\t\tif (empty($field))\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t\n\t\t\t$value = $this->dbutils->selectFeatureValue_singleRow($field,$featureId);\n\t\t\tif ($emptyCheck)\n\t\t\t{\n\t\t\t\t$cls = substr($featureAttr, 0, strlen($featureAttr)-5);\n\t\t\t\tif (strlen(trim($value)) == 0)\n\t\t\t\t{\n\n\t\t\t\t\t$value = \"mS3Commerce_{$cls}_isempty\";\n\t\t\t\t} else {\n\t\t\t\t\t$value = \"mS3Commerce_{$cls}_isnotempty\";\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\t\twhile (FALSE);\n\t\treturn $value;\n\t}", "public function get_localized_txt( $p_lang= null ) {\n\t\tglobal $g_active_language;\n\t\tif( !$p_lang ) {\n\t\t\t$p_lang = $g_active_language;\n\t\t}\n\t\tif( isset( $this->contents[$p_lang]) ) {\n\t\t\treturn $this->contents[$p_lang];\n\t\t}\n\t\telse return $this->contents[config_get( 'fallback_language' )];\n\t}", "public function getText () {\n\t$preValue = $this->preGetValue(\"Text\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->Text;\n\treturn $data;\n}", "function _fun_get_text_by_id($data)\n\t {\n\t $this->db->select($data['column_name']);\n $this->db->where($data['column_id'],$data['val']);\n $query = $this->db->get($data['table']);\n\n\t if($query->num_rows() > 0)\n {\n $row = $query->row_array();\n\t\t return $row[$data['column_name']];\n\t }\n\t return '';\n\t }", "private function getText ()\n {\n\n return $this->text;\n }", "public function get_text($id) {\n\t\t$pdo = $this->pdo();\n\n\t\t$sql = <<<SQL\nselect text, memberid, assigntag, submissiontag, type, date, teamid from $this->tablename\nwhere id=?\nSQL;\n\n\t\t$submissionuser = '';\n\t\t$text = null;\n\t\t$assigntag = null;\n\t\t$submissiontag = null;\n\t\t$type = '';\n\t\t$date = 0;\n\t\t$teamId = 0;\n\n\t\t$stmt = $pdo->prepare($sql);\n\t\t$stmt->execute(array($id));\n\t\t$stmt->bindColumn(1, $text, \\PDO::PARAM_STR);\n\t\t$stmt->bindColumn(2, $submissionuser, \\PDO::PARAM_INT);\n\t\t$stmt->bindColumn(3, $assigntag, \\PDO::PARAM_STR);\n\t\t$stmt->bindColumn(4, $submissiontag, \\PDO::PARAM_STR);\n\t\t$stmt->bindColumn(5, $type, \\PDO::PARAM_STR);\n\t\t$stmt->bindColumn(6, $date, \\PDO::PARAM_STR);\n\t\t$stmt->bindColumn(7, $teamId, \\PDO::PARAM_INT);\n\t\t$stmt->fetch(\\PDO::FETCH_BOUND);\n\n\t\treturn array('text' => $text,\n\t\t\t'teamid'=>+$teamId,\n\t\t\t'type'=>$type,\n\t\t\t'memberid' => +$submissionuser,\n\t\t\t'assigntag' => $assigntag, 'submissiontag' => $submissiontag, 'date'=>strtotime($date));\n\t}", "public function getTranslatedText()\n {\n return $this->translatedText;\n }", "public function get_language($id)\n\t{\n\t\treturn $this->get_single($id);\n\t}", "public function get_text()\n\t\t{\n return $this->text;\n }", "public function getText()\n {\n return $this->__get(\"text\");\n }", "function getFeatureHtmlText($featureId, $Filter) {\n\t\t++$this->template->searchNameCounter;\n\n\t\tforeach ($Filter[\"Values\"] as $key => $value)\n\t\t\t$content .= $value;\n\n\t\treturn $content;\n\t}", "private function getArticleText(): string\n {\n if (config('services.wiki_translations.locale') === 'de_DE') {\n $text = optional($this->article->german())->translation;\n } else {\n $text = optional($this->article->english())->translation;\n }\n\n if ($text === null) {\n $text = optional($this->article->english())->translation;\n }\n\n return Article::normalizeContent($text);\n }", "public function text($text = \"\", $lang = NULL) {\n\t\t$pluginPath = App::pluginPath('Phpstardust');\n\t\trequire $pluginPath .'Config' .DS .'locale.php';\n\t\n\t\tif (!CakeSession::check('Config.language')) {\n\t\t\tConfigure::write('Config.language', 'en');\n\t\t\tCakeSession::write('Config.language', 'en');\t\n\t\t}\n\t\t\n\t\tif ($lang!==NULL) {\n\t\t\t\n\t\t\tConfigure::write('Config.language', $lang);\n\t\t\tCakeSession::write('Config.language', $lang);\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $locale[$text][CakeSession::read('Config.language')];\n\t\t\n\t}", "public function getText( ) { \n return $this->text;\n }", "public function getText() {\n return $this->text;\n }", "public function getText()\n {\n return $this->data->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "private function getQuestionTxt($question_id) {\n $quoted_question_id = $this->database->quote($question_id);\n $query = \"SELECT label FROM reviewerlistsquestions\n WHERE id = $quoted_question_id\";\n return $this->database->query($query)->fetchAll(PDO::FETCH_ASSOC)[0]['label'];\n }" ]
[ "0.73874533", "0.6356278", "0.6309557", "0.627063", "0.627063", "0.627063", "0.627063", "0.62208605", "0.61778986", "0.6137422", "0.61146146", "0.60906255", "0.6083416", "0.6070521", "0.6069535", "0.6028557", "0.60199857", "0.6011422", "0.6003295", "0.59978837", "0.59649277", "0.590286", "0.5902669", "0.58942354", "0.5871936", "0.58631676", "0.5862889", "0.5838274", "0.5838274", "0.58271176" ]
0.8343048
0
/ delete delete all FeatureValues for given feature_value_id
function delete() { $coo_feature_set_source = MainFactory::create_object('FeatureSetSource'); $coo_feature_set_source->delete_feature_values($this->v_feature_value_id); $coo_feature_set_source = NULL; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delete()\n {\n $coo_feature = MainFactory::create_object('GMDataObject', array('categories_filter'));\n $t_keys_array = array('categories_id' => $this->v_categories_id,\n 'feature_id' => $this->v_feature_id\n );\n\n $coo_feature->set_keys($t_keys_array);\n $coo_feature->delete();\n $coo_feature = NULL;\n }", "public function destroy($id)\n {\n $row = \\App\\Feature::findOrFail($id);\n \\App\\FeatureMakeup::where('feature_id', $row->id)->delete();\n \\App\\FeatureItem::where('feature_id', $row->id)->delete();\n $row->delete();\n return ['ret'=>0];\n }", "public function delete_by($table, $id_field, $id_value)\n {\n if($this->field_name_is_valid($table) === false) return false;\n if($this->field_name_is_valid($id_field) === false) return false;\n\n return $this->delete($table, array(\n $id_field => $id_value\n ));\n }", "public function delete_all_values_by_field_id($field_id)\n {\n $field_id = intval($field_id);\n $sql = \"DELETE FROM {$this->table}\n WHERE\n field_id = $field_id \";\n Database::query($sql);\n }", "public function deleteValue()\r\n\t{\r\n\t\t// Get request\r\n\t\t$metaValueId = Request::getInt('value');\r\n\t\t\r\n\t\t// Delete from model\r\n\t\t$metaModel = BluApplication::getModel('meta');\r\n\t\t$deleted = $metaModel->deleteMetaValue($metaValueId, array(), false);\r\n\t\t\r\n\t\t// Back to listing\r\n\t\tif ($deleted) {\r\n\t\t\tMessages::addMessage('Meta value deleted', 'info');\r\n\t\t}\r\n\t\t$this->view();\r\n\t}", "public function removeValue($value);", "public function destroy($id)\n {\n $feature = Features::findOrFail($id);\n $feature->delete(); \n }", "public function destroy($id)\n { \n $data = Goods::get();\n // dd($data);\n foreach ($data as $v) {\n // dd (strpos($v->bid,\"$id\"));\n if(strpos($v->bid,\"$id\") > 0){\n flash()->overlay('删除失败,当前属性值正在出售', 5);\n return back(); \n }\n }\n // dd();\n if (Value::destroy($id)) {\n flash()->overlay('删除成功', 1);\n return redirect('admin/values');\n }else{\n flash()->overlay('删除失败', 5);\n return back();\n }\n }", "public function deleteBy($key, $value = null) {\n\t\t$where = $this->_whereValues($key, $value);\n\t\treturn $this->delete($where);\n\t}", "function delete($value='') {\n\t\t$database = database::db();\n\t\t$id_field = $this->field?$this->field:$this->id_field;\n\t\t$value = $value?$value:$this->set[$id_field];\n\t\t$q = sprintf('DELETE FROM '.$this->_esc($this->table).' WHERE `'.$this->_esc($id_field).'`=%s',$this->_esc($value));\n\t\t$database->query($q);\n\t}", "public function deleteAction($value);", "function stop_service_feature_delete($stop_service_feature_id) {\n return entity_get_controller('stop_service_feature')->delete($stop_service_feature_id);\n}", "public function Delete($value){\n $this->RetrieveData();\n foreach($this->cineList as $key =>$cine){\n if($cine->getIdCine() == $value){\n unset($this->cineList[$key]);\n break;\n }\n }\n $this->SaveData();\n }", "public function deleteByField($name, $value) {\n\t\t$this->deleteAll([$name . ' = ?' => $value]);\n\t}", "public static function _deleteByObjId($a_obj_id)\n\t{\t \n\t \tilADTFactory::getInstance()->initActiveRecordByType();\t\n\t\tilADTActiveRecordByType::deleteByPrimary(\n\t\t\t\"adv_md_values\",\n\t\t\tarray(\"obj_id\"=>array(\"integer\", $a_obj_id)));\n\t}", "function delete_dropdown_value($db, $value_id = 0)\n {\n if ($value_id) {\n $sql = \"delete from \" . $this->classified_sell_choices_table . \" where value_id = \" . $value_id;\n $result = $db->Execute($sql);\n if (!$result) {\n return false;\n }\n return true;\n } else {\n return false;\n }\n }", "private function deleteValue($key)\n {\n $valueKey = $this->valueKeyPrefix . $key;\n return $this->_delete($valueKey);\n }", "public function DeleteAllFichasItemValorsAsId() {\n\t\t\tif ((is_null($this->intIdItem)))\n\t\t\t\tthrow new QUndefinedPrimaryKeyException('Unable to call UnassociateFichasItemValorAsId on this unsaved Item.');\n\n\t\t\t// Get the Database Object for this Class\n\t\t\t$objDatabase = Item::GetDatabase();\n\n\t\t\t// Perform the SQL Query\n\t\t\t$objDatabase->NonQuery('\n\t\t\t\tDELETE FROM\n\t\t\t\t\t`fichas_item_valor`\n\t\t\t\tWHERE\n\t\t\t\t\t`id_item` = ' . $objDatabase->SqlVariable($this->intIdItem) . '\n\t\t\t');\n\t\t}", "public function delete( $contentId )\n {\n $locationIds = $this->contentGateway->getAllLocationIds( $contentId );\n foreach ( $locationIds as $locationId )\n {\n $this->locationGateway->removeSubtree( $locationId );\n }\n $this->fieldHandler->deleteFields( $contentId );\n\n $this->contentGateway->deleteRelations( $contentId );\n $this->contentGateway->deleteVersions( $contentId );\n $this->contentGateway->deleteNames( $contentId );\n $this->contentGateway->deleteContent( $contentId );\n }", "public function deleteValues($ipropertyId)\n\t{\n\t\t$ipropertyId = intval($ipropertyId);\n\t\t$connection = \\Bitrix\\Main\\Application::getConnection();\n\t\t$connection->query(\"\n\t\t\tDELETE FROM b_iblock_iblock_iprop\n\t\t\tWHERE IPROP_ID = \".$ipropertyId.\"\n\t\t\");\n\t\t$connection->query(\"\n\t\t\tDELETE FROM b_iblock_section_iprop\n\t\t\tWHERE IPROP_ID = \".$ipropertyId.\"\n\t\t\");\n\t\t$connection->query(\"\n\t\t\tDELETE FROM b_iblock_element_iprop\n\t\t\tWHERE IPROP_ID = \".$ipropertyId.\"\n\t\t\");\n\t}", "function deleteData()\n{\n global $myDataGrid;\n $arrKeys = [];\n foreach ($myDataGrid->checkboxes as $strValue) {\n $arrKeys['id'][] = $strValue;\n }\n $dataHrdEvaluationCategory = new cHrdEvaluationCategory();\n $dataHrdEvaluationCategory->deleteMultiple($arrKeys);\n $myDataGrid->message = $dataHrdEvaluationCategory->strMessage;\n}", "public function catproductDelete($value){\n\t\t$prod = $this->getProductsByCategorie($value);\n\t\t//print_r($prod);\n\t\tif (!empty($prod)){\n\t\t\tthrow new Exception(\"La categorie n'est pas vide ! \",1234);\n\t\t}\n\t\t\n\t\t$this->dbConnect();\n\t\t$this->begin();\n\t\t\n\t\t$sql = \"DELETE FROM .`catproduct` \n\t\t\t\tWHERE `id`=\". $value .\";\";\n\t\t$result = mysqli_query($this->mysqli,$sql);\n\t\t\t\n\t\tif (!$result) {\n\t\t\t$this->rollback();\n\t\t\tthrow new Exception('Erreur Mysql catproductDelete sql = : '.$sql);\n\t\t}\n\n\t\t$this->commit();\n\t\n\t\t$this->dbDisConnect();\n\t}", "public static function _deleteByFieldId($a_field_id, ilADT $a_adt)\n\t{\t \t\n\t\tilADTFactory::getInstance()->initActiveRecordByType();\t\n\t\tilADTActiveRecordByType::deleteByPrimary(\n\t\t\t\"adv_md_values\",\n\t\t\tarray(\"field_id\"=>array(\"integer\", $a_field_id)),\n\t\t\t$a_adt->getType());\t \t\n\t}", "public function delete($id)\n\t{\n\t\t$this->tableGateway->delete(['kvpsecu' => (int) $id]);\n\t}", "public function data_delete($mytable,$attribute_name, $attribute_value)\n\t{\n\t\t$this->db->where($attribute_name, $attribute_value);\n\t\t$this->db->delete($mytable);\n\t\treturn true;\n\t}", "function deleteByContextId($contextId) {\n\t\t$submissions = $this->getByContextId($contextId);\n\t\twhile ($submission = $submissions->next()) {\n\t\t\t$this->deleteById($submission->getId());\n\t\t}\n\t}", "public function removeStatsFacet($value) {}", "function delete_data(){\r\n\t\t$value=explode(\"+#+\",$this->Value);\r\n\t\tmysqli_query($this->conn,\"delete from \".$this->table.\" where \".$this->identifier.\"='\".$value[0].\"'\");\r\n\t}", "public function deleteTaxaAttributeById($id) {\n $this->db->query('DELETE FROM `taxa_attribute_value` \n WHERE `taxa_id`=' . intval($this->data['id']) . ' AND `taxa_attribute_id` = ' . intval($id)\n , \\Zend\\Db\\Adapter\\Adapter::QUERY_MODE_EXECUTE);\n }", "public function delete()\n {\n self::remove($this->key);\n $this->key = null;\n $this->value = null;\n }" ]
[ "0.60049546", "0.57921547", "0.5737796", "0.5685768", "0.5631149", "0.56299704", "0.56014276", "0.55821913", "0.5580978", "0.5539648", "0.55252486", "0.5519432", "0.55174005", "0.54131144", "0.53798753", "0.53780943", "0.53548527", "0.534737", "0.53210944", "0.5310661", "0.53070635", "0.53056365", "0.53033745", "0.52976227", "0.5272272", "0.5253984", "0.5251536", "0.5218889", "0.52176833", "0.52011067" ]
0.65732825
0
It returns the label for status_id field
public function getStatusLabelAttribute() : string { return isset($this->status_id) && isset($this->statusLabels[$this->status_id]) ? $this->statusLabels[$this->status_id] : '-'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLabelField() \n {\n return \"status_desc\";\n }", "public function getStatusLabel() {\n\n $statusString = ucfirst($this->getStatusString());\n\n switch ($this->getStatus()) {\n case self::STATUS_LEAD:\n return '<span class=\"label label-default\">' . $statusString . '</span>';\n case self::STATUS_SAVED:\n return '<span class=\"label label-success\">' . $statusString . '</span>';\n default:\n return '<span class=\"label label-warning\">' . $statusString . '</span>';\n }\n\n }", "public function getStatusLabel()\r\n {\r\n switch ($this->status) {\r\n case Task::STATUS_PENDING:\r\n $statusLabel = Yii::t('TaskModule.views_index_index', 'Begin Task');\r\n break;\r\n case Task::STATUS_IN_PROGRESS:\r\n if ($this->review)\r\n $statusLabel = Yii::t('TaskModule.views_index_index', 'Let Task Review');\r\n else\r\n $statusLabel = Yii::t('TaskModule.views_index_index', 'Finish Task');\r\n break;\r\n case Task::STATUS_PENDING_REVIEW:\r\n $statusLabel = Yii::t('TaskModule.views_index_index', 'Finish Task');\r\n break;\r\n default :\r\n $statusLabel = '';\r\n }\r\n\r\n return $statusLabel;\r\n }", "function getLabelStatus()\n {\n $labels = $this->getLabelsStatus();\n if(isset($labels[$this->status])){\n return $labels[$this->status];\n }\n }", "public static function statusLabel($status)\n {\n $statuses = static::getStatuses();\n return ArrayHelper::getValue($statuses, $status);\n }", "function getLabelStatus() {\n $labels = $this->getLabelsStatus();\n if (isset($labels[$this->status])) {\n return $labels[$this->status];\n }\n }", "public function getStatusLabel($status)\n {\n $return = '-';\n foreach ($this->getAllRemittanceFileStatus() as $statusId => $label) {\n if ($statusId == $status) {\n $return = $label;\n break;\n }\n }\n return $return;\n }", "public function getStatusLabel() {\n return $this->getConfig ()->getStatusLabel ( $this->getStatus () );\n }", "public function getStatusLabelAttribute()\n {\n return isset($this->statusLabel[$this->state]) ? $this->statusLabel[$this->state] : '';\n }", "public function getStatusLabel($status)\n {\n $labels = self::statusLabels();\n\n if (isset($labels[$status])) {\n return $labels[$status];\n }\n\n return $status;\n }", "public function getStatusLabel($status)\n {\n if (isset($status)) {\n if ($status == 0) {\n $status = 'Inactive';\n } else if ($status == 1) {\n $status = 'Active';\n } else if ($status == 2) {\n $status = 'Draft';\n }\n }\n return $status;\n }", "private function prepareLabelValue()\n {\n return __('Subscription status') . ': ' . $this->subscriptionStatusProvider->getStatus();\n }", "protected function getLabel()\n {\n return str_replace($this->id, $this->id . '_id', parent::getLabel());\n }", "private function _getOrderStatusLabel($orderStatus)\n {\n $orderStatusLabel = \"\";\n\n $statuses = Mage::getModel('sales/order_status')->getResourceCollection()->getData();\n foreach ($statuses as $status)\n {\n if($status[\"status\"] == $orderStatus)\n return $status[\"label\"];\n }\n return $orderStatusLabel;\n }", "public function getStatusName(){\n return $this->status;\n }", "function learndash_get_step_post_status_label( $post ) {\n\t$post_status_label = '';\n\tif ( ( $post ) && ( is_a( $post, 'WP_Post' ) ) ) {\n\t\t$post_status_slug = learndash_get_step_post_status_slug( $post );\n\t\t$post_statuses = learndash_get_step_post_statuses();\n\t\tif ( isset( $post_statuses[ $post_status_slug ] ) ) {\n\t\t\t$post_status_label = $post_statuses[ $post_status_slug ];\n\t\t}\n\t}\n\n\treturn $post_status_label;\n}", "public function getStatusName() : string\n {\n return ArrayHelper::get(LanguageHelper::getStatuses(), $this->status);\n }", "public function getStatusLabelAttribute()\n {\n if ($this->id_satuan >= 0) {\n return '<span class=\"badge badge-secondary>Draft</span>';\n }\n return '<span class=\"badge badge-success>Publish</span>';\n }", "public function getStatusId()\n {\n return $this->__get(\"status_id\");\n }", "public function genLabelStatus($status) {\n $symbol = \"\";\n\n switch (strtolower($status)) {\n case 'in progress':\n $symbol = '<span class=\"label label-sm label-default\">'.$status.'</span>';\n break;\n\n case 'approved':\n $symbol = '<span class=\"label label-sm label-success\">'.$status.'</span>';\n break;\n\n case 'rejected':\n $symbol = '<span class=\"label label-sm label-danger\">'.$status.'</span>';\n break;\n\n case 'waiting':\n $symbol = '<span class=\"label label-sm label-warning\">'.$status.'</span>';\n break;\n\n case 'verify':\n $symbol = '<span class=\"label label-sm label-warning\">'.$status.'</span>';\n break;\n\n case 'recheck':\n $symbol = '<span class=\"label label-sm label-warning\">'.$status.'</span>';\n break;\n }\n\n return $symbol;\n }", "public function getStatusAttribute()\n {\n return data_get($this->ticket, 'ticketStatus.label');\n }", "public function getWorkflowBaseStatusLabel()\n {\n $label = '';\n $hasWorkflow = false;\n if ($this->getBehavior('workflow') || $this->findBehaviorByClassName(SimpleWorkflowBehavior::className())) {\n $hasWorkflow = true;\n }\n if ($hasWorkflow && $this->hasWorkflowStatus()) {\n /** @var Status $status */\n $status = $this->getWorkflowStatus();\n if ($status) {\n $label = $status->getLabel();\n }\n }\n return $label;\n }", "public function getStatusLabel()\r\n {\r\n return $this->status ? Yii::t('app', 'Active') : Yii::t('app', 'Inactive');\r\n }", "static function getLabelsStatus()\n {\n static $labelsStatus = array(\n self::STATUS_DRAFT => 'pequiven_objetive.status.draft',\n self::STATUS_APPROVED => 'pequiven_objetive.status.approved',\n );\n return $labelsStatus;\n }", "public function getStatusAttribute()\n {\n $status = $this->attributes['status'];\n\n $statusus = self::$improvementStatus;\n $statusLabel = [\n 'identifier' => $status,\n 'label' => $label = isset($statusus[$status]) ? $statusus[$status] : false,\n ];\n\n return $statusLabel;\n }", "public function getStatusName($status_id = null) {\n if (!$status_id) {\n $status_id = $this->getStatus();\n }\n return self::LIST_STATUS[$status_id];\n }", "public function getEngagementStatusLabelAttribute()\n {\n return data_get($this->engagement, 'status_label');\n }", "public function getStatusId();", "function erp_ac_get_status_label( $items, $slug ) {\n $label = '';\n $status = $items->status;\n \n switch ( $status ) {\n case 'closed':\n $label = __( 'Closed', 'erp-accounting' );\n break;\n\n case 'paid':\n $label = __( 'Paid', 'erp-accounting' );\n break;\n\n case 'awaiting_payment':\n $label = __( 'Awaiting Payment', 'erp-accounting' );\n break;\n\n case 'overdue':\n $label = __( 'Overdue', 'erp-accounting' );\n break;\n\n case 'partial':\n $label = __( 'Partially Paid', 'erp-accounting' );\n break;\n\n case 'draft':\n $url = admin_url( 'admin.php?page='.$slug.'&action=new&type=' . $items->form_type . '&transaction_id=' . $items->id );\n $label = sprintf( '%1s<a href=\"%2s\">%3s</a>', __( 'Draft', 'erp-accounting' ), $url, __( ' (Edit)', 'erp-accounting') );\n break;\n }\n\n return apply_filters( 'erp_ac_status_labels', $label, $status );\n}", "public function getNameStatus()\n {\n return (self::getStatuses())[$this->status] ?? '';\n }" ]
[ "0.7775824", "0.7713031", "0.75868374", "0.7564532", "0.7550372", "0.7529831", "0.7509834", "0.7374906", "0.7366883", "0.732773", "0.7209652", "0.7141887", "0.71174663", "0.7070184", "0.6903073", "0.68884134", "0.68808144", "0.68469316", "0.6829772", "0.68267936", "0.6801769", "0.6797985", "0.6796839", "0.6777776", "0.67748576", "0.671619", "0.6702291", "0.6647963", "0.6643153", "0.6630859" ]
0.7713837
1
Get the resume content from the database
public function getResume() { //Bring in the mySQL connection global $mysqli; //Define the query $query = "select `section_anchor`, `section_bground`, `section_name`, `section_slide`, `section_class`, `item_content`, `item_order`, `item_slide` from section, item where section_id = item_section order by section_id, item_order asc"; //Run the query if ($result = $mysqli->query($query, MYSQLI_STORE_RESULT)) { //Keep track of what section we're in $currentSection = ''; //Cycle through the results and create an array of content while($resultRow = $result->fetch_array(MYSQLI_ASSOC)) { //If we're in a new section, add it's details to the array if ($currentSection != $resultRow['section_name']) { $currentSection = $resultRow['section_name']; //Send unique section details into an array $this->sectionDetails['names'][] = $resultRow['section_name']; $this->sectionDetails['anchors'][] = $resultRow['section_anchor']; $this->sectionDetails['bgrounds'][] = $resultRow['section_bground']; $this->sectionDetails[$currentSection]['slide'] = $resultRow['section_slide']; $this->sectionDetails[$currentSection]['class'] = $resultRow['section_class']; } //Add the resume content to the array $this->resumeContent[$currentSection]['content'][$resultRow['item_slide']][]['content'] = $resultRow['item_content']; } // Free DB results $result->free(); //Close connection to DB $mysqli->close(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_resume2()\n {\n return $this->db->join('category', 'resume.work_category = category.id_category')\n ->where('id_login',$this->uri->segment(4))\n ->get('resume')\n ->result();\n }", "private function loadTextFromDB()\n {\n return $this->fmAPI->findAll('WebContent', '\\MSDev\\FileMakerDataAPIBundle\\Entity\\WebContent');\n }", "public function getResume()\n {\n return $this->hasOne(Resume::class, ['id' => 'resume_id']);\n }", "public function get_data() {\n $query = \"SELECT * FROM user_resume WHERE id = :id\";\n $usresume = $this->pdo->prepare($query);\n $usresume->execute(['id' => $_POST['id']]); \n return $usresume;\n }", "public function resume_list(){\n $count = M(\"u_resume\")->count();\n //实例化分页类\n $Page = new \\Think\\Page($count,$this->pagenum);\n // $Page = new \\Think\\Page($count,20);\n //设置上一页与下一页\n $Page->setConfig('prev', '上一页');\n $Page->setConfig('next', '下一页');\n $Page->setConfig('theme', '%HEADER% %FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END%');\n //显示分页信息\n $show = $Page->show();// 分页显示输出 ->limit($Page->firstRow.','.$Page->listRows)\n //$field = \"u_donation.*,\";\n $list = M(\"u_resume\")->limit($Page->firstRow.','.$Page->listRows)->order(\"resume_id DESC\")->select();\n $this->assign('list',$list);\n $this->assign('page',$show);\n $this->display();\n }", "public function getResume()\n {\n return $this->_resume;\n }", "public function getResume()\n {\n return $this->_resume;\n }", "public function resume() {\n # Define a one-to-many relationship.\n return $this->hasMany('Resume');\n }", "public function sidebarResume()\n {\n $userManager = new UserManager();\n\n $admin = $userManager->findOneBy(['role' => User::ROLE_ADMIN]);\n\n //Sends the list of networks links corresponding to the admin user to the twig template\n $uploadManager = new UploadManager();\n\n ! is_null($admin['resume_id'])\n ? $this->templateVars['resume'] = $uploadManager->findOneBy(['id'=>$admin['resume_id']])\n : $this->templateVars['resume'] = null;\n }", "function list_upload_resume($id_pelaut= \"\")\n\n\t{\n\n\t\t$str = \"select * from resume_file where id_pelaut = '$id_pelaut' \";\n\n\t\t$q = $this->db->query($str);\n\n\t\t$f = $q->result_array();\n\n\t\treturn $f;\n\n\t\t\n\n\t}", "public static function viewResumedetails($request) {\n\t\t$db = DB::connection('mysql');\n\t\t$select = $db->table('mst_resume')\n\t\t\t\t\t->SELECT('*')\n\t\t\t\t\t->where([['empId', '=', $request->empid]])\n\t\t\t\t\t->ORDERBY('createdDate', 'DESC')\n\t\t\t\t\t->paginate($request->plimit);\n\t\treturn $select;\n\t}", "function getContent(){ $this->fetchContent(); return $this->_Content; }", "function get_user_resume($where){\n \n\n $resume = base_url().USER_RESUME;\n $cv = base_url().USER_CV;\n\n $this->db->select('COALESCE(user_resume,\"\") as user_resume, COALESCE(user_cv,\"\") as user_cv,\n (case\n when(user_resume = \"\")\n THEN \"\"\n ELSE CONCAT (\"'.$resume.'\",user_resume) \n END ) as user_resume_url ,\n\n (case\n when(user_cv = \"\")\n THEN \"\"\n ELSE CONCAT(\"'.$cv.'\",user_cv) \n END ) as user_cv_url');\n\n $res = $this->db->where($where)->get(USER_META)->row();\n return $res;\n }", "public function resume()\n {\n $pend = Pendidikan::where('user_id', Auth::user()->id)->orderBy('tahun_lulus', 'desc')->get();\n $work = Experience::where('user_id', Auth::user()->id)->orderBy('work_from', 'desc')->get();\n $skill = Skill::where('user_id', Auth::user()->id)->get();\n $bahasa = Bahasa::where('user_id', Auth::user()->id)->get();\n $serti = Sertificate::where('user_id', Auth::user()->id)->get();\n return view('pegawai.resume', compact('pend', 'work', 'skill', 'bahasa', 'serti'));\n }", "public function resume()\n {\n return $this->belongsTo(Resume::class);\n }", "public function getIntroduction() {\n $content = $this->db->query('SELECT introduction FROM home_page WHERE id=1');\n if(!$content) {\n $content = '';\n } else {\n $content = $content->fetch_row()[0];\n }\n return $content;\n }", "function getUserResumeHeadlineDetails($user_id) {\n \n //echo $select;\n $select = $this->pdo->prepare(\"SELECT * FROM user_resume_headline WHERE user_id=?\");\n $select->execute(array($user_id));\n \n $user_details = $select->fetchAll(PDO::FETCH_ASSOC);\n \n return $user_details;\n }", "protected function getContents()\n {\n return $this->engine->get($this->path, $this->gatherData());\n }", "function homePageContent(){\n\t\t\t$query = $this->link->prepare(\"select * from homepage\");\n\t\t\t$query->execute();\n\t\t\treturn $query->fetchALL(PDO::FETCH_ASSOC);\n\t\t}", "public function getContents() {\n //echo \"TRACE=\".$this->getClass().\"-\".$this->id;\n return bizobject::getBizobjects('content', 'referentClass=\"'.$this->getClass().'\" AND referentId='.$this->id, 'format');\n }", "function content($page){\n\t\t\t$query = $this->link->prepare(\"select content from otherpages where id=$page\");\n\t\t\t$query->execute();\n\t\t\treturn $query->fetchALL(PDO::FETCH_ASSOC);\n\t\t\t\n\t\t}", "public function index()\n {\n $resume=Auth::check()?Auth::user()->resume:null;\n return view('resumes.index',compact('resume'));\n }", "public function index()\n {\n //$resumes = Resume::all();\n \n return view('resume.index');\n }", "public function web_content_detail(){\n $content_detail = $this->db->select('*')->get('webcontents')->result_array();\n if ($content_detail) {\n return $content_detail;\n }\n else {\n return array('status' => 'FALSE' , 'message' => 'Something Went Wrong.');\n }\n }", "public function get_content($id)\n {\n $qr = \"SELECT content FROM task WHERE id ='$id'\";\n if (mysqli_query($this->conn, $qr)) {\n $content = mysqli_query($this->conn, $qr);\n $row = $content->fetch_assoc();\n }\n return $row['content'];\n }", "protected function loadTaskContent()\n {\n\n // Require task ID\n if (!empty($this->id)) {\n if ($content = $this->db->fetch(sprintf(\n \"SELECT `subject`, `body`, `doc_id` FROM `%s` WHERE `task_id` = :task_id;\",\n $this->settings->TABLES['LM_TASK_EMAILS']\n ), [\n 'task_id' => $this->id\n ])) {\n $this->row = array_merge($this->row, $content);\n }\n }\n }", "function getdata() {\n\t\t\tglobal $wpdb, $table_prefix;\n\t\t\t$table_name = $table_prefix.DOCUMENTORLITE_SECTIONS;\n\t\t\t$results = $wpdb->get_results( $wpdb->prepare(\"SELECT * FROM $table_name WHERE sec_id = %d\", $this->secid ) );\n\t\t\treturn $results;\n\t\t}", "function getData()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (empty($this->_data))\n\t\t{\n\t\t\t$query = $this->_buildQuery();\n\t\t\t$this->_data = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit'));\n\t\t\tif ($this->_data)\n\t\t\t{\n\t\t\t\techo $this->_db->getErrorMsg();\n\t\t\t}\n\t\t}\n\t\treturn $this->_data;\n\t}", "public function getAllContent()\n {\n $this->db->connect();\n $sql = \"SELECT * FROM $this->table;\";\n $resultset = $this->db->executeFetchAll($sql);\n return $resultset;\n }", "public function downloadresumeAction(){\n\t\t$cand_details_model = new Default_Model_Candidatedetails();\n \t$result = $cand_details_model->getcandidateData($this->_getParam('id'));\n \tif(!empty($result['cand_resume'])){\n \t\t$status = array();\n\t\t\t$file = BASE_PATH.'/uploads/resumes/'.$result['cand_resume'];\n\t\t\t$status = sapp_Global::downloadFile($file);\n\t\t\tif(!empty($status['message'])){\n\t\t\t\t$this->_helper->FlashMessenger()->setNamespace('down_resume')->addMessage($status['message']);\n\t\t\t}\n \t}\n \t\t$this->_redirect('scheduleinterviews/edit/id/'.$this->_getParam('int_id'));\n }" ]
[ "0.64087164", "0.63521224", "0.63430405", "0.6324436", "0.61402166", "0.61208516", "0.6094812", "0.60523945", "0.5920464", "0.5887443", "0.5875615", "0.58002496", "0.57822716", "0.5730966", "0.57081544", "0.56813383", "0.56712234", "0.5618019", "0.5596266", "0.5509361", "0.5503723", "0.5497667", "0.5484934", "0.5484825", "0.5483146", "0.54806143", "0.5476673", "0.5453589", "0.54384166", "0.5418836" ]
0.7189153
0
Create a new FileIcon instance. Read the catalog of available file icons and saves it to $supportedFileExtensions as an array
public function __construct() { $this->supportedFileExtensions = json_decode( file_get_contents(base_path("node_modules/file-icon-vectors/dist/icons/vivid/catalog.json")) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addIcon( &$file )\n\t{\n\t\tstatic $icon_exists = array();\n\n\t\tswitch ($file->ext)\n\t\t{\n\t\t\t// Image\n\t\t\tcase 'jpg':\n\t\t\tcase 'png':\n\t\t\tcase 'gif':\n\t\t\tcase 'xcf':\n\t\t\tcase 'odg':\n\t\t\tcase 'wbmp':\n\t\t\tcase 'bmp':\n\t\t\tcase 'ico':\n\t\t\tcase 'jpeg':\n\t\t\tcase 'webp':\n\t\t\t\t$file->icon = 'components/com_flexicontent/assets/images/mime-icon-16/image.png';\n\t\t\tbreak;\n\n\t\t\t// Non-image document\n\t\t\tdefault:\n\t\t\t\tif ( !isset($icon_exists[$file->ext]) ) {\n\t\t\t\t\t$icon = JPATH_SITE.DS.'components'.DS.'com_flexicontent'.DS.'assets'.DS.'images'.DS.'mime-icon-16'.DS.$file->ext.'.png';\n\t\t\t\t\t$icon_exists[$file->ext] = file_exists($icon);\n\t\t\t\t}\n\t\t\t\tif ( $icon_exists[$file->ext] ) {\n\t\t\t\t\t$file->icon = 'components/com_flexicontent/assets/images/mime-icon-16/'.$file->ext.'.png';\n\t\t\t\t} else {\n\t\t\t\t\t$file->icon = 'components/com_flexicontent/assets/images/mime-icon-16/unknown.png';\n\t\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\treturn $file;\n\t}", "protected function _buildListOfIcons()\n {\n $icons = new \\Yana\\Views\\Icons\\Collection();\n $icons[\"1\"] = $icon1 = new \\Yana\\Views\\Icons\\File();\n $icon1->setId(\"Id1\")->setPath(\"Path1\");\n $icons[\"2\"] = $icon2 = new \\Yana\\Views\\Icons\\File();\n $icon2->setId(\"Id2\")->setPath(\"Path2\");\n return $icons;\n }", "function get_icons() {\n\t\t$icons = array();\n\t\t$config = themify_fontello_get_config();\n\t\tif( $config ) {\n\t\t\tif( ! empty( $config['glyphs'] ) ) {\n\t\t\t\tforeach( $config['glyphs'] as $glyph ) {\n\n\t\t\t\t\t/* custom icons uploaded but not selected are still included in the list; skip over those. */\n\t\t\t\t\tif( isset( $glyph['src'] ) && $glyph['src'] === 'custom_icons' && $glyph['selected'] == false ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$icons[ 'tf_fontello-' . $glyph['css'] ] = $glyph['css'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t'key' => 'custom',\n\t\t\t\t'label' => __( 'Icons', 'themify' ),\n\t\t\t\t'icons' => $icons\n\t\t\t),\n\t\t);\n\t}", "function iconfile ($file) {\n $ftype = strrchr($file, '.');\n\n $iconfiles = array(\n ## Office Documents\n '.doc' => 'page_white_word.png',\n '.docx' => 'page_white_word.png',\n '.ppt' => 'powerpoint.png',\n '.xls' => 'page_white_excel.png',\n '.xlsx' => 'page_white_excel.png',\n '.rtf' => 'page_white_word.png',\n ## PDF\n '.pdf' => 'page_white_acrobat.png',\n ## Images\n '.gif' => 'page_white_picture.png',\n '.jpeg' => 'page_white_picture.png',\n '.jpg' => 'page_white_picture.png',\n '.png' => 'page_white_picture.png',\n ## Archives\n '.zip' => 'page_white_compressed.png'\n );\n\n if (array_key_exists($ftype, $iconfiles)) {\n $image = $iconfiles[$ftype];\n } else {\n $image = 'page_white.png';\n }\n\n return '<img src=\"'.STATIK.'nro/illus/'.$image.'\" alt=\"\" width=\"16\" height=\"16\">';\n}", "public function getSupportedFileExtensions();", "public function getFileIconId();", "function geticon($ext)\n{\n$icons = array(\n'file' => \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABYlBMVEUgIGVZgcZYgsVdhMRehMRhiMNiicNlisJni8FpjMFsjsBujr9ykL9ykb92k716lbt7lbx+l7qCmryFnb6IoMCLosKMosKPpcSRp8aSqMaVq8iXrMmarsudsM2dsc2htM6jttGkttGnudOpu9SqvNWuvtevwNizw9rU5PrW5PrW5frW5fvX5fvY5frY5vvZ5vvZ5/va5/ra5/vb5/vc6Pvc6Pzc6fvc6fzd6fvd6fze6fve6vve6vzf6vvf6vzf6/zg6/vg6/zh6/zg7Pzh7Pvh7Pzi7Pvi7Pzi7fzj7fvj7fzk7fzj7vzj7v3k7vzl7vzl7v3l7/zl7/3m7/zm7/3n7/zn8Pzn8P3o8Pzo8P3p8P3o8f3p8f3q8f3r8f3q8vzr8v3r8/3s8/3t8/3t9P3t9P7u9P3u9P7v9P3u9f7v9f3v9f7w9f7w9v3x9v3x9/7y9/3y9/7z9/70+P7///9VgMh2qvBUAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfWCxgAGCK9tcJOAAAA50lEQVQY02NgYGBQV1aQk5YQFRYUZIAAteLiooLc7DTBEqiIanFhXk5GarJgCVREpTA/Nz0lKQEoABFRysnJTE6KjxEEAZCAYlZaUmJsTGRwgJcHWEA+LSkhNjo8xN/XwwUsIJuUEBMRGuzn4+rqyA8SkImLigz39/Nydba35gMJSEWGB/t7e7g6WluZ84AEJMMCA7zdXR2sLUyMuEAC4kH+Hu5O9jZmJkYGHCABMW9PN0d7G1MTQz0dNpCAiIerva2libGhvq4WC0hA2NHOCqhdX09bU4MRJCAkIMDHy83JzsrMVFoKAB5KMY+XnxuDAAAAAElFTkSuQmCC\", \n'doc'=>\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABLFBMVEUgIH0IL4sFNoIIPIgGQpsoPm0JS7IhTJo6WpgyW7YqYrc4Ya5AZrQ6abhEarlNaqdCbsRVbaRJdMxddatSd8pVe85VgMhffcNYftFZgcZYgsVnfrNdhMRggc1ehMRhiMNiicNlisJni8F3ipxpjMFnitVsjsBujr9ykL9ykb92k713kdV6lbt7lbx+l7p8l9iCmryFnb6DnNqIoMCAnuaLosKMosKLpN2Rp8aJpemXrMmQrtaTq+adsc2jttGpu9StutCvvN+vwNiqvvGzw9q3yPTJ0uLW3OrS4vrU4/rc4vTW5PrX5fvZ5vvb5/vc6Pve6fvg6vzh7Pzj7fzl7vzm7/zo8P3q8f3r8v3w8vrt8/3v9P3w9v7y9/70+P71+f73+v75+/////8BMngx1mg0AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfWBhAMAA2gQXJ0AAAA4ElEQVQY0z2O11bCQBBAh2VdmkZjQSzYICggqxRF3NilhRYgiAVQh///BzKi3re595yZAQB4vru9ub66yEoJcx6/vz4n49GHRDKmWSqcGZH1leC7RDIm/iJeXeGa0lMuWo1aelEMJQEFK7dpadZyTLwMnH5PQhrT2oOv6K9wmrsSDNzR1lhgAbmjVNc+hQ3U/WXG7tHrdruTglX0hN7YIiLrKdVpn8DS39mp29utBASFEJxzL5vaSrWaR/T65c9+6s3GAYm801dzGvU9Etn/Xq9tkTjPZFLJ4/jh/u52ODwDUNw0qTJOYJQAAAAASUVORK5CYII=\",\n'pdf'=>\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABPlBMVEVtCQJjAACMAAiUAABzGBitAAi1AADGAADOCAicISHOEBDnCBDWGBj3EBD3GBjOKTGcQkK9OTn3KSneOTm9SkrvOTn/MTnOSkq9UlreSkrvQkrnSkpVgMjvSkpZgcZYgsVdhMRehMTvUlLvUlphiMNiicPnWlplisLnWmNni8HWY2tpjMFsjsBujr9ykL9ykb92k716lbt7lbx+l7rnc3OCmryFnb6IoMD/c3Pve3uLosKMosLehISPpcSRp8aSqMbnjIyVq8iXrMmZrcqcsMydsc2jttHvnJypu9SsvtavwNizw9rvra3etb3v1tbS4vrU4/rW5PrX5fvZ5vvb5/vc6Pve6fvg6vzh7Pzj7fzl7vzn7/fm7/zo8P3q8f3r8v3t8/3v9P3w9v7y9/70+P71+f73+v75+/////9aAACwyNz9AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfWBhAMAijZc8SxAAAA0klEQVQY02NgYGDw9nBzdbKzMjM2ZoAAr/S01JTkpETjDKiIJ4SfYJwBEpEQERTXUFNWk+KPBwoARSxkxYT4+Hj5uFnjjEGAQZSHi4udg52VjSk2JioywpiBmTGTRQAIOAVA/HCwsS6JCfFxkmB+mCFIwBnI9xN2B/FDDUACjvFxsZbRDj5AfogeSMA+LtZP2sdHUlrJJlgHJGAbG6PmC1LvqxWkCRKwjtFwAPFDgoMCVUEC5iYmMH6AIkjALBLO95cDCZgaGRno62qrqyjIy8gAAGduNQKHw8HXAAAAAElFTkSuQmCC\",\n'xls' => \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABdFBMVEVveCo0TRk1TRg0Uhc0Uxc0WBU0XhM0XhQ1Xho0YxE0ZBI2YxszaQ8yaCgzbQ40bQ47aB4zcA06bx45cB47cSI6dxk8dx8+ex46fSc/fSFCgCVGhCxHhS1CiTVHiDtNjDZgflxPjjlIkj9Tk0BSl0hVgMhYmEdZgcZYgsVamklemFVdhMRehMRYnlJhiMNiicNbolhfoVNlisJhoFhholRni8FpjMFwm21sjsBujr9lp1tkqGBykL9ykb9nql92k71prWJqrGV0pXB6lbt7lbx+l7ptsGeCmryFnb6HqYWIoMCLosKMosKRp8acsJuXrMmQrtaQvYuhs5+dsc2Two6TxI2WxJGjttGaxpapu9SvwNizw9rA0cDM2svP3c/W4tbS4vrU4/rW5PrX5fvZ5vvf6d/b5/vc6Pve6fvg6vzl7OXh7Pzj7fzl7vzm7/zo8P3q8f3r8v3t8/3v9P3w9v7y9/70+P71+f73+v75+/////81SRob6qKVAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfWBhAMAg4LfkFMAAAA4ElEQVQY02NgYGCIjgwP9vf19nB1ZYCAqMqK8rLSkmLXKpCIm4OVoaayvIyUeJFrFUjErQoKBAuBAkARtxBrlapYLS0/vgJXEGCwywp1lHUylovnyc/Lzcl2ZTCpioswkOCNqeIE8TNdGdSqAnXDDETMU9lzAwIyM5wZFAPFhLgDlQSCWIHyGen2DNIgGzyFORSYswMC0tNsGCRh1jIB5dNSLBhEBfl5uNhYWRirMwICUpJNQU73AZsPkk9O0gcJeOXmBEBAUqIOSMADLp+YoA4ScHdxsbe1NDPS09ZQVQUAym9GeqIKMRMAAAAASUVORK5CYII=\",\n'ppt' => \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABhlBMVEUiCQJ2GhR8IBiAJByDKB6ILCGGKy2NMSWQNCeSNS2SNi6RNzCROjOROzSZPCywOS+iRDOkRzSvRzmqTDivUDu8Ty+yUz2dXUi3WEG4WkKwX0S9XkXZWSu/YUjAYUhVgMhZgcZYgsXDZUvDZktdhMRehMRhiMPHa09iicPIa09lisJni8FpjMHBdFvMcVPMcVRsjsBujr9ykL9ykb/Qd1jRd1h2k716lbt7lbzVfFx+l7rVfVyCmrzZgF/ZgWD1e0KFnb7bg2KIoMDuglSLosKMosKRp8boj2rwkVzwklvwkWeXrMmQrtbwlmjwlmvwl2qdsc3wnF7wmXHwm2fwnV3woG+jttHwpWrwpnSpu9SvwNizw9rwtoHwvYvwxZLwyZfwzaH21sbS4vrU4/rW5PrX5fvZ5vvb5/vc6Pve6fvg6vzh7Pzj7fz+59vl7vzm7/zo8P3q8f3r8v3t8/3v9P388+3w9v789O/y9/70+P71+f73+v75+///+/f//Pr//fv///9WDA/EYw43AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfWBhAMAwTysJkTAAAA7UlEQVQY02NgYGCIjgwL8HZzcbCyYoCAqJrqqsqKshKrBpCIo6OdpYm+upKsdLFVA0jEsSFXiodHPLFBuggoABSxzRUqr23kYUuUKLQCAQZrqdK6+kaZYCmRgvy8nGwrBlNOe2d3Uf8ITkEQP8uKQY83PiHWyyuUky/Pxycr05xBUyowLibIz0OKHSifmWHGoJwrFBLu68mfy5Lt45ORbsQg15Cry82lm9vABJRPTzNgkJYUExbg42BlZsz08UlL1QY53RVsPkg+NUUDJOCUl+MDASnJqiABB7h8cpICSMDGwsLM2FBHS01FUV4eAMTGQpNOj1PnAAAAAElFTkSuQmCC\",\n'dot' => \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAFfKj/FAAAAA3NCSVQICAjb4U/gAAAA0lBMVEX//////////7X//5n//3j//1r//zzm7/z//x7//wDh7Pzc6PvX5fvW5Prc4vTS4vrJ0uK3yPSzw9qvwNiqvvGvvN+tutCjttGdsc2QrtaTq+aXrMmRp8aJpemLpN2MosKAnuaDnNqFnb58l9h7lbxzlNZ2k71sjsBnitV3ipxiicNggc1YgsVVgMhnfrNffcNYftFVe85ddatSc85JdMxVbaRCbsRNaqdEark6abhAZrQ4Ya4qYrcyW7Y6WpghTJoJS7IoPm0GQpsIPIgIL4sBMngq18WvAAAARnRSTlMA////////////////////////////////////////////////////////////////////////////////////////////iZqVbwAAAAlwSFlzAAAK8AAACvABQqw0mAAAACB0RVh0U29mdHdhcmUATWFjcm9tZWRpYSBGaXJld29ya3MgTVi7kSokAAAA2UlEQVR4nC2OaVvCQAyEJ151N63ihS7KVUKLpXijVRHWrvz/v2RanS/JM0nmDXCDR0JXcGLRp4EAkY2BqxQYkxEsg2XAcoJef/LwatSaTi8GHWbGO6ks6zqsluQYOL28HmoGeqPZ80oMcD6fL72IgKrNumbWZh26Gpqhud4y58AwssxxAaRNTUoNwNnO7t7+waER0+aZf3k1midGR+N7qujt1re2YEZ31VP4+qY6cs4q54V+Pil8EAXrHCtv5b2v6zqELTsXNzgFRjpslfxhU5Esy/OiKMvF4hcq4xjn7deUZgAAAABJRU5ErkJggg==\",\n'mp3' => \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAB+1BMVEUgYmc7PkM6Q09CRk1ER01DSE5FSE1GSU5GSk9GSlBHSlBIS09IS1BQVFtQVVtTVltYXWVYXmVYXmZdXl9gYGBeYWZpaWlmbXhsbnFubm5xcXF3d3d5eXlVgMhZgcZYgsV+f4BdhMRehMSBgoNhiMOCg4ViicNlisJni8FpjMGIiIiJiYlsjsBujr+KjI+JjJN8j6lykL9ykb+MjpB2k72OkZd6lbt7lbyQkpWSkpJ+l7qVlZWWlpaCmryFmriFnb6ampqWm6OZm52IoMCLosKfn5+doKWgoKCeoaefoqajo6ORp8ORp8akp6uoqKiXrMmsrKylr7ydsc2zs7OjttGpu9S2ub2yuse9wMOzw9q4w9W4xNa7xdXCxMjFyMvFytHCy9fHy9DAzODJy8/IzNLEzt7F0N/F0OHI0d7H0uPJ0+HK0+HP2OTL2u7N2u7O2uzP2+3O3O/P3O3Q3O3Q3O7Q3O/R3e/S3u7T3u7Y3ejU3+/V3+7W3+3X3+7W4O/Y4O/Z4e7Z4e/T4/nV4/nd5PHZ5fnZ5vra5/vd6Prc6fze6vvf6vrf6/zg6/zg7Pzh7Pvh7Pzi7fzj7fzj7vzj7v3k7vzl7vvl7vzl7v3m7/zm7/3n8P3o8P3p8f3q8vzr8v3s8/3t8/3t9P7u9P3u9f7v9f7w9f7///8AAABpfOEAAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfWCxgAGAUYv3clAAAA80lEQVQY02NgYGCIDA0J8vdxsbeyYoCAwOS42IiwpYutlkNFgv0cbFylFy20Wg4VCXBKSTSWWjAfKAAR8fJdtsRCbN5cKxAACTh4Ll6gJzJ3zswZkyaCBSzd4lVlhGfPmj5lYj9QwNpd2UNBS1J/5tTJEyb0mjFIa0uLV5pKODZMnTShr6fLBKTFu2XmtMbauu6q8o5OQyB/hYFoTj0PO1cWH29mmw6Qz8CUwJ/NFs5SXBQjVKgBErCr4c5gZOEsLROMblYDCThXc6WxpZe05kcJ5CqBBOwrOFM5CtrzWJmTmuRAttiam5sY6WqqqyjKy8oCAAsLR8hfZq/DAAAAAElFTkSuQmCC\",\n'folder' => \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABAklEQVR42mNkoBAwAjEXEAcCMTsW+U9AvB6I/+I0gJ2Noe3QJoZKASEgjwkq+h+C795lYPCKZMgC8mZg0fsfbICIIMOcF6cZkrGZ/v8fA0PndIa/7z8BXfAPqgVKv//A8GPeZoYERmE+hjmP1+AwAOgiTjOIP7HZLyjLMJNRmB/ogjMMyYzsUC8wIhQwsgCFWHAHoKAy0AARIYY5r69idwEhIKgBMgAYBq8vkGmALsyAU2QaYAwz4CiZBliADBAAGnCATANsYQbsJtMAJ5ABwGh8uZE8A4R9gAYwMzHkT8hl6Bfgxp5ecIH3Xxj+F05hyIdpUmXAnpnwge9AfJckW7EBAC/gSzisxsnmAAAAAElFTkSuQmCC\"\n);\n\nreturn (array_key_exists($ext,$icons)?$icons[$ext]:$icons['file']);\n}", "protected function get__icon()\n\t{\n\t\treturn 'files-o';\n\t}", "function GetFileIcon($file_name){\n $ext = substr(strrchr($file_name, \".\"), 1);\n switch($ext){\n case \"asp\" : $icon=\"ico_asp.gif\"; break;\n case \"bmp\" : $icon=\"ico_bmp.gif\"; break;\n case \"css\" : $icon=\"ico_css.gif\"; break;\n case \"doc\" : $icon=\"ico_doc.gif\"; break;\n case \"exe\" : $icon=\"ico_exe.gif\"; break;\n case \"gif\" : $icon=\"ico_gif.gif\"; break;\n case \"htm\" : $icon=\"ico_htm.gif\"; break;\n case \"html\": $icon=\"ico_htm.gif\"; break;\n case \"jpg\" : $icon=\"ico_jpg.gif\"; break;\n case \"js\" : $icon=\"ico_js.gif\"; break;\n case \"mdb\" : $icon=\"ico_mdb.gif\"; break;\n case \"mov\" : $icon=\"ico_mov.gif\"; break;\n case \"mp3\" : $icon=\"ico_mp3.gif\"; break;\n case \"pdf\" : $icon=\"ico_pdf.gif\"; break;\n case \"png\" : $icon=\"ico_png.gif\"; break;\n case \"ppt\" : $icon=\"ico_ppt.gif\"; break;\n case \"mid\" : $icon=\"ico_sound.gif\"; break;\n case \"wav\" : $icon=\"ico_sound.gif\"; break;\n case \"wma\" : $icon=\"ico_sound.gif\"; break;\n case \"swf\" : $icon=\"ico_swf.gif\"; break;\n case \"txt\" : $icon=\"ico_txt.gif\"; break;\n case \"vbs\" : $icon=\"ico_vbs.gif\"; break;\n case \"avi\" : $icon=\"ico_video.gif\"; break;\n case \"wmv\" : $icon=\"ico_video.gif\"; break;\n case \"mpeg\": $icon=\"ico_video.gif\"; break;\n case \"mpg\" : $icon=\"ico_video.gif\"; break;\n case \"xls\" : $icon=\"ico_xls.gif\"; break;\n case \"zip\" : $icon=\"ico_zip.gif\"; break;\n default : $icon=\"ico_unknown.gif\"; break;\n }\n return \"<img src=\\\"\".APP_IMAGES_DIR.\"icons/{$icon}\\\" />\";\n }", "function file_type_icon($filename){\n\n error_log('file_type_icon() is deprecated, please gradually stop using it');\n\n $ext = extension($filename);\n return strtoupper($ext);\n\n // return (preg_match('/jpg|gif|png|ai|doc|docx|xls|xlsx|ppt|pptx|pdf|bmp|psd|zip|rar|txt/', $ext)) ? '<span class=\"ico_file_'.$ext.'\">&nbsp;</span>' : '<span class=\"ico_file_magnifier\">&nbsp;</span>';\n}", "function getIcon($ftype, $width, $height)\n{\n if (strtolower($ftype[1]) == \"png\" || strtolower($ftype[1]) == \"jpeg\" || strtolower($ftype[1]) == \"gif\" || strtolower($ftype[1]) == \"jpg\" || strtolower($ftype[1]) == \"bmp\") {\n $icono = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"' . $width . '\" height=\"' . $height . '\" fill=\"currentColor\" class=\"bi bi-file-image\" viewBox=\"0 0 16 16\">\n <path d=\"M8.002 5.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0z\"/>\n <path d=\"M12 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zM3 2a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v8l-2.083-2.083a.5.5 0 0 0-.76.063L8 11 5.835 9.7a.5.5 0 0 0-.611.076L3 12V2z\"/>\n</svg>';\n } //compruebo si es audio\n elseif (strtolower($ftype[1]) == \"mp3\" || strtolower($ftype[1]) == \"wav\" || strtolower($ftype[1]) == \"wma\" || strtolower($ftype[1]) == \"ogg\" || strtolower($ftype[1]) == \"mp4\") {\n $icono = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"' . $width . '\" height=\"' . $height . '\" fill=\"currentColor\" class=\"bi bi-file-music\" viewBox=\"0 0 16 16\">\n <path d=\"M10.304 3.13a1 1 0 0 1 1.196.98v1.8l-2.5.5v5.09c0 .495-.301.883-.662 1.123C7.974 12.866 7.499 13 7 13c-.5 0-.974-.134-1.338-.377-.36-.24-.662-.628-.662-1.123s.301-.883.662-1.123C6.026 10.134 6.501 10 7 10c.356 0 .7.068 1 .196V4.41a1 1 0 0 1 .804-.98l1.5-.3z\"/>\n <path d=\"M4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H4zm0 1h8a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1z\"/>\n</svg>';\n } //comrpuebo si son zip, rar u otros\n elseif (strtolower($ftype[1]) == \"zip\" || strtolower($ftype[1]) == \"rar\" || strtolower($ftype[1]) == \"tgz\" || strtolower($ftype[1]) == \"tar\") {\n $icono = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"' . $width . '\" height=\"' . $height . '\" fill=\"currentColor\" class=\"bi bi-file-zip\" viewBox=\"0 0 16 16\">\n <path d=\"M6.5 7.5a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v.938l.4 1.599a1 1 0 0 1-.416 1.074l-.93.62a1 1 0 0 1-1.109 0l-.93-.62a1 1 0 0 1-.415-1.074l.4-1.599V7.5zm2 0h-1v.938a1 1 0 0 1-.03.243l-.4 1.598.93.62.93-.62-.4-1.598a1 1 0 0 1-.03-.243V7.5z\"/>\n <path d=\"M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2zm5.5-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H9v1H8v1h1v1H8v1h1v1H7.5V5h-1V4h1V3h-1V2h1V1z\"/>\n</svg>';\n } //compruebo si es un archivo de codigo\n elseif (strtolower($ftype[1]) == \"php\" || strtolower($ftype[1]) == \"php3\" || strtolower($ftype[1]) == \"html\" || strtolower($ftype[1]) == \"css\" || strtolower($ftype[1]) == \"py\" || strtolower($ftype[1]) == \"java\" || strtolower($ftype[1]) == \"js\" || strtolower($ftype[1]) == \"sql\") {\n $icono = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"' . $width . '\" height=\"' . $height . '\" fill=\"currentColor\" class=\"bi bi-file-code\" viewBox=\"0 0 16 16\">\n <path d=\"M6.646 5.646a.5.5 0 1 1 .708.708L5.707 8l1.647 1.646a.5.5 0 0 1-.708.708l-2-2a.5.5 0 0 1 0-.708l2-2zm2.708 0a.5.5 0 1 0-.708.708L10.293 8 8.646 9.646a.5.5 0 0 0 .708.708l2-2a.5.5 0 0 0 0-.708l-2-2z\"/>\n <path d=\"M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2zm10-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z\"/>\n</svg>';\n } //compruebo si es el archivo es de tipo pdf\n elseif (strtolower($ftype[1]) == \"pdf\") {\n $icono = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"' . $width . '\" height=\"' . $height . '\" fill=\"currentColor\" class=\"bi bi-file-pdf\" viewBox=\"0 0 16 16\">\n <path d=\"M4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H4zm0 1h8a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1z\"/>\n <path d=\"M4.603 12.087a.81.81 0 0 1-.438-.42c-.195-.388-.13-.776.08-1.102.198-.307.526-.568.897-.787a7.68 7.68 0 0 1 1.482-.645 19.701 19.701 0 0 0 1.062-2.227 7.269 7.269 0 0 1-.43-1.295c-.086-.4-.119-.796-.046-1.136.075-.354.274-.672.65-.823.192-.077.4-.12.602-.077a.7.7 0 0 1 .477.365c.088.164.12.356.127.538.007.187-.012.395-.047.614-.084.51-.27 1.134-.52 1.794a10.954 10.954 0 0 0 .98 1.686 5.753 5.753 0 0 1 1.334.05c.364.065.734.195.96.465.12.144.193.32.2.518.007.192-.047.382-.138.563a1.04 1.04 0 0 1-.354.416.856.856 0 0 1-.51.138c-.331-.014-.654-.196-.933-.417a5.716 5.716 0 0 1-.911-.95 11.642 11.642 0 0 0-1.997.406 11.311 11.311 0 0 1-1.021 1.51c-.29.35-.608.655-.926.787a.793.793 0 0 1-.58.029zm1.379-1.901c-.166.076-.32.156-.459.238-.328.194-.541.383-.647.547-.094.145-.096.25-.04.361.01.022.02.036.026.044a.27.27 0 0 0 .035-.012c.137-.056.355-.235.635-.572a8.18 8.18 0 0 0 .45-.606zm1.64-1.33a12.647 12.647 0 0 1 1.01-.193 11.666 11.666 0 0 1-.51-.858 20.741 20.741 0 0 1-.5 1.05zm2.446.45c.15.162.296.3.435.41.24.19.407.253.498.256a.107.107 0 0 0 .07-.015.307.307 0 0 0 .094-.125.436.436 0 0 0 .059-.2.095.095 0 0 0-.026-.063c-.052-.062-.2-.152-.518-.209a3.881 3.881 0 0 0-.612-.053zM8.078 5.8a6.7 6.7 0 0 0 .2-.828c.031-.188.043-.343.038-.465a.613.613 0 0 0-.032-.198.517.517 0 0 0-.145.04c-.087.035-.158.106-.196.283-.04.192-.03.469.046.822.024.111.054.227.09.346z\"/>\n</svg>';\n } //compruebo si es el archivo es excel\n elseif (strtolower($ftype[1]) == \"xlsx\") {\n $icono = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"' . $width . '\" height=\"' . $height . '\" fill=\"currentColor\" class=\"bi bi-file-excel\" viewBox=\"0 0 16 16\">\n <path d=\"M5.18 4.616a.5.5 0 0 1 .704.064L8 7.219l2.116-2.54a.5.5 0 1 1 .768.641L8.651 8l2.233 2.68a.5.5 0 0 1-.768.64L8 8.781l-2.116 2.54a.5.5 0 0 1-.768-.641L7.349 8 5.116 5.32a.5.5 0 0 1 .064-.704z\"/>\n <path d=\"M4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H4zm0 1h8a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1z\"/>\n</svg>';\n } //compruebo si es el archivo es de powerpoint\n elseif (strtolower($ftype[1]) == \"pptx\") {\n $icono = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"' . $width . '\" height=\"' . $height . '\" fill=\"currentColor\" class=\"bi bi-file-ppt\" viewBox=\"0 0 16 16\">\n <path d=\"M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2zm10-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z\"/>\n <path d=\"M6 5a1 1 0 0 1 1-1h1.188a2.75 2.75 0 0 1 0 5.5H7v2a.5.5 0 0 1-1 0V5zm1 3.5h1.188a1.75 1.75 0 1 0 0-3.5H7v3.5z\"/>\n</svg>';\n } //compruebo si es el archivo es de word\n elseif (strtolower($ftype[1]) == \"docx\") {\n $icono = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"' . $width . '\" height=\"' . $height . '\" fill=\"currentColor\" class=\"bi bi-file-word\" viewBox=\"0 0 16 16\">\n <path d=\"M4.879 4.515a.5.5 0 0 1 .606.364l1.036 4.144.997-3.655a.5.5 0 0 1 .964 0l.997 3.655 1.036-4.144a.5.5 0 0 1 .97.242l-1.5 6a.5.5 0 0 1-.967.01L8 7.402l-1.018 3.73a.5.5 0 0 1-.967-.01l-1.5-6a.5.5 0 0 1 .364-.606z\"/>\n <path d=\"M4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H4zm0 1h8a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1z\"/>\n</svg>';\n } //compruebo si es el archivo es de texto\n elseif (strtolower($ftype[1]) == \"txt\") {\n $icono = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"' . $width . '\" height=\"' . $height . '\" fill=\"currentColor\" class=\"bi bi-file-text\" viewBox=\"0 0 16 16\">\n <path d=\"M5 4a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1H5zm-.5 2.5A.5.5 0 0 1 5 6h6a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zM5 8a.5.5 0 0 0 0 1h6a.5.5 0 0 0 0-1H5zm0 2a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1H5z\"/>\n <path d=\"M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2zm10-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z\"/>\n</svg>';\n } //compruebo si es el archivo es de video\n elseif (strtolower($ftype[1]) == \"avi\" || strtolower($ftype[1]) == \"asf\" || strtolower($ftype[1]) == \"dvd\"\n || strtolower($ftype[1]) == \"m1v\" || strtolower($ftype[1]) == \"movie\" || strtolower($ftype[1]) == \"mpeg\"\n || strtolower($ftype[1]) == \"wn\" || strtolower($ftype[1]) == \"wmv\") {\n $icono = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"' . $width . '\" height=\"' . $height . '\" fill=\"currentColor\" class=\"bi bi-file-play\" viewBox=\"0 0 16 16\">\n <path d=\"M6 10.117V5.883a.5.5 0 0 1 .757-.429l3.528 2.117a.5.5 0 0 1 0 .858l-3.528 2.117a.5.5 0 0 1-.757-.43z\"/>\n <path d=\"M4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H4zm0 1h8a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1z\"/>\n</svg>';\n } else {\n $icono = '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"' . $width . '\" height=\"' . $height . '\" fill=\"currentColor\" class=\"bi bi-file\" viewBox=\"0 0 16 16\">\n <path d=\"M4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H4zm0 1h8a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1z\"/>\n </svg>';\n }\n\n return $icono;\n}", "function icon($extension, $fallback = 'file')\n{\n\tglobal $txt, $settings;\n\n\t$fallback_image = $settings['default_images_url'] . '/filemanager/filetypes/' .$fallback . '.png';\n\n\tif(empty($extension))\n\treturn $fallback_image;\n\telse\n\t{\n\t\t$filetypes = array(\n\t\t\t'ttf' => 'font', 'gdf' => 'font', 'htaccess' => 'code', 'htpasswd' => 'code',\n\t\t\t'php' => 'php', 'php~' => 'php', 'asp' => 'text', 'shtml' => 'text',\n\t\t\t'rb' => 'ruby', 'pl' => 'text', 'pdf' => 'pdf', 'txt' => 'text',\n\t\t\t'bas' => 'text', 'c' => 'c', 'h' => 'text', 'htm' => 'html',\n\t\t\t'html' => 'html', 'css' => 'css', 'pas' => 'text', 'js' => 'script',\n\t\t\t'xml' => 'xml', 'sql' => 'sql', 'mp3' => 'audio', 'ram' => 'audio',\n\t\t\t'ra' => 'audio', 'au' => 'audio', 'wav' => 'audio', 'm3u' => 'audio',\n\t\t\t'aiff' => 'audio', 'aifc' => 'audio', 'mid' => 'audio', 'rmi' => 'audio',\n\t\t\t'aif' => 'audio', 'snd' => 'audio', 'avi' => 'video', 'movie' => 'video',\n\t\t\t'mpeg' => 'video', 'mp2' => 'video', 'mpg' => 'video', 'mov' => 'video',\n\t\t\t'mpe' => 'video', 'mpv2' => 'video', 'mpa' => 'video', 'lsf' => 'video',\n\t\t\t'lsx' => 'video', 'asf' => 'video', 'asr' => 'video', 'asx' => 'video',\n\t\t\t'qt' => 'video', 'm2v' => 'video', 'rar' => 'package', 'gz' => 'package',\n\t\t\t'tar' => 'package', 'zip' => 'package', 'bz2' => 'package', 'bin' => 'package',\n\t\t\t'lzh' => 'package', 'cab' => 'package', 'lha' => 'package', '7z' => 'package',\n\t\t\t'tgz' => 'package', 'z' => 'package', 'exe' => 'application', 'doc' => 'text', \n\t\t\t'dot' => 'text', 'odt' => 'text', 'xlm' => 'text', 'xls' => 'excel',\n\t\t\t'ods' => 'text', 'ppt' => 'text', 'pps' => 'text', 'cab' => 'text',\n\t\t\t'odp' => 'text', 'pub' => 'text', 'wri' => 'text', 'odc' => 'text',\n\t\t\t'odb' => 'text', 'jpg' => 'image', 'gif' => 'image', 'png' => 'image',\n\t\t\t'bmp' => 'image', 'jpeg' => 'image', 'jpe' => 'image', 'jfif' => 'image',\n\t\t\t'svg' => 'image', 'tif' => 'image', 'tiff' => 'image', 'ico' => 'image',\n\t\t\t'cod' => 'image', 'ief' => 'image', 'ras' => 'image', 'cmx' => 'image',\n\t\t\t'pnm' => 'image', 'pbm' => 'image', 'pgm' => 'image', 'ppm' => 'image',\n\t\t\t'rgb' => 'image', 'xbm' => 'image', 'xpm' => 'image', 'xwd' => 'image',\n\t\t\t'flv' => 'flash', 'swf' => 'flash', 'psd' => 'photoshop', 'ai' => 'illustrator',\n\t\t\t'list' => 'list','log' => 'list', 'tif' => 'image'\n\t\t);\n\n\t\tif(isset($filetypes[strtolower($extension)]))\n\t\t{\n\t\t\tif(file_exists($settings['default_theme_dir'] . '/images/filemanager/filetypes/' . $filetypes[strtolower($extension)] . '.png'))\n\t\t\t\treturn $settings['default_images_url'] . '/filemanager/filetypes/' . $filetypes[strtolower($extension)] . '.png';\n\t\t\telse\n\t\t\t\treturn $fallback_image;\n\t\t}\n\t\telse\n\t\t\treturn $fallback_image;\n\t}\n}", "function _shiny_upload_generic_icon_map($file) {\n switch ($file['filemime']) {\n // Word document types.\n case 'application/msword':\n case 'application/vnd.ms-word.document.macroEnabled.12':\n case 'application/vnd.oasis.opendocument.text':\n case 'application/vnd.oasis.opendocument.text-template':\n case 'application/vnd.oasis.opendocument.text-master':\n case 'application/vnd.oasis.opendocument.text-web':\n case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':\n case 'application/vnd.stardivision.writer':\n case 'application/vnd.sun.xml.writer':\n case 'application/vnd.sun.xml.writer.template':\n case 'application/vnd.sun.xml.writer.global':\n case 'application/vnd.wordperfect':\n case 'application/x-abiword':\n case 'application/x-applix-word':\n case 'application/x-kword':\n case 'application/x-kword-crypt':\n return 'x-office-document';\n\n // Spreadsheet document types.\n case 'application/vnd.ms-excel':\n case 'application/vnd.ms-excel.sheet.macroEnabled.12':\n case 'application/vnd.oasis.opendocument.spreadsheet':\n case 'application/vnd.oasis.opendocument.spreadsheet-template':\n case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':\n case 'application/vnd.stardivision.calc':\n case 'application/vnd.sun.xml.calc':\n case 'application/vnd.sun.xml.calc.template':\n case 'application/vnd.lotus-1-2-3':\n case 'application/x-applix-spreadsheet':\n case 'application/x-gnumeric':\n case 'application/x-kspread':\n case 'application/x-kspread-crypt':\n return 'x-office-spreadsheet';\n\n // Presentation document types.\n case 'application/vnd.ms-powerpoint':\n case 'application/vnd.ms-powerpoint.presentation.macroEnabled.12':\n case 'application/vnd.oasis.opendocument.presentation':\n case 'application/vnd.oasis.opendocument.presentation-template':\n case 'application/vnd.openxmlformats-officedocument.presentationml.presentation':\n case 'application/vnd.stardivision.impress':\n case 'application/vnd.sun.xml.impress':\n case 'application/vnd.sun.xml.impress.template':\n case 'application/x-kpresenter':\n return 'x-office-presentation';\n\n // Compressed archive types.\n case 'application/zip':\n case 'application/x-zip':\n case 'application/stuffit':\n case 'application/x-stuffit':\n case 'application/x-7z-compressed':\n case 'application/x-ace':\n case 'application/x-arj':\n case 'application/x-bzip':\n case 'application/x-bzip-compressed-tar':\n case 'application/x-compress':\n case 'application/x-compressed-tar':\n case 'application/x-cpio-compressed':\n case 'application/x-deb':\n case 'application/x-gzip':\n case 'application/x-java-archive':\n case 'application/x-lha':\n case 'application/x-lhz':\n case 'application/x-lzop':\n case 'application/x-rar':\n case 'application/x-rpm':\n case 'application/x-tzo':\n case 'application/x-tar':\n case 'application/x-tarz':\n case 'application/x-tgz':\n return 'package-x-generic';\n\n // Script file types.\n case 'application/ecmascript':\n case 'application/javascript':\n case 'application/mathematica':\n case 'application/vnd.mozilla.xul+xml':\n case 'application/x-asp':\n case 'application/x-awk':\n case 'application/x-cgi':\n case 'application/x-csh':\n case 'application/x-m4':\n case 'application/x-perl':\n case 'application/x-php':\n case 'application/x-ruby':\n case 'application/x-shellscript':\n case 'text/vnd.wap.wmlscript':\n case 'text/x-emacs-lisp':\n case 'text/x-haskell':\n case 'text/x-literate-haskell':\n case 'text/x-lua':\n case 'text/x-makefile':\n case 'text/x-matlab':\n case 'text/x-python':\n case 'text/x-sql':\n case 'text/x-tcl':\n return 'text-x-script';\n\n // HTML aliases.\n case 'application/xhtml+xml':\n return 'text-html';\n\n // Executable types.\n case 'application/x-macbinary':\n case 'application/x-ms-dos-executable':\n case 'application/x-pef-executable':\n return 'application-x-executable';\n\n default:\n return FALSE;\n }\n}", "protected function extendFileTypes(array $fileTypes): array\n {\n // normalize array\n foreach ($fileTypes as $ext => $file) {\n $extension = $file['extension'] ?? $ext;\n $type = $file['type'] ?? null;\n $mime = $file['mime'] ?? null;\n $resizable = $file['resizable'] ?? false;\n $viewable = $file['viewable'] ?? false;\n\n if (is_string($type) === true) {\n if (isset(F::$types[$type]) === false) {\n F::$types[$type] = [];\n }\n\n if (in_array($extension, F::$types[$type]) === false) {\n F::$types[$type][] = $extension;\n }\n }\n\n if ($mime !== null) {\n if (array_key_exists($extension, Mime::$types) === true) {\n // if `Mime::$types[$extension]` is not already an array, make it one\n // and append the new MIME type unless it's already in the list\n Mime::$types[$extension] = array_unique(array_merge((array)Mime::$types[$extension], (array)$mime));\n } else {\n Mime::$types[$extension] = $mime;\n }\n }\n\n if ($resizable === true && in_array($extension, Image::$resizableTypes) === false) {\n Image::$resizableTypes[] = $extension;\n }\n\n if ($viewable === true && in_array($extension, Image::$viewableTypes) === false) {\n Image::$viewableTypes[] = $extension;\n }\n }\n\n return $this->extensions['fileTypes'] = [\n 'type' => F::$types,\n 'mime' => Mime::$types,\n 'resizable' => Image::$resizableTypes,\n 'viewable' => Image::$viewableTypes\n ];\n }", "private static function initialize()\n {\n $fileName = ExtensionManagementUtility::extPath('extractor') . 'Resources/Private/mime.types';\n $fh = fopen($fileName, 'r');\n if (is_resource($fh)) {\n while (($buffer = fgets($fh, 1024)) !== false) {\n if ($buffer{0} === '#') {\n continue;\n }\n list($mimeType, $extensions) = GeneralUtility::trimExplode(TAB, $buffer, true);\n $extensions = GeneralUtility::trimExplode(' ', $extensions, true);\n static::$mimeTypesMapping[$mimeType] = $extensions;\n foreach ($extensions as $extension) {\n static::$extensionsMapping[$extension] = $mimeType;\n }\n }\n fclose($fh);\n }\n }", "public static function appIcons() {\n $config = Config::instance();\n $icons_directory = THEME_DIRECTORY.'/'.$config->app_icons_directory;\n $icons_url = THEME_URL.'/'.$config->app_icons_directory;\n if(!file_exists($icons_directory)) return null;\n \n $files = scandir($icons_directory);\n if(!Arr::iterable($files)) return null;\n \n // Icon files should start with one of these, and be delimited by hyphens\n $icon_types = ['apple', 'android', 'favicon'];\n $paths = [];\n \n foreach($files as $file) {\n if(!preg_match('/\\.png$/', $file)) continue;\n \n // Get size from image name\n preg_match('/(\\d+x\\d+)/', $file, $sizes);\n if(!Arr::iterable($sizes)) continue;\n \n $size = reset($sizes);\n $icon_type = reset(explode('-', $file));\n if(!in_array($icon_type, $icon_types)) continue;\n \n $file_path = $icons_url.'/'.$file;\n $paths[] = View::make('meta/icon-'.$icon_type, [\n 'file' => $file_path,\n 'size' => $size,\n ]);\n }\n \n $paths[] = View::make('meta/icon-favicon-ico', [\n 'file' => $icons_url.'/favicon.ico',\n ]);\n return join('', $paths);\n }", "public function run()\n {\n $types = [\n [\n 'name' => 'folder',\n 'extension' => '.',\n 'icon' => 'folder',\n 'mime' => null,\n ],\n [\n 'name' => 'Word',\n 'extension' => 'doc',\n 'icon' => 'doc',\n 'mime' => 'application/msword',\n ],\n [\n 'name' => 'Word',\n 'extension' => 'docx',\n 'icon' => 'docx',\n 'mime' => 'application/msword',\n ],\n [\n 'name' => 'Excel',\n 'extension' => 'xls',\n 'icon' => 'xls',\n 'mime' => 'application/vnd.ms-excel',\n ],\n [\n 'name' => 'Excel',\n 'extension' => 'xlsx',\n 'icon' => 'xlsx',\n 'mime' => 'application/vnd.ms-excel',\n ],\n [\n 'name' => 'Powerpoint',\n 'extension' => 'ppt',\n 'icon' => 'ppt',\n 'mime' => 'application/vnd.ms-powerpoint',\n ],\n [\n 'name' => 'Powerpoint',\n 'extension' => 'pptx',\n 'icon' => 'pptx',\n 'mime' => 'application/vnd.ms-powerpoint',\n ],\n [\n 'name' => 'Text',\n 'extension' => 'txt',\n 'icon' => 'txt',\n 'mime' => 'text/plain',\n ],\n [\n 'name' => 'Icon',\n 'extension' => 'ico',\n 'icon' => 'ico',\n 'mime' => 'image/x-icon',\n ],\n [\n 'name' => 'CSV',\n 'extension' => 'csv',\n 'icon' => 'csv',\n 'mime' => 'text/csv',\n ],\n [\n 'name' => 'PDF',\n 'extension' => 'pdf',\n 'icon' => 'pdf',\n 'mime' => 'application/pdf',\n ],\n [\n 'name' => 'JPG',\n 'extension' => 'jpg',\n 'icon' => 'image',\n 'mime' => 'image/jpeg',\n ],\n [\n 'name' => 'JPEG',\n 'extension' => 'jpeg',\n 'icon' => 'image',\n 'mime' => 'image/jpeg',\n ],\n [\n 'name' => 'PNG',\n 'extension' => 'png',\n 'icon' => 'image',\n 'mime' => 'image/png',\n ],\n [\n 'name' => 'WEBP',\n 'extension' => 'webp',\n 'icon' => 'image',\n 'mime' => 'image/webp',\n ],\n [\n 'name' => 'SVG',\n 'extension' => 'svg',\n 'icon' => 'svg',\n 'mime' => 'image/svg+xml',\n ],\n [\n 'name' => 'ZIP',\n 'extension' => 'zip',\n 'icon' => 'zip',\n 'mime' => 'application/zip',\n ],\n [\n 'name' => 'RAR',\n 'extension' => 'rar',\n 'icon' => 'rar',\n 'mime' => 'application/x-rar-compressed',\n ],\n [\n 'name' => 'Video MP4',\n 'extension' => 'mp4',\n 'icon' => 'mp4',\n 'mime' => 'video/mp4',\n ],\n [\n 'name' => 'Video WEBM',\n 'extension' => 'webm',\n 'icon' => 'webm',\n 'mime' => 'video/webm',\n ],\n [\n 'name' => 'Video WEBM',\n 'extension' => 'weba',\n 'icon' => 'webm',\n 'mime' => 'video/webm',\n ],\n [\n 'name' => 'Audio MP3',\n 'extension' => 'mp3',\n 'icon' => 'mp3',\n 'mime' => 'audio/mpeg',\n ],\n [\n 'name' => 'True Type Font',\n 'extension' => 'ttf',\n 'icon' => 'ttf',\n 'mime' => 'font/ttf',\n ],\n [\n 'name' => 'Adobe Ilustrator',\n 'extension' => 'ai',\n 'icon' => 'ai',\n 'mime' => null,\n ],\n ];\n\n foreach ($types as $type) {\n FileType::create($type);\n }\n }", "function shiny_upload_file_icon($file) {\n if (is_object($file)) {\n $file = (array) $file;\n }\n $mime = check_plain($file['filemime']);\n\n $dashed_mime = strtr($mime, array('/' => '-'));\n\n if ($icon_url = _shiny_upload_icon_url($file)) {\n $icon = '<img class=\"field-icon-'. $dashed_mime .'\" alt=\"'. $mime .' icon\" src=\"'. $icon_url .'\" />';\n }\n return '<span class=\"filefield-icon field-icon-'. $dashed_mime .'\">'. $icon .'</span>';\n}", "public function getIcons()\n {\n return array(\n 'icon-active',\n 'icon-add',\n 'icon-assessments',\n 'icon-browse',\n 'icon-conditions',\n 'icon-copy',\n 'icon-cpdb',\n 'icon-databack',\n 'icon-databegin',\n 'icon-dataend',\n 'icon-dataforward',\n 'icon-defaultanswers',\n 'icon-do',\n 'icon-edit',\n 'icon-emailtemplates',\n 'icon-expired',\n 'icon-export',\n 'icon-exportcsv',\n 'icon-exportr',\n 'icon-exportspss',\n 'icon-exportvv',\n 'icon-expression',\n 'icon-expressionmanagercheck',\n 'icon-global',\n 'icon-import',\n 'icon-importcsv',\n 'icon-importldap',\n 'icon-importvv',\n 'icon-inactive',\n 'icon-invite',\n 'icon-label',\n 'icon-labels',\n 'icon-list',\n 'icon-logout',\n 'icon-maximize',\n 'icon-minimize',\n 'icon-organize',\n 'icon-quota',\n 'icon-remind',\n 'icon-renumber',\n 'icon-resetsurveylogic',\n 'icon-responses',\n 'icon-saved',\n 'icon-security',\n 'icon-settings',\n 'icon-shield',\n 'icon-superadmin',\n 'icon-survey',\n 'icon-takeownership',\n 'icon-template',\n 'icon-templatepermissions',\n 'icon-templates',\n 'icon-tools',\n 'icon-user',\n 'icon-usergroup',\n 'icon-viewlast'\n );\n }", "public function create()\n {\n $icones = [\n [\n 'class' => 'flaticon-050-satellite',\n 'code' => 'f131',\n ],\n [\n 'class' => 'flaticon-049-projector',\n 'code' => 'f130',\n ],\n [\n 'class' => 'flaticon-048-abstract',\n 'code' => 'f12f',\n ],\n [\n 'class' => 'flaticon-050-satellite',\n 'code' => 'f131',\n ],\n [\n 'class' => 'flaticon-035-smartphone',\n 'code' => \"f122\"\n ],\n [\n 'class' => 'flaticon-036-brainstorming',\n 'code' => \"f123\"\n ],\n [\n 'class' => 'flaticon-037-idea',\n 'code' => \"f124\"\n ],\n [\n 'class' => 'flaticon-038-graphic-tool-1',\n 'code' => \"f125\"\n ],\n [\n 'class' => 'flaticon-039-vector',\n 'code' => \"f126\"\n ],\n [\n 'class' => 'flaticon-040-rgb',\n 'code' => \"f127\"\n ],\n [\n 'class' => 'flaticon-041-graphic-tool',\n 'code' => \"f128\"\n ],\n [\n 'class' => 'flaticon-042-typography',\n 'code' => \"f129\"\n ],\n [\n 'class' => 'flaticon-043-sketch',\n 'code' => \"f12a\"\n ],\n [\n 'class' => 'flaticon-044-paint-bucket',\n 'code' => \"f12b\"\n ],\n [\n 'class' => 'flaticon-045-video-player',\n 'code' => \"f12c\"\n ],\n [\n 'class' => 'flaticon-046-laptop',\n 'code' => \"f12d\"\n ],\n [\n 'class' => 'flaticon-047-artificial-intelligence',\n 'code' => \"f12e\"\n ],\n ];\n return view('admin.service.add', compact('icones'));\n }", "private function addFavicon(): void\n {\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n if (is_file('favicon.png')) {\n $favicon = [\n 'mime' => finfo_file($finfo, 'favicon.png'),\n 'url' => 'favicon.png',\n ];\n } elseif (is_file('favicon.ico')) {\n $favicon = [\n 'mime' => finfo_file($finfo, 'favicon.ico'),\n 'url' => 'favicon.ico',\n ];\n }\n\n if (isset($favicon)) {\n $this->paramViews['favicon'] = $favicon;\n }\n }", "function generateicon($mime_type) {\n\t $icon_classes = array(\n\t\t// Media\n\t\t'image' => 'fa-file-image-o',\n\t\t'audio' => 'fa-file-audio-o',\n\t\t'video' => 'fa-file-video-o',\n\t\t// Documents\n\t\t'application/pdf' => 'fa-file-pdf-o',\n\t\t'application/msword' => 'fa-file-word-o',\n\t\t'application/vnd.ms-word' => 'fa-file-word-o',\n\t\t'application/vnd.oasis.opendocument.text' => 'fa-file-word-o',\n\t\t'application/vnd.openxmlformats-officedocument.wordprocessingml' => 'fa-file-word-o',\n\t\t'application/vnd.ms-excel' => 'fa-file-excel-o',\n\t\t'application/vnd.openxmlformats-officedocument.spreadsheetml' => 'fa-file-excel-o',\n\t\t'application/vnd.oasis.opendocument.spreadsheet' => 'fa-file-excel-o',\n\t\t'application/vnd.ms-powerpoint' => 'fa-file-powerpoint-o',\n\t\t'application/vnd.openxmlformats-officedocument.presentationml' => 'fa-file-powerpoint-o',\n\t\t'application/vnd.oasis.opendocument.presentation' => 'fa-file-powerpoint-o',\n\t\t'text/plain' => 'fa-file-text-o',\n\t\t'text/html' => 'fa-file-code-o',\n\t\t'application/json' => 'fa-file-code-o',\n\t\t// Archives\n\t\t'application/gzip' => 'fa-file-archive-o',\n\t\t'application/zip' => 'fa-file-archive-o',\n\t );\n\t foreach ($icon_classes as $text => $icon) {\n\t\tif (strpos($mime_type, $text) === 0) {\n\t\t return $icon;\n\t\t}\n\t }\n\t return 'fa-file-o';\n\t}", "public function getSupportedFileExtensions()\n {\n return Thumbnail::getFormatsSupported();\n }", "public static function mimetypes() {\n return mimeinfo_from_icon('type', 'image.gif', true);\n }", "public function setFileIconId($fileIconId);", "public function getSupportedExtensions();", "function addFileType($appLocation, $extention, $iconLocation){\n\n\t\t\t$fullAppLocation = '../'.$appLocation;\n\t\t\t$fullIconLocation = '../../images/'.$iconLocation;\n\n\t\t\t$types_file_handle = new MarkUpFile('../Lib/fileTypes.txt');\n\t\t\t$types_file_handle->Write(false, array(array($fullAppLocation, $extention, $fullIconLocation)));\n\t\t\t$types_file_handle->Close();\n\n\t\t}", "public function testFormatterFileMime() {\n $entity_display = EntityViewDisplay::create([\n 'targetEntityType' => 'file',\n 'bundle' => 'file',\n ]);\n $entity_display->setComponent('filemime', ['type' => 'file_filemime', 'settings' => ['filemime_image' => TRUE]]);\n\n foreach (array_values($this->files) as $i => $file) {\n $build = $entity_display->build($file);\n $this->assertEquals('image__file_icon', $build['filemime'][0]['#theme']);\n $this->assertEquals(spl_object_hash($file), spl_object_hash($build['filemime'][0]['#file']));\n }\n }", "public function get_icon() {\r\n return 'fas fa-file-code';\r\n }", "private function get_available_repo_icons() {\n // programming language repo icons...\n return array(\n 'c',\n 'c#',\n 'c++',\n 'delphi',\n 'java',\n 'javascript',\n 'perl',\n 'php',\n 'python',\n 'ruby',\n 'shell'\n );\n }" ]
[ "0.6430728", "0.58854115", "0.57934", "0.5761499", "0.5673859", "0.56693035", "0.55805236", "0.55379647", "0.54547256", "0.5359047", "0.5353483", "0.53283995", "0.5313", "0.5312884", "0.5264652", "0.526438", "0.52571714", "0.5198695", "0.51977533", "0.51644623", "0.5154159", "0.5153518", "0.51470757", "0.51413107", "0.51157886", "0.5105239", "0.50704104", "0.5069262", "0.5063334", "0.5062349" ]
0.6214835
1
Determine if there is an icon for provided file extension.
public function hasRelatedIcon(string $fileExtension): bool { return in_array($fileExtension,$this->supportedFileExtensions) ? true : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fileExtension($file)\n{\n\t$ext = str_replace(\".\", \"\", strrchr($file, '.'));\n\t$icon = \"../images/icons/\" . $ext . \".png\";\n\tif (file_exists($icon)) {\n\t\treturn \"<img src='\" . $icon . \"'>\";\n\t} else {\n\t\treturn \"<img src='../images/icons/noimage.gif'>\";\n\t}\n}", "public function hasIcon()\n {\n return !is_null($this->icon);\n }", "public function hasIcon()\n {\n return !is_null($this->icon);\n }", "function file_type_icon($filename){\n\n error_log('file_type_icon() is deprecated, please gradually stop using it');\n\n $ext = extension($filename);\n return strtoupper($ext);\n\n // return (preg_match('/jpg|gif|png|ai|doc|docx|xls|xlsx|ppt|pptx|pdf|bmp|psd|zip|rar|txt/', $ext)) ? '<span class=\"ico_file_'.$ext.'\">&nbsp;</span>' : '<span class=\"ico_file_magnifier\">&nbsp;</span>';\n}", "function parse_icon($ext) {\r\n switch (strtolower($ext)) {\r\n case 'doc': return 'doc_small.gif';\r\n case 'rtf': return 'doc_small.gif';\r\n case 'txt': return 'txt_small.gif';\r\n case 'xls': return 'xls_small.gif';\r\n case 'csv': return 'xls_small.gif';\r\n case 'ppt': return 'ppt_small.gif';\r\n case 'html': return 'html_small.gif';\r\n case 'htm': return 'html_small.gif';\r\n case 'php': return 'script_small.gif';\r\n case 'php3': return 'script_small.gif';\r\n case 'cgi': return 'script_small.gif';\r\n case 'pdf': return 'pdf_small.gif';\r\n case 'rar': return 'rar_small.gif';\r\n case 'zip': return 'zip_small.gif';\r\n case 'gz': return 'gz_small.gif';\r\n case 'jpg': return 'jpg_small.gif';\r\n case 'gif': return 'gif_small.gif';\r\n case 'png': return 'png_small.gif';\r\n case 'bmp': return 'image_small.gif';\r\n case 'exe': return 'binary_small.gif';\r\n case 'bin': return 'binary_small.gif';\r\n case 'avi': return 'mov_small.gif';\r\n case 'mpg': return 'mov_small.gif';\r\n case 'moc': return 'mov_small.gif';\r\n case 'asf': return 'mov_small.gif';\r\n case 'mp3': return 'sound_small.gif';\r\n case 'wav': return 'sound_small.gif';\r\n case 'org': return 'sound_small.gif';\r\n default:\r\n return 'def_small.gif';\r\n }\r\n}", "public function hasIconUrl()\n {\n return $this->icon_url !== null;\n }", "function isRecognizableExtension( $extension ) {\n\t\tstatic $types = array(\n\t\t\t'gif', 'jpeg', 'jpg', 'png', 'swf', 'psd',\n\t\t\t'bmp', 'tiff', 'tif', 'jpc', 'jp2',\n\t\t\t'jpx', 'jb2', 'swc', 'iff', 'wbmp',\n\t\t\t'xbm'\n\t\t);\n\t\treturn in_array( strtolower( $extension ), $types );\n\t}", "private function imageCheck($extension)\n {\n $allowedTypes = [\n 'image/gif',\n 'image/jpg',\n 'image/png',\n 'image/bmp',\n 'image/jpeg'\n ];\n\n return in_array($extension, $allowedTypes);\n }", "public function getTypeIcon($type) {\n\t\tswitch ($type) {\n\t\t\tcase self::APP_NAME:\n\t\t\t\treturn false;\n\t\t}\n\n\t\treturn false;\n\t}", "function is_valid_icon( $name ) {\n\t\tif ( substr( $name, 0, 5 ) === 'icon-' || substr( $name, 0, 12 ) === 'tf_fontello-' ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function isImage() {\n return in_array($this->get(\"extension\"), [\"jpg\", \"jpeg\", \"png\", \"gif\"]);\n }", "protected function checkFileExtension()\n\t{\n\t\t$fileInfo = pathinfo($this -> sourceFile);\n\t\treturn $fileInfo['extension'] == $this -> fileExtension;\n\t}", "function getIcon($icon) {\n $icons = array (\"pdf\" => \"icon_adobe.png\", \"code\" => \"icon_code.jpg\", \"xlsx\" => \"icon_excel.png\",\n \"img\" => \"icon_gallery.png\", \"pptx\" => \"icon_ppt.png\", \"docx\" => \"icon_word.png\", \"zip\" => \"icon_zip.png\");\n \n if ( !array_key_exists($icon, $icons) ) {\n return \"user.png\";\n }\n \n return $icons[$icon];\n }", "function is_valid_icon( $name ) {\n\t\treturn true;\n\t}", "protected function checkExtension($extension)\n {\n return $extension=='image/jpeg'||$extension=='image/jpg'||$extension=='image/png'||$extension=='image/gif';\n }", "function addIcon( &$file )\n\t{\n\t\tstatic $icon_exists = array();\n\n\t\tswitch ($file->ext)\n\t\t{\n\t\t\t// Image\n\t\t\tcase 'jpg':\n\t\t\tcase 'png':\n\t\t\tcase 'gif':\n\t\t\tcase 'xcf':\n\t\t\tcase 'odg':\n\t\t\tcase 'wbmp':\n\t\t\tcase 'bmp':\n\t\t\tcase 'ico':\n\t\t\tcase 'jpeg':\n\t\t\tcase 'webp':\n\t\t\t\t$file->icon = 'components/com_flexicontent/assets/images/mime-icon-16/image.png';\n\t\t\tbreak;\n\n\t\t\t// Non-image document\n\t\t\tdefault:\n\t\t\t\tif ( !isset($icon_exists[$file->ext]) ) {\n\t\t\t\t\t$icon = JPATH_SITE.DS.'components'.DS.'com_flexicontent'.DS.'assets'.DS.'images'.DS.'mime-icon-16'.DS.$file->ext.'.png';\n\t\t\t\t\t$icon_exists[$file->ext] = file_exists($icon);\n\t\t\t\t}\n\t\t\t\tif ( $icon_exists[$file->ext] ) {\n\t\t\t\t\t$file->icon = 'components/com_flexicontent/assets/images/mime-icon-16/'.$file->ext.'.png';\n\t\t\t\t} else {\n\t\t\t\t\t$file->icon = 'components/com_flexicontent/assets/images/mime-icon-16/unknown.png';\n\t\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\treturn $file;\n\t}", "function _shiny_upload_icon_path($file, $theme = 'protocons') {\n $dashed_mime = strtr($file['filemime'], array('/' => '-'));\n if ($iconpath = _shiny_upload_create_icon_path($dashed_mime, $theme)) {\n return $iconpath;\n }\n // For a couple of mimetypes, we can \"manually\" tell a generic icon.\n if ($generic_name = _shiny_upload_generic_icon_map($file)) {\n if ($iconpath = _shiny_upload_create_icon_path($generic_name, $theme)) {\n return $iconpath;\n }\n }\n // Use generic icons for each category that provides such icons.\n foreach (array('audio', 'image', 'text', 'video') as $category) {\n if (strpos($file['filemime'], $category .'/') === 0) {\n if ($iconpath = _shiny_upload_create_icon_path($category .'-x-generic', $theme)) {\n return $iconpath;\n }\n }\n }\n // Try application-octet-stream as last fallback.\n if ($iconpath = _shiny_upload_create_icon_path('application-octet-stream', $theme)) {\n return $iconpath;\n }\n // Sorry, no icon can be found...\n return FALSE;\n}", "public function isImage()\n {\n $extensions = ['jpg','jpeg','png','bmp'];\n return in_array($this->extension, $extensions);\n }", "public function getIsExtension() {}", "function GetFileIcon($file_name){\n $ext = substr(strrchr($file_name, \".\"), 1);\n switch($ext){\n case \"asp\" : $icon=\"ico_asp.gif\"; break;\n case \"bmp\" : $icon=\"ico_bmp.gif\"; break;\n case \"css\" : $icon=\"ico_css.gif\"; break;\n case \"doc\" : $icon=\"ico_doc.gif\"; break;\n case \"exe\" : $icon=\"ico_exe.gif\"; break;\n case \"gif\" : $icon=\"ico_gif.gif\"; break;\n case \"htm\" : $icon=\"ico_htm.gif\"; break;\n case \"html\": $icon=\"ico_htm.gif\"; break;\n case \"jpg\" : $icon=\"ico_jpg.gif\"; break;\n case \"js\" : $icon=\"ico_js.gif\"; break;\n case \"mdb\" : $icon=\"ico_mdb.gif\"; break;\n case \"mov\" : $icon=\"ico_mov.gif\"; break;\n case \"mp3\" : $icon=\"ico_mp3.gif\"; break;\n case \"pdf\" : $icon=\"ico_pdf.gif\"; break;\n case \"png\" : $icon=\"ico_png.gif\"; break;\n case \"ppt\" : $icon=\"ico_ppt.gif\"; break;\n case \"mid\" : $icon=\"ico_sound.gif\"; break;\n case \"wav\" : $icon=\"ico_sound.gif\"; break;\n case \"wma\" : $icon=\"ico_sound.gif\"; break;\n case \"swf\" : $icon=\"ico_swf.gif\"; break;\n case \"txt\" : $icon=\"ico_txt.gif\"; break;\n case \"vbs\" : $icon=\"ico_vbs.gif\"; break;\n case \"avi\" : $icon=\"ico_video.gif\"; break;\n case \"wmv\" : $icon=\"ico_video.gif\"; break;\n case \"mpeg\": $icon=\"ico_video.gif\"; break;\n case \"mpg\" : $icon=\"ico_video.gif\"; break;\n case \"xls\" : $icon=\"ico_xls.gif\"; break;\n case \"zip\" : $icon=\"ico_zip.gif\"; break;\n default : $icon=\"ico_unknown.gif\"; break;\n }\n return \"<img src=\\\"\".APP_IMAGES_DIR.\"icons/{$icon}\\\" />\";\n }", "function iconfile ($file) {\n $ftype = strrchr($file, '.');\n\n $iconfiles = array(\n ## Office Documents\n '.doc' => 'page_white_word.png',\n '.docx' => 'page_white_word.png',\n '.ppt' => 'powerpoint.png',\n '.xls' => 'page_white_excel.png',\n '.xlsx' => 'page_white_excel.png',\n '.rtf' => 'page_white_word.png',\n ## PDF\n '.pdf' => 'page_white_acrobat.png',\n ## Images\n '.gif' => 'page_white_picture.png',\n '.jpeg' => 'page_white_picture.png',\n '.jpg' => 'page_white_picture.png',\n '.png' => 'page_white_picture.png',\n ## Archives\n '.zip' => 'page_white_compressed.png'\n );\n\n if (array_key_exists($ftype, $iconfiles)) {\n $image = $iconfiles[$ftype];\n } else {\n $image = 'page_white.png';\n }\n\n return '<img src=\"'.STATIK.'nro/illus/'.$image.'\" alt=\"\" width=\"16\" height=\"16\">';\n}", "public function hasIcon($size, $type = 'icon') {\n\t\treturn _elgg_services()->iconService->hasIcon($this, $size, $type);\n\t}", "function magic_if_image($file_path)\n{\n\n\tglobal $is_image;\n\n\t$info = new SplFileInfo($file_path);\n\n\t$filetype=$info->getExtension(); \n\n\tif($filetype=='jpg' || $filetype=='png' || $filetype=='bmp' || $filetype=='gif' || $filetype=='jpeg'){\n\n\t\t$is_image='Yes';\n\n\t}else{\n\t\t$is_image='No';\n\t}\n\n\n\treturn $is_image;\n\n}", "public function isIconEnabled()\n {\n return $this->iconEnabled;\n }", "function _filefield_icon_path($file, $theme = NULL) {\r\n if (!isset($theme)) {\r\n $theme = variable_get('filefield_icon_theme', 'default');\r\n }\r\n\r\n // If there's an icon matching the exact mimetype, go for it.\r\n $dashed_mime = strtr($file['filemime'], array('/' => '-'));\r\n if ($icon_path = _filefield_create_icon_path($dashed_mime, $theme)) {\r\n return $icon_path;\r\n }\r\n // For a couple of mimetypes, we can \"manually\" tell a generic icon.\r\n if ($generic_name = _filefield_generic_icon_map($file)) {\r\n if ($icon_path = _filefield_create_icon_path($generic_name, $theme)) {\r\n return $icon_path;\r\n }\r\n }\r\n // Use generic icons for each category that provides such icons.\r\n foreach (array('audio', 'image', 'text', 'video') as $category) {\r\n if (strpos($file['filemime'], $category .'/') === 0) {\r\n if ($icon_path = _filefield_create_icon_path($category .'-x-generic', $theme)) {\r\n return $icon_path;\r\n }\r\n }\r\n }\r\n // Try application-octet-stream as last fallback.\r\n if ($icon_path = _filefield_create_icon_path('application-octet-stream', $theme)) {\r\n return $icon_path;\r\n }\r\n // Sorry, no icon can be found...\r\n return FALSE;\r\n}", "function fileExtensionMiniature($file)\n{\n\t$ext = str_replace(\".\", \"\", strrchr($file, '.'));\n\t$icon = \"../images/icons/\" . $ext . \".png\";\n\treturn $icon;\n}", "protected function isExtension($extension)\n {\n return strtolower($this->file->getExtension()) == strtolower($extension);\n }", "function has_extension( $extension_name )\n {\n // look for extension folder\n if(file_exists(\n 'extensions/'.$extension_name\n )){\n return true;\n }\n \n // didn't have it\n return false;\n }", "protected function get__icon()\n\t{\n\t\treturn 'files-o';\n\t}", "function icon($extension, $fallback = 'file')\n{\n\tglobal $txt, $settings;\n\n\t$fallback_image = $settings['default_images_url'] . '/filemanager/filetypes/' .$fallback . '.png';\n\n\tif(empty($extension))\n\treturn $fallback_image;\n\telse\n\t{\n\t\t$filetypes = array(\n\t\t\t'ttf' => 'font', 'gdf' => 'font', 'htaccess' => 'code', 'htpasswd' => 'code',\n\t\t\t'php' => 'php', 'php~' => 'php', 'asp' => 'text', 'shtml' => 'text',\n\t\t\t'rb' => 'ruby', 'pl' => 'text', 'pdf' => 'pdf', 'txt' => 'text',\n\t\t\t'bas' => 'text', 'c' => 'c', 'h' => 'text', 'htm' => 'html',\n\t\t\t'html' => 'html', 'css' => 'css', 'pas' => 'text', 'js' => 'script',\n\t\t\t'xml' => 'xml', 'sql' => 'sql', 'mp3' => 'audio', 'ram' => 'audio',\n\t\t\t'ra' => 'audio', 'au' => 'audio', 'wav' => 'audio', 'm3u' => 'audio',\n\t\t\t'aiff' => 'audio', 'aifc' => 'audio', 'mid' => 'audio', 'rmi' => 'audio',\n\t\t\t'aif' => 'audio', 'snd' => 'audio', 'avi' => 'video', 'movie' => 'video',\n\t\t\t'mpeg' => 'video', 'mp2' => 'video', 'mpg' => 'video', 'mov' => 'video',\n\t\t\t'mpe' => 'video', 'mpv2' => 'video', 'mpa' => 'video', 'lsf' => 'video',\n\t\t\t'lsx' => 'video', 'asf' => 'video', 'asr' => 'video', 'asx' => 'video',\n\t\t\t'qt' => 'video', 'm2v' => 'video', 'rar' => 'package', 'gz' => 'package',\n\t\t\t'tar' => 'package', 'zip' => 'package', 'bz2' => 'package', 'bin' => 'package',\n\t\t\t'lzh' => 'package', 'cab' => 'package', 'lha' => 'package', '7z' => 'package',\n\t\t\t'tgz' => 'package', 'z' => 'package', 'exe' => 'application', 'doc' => 'text', \n\t\t\t'dot' => 'text', 'odt' => 'text', 'xlm' => 'text', 'xls' => 'excel',\n\t\t\t'ods' => 'text', 'ppt' => 'text', 'pps' => 'text', 'cab' => 'text',\n\t\t\t'odp' => 'text', 'pub' => 'text', 'wri' => 'text', 'odc' => 'text',\n\t\t\t'odb' => 'text', 'jpg' => 'image', 'gif' => 'image', 'png' => 'image',\n\t\t\t'bmp' => 'image', 'jpeg' => 'image', 'jpe' => 'image', 'jfif' => 'image',\n\t\t\t'svg' => 'image', 'tif' => 'image', 'tiff' => 'image', 'ico' => 'image',\n\t\t\t'cod' => 'image', 'ief' => 'image', 'ras' => 'image', 'cmx' => 'image',\n\t\t\t'pnm' => 'image', 'pbm' => 'image', 'pgm' => 'image', 'ppm' => 'image',\n\t\t\t'rgb' => 'image', 'xbm' => 'image', 'xpm' => 'image', 'xwd' => 'image',\n\t\t\t'flv' => 'flash', 'swf' => 'flash', 'psd' => 'photoshop', 'ai' => 'illustrator',\n\t\t\t'list' => 'list','log' => 'list', 'tif' => 'image'\n\t\t);\n\n\t\tif(isset($filetypes[strtolower($extension)]))\n\t\t{\n\t\t\tif(file_exists($settings['default_theme_dir'] . '/images/filemanager/filetypes/' . $filetypes[strtolower($extension)] . '.png'))\n\t\t\t\treturn $settings['default_images_url'] . '/filemanager/filetypes/' . $filetypes[strtolower($extension)] . '.png';\n\t\t\telse\n\t\t\t\treturn $fallback_image;\n\t\t}\n\t\telse\n\t\t\treturn $fallback_image;\n\t}\n}" ]
[ "0.6785213", "0.6715672", "0.6696902", "0.6513231", "0.64585274", "0.64302397", "0.63067925", "0.629674", "0.6290034", "0.62100434", "0.6180996", "0.6168356", "0.61341375", "0.61197466", "0.6118044", "0.61175597", "0.61020833", "0.6081577", "0.60734326", "0.60119337", "0.6010841", "0.5994896", "0.5972558", "0.5945845", "0.5908657", "0.5884458", "0.5872587", "0.5855276", "0.5854552", "0.5843037" ]
0.75948554
0
Default action. Starts daemon.
public function actionStart() { try { $this->stdout(sprintf("[%s] running daemon\n", $this->daemonName()), Console::FG_GREEN); $this->startDaemon([$this, 'worker']); } catch (IsRunningException $e) { $this->stdout("{$e->getMessage()}\n", Console::FG_RED); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function action_launch()\n\t{\n\t\t// Grab the command line settings\n\t\t$settings = CLI::options('daemonize');\n\n\t\t// Lets make sure the system is only running one master file.\n\t\tif(file_exists($this->_config['pid_file']))\n\t\t{\n\t\t\t// Grab the PID last saved.\n\t\t\t$pid = file_get_contents($this->_config['pid_file']);\n\n\t\t\t// See if the daemon is running.\n\t\t\tif (Daemon::ProcessIsRunning($pid))\n\t\t\t{\n\t\t\t\tKohana::$log->add(Log::CRITICAL, 'TaskDaemon: Daemon already running at: ' . $pid);\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\n\t\t// We do not want to daemonize, useful if you are using some kind of monitoring program\n\t\tif(isset($settings['daemonize']) && $settings['daemonize'] == 'no')\n\t\t{\n\t\t\t// Fork successful - exit parent (daemon continues in child)\n\t\t\tKohana::$log->add(Log::INFO, 'TaskDaemon: Daemon created succesfully at: ' . posix_getpid());\n\n\t\t\t// Set the pid file for this daemon so we can see if it is running at any time.\n\t\t\tfile_put_contents($this->_config['pid_file'], posix_getpid());\n\n\t\t\t// Background process - run daemon\n\t\t\tKohana::$log->add(Log::INFO, strtr('TaskDaemon: Config :config loaded, max: :max, sleep: :sleep', array(\n\t\t\t\t':config' => $this->_config_name,\n\t\t\t\t':max' => $this->_config['max'],\n\t\t\t\t':sleep' => $this->_config['sleep']\n\t\t\t)));\n\n\t\t\t// Write the log to ensure no memory issues\n\t\t\tKohana::$log->write();\n\n\t\t\t// Launch the daemon\n\t\t\tDaemon::launch($this->_config);\n\n\t\t\tunset($this);\n\t\t}\n\t\telse // Run as your own standalone daemon.\n\t\t{\n\t\t\t// fork into background\n\t\t\t$pid = pcntl_fork();\n\n\t\t\tif ($pid == -1)\n\t\t\t{\n\t\t\t\t// Error - fork failed\n\t\t\t\tKohana::$log->add(Log::CRITICAL, 'TaskDaemon: Initial fork failed');\n\t\t\t\texit;\n\t\t\t}\n\t\t\telseif ($pid)\n\t\t\t{\n\t\t\t\t// Fork successful - exit parent (daemon continues in child)\n\t\t\t\tKohana::$log->add(Log::INFO, 'TaskDaemon: Daemon created succesfully at: ' . $pid);\n\n\t\t\t\t// Set the pid file for this daemon so we can see if it is running at any time.\n\t\t\t\tfile_put_contents( $this->_config['pid_file'], $pid);\n\n\t\t\t\tKohana::$log->write();\n\n\t\t\t\t// We are done so we exit out.\n\t\t\t\texit(0);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// We need to detach from the master process and become our own master process.\n\t\t\t\tif (posix_setsid() == -1)\n\t\t\t\t{\n\t\t\t\t Kohana::$log->add(Log::CRITICAL, 'TaskDaemon: Could not detach from terminal in launch.');\n\t\t\t\t\texit(1);\n\t\t\t\t}\n\n\t\t\t\t// Background process - run daemon\n\t\t\t\tKohana::$log->add(Log::INFO, strtr('TaskDaemon: Config :config loaded, max: :max, sleep: :sleep', array(\n\t\t\t\t\t':config' => $this->_config_name,\n\t\t\t\t\t':max' => $this->_config['max'],\n\t\t\t\t\t':sleep' => $this->_config['sleep']\n\t\t\t\t)));\n\n\t\t\t\t// Write the log to ensure no memory issues\n\t\t\t\tKohana::$log->write();\n\n\t\t\t\t// Launch the daemon\n\t\t\t\tDaemon::launch($this->_config);\n\n\t\t\t\t//exit(0);\n\n\t\t\t\tunset($this);\n\t\t\t}\n\t\t}\n\t}", "public function start() {\n\t\t// Init the \"Daemon\"\n\t\t$daemon = new Writed();\n\t\t// Run it\n\t\t$daemon->run();\n\t\t// successfull status code\n\t\treturn 0;\n\t}", "public static function start()\r\n {\r\n if (!self::$_instance) {\r\n self::_loadFiles();\r\n\r\n self::$_instance = new Rootd_Installer();\r\n self::$_instance->run();\r\n }\r\n }", "function Daemon()\n\t{\n\t\t// if($_SERVER['REMOTE_ADDR']!='127.0.0.1') exit(\"Access Denied.\");\t\t\n\t\t\t\t\t\t\n\t\tparent::controller();\n\t}", "function boot_start($daemon)\n {\n clearos_profile(__METHOD__, __LINE__);\n $this->load->library('base/Daemon', $daemon);\n\n try {\n $this->daemon->set_boot_state(TRUE);\n redirect('/services/');\n } catch (Exception $e) {\n $this->page->view_exception($e);\n return;\n }\n }", "public function actionStartAsDaemon($force = FALSE)\n {\n\n if($this->isRunning() AND ! $force)\n {\n echo \"Chat is already running\\n\";\n return;\n }\n\n // Run as daemon\n parent::init();\n\n $serverClass = Yii::import('chat.components.ChatWebSocket', true);\n \n try {\n\n $this->chat = new $serverClass('0.0.0.0', 2101);\n\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n }", "public static function start()\n\t{\n\t}", "protected function start() {\n $args = $this->getServerArguments();\n if ($args['command']) {\n $commandClass = $this->getCommandClassFromNameAndModule($args['command'], null);\n } else {\n $commandClass = $this->notFoundCommand;\n }\n if (!class_exists($commandClass)) {\n $this->alert('Command ' . $commandClass . ' not found!', array(\n 'requestedCommand' => $args['command'],\n 'requestedModule' => '-'\n ));\n $commandClass = $this->notFoundCommand;\n }\n\n $command = $this->loadCommand($commandClass);\n $command->setActiveAction($args['action']);\n $command->run($args['params']);\n }", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start();", "public function start() {}", "public function run() {\r\n\t\t\r\n\t\t$this->monitor_pid = $this->get_pid();\r\n\t\t$this->daemon_pid = $this->start();\t// start the Daemon\r\n\t\tif(!$this->daemon_pid) {\r\n\t\t\tthrow new Exception(\"Could not start the daemon\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\t\r\n\t\t\tif(file_exists($this->pid_file)) {\r\n\t\t\t\tunlink($this->pid_file)\r\n\t\t\t\t\tor trigger_error(\"PID file locked\", E_USER_ERROR);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->daemon_pidfile_handle = fopen($this->pid_file, 'w')\r\n\t\t\t\tor trigger_error(\"ERROR: could not create PID file ($this->pid_file)\", E_USER_ERROR);\r\n\t\t\t\r\n\t\t\tfwrite($this->daemon_pidfile_handle, $this->monitor_pid);\r\n\t\t\t@flock($this->daemon_pidfile_handle, LOCK_EX) or $this->log(\"WARNING: could not lock PID file ($this->pid_file)\");\r\n\t\t\t\r\n\t\t\t$this->log(\"Daemon started\");\r\n\t\t\t$this->monitor();\t\t\t\t// watch the Daemon\r\n\t\t}\r\n\t}", "public static function run() {\n\t\t$instance = new Master();\n\t\t$instance->start();\n\t}", "public static function start( )\n {\n \n Process::execute( \"/etc/init.d/apache2 start\" );\n \n }", "public function start() {\n\t}", "public static function run()\n {\n \\Swoole\\Runtime::enableCoroutine();\n self::$debug = new \\swoole_atomic(0);\n self::$xdebug = false;\n self::$coverage = false;\n self::$leader = new \\swoole_atomic(0);\n self::$xdebug_table = new \\swoole_table(1);\n self::$xdebug_table->column('wid', \\swoole_table::TYPE_INT, 8);\n self::$xdebug_table->column('cid', \\swoole_table::TYPE_INT, 8);\n self::$xdebug_table->create();\n self::$startTime = date('Y-m-d H:i:s');\n self::$startMillisecond = getMillisecond();\n self::setProcessTitle(getServerName());\n $application = new Application();\n $input = new ArgvInput();\n $output = new ConsoleOutput();\n self::$io = new SymfonyStyle($input, $output);\n self::addDirCommand(SERVER_DIR, \"Server\", $application);\n self::addDirCommand(APP_DIR, \"app\", $application);\n $application->run($input, $output);\n }", "public function actionStart()\n {\n if($this->isRunning())\n {\n echo \"Chat is already running\\n\";\n return;\n }\n\n $cmd = Yii::app()->basePath . DIRECTORY_SEPARATOR . 'yiic chat startAsDaemon --force=1 > /dev/null 1';\n echo 'Starting chat ... ';\n `$cmd`;\n sleep(3);\n if($this->isRunning())\n echo \"ok\\n\";\n else\n echo \"failed\\n\";\n }", "protected function startStandalone() {\n if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\n $JAVA=\"javaw\";\n } else {\n $JAVA=\"nohup java\";\n }\n $dir = getcwd();\n chdir( LUCENE_BASE_PATH.'/java' );\n $cmd = \"$JAVA -Dphp.java.bridge.daemon='true' -jar JavaBridge.jar \".\n \t\t\t\tescapeshellarg('SERVLET_LOCAL:'.$this->getConfig('servlet_port')).\" &\";\n system($cmd);\n chdir($dir);\n }", "public function start()\n {\n $this->exec('sudo asterisk -vvv </dev/null >>'.$this->version.'.log 2>&1 &');\n sleep(1);\n }", "public function start()\n {\n }", "public function start()\n {\n }", "public function start()\n {\n }", "public function start()\n {\n $this->pid = getmypid();\n\n // Parse command line options. Loads the config file as well\n $this->getopt();\n \n // Register signal listeners\n $this->register_ticks();\n \n // Load up the workers\n $this->load_workers();\n if (empty($this->functions)){\n $this->log(\"No workers found\");\n posix_kill($this->pid, SIGUSR1);\n exit();\n }\n\n // Validate workers in the helper process\n $this->fork_me(\"validate_workers\");\n\n $this->log(\"Started with pid $this->pid\", self::LOG_LEVEL_PROC_INFO);\n\n // Start the initial workers and set up a running environment\n $this->bootstrap();\n\n $this->process_loop();\n\n // Kill the helper if it is running\n if (isset($this->helper_pid)){\n posix_kill($this->helper_pid, SIGKILL);\n }\n\n $this->log(\"Exiting\");\n }", "protected function start()\n {\n\n }", "static function start() {\r\n\t\t$run_name = 'Main';\r\n\t\t$action_name = 'index';\r\n\r\n\t\t$routes = explode('/', $_SERVER['REQUEST_URI']);\r\n\r\n\t\t# Get the name Controller\r\n\t\tif (!empty($routes[1])) {\r\n\t\t\t$run_name = $routes[1];\r\n\t\t}\r\n\r\n\t\tif (!empty($routes[2])) {\r\n\t\t\t$action_name = $routes[2];\r\n\t\t}\r\n\r\n\t\tunset($routes);\r\n\t\t# add prefix\r\n\t\t$bin_name = strtok('Bin_'.$run_name, '?');\r\n\t\t$run_name = strtok('Run_'.$run_name, '?');\r\n\t\t$action_name = strtok('action_'.$action_name, '?');\r\n\r\n\t\t# include a file the class Bin\r\n\t\t$bin_file = strtolower($bin_name).'.php';\r\n\t\t$bin_path = 'etc/bin/'.$bin_file;\r\n\r\n\t\tif (file_exists($bin_path)) {\r\n\t\t\tinclude 'etc/bin/'.$bin_file;\r\n\t\t}\r\n\r\n\t\t# include a file the class Run\r\n\t\t$run_file = strtolower($run_name).'.php';\r\n\t\t$run_path = 'etc/run/'.$run_file;\r\n\r\n\t\tif (file_exists($run_path)) {\r\n\t\t\tinclude 'etc/run/'.$run_file;\r\n\r\n\t\t\t# creat Run\r\n\t\t\t$run = new $run_name;\r\n\t\t\t$action = $action_name;\r\n\r\n\t\t\tif (method_exists($run, $action)) {\r\n\t\t\t\t# call the action Run\r\n\t\t\t\t$run->$action();\r\n\t\t\t} else {\r\n\t\t\t\tRoute::ErrorPage404();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tRoute::ErrorPage404();\r\n\t\t}\r\n }", "protected function start()\n { }" ]
[ "0.740749", "0.6849461", "0.67883813", "0.66998845", "0.6505348", "0.6495885", "0.6464566", "0.6427548", "0.636723", "0.636723", "0.636723", "0.636723", "0.636723", "0.636723", "0.6325837", "0.6299018", "0.6262595", "0.6262569", "0.62539756", "0.6252157", "0.6245446", "0.618355", "0.6159044", "0.6132767", "0.6132767", "0.6132767", "0.61164486", "0.6092983", "0.60845095", "0.60346866" ]
0.78671044
0
Funcion que verifica el cupo en el grupo del espacio academico
function verificarCupo($retorno) { //verifica cupo en el grupo $sobrecupo=$this->validacion->verificarSobrecupo($this->datosInscripcion); if($sobrecupo!='ok' && is_array($sobrecupo)) { $retorno['mensaje']="El grupo presenta sobrecupo: Cupo:".$sobrecupo['cupo']." Disponibles: 0. No se ha realizado la inscripción"; $this->enlaceNoAdicion($retorno); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function testGroupe()\r\n\t{\r\n\t\t$var=$this->monUtilisateur->recupGroupes();\r\n\t\tif ($var[0] == DIEU ) return 1;\r\n\t\telse return 0;\r\n\t}", "function db_conplano_grupo($anousu = null, $estrut = \"\", $grupo = 0) {\n\n if ($anousu == \"\" || $anousu == null) {\n $anousu = db_getsession(\"DB_anousu\");\n }\n\n $sql_result = analiseQueryPlanoOrcamento(\"select fc_conplano_grupo($anousu, '$estrut', $grupo) as retorno\");\n $result = db_query($sql_result);\n $numrows = pg_numrows($result);\n if ($numrows != 0) {\n $retorno = pg_result($result, 0, 0);\n if ($retorno == 't') {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n}", "public function getIdAgrupadorLibre(){\n $id_agrupador_max = 0;\n $flag_existe_agrupador = false;\n //para ZonaSesion\n foreach($this->_ZonaSesion_arr as $ZonaSesion){\n if($ZonaSesion->getIdAgrupador()>$id_agrupador_max){\n $id_agrupador_max=$ZonaSesion->getIdAgrupador();\n $flag_existe_agrupador=true; \n }\n //los descuentos\n $descuento_arr = $ZonaSesion->getIdDescuentoArr();\n foreach($descuento_arr as $descuento){\n if($descuento[\"id_agrupador\"]>$id_agrupador_max){\n $descuento[\"id_agrupador\"];\n $flag_existe_agrupador=true; \n }\n }\n }\n //para EspecialButacaSesion\n foreach($this->_EspecialButacaSesion_arr as $EspecialButacaSesion){\n if($EspecialButacaSesion->getIdAgrupador()>$id_agrupador_max){\n $id_agrupador_max=$EspecialButacaSesion->getIdAgrupador();\n $flag_existe_agrupador=true; \n }\n //los descuentos\n $descuento_arr = $EspecialButacaSesion->getIdDescuentoArr();\n foreach($descuento_arr as $descuento){\n if($descuento[\"id_agrupador\"]>$id_agrupador_max){\n $descuento[\"id_agrupador\"];\n $flag_existe_agrupador=true; \n }\n }\n }\n //para CanalesSesion\n foreach($this->_CanalesSesion_arr as $CanalesSesion){\n if($CanalesSesion->getIdAgrupador()>$id_agrupador_max){\n $id_agrupador_max=$CanalesSesion->getIdAgrupador();\n $flag_existe_agrupador=true; \n }\n //los descuentos\n $descuento_arr = $CanalesSesion->getIdDescuentoArr();\n foreach($descuento_arr as $descuento){\n if($descuento[\"id_agrupador\"]>$id_agrupador_max){\n $descuento[\"id_agrupador\"];\n $flag_existe_agrupador=true; \n }\n }\n }\n if($flag_existe_agrupador=true)$id_agrupador_max = $id_agrupador_max+1;//si no se ha cambiado tiene qeu ser cero para que id_agrupador vaya de 0 a n\n return $id_agrupador_max;\n }", "public function createGrupo($clave,$carrera){\n\t\t\t// Se delcara la consulta\n\t\t\t$stmt = $this->con->prepare(\"INSERT INTO `grupos` (clave,carrera) VALUES ('$clave','$carrera')\");\n\t\t\t// Se carga el resultado de la consulta \n\t\t\t$stmt->execute();\n\t\t\tif($stmt){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function verificarInscrito($retorno,$espaciosInscritos) {\n //verifica si el espacio ya ha sido inscrito\n $inscrito='ok';\n foreach ($espaciosInscritos as $inscritos) {\n if($inscritos['CODIGO']==$this->datosInscripcion['codEspacio'])\n {\n $inscrito=$inscritos['GRUPO'];\n break;\n }\n }\n if($inscrito!='ok')\n {\n $retorno['mensaje']=\"El espacio académico ya esta inscrito en el grupo \".$inscrito.\" para el periodo actual. No se puede inscribir de nuevo.\";\n $this->enlaceNoAdicion($retorno);\n }\n }", "function verificarInscrito($retorno,$espaciosInscritos) {\n //verifica si el espacio ya ha sido inscrito\n $inscrito='ok';\n foreach ($espaciosInscritos as $inscritos) {\n if($inscritos['CODIGO']==$this->datosInscripcion['codEspacio'])\n {\n $inscrito=$inscritos['GRUPO'];\n break;\n }\n }\n if($inscrito!='ok')\n {\n $retorno['mensaje']=\"El espacio académico ya esta inscrito en el grupo \".$inscrito.\" para el periodo actual. No se puede inscribir de nuevo.\";\n $this->enlaceNoAdicion($retorno);\n }\n }", "function verificarCruce($retorno,$horarioEstudiante,$horarioGrupo) {\n //verifica si hay cruce de horario\n $cruce=$this->validacion->verificarCruceHorarios($horarioEstudiante,$horarioGrupo);\n if($cruce==1)\n {\n $retorno['mensaje']=\"El horario del espacio académico presenta cruce con el horario del estudiante. No se ha realizado la inscripción\";\n $this->enlaceNoAdicion($retorno);\n exit;\n }\n }", "function verificarCruce($retorno,$horarioEstudiante,$horarioGrupo) {\n //verifica si hay cruce de horario\n $cruce=$this->validacion->verificarCruceHorarios($horarioEstudiante,$horarioGrupo);\n if($cruce==1)\n {\n $retorno['mensaje']=\"El horario del espacio académico presenta cruce con el horario del estudiante. No se ha realizado la inscripción\";\n $this->enlaceNoAdicion($retorno);\n exit;\n }\n }", "function recorrerMatrizGrupos() {\n\t\t\t\n\t\t\t\tglobal $res,$matriz;\n\t\t\t\t\tfor($pos=0;$pos < mysql_num_rows($res); $pos++) {\n\t\t\t\t\t\n\t\t\t\t\t\t$grupo= $matriz[\"grupo\"][$pos] ;\n\t\t\t\t\t\t$grupo = eliminarCaracteresEspeciales($grupo);\n\t\t\t\t\t\t$almacenppal= \"SUMINISTROS\";\n\t\t\t\t\t\t$compania = $_SESSION[\"compania\"];\n\t\t\t\t\t\t\tif(!$compania) {\n\t\t\t\t\t\t\t\t$compania = \"CLINICA SAN JUAN DE DIOS\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\tinsertarGrupo($grupo, $almacenppal, $compania, 2007);\n\t\t\t\t\t\t\tinsertarGrupo($grupo, $almacenppal, $compania, 2008);\n\t\t\t\t\t\t\tinsertarGrupo($grupo, $almacenppal, $compania, 2009);\n\t\t\t\t\t\t\tinsertarGrupo($grupo, $almacenppal, $compania, 2010);\n\t\t\t\t\t\t\tinsertarGrupo($grupo, $almacenppal, $compania, 2011);\n\t\t\t\t\t\t\tinsertarGrupo($grupo, $almacenppal, $compania, 2012);\n\t\t\t\t\t\t\tinsertarGrupo($grupo, $almacenppal, $compania, 2013);\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tinsertarGrupo(\"POR VALIDAR\", $almacenppal, $compania, 2007);\n\t\t\t\t\tinsertarGrupo(\"POR VALIDAR\", $almacenppal, $compania, 2008);\n\t\t\t\t\tinsertarGrupo(\"POR VALIDAR\", $almacenppal, $compania, 2009);\n\t\t\t\t\tinsertarGrupo(\"POR VALIDAR\", $almacenppal, $compania, 2010);\n\t\t\t\t\tinsertarGrupo(\"POR VALIDAR\", $almacenppal, $compania, 2011);\n\t\t\t\t\tinsertarGrupo(\"POR VALIDAR\", $almacenppal, $compania, 2012);\n\t\t\t\t\tinsertarGrupo(\"POR VALIDAR\", $almacenppal, $compania, 2013);\n\t\t\t\n\t\t\t}", "function buscarGrupos($idEspacioAcademico)\n\t{\n\t\t$sql=\"SELECT idGrupo,NumeroGrupo,EspacioAcademico_idEspacioAcademico FROM grupo\n\t\t\t\tWHERE EspacioAcademico_idEspacioAcademico= \".$idEspacioAcademico;\n $consulta = $this->query($sql);\n \t$datos = array();\n $i=0;\n while($dato = $consulta->fetch(PDO::FETCH_ASSOC))\n {\n \t$datos[$i] = array();\n \t$datos[$i]['pk'] = $dato['idGrupo'];\n \t\n \t$i++;\n }\n\n return $datos;\n\t}", "public function hasGrupoAvaliacaoSelecionada() {\n return $this->oGrupoAvaliacao instanceof AvaliacaoGrupo;\n }", "function validar_cuota_alumno($id_alumno, $id_ciclo, $id_nivel, $id_grupo){\r\n\t\t////// CONFIGURACION ESPECIFICA COLEGIO YUCATAN ////// DIAS DE APLICACION DESC\r\n\t\t$dia_ini_yuc=1;\r\n\t\t$dia_fin_yuc=9;\r\n\t\t$dia_pago_yuc=8;\r\n\t\r\n\t\t\r\n\t\t$str_ciclo = \"SELECT * FROM ciclos WHERE id_ciclo = '\".$id_ciclo.\"'\";\r\n\t\t$sql_ciclo = $this->EjecutarConsulta($str_ciclo);\r\n\t\t$arr_ciclo = mysql_fetch_array($sql_ciclo);\r\n\t\t\r\n\t\t$a1 = split(\"-\",$arr_ciclo['fecha_ini']); \r\n\t\t$anio1 = $a1[0];\r\n\t\t$a2 = split(\"-\",$arr_ciclo['fecha_fin']); \r\n\t\t$anio2 = $a2[0]; \r\n\t\t$m_fin_ciclo = $a2[1];\r\n\t\t$fin_ciclo = $arr_ciclo['fecha_fin']; \r\n\t\t\r\n\t\t// ------------------------ SACAR NIVEL, GRADO -------------------------------------------- //\t\r\n\t\t$str_nivel = \"SELECT g.id_grupo, g.id_nivel,g.grado FROM alumno_grupo ag INNER JOIN grupos g ON g.id_grupo = ag.id_grupo \r\n\t\t\t\t\t WHERE ag.id_alumno = \".$id_alumno.\" AND g.id_ciclo = \".$id_ciclo;\r\n\t\t$sql_nivel = $this->EjecutarConsulta($str_nivel);\r\n\t\t$arr_nivel = mysql_fetch_array($sql_nivel);\r\n\t\t$id_nivel = $arr_nivel['id_nivel'];\r\n\t\t$id_grupo = $arr_nivel['id_grupo'];\r\n\t\t$grado = $arr_nivel['grado'];\r\n\r\n\t\t$str_meses_pagar = \"SELECT m.mes, (SELECT DATE_FORMAT(CONCAT('0000-',m.mes,'-00'),'%b') FROM boleta_pago b WHERE b.id_alumno = \".$id_alumno.\" AND b.id_grupo='\".$id_grupo.\"') AS mes_boleta FROM meses_pagar m where m.id_ciclo = \".$id_ciclo.\" ORDER BY m.id ASC\";\r\n\t\t//echo $str_meses_pagar;\r\n\t\t$sql_meses_pagar = $this->EjecutarConsulta($str_meses_pagar);\r\n\t\t$num_meses_a_pagar = mysql_num_rows($sql_meses_pagar);\r\n\t\t$c=0;\t$i=0;\r\n\t\twhile($rwm=mysql_fetch_array($sql_meses_pagar)){\t\t\t\r\n\t\t\t$day=1; $month=$rwm[\"mes\"]; \r\n\t\t\tif((int)$month >= 8 && (int)$month <= 12){ $year = $anio1; }else{ $year = $anio2;\t}\r\n\t\t\t\r\n\t\t\t// -------------------- CUOTA DE COLEGIATURA POR MES ------------------- //\t\t\r\n\t\t\t$str_cuota = \"SELECT c.importe, c.descrip AS concepto, cm.id_conce_mes, cm.estatus AS pagado\r\n\t\t\t\t\t\t\tFROM conceptos_alumnos ca \r\n\t\t\t\t\t\t\tINNER JOIN conceptos_alumnos_mes cm On cm.id_concepto_alumno=ca.id\r\n\t\t\t\t\t\t\tINNER JOIN conceptos_nivel cn ON ca.id_concepto_nivel=cn.id_concepto_nivel \r\n\t\t\t\t\t\t\tINNER JOIN conceptos c ON c.id_concepto = cn.id_concepto \r\n\t\t\t\t\t\t\tWHERE cn.tipo_c = '04' \r\n\t\t\t\t\t\t\tAND cn.id_ciclo = '\".$id_ciclo.\"'\r\n\t\t\t\t\t\t\tAND cn.id_nivel = '\".$id_nivel.\"' \r\n\t\t\t\t\t\t\tAND cn.grado = '\".$grado.\"'\r\n\t\t\t\t\t\t\tAND ca.id_alumno = '\".$id_alumno.\"'\r\n\t\t\t\t\t\t\tAND cm.mes='\".$rwm[\"mes\"].\"'\";\r\n\t\t\t$sql_cuota = $this->EjecutarConsulta($str_cuota);\r\n\t\t\t$arr_cuota = mysql_fetch_array($sql_cuota);\t\tmysql_free_result($sql_cuota);\r\n\t\t\t$importe_cuota=$arr_cuota['importe'];\r\n\r\n\t\t\t$mes_es=date(\"M\",mktime(0,0,0,$month,1,date(\"Y\"))); \r\n\t\t\t$q_b=$this->EjecutarConsulta(\"SELECT `\".$mes_es.\"` AS pagado FROM boleta_pago WHERE id_alumno='\".$id_alumno.\"' AND id_grupo='\".$id_grupo.\"'\");\r\n\t\t\t$rw_boleta=mysql_fetch_array($q_b);\r\n\t\t\t$pagado_mes=$rw_boleta[\"pagado\"];\r\n\t\t\t// ------------------------------- FIN CUOTA -----------------------------//\r\n\r\n\t\t\t//---- CUOTAS PROGRAMADAS POR CONFIG. CAJA ----///\r\n\t\t\t$cuota_extra=0;\t\t$concepto_cuota_extra=\"\";\r\n\t\t\t$str_cargos_caja = \"SELECT * FROM conceptos_configurables \r\n\t\t\t\t\t\tWHERE id_ciclo = '\".$id_ciclo.\"' AND (id_nivel = '\".$id_nivel.\"' OR id_nivel = 0) \r\n\t\t\t\t\t\tAND (grado ='\".$grado.\"' OR grado = '0') \r\n\t\t\t\t\t\tAND tipo_c = 'C' AND aplicar_por='3'\";\r\n\t\t\t//echo $str_cargos_caja.\"<br />\";\t\t\t\t\t\t\r\n\t\t\t$sql_cargos_caja = $this->EjecutarConsulta($str_cargos_caja); $ccc=0;\r\n\t\t\twhile($arr_cargos_caja = mysql_fetch_array($sql_cargos_caja)){\r\n\t\t\t\t$l = 0;\r\n\t\t\t\tif($m >= 8 && $m <= 12){ $anio = $anio1;\t}else{ \t\t$anio = $anio2;\t\t\t}\r\n\t\t\t\t$ma = mktime(0,0,0,$month, $day, $year); /// FECHA DEL DIA DE HOY\r\n\t\t\t\t$mp = mktime(0,0,0,$m,date(\"t\",mktime(0,0,0,$m,1,$anio)),$anio); //// MES A PAGAR FECHA DEL ULTIMO DIA DEL MES\r\n\t\t\t\t\r\n\t\t\t\tif($arr_cargos_caja[\"tipo_imp\"] != 'pesos'){ \r\n\t\t\t\t\t$importe = ($importe_cuota * $arr_cargos_caja[\"importe\"])/100; \r\n\t\t\t\t}else{ \r\n\t\t\t\t\t$importe = $arr_cargos_caja[\"importe\"];\r\n\t\t\t\t}\r\n\t\t\t\tif($arr_cargos_caja['aplicar_por'] == '3'){\r\n\t\t\t\t\tif($m==$arr_cargos_caja[\"N\"]){\r\n\t\t\t\t\t\t$cuota_extra = $importe;\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t$concepto_cuota_extra = $arr_cargos_caja[\"concepto\"];\r\n\t\t\t\t\t\t$ccc++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif($concepto_cuota_extra!=\"\"){\t$concepto[$i].=\" Y \".strtoupper($concepto_cuota_extra);\t}\r\n\t\t\t$importe_cuota+=$cuota_extra;\r\n\t\t\t/// FIN CUOTA EXTRA ////\t\t\t\r\n\t\t\t\r\n\t\t\t// ------------------------ DESCUENTOS ------------------//\t\t\r\n\t\t\t$band=0;\r\n\t\t\t$str_descuentos = \"SELECT cn.id_concepto_nivel, c.descrip AS concepto, c.tipo_importe, c.importe, cm.id_conce_mes \r\n\t\t\t\t\t\t\t FROM conceptos_alumnos ca \r\n\t\t\t\t\t\t\t LEFT JOIN conceptos_alumnos_mes cm ON cm.id_concepto_alumno=ca.id \r\n\t\t\t\t\t\t\t LEFT JOIN conceptos_nivel cn ON ca.id_concepto_nivel = cn.id_concepto_nivel \r\n\t\t\t\t\t\t\t LEFT JOIN conceptos c ON c.id_concepto = cn.id_concepto \r\n\t\t\t\t\t\t\t WHERE cn.tipo_c = '02' AND ca.id_alumno = '\".$id_alumno.\"' AND cn.id_ciclo = '\".$id_ciclo.\"' AND cn.id_nivel = '\".$id_nivel.\"' \r\n\t\t\t\t\t\t\t AND (cn.grado = '\".$grado.\"' OR cn.grado = 0) AND c.tipo = 'D' AND cm.mes='\".$rwm[\"mes\"].\"'\";\t\r\n\t\t\t//echo $str_descuentos.\"<br />\";\r\n\t\t\t$fecha_actual = mktime(0,0,0,$month,$day,$year);\r\n\t\t\tif($m >= 8 && $m <= 12){ \t$anio = $anio1;\t}else{ \t$anio = $anio2;\t}\r\n\t\t\t$fecha_final_mes = mktime(0,0,0,$m,$dia_fin_yuc,$anio);\r\n\t\t\t\r\n\t\t\tif($fecha_actual<=$fecha_final_mes){\r\n\t\t\t\t$sql_descuentos = $this->EjecutarConsulta($str_descuentos);\r\n\t\t\t\t$q = 0;\r\n\t\t\t\t$sum_descuentos = 0;\r\n\t\t\t\twhile($arr_descuentos = mysql_fetch_array($sql_descuentos)){\r\n\t\t\t\t\tif($arr_descuentos['tipo_importe'] != 'pesos'){ \r\n\t\t\t\t\t\t$importe = ($importe_cuota * $arr_descuentos['importe'])/100;\r\n\t\t\t\t\t}else{ \r\n\t\t\t\t\t\t$importe = $arr_descuentos['importe'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$sum_descuentos += $importe; \r\n\t\t\t\t\t$band=1;\r\n\t\t\t\t\t$q++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//$descuentos[$i]=$sum_descuentos;\r\n\t\t\t/// FIN DESCUENTOS CUOTA ///\r\n\r\n\t\t\t// ------------------------ BECAS ------------------//\t\t\r\n\t\t\t$str_becas = \"SELECT cn.id_concepto_nivel, c.descrip AS concepto, c.tipo_importe, c.importe, cm.id_conce_mes \r\n\t\t\t\t\t\t\t FROM conceptos_alumnos ca \r\n\t\t\t\t\t\t\t LEFT JOIN conceptos_alumnos_mes cm ON cm.id_concepto_alumno=ca.id \r\n\t\t\t\t\t\t\t LEFT JOIN conceptos_nivel cn ON ca.id_concepto_nivel = cn.id_concepto_nivel \r\n\t\t\t\t\t\t\t LEFT JOIN conceptos c ON c.id_concepto = cn.id_concepto \r\n\t\t\t\t\t\t\t WHERE cn.tipo_c = '02' AND ca.id_alumno = '\".$id_alumno.\"' \r\n\t\t\t\t\t\t\t AND cn.id_ciclo = '\".$id_ciclo.\"' AND cn.id_nivel = '\".$id_nivel.\"' \r\n\t\t\t\t\t\t\t AND (cn.grado = '\".$grado.\"' OR cn.grado = 0) AND c.tipo = 'B' AND cm.mes='\".$rwm[\"mes\"].\"'\";// AND ca.estatus = '0'\r\n\t\t\t$sql_becas = $this->EjecutarConsulta($str_becas);\r\n\t\t\t$q = 0;\r\n\t\t\t$sum_becas = 0;\t$band2=0;\r\n\t\t\twhile($arr_becas = mysql_fetch_array($sql_becas)){\r\n\t\t\t\tif($arr_becas['tipo_importe'] != 'pesos'){ \r\n\t\t\t\t\t$importe = ($importe_cuota * $arr_becas['importe'])/100;\r\n\t\t\t\t}else{ \r\n\t\t\t\t\t$importe = $arr_becas['importe'];\r\n\t\t\t\t}\r\n\t\t\t\t$sum_becas += $importe; \r\n\t\t\t\t$q++;\r\n\t\t\t\t$band2=1;\r\n\t\t\t}\r\n\t\t\t$becas=$sum_becas;\r\n\t\t\t//// FIN BECAS CUOTA\t////\r\n\t\t\t\r\n\t\t\t// ------------------------ DESCUENTOS CONCEPTOS CONFIGURABLES ------------- //\t\t\r\n\t\t\t$str_desc_caja = \"SELECT * FROM conceptos_configurables \r\n\t\t\t\t\t\t\t WHERE id_ciclo = '\".$id_ciclo.\"' AND (id_nivel = '\".$id_nivel.\"' OR id_nivel = 0) \r\n\t\t\t\t\t\t\t AND (grado = '\".$grado.\"' OR grado = 0) \r\n\t\t\t\t\t\t\t AND tipo_c = 'D' ORDER BY if(aplicar_por = '2',N,id_config) ASC\";\r\n\t\t\t//echo $str_desc_caja.\"<br />\";\r\n\t\t\t$cuota = $importe_cuota;\r\n\t\t\t$sum_desc_caja = 0;//$sum_descuentos;\t\t\t\t\t\t\t\t//Total a aplicar en formula para conceptos q sean tipo porcentaje, pudiera ser solo la cuota, \r\n\t\t\t$total_cuota_desc = $cuota - $sum_descuentos;\t//+ $sum_cargos\t\t//depende de la forma como la escuela lo quiera manejar\t\r\n\t\t\t\r\n\t\t\tif($band==0 && $band2==0){/// SI HAY DESC NO APLICA OPORTUNOS\t\t\t\r\n\t\t\t\t$sql_desc_caja = $this->EjecutarConsulta($str_desc_caja);\r\n\t\t\t\twhile($arr_desc_caja = mysql_fetch_array($sql_desc_caja)){\r\n\t\t\t\t\t$aplicar_por = $arr_desc_caja['aplicar_por'];\r\n\t\t\t\t\tif($aplicar_por == '0'){\t//Por Periodo (Dia inicial - Dia final) de cada mes\r\n\t\t\t\t\t\t// ---- fecha actual --- //\r\n\t\t\t\t\t\t$fecha_actual = mktime(0,0,0,$month,$day,$year); /// FECHA DE PAGO\r\n\t\t\t\t\t\t// ---- fecha inicial y fincal ---- //\r\n\t\t\t\t\t\tif($m >= 8 && $m <= 12){ \r\n\t\t\t\t\t\t\t$anio = $anio1;\t\r\n\t\t\t\t\t\t}else{ \r\n\t\t\t\t\t\t\t$anio = $anio2;\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$fecha_inicial = mktime(0,0,0,$m,$arr_desc_caja['dia_ini'],$anio);\r\n\t\t\t\t\t\t$fecha_final = mktime(0,0,0,$m,$arr_desc_caja['dia_fin'],$anio);\r\n\t\t\t\t\t\tif(($fecha_inicial <= $fecha_actual && $fecha_actual <= $fecha_final) || ($fecha_actual<=$fecha_inicial)){ \r\n\t\t\t\t\t\t\tif($arr_desc_caja['tipo_imp'] != 'pesos'){ \r\n\t\t\t\t\t\t\t\t$importe_desc_caja = ($total_cuota_desc * $arr_desc_caja['importe'])/100; \r\n\t\t\t\t\t\t\t}else{ \r\n\t\t\t\t\t\t\t\t$importe_desc_caja = $arr_desc_caja['importe'];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$sum_desc_caja = $sum_desc_caja + $importe_desc_caja;\r\n\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\t$sum_desc_caja_aux = $sum_desc_caja;\r\n\t\t\t$tot_descuentos = $sum_desc_caja_aux+$sum_descuentos;\r\n\t\t\t$descuentos=$tot_descuentos;\r\n\t\t\t// ----------- FIN DESCUENTOS CAJA ------------------ //\r\n\r\n\t\t\t\r\n\t\t\t// ------------ PAGOS REALIZADOS CUOTA---------- //\t\t\t\r\n\t\t\t$str_pagos = \"SELECT r.id_factura, d.descrip, d.importe, r.fecha_cobro \r\n\t\t\t\t\t\t FROM recibos_conceptos d \r\n\t\t\t\t\t\t\tLEFT JOIN recibos r ON d.id_factura = r.id_factura \r\n\t\t\t\t\t\t\tWHERE r.tipo_r = '02' \r\n\t\t\t\t\t\t\tAND r.id_alumno = '\".$id_alumno.\"' \r\n\t\t\t\t\t\t\tAND r.id_ciclo = '\".$id_ciclo.\"' \r\n\t\t\t\t\t\t\tAND r.estado = 'P' \r\n\t\t\t\t\t\t\tAND d.id_conce_mes='\".$arr_cuota['id_conce_mes'].\"'\r\n\t\t\t\t\t\t\tGROUP BY r.id_factura \r\n\t\t\t\t\t\t ORDER BY r.fecha_cobro DESC\";\r\n\t\t\t//echo $str_pagos.\"<br />\";\r\n\t\t\t$sql_pagos = $this->EjecutarConsulta($str_pagos);\r\n\t\t\t$PAGOS=0;\t$suma_conce_pagos=0;\t$band=0;\t$suma_pagos_es=0;\r\n\t\t\t$desc_pagados=0; \t$desc_caja_pagados=0;\t$becas_pagados=0;\t$cargos_caja_pagados=0;\r\n\t\t\twhile($arr_pagos = mysql_fetch_array($sql_pagos)){\r\n\t\t\t\t$importe_pagos=$arr_pagos[\"importe\"];\r\n\t\t\t\t$PAGOS += $importe_pagos;\r\n\t\t\t\t$fp=split(\"-\",$arr_pagos[\"fecha_cobro\"]);\r\n\t\t\t\tif($m >= 8 && $m <= 12){ $anio = $anio1;\t}else{ \t$anio = $anio2;\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$fecha_actual=mktime(0,0,0,$month,$day,$year);\r\n\t\t\t\t$tolera_mes = mktime(0,0,0,$m,$dia_fin_yuc,$anio);\r\n\t\t\t\t$fecha_pago_es = mktime(0,0,0,$fp[1],$fp[2],$fp[0]);\r\n\t\t\t\t//echo date(\"d/m/Y\",$fecha_actual).\" \".date(\"d/m/Y\",$tolera_mes).\" \".date(\"d/m/Y\",$fecha_pago_es);\r\n\t\t\t\tif($fecha_pago_es<=$tolera_mes && $tolera_mes<$fecha_actual){\r\n\t\t\t\t\t$sql=$this->EjecutarConsulta(\"SELECT * FROM recibos_conceptos WHERE id_factura='\".$arr_pagos[\"id_factura\"].\"' AND tipo!='C'\");\r\n\t\t\t\t\twhile($rw_pagos=mysql_fetch_array($sql)){\r\n\t\t\t\t\t\t$suma_pagos_es+=$importe_pagos;\r\n\t\t\t\t\t\tif($rw_pagos[\"tipo\"]==\"D\"){\t\t$desc_pagados+=((-1)*$rw_pagos[\"importe\"]);\t\t\t}\r\n\t\t\t\t\t\tif($rw_pagos[\"tipo\"]==\"DC\"){\t$desc_caja_pagados+=((-1)*$rw_pagos[\"importe\"]);\t}\r\n\t\t\t\t\t\tif($rw_pagos[\"tipo\"]==\"B\"){ \t$becas_pagados+=((-1)*$rw_pagos[\"importe\"]);\t\t}\r\n\t\t\t\t\t\tif($rw_pagos[\"tipo\"]==\"C\" || $rw_pagos[\"tipo\"]==\"CC\"){\r\n\t\t\t\t\t\t\t$cargos_caja_pagados+=$rw_pagos[\"importe\"];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$band=1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//echo $band.\" \".$desc_pagados.\" \".$desc_caja_pagados.\"<br />\";\r\n\t\t\t$abonos=$PAGOS;\r\n\t\t\tif($band==1){\r\n\t\t\t\t//$pp_cuota=(($arr_cuota['importe']-($desc_pagados+$desc_caja_pagados))+$cargos_caja_pagados)-$suma_pagos_es;\r\n\t\t\t\t$pp_cuota=(($importe_cuota-($desc_pagados+$desc_caja_pagados))+$cargos_caja_pagados)-$suma_pagos_es;\r\n\t\t\t\tif($pp_cuota<=$suma_pagos_es){ \r\n\t\t\t\t\t$band=2;\t\r\n\t\t\t\t\t$descuentos+=($desc_pagados+$desc_caja_pagados);\r\n\t\t\t\t\t$becas+=$becas_pagados;\r\n\t\t\t\t\t$atrasos=$cargos_caja_pagados;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$sum_descuentos+=$desc_pagados; \r\n\t\t\t\t\t$sum_becas+=$becas_pagados; \r\n\t\t\t\t\t$sum_desc_caja_aux+=$desc_caja_pagados;\r\n\t\t\t\t\t$sum_cargos_caja+=$cargos_caja_pagados;\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t\t\r\n\t\t\t$cant_pagar_mes=(($importe_cuota-$sum_descuentos-$sum_becas-$sum_desc_caja_aux)+$sum_cargos_caja)-$PAGOS;\r\n\t\t\t//echo $cant_pagar_mes.\"= ((\".$arr_cuota['importe'].\"-$sum_descuentos-$sum_becas-$sum_desc_caja_aux)+$sum_cargos_caja))-$PAGOS<br /><br />\";\r\n\t\t\t$i++; \t\t\t\r\n\t\t\tif($cant_pagar_mes<=0){ \r\n\t\t\t\t$q_b=$this->EjecutarConsulta(\"UPDATE boleta_pago SET `\".$mes_es.\"`='1' WHERE id_alumno='\".$id_alumno.\"' AND id_grupo='\".$id_grupo.\"'\");\r\n\t\t\t}elseif($pagado_mes==0){\r\n\t\t\t\t$q_b=$this->EjecutarConsulta(\"UPDATE boleta_pago SET `\".$mes_es.\"`='0' WHERE id_alumno='\".$id_alumno.\"' AND id_grupo='\".$id_grupo.\"'\");\r\n\t\t\t}\r\n\t\t\t$cant_pagar_mes=0;\r\n\r\n\t\t// --------- -- FIN PAGOS REALIZADOS CUOTA------- //\r\n\t\t}\r\n\t}", "public function verGrupo($idGrupo=-1){\n\t\tif($idGrupo>-1){\n\t\t\t$grupo = $this->didaktikappDao->getGrupo($idGrupo);\n\t\t\t$grupo->actividades = (object)[];\n\t\t\tif(strlen($grupo->idAct1)>0){\n\t\t\t\t$grupo->actividades->act1 = $this->didaktikappDao->getAct1($grupo->idAct1);\n\t\t\t}\n\t\t\tif(strlen($grupo->idAct2)>0){\n\t\t\t\t$grupo->actividades->act2 = $this->didaktikappDao->getAct2($grupo->idAct2);\n\t\t\t}\n\t\t\tif(strlen($grupo->idAct3)>0){\n\t\t\t\t$grupo->actividades->act3 = $this->didaktikappDao->getAct3($grupo->idAct3);\n\t\t\t\t$grupo->actividades->act3->foto1 = base64_encode($grupo->actividades->act3->foto1);\n\t\t\t\t$grupo->actividades->act3->foto2 = base64_encode($grupo->actividades->act3->foto2);\n\t\t\t\t$grupo->actividades->act3->foto3 = base64_encode($grupo->actividades->act3->foto3);\n\t\t\t}\n\t\t\tif(strlen($grupo->idAct4)>0){\n\t\t\t\t$grupo->actividades->act4 = $this->didaktikappDao->getAct4($grupo->idAct4);\n\t\t\t}\n\t\t\tif(strlen($grupo->idAct5)>0){\n\t\t\t\t$grupo->actividades->act5 = $this->didaktikappDao->getAct5($grupo->idAct5);\n\t\t\t\t$grupo->actividades->act5->foto1 = base64_encode($grupo->actividades->act5->foto1);\n\t\t\t\t$grupo->actividades->act5->foto2 = base64_encode($grupo->actividades->act5->foto2);\n\t\t\t}\n\t\t\tif(strlen($grupo->idAct6)>0)$grupo->actividades->act6 = $this->didaktikappDao->getAct6($grupo->idAct6);\n\t\t\t$data['grupo'] = $grupo;\n\t\t\t$this->load->view('grupo',$data);\n\t\t}\n\t}", "function ultimoGrupoCreado($arregloDatos) \n\n {\n\n $sql=\" SELECT max(grupo) as cantidad\n\n FROM inventario_declaraciones\n\n WHERE cod_maestro =$arregloDatos[id_levante]\"; \n\n \n\n $this->query($sql);\n\n if($this->_lastError) {\n\n echo $sql;\n\n return TRUE;\n\n }\n\n \n\n $this->fetch();\n\n $arregloDatos[cuenta_grupos]=$this->cantidad;\n\n return $arregloDatos[cuenta_grupos];\n\n }", "function comparacio_mitjana_grup($mitjana_arrodonida, $mitjana_grup_arrodonida){\n if($mitjana_arrodonida == \"N/P\"){\n $comparacio_mitjana_grup = \"N/P\"; \n }else if($mitjana_arrodonida == $mitjana_grup_arrodonida){\n $comparacio_mitjana_grup = \"=\";\n }else if($mitjana_arrodonida > $mitjana_grup_arrodonida){\n $comparacio_mitjana_grup = \"+\";\n }else if($mitjana_arrodonida < $mitjana_grup_arrodonida){\n $comparacio_mitjana_grup = \"-\";\n }\n // Devuelve la comparacion de la media del grupo\n return $comparacio_mitjana_grup;\n }", "public function Npcatpre_Almsolegr($mascara=array()) {\n //Cambios Solicitado por Monagas\n $fornumuni = \"\";\n $varemp = sfContext::getInstance()->getUser()->getAttribute('configemp');\n if ($varemp)\n if (array_key_exists('aplicacion', $varemp))\n if (array_key_exists('compras', $varemp['aplicacion']))\n if (array_key_exists('modulos', $varemp['aplicacion']['compras']))\n if (array_key_exists('almsolegr', $varemp['aplicacion']['compras']['modulos'])) {\n if (array_key_exists('fornumuni', $varemp['aplicacion']['compras']['modulos']['almsolegr'])) {\n $fornumuni = $varemp['aplicacion']['compras']['modulos']['almsolegr']['fornumuni'];\n }\n }\n $loguse = sfContext::getInstance()->getUser()->getAttribute('loguse');\n\n if (array_key_exists('1', $mascara))\n $mask2 = $mascara[1];\n else\n $mask2 = \"\";\n\n\n $mask = $mascara[0];\n $this->c = new Criteria();\n if ($fornumuni == 'S' && $mask2 == 'almsolegr') {\n $this->sql = \"length(npcatpre.codcat) = '\" . $mask . \"' and npcatpre.codcat in (select codcat from causuuni where loguse='\" . $loguse . \"')\";\n } else {\n $this->sql = \"length(CodCat) = '\" . $mask . \"'\";\n }\n\n $categoriasusu = sfContext::getInstance()->getUser()->getAttribute('categoriasusu');\n if ($categoriasusu != '') {\n $aux = explode('*', $categoriasusu);\n for ($a = 0; $a < count($aux); $a++) {\n if ($a == 0)\n $this->sql = $this->sql . \" and (\" . NpcatprePeer::CODCAT . \" like '\" . $aux[$a] . \"%' \";\n else if ($a == (count($aux) - 1))\n $this->sql = $this->sql . \" or \" . NpcatprePeer::CODCAT . \" like '\" . $aux[$a] . \"%' \";\n else\n $this->sql = $this->sql . \" or \" . NpcatprePeer::CODCAT . \" like '\" . $aux[$a] . \"%'\";\n }\n $this->sql = $this->sql . \")\";\n }\n $this->c->add(NpcatprePeer :: CODCAT, $this->sql, Criteria :: CUSTOM);\n // $this->c->addAscendingOrderByColumn(NpcatprePeer::CODCAT);\n\n $this->columnas = array(\n NpcatprePeer :: CODCAT => 'Código',\n NpcatprePeer :: NOMCAT => 'Descripción'\n );\n }", "function buscarHorarioGrupo() {\n $variables=array(array('CODIGO'=>$this->datosInscripcion['codEspacio'],\n 'GRUPO'=>$this->datosInscripcion['grupo']));\n $horarioGrupo=$this->procedimientos->buscarHorario($variables);\n return $horarioGrupo;\n }", "public function hasGroup(): bool;", "function has_cargo($user, $cargos = null){\n if (!$cargos)\n $cargos = array();\n\n $res = false;\n $ucargos = $user->cargos;\n \n foreach ($ucargos as $cargo){\n foreach ($cargos as $requerido){\n if ($cargo->codigo == $requerido){\n $res = true;\n break;\n }\n }\n if ($res)\n break;\n }\n return $res;\n}", "function tieneCursosAsignados($idAlumno)\n{\n $arrayCursosPILA = getArraysIdsRelCursoGrupo($idAlumno);\n $arrayCursos = array_pop($arrayCursosPILA);\n \n //echo count( $arrayCursosPILA );\n if( count( $arrayCursos ) > 0)\n return true;\n return false;\n \n}", "function bbp_group_is_creator()\n{\n}", "function LisGrupoUsuario($nombre) {\n $ocado = new cado();\n $sql = \"select * from conf_usuario_grupo where estado=0 and nombre like '$nombre%' order by nombre asc\";\n $ejecutar = $ocado->ejecutar($sql);\n return $ejecutar;\n }", "function bbp_group_is_member()\n{\n}", "function crearEnlaceCambioUno($estilo, $disponibles, $cruce, $resultado_grupos, $icono) {\n if(isset($_REQUEST['grupo'])&&$_REQUEST['grupo']!=0)\n {\n $mensajeEnlace='cambiar';\n }else\n {\n $mensajeEnlace='adicionar';\n $_REQUEST['grupo']=0;\n }\n ?><td class='<? echo $estilo ?>'<? if ($disponibles <= '0' || $cruce != 'ok') {?>bgColor='#F8E0E0'<? } ?>>\n <?\n if ($cruce == 'ok') {\n //si no hay cupo en grupo\n if($disponibles==='a')\n {\n ?>No se puede <?echo $mensajeEnlace;\n }elseif($disponibles<=0)\n {\n ?>No hay cupos disponibles<?\n }\n elseif($disponibles>0)\n {\n $pagina = $this->configuracion[\"host\"] . $this->configuracion[\"site\"] . \"/index.php?\";\n $variables = \"pagina=\".$_REQUEST['destino'];\n $variables.=\"&opcion=inscribirEspacio\";\n $variables.=\"&action=\".$_REQUEST['destino'];\n $variables.=\"&retorno=\".$_REQUEST['retorno'];\n $variables.=\"&opcionRetorno=\".$_REQUEST['opcionRetorno'];\n\n $parametros = \"&codProyecto=\" . $_REQUEST['codProyecto'];\n $parametros.=\"&planEstudio=\" . $_REQUEST['planEstudio'];\n $parametros.=\"&codEstudiante=\" . $_REQUEST['codEstudiante'];\n $parametros.=\"&codProyectoEstudiante=\" . (isset($_REQUEST['codProyectoEstudiante'])?$_REQUEST['codProyectoEstudiante']:'');\n $parametros.=\"&planEstudioEstudiante=\" . (isset($_REQUEST['planEstudioEstudiante'])?$_REQUEST['planEstudioEstudiante']:'');\n $parametros.=\"&estado_est=\" . trim($_REQUEST['estado_est']);\n $parametros.=\"&codEspacio=\" . $_REQUEST['codEspacio'];\n $parametros.=\"&nombreEspacio=\" . $_REQUEST['nombreEspacio'];\n $parametros.=\"&creditos=\" . (isset($_REQUEST['creditos'])?$_REQUEST['creditos']:'');\n $parametros.=\"&grupo=\" . $resultado_grupos['GRUPO'];\n $parametros.=\"&cupo=\" . $resultado_grupos['CUPO'];\n $parametros.=\"&carrera=\" . $resultado_grupos['CARRERA'];\n $parametros.=\"&grupoAnterior=\".$_REQUEST['grupo'];\n\n $variable = $variables . $parametros;\n\n include_once($this->configuracion[\"raiz_documento\"] . $this->configuracion[\"clases\"] . \"/encriptar.class.php\");\n $this->cripto = new encriptar();\n $variable= $this->cripto->codificar_url($variable, $this->configuracion);\n\n ?> <button class=\"botonEnlacePreinscripcion\" onclick=\"window.location = \n '<?\n echo $pagina . $variable;\n ?>'\n \"><center><img src=\"<? echo $this->configuracion[\"site\"] . $this->configuracion[\"grafico\"] . \"/clean.png\" ?>\" border=\"0\" width=\"25\" height=\"25\">\n </button>\t\t\t\t\t\n <?\n }else\n {\n ?>No se puede <?echo $mensajeEnlace;\n }\n ?>\n </td>\n <?\n } else {\n ?>\n No se puede <?echo $mensajeEnlace;?>. Presenta cruce.\n </td>\n <? }\n }", "public function getCupo()\r\n {\r\n return $this->cupo;\r\n }", "function cambiar() {\n $this->buscarGrupo();\n }", "function classe_existante($niveau, $groupe)\n{\n\tinclude'./inc/db.php';\n\t$classe_existe = false;\n\t\n\t$classes = $bdd->prepare('SELECT niveau, groupe FROM classes WHERE niveau= ? AND groupe = ?');\n\t$classes->execute(array($niveau, $groupe));\n\t$donnees_classes = $classes ->fetch();\n\t\n\tif($donnees_classes){\n\t\t$classe_existe = true;\n\t}\n\t\n\treturn $classe_existe;\t\n}", "function tieneCursosAsignadosScorm($idAlumno)\n{\n $arrayCursosPILA = @getArraysIdsRelCursoGrupoScorm($idAlumno);\n $arrayCursos = array_pop($arrayCursosPILA);\n \n //echo count( $arrayCursosPILA );\n if( count( $arrayCursos ) > 0)\n return true;\n return false;\n \n}", "public function isGroup(): bool\n {\n }", "function ultimoGrupo($arregloDatos) \n\n {\n\n $sql=\" SELECT lev_cuenta_grupo as cantidad\n\n FROM inventario_maestro_movimientos\n\n WHERE codigo =$arregloDatos[id_levante]\"; \n\n $this->query($sql);\n\n if($this->_lastError) {\n\n echo\n\n $sql;\n\n return TRUE;\n\n }\n\n \n\n $this->fetch();\n\n $arregloDatos[cuenta_grupos]=$this->cantidad;\n\n return $arregloDatos[cuenta_grupos];\n\n //echo \"xxx\";\n\n }" ]
[ "0.63402075", "0.62155175", "0.5884203", "0.58563375", "0.5763133", "0.5763133", "0.5760482", "0.5760482", "0.5646103", "0.55742174", "0.5554807", "0.5546044", "0.5543554", "0.55332047", "0.5512109", "0.54982394", "0.5497486", "0.54972285", "0.5466694", "0.5456579", "0.5434565", "0.54275185", "0.54244876", "0.54125947", "0.54100686", "0.53979534", "0.5381654", "0.53812414", "0.5380783", "0.53803796" ]
0.6807956
1
Funcion que verifica si el espacio academico pertenece al plan de estudios del estudiante
function verificarEspacioPlan($retorno) { //verifica si el espacio pertenece al plan de estudios del estudiante $planEstudio=$this->validacion->validarEspacioPlan($_REQUEST); if($planEstudio!='ok') { $retorno['mensaje']="El espacio academico no pertenece al plan de estudios del estudiante."; $this->enlaceNoAdicion($retorno); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verificarInscrito($retorno,$espaciosInscritos) {\n //verifica si el espacio ya ha sido inscrito\n $inscrito='ok';\n foreach ($espaciosInscritos as $inscritos) {\n if($inscritos['CODIGO']==$this->datosInscripcion['codEspacio'])\n {\n $inscrito=$inscritos['GRUPO'];\n break;\n }\n }\n if($inscrito!='ok')\n {\n $retorno['mensaje']=\"El espacio académico ya esta inscrito en el grupo \".$inscrito.\" para el periodo actual. No se puede inscribir de nuevo.\";\n $this->enlaceNoAdicion($retorno);\n }\n }", "function verificarInscrito($retorno,$espaciosInscritos) {\n //verifica si el espacio ya ha sido inscrito\n $inscrito='ok';\n foreach ($espaciosInscritos as $inscritos) {\n if($inscritos['CODIGO']==$this->datosInscripcion['codEspacio'])\n {\n $inscrito=$inscritos['GRUPO'];\n break;\n }\n }\n if($inscrito!='ok')\n {\n $retorno['mensaje']=\"El espacio académico ya esta inscrito en el grupo \".$inscrito.\" para el periodo actual. No se puede inscribir de nuevo.\";\n $this->enlaceNoAdicion($retorno);\n }\n }", "public function disponibilitePlacePlanche() {\n\t\treturn ($this->nbPlacesPlanchesTotal() - $this->_nbrPlanchesBooked) >= 1;\n\t}", "function esValidoAniodelPlan($anioInicio, $anioFin, $anioI = NULL , $anioF = NULL) { \n // obtenemos planes de la carrera\n //$planes = $this->getPlanesSegunCarrera($codCarrera);\n $planes = $this->getPlanesDeEstudio();\n \n if (is_null($planes)){\n return TRUE; // no hay planes de estudio de la carrera por lo que el plan es valido\n } else {\n \n $anioActual = date(\"Y\");\n $anios = array();\n for ($i = 1995; $i <= ($anioActual+1); $i++) {\n $anios[$i] = \"Disponible\";\n }\n \n foreach ($planes as $plan) {\n \n// if (is_null($plan->getAnio_fin())){\n// $anios[$anioActual] = \"No disponible\"; // seteamos como no disponible el anio siguiente al anio actual\n// } else {\n \n if (is_null($plan->getAnio_fin())){\n for ($index = $plan->getAnio_inicio(); $index <= ($anioActual+1); $index++) {\n $anios[$index] = \"No Disponible\";\n }\n } else {\n for ($index = $plan->getAnio_inicio(); $index <= $plan->getAnio_fin(); $index++) {\n $anios[$index] = \"No Disponible\";\n }\n }\n \n \n \n //}\n \n }\n \n \n }\n \n // validamos si no es NULL las variables anioI y anioF --> se utiliza para la modificacion de un plan\n if (!is_null($anioI)) {\n if (is_null($anioF)) {\n for ($index = $anioI; $index <= ($anioActual + 1); $index++) {\n $anios[$index] = \"Disponible\";\n }\n } else {\n for ($index = $anioI; $index <= $anioF; $index++) {\n $anios[$index] = \"Disponible\";\n }\n }\n }\n\n\n //procedemos a validar los anios enviados por parametros\n \n if (is_null($anioFin)){\n for ($index1 = $anioInicio; $index1 <= ($anioActual+1); $index1++) {\n if ($anios[$index1] == \"No Disponible\"){\n return FALSE;\n }\n }\n }else {\n for ($index1 = $anioInicio; $index1 <= $anioFin; $index1++) {\n if ($anios[$index1] == \"No Disponible\"){\n return FALSE;\n }\n }\n }\n \n return TRUE;\n\n }", "function showWinner()\n{\n\t\n\t\n\t$val= getLastContest();\n\tif ($val >0)\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "function esHorarioProhibido($fecha) {\r\n // Obtener hora seleccionada por el usuario para conducir\r\n // en formato 5:30am, 8:45pm.\r\n $date = new DateTime($fecha);\r\n $hora_conducir = strtotime($date->format(\"g:ia\"));\r\n\r\n // Obtener horarios de inicio y fin de Pico y Pala.\r\n $horario_manana = explode(\"-\", HORARIO_PROHIBIDO_MANANA);\r\n $horario_tarde = explode(\"-\", HORARIO_PROHIBIDO_TARDE);\r\n\r\n // Rangos de horarios de prohibicion en la manana.\r\n $hora_am_start = strtotime($horario_manana[0]);\r\n $hora_am_end = strtotime($horario_manana[1]);\r\n\r\n // Rangos de horarios de prohibicion en la tarde.\r\n $hora_pm_start = strtotime($horario_tarde[0]);\r\n $hora_pm_end = strtotime($horario_tarde[1]);\r\n\r\n // Si la hora esta en el rango de prohibicion de la manana.\r\n if ($hora_conducir >= $hora_am_start && $hora_conducir <= $hora_am_end) {\r\n return TRUE;\r\n }\r\n // Si la hora esta en el rango de prohibicion de la tarde.\r\n elseif ($hora_conducir >= $hora_pm_start && $hora_conducir <= $hora_pm_end) {\r\n return TRUE;\r\n }\r\n else {\r\n // Si la hora esta fuera de los rangos de prohibicion, es horario NO prohibido.\r\n // El usuario puede conducir.\r\n return FALSE;\r\n }\r\n }", "function existe_espacio_disponible (){\n $fin=FALSE;\n $i=0;\n $n=count($this->s__horarios_disponibles);\n while($i<$n && !$fin){\n $elto=$this->s__horarios_disponibles[$i];\n $hi=$this->s__datos_solcitud['hora_inicio'];\n $hf=$this->s__datos_solcitud['hora_fin'];\n \n //Verificamos inclusion.\n if($hi>=$elto['hora_inicio'] && $hi<=$elto['hora_fin'] && $hf<=$elto['hora_fin']){\n //Cortamos el bucle y en el formulario por defecto usamos la informacion de s__datos_solicitud.\n $fin=TRUE;\n }\n $i++;\n }\n \n return $fin;\n }", "public function isAquarius();", "function verificarCruce($retorno,$horarioEstudiante,$horarioGrupo) {\n //verifica si hay cruce de horario\n $cruce=$this->validacion->verificarCruceHorarios($horarioEstudiante,$horarioGrupo);\n if($cruce==1)\n {\n $retorno['mensaje']=\"El horario del espacio académico presenta cruce con el horario del estudiante. No se ha realizado la inscripción\";\n $this->enlaceNoAdicion($retorno);\n exit;\n }\n }", "function verificarCruce($retorno,$horarioEstudiante,$horarioGrupo) {\n //verifica si hay cruce de horario\n $cruce=$this->validacion->verificarCruceHorarios($horarioEstudiante,$horarioGrupo);\n if($cruce==1)\n {\n $retorno['mensaje']=\"El horario del espacio académico presenta cruce con el horario del estudiante. No se ha realizado la inscripción\";\n $this->enlaceNoAdicion($retorno);\n exit;\n }\n }", "function controlEmbarazadas($beneficiario, $prestaciones, $periodo_comprobante, $fecha_comprobante) {\r\n $puede = true;\r\n $prestaciones->movefirst();\r\n while (!$prestaciones->EOF) {\r\n if (practicaSoloParaEmbarazadas($prestaciones->fields['id_nomenclador'])) {\r\n if (!beneficiarioEmbarazadoSMI($beneficiario['clavebeneficiario'], $periodo_comprobante, $fecha_comprobante)) {\r\n $puede = false;\r\n break;\r\n }\r\n }\r\n $prestaciones->movenext();\r\n }\r\n return $puede;\r\n}", "public function esSesionAgotada(){\n $this->_ButacaSesion_arr;\n foreach($this->_ButacaSesion_arr as $ButacaSesion){\n if($ButacaSesion->getEstado()==\"libre\"){\n return 0;\n }\n }\n return 1;\n }", "function alta($nombre,$codigo){\n\t\t\n\t\t//si todo salio bien\n\t\treturn true;\n\t\t//sino\n\t\treturn false;\n\t}", "public function VerificarFechas($ultimaVenta, $ultimaSolicitud, $ultimaSolicitudCambio){\n $disponible = true;\n //Valido por la existencia de las fechas.\n if ($ultimaVenta === null && $ultimaSolicitud === null && $ultimaSolicitudCambio === null) {\n $disponible = true; //NO se ha vendido, no se ha devuelto y no se ha dado en cambio.\n } else {\n if ($ultimaVenta === null && $ultimaSolicitud === null && $ultimaSolicitudCambio !== null) {\n $disponible = false; //Se entrego por cambio el producto. NO DISPONIBLE\n } else {\n if ($ultimaVenta !== null && $ultimaSolicitud === null && $ultimaSolicitudCambio === null) {\n $disponible = false;\n } \n else{\n if ($ultimaVenta !== null && $ultimaSolicitud !== null && $ultimaSolicitudCambio === null) {\n //Existe la venta y la devolucion. Debo verificar cual es mas reciente.\n if ($ultimaVenta > $ultimaSolicitud) {\n $disponible = false;//se vendió más recientemente que la solicitud de devolucion.\n } else {\n $disponible = true;\n }\n \n } else {\n if ($ultimaVenta !== null && $ultimaSolicitud !== null && $ultimaSolicitudCambio !== null) {\n if ($ultimaVenta > $ultimaSolicitud && $ultimaVenta > $ultimaSolicitudCambio) {\n $disponible = false;\n } else {\n if ($ultimaSolicitud > $ultimaVenta && $ultimaSolicitud > $ultimaSolicitudCambio) {\n $disponible = true;\n } else {\n if ($ultimaSolicitudCambio > $ultimaSolicitud && $ultimaSolicitudCambio> $ultimaVenta) {\n $disponible = false;\n } \n }\n }\n \n } \n \n }\n \n }\n }\n }\n return $disponible;\n }", "public function isEvent() {\r\n\t\t//credits/contra costs = 0 (or empty) & no droideka, or name match\r\n\t\t//if have no idea what exactly indicates if a troop is trainable or not (player.unlockedlevels ???)\r\n\t\tif ((preg_match('/^(0[a-z]*|)$/i',$this->fmt($this->defaultRec(),'credits')) &&\r\n\t\t\tpreg_match('/^(0[a-z]*|)$/i',$this->fmt($this->defaultRec(),'contraband')) &&\r\n\t\t\t!preg_match('/Champion/i',$this->getID())\r\n\t\t\t)\r\n\t\t\t|| preg_match('/Death|Rancor|Krayt|Sample/',$this->getID()) )\r\n\t\t\treturn TRUE;\r\n\t\telse\r\n\t\t\treturn FALSE;\r\n\t}", "function consultar_pasado($fisher_elegido, $permutado_pasado){\n $encontrar=true;\n\n for($i=0; $i<count($permutado_pasado); $i++){\n if($permutado_pasado[$i] == $fisher_elegido){\n $encontrar=false;\n break;\n }\n }\n\n return $encontrar;\n}", "function is_competition_mode() {\n $now = time();\n $start = strtotime(COMPETITION_START);\n $end = strtotime(COMPETITION_END);\n return $now >= $start && $now < $end;\n}", "function cardIsAce($card) \n{\n // todo\n\treturn $card[0] == 'A' ? TRUE : FALSE;\n\n}", "public function isSagittarius();", "function verificar_existencia_de_espacio (){\n \n $anio_lectivo=date('Y', strtotime($this->s__fecha_consulta));\n $this->s__dia_consulta=$this->obtener_dia(date('N', strtotime($this->s__fecha_consulta)));\n //Debemos usar la fecha seleccionada por el usuario. Necesitamos brindar una respuesta concreta\n //segun los espacios ocupados en ese dia.\n $periodo=$this->dep('datos')->tabla('periodo')->get_periodo_calendario(date('Y-m-d', strtotime($this->s__fecha_consulta)), $anio_lectivo, $this->s__id_sede);\n \n //Obtenemos las aulas del establecimiento.\n $aulas_ua=$this->dep('datos')->tabla('aula')->get_aulas_por_sede($this->s__id_sede);\n \n //Obtenemos las asignaciones para la fecha solicitada. En este caso necesitamos traer las \n //asignaciones para todas las aulas del establecimiento.\n $asignaciones=$this->procesar_periodo($periodo, 'hd');\n \n //Obtenemos todas las aulas que actualmente estan siendo usadas. \n $aulas=$this->obtener_aulas($asignaciones);\n \n //Guardamos el id_sede en sesion, para utilizar dentro de la clase HorariosDisponibles en la \n //operacion agregar_capacidad.\n toba::memoria()->set_dato_instancia(0, $this->s__id_sede);\n \n $horarios_disponibles=new HorariosDisponibles();\n \n $this->s__horarios_disponibles=$horarios_disponibles->calcular_horarios_disponibles($aulas, $aulas_ua, $asignaciones);\n \n //Obtenemos los horarios que coinciden con el requerimiento registrado.\n $horarios=$this->calcular_horarios_disponibles_segun_req();\n \n //Si existe al menos 1 horario libre que coincide con el requerimiento, lo mostramos en el \n //cuadro_espacio_ocupado :D, -_-\n if(count($horarios) > 0){\n $this->s__horarios_libres=$horarios; //contiene los horarios que conciden con el requerimiento\n }else{\n toba::notificacion()->agregar(\"No existen horarios disponibles alternativos\", 'info');\n return ;\n }\n \n }", "function informe_anual()\n{\n\techo \"No se ha creado el informe anual del presente a&ntilde;o\";\n}", "function verificar_vacaciones($cuasa_real2,$fecha){\n\n\t $fecha1=strtotime($cuasa_real2);\n\t //echo $cuasa_real2; die(\"causa real\");\n\t $fecha2=strtotime($fecha);\n\t \n\t \n\t if((int)$fecha1 <= (int)$fecha2){\n\t \n\t\treturn 1;\n\t }else{\n\t \n\t\treturn 2;\n\t }\n}", "public function checkIniciCirugia()\n {\n if ($this->inici_cirugia_H3 == null && $this->sortidaQuirofanH5Real != null) {\n $this->inici_cirugia_H3 = $this->entradaQuirofanH2Real;\n }\n return $this->inici_cirugia_H3;\n }", "public function isCapricorn();", "function tieneAistencia($id_nom, $aId_activ)\n{\n // Comprobar que no tienen alguna actividad ya asignada como propia\n $GesAsistentes = new asistentes\\GestorAsistenteDl();\n $cAsistentes = $GesAsistentes->getAsistentesDl(array('id_nom' => $id_nom, 'propio' => 't'));\n foreach ($cAsistentes as $oAsistente) {\n $id_activ = $oAsistente->getId_activ();\n if (array_key_exists($id_activ, $aId_activ)) {\n return TRUE;\n }\n }\n $GesAsistentesOut = new asistentes\\GestorAsistenteOut();\n $cAsistentesOut = $GesAsistentesOut->getAsistentesOut(array('id_nom' => $id_nom, 'propio' => 't'));\n foreach ($cAsistentesOut as $oAsistente) {\n $id_activ = $oAsistente->getId_activ();\n if (array_key_exists($id_activ, $aId_activ)) {\n return TRUE;\n }\n }\n return FALSE;\n}", "public function disponibilitePlace()\n\t{\n\t\treturn ($this->nbPlacesTotal() - count($this->_listeParticipants)) >= 1;\n\t}", "function validarCuit() {\n $es_numerico = true;\n //parto el cuit en los guiones y los guardo en datos(array)\n $datos = explode('-', $this->data['Empresa']['cuit']);\n foreach ($datos as $dato) {\n //por cada parte del cuit me fijo que sea numerico\n if (!is_numeric($dato)) {\n //si no es pongo la bandera en false\n $es_numerico = false;\n }\n }\n //debo comprobar las longitudes de las tres partes\n $longitud0 = true;\n $longitud1 = $longitud0;\n $longitud2 = $longitud1;\n //la primer parte son 2 numeros, si la longitud es distinta de 2 hay un error\n if (!isset($datos[0]) || strlen($datos[0]) != 2) {\n //longitud distinta de 2, pongo la bandera en false\n $longitud0 = false;\n }\n //la segunda parte son 8 numeros, si la longitud es distinta de 8 u 7 hay un error\n if (!isset($datos[1]) || !in_array(strlen($datos[1]), array(7, 8))) {\n //longitud distinta de 8, pongo la bandera en false\n $longitud1 = false;\n }\n //la tercer parte es 1 digito, si la longitud es distinta de 1 hay un error\n if (!isset($datos[2]) || strlen($datos[2]) != 1) {\n //longitud distinta de 1, pongo la bandera en false\n $longitud2 = false;\n }\n //un cuit es valido, si todas las banderas llegan a este punto en true\n return ($es_numerico && $longitud0 && $longitud1 && $longitud2);\n }", "function setCardioTimes($viewAreaTimeslot, &$cardioStartTime, &$cardioEndTime, &$errors){\n \n $area = \\Trainingskalender\\models\\Area\n ::find('labelling = \\'Cardio\\'');\n\n $diffTrainingStartCardio = unserialize (diffTrainingStartCardio);\n\n foreach ($diffTrainingStartCardio as $value){\n\n setTimeDiffBeforeTraining($value,durationCardio,$viewAreaTimeslot['startTime'] , $cardioStartTime, $cardioEndTime );\n $trainingEntrysByCardioTime = getTrainingEntrysByCardioTime($viewAreaTimeslot, $cardioStartTime, $cardioEndTime);\n \n if(arePlacesAvailable($area[0]['maxNumberOfPeople'],$viewAreaTimeslot, $cardioStartTime, $cardioEndTime, $trainingEntrysByCardioTime)){\n return true;\n }\n\n }\n\n array_push($errors, \"Keine Kardiozeit verfügbar\");\n \n return false;\n\n}", "public function validaFichaAviso()\n {\n if (MODULE == 'postulante' && CONTROLLER == 'aviso' && ACTION == 'ver') {\n return true;\n }\n return false;\n }", "public function isActiveCompetition() {\n $today = date(\"Y-m-d\");\n if ($this->getStartdatum() <= $today && $today <= $this->getSlutdatum()) {\n return true;\n } else {\n return false;\n }\n }" ]
[ "0.6090013", "0.6090013", "0.5968163", "0.5957945", "0.5932973", "0.58896613", "0.57799625", "0.5751489", "0.5720834", "0.5720834", "0.5710396", "0.5693098", "0.56535196", "0.5629086", "0.55978626", "0.55555624", "0.55348474", "0.55273265", "0.55261093", "0.5522347", "0.5506902", "0.5500519", "0.54816705", "0.54797095", "0.54767233", "0.5475562", "0.54559934", "0.54391295", "0.5423104", "0.541903" ]
0.6221886
1
Funcion que busca los espacios que se han cancelado
function buscarEspaciosCancelados($retorno) { $this->espaciosCancelados=json_decode($this->datosEstudiante[0]['CANCELADOS'],true); $codEspacio=$this->datosInscripcion['codEspacio']; if (is_array($this->espaciosCancelados)&&$this->espaciosCancelados!="") { foreach ($this->espaciosCancelados as $cancelados) { if($cancelados==$codEspacio) { $retorno['mensaje']= $retorno['nombreEspacio']." ha sido cancelado en el período actual. No se puede adicionar."; $this->enlaceNoAdicion($retorno); exit; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verificarCancelado($retorno) {\n //verificar cancelado\n $cancelado=$this->validacion->validarCancelado($_REQUEST);\n if($cancelado!='ok' && is_array($cancelado))\n {\n $retorno['mensaje']=\"El espacio academico ha sido cancelado \".$cancelado['veces'].\" en el per&iacute;odo actual.\";\n $this->enlaceNoAdicion($retorno);\n \n }\n }", "function verificarCancelado($retorno) {\n //verificar cancelado\n $cancelado=$this->validacion->validarCancelado($_REQUEST);\n if($cancelado!='ok' && is_array($cancelado))\n {\n $retorno['mensaje']=\"El espacio academico ha sido cancelado \".$cancelado['veces'].\" en el per&iacute;odo actual.\";\n $this->enlaceNoAdicion($retorno);\n \n }\n }", "function evt__cancelar()\n\t{\n\t\t$this->_log->debug($this->get_txt() . \"[callback][ evt__cancelar ]\", 'toba');\n\t\t$this->disparar_limpieza_memoria();\n\t\tif(isset($this->_cn)){\n\t\t\t$this->_cn->cancelar();\t\t\t\n\t\t}\n\t}", "public function cancelamentos( Request $request)\n {\n $processos = [26,76,91];\n $tipoOs = [2,133];\n $cancelamentos = DB::table('mk_atendimento')\n ->whereIn('cd_processo', $processos )\n ->select('cliente_cadastrado')\n ->get();\n\n $ordens = DB::table('mk_os')\n ->whereIn('tipo_os', $tipoOs )\n ->get();\n\n $pessoas = DB::table('mk_pessoas as cliente')\n ->joinSub( $cancelamentos, 'cancelamentos', function ($cancelamento) {\n $cancelamento->on('cliente.codpessoa', '=', 'cancelamentos.cliente_cadastrado' );\n })->get();\n\n if (request()->wantsJson()) {\n return response()->json([\n 'result' => $ordens,\n ]);\n }\n\n return $pessoas;\n }", "public function eventos_cajeros_cerrados(){\n //Validación para verificar si el usuario está logeado en el sistema\n if(isset($_SESSION['nombre'])){\n //Creación de un objeto de clase eventos\n $obj_gerencia_seguridad = new cls_datos_gerencia_seguridad();\n $obj_tipo_evento = new cls_tipo_evento();\n \n //Metodo de la clase que permite obtener todas las provincias que se encuentran listadas en el sistema.\n $obj_gerencia_seguridad->setCondicion(\"\");\n $obj_gerencia_seguridad->obtener_todas_las_provincias();\n //Asigna el resultado a un vector\n $lista_provincias=$obj_gerencia_seguridad->getArreglo();\n \n //Obtiene todos lps tipos de puntos BCR que se encuentran activos en la base de datos\n $obj_gerencia_seguridad->setCondicion(\"ID_Tipo_Punto in (2,3,4,12) AND Estado=1\");\n $obj_gerencia_seguridad->obtener_todos_los_tipos_de_puntos_BCR();\n //Asigna el resultado de la consulta a un vector\n $lista_tipos_de_puntos_bcr=$obj_gerencia_seguridad->getArreglo();\n \n $obj_gerencia_seguridad->setCondicion(\"ID_Tipo_Punto=1 AND t_Provincia.ID_Provincia= 1\");\n //Metodo que filtra los puntos BCR para uso de la bitacora digital\n $obj_gerencia_seguridad->filtra_sitios_bcr_bitacora();\n //Obtiene el resultado de la consulta en una variable vector.\n $lista_puntos_bcr_oficinas_sj=$obj_gerencia_seguridad->getArreglo(); \n \n //Obtiene todos los tipos de eventos\n $obj_tipo_evento->setCondicion(\"Estado=1\");\n $obj_tipo_evento->obtener_tipo_evento();\n $tipo_evento = $obj_tipo_evento->getArreglo();\n \n //Llamada al formulario correspondiente de la vista\n require __DIR__.'/../vistas/plantillas/frm_eventos_cajeros_cerrados.php';\n }\n else {\n $tipo_de_alerta=\"alert alert-warning\";\n $validacion=\"Es necesario volver a iniciar sesión para consultar el sistema\";\n //Llamada al formulario correspondiente de la vista\n $this->volver_oriel();\n }\n }", "protected function cancel(){\n $temp = explode(',', $_POST['cancel']);\n $caseProgress = Case_ProgressModel::model()->findOne('id = ' . $temp[0]);\n TransitionModel::model()->returnTokens($temp[1], $temp[2], $caseProgress->id);\n $caseProgress->delete();\n header('Location:' . ENTRY_SCRIPT_URL . 'task/listAll', TRUE, 301);\n }", "static public function ctrCancelarCuenta(){\n\n\t\tif(isset($_POST[\"cancelarDocumento\"])){\n\n\t\t\t$tabla=\"cuenta_ctejf\";\n\t\t\t $datos = array(\"id\" => $_POST[\"idCuenta2\"],\n\t\t\t \t\t\t \"tipo_doc\"=>$_POST[\"cancelarTipoDocumento\"],\n\t\t\t\t\t\t \"num_cta\"=>$_POST[\"cancelarDocumentoOriginal\"],\n\t\t\t\t\t\t \"cliente\"=>$_POST[\"cancelarCliente\"],\n\t\t\t\t\t\t \"vendedor\"=>$_POST[\"cancelarVendedor\"],\n\t\t\t\t\t\t \"monto\"=>$_POST[\"cancelarMonto\"],\n\t\t\t\t\t\t \"notas\"=>$_POST[\"cancelarNota\"],\n\t\t\t\t\t\t \"usuario\"=>$_POST[\"cancelarUsuario\"],\n\t\t\t\t\t\t \"fecha\"=>$_POST[\"cancelarFechaUltima\"],\n\t\t\t\t\t\t \"fecha_ven\"=>$_POST[\"cancelarVencimientoOrigen\"],\n\t\t\t\t\t\t\t\"cod_pago\" => $_POST[\"cancelarCodigo\"],\n\t\t\t\t\t\t\t\"doc_origen\" => $_POST[\"cancelarDocumento\"],\n\t\t\t\t\t\t\t\"saldo\"=>0,\n\t\t\t\t\t\t\t\"tip_mov\" => \"-\");\n\n\t\t\t\t$cuenta=ControladorCuentas::ctrMostrarCuentas(\"id\",$_POST[\"idCuenta2\"]);\n\t\t\t\t$saldoNuevo=$cuenta[\"saldo\"]-$_POST[\"cancelarMonto\"];\n\t\t\t\tif($saldoNuevo >= -0.5 && $saldoNuevo<= 0.5){\n\t\t\t\t\t$estado=ModeloCuentas::mdlActualizarUnDato($tabla,\"estado\",\"CANCELADO\",$_POST[\"idCuenta2\"]);\n\t\t\t\t}\n\t\t\t\t$ultimo_pago=ModeloCuentas::mdlActualizarUnDato($tabla,\"ult_pago\",$_POST[\"cancelarFechaUltima\"],$_POST[\"idCuenta2\"]);\n\t\t\t\t$actualizado=ModeloCuentas::mdlActualizarUnDato($tabla,\"saldo\",$saldoNuevo,$_POST[\"idCuenta2\"]);\n\t\t\t \t$respuesta = ModeloCuentas::mdlIngresarCuenta($tabla,$datos);\n\t\t\t \tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"La cuenta ha sido cancelada correctamente\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"cuentas\";\n\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</script>';\n\n\n\t\t\t}\n\t\t}\n\n\t}", "static public function ctrCancelarCotizacion(){\r\n\r\n\t\tif(isset($_GET[\"idCotizacion\"])){\r\n\r\n\t\t\t$tabla = \"cotizaciones\";\r\n\t\t\t$datos = array(\"folio\" => $_GET[\"idCotizacion\"],\r\n\t\t\t\t\t\t \"motivoCancelacion\" => $_GET['motivo']);\r\n\r\n\t\t\t$tabla1 = \"bitacora\";\r\n\t\t\t$datos1 = array(\"usuario\" => $_SESSION[\"nombre\"],\r\n\t\t\t\t\t\t\t\t \"perfil\" => $_SESSION[\"perfil\"],\r\n\t\t\t\t\t\t\t\t \"accion\" => 'Cancelación de Cotizacion',\r\n\t\t\t\t\t\t\t\t \"folio\" => $_GET[\"idCotizacion\"]);\r\n\r\n\t\t\t\r\n\r\n\r\n\t\t\t$respuesta = ModeloCotizaciones::mdlCancelarCotizacion($tabla, $datos);\r\n\t\t\t$respuesta1 = ModeloCotizaciones::mdlRegistroBitacoraCancelar($tabla1, $datos1);\r\n\r\n\t\t\tif($respuesta == \"ok\" && $respuesta1 == \"ok\"){\r\n\r\n\t\t\t\techo'<script>\r\n\r\n\t\t\t\twindow.location = \"cotizador\";\r\n\r\n\t\t\t\t</script>';\r\n\r\n\t\t\t}\t\t\r\n\r\n\t\t}\r\n\r\n\t}", "function cancelar_reserva(request $request){\n if($request->estado == 'A'){\n $horainicial = new \\Carbon\\Carbon($request->horario['horainicial']);\n //Horario actual del servidor\n $horaactual = new \\Carbon\\Carbon();\n //Agregarle 2 horas a la fecha actual\n $horaactual->addHours(2);\n //VALIDACION: solo cancelar reservas con 2 horas de anticipacion\n if($horainicial->lt($horaactual)) {\n return response()->json([\n 'error' => [\n 'title'=> 'Tiempo de anticipacion',\n 'code' => 400,\n 'message' => \"Solo puede cancelar reservaciones 2 horas antes del inicio\",\n ]\n ], 400);\n }\n $reserva= Reserva::find($request->id);\n $reserva->estado = 'CA';\n $reserva->fecha_cancelada = new \\Carbon\\Carbon();\n $reserva->save();\n return response()->json([\n 'success' => [\n 'title'=> 'Genial!',\n 'code' =>200,\n 'message' => \"Reserva cancelada con exito\",\n ]\n ], 200);\n }else{\n return response()->json([\n 'error' => [\n 'title'=> 'Error',\n 'code' => 400,\n 'message' => \"Solo pueden cancelar reservaciones activas\",\n ]\n ], 400);\n }\n\n }", "static public function ctrAlertaDecomisos(){\t\t\r\n\r\n\t\t$carnesADecomisar=ControladorFormularios::ctrListaCarnesDecomisar();\r\n\t\t$contarCarnes=count($carnesADecomisar);\r\n\r\n\t\tif ($contarCarnes>0) {\r\n\t\t\t$alerta='SI';\r\n\r\n\t\t\t$respuesta = array(\t'alerta_' \t=> $alerta,\r\n\t\t\t\t\t\t\t\t'cantidad_'\t=> $contarCarnes);\r\n\t\t\treturn $respuesta;\r\n\t\t}\r\n\t}", "static public function ctrMostrarCotizacionesCanceladas(){\r\n\r\n\t\t$tabla = \"cotizaciones\";\r\n\r\n\t\t$respuesta = ModeloCotizaciones::mdlMostrarCotizacionesCanceladas($tabla);\r\n\r\n\t\treturn $respuesta;\r\n\t}", "static public function ctrCancelarCuenta2(){\n\n\t\tif(isset($_POST[\"cancelarDocumento2\"])){\n\n\t\t\t$tabla=\"cuenta_ctejf\";\n\t\t\t $datos = array(\"id\" => $_POST[\"idCuenta3\"],\n\t\t\t \t\t\t \"tipo_doc\"=>$_POST[\"cancelarTipoDocumento2\"],\n\t\t\t\t\t\t \"num_cta\"=>$_POST[\"cancelarDocumentoOriginal2\"],\n\t\t\t\t\t\t \"cliente\"=>$_POST[\"cancelarCliente2\"],\n\t\t\t\t\t\t \"vendedor\"=>$_POST[\"cancelarVendedor2\"],\n\t\t\t\t\t\t \"monto\"=>$_POST[\"cancelarMonto3\"],\n\t\t\t\t\t\t \"notas\"=>$_POST[\"cancelarNota2\"],\n\t\t\t\t\t\t \"usuario\"=>$_POST[\"cancelarUsuario2\"],\n\t\t\t\t\t\t \"fecha\"=>$_POST[\"cancelarFechaUltima2\"],\n\t\t\t\t\t\t \"fecha_ven\"=>$_POST[\"cancelarVencimientoOrigen2\"],\n\t\t\t\t\t\t \"cod_pago\" => $_POST[\"cancelarCodigo2\"],\n\t\t\t\t\t\t \"doc_origen\" => $_POST[\"cancelarDocumento2\"],\n\t\t\t\t\t\t \"saldo\"=>0,\n\t\t\t\t\t\t \"tip_mov\" => \"-\"\t\n\t\t\t\t\t\t);\n\n\t\t\t\t$cuenta=ControladorCuentas::ctrMostrarCuentas(\"id\",$_POST[\"idCuenta3\"]);\n\t\t\t\t$saldoNuevo=$cuenta[\"saldo\"]-$_POST[\"cancelarMonto3\"];\n\t\t\t\tif($saldoNuevo >= -0.5 && $saldoNuevo<= 0.5){\n\t\t\t\t\t$estado=ModeloCuentas::mdlActualizarUnDato($tabla,\"estado\",\"CANCELADO\",$_POST[\"idCuenta3\"]);\n\t\t\t\t}\n\t\t\t\t$ultimo_pago=ModeloCuentas::mdlActualizarUnDato($tabla,\"ult_pago\",$_POST[\"cancelarFechaUltima2\"],$_POST[\"idCuenta3\"]);\n\t\t\t\t$actualizado=ModeloCuentas::mdlActualizarUnDato($tabla,\"saldo\",$saldoNuevo,$_POST[\"idCuenta3\"]);\n\t\t\t \t$respuesta = ModeloCuentas::mdlIngresarCuenta($tabla,$datos);\n\t\t\t \tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo'<script>\t\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"La cuenta ha sido cancelada correctamente\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"index.php?ruta=ver-cuentas&numCta='.$cuenta[\"num_cta\"].'\";\n\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</script>';\n\n\n\t\t\t}\n\t\t}\n\n\t}", "function cancelaconciertosantiguos()\n{\n $c = conectar();\n $update = \"update concierto set estado=2 where estado=0 and fecha<DATE_ADD(NOW(),INTERVAL -1 DAY);\";\n if (mysqli_query($c, $update)) {\n return \"ok\";\n } else {\n $resultado = mysqli_error($c);\n }\n desconectar($c);\n return $resultado;\n}", "public function cancel()\n\t{\n\t}", "public function cancelar() {\n\n $oMatriculaAnterior = $this->getMatriculaAnterior();\n $oMatriculaAtual = $this->getMatricula();\n\n /**\n * Alteramos a situacao da matricula anterior para MATRICULADO\n */\n $oMatriculaAnterior->setSituacao(\"MATRICULADO\");\n $oMatriculaAnterior->setAtiva(true);\n\n /**\n * Atualizamos o diario anterior (com situacao TROCA DE TURMA), para receber os dados do diario da matricula\n * atual (com situacao MATRICULADO)\n */\n $this->atualizarDiario($oMatriculaAnterior);\n\n /**\n * Pegamos o diario da matricula atual, e removemos por completo\n */\n $oMatriculaAtual->getDiarioDeClasse()->remover();\n\n /**\n * Removemos a matricula atual\n */\n $oMatriculaAtual->remover($oMatriculaAnterior);\n\n /**\n * Salvamos os dados da matricula anterior\n */\n $oMatriculaAnterior->setDataEncerramento( null );\n $oMatriculaAnterior->salvar();\n }", "public function adminReportesNotificacionesCancelar(Request $request){\n $response = [\n 'result' => 'error',\n 'msj' => ''\n ];\n if($request->has('bitacora_id'))\n {\n $bitacora = Bitacora::find($request->get('bitacora_id'));\n if(!is_null($bitacora))\n {\n //hacemos rollback a la información\n $rollBack = DB::statement(\"UPDATE \".$bitacora->table.\" SET \".$bitacora->table_column.\"='\".$bitacora->old_info.\"' WHERE id=\".$bitacora->table_id);\n\n\n $bitacora->status_auth='Cancelado';\n $bitacora->status='Procesado';\n $bitacora->fecha_autorizacion = \\DB::raw('NOW()');\n $bitacora->aut_user_id=Auth::user()->id;\n $bitacora->save();\n\n $response['result'] = 'ok';\n }else{\n $response['msj'] = 'No se pudo rechazar el cambio, vuelve a intentarlo';\n }\n\n }else{\n $response['msj'] = 'No se pudo rechazar el cambio, vuelve a intentarlo';\n }\n\n return $response;\n }", "static public function ctrEliminarCancelacion(){\n\n\t\tif(isset($_GET[\"idCancelacion\"])){\n\n\t\t\t$datos = $_GET[\"idCancelacion\"];\n\t\t\t$tabla=\"cuenta_ctejf\";\n\t\t\tdate_default_timezone_set('America/Lima');\n\t\t\t$fecha = new DateTime();\n\t\t\t$cancelacion=ModeloCuentas::mdlMostrarCancelacion($tabla,\"id\",$datos);\n\t\t\t\n\t\t\t$usuario= $_SESSION[\"nombre\"];\n\t\t\t$para = '[email protected]';\n\t\t\t$asunto = 'Se elimino una cancelación';\n\t\t\t$descripcion = 'El usuario '.$usuario.' elimino una cancelacion de la cuenta de '.$cancelacion[\"tipo_doc\"].' - '.$cancelacion[\"num_cta\"];\n\t\t\t$de = 'From: [email protected]';\n\t\t\tif($_SESSION[\"correo\"] == 1){\n\t\t\t\tmail($para, $asunto, $descripcion, $de);\n\t\t\t}\n\t\t\tif($_SESSION[\"datos\"] == 1){\n\t\t\t\t$datos2= array( \"usuario\" => $usuario,\n\t\t\t\t\t\t\t\t\"concepto\" => $descripcion,\n\t\t\t\t\t\t\t\t\"fecha\" => $fecha->format(\"Y-m-d H:i:s\"));\n\t\t\t\t$auditoria=ModeloUsuarios::mdlIngresarAuditoria(\"auditoriajf\",$datos2);\n\t\t\t}\n\t\t\t$origen=ControladorCuentas::ctrMostrarCuentas(\"num_cta\",$cancelacion[\"num_cta\"]);\n\t\t\t$idOrigen=$origen[\"id\"];\n\t\t\t$saldoNuevo=$cancelacion[\"monto\"]+$origen[\"saldo\"];\n\t\t\tif($saldoNuevo>0){\n\t\t\t\t$estado=ModeloCuentas::mdlActualizarUnDato($tabla,\"estado\",\"PENDIENTE\",$idOrigen);\n\t\t\t}\n\t\t\t$actualizacion=ModeloCuentas::mdlActualizarUnDato($tabla,\"saldo\",$saldoNuevo,$idOrigen);\n\t\t\t$datos3 = array(\"id\"=>$cancelacion[\"id\"],\n\t\t\t\t\t\t \"usuario_bkp\"=>$_SESSION[\"id\"],\n\t\t\t\t\t\t \"fecha_bkp\"=>$fecha->format(\"Y-m-d H:i:s\"));\n\t\t\t$ingreso_bkp = ModeloCuentas::mdlIngresarCuentaBckp2(\"cuenta_cte_bkpjf\",$datos3);\n\t\t\t//Despues de realizar el bkp eliminamos\n\t\t\t$respuesta = ModeloCuentas::mdlEliminarCuenta($tabla,$datos);\t\t\n\t\t\tif($respuesta == \"ok\"){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\techo'<script>\n\n\t\t\t\tswal({\n\t\t\t\t\t type: \"success\",\n\t\t\t\t\t title: \"La cancelación ha sido borrada correctamente\",\n\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t confirmButtonText: \"Cerrar\",\n\t\t\t\t\t closeOnConfirm: false\n\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\twindow.location = \"index.php?ruta=ver-cuentas&numCta='.$origen[\"num_cta\"].'&rutas=cuentas\";\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\n\t\t\t\t</script>';\n\n\t\t\t}\t\t\n\n\t\t}\n\n\t}", "public function listingCancel()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('t_booking');\n\t\t$this->db->where('status', 'cancel');\n\t\t$this->db->order_by('kode_booking', 'desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "function eliminarDatosCalculados(){\n\t\t$this->procedimiento='oip.ft_archivo_horas_piloto_ime';\n\t\t$this->transaccion='OIP_ARHOPI_ELI';\n\t\t$this->tipo_procedimiento='IME';\n\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_archivo_horas_piloto','id_archivo_horas_piloto','int4');\n $this->setParametro('datosCalculados','datosCalculados','varchar');\n $this->setParametro('sin_excel','sin_excel','boolean');\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 }", "function CancelReserve($Mfn){\rglobal $db_path,$Wxis,$xWxis,$wxisUrl,$arrHttp;\r\t$fecha_dev=date(\"Ymd\");\n\t$hora_dev=date(\"H:i:s\");\n\t$ValorCapturado=\"d1d130d131d132<1 0>1</1>\";\n\t$ValorCapturado.=\"<130 0>$fecha_dev</130>\";\n\t$ValorCapturado.=\"<131 0>$hora_dev</131>\";\n\t$ValorCapturado.=\"<132 0>\".$_SESSION[\"login\"].\"</132>\";\n\t$ValorCapturado=urlencode($ValorCapturado);\n\t$IsisScript=$xWxis.\"actualizar_registro.xis\";\n\t$Formato=\"\";\n\t$query = \"&base=reserve&cipar=$db_path\".\"par/reserve.par&login=\".$_SESSION[\"login\"].\"&Mfn=\".$Mfn.\"&ValorCapturado=\".$ValorCapturado;\n\tinclude(\"../common/wxis_llamar.php\");\n\t//foreach ($contenido as $value) echo \"$value<br>\";die;\n}", "public function isCanceled()\n {\n \n }", "public function cerrar_requisicion_apro($cod_form,$observaciones,$fecha,$cod_car,$cod_epl){\n\t\t\t\t\n\t\t\t\tdate_default_timezone_set('America/Bogota');\n\n\t\t\t try { \n\t\t\t\tglobal $conn;\n\n\t\t\t\t$sql=\"update sol_req_int_tmp set estado='AP' where cod_form=\".$cod_form.\" \";\n\n\n\t\t\t\t$rs=$conn->Execute($sql);\n\t\t\t\t\n\t\t\t\t$fecha_click=date(\"Y-m-d H:i:s\");\n\n\t\t\t\t$estado1='CERR';\n\t\t\t\t$estado='Cerrado';\n\t\t\t\t\n\t\t\t\t$sql_comodin=\"insert into vacantes_gh(cod_cargo,cod_jefe,fecha,observaciones,estado,cod_form_fk)\n\t\t\t\t\t values(\".$cod_car.\",'66972546','\".$fecha_click.\"','\".$observaciones.\"','\".$estado1.\"','\".$cod_form.\"')\";\n\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t$conn->Execute($sql_comodin);\n\n\t\t\t\tif($rs){\n\n\t\t\t\t $sql4=\"select * from log_vacantes where codigo_vacante=$cod_form\";\n\t\t\t\t\t\n\t\t\t\t\t$rs2=$conn->Execute($sql4);\n\t\t\t\t\n\t\t\t\t\tif($rs2->RecordCount() > 0){\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$fila=$rs2->FetchRow();\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$sql3=\"insert into log_vacantes(codigo_vacante,jefe,estado,fecha_click,fecha_ini_entr,categoria)\n\t\t\t\t\t values(\".$cod_form.\",'\".$fila['jefe'].\"','\".$estado.\"','\".$fecha_click.\"','\".$fila['fecha_ini_entr'].\"','Requisicion Interna')\";\n\t\t\t\t\t \n\t\t\t\t\t $rs3=$conn->Execute($sql3);\n\t\t\t\t\t \n\t\t\t\t\t if($rs3){\n\t\t\t\t\t \n\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t }else{\n\t\t\t\t\t \n\t\t\t\t\t\t\treturn 2;\n\t\t\t\t\t }\n\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn 2;\n\t\t\t\t\t\n\t\t\t\t\t}\n\n\n\t\t\t\t}else{\n\t\t\t\t return 2;\n\t\t\t\t}\n\n\n\n\t\t\t }catch (exception $e) { \n\n\t\t\t\t var_dump($e); \n\n\t\t\t\t adodb_backtrace($e->gettrace());\n\n\t\t\t } \n\n\n\t\t }", "public function isCanceled(): bool;", "protected function deceasedPatients()\n\t{\n\t\techo \"Cancelling operations for deceased patients...\";\n\n\t\t// TODO: This needs to be made more robust\n\t\t$cancellation_reason = CancellationReason::model()->find(\"text = 'Patient has died'\");\n\t\tif (!$cancellation_reason) {\n\t\t\tthrow new CException('Cannot find cancellation code for \"patient has died\"');\n\t\t}\n\n\t\tforeach (Yii::app()->db->createCommand()\n\t\t\t->select(\"element_operation.id\")\n\t\t\t->from(\"element_operation\")\n\t\t\t->join(\"event\",\"element_operation.event_id = event.id\")\n\t\t\t->join(\"episode\",\"event.episode_id = episode.id\")\n\t\t\t->join(\"patient\",\"episode.patient_id = patient.id\")\n\t\t\t->leftJoin(\"booking\",\"booking.element_operation_id = element_operation.id\")\n\t\t\t->leftJoin(\"session\",\"booking.session_id = session.id\")\n\t\t\t->where(\"(session.date > NOW() or session.date is null) and element_operation.status != :cancelled and patient.date_of_death is not null and patient.date_of_death < NOW()\",array(':cancelled'=>ElementOperation::STATUS_CANCELLED))\n\t\t\t->queryAll() as $operation) {\n\t\t\t$operation = ElementOperation::model()->findByPk($operation['id']);\n\t\t\t$operation->cancel($cancellation_reason->id, 'Booking cancelled automatically');\n\t\t}\n\n\t\techo \"done.\\n\";\n\n\t}", "public function cancelar($rfcemisor, $uuid, $cer, $key, $pass)\n\t\t{\n\t\t\t$cer_content = file_get_contents($cer);\n\t\t\t$storagePath = \\Storage::disk('local')->getDriver()->getAdapter()->getPathPrefix();\n\t\t\t$q = Emisor_CFDI::whereRfc($rfcemisor)->first();\n\t\t\t$file = $storagePath . \"emisores/\" . $rfcemisor . \"/CSD/CANCELACIONES_\" . $rfcemisor . \".enc\";\n\t\t\t$cmd = 'openssl rsa -in ' . $key . ' -des3 -out ' . $file . ' -passout pass:'. $pass;\n shell_exec($cmd);\n $key_content = file_get_contents($file);\n $client = new \\SoapClient(\"{$this->url}cancel.wsdl\"); //Instancia del objeto SoapClient (con la url cancel)\n\t\t\t$uuid = array($uuid); // Hago el casting de string a array porque asi lo requiere el Web Service (Aunque solo se cancele un comprobante)\n\n\t\t\t/******Parametros requeridos por el webservice******/\n\t\t\t$params = array(\n\t\t\t \"UUIDS\" => array('uuids' => $uuid),\n\t\t\t \"username\" => $this->username,\n\t\t\t \"password\" => $this->password,\n\t\t\t \"taxpayer_id\" => $rfcemisor,\n\t\t\t \"cer\" => $cer_content,\n\t\t\t \"key\" => $key_content\n\t\t\t);\n\n\n\t\t\t/**************************************************/\n\t\t\t$response = $client->__soapCall(\"cancel\", array($params)); //Ejecuta la peticion al web service, y guardamos la respuesta en un stdClass\n\n\t\t\treturn $response->cancelResult;\n\t\t}", "function _webform_event_cancel_submissions($nid, $uid) {\n // Get other submissions for canceled user\n $return = array();\n $otherSubmissions = db_select('webform_submissions', 'subs')\n ->fields('subs', array('sid'))\n ->condition('uid', $uid, '=')\n ->condition('nid', $nid, '=')\n ->execute()\n ->fetchAll();\n\n // Loop them\n $i = 0;\n foreach ($otherSubmissions as $submissionData) {\n // Load submission data\n $data = webform_get_submission($nid, $submissionData->sid);\n // Loop data\n if (isset($data->data[99][0])) {\n $return[$i]['action'] = $data->data[99][0];\n }\n else {\n $return[$i]['action'] = $data->data[99]['value'][0];\n }\n $return[$i]['nid'] = $nid;\n $return[$i]['sid'] = $submissionData->sid;\n $i++;\n }\n return $return;\n}", "static public function ctrEditarCancelacion(){\n\n\t\tif(isset($_POST[\"cancelarDocumento\"])){\n\n\t\t\t$tabla=\"cuenta_ctejf\";\n\t\t\t\n\t\t\t$datos = array(\"id\" => $_POST[\"idCuenta2\"],\n\t\t\t\t\t\t\t\"tipo_doc\"=>$_POST[\"cancelarCodigo\"],\n\t\t\t\t\t\t \"num_cta\"=>$_POST[\"cancelarDocumento\"],\n\t\t\t\t\t\t \"vendedor\"=>$_POST[\"cancelarVendedor\"],\n\t\t\t\t\t\t \"fecha\"=>$_POST[\"cancelarCliente\"],\n\t\t\t\t\t\t \"monto\"=>$_POST[\"cancelarMonto2\"],\n\t\t\t\t\t\t \"notas\"=>$_POST[\"cancelarNota\"],\n\t\t\t\t\t\t \"usuario\"=>$_POST[\"cancelarUsuario\"],\n\t\t\t\t\t\t \"fecha\"=>$_POST[\"cancelarFechaUltima\"]);\n\t\t\t\t\t\t \n\t\t\t\t$origen=ControladorCuentas::ctrMostrarCuentas(\"num_cta\",$_POST[\"cancelarDocumento\"]);\n\t\t\t\t$idOrigen=$origen[\"id\"];\n\t\t\t\t$saldoNuevo=$_POST[\"cancelarMontoAntiguo\"]-$_POST[\"cancelarMonto2\"];\n\t\t\t\tif($saldoNuevo>0){\n\t\t\t\t\t$estado=ModeloCuentas::mdlActualizarUnDato($tabla,\"estado\",\"PENDIENTE\",$idOrigen);\n\t\t\t\t}\n\t\t\t\t$actualizacion=ModeloCuentas::mdlActualizarUnDato($tabla,\"saldo\",$saldoNuevo,$idOrigen);\n\t\t\t\tdate_default_timezone_set('America/Lima');\n\t\t\t\t$fecha = new DateTime();\n\t\t\t\t$cancelacion=ModeloCuentas::mdlMostrarCancelacion($tabla,\"id\",$datos);\n\t\t\t\t$usuario= $_SESSION[\"nombre\"];\n\t\t\t\t$para = '[email protected]';\n\t\t\t\t$asunto = 'Se edito una cancelación';\n\t\t\t\t$descripcion = 'El usuario '.$usuario.' edito una cancelacion de la cuenta de '.$cancelacion[\"tipo_doc\"].' - '.$cancelacion[\"num_cta\"];\n\t\t\t\t$de = 'From: [email protected]';\n\t\t\t\tif($_SESSION[\"correo\"] == 1){\n\t\t\t\t\tmail($para, $asunto, $descripcion, $de);\n\t\t\t\t}\n\t\t\t\tif($_SESSION[\"datos\"] == 1){\n\t\t\t\t\t$datos2= array( \"usuario\" => $usuario,\n\t\t\t\t\t\t\t\t\t\"concepto\" => $descripcion,\n\t\t\t\t\t\t\t\t\t\"fecha\" => $fecha->format(\"Y-m-d H:i:s\"));\n\t\t\t\t\t$auditoria=ModeloUsuarios::mdlIngresarAuditoria(\"auditoriajf\",$datos2);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t \t$respuesta = ModeloCuentas::mdlEditarCuenta($tabla,$datos);\n\t\t\t \tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"La cancelación ha sido cambiada correctamente\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"index.php?ruta=ver-cuentas&numCta='.$_POST[\"cancelarDocumento\"].'\";\n\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</script>';\n\n\n\t\t\t}\n\t\t}\n\n\t}", "public function getShippingCanceled();", "function eliminarCasaOracion(){\n\t\t$this->procedimiento='ccb.f_casa_oracion_ime';\n\t\t$this->transaccion='CCB_CAOR_ELI';\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_casa_oracion','id_casa_oracion','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 static function regularizarCancelamentos(){\n $matriculas = Matricula::select( '*', 'matriculas.status as status', 'matriculas.id as id')\n ->join('inscricoes','inscricoes.matricula','matriculas.id')\n ->where('matriculas.status','ativa')\n ->where('inscricoes.status','cancelada')\n ->get();\n /*pega todas matriculas com valor de 100\n $matriculas = Matricula::select( '*', 'matriculas.status as status', 'matriculas.id as id')\n ->join('inscricoes','inscricoes.matricula','matriculas.id')\n ->where('matriculas.status','ativa')\n ->where('matriculas.valor', 100)\n ->get();*/\n\n return view('secretaria.matricula.lista-geral', compact('matriculas'));\n\n\n }" ]
[ "0.645485", "0.645485", "0.61303675", "0.61302656", "0.60796636", "0.6053346", "0.5980412", "0.5929814", "0.58743435", "0.5868906", "0.5832737", "0.58316094", "0.58249366", "0.58136886", "0.57881194", "0.5775468", "0.57223064", "0.56619567", "0.5660832", "0.5602531", "0.56003267", "0.55832833", "0.5583227", "0.55809766", "0.55781436", "0.55540293", "0.5519654", "0.55183023", "0.55138206", "0.5444745" ]
0.70701116
1
Funcion que busca los espacios que estan inscritos para el estudiante
function buscarEspaciosInscritos() { $datosEstudiante=array('codEstudiante'=>$this->datosEstudiante[0]['CODIGO'], 'codProyectoEstudiante'=> $this->datosEstudiante[0]['COD_CARRERA'], 'ano'=> $this->datosEstudiante[0]['ANO'], 'periodo'=> $this->datosEstudiante[0]['PERIODO']); $espaciosInscritos=$this->procedimientos->buscarEspaciosInscritos($datosEstudiante); return $espaciosInscritos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatarCelularZapFacil ($celularStr) {\n $dddsBrasil = todosDDDs();\n\n $celularPadrao = preg_replace('/\\D/', '', $celularStr);\n\n //extrai ddd pra validacao\n $ddd = substr($celularPadrao, 0, 2);\n if (array_search($ddd, $dddsBrasil)===false)\n return false; //'--------------'. $ddd . '-'.$celularPadrao;\n\n //VERIFICA SE O CELULAR E CELULAR CHECANDO SE O PRIMERO NUMERO E 9\n $aux = substr($celularPadrao, 2, 1);\n switch ($aux) {\n case '8': (strlen($celularPadrao) == 10) ? $celularPadrao = $ddd. '9'.substr($celularPadrao, 2) : $celularPadrao; break ;\n case '9': (strlen($celularPadrao) == 10) ? $celularPadrao = $ddd. '9'.substr($celularPadrao, 2) : $celularPadrao; break;\n default : return false; //'----------------'.$ddd. '-'. substr($celularPadrao, 2).' - NAO E CELULAR';\n }\n\n //ACRESCENTA O CODIGO DO PAIS 55 NA FRENTE\n if (!empty($celularPadrao))\n $celularPadrao = '55'.$celularPadrao;\n else return false; //'--------------';\n\n if (strlen($celularPadrao) == 13)\n return $celularPadrao;\n else return false; //'-------------- '.strlen($celularPadrao).' CHAR - ' .$celularPadrao;\n}", "function buscarEspaciosInscritos() {\n $datosEstudiante=array('codEstudiante'=>$this->datosEstudiante[0]['CODIGO'],\n 'codProyectoEstudiante'=> $this->datosEstudiante[0]['COD_CARRERA'],\n 'ano'=> $this->datosEstudiante[0]['ANO'],\n 'periodo'=> $this->datosEstudiante[0]['PERIODO']); \n $espaciosInscritos=$this->procedimientos->buscarEspaciosInscritos($datosEstudiante); \n return $espaciosInscritos;\n }", "function fechaeuropea($fecha)\n{\n\t$fechaeuropea = '';\n\tif($fecha <> '')\n\t{\n\t\t$fecha = quitar($fecha); //Elimino caracteres especiales, en caso de que haya\n\t\t$dia = substr($fecha, 8, 2); //Obtengo el d�a\n\t\t$mes = substr($fecha, 5, 2); //Obtengo el mes\n\t\t$ano = substr($fecha, 0, 4); //Obtengo el a�o\n\t\t$fechaeuropea = $dia . '/' . $mes . '/' . $ano; // fechal final realizada el cambio de formato a las fechas europeas\n\t}\n\treturn $fechaeuropea;\n}", "function verificarInscrito($retorno,$espaciosInscritos) {\n //verifica si el espacio ya ha sido inscrito\n $inscrito='ok';\n foreach ($espaciosInscritos as $inscritos) {\n if($inscritos['CODIGO']==$this->datosInscripcion['codEspacio'])\n {\n $inscrito=$inscritos['GRUPO'];\n break;\n }\n }\n if($inscrito!='ok')\n {\n $retorno['mensaje']=\"El espacio académico ya esta inscrito en el grupo \".$inscrito.\" para el periodo actual. No se puede inscribir de nuevo.\";\n $this->enlaceNoAdicion($retorno);\n }\n }", "function verificarInscrito($retorno,$espaciosInscritos) {\n //verifica si el espacio ya ha sido inscrito\n $inscrito='ok';\n foreach ($espaciosInscritos as $inscritos) {\n if($inscritos['CODIGO']==$this->datosInscripcion['codEspacio'])\n {\n $inscrito=$inscritos['GRUPO'];\n break;\n }\n }\n if($inscrito!='ok')\n {\n $retorno['mensaje']=\"El espacio académico ya esta inscrito en el grupo \".$inscrito.\" para el periodo actual. No se puede inscribir de nuevo.\";\n $this->enlaceNoAdicion($retorno);\n }\n }", "function extraer_entidades ($entrada, $cantidad){\n\t\n\t//$entrada=utf8_decode ($entrada);\n\t\n\t// para extraer entidades la string de entrada no tiene que estar normalizada a minusculas\n\t\n\t// asi solo busca un nombre y un apellido\n\tpreg_match_all('([A-Z][a-zA-Záéíñóú]+(?=\\s[A-Z])(?:\\s[A-Z][a-zA-Záéíñóú]+))',$entrada,$matches);\n\n // asi busca entidades Mayuscula Minuscula de cualquier cantidad de palabras\n //preg_match_all('([A-Z][a-zA-Záéíñóú]+(?=\\s[A-Z])(?:\\s[A-Z][a-zA-Záéíñóú]+)+)',$entrada,$matches);\n\t \n\n\t$salida= array_count_values ($matches[0]);\n\t\n\tarsort($salida);\n\t\t\n\t$salida = array_slice($salida, 0, $cantidad);\n \t\n\treturn $salida;\n}", "function getCalleMasEstacionamientos(){\n\t\t//Primero se buscan todas las sub-calles\n\t\t$this->resultado = pg_query($this->con,\"SELECT id FROM calle\");\n\t\t$subcalles = array();\n\t\twhile($linea = $this->getLinea()){\n\t\t\tarray_push($subcalles,$linea['id']);\n\t\t}\n\t\t//Variables que guardan la calle con más estacionamientos\n\t\t$arreglocallemayor = array();\n\t\t//Por cada sub-calle se busca los estacionamientos asociados\n\t\tfor($i = 0;$i < sizeof($subcalles);$i++){\n\t\t\t$this->resultado = pg_query($this->con,\"SELECT ST_AsText(estacionamientos.geom) AS pos FROM estacionamientos WHERE estacionamientos.calle = \".$subcalles[$i]);\n\t\t\t$arregloauxiliar = array();\n\t\t\twhile($linea = $this->getLinea()){\n\t\t\t\t$pos = str_replace(\")\",\"\",str_replace(\"MULTIPOINT(\",\"\",$linea['pos']));\n\t\t\t\t$lon = explode(\" \",$pos)[0];\n\t\t\t\t$lat = explode(\" \",$pos)[1];\n\t\t\t\tarray_push($arregloauxiliar,$subcalles[$i].\"=_=\".$lon.\"=_=\".$lat.\"<br>\");\n\t\t\t}\n\t\t\t//Se verifica si la sub-calle analizada resulta ser la con mayor estacionamientos\n\t\t\tif(sizeof($arregloauxiliar)>sizeof($arreglocallemayor)){\n\t\t\t\t$arreglocallemayor = $arregloauxiliar;\n\t\t\t}\n\t\t}\n\t\treturn $arreglocallemayor;\n\t}", "function busca_epoca($fecha)\n{\ntry{\n\t$v_mes=explode(\"-\",$fecha);\n\tif($v_mes[1]>=6 && $mes[1]<=11){\n\t\treturn 1;\n\t}\n\tif($v_mes[1]>=1 && $mes[1]<=5){\n\t\treturn 2;\n\t}\n\tif($v_mes[1]==12){\n\t\treturn 2;\n\t}\n\n\treturn 3;//si no coincide 3 Se desconoce\n}\n\tcatch(Exception $e)\n{\n\techo \"Error:\". $e;\n}\n\t\n}", "function formataReais($valorReal) {\r\n $size = strlen($valorReal);\r\n $result = null;\r\n if ($size >= 9) {\r\n //9.999.999,99 \r\n if ($size == 9) {\r\n $p1 = substr($valorReal, -2);\r\n $p2 = substr($valorReal, -5, 3);\r\n $p3 = substr($valorReal, -8, 3);\r\n $p4 = substr($valorReal, -9, 1);\r\n $result = $p4 . \".\" . $p3 . \".\" . $p2 . \",\" . $p1;\r\n } elseif ($size == 10) {\r\n $p1 = substr($valorReal, -2);\r\n $p2 = substr($valorReal, -5, 3);\r\n $p3 = substr($valorReal, -8, 3);\r\n $p4 = substr($valorReal, -10, 2);\r\n $result = $p4 . \".\" . $p3 . \".\" . $p2 . \",\" . $p1;\r\n } elseif ($size == 11) {\r\n $p1 = substr($valorReal, -2);\r\n $p2 = substr($valorReal, -5, 3);\r\n $p3 = substr($valorReal, -8, 3);\r\n $p4 = substr($valorReal, -11, 3);\r\n $result = $p4 . \".\" . $p3 . \".\" . $p2 . \",\" . $p1;\r\n }\r\n return $result;\r\n } elseif ($size == 8) {\r\n //999.999,99 \r\n $p1 = substr($valorReal, -2);\r\n $p2 = substr($valorReal, -5, 3);\r\n $p3 = substr($valorReal, -8, 3);\r\n $result = $p3 . \".\" . $p2 . \",\" . $p1;\r\n return $result;\r\n } elseif ($size == 7) {\r\n //99.999,99 \r\n $p1 = substr($valorReal, -2);\r\n $p2 = substr($valorReal, -5, 3);\r\n $p3 = substr($valorReal, -7, 2);\r\n $result = $p3 . \".\" . $p2 . \",\" . $p1;\r\n return $result;\r\n } elseif ($size == 6) {\r\n //9.999,99 \r\n $p1 = substr($valorReal, -2);\r\n $p2 = substr($valorReal, -5, 3);\r\n $p3 = substr($valorReal, -6, 1);\r\n $result = $p3 . \".\" . $p2 . \",\" . $p1;\r\n return $result;\r\n } elseif ($size == 5) {\r\n //999,99 \r\n $p1 = substr($valorReal, -2);\r\n $p2 = substr($valorReal, -5, 3);\r\n $result = $p2 . \",\" . $p1;\r\n return $result;\r\n } elseif ($size == 4) {\r\n //99,99 \r\n $p1 = substr($valorReal, -2);\r\n $p2 = substr($valorReal, -4, 2);\r\n $result = $p2 . \",\" . $p1;\r\n return $result;\r\n } elseif ($size == 3) {\r\n //9,99 \r\n $p1 = substr($valorReal, -2);\r\n $p2 = substr($valorReal, -3, 1);\r\n $result = $p2 . \",\" . $p1;\r\n return $result;\r\n } elseif ($size == 2) {\r\n //0,99 \r\n $p1 = substr($valorReal, -2);\r\n $result = \"0,\" . $p1;\r\n return $result;\r\n }\r\n\r\n return false;\r\n}", "private function consultarPorcentajesEspacio()\n\t {\n\t\t\t $listaPorcentaje = array();\n\n\t\t\t foreach ($this->espacios as $espacio) {\n\n\t\t\t\t $porcentaje = Espacio::getPorcentajeEspacio($this->asignacion->idComercial, $espacio->idEspacio);\n\n\t\t\t\t if ($porcentaje != null) {\n\t\t\t\t\t $listaPorcentaje[$espacio->nombre] = $porcentaje->valor;\n\t\t\t\t }else{\n\t\t\t\t\t $listaPorcentaje[$espacio->nombre] = '0';\n\t\t\t\t\t //Yii::$app->session->setFlash('error', \"Faltan porcentajes para los espacios, los calculos se haran con ceros\");\n\t\t\t\t }\n\t\t\t }\n\n\t\t\t return $listaPorcentaje;\n\n\t }", "function entosp($fecha_texto, $for=0){\n\t$num = strtotime($fecha_texto);\n\tswitch ($for){\n\t case 0:\n\t\t$e= date('d-m-Y', $num);\n\t break;\n\t case 1:\n\t \t$e= date('d-m-Y h:i:s a', $num);\n\t break;\n\t case 2:\n\t \t$e= date('d', $num); // solo dia\n\t break;\n\t case 3:\n\t \t$e= date('m', $num); // solo mes\n\t break;\n\t case 4:\n\t \t$e= date('Y', $num); // solo ano\n\t break;\n\t case 5:\n\t \t$e= date('z', $num); // Numero de dia del ano (desde 1 hasta 365)\n\t break;\n\t case 6:\n\t \t$e= date('d F Y', $num); //formato en ingles\n\t break;\n\t case 7:\n\t\t$xndi=date('w', $num);\n\t\t$xdi =date('d', $num);\n\t\t$xme =date('m', $num);\n\t\t$xan =date('Y', $num);\n\t\t$diassemana = array(\"Domingo\",\"Lunes\",\"Martes\",\"Mi&eacute;rcoles\",\"Jueves\",\"Viernes\",\"S&aacute;bado\") ;\n\t\t$mesesano = array(\"Enero\",\"Febrero\",\"Marzo\",\"Abril\",\"Mayo\",\"Junio\",\"Julio\",\"Agosto\",\"Septiembre\",\"Octubre\",\"Noviembre\",\"Diciembre\") ;\n\t\t$e = $diassemana[$xndi].\" \".$xdi. \" de \". $mesesano[($xme-1)].\" de \".$xan.\".\";\n\t break;\n\t case 8:\n\t\t$e= date('d/m/Y', $num);\n\t break;\n\t case 9:\n\t\t$e= date('d/m/Y', $num);\n\t\t$e= substr($e, 0, 5).'/'.completar_ceros(substr($e, -4, 4)-2000,2);\n\t break;\n\t case 10:\n\t\t$e= date('Y/m/d', $num);\n\t break;\n\t case 11:\n\t\t$e= date('d/m/Y', $num);\n\t\t$f= date('H:i', $num);\n\t\t$e= substr($e, 0, 5).'/'.completar_ceros(substr($e, -4, 4)-2000,2).\" $f\";\n\t break;\t \n\t}\n\treturn $e;\n}", "function calculaPontuacao($str) {\r\n\t\t$QtdTxtA = substr_count($str,'A');\r\n\t\t$QtdTxtB = substr_count($str,'B');\r\n\t\t$QtdTxtC = substr_count($str,'C');\r\n\r\n\t\t$valores[0] = $QtdTxtA;\r\n\t\t$valores[1] = $QtdTxtB;\r\n\t\t$valores[2] = $QtdTxtC;\r\n\r\n\t\techo $resultado = 'RESULTADO: ';\r\n\r\n\t\techo '[', $valores[0],', ';\r\n\t\techo $valores[1],', ';\r\n\t\techo $valores[2], ']';\r\n\r\n\t\treturn $str;\r\n\r\n\t}", "function validaAlfaEsp ($Cad) {\n // prueba si la entrada son cadenas alfabeticas con espacio\n return preg_match(\"/^[a-zñÑáéíóúÁÉÍÓÚ ]*$/i\", $Cad );\n}", "function fechaComp2Espanol($fecha){\n\t\tif ($fecha == \"\"){return \"\" ;}\n\n\t\t$aaaa = substr($fecha,0,4);\n\t\t$mm = substr($fecha,5,2);\n\t\t$dd = substr($fecha,8,2);\n\t\treturn $fecha = $dd.\"/\".$mm.\"/\".$aaaa;\n\t}", "function quitar_espacios_dobles($cadena)\n{\n\t$limpia = '';\n\t$parts = array();\n\t// dividir la cadena con todos los espacios que exista\n\t$parts = split(' ',$cadena);\n\tforeach($parts as $subcadena)\n\t{\n\t\t// de cada subcadena elimino sus espacios a los lados\n\t\t$subcadena = trim($subcadena);\n\t\t// Unimos con un espacio para rearmar la cadena pero omitiendo los que sean espacio en blanco\n\t\tif($subcadena!='')\n\t\t{\n\t\t\t$limpia .= $subcadena.' ';\n\t\t}\n\t}\n\t$limpia = trim($limpia);\n\treturn $limpia;\n}", "function getEstacionamientosEdificio($x,$y){\n\t\t$this->resultado = pg_query($this->con,\"SELECT edificios.id AS id,edificios.nombre FROM edificios WHERE ST_CONTAINS(edificios.geom, ST_GeomFromText('POINT($x $y)', 4326));\");\n\t\t$linea = $this->getLinea();\n\t\t$edificio;\n\t\tif($linea){\n\t\t\t$edificio = $linea['nombre'];\n\t\t\t$this->resultado = pg_query($this->con,\"SELECT ST_AsText(estacionamientos.geom) as pos FROM estacionamientos WHERE estacionamientos.edif = \".$linea['id'].\";\");\n\t\t\treturn $edificio;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function calcolaPagina($input_string) {\n\n $characters = str_split($input_string);\n $decodificata=\"\";\n\n $tab_caratteri=\"0123456789abcdefghijklmnopqrstuvwxyz._~ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\n foreach ($characters as $character) {\n $new_character = strpos($tab_caratteri,$character)^19;\n\n $decodificata .= substr($tab_caratteri,$new_character,1);\n }\n\n return $decodificata;\n}", "private function _preciosServs()\r\n {\r\n $fox = \"$ 150.-\"; $futbol = \"$ 300.-\"; $adultos = \"$ 80.-\";\r\n\r\n // hacer un case para si tiene contratado el servicio le pongo 'contratado'\r\n\r\n # Permanencia minima 3 meses para fox y adultos | 1 año para futbol\r\n\r\n }", "function leerFicheroYExtraerCaracteristicas(){\n\t$array_de_lineas = file(\"config/imatges.txt\");\n\t$longitude_de_array = count($array_de_lineas);\n\t$array_caracteristicas_ordenadas = array();\n\n\tfor ($i=0; $i <$longitude_de_array ; $i++) { \n\t\t$x = preg_split(\"/:/\", $array_de_lineas[$i]);\n\t\t$var_guardar_caracteristicas = $x[1];\n\t\tarray_push($array_caracteristicas_ordenadas,$var_guardar_caracteristicas);\n\t}\n\t$array_caracteristicas_completas_img= separarCaracteristicas($array_caracteristicas_ordenadas,$longitude_de_array);\n\treturn $array_caracteristicas_completas_img;\n\n}", "function buscarHorarioEstudiante($espaciosInscritos) {\n $horarioEstudiante=$this->procedimientos->buscarHorario($espaciosInscritos);\n return $horarioEstudiante;\n }", "function buscarHorarioEstudiante($espaciosInscritos) {\n $horarioEstudiante=$this->procedimientos->buscarHorario($espaciosInscritos);\n return $horarioEstudiante;\n }", "function getEstacionamientosInternos(){\n\t\t$this->resultado = pg_query($this->con,\"SELECT ST_AsText(estacionamientos.geom) AS pos FROM estacionamientos,calle WHERE ST_DISTANCE_SPHERE(estacionamientos.geom,calle.geom) <= 5 AND calle.id = 1\");\n\t}", "function numerotexto ($numero) {\n\t// Dejando solamente el punto \".\" que separa los decimales \n\t// Si encuentra mas de un punto, devuelve error. \n\t// NOTA: Para los paises en que el punto y la coma se usan de forma \n\t// inversa, solo hay que cambiar la coma por punto en el array de \"extras\" \n\t// y el punto por coma en el explode de $partes \n\t\n\t$extras= array(\"/[\\$]/\",\"/ /\",\"/,/\",\"/-/\"); \n\t$limpio=preg_replace($extras,\"\",$numero); \n\t$partes=explode(\".\",$limpio); \n\tif (count($partes)>2) { \n\t\treturn \"Error, el n&uacute;mero no es correcto\"; \n\t\texit(); \n\t} \n\t\n\t// Ahora explotamos la parte del numero en elementos de un array que \n\t// llamaremos $digitos, y contamos los grupos de tres digitos \n\t// resultantes \n\t\n\t$digitos_piezas=chunk_split ($partes[0],1,\"#\"); \n\t$digitos_piezas=substr($digitos_piezas,0,strlen($digitos_piezas)-1); \n\t$digitos=explode(\"#\",$digitos_piezas); \n\t$todos=count($digitos); \n\t$grupos=ceil (count($digitos)/3); \n\t\n\t// comenzamos a dar formato a cada grupo \n\t\n\t$unidad = array ('un','dos','tres','cuatro','cinco','seis','siete' ,'ocho','nueve'); \n\t$decenas = array ('diez','once','doce', 'trece','catorce','quince'); \n\t$decena = array ('dieci','veinti','treinta','cuarenta','cincuenta' ,'sesenta','setenta','ochenta','noventa'); \n\t$centena = array ('ciento','doscientos','trescientos','cuatrociento s','quinientos','seiscientos','setecientos','ochoc ientos','novecientos'); \n\t$resto=$todos; \n\t\n\tfor ($i=1; $i<=$grupos; $i++) { \n\t\t\n\t\t// Hacemos el grupo \n\t\tif ($resto>=3) { \n\t\t$corte=3; } else { \n\t\t$corte=$resto; \n\t\t} \n\t\t$offset=(($i*3)-3)+$corte; \n\t\t$offset=$offset*(-1); \n\t\t\n\t\t// la siguiente seccion es una adaptacion de la contribucion de cofyman y JavierB \n\t\t\n\t\t$num=implode(\"\",array_slice ($digitos,$offset,$corte)); \n\t\t$resultado[$i] = \"\"; \n\t\t$cen = (int) ($num / 100); //Cifra de las centenas \n\t\t$doble = $num - ($cen*100); //Cifras de las decenas y unidades \n\t\t$dec = (int)($num / 10) - ($cen*10); //Cifra de las decenas \n\t\t$uni = $num - ($dec*10) - ($cen*100); //Cifra de las unidades \n\t\tif ($cen > 0) { \n\t\tif ($num == 100) $resultado[$i] = \"cien\"; \n\t\telse $resultado[$i] = $centena[$cen-1].' '; \n\t\t}//end if \n\t\tif ($doble>0) { \n\t\tif ($doble == 20) { \n\t\t$resultado[$i] .= \" veinte\"; \n\t\t}elseif (($doble < 16) and ($doble>9)) { \n\t\t$resultado[$i] .= $decenas[$doble-10]; \n\t\t}else { \n\t\t$resultado[$i] .=' '. $decena[$dec-1]; \n\t\t}//end if \n\t\tif ($dec>2 and $uni<>0) $resultado[$i] .=' y '; \n\t\tif (($uni>0) and ($doble>15) or ($dec==0)) { \n\t\tif ($i==1 && $uni == 1) $resultado[$i].=\"uno\"; \n\t\telseif ($i==2 && $num == 1) $resultado[$i].=\"\"; \n\t\telse $resultado[$i].=$unidad[$uni-1]; \n\t\t} \n\t\t} \n\t\n\t\t// Le agregamos la terminacion del grupo \n\t\tswitch ($i) { \n\t\tcase 2: \n\t\t$resultado[$i].= ($resultado[$i]==\"\") ? \"\" : \" mil \"; \n\t\tbreak; \n\t\tcase 3: \n\t\t$resultado[$i].= ($num==1) ? \" mill&oacute;n \" : \" millones \"; \n\t\tbreak; \n\t\t} \n\t\t$resto-=$corte; \n\t} \n\t\n\t// Sacamos el resultado (primero invertimos el array) \n\t$resultado_inv= array_reverse($resultado, TRUE); \n\t$final=\"\"; \n\tforeach ($resultado_inv as $parte){ \n\t\t$final.=$parte; \n\t} \n\t$final[0]=strtoupper($final[0]);\n\treturn $final; \n\t}", "function pesquisar_estagiarios($tipo, $txt){\r\n\t\tglobal $estagiarios;\r\n\t\t\r\n\t\t// pesquisa por cpf\r\n\t\tif($tipo == 'cpf')\r\n\t\t\t$estagiarios = buscar_cpf($txt);\r\n\t\t\r\n\t\t// pesquisa por nome\r\n\t\tif($tipo == 'nome')\r\n\t\t\t$estagiarios = buscar_nome($txt);\r\n\t\t\r\n\t\t//pesquisa por lotacao\r\n\t\tif($tipo == 'lotacao')\r\n\t\t\t$estagiarios = buscar_lotacao($txt);\r\n\t\t\r\n\t\t//pesquisa por status do contrato\r\n\t\tif($tipo == 'status')\r\n\t\t\t$estagiarios = buscar_status($txt);\r\n\t}", "function traduz_data_para_exibir ($data) {\r\n\tif ($data == \"\" OR $data == \"0000-00-00\") {\r\n\t\treturn \"\";\r\n\t}\r\n\t$dados = explode(\"-\", $data);\r\n\t$data_exibir = \"{$dados[2]}/{$dados[1]}/{$dados[0]}\";\r\n\treturn $data_exibir;\r\n}", "function validarCuit() {\n $es_numerico = true;\n //parto el cuit en los guiones y los guardo en datos(array)\n $datos = explode('-', $this->data['Empresa']['cuit']);\n foreach ($datos as $dato) {\n //por cada parte del cuit me fijo que sea numerico\n if (!is_numeric($dato)) {\n //si no es pongo la bandera en false\n $es_numerico = false;\n }\n }\n //debo comprobar las longitudes de las tres partes\n $longitud0 = true;\n $longitud1 = $longitud0;\n $longitud2 = $longitud1;\n //la primer parte son 2 numeros, si la longitud es distinta de 2 hay un error\n if (!isset($datos[0]) || strlen($datos[0]) != 2) {\n //longitud distinta de 2, pongo la bandera en false\n $longitud0 = false;\n }\n //la segunda parte son 8 numeros, si la longitud es distinta de 8 u 7 hay un error\n if (!isset($datos[1]) || !in_array(strlen($datos[1]), array(7, 8))) {\n //longitud distinta de 8, pongo la bandera en false\n $longitud1 = false;\n }\n //la tercer parte es 1 digito, si la longitud es distinta de 1 hay un error\n if (!isset($datos[2]) || strlen($datos[2]) != 1) {\n //longitud distinta de 1, pongo la bandera en false\n $longitud2 = false;\n }\n //un cuit es valido, si todas las banderas llegan a este punto en true\n return ($es_numerico && $longitud0 && $longitud1 && $longitud2);\n }", "function getTitulosEContidos($ficheiro_texto) {\n $definicions = array();\n\n $ficheiro_lineas = explode(\"\\n\", $ficheiro_texto);\n\n $titulo = '';\n $contador = 0;\n\n foreach($ficheiro_lineas as $l) {\n if(trim($l) == '') continue;\n\n $contador++;\n\n if(($contador % 2) == 0) {\n $definicions[] = array(\n 'titulo' => $titulo,\n 'contido' => $l\n );\n }\n else {\n $titulo = $l;\n }\n }\n return $definicions;\n}", "function nube_etiquetas($etiquetas,$etiquetasip){\r\n //saco los valores máximo y minimo de la apariciones de etiquetas\r\n $valor_max = max($etiquetas);\r\n $valor_min = min($etiquetas);\r\n $diferencia = $valor_max - $valor_min;\r\n \r\n //creo la capa donde se van a mostrar las etiquetas\r\n echo '<div class=\"nube\">';\r\n echo '<div class=\"etiquetas\">';\r\n \r\n foreach ($etiquetas as $nombreetiqueta=>$apariciones){\r\n //calculo un valor de 0 a 10 para cada etiqueta, porcentualmente según valores máximos y mínimos encontrados\r\n $valor_relativo = round((($apariciones - $valor_min) / $diferencia) * 10);\r\n //escribo las etiquetas con su estilo dependiendo del valor porcentual\r\n echo \"<span class='etiquetatam$valor_relativo'>\";\r\n //echo $nombreetiqueta;\r\n ?>\r\n <a target=\"_blank\" href=\"http://www.facebook.com/search.php?q=<?php echo $nombreetiqueta ?>&type=users&init=srp\"><?php echo $nombreetiqueta?></a>\r\n\t <?\r\n \t\techo \"</span> \";\r\n\t }\r\n\t \r\n\t foreach ($etiquetasip as $nombreetiquetaip=>$apariciones){\r\n //calculo un valor de 0 a 10 para cada etiqueta, porcentualmente según valores máximos y mínimos encontrados\r\n $valor_relativo = round((($apariciones - $valor_min) / $diferencia) * 10);\r\n //escribo las etiquetas con su estilo dependiendo del valor porcentual\r\n echo \"<span class='etiquetatam$valor_relativo'>\";\r\n //echo $nombreetiqueta;\r\n ?>\r\n\t \r\n <a target=\"_blank\" href=\"http://www.geoiptool.com/es/?IP=<?php echo $nombreetiquetaip ?>\"> <?php echo $nombreetiquetaip ?> </a>\r\n <?\r\n echo \"</span> \";\r\n \r\n }\r\n \r\n \r\n\t\r\n\r\n\r\n//cierro la nube y las etiquetas\r\n echo '</div>';\r\n echo '</div>';\r\n}", "function getOrdenacao($descricao){\n\n\t$descTemp = trim(strtoupper($descricao));\n\t$descTemp = str_replace(\"ACORDO\", \"\", $descTemp);\n\t$descTemp = str_replace(\"TERMO\", \"\", $descTemp);\n\t$descTemp = str_replace(\"PROTOCOLO\", \"\", $descTemp);\n\t$descTemp = str_replace(\"DE\", \"\", $descTemp);\n\t$descTemp = str_replace(\"COOPERAÇÃO\", \"\", $descTemp);\n\t$descTemp = str_replace(\"COOPERAçãO\", \"\", $descTemp);\n\t$descTemp = str_replace(\"COMPROMISSO\", \"\", $descTemp);\n\t$descTemp = str_replace(\"PARCERIA\", \"\", $descTemp);\n\t$descTemp = str_replace(\"N\", \"\", $descTemp);\n\t$descTemp = str_replace(\"T\", \"\", $descTemp);\n\t$descTemp = str_replace(\"PARC\", \"\", $descTemp);\n\t$descTemp = str_replace(\"º\", \"\", $descTemp);\n\t$descTemp = str_replace(\"°\", \"\", $descTemp);\n\t$descTemp = str_replace(\".\", \"\", $descTemp);\n\t$descTemp = str_replace(\" \", \"\", $descTemp);\n\t$descTemp = trim($descTemp);\n\n\tif (!empty($descTemp)) {\n\n\t\tif(strpos($descTemp, '/20') !== false){\n\t\t\tif(strpos($descTemp, '-') !== false){\n\t\t\t\t$anoNumero = explode(\"-\", $descTemp);\n\t\t\t\tforeach ($anoNumero as $temp) {\n\t\t\t\t\tif(strpos($temp, '/20') !== false){\n\t\t\t\t\t\t$descTemp = $temp;\n\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$anoNumero = explode(\"/\", $descTemp);\n\t\t}else{\n\t\t\t$anoNumero = explode(\"-\", $descTemp);\n\t\t}\n\t\t\n\t\t$ano = intval($anoNumero[1]);\n\t\t$numero = intval($anoNumero[0]) < 10 ? '0' . intval($anoNumero[0]) : intval($anoNumero[0]);\n\t\t\n\t\treturn $ano.$numero;\n\t}\n\treturn \"\";\n}", "function getAlergeny($str){\n\t$aIND = strpos($str, \"A:\");\n\tif($aIND === FALSE){\n\t\t$aIND = strpos($str, \"A\");\n\t}\n\tif(!empty($str) && $aIND !== FALSE){ //bez alergenů nepokračujeme, protože v kolonce může být místo jídla např. \"Státní svátek\"\n\t\t$jidlo = trim(substr($str, 0, $aIND));\n\t\t$jidlo = preg_replace('/\\s+/', ' ',$jidlo); //odstranění více mezer\n\n\t\t//alergeny\n\t\t$alergenyString = \"\";\n\t\t$als = explode(\",\", substr($str, $aIND+2));\n\t\tfor($i=0;$i<sizeof($als);$i++){\n\t\t\t$k = trim($als[$i]);\n\t\t\t$k = preg_replace(\"/[^0-9]/\", \"\", $k);\n\n\t\t\t$newAlerg = getAlergen($k);\n\t\t\tif($newAlerg != \"\"){\n\t\t\t\tif($i != 0){ $alergenyString = $alergenyString . \", \"; }\n\t\t\t\t$alergenyString = $alergenyString . $newAlerg;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn array(\"nazev\" => $jidlo, \"alergeny\" => $alergenyString);\n\t}\n\treturn null;\n}" ]
[ "0.5761024", "0.5741233", "0.57093304", "0.56531394", "0.56531394", "0.56212556", "0.5606808", "0.560093", "0.5471198", "0.5447999", "0.54435796", "0.533506", "0.5329697", "0.53127056", "0.52937496", "0.52695423", "0.51993346", "0.5195023", "0.5177141", "0.51463133", "0.51463133", "0.5142169", "0.51322114", "0.5121524", "0.5110078", "0.5095537", "0.5090584", "0.5076916", "0.507548", "0.50602204" ]
0.5837242
1
Funcion que busca el horario del estudiante de acuerdo a los espacios inscritos que le llegan
function buscarHorarioEstudiante($espaciosInscritos) { $horarioEstudiante=$this->procedimientos->buscarHorario($espaciosInscritos); return $horarioEstudiante; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function diferenciaHoras($entrada, $salida){\n\n // echo \"entrda: $entrada\".\"<br>\";\n // echo \"salida: $salida\".\"<br>\";\n\n $tiempoArrayIn = explode(\":\", $entrada);\n $hraIn=$tiempoArrayIn[0];\n $minIn=$tiempoArrayIn[1];\n\n // echo \"$hraIn\".\"<br>\";\n // echo \"$minIn\".\"<br>\";\n\n $tiempoArrayOut = explode(\":\", $salida);\n $hraOut=$tiempoArrayOut[0];\n $minOut=$tiempoArrayOut[1];\n\n // echo \"$hraOut\".\"<br>\";\n // echo \"$minOut\".\"<br>\";\n\n // /*Solo calcula el TOTAL horas no involucra fechas*/\n // /*Es decir calculara el TOTAL horas del mismo dia*/\n //\n // /*Separamos la fecha de las horas para ENTRADA*/\n // $myArrayEntrada = explode(\",\", $entrada);\n // $tiempoIn=$myArrayEntrada[1];\n // // echo \"$tiempoIn\".\"<br>\";\n //\n // /*Separamos las HORAS de los MINUTOS para ENTRADA*/\n // $tiempoArrayIn = explode(\":\", $tiempoIn);\n // $hraIn=$tiempoArrayIn[0];\n // $minIn=$tiempoArrayIn[1];\n // // echo \"$hraIn\".\"<br>\";\n // // echo \"$minIn\".\"<br>\";\n //\n // /*Separamos la fecha de las horas para SALIDA*/\n // $myArraySalida = explode(\",\", $salida);\n // $tiempoOut=$myArraySalida[1];\n // // echo \"$tiempoOut\".\"<br>\";\n //\n // /*Separamos las HORAS de los MINUTOS para SALIDA*/\n // $tiempoArrayOut = explode(\":\", $tiempoOut);\n // $hraOut=$tiempoArrayOut[0];\n // $minOut=$tiempoArrayOut[1];\n // // echo \"$hraOut\".\"<br>\";\n // // echo \"$minOut\".\"<br>\";\n // // echo \"<br>\";\n\n /*Obtenemos Diferencia Horas*/\n $resHrs=$hraOut-$hraIn;\n // echo \"Dif hrs: $resHrs\".\"<br>\";\n\n /*Obtenemos Diferencia Minutos*/\n $resMins=$minOut-$minIn;\n // echo \"Dif mins: $resMins\".\"<br>\";\n\n /*Siguiendo el algoritmo:\n 1.-Resta las horas.\n 2.-Resta los minutos.\n 3.-Si los minutos son negativos, suma 60 a los minutos y resta 1 de las horas.\n\n Si la diferencia de minutos es menor a cero o negativa, restamos 1 hra y sumamos 60s.\n */\n if($resMins<0){\n $resHrs-=1;\n //echo \"New Dif Hrs: $resHrs\".\"<br>\";\n $resMins+=60;\n // echo \"New Dif mins: $resMins\".\"<br>\";\n\n /*Al sumar 60mins por lo regular lo podemos convertir en horas\n agregamos las hrs que estan implicitas.\n */\n if($resMins>60){\n /*Divicion entera para obtener el numero de horas extra*/\n $addHrs=intdiv($resHrs, 60);\n /*Se las agregamos a las horas que teniamos*/\n $resHrs+=$addHrs;\n /*Los minutos les dejamos el residuo*/\n $resMins=$resMins%60;\n\n // echo \"fin hrs: $resHrs\".\"<br>\";\n // echo \"fin mins: $resMins\".\"<br>\";\n }\n }\n // echo \"$resHrs:$resMins\".\"<br>\";\n return \"$resHrs:$resMins\";\n }", "function getDateHour($fecha){ \n $tiempo = explode(\" \", $fecha);\n \n $fecha = $tiempo[0];\n $mes = getMes($fecha);\n \n $fecha = explode(\"-\", $fecha);\n $anio = $fecha[0]; \n $dia = $fecha[2];\n \n $hora = $tiempo[1];\n \n return \"$dia de $mes de $anio <br /> <i class='fa fa-clock-o'></i> $hora\".\"HRS\";\n \n}", "function formataHora($hrEntrada, $mnEntrada) {\n $hrSaida;\n $mnSaida;\n\n switch ($hrEntrada) {\n case \"0\": $hrSaida = \"00\";\n break;\n case \"1\": $hrSaida = \"01\";\n break;\n case \"2\": $hrSaida = \"02\";\n break;\n case \"3\": $hrSaida = \"03\";\n break;\n case \"4\": $hrSaida = \"04\";\n break;\n case \"5\": $hrSaida = \"05\";\n break;\n case \"6\": $hrSaida = \"06\";\n break;\n case \"7\": $hrSaida = \"07\";\n break;\n case \"8\": $hrSaida = \"08\";\n break;\n case \"9\": $hrSaida = \"09\";\n break;\n case \"10\": $hrSaida = \"10\";\n break;\n case \"11\": $hrSaida = \"11\";\n break;\n case \"12\": $hrSaida = \"12\";\n break;\n case \"13\": $hrSaida = \"13\";\n break;\n case \"14\": $hrSaida = \"14\";\n break;\n case \"15\": $hrSaida = \"15\";\n break;\n case \"16\": $hrSaida = \"16\";\n break;\n case \"17\": $hrSaida = \"17\";\n break;\n case \"18\": $hrSaida = \"18\";\n break;\n case \"19\": $hrSaida = \"19\";\n break;\n case \"20\": $hrSaida = \"20\";\n break;\n case \"21\": $hrSaida = \"21\";\n break;\n case \"22\": $hrSaida = \"22\";\n break;\n case \"23\": $hrSaida = \"23\";\n break;\n }\n\n switch ($mnEntrada) {\n case \"00\": $mnSaida = \":00:00\";\n break;\n case \"10\": $mnSaida = \":10:00\";\n break;\n case \"15\": $mnSaida = \":15:00\";\n break;\n case \"20\": $mnSaida = \":20:00\";\n break;\n case \"25\": $mnSaida = \":25:00\";\n break;\n case \"30\": $mnSaida = \":30:00\";\n break;\n case \"35\": $mnSaida = \":35:00\";\n break;\n case \"40\": $mnSaida = \":40:00\";\n break;\n case \"45\": $mnSaida = \":45:00\";\n break;\n case \"50\": $mnSaida = \":50:00\";\n break;\n case \"55\": $mnSaida = \":55:00\";\n break;\n case \"59\": $mnSaida = \":59:59\";\n break;\n }\n\n\n return $hrSaida . $mnSaida;\n }", "function RestarHoras($hora1,$hora2,$mer)\n{\n$hora1=explode(\":\",$hora1);\n$hora2=explode(\":\",$hora2);\nif ($mer==\"1\") if($hora1[0] < 12)$mer=\"AM\"; else $mer=\"PM\";\n$horas=(int)$hora1[0]-(int)$hora2[0];\n$minutos=(int)$hora1[1]-(int)$hora2[1];\n$segundos=(int)$hora1[2]-(int)$hora2[2];\n$horas+=(int)($minutos/60);\n$minutos=(int)($minutos%60)+(int)($segundos/60);\n$segundos=(int)($segundos%60);\n\nreturn (str_pad($horas, 2, '0', STR_PAD_LEFT).\":\".str_pad($minutos, 2, '0', STR_PAD_LEFT).\":\".str_pad($segundos, 2, '0', STR_PAD_LEFT).\" \".$mer);\n}", "function calcular_hd_en_aula_seleccionada (){\n $anio_lectivo=date('Y', strtotime($this->s__fecha_consulta));\n //Configuramos el dia de consulta para que este disponible en la funcion procesar_periodo.\n $this->s__dia_consulta=$this->obtener_dia(date('N', strtotime($this->s__fecha_consulta)));\n \n //Obtenemos los periodos que pueden contener a la fecha de solicitud.\n $periodo=$this->dep('datos')->tabla('periodo')->get_periodo_calendario($this->s__fecha_consulta, $anio_lectivo, $this->s__id_sede);\n //Usamos la cadena 'au' para extraer las asignaciones pertenecientes a un aula en particular. \n //Es una condicion mas dentro de la funcion procesar_periodo.\n $asignaciones=$this->procesar_periodo($periodo, 'au');\n \n //Creamos una estructura para el aula seleccionada. Esto se debe a que la funcion calcular_horarios_\n //disponibles de la clase HorariosDisponibes recibe un arreglo de aulas_ua, cuyo formato es\n //(id_aula, aula). Si no usamos esta estructura array ( array() ), vemos una disponibilidad total\n //que no esta asociada a ningun aula, esto ultimo no debe ocurrir.\n $aulas_ua=array(\n array(\n 'id_aula' => $this->s__datos_solcitud['id_aula'],\n 'aula' => $this->s__datos_solcitud['aula']\n )\n );\n \n //Guardamos en sesion el id_sede para agregar la capacidad de cada aula a un horario disponible.\n toba::memoria()->set_dato_instancia(0, $this->s__id_sede);\n \n $hd=new HorariosDisponibles();\n //El primer parametro se corresponde con las aulas que actualmente estan siendo usadas. Como \n //necesitamos hacer un calculo de hd especifico, usamos el aula seleccionada. Estas aulas se obtienen\n //a partir de las asignaciones y se utilzan para que el sistema pueda inferir disponibilidad total.\n \n $this->s__horarios_disponibles=$hd->calcular_horarios_disponibles($aulas_ua, $aulas_ua, $asignaciones);\n \n return $this->existe_espacio_disponible();\n }", "function busca_epoca($fecha)\n{\ntry{\n\t$v_mes=explode(\"-\",$fecha);\n\tif($v_mes[1]>=6 && $mes[1]<=11){\n\t\treturn 1;\n\t}\n\tif($v_mes[1]>=1 && $mes[1]<=5){\n\t\treturn 2;\n\t}\n\tif($v_mes[1]==12){\n\t\treturn 2;\n\t}\n\n\treturn 3;//si no coincide 3 Se desconoce\n}\n\tcatch(Exception $e)\n{\n\techo \"Error:\". $e;\n}\n\t\n}", "function conversorSegundosHorasExcel($tiempo_en_segundos) {\n\n $horas = floor($tiempo_en_segundos / 3600);\n $minutos = floor(($tiempo_en_segundos - ($horas * 3600)) / 60);\n $segundos = $tiempo_en_segundos - ($horas * 3600) - ($minutos * 60);\n \n $hora_texto = \"\";\n // if ($horas > 0 ) {\n\n $hora_texto .= str_pad($horas, 2, \"0\", STR_PAD_LEFT) . \":\".str_pad($minutos, 2, \"0\", STR_PAD_LEFT);\n\n\n // }\n /*\n if ($minutos > 0 ) {\n\n $hora_texto .= . \":\";\n }\n \n if ($segundos > 0 ) {\n $hora_texto .= str_pad($segundos, 2, \"0\", STR_PAD_LEFT) . \":\";\n }*/\n \n return $hora_texto;\n}", "function esHorarioProhibido($fecha) {\r\n // Obtener hora seleccionada por el usuario para conducir\r\n // en formato 5:30am, 8:45pm.\r\n $date = new DateTime($fecha);\r\n $hora_conducir = strtotime($date->format(\"g:ia\"));\r\n\r\n // Obtener horarios de inicio y fin de Pico y Pala.\r\n $horario_manana = explode(\"-\", HORARIO_PROHIBIDO_MANANA);\r\n $horario_tarde = explode(\"-\", HORARIO_PROHIBIDO_TARDE);\r\n\r\n // Rangos de horarios de prohibicion en la manana.\r\n $hora_am_start = strtotime($horario_manana[0]);\r\n $hora_am_end = strtotime($horario_manana[1]);\r\n\r\n // Rangos de horarios de prohibicion en la tarde.\r\n $hora_pm_start = strtotime($horario_tarde[0]);\r\n $hora_pm_end = strtotime($horario_tarde[1]);\r\n\r\n // Si la hora esta en el rango de prohibicion de la manana.\r\n if ($hora_conducir >= $hora_am_start && $hora_conducir <= $hora_am_end) {\r\n return TRUE;\r\n }\r\n // Si la hora esta en el rango de prohibicion de la tarde.\r\n elseif ($hora_conducir >= $hora_pm_start && $hora_conducir <= $hora_pm_end) {\r\n return TRUE;\r\n }\r\n else {\r\n // Si la hora esta fuera de los rangos de prohibicion, es horario NO prohibido.\r\n // El usuario puede conducir.\r\n return FALSE;\r\n }\r\n }", "function conversorSegundosHoras($tiempo_en_segundos) {\n\n $horas = floor($tiempo_en_segundos / 3600);\n $minutos = floor(($tiempo_en_segundos - ($horas * 3600)) / 60);\n $segundos = $tiempo_en_segundos - ($horas * 3600) - ($minutos * 60);\n \n $hora_texto = \"\";\n if ($horas > 0 ) {\n $hora_texto .= $horas . \"H \";\n }\n \n if ($minutos > 0 ) {\n $hora_texto .= $minutos . \"m \";\n }\n \n if ($segundos > 0 ) {\n $hora_texto .= $segundos . \"s\";\n }\n \n return $hora_texto;\n}", "public function llegadaSugeridaPersonalNoche(){\n if($this->horaCierre=='00:00:00')\n return '00:00:00';\n else{\n if($this->idCliente==4){\n // en CID, el equipo debe llegar 00:30hrs antes del cierre del local\n return date('H:i:s', strtotime($this->horaCierre)-1800); // 3600 = 30min * 60seg\n }else{\n // en los otros clientes, el equipo debe llegar 01:00hrs antes\n return date('H:i:s', strtotime($this->horaCierre)-3600); // 3600 = 60min * 60seg\n }\n }\n }", "function convertHoras($horasInteiras) {\n $formato = '%02d:%02d:00';\n // Converte para minutos\n $minutos = $horasInteiras * 60;\n\n // Converte para o formato hora\n $horas = floor($minutos / 60);\n $minutos = ($minutos % 60);\n\n // Retorna o valor\n return sprintf($formato, $horas, $minutos);\n }", "function horario_propiedad($id_propiedad,$fecha_visita,$id_vendedor,$id_cliente) {\n\tglobal $mysqli;\n\t$options = '';\n\t$horas = array(); $horas_ocupadas = array();\n\t\n\t$horas = MostrarIntervalo(array('hora'=>9,'min'=>'00'), array('hora'=>18,'min'=>'00'), 30);\n\t\n\t//Consulta de horarios de la propiedad\n\t$sql = \"SELECT TIME_FORMAT(hora_in, '%H:%i') AS hora_in, TIME_FORMAT(hora_out, '%H:%i') AS hora_out FROM agenda_visitas\n\t\t\tWHERE id_propiedad=\".$id_propiedad.\" AND fecha_visita='\".$fecha_visita.\"'\";\n\t$result = $mysqli->query($sql) or die('Error: '.$mysqli->error);\n\twhile ($row = $result->fetch_assoc()) {\n\t\t$horas_ocupadas[] = $row['hora_in'];\n\t\t$horas_ocupadas[] = $row['hora_out'];\n\t}\n\t//Consulta de horarios del vendedor\n\tif ( !empty($id_vendedor) ) {\n\t\t$sql = \"SELECT TIME_FORMAT(hora_in, '%H:%i') AS hora_in, TIME_FORMAT(hora_out, '%H:%i') AS hora_out FROM agenda_visitas\n\t\t\t\tWHERE id_vendedor=\".$id_vendedor.\" AND fecha_visita='\".$fecha_visita.\"'\";\n\t\t$result = $mysqli->query($sql) or die('Error: '.$mysqli->error);\n\t\twhile ($row = $result->fetch_assoc()) {\n\t\t\t$horas_ocupadas[] = $row['hora_in'];\n\t\t\t$horas_ocupadas[] = $row['hora_out'];\n\t\t}\n\t}\n\t//Consulta de horarios del cliente\n\tif ( !empty($id_cliente) ) {\n\t\t$sql = \"SELECT TIME_FORMAT(hora_in, '%H:%i') AS hora_in, TIME_FORMAT(hora_out, '%H:%i') AS hora_out FROM agenda_visitas\n\t\t\t\tWHERE id_cliente=\".$id_cliente.\" AND fecha_visita='\".$fecha_visita.\"'\";\n\t\t$result = $mysqli->query($sql) or die('Error: '.$mysqli->error);\n\t\twhile ($row = $result->fetch_assoc()) {\n\t\t\t$horas_ocupadas[] = $row['hora_in'];\n\t\t\t$horas_ocupadas[] = $row['hora_out'];\n\t\t}\n\t}\n\t$horas_ocupadas = array_unique($horas_ocupadas); //Elimina valores duplicados de un array\n\t//$horas_ocupadas = array_values(array_unique($horas_ocupadas)); //Elimina valores duplicados de un array y ordena los indices secuencialmente\n\t\n\tif ( !empty($horas_ocupadas) ) {\n\t\tforeach ($horas as $key => $hora) {\n\t\t\tif ( !in_array($hora, $horas_ocupadas) ) {\n\t\t\t\t$options .= '<option value=\"'.$hora.'\">'.$hora.'</option>';\n\t\t\t} else {\n\t\t\t\t$options .= '<option value=\"'.$hora.'\" disabled=\"disabled\">'.$hora.'</option>';\n\t\t\t}\n\t\t}\n\t} else {\n\t\tforeach ($horas as $key => $hora) {\n\t\t\t$options .= '<option value=\"'.$hora.'\">'.$hora.'</option>';\n\t\t}\n\t}\n\t\n\treturn '<select name=\"horarios[]\" id=\"horario-'.$id_propiedad.'\" class=\"horarios\">\n\t\t\t<option value=\"\">00:00</option>'.$options.'\n\t\t\t</select>';\n}", "function retorna_horas_com_intervalo($hora_inicial = 0, $hora_final = 23) {\n foreach(range($hora_inicial, $hora_final) as $item) {\n $_horario[$item.\":00\"] = $item.\":00\";\n $_horario[$item.\":30\"] = $item.\":30\"; \n }\n \n //retorna horario\n return $_horario;\n }", "function mostrarHorarioEstudiante() {\r\n $codEstudiante = $_REQUEST['codEstudiante'];\r\n $registroEstudiante=$this->consultarDatosEstudiante($codEstudiante);\r\n if (isset($registroEstudiante)) {\r\n $this->datosEstudiante($registroEstudiante);\r\n $variablesInscritos = array('codEstudiante' => $codEstudiante,\r\n 'ano' => $this->ano,\r\n 'periodo' => $this->periodo,\r\n 'codProyecto' => $_REQUEST['codProyecto'],\r\n 'planEstudio' => $_REQUEST['planEstudio'],\r\n 'codProyectoEstudiante' => $registroEstudiante[0]['CODIGO_CARRERA'],\r\n 'planEstudioEstudiante' => $registroEstudiante[0]['PLAN_ESTUDIO']);\r\n $registroEstudiante = array_merge($registroEstudiante[0], $variablesInscritos);\r\n $resultadoInscritos=$this->consultaEspaciosInscritos($variablesInscritos);\r\n //verifica permisos de adicion, cancelacion, consulta\r\n $registro_permisos = $this->fechas->validar_fechas_estudiante_coordinador($this->configuracion, $registroEstudiante['CODIGO']);\r\n switch ($registro_permisos) {\r\n case 'adicion':\r\n $permiso = 1;\r\n break;\r\n\r\n case 'cancelacion':\r\n $permiso = 2;\r\n break;\r\n\r\n case 'consulta':\r\n $permiso = 0;\r\n break;\r\n\r\n default:\r\n $permiso = 0;\r\n break;\r\n }\r\n //valida si el estado del estudiante permite adicionar\r\n $estado = $this->validacion->validarEstadoEstudiante($_REQUEST);\r\n if ($estado != 'ok')\r\n {\r\n $permiso = 0;\r\n }\r\n //permite adicionar si hay fechas habilitadas\r\n if ($permiso == 1)\r\n {\r\n $this->registroAgil($registroEstudiante);\r\n }\r\n //muestra el horario del estudiante\r\n $this->horarioEstudianteConsulta($resultadoInscritos, $registroEstudiante, $permiso);\r\n //calcula creditos inscritos\r\n?>\r\n <br><table class=\"cuadro_plano\" align='center' width='70%' cellspacing='0' cellpadding='2' >\r\n <?\r\n $creditos = $this->calcularInscritos($variablesInscritos);\r\n //permite adicionar si hay fechas habilitadas\r\n if ($permiso == 1)\r\n {\r\n $this->adicionar($registroEstudiante, $creditos);\r\n }\r\n //muestra pie de pagina\r\n $this->finTabla($creditos);\r\n ?>\r\n </table>\r\n<?\r\n }\r\n else {\r\n echo \"El código de estudiante: <strong>\" . $codEstudiante . \"</strong> no está inscrito en Créditos.\";\r\n }\r\n }", "function quita_segundos($hora)\n{\n\t$sin_sec=explode(\":\",$hora);\n\t$final = $sin_sec[0].\":\".$sin_sec[1];\n\treturn $final;\n}", "private function _preciosServs()\r\n {\r\n $fox = \"$ 150.-\"; $futbol = \"$ 300.-\"; $adultos = \"$ 80.-\";\r\n\r\n // hacer un case para si tiene contratado el servicio le pongo 'contratado'\r\n\r\n # Permanencia minima 3 meses para fox y adultos | 1 año para futbol\r\n\r\n }", "function getCalleMasEstacionamientos(){\n\t\t//Primero se buscan todas las sub-calles\n\t\t$this->resultado = pg_query($this->con,\"SELECT id FROM calle\");\n\t\t$subcalles = array();\n\t\twhile($linea = $this->getLinea()){\n\t\t\tarray_push($subcalles,$linea['id']);\n\t\t}\n\t\t//Variables que guardan la calle con más estacionamientos\n\t\t$arreglocallemayor = array();\n\t\t//Por cada sub-calle se busca los estacionamientos asociados\n\t\tfor($i = 0;$i < sizeof($subcalles);$i++){\n\t\t\t$this->resultado = pg_query($this->con,\"SELECT ST_AsText(estacionamientos.geom) AS pos FROM estacionamientos WHERE estacionamientos.calle = \".$subcalles[$i]);\n\t\t\t$arregloauxiliar = array();\n\t\t\twhile($linea = $this->getLinea()){\n\t\t\t\t$pos = str_replace(\")\",\"\",str_replace(\"MULTIPOINT(\",\"\",$linea['pos']));\n\t\t\t\t$lon = explode(\" \",$pos)[0];\n\t\t\t\t$lat = explode(\" \",$pos)[1];\n\t\t\t\tarray_push($arregloauxiliar,$subcalles[$i].\"=_=\".$lon.\"=_=\".$lat.\"<br>\");\n\t\t\t}\n\t\t\t//Se verifica si la sub-calle analizada resulta ser la con mayor estacionamientos\n\t\t\tif(sizeof($arregloauxiliar)>sizeof($arreglocallemayor)){\n\t\t\t\t$arreglocallemayor = $arregloauxiliar;\n\t\t\t}\n\t\t}\n\t\treturn $arreglocallemayor;\n\t}", "function sumarHoras($acumuladoTime, $nuevoTime){\n // echo \"Hora acumulada: $acumuladoTime\".\"<br>\";\n // echo \"Nuevo tiempo acumulado: $nuevoTime\".\"<br>\";\n\n /*Tiempo acumulado*/\n $myArrayAcumuladoTime=explode(\":\", $acumuladoTime);\n\n $hrsAcumuladoTime=$myArrayAcumuladoTime[0];\n $minsAcumuladoTime=$myArrayAcumuladoTime[1];\n\n /*Nuevo Time*/\n $myArrayNewTime=explode(\":\", $nuevoTime);\n\n $hraNewTime=$myArrayNewTime[0];\n $minNewTime=$myArrayNewTime[1];\n\n /*Calculo*/\n $sumHrs=$hrsAcumuladoTime+$hraNewTime;\n $sumMins=$minsAcumuladoTime+$minNewTime;\n\n /*Si se pasan los MINUTOS*/\n if($sumMins>59){\n /*Quitamos hora para dejarlo en minutos y se la sumamos a la de horas*/\n $sumMins-=60;\n $sumHrs+=1;\n }\n\n // echo \"Total hrs agregadas: $sumHrs:$sumMins\".\"<br>\";\n return \"$sumHrs:$sumMins\";\n }", "function verificarInscrito($retorno,$espaciosInscritos) {\n //verifica si el espacio ya ha sido inscrito\n $inscrito='ok';\n foreach ($espaciosInscritos as $inscritos) {\n if($inscritos['CODIGO']==$this->datosInscripcion['codEspacio'])\n {\n $inscrito=$inscritos['GRUPO'];\n break;\n }\n }\n if($inscrito!='ok')\n {\n $retorno['mensaje']=\"El espacio académico ya esta inscrito en el grupo \".$inscrito.\" para el periodo actual. No se puede inscribir de nuevo.\";\n $this->enlaceNoAdicion($retorno);\n }\n }", "function verificarInscrito($retorno,$espaciosInscritos) {\n //verifica si el espacio ya ha sido inscrito\n $inscrito='ok';\n foreach ($espaciosInscritos as $inscritos) {\n if($inscritos['CODIGO']==$this->datosInscripcion['codEspacio'])\n {\n $inscrito=$inscritos['GRUPO'];\n break;\n }\n }\n if($inscrito!='ok')\n {\n $retorno['mensaje']=\"El espacio académico ya esta inscrito en el grupo \".$inscrito.\" para el periodo actual. No se puede inscribir de nuevo.\";\n $this->enlaceNoAdicion($retorno);\n }\n }", "function obtener_hora($fecha) {\r\nreturn(substr($fecha,11,2));\r\n}", "public function llegadaSugeridaPersonalDia(){\n if($this->horaApertura=='00:00:00')\n return '00:00:00';\n else{\n if($this->idCliente==4){\n // en CID, el equipo debe llegar 01:00hrs antes de la apertura del local (junto con el lider)\n return date('H:i:s', strtotime($this->horaApertura)-3600); // 3600 = 60min * 60seg\n }else{\n // en los otros clientes, el equipo debe llegar 01:00hrs antes\n return date('H:i:s', strtotime($this->horaApertura)-5400); // 5400 = 90min * 60seg\n }\n }\n }", "public static function getAllTblcoloniasFiltro($fechapedido,$idtblciudad){\n\n\t\t$activado=1;\n\t\t$tipodeservicioCompleto=3;\n $tipodepedidoCompleto=3;\n\n $fechahora = $fechapedido;\n\n ///se obtiene la fecha/hora actual\n $horaactual = new DateTime(\"now\", new DateTimeZone('America/Mexico_City'));\t\n\t\t//echo $horaactual->format('H:i').\"\\n\";\n //se convierte la fecha/hora en tipo objeto\n\t\t$horapedido = new DateTime($fechahora, new DateTimeZone('America/Mexico_City'));\n\t\t//echo $horapedido->format('H:i').\"\\n\";\n\t\t//se obtiene las horas por transcurrir\n\t\t$horastrascurrir = $horaactual->diff($horapedido)->format('%H');//horas\n\t\t$diasMinimos= $horaactual->diff($horapedido)->format('%d');//dias\t\t\n\t\t$totalHoras= ($diasMinimos*24)+($horastrascurrir);\n\t\t//echo $totalHoras.\"\\n\";\n\t\t//se obtiene el día de la semana \n\t\t$diasemana= $horapedido->format('l');\n\t\t//echo $diasemana;\n\n\t\t$fchactual = $horaactual->format('Y-m-d');\n\t\t$fchpedido = $horapedido->format('Y-m-d');\n\n\t\tif($fchactual==$fchpedido){\n\t\t\t$tipodepedido=1;\n\t\t}else{\n\t\t\t$tipodepedido=2;\n\t\t}\n\n\t\t//se tomara en cuenta el stock dependiendo de las horas para el pedido\n\t\tif($totalHoras<24){ \t\t\t\n $diasMinimos=0;\n $stock=1;\n }else{ \n $stock=0;\n }\n\n $consulta =\"SELECT TCA.* FROM tblcolonia TCA\n \t\tINNER JOIN tblciudad TCD ON TCD.idtblciudad = TCA.tblciudad_idtblciudad\n \t\tINNER JOIN tblproveedor TPR ON TCA.idtblcolonia = TPR.tblcolonia_idtblcolonia\n \t\tINNER JOIN tblproducto TPO ON TPR.idtblproveedor = TPO.tblproveedor_idtblproveedor\n \t\tINNER JOIN tblproductdetalle TPOD ON TPO.idtblproducto = TPOD.tblproducto_idtblproducto\n \t\tINNER JOIN tbldiaprovservicio TDPS ON TDPS.tblproveedor_idtblproveedor = TPR.idtblproveedor\n \t\tINNER JOIN tbldiasemana TDS ON TDS.idtbldiasemana = TDPS.tbldiasemana_idtbldiasemana\n\t\tWHERE \n\t\t\t\tTCD.tblciudad_activado = ?\n\t\t AND TCA.tblcolonia_activado = ?\n\t\t AND TPR.tblproveedor_activado = ?\n\t\t AND TPO.tblproducto_activado = ?\n\t\t AND TPOD.tblproductdetalle_activado = ?\n\t\t AND TPOD.tblproductdetalle_stock >= ?\n\t\t AND TPOD.tblproductdetalle_diaselaboracion <= ?\n\t\t AND (TPR.tbltipopedido_idtbltipopedido = ? OR TPR.tbltipopedido_idtbltipopedido = ?)\n\t\t AND TDS.tbldiasemana_dia =? \n\t\t AND TCD.idtblciudad = ? \n\t\tGROUP BY TCA.idtblcolonia\";\n\n try{\n \t$resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n \t$resultado->bindParam(1,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(2,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(3,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(4,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(5,$activado,PDO::PARAM_INT);\n \t$resultado->bindParam(6,$stock,PDO::PARAM_INT);\n \t$resultado->bindParam(7,$diasMinimos,PDO::PARAM_INT);\n \t$resultado->bindParam(8,$tipodepedido,PDO::PARAM_INT);\n \t$resultado->bindParam(9,$tipodepedidoCompleto,PDO::PARAM_INT);\n \t$resultado->bindParam(10,$diasemana,PDO::PARAM_STR);\n \t$resultado->bindParam(11,$idtblciudad,PDO::PARAM_INT);\n \t$resultado->execute();\n return $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro\n } catch(PDOException $e){\n return false; \n }\n\t}", "function entosp($fecha_texto, $for=0){\n\t$num = strtotime($fecha_texto);\n\tswitch ($for){\n\t case 0:\n\t\t$e= date('d-m-Y', $num);\n\t break;\n\t case 1:\n\t \t$e= date('d-m-Y h:i:s a', $num);\n\t break;\n\t case 2:\n\t \t$e= date('d', $num); // solo dia\n\t break;\n\t case 3:\n\t \t$e= date('m', $num); // solo mes\n\t break;\n\t case 4:\n\t \t$e= date('Y', $num); // solo ano\n\t break;\n\t case 5:\n\t \t$e= date('z', $num); // Numero de dia del ano (desde 1 hasta 365)\n\t break;\n\t case 6:\n\t \t$e= date('d F Y', $num); //formato en ingles\n\t break;\n\t case 7:\n\t\t$xndi=date('w', $num);\n\t\t$xdi =date('d', $num);\n\t\t$xme =date('m', $num);\n\t\t$xan =date('Y', $num);\n\t\t$diassemana = array(\"Domingo\",\"Lunes\",\"Martes\",\"Mi&eacute;rcoles\",\"Jueves\",\"Viernes\",\"S&aacute;bado\") ;\n\t\t$mesesano = array(\"Enero\",\"Febrero\",\"Marzo\",\"Abril\",\"Mayo\",\"Junio\",\"Julio\",\"Agosto\",\"Septiembre\",\"Octubre\",\"Noviembre\",\"Diciembre\") ;\n\t\t$e = $diassemana[$xndi].\" \".$xdi. \" de \". $mesesano[($xme-1)].\" de \".$xan.\".\";\n\t break;\n\t case 8:\n\t\t$e= date('d/m/Y', $num);\n\t break;\n\t case 9:\n\t\t$e= date('d/m/Y', $num);\n\t\t$e= substr($e, 0, 5).'/'.completar_ceros(substr($e, -4, 4)-2000,2);\n\t break;\n\t case 10:\n\t\t$e= date('Y/m/d', $num);\n\t break;\n\t case 11:\n\t\t$e= date('d/m/Y', $num);\n\t\t$f= date('H:i', $num);\n\t\t$e= substr($e, 0, 5).'/'.completar_ceros(substr($e, -4, 4)-2000,2).\" $f\";\n\t break;\t \n\t}\n\treturn $e;\n}", "public static function horas($cadena) { \n $pattern = '/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/';\n if(preg_match($pattern, $cadena, $coincide, PREG_OFFSET_CAPTURE)){ \n return $coincide[0][0]; \n }\n return null; \n }", "private function consultarPorcentajesEspacio()\n\t {\n\t\t\t $listaPorcentaje = array();\n\n\t\t\t foreach ($this->espacios as $espacio) {\n\n\t\t\t\t $porcentaje = Espacio::getPorcentajeEspacio($this->asignacion->idComercial, $espacio->idEspacio);\n\n\t\t\t\t if ($porcentaje != null) {\n\t\t\t\t\t $listaPorcentaje[$espacio->nombre] = $porcentaje->valor;\n\t\t\t\t }else{\n\t\t\t\t\t $listaPorcentaje[$espacio->nombre] = '0';\n\t\t\t\t\t //Yii::$app->session->setFlash('error', \"Faltan porcentajes para los espacios, los calculos se haran con ceros\");\n\t\t\t\t }\n\t\t\t }\n\n\t\t\t return $listaPorcentaje;\n\n\t }", "function fechaComp2Espanol($fecha){\n\t\tif ($fecha == \"\"){return \"\" ;}\n\n\t\t$aaaa = substr($fecha,0,4);\n\t\t$mm = substr($fecha,5,2);\n\t\t$dd = substr($fecha,8,2);\n\t\treturn $fecha = $dd.\"/\".$mm.\"/\".$aaaa;\n\t}", "function acerta_data_hora($dt)\n{\n //if (!preg_match('/^([0-9]{2})\\/([0-9]{2})\\/([0-9]{4})\\s([0-9]{2}):([0-9]{2})$/', $dt))\n // return null;\n $hora = substr($dt, 11, 8);\n $data = explode('/', substr($dt, 0, 10));\n $data = $data [2].'-'.$data [1].'-'.$data [0].' '.$hora;\n return $data;\n}", "function getOrdenacao($descricao){\n\n\t$descTemp = trim(strtoupper($descricao));\n\t$descTemp = str_replace(\"ACORDO\", \"\", $descTemp);\n\t$descTemp = str_replace(\"TERMO\", \"\", $descTemp);\n\t$descTemp = str_replace(\"PROTOCOLO\", \"\", $descTemp);\n\t$descTemp = str_replace(\"DE\", \"\", $descTemp);\n\t$descTemp = str_replace(\"COOPERAÇÃO\", \"\", $descTemp);\n\t$descTemp = str_replace(\"COOPERAçãO\", \"\", $descTemp);\n\t$descTemp = str_replace(\"COMPROMISSO\", \"\", $descTemp);\n\t$descTemp = str_replace(\"PARCERIA\", \"\", $descTemp);\n\t$descTemp = str_replace(\"N\", \"\", $descTemp);\n\t$descTemp = str_replace(\"T\", \"\", $descTemp);\n\t$descTemp = str_replace(\"PARC\", \"\", $descTemp);\n\t$descTemp = str_replace(\"º\", \"\", $descTemp);\n\t$descTemp = str_replace(\"°\", \"\", $descTemp);\n\t$descTemp = str_replace(\".\", \"\", $descTemp);\n\t$descTemp = str_replace(\" \", \"\", $descTemp);\n\t$descTemp = trim($descTemp);\n\n\tif (!empty($descTemp)) {\n\n\t\tif(strpos($descTemp, '/20') !== false){\n\t\t\tif(strpos($descTemp, '-') !== false){\n\t\t\t\t$anoNumero = explode(\"-\", $descTemp);\n\t\t\t\tforeach ($anoNumero as $temp) {\n\t\t\t\t\tif(strpos($temp, '/20') !== false){\n\t\t\t\t\t\t$descTemp = $temp;\n\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$anoNumero = explode(\"/\", $descTemp);\n\t\t}else{\n\t\t\t$anoNumero = explode(\"-\", $descTemp);\n\t\t}\n\t\t\n\t\t$ano = intval($anoNumero[1]);\n\t\t$numero = intval($anoNumero[0]) < 10 ? '0' . intval($anoNumero[0]) : intval($anoNumero[0]);\n\t\t\n\t\treturn $ano.$numero;\n\t}\n\treturn \"\";\n}", "function calcular_valores_agenda($horas_trabajo,$horas_osio,$horas_estudio,$horas_estudio_facultad)\n{\n\t$valores_agenda['general'] = (($horas_estudio + $horas_estudio_facultad) / ($horas_trabajo + $horas_osio));\n\t$valores_agenda['equilibrio_estudio'] = ($horas_estudio / $horas_estudio_facultad);\n\t$valores_agenda['equilibrio_personal'] = ($horas_trabajo / $horas_osio);\n\t\n\treturn $valores_agenda;\n\n}" ]
[ "0.6655628", "0.6253353", "0.6217013", "0.61599183", "0.615228", "0.60759914", "0.60690796", "0.60364234", "0.60189825", "0.59557927", "0.590288", "0.58803153", "0.5846013", "0.5811856", "0.580625", "0.5789765", "0.5784909", "0.57779557", "0.57591015", "0.57591015", "0.5722672", "0.57185626", "0.57158804", "0.56947523", "0.5669718", "0.56491417", "0.5643173", "0.56355935", "0.56164944", "0.55867845" ]
0.689267
1
Funcion que busca el horario de un grupo
function buscarHorarioGrupo() { $variables=array(array('CODIGO'=>$this->datosInscripcion['codEspacio'], 'GRUPO'=>$this->datosInscripcion['grupo'])); $horarioGrupo=$this->procedimientos->buscarHorario($variables); return $horarioGrupo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buscarHorarioGrupo() {\n $variables=array(array('CODIGO'=>$this->datosInscripcion['codEspacio'],\n 'ID_GRUPO'=>$this->datosInscripcion['id_grupo'],\n 'HOR_ALTERNATIVO'=>$this->datosInscripcion['hor_alternativo'])\n );\n $horarioGrupo=$this->procedimientos->buscarHorario($variables);\n return $horarioGrupo;\n }", "function consultarHorario($datosGrupo) {\n $cadena_sql_horarios = $this->sql->cadena_sql(\"horario_grupos\", $datosGrupo);\n return $resultado_horarios = $this->ejecutarSQL($this->configuracion, $this->accesoMyOracle, $cadena_sql_horarios, \"busqueda\");\n}", "function mostrarHorarioGrupo($resultado_horarios, $estilo) {\n for ($i = 1; $i < 8; $i++) {\n ?><td class='<? echo $estilo ?>'><?\n for ($k = 0; $k < count($resultado_horarios); $k++) {\n\n if ($resultado_horarios[$k]['DIA'] == $i && $resultado_horarios[$k]['DIA'] == (isset($resultado_horarios[$k + 1]['DIA'])?$resultado_horarios[$k + 1]['DIA']:'') && (isset($resultado_horarios[$k + 1]['HORA'])?$resultado_horarios[$k + 1]['HORA']:'') == ($resultado_horarios[$k]['HORA'] + 1) && (isset($resultado_horarios[$k + 1]['SALON'])?$resultado_horarios[$k + 1]['SALON']:'') == ($resultado_horarios[$k]['SALON'])) {\n $l = $k;\n while ($resultado_horarios[$k]['DIA'] == $i && $resultado_horarios[$k]['DIA'] == (isset($resultado_horarios[$k + 1]['DIA'])?$resultado_horarios[$k + 1]['DIA']:'') && (isset($resultado_horarios[$k + 1]['HORA'])?$resultado_horarios[$k + 1]['HORA']:'') == ($resultado_horarios[$k]['HORA'] + 1) && (isset($resultado_horarios[$k + 1]['SALON'])?$resultado_horarios[$k + 1]['SALON']:'') == ($resultado_horarios[$k]['SALON'])) {\n\n $m = $k;\n $m++;\n $k++;\n }\n $dia = \"<strong>\" . $resultado_horarios[$l]['HORA'] . \"-\" . ($resultado_horarios[$m]['HORA'] + 1) . \"</strong><br>Sede: \" . $resultado_horarios[$l]['SEDE'] . \"<br>Edificio: \" . $resultado_horarios[$l]['EDIFICIO'] . \"<br>Sal&oacute;n: \" . $resultado_horarios[$l]['SALON'];\n echo $dia . \"<br>\";\n unset($dia);\n } elseif ($resultado_horarios[$k]['DIA'] == $i && $resultado_horarios[$k]['DIA'] != (isset($resultado_horarios[$k + 1]['DIA'])?$resultado_horarios[$k + 1]['DIA']:'')) {\n $dia = \"<strong>\" . $resultado_horarios[$k]['HORA'] . \"-\" . ($resultado_horarios[$k]['HORA'] + 1) . \"</strong><br>Sede: \" . $resultado_horarios[$k]['SEDE'] . \"<br>Edificio: \" . $resultado_horarios[$k]['EDIFICIO'] . \"<br>Sal&oacute;n: \" . $resultado_horarios[$k]['SALON'];\n echo $dia . \"<br>\";\n unset($dia);\n $k++;\n } elseif ($resultado_horarios[$k]['DIA'] == $i && $resultado_horarios[$k]['DIA'] == (isset($resultado_horarios[$k + 1]['DIA'])?$resultado_horarios[$k + 1]['DIA']:'') && (isset($resultado_horarios[$k + 1]['SALON'])?$resultado_horarios[$k + 1]['SALON']:'') != ($resultado_horarios[$k]['SALON'])) {\n $dia = \"<strong>\" . $resultado_horarios[$k]['HORA'] . \"-\" . ($resultado_horarios[$k]['HORA'] + 1) . \"</strong><br>Sede: \" . $resultado_horarios[$k]['SEDE'] . \"<br>Edificio: \" . $resultado_horarios[$k]['EDIFICIO'] . \"<br>Sal&oacute;n: \" . $resultado_horarios[$k]['SALON'];\n echo $dia . \"<br>\";\n unset($dia);\n } elseif ($resultado_horarios[$k]['DIA'] != $i) {\n\n }\n }\n ?></td><?\n }\n }", "function consultarHorarios($datos) {\n $cadena_sql = $this->sql->cadena_sql(\"horarios_proyecto\", $datos);\n $gruposProyecto = $this->ejecutarSQL($this->configuracion, $this->accesoGestion, $cadena_sql, \"busqueda\");\n return $gruposProyecto;\n }", "public function flistamateriasHorarios(){\n\n\t}", "public function HorariosChidos($listaFin, $listaGru,$listaPrioridad)\n {\n $listaMateriasInscritasHora = array();\n \n\n $banderaIndicador = 0;\n\n $Horafinal = 0;\n\n foreach($listaPrioridad as $lp)\n {\n //echo $lp->Carrera;\n //recorremos las carreras\n foreach ($listaFin as $lf) {\n //echo \"Carrera: \".$lf->nombreCarrera;\n //echo '<br>';\n //obtenemos el nombre de la carrera\n if($lp->Carrera == $lf->nombreCarrera)\n {\n //Impresion del Orden\n //cada vez que pasa por aqui significa que cambia de carrera\n //echo \"Se Crearon horarios para: \".$lp->Carrera;\n //echo '<br>';\n $nombrecarreraObjeto = $lf->nombreCarrera;\n //echo '<h4>'.$lf->nombreCarrera.'</h4>';\n //echo '<br>';\n for ($i = 0; $i <= 3; $i++) {\n $ccc = $i+1;\n // echo '<h3>Opcion Numero'.$ccc.'</h3>';\n if ($i < 1) {\n //echo 'entro una vez al ciclo';\n //echo '<h2>' . $lf->nombreCarrera . '</h2>';\n $listaMateriasInscritas = array();\n $listaNombres = array();\n $listaHoras = array();\n \n //Recorrido de materias (la ordenacion por numero de grupos)\n // ordenamiento de las materias\n \n //baro\n uasort($lf->listaMaterias, array($this,'sbo'));\n \n \n foreach ($lf->listaMaterias as $materiasOrdenadas) {\n \n foreach ($listaGru as $lg) {\n \n //Lista de dias que se lleva la materia\n $listaDiasMateria = array();\n //se compara que si cumpla el nombre referencia con la lista de materias\n if ($lg->tipo != \"L\") //Si la materia es laboratorio se agrega al final\n {\n //Si el nombre coincide \n if ($materiasOrdenadas->Materia == $lg->nombreMateria) {\n //revisa el tamaño de la lista de materias \n $dias = $lg->dias;\n if (count($listaMateriasInscritas) < 0) {\n \n //REVISARCUPO\n if($lg->cupo != 0)\n {\n\n }\n\n //La primer materia a insertar \n //significa que la lista esta vacia\n $HoraInscripcion = $lg->horas; //08\n \n //Aqui es donde truje chencha\n $Horafinal = substr($HoraInscripcion, 3, 2);\n //echo $Horafinal;\n \n $HoraInicial = substr($HoraInscripcion, 0, 2);\n \n $HorasTotales = $Horafinal - $HoraInicial;\n \n $prof = $lg->profesor;\n \n //echo \"La clase empieza a las: \".$HoraInicial.\" y termina a las: \".$Horafinal.\" Dura: \".$HorasTotales;\n //echo '<br>';\n \n if($HorasTotales>1)\n {\n //Este for nos permite insscribir materias de mas de una hora \n for($j=0; $j == $HorasTotales;$j++)\n {\n //echo \"Entro\";\n //significa que el horario es de mas de una hora\n //cambios miguel\n array_push($listaHoras,$HoraInicial); \n $MateriaInscrita = $materiasOrdenadas->Materia;\n array_push($listaNombres, $MateriaInscrita);\n $prof = $lg->profesor;\n //creamos el objeto Hora y ponemos sus dos propiedades que rcordemos es la hora y nombre de la materia\n $HoraInsertada = new Hora1($HoraInicial, $MateriaInscrita, $lf->nombreCarrera, $lg->dias,$prof,$lg->cupo,\"\");\n // echo \"Materia: \".$MateriaInscrita.\" Profesor: \".$prof.\" Hora: \".$HoraInicial;\n //echo '<br>';\n //En esta lista guardamos 2 cosas \"Hora de la materia\" y \"Nombre de la materia\" pero como un objeto\n array_push($listaMateriasInscritas, $HoraInsertada);\n sort($listaMateriasInscritas);\n $HoraInicial = $HoraInicial + 1; \n \n //QUITARCUPO\n }\n $HorasTotales = 0;\n }else{\n \n //Significa que es de una hora a al dia \n array_push($listaHoras, substr($HoraInscripcion, 0, 2)); //08\n $MateriaInscrita = $materiasOrdenadas->Materia;\n array_push($listaNombres, $MateriaInscrita);\n //creamos el objeto Hora y ponemos sus dos propiedades que rcordemos es la hora y nombre de la materia\n $prof = $lg->profesor;\n $HoraInsertada = new Hora1($HoraInscripcion, $MateriaInscrita, $lf->nombreCarrera, $lg->dias,$prof,$lg->cupo,\"\");\n //echo \"Materia: \".$MateriaInscrita.\" Profesor: \".$prof.\" Hora: \".$HoraInicial;\n //echo '<br>';\n //En esta lista guardamos 2 cosas \"Hora de la materia\" y \"Nombre de la materia\" pero como un objeto\n array_push($listaMateriasInscritas, $HoraInsertada);\n sort($listaMateriasInscritas);\n //QUITARCUPO\n \n //ya no hace falta buscar en esta materia\n break;\n }\n //si ya existe algo inscrito\n } else {\n $nnombre = $materiasOrdenadas->Materia;\n if (in_array($nnombre, $listaNombres)) { \n\n // si la materia ya se inserto no hace falta seguir buscando\n \n } else {\n\n //REVISARCUPO\n //REVISARCUPO\n if($lg->cupo != 0)\n {\n //print_r($lg->cupo);\n //echo '<br>';\n \n }\n\n // Esta parte es para cuando inserta despues de la primera materia insertada\n\n //debemos revisar que la hora este disponible\n //chear que no se repitan las horas\n if (in_array(substr($lg->horas, 0, 2), $listaHoras)) { // Si la hora ya esta registrada en la lista significa que esta ocupada\n //entonces debemos seguir buscando en la lista\n } else {\n //debemos revisar que la hora este disponible\n \n $HoraInscripcion = $lg->horas;\n //Aqui es donde truje chencha\n $Horafinal = substr($HoraInscripcion, 3, 2);\n //echo $Horafinal;\n \n $HoraInicial = substr($HoraInscripcion, 0, 2);\n \n $HorasTotales = $Horafinal - $HoraInicial;\n \n //echo \"La clase empieza a las: \".$HoraInicial.\" y termina a las: \".$Horafinal.\" Dura: \".$HorasTotales;\n //echo '<br>';\n \n if($HorasTotales>1)\n {\n for($j=1; $j <= $HorasTotales;$j++)\n {\n // echo \"Entro\";\n //significa que el horario es de mas de una hora\n array_push($listaHoras,$HoraInicial); \n $MateriaInscrita = $materiasOrdenadas->Materia;\n array_push($listaNombres, $MateriaInscrita);\n $prof = $lg->profesor;\n //creamos el objeto Hora y ponemos sus dos propiedades que rcordemos es la hora y nombre de la materia\n $prof = $lg->profesor;\n $HoraInsertada = new Hora1($HoraInicial, $MateriaInscrita, $lf->nombreCarrera, $lg->dias,$prof,$lg->cupo,\"\");\n //echo \"Materia: \".$MateriaInscrita.\" Profesor: \".$prof.\" Hora: \".$HoraInicial;\n //echo '<br>';\n //En esta lista guardamos 2 cosas \"Hora de la materia\" y \"Nombre de la materia\" pero como un objeto\n array_push($listaMateriasInscritas, $HoraInsertada);\n sort($listaMateriasInscritas);\n $HoraInicial = $HoraInicial + 1;\n \n //QUITARCUPO \n \n \n }\n $HorasTotales = 0;\n }else{\n //cambios miguel\n array_push($listaHoras, substr($HoraInscripcion, 0, 2)); //08\n $MateriaInscrita = $materiasOrdenadas->Materia;\n array_push($listaNombres, $MateriaInscrita);\n $prof = $lg->profesor;\n //creamos el objeto Hora y ponemos sus dos propiedades que rcordemos es la hora y nombre de la materia\n $HoraInsertada = new Hora1($HoraInscripcion, $MateriaInscrita, $lf->nombreCarrera, $lg->dias,$prof,$lg->cupo,\"\");\n //echo \"Materia: \".$MateriaInscrita.\" Profesor: \".$prof.\" Hora: \".$HoraInicial;\n //echo '<br>';\n //En esta lista guardamos 2 cosas \"Hora de la materia\" y \"Nombre de la materia\" pero como un objeto\n array_push($listaMateriasInscritas, $HoraInsertada);\n sort($listaMateriasInscritas);\n //ya no hace falta buscar en esta materia\n //echo \"La materia: \" . $MateriaInscrita . \" Se inserto a la hora: \" . substr($HoraInscripcion, 0, 2);\n // echo '<br>';\n //unset($listaDiasMateria);\n\n\n\n //QUITARCUPO\n \n\n break;\n }\n }\n }\n }\n }\n }else{\n //SI ES LABORATORIO-------------------------------------------------------------------\n }\n }\n }\n } else {\n //echo 'Mas opciones de horarios ';\n //echo '<h2>' . $lf->nombreCarrera . '</h2>';\n $listaMateriasInscritas = array();\n $listaNombres = array();\n $listaHoras = array();\n uasort($lf->listaMaterias, array($this, 'sbo'));\n \n foreach ($lf->listaMaterias as $materiasOrdenadas) {\n \n foreach ($listaGru as $lg) {\n //Lista de dias que se lleva la materia\n $listaDiasMateria = array();\n //se compara que si cumpla el nombre referencia con la lista de materias\n if ($lg->tipo != \"L\") //Si la materia es laboratorio se agrega al final\n {\n if ($materiasOrdenadas->Materia == $lg->nombreMateria) {\n\n //REVISARCUPO\n\n //revisa el tamaño de la lista de materias \n $dias = $lg->dias;\n if (count($listaMateriasInscritas) < 0) {\n \n foreach ($lf->listaMaterias as $listass) {\n \n if ($listass->Materia == $lg->nombreMateria) {\n $numeroMagico = $listass->valorGrupo;\n //echo $numeroMagico; \n }\n }\n \n if ($numeroMagico > 3) {\n //si es mayor a 3 se va a swichear\n foreach ($listaMateriasInscritasHora as $lli) {\n foreach ($lli->listaDia as $otro) {\n $banderaIndicador = 0;\n if ($otro->carr == $lf->nombreCarrera) {\n //si es de la misma carrera\n if ($otro->campo == $lg->nombreMateria) {\n //tiene que verificar de la carrera\n $dasd = $otro->hora;\n $hu = substr($dasd, 0, 2);\n $jei = strval($hu);\n $jelou = substr($lg->horas, 0, 2);\n $bye = strval($jelou);\n if ($jei == $bye) {\n \n $banderaIndicador = 1;\n }\n }\n }\n }\n }\n }\n if ($banderaIndicador == 1) {\n //significa que no va a insertar ese\n $banderaIndicador = 0;\n } else {\n //echo \"entro\";\n //significa que la lista esta vacia\n $HoraInscripcion = $lg->horas; //08\n \n //Aqui es donde truje chencha\n $Horafinal = substr($HoraInscripcion, 3, 2);\n //echo $Horafinal;\n \n $HoraInicial = substr($HoraInscripcion, 0, 2);\n \n $HorasTotales = $Horafinal - $HoraInicial;\n \n //echo \"La clase empieza a las: \".$HoraInicial.\" y termina a las: \".$Horafinal.\" Dura: \".$HorasTotales;\n //echo '<br>';\n if($HorasTotales>1)\n {\n for($j=0; $j == $HorasTotales;$j++)\n {\n //echo 'Entro';\n //significa que el horario es de mas de una hora\n //cambios miguel\n array_push($listaHoras,$HoraInicial); \n $MateriaInscrita = $materiasOrdenadas->Materia;\n array_push($listaNombres, $MateriaInscrita);\n //creamos el objeto Hora y ponemos sus dos propiedades que rcordemos es la hora y nombre de la materia\n $prof = $lg->profesor;\n $HoraInsertada = new Hora1($HoraInicial, $MateriaInscrita, $lf->nombreCarrera, $lg->dias,$prof,$lg->cupo,\"\");\n //echo \"Materia: \".$MateriaInscrita.\" Profesor: \".$prof.\" Hora: \".$HoraInicial;\n //echo '<br>';\n //En esta lista guardamos 2 cosas \"Hora de la materia\" y \"Nombre de la materia\" pero como un objeto\n array_push($listaMateriasInscritas, $HoraInsertada);\n sort($listaMateriasInscritas);\n $HoraInicial = $HoraInicial + 1; \n //QUITARCUPO \n \n }\n $HorasTotales = 0;\n }else{\n //cambios miguel\n array_push($listaHoras, substr($HoraInscripcion, 0, 2)); //08\n $MateriaInscrita = $materiasOrdenadas->Materia;\n array_push($listaNombres, $MateriaInscrita);\n //creamos el objeto Hora y ponemos sus dos propiedades que rcordemos es la hora y nombre de la materia\n $prof = $lg->profesor;\n $HoraInsertada = new Hora1($HoraInscripcion, $MateriaInscrita, $lf->nombreCarrera, $lg->dias,$prof,$lg->cupo,\"\");\n //echo \"Materia: \".$MateriaInscrita.\" Profesor: \".$prof.\" Hora: \".$HoraInicial;\n //echo '<br>';\n //En esta lista guardamos 2 cosas \"Hora de la materia\" y \"Nombre de la materia\" pero como un objeto\n array_push($listaMateriasInscritas, $HoraInsertada);\n sort($listaMateriasInscritas);\n //ya no hace falta buscar en esta materia\n //echo \"La materia: \" . $MateriaInscrita . \" Se inserto a la hora: \" . substr($HoraInscripcion, 0, 2);\n // echo '<br>';\n //unset($listaDiasMateria);\n //QUITARCUPO\n \n break;\n }\n \n }\n } else { \n //osea que ya existe algo\n foreach ($listaMateriasInscritasHora as $lli) {\n foreach ($lli->listaDia as $otro) {\n if ($otro->carr == $lf->nombreCarrera) {\n //si es de la misma carrera\n if ($otro->campo == $lg->nombreMateria) {\n if ($lf->nombreCarrera == $otro->carr) {\n foreach ($lf->listaMaterias as $listass) {\n \n if ($listass->Materia == $otro->campo) {\n $numeroMagico = $listass->valorGrupo;\n break;\n }\n }\n }\n if ($numeroMagico > 3) {\n //tiene que verificar de la carrera\n $dasd = $otro->hora;\n $hu = substr($dasd, 0, 2);\n $jei = strval($hu);\n $jelou = substr($lg->horas, 0, 2);\n $bye = strval($jelou);\n if ($jei == $bye) {\n $banderaIndicador = 1;\n }\n }\n }\n }\n }\n }\n \n if ($banderaIndicador == 1) {\n $banderaIndicador = 0;\n } else {\n //echo \"entro\";\n $nnombre = $materiasOrdenadas->Materia;\n if (in_array($nnombre, $listaNombres)) { // si la materia ya se inserto no hace falta seguir buscando\n //echo \"Existe Irix\";\n } else {\n\n //REVISARCUPO\n\n //debemos revisar que la hora este disponible\n //chear que no se repitan las horas\n if (in_array(substr($lg->horas, 0, 2), $listaHoras)) { // Si la hora ya esta registrada en la lista significa que esta ocupada\n //entonces debemos seguir buscando en la lista\n } else {\n //debemos revisar que la hora este disponible\n //significa que la lista esta vacia\n $HoraInscripcion = $lg->horas;\n \n //Aqui es donde truje chencha\n $Horafinal = substr($HoraInscripcion, 3, 2);\n //echo $Horafinal;\n \n $HoraInicial = substr($HoraInscripcion, 0, 2);\n \n $HorasTotales = $Horafinal - $HoraInicial;\n \n //echo \"La clase empieza a las: \".$HoraInicial.\" y termina a las: \".$Horafinal.\" Dura: \".$HorasTotales;\n //echo '<br>';\n \n if($HorasTotales>1)\n {\n for($j=0; $j == $HorasTotales;$j++)\n {\n //echo \"entro\";\n //significa que el horario es de mas de una hora\n //cambios miguel\n array_push($listaHoras,$HoraInicial); \n $MateriaInscrita = $materiasOrdenadas->Materia;\n array_push($listaNombres, $MateriaInscrita);\n $prof = $lg->profesor;\n //creamos el objeto Hora y ponemos sus dos propiedades que rcordemos es la hora y nombre de la materia\n $HoraInsertada = new Hora1($HoraInicial, $MateriaInscrita, $lf->nombreCarrera, $lg->dias,$prof,$lg->cupo,\"\");\n //echo \"Materia: \".$MateriaInscrita.\" Profesor: \".$prof.\" Hora: \".$HoraInicial;\n //echo '<br>';\n //En esta lista guardamos 2 cosas \"Hora de la materia\" y \"Nombre de la materia\" pero como un objeto\n array_push($listaMateriasInscritas, $HoraInsertada);\n sort($listaMateriasInscritas);\n $HoraInicial = $HoraInicial + 1;\n //QUITARCUPO \n \n }\n $HorasTotales = 0;\n }else{\n //cambios miguel\n array_push($listaHoras, substr($HoraInscripcion, 0, 2)); //08\n $MateriaInscrita = $materiasOrdenadas->Materia;\n array_push($listaNombres, $MateriaInscrita);\n $prof = $lg->profesor;\n //creamos el objeto Hora y ponemos sus dos propiedades que rcordemos es la hora y nombre de la materia\n $HoraInsertada = new Hora1($HoraInscripcion, $MateriaInscrita, $lf->nombreCarrera, $lg->dias,$prof,$lg->cupo,\"\");\n //echo \"Materia: \".$MateriaInscrita.\" Profesor: \".$prof.\" Hora: \".$HoraInicial;\n //echo '<br>';\n //En esta lista guardamos 2 cosas \"Hora de la materia\" y \"Nombre de la materia\" pero como un objeto\n array_push($listaMateriasInscritas, $HoraInsertada);\n sort($listaMateriasInscritas);\n //ya no hace falta buscar en esta materia\n //echo \"La materia: \" . $MateriaInscrita . \" Se inserto a la hora: \" . substr($HoraInscripcion, 0, 2);\n // echo '<br>';\n //unset($listaDiasMateria);\n //QUITARCUPO\n \n \n break;\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n \n $auxlistas = array();\n $auxdias = array();\n $listaAMandar = array(\"\");\n $diasAux = \"\";\n foreach($listaMateriasInscritas as $lismat)\n {\n $numeroAux = $lismat->hora;\n $diasAux = $lismat->dias;\n array_push($auxdias,$diasAux);\n array_push($auxlistas,substr($numeroAux, 0, 2)); \n }\n \n foreach($auxlistas as $al)\n {\n foreach($listaMateriasInscritas as $lmi)\n {\n $horaAux = substr($lmi->hora, 0, 2);\n if($al == $horaAux)\n {\n // echo 'La materia: '.$lmi->campo.' Inscrita a: '.$lmi->hora.' de la carrera: '.$lmi->carr.' Los dias: '.$lmi->dias;\n // echo '<br>';\n $prof = $lg->profesor;\n $HoraInsertada = new Hora1($lmi->hora, $lmi->campo, $lmi->carr,$lmi->dias,$prof,$lg->cupo,\"\");\n //echo \"Materia: \".$MateriaInscrita.\" Profesor: \".$prof.\" Hora: \".$HoraInicial;\n //echo '<br>';\n array_push($listaAMandar,$HoraInsertada);\n $referencia = 1; \n }\n }\n }\n //referenciahorarios\n $HF = new HorarioFinal($i, $listaMateriasInscritas);\n array_push($listaMateriasInscritasHora, $HF);\n }\n \n }\n }\n \n }\n //lo usare para revisar la lista\n //print_r($listaMateriasInscritasHora);\n return $listaMateriasInscritasHora;\n }", "function generarHorario($gruposProyecto,$variables,$estilo,$icono,$horario) {\n $noHorario=0;\n ?>\n <tr onmouseover=\"this.style.background='#F4F4EA'\" onmouseout=\"this.style.background=''\">\n <td class='<? echo $estilo ?>'>\n <? echo $gruposProyecto['GRUPO'];?>\n </td>\n <?\n if (is_array($horario))\n {\n $this->mostrarHorarioGrupo($horario,$estilo);\n }else\n {\n $this->mostrarNoHorario($estilo);\n $noHorario=1;\n }\n $cupo = $gruposProyecto['CUPO'];\n ?>\n <td class='<? echo $estilo ?>'>\n <? echo $cupo ?>\n </td>\n <?\n $inscritos = $gruposProyecto['INSCRITOS'];\n $disponibles = $cupo - $inscritos;\n ?>\n <td class='<? echo $estilo ?>'>\n <? if($disponibles>0){echo $disponibles; } else {echo \"0\";} ?>\n </td>\n <?if(is_array($this->horarioEstudiante))\n {\n $cruce=$this->validacion->verificarCruceHorarios($this->horarioEstudiante,$horario);\n }else\n {\n $cruce='ok';\n }\n if($noHorario==0)\n {\n $this->crearEnlaceCambioUno($estilo, $disponibles, $cruce, $gruposProyecto, $icono);\n }else\n {\n $this->crearEnlaceCambioUno($estilo, 'a', 'ok', $gruposProyecto, $icono);\n }\n ?>\n </tr><?\n }", "function presentarHorario($resultado_grupos,$resultado_horarios,$estilo,$enlace,$variables,$icono) {\n $l=0;\n $totalGrupos=count($resultado_grupos);\n foreach ($resultado_grupos as $grupo) {\n if($grupo['CARRERA']==$this->datosEstudiante[0]['COD_CARRERA'])\n {\n $gruposProyecto[]=$grupo;\n }else\n {\n $evento=$this->fechas->validar_fechas_estudiantes_otros_grupos($this->configuracion,$grupo['CARRERA']);\n if($evento=='adicion')\n {\n $gruposOtros[]=$grupo;\n }\n }\n \n }\n if(isset($gruposProyecto)&&is_array($gruposProyecto))\n {\n $totalGruposProyecto=count($gruposProyecto);\n for ($j = 0; $j < $totalGruposProyecto; $j++)\n {\n $permiso='adicion';\n if ($permiso=='adicion')\n {\n if ((isset($gruposProyecto[$j-1]['CARRERA'])?$gruposProyecto[$j-1]['CARRERA']:'')!=$gruposProyecto[$j]['CARRERA'])\n {\n $carrera=$this->consultarNombreCarrera($gruposProyecto[$j]['CARRERA']);\n ?>\n <div width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"2px\" cellspacing=\"1px\" ><div class=\"nombrecarrera\" ><b><? echo \"PROYECTO CURRICULAR: \" . $carrera ?> </div>\n <tr>\n <td>\n <table class='contenidotabla'>\n <?$this->crearEncabezadoHorario($estilo,$enlace);\n }\n if (is_array($resultado_horarios))\n {\n foreach ($resultado_horarios as $horarios) {\n if($horarios['GRUPO']==$gruposProyecto[$j]['GRUPO'])\n {\n $horarioGrupo[]=$horarios;\n }\n }\n }else\n {\n $horarioGrupo='';\n }\n //var_dump($horarioGrupo);\n if ((isset($gruposProyecto[$j-1]['GRUPO'])?$gruposProyecto[$j-1]['GRUPO']:'') != $gruposProyecto[$j]['GRUPO'])\n {\n $variables['grupo'] = $gruposProyecto[$j]['GRUPO'];\n $variables['carrera'] = $gruposProyecto[$j]['CARRERA'];\n $this->generarHorario($gruposProyecto[$j],$variables,$estilo,$icono,$horarioGrupo);\n }\n unset($horarioGrupo);\n if ($gruposProyecto[$j]['CARRERA'] != (isset($gruposProyecto[$j + 1]['CARRERA'])?$gruposProyecto[$j + 1]['CARRERA']:''))\n {\n ?>\n </table>\n </div>\n \n <?\n }\n else\n {\n }\n }\n else\n {\n $l++;\n }\n }\n if($l==$j)\n {\n ?>\n <tr>\n <td class=\"cuadro_plano centrar\">\n <? echo \"No existen grupos registrados en el Proyecto.\"; ?>\n </td>\n </tr>\n <?\n }\n $l=0;\n }\n if(isset($gruposOtros)&&is_array($gruposOtros))\n {\n $totalGruposOtros=count($gruposOtros);\n ?><a name=\"2\"></a><br><div class=\"columna4\"><center>GRUPOS DE OTROS PROYECTOS</center></div><?\n for ($j = 0; $j < $totalGruposOtros; $j++)\n {\n $permiso='adicion';\n if ($permiso=='adicion')\n {\n if ((isset($gruposOtros[$j-1]['CARRERA'])?$gruposOtros[$j-1]['CARRERA']:'')!=$gruposOtros[$j]['CARRERA'])\n {\n $carrera=$this->consultarNombreCarrera($gruposOtros[$j]['CARRERA']);\n ?>\n <div width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"2px\" cellspacing=\"1px\" ><div class=\"nombrecarrera\" ><b><? echo \"PROYECTO CURRICULAR: \" . $carrera ?> </div>\n <table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"5 px\" cellspacing=\"1px\" >\n <tr>\n <td>\n <table class='contenidotabla'>\n <?$this->crearEncabezadoHorario('niveles centrar',$enlace);\n }\n if(is_array($resultado_horarios))\n {\n foreach ($resultado_horarios as $horarios) {\n if($horarios['GRUPO']==$gruposOtros[$j]['GRUPO'])\n {\n $horarioGrupo[]=$horarios;\n }\n }\n }else\n {\n $horarioGrupo='';\n }\n //var_dump($horarioGrupo);\n if ((isset($gruposOtros[$j-1]['GRUPO'])?$gruposOtros[$j-1]['GRUPO']:'') != $gruposOtros[$j]['GRUPO'])\n {\n $variables['grupo'] = $gruposOtros[$j]['GRUPO'];\n $variables['carrera'] = $gruposOtros[$j]['CARRERA'];\n $this->generarHorario($gruposOtros[$j],$variables,$estilo,$icono,$horarioGrupo);\n }\n unset($horarioGrupo);\n if ($gruposOtros[$j]['CARRERA'] != (isset($gruposOtros[$j + 1]['CARRERA'])?$gruposOtros[$j + 1]['CARRERA']:''))\n {\n ?>\n </table>\n </td>\n </tr>\n </table> </div><?\n }\n else\n {\n }\n }\n else\n {\n $l++;\n }\n }\n if($l==$j)\n {\n ?>\n <tr>\n <td class=\"cuadro_plano centrar\">\n <? echo \"No existen grupos registrados en el Proyecto.\"; ?>\n </td>\n </tr>\n <?\n }\n }\n ?><img src=\"<? echo $this->configuracion['site'].$this->configuracion['grafico'] ?>/up2.png\" width=\"15\" height=\"10\" border=\"0\"><a class=\"scroll\" href=\"#1\">Volver Arriba</a><?\n }", "function horario($name,$hr_fr,$min_fr,$hr_to,$min_to,$valor)\n\t{\n\n\t\tif($valor != \"\")\n\t\t{\n\t\t\t$hora\t\t= substr($valor,0,2);\n\t\t\t$minutos\t= substr($valor,3,2);\n\t\t}else{\n\t\t\t$hora \t\t= \"\";\n\t\t\t$minutos\t= \"\";\n\t\t}\n\n\t\t$html \t= '<select name=\"'.$name.'_hr\" id=\"'.$name.'_hr\" style=\"width:8%\">';\n\n\t\t\t\t\tfor($hr = $hr_fr; $hr <= $hr_to; $hr++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$hr \t= (strlen($hr) == 1)? \"0\".$hr : $hr;\n\n\t\t\t\t\t\t$html .= '<option value=\"'.$hr.'\"';\n\t\t\t\t\t\t$html .= ($hora == $hr)? ' selected':'';\n\t\t\t\t\t\t$html .= '>'.$hr.'</option>';\n\t\t\t\t\t}\n\n $html .= '</select><span style=\"line-height:28px;\">&nbsp;:&nbsp;</span>';\n\n $html .= '<select name=\"'.$name.'_min\" id=\"'.$name.'_min\" style=\"width:8%\">';\n\n\t\t\t\t\tfor($mi = $min_fr; $mi <= $min_to; $mi++)\n\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t$mi \t= (strlen($mi) == 1)? \"0\".$mi : $mi;\n\n\t\t\t\t\t\t$html .= '<option value=\"'.$mi.'\"';\n\t\t\t\t\t\t$html .= ($minutos == $mi)? ' selected':'';\n\t\t\t\t\t\t$html .= '>'.$mi.'</option>';\n\t\t\t\t\t}\n\t\t\t\t\t\n $html .= '</select>';\n\n return $html;\n\n\t}", "public function getTablaHorario()\n {\n try {\n $respuesta=[];\n $filtros = json_decode(file_get_contents(\"php://input\"), true);\n $dbm = new DbmControlescolar($this->get(\"db_manager\")->getEntityManager());\n $cicloactual=$dbm->getRepositorioById(\"Ciclo\",\"actual\",1);\n $horario = $dbm->BuscarTablaHorario($filtros);\n $talleres = $dbm->getTalleres($filtros);\n foreach($talleres as $taller){\n $data = $filtros;\n $data['groupby'] = true;\n $data['tallerid'] = $taller['tallercurricularid'];\n $tall = $dbm->BuscarTablaHorario($data);\n foreach($tall as $t){\n $t['taller'] = true;\n $horario[] = $t;\n }\n }\n $horainicial=\"24:00\";\n $horas = [];\n $tipo = [];\n $horafinal=\"00:00\";\n foreach ($horario as $hora){\n if($hora['taller'] !== true){\n $grupokey=false;\n foreach ($grupos as $key => $grupo) {\n if ( $key==$hora[\"grupoid\"]) {\n $grupokey=$key;\n break;\n }\n }\n if ($grupokey=== false){\n $grupos[$hora[\"grupoid\"]]=$hora[\"grupo\"];\n }\n $diasalumno[$hora[\"dia\"]][]=$hora;\n if ($hora[\"horainicio\"]<$horainicial){\n $horainicial=$hora[\"horainicio\"];\n }\n if ($hora[\"horafin\"]>$horafinal){\n $horafinal=$hora[\"horafin\"];\n }\n }\n }\n $date1 = new \\DateTime($horainicial);\n $date2 = new \\DateTime($horafinal);\n $diff = $date2->diff($date1);\n $cuantashoras= $diff->format('%h');\n // for ($i=0;$i<$cuantashoras;$i++){\n // $b=$date1->format('H')+$i;\n // $e=$b+1;\n // $horas[]=[\"inicio\"=>sprintf(\"%02d\", $b).\":00\",\"fin\"=>sprintf(\"%02d\", $e).\":00\"];\n // }\n foreach($horario as $h){\n $find = false;\n foreach($horas as $hh){\n if($hh['inicio'] == $h['horainicio'] && $hh['fin'] == $h['horafin']){\n $find = true;\n }\n }\n if(!$find){\n $horas[]=[\"inicio\"=>$h['horainicio'],\"fin\"=>$h['horafin']];\n }\n }\n sort($horas);\n $dias=[[\"dia\"=>1,\"nombre\"=>\"Lunes\"],[\"dia\"=>2,\"nombre\"=>\"Martes\"],[\"dia\"=>3,\"nombre\"=>\"Miercoles\"],[\"dia\"=>4,\"nombre\"=>\"Jueves\"],[\"dia\"=>5,\"nombre\"=>\"Viernes\"]];\n // if (count($grupos)==1){\n // foreach ($horas as $key=>$hora){\n // $respuesta[$key][\"hora\"]=$hora[\"inicio\"].\" - \".$hora[\"fin\"];\n // foreach ($dias as $dia){\n // foreach ($diasalumno as $diaalumno){\n // foreach ($diaalumno as $da){\n // if ($dia[\"dia\"]==$da[\"dia\"] && $da[\"horainicio\"]==$hora[\"inicio\"] && $da[\"horafin\"]==$hora[\"fin\"]) {\n // $item=[\"materia\"=>$da[\"materia\"],\"inicio\"=>' ',\"fin\"=>' ', 'all' => $da];\n // $respuesta[$key][$dia[\"nombre\"]][]=$item;\n // }\n // }\n // }\n // }\n // }\n // }else{\n // }\n foreach ($grupos as $grupoid=>$grupo){\n $grupoentidad=$dbm->getRepositorioById(\"CeGrupo\",\"grupoid\",$grupoid);\n if ($grupoentidad->getTipogrupoid()->getTipogrupoid()==1){\n $indice=$grupoid;\n $respuesta[$indice][\"grupo\"]=$grupoentidad->getGradoid()->getNivelid()->getNombre().\" \".$grupoentidad->getGradoid()->getGrado().\" \".$grupoentidad->getNombre();\n }else{\n $grupoorigen=$dbm->getRepositorioById(\"CeGrupoorigenporsubgrupo\",\"grupoid\",$grupoid);\n $indice=$grupoorigen->getGrupoorigenid()->getGrupoid();\n }\n \n foreach ($horas as $key=>$hora){\n $respuesta[$indice][\"horario\"][$key][\"hora\"]=$hora[\"inicio\"].\" - \".$hora[\"fin\"];\n foreach ($dias as $dia){\n foreach ($diasalumno as $diaalumno){\n foreach ($diaalumno as $da){\n if ($grupoid==$da[\"grupoid\"] && $dia[\"dia\"]==$da[\"dia\"] && $da[\"horainicio\"]==$hora[\"inicio\"] && $da[\"horafin\"]==$hora[\"fin\"]) {\n $respuesta[$indice][\"planestudioid\"] = $da['planestudioid'];\n $respuesta[$indice][\"gradoid\"] = $grupoentidad->getGradoid()->getGradoid();\n $gn = $da[\"materia\"];\n $item=[\"materia\"=>$gn,'mat' => $da['materia'], \"inicio\"=>' ',\"fin\"=>' ', 'all' => $da];\n $find = false;\n foreach($respuesta[$indice][\"horario\"][$key][$dia[\"nombre\"]] as $hh){\n if($hh['mat'] == $da['materia']){\n $find = true;\n }\n }\n if(!$find){\n $respuesta[$indice][\"horario\"][$key][$dia[\"nombre\"]][]=$item;\n }\n }\n }\n }\n }\n }\n }\n foreach($horario as $h){\n if($h['taller'] == true){\n $grupoentidad=$dbm->getRepositorioById(\"CeTallercurricular\",\"tallercurricularid\",$h['grupoid']);\n $grados=$dbm->getRepositoriosById(\"CeGradoportallercurricular\",\"tallercurricularid\",$h['grupoid']);\n $alumnos = $dbm->getRepositoriosById(\"CeAlumnocicloportaller\",\"tallercurricularid\",$h['grupoid']);\n\n $gruposTaller = [];\n\n foreach($alumnos as $al){\n $aciclo = $dbm->getRepositorioById(\"CeAlumnocicloporgrupo\",\"alumnoporcicloid\",$al->getAlumnoporcicloid()->getAlumnoporcicloid());\n\n if($aciclo){\n $nombre = $al->getAlumnoporcicloid()->getGradoid()->getNivelid()->getNombre().\" \".$al->getAlumnoporcicloid()->getGradoid()->getGrado().\" \".$aciclo->getGrupoid()->getNombre();\n\n $find = false;\n\n foreach($gruposTaller as $g){\n if($g == $nombre){\n $find = true;\n }\n }\n\n if(!$find){\n $gruposTaller[] = $nombre;\n }\n }\n }\n \n foreach($grados as $g){\n if(count($gruposTaller) == 0){\n foreach($respuesta as $key => $r){\n if($h['planestudioid'] == $r['planestudioid'] && $g->getGradoid()->getGradoid() == $r['gradoid']){\n $indice = $key;\n foreach ($dias as $dia){\n foreach ($horas as $key=>$hora){\n if ($dia[\"dia\"]==$h[\"dia\"] && $h[\"horainicio\"]==$hora[\"inicio\"] && $h[\"horafin\"]==$hora[\"fin\"]) {\n \n $gn = $h[\"materia\"];\n \n $h['grupo'] = $gn;\n \n $item=[\"materia\"=>$gn,'mat' => $h['materia'], \"inicio\"=>' ',\"fin\"=>' ', 'all' => $h];\n $find = false;\n foreach($respuesta[$indice][\"horario\"][$key][$dia[\"nombre\"]] as $hh){\n if($hh['mat'] == $h['materia'] && $hh['all']['grupo'] == $h['materia']){\n $find = true;\n }\n }\n if(!$find){\n $respuesta[$indice][\"horario\"][$key][$dia[\"nombre\"]][]=$item;\n }\n }\n }\n }\n \n }\n }\n }else{\n foreach($gruposTaller as $gt){\n foreach($respuesta as $key => $r){\n if($r['grupo'] == $gt){\n $indice = $key;\n foreach ($dias as $dia){\n foreach ($horas as $key=>$hora){\n if ($dia[\"dia\"]==$h[\"dia\"] && $h[\"horainicio\"]==$hora[\"inicio\"] && $h[\"horafin\"]==$hora[\"fin\"]) {\n \n $gn = $h[\"materia\"];\n \n $h['grupo'] = $gn;\n\n $gn = ' ';\n \n $item=[\"materia\"=>$gn,'mat' => $h['materia'], \"inicio\"=>' ',\"fin\"=>' ', 'all' => $h];\n $find = false;\n foreach($respuesta[$indice][\"horario\"][$key][$dia[\"nombre\"]] as $hh){\n if($hh['mat'] == $h['materia'] && $hh['all']['grupo'] == $h['materia']){\n $find = true;\n }\n }\n if(!$find){\n $respuesta[$indice][\"horario\"][$key][$dia[\"nombre\"]][]=$item;\n }\n }\n }\n }\n \n }\n } \n }\n }\n \n }\n }\n }\n \n $respuesta=array_values($respuesta);\n usort($respuesta, function($a, $b) {\n return $a['grupo']> $b['grupo']? 1 : -1;\n });\n array_reverse($respuesta);\n\n $res = [];\n foreach($respuesta as $r){\n $find = false;\n $ro = [\n 'grupo' => $r['grupo'],\n 'horario' => []\n ];\n foreach($r['horario'] as $rr){\n if($rr['Lunes'] || $rr['Martes'] || $rr['Miercoles'] || $rr['Jueves'] || $rr['Viernes']){\n $ro['horario'][] = $rr;\n }\n }\n $res[] = $ro;\n }\n if(count($res) == 0){\n return new View('No se encontraron resultados', Response::HTTP_PARTIAL_CONTENT);\n }\n\n return new View($res, Response::HTTP_OK);\n } catch (\\Exception $e) {\n return new View($e->getMessage(), Response::HTTP_BAD_REQUEST);\n }\n }", "public function listadoHorariosAction()\n {\n $listadoHorarios = $this->getHorarioAtencionServices();\n return $listadoHorarios->getListHours();\n }", "function horario_propiedad($id_propiedad,$fecha_visita,$id_vendedor,$id_cliente) {\n\tglobal $mysqli;\n\t$options = '';\n\t$horas = array(); $horas_ocupadas = array();\n\t\n\t$horas = MostrarIntervalo(array('hora'=>9,'min'=>'00'), array('hora'=>18,'min'=>'00'), 30);\n\t\n\t//Consulta de horarios de la propiedad\n\t$sql = \"SELECT TIME_FORMAT(hora_in, '%H:%i') AS hora_in, TIME_FORMAT(hora_out, '%H:%i') AS hora_out FROM agenda_visitas\n\t\t\tWHERE id_propiedad=\".$id_propiedad.\" AND fecha_visita='\".$fecha_visita.\"'\";\n\t$result = $mysqli->query($sql) or die('Error: '.$mysqli->error);\n\twhile ($row = $result->fetch_assoc()) {\n\t\t$horas_ocupadas[] = $row['hora_in'];\n\t\t$horas_ocupadas[] = $row['hora_out'];\n\t}\n\t//Consulta de horarios del vendedor\n\tif ( !empty($id_vendedor) ) {\n\t\t$sql = \"SELECT TIME_FORMAT(hora_in, '%H:%i') AS hora_in, TIME_FORMAT(hora_out, '%H:%i') AS hora_out FROM agenda_visitas\n\t\t\t\tWHERE id_vendedor=\".$id_vendedor.\" AND fecha_visita='\".$fecha_visita.\"'\";\n\t\t$result = $mysqli->query($sql) or die('Error: '.$mysqli->error);\n\t\twhile ($row = $result->fetch_assoc()) {\n\t\t\t$horas_ocupadas[] = $row['hora_in'];\n\t\t\t$horas_ocupadas[] = $row['hora_out'];\n\t\t}\n\t}\n\t//Consulta de horarios del cliente\n\tif ( !empty($id_cliente) ) {\n\t\t$sql = \"SELECT TIME_FORMAT(hora_in, '%H:%i') AS hora_in, TIME_FORMAT(hora_out, '%H:%i') AS hora_out FROM agenda_visitas\n\t\t\t\tWHERE id_cliente=\".$id_cliente.\" AND fecha_visita='\".$fecha_visita.\"'\";\n\t\t$result = $mysqli->query($sql) or die('Error: '.$mysqli->error);\n\t\twhile ($row = $result->fetch_assoc()) {\n\t\t\t$horas_ocupadas[] = $row['hora_in'];\n\t\t\t$horas_ocupadas[] = $row['hora_out'];\n\t\t}\n\t}\n\t$horas_ocupadas = array_unique($horas_ocupadas); //Elimina valores duplicados de un array\n\t//$horas_ocupadas = array_values(array_unique($horas_ocupadas)); //Elimina valores duplicados de un array y ordena los indices secuencialmente\n\t\n\tif ( !empty($horas_ocupadas) ) {\n\t\tforeach ($horas as $key => $hora) {\n\t\t\tif ( !in_array($hora, $horas_ocupadas) ) {\n\t\t\t\t$options .= '<option value=\"'.$hora.'\">'.$hora.'</option>';\n\t\t\t} else {\n\t\t\t\t$options .= '<option value=\"'.$hora.'\" disabled=\"disabled\">'.$hora.'</option>';\n\t\t\t}\n\t\t}\n\t} else {\n\t\tforeach ($horas as $key => $hora) {\n\t\t\t$options .= '<option value=\"'.$hora.'\">'.$hora.'</option>';\n\t\t}\n\t}\n\t\n\treturn '<select name=\"horarios[]\" id=\"horario-'.$id_propiedad.'\" class=\"horarios\">\n\t\t\t<option value=\"\">00:00</option>'.$options.'\n\t\t\t</select>';\n}", "function retorna_horas_com_intervalo($hora_inicial = 0, $hora_final = 23) {\n foreach(range($hora_inicial, $hora_final) as $item) {\n $_horario[$item.\":00\"] = $item.\":00\";\n $_horario[$item.\":30\"] = $item.\":30\"; \n }\n \n //retorna horario\n return $_horario;\n }", "function crearEncabezadoHorario($estilo, $mensajeEnlace) {\n ?>\n <div class='sigma'>\n <th class='<? echo $estilo ?>' width=\"50\">Grupo</th>\n <th class='<? echo $estilo ?>' width=\"60\">Lun</th>\n <th class='<? echo $estilo ?>' width=\"60\">Mar</th>\n <th class='<? echo $estilo ?>' width=\"60\">Mie</th>\n <th class='<? echo $estilo ?>' width=\"60\">Jue</th>\n <th class='<? echo $estilo ?>' width=\"60\">Vie</th>\n <th class='<? echo $estilo ?>' width=\"60\">S&aacute;b</th>\n <th class='<? echo $estilo ?>' width=\"60\">Dom</th>\n <th class='<? echo $estilo ?>' width=\"40\">Cupo</th>\n <th class='<? echo $estilo ?>' width=\"80\">Disponibles</th>\n <th class='<? echo $estilo ?>' ><? echo $mensajeEnlace ?></th>\n </div>\n <?\n }", "public function crearHorarios()\n\t{\n\t\t$diasSemana = array(\"LUNES\", \"MARTES\", \"MIERCOLES\", \"JUEVES\", \"VIERNES\");\n\t\t$dia = 0;\n\t\t$horaInicio = \"\";\n\t\t$horaFin = \"\";\n\t\tfor ($i = 0; $i < 5; $i++) { // dias de la semana\n\t\t\tfor ($j = 7; $j < 16; $j++) { // horas del dia\n\t\t\t\t$dia = $i;\n\t\t\t\t$horaInicio = str_pad($j.\":00:00\", 8, STR_PAD_LEFT);\n\t\t\t\t$horaFin = str_pad($j.\":50:00\", 8, STR_PAD_LEFT);\n\t\t\t\t$existe = !Horario::where('dia', '=', $i)\n\t\t\t\t\t->where('hora_inicio', '=', $horaInicio)\n\t\t\t\t\t->where('hora_fin', '=', $horaFin)\n\t\t\t\t\t->get()->isEmpty();\n\t\t\t\tif (!$existe) {\n\t\t\t\t\techo \"Creando horario: \".$diasSemana[$dia].\" - \".$horaInicio.\" - \".$horaFin.\"\\n\";\n\t\t\t\t\tHorario::create(array(\n\t\t\t\t\t\t'hora_inicio' => $horaInicio,\n\t\t\t\t\t\t'hora_fin' => $horaFin,\n\t\t\t\t\t\t'dia' => $dia\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function listarHorasPiloto(){\n\t\t$this->procedimiento='oip.ft_horas_piloto_sel';\n\t\t$this->transaccion='OIP_HOPILO_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n \n $this->capturaCount('total_pago_variable','numeric');\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_horas_piloto','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('gestion','int4');\n\t\t$this->captura('mes','varchar');\n\t\t$this->captura('ci','varchar');\n $this->captura('nombre_piloto','text');\n $this->captura('escala_salarial', 'varchar');\n\t\t$this->captura('tipo_flota','varchar');\n\t\t$this->captura('horas_vuelo','int4');\n\t\t$this->captura('horas_simulador_full','int4');\n $this->captura('horas_simulador_fix','int4');\n $this->captura('factor_esfuerzo','numeric');\n $this->captura('pago_variable','numeric');\n $this->captura('monto_horas_vuelo','numeric');\n $this->captura('monto_horas_simulador_full','numeric');\n $this->captura('monto_horas_simulador_fix','numeric');\n $this->captura('estado','varchar');\n $this->captura('pic_sic','varchar');\n $this->captura('horas_simulador_full_efectivas','integer'); \n $this->captura('horas_simulador_fix_efectivas','integer'); \n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('id_funcionario','int4');\n\t\t$this->captura('pic_sic_servicio','varchar');\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function obtenerHorarios()\r\n {\r\n $id=0;\r\n $accion = \"listar\";\r\n \r\n $query = $this->connect()->prepare('Call getAllHorarioReservacion(:id, :accion)');\r\n $query->execute(['id'=>$id, 'accion'=>$accion]);\r\n return $query;\r\n }", "public function pegaTodosHorarios()\n {\n $resultado = $this->db->getOnibus();\n\n if (is_array($resultado) && empty($resultado))\n return Resposta::enviar(array('status' => 410, 'mensagem' => Constantes::STATUS_410));\n else\n return Resposta::enviar(array(\n 'status' => 200,\n 'mensagem' => Constantes::STATUS_200,\n 'total' => sizeof($resultado),\n 'dados' => $resultado\n ));\n }", "public function leeHorariosCompletos($nombreArchivo)\n {\n $rutaArchivo = \\public_path() . '/archivos/' . $nombreArchivo;\n $documento = IOFactory::load($rutaArchivo);\n\n # obtenemos la primera celda para la validacion del archivo CPM\n $coordenadas = \"A1\";\n $hojaActual = $documento->getSheet(0);\n $celda = $hojaActual->getCell($coordenadas);\n $valorRaw1 = $celda->getValue();\n\n $coordenadas = \"B1\";\n $hojaActual = $documento->getSheet(0);\n $celda = $hojaActual->getCell($coordenadas);\n $valorRaw2 = $celda->getValue();\n\n $coordenadas = \"C1\";\n $hojaActual = $documento->getSheet(0);\n $celda = $hojaActual->getCell($coordenadas);\n $valorRaw3 = $celda->getValue();\n\n $coordenadas = \"D1\";\n $hojaActual = $documento->getSheet(0);\n $celda = $hojaActual->getCell($coordenadas);\n $valorRaw4 = $celda->getValue();\n\n $coordenadas = \"E1\";\n $hojaActual = $documento->getSheet(0);\n $celda = $hojaActual->getCell($coordenadas);\n $valorRaw5 = $celda->getValue();\n\n $coordenadas = \"F1\";\n $hojaActual = $documento->getSheet(0);\n $celda = $hojaActual->getCell($coordenadas);\n $valorRaw6 = $celda->getValue();\n\n\n //revisa que las celdas coincidan para poder pasar\n if($valorRaw1 = \"materia\" and $valorRaw2 = \"creditos\" and $valorRaw3 = \"profesor\" and $valorRaw4 = \"tipo\" \n and $valorRaw5 = \"horas\" and $valorRaw6 = \"dias\")\n {\n\n // Sin comillas para objetos\n $listaGrupos = array();\n\n $nombreMateria = \"\";\n $creditos = \"\";\n $profesor = \"\";\n $tipo = \"\";\n $horas = \"\";\n $dias = \"\";\n $lunes = \"\";\n $martes = \"\";\n $miercoles = \"\";\n $jueves = \"\";\n $viernes = \"\";\n $sabado = \"\";\n $cupo = \"\";\n $salon = \"\";\n\n\n foreach ($hojaActual->getRowIterator() as $fila) {\n foreach ($fila->getCellIterator() as $celdaPrueba) {\n\n # El valor, así como está en el documento\n $valorRaw = $celdaPrueba->getValue();\n # Fila, que comienza en 1, luego 2 y así...\n $fila = $celdaPrueba->getRow();\n # Columna, que es la A, B, C y así...\n $columna = $celdaPrueba->getColumn();\n\n //revisar que las primeras opciones de las letras sean las correctas\n \n\n if ($valorRaw != \"\") {\n if ($columna == \"A\") {\n if ($valorRaw != \"materia\") {\n $nombreMateria = $valorRaw;\n }\n }\n if ($columna == \"B\") {\n if ($valorRaw != \"creditos\") {\n $creditos = $valorRaw;\n }\n }\n if ($columna == \"C\") {\n if ($valorRaw != \"profesor\") {\n $profesor = $valorRaw;\n //echo $profesor.\"<br>\";\n }\n }\n if ($columna == \"D\") {\n if ($valorRaw != \"tipo\") {\n $tipo = $valorRaw;\n }\n }\n if ($columna == \"E\") {\n if ($valorRaw != \"horas\") {\n $horas = $valorRaw;\n }\n }\n if ($columna == \"F\") {\n if ($valorRaw != \"dias\") {\n $dias = $valorRaw;\n }\n }\n if ($columna == \"G\") {\n if ($valorRaw != \"lunes\") {\n $lunes = $valorRaw;\n }\n }\n if ($columna == \"H\") {\n if ($valorRaw != \"martes\") {\n $martes = $valorRaw;\n }\n }\n if ($columna == \"I\") {\n if ($valorRaw != \"miercoles\") {\n $miercoles = $valorRaw;\n }\n }\n if ($columna == \"J\") {\n if ($valorRaw != \"jueves\") {\n $jueves = $valorRaw;\n }\n }\n if ($columna == \"K\") {\n if ($valorRaw != \"viernes\") {\n $viernes = $valorRaw;\n }\n }\n if ($columna == \"L\") {\n if ($valorRaw != \"sabado\") {\n $sabado = $valorRaw;\n }\n }\n if ($columna == \"M\") {\n if ($valorRaw != \"cupo\") {\n $cupo = $valorRaw;\n }\n }\n if ($columna == \"N\") {\n if ($valorRaw != \"salon\") {\n $salon = $valorRaw;\n }\n }\n }\n }\n\n if($nombreMateria != \"\")\n {\n // Crea objeto\n $Grupo = new HoraClase(trim($nombreMateria), $creditos, $profesor, $tipo, $horas, $dias, $lunes, $martes, $miercoles, $jueves, $viernes, $sabado, $cupo, $salon);\n //print_r($Grupo);\n //echo \"Entro la materia \".$nombreMateria.\" De tipo: \".$tipo.\"\";\n \n\n // Inserta el objeto en el array de listaGrupos\n array_push($listaGrupos, $Grupo);\n $nombreMateria = \"\";\n $creditos = \"\";\n $profesor = \"\";\n $tipo = \"\";\n $horas = \"\";\n $dias = \"\";\n $lunes = \"\";\n $martes = \"\";\n $miercoles = \"\";\n $jueves = \"\";\n $viernes = \"\";\n $sabado = \"\";\n $cupo = \"\";\n $tipo = \"\";\n }\n } \n }else{\n //No entro wacho\n //debemos alertar de alguna manera\n }\n return $listaGrupos;\n }", "function consultarGrupoApoyo($idCompania, $fechaInicial, $fechaFinal, $año)\n {\n\n //**********************\n // C R E A C I O N \n // D E L A S \n // T A R E A S \n //*********************\n\n $grupoapoyo = DB::Select(\n ' SELECT nombreGrupoApoyo as descripcionTarea, \n idGrupoApoyo as idConcepto, \n IF(fechaConstitucionConformacionGrupoApoyo >= fechaCreacionCompania, fechaConstitucionConformacionGrupoApoyo, fechaCreacionCompania) as fechaCreacionCompania,\n valorFrecuenciaMedicion, unidadFrecuenciaMedicion\n FROM grupoapoyo GA\n left join conformaciongrupoapoyo CGA \n on GA.idGrupoApoyo = CGA.GrupoApoyo_idGrupoApoyo\n left join frecuenciamedicion FM\n on GA.FrecuenciaMedicion_idFrecuenciaMedicion = FM.idFrecuenciaMedicion\n LEFT JOIN compania c \n ON GA.Compania_idCompania = c.idCompania\n Where GA.Compania_idCompania = '.$idCompania .' \n group by idGrupoApoyo\n ');\n\n $datos = array();\n \n\n //and nombreCompletoTercero like \"'.$letra.'%\"\n for($i= 0; $i < count($grupoapoyo); $i++)\n {\n $registro = get_object_vars($grupoapoyo[$i]);\n $pos = buscarGrupoApoyo($registro[\"idConcepto\"], $datos);\n\n if($pos == -1)\n {\n $pos = count($datos);\n for($mes = 1; $mes <= 12; $mes++)\n {\n $datos[$pos][str_pad($mes, 2, '0', STR_PAD_LEFT).'T'] = 0;\n $datos[$pos][str_pad($mes, 2, '0', STR_PAD_LEFT).'C'] = 0;\n }\n }\n $datos[$pos]['idGrupoApoyo'] = $registro[\"idConcepto\"];\n $datos[$pos]['Nombre'] = $registro[\"descripcionTarea\"];\n\n // las tareas semanales o diarias deben crear 4 o 30 tareas en cada periodo respectivamente\n // las tareas expresadas en meses o años, solo deben poner una tarea en el periodo\n $frecuencia = ($registro['valorFrecuenciaMedicion'] == 0 ? 1 : $registro['valorFrecuenciaMedicion']);\n $multiplo = (( $registro['unidadFrecuenciaMedicion'] == 'Años' or \n $registro['unidadFrecuenciaMedicion'] == 'Meses') \n ? 1 \n : (($registro['unidadFrecuenciaMedicion'] == 'Semanas' ? 4 : 30) / $frecuencia)) ;\n\n \n $periodicidad = $registro['valorFrecuenciaMedicion'] * ($registro['unidadFrecuenciaMedicion'] == 'Años' ? 12 : 1);\n\n // si la empresa se creó antes del año que estamos consultando, se debe pintar las tareas (fecha inicio enero del año consultado)\n // pero si su creación es posterior, no se deben pintar (fecha de inicio toma la de la compania)\n $fechaInicio = date(\"Y\",strtotime($registro[\"fechaCreacionCompania\"])) < $año \n ? date($año.\"-01-01\")\n : date(\"Y-m-d\",strtotime($registro[\"fechaCreacionCompania\"]));\n \n $fechaInicio = date(\"Y-m-d\",strtotime(\"+ \".$periodicidad.\" MONTH\", strtotime($fechaInicio)));\n $fechaFin = date($año.\"-12-31\");\n\n while($fechaInicio <= date(\"Y-12-31\") and $fechaInicio < $fechaFin)\n {\n $datos[$pos][str_pad(date(\"m\",strtotime($fechaInicio)), 2, '0', STR_PAD_LEFT).'T'] += (1*$multiplo); \n \n $fechaInicio = date(\"Y-m-d\",strtotime(\"+ \".$periodicidad.\" MONTH\", strtotime($fechaInicio)));\n }\n\n }\n\n //**********************\n // C R E A C I O N \n // D E L O S \n // C U M P L I M I E N T O S\n //*********************\n\n $grupoapoyo = DB::Select(\n ' SELECT GrupoApoyo_idGrupoApoyo as idConcepto,\n fechaActaGrupoApoyo, fechaCreacionCompania\n FROM actagrupoapoyo A\n LEFT JOIN compania c \n ON A.Compania_idCompania = c.idCompania\n Where A.Compania_idCompania = '.$idCompania .' and DATE_FORMAT(fechaActaGrupoApoyo,\"%Y\") = '.$año.' \n ');\n\n // si la empresa se creó antes del año que estamos consultando, se debe pintar las tareas (fecha inicio enero del año consultado)\n // pero si su creación es posterior, no se deben pintar (fecha de inicio toma la de la compania)\n \n\n for($i= 0; $i < count($grupoapoyo); $i++)\n {\n $registro = get_object_vars($grupoapoyo[$i]);\n \n $fechaInicio = date(\"Y\",strtotime($registro[\"fechaCreacionCompania\"])) < $año \n ? date($año.\"-01-01\")\n : date(\"Y-m-d\",strtotime($registro[\"fechaCreacionCompania\"]));\n\n $pos = buscarGrupoApoyo($registro[\"idConcepto\"], $datos);\n\n $datos[$pos]['idGrupoApoyo'] = $registro[\"idConcepto\"];\n // CUMPLIMIENTO\n if($registro[\"fechaActaGrupoApoyo\"] != '0000-00-00' and \n date(\"Y\",strtotime($registro[\"fechaActaGrupoApoyo\"])) == date(\"Y\", strtotime($fechaInicio)) and \n $registro[\"fechaActaGrupoApoyo\"] >= $registro[\"fechaCreacionCompania\"])\n {\n \n $datos[$pos][date(\"m\",strtotime($registro[\"fechaActaGrupoApoyo\"])).'C'] += 1;\n }\n }\n\n $tabla = '';\n\n $tabla .= ' \n <div class=\"panel panel-primary\" style=\"border:1px solid\">\n <div class=\"panel-heading\">\n <h4 class=\"panel-title\">\n <a data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#actagrupoapoyo\">Acta de Reunión de Grupos de Apoyo</a>\n </h4>\n </div>';\n \n $tabla .= '\n <div id=\"actagrupoapoyo\" class=\"panel-collapse\"> \n <div class=\"panel-body\" style=\"overflow:auto;\">\n <table class=\"table table-striped table-bordered table-hover\">\n <thead class=\"thead-inverse\">\n <tr class=\"table-info\">\n <th scope=\"col\" width=\"30%\">&nbsp;</th>\n <th>Enero</th>\n <th>Febrero</th>\n <th>Marzo</th>\n <th>Abril</th>\n <th>Mayo</th>\n <th>Junio</th>\n <th>Julio</th>\n <th>Agosto</th>\n <th>Septiembre</th>\n <th>Octubre</th>\n <th>Noviembre</th>\n <th>Diciembre</th>\n <th>Presupuesto</th>\n <th>Costo Real</th>\n <th>Cumplimiento</th>\n <th>Meta</th>\n <th>Observación</th>\n </tr>\n </thead>\n <tbody>';\n for ($i=0; $i <count($datos); $i++) \n { \n $tabla .= \n '<tr align=\"center\">\n <input type=\"hidden\" id=\"idPlanTrabajoDetalle\" name=\"idPlanTrabajoDetalle[]\" value=\"null\">\n <input type=\"hidden\" id=\"Modulo_idModulo\" name=\"Modulo_idModulo[]\" value=\"9\">\n <input type=\"hidden\" id=\"idConcepto\" name=\"idConcepto[]\" value=\"'.$datos[$i][\"idGrupoApoyo\"].'\">\n <input type=\"hidden\" id=\"TipoExamenMedico_idTipoExamenMedico\" name=\"TipoExamenMedico_idTipoExamenMedico[]\" value=\"\">\n\n\n <td scope=\"row\">'\n .$datos[$i][\"Nombre\"].\n '<input type=\"hidden\" id=\"nombreConceptoPlanTrabajoDetalle\" name=\"nombreConceptoPlanTrabajoDetalle[]\" value=\"'.$datos[$i][\"Nombre\"].'\">\n </td>';\n\n \n for($mes = 1; $mes <= 12; $mes++)\n {\n $cMes = str_pad($mes,2,'0',STR_PAD_LEFT);\n $fechaMes = date(\"Y-\".$cMes.\"-01\");\n $tabla .= \n '<td>'.colorTarea($datos[$i][$cMes.'T'],$datos[$i][$cMes.'C']).\n '<input type=\"hidden\" id=\"'.nombreMesMinuscula($fechaMes).'PlanTrabajoDetalle\" name=\"'.nombreMesMinuscula($fechaMes).'PlanTrabajoDetalle[]\" \n value=\"'.valorTarea($datos[$i][$cMes.'T'],$datos[$i][$cMes.'C']).'\">\n </td>';\n }\n \n $tabla .= \n '<td>\n 0\n <input type=\"hidden\" id=\"presupuestoPlanTrabajoDetalle\" name=\"presupuestoPlanTrabajoDetalle[]\" value=\"0\">\n </td>\n <td>\n 0\n <input type=\"hidden\" id=\"costoRealPlanTrabajoDetalle\" name=\"costoRealPlanTrabajoDetalle[]\" value=\"0\">\n </td>\n <td>\n 0\n <input type=\"hidden\" id=\"cumplimientoPlanTrabajoDetalle\" name=\"cumplimientoPlanTrabajoDetalle[]\" value=\"0\">\n </td>\n <td>\n <input type=\"text\" id=\"metaPlanTrabajoDetalle\" name=\"metaPlanTrabajoDetalle[]\" value=\"0\">\n </td>\n <td>\n <textarea id=\"observacionPlanTrabajoDetalle\" name=\"observacionPlanTrabajoDetalle[]\">\n </textarea>\n </td>\n \n </tr>';\n\n }\n $tabla .= '\n </tbody>\n </table>\n </div> \n </div>\n </div>';\n\n return $tabla;\n }", "public function GenerarHorariosBloque($listaFinal,$listaGrupos,$listaPrioridad)\n {\n $listaPruebas = array(); \n $listaDeHorariosFinal = array();\n $listaMateriasInscritasHora = array();\n $listaAdvertencias = array(\"\");\n $listaERRORES = array(\"\");\n $ReporteFinal = array();\n $listaOriginal = array();\n //foreach para recorrer carrera por carrera\n foreach ($listaFinal as $lf) {\n\n $listaDeHorariosFinal = array();\n\n //\n $listaAuxiliarHorarios = array();\n\n for($r=0; $r<6; $r++)\n {\n //VARIABLE QUE NOS VA A INDICAR CUANTO CUPO TIENE CADA HORARIO\n $CupoTotalHorario = 0;\n\n if($r>0)\n {\n sort($listaMateriasHorario);\n array_push($listaAuxiliarHorarios,$listaMateriasHorario);\n foreach($listaAuxiliarHorarios as $lh)\n {\n foreach($lh as $recorrido)\n {\n //echo $recorrido->campo;\n //echo $recorrido->hora;\n //echo '<br>';\n }\n }\n }\n $listaMateriasInscritasNombre = array();\n $listaMateriasAñadidas = array();\n if($r == 0)\n {\n //echo '<h4>'.$r.'</h4>';\n //guardamos el nombre de la carrera\n $carrera = $lf->nombreCarrera;\n //echo '<h5>'.$carrera.'</h5>';\n //lista donde se va a guardar las horas de la carrera\n $listaHorasOcupada = array();\n //lista de Hora y Dia ocupada\n $listaDiaHoraOcupado = array(\"\");\n //acomodamos la lista\n uasort($lf->listaMaterias, array($this, 'sbo'));\n //lista que nos dira que materias YA estan insertadas\n \n //foreach para recorrer las materias de la carrera con la informacion\n\n //NUMERO DE HORARIO A REALIZAR\n $NumeroReferenciaHorario = 1;\n\n $listaMateriasHorario = array();\n\n \n foreach ($lf->listaMaterias as $listass) {\n\n $contadorDiasMateria = 0;\n $contadorFinalMateria = 0;\n $ClavMat = $listass->clave;\n\n foreach ($listaGrupos as $clave => $fila) {\n\n //guardamos la variable que vamos a comparar esta variable es la que se esta recorriendo del archivo\n //Comparamos si la materia con pocos grupos es igual al recorrido dentro del archivo \n $nombreM =$fila->nombreMateria;\n\n $contadorDiasMateria = 0;\n $contadorFinalMateria = 0;\n\n if(in_array($listass->Materia,$listaMateriasInscritasNombre)){\n //si ya se inserto no se hace nada \n }else{\n //si no esta en la lista significa que se debe insertar\n //se compara el nombre\n //echo '<br>';\n if($nombreM == $listass->Materia)\n { \n //Guardamos los primeros dos digitos de la hora en la que se INICIA la clase \n $HoraInicial = substr($fila->horas, 0, 2);\n //Guardamos los primeros dos digitos de la hora en que se TERMINA\n $HoraFinal = substr($fila->horas, 3, 2);\n //Restamos para saber de cuantas horas es la clase \n $Resta = $HoraFinal - $HoraInicial;\n\n //Si es mayor a 1 significa que la clase dura mas de una hora\n if($Resta>1)\n {\n //Si la materia es de mas de una hora SEGUIDA \n\n $HoraReffLunes = 0;\n $HoraReffMartes = 0;\n $HoraReffMiercoles = 0;\n $HoraReffJueves = 0;\n $HoraReffViernes = 0;\n $HoraReffSabado = 0;\n //hacemos un ciclo para insertar el numero total de horas\n\n //Referencia para saber de cuantos dias es la materia\n if($fila->lunes == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n if($fila->martes == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n if($fila->miercoles == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n if($fila->jueves == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n if($fila->viernes == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n if($fila->sabado == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n\n //revision dentro de la lista\n \n\n $unavezLunes = 0;\n $unavezMartes = 0;\n $unavezMiercoles = 0;\n $unavezJueves = 0;\n $unavezViernes = 0;\n $unavezSabado = 0;\n\n for($i = 0; $i<$Resta; $i++)\n {\n if($fila->lunes != \"\")\n {\n $HoraReffLunes = substr($fila->lunes, 0, 2);\n $horaDiaLunes = 'lunes'.$HoraReffLunes;\n if(in_array($horaDiaLunes,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar\n $contadorFinalMateria = 10000;\n }else{\n //poner un if para solo una entrada al contador\n if($unavezLunes == 0)\n {\n $contadorFinalMateria = $contadorFinalMateria + 1;\n $unavezLunes = 1;\n } \n $HoraReffLunes == $HoraReffLunes + 1;\n }\n }\n if($fila->martes != \"\")\n {\n $HoraReffMartes = substr($fila->martes, 0, 2);\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n if(in_array($horaDiaMartes,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar \n $contadorFinalMateria = 10000;\n }else{\n if($unavezMartes == 0)\n {\n $contadorFinalMateria = $contadorFinalMateria + 1;\n $unavezMartes = 1;\n } \n $HoraReffMartes == $HoraReffMartes + 1;\n }\n }\n if($fila->miercoles != \"\")\n {\n $HoraReffMiercoles = substr($fila->miercoles, 0, 2);\n $horaDiaMiercoles = 'miercoles'.$HoraReffMiercoles;\n if(in_array($horaDiaMiercoles,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar\n $contadorFinalMateria = 10000;\n }else{\n if($unavezMiercoles == 0)\n {\n $contadorFinalMateria = $contadorFinalMateria + 1;\n $unavezMiercoles = 1;\n } \n $HoraReffMiercoles == $HoraReffMiercoles + 1;\n }\n }\n if($fila->jueves != \"\")\n {\n $HoraReffJueves = substr($fila->jueves, 0, 2);\n $horaDiaJueves = 'jueves'.$HoraReffJueves;\n if(in_array($horaDiaJueves,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar\n $contadorFinalMateria = 10000;\n }else{\n if($unavezJueves == 0)\n {\n $contadorFinalMateria = $contadorFinalMateria + 1;\n $unavezJueves = 1;\n } \n $HoraReffJueves == $HoraReffJueves + 1;\n }\n }\n if($fila->viernes != \"\")\n {\n $HoraReffViernes = substr($fila->viernes, 0, 2);\n $horaDiaViernes = 'viernes'.$HoraReffViernes;\n if(in_array($horaDiaViernes,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar\n $contadorFinalMateria = 10000;\n }else{\n if($unavezViernes == 0)\n {\n $contadorFinalMateria = $contadorFinalMateria + 1;\n $unavezViernes = 1;\n } \n $HoraReffViernes == $HoraReffViernes + 1;\n }\n }\n if($fila->sabado != \"\")\n {\n $HoraReffSabado = substr($fila->sabado, 0, 2);\n $horaDiaSabado = 'sabado'.$HoraReffSabado;\n if(in_array($horaDiaSabado,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar\n $contadorFinalMateria = 10000;\n }else{\n if($unavezSabado == 0)\n {\n $contadorFinalMateria = $contadorFinalMateria + 1;\n $unavezSabado = 1;\n } \n $HoraReffSabado == $HoraReffSabado + 1;\n }\n }\n //TERMINACION DE COMPARACION\n }\n //echo \"Se compara las horas totales: \".$contadorDiasMateria.\" contra las horas disponibles\".$contadorFinalMateria;\n if($contadorFinalMateria == $contadorDiasMateria)\n {\n // echo $listass->valorGrupo;\n //SI ENTRA AQUI SIGNIFICA QUE SI HAY ESPACIO PARA METER LA MATERIA\n \n $brincoLunes = 0;\n $brincoMartes = 0;\n $brincoMiercoles = 0;\n $brincoJueves = 0;\n $brincoViernes = 0;\n $brincoSabado = 0;\n\n $referenciaSalida = 0;\n\n //ESTA PARTE ES PARA VER CUAL ES LA CANTIDAD DE VECES QUE SE PUEDE REPARTIR EL HORARIO\n //revisamos si el cupo tiene algo\n if($CupoTotalHorario == 0)\n {\n $CupoTotalHorario = $fila->cupo;\n }else{\n if($CupoTotalHorario > $fila->cupo)\n {\n $CupoTotalHorario = $fila->cupo;\n }\n }\n\n //se inserta la materia a la lista\n array_push($listaMateriasInscritasNombre,$nombreM);\n //echo 'Se inserto la materia: '.$nombreM.\" A las: \".$fila->horas.\" Los dias: \".$fila->dias.' Profesor '.$fila->profesor;\n //echo '<br>';\n \n for($i = 0; $i<$Resta; $i++)\n {\n \n $HoraInsertada = new Hora1($HoraInicial,$nombreM,$lf->nombreCarrera,$fila->dias,$fila->profesor,$fila->cupo,$ClavMat);\n array_push($listaMateriasHorario,$HoraInsertada);\n $HoraInicial = $HoraInicial + 1;\n //significa que si hay cupo en la hora deseada con los dias deseados\n if($fila->tipo == \"L\")\n {\n //Si es laboratorio\n if($fila->lunes == \"\")\n {\n //echo \"No existe clases los lunes \"; \n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoLunes == 0)\n {\n $HoraReffLunes = substr($fila->lunes, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia lunes a las: \".$HoraReffLunes;\n $horaDiaLunes = 'lunes'.$HoraReffLunes;\n array_push($listaDiaHoraOcupado,$horaDiaLunes);\n $HoraReffLunes = $HoraReffLunes + 1;\n $brincoLunes = 1;\n //echo '<br>';\n }else{\n //echo 'El laboratorio'.$nombreM.\" Se inserto el dia lunes a las: \".$HoraReffLunes;\n $horaDiaLunes = 'lunes'.$HoraReffLunes;\n array_push($listaDiaHoraOcupado,$horaDiaLunes);\n $HoraReffLunes = $HoraReffLunes + 1;\n //echo '<br>';\n }\n }\n if($fila->martes == \"\")\n {\n //echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoMartes == 0)\n {\n $HoraReffMartes = substr($fila->martes, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia martes a las: \".$HoraReffMartes;\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n array_push($listaDiaHoraOcupado,$horaDiaMartes);\n $HoraReffMartes = $HoraReffMartes + 1;\n $brincoMartes = 1;\n //echo '<br>';\n }else{\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia martes a las: \".$HoraReffMartes;\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n array_push($listaDiaHoraOcupado,$horaDiaMartes);\n $HoraReffMartes = $HoraReffMartes + 1;\n //echo '<br>';\n }\n $HoraReffMartes = substr($fila->martes, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia martes a las: \".$HoraReffMartes;\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n array_push($listaDiaHoraOcupado,$horaDiaMartes);\n $HoraReffMartes = $HoraReffMartes + 1;\n //echo '<br>';\n }\n if($fila->miercoles == \"\")\n {\n //echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoMiercoles == 0)\n {\n $HoraReffMiercoles = substr($fila->miercoles, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia miercoles a las: \".$HoraReffMiercoles;\n $horaDiaMiercoles = 'miercoles'.$HoraReffMiercoles;\n array_push($listaDiaHoraOcupado,$horaDiaMiercoles);\n $HoraReffMiercoles = $HoraReffMiercoles + 1;\n $brincoMiercoles = 1;\n //echo '<br>';\n\n }else{\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia miercoles a las: \".$HoraReffMiercoles;\n $horaDiaMiercoles = 'miercoles'.$HoraReffMiercoles;\n array_push($listaDiaHoraOcupado,$horaDiaMiercoles);\n $HoraReffMiercoles = $HoraReffMiercoles + 1;\n //echo '<br>';\n }\n }\n if($fila->jueves == \"\")\n {\n // echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoJueves == 0)\n {\n $horaDia = $HoraInicial.\"jueves\";\n $HoraReffJueves = substr($fila->jueves, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia jueves a las: \".$HoraReffJueves;\n $horaDiaJueves = 'jueves'.$HoraReffJueves;\n array_push($listaDiaHoraOcupado,$horaDiaJueves);\n $HoraReffJueves = $HoraReffJueves + 1;\n $brincoJueves = 1;\n //echo '<br>';\n }else{\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia jueves a las: \".$HoraReffJueves;\n $horaDiaJueves = 'jueves'.$HoraReffJueves;\n array_push($listaDiaHoraOcupado,$horaDiaJueves);\n $HoraReffJueves = $HoraReffJueves + 1;\n //echo '<br>';\n }\n }\n if($fila->viernes == \"\")\n {\n //echo \"No existe clases los lunes \";\n }else{\n \n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoViernes == 0)\n {\n $horaDia = $HoraInicial.\" viernes\";\n $HoraReffViernes = substr($fila->viernes, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia viernes a las: \".$HoraReffViernes;\n $horaDiaViernes = 'viernes'.$HoraReffViernes;\n array_push($listaDiaHoraOcupado,$horaDiaViernes);\n $HoraReffViernes = $HoraReffViernes + 1;\n $brincoViernes = 1;\n //echo '<br>';\n }else{\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia viernes a las: \".$HoraReffViernes;\n $horaDiaViernes = 'viernes'.$HoraReffViernes;\n array_push($listaDiaHoraOcupado,$horaDiaViernes);\n $HoraReffViernes = $HoraReffViernes + 1;\n //echo '<br>';\n }\n \n }\n if($fila->sabado == \"\")\n {\n //echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoSabado == 0)\n {\n $HoraReffSabado = substr($fila->sabado, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia sabado a las: \".$HoraReffSabado;\n $horaDiaSabado = 'sabado'.$HoraReffSabado;\n array_push($listaDiaHoraOcupado,$horaDiaJueves);\n //echo '<br>';\n $HoraReffSabado = $HoraReffSabado + 1;\n $brincoSabado = 1;\n }else{\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia sabado a las: \".$HoraReffSabado;\n $horaDiaSabado = 'sabado'.$HoraReffSabado;\n array_push($listaDiaHoraOcupado,$horaDiaJueves);\n //echo '<br>';\n $HoraReffSabado = $HoraReffSabado + 1;\n }\n }\n }else{\n //SI NO es laboratorio\n if($fila->lunes == \"\")\n {\n //echo \"No existe clases los lunes \"; \n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoLunes == 0)\n {\n $HoraReffLunes = substr($fila->lunes, 0, 2);\n //echo 'La materia '.$nombreM.\" Se inserto el dia lunes a las: \".$HoraReffLunes;\n $horaDiaLunes = 'lunes'.$HoraReffLunes;\n array_push($listaDiaHoraOcupado,$horaDiaLunes);\n $HoraReffLunes = $HoraReffLunes + 1;\n $brincoLunes = 1;\n //echo '<br>';\n }else{\n //echo 'La materia '.$nombreM.\" Se inserto el dia lunes a las: \".$HoraReffLunes;\n $horaDiaLunes = 'lunes'.$HoraReffLunes;\n array_push($listaDiaHoraOcupado,$horaDiaLunes);\n $HoraReffLunes = $HoraReffLunes + 1;\n //echo '<br>';\n }\n }\n if($fila->martes == \"\")\n {\n //echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoMartes == 0)\n {\n $HoraReffMartes = substr($fila->martes, 0, 2);\n //echo 'La materia '.$nombreM.\" Se inserto el dia martes a las: \".$HoraReffMartes;\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n array_push($listaDiaHoraOcupado,$horaDiaMartes);\n $HoraReffMartes = $HoraReffMartes + 1;\n $brincoMartes = 1;\n //echo '<br>';\n }else{\n //echo 'La materia '.$nombreM.\" Se inserto el dia martes a las: \".$HoraReffMartes;\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n array_push($listaDiaHoraOcupado,$horaDiaMartes);\n $HoraReffMartes = $HoraReffMartes + 1;\n //echo '<br>';\n }\n $HoraReffMartes = substr($fila->martes, 0, 2);\n //echo 'La materia '.$nombreM.\" Se inserto el dia martes a las: \".$HoraReffMartes;\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n array_push($listaDiaHoraOcupado,$horaDiaMartes);\n $HoraReffMartes = $HoraReffMartes + 1;\n //echo '<br>';\n }\n if($fila->miercoles == \"\")\n {\n // echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoMiercoles == 0)\n {\n $HoraReffMiercoles = substr($fila->miercoles, 0, 2);\n //echo 'La materia '.$nombreM.\" Se inserto el dia miercoles a las: \".$HoraReffMiercoles;\n $horaDiaMiercoles = 'miercoles'.$HoraReffMiercoles;\n array_push($listaDiaHoraOcupado,$horaDiaMiercoles);\n $HoraReffMiercoles = $HoraReffMiercoles + 1;\n $brincoMiercoles = 1;\n //echo '<br>';\n\n }else{\n //echo 'La materia '.$nombreM.\" Se inserto el dia miercoles a las: \".$HoraReffMiercoles;\n $horaDiaMiercoles = 'miercoles'.$HoraReffMiercoles;\n array_push($listaDiaHoraOcupado,$horaDiaMiercoles);\n $HoraReffMiercoles = $HoraReffMiercoles + 1;\n //echo '<br>';\n }\n }\n if($fila->jueves == \"\")\n {\n // echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoJueves == 0)\n {\n $horaDia = $HoraInicial.\"jueves\";\n $HoraReffJueves = substr($fila->jueves, 0, 2);\n //echo 'La materia '.$nombreM.\" Se inserto el dia jueves a las: \".$HoraReffJueves;\n $horaDiaJueves = 'jueves'.$HoraReffJueves;\n array_push($listaDiaHoraOcupado,$horaDiaJueves);\n $HoraReffJueves = $HoraReffJueves + 1;\n $brincoJueves = 1;\n //echo '<br>';\n }else{\n //echo 'La materia '.$nombreM.\" Se inserto el dia jueves a las: \".$HoraReffJueves;\n $horaDiaJueves = 'jueves'.$HoraReffJueves;\n array_push($listaDiaHoraOcupado,$horaDiaJueves);\n $HoraReffJueves = $HoraReffJueves + 1;\n //echo '<br>';\n }\n }\n if($fila->viernes == \"\")\n {\n //echo \"No existe clases los lunes \";\n }else{ \n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoViernes == 0)\n {\n $horaDia = $HoraInicial.\" viernes\";\n $HoraReffViernes = substr($fila->viernes, 0, 2);\n //echo 'La materia varias horas mismo dia '.$nombreM.\" Se inserto el dia viernes a las: \".$HoraReffViernes;\n $horaDiaViernes = 'viernes'.$HoraReffViernes;\n array_push($listaDiaHoraOcupado,$horaDiaViernes);\n $HoraReffViernes = $HoraReffViernes + 1;\n $brincoViernes = 1;\n //echo '<br>';\n }else{\n //echo 'La materia varias horas mismo dia '.$nombreM.\" Se inserto el dia viernes a las: \".$HoraReffViernes;\n $horaDiaViernes = 'viernes'.$HoraReffViernes;\n array_push($listaDiaHoraOcupado,$horaDiaViernes);\n $HoraReffViernes = $HoraReffViernes + 1;\n //echo '<br>';\n } \n }\n if($fila->sabado == \"\")\n {\n // echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoSabado == 0)\n {\n $HoraReffSabado = substr($fila->sabado, 0, 2);\n //echo 'La materia '.$nombreM.\" Se inserto el dia sabado a las: \".$HoraReffSabado;\n $horaDiaSabado = 'sabado'.$HoraReffSabado;\n array_push($listaDiaHoraOcupado,$horaDiaSabado);\n //echo '<br>';\n $HoraReffSabado = $HoraReffSabado + 1;\n $brincoSabado = 1;\n }else{\n // echo 'La materia '.$nombreM.\" Se inserto el dia sabado a las: \".$HoraReffSabado;\n $horaDiaSabado = 'sabado'.$HoraReffSabado;\n array_push($listaDiaHoraOcupado,$horaDiaSabado);\n //echo '<br>';\n $HoraReffSabado = $HoraReffSabado + 1;\n }\n }\n }\n }\n $Resta = 0;\n }else{\n //EL HORARIO NO SE PUDO INSERTAR por que se empalmo\n }\n //si eres de una sola hora\n //----------------------------------------------------------------------------------------\n }else{\n //Si no es mayor a 1 significa que la clase solo es de una hora \n //Referencia para saber de cuantos dias es la materia\n if($fila->lunes == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n if($fila->martes == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n if($fila->miercoles == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n if($fila->jueves == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n if($fila->viernes == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n if($fila->sabado == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n\n \n if($fila->lunes != \"\")\n {\n $HoraReffLunes = substr($fila->lunes, 0, 2);\n $horaDiaLunes = 'lunes'.$HoraReffLunes;\n if(in_array($horaDiaLunes,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar \n }else{\n $contadorFinalMateria = $contadorFinalMateria + 1; \n }\n }\n if($fila->martes != \"\")\n {\n $HoraReffMartes = substr($fila->martes, 0, 2);\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n if(in_array($horaDiaMartes,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar \n }else{\n $contadorFinalMateria = $contadorFinalMateria + 1;\n \n }\n }\n if($fila->miercoles != \"\")\n {\n $HoraReffMiercoles = substr($fila->miercoles, 0, 2);\n $horaDiaMiercoles = 'miercoles'.$HoraReffMiercoles;\n if(in_array($horaDiaMiercoles,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar \n }else{\n $contadorFinalMateria = $contadorFinalMateria + 1;\n \n }\n }\n if($fila->jueves != \"\")\n {\n $HoraReffJueves = substr($fila->jueves, 0, 2);\n $horaDiaJueves = 'jueves'.$HoraReffJueves;\n if(in_array($horaDiaJueves,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar \n }else{\n $contadorFinalMateria = $contadorFinalMateria + 1;\n \n }\n }\n if($fila->viernes != \"\")\n {\n $HoraReffViernes = substr($fila->viernes, 0, 2);\n $horaDiaViernes = 'viernes'.$HoraReffViernes;\n if(in_array($horaDiaViernes,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar \n }else{\n $contadorFinalMateria = $contadorFinalMateria + 1;\n \n }\n }\n if($fila->sabado != \"\")\n {\n $HoraReffSabado = substr($fila->sabado, 0, 2);\n $horaDiaSabado = 'sabado'.$HoraReffSabado;\n if(in_array($horaDiaSabado,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar \n }else{\n $contadorFinalMateria = $contadorFinalMateria + 1;\n \n }\n }\n\n //echo \"Se compara las horas totales: \".$contadorDiasMateria.\" contra las horas disponibles\".$contadorFinalMateria;\n //TERMINACION DE COMPARACION\n if($contadorFinalMateria == $contadorDiasMateria)\n {\n \n //echo $listass->valorGrupo;\n $brincoLunes = 0;\n $brincoMartes = 0;\n $brincoMiercoles = 0;\n $brincoJueves = 0;\n $brincoViernes = 0;\n $brincoSabado = 0;\n\n if($CupoTotalHorario == 0)\n {\n $CupoTotalHorario = $fila->cupo;\n }else{\n if($CupoTotalHorario > $fila->cupo)\n {\n $CupoTotalHorario = $fila->cupo;\n }\n }\n\n //Significa que si hay espacio\n array_push($listaMateriasInscritasNombre,$nombreM);\n //echo 'Se inserto la materia: '.$nombreM.\" A las: \".$fila->horas.\" Los dias: \".$fila->dias.' Profesor: '.$fila->profesor;\n //echo '<br>';\n $HoraInsertada = new Hora1($HoraInicial,$nombreM,$lf->nombreCarrera,$fila->dias,$fila->profesor,$fila->cupo,$ClavMat);\n array_push($listaMateriasHorario,$HoraInsertada);\n // echo '<h5>'.$fila->tipo.'</h5>';\n //Si es laboratorio\n if($fila->lunes == \"\")\n {\n //echo \"No existe clases los lunes \"; \n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoLunes == 0)\n {\n $HoraReffLunes = substr($fila->lunes, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia lunes a las: \".$HoraReffLunes;\n $horaDiaLunes = 'lunes'.$HoraReffLunes;\n array_push($listaDiaHoraOcupado,$horaDiaLunes);\n $HoraReffLunes = $HoraReffLunes + 1;\n $brincoLunes = 1;\n //echo '<br>';\n }else{\n //echo 'El laboratorio'.$nombreM.\" Se inserto el dia lunes a las: \".$HoraReffLunes;\n $horaDiaLunes = 'lunes'.$HoraReffLunes;\n array_push($listaDiaHoraOcupado,$horaDiaLunes);\n $HoraReffLunes = $HoraReffLunes + 1;\n //echo '<br>';\n }\n }\n if($fila->martes == \"\")\n {\n //echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoMartes == 0)\n {\n $HoraReffMartes = substr($fila->martes, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia martes a las: \".$HoraReffMartes;\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n array_push($listaDiaHoraOcupado,$horaDiaMartes);\n $HoraReffMartes = $HoraReffMartes + 1;\n $brincoMartes = 1;\n //echo '<br>';\n }else{\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia martes a las: \".$HoraReffMartes;\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n array_push($listaDiaHoraOcupado,$horaDiaMartes);\n $HoraReffMartes = $HoraReffMartes + 1;\n //echo '<br>';\n }\n $HoraReffMartes = substr($fila->martes, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia martes a las: \".$HoraReffMartes;\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n array_push($listaDiaHoraOcupado,$horaDiaMartes);\n $HoraReffMartes = $HoraReffMartes + 1;\n //echo '<br>';\n }\n if($fila->miercoles == \"\")\n {\n // echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoMiercoles == 0)\n {\n $HoraReffMiercoles = substr($fila->miercoles, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia miercoles a las: \".$HoraReffMiercoles;\n $horaDiaMiercoles = 'miercoles'.$HoraReffMiercoles;\n array_push($listaDiaHoraOcupado,$horaDiaMiercoles);\n $HoraReffMiercoles = $HoraReffMiercoles + 1;\n $brincoMiercoles = 1;\n //echo '<br>';\n\n }else{\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia miercoles a las: \".$HoraReffMiercoles;\n $horaDiaMiercoles = 'miercoles'.$HoraReffMiercoles;\n array_push($listaDiaHoraOcupado,$horaDiaMiercoles);\n $HoraReffMiercoles = $HoraReffMiercoles + 1;\n //echo '<br>';\n }\n }\n if($fila->jueves == \"\")\n {\n // echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoJueves == 0)\n {\n $horaDia = $HoraInicial.\"jueves\";\n $HoraReffJueves = substr($fila->jueves, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia jueves a las: \".$HoraReffJueves;\n $horaDiaJueves = 'jueves'.$HoraReffJueves;\n array_push($listaDiaHoraOcupado,$horaDiaJueves);\n $HoraReffJueves = $HoraReffJueves + 1;\n $brincoJueves = 1;\n //echo '<br>';\n }else{\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia jueves a las: \".$HoraReffJueves;\n $horaDiaJueves = 'jueves'.$HoraReffJueves;\n array_push($listaDiaHoraOcupado,$horaDiaJueves);\n $HoraReffJueves = $HoraReffJueves + 1;\n //echo '<br>';\n }\n }\n if($fila->viernes == \"\")\n {\n //echo \"No existe clases los lunes \";\n }else{\n \n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoViernes == 0)\n {\n $horaDia = $HoraInicial.\" viernes\";\n $HoraReffViernes = substr($fila->viernes, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia viernes a las: \".$HoraReffViernes;\n $horaDiaViernes = 'viernes'.$HoraReffViernes;\n array_push($listaDiaHoraOcupado,$horaDiaViernes);\n $HoraReffViernes = $HoraReffViernes + 1;\n $brincoViernes = 1;\n //echo '<br>';\n }else{\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia viernes a las: \".$HoraReffViernes;\n $horaDiaViernes = 'viernes'.$HoraReffViernes;\n array_push($listaDiaHoraOcupado,$horaDiaViernes);\n $HoraReffViernes = $HoraReffViernes + 1;\n //echo '<br>';\n }\n \n }\n if($fila->sabado == \"\")\n {\n // echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoSabado == 0)\n {\n $HoraReffSabado = substr($fila->sabado, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia sabado a las: \".$HoraReffSabado;\n $horaDiaSabado = 'sabado'.$HoraReffSabado;\n array_push($listaDiaHoraOcupado,$horaDiaSabado);\n //echo '<br>';\n $HoraReffSabado = $HoraReffSabado + 1;\n $brincoSabado = 1;\n }else{\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia sabado a las: \".$HoraReffSabado;\n $horaDiaSabado = 'sabado'.$HoraReffSabado;\n array_push($listaDiaHoraOcupado,$horaDiaSabado);\n //echo '<br>';\n $HoraReffSabado = $HoraReffSabado + 1;\n }\n }\n /*********************************************************************** */\n }else{\n }\n\n }\n }\n }\n }\n }\n\n }else{\n\n /*-------------------------------------------------------------------------------------------------------------------- */ \n //echo '<h4>'.$r.'</h4>';\n //guardamos el nombre de la carrera\n $carrera = $lf->nombreCarrera;\n //echo '<h5>'.$carrera.'</h5>';\n //lista donde se va a guardar las horas de la carrera\n $listaHorasOcupada = array();\n //lista de Hora y Dia ocupada\n $listaDiaHoraOcupado = array(\"\");\n //acomodamos la lista\n uasort($lf->listaMaterias, array($this, 'sbo'));\n //lista que nos dira que materias YA estan insertadas\n \n //foreach para recorrer las materias de la carrera con la informacion\n\n //NUMERO DE HORARIO A REALIZAR\n $NumeroReferenciaHorario = 1;\n\n $listaMateriasHorario = array();\n\n \n foreach ($lf->listaMaterias as $listass) {\n\n $contadorDiasMateria = 0;\n $contadorFinalMateria = 0;\n $ClavMat = $listass->clave;\n\n foreach ($listaGrupos as $clave => $fila) {\n\n //guardamos la variable que vamos a comparar esta variable es la que se esta recorriendo del archivo\n //Comparamos si la materia con pocos grupos es igual al recorrido dentro del archivo \n $nombreM =$fila->nombreMateria;\n\n $contadorDiasMateria = 0;\n $contadorFinalMateria = 0;\n\n if(in_array($listass->Materia,$listaMateriasInscritasNombre)){\n //si ya se inserto no se hace nada \n }else{\n //si no esta en la lista significa que se debe insertar\n //se compara el nombre\n //echo '<br>';\n if($nombreM == $listass->Materia)\n { \n //Guardamos los primeros dos digitos de la hora en la que se INICIA la clase \n $HoraInicial = substr($fila->horas, 0, 2);\n //Guardamos los primeros dos digitos de la hora en que se TERMINA\n $HoraFinal = substr($fila->horas, 3, 2);\n //Restamos para saber de cuantas horas es la clase \n $Resta = $HoraFinal - $HoraInicial;\n\n //Si es mayor a 1 significa que la clase dura mas de una hora\n if($Resta>1)\n {\n //Si la materia es de mas de una hora SEGUIDA \n\n $HoraReffLunes = 0;\n $HoraReffMartes = 0;\n $HoraReffMiercoles = 0;\n $HoraReffJueves = 0;\n $HoraReffViernes = 0;\n $HoraReffSabado = 0;\n //hacemos un ciclo para insertar el numero total de horas\n\n //Referencia para saber de cuantos dias es la materia\n if($fila->lunes == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n if($fila->martes == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n if($fila->miercoles == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n if($fila->jueves == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n if($fila->viernes == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n if($fila->sabado == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n\n //revision dentro de la lista\n \n\n $unavezLunes = 0;\n $unavezMartes = 0;\n $unavezMiercoles = 0;\n $unavezJueves = 0;\n $unavezViernes = 0;\n $unavezSabado = 0;\n\n for($i = 0; $i<$Resta; $i++)\n {\n if($fila->lunes != \"\")\n {\n $HoraReffLunes = substr($fila->lunes, 0, 2);\n $horaDiaLunes = 'lunes'.$HoraReffLunes;\n if(in_array($horaDiaLunes,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar\n $contadorFinalMateria = 10000;\n }else{\n //poner un if para solo una entrada al contador\n if($unavezLunes == 0)\n {\n $contadorFinalMateria = $contadorFinalMateria + 1;\n $unavezLunes = 1;\n } \n $HoraReffLunes == $HoraReffLunes + 1;\n }\n }\n if($fila->martes != \"\")\n {\n $HoraReffMartes = substr($fila->martes, 0, 2);\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n if(in_array($horaDiaMartes,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar \n $contadorFinalMateria = 10000;\n }else{\n if($unavezMartes == 0)\n {\n $contadorFinalMateria = $contadorFinalMateria + 1;\n $unavezMartes = 1;\n } \n $HoraReffMartes == $HoraReffMartes + 1;\n }\n }\n if($fila->miercoles != \"\")\n {\n $HoraReffMiercoles = substr($fila->miercoles, 0, 2);\n $horaDiaMiercoles = 'miercoles'.$HoraReffMiercoles;\n if(in_array($horaDiaMiercoles,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar\n $contadorFinalMateria = 10000;\n }else{\n if($unavezMiercoles == 0)\n {\n $contadorFinalMateria = $contadorFinalMateria + 1;\n $unavezMiercoles = 1;\n } \n $HoraReffMiercoles == $HoraReffMiercoles + 1;\n }\n }\n if($fila->jueves != \"\")\n {\n $HoraReffJueves = substr($fila->jueves, 0, 2);\n $horaDiaJueves = 'jueves'.$HoraReffJueves;\n if(in_array($horaDiaJueves,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar\n $contadorFinalMateria = 10000;\n }else{\n if($unavezJueves == 0)\n {\n $contadorFinalMateria = $contadorFinalMateria + 1;\n $unavezJueves = 1;\n } \n $HoraReffJueves == $HoraReffJueves + 1;\n }\n }\n if($fila->viernes != \"\")\n {\n $HoraReffViernes = substr($fila->viernes, 0, 2);\n $horaDiaViernes = 'viernes'.$HoraReffViernes;\n if(in_array($horaDiaViernes,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar\n $contadorFinalMateria = 10000;\n }else{\n if($unavezViernes == 0)\n {\n $contadorFinalMateria = $contadorFinalMateria + 1;\n $unavezViernes = 1;\n } \n $HoraReffViernes == $HoraReffViernes + 1;\n }\n }\n if($fila->sabado != \"\")\n {\n $HoraReffSabado = substr($fila->sabado, 0, 2);\n $horaDiaSabado = 'sabado'.$HoraReffSabado;\n if(in_array($horaDiaSabado,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar\n $contadorFinalMateria = 10000;\n }else{\n if($unavezSabado == 0)\n {\n $contadorFinalMateria = $contadorFinalMateria + 1;\n $unavezSabado = 1;\n } \n $HoraReffSabado == $HoraReffSabado + 1;\n }\n }\n //TERMINACION DE COMPARACION\n }\n //echo \"Se compara las horas totales: \".$contadorDiasMateria.\" contra las horas disponibles\".$contadorFinalMateria;\n if($contadorFinalMateria == $contadorDiasMateria)\n {\n\n //cuando una materia tiene multiples horas seguidas\n\n \n //echo $listass->valorGrupo;\n $bandera = 0;\n\n if($listass->valorGrupo > 2)\n {\n foreach($listaAuxiliarHorarios as $lh)\n {\n foreach($lh as $recorrido)\n {\n //echo $recorrido->campo;\n //echo $recorrido->hora;\n if($nombreM == $recorrido->campo)\n {\n $Hora1 = substr($fila->horas, 0, 2);\n $Hora2 = substr($recorrido->hora, 0, 2);\n $HoraA = strval($fila->horas);\n $HoraB = strval($recorrido->hora);\n //echo 'La materia '.$nombreM.\" Hora: \".$HoraA.' VS '.' La materia '.$recorrido->campo.' Hora: '.$HoraB;\n //echo '<br>';\n if($HoraA == $HoraB)\n {\n //posibilidadborrar\n if($fila->profesor == $recorrido->profesor)\n {\n //echo 'Entro'; \n $bandera = 1;\n } \n }\n }\n }\n }\n \n }\n\n if($bandera == 1)\n {\n $bandera == 0;\n }else\n {\n //SI ENTRA AQUI SIGNIFICA QUE SI HAY ESPACIO PARA METER LA MATERIA\n \n $brincoLunes = 0;\n $brincoMartes = 0;\n $brincoMiercoles = 0;\n $brincoJueves = 0;\n $brincoViernes = 0;\n $brincoSabado = 0;\n\n $referenciaSalida = 0;\n\n if($CupoTotalHorario == 0)\n {\n $CupoTotalHorario = $fila->cupo;\n }else{\n if($CupoTotalHorario > $fila->cupo)\n {\n $CupoTotalHorario = $fila->cupo;\n }\n }\n\n //se inserta la materia a la lista\n array_push($listaMateriasInscritasNombre,$nombreM);\n //echo 'Se inserto la materia: '.$nombreM.\" A las: \".$fila->horas.\" Los dias: \".$fila->dias.' Profesor '.$fila->profesor;\n //echo '<br>';\n \n for($i = 0; $i<$Resta; $i++)\n {\n \n $HoraInsertada = new Hora1($HoraInicial,$nombreM,$lf->nombreCarrera,$fila->dias,$fila->profesor,$fila->cupo,$ClavMat);\n array_push($listaMateriasHorario,$HoraInsertada);\n $HoraInicial = $HoraInicial + 1;\n //significa que si hay cupo en la hora deseada con los dias deseados\n if($fila->tipo == \"L\")\n {\n //Si es laboratorio\n if($fila->lunes == \"\")\n {\n //echo \"No existe clases los lunes \"; \n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoLunes == 0)\n {\n $HoraReffLunes = substr($fila->lunes, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia lunes a las: \".$HoraReffLunes;\n $horaDiaLunes = 'lunes'.$HoraReffLunes;\n array_push($listaDiaHoraOcupado,$horaDiaLunes);\n $HoraReffLunes = $HoraReffLunes + 1;\n $brincoLunes = 1;\n //echo '<br>';\n }else{\n //echo 'El laboratorio'.$nombreM.\" Se inserto el dia lunes a las: \".$HoraReffLunes;\n $horaDiaLunes = 'lunes'.$HoraReffLunes;\n array_push($listaDiaHoraOcupado,$horaDiaLunes);\n $HoraReffLunes = $HoraReffLunes + 1;\n //echo '<br>';\n }\n }\n if($fila->martes == \"\")\n {\n //echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoMartes == 0)\n {\n $HoraReffMartes = substr($fila->martes, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia martes a las: \".$HoraReffMartes;\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n array_push($listaDiaHoraOcupado,$horaDiaMartes);\n $HoraReffMartes = $HoraReffMartes + 1;\n $brincoMartes = 1;\n //echo '<br>';\n }else{\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia martes a las: \".$HoraReffMartes;\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n array_push($listaDiaHoraOcupado,$horaDiaMartes);\n $HoraReffMartes = $HoraReffMartes + 1;\n //echo '<br>';\n }\n $HoraReffMartes = substr($fila->martes, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia martes a las: \".$HoraReffMartes;\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n array_push($listaDiaHoraOcupado,$horaDiaMartes);\n $HoraReffMartes = $HoraReffMartes + 1;\n //echo '<br>';\n }\n if($fila->miercoles == \"\")\n {\n //echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoMiercoles == 0)\n {\n $HoraReffMiercoles = substr($fila->miercoles, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia miercoles a las: \".$HoraReffMiercoles;\n $horaDiaMiercoles = 'miercoles'.$HoraReffMiercoles;\n array_push($listaDiaHoraOcupado,$horaDiaMiercoles);\n $HoraReffMiercoles = $HoraReffMiercoles + 1;\n $brincoMiercoles = 1;\n //echo '<br>';\n\n }else{\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia miercoles a las: \".$HoraReffMiercoles;\n $horaDiaMiercoles = 'miercoles'.$HoraReffMiercoles;\n array_push($listaDiaHoraOcupado,$horaDiaMiercoles);\n $HoraReffMiercoles = $HoraReffMiercoles + 1;\n //echo '<br>';\n }\n }\n if($fila->jueves == \"\")\n {\n // echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoJueves == 0)\n {\n $horaDia = $HoraInicial.\"jueves\";\n $HoraReffJueves = substr($fila->jueves, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia jueves a las: \".$HoraReffJueves;\n $horaDiaJueves = 'jueves'.$HoraReffJueves;\n array_push($listaDiaHoraOcupado,$horaDiaJueves);\n $HoraReffJueves = $HoraReffJueves + 1;\n $brincoJueves = 1;\n //echo '<br>';\n }else{\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia jueves a las: \".$HoraReffJueves;\n $horaDiaJueves = 'jueves'.$HoraReffJueves;\n array_push($listaDiaHoraOcupado,$horaDiaJueves);\n $HoraReffJueves = $HoraReffJueves + 1;\n //echo '<br>';\n }\n }\n if($fila->viernes == \"\")\n {\n //echo \"No existe clases los lunes \";\n }else{\n \n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoViernes == 0)\n {\n $horaDia = $HoraInicial.\" viernes\";\n $HoraReffViernes = substr($fila->viernes, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia viernes a las: \".$HoraReffViernes;\n $horaDiaViernes = 'viernes'.$HoraReffViernes;\n array_push($listaDiaHoraOcupado,$horaDiaViernes);\n $HoraReffViernes = $HoraReffViernes + 1;\n $brincoViernes = 1;\n //echo '<br>';\n }else{\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia viernes a las: \".$HoraReffViernes;\n $horaDiaViernes = 'viernes'.$HoraReffViernes;\n array_push($listaDiaHoraOcupado,$horaDiaViernes);\n $HoraReffViernes = $HoraReffViernes + 1;\n //echo '<br>';\n }\n \n }\n if($fila->sabado == \"\")\n {\n //echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoSabado == 0)\n {\n $HoraReffSabado = substr($fila->sabado, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia sabado a las: \".$HoraReffSabado;\n $horaDiaSabado = 'sabado'.$HoraReffSabado;\n array_push($listaDiaHoraOcupado,$horaDiaJueves);\n //echo '<br>';\n $HoraReffSabado = $HoraReffSabado + 1;\n $brincoSabado = 1;\n }else{\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia sabado a las: \".$HoraReffSabado;\n $horaDiaSabado = 'sabado'.$HoraReffSabado;\n array_push($listaDiaHoraOcupado,$horaDiaJueves);\n //echo '<br>';\n $HoraReffSabado = $HoraReffSabado + 1;\n }\n }\n }else{\n //SI NO es laboratorio\n if($fila->lunes == \"\")\n {\n //echo \"No existe clases los lunes \"; \n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoLunes == 0)\n {\n $HoraReffLunes = substr($fila->lunes, 0, 2);\n //echo 'La materia '.$nombreM.\" Se inserto el dia lunes a las: \".$HoraReffLunes;\n $horaDiaLunes = 'lunes'.$HoraReffLunes;\n array_push($listaDiaHoraOcupado,$horaDiaLunes);\n $HoraReffLunes = $HoraReffLunes + 1;\n $brincoLunes = 1;\n //echo '<br>';\n }else{\n //echo 'La materia '.$nombreM.\" Se inserto el dia lunes a las: \".$HoraReffLunes;\n $horaDiaLunes = 'lunes'.$HoraReffLunes;\n array_push($listaDiaHoraOcupado,$horaDiaLunes);\n $HoraReffLunes = $HoraReffLunes + 1;\n //echo '<br>';\n }\n }\n if($fila->martes == \"\")\n {\n //echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoMartes == 0)\n {\n $HoraReffMartes = substr($fila->martes, 0, 2);\n //echo 'La materia '.$nombreM.\" Se inserto el dia martes a las: \".$HoraReffMartes;\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n array_push($listaDiaHoraOcupado,$horaDiaMartes);\n $HoraReffMartes = $HoraReffMartes + 1;\n $brincoMartes = 1;\n //echo '<br>';\n }else{\n //echo 'La materia '.$nombreM.\" Se inserto el dia martes a las: \".$HoraReffMartes;\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n array_push($listaDiaHoraOcupado,$horaDiaMartes);\n $HoraReffMartes = $HoraReffMartes + 1;\n //echo '<br>';\n }\n $HoraReffMartes = substr($fila->martes, 0, 2);\n //echo 'La materia '.$nombreM.\" Se inserto el dia martes a las: \".$HoraReffMartes;\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n array_push($listaDiaHoraOcupado,$horaDiaMartes);\n $HoraReffMartes = $HoraReffMartes + 1;\n //echo '<br>';\n }\n if($fila->miercoles == \"\")\n {\n // echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoMiercoles == 0)\n {\n $HoraReffMiercoles = substr($fila->miercoles, 0, 2);\n //echo 'La materia '.$nombreM.\" Se inserto el dia miercoles a las: \".$HoraReffMiercoles;\n $horaDiaMiercoles = 'miercoles'.$HoraReffMiercoles;\n array_push($listaDiaHoraOcupado,$horaDiaMiercoles);\n $HoraReffMiercoles = $HoraReffMiercoles + 1;\n $brincoMiercoles = 1;\n //echo '<br>';\n\n }else{\n //echo 'La materia '.$nombreM.\" Se inserto el dia miercoles a las: \".$HoraReffMiercoles;\n $horaDiaMiercoles = 'miercoles'.$HoraReffMiercoles;\n array_push($listaDiaHoraOcupado,$horaDiaMiercoles);\n $HoraReffMiercoles = $HoraReffMiercoles + 1;\n //echo '<br>';\n }\n }\n if($fila->jueves == \"\")\n {\n // echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoJueves == 0)\n {\n $horaDia = $HoraInicial.\"jueves\";\n $HoraReffJueves = substr($fila->jueves, 0, 2);\n //echo 'La materia '.$nombreM.\" Se inserto el dia jueves a las: \".$HoraReffJueves;\n $horaDiaJueves = 'jueves'.$HoraReffJueves;\n array_push($listaDiaHoraOcupado,$horaDiaJueves);\n $HoraReffJueves = $HoraReffJueves + 1;\n $brincoJueves = 1;\n //echo '<br>';\n }else{\n //echo 'La materia '.$nombreM.\" Se inserto el dia jueves a las: \".$HoraReffJueves;\n $horaDiaJueves = 'jueves'.$HoraReffJueves;\n array_push($listaDiaHoraOcupado,$horaDiaJueves);\n $HoraReffJueves = $HoraReffJueves + 1;\n //echo '<br>';\n }\n }\n if($fila->viernes == \"\")\n {\n //echo \"No existe clases los lunes \";\n }else{ \n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoViernes == 0)\n {\n $horaDia = $HoraInicial.\" viernes\";\n $HoraReffViernes = substr($fila->viernes, 0, 2);\n //echo 'La materia varias horas mismo dia '.$nombreM.\" Se inserto el dia viernes a las: \".$HoraReffViernes;\n $horaDiaViernes = 'viernes'.$HoraReffViernes;\n array_push($listaDiaHoraOcupado,$horaDiaViernes);\n $HoraReffViernes = $HoraReffViernes + 1;\n $brincoViernes = 1;\n //echo '<br>';\n }else{\n //echo 'La materia varias horas mismo dia '.$nombreM.\" Se inserto el dia viernes a las: \".$HoraReffViernes;\n $horaDiaViernes = 'viernes'.$HoraReffViernes;\n array_push($listaDiaHoraOcupado,$horaDiaViernes);\n $HoraReffViernes = $HoraReffViernes + 1;\n //echo '<br>';\n } \n }\n if($fila->sabado == \"\")\n {\n // echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoSabado == 0)\n {\n $HoraReffSabado = substr($fila->sabado, 0, 2);\n //echo 'La materia '.$nombreM.\" Se inserto el dia sabado a las: \".$HoraReffSabado;\n $horaDiaSabado = 'sabado'.$HoraReffSabado;\n array_push($listaDiaHoraOcupado,$horaDiaSabado);\n //echo '<br>';\n $HoraReffSabado = $HoraReffSabado + 1;\n $brincoSabado = 1;\n }else{\n // echo 'La materia '.$nombreM.\" Se inserto el dia sabado a las: \".$HoraReffSabado;\n $horaDiaSabado = 'sabado'.$HoraReffSabado;\n array_push($listaDiaHoraOcupado,$horaDiaSabado);\n //echo '<br>';\n $HoraReffSabado = $HoraReffSabado + 1;\n }\n }\n }\n }\n $Resta = 0;\n }\n\n }else{\n //EL HORARIO NO SE PUDO INSERTAR por que se empalmo\n }\n //si eres de una sola hora\n //----------------------------------------------------------------------------------------\n }else{\n //Si no es mayor a 1 significa que la clase solo es de una hora \n //Referencia para saber de cuantos dias es la materia\n if($fila->lunes == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n if($fila->martes == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n if($fila->miercoles == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n if($fila->jueves == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n if($fila->viernes == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n if($fila->sabado == \"\")\n {\n //si esta vacio no cuenta \n }else{\n $contadorDiasMateria = $contadorDiasMateria + 1;\n }\n\n \n if($fila->lunes != \"\")\n {\n $HoraReffLunes = substr($fila->lunes, 0, 2);\n $horaDiaLunes = 'lunes'.$HoraReffLunes;\n if(in_array($horaDiaLunes,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar \n }else{\n $contadorFinalMateria = $contadorFinalMateria + 1; \n }\n }\n if($fila->martes != \"\")\n {\n $HoraReffMartes = substr($fila->martes, 0, 2);\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n if(in_array($horaDiaMartes,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar \n }else{\n $contadorFinalMateria = $contadorFinalMateria + 1;\n \n }\n }\n if($fila->miercoles != \"\")\n {\n $HoraReffMiercoles = substr($fila->miercoles, 0, 2);\n $horaDiaMiercoles = 'miercoles'.$HoraReffMiercoles;\n if(in_array($horaDiaMiercoles,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar \n }else{\n $contadorFinalMateria = $contadorFinalMateria + 1;\n \n }\n }\n if($fila->jueves != \"\")\n {\n $HoraReffJueves = substr($fila->jueves, 0, 2);\n $horaDiaJueves = 'jueves'.$HoraReffJueves;\n if(in_array($horaDiaJueves,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar \n }else{\n $contadorFinalMateria = $contadorFinalMateria + 1;\n \n }\n }\n if($fila->viernes != \"\")\n {\n $HoraReffViernes = substr($fila->viernes, 0, 2);\n $horaDiaViernes = 'viernes'.$HoraReffViernes;\n if(in_array($horaDiaViernes,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar \n }else{\n $contadorFinalMateria = $contadorFinalMateria + 1;\n \n }\n }\n if($fila->sabado != \"\")\n {\n $HoraReffSabado = substr($fila->sabado, 0, 2);\n $horaDiaSabado = 'sabado'.$HoraReffSabado;\n if(in_array($horaDiaSabado,$listaDiaHoraOcupado))\n {\n //si existes significa que no se puede insertar \n }else{\n $contadorFinalMateria = $contadorFinalMateria + 1;\n \n }\n }\n\n //echo \"Se compara las horas totales: \".$contadorDiasMateria.\" contra las horas disponibles\".$contadorFinalMateria;\n //TERMINACION DE COMPARACION\n if($contadorFinalMateria == $contadorDiasMateria)\n {\n //echo $listass->valorGrupo;\n $bandera = 0;\n\n if($listass->valorGrupo > 2)\n {\n foreach($listaAuxiliarHorarios as $lh)\n {\n foreach($lh as $recorrido)\n {\n //echo $recorrido->campo;\n //echo $recorrido->hora;\n if($nombreM == $recorrido->campo)\n {\n $Hora1 = substr($fila->horas, 0, 2);\n $Hora2 = substr($recorrido->hora, 0, 2);\n $HoraA = strval($Hora1);\n $HoraB = strval($Hora2);\n //echo 'La materia '.$nombreM.\" Hora: \".$HoraA.' VS '.' La materia '.$recorrido->campo.' Hora: '.$HoraB;\n //echo '<br>';\n if($HoraA == $HoraB)\n { \n if($fila->profesor == $recorrido->profesor)\n {\n //echo 'Entro'; \n $bandera = 1;\n } \n }\n }\n }\n }\n \n }\n\n if($bandera == 1)\n {\n $bandera == 0;\n }else{\n \n\n $brincoLunes = 0;\n $brincoMartes = 0;\n $brincoMiercoles = 0;\n $brincoJueves = 0;\n $brincoViernes = 0;\n $brincoSabado = 0;\n\n if($CupoTotalHorario == 0)\n {\n $CupoTotalHorario = $fila->cupo;\n }else{\n if($CupoTotalHorario > $fila->cupo)\n {\n $CupoTotalHorario = $fila->cupo;\n }\n }\n\n //Significa que si hay espacio\n array_push($listaMateriasInscritasNombre,$nombreM);\n //echo 'Se inserto la materia: '.$nombreM.\" A las: \".$fila->horas.\" Los dias: \".$fila->dias.' Profesor: '.$fila->profesor;\n //echo '<br>';\n $HoraInsertada = new Hora1($HoraInicial,$nombreM,$lf->nombreCarrera,$fila->dias,$fila->profesor,$fila->cupo,$ClavMat);\n array_push($listaMateriasHorario,$HoraInsertada);\n // echo '<h5>'.$fila->tipo.'</h5>';\n //Si es laboratorio\n if($fila->lunes == \"\")\n {\n //echo \"No existe clases los lunes \"; \n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoLunes == 0)\n {\n $HoraReffLunes = substr($fila->lunes, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia lunes a las: \".$HoraReffLunes;\n $horaDiaLunes = 'lunes'.$HoraReffLunes;\n array_push($listaDiaHoraOcupado,$horaDiaLunes);\n $HoraReffLunes = $HoraReffLunes + 1;\n $brincoLunes = 1;\n //echo '<br>';\n }else{\n //echo 'El laboratorio'.$nombreM.\" Se inserto el dia lunes a las: \".$HoraReffLunes;\n $horaDiaLunes = 'lunes'.$HoraReffLunes;\n array_push($listaDiaHoraOcupado,$horaDiaLunes);\n $HoraReffLunes = $HoraReffLunes + 1;\n //echo '<br>';\n }\n }\n if($fila->martes == \"\")\n {\n //echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoMartes == 0)\n {\n $HoraReffMartes = substr($fila->martes, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia martes a las: \".$HoraReffMartes;\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n array_push($listaDiaHoraOcupado,$horaDiaMartes);\n $HoraReffMartes = $HoraReffMartes + 1;\n $brincoMartes = 1;\n //echo '<br>';\n }else{\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia martes a las: \".$HoraReffMartes;\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n array_push($listaDiaHoraOcupado,$horaDiaMartes);\n $HoraReffMartes = $HoraReffMartes + 1;\n //echo '<br>';\n }\n $HoraReffMartes = substr($fila->martes, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia martes a las: \".$HoraReffMartes;\n $horaDiaMartes = 'martes'.$HoraReffMartes;\n array_push($listaDiaHoraOcupado,$horaDiaMartes);\n $HoraReffMartes = $HoraReffMartes + 1;\n //echo '<br>';\n }\n if($fila->miercoles == \"\")\n {\n // echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoMiercoles == 0)\n {\n $HoraReffMiercoles = substr($fila->miercoles, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia miercoles a las: \".$HoraReffMiercoles;\n $horaDiaMiercoles = 'miercoles'.$HoraReffMiercoles;\n array_push($listaDiaHoraOcupado,$horaDiaMiercoles);\n $HoraReffMiercoles = $HoraReffMiercoles + 1;\n $brincoMiercoles = 1;\n //echo '<br>';\n\n }else{\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia miercoles a las: \".$HoraReffMiercoles;\n $horaDiaMiercoles = 'miercoles'.$HoraReffMiercoles;\n array_push($listaDiaHoraOcupado,$horaDiaMiercoles);\n $HoraReffMiercoles = $HoraReffMiercoles + 1;\n //echo '<br>';\n }\n }\n if($fila->jueves == \"\")\n {\n // echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoJueves == 0)\n {\n $horaDia = $HoraInicial.\"jueves\";\n $HoraReffJueves = substr($fila->jueves, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia jueves a las: \".$HoraReffJueves;\n $horaDiaJueves = 'jueves'.$HoraReffJueves;\n array_push($listaDiaHoraOcupado,$horaDiaJueves);\n $HoraReffJueves = $HoraReffJueves + 1;\n $brincoJueves = 1;\n //echo '<br>';\n }else{\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia jueves a las: \".$HoraReffJueves;\n $horaDiaJueves = 'jueves'.$HoraReffJueves;\n array_push($listaDiaHoraOcupado,$horaDiaJueves);\n $HoraReffJueves = $HoraReffJueves + 1;\n //echo '<br>';\n }\n }\n if($fila->viernes == \"\")\n {\n //echo \"No existe clases los lunes \";\n }else{\n \n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoViernes == 0)\n {\n $horaDia = $HoraInicial.\" viernes\";\n $HoraReffViernes = substr($fila->viernes, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia viernes a las: \".$HoraReffViernes;\n $horaDiaViernes = 'viernes'.$HoraReffViernes;\n array_push($listaDiaHoraOcupado,$horaDiaViernes);\n $HoraReffViernes = $HoraReffViernes + 1;\n $brincoViernes = 1;\n //echo '<br>';\n }else{\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia viernes a las: \".$HoraReffViernes;\n $horaDiaViernes = 'viernes'.$HoraReffViernes;\n array_push($listaDiaHoraOcupado,$horaDiaViernes);\n $HoraReffViernes = $HoraReffViernes + 1;\n //echo '<br>';\n }\n \n }\n if($fila->sabado == \"\")\n {\n // echo \"No existe clases los lunes \";\n }else{\n //si fila es diferente de vacio significa que la hora se ocupa ahi\n if($brincoSabado == 0)\n {\n $HoraReffSabado = substr($fila->sabado, 0, 2);\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia sabado a las: \".$HoraReffSabado;\n $horaDiaSabado = 'sabado'.$HoraReffSabado;\n array_push($listaDiaHoraOcupado,$horaDiaSabado);\n //echo '<br>';\n $HoraReffSabado = $HoraReffSabado + 1;\n $brincoSabado = 1;\n }else{\n //echo 'El laboratorio '.$nombreM.\" Se inserto el dia sabado a las: \".$HoraReffSabado;\n $horaDiaSabado = 'sabado'.$HoraReffSabado;\n array_push($listaDiaHoraOcupado,$horaDiaSabado);\n //echo '<br>';\n $HoraReffSabado = $HoraReffSabado + 1;\n }\n }\n /*********************************************************************** */\n }\n }else{\n }\n\n }\n }\n }\n }\n }\n\n }\n sort($listaMateriasHorario);\n $hr = new HorarioFinal($r,$listaMateriasHorario);\n array_push($listaPruebas,$hr);\n $HF = new HorarioFinal($r,$listaAuxiliarHorarios);\n } \n \n }\n\n //cambie a dos FOR BAROFOR\n //print_r($listaPruebas);\n /*foreach($listaPruebas as $horarios)\n {\n echo '<h5>'.$horarios->numeroHorario.'</h5>';\n foreach($horarios->listaDia as $h)\n {\n echo ' '.$h->campo;\n echo ' '.$h->hora; //08-09 \n echo ' '.$h->campo; // Quimica\n echo ' '.$h->carr;\n echo ' '.$h->dias;\n echo ' '.$h->profesor;\n echo '<br>';\n }\n echo '<br>';\n echo '<br>';\n echo '<br>';\n echo '<br>';\n echo '<br>';\n }*/\n\n //AYUDAME MIGUEEEEEL JAJA\n\n return $listaPruebas;\n }", "function LisGrupoUsuario($nombre) {\n $ocado = new cado();\n $sql = \"select * from conf_usuario_grupo where estado=0 and nombre like '$nombre%' order by nombre asc\";\n $ejecutar = $ocado->ejecutar($sql);\n return $ejecutar;\n }", "function registroAgil($registroEstudiante) {\r\n ?>\r\n <script type=\"text/javascript\" language=\"javascript\">\r\n function buscarHorario(arreglo,codEspacio,codProyecto)\r\n {\r\n var horario=new Array();\r\n var fila=0;\r\n var columna=0;\r\n horario[fila]=new Array();\r\n\r\n var resultado=arreglo.split(\"|\");\r\n\r\n for(var j=0;j<resultado.length;j++)\r\n {\r\n if(j%11==0)\r\n {\r\n fila++;\r\n horario[fila]=new Array();\r\n columna=0;\r\n }\r\n horario[fila][columna]=new Array(resultado[j]);\r\n columna++;\r\n //alert(\"Fila:\"+fila+\" Evento: \"+horario[fila]+\" Valor J: \"+j);\r\n }\r\n var tx=\"\";\r\n\r\n tx=\"<table class='contenidotabla centrar'>\";\r\n tx+=\"<tr class='sigma centrar'>\";\r\n tx+=\"<td width='25%'>Dia</td><td width='25%'>Hora</td><td width='25%'>Sede</td><td width='25%'>Salon</td>\";\r\n tx+=\"</tr>\";\r\n for(var q=1;q<fila;q++)\r\n {\r\n tx+=\"<tr>\";\r\n tx+=\"<td>\"+horario[q][3]+\"</td><td class='sigma centrar'>\"+horario[q][4]+\"</td><td class='centrar'>\"+horario[q][5]+\"</td><td class='centrar'>\"+horario[q][6]+\"</td>\";\r\n tx+=\"</tr>\";\r\n }\r\n tx+=\"<tr><td colspan='4'><b>Cupo: \"+horario[1][1]+\" <font color=#ffffff>__</font> Inscritos: \"+horario[1][2]+\" <font color=#ffffff>__</font> Disponibles: \"+(horario[1][1]-horario[1][2])+\"</b></td></tr>\";\r\n tx+=\"</table>\";\r\n\r\n document.getElementById('div_horario').innerHTML=tx;\r\n var inp=\"\";\r\n\r\n inp=\"<input type='hidden' name='id_grupo' value='\"+horario[1][9]+\"'>\"\r\n inp+=\"<input type='hidden' name='hor_alternativo' value='\"+horario[1][10]+\"'>\"\r\n inp+=\"<input type='hidden' name='carrera' value='\"+horario[1][8]+\"'>\"\r\n inp+=\"<input class='boton' type='button' style='cursor:pointer;' onclick='submit()' name='registrar' value='Registrar'>\"\r\n\r\n document.getElementById('div_registrar').innerHTML=inp;\r\n\r\n var infGrup=\"\";\r\n\r\n infGrup=\"<font size='1px' color='#FFFFFF'><b>\"+horario[1][7]+\"</b></font>\";\r\n\r\n document.getElementById('div_InfoGrupo').innerHTML=infGrup;\r\n }\r\n </script>\r\n <form enctype='tipo:multipart/form-data,application/x-www-form-urlencoded,text/plain' method='POST' action='index.php' name='<? echo $this->formulario ?>'>\r\n <table class=\"contenidotabla centrar\">\r\n <caption class=\"sigma\">\r\n REGISTRO AGIL DE ESPACIOS ACAD&Eacute;MICOS\r\n </caption>\r\n <tr class=\"sigma\">\r\n <th width=\"33%\" class=\"sigma centrar\">Espacio Acad&eacute;mico</th>\r\n <th width=\"33%\" class=\"sigma centrar\">Grupos</th>\r\n <th width=\"33%\" class=\"sigma centrar\">Horarios</th>\r\n </tr>\r\n <tr>\r\n <td width=\"33%\" class=\"cuadro_plano centrar\">\r\n <div style='width: 100%; height: 150px;border:0px solid #000000;'>\r\n <input type=\"text\" name=\"codEspacioAgil\" style=\" background-color: #ABB0BE;\" id=\"codEspacioAgil\" size=\"6\" maxlength=\"8\" onblur=\"this.style.backgroundColor='#ABB0BE'\" onfocus=\"this.style.backgroundColor='#A7C3DF'\"onchange=\"xajax_buscarEspacios(document.getElementById('codEspacioAgil').value,<? echo $registroEstudiante['planEstudioEstudiante'] ?>,<? echo $registroEstudiante['codProyectoEstudiante'] ?>)\" onkeypress=\"javascript:if(event.keyCode==13){xajax_buscarEspacios(document.getElementById('codEspacioAgil').value,<? echo $registroEstudiante['planEstudioEstudiante'] ?>,<? echo $registroEstudiante['codProyectoEstudiante'] ?>);return false;}\" >\r\n <img src=\"<? echo $this->configuracion[\"site\"] . $this->configuracion[\"grafico\"] . \"/viewrel.png\" ?>\" style=\"cursor:pointer\" border=\"0\" onclick=\"if(<? echo $this->verificar; ?>){xajax_buscarEspacios(document.getElementById('codEspacioAgil').value,<? echo $registroEstudiante['planEstudioEstudiante'] ?>,<? echo $registroEstudiante['codProyectoEstudiante'] ?>)}else{false}\"><br>\r\n <div id=\"div_infoea\" style='width: 100%; height: 120px;'>\r\n <table class='contenidotabla centrar'>\r\n <tr>\r\n <td rowspan=\"4\" colspan=\"4\" class=\"centrar\">\r\n Digite el c&oacute;digo del espacio acad&eacute;mico\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n </div>\r\n </td>\r\n <td width=\"33%\" class=\"cuadro_plano centrar\">\r\n <div style='width: 100%; height: 150px;border:0px solid #000000;'>\r\n <div id=\"div_grupos\">\r\n <select class='sigma' style='width: 100%; height: 120px;' size='7' >\r\n <optgroup label=\"<&mdash; Digite el c&oacute;digo del E.A.\"></optgroup>\r\n </select>\r\n </div>\r\n <div id=\"div_InfoGrupo\" style=\"background-color:ABB0BE\">\r\n\r\n </div>\r\n </div>\r\n\r\n </td>\r\n <td width=\"33%\" class=\"cuadro_plano centrar\">\r\n <div style='width: 100%; height: 150px;border:0px solid #000000;'>\r\n <div id=\"div_horario\" style=\"width: 100%; height: 120px;border:0px solid #000000;\">\r\n <&minus;&minus; Seleccione el grupo para ver el horario\r\n </div>\r\n </div>\r\n <div class='centrar'><span id='toolTipBox' width='10' ></span></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan=\"3\" class=\"centrar\">\r\n <input type=\"hidden\" name=\"codEstudiante\" value=\"<? echo $registroEstudiante['CODIGO'] ?>\">\r\n <input type=\"hidden\" name=\"codProyecto\" value=\"<? echo $registroEstudiante['codProyecto'] ?>\">\r\n <input type=\"hidden\" name=\"planEstudio\" value=\"<? echo $registroEstudiante['planEstudio'] ?>\">\r\n <input type=\"hidden\" name=\"codProyectoEstudiante\" value=\"<? echo $registroEstudiante['codProyectoEstudiante'] ?>\">\r\n <input type=\"hidden\" name=\"planEstudioEstudiante\" value=\"<? echo $registroEstudiante['planEstudioEstudiante'] ?>\">\r\n <input type=\"hidden\" name=\"estado_est\" value=\"<? echo $registroEstudiante['LETRA_ESTADO'] ?>\">\r\n <input type=\"hidden\" name=\"action\" value=\"<? echo $this->bloque ?>\">\r\n <input type=\"hidden\" name=\"opcion\" value=\"registroAgil\">\r\n <div id=\"div_registrar\"></div>\r\n </td>\r\n </tr>\r\n </table>\r\n </form>\r\n<?\r\n }", "function consultarGrupos() {\n\t\t\tglobal $res;\n\t\t\t$cnx = conectar_mysql(\"Suministros\");\n\t\t\t$cons = \"SELECT DISTINCT(Agrupacion) FROM Suministros.Movimientos\";\n\t\t\t$res = mysql_query($cons);\n\t\t\treturn $res; \n\t\t\n\t\t}", "function calcular_hd_en_aula_seleccionada (){\n $anio_lectivo=date('Y', strtotime($this->s__fecha_consulta));\n //Configuramos el dia de consulta para que este disponible en la funcion procesar_periodo.\n $this->s__dia_consulta=$this->obtener_dia(date('N', strtotime($this->s__fecha_consulta)));\n \n //Obtenemos los periodos que pueden contener a la fecha de solicitud.\n $periodo=$this->dep('datos')->tabla('periodo')->get_periodo_calendario($this->s__fecha_consulta, $anio_lectivo, $this->s__id_sede);\n //Usamos la cadena 'au' para extraer las asignaciones pertenecientes a un aula en particular. \n //Es una condicion mas dentro de la funcion procesar_periodo.\n $asignaciones=$this->procesar_periodo($periodo, 'au');\n \n //Creamos una estructura para el aula seleccionada. Esto se debe a que la funcion calcular_horarios_\n //disponibles de la clase HorariosDisponibes recibe un arreglo de aulas_ua, cuyo formato es\n //(id_aula, aula). Si no usamos esta estructura array ( array() ), vemos una disponibilidad total\n //que no esta asociada a ningun aula, esto ultimo no debe ocurrir.\n $aulas_ua=array(\n array(\n 'id_aula' => $this->s__datos_solcitud['id_aula'],\n 'aula' => $this->s__datos_solcitud['aula']\n )\n );\n \n //Guardamos en sesion el id_sede para agregar la capacidad de cada aula a un horario disponible.\n toba::memoria()->set_dato_instancia(0, $this->s__id_sede);\n \n $hd=new HorariosDisponibles();\n //El primer parametro se corresponde con las aulas que actualmente estan siendo usadas. Como \n //necesitamos hacer un calculo de hd especifico, usamos el aula seleccionada. Estas aulas se obtienen\n //a partir de las asignaciones y se utilzan para que el sistema pueda inferir disponibilidad total.\n \n $this->s__horarios_disponibles=$hd->calcular_horarios_disponibles($aulas_ua, $aulas_ua, $asignaciones);\n \n return $this->existe_espacio_disponible();\n }", "function separar_hora($arreglo)\n\t{\n\t\t$size = count($arreglo);\n\t\t\n\t\tfor($count = 1;$count <= $size;$count++)\n\t\t{\n\t\t\n\t\t\n\t\t\n\t\t}//Aqui termina el for para ordenacion\t\n\t\t\n\t\n\t}", "public function getTablaHorarioAlumno()\n {\n try {\n $respuesta=[];\n $filtros = json_decode(file_get_contents(\"php://input\"), true);\n $dbm = new DbmControlescolar($this->get(\"db_manager\")->getEntityManager());\n $cicloactual = $dbm->BuscarAlumnosA([\n 'alumnoid' => $filtros['alumnoid']\n ]); \n\n $alumnociclo = $dbm->getRepositorioById('CeAlumnoporciclo', 'alumnoporcicloid', $cicloactual[0]['alumnoporcicloid']);\n $gruposAl = $dbm->getRepositoriosById('CeAlumnocicloporgrupo', 'alumnoporcicloid', $alumnociclo->getAlumnoporcicloid());\n\n $filtros[\"cicloid\"] = $filtros[\"cicloid\"] ? $filtros[\"cicloid\"] : $alumnociclo->getCicloid()->getCicloid();\n\n $horarioS = [];\n\n foreach($gruposAl as $grupo){\n $h = $dbm->BuscarTablaHorario([\n 'cicloid' => $alumnociclo->getCicloid()->getCicloid(),\n 'nivelid' => $alumnociclo->getGradoid()->getNivelid()->getNivelid(),\n 'gradoid' => $alumnociclo->getGradoid()->getGradoid(),\n 'grupoid' => $grupo->getGrupoid()->getGrupoid(),\n 'alumnoid' => $alumnociclo->getAlumnoid()->getAlumnoid(),\n ]);\n foreach($h as $hh){\n $horarioS[] = $hh;\n }\n }\n\n $talleresAl = $dbm->getRepositoriosById('CeAlumnocicloportaller', 'alumnoporcicloid', $alumnociclo->getAlumnoporcicloid());\n\n\n foreach($talleresAl as $taller){\n $grado = $dbm->getOneByParametersRepositorio('CeGradoportallercurricular', [\n 'tallercurricularid' => $taller->getTallercurricularid()->getTallercurricularid(),\n 'gradoid' => $alumnociclo->getGradoid()->getGradoid(),\n ]);\n\n if($grado){\n $h = $dbm->BuscarTablaHorario([\n 'cicloid' => $alumnociclo->getCicloid()->getCicloid(),\n 'nivelid' => $alumnociclo->getGradoid()->getNivelid()->getNivelid(),\n 'gradoid' => $alumnociclo->getGradoid()->getGradoid(),\n 'tallerid' => $taller->getTallercurricularid()->getTallercurricularid(),\n 'alumnoid' => $alumnociclo->getAlumnoid()->getAlumnoid(),\n ]);\n foreach($h as $hh){\n $horarioS[] = $hh;\n }\n }\n }\n\n $horario = $dbm->BuscarTablaHorario($filtros);\n $talleres = $dbm->getTalleres($filtros);\n foreach($talleres as $taller){\n $data = $filtros;\n $data['groupby'] = true;\n $data['tallerid'] = $taller['tallercurricularid'];\n $tall = $dbm->BuscarTablaHorario($data);\n foreach($tall as $t){\n $t['taller'] = true;\n $horario[] = $t;\n }\n }\n $horainicial=\"24:00\";\n $horas = [];\n $tipo = [];\n $horafinal=\"00:00\";\n foreach ($horario as $hora){\n if($hora['taller'] !== true){\n $grupokey=false;\n foreach ($grupos as $key => $grupo) {\n if ( $key==$hora[\"grupoid\"]) {\n $grupokey=$key;\n break;\n }\n }\n if ($grupokey=== false){\n $grupos[$hora[\"grupoid\"]]=$hora[\"grupo\"];\n }\n $diasalumno[$hora[\"dia\"]][]=$hora;\n if ($hora[\"horainicio\"]<$horainicial){\n $horainicial=$hora[\"horainicio\"];\n }\n if ($hora[\"horafin\"]>$horafinal){\n $horafinal=$hora[\"horafin\"];\n }\n }\n }\n $date1 = new \\DateTime($horainicial);\n $date2 = new \\DateTime($horafinal);\n $diff = $date2->diff($date1);\n $cuantashoras= $diff->format('%h');\n // for ($i=0;$i<$cuantashoras;$i++){\n // $b=$date1->format('H')+$i;\n // $e=$b+1;\n // $horas[]=[\"inicio\"=>sprintf(\"%02d\", $b).\":00\",\"fin\"=>sprintf(\"%02d\", $e).\":00\"];\n // }\n foreach($horario as $h){\n $find = false;\n foreach($horas as $hh){\n if($hh['inicio'] == $h['horainicio'] && $hh['fin'] == $h['horafin']){\n $find = true;\n }\n }\n if(!$find){\n $horas[]=[\"inicio\"=>$h['horainicio'],\"fin\"=>$h['horafin']];\n }\n }\n sort($horas);\n $dias=[[\"dia\"=>1,\"nombre\"=>\"Lunes\"],[\"dia\"=>2,\"nombre\"=>\"Martes\"],[\"dia\"=>3,\"nombre\"=>\"Miercoles\"],[\"dia\"=>4,\"nombre\"=>\"Jueves\"],[\"dia\"=>5,\"nombre\"=>\"Viernes\"]];\n // if (count($grupos)==1){\n // foreach ($horas as $key=>$hora){\n // $respuesta[$key][\"hora\"]=$hora[\"inicio\"].\" - \".$hora[\"fin\"];\n // foreach ($dias as $dia){\n // foreach ($diasalumno as $diaalumno){\n // foreach ($diaalumno as $da){\n // if ($dia[\"dia\"]==$da[\"dia\"] && $da[\"horainicio\"]==$hora[\"inicio\"] && $da[\"horafin\"]==$hora[\"fin\"]) {\n // $item=[\"materia\"=>$da[\"materia\"],\"inicio\"=>' ',\"fin\"=>' ', 'all' => $da];\n // $respuesta[$key][$dia[\"nombre\"]][]=$item;\n // }\n // }\n // }\n // }\n // }\n // }else{\n // }\n foreach ($grupos as $grupoid=>$grupo){\n $grupoentidad=$dbm->getRepositorioById(\"CeGrupo\",\"grupoid\",$grupoid);\n if ($grupoentidad->getTipogrupoid()->getTipogrupoid()==1){\n $indice=$grupoid;\n $respuesta[$indice][\"grupo\"]=$grupoentidad->getGradoid()->getNivelid()->getNombre().\" \".$grupoentidad->getGradoid()->getGrado().\" \".$grupoentidad->getNombre();\n }else{\n $grupoorigen=$dbm->getRepositorioById(\"CeGrupoorigenporsubgrupo\",\"grupoid\",$grupoid);\n $indice=$grupoorigen->getGrupoorigenid()->getGrupoid();\n }\n \n foreach ($horas as $key=>$hora){\n $respuesta[$indice][\"horario\"][$key][\"hora\"]=$hora[\"inicio\"].\" - \".$hora[\"fin\"];\n foreach ($dias as $dia){\n foreach ($diasalumno as $diaalumno){\n foreach ($diaalumno as $da){\n if ($grupoid==$da[\"grupoid\"] && $dia[\"dia\"]==$da[\"dia\"] && $da[\"horainicio\"]==$hora[\"inicio\"] && $da[\"horafin\"]==$hora[\"fin\"]) {\n $respuesta[$indice][\"planestudioid\"] = $da['planestudioid'];\n $respuesta[$indice][\"gradoid\"] = $grupoentidad->getGradoid()->getGradoid();\n $gn = $da[\"materia\"];\n $item=[\"materia\"=>$gn,'mat' => $da['materia'], \"inicio\"=>' ',\"fin\"=>' '];\n\n $item = array_merge($item, $da);\n $find = false;\n foreach($respuesta[$indice][\"horario\"][$key][$dia[\"nombre\"]] as $hh){\n if($hh['mat'] == $da['materia']){\n $find = true;\n }\n }\n if(!$find){\n $respuesta[$indice][\"horario\"][$key][$dia[\"nombre\"]][]=$item;\n }\n }\n }\n }\n }\n }\n }\n foreach($horario as $h){\n if($h['taller'] == true){\n $grupoentidad=$dbm->getRepositorioById(\"CeTallercurricular\",\"tallercurricularid\",$h['grupoid']);\n $grados=$dbm->getRepositoriosById(\"CeGradoportallercurricular\",\"tallercurricularid\",$h['grupoid']);\n $alumnos = $dbm->getRepositoriosById(\"CeAlumnocicloportaller\",\"tallercurricularid\",$h['grupoid']);\n\n $gruposTaller = [];\n\n foreach($alumnos as $al){\n $aciclo = $dbm->getRepositorioById(\"CeAlumnocicloporgrupo\",\"alumnoporcicloid\",$al->getAlumnoporcicloid()->getAlumnoporcicloid());\n\n if($aciclo){\n $nombre = $al->getAlumnoporcicloid()->getGradoid()->getNivelid()->getNombre().\" \".$al->getAlumnoporcicloid()->getGradoid()->getGrado().\" \".$aciclo->getGrupoid()->getNombre();\n\n $find = false;\n\n foreach($gruposTaller as $g){\n if($g == $nombre){\n $find = true;\n }\n }\n\n if(!$find){\n $gruposTaller[] = $nombre;\n }\n }\n }\n \n foreach($grados as $g){\n if(count($gruposTaller) == 0){\n foreach($respuesta as $key => $r){\n if($h['planestudioid'] == $r['planestudioid'] && $g->getGradoid()->getGradoid() == $r['gradoid']){\n $indice = $key;\n foreach ($dias as $dia){\n foreach ($horas as $key=>$hora){\n if ($dia[\"dia\"]==$h[\"dia\"] && $h[\"horainicio\"]==$hora[\"inicio\"] && $h[\"horafin\"]==$hora[\"fin\"]) {\n \n $gn = $h[\"materia\"];\n \n $h['grupo'] = $gn;\n \n $item=[\"materia\"=>$gn,'mat' => $h['materia'], \"inicio\"=>' ',\"fin\"=>' '];\n $item = array_merge($item, $h);\n $find = false;\n foreach($respuesta[$indice][\"horario\"][$key][$dia[\"nombre\"]] as $hh){\n if($hh['mat'] == $h['materia'] && $hh['all']['grupo'] == $h['materia']){\n $find = true;\n }\n }\n if(!$find){\n $respuesta[$indice][\"horario\"][$key][$dia[\"nombre\"]][]=$item;\n }\n }\n }\n }\n \n }\n }\n }else{\n foreach($gruposTaller as $gt){\n foreach($respuesta as $key => $r){\n if($r['grupo'] == $gt){\n $indice = $key;\n foreach ($dias as $dia){\n foreach ($horas as $key=>$hora){\n if ($dia[\"dia\"]==$h[\"dia\"] && $h[\"horainicio\"]==$hora[\"inicio\"] && $h[\"horafin\"]==$hora[\"fin\"]) {\n \n foreach($talleresAl as $t){\n if($t->getTallercurricularid()->getTallercurricularid() == $h['grupoid'] && $t->getTallercurricularid()->getProfesorid()->getProfesorid() == $h['profesorid']){\n $gn = $h[\"materia\"];\n \n $h['grupo'] = $gn;\n\n $gn = ' ';\n \n $item=[\"materia\"=>$gn,'mat' => $h['materia'], \"inicio\"=>' ',\"fin\"=>' '];\n $item = array_merge($item, $h);\n $find = false;\n foreach($respuesta[$indice][\"horario\"][$key][$dia[\"nombre\"]] as $hh){\n if($hh['mat'] == $h['materia'] && $hh['all']['grupo'] == $h['materia']){\n $find = true;\n }\n }\n if(!$find){\n $respuesta[$indice][\"horario\"][$key][$dia[\"nombre\"]][]=$item;\n }\n }\n }\n }\n }\n }\n \n }\n } \n }\n }\n \n }\n }\n }\n\n function my_array_unique($array, $keep_key_assoc = false){\n $duplicate_keys = array();\n $tmp = array(); \n \n foreach ($array as $key => $val){\n // convert objects to arrays, in_array() does not support objects\n if (is_object($val))\n $val = (array)$val;\n \n if (!in_array($val, $tmp))\n $tmp[] = $val;\n else\n $duplicate_keys[] = $key;\n }\n \n foreach ($duplicate_keys as $key)\n unset($array[$key]);\n \n return $keep_key_assoc ? $array : array_values($array);\n }\n \n $respuesta=array_values($respuesta);\n usort($respuesta, function($a, $b) {\n return $a['grupo']> $b['grupo']? 1 : -1;\n });\n array_reverse($respuesta);\n\n $res = [];\n foreach($respuesta as $r){\n $find = false;\n $ro = [\n 'grupo' => $r['grupo'],\n 'horario' => []\n ];\n foreach($r['horario'] as $rr){\n if($rr['Lunes'] || $rr['Martes'] || $rr['Miercoles'] || $rr['Jueves'] || $rr['Viernes']){\n $ro['horario'][] = $rr;\n }\n }\n $res[] = $ro;\n }\n \n if(count($res) == 0){\n return new View('No se encontraron resultados', Response::HTTP_PARTIAL_CONTENT);\n }\n $result = [];\n foreach($res[0]['horario'] as $h){\n $Lunes = [];\n\n foreach($h['Lunes'] as $hh){\n $find = false;\n foreach($Lunes as $l){\n if($hh['grupoid'] == $l['grupoid']){\n $find = true;\n }\n }\n if(!$find){\n $Lunes[] = $hh;\n }\n }\n\n $h['Lunes'] = $Lunes;\n $Martes = [];\n\n foreach($h['Martes'] as $hh){\n $find = false;\n foreach($Martes as $l){\n if($hh['grupoid'] == $l['grupoid']){\n $find = true;\n }\n }\n if(!$find){\n $Martes[] = $hh;\n }\n }\n\n $h['Martes'] = $Martes;\n $Miercoles = [];\n\n foreach($h['Miercoles'] as $hh){\n $find = false;\n foreach($Miercoles as $l){\n if($hh['grupoid'] == $l['grupoid']){\n $find = true;\n }\n }\n if(!$find){\n $Miercoles[] = $hh;\n }\n }\n\n $h['Miercoles'] = $Miercoles;\n $Jueves = [];\n\n foreach($h['Jueves'] as $hh){\n $find = false;\n foreach($Jueves as $l){\n if($hh['grupoid'] == $l['grupoid']){\n $find = true;\n }\n }\n if(!$find){\n $Jueves[] = $hh;\n }\n }\n\n $h['Jueves'] = $Jueves;\n $Viernes = [];\n\n foreach($h['Viernes'] as $hh){\n $find = false;\n foreach($Viernes as $l){\n if($hh['grupoid'] == $l['grupoid']){\n $find = true;\n }\n }\n if(!$find){\n $Viernes[] = $hh;\n }\n }\n\n $h['Viernes'] = $Viernes;\n $result[] = $h;\n }\n return new View([$result], Response::HTTP_OK);\n } catch (\\Exception $e) {\n return new View($e->getMessage(), Response::HTTP_BAD_REQUEST);\n }\n }", "function calcular_horarios_disponibles_segun_req (){\n $horarios_disponibles=array();\n foreach($this->s__horarios_disponibles as $horario){\n if($this->verificar_existencia_de_horario($horario)){\n $horarios_disponibles[]=$horario;\n }\n }\n return $horarios_disponibles;\n }", "function listarAdministradorHidro(CTParametro $parametro){\r\n\t\t$obj=new MODAdministradorHidro($parametro);\r\n\t\t$res=$obj->listarAdministradorHidro();\r\n\t\treturn $res;\r\n\t}", "function get_gasto_por_servicio($ejercicio)\n {\n if(empty($ejercicio))\n {\n $sqltext = \"\n SELECT \n `c`.`color_grafica`,\n `c`.`titulo_grafica` AS `nombre_servicio_categoria`,\n IFNULL((SELECT \n SUM(`d`.`monto_desglose`)\n FROM\n (`inai`.`vact_facturas_desglose` `d`\n JOIN `inai`.`vact_facturas` `e`)\n WHERE\n ((`d`.`id_factura` = `e`.`id_factura`)\n AND (`d`.`id_servicio_categoria` = `c`.`id_servicio_categoria`))),\n 0) AS `monto`\n FROM `inai`.`cat_servicios_categorias` `c`\n ORDER BY `c`.`id_servicio_categoria`\n \";\n }else\n {\n $sqltext = \"\n SELECT \n `c`.`color_grafica`,\n `c`.`titulo_grafica` AS `nombre_servicio_categoria`,\n IFNULL((SELECT \n SUM(`d`.`monto_desglose`)\n FROM\n (`inai`.`vact_facturas_desglose` `d`\n JOIN `inai`.`vact_facturas` `e`)\n WHERE\n ((`d`.`id_factura` = `e`.`id_factura`)\n AND (`d`.`id_servicio_categoria` = `c`.`id_servicio_categoria`)\n AND (`e`.`id_ejercicio` = \" . $ejercicio . \"))),\n 0) AS `monto`\n FROM `inai`.`cat_servicios_categorias` `c`\n ORDER BY `c`.`id_servicio_categoria`\n \";\n }\n\n $query = $this->db->query( $sqltext );\n $colores = [];\n $categorias = [];\n $montos = [];\n\n if($query->num_rows() > 0)\n {\n $cont = 0;\n foreach ($query->result_array() as $row) {\n $categorias[$cont] = $row['nombre_servicio_categoria'];\n $montos[$cont] = floatval($row['monto']);\n $colores[$cont] = $row['color_grafica'];\n $cont++;\n }\n } \n\n return array(\n 'categorias' => $categorias,\n 'montos' => $montos,\n 'colores' => $colores,\n 'total' => 0\n );\n\n }" ]
[ "0.7772413", "0.6948909", "0.68616015", "0.6638672", "0.63600016", "0.62059593", "0.61658454", "0.6165486", "0.60757023", "0.5985088", "0.5868438", "0.5857005", "0.58094454", "0.57315224", "0.57238317", "0.57019377", "0.56690943", "0.56663996", "0.5639268", "0.5599234", "0.5593665", "0.55639154", "0.55384344", "0.55214095", "0.5510087", "0.55077374", "0.54888767", "0.5488724", "0.5483419", "0.5469812" ]
0.77601963
1
Funcion que actualiza el registro de inscripciones de la sesion del estudiante
function actualizarInscripcionesSesion() { $datosEstudiante=array('codEstudiante'=>$this->datosEstudiante[0]['CODIGO'], 'codProyectoEstudiante'=> $this->datosEstudiante[0]['COD_CARRERA'], 'ano'=> $this->datosEstudiante[0]['ANO'], 'periodo'=> $this->datosEstudiante[0]['PERIODO']); $espaciosInscritos=$this->procedimientos->actualizarInscritosSesion($datosEstudiante); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inscribirEspacio()\n {\n if ($this->usuario!=$_REQUEST['codEstudiante'])\n {\n echo \"Ha ocurrido un error. Por favor inicie sesion nuevamente \";exit;\n }\n $this->datosEstudiante=$this->consultarDatosEstudiante($this->usuario);\n $this->buscarDatosEspacio($_REQUEST['codEspacio']);\n $this->datosInscripcion=$_REQUEST;\n $this->datosInscripcion['codProyecto']= $this->datosInscripcion['codProyectoEstudiante'];\n $this->datosInscripcion['planEstudio']=$this->datosInscripcion['planEstudioEstudiante'];\n $retorno['pagina']=$this->datosInscripcion['retornoPagina']=\"admin_consultarInscripcionesEstudiante\";\n $retorno['opcion']=$this->datosInscripcion['retornoOpcion']=\"mostrarConsulta\";\n $this->datosInscripcion['retornoParametros']=array('codProyectoEstudiante'=>$_REQUEST[\"codProyectoEstudiante\"],\n 'planEstudioEstudiante'=>$_REQUEST[\"planEstudioEstudiante\"],\n 'codEstudiante'=>$_REQUEST[\"codEstudiante\"]);\n $back='';\n foreach ($this->datosInscripcion['retornoParametros'] as $key => $value) {\n $back.=\"&\".$key.\"=\".$value;\n }\n //$retorno['parametros']=$back;\n $retorno['nombreEspacio']=$this->datosInscripcion['nombreEspacio'];\n \n //$this->buscarEspaciosCancelados($retorno);\n \n $espaciosInscritos=$this->buscarEspaciosInscritos();\n if(is_array($espaciosInscritos))\n {\n $this->verificarInscrito($retorno,$espaciosInscritos);\n $horarioEstudiante=$this->buscarHorarioEstudiante($espaciosInscritos);\n $horarioGrupo=$this->buscarHorarioGrupo();\n $this->verificarCruce($retorno,$horarioEstudiante,$horarioGrupo);\n }\n $this->verificarParametros($retorno,$espaciosInscritos);\n $this->verificarCupo($retorno);\n $this->registrarInscripcion();\n }", "function inscribirEspacio()\n {\n if ($this->usuario!=$_REQUEST['codEstudiante'])\n {\n echo \"Ha ocurrido un error. Por favor inicie sesion nuevamente \";exit;\n }\n $this->datosEstudiante=$this->consultarDatosEstudiante($this->usuario);\n $this->buscarDatosEspacio($_REQUEST['codEspacio']);\n $this->datosInscripcion=$_REQUEST;\n $this->datosInscripcion['codProyecto']= $this->datosInscripcion['codProyectoEstudiante'];\n $this->datosInscripcion['planEstudio']=$this->datosInscripcion['planEstudioEstudiante'];\n $retorno['pagina']=$this->datosInscripcion['retornoPagina']=\"admin_consultarInscripcionesEstudiante\";\n $retorno['opcion']=$this->datosInscripcion['retornoOpcion']=\"mostrarConsulta\";\n $this->datosInscripcion['retornoParametros']=array('codProyectoEstudiante'=>$_REQUEST[\"codProyectoEstudiante\"],\n 'planEstudioEstudiante'=>$_REQUEST[\"planEstudioEstudiante\"],\n 'codEstudiante'=>$_REQUEST[\"codEstudiante\"]);\n $back='';\n foreach ($this->datosInscripcion['retornoParametros'] as $key => $value) {\n $back.=\"&\".$key.\"=\".$value;\n }\n //$retorno['parametros']=$back;\n $retorno['nombreEspacio']=$this->datosInscripcion['nombreEspacio'];\n \n //$this->buscarEspaciosCancelados($retorno);\n $espaciosInscritos=$this->buscarEspaciosInscritos();\n if(is_array($espaciosInscritos))\n {\n $this->verificarInscrito($retorno,$espaciosInscritos);\n $horarioEstudiante=$this->buscarHorarioEstudiante($espaciosInscritos);\n $horarioGrupo=$this->buscarHorarioGrupo();\n $this->verificarCruce($retorno,$horarioEstudiante,$horarioGrupo);\n }\n $this->verificarParametros($retorno,$espaciosInscritos);\n $this->verificarCupo($retorno);\n $this->registrarInscripcion();\n }", "function registrarInscripcion() {\n $pagina=$this->configuracion[\"host\"].$this->configuracion[\"site\"].\"/index.php?\";\n $variable=\"pagina=\".$this->datosInscripcion['retornoPagina'];\n $variable.=\"&opcion=\".$this->datosInscripcion['retornoOpcion'];\n foreach ($this->datosInscripcion['retornoParametros'] as $key => $value)\n {\n $variable.=\"&\".$key.\"=\".$value;\n }\n $variable=$this->cripto->codificar_url($variable,$this->configuracion);\n\n $resultado_espacio=$this->datosEspacio;\n if(is_array($resultado_espacio))\n {\n $letras=array('OB','OC','EI','EE','CP');\n $numeros=array(1,2,3,4,5);\n $clasificacion=str_replace($letras,$numeros,trim(isset($resultado_espacio['CLASIFICACION'])?$resultado_espacio['CLASIFICACION']:''));\n $datos['codEstudiante']=$this->datosEstudiante[0]['CODIGO'];\n $datos['codProyectoEstudiante']=$this->datosEstudiante[0]['COD_CARRERA'];\n $datos['codEspacio']=$this->datosInscripcion['codEspacio'];\n $datos['grupo']=$this->datosInscripcion['grupo'];\n $datos['ano']=$this->ano;\n $datos['periodo']=$this->periodo;\n $datos['creditos']=(isset($resultado_espacio['CREDITOS'])?$resultado_espacio['CREDITOS']:'');\n $datos['htd']=(isset($resultado_espacio['HTD'])?$resultado_espacio['HTD']:'');\n $datos['htc']=(isset($resultado_espacio['HTC'])?$resultado_espacio['HTC']:'');\n $datos['hta']=(isset($resultado_espacio['HTA'])?$resultado_espacio['HTA']:'');\n $datos['CLASIFICACION']=$clasificacion;\n\n $resultado_adicionar=$this->insertarRegistroInscripcion($datos);\n if($resultado_adicionar>=1)\n {\n $mensaje=\"Espacio académico adicionado.\";\n $this->actualizarInscripcionesSesion();\n $this->procedimientos->actualizarCupo($datos);\n $variablesRegistro=array('usuario'=>$this->usuario,\n 'evento'=>'1',\n 'descripcion'=>'Adiciona Espacio académico',\n 'registro'=>$this->ano.\"-\".$this->periodo.\", \".$datos['codEspacio'].\", 0, \".$datos['grupo'].\", \".$this->datosEstudiante[0]['PLAN_ESTUDIO'].\", \".$this->datosInscripcion['carrera'],\n 'afectado'=>$this->datosEstudiante[0]['CODIGO']);\n }else\n {\n $mensaje=\"No se puede adicionar, por favor intente mas tarde.\";\n $variablesRegistro=array('usuario'=>$this->usuario,\n 'evento'=>'50',\n 'descripcion'=>'Conexion Error Oracle adicionar',\n 'registro'=>$this->ano.\"-\".$this->periodo.\", \".$datos['codEspacio'].\",0, \".$datos['grupo'].\", \".$this->datosEstudiante[0]['PLAN_ESTUDIO'].\", \".$this->datosEstudiante[0]['COD_CARRERA'],\n 'afectado'=>$this->datosEstudiante[0]['CODIGO']);\n }\n }else\n {\n $mensaje=\"No hay datos del espacio. No se puede adicionar.\";\n $variablesRegistro=array('usuario'=>$this->usuario,\n 'evento'=>'50',\n 'descripcion'=>'Error datos espacio adicionar',\n 'registro'=>$this->ano.\"-\".$this->periodo.\", \".$_REQUEST['codEspacio'].\",0, \".$_REQUEST['grupo'].\", \".$this->datosEstudiante[0]['PLAN_ESTUDIO'].\", \".$this->datosEstudiante[0]['COD_CARRERA'],\n 'afectado'=>$this->datosEstudiante[0]['CODIGO']);\n }\n $this->retornar($pagina,$variable,$variablesRegistro,$mensaje);\n }", "function registrarInscripcion() {\n $pagina=$this->configuracion[\"host\"].$this->configuracion[\"site\"].\"/index.php?\";\n $variable=\"pagina=\".$this->datosInscripcion['retornoPagina'];\n $variable.=\"&opcion=\".$this->datosInscripcion['retornoOpcion'];\n foreach ($this->datosInscripcion['retornoParametros'] as $key => $value)\n {\n $variable.=\"&\".$key.\"=\".$value;\n }\n $variable=$this->cripto->codificar_url($variable,$this->configuracion);\n\n $resultado_espacio=$this->datosEspacio;\n if(is_array($resultado_espacio))\n {\n $letras=array('OB','OC','EI','EE','CP');\n $numeros=array(1,2,3,4,5);\n $clasificacion=str_replace($letras,$numeros,trim(isset($resultado_espacio['CLASIFICACION'])?$resultado_espacio['CLASIFICACION']:''));\n if ($clasificacion=='')$clasificacion=0;\n $datos['codEstudiante']=$this->datosEstudiante[0]['CODIGO'];\n $datos['codProyectoEstudiante']=$this->datosEstudiante[0]['COD_CARRERA'];\n $datos['codEspacio']=$this->datosInscripcion['codEspacio'];\n $datos['id_grupo']=$this->datosInscripcion['id_grupo'];\n $datos['ano']=$this->ano;\n $datos['periodo']=$this->periodo;\n $datos['creditos']=(isset($resultado_espacio['CREDITOS'])?$resultado_espacio['CREDITOS']:'');\n $datos['htd']=(isset($resultado_espacio['HTD'])?$resultado_espacio['HTD']:'');\n $datos['htc']=(isset($resultado_espacio['HTC'])?$resultado_espacio['HTC']:'');\n $datos['hta']=(isset($resultado_espacio['HTA'])?$resultado_espacio['HTA']:'');\n $datos['CLASIFICACION']=$clasificacion;\n $datos['nivel']=$this->datosInscripcion['nivel'];\n $datos['hor_alternativo']=$this->datosInscripcion['hor_alternativo'];\n foreach ($datos as $key => $value) {\n if($value=='')\n {$datos[$key]='null';}\n }\n\n $resultado_adicionar=$this->insertarRegistroInscripcion($datos);\n if($resultado_adicionar>=1)\n {\n $mensaje=\"Espacio académico adicionado.\";\n $this->actualizarInscripcionesSesion();\n $this->procedimientos->actualizarCupo($datos);\n $variablesRegistro=array('usuario'=>$this->usuario,\n 'evento'=>'1',\n 'descripcion'=>'Adiciona Espacio académico',\n 'registro'=>$this->ano.\"-\".$this->periodo.\", \".$datos['codEspacio'].\", 0, \".$datos['id_grupo'].\", \".$this->datosEstudiante[0]['PLAN_ESTUDIO'].\", \".$this->datosInscripcion['carrera'],\n 'afectado'=>$this->datosEstudiante[0]['CODIGO']);\n }else\n {\n $mensaje=\"No se puede adicionar, por favor intente mas tarde.\";\n $variablesRegistro=array('usuario'=>$this->usuario,\n 'evento'=>'50',\n 'descripcion'=>'Conexion Error Oracle adicionar',\n 'registro'=>$this->ano.\"-\".$this->periodo.\", \".$datos['codEspacio'].\",0, \".$datos['id_grupo'].\", \".$this->datosEstudiante[0]['PLAN_ESTUDIO'].\", \".$this->datosEstudiante[0]['COD_CARRERA'],\n 'afectado'=>$this->datosEstudiante[0]['CODIGO']);\n }\n }else\n {\n $mensaje=\"No hay datos del espacio. No se puede adicionar.\";\n $variablesRegistro=array('usuario'=>$this->usuario,\n 'evento'=>'50',\n 'descripcion'=>'Error datos espacio adicionar',\n 'registro'=>$this->ano.\"-\".$this->periodo.\", \".$_REQUEST['codEspacio'].\",0, \".$_REQUEST['id_grupo'].\", \".$this->datosEstudiante[0]['PLAN_ESTUDIO'].\", \".$this->datosEstudiante[0]['COD_CARRERA'],\n 'afectado'=>$this->datosEstudiante[0]['CODIGO']);\n }\n $this->retornar($pagina,$variable,$variablesRegistro,$mensaje);\n }", "function registrar_solicitud ($datos, $dia, $fecha_inicio, $fecha_fin){\n \n $anio_lectivo=date('Y', strtotime($fecha_inicio));\n \n $periodos=$this->dep('datos')->tabla('periodo')->get_periodo_calendario($fecha_inicio, $anio_lectivo, $this->s__datos_solcitud['id_sede']);\n \n $id_=$this->obtener_periodo($periodos, $this->s__datos_solcitud['tipo_asignacion']);\n \n if(strcmp($this->s__datos_solcitud['tipo_agente'], \"Organizacion\")==0){\n $apellido=' . ';\n $nro_doc=' - ';\n $tipo_doc=' - ';\n }else{\n $apellido=$this->s__datos_responsable[0]['apellido'];\n $nro_doc=$this->s__datos_responsable[0]['nro_docum'];\n $tipo_doc=$this->s__datos_responsable[0]['tipo_docum'];\n }\n //--Usamos ambos arreglos, $datos y $s__datos_solcitud.\n $asignacion=array(\n 'finalidad' => $datos['finalidad'],\n 'descripcion' => $datos['descripcion'],\n 'hora_inicio' => $datos['hora_inicio'],\n 'hora_fin' => $datos['hora_fin'],\n 'cantidad_alumnos' => $datos['capacidad'],\n 'facultad' => $this->s__datos_solcitud['facultad'],\n 'nro_doc' => $nro_doc,\n 'tipo_doc' => $tipo_doc,\n 'id_aula' => $this->s__datos_solcitud['id_aula'],\n 'modulo' => 1,\n 'tipo_asignacion' => $this->s__datos_solcitud['tipo_asignacion'],\n 'id_periodo' => $id_,\n 'id_responsable_aula' => $this->s__datos_solcitud['id_responsable'],\n 'nombre' => $this->s__datos_responsable[0]['nombre'],\n 'apellido' => $apellido,\n 'legajo' => $this->s__datos_responsable[0]['legajo'],\n );\n \n //Este grupo de funciones se copia tal cual desde la operacion Cargar Asignaciones. En este caso\n //intentamos no alterar sus estructuras.\n $this->registrar_asignacion($asignacion);\n \n //Agregamos a $asignacion datos extra relacionados a un periodo, para no alterar la estructura \n //de esta funcion. $dia tiene el mismo formato retornado por ef_multi_seleccion_check.\n $asignacion['dias']=$dia;\n $asignacion['fecha_inicio']=$fecha_inicio;//$this->s__datos_solcitud['fecha'];\n $asignacion['fecha_fin']=$fecha_fin;//$this->s__datos_solcitud['fecha'];\n \n $this->registrar_asignacion_periodo($asignacion);\n \n //Pasamos la solicitud a estado finalizada. Para ello solamente necesitamos el id_solicitud guardado\n //en la variable s__datos_solcitud. Internamente vamos a utilizar datos_tabla.\n $this->pasar_a_estado_finalizada('ACEPTADA');\n \n //Enviamos una notificacion al interesado.\n //$this->notificar();\n }", "function insertarRegistroInscripcion($datos) {\n $cadena_sql_adicionar=$this->sql->cadena_sql(\"inscribir_espacio\",$datos);\n $resultado_adicionar=$this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql_adicionar,\"\");\n return $this->totalAfectados($this->configuracion, $this->accesoOracle);\n }", "function insertarRegistroInscripcion($datos) {\n $cadena_sql_adicionar=$this->sql->cadena_sql(\"inscribir_espacio\",$datos);\n $resultado_adicionar=$this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql_adicionar,\"\");\n return $this->totalAfectados($this->configuracion, $this->accesoOracle);\n }", "function modificarSubsistema(){\r\n\t\t$this->procedimiento='segu.ft_subsistema_ime';// nombre procedimiento almacenado\r\n\t\t$this->transaccion='SEG_SUBSIS_MOD';//nombre de la transaccion\r\n\t\t$this->tipo_procedimiento='IME';//tipo de transaccion\r\n\t\t\r\n\t\t//Define los parametros para la funcion\t\r\n\t\t$this->setParametro('id_subsistema','id_subsistema','integer');\r\n\t\t$this->setParametro('codigo','codigo','varchar');\r\n\t\t$this->setParametro('prefijo','prefijo','varchar');\r\n\t\t$this->setParametro('nombre','nombre','varchar');\r\n\t\t$this->setParametro('nombre_carpeta','nombre_carpeta','varchar');\r\n\t\t\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t\t\t\r\n\t\t$this->ejecutarConsulta();\r\n\t\treturn $this->respuesta;\r\n\t}", "public function inscription(){\n if($this->emailExist()){\n echo \"<p> Cet email est déjà utilisé </p>\";\n return;\n }\n \n //Envoyer dans la base de donnée le nouvel utilisateur\n $connect = connectToBdd();\n $pdo = $connect -> prepare(\"INSERT INTO user(email, password) VALUES(?, ?)\");\n $pdo -> execute(array($this -> mail, $this ->password)); \n \n //Recuperer le $this -> id\n $this -> id = $connect -> lastInsertId();\n }", "function insertarSubsistema(){\r\n\t\t$this->procedimiento='segu.ft_subsistema_ime';// nombre procedimiento almacenado\r\n\t\t$this->transaccion='SEG_SUBSIS_INS';//nombre de la transaccion\r\n\t\t$this->tipo_procedimiento='IME';//tipo de transaccion\r\n\t\t//Define los parametros para la funcion\t\r\n\t\t$this->setParametro('codigo','codigo','varchar');\r\n\t\t$this->setParametro('prefijo','prefijo','varchar');\r\n\t\t$this->setParametro('nombre','nombre','varchar');\r\n\t\t$this->setParametro('nombre_carpeta','nombre_carpeta','varchar');\r\n\t\r\n \t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\t\treturn $this->respuesta;\r\n\t}", "function actualizar() \r\n { \r\n $_SESSION['idusuario'] = $this->idusuario;\r\n $_SESSION['nombreCompletoUsuario'] = $this->nombreCompletoUsuario;\r\n $_SESSION['usuario'] = $this->usuario; \r\n $_SESSION['logeado'] = $this->logeado;\r\n $_SESSION['t_expirar'] = TIEMPO_SESION; \r\n $_SESSION['hora_inicio'] = $this->hora_inicio;\r\n $_SESSION['idioma'] = $this->idioma; \r\n $_SESSION['ididioma'] = $this->ididioma;\r\n $_SESSION['idgrupo'] = $this->idgrupo;\r\n $_SESSION['arrAcceso'] = $this->arrAcceso;\r\n $_SESSION['arrFiltro'] = $this->arrFiltro;\r\n $_SESSION['where'] = $this->where;\r\n }", "function abrirsesion($id,$nombreusuario,$ci)\n\t{\n\t\t//declaracion de variable de sesion para el usuario\n\t\t$_SESSION[\"idtemp\"];\n\t\t//declaracion de variable de sesion para la navegacion del menu\n\t\t$_SESSION[\"seleccionmodulo\"];\n\t\t$_SESSION[\"seleccionsubmodulo\"];\n\t\t$_SESSION[\"seleccionprograma\"];\n\t\t$_SESSION[\"idconfiguracion\"];\n\t\t//asigna el valor del usuario encriptado en md5\n\t\t$_SESSION[\"idtemp\"] = md5($nombreusuario . date('dmYGis'));\n\t\t//asigna el valor de las variables de menu \n\t\t$_SESSION[\"seleccionmodulo\"] = \"\";\n\t\t$_SESSION[\"seleccionsubmodulo\"] = \"\";\n\t\t$_SESSION[\"seleccionprograma\"] = \"\";\n\t\t$_SESSION[\"idconfiguracion\"];\n\t\t//crea el registro temporal en bd usuarios\n\t\t$rcsusuariotemp = new Recordset();\n\t\t$consulta = \"UPDATE seguridad_usuarios SET idtemp = '\" . $_SESSION[\"idtemp\"] . \"' WHERE cedula = '\" . $ci . \"'\";\n\t\t$rcsusuariotemp->sql = $consulta;\n\t\t$rcsusuariotemp->abrir();\n\t\t//registro de inicio de sesion en bitacora\n\t\tregistrobitacora(\"\",\"\",\"Apertura de Sesión\",$id ,\"\");\n\t}", "public function inicio_sesion($correo,$contra)\n {\n $contraCifrada = sha1($contra);\n $contraCifrada = sha1($contraCifrada);\n $randos= rand(100000,999999);\n $fecha = date(\"D/m/A H:i:s\");\n $cifrado = sha1($correo.$fecha.$randos);\n\n\n\n $sql_admin = \"SELECT correoAdministrador FROM administrador WHERE correoAdministrador=:correoAdministrador AND contrasenaAdministrador=:contrasenaAdministrador\";\n $modelo = new Servidor();\n $conexion = $modelo->conectar();\n $parametro_admin = $conexion->prepare($sql_admin);\n $parametro_admin->bindParam(\":correoAdministrador\",$correo);\n $parametro_admin->bindParam(\":contrasenaAdministrador\",$contraCifrada);\n $parametro_admin->execute();\n $columnas_admin = $parametro_admin->rowCount();\n\n\n if($columnas_admin==0)\n {\n $sql = \"SELECT correoEmpleado FROM empleado WHERE correoEmpleado=:correoEmpleado AND contrasenaEmpleado=:contrasenaEmpleado\";\n $modelo = new Servidor();\n $conexion = $modelo->conectar();\n $parametro = $conexion->prepare($sql);\n $parametro->bindParam(\":correoEmpleado\",$correo);\n $parametro->bindParam(\":contrasenaEmpleado\",$contraCifrada);\n $parametro->execute();\n $columnas = $parametro->rowCount();\n\n\n if($columnas==0)\n {\n $sql2 = \"SELECT correoEmpresa FROM empresas WHERE correoEmpresa=:correoEmpresa AND contrasenaEmpresa=:contrasenaEmpresa\";\n $parametro2 = $conexion->prepare($sql2);\n $parametro2->bindParam(\":correoEmpresa\",$correo);\n $parametro2->bindParam(\":contrasenaEmpresa\",$contraCifrada);\n $parametro2->execute();\n $columnas2 = $parametro2 ->rowCount();\n if($columnas2==0)\n {\n return json_encode(\"No existe el usuario registrado\");\n }\n else\n {\n $sql6 = \"SELECT activo FROM empresas WHERE correoEmpresa=:correoEmpresa AND contrasenaEmpresa=:contrasenaEmpresa\";\n $parametro6 = $conexion->prepare($sql6);\n $parametro6->bindParam(\":correoEmpresa\",$correo);\n $parametro6->bindParam(\":contrasenaEmpresa\",$contraCifrada);\n $parametro6->execute();\n $datos1= $parametro6->fetchAll(PDO::FETCH_ASSOC);\n $estado_activo1 = $datos1[0]['activo'];\n if($estado_activo1==1)\n {\n $sql7 = \"UPDATE empresas SET idSesion=:idSesion WHERE correoEmpresa=:correoEmpresa AND contrasenaEmpresa=:contrasenaEmpresa\";\n $parametro7 = $conexion->prepare($sql7);\n $parametro7->bindParam(\":idSesion\",$cifrado);\n $parametro7->bindParam(\":correoEmpresa\",$correo);\n $parametro7->bindParam(\":contrasenaEmpresa\",$contraCifrada);\n if($parametro7->execute())\n {\n $sql8 = \"SELECT \n id,\n rfcEmpresa,\n nombreEmpresa,\n razonsocialEmpresa,\n domicilioEmpresa,\n numerocalleEmpresa,\n coloniaEmpresa,\n cpEmpresa,\n municipioEmpresa,\n estadoEmpresa,\n telefonoEmpresa,\n correoEmpresa,\n idSesion,\n tipo_usuario FROM empresas WHERE correoEmpresa=:correoEmpresa AND contrasenaEmpresa=:contrasenaEmpresa\";\n $parametro8 = $conexion->prepare($sql8);\n $parametro8->bindParam(\":correoEmpresa\",$correo);\n $parametro->bindParam(\":contrasenaEmpresa\",$contraCifrada);\n if($parametro8->execute())\n {\n $datos1 = $parametro8->fetchAll(PDO::FETCH_ASSOC);\n $_SESSION['idSesion'] = $datos1[0]['idSesion'];\n $_SESSION['idUsuario'] = $datos1[0]['id'];\n \n return json_encode($datos1);\n }\n }\n }\n else\n {\n return json_encode (\"inicio bloqueado\");\n }\n }\n }\n else\n {\n \n $sql3 = \"SELECT activo FROM empleado WHERE correoEmpleado=:correoEmpleado AND contrasenaEmpleado=:contrasenaEmpleado\";\n $parametro3 = $conexion->prepare($sql3);\n $parametro3->bindParam(\":correoEmpleado\",$correo);\n $parametro3->bindParam(\":contrasenaEmpleado\",$contraCifrada);\n $parametro3->execute();\n $datos= $parametro3->fetchAll(PDO::FETCH_ASSOC);\n $estado_activo = $datos[0]['activo'];\n if($estado_activo==1)\n {\n $sql4 = \"UPDATE empleado SET idSesion=:idSesion WHERE correoEmpleado=:correoEmpleado AND contrasenaEmpleado=:contrasenaEmpleado\";\n $parametro4 = $conexion->prepare($sql4);\n $parametro4->bindParam(\":idSesion\",$cifrado);\n $parametro4->bindParam(\":correoEmpleado\",$correo);\n $parametro4->bindParam(\":contrasenaEmpleado\",$contraCifrada);\n if($parametro4->execute())\n {\n $sql5 = \"SELECT id,nombreEmpleado,\n apellidopEmpleado,\n apellidomEmpleado,\n domicilioEmpleado,\n numeroextEmpleado,\n coloniaEmpleado,\n telefonoEmpleado,\n puestoEmpleado,\n correoEmpleado,\n idSesion,\n tipo_usuario FROM empleado WHERE correoEmpleado=:correoEmpleado AND contrasenaEmpleado=:contrasenaEmpleado\";\n $parametro5 = $conexion->prepare($sql5);\n $parametro5->bindParam(\":correoEmpleado\",$correo);\n $parametro5->bindParam(\":contrasenaEmpleado\",$contraCifrada);\n if($parametro5->execute())\n {\n $datos = $parametro5->fetchAll(PDO::FETCH_ASSOC);\n $_SESSION['idSesion'] = $datos[0]['idSesion'];\n $_SESSION['idUsuario'] = $datos[0]['id'];\n \n return json_encode($datos);\n }\n }\n }\n else\n {\n return json_encode(\"Inicio bloqueado\");\n }\n \n }\n\n }\n else\n {\n $sql_admin1 = \"SELECT activo FROM administrador WHERE correoAdministrador=:correoAdministrador AND contrasenaAdministrador=:contrasenaAdministrador\";\n $parametro_admin1 = $conexion->prepare($sql_admin1);\n $parametro_admin1->bindParam(\":correoAdministrador\",$correo);\n $parametro_admin1->bindParam(\":contrasenaAdministrador\",$contraCifrada);\n $parametro_admin1->execute();\n $datos_admin= $parametro_admin1->fetchAll(PDO::FETCH_ASSOC);\n $estado_activo_admin = $datos_admin[0]['activo'];\n if($estado_activo_admin==1)\n {\n $sql_admin2 = \"UPDATE administrador SET idSesion=:idSesion WHERE correoAdministrador=:correoAdministrador AND contrasenaAdministrador=:contrasenaAdministrador\";\n $parametro_admin2 = $conexion->prepare($sql_admin2);\n $parametro_admin2->bindParam(\":idSesion\",$cifrado);\n $parametro_admin2->bindParam(\":correoAdministrador\",$correo);\n $parametro_admin2->bindParam(\":contrasenaAdministrador\",$contraCifrada);\n if($parametro_admin2->execute())\n {\n $sql_admin3 = \"SELECT \n id,\n nombreAdministrador,\n apellidopAdministrador,\n apellidomAdministrador,\n domicilioAdministrador,\n numeroextAdministrador,\n coloniaAdministrador,\n telefonoAdministrador,\n puestoAdministrador,\n correoAdministrador,\n idSesion,\n tipo_usuario FROM administrador WHERE correoAdministrador=:correoAdministrador AND contrasenaAdministrador=:contrasenaAdministrador\";\n $parametro_admin3 = $conexion->prepare($sql_admin3);\n $parametro_admin3->bindParam(\":correoAdministrador\",$correo);\n $parametro_admin3->bindParam(\":contrasenaAdministrador\",$contraCifrada);\n if($parametro_admin3->execute())\n {\n $datos_admin = $parametro_admin3->fetchAll(PDO::FETCH_ASSOC);\n $_SESSION['idSesion'] = $datos_admin[0]['idSesion'];\n $_SESSION['idUsuario'] = $datos_admin[0]['id'];\n\n return json_encode($datos_admin);\n }\n }\n }\n else\n {\n return json_encode(\"Inicio bloqueado\");\n }\n\n }\n }", "function evt__procesar()\n\t{\n\t\t$this->_log->debug($this->get_txt() . \"[callback][ evt__procesar ]\", 'toba');\n\t\tif(isset($this->_cn)){\n\t\t\t$this->disparar_entrega_datos_cn();\n\t\t\t$this->_cn->procesar();\n\t\t}\n\t}", "function iniciarsession(){}", "private function salva() {\n $this->enderecoModel = $this->enderecoView->recebeDadosDaEntrada();\n\n //II - validar dados\n //III - se dados ok então continua\n // senão mensagem de erro e sai\n //IV - incluir dados no BD\n //var_dump($this->cursoModel);\n $incluiu = $this->enderecoModel->insereObjeto();\n //V - se incluiu então mensagem de ok\n // senão mensagem de erro\n if ($incluiu) {\n $this->enderecoView->addMensagem(\"Inclusão bem sucedida!\");\n } else {\n $this->enderecoView->addMensagem(\"Inclusão mal sucedida! Contate o responsável.\");\n }\n }", "function evt__cuadro_espacio_ocupado__asignar ($datos){\n $this->s__datos_solcitud['id_aula']=$datos['id_aula'];\n $this->s__datos_solcitud['aula']=$datos['aula'];\n \n $this->set_pantalla('pant_asignacion');\n }", "function saveDataFromInput() {\n $this->subscriber = \\Idno\\Core\\site()->currentPage()->getInput('subscriber');\n $this->subscription = \\Idno\\Core\\site()->currentPage()->getInput('subscribe');\n\n\n // Check duplicates\n if ($result = \\Idno\\Core\\site()->db()->getObjects('IdnoPlugins\\Subscribe\\Subscription', ['subscriber' => $this->subscriber, 'subscription' => $this->subscription]))\n throw new SubscriptionException(\"{$this->subscriber} already subscribed to updates from {$this->subscription}\");\n\n if ($content = \\Idno\\Core\\Webservice::get($this->subscription)) {\n\n // For reference, store the domain part so we can quickly see if it's a recognised domain before performing a MF2 parse\n $this->subscription_domain = parse_url($this->subscription, PHP_URL_HOST);\n\n // Now fetch MF2 of the subscription url\n $this->subscription_mf2 = \\Idno\\Core\\Webmention::parseContent($content['content']);\n\n // Get the endpoint\n // Get subscriber endpoint\n if (preg_match('~<link href=\"([^\"]+)\" rel=\"http://mapkyc.me/1dM84ud\" ?\\/?>~', $content['content'], $match)) {\n $this->subscription_endpoint = $match[1];\n }\n else\n throw new SubscriptionException('No subscription endpoint found.');\n \n // Attempt to subscribe (makes sure object is not created unless we've got a +ve response from remote server)\n $this->subscribe();\n }\n else\n throw new SubscriptionException(\"Page {$this->subscription} could not be reached.\");\n\n return $this->save();\n }", "public function InscribirParticipante($numInsercion,$lin_inf, $conexion,$pIdJornada,$actualizarTercero) { //26\r\n\t\theader(\"Content-Type: text/html;charset=utf-8\"); \r\n $IdUsuario = $_SESSION['idUsuario']; \r\n $registro = explode(\";\", $lin_inf);\r\n $auxFecha = $this->obtenerFecha($registro[14]);\r\n $pFecha = $this->obtenerFecha($registro[10]);\r\n $apellidos =($registro[2]);\r\n $nombres = $registro[3];\r\n $correo = $this->evalString(($registro[9]));\r\n $observacionEstado=\"\";\r\n if(isset($registro[24])){\r\n $observacionEstado=$registro[24];\r\n }else{\r\n $observacionEstado=\"sin observacion\";\r\n }\r\n\r\n @$sql = \"CALL SPCARGAMASIVAPARTICIPANTES($registro[0],$registro[1],'$apellidos','$nombres', '$registro[4]', $registro[5], $registro[6],$registro[7],$registro[8], '$correo', '$pFecha', $registro[11],$registro[12], $registro[13], '$auxFecha',\r\n\t\t$registro[15], $registro[16], $registro[17], $registro[18], $registro[19], $registro[20], $registro[21], $registro[22], $registro[23],'$observacionEstado',$IdUsuario, \".$pIdJornada.\", $actualizarTercero);\";\r\n\t\t\r\n\t\t$rs=null;\r\n\t\t$conexion->getPDO()->query(\"SET NAMES 'utf8'\");\r\n $inserto = 0;\r\n if ($rs = $conexion->getPDO()->query($sql)) {\r\n if ($filas = $rs->fetchAll(PDO::FETCH_ASSOC)) {\r\n $response = 1;\r\n foreach ($filas as $fila) {\r\n $resultado = $fila['resultado'];\r\n $inserto = 1;\r\n\r\n }\r\n }else{\r\n echo $numInsercion.' 2--- '. $sql.\"<br>\";\r\n }\r\n } else {\r\n echo $numInsercion.' --- '. $sql.\"<br>\";\r\n\t\t\t\r\n $response = 0;\r\n }\r\n return $inserto;\r\n }", "function evt__cuadro__seleccion($datos){\n \n if(strcmp($datos['estado'], 'PENDIENTE') != 0){\n $mensaje=\" Solamente se pueden analizar solicitudes en estado PENDIENTE. \";\n toba::notificacion()->agregar($mensaje, 'info');\n return ;\n }\n\t //Necesitamos todos los datos de la solicitud para:\n //a) pasarla a estado finalizada.\n //b) registrar la solicitud si existe algun espacio disponible. \n //Usamos la misma variable, s__datos_solicitud.\n $this->s__datos_solcitud=$datos;\n $this->s__contador += 1;\n \n //Usamos el id_sede especificado en la solicitud. Debemos conceder o no las solicitudes que hicieron\n //en nuestra dependencia, para ello necesitamos conocer cuales son los espacios que tenemos \n //disponibles en nuestro establecimiento.\n $this->s__id_sede=$datos['id_sede'];\n \n //Guardamos la fecha de solicitud en una variable aparte. Se utiliza en la funcion procesar_periodo \n //para obtener todas las asignaciones, definitivas o periodicas, de la fecha de solicitud.\n //El valor de esta variable es usada dentro de los metodos del datos_tabla.\n $this->s__fecha_consulta=$datos['fecha'];\n \n $this->s__capacidad=$datos['capacidad'];\n \n //Verificamos si la solicitud es unica o multi_evento.\n if(strcmp($datos['tipo'], \"UNICO\")==0){\n //Empezamos calculando horarios disponibles en el aula seleccionada. El resultado de \n //calcular_hd_en_aula_seleccionada es booleando. True si exsite el horario especificado en la \n //solicitud.\n if($this->calcular_hd_en_aula_seleccionada()){\n //Si existe espacio disponible en el aula solicitada, debemos mostrar los datos de la \n //solicitud y permitirle al usuario persistir una nueva asignacion.\n $this->set_pantalla('pant_asignacion');\n }else{\n //Si no existe el horario especificado en la solicitud iniciamos la busqueda de un horario \n //alternativo en otra aula.\n $this->verificar_existencia_de_espacio();\n $this->set_pantalla('pant_busqueda');\n }\n }else{\n $this->conceder_multi_evento($datos);\n }\n \n// //Se necesita para enviar una notificacion si la solicitud es exitosa.\n// $this->s__sede_origen=$datos['id_sede'];\n// $this->s__sigla=$datos['facultad'];\n// $this->s__datos_filtro=array();\n// //Se usa para cargar el formulario form_asignacion con datos por defecto. En este punto la solicitud \n// //esta lista para ser concedida.\n// $this->s__datos_solicitud=$datos;\n \n\t}", "public function activar() {\n $sentencia = $this->bd->prepare(\"UPDATE usuario SET estado = 'activo' WHERE id_usuario = ?\");\n $sentencia->execute([$this->id]);\n }", "public function subscribeAction()\n\t{\n\t\t// persist subscription\n\t\t$this->_sessionModel->subscribeUser($this->getRequest()->getParam('id'));\n\t}", "function registrar_asignacion_periodo ($datos){\n $secuencia=recuperar_secuencia('asignacion_id_asignacion_seq');\n \n //La secuencia de la tabla asignacion_periodo es: asignacion_periodo_id_asignacion_seq.\n \n $periodo=array(\n 'id_asignacion' => $secuencia,\n 'fecha_inicio' => $datos['fecha_inicio'],\n 'fecha_fin' => $datos['fecha_fin']\n );\n \n $this->dep('datos')->tabla('asignacion_periodo')->nueva_fila($periodo);\n $this->dep('datos')->tabla('asignacion_periodo')->sincronizar();\n $this->dep('datos')->tabla('asignacion_periodo')->resetear();\n \n //En esta seccion se guarda informacion en la tabla esta_formada. Podemos tener varios dias. Su formato es:\n //array( 0 => array(id_solictud, nombre, fecha), ..., )\n $dias=$datos['dias'];\n foreach ($dias as $clave=>$dia){\n \n $dato['nombre']= $dia['nombre'];\n $dato['id_asignacion']=$secuencia;\n $dato['fecha']=$dia['fecha'];\n $this->dep('datos')->tabla('esta_formada')->nueva_fila($dato);\n $this->dep('datos')->tabla('esta_formada')->sincronizar();\n $this->dep('datos')->tabla('esta_formada')->resetear();\n }\n \n }", "public function asign_transmisor($usuarioID){\n\t\t\t$equipo = $this->input->post('equiposID');\n\t\t\t$data = array(\n\t\t\t\t'asignado' => $this->input->post('asignado')\n\t\t\t);\n\t\t\t$this->db->where('equiposID', $equipo);\n\t\t\t$this->db->update('equipos', $data);\n\t\t\t// en la misma funcion actualizamos el equiposID del cliente\n\t\t\tif($_POST['volver']==1){// condicional para volver a almacen\n\t\t\t$data_user = array(\n\t\t\t\t'equiposID' => ''\n\t\t\t);\n\t\t\t} else {\n\t\t\t$data_user = array(\n\t\t\t\t'equiposID' => $this->input->post('equiposID')\n\t\t\t);}\n\t\t\t$this->db->where('usuarioID', $usuarioID);\n\t\t\t$this->db->update('usuarios', $data_user);\n\t\t}", "function modificarSucursalUsuario(){\n\t\t$this->procedimiento='vef.ft_sucursal_usuario_ime';\n\t\t$this->transaccion='VF_SUCUSU_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_sucursal_usuario','id_sucursal_usuario','int4');\n\t\t$this->setParametro('id_sucursal','id_sucursal','int4');\n\t\t$this->setParametro('id_punto_venta','id_punto_venta','int4');\n\t\t$this->setParametro('id_usuario','id_usuario','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('tipo_usuario','tipo_usuario','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 inicioSesion()\r\n {\r\n //OBJETO A DEVOLVER\r\n $USU;\r\n $comprobarUsuario;\r\n $comprobarGrupo='';\r\n if($_SERVER['REQUEST_METHOD']=='POST')\r\n { $nombre = $_POST['nombre'];\r\n $pass = $_POST['password'];\r\n if(!empty($nombre) && !empty($pass))\r\n { require_once __DIR__ . '/../Repositorio/usuarioRepositorio.php';\r\n $comprobarUsuario = (new UsuarioRepositorio)->findUsuarioPorNombre($nombre, $pass);\r\n if ($comprobarUsuario == true) {\r\n $_SESSION['usuario'] = $nombre;\r\n //comprobar Grupo\r\n $comprobarGrupo = (new UsuarioRepositorio)->comprobarGrupo($nombre);\r\n if($comprobarGrupo == 'admins'){\r\n require __DIR__ . '/../../app/plantillas/inicioSesionAdministrador.php';\r\n }elseif($comprobarGrupo == 'clientes'){\r\n require __DIR__ . '/../../app/plantillas/inicioSesionUsuario.php';\r\n }\r\n\r\n }else\r\n {\r\n $error = 'Usuario o contraseña erróneos';\r\n }\r\n }else\r\n { $error = 'Son necesarios el Usuario y la Contraseña';\r\n }\r\n }\r\n require __DIR__ . '/../../app/plantillas/inicioSesion.php';\r\n }", "public function ModificarInstancia(){}", "public function subscribe(){\n\t\t\n\t}", "function registrarAfiliado($idinversionista,$nombres,$apellidos,$dni,$celular,$email,$imagen,$contrasenia){\n $db=new baseDatos();\n try {\n $conexion=$db->conectar();\n $sql='INSERT INTO tb_inversionista( nombres , apellidos , dni , celular ,email, imagen , contrasenia)'.\n ' VALUES( :nombres , :apellidos , :dni , :celular , :email , :imagen , :contrasenia)';\n $sentencia=$conexion->prepare($sql);\n $sentencia->bindParam(':nombres',$nombres);\n $sentencia->bindParam(':apellidos',$apellidos);\n $sentencia->bindParam(':dni',$dni);\n $sentencia->bindParam(':celular',$celular);\n $sentencia->bindParam(':email',$email);\n $sentencia->bindParam(':imagen',$imagen);\n $sentencia->bindParam(':contrasenia',$contrasenia);\n $sentencia->execute();\n $id=$conexion->lastInsertId();\n //insertar inversion inicial sin datos\n $sinversion=new sinversion();\n $sinversion->insertarInversion($id);\n $safiliado=new safiliado();\n $safiliado->registrarAfiliacion($idinversionista,$id,1);\n return $id;\n } catch (PDOException $e) {\n throw $e;\n }\n }", "public function store(Request $request)\n {\n $usuario=User::Where(\"dni\",'=',$request->dni)->first();\n\n //consultando el registro de la tabla pago\n $pagos=Pago::where('num_comprobante','=',$request->n_comprobante)\n ->where('fecha_comprobante','=',$request->f_comprobante)->first();\n \n\n if($usuario->f_nac==null and $usuario->email==null){\n\n $usuario->f_nac=$request->get('f_nac');\n $usuario->email=$request->get('email');\n $usuario->distrito_nac=$request->get('distrito_nac');\n $usuario->domicilio=$request->get('domicilio');\n $usuario->n_domicilio=$request->get('n_domicilio');\n $usuario->cel=$request->get('cel');\n $usuario->save();\n //creamos una nueva inscripcion\n $inscripcionp=new InscripcionNcgt;\n $inscripcionp->programa_ncgt_id=$request->get('descripcion');\n $inscripcionp->user_id=$usuario->id;\n\n if($usuario->hasRoles(['Estudiante','Docente'])){\n $inscripcionp->es_interno=1;\n $inscripcionp->save();\n }else{\n $inscripcionp->es_interno=0;\n $inscripcionp->save();\n }\n\n //registrando en la tabla control de pago\n $control=new ControlPago;\n $control->inscripcion_ncgt_id=$inscripcionp->id;\n $control->pago_id=$pagos->id;\n $control->tipo=1;\n $control->save();\n $pagos->estado_recibo=1;\n $pagos->save();\n return redirect()->route('diplomado.ins.index',['tipo'=>$request->tipo])->with('verde','Se registró la inscripcion de \\''.$usuario->nombres.'\\' correctamente');\n }else{\n $inscripcionp=new InscripcionNcgt;\n $inscripcionp->programa_ncgt_id=$request->get('descripcion');\n $inscripcionp->user_id=$usuario->id;\n if($usuario->hasRoles(['Estudiante','Docente'])){\n $inscripcionp->es_interno=1;\n $inscripcionp->save();\n }else{\n $inscripcionp->es_interno=0;\n $inscripcionp->save();\n }\n\n //registrando en la tabla control de pago\n $control=new ControlPago;\n $control->inscripcion_ncgt_id=$inscripcionp->id;\n $control->pago_id=$pagos->id;\n $control->tipo=1;\n $control->save();\n $pagos->estado_recibo=1;\n $pagos->save();\n }\n return redirect()->route('diplomado.ins.index',['tipo'=>$request->tipo])->with('verde','Se registró la inscripcion de \\''.$usuario->nombres.'\\' correctamente');\n \n }" ]
[ "0.6429248", "0.6398824", "0.60449636", "0.5955053", "0.5907417", "0.5768359", "0.5768359", "0.5761262", "0.5753026", "0.5728473", "0.5722455", "0.5688723", "0.5652065", "0.56304425", "0.55941737", "0.55836076", "0.5552091", "0.55436194", "0.55418223", "0.5534588", "0.55046844", "0.5481797", "0.5458077", "0.54579175", "0.54439443", "0.5441421", "0.54373044", "0.5430835", "0.5425349", "0.5422672" ]
0.7228825
1
TODO: Implement selectAllStmt() method.
protected function selectAllStmt() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function selectStmt()\n {\n }", "abstract protected function getSelectStatement();", "public static function selectAll($statement, $param = []) {\n return self::query($statement, $param)->fetchAll();\n }", "function selectStmt() {\n return $this->selectStmt;\n }", "public function selectAll() {\n\t\t\tif(!$this->selectAllStatement->execute()) return false; // if the query didn't execute, return false\n\t\t\t$result = $this->selectAllStatement->get_result(); // frees memory\n\t\t\t$resultArray = $result->fetch_all(MYSQLI_ASSOC);\n\t\t\treturn $resultArray;\n\t\t}", "public function selectAll(){\n\t\t \t$sql = \"SELECT * FROM $this->tb ORDER BY id DESC\";\n\t\t \t$stmt = $this->prepare($sql);\n\t\t \t$stmt->execute();\n\t\t \treturn $stmt->fetchAll();\n\t\t}", "public function allSelect();", "function selectall($table)\r\n {\r\n $sql = \"SELECT * FROM $table \";\r\n $stmt = conn()->query($sql);\r\n return $stmt;\r\n }", "function selectAll($table, $db)\n{\n /* mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); */\n $query = \"SELECT * FROM \" . $table . \"\";\n\n //SECURE STMT'S\n $stmt = $db->prepare($query);\n $stmt->execute();\n\n return $stmt;\n}", "public function selectAll()\n {\n $sql = \"SELECT idcidade, cidade, DDD, capital, estado_idestado\n FROM \" . $this->schema . \".\" . $this->table;\n }", "function selectAll()\n {\n $query = \"SELECT ClarificationID, ProposalID, DocID, question, answer, ClosingDate, CreatedDate, LastEditDate FROM Clarification;\";\n $stmt = $this->conn->prepare( $query );\n\n // execute query\n $stmt->execute();\n return $stmt;\n }", "public function selectAll() {\n $sqlQuery = sprintf(\"SELECT * FROM `%s`\", $this->getTableName());\n\n return $this->fetchRows($sqlQuery);\n }", "public function selectAll() {\n $this->generateSelectAll();\n $this->_all = true;\n $this->typeTransacction();\n $this->utf8_decode_array();\n }", "public function fetchAll($statement, array $bindings = []);", "public function all(){\n $rawSql = $this->getRawSql();\n if(!$rawSql)\n throw new \\Exception('Sql statement is empty');\n $statement = Yii::$app->clickhouse->select($this->getRawSql());\n if($this->classCaller)\n return (new $this->classCaller)->afterFind($statement->fetchAll());\n return $statement->fetchAll();\n }", "public function fetchAll(){\n $resultSet = $this->select();\n return $resultSet;\n }", "public function getAll() {\n $this->selStmt->execute();\n return $this->selStmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function select();", "public function select();", "public function select();", "public static function getAllForSelect()\n {\n }", "public function getAllRows(){\n $this->execute();\n return $this->stmt->fetchAll();\n }", "public function selectAllstudio() {\n\t\t$this->dbAdapter->dbOpen();\n\t\t$result = $this->dbAdapter->studioSelectAll();\n\t\t$this->dbAdapter->dbClose();\n\t\t$this->error = $this->dbAdapter->lastError();\n\t\t\n\t\treturn $result;\t\t\n\t}", "public function select_for_all($statement,$page,$limit,$startpoint)\n{\n\t$query=mysql_query(\"SELECT * FROM {$statement} LIMIT {$startpoint},{$limit}\");\n\treturn $query;\n}", "function read(){\n\t\t// select all query:get all students\n\t\t$query = \" SELECT * FROM student\";\n\t\t// prepare query statement\n\t\t$stmt = $this->conn->prepare($query);\n\t\t//executequery\n\t\t$stmt->execute();\n\t\treturn $stmt;\n\t}", "public function selectAll()\n {\n $sql = \"SELECT idcliente, cpf_cnpj, nome_razao_social, apelido_nome_fantasia, inscricao_municipal, identidade_inscricao_estadual, data_nascimento_fundacao, sexo, email_idemail, endereco_idendereco, telefone_idtelefone, created, modified\n FROM \" . $this->schema . \".\" . $this->table;\n }", "protected function fetchAll() {\r\n\t\ttry {\r\n\t\t\treturn $this->_db->fetchAll($this->_sql, $this->_params);\r\n\t\t} catch (Exception $e) {\r\n\t\t\tdie($e->getMessage());\r\n\t\t}\r\n\t}", "abstract public function execStmt($stmt);", "protected function _statementList(){ }", "public function fetchAllRows();" ]
[ "0.77772", "0.69502854", "0.66948575", "0.6668828", "0.6628719", "0.65415573", "0.6374966", "0.63744384", "0.63532114", "0.6328679", "0.6326394", "0.6318357", "0.6148151", "0.6137044", "0.6129185", "0.60759854", "0.6039489", "0.6020348", "0.6020348", "0.6020348", "0.596121", "0.59585404", "0.5952535", "0.59222955", "0.59101343", "0.58758765", "0.5873472", "0.58546084", "0.585322", "0.58218956" ]
0.9071761
0
executes codes after compiling results function is executed
public function afterCompilingResults() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function afterCompilingResults() {\n }", "public function beforeCompilingResults() \n {\n }", "public function beforeCompilingResults()\n {\n }", "public function beforeCompilingResults()\n {\n }", "public function beforeCompilingResults() {\n }", "public function main() {\n\t\t$this->execute();\n\t}", "protected function compile()\n\t{\n\t\treturn;\n\t}", "private function exec_after_completition() {\r\n require_once $this->path_exec_after_completition;\r\n }", "abstract function executeResult();", "public final function execute() {\n $this->validate();\n $this->main();\n }", "protected function compile()\n {\n }", "public function run()\n {\n $this\n ->applyFilters()\n ->applySearch()\n ->finalize()\n ->applyTransformer()\n ->getResults();\n }", "function execute() { \r\n static $alreadyExecuted; \r\n if ($alreadyExecuted == 1) return; \r\n $alreadyExecuted = 1; \r\n \r\n $yasca =& Yasca::getInstance(); \r\n $dir = $yasca->options['dir']; \r\n $stat_msgs = array(); \r\n\r\n\t$executable = $this->executable[getSystemOS()];\r\n\t$executable = $this->replaceExecutableStrings($executable);\r\n\t$arguments = $this->arguments[getSystemOS()];\r\n\t$arguments = $this->replaceExecutableStrings($arguments);\r\n\r\n if (getSystemOS() == \"Windows\" ||\r\n (getSystemOS() == \"Linux\" && !preg_match(\"/no wine in/\", `which wine`))) {\r\n $yasca->log_message(\"Forking external process (FxCop)...\", E_USER_WARNING);\r\n exec( $executable . $arguments . escapeshellarg($dir), $stat_msgs);\r\n } \r\n \r\n if ($yasca->options['debug']) { \r\n $yasca->log_message(\"FxCop returned: \" . implode(\"\\r\\n\", $stat_msgs), E_ALL); \r\n\t} \r\n\r\n\tif (!file_exists(\"scan.xml\")) {\r\n\t $yasca->log_message(\"External process completed...\", E_USER_WARNING);\r\n\t return;\r\n\t}\r\n\r\n $dom = new DOMDocument(); \r\n if (!$dom->load(\"scan.xml\")) { \r\n $yasca->log_message(\"FxCop did not return a valid XML document. Ignoring.\", E_USER_WARNING); \r\n return; \r\n } \r\n \r\n\t$yasca->log_message(\"External process completed...\", E_USER_WARNING);\r\n\r\n\t//Process results\r\n\tforeach ($dom->getElementsByTagName(\"Namespace\") as $namespace) {\r\n\t if ($namespace->getElementsByTagName(\"Type\")->length == 0) \r\n\t\t$this->process_messages($namespace);\t \r\n\t} \r\n\r\n\tforeach ($dom->getElementsByTagName(\"Module\") as $module) { \r\n\t $this->process_messages($module);\t \r\n\t} \r\n\r\n\tforeach ($dom->getElementsByTagName(\"Type\") as $type) {\r\n\t $this->process_messages($type);\t \r\n\t} \r\n\r\n\tunlink(\"scan.xml\");\r\n }", "protected function compile()\n {\n parent::compile();\n \n // This is where our custom code will go\n }", "public function main()\n\t{\n\t\t$this->prepare();\n\t\tlist($return, $output) = $this->executeCommand();\n\t\t$this->cleanup($return, $output);\n\t}", "public function execute()\n\t{\n\t\t$this->run();\n\t}", "protected function executeProlog() {}", "final public function compile()\n {\n if ($this->compiled)\n {\n return;\n }\n\n $this->beforeCompile();\n\n $this->compiled = true;\n }", "public function execute()\r\n\t{\r\n\t\t\r\n\t}", "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.7324083", "0.6864271", "0.67272407", "0.67272407", "0.6673214", "0.6412497", "0.6406833", "0.6125036", "0.6044642", "0.6036691", "0.602318", "0.6000164", "0.599249", "0.596747", "0.59580916", "0.59446573", "0.58863336", "0.5883281", "0.58635044", "0.5850986", "0.5850986", "0.5850986", "0.5850986", "0.5850986", "0.5850986", "0.5850986", "0.5850986", "0.5850986", "0.5850986", "0.5850986" ]
0.7359962
1
Get customer activities block.
public function getCustomerActivitiesBlock() { return $this->blockFactory->create( \Magento\Sales\Test\Block\Adminhtml\Order\Create\CustomerActivities::class, [ 'element' => $this->browser->find($this->customerActivities, Locator::SELECTOR_CSS) ] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getactivityAction()\n {\n if (!$this->_authenticate()) {\n return;\n }\n\n try {\n $request = $this->getRequest();\n $helper = Mage::helper('eyehubspot');\n $multistore = $request->getParam ('multistore', self::IS_MULTISTORE );\n $maxperpage = $request->getParam('maxperpage', self::MAX_CUSTOMER_PERPAGE);\n $maxAssociated = $request->getParam('maxassoc', self::MAX_ASSOC_PRODUCT_LIMIT);\n $start = date('Y-m-d H:i:s', $request->getParam('start', 0));\n $end = date('Y-m-d H:i:s', time() - 300);\n $websiteId = Mage::app()->getWebsite()->getId();\n $store = Mage::app()->getStore();\n $storeId = Mage::app()->getStore()->getId();\n $collection = Mage::getModel('customer/customer')->getCollection();\n $resource = Mage::getSingleton('core/resource');\n $read = $resource->getConnection('core_read');\n $customerData = array();\n\n try {\n // because of limitations in the log areas of magento, we cannot use the\n // standard collection to retreive the results\n $select = $read->select()\n ->from(array('lc' => $resource->getTableName('log/customer')))\n ->joinInner(\n array('lv' => $resource->getTableName('log/visitor')),\n 'lc.visitor_id = lv.visitor_id'\n )\n ->joinInner(\n array('vi' => $resource->getTableName('log/visitor_info')),\n 'lc.visitor_id = vi.visitor_id'\n )\n ->joinInner(\n array('c' => $resource->getTableName('customer/entity')),\n 'c.entity_id = lc.customer_id',\n array('email' => 'email', 'customer_since' => 'created_at')\n )\n ->joinInner(\n array('p' => $resource->getTableName('log/url_info_table')),\n 'p.url_id = lv.last_url_id',\n array('last_url' => 'p.url', 'last_referer' => 'p.referer')\n )\n ->where('lc.customer_id > 0');\n // only add the filter if website id > 0\n if (!($multistore) && $websiteId) {\n \t$select->where(\"c.website_id = '$websiteId'\");\n }\n $select->where(\"lv.last_visit_at >= '$start'\")\n ->where(\"lv.last_visit_at < '$end'\")\n ->order('lv.last_visit_at')\n ->limit($maxperpage);\n\n $collection = $read->fetchAll($select);\n } catch (Exception $e) {\n $this->_outputError(self::ERROR_CODE_UNSUPPORTED_SQL, 'DB Exception on query', $e);\n return;\n }\n\n foreach ($collection as $assoc) {\n $log = new Varien_Object($assoc);\n $customerId = $log->getCustomerId();\n\n // merge and replace older data with newer\n if (isset($customerData[$customerId])) {\n $temp = $customerData[$customerId];\n $log->addData($temp->getData());\n $log->setFirstVisitAt($temp->getFirstVisitAt());\n } else {\n $log->setViewed($helper->getProductViewedList($customerId, $multistore, $maxAssociated));\n $log->setCompare($helper->getProductCompareList($customerId, $multistore, $maxAssociated));\n $log->setWishlist($helper->getProductWishlist($customerId, $multistore, $maxAssociated));\n }\n\n $log->unsetData('session_id');\n $customerData[$customerId] = $log;\n }\n } catch (Exception $e) {\n $this->_outputError(\n self::ERROR_CODE_UNKNOWN_EXCEPTION,\n 'Unknown exception on request',\n $e\n );\n return;\n }\n\n $this->_outputJson(array(\n 'visitors' => $helper->convertAttributeData($customerData),\n 'website' => $websiteId,\n 'store' => $storeId\n ));\n }", "public function index()\n {\n // Get customerblockassociations\n $customerblockassociations = CustomerBlockAssociation::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of customerblockassociations as a resource\n return CustomerBlockAssociationResource::collection($customerblockassociations);\n }", "public function activity()\n {\n return view('backend.lead.activity');\n }", "public function getBlockGrid()\n {\n if ($this->blockGrid === null) {\n $this->blockGrid = $this->getLayout()->createBlock(\n 'Tigren\\CompanyAccount\\Block\\Adminhtml\\Account\\Edit\\Tab\\CustomerGrid',\n 'account.customers.grid'\n );\n }\n return $this->blockGrid;\n }", "public function customer()\n {\n $curl = new Curl();\n\n self::$headers['Authorization'] = 'Bearer ' . self::getAccessToken();\n\n $data = [];\n\n return $curl->get(Endpoint::BASE_ENDPOINT . Endpoint::CUSTOMER, $data, self::_headers())->getResponse()->getResult();\n }", "public function getCustomer()\n {\n return Mage::getSingleton('customer/session')->getCustomer();\n }", "public function getCustomerSegment()\n {\n $segment = new Varien_Object();\n $segment->setCustomerGroupId(Mage::getSingleton('customer/session')->getCustomerGroupId());\n $segment->setStoreId(Mage::app()->getStore()->getId());\n Mage::dispatchEvent('ecomdev_varnish_customer_segment', array('segment' => $segment));\n \n return $segment->getData();\n }", "private function getAdvertisementBlock() {\n \t$block = null;\n\n $blockId = $this->properties->getWidgetProperty(self::PROPERTY_BLOCK);\n if ($blockId) {\n \t$block = $this->models[AdvertisementBlockModel::NAME]->findById($blockId, 0);\n }\n\n if (!$block) {\n $block = $this->models[AdvertisementBlockModel::NAME]->createData();\n }\n\n return $block;\n }", "protected function _getCurrentCustomer()\n {\n return $this->getCustomer();\n }", "public function getCustomer()\n {\n // TODO: Implement getCustomer() method.\n }", "public function activities(){\n\n $response = Http::withHeaders(self::headers())\n ->get(self::endpoint() . config('alpaca.activities_uri'))\n ->collect();\n\n return $response;\n }", "public function getCustomer()\n {\n if ($this->moduleManager->isEnabled('Magento_PageCache')\n && !$this->request->isAjax()\n && $this->view->isLayoutLoaded()\n && $this->layout->isCacheable()\n ) {\n return $this->getDepersonalizedCustomer();\n } else {\n return $this->getCustomerFromService();\n }\n }", "protected function get_social_block_activity_node($activityname) {\n $activityname = behat_context_helper::escape($activityname);\n $xpath = \"//*[contains(concat(' ',normalize-space(@class),' '),' block_social_activities ')]//li[contains(., $activityname)]\";\n\n return $this->find('xpath', $xpath);\n }", "public function activities() {\n return $this->hasMany(Activity::class, 'causer_id', 'id');\n }", "public function getCustomer()\n {\n return $this->_customerSession->getCustomer();\n }", "public function getInviteCredithistory(){\n /**'\n * Get customer Id\n * @var $customerId\n */\n $customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();\n /**\n * Get parameter limit and page\n * @var $limit\n * @var $page\n */\n $limit = empty($this->getRequest()->getParam('limit')) ? '10' : $this->getRequest()->getParam('limit');\n $page = empty($this->getRequest()->getParam('p')) ? '1' : $this->getRequest()->getParam('p');\n /**\n * Get credited discount amount collection\n *\n * @var $creidtcollection\n */\n $creidtcollection = Mage::getModel('airhotels/invitefriendsorder')->getCollection()->addFieldToFilter('invitee_id', array('eq' => $customerId))->addFieldToFilter('customer_id', array('neq' => 0));\n $creidtcollection->setPageSize($limit) ->setCurPage($page);\n \n return $creidtcollection;\n }", "public function getBlock( $cblock )\n\t{\n\t\t/* Check for config data */\n\t\t$config = unserialize($cblock['cblock_config']);\n\t\t$config['num_latest_visitors'] = $config['num_latest_visitors'] ? $config['num_latest_visitors'] : 5;\n\t\t\n\t\tif( !$config['num_latest_visitors'] && $cblock['member_id'] == $this->memberData['member_id'] )\n\t\t{\n\t\t\treturn $this->getConfigForm( $cblock );\n\t\t}\n\n\t\t$_pp_last_visitors = $this->blog['blog_last_visitors'] ? unserialize($this->blog['blog_last_visitors']) : array();\n\t\t$_visitor_info = array();\n\t\t$_count = 0;\n\n\t\tif( is_array($_pp_last_visitors) )\n\t\t{\n\t\t\tkrsort($_pp_last_visitors);\n\n\t\t\t$_ids = array_values($_pp_last_visitors);\n\t\t\t\n\t\t\tif( is_array($_ids) && count($_ids) )\n\t\t\t{\n\t\t\t\t$_visitor_info = IPSMember::load( $_ids, 'extendedProfile, groups', 'id' );\n\t\t\t\t\n\t\t\t\tforeach( $_visitor_info as $mid => $row )\n\t\t\t\t{\n\t\t\t\t\t$_visitor_info[ $mid ] = IPSMember::buildDisplayData( $row, array( 'reputation' => 0, 'warn' => 0 ) );\n\t\t\t\t}\n\t\t\t\n\t\t\t\tforeach( $_pp_last_visitors as $_time => $_id )\n\t\t\t\t{\n\t\t\t\t\tif ( $_count + 1 > $config['num_latest_visitors'] )\n\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\t\t$_count++;\n\t\t\t\t\n\t\t\t\t\t$_visitor_info[ $_id ]['visited_date'] = $_time;\n\t\n\t\t\t\t\t$visitors[] = $_visitor_info[ $_id ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$return_html = $this->registry->output->getTemplate('blog_cblocks')->cblock_header( $cblock, $this->lang->words['blog_latest_visitors'], $this->configable, true );\n\t\t$return_html .= $this->registry->output->getTemplate('blog_cblocks')->latest_visitors( $visitors );\n\t\t$return_html .= $this->registry->output->getTemplate('blog_cblocks')->cblock_footer( array( 'cblock_id' => $cblock['cblock_id'], 'cblock_type' => '', 'allow_edit' => 0 ) );\n\t\t\n\t\t// Add the new recent visitor\n\t\t\n\t\t// @todo: un-comment and replace this code below once the blog version is compatible with IPB 3.3+ only\n\t\t//if ( ! IPSMember::isLoggedInAnon($this->memberData) )\n\t\t\n\t\t$privacy = explode( '&', $this->memberData['login_anonymous'] );\n\t\t\n\t\tif( ! $privacy[0] )\n\t\t{\n\t\t\t$this->blogAddVisitor( $cblock, $this->memberData['member_id'] );\n\t\t}\n\t\n\t\treturn $return_html;\n\t}", "public static function getCurrentActivities()\n {\n $activity = Activity::where('created_at', '>=', \\Carbon\\Carbon::today())->get();\n\n foreach($activity as $thisActivity) {\n # Create a \"display friendly\" version of the date_from and date_to date to be used in the view\n $thisActivity->date_from_display = \\Carbon\\Carbon::createFromFormat('Y-m-d H:i:s', $thisActivity->date_from)->format('l, m/d/Y H:i');\n $thisActivity->date_to_display = \\Carbon\\Carbon::createFromFormat('Y-m-d H:i:s', $thisActivity->date_to)->format('l, m/d/Y H:i');\n }\n return $activity;\n }", "public function getCustomer()\n {\n return $this->customer;\n }", "public function activity()\n {\n $activity = Transaction::where('user_id', '=', Auth::id())->paginate(10);\n\n return view('pages.activity', compact('activity'));\n }", "public function getCustomer()\n {\n return $this->customer;\n }", "public function getCustomer()\n {\n return $this->customer;\n }", "public function getCustomer()\n {\n return $this->customer;\n }", "public function getCustomer()\n {\n return $this->customer;\n }", "public function getCustomer(){\n return $this->_customer;\n }", "function bcashGetCurrentBlock():BchInfo {\n return ApiRequest::get(Constants::TATUM_API_URL . \"/v3/bcash/info\", [], ['x-api-key' => getenv('TATUM_API_KEY')])->data;\n}", "public function show($id)\n {\n // Get customerblockassociations\n $customerblockassociations = CustomerBlockAssociation::findOrFail($id);\n\n // Return single customerblockassociations as a resource\n return new CustomerBlockAssociationResource($customerblockassociations);\n }", "public function activity_get_activities() {\n $oReturn = new stdClass();\n $this->init('activity', 'see_activity');\n\n if (!bp_has_activities())\n return $this->error('activity');\n if ($this->pages !== 1) {\n $aParams ['max'] = true;\n $aParams ['per_page'] = $this->offset;\n $iPages = $this->pages;\n }\n\n $aParams ['display_comments'] = $this->comments;\n $aParams ['sort'] = $this->sort;\n\n $aParams ['filter'] ['user_id'] = $this->userid;\n $aParams ['filter'] ['object'] = $this->component;\n $aParams ['filter'] ['action'] = $this->type;\n $aParams ['filter'] ['primary_id'] = $this->itemid;\n $aParams ['filter'] ['secondary_id'] = $this->secondaryitemid;\n $iLimit = $this->limit;\n\n if ($this->pages === 1) {\n $aParams ['page'] = 1;\n if ($iLimit != 0)\n $aParams['per_page'] = $iLimit;\n $aTempActivities = bp_activity_get($aParams);\n\n\n if (!empty($aTempActivities['activities'])) {\n foreach ($aTempActivities['activities'] as $oActivity) {\n $oReturn->activities[(int) $oActivity->id]->component = $oActivity->component;\n $oReturn->activities[(int) $oActivity->id]->user[(int) $oActivity->user_id]->username = $oActivity->user_login;\n $oReturn->activities[(int) $oActivity->id]->user[(int) $oActivity->user_id]->mail = $oActivity->user_email;\n $oReturn->activities[(int) $oActivity->id]->user[(int) $oActivity->user_id]->display_name = $oActivity->display_name;\n $oReturn->activities[(int) $oActivity->id]->type = $oActivity->type;\n $oReturn->activities[(int) $oActivity->id]->time = $oActivity->date_recorded;\n $oReturn->activities[(int) $oActivity->id]->is_hidden = $oActivity->hide_sitewide === \"0\" ? false : true;\n $oReturn->activities[(int) $oActivity->id]->is_spam = $oActivity->is_spam === \"0\" ? false : true;\n }\n $oReturn->count = count($aTempActivities['activities']);\n } else {\n return $this->error('activity');\n }\n return $oReturn;\n }\n\n for ($i = 1; $i <= $iPages; $i++) {\n if ($iLimit != 0 && ($i * $aParams['per_page']) > $iLimit) {\n $aParams['per_page'] = $aParams['per_page'] - (($i * $aParams['per_page']) - $iLimit);\n $bLastRun = true;\n }\n $aParams ['page'] = $i;\n $aTempActivities = bp_activity_get($aParams);\n if (empty($aTempActivities['activities'])) {\n if ($i == 1)\n return $this->error('activity');\n else\n break;\n }\n else {\n foreach ($aTempActivities['activities'] as $oActivity) {\n $oReturn->activities[(int) $oActivity->id]->component = $oActivity->component;\n $oReturn->activities[(int) $oActivity->id]->user[(int) $oActivity->user_id]->username = $oActivity->user_login;\n $oReturn->activities[(int) $oActivity->id]->user[(int) $oActivity->user_id]->mail = $oActivity->user_email;\n $oReturn->activities[(int) $oActivity->id]->user[(int) $oActivity->user_id]->display_name = $oActivity->display_name;\n $oReturn->activities[(int) $oActivity->id]->type = $oActivity->type;\n $oReturn->activities[(int) $oActivity->id]->time = $oActivity->date_recorded;\n $oReturn->activities[(int) $oActivity->id]->is_hidden = $oActivity->hide_sitewide === \"0\" ? false : true;\n $oReturn->activities[(int) $oActivity->id]->is_spam = $oActivity->is_spam === \"0\" ? false : true;\n }\n $oReturn->count = count($aTempActivities['activities']);\n if ($bLastRun)\n break;\n }\n }\n\n return $oReturn;\n }", "public function getCmsBlock()\n {\n $helper = Mage::helper('paybyfinance');\n switch ($this->_type) {\n case 'accepted':\n $id = Mage::getStoreConfig($helper::XML_PATH_BLOCK_ACCEPTED);\n break;\n case 'referred':\n $id = Mage::getStoreConfig($helper::XML_PATH_BLOCK_REFERRED);\n break;\n case 'declined':\n $id = Mage::getStoreConfig($helper::XML_PATH_BLOCK_DECLINED);\n break;\n case 'abandoned':\n $id = Mage::getStoreConfig($helper::XML_PATH_BLOCK_ABANDONED);\n break;\n case 'error':\n $id = Mage::getStoreConfig($helper::XML_PATH_BLOCK_ERROR);\n break;\n default:\n throw new Exception(\"Undefined status block type.\", 1);\n }\n\n $block = Mage::getModel('cms/block')->load($id);\n $this->_order = $helper->getOrder($this->getRequest()->getParams());\n $helper = Mage::helper('cms');\n $processor = $helper->getBlockTemplateProcessor();\n $processor->setVariables(\n array(\n 'order_id' => $this->getOrderIdText(),\n 'phone' => Mage::getStoreConfig('general/store_information/phone')\n )\n );\n $html = $processor->filter($block->getContent());\n\n return $html;\n }", "protected function getCustomerFromParentBlock()\n {\n $parentBlock = $this->getParentBlock();\n if($parentBlock && $parentBlock instanceof PersonalInfo)\n {\n return $parentBlock->getCustomer();\n }\n return false;\n }" ]
[ "0.60864556", "0.56332517", "0.5397756", "0.53579706", "0.53563625", "0.5332563", "0.5328629", "0.5306863", "0.52852607", "0.52689767", "0.52568215", "0.5254112", "0.5220492", "0.521404", "0.52027243", "0.5198497", "0.51980513", "0.51923066", "0.5187331", "0.51726717", "0.51717347", "0.51717347", "0.51717347", "0.51717347", "0.5169321", "0.5159124", "0.51566076", "0.51485795", "0.5130047", "0.51033175" ]
0.78947425
0
Select wish list in Wish list dropdown.
public function selectWishlist($name) { $this->_rootElement->find($this->wishlist, Locator::SELECTOR_CSS, 'select')->setValue($name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set_wish_list( $wishlist_list = [] ) {\n\n\t\t\t$save_for_logged_user = filter_var( jet_cw()->settings->get( 'save_user_wish_list' ), FILTER_VALIDATE_BOOLEAN );\n\t\t\t$value = implode( ':', $wishlist_list );\n\t\t\t$_SESSION['jet-wish-list'] = $value;\n\n\t\t\tif ( is_user_logged_in() && $save_for_logged_user ) {\n\t\t\t\tupdate_user_meta( get_current_user_id(), 'jet_wish_list', $value );\n\t\t\t}\n\n\t\t}", "function setWishListItem( $wishlist )\r\n {\r\n if ( is_a( $wishlist, \"eZWishListItem\" ) )\r\n {\r\n $this->WishListItemID = $wishlist->id();\r\n }\r\n }", "public function wishlist() {\n $this->load->model('Item_model', 'Item', TRUE);\n $this->load->model('Category_model', 'Category', TRUE);\n \n $data = array(\n 'title' => 'Ma wishlist',\n 'active' => 'wishlist',\n 'css' => array(\n 'listItem.css',\n 'user/index.css'\n ),\n 'categories' => $this->Category->getCategory(),\n 'subcategories' => $this->Category->getCategory('sub'),\n 'js' => array(\n 'listItem.js'\n ),\n 'items' => $this->Item->getWishlist(array(\n 'where' => array(\n 'W.user_id' => $this->session->user['id']\n )\n ))\n );\n \n $this->load->view('template/header', $data);\n $this->load->view('user/index', $data);\n $this->load->view('template/footer', $data);\n }", "public function show(Wishlist $wishlist)\n {\n\n }", "public function getCurrentWishlist(): WishlistInterface;", "public function actionWish()\n {\n\n if (is_guest()) {\n return $this->userNotFoundError();\n }\n\n $id = Yii::$app->request->get('id');\n $result = [\n 'success' => false,\n 'action' => 'no-action',\n 'message' => false\n ];\n\n if ($id == null) {\n return $result;\n }\n\n $user = Yii::$app->user->identity;\n\n if (!$user->isWish($id)) {\n if ($user->addToWishList($id)) {\n $result['success'] = true;\n $result['action'] = 'added';\n $result['message'] = t('Added to wishlist');\n }\n } else {\n if ($user->removeFromWishList($id)) {\n $result['success'] = true;\n $result['action'] = 'removed';\n $result['message'] = t('Removed from wishlist');\n }\n }\n\n return $result;\n }", "public function wishList()\n {\n return $this->belongsTo('App\\WishList');\n }", "public function show(Wishlist $wishlist)\n {\n //\n }", "public function show(Wishlist $wishlist)\n {\n //\n }", "public function checkWishList(){\n\t\tif($this->request->is('post')){\n\t\t$response=array();\n\t\t$postData = $this->request->input('json_decode',true);\n\t\t$clientId=$postData['clientId'];\n\t\t$data = $this->Wishlist->find('list',array('conditions'=>array('client_id'=>$clientId)));\n\t\tif(count($data)>0){\n\t\t\t$response=$data;\n\t\t}\n\t\t$this->set(\n\t\t\t\tarray(\n\t\t\t\t\t'_serialize',\n\t\t\t\t\t'data' => array('checkListProducts'=>$response),\n\t\t\t\t\t'_jsonp' => true\n\t\t\t\t)\n\t\t\t);\n\t\t}else{\n\t\t\t$this->set(\n\t\t\t\tarray(\n\t\t\t\t\t'_serialize',\n\t\t\t\t\t'data' => array('checkListProducts'=>'Invalid Request'),\n\t\t\t\t\t'_jsonp' => true\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\t$this->render('data_layout');\n\t}", "public function get_wish_list() {\n\n\t\t\t$wishlist_list = ! empty( $_SESSION['jet-wish-list'] ) ? $_SESSION['jet-wish-list'] : '';\n\t\t\t$save_for_logged_user = filter_var( jet_cw()->settings->get( 'save_user_wish_list' ), FILTER_VALIDATE_BOOLEAN );\n\n\t\t\tif ( is_user_logged_in() && $save_for_logged_user ) {\n\t\t\t\t$wishlist_list = get_user_meta( get_current_user_id(), 'jet_wish_list', true );\n\t\t\t}\n\n\t\t\tif ( ! empty( $wishlist_list ) ) {\n\t\t\t\t$wishlist_list = explode( ':', $wishlist_list );\n\t\t\t} else {\n\t\t\t\t$wishlist_list = array();\n\t\t\t}\n\n\t\t\tforeach ( $wishlist_list as $key => $value ) {\n\t\t\t\t$product = get_post( $value );\n\n\t\t\t\tif ( ! empty( $product ) && 'publish' !== get_post_status( $product ) ) {\n\t\t\t\t\tarray_splice( $wishlist_list, $key, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $wishlist_list;\n\n\t\t}", "function bibdk_reservation_favourite_selector() {\n $fav_options = bibdk_reservation_get_favourites_for_selector();\n // data check\n if (empty($fav_options)) {\n return;\n }\n\n $options[0] = t('Select another favourite library');\n $options += $fav_options;\n\n return array(\n '#type' => 'select',\n '#options' => $options,\n '#default_value' => 0,\n '#attributes' => array('class' => array(drupal_html_class('reservation_favourite_selector'))),\n );\n}", "public function wishlist()\n {\n return $this->belongsTo(Wishlist::class);\n }", "public function getWishListID() {\n //return the value wish list id\n return $this->WishListID;\n }", "public function getWishlistsByUser();", "public function myWishList()\n {\n $data = array();\n $data['page5'] = $this->PagesModel->get(19); \n $data['categories'] = $this->CategoriesModel->getParentCategory();\n\n $data['categoriesMenu'] = $this->CategoriesModel->getParentCategoryMenu();\n foreach ($data['categoriesMenu'] as $key => $value) {\n $child_category = $this->CategoriesModel->getChildCategories($value['id']);\n $data['categoriesMenu'][$key]['child'] = $child_category;\n }\n $user = $this->session->userdata('user');\n $this->load->model('UserWishListModel');\n\n $data[\"user_wishlist\"] = $this->UserWishListModel->getUserWishList($user->id);\n\n //print_r(json_encode($data[\"user_wishlist\"]));exit();\n\n $this->load->template('profile/my-wishlist',$data);\n }", "public function addToWishlist($wishlist_id) {\n\t\tEngine_Api::_()->getDbTable('wishlistlistings', 'ynmultilisting')->addListingToWishlist($this->getIdentity(), $wishlist_id);\n\t}", "protected function _getWishlist()\n {\n if (!Mage::helper('cminds_multiwishlist')->isEnabled()) {\n return parent::_getWishlist();\n }\n\n $wishlistId = Mage::registry('wishlist_id');\n $wishlist = Mage::getModel('cminds_multiwishlist/multiwishlist')->load($wishlistId);\n\n return $wishlist;\n }", "function www_update() {\n\tupdate_option( '_wolf_wishlist_needs_page', true );\n\tupdate_option( '_wolf_wishlist_page_id', get_option( '_wolf_woocommerce_wishlist_page_id' ) );\n}", "public function actionGetwishlistproduct() {\r\n if (isset(Yii::$app->user->identity->id)) {\r\n if (isset(Yii::$app->session['temp_wish_list'])) {\r\n $models = WishList::find()->where(['session_id' => Yii::$app->session['temp_wish_list']])->all();\r\n\r\n foreach ($models as $msd) {\r\n $data = WishList::find()->where(['product' => $msd->product, 'user_id' => Yii::$app->user->identity->id])->one();\r\n if (empty($data)) {\r\n $msd->user_id = Yii::$app->user->identity->id;\r\n $msd->session_id = '';\r\n $msd->save();\r\n } else {\r\n $data->date = $msd->date;\r\n if ($data->save()) {\r\n $msd->delete();\r\n }\r\n }\r\n }\r\n unset(Yii::$app->session['temp_wish_list']);\r\n }\r\n }\r\n }", "public function showWishlist(Request $request,$id){\n\t\t$UserId=base64_decode($id);\n\t $homeTitle = 'Wish List';\n\t\t$wishList = DB::table('sb_product')\n\t\t\t->select('sb_product.*','sb_product.status as productStatus','sb_product.name as productName','sb_customer_wishlist.*')\n\t\t\t->leftJoin('sb_customer_wishlist', 'sb_customer_wishlist.product_id', '=', 'sb_product.product_id')->where('user_id',$UserId)->get(); \n\t\treturn view('admin.customers.wishlist',array('homeTitle'=>$homeTitle,'wishList'=>$wishList,'params'=>$request))\n\t\t->with('i', ($request->input('page', 1) - 1) * env('RECORD_PER_PAGE')); \n }", "private function has_wishlist() {\n\t\treturn $this->get_current_user_wishlist();\n\t}", "public function toggleWishlistAndcCart()\n {\n if ($this->request->exists('post')) {\n $data = $this->request->get();\n if ($data['csrftoken'] && $this->token->validateToken($data['csrftoken'], $data['frm_name'])) {\n $table = str_replace(' ', '', ucwords(str_replace('_', ' ', $data['table'])));\n $model = $this->container->make($table . 'Manager'::class);\n $model->assign($data);\n $method = isset($data['method']) ? $data['method'] : '';\n if ($output = $model->manage_user_cart($method)) {\n $this->jsonResponse(['result' => 'success', 'msg' => $output]);\n } else {\n $this->jsonResponse(['result' => 'error', 'msg' => '']);\n }\n }\n }\n }", "public function productWishlist()\n {\n return $this->hasOne(ProductWishList::class, 'products_id')\n ->select('_id as wishlistId', 'products_id', 'users_id as addWishlistUserId');\n }", "public function index()\n {\n $client_id = Session::get('CLIENT_ID');\n $wishlists = Wishlist::where('client_id', $client_id)->orderByDesc('created_at')->get();\n return view('client.account.wishlist', compact('wishlists'));\n }", "function addTowishlist($proID){\n $product = $this->Home_model->getRows($proID);\n $product_id = $product->id;\n $user_id = $this->session->userdata('user_id');\n if($user_id){\n $this->Home_model->addToWishList($user_id,$product_id);\n redirect('wishlist/');\n }else{\n redirect('login');\n }\n }", "public function wishlist()\n {\n $products = $this->productModel->paginate(config('product.paginate8'));\n return view('my-directory.wishlist-ms', ['products' => $products]);\n\n\n }", "function getUserWishlists($user_id) {\n $result = DB::table('wihslists')->where('user_id', '==', $user_id)->get();\n return $result;\n }", "public function wishlists()\n {\n return $this->hasMany('App\\Wishlist');\n }", "public function wishlist()\n {\n return $this->hasMany('App\\Wishlist');\n }" ]
[ "0.6423323", "0.62911046", "0.61965793", "0.5875442", "0.5837929", "0.58343065", "0.57973427", "0.57766646", "0.57766646", "0.57357484", "0.5695515", "0.56946886", "0.5671896", "0.56264555", "0.55788577", "0.5501981", "0.54842705", "0.5448765", "0.54155725", "0.53841543", "0.533273", "0.5321137", "0.5318045", "0.53037745", "0.52925396", "0.52558386", "0.5245804", "0.52403736", "0.5232085", "0.52315456" ]
0.7152175
0
Select item to add to order.
public function selectItemToAddToOrder(InjectableFixture $product, $qty) { $configureIcon = $this->_rootElement->find( sprintf($this->addToOrderGrouped, $product->getName()), Locator::SELECTOR_XPATH )->isVisible(); $productCheckoutData = $product->getData('checkout_data'); if (isset($productCheckoutData['options']) && $configureIcon) { $this->_rootElement->find( sprintf($this->addToOrderGrouped, $product->getName()), Locator::SELECTOR_XPATH )->click(); $this->getConfigureBlock()->clickOk(); } else { $checkBox = $this->_rootElement->find( sprintf($this->addToOrder, $product->getName(), $qty, $product->getCheckoutData()['cartItem']['price']), Locator::SELECTOR_XPATH, 'checkbox' ); $checkBox->click(); $this->_rootElement->click(); $checkBox->setValue('Yes'); $this->getCustomerActivitiesBlock()->updateChanges(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add($id,$item,$qty,$option=null);", "function add($order_num, $item) {\n $this->Orders->add_item($order_num, $item);\n redirect('/order/display_menu/' . $order_num);\n }", "public function testAddToBasketAddingArticleWithSelectlist()\n {\n $oBasket = new oxbasket();\n $oBasketItem = $oBasket->addToBasket( $this->oArticle->getId(), 10, array('0'), null, false, true );\n $oBasketItem = $oBasket->addToBasket( $this->oArticle->getId(), 10, null, null, false, true );\n $this->assertEquals( 20, $oBasketItem->getAmount() );\n $this->assertEquals( 200, $oBasketItem->getWeight() );\n $this->assertEquals( $this->oArticle->getId(), $oBasketItem->getProductId() );\n }", "function add($order_num, $item) {\n //FIXME\n\t\t//add an item\n\t\t$this->orders->add_item($order_num, $item);\n\t\t\n\t\t//update the price\n\t\t$this->orders->total($order_num);\n\t\t\n redirect('/order/display_menu/' . $order_num);\n }", "public function onAdd(OrderItemEvent $event)\n {\n $order = $event->getOrder();\n $item = $event->getItem();\n\n $order->addItem($item);\n }", "public function addItem();", "abstract protected function handleSelected();", "public function addItem(CanBeOrdered $item) : OrderItem;", "function add_select($select)\r\n {\r\n if (!is_object($select))\r\n die(\"invalid argument in add_select()\");\r\n\r\n $this->element[$this->number_of_elements] = $select;\r\n\r\n $this->number_of_elements++;\r\n }", "public function setSelected($data) {$this->_selected = $data; }", "public function setItem()\n {\n //conditional checks by taking advantage of polymorphism\n $this->setAllBasics();\n $this->setParams();\n\n $addQuery = 'INSERT INTO items(sku, name, price, type, height, width, length) VALUES (:sku,:name,:price, :type,:height, :width, :length)';\n $query = $this->pdo->prepare($addQuery);\n $query->bindValue(':sku', $this->getSKU());\n $query->bindValue(':name', $this->getName());\n $query->bindValue(':price', $this->getPrice());\n $query->bindValue(':type', $this->getType());\n $query->bindValue(':height', $this->getHeight());\n $query->bindValue(':width', $this->getWidth());\n $query->bindValue(':length', $this->getLength());\n\n $query->execute();\n }", "function getItem($id, $order=1) {\n $item = $this->items[$id];\n $item[\"pedido\"] = $order;\n return $item;\n }", "function onAfterSetSelection($selection, $prevSelection, $cartPositionId) {\n\n\t}", "public function addItemAction(){\n $this->isEnabled();\n if($this->prDispatch()){\n $this->_redirect('*/index/');\n return;\n }\n if($this->_getHelper()->checkIsValidList()){\n Mage::getSingleton('core/session')->addError('Você não possui listas criadas, crie uma lista');\n $this->_redirect('*/index/', array('login'=>1));\n return;\n }\n \n $productId = $this->getRequest()->getParam('id');\n if(!empty($productId)){\n Mage::getModel('jbp_giftlist/item')->saveData($productId);\n $this->_redirectUrl(Mage::getSingleton('core/session')->getLastUrl());\n return;\n }\n $this->_redirect('/');\n }", "public function selected()\n {\n parent::selected();\n $this->name = '';\n }", "function add_item($num, $code) {\n $CI = &get_instance();\n \n // If an item of the given type already is already ordered, update it's quantity.\n if ($CI->orderitems->exists($num, $code)) {\n $record = $CI->orderitems->get($num, $code);\n $record->quantity++;\n $CI->orderitems->update($record);\n }\n // If no item of the given type is already ordered, add a new one to the order.\n else {\n $record = $CI->orderitems->create();\n $record->order = $num;\n $record->item = $code;\n $record->quantity = 1;\n $CI->orderitems->add($record);\n }\n }", "public function add_choice() {\n\t\t\techo prince_choices_view( esc_attr( $_REQUEST['name'] ), esc_attr( $_REQUEST['count'] ) );\n\t\t\tdie();\n\t\t}", "function add_item($num, $code) {\n \n\t\t// if the order exists...\n\t\tif($this->exists($num))\n\t\t{\n\t\t\t// if the item exists in this order, increment the quantity!\n\t\t\tif($this->orderitems->exists($num, $code))\n\t\t\t{\n\t\t\t\t$orderItem = $this->orderitems->get($num, $code);\n\t\t\t\t$qty = $orderItem->quantity;\n\t\t\t\t\n\t\t\t\t$qty++;\n\t\t\t\t$orderItem->quantity = $qty;\n\t\t\t\t\n\t\t\t\t$this->orderitems->update($orderItem);\n\t\t\t}\n\t\t\telse // otherwise, insert a record\n\t\t\t{\n\t\t\t\t$orderItem = $this->orderitems->create();\n\t\t\t\t$orderItem->order = $num;\n\t\t\t\t$orderItem->item = $code;\n\t\t\t\t$orderItem->quantity = 1;\n\t\t\t\t\n\t\t\t\t$this->orderitems->add($orderItem);\n\t\t\t}\n\t\t}\n }", "public function selectItem()\n {\n $items = array();\n\n // trim items from options:\n foreach ($this->items_map as $key => $item) {\n if ($this->min_sell_value > $item->sell_value || $this->max_sell_value < $item->sell_value) {\n continue;\n }\n\n if ($this->min_level > $item->level || $this->max_level < $item->level) {\n continue;\n }\n\n $items[$key] = $item;\n }\n\n if ($this->modifier == self::CALC_MOD_LEVEL) {\n $this->odds_table = $this->generateOddsForLevelMods($items, $this->modifier_level);\n } elseif ($this->modifier == self::CALC_MOD_MONEY) {\n $this->odds_table = $this->generateOddsForMoneyMods($items);\n } else {\n $this->odds_table = $this->generateOddsForEvenMods($items);\n }\n\n // adjust odds map to create relative percentages:\n $total = array_sum($this->odds_table);\n $this->odds_table = array_map(function($n) use($total) {\n return $n / $total;\n }, $this->odds_table);\n\n asort($this->odds_table);\n $this->odds_table = array_reverse($this->odds_table);\n\n if (count($this->odds_table) > 0) {\n return $this->choose($this->odds_table);\n }\n }", "public function add()\n {\n $this->jsonHeader();\n $adminId = (int)$_GET['adminId'];\n if ($adminId) {\n define('IN_ADMIN', 1);\n $_COOKIE['classified_session'] = $_COOKIE['admin_classified_session'];\n }\n\n $session = geoSession::getInstance();\n $session->initSession();\n\n $cart = geoCart::getInstance();\n //start up the cart\n $userId = ($adminId) ? (int)$_GET['userId'] : null;\n $cart->init(true, $userId);\n\n if (!$this->_validateCartStep()) {\n //invalid it seems?\n return;\n }\n\n $fields = geoFields::getInstance($cart->user_data['group_id'], $cart->item->getCategory());\n\n if (!$fields->cost_options->is_enabled) {\n //failsafe\n return;\n }\n\n //data to be returned\n $data = array();\n\n $tpl_vars = $cart->getCommonTemplateVars();\n\n $tpl_vars['new'] = true;\n\n //add new always starts off as none\n $tpl_vars['quantity_type'] = 'none';\n\n $tpl_vars['maxImages'] = $this->maxImages;\n\n $template = new geoTemplate(geoTemplate::SYSTEM, 'order_items');\n $template->assign($tpl_vars);\n\n $data['dialog'] = $template->fetch('shared/cost_options/edit.tpl');\n $data['dialog_title'] = $this->messages[502215];\n\n echo $this->encodeJSON($data);\n }", "protected function addItem() {\n\n }", "public function setSelected() {\r\n\t\t$this->click(); //setSelected is now deprecated\r\n\t}", "public function selectItemTypeSelectd()\n {\n \n $itemTypeIds = !empty($_GET['itemTypeIds']) ? $_GET['itemTypeIds'] : '';\n \n\n if (!empty($itemTypeIds)) {\n\n $getItemTypeIdData = DB::select('SELECT * FROM item_type_master WHERE is_deleted_status = \"N\"');\n\n if (!empty($getItemTypeIdData)) {\n\n foreach ($getItemTypeIdData as $itemType) {\n\n $itemTpyeListHtml = '<option value=\"'.$itemType->id.'\"';\n \n if ($itemTypeIds == $itemType->id) { \n\n $itemTpyeListHtml .= ' selected=\"selected\"';\n\n }\n\n $itemTpyeListHtml .= '>'.$itemType->name.'</option>';\n\n echo $itemTpyeListHtml; \n\n }\n\n }\n }\n }", "public function addItem($item);", "public function SelectItem(core\\AModel $model)\r\n {\r\n $this->init();\r\n \r\n $this->_sp = \"sp_selGabineteItems\";\r\n $this->_params = array(\r\n ':idPedido' => (int)$model->_idPedido,\r\n );\r\n \r\n //var_dump($this->_sp, $this->_params);\r\n \r\n return Database::getInstance()->DoQuery($this->_sp, $this->_params);\r\n }", "public function setCompleteItem() {\n\t\t$rawItems = Item::$rawItems;\n\t\tif (isset($rawItems[$this->idItem]['amount'])) {\n\t\t\t$this->amount = ($rawItems[$this->idItem]['amount']);\n\t\t}\n\t\tif (isset($rawItems[$this->idItem]['name'])) {\n\t\t\t$this->name = ($rawItems[$this->idItem]['name']);\n\t\t}\n\t\tif (isset($rawItems[$this->idItem]['price'])) {\n\t\t\t$this->price = ($rawItems[$this->idItem]['price']);\n\t\t}\n\t}", "public function add( $item );", "function pod_add_option_to_order_items($item, $cart_item_key, $values, $order) {\n\tif (empty($values['option-product'])) {\n\t\treturn;\n\t}\n\n\t$item->add_meta_data(__('Gicléeprint op', 'iconic'), $values['option-product']);\n\t$item->add_meta_data(__('Formaat', 'iconic2'), $values['option-formaat']);\n\tif($values['option-lijst'] != \"\") {\n\t\t$item->add_meta_data(__('Lijst', 'iconic3'), $values['option-lijst']);\n\t}\n}", "abstract function addChoice(ChoiceProperty $choice);", "public function testAddOrderItem() {\n $cart = $this->cartProvider->createCart('default', $this->store, $this->user);\n\n $order_item = OrderItem::create([\n 'type' => 'default',\n 'quantity' => 2,\n 'unit_price' => new Price('12.00', 'USD'),\n ]);\n $order_item->save();\n $this->cartManager->addOrderItem($cart, $order_item);\n $this->assertEquals(1, count($cart->getItems()));\n }" ]
[ "0.5894428", "0.58642024", "0.57113165", "0.56312805", "0.5627853", "0.5562129", "0.5494275", "0.54817164", "0.5400127", "0.5316034", "0.53104293", "0.5274518", "0.52677333", "0.5264836", "0.5262266", "0.5259954", "0.5259654", "0.5230328", "0.5202011", "0.51980776", "0.5195795", "0.5182176", "0.5156101", "0.5148425", "0.5121627", "0.5116579", "0.51087505", "0.5074685", "0.50689715", "0.50679" ]
0.5890483
1
WooCommerce Product Support Widgets.
function wds_wcps_register_widgets() { register_widget( 'Woo_User_Product_Support_Forum_List' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function understrap_woocommerce_support() {\n\t\tadd_theme_support( 'woocommerce' );\n\n\t\t// Add New Woocommerce 3.0.0 Product Gallery support\n\t\tadd_theme_support( 'wc-product-gallery-lightbox' );\n\t\tadd_theme_support( 'wc-product-gallery-zoom' );\n\t\tadd_theme_support( 'wc-product-gallery-slider' );\n\n\t\t// hook in and customizer form fields.\n\t\tadd_filter( 'woocommerce_form_field_args', 'understrap_wc_form_field_args', 10, 3 );\n\t}", "function jsquare_products_showcase_widget() {\n\tregister_widget( 'jsquare_products_showcase' );\n}", "function woosupport(){\n\t//woocommerce support\n\tadd_theme_support( 'woocommerce', array(\n\t\t'thumbnail_image_width' => 700,\n\t\t'single_image_width'\t=> 700,\n\t\t'product_grid' \t\t\t=> array(\n\t\t\t'default_rows' => 10,\n\t\t\t'min_rows' => 5,\n\t\t\t'max_rows' => 10,\n\t\t\t'default_columns' => 4,\n\t\t\t'min_columns' => 4,\n\t\t\t'max_columns' => 4,\t\t\t\t\n\t\t)\n\t) );\n\tadd_theme_support( 'wc-product-gallery-zoom' );\n\tadd_theme_support( 'wc-product-gallery-lightbox' );\n\tadd_theme_support( 'wc-product-gallery-slider' );\n\n\tif ( ! isset( $content_width ) ) {\n\t\t$content_width = 600;\n\t}\n}", "function widget( $args, $instance ) {\n\textract( $args );\n\n\t/* Our variables from the widget settings. */\n\t$title = apply_filters('widget_title', $instance['title'] );\n\t$tags = (!empty($instance['tags'])) ? $instance['tags'] : '';\n\t$post_type = (!empty($instance['post_type'])) ? $instance['post_type'] : '';\t\n\t$number = (int)$instance['number'];\n\tglobal $post;\n\t\n\tif ($post_type){\n\t\t$query = array('posts_per_page' => $number, 'post_type' => 'product', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'no_found_rows'=>1);\n\t\t$query['meta_query']=array(array('key' => '_featured', 'value' => 'yes'));\n\t\tif ($tags){\n\t\t\t$query['tax_query'] = array(array('taxonomy' => 'product_tag', 'terms' => $tag, 'field' => 'term_slug'));\t\t\t\n\t\t}\t \t\t\n\t}\n\telse{\n\t\t$query = array('posts_per_page' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'tag' => $tags, 'no_found_rows'=>1);\n\t}\n\t$loop = new WP_Query($query);\n\t\n\t/* Before widget (defined by themes). */\n\techo $before_widget;\n\n\tif ($loop->have_posts()) :\n\n\t/* Display the widget title if one was input (before and after defined by themes). */\n\tif ( $title )\n\t\techo '<div class=\"title\">' . $title . '</div>';\n\t?>\n\t\t<?php wp_enqueue_script('flexslider'); ?>\n\t\t<div class=\"slides\">\t\t\n\t\t<?php while ($loop->have_posts()) : $loop->the_post(); ?>\t\n\t\t\t<div class=\"slide\">\n\t\t\t\t<?php if($post_type):?>\n\t\t\t\t\t<?php global $post, $product;?>\n\t\t\t\t\t<div class=\"wrap woo_feat_slider woocommerce text-center mt15\">\n\t\t\t\t\t\t<?php $wootarget = ($product->product_type =='external') ? ' target=\"_blank\" rel=\"nofollow\"' : '' ;?>\n\t\t\t\t\t\t<?php $woolink = ($product->product_type =='external') ? $product->add_to_cart_url() : get_post_permalink($post->ID) ;?>\n\t\t\t\t\t <figure class=\"centered_image_woo\">\n\t\t\t\t\t <a href=\"<?php echo $woolink ;?>\"<?php echo $wootarget ;?>>\n\t\t\t\t\t <?php if ( $product->is_featured() ) : ?>\n\t\t\t\t\t <?php echo apply_filters( 'woocommerce_featured_flash', '<span class=\"onfeatured\">' . __( 'Featured!', 'rehub_framework' ) . '</span>', $post, $product ); ?>\n\t\t\t\t\t <?php endif; ?> \n\t\t\t\t\t <?php if ( $product->is_on_sale() ) : ?>\n\t\t\t\t\t <?php \n\t\t\t\t\t $percentage=0;\n\t\t\t\t\t $featured = ($product->is_featured()) ? ' onsalefeatured' : '';\n\t\t\t\t\t if ($product->regular_price) {\n\t\t\t\t\t $percentage = round( ( ( $product->regular_price - $product->sale_price ) / $product->regular_price ) * 100 );\n\t\t\t\t\t }\n\t\t\t\t\t if ($percentage && $percentage>0 && !$product->is_type( 'variable' )) {\n \t\t\t\t\t\t\t\t$sales_html = apply_filters( 'woocommerce_sale_flash', '<span class=\"onsale'.$featured.'\"><span>- ' . $percentage . '%</span></span>', $post, $product );\n\t\t\t\t\t } else {\n\t\t\t\t\t $sales_html = apply_filters( 'woocommerce_sale_flash', '<span class=\"onsale'.$featured.'\">' . esc_html__( 'Sale!', 'rehub_framework' ) . '</span>', $post, $product );\n\t\t\t\t\t }\n\t\t\t\t\t ?>\n\t\t\t\t\t <?php echo $sales_html; ?>\n\t\t\t\t\t <?php endif; ?>\n\t\t\t\t\t <?php \n\t\t\t\t\t $showimg = new WPSM_image_resizer();\n\t\t\t\t\t $showimg->use_thumb = true; \n\t\t\t\t\t $showimg->no_thumb = rehub_woocommerce_placeholder_img_src(''); \n\t\t\t\t\t ?>\n\t\t\t\t\t <?php $showimg->width = '300';?>\n\t\t\t\t\t <?php $showimg->height = '300';?> \n\t\t\t\t\t <?php $showimg->show_resized_image(); ?>\n\t\t\t\t\t </a> \n\t\t\t\t\t </figure>\n\t\t\t\t\t <div class=\"woo_loop_desc\"> \n\t\t\t\t\t <a <?php if(rehub_option('woo_thumb_enable') =='1') :?>class=\"<?php echo getHotIconclass($post->ID); ?>\"<?php endif ;?> href=\"<?php echo $woolink ;?>\"<?php echo $wootarget ;?>>\n\t\t\t\t\t <?php echo rh_expired_or_not($post->ID, 'span');?> \n\t\t\t\t\t <?php \n\t\t\t\t\t /**\n\t\t\t\t\t * woocommerce_shop_loop_item_title hook.\n\t\t\t\t\t *\n\t\t\t\t\t * @hooked woocommerce_template_loop_product_title - 10\n\t\t\t\t\t */ \n\t\t\t\t\t do_action( 'woocommerce_shop_loop_item_title' ); \n\t\t\t\t\t ?>\n\t\t\t\t\t </a>\n\t\t\t\t\t <?php do_action( 'rehub_vendor_show_action' ); ?> \n\t\t\t\t\t </div>\n\t\t\t\t <div class=\"woo_spec_price\">\n\t\t\t\t\t\t\t<?php wc_get_template( 'loop/price.php' ); ?>\n\t\t\t\t </div>\t\t\t\t\t\t\t\n\t\t\t\t\t</div>\t\n\t\t\t\t<?php else:?>\n\t\t\t\t\t<div class=\"wrap rehub-main-font\">\n\t\t\t\t\t\t<a href=\"<?php the_permalink();?>\" class=\"view-link\">\n\t\t\t\t\t\t\t<span class=\"pattern\"></span>\n\t\t\t\t\t\t\t<div class=\"image\"><?php wpsm_thumb ('grid_news') ?></div>\n\t\t\t\t\t\t\t<?php if(vp_metabox('rehub_post.rehub_framework_post_type') == 'review') :?><span class=\"score\"><i><?php echo rehub_get_overall_score() ?></i><?php _e('SCORE', 'rehub_framework'); ?></span><?php endif;?>\n\t\t\t\t\t\t\t<?php $category = get_the_category($post->ID); $first_cat = $category[0]->term_id; $cat_name = get_cat_name($first_cat);?>\n\t\t\t\t\t\t\t<span class=\"reviews\"><?php echo $cat_name ;?></span>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<h3 class=\"link\"><a class=\"rehub-main-color\" href=\"<?php the_permalink();?>\"><?php the_title();?></a></h3>\n\t\t\t\t\t\t<p><?php kama_excerpt('maxchar=100'); ?></p>\n\t\t\t\t\t</div>\t\t\t\t\n\t\t\t\t<?php endif;?>\n </div>\t\n\t\t<?php endwhile; ?>\n\t\t</div>\n\t\t<?php wp_reset_query(); ?>\n\t\t<?php else: ?><?php _e('No posts for this criteria.', 'rehub_framework'); ?>\n\t\t<?php endif; ?>\n\t\t\t\n\t<?php\n\n\t/* After widget (defined by themes). */\n\techo $after_widget;\n}", "function Cooken_add_woocommerce_support() {\n add_theme_support( 'woocommerce', array(\n 'thumbnail_image_width' => 255,\n 'single_image_width' => 255,\n 'product_grid' => array(\n 'default_rows' => 3,\n 'min_rows' => 2,\n 'max_rows' => 8,\n 'default_columns' => 4,\n 'min_columns' => 2,\n 'max_columns' => 5,\n ),\n\n ) ); \n add_theme_support( 'wc-product-gallery-zoom' );\n add_theme_support( 'wc-product-gallery-lightbox' );\n add_theme_support( 'wc-product-gallery-slider' );\n }", "function widget_product_tag_cloud()\n{\n?>\n<section class=\"widget woocommerce widget_product_tag_cloud\">\n\t<h2 class=\"widget-title\">\n\t\tWoo Tags.\n\t</h2>\n\t<div class=\"widget-body\">\n\t\t<a href=\"\" target=\"_blank\" class=\"btn-tags\">shirt</a>\n\t\t<a href=\"\" target=\"_blank\" class=\"btn-tags\">jacket</a>\n\t\t<a href=\"\" target=\"_blank\" class=\"btn-tags\">pants</a>\n\t\t<a href=\"\" target=\"_blank\" class=\"btn-tags\">suit</a>\n\t\t<a href=\"\" target=\"_blank\" class=\"btn-tags\">woman bags</a>\n\t\t<a href=\"\" target=\"_blank\" class=\"btn-tags\">shoes</a>\n\t\t<a href=\"\" target=\"_blank\" class=\"btn-tags\">other products</a>\n\t</div>\n</section>\n<?php\n}", "public function supports_widgets(): bool;", "public function product_tab_custom_js(){\n\t\t\n\t\tif ( 'product' != get_post_type() ) :\n\t\t\t\treturn;\n\t\t\tendif;\n\t\t\t?><script type='text/javascript'>\n\t\t\t\tjQuery( document ).ready( function() {\n\t\t\t\t\tjQuery( '.options_group.pricing' ).addClass( 'show_if_<?php echo $this->product_type ?>' ).show();\n\t\t\t\t});\n\t\t\t</script><?php\n }", "function worldanimalprotection_woocommerce_setup(){\n add_theme_support('woocommerce');\n add_theme_support('wc-product-gallery-zoom');\n add_theme_support('wc-product-gallery-lightbox');\n add_theme_support('wc-product-gallery-slider');\n\n // Remove related products\n remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );\n\n add_filter('woocommerce_product_related_posts_query', '__return_empty_array', 100);\n\n}", "public function widget( $widget_args, $instance ) {\n\t\t\n extract( $widget_args );\n\t\n\t\t$title = apply_filters( 'widget_title', $instance['title'] );\n\t\t$products_number = $instance['products_number'];\n\t\t$product_category = $instance['product_category'];\n\t\t$orderby = $instance['orderby'];\n\t\t$order = $instance['order'];\n\t\t$style = $instance['style'];\n\t\t$show_read_more = $instance['show_read_more'];\n\t\t$show_sku = $instance['show_sku'];\n\t\t$add_to_cart_btn = $instance['add_to_cart_btn'];\n\t\t\n\t\twp_register_style('jsquare_products_showcase_css', plugin_dir_url(__FILE__).'css/style.css' );\n\t\twp_enqueue_style('jsquare_products_showcase_css');\n\t\twp_style_add_data( 'jsquare_products_showcase_css', 'rtl', 'replace' );\n\t\t\n\t\twp_register_style( 'uikit.css', plugin_dir_url(__FILE__).'css/uikit.css' );\n\t\twp_enqueue_style( 'uikit.css' );\n\t\t\n\t\twp_register_script( 'uikit.js', plugin_dir_url(__FILE__).'js/uikit.min.js', array('jquery') );\n\t\twp_enqueue_script( 'uikit.js' );\n\t\n\t\tif (($style == 'slideset-default') || ($style == 'small-slideset') || ($style == 'large-slideset') || ($style == 'slideset-content-hover') || ($style == 'slideset-category') || ($style == 'slideset-category-hover') || ($style == 'slideset-four-columns') || ($style == 'slideset-four-columns-hover') || ($style == 'slideset-hover-color') || ($style == 'minimal-slideset')) {\n\t\t\twp_register_script( 'slideset.js', plugin_dir_url(__FILE__).'js/slideset.min.js' );\n\t\t\twp_enqueue_script( 'slideset.js' );\n\t\t\twp_register_style( 'slidenav.css', plugin_dir_url(__FILE__).'css/slidenav.min.css' );\n\t\t\twp_enqueue_style( 'slidenav.css' );\n\t\t\twp_register_style( 'dotnav.css', plugin_dir_url(__FILE__).'css/dotnav.min.css' );\n\t\t\twp_enqueue_style( 'dotnav.css' );\n\t\t}\n\t\t\n\t\t\n\t\t// before and after widget arguments are defined by themes\n\t\techo $widget_args['before_widget'];\n\t\tif ( ! empty( $title ) ) {\n\t\t\techo $widget_args['before_title'];\n\t\t\n\t\t\techo $title;\n\t\t\n\t\t\techo $widget_args['after_title'];\n\t\t}\n\t\t\n\t\t// Include files based on the style selected on widget's options\n\t\tif ($style == 'grid') {\n\t\t\tinclude 'styles/grids/grid.php';\n\t\t}\n\t\telse if ($style == 'grid-two-columns') {\n\t\t\tinclude 'styles/grids/grid-two-columns.php';\n\t\t}\n\t\telse if ($style == 'grid-five-columns') {\n\t\t\tinclude 'styles/grids/grid-five-columns.php';\n\t\t}\n\t\telse if ($style == 'grid-overlay') {\n\t\t\tinclude 'styles/grids/grid-overlay.php';\n\t\t}\n\t\telse if ($style == 'grid-overlay-small') {\n\t\t\tinclude 'styles/grids/grid-overlay-small.php';\n\t\t}\n\t\telse if ($style == 'grid-overlay-hover') {\n\t\t\tinclude 'styles/grids/grid-overlay-hover.php';\n\t\t}\n\t\telse if ($style == 'grid-large-image') {\n\t\t\tinclude 'styles/grids/grid-large-image.php';\n\t\t}\n\t\telse if ($style == 'grid-large-image-2') {\n\t\t\tinclude 'styles/grids/grid-large-image-2.php';\n\t\t}\n\t\t\n\t\telse if ($style == 'default-list') {\n\t\t\tinclude 'styles/lists/default.php';\n\t\t}\n\t\telse if ($style == 'list-overlay') {\n\t\t\tinclude 'styles/lists/list-overlay.php';\n\t\t}\n\t\telse if ($style == 'small-list') {\n\t\t\tinclude 'styles/lists/small-list.php';\n\t\t}\n\t\t\n\t\techo $widget_args['after_widget'];\n\t}", "public static function wish_list_button( $product, $post, $slider_id ) {\n\t\t\t$_product_wish_list = get_post_meta( $slider_id, '_product_wishlist', true );\n\n\t\t\tif ( defined( 'WC_VERSION' ) && version_compare( WC_VERSION, '2.7.0', '>=' ) ) {\n\t\t\t\t$product_id = $product->get_id();\n\t\t\t} else {\n\t\t\t\t$product_id = $post->ID;\n\t\t\t}\n\n\t\t\tif ( class_exists( 'YITH_WCWL' ) && $_product_wish_list == 'on' ) {\n\t\t\t\techo do_shortcode( '[yith_wcwl_add_to_wishlist product_id=\"' . $product_id . '\"]' );\n\t\t\t}\n\t\t}", "function fusion_element_featured_products_slider() {\n\tif ( class_exists( 'WooCommerce' ) ) {\n\t\tfusion_builder_map(\n\t\t\tfusion_builder_frontend_data(\n\t\t\t\t'FusionSC_WooFeaturedProductsSlider',\n\t\t\t\t[\n\t\t\t\t\t'name' => esc_attr__( 'Woo Featured Products Slider', 'fusion-builder' ),\n\t\t\t\t\t'shortcode' => 'fusion_featured_products_slider',\n\t\t\t\t\t'icon' => 'fusiona-star-empty',\n\t\t\t\t\t'help_url' => 'https://theme-fusion.com/documentation/fusion-builder/elements/woocommerce-featured-products-slider-element/',\n\t\t\t\t\t'params' => [\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'type' => 'radio_button_set',\n\t\t\t\t\t\t\t'heading' => esc_attr__( 'Picture Size', 'fusion-builder' ),\n\t\t\t\t\t\t\t'description' => __( 'fixed = width and height will be fixed <br />auto = width and height will adjust to the image.', 'fusion-builder' ),\n\t\t\t\t\t\t\t'param_name' => 'picture_size',\n\t\t\t\t\t\t\t'value' => [\n\t\t\t\t\t\t\t\t'fixed' => esc_attr__( 'Fixed', 'fusion-builder' ),\n\t\t\t\t\t\t\t\t'auto' => esc_attr__( 'Auto', 'fusion-builder' ),\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'default' => 'fixed',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'type' => 'radio_button_set',\n\t\t\t\t\t\t\t'heading' => esc_attr__( 'Carousel Layout', 'fusion-builder' ),\n\t\t\t\t\t\t\t'description' => esc_attr__( 'Choose to show titles on rollover image, or below image.', 'fusion-builder' ),\n\t\t\t\t\t\t\t'param_name' => 'carousel_layout',\n\t\t\t\t\t\t\t'value' => [\n\t\t\t\t\t\t\t\t'title_on_rollover' => esc_attr__( 'Title on rollover', 'fusion-builder' ),\n\t\t\t\t\t\t\t\t'title_below_image' => esc_attr__( 'Title below image', 'fusion-builder' ),\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'default' => 'title_on_rollover',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'type' => 'radio_button_set',\n\t\t\t\t\t\t\t'heading' => esc_attr__( 'Carousel Autoplay', 'fusion-builder' ),\n\t\t\t\t\t\t\t'description' => esc_attr__( 'Choose to autoplay the carousel.', 'fusion-builder' ),\n\t\t\t\t\t\t\t'param_name' => 'autoplay',\n\t\t\t\t\t\t\t'value' => [\n\t\t\t\t\t\t\t\t'yes' => esc_attr__( 'Yes', 'fusion-builder' ),\n\t\t\t\t\t\t\t\t'no' => esc_attr__( 'No', 'fusion-builder' ),\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'type' => 'range',\n\t\t\t\t\t\t\t'heading' => esc_attr__( 'Maximum Columns', 'fusion-builder' ),\n\t\t\t\t\t\t\t'description' => esc_attr__( 'Select the number of max columns to display.', 'fusion-builder' ),\n\t\t\t\t\t\t\t'param_name' => 'columns',\n\t\t\t\t\t\t\t'value' => '5',\n\t\t\t\t\t\t\t'min' => '1',\n\t\t\t\t\t\t\t'max' => '6',\n\t\t\t\t\t\t\t'step' => '1',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'type' => 'range',\n\t\t\t\t\t\t\t'heading' => esc_attr__( 'Column Spacing', 'fusion-builder' ),\n\t\t\t\t\t\t\t'description' => esc_attr__( \"Insert the amount of spacing between items without 'px'. ex: 13.\", 'fusion-builder' ),\n\t\t\t\t\t\t\t'param_name' => 'column_spacing',\n\t\t\t\t\t\t\t'value' => '10',\n\t\t\t\t\t\t\t'min' => '1',\n\t\t\t\t\t\t\t'max' => '100',\n\t\t\t\t\t\t\t'step' => '1',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'type' => 'textfield',\n\t\t\t\t\t\t\t'heading' => esc_attr__( 'Scroll Items', 'fusion-builder' ),\n\t\t\t\t\t\t\t'description' => esc_attr__( 'Insert the amount of items to scroll. Leave empty to scroll number of visible items.', 'fusion-builder' ),\n\t\t\t\t\t\t\t'param_name' => 'scroll_items',\n\t\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'type' => 'radio_button_set',\n\t\t\t\t\t\t\t'heading' => esc_attr__( 'Show Navigation', 'fusion-builder' ),\n\t\t\t\t\t\t\t'description' => esc_attr__( 'Choose to show navigation buttons on the carousel.', 'fusion-builder' ),\n\t\t\t\t\t\t\t'param_name' => 'show_nav',\n\t\t\t\t\t\t\t'value' => [\n\t\t\t\t\t\t\t\t'yes' => esc_attr__( 'Yes', 'fusion-builder' ),\n\t\t\t\t\t\t\t\t'no' => esc_attr__( 'No', 'fusion-builder' ),\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'type' => 'radio_button_set',\n\t\t\t\t\t\t\t'heading' => esc_attr__( 'Mouse Scroll', 'fusion-builder' ),\n\t\t\t\t\t\t\t'description' => esc_attr__( 'Choose to enable mouse drag control on the carousel. IMPORTANT: For easy draggability, when mouse scroll is activated, links will be disabled.', 'fusion-builder' ),\n\t\t\t\t\t\t\t'param_name' => 'mouse_scroll',\n\t\t\t\t\t\t\t'value' => [\n\t\t\t\t\t\t\t\t'yes' => esc_attr__( 'Yes', 'fusion-builder' ),\n\t\t\t\t\t\t\t\t'no' => esc_attr__( 'No', 'fusion-builder' ),\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'default' => 'no',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'type' => 'radio_button_set',\n\t\t\t\t\t\t\t'heading' => esc_attr__( 'Show Categories', 'fusion-builder' ),\n\t\t\t\t\t\t\t'description' => esc_attr__( 'Choose to show or hide the categories.', 'fusion-builder' ),\n\t\t\t\t\t\t\t'param_name' => 'show_cats',\n\t\t\t\t\t\t\t'value' => [\n\t\t\t\t\t\t\t\t'yes' => esc_attr__( 'Yes', 'fusion-builder' ),\n\t\t\t\t\t\t\t\t'no' => esc_attr__( 'No', 'fusion-builder' ),\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'type' => 'radio_button_set',\n\t\t\t\t\t\t\t'heading' => esc_attr__( 'Show Price', 'fusion-builder' ),\n\t\t\t\t\t\t\t'description' => esc_attr__( 'Choose to show or hide the price.', 'fusion-builder' ),\n\t\t\t\t\t\t\t'param_name' => 'show_price',\n\t\t\t\t\t\t\t'value' => [\n\t\t\t\t\t\t\t\t'yes' => esc_attr__( 'Yes', 'fusion-builder' ),\n\t\t\t\t\t\t\t\t'no' => esc_attr__( 'No', 'fusion-builder' ),\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'type' => 'radio_button_set',\n\t\t\t\t\t\t\t'heading' => esc_attr__( 'Show Buttons', 'fusion-builder' ),\n\t\t\t\t\t\t\t'description' => esc_attr__( 'Choose to show or hide Add to Cart / Details buttons on the rollover.', 'fusion-builder' ),\n\t\t\t\t\t\t\t'param_name' => 'show_buttons',\n\t\t\t\t\t\t\t'value' => [\n\t\t\t\t\t\t\t\t'yes' => esc_attr__( 'Yes', 'fusion-builder' ),\n\t\t\t\t\t\t\t\t'no' => esc_attr__( 'No', 'fusion-builder' ),\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'default' => 'yes',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'type' => 'checkbox_button_set',\n\t\t\t\t\t\t\t'heading' => esc_attr__( 'Element Visibility', 'fusion-builder' ),\n\t\t\t\t\t\t\t'param_name' => 'hide_on_mobile',\n\t\t\t\t\t\t\t'value' => fusion_builder_visibility_options( 'full' ),\n\t\t\t\t\t\t\t'default' => fusion_builder_default_visibility( 'array' ),\n\t\t\t\t\t\t\t'description' => esc_attr__( 'Choose to show or hide the element on small, medium or large screens. You can choose more than one at a time.', 'fusion-builder' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'type' => 'textfield',\n\t\t\t\t\t\t\t'heading' => esc_attr__( 'CSS Class', 'fusion-builder' ),\n\t\t\t\t\t\t\t'description' => esc_attr__( 'Add a class to the wrapping HTML element.', 'fusion-builder' ),\n\t\t\t\t\t\t\t'param_name' => 'class',\n\t\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t\t'group' => esc_attr__( 'General', 'fusion-builder' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'type' => 'textfield',\n\t\t\t\t\t\t\t'heading' => esc_attr__( 'CSS ID', 'fusion-builder' ),\n\t\t\t\t\t\t\t'description' => esc_attr__( 'Add an ID to the wrapping HTML element.', 'fusion-builder' ),\n\t\t\t\t\t\t\t'param_name' => 'id',\n\t\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t\t'group' => esc_attr__( 'General', 'fusion-builder' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t\t'callback' => [\n\t\t\t\t\t\t'function' => 'fusion_ajax',\n\t\t\t\t\t\t'action' => 'get_fusion_featured_products',\n\t\t\t\t\t\t'ajax' => true,\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t)\n\t\t);\n\t}\n}", "function get_woocommerce_product_list()\n{\n global $product;\n $allProducts = new WP_Query(array('post_type' => array('product', 'product_variation'), 'posts_per_page' => -1\n ));\n if (!$product->is_type('wcpb')) //show the bundle list if the product itself is not bundle\n {\n $bundleHtml = \"<div class='bundle_list_div'>\";\n $bundleHtml .= \"<div class='bundle_list_title'>Related Data Packages</div>\";\n $bundleHtml .= \"<div class='bundle_list'><ul>\";\n $hasBundle = 0;\n\n while ($allProducts->have_posts()) {\n $allProducts->the_post();\n $bundleId = get_the_ID();\n $bundleData = get_product($bundleId);\n if ($bundleData->is_type('wcpb')) //Check product is bundle or not\n {\n\n $_product_metadata = get_metadata('post', $bundleId);\n $bundle_child_products = json_decode($_product_metadata['wcpb_bundle_products'][0]);\n $childHtml = \"\";\n\n foreach ($bundle_child_products as $bundleChildId => $bundleChildValue){\n $childHtml .= '<div><a target=\"_blank\" href=\"\"> '.$bundleChildValue->title.'</a></div>';\n }\n foreach ($bundle_child_products as $bundleChildId => $bundleChildValue) {\n if ($bundleChildId == $product->id) //Check bundle product id is same as product id\n {\n $hasBundle = 1;\n $bundleHtml .= '<li>';\n $bundleHtml .= '<form method=\"post\" enctype=\"multipart/form-data\" >';\n $bundleHtml .= '<a target=\"_blank\" href=\"' . get_permalink($bundleId) . '\">' . get_the_title($bundleId).' \"Includes\"</a>';\n $bundleHtml .= '<input type=\"hidden\" name=\"add-to-cart\" value=\"' . $bundleId . '\">';\n $bundleHtml .= '<button type=\"submit\" class=\"single_add_to_cart_button subscribe_add_to_cart_button\">Subscribe To DataPackage</button>';\n $bundleHtml .= '</form>';\n $bundleHtml .= '<dl class=\"wcpb-cart-item-container\">\n <dt></dt>\n <dd>'.$childHtml.'</dd>\n </dl>';\n\n $bundleHtml .= '</li>';\n }\n\n }\n }\n }\n if ($hasBundle == 0) {\n\n $bundleHtml .= \"No Related Data Packages\";\n }\n $bundleHtml .= \"</ul></div></div>\";\n\n\n\n echo $bundleHtml;\n }\n}", "function twenty_child_override_product_box($atts ){\n $output=\"\";\n $parameters = shortcode_atts( array(\n 'product_id' => '',\n 'bg' => '',\n 'name_shortcode'=>''\n ), $atts );\n\n if($parameters['name_shortcode']!=='twenty_child_product_box'){\n return $output;\n }\n $output.=do_shortcode(\"[\".$parameters['name_shortcode'].\" product_id='\" .$parameters['product_id'].\"' bg='\".$parameters['bg'].\"']\")\n .__('Product for computer only','twenty_child');\n return $output;\n }", "function action_woocommerce_before_main_content() {\n if ( is_product() ) {\n echo \"<div class='container'>\";\n echo \"<div class='content'>\";\n }\n}", "function ideal_protest_voting_vud_widgets() {\n return array(\n 'title' => t('Ohel Voting Widget'),\n 'widget template' => 'widget',\n );\n}", "public function isEnabledWidget()\n {\n return parent::isEnabledWidget() && $this->getWidgetSettings()->isProductReviewsWidget();\n }", "function wauc_auction_custom_js() {\n if ( 'product' != get_post_type() ) :\n return;\n endif;\n ?><script type='text/javascript'>\n jQuery( document ).ready( function() {\n jQuery( '.options_group.pricing' ).addClass( 'show_if_auction' ).show();\n });\n </script><?php\n }", "function mixtape_qodef_woocommerce_content() {\n\n\t\tif ( is_singular( 'product' ) ) {\n\n\t\t\twhile ( have_posts() ) : the_post();\n\n\t\t\t\twc_get_template_part( 'content', 'single-product' );\n\n\t\t\tendwhile;\n\n\t\t} else {\n\n\t\t\tif ( have_posts() ) :\n\n\t\t\t\tdo_action('woocommerce_before_shop_loop');\n\n\t\t\t\twoocommerce_product_loop_start();\n\n\t\t\t\twoocommerce_product_subcategories();\n\n\t\t\t\twhile ( have_posts() ) : the_post();\n\n\t\t\t\t\twc_get_template_part( 'content', 'product' );\n\n\t\t\t\tendwhile; // end of the loop.\n\n\t\t\t\twoocommerce_product_loop_end();\n\n\t\t\t\tif(mixtape_qodef_is_woocommerce_page()):\n\t\t\t\t\tremove_action( 'woocommerce_after_shop_loop', 'woocommerce_pagination', 10 );\n\t\t\t\t\tadd_action('mixtape_qodef_before_column_close','woocommerce_pagination',10);\n\t\t\t\tendif;\n\n\t\t\telseif ( ! woocommerce_product_subcategories( array( 'before' => woocommerce_product_loop_start( false ), 'after' => woocommerce_product_loop_end( false ) ) ) ) :\n\n\t\t\t\twc_get_template( 'loop/no-products-found.php' );\n\n\t\t\tendif;\n\n\t\t}\n\t}", "function cw_post_type_product() {\n $supports = array(\n 'title', // post title\n 'editor', // post content\n 'author', // post author\n 'thumbnail', // featured images\n 'excerpt', // post excerpt\n 'custom-fields', // custom fields\n 'comments', // post comments\n 'revisions', // post revisions\n 'post-formats', // post formats\n );\n $labels = array(\n 'name' => _x('product', 'plural'),\n 'singular_name' => _x('product', 'singular'),\n 'menu_name' => _x('product', 'admin menu'),\n 'name_admin_bar' => _x('product', 'admin bar'),\n 'add_new' => _x('Add New', 'add new'),\n 'add_new_item' => __('Add New product'),\n 'new_item' => __('New product'),\n 'edit_item' => __('Edit product'),\n 'view_item' => __('View product'),\n 'all_items' => __('All product'),\n 'search_items' => __('Search product'),\n 'not_found' => __('No product found.'),\n );\n $args = array(\n 'supports' => $supports,\n 'labels' => $labels,\n 'public' => true,\n 'query_var' => true,\n 'rewrite' => array('slug' => 'product'),\n 'has_archive' => true,\n 'taxonomies' => array('product_category'),\n 'hierarchical' => false,\n 'menu_icon' => 'dashicons-admin-home',\n );\n\n register_post_type('product', $args);\n }", "public function cek_ongkir_widget(){\n\t\t\n\t\t$weight['unit']\t= 'kg';\n\t\t$weight['product'] = '1';\n\t\t\n\t\twoocommerce_get_template( 'cek-ongkir-widget.php', array(\n\t\t\t'id' => 'widget',\n\t\t\t'weight' => $weight,\n\t\t\t'fields' => apply_filters( 'woocommerce_jne_cek_ongkir_fields', WC_JNE()->shipping->cek_ongkir->fields() )\n\t\t), 'woocommerce-jne-exclusive', untrailingslashit( WC_JNE()->plugin_path() ) . '/templates/' );\t\t\t\t\n\t}", "protected function register_product_tabs_controls() {\n\n\t\t$this->start_controls_section(\n\t\t\t'section_product_content',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Product Tabs', 'martfury' ),\n\t\t\t]\n\t\t);\n\n\t\t$this->start_controls_tabs( 'products_content_settings' );\n\n\t\t$this->start_controls_tab( 'products_tab', [ 'label' => esc_html__( 'Products', 'martfury' ) ] );\n\n\t\t$this->add_control(\n\t\t\t'product_cats',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Product Categories', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::SELECT2,\n\t\t\t\t'options' => Elementor::get_taxonomy(),\n\t\t\t\t'default' => '',\n\t\t\t\t'multiple' => true,\n\t\t\t\t'label_block' => true,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'per_page',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Products per view', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::NUMBER,\n\t\t\t\t'default' => 12,\n\t\t\t\t'min' => 2,\n\t\t\t\t'max' => 50,\n\t\t\t\t'step' => 1,\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab( 'product_tabs_tab', [ 'label' => esc_html__( 'Tabs', 'martfury' ) ] );\n\n\t\t$this->add_responsive_control(\n\t\t\t'show_heading_tab',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Heading', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'options' => [\n\t\t\t\t\t'block' => esc_html__( 'Show', 'martfury' ),\n\t\t\t\t\t'none' => esc_html__( 'Hide', 'martfury' ),\n\t\t\t\t],\n\t\t\t\t'default' => 'block',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .mf-products-of-category-2 .mf-products-tabs .tabs-header' => 'display: {{VALUE}}!important',\n\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$repeater = new \\Elementor\\Repeater();\n\n\t\t$repeater->add_control(\n\t\t\t'tab_title', [\n\t\t\t\t'label' => esc_html__( 'Title', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'default' => esc_html__( 'Tab Name', 'martfury' ),\n\t\t\t\t'label_block' => true,\n\t\t\t]\n\t\t);\n\n\t\t$repeater->add_control(\n\t\t\t'tab_products',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Products', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'options' => [\n\t\t\t\t\t'recent' => esc_html__( 'Recent', 'martfury' ),\n\t\t\t\t\t'featured' => esc_html__( 'Featured', 'martfury' ),\n\t\t\t\t\t'best_selling' => esc_html__( 'Best Selling', 'martfury' ),\n\t\t\t\t\t'top_rated' => esc_html__( 'Top Rated', 'martfury' ),\n\t\t\t\t\t'sale' => esc_html__( 'On Sale', 'martfury' ),\n\t\t\t\t],\n\t\t\t\t'default' => 'recent',\n\t\t\t\t'toggle' => false,\n\t\t\t]\n\t\t);\n\n\t\t$repeater->add_control(\n\t\t\t'tab_orderby',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Order By', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'options' => [\n\t\t\t\t\t'' => esc_html__( 'Default', 'martfury' ),\n\t\t\t\t\t'date' => esc_html__( 'Date', 'martfury' ),\n\t\t\t\t\t'title' => esc_html__( 'Title', 'martfury' ),\n\t\t\t\t\t'menu_order' => esc_html__( 'Menu Order', 'martfury' ),\n\t\t\t\t\t'rand' => esc_html__( 'Random', 'martfury' ),\n\t\t\t\t],\n\t\t\t\t'default' => '',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'products' => [ 'recent', 'top_rated', 'sale', 'featured' ],\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$repeater->add_control(\n\t\t\t'tab_order',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Order', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'options' => [\n\t\t\t\t\t'' => esc_html__( 'Default', 'martfury' ),\n\t\t\t\t\t'asc' => esc_html__( 'Ascending', 'martfury' ),\n\t\t\t\t\t'desc' => esc_html__( 'Descending', 'martfury' ),\n\t\t\t\t],\n\t\t\t\t'default' => '',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'products' => [ 'recent', 'top_rated', 'sale', 'featured' ],\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'tabs',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Product Tabs', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::REPEATER,\n\t\t\t\t'fields' => $repeater->get_controls(),\n\t\t\t\t'default' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'tab_title' => esc_html__( 'New Arrivals', 'martfury' ),\n\t\t\t\t\t\t'tab_products' => 'recent'\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'tab_title' => esc_html__( 'Best Seller', 'martfury' ),\n\t\t\t\t\t\t'tab_products' => 'best_selling'\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'tab_title' => esc_html__( 'Sale', 'martfury' ),\n\t\t\t\t\t\t'tab_products' => 'sale'\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t'title_field' => '{{{ tab_title }}}',\n\t\t\t\t'prevent_empty' => false\n\t\t\t]\n\t\t);\n\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab( 'product_carousel_tab', [ 'label' => esc_html__( 'Carousel', 'martfury' ) ] );\n\n\t\t$this->add_control(\n\t\t\t'products_slides_to_show',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Slides To Show', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'options' => [\n\t\t\t\t\t'4' => esc_html__( '4 Columns', 'martfury' ),\n\t\t\t\t\t'3' => esc_html__( '3 Columns', 'martfury' ),\n\t\t\t\t\t'5' => esc_html__( '5 Columns', 'martfury' ),\n\t\t\t\t\t'6' => esc_html__( '6 Columns', 'martfury' ),\n\t\t\t\t],\n\t\t\t\t'default' => '4',\n\t\t\t\t'toggle' => false,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'products_slides_to_scroll',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Slides To Scroll', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'options' => [\n\t\t\t\t\t'4' => esc_html__( '4 Columns', 'martfury' ),\n\t\t\t\t\t'3' => esc_html__( '3 Columns', 'martfury' ),\n\t\t\t\t\t'5' => esc_html__( '5 Columns', 'martfury' ),\n\t\t\t\t\t'6' => esc_html__( '6 Columns', 'martfury' ),\n\t\t\t\t],\n\t\t\t\t'default' => '4',\n\t\t\t\t'toggle' => false,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'products_navigation',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Navigation', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'options' => [\n\t\t\t\t\t'both' => esc_html__( 'Arrows and Dots', 'martfury' ),\n\t\t\t\t\t'arrows' => esc_html__( 'Arrows', 'martfury' ),\n\t\t\t\t\t'dots' => esc_html__( 'Dots', 'martfury' ),\n\t\t\t\t\t'none' => esc_html__( 'None', 'martfury' ),\n\t\t\t\t],\n\t\t\t\t'default' => 'arrows',\n\t\t\t\t'toggle' => false,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'products_infinite',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Infinite Loop', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_off' => esc_html__( 'Off', 'martfury' ),\n\t\t\t\t'label_on' => esc_html__( 'On', 'martfury' ),\n\t\t\t\t'default' => 'yes'\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'products_autoplay',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Autoplay', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'label_off' => esc_html__( 'Off', 'martfury' ),\n\t\t\t\t'label_on' => esc_html__( 'On', 'martfury' ),\n\t\t\t\t'default' => 'no'\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'products_autoplay_speed',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Autoplay Speed (in ms)', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::NUMBER,\n\t\t\t\t'default' => 5000,\n\t\t\t\t'min' => 100,\n\t\t\t\t'step' => 100,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'products_speed',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Speed (in ms)', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::NUMBER,\n\t\t\t\t'default' => 800,\n\t\t\t\t'min' => 100,\n\t\t\t\t'step' => 100,\n\t\t\t]\n\t\t);\n\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->end_controls_tabs();\n\n\t\t$this->end_controls_section();\n\t}", "function add_feature_support_to_product_types() {\n\t\t// Register the product feature\n\t\t$slug = 'featured-video';\n\t\t$description = __( \"This displays a custom pricing options for all Exchange product types\", 'LION' );\n\t\tit_exchange_register_product_feature( $slug, $description );\n\n\t\t// Add it to all enabled product-type addons\n\t\t$products = it_exchange_get_enabled_addons( array( 'category' => 'product-type' ) );\n\t\tforeach( $products as $key => $params ) {\n\t\t\tit_exchange_add_feature_support_to_product_type( 'featured-video', $params['slug'] );\n\t\t}\n\t}", "protected function register_side_products_style_controls() {\n\n\t\t$this->start_controls_section(\n\t\t\t'section_side_products_style',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Side Products', 'martfury' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_STYLE,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'side_products_hide_desktop',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Hide On Desktop', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'default' => '',\n\t\t\t\t'label_on' => esc_html__( 'Hide', 'martfury' ),\n\t\t\t\t'label_off' => esc_html__( 'Show', 'martfury' ),\n\t\t\t\t'return_value' => 'yes',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'side_products_hide_tablet',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Hide On Tablet', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'default' => '',\n\t\t\t\t'label_on' => esc_html__( 'Hide', 'martfury' ),\n\t\t\t\t'label_off' => esc_html__( 'Show', 'martfury' ),\n\t\t\t\t'return_value' => 'yes',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'side_products_hide_mobile',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Hide On Mobile', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t'default' => '',\n\t\t\t\t'label_on' => esc_html__( 'Hide', 'martfury' ),\n\t\t\t\t'label_off' => esc_html__( 'Show', 'martfury' ),\n\t\t\t\t'return_value' => 'yes',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'side_products_padding',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Padding', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => [ 'px', 'em', '%' ],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .mf-products-of-category-2 .products-side' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Border::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'side_products_border',\n\t\t\t\t'label' => esc_html__( 'Border', 'martfury' ),\n\t\t\t\t'selector' => '{{WRAPPER}} .mf-products-of-category-2 .products-side',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'side_products_style_divider',\n\t\t\t[\n\t\t\t\t'label' => '',\n\t\t\t\t'type' => Controls_Manager::DIVIDER,\n\t\t\t]\n\t\t);\n\n\n\t\t$this->start_controls_tabs( 'side_products_heading_settings' );\n\n\n\t\t$this->start_controls_tab( 'side_products_heading_style', [ 'label' => esc_html__( 'Heading', 'martfury' ) ] );\n\n\t\t$this->add_responsive_control(\n\t\t\t'side_products_heading_padding',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Padding', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => [ 'px', 'em', '%' ],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .mf-products-of-category-2 .products-side .side-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'side_products_heading_spacing',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Spacing', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .mf-products-of-category-2 .products-side .side-title' => 'margin-bottom: {{SIZE}}{{UNIT}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'side_products_heading_border_type',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Border Type', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'options' => [\n\t\t\t\t\t'' => esc_html__( 'Solid', 'martfury' ),\n\t\t\t\t\t'double' => _x( 'Double', 'Border Control', 'martfury' ),\n\t\t\t\t\t'dotted' => _x( 'Dotted', 'Border Control', 'martfury' ),\n\t\t\t\t\t'dashed' => _x( 'Dashed', 'Border Control', 'martfury' ),\n\t\t\t\t\t'groove' => _x( 'Groove', 'Border Control', 'martfury' ),\n\t\t\t\t\t'none' => _x( 'None', 'Border Control', 'martfury' ),\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .mf-products-of-category-2 .products-side .side-title' => 'border-style: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'side_products_heading_border_width',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Border Width', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .mf-products-of-category-2 .products-side .side-title' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'product_tabs_heading_border_type!' => 'none',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'side_products_heading_border_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Border Color', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .mf-products-of-category-2 .products-side .side-title' => 'border-color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t\t'condition' => [\n\t\t\t\t\t'product_tabs_heading_border_type!' => 'none',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'side_products_heading_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Text Color', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .mf-products-of-category-2 .products-side .side-title' => 'color: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Typography::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'side_products_title_typography',\n\t\t\t\t'selector' => '{{WRAPPER}} .mf-products-of-category-2 .products-side .side-title',\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab( 'side_products_products_style', [ 'label' => esc_html__( 'Products', 'martfury' ) ] );\n\n\t\t$this->add_control(\n\t\t\t'side_products_product_items_spacing',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Product Items Spacing', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'default' => [\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t],\n\t\t\t\t'range' => [\n\t\t\t\t\t'px' => [\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .mf-products-of-category-2 .products-side ul.products li.product' => 'margin-bottom: {{SIZE}}{{UNIT}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab( 'side_products_view_all_style', [ 'label' => esc_html__( 'View All', 'martfury' ) ] );\n\n\t\t$this->add_control(\n\t\t\t'side_products_view_all_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Text Color', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .mf-products-of-category-2 .products-side .link' => 'color: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'side_products_view_all_hover_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Text Color', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .mf-products-of-category-2 .products-side .link:hover' => 'color: {{VALUE}}',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Typography::get_type(),\n\t\t\t[\n\t\t\t\t'name' => 'side_products_view_all_typography',\n\t\t\t\t'selector' => '{{WRAPPER}} .mf-products-of-category-2 .products-side .link',\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->end_controls_tabs();\n\n\t\t$this->end_controls_section();\n\t}", "function waikiki_products_shortcode_func( $atts ) {\n $atts = shortcode_atts( array(\n 'per_page' => '24',\n 'columns' => '4',\n 'orderby' => 'date',\n 'order' => 'desc',\n 'offset' => 0,\n 'category' => '', // Slugs\n 'operator' => 'IN', // Possible values are 'IN', 'NOT IN', 'AND'.\n 'terms' => 'featured',\n ), $atts);\n\n // Get WooCommerce Global - TEST\n global $woocommerce;\n\n ob_start();\n\n $query_args = array(\n 'posts_per_page' => $atts['per_page'],\n 'orderby' => $atts['orderby'],\n 'order' => $atts['order'],\n 'offset' => $atts['offset'],\n 'no_found_rows' => 1,\n 'post_status' => 'publish',\n 'post_type' => 'product',\n\t\t\t\t'columns' => $atts['columns'],\n 'meta_query' => WC()->query->get_meta_query(),\n\t\t\t\t//'featured'\t\t\t => $atts['featured'],\n\t\t\t\t//'viewed_products' => $atts['viewed_products'],\n 'tax_query' => array(\n array(\n 'taxonomy' => 'product_visibility',\n 'field' => 'name',\n 'terms' => $atts['terms'],\n ),\n ),\n //Add this line for sale only products\n //'post__in' => array_merge( array( 0 ), wc_get_product_ids_on_sale() )\n );\n\n/*Begin new query test*/\n$loop = new WP_Query( $query_args );\nif ( $loop->have_posts() ) {\n $content2 = '<div class=\"woocommerce\"><ul class=\"rc_wc_rvp_product_list_widget products slick-featured slick flickity flickity-featured\">';\n/*new loop test*/\n while ( $loop->have_posts() ) {\n $loop->the_post();\n global $product;\n\n $content2 .= '<li class=\"carousel-cell\">\n <a href=\"' . get_permalink() . '\">\n ' . ( has_post_thumbnail() ? get_the_post_thumbnail( $loop->post->ID, 'shop_thumbnail' ) : woocommerce_placeholder_img( 'shop_thumbnail' ) ) . ' <span class=\"product-title\"> ' . get_the_title() . ' </span>\n </a>\n\t\t\t'. $product->get_price_html() . '\n </li>';\n }\n\n $content2 .= '</ul></div>';\n} else {\n\n}\n\n // Get clean object\n\t$content2 .= ob_get_clean();\n\n\n\t// Return whole content\n\treturn $content2;\n}", "function widget_recently_viewed_products()\n{\n?>\n<section class=\"widget woocommerce widget_recently_viewed_products\">\n\t<h2 class=\"widget-title\">\n\t\tWoo Recently Viewed.\n\t</h2>\n\t<div class=\"widget-body\">\n\t\t<ul class=\"product_list_widget\">\n\t\t\t<li>\n\t\t\t\t<a href=\"http://\">\n\t\t\t\t\t<img src=\"assets/front/dummy-images/banner/cat1.png\" alt=\"\" />Woo Logo</a>\n\t\t\t\t<del>\n\t\t\t\t\t<span class=\"amount\">$2000</span>\n\t\t\t\t</del>\n\t\t\t\t<ins>\n\t\t\t\t\t<span class=\"amount\">$18</span>\n\t\t\t\t</ins>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<a href=\"http://\">\n\t\t\t\t\t<img src=\"assets/front/dummy-images/banner/cat2.png\" alt=\"\" />Premium Quality</a>\n\t\t\t\t<span class=\"from\">From :</span>\n\t\t\t\t<del>\n\t\t\t\t\t<span class=\"amount\">$2000</span>\n\t\t\t\t</del>\n\t\t\t\t<ins>\n\t\t\t\t\t<span class=\"amount\">$18</span>\n\t\t\t\t</ins>\n\t\t\t</li>\n\t\t</ul>\n\t</div>\n</section>\n<?php\n}", "function ava_woo_oceanwp_open_canvas_wrap() {\n\tif ( ! is_singular( array( ava_woo_builder_post_type()->slug(), 'product' ) ) ) {\n\t\treturn;\n\t}\n\n\techo '<div class=\"site-main\">';\n}", "function chandelier_elated_woocommerce_content() {\r\n\r\n\t\tif ( is_singular( 'product' ) ) {\r\n\r\n\t\t\twhile ( have_posts() ) : the_post();\r\n\r\n\t\t\t\twc_get_template_part( 'content', 'single-product' );\r\n\r\n\t\t\tendwhile;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tif ( have_posts() ) :\r\n\r\n\t\t\t\tdo_action('woocommerce_before_shop_loop');\r\n\r\n\t\t\t\twoocommerce_product_loop_start();\r\n\r\n\t\t\t\twoocommerce_product_subcategories();\r\n\r\n\t\t\t\twhile ( have_posts() ) : the_post();\r\n\r\n\t\t\t\t\twc_get_template_part( 'content', 'product' );\r\n\r\n\t\t\t\tendwhile; // end of the loop.\r\n\r\n\t\t\t\twoocommerce_product_loop_end();\r\n\r\n\t\t\t\tdo_action('woocommerce_after_shop_loop');\r\n\r\n\t\t\telseif ( ! woocommerce_product_subcategories( array( 'before' => woocommerce_product_loop_start( false ), 'after' => woocommerce_product_loop_end( false ) ) ) ) :\r\n\r\n\t\t\t\twc_get_template( 'loop/no-products-found.php' );\r\n\r\n\t\t\tendif;\r\n\r\n\t\t}\r\n\t}", "function ava_woo_oceanwp_close_canvas_wrap() {\n\n\tif ( ! is_singular( array( ava_woo_builder_post_type()->slug(), 'product' ) ) ) {\n\t\treturn;\n\t}\n\n\techo '</div>';\n}", "protected function register_side_products_controls() {\n\n\t\t$this->start_controls_section(\n\t\t\t'section_side_product',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Side Products', 'martfury' ),\n\t\t\t]\n\t\t);\n\n\n\t\t$this->start_controls_tabs( 'side_products_content_settings' );\n\n\t\t$this->start_controls_tab( 'side_products_heading_tab', [ 'label' => esc_html__( 'Heading', 'martfury' ) ] );\n\n\t\t$this->add_control(\n\t\t\t'side_title',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Title', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'default' => esc_html__( 'Heading Name', 'martfury' ),\n\t\t\t\t'placeholder' => esc_html__( 'Enter your title', 'martfury' ),\n\t\t\t\t'label_block' => true,\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab( 'side_products_tab', [ 'label' => esc_html__( 'Products', 'martfury' ) ] );\n\n\t\t$this->add_control(\n\t\t\t'side_per_page',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Total Products', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::NUMBER,\n\t\t\t\t'default' => 6,\n\t\t\t\t'min' => 2,\n\t\t\t\t'max' => 50,\n\t\t\t\t'step' => 1,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'side_products',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Products', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'options' => [\n\t\t\t\t\t'recent' => esc_html__( 'Recent', 'martfury' ),\n\t\t\t\t\t'featured' => esc_html__( 'Featured', 'martfury' ),\n\t\t\t\t\t'best_selling' => esc_html__( 'Best Selling', 'martfury' ),\n\t\t\t\t\t'top_rated' => esc_html__( 'Top Rated', 'martfury' ),\n\t\t\t\t\t'sale' => esc_html__( 'On Sale', 'martfury' ),\n\t\t\t\t],\n\t\t\t\t'default' => 'recent',\n\t\t\t\t'toggle' => false,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'side_product_cats',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Product Categories', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::SELECT2,\n\t\t\t\t'options' => Elementor::get_taxonomy(),\n\t\t\t\t'default' => '',\n\t\t\t\t'multiple' => true,\n\t\t\t\t'label_block' => true,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'side_product_orderby',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Order By', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'options' => [\n\t\t\t\t\t'' => esc_html__( 'Default', 'martfury' ),\n\t\t\t\t\t'date' => esc_html__( 'Date', 'martfury' ),\n\t\t\t\t\t'title' => esc_html__( 'Title', 'martfury' ),\n\t\t\t\t\t'menu_order' => esc_html__( 'Menu Order', 'martfury' ),\n\t\t\t\t\t'rand' => esc_html__( 'Random', 'martfury' ),\n\t\t\t\t],\n\t\t\t\t'default' => '',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'side_products' => [ 'recent', 'top_rated', 'sale', 'featured' ],\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'side_product_order',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Order', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'options' => [\n\t\t\t\t\t'' => esc_html__( 'Default', 'martfury' ),\n\t\t\t\t\t'asc' => esc_html__( 'Ascending', 'martfury' ),\n\t\t\t\t\t'desc' => esc_html__( 'Descending', 'martfury' ),\n\t\t\t\t],\n\t\t\t\t'default' => '',\n\t\t\t\t'condition' => [\n\t\t\t\t\t'side_products' => [ 'recent', 'top_rated', 'sale', 'featured' ],\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->start_controls_tab( 'side_products_view_all_tab', [ 'label' => esc_html__( 'View All', 'martfury' ) ] );\n\n\t\t$this->add_control(\n\t\t\t'side_link_text', [\n\t\t\t\t'label' => esc_html__( 'Title', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'default' => esc_html__( 'View More', 'martfury' ),\n\t\t\t\t'label_block' => true,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'side_link_url', [\n\t\t\t\t'label' => esc_html__( 'Link', 'martfury' ),\n\t\t\t\t'type' => Controls_Manager::URL,\n\t\t\t\t'placeholder' => esc_html__( 'https://your-link.com', 'martfury' ),\n\t\t\t\t'show_external' => true,\n\t\t\t\t'default' => [\n\t\t\t\t\t'url' => '#',\n\t\t\t\t\t'is_external' => false,\n\t\t\t\t\t'nofollow' => false,\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_tab();\n\n\t\t$this->end_controls_tabs();\n\n\t\t$this->end_controls_section();\n\t}" ]
[ "0.64348054", "0.63660693", "0.63049513", "0.62550443", "0.62233925", "0.6055937", "0.6025117", "0.6023077", "0.59108245", "0.5873526", "0.5803955", "0.5758637", "0.5714378", "0.5698932", "0.56935877", "0.56927973", "0.56830865", "0.5682685", "0.56806815", "0.5679792", "0.56636804", "0.56525487", "0.5614337", "0.56074435", "0.5589245", "0.5574431", "0.5552242", "0.55501175", "0.5548125", "0.5539764" ]
0.6491286
0
Store a newly created Testimonial in storage.
public function testimonialStore(Request $request) { $this->validate($request, [ 'testimonial_content' => 'required|string' ]); $testimonial = new Testimonial(); $testimonial->content = $request->testimonial_content; $testimonial->featured = 0; $testimonial->user_id = Auth::user()->id; $testimonial->reviewed = 0; if($testimonial->save()) { Session::flash('success', 'Your testimonial has been successfully created'); return redirect()->route('testimonial.index', $testimonial->id); } else { Session::flash('danger', 'Sorry, a problem occurred while creating this testimonial.'); return redirect()->route('testimonial.index'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(TestimonialsRequest $request)\n {\n //\n }", "public function store(TestimonialStoreRequest $request)\n {\n $this->authorize('master-policy.perform', ['testimonial', 'add']);\n $data = $request->except(['image']);\n if($request->get('image')){\n $saveName = sha1(date('YmdHis').str_random(3));\n $image = $request->get('image');\n $image = str_replace('data:image/png;base64','',$image);\n $image= str_replace('','+',$image);\n $imageData= base64_decode($image);\n $data['image'] = 'testimonial/'.$saveName.'.png';\n Storage::put($data['image'],$imageData);\n }\n $data['is_active'] = isset($request['is_active']) ? 1 : 0;\n if($this->testimonials->create($data)){\n return redirect()->route('admin.testimonials.index')->with('flash_notice','Testinomials is created Successfully');\n\n }\n return redirect()->back()->withInput()->with('flash_notice','Testinomials can not be created ');\n }", "public function store(TestimonialRequest $request)\n {\n $testimonial = new Testimonial();\n\n $testimonial->auteur = $request->input('auteur');\n $testimonial->fonction = $request->input('fonction');\n $testimonial->texte = $request->input('texte');\n $testimonial->image = $request->file('image')->store('img/testimonial');\n\n $testimonial->save();\n\n return redirect(route('testimonials.index'));\n\n }", "public function store(TestimonialsRequest $request)\n {\n if ($request->hasFile('image')) {\n $photo = $request->file('image');\n $filename = 'image' . '_' . time() . '.' . $photo->getClientOriginalExtension();\n $location = public_path('testimonial-image/');\n $request->file('image')->move($location, $filename);\n }\n $testimonial = new Testimonial();\n $testimonial->customer_name = $request->customer_name;\n $testimonial->description = $request->description;\n $testimonial->image = $filename;\n $testimonial->save();\n\n return redirect()->back()->with('success', 'Testimonial Created Successfully!');\n }", "public function store(Request $request)\n {\n $testimonial = new Testimonial;\n $testimonial->fill($request->all());\n\n $testimonial->save();\n return redirect('admin/testimonial')->with('message','Testimonial Added Successfully.');\n }", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'quote' => 'required',\n 'job' => 'required',\n 'avatar' => 'required',\n ]);\n\n $testimonialItem = new TestimonialItem();\n $testimonialItem->name = $request->name;\n $testimonialItem->quote = $request->quote;\n $testimonialItem->job = $request->job;\n \n $testimonialItem->avatar = $request->file('avatar')->hashName();\n $request->file('avatar')->storePublicly('img/avatar', 'public');\n\n $testimonialItem->testimonial_id = 1;\n $testimonialItem->created_at = now();\n $testimonialItem->save();\n return redirect()->route('testimonial-items.index')->with('message', 'The Testimonial item has been created.');\n }", "public function store(reqTestimonial $request)\n {\n // \\Validator::make($request->all(), [\n // \"nama_testi\" => 'required',\n // 'image_testi' => 'required',\n // \"deskripsi_testi\" => \"required|min:20|max:10000\"\n // ])->validate();\n\n $new_testi = new Testimoni();\n $new_testi->nama_testi = $request->get('nama_testi');\n\n $image_testi = $request->file('image_testi');\n\n if ($image_testi) {\n $image_path = $image_testi->store('image-testi', 'public');\n\n $new_testi->image_testi = $image_path;\n }\n\n $new_testi->deskripsi_testi = $request->get('deskripsi_testi');\n $new_testi->save();\n\n return redirect()->route('testimonial.index')->with('status', 'Testimonial Berhasil ditambahkan');\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'name' => 'required|string',\n 'position' => 'required|string',\n 'image' => 'required',\n 'testimonial' => 'required',\n ]);\n DB::beginTransaction();\n try {\n $input = $request->all();\n if ($request->hasFile('image')) {\n $path = $request->image->store('public');\n $input['image'] = $path;\n }\n Testimonial::create($input);\n } catch (\\Exception $e) {\n DB::rollback();\n return back()->withError($e->getMessage())->withInput();\n }\n DB::commit();\n Session::flash('type', \"success\");\n Session::flash('message', \"New Content has been Added Successfully\");\n return redirect()->route('testimonial.index');\n }", "public function store(Request $request)\n {\n $request->validate([\n 'quote' => 'required',\n 'name' => 'required',\n 'job' => 'required',\n 'image' => 'required'\n ]);\n\n $testimonialItem = new TestimonialItem();\n $testimonialItem->quote = $request->quote;\n $testimonialItem->name = $request->name;\n $testimonialItem->job = $request->job;\n $testimonialItem->testimonial_id = 1;\n $testimonialItem->image = $request->file('image')->hashName();\n $request->file('image')->storePublicly('img/testimonials', 'public');\n $testimonialItem->save();\n $testimonialItem->updated_at = now();\n\n return redirect()->route('testimonials.index')->with('message', 'Testimonial item has been created');\n }", "public function store(Request $request)\n {\n $user = User::whereId($request->id)->firstOrFail();\n\n $testimonial = new Testimonial([\n 'user_id' => $request->id,\n 'testimonial' => $request->testimonial,\n 'rating' => $request->rating,\n 'reviewer_id' => Auth::user()->id,\n ]);\n $testimonial -> save();\n\n if($request->has('path')){\n $backpath = $request->path;\n }else{\n $backpath = 0;\n }\n\n return view('testimonials.index',compact('user', 'backpath'));\n }", "public function store(Request $request)\n {\n $newTestimonial= new Testi;\n $newTestimonial->avis=$request->avis;\n $newTestimonial->team_id=$request->team_id;\n $newTestimonial->save();\n return redirect('/testimonials');\n }", "public function store(Request $request)\n {\n Validator::make([\n 'content' => $request->content,\n 'year' => $request->year,\n ], [\n 'content' => ['required', 'string', 'max:1024'],\n 'year' => ['required', 'numeric', 'digits:4'],\n ])->validateWithBag('createTestimonial');\n\n $testimonial = Testimonial::create([\n 'content' => $request->content,\n 'provider' => $request->provider,\n 'subprovider' => $request->subprovider,\n 'year' => $request->year,\n ]);\n\n return back()->with('flash', [\n 'testimonial' => $testimonial\n ]);\n }", "public function store(Request $request, Testimonial $testimonial)\n {\n $testimonial->name = $request->name;\n $testimonial->designation = $request->designation;\n $testimonial->comment = $request->comment;\n\n if($request->file('image')){\n $img = $request->file('image');\n $img_name = 'testimonial-'.time().'-.';\n $img->storeAs('/public/img/testimonial/',$img_name.'.'.$img->getClientOriginalExtension());\n $testimonial->image = 'storage/img/testimonial/'.$img_name.'.'.$img->getClientOriginalExtension();\n }\n\n $testimonial->save();\n\n return redirect()->route('admin.testimonial.index')->withSuccess('New testimonial created successfully!');\n }", "public function store(Request $request)\n {\n //\n $user=Auth::guard('alumni')->user();\n $this->validate($request,[\n 'testimonial'=>'required'\n ]);\n $post=new Testimonial;\n $post->testimonial=$request->input('testimonial');\n $post->names=$user->First_Name.' '.$user->Middle_Name;\n $post->course=$user->Course;\n $post->save();\n return redirect('/testimonial')->with('success','Testimonial created');\n }", "public function store(Request $request)\n {\n $testimonial = Testimonial::create($request->all());\n return redirect('admin/testimonial')->with(\"status\",\"Thêm mới thành công\");\n }", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required|min:3|max:255'\n ]);\n $testi = new \\App\\Models\\testimonials();\n $testi->name = $request->input('name');\n $testi->job = $request->input('job');\n $testi->testi = $request->input('testi');\n $testi->save();\n $request->session()->flash(\"msg\", \"Insert testimonials successfully\");\n return redirect(route(\"testimonials.index\"));\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'content' => 'required',\n 'date' => 'required',\n ]);\n $model = new Testimonial($request->all());\n $model->save();\n return $model;\n }", "public function store(Request $request)\n {\n //\n $firstname = $request->firstname;\n $lastname = $request->lastname;\n $ordernumber = $request->ordernumber;\n $testimony = $request->testimony;\n $rate = $request->rate;\n\n \n\n $this->validate(request(), [\n 'firstname' => 'required|string|min:2|max:20',\n 'lastname' => 'required|string|min:2|max:20',\n 'ordernumber' => 'required|unique:testimonials|string|min:12|max:12', \n 'testimony' => 'required|string|max:400',\n 'rate' => 'required|integer',\n ],\n ['ordernumber.unique'=> 'The order number has already been taken.']);\n\n \n\n \n\n $p = new Testimonial;\n $p->firstname = $firstname;\n $p->lastname = $lastname;\n $p->ordernumber = $ordernumber;\n $p->testimonial = $testimony;\n $p->rate = $rate;\n $p->status = 'new';\n $p->save();\n\n if($p->save())\n {\n return redirect('/landing')->with('status', 'Thank you for submitting your testimonial. As soon as it is validated it will be displayed here');\n }\n else\n {\n return redirect()->back();\n }\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'text' => 'required',\n 'role' => 'required',\n 'name' => 'required'\n ]);\n\n Testimonial::create($request->all() + [\n 'profile_pic' => 'images/student.png',\n ]);\n\n return [\n 'message' => 'Successfully created'\n ];\n }", "public function store()\n {\n $this->storage->set($this);\n\n }", "public function store(Request $request)\n {\n $rules = [\n 'name' => 'required|unique:testimonials|max:300|between:2,300',\n 'reviews' => 'required',\n 'image' => 'required',\n\n ];\n $messages = [\n \n ];\n $this->validate($request, $rules, $messages);\n $testimonial = new \\App\\Testimonial();\n $testimonial->fill($request->all());\n if ($files = $request->file('image')) { \n // for save original image\n $ImageUpload = Image::make($files);\n // for save thumnail image\n $thumbnailPath = 'img/team/';\n $ImageUpload->resize(160,160);\n $ImageUpload = $ImageUpload->save($thumbnailPath.'team_'.time().'.'.$files->getClientOriginalExtension());\n $testimonial->image = $ImageUpload->basename;\n }\n $testimonial->save();\n Session::flash('message',$testimonial->name .' '.'added successfully !!');\n return redirect('/testimonials');\n }", "public function store(Request $request)\n {\n $testimonial = new Testimonial;\n\n $this->validate($request,[\n 'name' => 'required|max:100',\n \n ],[\n 'name.required' => ' Project name field is required.',\n 'name.max' => ' Project name may not be greater than 100 characters.',\n ]);\n\n $testimonial->name = $request->input('name');\n $testimonial->description = $request->input('description');\n $testimonial->status = $request->input('status');\n\n $profileImage = $request->file('image');\n $newProfileImageName = rand() . '.' . $profileImage->getClientOriginalExtension();\n $profileImage->move(public_path(\"images\"),$newProfileImageName);\n $testimonial->image = $newProfileImageName;\n\n Session::flash('success','Portfolio Successfully Added');\n\n $testimonial->save();\n\n return redirect()->back();\n\n }", "public function store()\n\t{\n\t\t$rules = array(\n\t\t 'date' => 'required|date_format:Y-m-d',\n\t\t);\n\t\tforeach(Input::get('experience') as $key => $value) {\n\t\t $rules['experience.'.$key] = 'required|numeric';\n\t\t}\n\t\t$input = Input::all();\n\t\t\n\t\t$validator = Validator::make($input, $rules);\n\t\t\n\t if ($validator->fails()) {\n\t\tdd($validator->messages());\n\t\t return Redirect::back()\n\t\t\t ->with('flash_message', 'Please fill in all fields.')\n\t\t\t ->withInput(Input::all())\n\t\t\t\t ->withErrors($validator);\n\t\t}\n\t\telse {\n\t\tforeach ($input['experience'] as $key => $value) {\n\t\t $syncValues[$key] = array('experience' => $value);\n\t\t}\n\t\t $quest = new Quest;\n $quest->date = $input['date'];\n\t\t\t$quest->save();\n $quest->characters()->sync($syncValues);\n return Redirect::intended('/')->with('flash_message', 'Quest Created.');\t\t\n\t\t}\n\t}", "public function run()\r\n {\r\n Testimonial::create(['title' => 'testimonial',\r\n\r\n 'image'=>'testimonial/testimonial_image']);\r\n }", "public function store(Request $request)\n {\n\n $validator = Validator::make(request()->all(), $this->testimonial->getRules());\n\n if ($validator->fails()) {\n\n return back()->with('toast_warning', $validator->messages()->all()[0])->withInput();\n } else {\n $request->validate($this->testimonial->getRules());\n $form = $request->except('profile');\n $form['profile'] = storeImage(request()->profile, 'testimonial');\n\n if($success = $this->testimonial->fill($form)->save()){\n\n return redirect()->route('testimonials.index')->with('toast_success', 'Testimonial was added!');\n\n }\n }\n }", "public function store(Request $request)\n {\n $data = [\n 'name' => $request->get('name'),\n 'organization' => $request->get('organization'),\n 'publish' => $request->get('publish'),\n 'image' => $request->get('image'),\n 'testimony' => $request->get('testimony'),\n ];\n\n $image_avatar = \"avatarg.png\";\n foreach($data['image'] as $image) {\n $image_avatar = $image;\n }\n\n $testimony = new Testimonials([\n 'name' => $data['name'],\n 'organization' => $data['organization'],\n 'image' => $image_avatar,\n 'testimony' => $data['testimony'],\n 'activated' => $data['publish']\n ]);\n\n $testimony->save();\n\n return response()->json([\n 'success'=> 'God is Good'\n ]); \n }", "public function create()\n {\n return view('others::Testimonial.create');\n }", "public function add()\n\t{\n\t\t$this->load->language('extension/module/testimonialcrud');\n\t\t$this->document->setTitle($this->language->get('heading_title'));\n\t\t$this->load->model('extension/module/testimonial');\n\t\t/*** This is the section when someone clicks save button while adding the testimonial. It checks if the request method is post and if form is validated. Then it will call the addTestimonial method of model class which save the new testimonial to the database ***/\n\t\tif (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validateForm()) {\n\t\t\t$this->model_extension_module_testimonial->addTestimonial($this->request->post);\n\t\t\t$this->session->data['success'] = $this->language->get('text_success');\n\t\t\t$url = '';\n\t\t\tif (isset($this->request->get['sort'])) {\n\t\t\t\t$url .= '&sort=' . $this->request->get['sort'];\n\t\t\t}\n\t\t\tif (isset($this->request->get['order'])) {\n\t\t\t\t$url .= '&order=' . $this->request->get['order'];\n\t\t\t}\n\t\t\tif (isset($this->request->get['page'])) {\n\t\t\t\t$url .= '&page=' . $this->request->get['page'];\n\t\t\t}\n\t\t\t/*** This line of code is to redirect to the listing page ***/\n\t\t\t$this->response->redirect($this->url->link('extension/module/testimonialcrud', 'user_token=' . $this->session->data['user_token'] . $url, true));\n\t\t}\n\t\t/*** This is to show the form ***/\n\t\t$this->getForm();\n\t}", "function save_testimonial()\r\n\t{\r\n\t\tif($_POST)\r\n\t\t{\r\n\t\t\t$posted=array(); \r\n\t\t\t$posted[\"ta_message\"] \t= trim($this->input->post(\"ta_message\"));\r\n\t\t\t$i_user_id \t\t\t\t= decrypt($this->input->post(\"h_user_id\"));\r\n\t\t\t\r\n\t\t\t// Remove email address from content......\r\n\t\t\t$posted[\"ta_message\"] = preg_replace('/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}/','',$posted[\"ta_message\"]); \r\n\t\t\t// Remove website address from content......\r\n $posted[\"ta_message\"] = preg_replace('/([a-z0-9_-]+\\.)*[a-z0-9_-]+(\\.[a-z]{2,6}){1,2}/','',$posted[\"ta_message\"]); \r\n\t\t\t\r\n\t\t\t$s_tablename\t= \t$this->db->TESTIMONIALS;\r\n\t\t\t$s_where = \" WHERE i_user_id={$i_user_id} AND i_status=1\";\r\n\t\t\t$i_count = $this->mod_common->common_count_rows($s_tablename,$s_where);\r\n\t\t\t//pr($this->data['loggedin'],1);\r\n\t\t\tif(!empty($this->data['loggedin']))\r\n\t\t\t{\r\n\t\t\t\tif(!$i_count)\r\n\t\t\t\t{\t\t\t\t\t\r\n\t\t\t\t\t$info=array();\r\n\t\t\t\t\t$info[\"i_user_id\"]\t\t=\t$i_user_id;\r\n\t\t\t\t\t$info[\"s_content\"]\t\t=\t$posted[\"ta_message\"];\r\n\t\t\t\t\t$info[\"dt_created_on\"]\t=\ttime();\t\r\n\t\t\t\t\t//pr($info,1);\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t$i_newid \t\t= $this->mod_common->common_add_info($s_tablename,$info);\r\n\t\t\t\t\t//$i_newid = true;\r\n\t\t\t\t\tif($i_newid)////saved successfully\r\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t$msg = '1|'.$this->cls_msg[\"save_testimonial\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\t///Not saved, show the form again\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$msg = '2|'.$this->cls_msg[\"save_testimonial_err\"];\r\n\t\t\t\t\t}\t\t\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$msg = '2|'.$this->cls_msg[\"exceed_err\"];\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\t\t\t\t\r\n\t\t\t\r\n\t\t\telse // login and not a tradesman error\r\n\t\t\t{\r\n\t\t\t\t$msg = '2|'.$this->cls_msg[\"login_err\"];\r\n\t\t\t}\r\n\t\t}\r\n\t\techo $msg;\t\r\n\t}", "public function create()\n {\n return view('Testimonials.add');\n }" ]
[ "0.70882535", "0.7078847", "0.70430726", "0.67399293", "0.6725736", "0.66564846", "0.6604813", "0.65648866", "0.6530913", "0.6490227", "0.648344", "0.6469415", "0.64564174", "0.6366642", "0.62767315", "0.6273373", "0.6168723", "0.6139345", "0.59748054", "0.59729373", "0.5879811", "0.57868403", "0.57832164", "0.57801056", "0.57721823", "0.57259053", "0.56804705", "0.56612563", "0.56547993", "0.56194675" ]
0.7323386
0
Show Users Free CV Requests Index Page.
public function freeCVRequests() { $user = Auth::user(); if($user->status == 0) return redirect()->route('profile.index', $user->alias); $allResumes = Resume::all(); $resumes = Resume::where('status', 0)->orWhere('coach_id', $user->id)->orderBy('status', 'asc')->orderBy('created_at', 'asc')->get(); $total = $allResumes->count(); $reviewed = $allResumes->sum(function ($resume) { return $resume['status'] == 1; }); $notReviewed = $allResumes->sum(function ($resume) { return $resume['status'] == 0; }); $reviewedByCoaches = $allResumes->where('status', 1)->groupBy(function ($resume) { return $resume->coach->name . ' ' . $resume->coach->surname; })->transform(function ($item, $key) { return count($item); })->sort()->reverse(); $coachesNumber = count($reviewedByCoaches); return view('user.profile.cv-requests', compact('user', 'resumes', 'total', 'reviewed', 'notReviewed', 'reviewedByCoaches', 'coachesNumber')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionIndexfree()\n {\n \n $searchModel = new OfertaSearchfree();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('indexfree', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider, \n ]);\n }", "public function index()\n {\n $param = DB::table('match_requests')->where('user_id', Auth::user()->id)->first();\n if(isset($param)){\n return view('user.reserved', ['param' => $param]);\n }else{\n $msg = ['msg'=>'',];\n return view('user.home', $msg);\n }\n }", "public function index()\n {\n try{\n $result = DB::table('candidates')\n ->join('users', 'candidates.users_id', '=', 'users.id')\n ->select('users.*','candidates.*')\n ->paginate(5);\n \n return view('Admin.candidates',compact('result'));\n } catch ( \\Exception $exp ) {\n return redirect ()->back()->with('status', $exp->getMessage());\n }\n\n }", "public function index()\n {\n return view('requests.index', ['requests' => RequestObject::paginate(10)]); \n }", "public function index()\n {\n ///return \"pg\";\n \t\t$user_id = Auth::user()->id;\n $request_for_items = RfiUsers::where('user_id',$user_id)->latest()->paginate(10);\n return view('request_for_item.index', compact('request_for_items'))->with('i', (request()->input('page', 1) - 1) * 10);\n }", "public function index()\n {\n //\n $userRequest = RequestForBook::with('users')->get();\n return view('user_requests.index', compact('userRequest'));\n }", "public function indexAction()\n {\n $this->view->pageTitle = \"Open Check Requests\";\n\n $service = new App_Service_Search();\n $this->view->checkReqs = $service->getOpenCheckReqs();\n }", "public function index()\n {\n return view('pages.requests');\n }", "public function index()\n {\n return view('admin.contact-requests.index');\n }", "public function index()\n {\n $requestedCars = RequestedCar::paginate();\n return view('car-requests.index', [\n 'requestedCars' => $requestedCars\n ]);\n }", "public function index()\n {\n $collection = Candidate::where('id','>',0);\n\n if (request()->has('reviewed')) {\n $reviewed = request()->get('reviewed') == 'false' || request()->get('reviewed') == false ? false : true;\n $collection->where('reviewed',$reviewed);\n }\n\n $sort = request()->has('sort') && request()->get('sort')=='status' ? 'status' : 'date_applied';\n $order = request()->has('order') && request()->get('order')=='desc' ? 'DESC' : 'ASC';\n $collection->orderBy($sort, $order);\n \n return ApiResponses::respondCollectionRetrieved(new CandidatesCollection($collection->paginate(2)));\n }", "public function index() // 15\n {\n $this->authorize('index.citizens');\n $citizens=Citizen::SearchFromRequest()->PaginateForTable();\n\n return view('admin.citizens.index',compact('citizens'));\n }", "public function index()\n {\n //\n \t$cases = CaseIncedent::orderBy('id', 'DESC')->with('user')->latest()->paginate($this->limit);\n\n \t//dd($cases);\n\n return view('backend.case.index',compact('cases'))->with('i', (request()->input('page', 1) - 1) * 5);\n //return view('backend.case.index');\n }", "public function index(Request $request)\n {\n $is_show = (int)$request->input('is_show', -1);\n $resumes = Resume::where('site_id', $request->user()->getSite()['id']);\n if($is_show != -1)\n $resumes->where('is_show', $is_show);\n $resumes = $resumes->orderby('is_show', 'desc')\n ->orderby('id', 'desc')\n ->paginate($request->input('page_size',15));\n $resumes->appends(['is_show' => $is_show]);\n return View('cms.resume.index', [\n 'is_show' => $is_show,\n 'resumes' => $resumes\n ]);\n }", "public function requests()\n {\n if (!$this->session->userdata('logged_in')) {\n redirect('users/login');\n } else {\n $user['requests'] = $this->user_model->viewpending();\n $this->load->view('templates/header');\n $this->load->view('users/requests', $user);\n $this->load->view('templates/footer');\n }\n }", "public function index()\n {\n return view('pages.request');\n }", "public function index()\n {\n $research_requests = $this->researchRequestService->getAll();\n return view('rms::proposal.invited.index', compact('research_requests'));\n }", "public function index()\n {\n $reqalls = Requestpro::all();\n return view('admin.requestpro.index',compact('reqalls'));\n }", "public function index()\n {\n return view('customerrequest.index');\n }", "public function index()\n {\n $user = User::find(Auth::id());\n $post = Post::where('status','=','for-approval')->get();\n return view('posts.requests.index')\n ->with('post',$user->post)\n ->with('all',$post);\n }", "public function index()\n\t{\n\t\t$requesters = Requester::paginate();\n\t\treturn view('admin.requesters.index',compact('requesters'));\n\t}", "public function index(Request $request)\n {\n $userVerifications = UserVerification::paginate(15);\n\n return view('admin.user_verifications.index')\n ->with('userVerifications', $userVerifications);\n }", "public function index()\n {\n $candidates = Candidate::all();\n return view('candidates.index', compact('candidates'));\n }", "public function index()\n {\n $fees = Fee::orderby('fee_id','DESC')->where(['class_id'=>'2','feetype_id'=>'4'])->paginate(10);\n return view('Backend/Fees/Uniformfee/Kindergateenone/index', compact('fees'));\n }", "public function index(Request $request)\n {\n $flag = $request->input('flag');\n $page = 'legal';\n if ($flag == 'CCL')\n $contracts = Contract::where('company', 'CCL')->get();\n elseif ($flag == 'CAM')\n $contracts = Contract::where('company', 'CAM')->get();\n elseif ($flag == 'CPS')\n $contracts = Contract::where('company', 'CPS')->get();\n else\n $contracts = [];\n $page = $this->page;\n return view('legal.contracts.index', compact(['page', 'contracts', 'flag']));\n }", "public function actionVerifyindex()\n {\n $searchModel = new RequestSearch();\n $searchModel->status_id = Request::STATUS_SUBMITTED;\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n \n $CurrentUser= User::findOne(['user_id'=> Yii::$app->user->identity->user_id]);\n \n return $this->render('verifyindex', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n \n ]);\n }", "public function index()\n {\n $users = User::has('assets')->get();\n $statuses = Status::all();\n $userreqs = AssetUser::where('status_id', 3)->orWhere('status_id', 4)->get();\n $assets = Asset::all();\n $modelnames = Modelname::all();\n\n return view('requests.index', compact('users', 'statuses', 'userreqs', 'assets', 'modelnames'));\n }", "public function index(Request $request)\n {\n $voucher = CreditVoucher::with('party');\n\n if($request->filled('id')){\n $voucher->whereId($request->get('id'));\n }\n\n if($request->filled('name')){\n $voucher->whereHas('party', function (Builder $query) use($request){\n $query->where('name', 'like', \"%{$request->get('name')}%\");\n });\n }\n\n\n return view('account.general.credit.voucher.index', [\n 'vouchers' => $voucher->latest()->paginate()\n ]);\n }", "public function index()\n {\n $applied = true;\n $username = Auth::user()->name;\n if (!ApplicationRequest::where('fullname', $username)->exists()){\n $applied = false;\n }\n // $ch_username = ApplicationRequest::where('name', $username)->get();\n $app_requests = ApplicationRequest::orderBy('created_at', 'asc')->paginate(10);\n return view('pages.home')->with('app_requests', $app_requests)->with('applied', $applied);\n }", "public function index()\n {\n if (Auth::user()->role === 2) {\n $users = User::where('referral_id', Auth::user()->id)->orderBy('id', 'DESC')->get();\n foreach ($users as $key => $value) { \n $value->created = \\Carbon\\Carbon::createFromTimeStamp(strtotime($value->created_at))->format('m/d/Y g:i A'); \n }\n return view('Partners::index')->with(['domains' => $this->domains, 'users' => $users, 'user' => User::find(Auth::user()->id)]);\n } else {\n $status = DB::table('partners_requests')->where('user_id', Auth::user()->id)->where('status', 0)->first();\n return view('Partners::welcome')->with(['domains' => $this->domains, 'status' => $status]);\n }\n }" ]
[ "0.6387513", "0.6298503", "0.6293907", "0.62819684", "0.6243851", "0.6238159", "0.6149166", "0.6125138", "0.61144894", "0.6100874", "0.60975003", "0.6087762", "0.60780185", "0.60679823", "0.6062289", "0.6053318", "0.6041894", "0.60309714", "0.6025363", "0.601729", "0.60115916", "0.6002761", "0.5998542", "0.59742683", "0.5972128", "0.59659094", "0.5951469", "0.59357935", "0.59353524", "0.5925119" ]
0.72647476
0
Update the specified Free CV Request in storage.
public function freeCVUpdate(Request $request, $id) { $resume = Resume::findOrFail($id); $resume->coach_id = Auth::user()->id; $resume->status = 1; $resume->rating = $request->rating; if($resume->save()){ if($request->tips) { DB::transaction(function () use ($resume, $request) { $resume->tips()->sync(explode(',', $request->tips)); }, 5); } $user = User::findOrFail($resume->user_id); $user->free_cv = 2; $user->save(); $user->notify(new FreeCVResults($user)); Session::flash('success', 'Resume has been successfully edited'); return redirect()->route('cv-requests.index'); } else { return redirect()->route('cv-requests.edit', $resume->id); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(cvRequest $request,$id){\n\n \t$cv= Cv::find($id);\n\n \t$cv->titre = $request->input('titre');\n $cv->presentation = $request->input('presentation');\n\n if($request->hasFile('photo')){\n \t$cv->photo=$request->photo->store('image');\n }\n\n\n\n $cv->save();\n return redirect('cvs');\n }", "public function update($request);", "public function update(Request $request, $ec)\n {\n //\n }", "public function update(Request $request)\n {\n\n $filenumber=Input::get('filenumber');\n $limit=Input::get('limit');\n $date=Input::get('date');\n $estimater_number=Input::get('estimaternumber');\n $cert=Input::get('cert');\n $note=Input::get('note');\n\n enter_certificate::where('filenumber', '=', $filenumber)\n ->update(array('limit' =>$limit , 'date'=>$date ,'estimater_number'=>$estimater_number , 'cert'=>$cert , 'note'=>$note));\n return redirect()->to('/certificationTransaction');\n }", "public function update(Request $request, Croak $c)\n {\n //\n }", "public function update(Request $request)\n\t{\n\t\t//\n\t}", "public function update(Request $request, AjamiResume $ajamiResume)\n {\n //\n }", "public function update(Request $request)\n\t{\n\t\t\n\t}", "public function update(Request $request, resume $resume)\n {\n //\n }", "public function update($request)\n {\n }", "public function update($request)\n {\n }", "public function update(Request $request)\n\t{\n\n\t}", "public function update(Request $request, FactpProyec $factpProyec)\n {\n //\n }", "public function update(Request $request, IncidenciaHasAfectats $incidenciaHasRecurso)\n {\n\n }", "public function update(Request $request, Storage $storage)\n {\n //\n }", "public function update(Request $request) {\n \n }", "public function update(Request $request)\n {\n $rightId = 93;\n if (!$this->rightObj->checkRightsIrrespectiveChannel($rightId))\n return redirect('/dashboard');\n \n $this->validate($request,[\n \t\t 'description' => 'required',\n \t\t\t]); \n \t\t\t\n \t\t\t\n \t $freebies=SbuscriptionFreebies::find($request->freebies_id);\n $freebies->description=$request->description;\n $freebies->status=$request->status;\n $freebies->save();\n \n \n Session::flash('message', 'Freebies updated sucessfully.');\n return Redirect::to('subscription/freebies');\n\n }", "public function update(Request $request);", "public function update(Request $request, Prereq $prereq)\n {\n //\n }", "public function update(Request $request, Requisicao $requisicao)\n {\n //\n }", "public function update(Request $request, Licitacao $licitacao){ }", "public function update(Request $request, Candidate $candidate)\n {\n //\n }", "public function update(cvRequest $request, $id)\n {\n $exp = Experience::find($id);\n \n \n $exp->titre = $request->input('titre');\n $exp->datedebut = $request->input('datedebut');\n $exp->datefin = $request->input('datefin');\n \n $cv->save();\n \n return redirect('cvs');\n }", "public function update(Request $request, Directiva $directiva)\n {\n //\n }", "public function update(Request $request, Concert $concert)\n {\n //\n }", "public function update(Request $request, Concert $concert)\n {\n //\n }", "public function update(Request $request)\n {\n \n }", "public function update(Request $request)\n {\n \n }", "public function update(Request $request, $id)\n {\n $currentTime = new \\DateTime();\n\n // validate the current form post\n $this->validatorUpdate($request->all(), $this->messages(), $id)->validate();\n\n //get the current candidate by id\n $current_candidate = $this->candidate_model->getCandidateById($id);\n\n // upload cv file\n $file_absolute_path = $this->upload($request);\n\n // get file upload from request but have not upload successfully\n if ($request->cv_file_path && !$file_absolute_path) {\n return redirect()->back()->with('error_msg', 'Upload CV failed, Please try again');\n }\n\n // already have cv file and have not upload new one, then apply the old path\n if ($current_candidate->cv_file_path && !$file_absolute_path) {\n $file_absolute_path = $current_candidate->cv_file_path;\n }\n\n $candidate = array(\n 'id' => $id,\n 'first_name' => $request->first_name,\n 'last_name' => $request->last_name,\n 'email' => $request->email,\n 'phone' => $request->phone,\n 'wage' => $request->wage ? $request->wage : $current_candidate->wage,\n 'rate' => $request->rate,\n 'cv_file_path' => $file_absolute_path,\n 'comments' => $request->comments,\n 'role_id' => $request->role_id,\n 'recruiter_id' => $request->recruiter_id,\n 'notice_period' => $request->notice_period,\n 'visa_status' => $request->visa_status,\n 'number_years_experience' => $request->number_years_experience,\n 'reason_of_leaving' => $request->reason_of_leaving,\n 'communication_skills' => $request->communication_skills,\n 'completely_avoid' => $request->completely_avoid,\n 'updated_at' => $currentTime\n );\n\n if ($this->candidate_model->updateCandidate($candidate)) {\n return redirect()->back()->with('candidate_success', 'Candidate updated successfully');\n };\n return redirect()->back();\n }", "public function update(Request $request, factura $factura)\n {\n //\n }" ]
[ "0.65943307", "0.63250583", "0.6300696", "0.6277533", "0.6243967", "0.6241165", "0.62342834", "0.62210655", "0.6216854", "0.62134147", "0.62134147", "0.61818665", "0.6156228", "0.6155086", "0.612475", "0.608396", "0.6066932", "0.60618657", "0.60543686", "0.60510427", "0.6041716", "0.6012536", "0.60058314", "0.5997253", "0.5988032", "0.5988032", "0.5983764", "0.5983764", "0.5981259", "0.59804034" ]
0.7193217
0
Adds an item to the templateCache array
public static function addTemplateCache($key, $item) { self::$templateCache[$key] = $item; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_cache_add( $key, $value, $group = '', $expiration = 0 ) {\n global $wp_object_cache;\n return $wp_object_cache->add( $key, $value, $group, $expiration );\n}", "private function registerCacheUpdate()\n\n {\n\n $this->cacheService->getPageIdStack()->push(\n\n $this->getFrontendController()->id\n\n );\n\n }", "public static function add(Cacheable $cache)\n\t{\n\t\tself::$cacheArray[] = $cache;\n\t}", "public function addCacheVars(array $cacheVars);", "public function testAddEntryToTheCache(){\n\t\t$this->assertTrue(Cache::add($this->key, 'foobar', 10, false));\n\t}", "abstract public function cache(Array $templates, Array &$error_buffer = NULL);", "public function addToPagesCache() {\n \t$uid = $this['uid'];\n \ttx_pttools_assert::isValidUid($uid, array('message' => 'Adding to cache is only possible for saved objects.'));\n \t$cacheIdentifier = $this->getClassName() . '_' . $uid;\n \ttx_tcaobjects_cacheControl::addTag($cacheIdentifier);\n \tif (($endtimeField = $this->getEnableColumn('endtime')) == true) {\n \t\t$endtime = $this[$endtimeField];\n \t\tif (!empty($endtime)) {\n \t\t\ttx_tcaobjects_cacheControl::addTimeout($endtime);\t\t\n \t\t}\n \t}\n }", "public function add(CachedVariable $variable): CachedVariable;", "public function cache($key, $value)\n {\n $key = $this->key_prefix . $key;\n $this->log(\\Mustache_Logger::DEBUG, 'Adding to WP Object Cache cache: \"{key}\"', array('key' => $key));\n wp_cache_set($key, $value, $this->group);\n eval('?>' . $value);\n }", "public function Cache(ICacheItem $item);", "public function add($key, $context) {\n $this->templates[$key] = (object) $context;\n }", "private function cache_add( $key, $data ) {\n\t\treturn wp_cache_add( $key . '-' . $this->cache_hash, $data, 'themes', self::$cache_expiration );\n\t}", "public function addCacheVar($name, $value);", "public static function includeCached($sTemplate, array $aNewParams = array(), $iTTL = false, $sCacheKey = null, $bUseCache = true)\r\n\t{\r\n\t\tif (empty(self::$_twig))\r\n\t\t\treturn;\r\n\r\n\t\t// Compute the cache key\r\n\t\tif (empty($sCacheKey))\r\n\t\t{\r\n\t\t\t$sCacheKey = str_replace('/', '_', $sTemplate);\r\n\t\t\t$sCacheKey .= implode('_', $aNewParams);\r\n\t\t}\r\n\t\t$sCacheKey = 'twig_template_' . $sCacheKey;\r\n\r\n\t\t// Render the twig part only if not already in cache\r\n\t\t$oCont = $GLOBALS['asap_controller'];\r\n\t\tif (!$bUseCache || !$oCont->useFragmentCache($sCacheKey, $iTTL))\r\n\t\t{\r\n\t\t\techo self::$_twig->render($sTemplate, $aNewParams);\r\n\t\t\t$oCont->saveFragmentCache();\r\n\t\t}\r\n\t}", "public function testAdd()\n\t{\n\t\t$this->cache->put('key', 'value', 15);\n\t\t$this->assertFalse($this->cache->add('key', 'value', 15));\n\t}", "public function add($key, $value)\n {\n \t$this->cacheLvl1->add($key, $value);\n }", "public function addTemplate(Template $template)\n {\n $id = $template->getId();\n $this->templates[$id] = $template;\n }", "function pxl_shop_cart_add_item($item) {\n $shopping_cart_items = &pxl_shop_session_data()['cart']['items'];\n $shopping_cart_items[$item->id] = $item;\n}", "public function add($item);", "public function add($item);", "public function add($item);", "private function createOrAppend()\n {\n $this->memcache->add($this->queue, $this->item);\n if ($this->memcache->getResultCode() === \\Memcached::RES_NOTSTORED) {\n $this->memcache->append($this->queue, $this->item);\n }\n\n $this->checkResults([\\Memcached::RES_SUCCESS]);\n }", "public function addEnvironmentCacheTag($objectOrCacheTag);", "public function cache() {\n if(!array_key_exists($this->steamId64, self::$cache)) {\n self::$cache[$this->steamId64] = $this;\n }\n }", "function _task_cache_add($task) {\n if (!is_null($task)) {\n log_assert_valid(task_validate($task));\n mem_cache_set(\"task-by-id:{$task['id']}\", $task,\n IA_MEM_CACHE_TASK_EXPIRATION);\n }\n return $task;\n}", "abstract public function cache_store ( $key, $value );", "public function add( $item );", "function apc_add($key, $var, $ttl=0)\n{\n if (!array_key_exists($key, $GLOBALS['__fake_apc_data'])) {\n return apc_store($key, $var, $ttl);\n }\n return false;\n}", "public function test_add_array() {\n\t\t$key = microtime();\n\t\t$value = array( 5, 'quick' );\n\n\t\t// Add array to memcached\n\t\t$this->assertTrue( $this->object_cache->add( $key, $value ) );\n\n\t\t// Verify correct value and type is returned\n\t\t$this->assertSame( $value, $this->object_cache->get( $key ) );\n\t}", "function addCache($key, $data) {\n \t\t\n\t\t$key = $this->formatKey($key);\n\t\t\n\t\t$fh = @fopen('cache/'.$key,'w');\n\t\t$data = base64_encode($data);\n\t\t@fwrite($fh,serialize($data));\n\t\t@fclose($fh);\n\t}" ]
[ "0.6191753", "0.6015101", "0.6009428", "0.598213", "0.5919074", "0.5888319", "0.5778231", "0.5724273", "0.5639337", "0.56110805", "0.5549338", "0.55182225", "0.54654014", "0.54557955", "0.5411168", "0.5407773", "0.5366784", "0.53417456", "0.53335035", "0.53335035", "0.53335035", "0.532922", "0.53092605", "0.5265821", "0.52503955", "0.5212649", "0.5211017", "0.5203424", "0.519451", "0.51943296" ]
0.7368042
0
return the service endpoint for path
public function endpoint($path) { return $this->url . $path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEndpoint();", "public function getEndpoint();", "abstract public function getEndpoint();", "public function getEndpoint(): string;", "public function getEndpoint(): string;", "abstract public function getEndpointUrl();", "protected function endpoint($path)\n {\n return sprintf(\"%s/%s\", self::API_BASE, $path);\n }", "protected function getEndpoint()\n {\n if ($this->getTestMode()) {\n return self::API_HOST_TEST . self::API_PATH;\n }\n\n return self::API_HOST_LIVE . self::API_PATH;\n }", "function get_endpoint() {\n return variable_get('puertos_endpoint');\n }", "public function getEndpoint() {\n\t\tif (empty($this->endpoint)) {\n\t\t\treturn self::DEFAULT_ENDPOINT;\n\t\t} else {\n\t\t\treturn $this->endpoint;\n\t\t}\n\t}", "public function getEndpoint()\n {\n return $this->endpoint;\n }", "public function getEndpoint()\n {\n return $this->endpoint;\n }", "public function getEndpoint()\n {\n return $this->endpoint;\n }", "public function getEndpoint()\n { \n return static::$endpoint;\n }", "private function getEndPoint()\n {\n return env('APP_URL') . ($this->endpoint);\n }", "public function getEndpoint(): EndpointInterface\n {\n }", "public function getEndpoint()\n {\n return $this->_endpoint;\n }", "abstract protected function endpoint() : string;", "public static function getEndpoint()\n {\n $params = func_get_args();\n $endpoint = self::$endpoint_urls[array_shift($params)];\n if(count($params) > 0)\n {\n $endpoint = vsprintf($endpoint, $params);\n }\n return self::BASE_URL . $endpoint;\n }", "public function getEndpointUri()\n {\n return $this->endpoint_uri;\n }", "protected function getEndpoint()\n {\n $uri = $this->testMode\n ? $this->apiTestEndpoint\n : $this->apiLiveEndpoint;\n\n return $uri.'/'.$this->apiVersion;\n }", "public function getServicePath($serviceName)\n {\n \t\n \t$serviceName = explode(\".\", $serviceName);\n \t$serviceName = \"\\\\\" . implode(\"\\\\\", $serviceName);\n \t\n return $serviceName;\n // $services = config(\"services.services\") ?? [];\n // if (!in_array($serviceName, array_keys($services)))\n // throw new InvalidServiceException(sprintf(\"Service not implemented [%s]\", $serviceName));\n // return $services[$serviceName];\n }", "protected function get_endpoint() {\n\t\tif ( empty( $this->ENDPOINT ) ) {\n\t\t\tthrow new Facturapi_Exception( 'ENDPOINT must be defined' );\n\t\t} else {\n\t\t\treturn $this->ENDPOINT;\n\t\t}\n\t}", "public function get_endpoint_url() {\n\n return $this->endpoint_url;\n\n }", "function get_endpoint() {\n\n return variable_get('consulta_registro_sociedades');\n\n }", "public static function get_service_path() {\n\n $url = new \\moodle_url('/mod/lti/services.php');\n\n return $url->out(false);\n\n }", "abstract protected function getEndpoint($ip);", "public function getEndpoint(): string\n {\n return $this->getUrl() . 'invoices/create';\n }", "public function getCurrentEndpoint() \n {\n return $this->_options->getCurrentEndpoint();\n }", "public function getEndpoint() : string\n {\n return $this->getUrl().'/charges';\n }" ]
[ "0.7230544", "0.7230544", "0.71683306", "0.7068916", "0.7068916", "0.693678", "0.6935364", "0.67709076", "0.6767483", "0.66358846", "0.66002387", "0.66002387", "0.66002387", "0.6574566", "0.656443", "0.65615016", "0.6520849", "0.65102667", "0.6485342", "0.64836997", "0.6378748", "0.6315004", "0.62989223", "0.6296932", "0.6278098", "0.627246", "0.62640655", "0.62639004", "0.62310356", "0.6193193" ]
0.7408447
0
Get redirect login helper
private function loginHelper() { $this->helper = $this->fb->getRedirectLoginHelper(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public /*String*/ function getLoginUrl();", "public function getLogin()\n {\n $return_path = Input::get('url');\n if( ! $return_path ) $return_path = \\URL::previous();\n if( Sentinel::check() ) return redirect( $return_path ? $return_path : $this->redirectTo );\n return view('auth.login');\n }", "public function getLoginUrl();", "public function getLoginUrl();", "public function getLoginUrl();", "public function login_url() {\r\r\n return $this->helper->getLoginUrl( $this->permissions );\r\r\n }", "public function getLogin();", "private function _getUserRedirect() {\n $redirects = new LoginRedirect();\n $redirect = $redirects->getConfig();\n $clean = array_flip($redirect);\n $uri = array_values($clean);\n return $uri[0];\n }", "function getLoginRedirectAction()\n {\n return ($this->__login_redirect_action) ;\n }", "public function getRedirect();", "public function getLoginUrl(): string;", "public function getLoginURL()\n\t{\n\t\treturn self::$_loginHelper->getLoginURL();\n\t}", "public function redirectToLogin() {\n\n $tmp = explode( '.', $this->session->getStatus( 'tripple_login' ) );\n $map = array (\n Request::MOD => $tmp [0],\n Request::CON => $tmp [1],\n Request::RUN => $tmp [2] \n );\n $this->request->addParam( $map );\n \n if ('ajax' == $this->request->param( 'rqt', Validator::CNAME )) {\n $tmp = explode( '.', $this->session->getStatus( 'tripple_login' ) );\n // $this->tplEngine->setStatus( 401 );\n $this->tpl->redirectUrl = 'index.php?mod=' . $tmp [0] . '&amp;mex=' . $tmp [1] . '&amp;do=' . $tmp [2];\n }\n \n $this->main();\n \n }", "protected function getLoginUrl()\n {\n return $this->router->generate('login');\n }", "public function getLogin() {\n\t\tif (Auth::check()) {\n\t\t\treturn Redirect::to('/dashboard');\n\t\t} else {\n\t\t\treturn Redirect::route('users.login');\n\t\t}\n\t}", "protected function getUrlLogin() {\r\n return $_SERVER['SCRIPT_NAME'] . '/login';\r\n }", "function loginRadiusRedirectUrl()\n{\n\t$redirect = '';\n\t$loc = Configuration::get('LoginRadius_redirect');\n\n\tif ($loc == 'profile')\n\t\t$redirect = 'my-account.php';\n\telseif ($loc == 'url')\n\t{\n\t\t$custom_url = Configuration::get('redirecturl');\n\t\t$redirect = !empty($custom_url) ? $custom_url : 'my-account.php';\n\t}\n\telse\n\t{\n\t\tif (Tools::getValue('back'))\n\t\t{\n\t\t\t$back = Tools::getValue('back');\n\t\t\tif (_PS_VERSION_ >= 1.6)\n\t\t\t{\t\t\n\t\t\t\t$redirect_location = explode('controller=', $back);\n\t\t\t\tif(isset($redirect_location['1']))\n\t\t\t\t{\n\t\t\t\t\t$back = $redirect_location['1'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$redirect = $back;\n\t\t}\n\t\telseif (empty($redirect))\n\t\t{\n\t\t\t$http = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'Off' && !empty($_SERVER['HTTPS'])) ? 'https://' : 'http://');\n\t\t\t$uri_parts = explode('?', $_SERVER['REQUEST_URI'], 2);\n\t\t\t$uriWithQuery = $uri_parts[0].'?'.http_build_query($_GET);\t\t\t\t\n\t\t\t$redirect = urldecode($http.$_SERVER['HTTP_HOST'].$uriWithQuery);\n\t\t}\n\t}\n\n\treturn $redirect;\n}", "function getLogin();", "protected function getLoginRedirectPath()\n {\n return static::getInstance()->loginRedirectTo;\n }", "public function getUserLogin();", "protected function getLoginUrl()\n {\n\n return $this->router->generate('secure_login');\n }", "public function getLogin() {\n\t\treturn view ( 'auth.login' );\n\t}", "function jbst4_login_url() { return home_url(); }", "function bbp_redirect_login($url = '', $raw_url = '', $user = '')\n{\n}", "public function getLogin()\n {\n if( !Auth::guest() )\n {\n // If user is logged, redirect \n return Redirect::to('/');\n }\n else\n {\n return View::make('v2/users/login_only');\n }\n }", "public function login_url() {\n // Login type must be web login, else return empty string\n if ($this->helpertype !='login') {\n return ''; \n }\n return $this->helper->getLoginUrl(\n base_url() . $this->config->item('facebook_redirectUri'), \n $this->config->item('facebook_permissions')); \n }", "protected function getLoginUrl()\n\t{\n\t\t$pl = $this->getPlugin();\n\t\treturn $this->ctrl->getLinkTargetByClass(array($pl->getPageGUIClass(), \"ilpcpluggedgui\", \"ilquicksignupplugingui\"), \"loginView\",\n\t\t\t\"\", true);\n\t}", "function loginRedirect($data){\n $user = wp_get_current_user();\n if( $user ){\n $redirect = 'home-1';\n }\n else{\n $redirect = 'mm-error';\n }\n return $redirect;\n}", "protected function getLoginUrl()\n {\n return $this->router->generate(\"security_admin_login\");\n }", "public function snsLoginControl() {\n\t\t$driver = Route::getCurrentRoute()->getPath();\n\t\tswitch($driver) {\n\t\t\tcase 'login/facebook':\n\t\t\t\treturn Socialite::driver('facebook')->redirect();\n\t\t\t\tbreak;\n\t\t\tcase 'login/naver':\n\t\t\t\treturn Socialite::driver('naver')->redirect();\n\t\t\t\tbreak;\n\t\t\tcase 'login/kakao':\n\t\t\t\treturn Socialite::driver('kakao')->redirect();\n\t\t\t\tbreak;\n\t\t}\n\t}" ]
[ "0.7327277", "0.72961175", "0.72742546", "0.72742546", "0.72742546", "0.72058576", "0.7144817", "0.71383226", "0.7105929", "0.7058302", "0.70432794", "0.70323944", "0.6958803", "0.6899604", "0.68867666", "0.68792385", "0.6871554", "0.6860766", "0.68322736", "0.68291306", "0.6815818", "0.6715503", "0.6699814", "0.6687772", "0.6678764", "0.66764295", "0.6670093", "0.6663292", "0.66390365", "0.663864" ]
0.7516268
0
Fetches data from external stream and generates array of actions
public function fetch() { $actions = []; $logs = $this->fetchFromGraylog($this->config); $regex = '/^(?<log_message>\w+\s\w+)(\s-\s)(free\sspace: )(?<path>[^\s]+)(\s[^\s]+)(\s[^\s]+)(\s\()(?<free_space>[0-9]+)(%\sinode=[0-9]+%\)):$/m'; $skipHeader = true; foreach ($logs as $row) { if ($skipHeader) { $skipHeader = false; continue; } if (isset($row[0])) { $strDate = $row[0]; $msg = $row[1]; $hostname = $row[2]; $row = $this->parseWithRegex($msg, $regex); $datetime = new \DateTime($strDate); $actions[] = new Action('disk_space', ['path' => $row['path'], 'free_space' => $row['free_space'], 'hostname' => $hostname, 'time' => $datetime]); } } return $actions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fetchContactsStream($action = '')\n\t{\n\t\t//trigger pre event\n\t\t$result = $this->getEventManager()->trigger(__FUNCTION__ . '.pre', $this, array());\n\n\t\t/**\n\t\t * Set user details for request\n\t\t */\n\t\t//load user session data\n\t\t$objUserSession = FrontUserSession::isLoggedIn();\n\n\t\t//set file path\n\t\t$path = './data/cache/cache_streams/' . str_replace('-', '', $objUserSession->profile->profile_identifier);\n\t\tif (!is_dir($path))\n\t\t{\n\t\t\tmkdir($path, 0755, TRUE);\n\t\t}//end if\n\n\t\t$csv_file = $path . '/' . $objUserSession->profile->profile_identifier . '-contacts.csv';\n\t\t$csv_metadata_file = $path . '/' . $objUserSession->profile->profile_identifier . '-contacts.csv.metadata';\n\t\t$arr_return = array(\n\t\t\t\t'source_data_path' => $csv_file,\n\t\t\t\t'source_metadata' => $csv_metadata_file,\n\t\t);\n\n\t\tswitch ($action)\n\t\t{\n\t\t\tcase 'delete':\n\t\t\t\t@unlink($csv_file);\n\t\t\t\t@unlink($csv_metadata_file);\n\t\t\t\tbreak;\n\t\t}//end switch\n\n\t\t//check if data file exists\n\t\tif (is_file($csv_file) && is_file($csv_metadata_file))\n\t\t{\n\t\t\t//check if file has expired\n\t\t\t$arr = unserialize(file_get_contents($csv_metadata_file));\n\t\t\tif (!is_array($arr))\n\t\t\t{\n\t\t\t\t@unlink($csv_file);\n\t\t\t\t@unlink($csv_metadata_file);\n\t\t\t}//end if\n\n\t\t\tif (time() > $arr['expires'])\n\t\t\t{\n\t\t\t\t@unlink($csv_file);\n\t\t\t\t@unlink($csv_metadata_file);\n\t\t\t} else {\n\t\t\t\treturn $arr_return;\n\t\t\t}//end if\n\t\t}//end if\n\n\t\t//check if this is a user or site call\n\t\tif ($this->api_pword == \"\" || !$this->api_pword)\n\t\t{\n\t\t\t//try to extract from session\n\t\t\tif (is_object($objUserSession))\n\t\t\t{\n\t\t\t\t$this->api_pword = $objUserSession->pword;\n\t\t\t}//end if\n\t\t}//end if\n\n\t\t//set api username\n\t\tif ($this->api_user == \"\" || !$this->api_user)\n\t\t{\n\t\t\t//is api key encoded?\n\t\t\tif (is_object($objUserSession))\n\t\t\t{\n\t\t\t\tif (isset($objUserSession->api_key_encoded) && $objUserSession->api_key_encoded === TRUE)\n\t\t\t\t{\n\t\t\t\t\t$key = $this->getServiceLocator()->get(\"FrontCore\\Models\\FrontCoreSecurityModel\")->decodeValue($objUserSession->uname);\n\t\t\t\t\t$this->api_user = $key;\n\t\t\t\t} else {\n\t\t\t\t\t//try to extract from session\n\t\t\t\t\t$this->api_user = $objUserSession->uname;\n\t\t\t\t}//end if\n\t\t\t}//end if\n\t\t}//end if\n\n\t\t//set api key\n\t\tif ($this->api_key == \"\" || !$this->api_key)\n\t\t{\n\t\t\t//is api key encoded?\n\t\t\tif (is_object($objUserSession))\n\t\t\t{\n\t\t\t\tif (isset($objUserSession->api_key_encoded) && $objUserSession->api_key_encoded === TRUE)\n\t\t\t\t{\n\t\t\t\t\t$this->api_key = $this->getServiceLocator()->get(\"FrontCore\\Models\\FrontCoreSecurityModel\")->decodeValue($objUserSession->api_key);\n\t\t\t\t} else {\n\t\t\t\t\t//try to extract from session\n\t\t\t\t\t$this->api_key = $objUserSession->api_key;\n\t\t\t\t}//end if\n\t\t\t}//end if\n\t\t}//end if\n\t\trequire(\"./config/helpers/ob1.php\");\n\t\t$arr_set_headers = array();\n\t\tforeach ($arr_headers as $k => $v)\n\t\t{\n\t\t\t$arr_set_headers[] = \"$k: $v\";\n\t\t}//end foreach\n\n\t\t//load config\n\t\t$arr_config = $this->getServiceLocator()->get('config')['profile_config'];\n\n\t\t//build the url\n\t\t$arr_fields = array(\n\t\t\t'reg_id',\n\t\t\t'reg_id_encoded',\n\t\t\t'fname',\n\t\t\t'sname',\n\t\t\t'comm_destinations_email',\n\t\t\t'source',\n\t\t\t'reference',\n\t\t\t'datetime_created',\n\t\t\t'datetime_updated',\n\t\t\t'registration_status_status',\n\t\t\t'registration_status_colour',\n\t\t\t'user_uname',\n\t\t\t'user_sname'\n\t\t);\n\t\t$url = $arr_config['api_request_location'] . '/api/contacts?qp_limit=all&qp_stream_output_csv=1&qp_disable_hypermedia=1&qp_export_fields=' . implode(',', $arr_fields);\n\n\t\t/**\n\t\t * We use curl, its just easier\n\t\t */\n\t\tset_time_limit(0);\n\t\t$fp = fopen($csv_file, 'w');\n\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_FILE, $fp);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $arr_set_headers);\n\t\t$data = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\tfclose($fp);\n\n\t\t//set metadata\n\t\tfile_put_contents($csv_metadata_file, serialize(array('expires' => time() + (60 * 60))));\n\n\t\t//trigger pre event\n\t\t$result = $this->getEventManager()->trigger(__FUNCTION__ . '.post', $this, array());\n\n\t\t//return file paths\n\t\treturn $arr_return;\n\t}", "public function multiplex(array $actions): array;", "function fetch() {\n $this->data = file_get_contents($this->url());\n }", "protected function gatherActionData()\n {\n foreach ($this->actionsOrder as $actionType) {\n // Find all Actions to be processed.\n $actions = $this->getActions(\n $actionType,\n $this->scheduler->getPeriodStart(),\n $this->scheduler->getPeriodEnd()\n );\n\n // Store all the Action-related info in the Job entity.\n if (!$actions) {\n $this->io->text(\n 'No actions of type \"'.$actionType.'\" scheduled within the past '.$this->interval.' minutes.'\n );\n\n continue;\n }\n\n $tableHeaders = ['ID', 'Start Date', 'End Date', 'Name', 'Status'];\n if ($actionType != Action::TYPE_CAMPAIGN) {\n $tableHeaders[] = 'Campaign ID';\n $tableHeaders[] = 'Campaign Status';\n }\n if ($actionType == Action::TYPE_OPERATION) {\n $tableHeaders[] = 'Action ID';\n $tableHeaders[] = 'Action Status';\n }\n\n $outputTableRows = [];\n\n foreach ($actions as $action) {\n // Has a scheduler job been defined in the Action's module?\n $actionServices = $action->getModule()->getServices();\n if (!is_array($actionServices) || !isset($actionServices['job'])) {\n $message =\n 'No job service defined for module \"'\n .$action->getModule()->getIdentifier()\n .'\" in bundle \"'\n .$action->getModule()->getBundle()->getName().'\" '\n .'while processing Action of type \"'.$action->getType().'\" '\n .'with ID \"'.$action->getId().'\"'\n .'.';\n\n $this->io->text($message);\n\n continue;\n }\n\n // Queue new Job.\n $this->queueJob(\n $action->getType(),\n $action->getId(),\n $action->getModule()->getServices()['job'],\n 'action'\n );\n\n $this->logger->info(\n 'New job of {type} with the action ID {id} queued',\n [\n 'type' => $action->getType(),\n 'id' => $action->getId(),\n ]\n );\n\n // Highlight the date that is within the execution period.\n $startDate = $action->getStartDate()->format('Y-m-d H:i:s');\n $endDate = null;\n\n if ($action->getStartDate() >= $this->scheduler->getPeriodStart()) {\n $startDate = '<options=bold>'.$startDate.'</options=bold>';\n } elseif ($action->getEndDate()) {\n $endDate = $action->getEndDate()->format('Y-m-d H:i:s');\n $endDate = '<options=bold>'.$endDate.'</options=bold>';\n }\n\n $tableRows = [\n $action->getId(),\n $startDate,\n $endDate,\n $action->getName(),\n $action->getStatus(),\n ];\n\n if ($actionType == Action::TYPE_ACTIVITY || $actionType == Action::TYPE_MILESTONE) {\n $tableRows[] = $action->getCampaign()->getId();\n $tableRows[] = $action->getCampaign()->getStatus();\n }\n if ($actionType == Action::TYPE_OPERATION) {\n $tableRows[] = $action->getActivity()->getCampaign()->getId();\n $tableRows[] = $action->getActivity()->getCampaign()->getStatus();\n $tableRows[] = $action->getActivity()->getId();\n $tableRows[] = $action->getActivity()->getStatus();\n }\n\n $outputTableRows[] = $tableRows;\n }\n\n if (count($outputTableRows)) {\n // Create the table rows for output.\n $this->io->newLine();\n $this->io->text('These actions of type \"'.$actionType.'\" will be executed:');\n $this->io->table($tableHeaders, $outputTableRows);\n } else {\n $this->io->text(\n 'No actions of type \"'.$actionType.'\" scheduled within the past '.$this->interval.' minutes.'\n );\n }\n }\n }", "abstract public function getActions(): array;", "public function getEventStream();", "public static function get_actions();", "public function getEvents()\n {\n /* initialize empty buffer */\n $buffer = '';\n\n /* bring body of response */\n $body = $this->response->getBody();\n\n /* infinte loop */\n while (true) {\n /* if server close connection - try to reconnect */\n if ($body->eof()) {\n /* wait retry period before reconnection */\n sleep($this->retry / 1000);\n\n /* reconnect */\n $this->connect();\n\n /* clear buffer since there is no sense in partial message */\n $buffer = '';\n }\n /* start read into stream */\n $buffer .= $body->read(1);\n\n if (preg_match(self::END_OF_MESSAGE, $buffer)) {\n $parts = preg_split(self::END_OF_MESSAGE, $buffer, 2);\n\n $rawMessage = $parts[0];\n $remaining = $parts[1];\n\n $buffer = $remaining;\n\n /**\n * Save event into StreamEvent\n *\n * @var StreamEvent $event\n */\n $event = StreamEvent::parse($rawMessage);\n\n yield $event;\n }\n }\n }", "public function streamContent() {\n\t\t\n\t}", "public function getActions();", "public function getActions();", "public function getStream();", "public function getStream();", "public function getStream();", "public function getStream();", "public function getResponseStreaming() {}", "private function request() {\r\n\t\t$url = SCHEME . HTTP_HOST . HTTP_PORT . PATH;\r\n\t\treturn $this->data = file_get_contents($url, false, $this->build_query());\r\n\t}", "public static function httpStreamFactories(): array;", "public function get_actions() {\n\t\t$endpoints = array_keys( $this->_endpoints );\n\t\treturn array_combine( $endpoints, $endpoints );\n\t}", "public function streamContent()\n\t{\n\t\t\n\t}", "public function act()\n {\n $file_results = [];\n\n foreach ($this->_actions as $action) {\n $file_results[] = Document_Action::forge($this->_path, $action)->act();\n }\n\n return $file_results;\n }", "public function streamEvents(): \\Generator;", "protected function fetchData()\n\t{\n\t\t$this->_response = $this->_request->execute();\n\t\tif($this->_response->hasErrors())\n\t\t{\n\t\t\treturn array((array)$this->_response->error);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$items = $this->_response->results;\n\t\t\t$arrayItems = array();\n\t\t\tforeach($items as $itemObject)\n\t\t\t{\n\t\t\t\t$arrayItems[] = (array)$itemObject;\n\t\t\t}\n\t\t\treturn $arrayItems;\n\t\t}\n\t}", "protected function fetchDataAction() {\n\t\ttry {\n\n\t\t\t$listItems = $this->doAction('getRawColumns', array(\n\t\t\t\t'offset' => t3lib_div::_GP('start'),\n\t\t\t\t'rowcount' => t3lib_div::_GP('limit'),\n\t\t\t\t'sortingColumn' => t3lib_div::_GP('sort'),\n\t\t\t\t'sortingDirection' => t3lib_div::_GP('dir')\n\t\t\t));\n\n\t\t\t$count = $this->pager->get_totalItemCount();\n\t\t\t$data = '{\"success\": true, \"count\": '.$count.', \"listitems\":' . json_encode($listItems) . '}';\n\t\t} catch (Exception $exception) {\n\t\t\t$data = '{\"success\": false, \"message\": '.$exception->__toString().'}';\n\t\t}\n\t\t// output data directly\n\t\tob_clean();\n\n\t\theader('Cache-Control: no-cache, must-revalidate');\n\t\theader('Content-type: application/json');\n\t\theader(\"Content-Length: \".strlen($data));\n\n\t\techo $data;\n\t\texit();\n\t}", "public function run()\n {\n Source::create([\n \"name\" => \"BBC Gossip\",\n \"url\" => \"https://api.import.io/store/data/db62bf77-6862-49bd-9955-dc26b30cc2c5/_query?input/webpage/url=http%3A%2F%2Fwww.bbc.co.uk%2Fsport%2F0%2Ffootball%2Fgossip%2F&_user=cd943aba-5f7b-4b5f-bbb2-ba32fc0863db&_apikey=cd943aba5f7b4b5fbbb2ba32fc0863dbd8c75ffda5e937cc3bdb2f6a84d151265bd5edfe6f9e0c0d8b41963fa1957a5cf87a354e92f8233af5af9ed023e5319ae206249567f57fb93d8e468838e5549d\",\n \"url_node\" => \"external_link\",\n \"title_node\" => \"external_link/_text\",\n \"content_node\" => \"content\",\n \"image_node\" => \"\",\n \"filter\" => \"1\"\n ]);\n\n Source::create([\n \"name\" => \"Metro\",\n \"url\" => \"https://api.import.io/store/data/0a80a3ea-6b0a-4a20-aa3d-e17f3e8c0866/_query?input/webpage/url=http%3A%2F%2Fmetro.co.uk%2Fsport%2Ffootball%2F&_user=cd943aba-5f7b-4b5f-bbb2-ba32fc0863db&_apikey=cd943aba5f7b4b5fbbb2ba32fc0863dbd8c75ffda5e937cc3bdb2f6a84d151265bd5edfe6f9e0c0d8b41963fa1957a5cf87a354e92f8233af5af9ed023e5319ae206249567f57fb93d8e468838e5549d\",\n \"url_node\" => \"link\",\n \"title_node\" => \"title_link/_text\",\n \"content_node\" => \"excerpt_value\",\n \"image_node\" => \"image\",\n \"filter\" => \"1\"\n ]);\n\n Source::create([\n \"name\" => \"tottenhamhotspur.com\",\n \"url\" => \"https://api.import.io/store/data/850d0336-dcc0-4950-96c6-c4684710e830/_query?input/webpage/url=http%3A%2F%2Fwww.tottenhamhotspur.com%2Fnews-archive%2F&_user=cd943aba-5f7b-4b5f-bbb2-ba32fc0863db&_apikey=cd943aba5f7b4b5fbbb2ba32fc0863dbd8c75ffda5e937cc3bdb2f6a84d151265bd5edfe6f9e0c0d8b41963fa1957a5cf87a354e92f8233af5af9ed023e5319ae206249567f57fb93d8e468838e5549d\",\n \"url_node\" => \"link\",\n \"title_node\" => \"title\",\n \"content_node\" => \"content\",\n \"image_node\" => \"image\",\n \"filter\" => \"0\"\n ]);\n\n }", "public function read(){ return $this->source->fetch();}", "abstract public function get_remote_data();", "public function read()\n {\n // traverse through all items\n foreach ($this->xml->entry as $item) {\n $this->data[] = array(\n 'title' => (string)$item->title,\n 'description' => (string)$item->summary,\n 'category' => $this->get_categories($item),\n 'guid' => $this->get_guid($item),\n // No images in atom feeds, but search in content\n 'image' => $this->get_image($item),\n 'link' => $this->get_link($item),\n 'date' => $this->get_date($item),\n 'content' => (string)$item->content\n );\n }\n }", "public function getBatchActions();", "public function streamContent()\n {\n set_time_limit(0);\n ignore_user_abort(false);\n\n $handler = function ($owner) {\n //This should be executed only when connection is aborted.\n //We must flush statistics manualy.\n if (connection_status() == CONNECTION_ABORTED) {\n $afterContentSentEvent = new AfterContentSentEvent();\n $link = $owner->getLink();\n $afterContentSentEvent->bytes_sended = $owner->getBytesStreamed();\n $afterContentSentEvent->provider_id = $owner->provider->id;\n $afterContentSentEvent->provider_name = $owner->provider->name;\n $afterContentSentEvent->content_link = $link->link;\n $afterContentSentEvent->content_name = $link->content_name;\n $afterContentSentEvent->content_size = $link->content_size;\n $afterContentSentEvent->user_id = (Yii::$app->user->identity != null) ? Yii::$app->user->identity->id : null;\n $owner->trigger(StreamBehavior::EVENT_AFTER_STREAM, $afterContentSentEvent);\n Yii::$app->statistic->flush();\n }\n };\n //Register shutdown function to handle connection abort\n register_shutdown_function($handler, $this->owner);\n\n $this->bytesStreamed = 0;\n\n //Trigger before stream event\n $this->owner->trigger(self::EVENT_BEFORE_STREAM);\n\n $range = $this->owner->getHttpRange($this->owner->length);\n\n if ($range === false) {\n header('Content-Range: bytes */'.$this->owner->length);\n throw new HttpException(416, 'Requested range not satisfiable');\n }\n\n list($start, $end) = $range;\n $isRangeReq = ($start !== null && $end !== null && ($start !== 0 || $end !== $this->owner->length - 1));\n\n $context = $this->owner->createStreamContext();\n\n $params = [];\n\n if ($isRangeReq) {\n $params['rangeStart'] = (int)$start;\n $params['rangeEnd'] = (int)$end;\n }\n\n $stream = $this->owner->createStream($context, 'r', $params);\n\n if ($isRangeReq) {\n http_response_code(206);\n header('Content-Range: bytes '.$start.'-'.$end.'/'.$this->owner->length);\n header('Content-Length: '.$stream->getLength());\n }\n\n header('Content-Type: '.$this->owner->mimeType);\n header('Accept-Ranges: bytes');\n\n if (!ob_get_level()) {\n ob_start();\n }\n\n $contentChunkSentEvent = new ContentChunkSentEvent();\n $contentChunkSentEvent->stream = $stream;\n $contentChunkSentEvent->isPartial = $isRangeReq;\n\n try {\n while (($content = $stream->read())) {\n $contentChunkSentEvent->content = $content;\n $contentChunkSentEvent->bytes = strlen($content);\n //Trigger before content chunk sent event\n $this->owner->trigger(self::EVENT_BEFORE_CONTENT_CHUNK_SENT, $contentChunkSentEvent);\n echo $content;\n ob_flush();\n flush();\n //Trigger after content chunk sent event\n $this->owner->trigger(self::EVENT_AFTER_CONTENT_CHUNK_SENT, $contentChunkSentEvent);\n $this->bytesStreamed += strlen($content);\n }\n } catch (\\Exception $e) {\n @ob_end_clean();\n $stream->close();\n Yii::error($e);\n exit(1);\n }\n\n @ob_end_clean();\n\n $stream->close();\n //Trigger after stream event\n $afterContentSentEvent = new AfterContentSentEvent();\n $link = $this->owner->getLink();\n $afterContentSentEvent->bytes_sended = $this->getBytesStreamed();\n $afterContentSentEvent->provider_id = $this->owner->provider->id;\n $afterContentSentEvent->provider_name = $this->owner->provider->name;\n $afterContentSentEvent->content_link = $link->link;\n $afterContentSentEvent->content_name = $link->content_name;\n $afterContentSentEvent->content_size = $link->content_size;\n $afterContentSentEvent->user_id = (Yii::$app->user->identity != null) ? Yii::$app->user->identity->id : null;\n $this->owner->trigger(self::EVENT_AFTER_STREAM, $afterContentSentEvent);\n }" ]
[ "0.614982", "0.5675713", "0.5606393", "0.5585332", "0.5429489", "0.5429459", "0.54177487", "0.5317795", "0.5243621", "0.5230574", "0.5230574", "0.52285975", "0.52285975", "0.52285975", "0.52285975", "0.50743496", "0.50551873", "0.5037548", "0.5033939", "0.5021638", "0.5015126", "0.49851266", "0.49604988", "0.4950312", "0.49458587", "0.4945592", "0.4942019", "0.48931938", "0.48882025", "0.4871896" ]
0.5714736
1
Inserts a Measurement object into the Measurements table and returns the Measurement with the measurement_id property set, if successful; otherwise, returns the Measurement unchanged. Sets a measurement_id error if there is a db issue.
public static function addMeasurement($measurement) { $query = "INSERT INTO Measurements (measurement_index, measurement_value, measurement_timestamp, sensor_id) VALUES (:measurement_index, :measurement_value, :measurement_timestamp, :sensor_id)"; try { if (is_null($measurement) || $measurement->getErrorCount() > 0) return $measurement; $db = Database::getDB(); $statement = $db->prepare($query); $statement->bindValue(":measurement_index", $measurement->getMeasurementIndex()); $statement->bindValue(":measurement_value", $measurement->getMeasurementValue()); $statement->bindValue(":measurement_timestamp", $measurement->getMeasurementTimestamp()); $statement->bindValue(":sensor_id", $measurement->getSensorId()); $statement->execute(); $statement->closeCursor(); $newMeasurementId = $db->lastInsertId('measurement_id'); $measurement->setMeasurementId($newMeasurementId); } catch (Exception $e) { $measurement->setError('measurement_id', 'MEASUREMENT_INVALID'); } return $measurement; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createMeasurement($name, $treatmentID, $questionlistID)\n {\n $sql = \"INSERT INTO MEASUREMENT (Name, TreatmentID, QuestionlistID) \n\t\tVALUES (:name, :treatmentID, :questionlistID)\";\n\n $result = $this->query($sql, array(\n \":name\" => array($name, PDO::PARAM_STR),\n \":treatmentID\" => array($treatmentID, PDO::PARAM_INT),\n \":questionlistID\" => array($questionlistID, PDO::PARAM_INT)));\n\n return $result;\n }", "public function insert()\n\t{\n\t\t$measurementArray = array();\n\t\t$getData = array();\n\t\t$keyName = array();\n\t\t$funcName = array();\n\t\t$measurementArray = func_get_arg(0);\n\t\tfor($data=0;$data<count($measurementArray);$data++)\n\t\t{\n\t\t\t$funcName[$data] = $measurementArray[$data][0]->getName();\n\t\t\t$getData[$data] = $measurementArray[$data][0]->$funcName[$data]();\n\t\t\t$keyName[$data] = $measurementArray[$data][0]->getkey();\n\t\t}\n\t\t//data pass to the model object for insert\n\t\t$measurementModel = new MeasurementModel();\n\t\t$status = $measurementModel->insertData($getData,$keyName);\n\t\treturn $status;\n\t}", "public static function updateMeasurement($measurement) {\r\n\t\ttry {\r\n\t\t\t$db = Database::getDB();\r\n\t\t\t\r\n\t\t\tif (is_null($measurement) || $measurement->getErrorCount() > 0)\r\n\t\t\t\treturn $measurement;\r\n\t\t\t\r\n\t\t\t$checkMeasurement = MeasurementsDB::getMeasurementsBy('measurement_id',\r\n\t\t\t\t\t$measurement->getMeasurementId());\r\n\t\t\t\r\n\t\t\tif (empty($checkMeasurement)) {\r\n\t\t\t\t$measurement->setError('measurement_id', 'MEASUREMENT_DOES_NOT_EXIST');\r\n\t\t\t\treturn $measurement;\r\n\t\t\t}\r\n\t\t\tif ($measurement->getErrorCount() > 0)\r\n\t\t\t\treturn $measurement;\r\n\t\t\t\r\n\t\t\t$query = \"UPDATE Measurements SET measurement_index = :measurement_index,\r\n\t\t\t\t\tmeasurement_value = :measurement_value, measurement_timestamp = :measurement_timestamp,\r\n\t\t\t\t\tsensor_id = :sensor_id WHERE measurement_id = :measurement_id\";\r\n\t\t\t\r\n\t\t\t$statement = $db->prepare($query);\r\n\t\t\t$statement->bindValue(':measurement_index', $measurement->getMeasurementIndex());\r\n\t\t\t$statement->bindValue(':measurement_value', $measurement->getMeasurementValue());\r\n\t\t\t$statement->bindValue(':measurement_timestamp', $measurement->getMeasurementTimestamp());\r\n\t\t\t$statement->bindValue(':sensor_id', $measurement->getSensorId());\r\n\t\t\t$statement->bindValue(':measurement_id', $measurement->getMeasurementId());\r\n\t\t\t$statement->execute();\r\n\t\t\t$statement->closeCursor();\r\n\t\t} catch (Exception $e) {\r\n\t\t\t$measurement->setError('measurement_id', 'MEASUREMENT_COULD_NOT_BE_UPDATED');\r\n\t\t\t//echo $e->getMessage();\r\n\t\t\t//echo 'file: '.$e->getFile().' line: '.$e->getLine();\r\n\t\t}\r\n\t\t\r\n\t\treturn $measurement;\r\n\t}", "public function insert_performance($metric)\n\t{\n\t $data['metric_mbsec'] \t\t= $metric['mbsec'];\n\t\t$data['metric_iops'] \t\t\t= $metric['iops'];\n\t\t$data['metric_sizeiokbytes'] = $metric['sizeiokbytes'];\n\t\t$data['metric_latencyms'] \t= $metric['latencyms'];\n\t\t$data['metric_outstandingios'] = $metric['outstandingios'];\n\t\t$data['metric_type'] \t\t\t= $metric['type'];\n\t\t$data['metric_target'] \t\t= $metric['target'];\n\t\t$data['metric_testname'] \t\t= $metric['testname'];\n\t\t$data['metric_scenario'] \t\t= $metric['scenario'];\n\t\t$data['metric_unixdate'] \t\t= $metric['unixdate'];\n\t\t$data['metric_sysid_fk'] \t\t= $metric['sysid'];\n return $this->db->insert('storage_performance', $data);\n\t}", "public function store(MeasurementCreateRequest $request) {\n $response = $this->repository->create($request->all());\n\n return response()->json($response);\n }", "public function getMeasurement($measurementID)\n {\n $sql = \"SELECT *\n\t\tFROM MEASUREMENT\n\t\tWHERE MeasurementID = :measurementID\";\n\n $result = $this->query($sql, array(\n \":measurementID\" => array($measurementID, PDO::PARAM_INT)), \"one\");\n\n return $result;\n }", "public function create(Measurements_unit $measurements_unit)\n {\n return view(ad.'.measurements_units.add');\n }", "static public function insert(UnitOfMeasure $obj){\n\t\treturn 123;\n\t}", "private function insert()\n {\n $insert = $this->dsql();\n\n // Performs the actual database changes. Throw exception if problem occurs\n foreach ($this->elements as $name => $f) {\n if ($f instanceof Field) {\n if (!$f->editable() && !$f->system()) {\n continue;\n }\n if (!isset($this->dirty[$name]) && $f->defaultValue() === null) {\n continue;\n }\n\n $f->updateInsertQuery($insert);\n }\n }\n $this->hook('beforeInsert', array(&$insert));\n //delayed is not supported by INNODB, but what's worse - it shows error.\n //if($this->_save_as===false)$insert->option_insert('delayed');\n $id = $insert->insert();\n if ($id == 0) {\n // no auto-increment column present\n $id = $this->get($this->id_field);\n\n if ($id === null && $this->_save_as !== false) {\n throw $this->exception('Please add auto-increment ID column to your table or specify ID manually');\n }\n }\n $res = $this->hook('afterInsert', array($id));\n if ($res === false) {\n return $this;\n }\n\n if ($this->_save_as === false) {\n return $this->unload();\n }\n if ($this->_save_as) {\n $this->unload();\n }\n $o = $this->_save_as ?: $this;\n\n if ($this->fast && !$this->_save_as) {\n $this[$this->id_field] = $this->id = $id;\n\n return $this;\n }\n $res = $o->tryLoad($id);\n if (!$res->loaded()) {\n throw $this->exception('Saved model did not match conditions. Save aborted.');\n }\n\n return $res;\n }", "public function insert($monitor){\n $id=$monitor->getId();\n$marca=$monitor->getMarca();\n$modelo=$monitor->getModelo();\n$serial=$monitor->getSerial();\n$pulgadas=$monitor->getPulgadas();\n$observacion=$monitor->getObservacion();\n$estado=$monitor->getEstado();\n$cargo_id=$monitor->getCargo_id()->getId();\n\n try {\n $sql= \"INSERT INTO `monitor`( `id`, `marca`, `modelo`, `serial`, `pulgadas`, `observacion`, `estado`, `cargo_id`)\"\n .\"VALUES ('$id','$marca','$modelo','$serial','$pulgadas','$observacion','$estado','$cargo_id')\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }", "public function insert()\n {\n if ($this->id != 0) {\n return null; //can't insert something that already has an Id\n }\n\n $db = Db::instance(); //connect to db\n\n $q = sprintf(\"INSERT INTO `%s` (`firstName`, `lastName`, `birthDate`,\n `deathDate`, `description`) VALUES (%s, %s, %s, %s, %s);\",\n self::DB_TABLE,\n $db->escape($this->firstName),\n $db->escape($this->lastName),\n $db->escape($this->birthDate),\n $db->escape($this->deathDate),\n $db->escape($this->description)\n );\n\n $db->query($q);\n return $db->getInsertID();\n }", "private function _insert()\n {\n // Get the location or insert the new one\n $location = LocationHelper::insert($this->listing->location_data);\n\n // Insert the new property\n $property = PropertyHelper::insert($this->listing, $location);\n\n // Create a contact\n $contact = ContactHelper::insert($this->listing->data, $property);\n\n // Insert the new Units\n $units = UnitHelper::insert($property, $this->listing->data['units']);\n\n // return the property\n return $property;\n\n }", "public static function insert(Unit $unit)\n { \n $conn = &PDOData::connect();\n $stmt = $conn->prepare(\"INSERT INTO units (name, exchange_rate) VALUES (:name, :exchange_rate)\");\n \n $stmt->bindParam(':name', $event->getName(),PDO::PARAM_STR);\n $stmt->bindParam(':exchange_rate', $event->getExchange_rate()); \n $stmt->execute();\n\n $unitId = $conn->lastInsertId();\n PDOData::disconnect();\n\n return $unitId;\n }", "function insert() {\n\t\tglobal $db;\n\n\t\t$cols = array();\n\t\t$vals = array();\n\t\t$params = array();\n\t\tforeach ($this->changed as $col => $v) {\n\t\t\t$cols[] = \"`$col`\";\n\t\t\t$vals[] = \":$col\";\n\t\t\t$params[\":$col\"] = $this->{$col};\n\t\t}\n\n\t\t$cols = implode(\", \", array_filter($cols));\n\t\t$vals = implode(\", \", array_filter($vals));\n\n\t\t$qry = \"INSERT INTO `{$this->table}` ($cols) VALUES ($vals)\";\n\n\t\t$this->query($qry, $params);\n\t\t$this->id = $db->lastinsertid();\n\n\t\t$this->afterinsert();\n\n\t\treturn $this->id;\n\t}", "public function testInsertValidStatistic(){\n\t\t//count the number of rows and save\n\t\t$numRows = $this->getConnection()->getRowCount(\"statistic\");\n\n\t\t//create a new statistic and insert into mySQL\n\t\t$statistic = new Statistic(null, $this->VALID_STATISTICNAME);\n\t\t$statistic->insert($this->getPDO());\n\n\t\t//grab the data from mySQL and enforce the fields match expectations\n\t\t$pdoStatistic = Statistic::getStatisticByStatisticId($this->getPDO(), $statistic->getStatisticId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowcount(\"statistic\"));\n\t\t$this->assertEquals($pdoStatistic->getStatisticName(), $this->VALID_STATISTICNAME);\n\t}", "public function registerMeasurement(string $measurement): void;", "public function insert($wikiArticleforobject){\n\t\t$sql = 'INSERT INTO wiki_articleforobject (article_id, content_type_id, object_id, is_mptt) VALUES (?, ?, ?, ?)';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t\n\t\t$sqlQuery->setNumber($wikiArticleforobject->articleId);\n\t\t$sqlQuery->setNumber($wikiArticleforobject->contentTypeId);\n\t\t$sqlQuery->setNumber($wikiArticleforobject->objectId);\n\t\t$sqlQuery->setNumber($wikiArticleforobject->isMptt);\n\n\t\t$id = $this->executeInsert($sqlQuery);\t\n\t\t$wikiArticleforobject->id = $id;\n\t\treturn $id;\n\t}", "private final function saveInsert(){\n\t\t//Preparo el INSERT\n\t\tif (!$result = $this->db->insert(static::_table, $this->getStorableAttributes(get_class($this)))){\n\t\t\tthrow new Exception\\MysqlException('Error en consulta MySQL para guardar objeto de clase ' . get_class($this) . ' | MySQL Error: ' . $this->db->error() . ' | Query: ' . $query);\n\t\t}\n\t\t$this->setId($this->db->insertedId());\n\t\treturn $result;\n\t}", "public static function insert($data, $with_insert_id = false) {\n $query_managers = self::set_data_for_database($data);\n $qm_abstract_table = $query_managers['qm_abstract_table'];\n $qm_concrete_table = $query_managers['qm_concrete_table'];\n\n if (is_null($qm_abstract_table)) {\n return $qm_concrete_table->insert($with_insert_id);\n }\n\n $insert_id = $qm_abstract_table->insert(true);\n if ($insert_id === false) {\n return false;\n }\n\n $qm_concrete_table->set('id', $insert_id);\n\n $concrete_table_insert_result = $qm_concrete_table->insert();\n if ($concrete_table_insert_result === false) {\n return false;\n }\n\n if ($with_insert_id) {\n return $insert_id;\n } else {\n return true;\n }\n }", "function insert($melding)\n {\n $this->db->insert('melding', $melding);\n return $this->db->insert_id();\n }", "public function insert()\n {\n if (!$this->checkTable() || !$this->checkColumns() || !$this->checkValues()) {\n return false;\n }\n $sql = $this->buildQuery(self::QUERY_INSERT);\n\n return $this->query($sql);\n }", "public function insert()\n {\n $query = \"\";\n $result = false;\n\n try {\n $this->beginTransaction();\n\n $query = $this->assembleQuery($this->columns, true);\n $columns = $this->assembleInsertColumns();\n\n $sql = $this->buildInsert($this->db_name, $columns, $query);\n\n $this->db->Execute($sql);\n\n $result = $this->db->LastID();\n $this->commit();\n } catch (Exception $e) {\n $this->rollBack();\n $this->err_data = $e->getMessage();\n return false;\n }\n return $result;\n }", "public static function insert(Model &$object) {\n\n $database = self::get($object::_getDatabaseNamespace());\n $connection = $database->getConnection();\n\n $fields = $params = $placeholders = array();\n $object_data = $object->_getData();\n foreach($object->_getFields(true) as $object_field => $field_properties) {\n //Don't take any action for generated columns.\n if($field_properties['generated']){\n continue;\n }\n\n $object_value = $object_data[$object_field];\n\n $fields[] = $database->escape($object_field);\n if($object_value === $field_properties['default'] && $field_properties['serial'] === true) {\n $placeholders[] = 'DEFAULT';\n } else {\n $params[] = $database->valueToSQL($object_value);\n $placeholders[] = '?';\n }\n }\n\n $sql = sprintf(\n 'INSERT INTO %s.%s (%s) VALUES (%s);', $database->escape($object::_getSchemaName()),\n $database->escape($object::_getTableName()),\n implode(',', $fields),\n implode(',', $placeholders)\n );\n\n try {\n $connection->prepare($sql)->execute($params);\n } catch (\\PDOException $e){\n throw $connection->getDriverClass()::convertException($e);\n }\n $primary_key = $object::_getPrimaryKey();\n if($primary_key !== null && count($primary_key) === 1) {\n $column = current($primary_key);\n $field = $object::_getField($column);\n if($field['serial'] === true){\n $liid = intval($connection->lastInsertId($field['sequence']));\n $object->$column = $liid;\n }\n }\n\n return $object->_setLoaded();\n }", "public function insert($medium)\n {\n $query=\"INSERT INTO medium ( \".\n\t \"id,\".\n \"release,\".\n \"position,\".\n \"format,\".\n \"name,\".\n \"edits_pending,\".\n \"last_updated,\".\n \"track_count \". \n \")\".\n \"VALUES (\".\n \"null,\".\n \" \".$medium->release.\" ,\".\n \" \".$medium->position.\" ,\".\n \" \".$medium->format.\" ,\".\n \"'\".$this->sqlSafe($medium->name).\"',\".\n \" \".$medium->edits_pending.\" ,\".\n \"'\".$this->sqlSafe($medium->last_updated).\"',\".\n \" \".$medium->track_count.\" \". \n \")\"; \n\n $this->executeQuery($query);\n }", "public function insert() {\n\n // Does the movie object already have an ID?\n if ( !is_null( $this->id ) ) trigger_error ( \"movie::insert(): Attempt to insert an movie object that already has its ID property set (to $this->id).\", E_USER_ERROR );\n\n // Insert the movie\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"INSERT INTO movies ( title, releaseyear, synopsis, poster, trailer, director, genre, rating ) VALUES ( :title, :releaseyear, :synopsis, :poster, :trailer, :director, :genre, :rating )\";\n $st = $conn->prepare ( $sql );\n $st->bindValue( \":title\", $this->title, PDO::PARAM_STR );\n $st->bindValue( \":releaseyear\", $this->releaseyear, PDO::PARAM_STR );\n $st->bindValue( \":synopsis\", $this->synopsis, PDO::PARAM_STR );\n $st->bindValue( \":poster\", $this->poster, PDO::PARAM_STR );\n $st->bindValue( \":trailer\", $this->trailer, PDO::PARAM_STR );\n $st->bindValue( \":director\", $this->director, PDO::PARAM_STR );\n $st->bindValue( \":genre\", $this->genre, PDO::PARAM_STR );\n $st->bindValue( \":rating\", $this->rating, PDO::PARAM_STR );\n\n $st->execute();\n $this->id = $conn->lastInsertId();\n $conn = null;\n }", "public function insert(){\r\n\r\n $result = false;\r\n $key_provided = false;\r\n\r\n try{\r\n $cols = '';\r\n $arg_types = '';\r\n $cols = [];\r\n $bind = [];\r\n $args = [];\r\n $args[] = &$arg_types;\r\n foreach( $this->fillable as $attr ){\r\n if( array_key_exists($attr, $this->attributes) && $this->attributes[$attr] != '' ){\r\n if( $attr == $this->key ){\r\n $key_provided = true;\r\n }\r\n $arg_types .= $this->cols[$attr];\r\n $args[] = &$this->attributes[$attr];\r\n $bind[] = '?';\r\n $cols[] = '`' . $attr . '`';\r\n }\r\n }\r\n\r\n $query = 'insert into `' . $this->table . '` ';\r\n $query .= ' (' . implode(',', $cols) . ') ';\r\n $query .= ' values (' . implode(',',$bind) . ')';\r\n\r\n $dbHandler = new MySqlHandler();\r\n if( ! $dbHandler->dbConnected() ){\r\n throw new Exception('DB connection failed');\r\n }\r\n $affected_rows = $dbHandler->executePreparedScalarQuery( $query, $args );\r\n if( $affected_rows === 1 ){\r\n\r\n $result = true;\r\n if( ! $key_provided ){\r\n $this->attributes[$this->key] = $dbHandler->getLastInsertId();\r\n }\r\n\r\n }else{\r\n if( $dbHandler->errorno === MySqlHandler::$DUPLICATE_ERROR ){\r\n throw new Exception('Duplicate entry.');\r\n }else{\r\n throw new Exception($dbHandler->mysqliError);\r\n }\r\n }\r\n\r\n $dbHandler->close();\r\n\r\n }catch (Exception $e){\r\n unset($dbHandler);\r\n throw new Exception( $e->getMessage() );\r\n }\r\n\r\n return $result;\r\n }", "public function insert2($medium)\n {\n $query=\"INSERT INTO medium ( \".\n\t \"id,\".\n \"release,\".\n \"position,\".\n \"format,\".\n \"name,\".\n \"edits_pending,\".\n \"last_updated,\".\n \"track_count \". \n \")\".\n \"VALUES (\".\n \"null,\".\n \" \".$medium->release.\" ,\".\n \" \".$medium->position.\" ,\".\n \" \".$medium->format.\" ,\".\n \"'\".$this->sqlSafe($medium->name).\"',\".\n \" \".$medium->edits_pending.\" ,\".\n \"'\".$this->sqlSafe($medium->last_updated).\"',\".\n \" \".$medium->track_count.\" \". \n \")\"; \n\n $id = $this->executeInsert($query);\n\t $medium->id = $id;\n\t return($medium);\t\n }", "public static function Save(&$machinery){\n\t\t$id = $machinery->getId();\n\t\t$properties = array(\n\t\t\t\t\"photoId\" => null,\n\t\t\t\t\"date\" => Date::ParseDate($machinery->getDate()),\n\t\t\t\t\"description\" => self::$IsUsingUtf8 ? htmlentities(utf8_decode($machinery->getDescription()), ENT_COMPAT, self::$Charset, false) : htmlentities($machinery->getDescription(), ENT_COMPAT, self::$Charset, false),\n\t\t\t\t\"title\" => self::$IsUsingUtf8 ? htmlentities(utf8_decode($machinery->getTitle()), ENT_COMPAT, self::$Charset, false) : htmlentities($machinery->getTitle(), ENT_COMPAT, self::$Charset, false),\n\t\t\t\t\"active\" => intval($machinery->getActive())\n\t\t\t);\n\t\tif(is_object($machinery->getPhoto())){\n\t\t\t$properties[\"photoId\"] = $machinery->getPhoto()->getId();\n\t\t}\n\t\t$emptyValues = '';\n\t\tif(empty($properties[\"date\"])){\n\t\t\t$emptyValues .= ' date';\n\t\t}\n\t\tif(empty($properties[\"title\"])){\n\t\t\t$emptyValues .= ' title';\n\t\t}\n\t\tif(empty($emptyValues)){\n\t\t\t$query = new Query();\n\t\t\tif(!empty($id) && is_int($id)){\n\t\t\t\t$query->createUpdate('machineries', $properties, 'id = \"'.$id.'\"', true);\n\t\t\t\t$isExecuted = $query->execute();\n\t\t\t\tif(!$isExecuted){\n\t\t\t\t\tthrow new Exception('Unable to update Machinery \"'.$id.'\" in database. (MachineryModel::save())');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$query->createInsert('machineries', $properties, true);\n\t\t\t\t$isExecuted = $query->execute();\n\t\t\t\tif($isExecuted){\n\t\t\t\t\t//get the last inserted id\n\t\t\t\t\t$query->createSelect(array('MAX(id) as id'), 'machineries');\n\t\t\t\t\t$value = $query->execute();\n\t\t\t\t\t$machinery->setId($value['id']);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Exception('Unable to insert Machinery in database. (MachineryModel::save())');\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Exception('Unable to save Machinery with empty required values:'.$emptyValues.'. (MachineryModel::save())');\n\t\t}\n\t\treturn true;\n\t}", "public function testInsertInvalidTeamStatistic() {\n\t\t// create a Team Statistic with a non null id, and watch it fail\n\t\t$teamStatistic = new TeamStatistic(SprotsTest::INVALID_KEY, SprotsTest::INVALID_KEY, SprotsTest::INVALID_KEY, SprotsTest::INVALID_KEY, SprotsTest::INVALID_KEY);\n\t\t$teamStatistic->insert($this->getPDO());\n\t}", "public function insert()\n {\n $sql = $this\n ->sqlBuilder\n ->reset()\n ->insert($this->data)\n ->into($this->table)\n ->sql();\n\n if (!$this->db->preparedQuery($sql['sql'], $sql['types'], $sql['params'])) {\n return false;\n }\n\n $insertId = $this->db->getLastInsertId();\n\n if (false === $insertId) {\n return false;\n }\n\n return $insertId;\n }" ]
[ "0.56230783", "0.55290294", "0.53595924", "0.52884966", "0.5250881", "0.51845026", "0.5149847", "0.50212044", "0.50074023", "0.4966835", "0.49530903", "0.4940192", "0.49004564", "0.4888404", "0.4875894", "0.4856564", "0.48557544", "0.48184156", "0.48006192", "0.4800233", "0.47885302", "0.47851175", "0.47832352", "0.4765978", "0.47592592", "0.475876", "0.47416347", "0.4725538", "0.471134", "0.4710719" ]
0.7027099
0
Returns an array of Measurements that meet the criteria specified. If unsuccessful, this function returns an empty array.
public static function getMeasurementsBy($type = null, $value = null) { $measurementRows = MeasurementsDB::getMeasurementRowsBy($type, $value); return MeasurementsDB::getMeasurementsArray($measurementRows); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listMeasurements(): array;", "public function getMeasures()\n {\n return $this->measures;\n }", "public function expectedDimensionResults()\n {\n return [\n 'positiveDimension' => [\n 'givenDimension' => 5,\n 'expectedDimension' => 5,\n ],\n 'negativeDimension' => [\n 'givenDimension' => -5,\n 'expectedDimension' => 5,\n ],\n ];\n }", "public function getResults()\n\t{\n\t\t$results = array();\n\n\t\tif(count($this->times) > 0)\n\t\t{\n\t\t\t$times = array_values($this->times);\n\n\t\t\tforeach($this->times as $key => $arr)\n\t\t\t{\n\t\t\t\tif(is_string($key))\n\t\t\t\t\t$results[$key] = $arr['elapsed'];\n\t\t\t\telse\n\t\t\t\t\t$results[] = $arr['elapsed'];\n\t\t\t}\n\n\t\t\t$first = reset($this->times);\n\t\t\t$last = end($this->times);\n\t\t\t$results['total_elapsed'] = $last['started'] - $first['finished'];\n\t\t}\n\n\t\treturn $results;\n\t}", "public static function getMeasurementRowsBy($type = null, $value = null) {\r\n\t\t$allowedTypes = ['measurement_id', 'sensor_id'];\r\n\t\t$measurementRows = array();\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$db = Database::getDB();\r\n\t\t\t$query = \"SELECT measurement_id, measurement_index, measurement_value,\r\n\t\t\t\t\tmeasurement_timestamp, sensor_id FROM Measurements\";\r\n\t\t\t\r\n\t\t\tif (!is_null($type)) {\r\n\t\t\t\tif (!in_array($type, $allowedTypes))\r\n\t\t\t\t\tthrow new PDOException(\"$type not an allowed search criterion for Measurements\");\r\n\t\t\t\t\r\n\t\t\t\t$query = $query . \" WHERE ($type = :$type)\";\r\n\t\t\t\t$statement = $db->prepare($query);\r\n\t\t\t\t$statement->bindParam(\":$type\", $value);\r\n\t\t\t} else {\r\n\t\t\t\t$query = $query . \" ORDER BY measurement_index ASC\";\r\n\t\t\t\t$statement = $db->prepare($query);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$statement->execute();\r\n\t\t\t$measurementRows = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\t$statement->closeCursor();\r\n\t\t} catch (Exception $e) {\r\n\t\t\techo \"<p>Error getting measurement rows by $type: \".$e->getMessage().\"</p>\";\r\n\t\t}\r\n\t\t\r\n\t\treturn $measurementRows;\r\n\t}", "public static function FetchAll($params=array('orderBy', 'from', 'amount')){\n\t\t$machineriesArray = array();\n\t\t$params = self::CheckParams($params, self::FetchAll);\n\t\t$orderBy = array();\n\t\tif(!empty($params['orderBy'])){\n\t\t\t$orderBy = implode(',', $params['orderBy']);\n\t\t}\n\t\t$limit = '';\n\t\tif(!empty($params['from'])){\n\t\t\t$limit = ''.$params['from'];\n\t\t\tif(!empty($params['amount'])){\n\t\t\t\t$limit .= ', '.$params['amount'];\n\t\t\t} else {\n\t\t\t\t$limit .= ', 10';\n\t\t\t}\n\t\t}\n\t\t$query = new Query();\n\t\t$query->createSelect(array('*'), 'machineries', null, null, $orderBy, $limit);\n\t\t$arrayArraysMachinery = $query->execute(true);\n\t\tif(!empty($arrayArraysMachinery)){\n\t\t\tforeach($arrayArraysMachinery as $arrayMachinery){\n\t\t\t\tarray_push($machineriesArray, self::CreateObjectFromArray($arrayMachinery));\n\t\t\t}\n\t\t}\n\t\treturn $machineriesArray;\n\t}", "public function getResultsWithData()\n {\n $resultsWithData = [];\n foreach ($this->results as $i => $result) {\n if ($result->data_completeness != 'empty') {\n $resultsWithData[] = $result;\n }\n }\n\n return $resultsWithData;\n }", "protected function getMetrics()\n {\n return collect($this->metricKeys())\n ->map(function ($metric) {\n return $this->get($metric);\n })->filter()\n ->toArray();\n }", "protected function _getResults()\n {\n if ($this->_properties['results_schools']) {\n return $this->_properties['results_schools'];\n }\n\n if ($this->_properties['results_districts']) {\n return $this->_properties['results_districts'];\n }\n\n return [];\n }", "public static function runChecksDataProvider()\n\t{\n\t\treturn array(\n\t\t\tarray('aaa', '2009-07-08 10:00:00', FALSE, FALSE),\t// 0% accept rate, but no timeouts\n\t\t\tarray('aaa', '2009-07-08 11:00:00', FALSE, FALSE),\t// 50% accept rate, but no timeouts\n\t\t\tarray('aaa', '2009-07-08 11:30:00', FALSE, FALSE),\t// 50% accept rate, and 1 timeout\n\t\t\tarray('aaa', '2009-07-08 12:00:00', '2009-07-08 15:00:00', 'Accept Rate = 33.3% AND Timeouts/Errors/Blanks = 2'),\t// 33.3% accept rate, and 2 timeouts\n\t\t);\n\t}", "public static function getUnits()\n {\n $conn = &PDOData::connect();\n $stmt = $conn->prepare(\"SELECT * FROM units\");\n $stmt->execute();\n\n $result = array();\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $result[] = $row;\n }\n\n PDOData::disconnect();\n return $result;\n }", "public function generateMedics()\n {\n $search = request()->all();\n $statistics = [];\n \n if($search){\n\n $search['medic'] = (isset($search['medic'])) ? $search['medic'] : '';\n $search['date1'] = (isset($search['date1'])) ? $search['date1'] : '';\n $search['date2'] = (isset($search['date2'])) ? $search['date2'] : '';\n\n \n \n if($search['medic'])\n $statistics = $this->medicRepo->reportsStatisticsByMedic($search);\n else\n $statistics = $this->medicRepo->reportsStatistics($search);\n \n \n }\n \n return $statistics;\n }", "public function measurements()\n {\n return $this->hasMany(Measurement::class, 'physical_quantity_id');\n }", "public function getTestCaseResults(): array;", "public static function getMeasurementsArray($rows) {\r\n\t\t$measurements = array();\r\n\t\t\r\n\t\tif (!empty($rows)) {\r\n\t\t\t// Convert the array of arrays into an array of Measurements\r\n\t\t\t// and set the id field\r\n\t\t\tforeach ($rows as $measurementRow) {\r\n\t\t\t\t$measurement = new Measurement($measurementRow);\r\n\t\t\t\t\r\n\t\t\t\t$measurementId = $measurementRow['measurement_id'];\r\n\t\t\t\t$measurement->setMeasurementId($measurementId);\r\n\t\t\t\t\r\n\t\t\t\tarray_push($measurements, $measurement);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $measurements;\r\n\t}", "public function information_units_measure($id)\n {\n return $this->db->where('id_unit_measure', $id)->get('units_measure')->result_array();\n }", "public static function FindByMultipleValues($params, $expectsOne=false){\n\t\t$machineriesArray = array();\n\t\tif(is_array($params)){\n\t\t\t$params = self::CheckParams($params);\n\t\t\t//TODO: Use Query::Make() !!!\n\t\t\t$whereArray = array();\n\t\t\tforeach ($params['where'] as $key => $value){\n\t\t\t\tif(!empty($value) && is_array($value)){\n\t\t\t\t\tarray_push($whereArray, $key.' IN ('.implode(', ', $value).')');\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Exception('Invalid param, array expected in MachineryModel::FindByMultipleValues()');\n\t\t\t\t}\n\t\t\t}\n\t\t\t$where = implode(' OR ', $whereArray);\n\t\t\t$orderBy = array();\n\t\t\tif(!empty($params['orderBy'])){\n\t\t\t\t$orderBy = implode(',', $params['orderBy']);\n\t\t\t}\n\t\t\t$limit = '';\n\t\t\tif(!empty($params['from'])){\n\t\t\t\t$limit = ''.$params['from'];\n\t\t\t\tif(!empty($params['amount'])){\n\t\t\t\t\t$limit .= ', '.$params['amount'];\n\t\t\t\t} else {\n\t\t\t\t\t$limit .= ', 10';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$query = new Query();\n\t\t\t$query->createSelect(array('*'), 'machineries', null, $where, $orderBy, $limit);\n\t\t\t$arrayArraysMachinery = $query->execute(true);\n\t\t\tif(!empty($arrayArraysMachinery)){\n\t\t\t\tforeach($arrayArraysMachinery as $arrayMachinery){\n\t\t\t\t\tarray_push($machineriesArray, self::CreateObjectFromArray($arrayMachinery));\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Exception('Invalid param, array expected in MachineryModel::FindByMultipleValues()');\n\t\t}\n\t\treturn $machineriesArray;\n\t}", "public function getResults()\n {\n return $this->cleanData();\n\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM assessment_criterion';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "function getResults($reports) {\n $returnValue = NULL;\n for ($reportIndex = 0; $reportIndex < count($reports); $reportIndex++) {\n $report = $reports[$reportIndex];\n $header = $report->getColumnHeader();\n $dimensionHeaders = $header->getDimensions();\n $metricHeaders = $header->getMetricHeader()->getMetricHeaderEntries();\n $rows = $report->getData()->getRows();\n\n for ($rowIndex = 0; $rowIndex < count($rows); $rowIndex++) {\n $row = $rows[$rowIndex];\n $dimensions = $row->getDimensions();\n $metrics = $row->getMetrics();\n for ($i = 0; $i < count($dimensionHeaders) && $i < count($dimensions); $i++) {\n // print($dimensionHeaders[$i] . \": \" . $dimensions[$i] . \"\\n\");\n }\n for ($j = 0; $j < count($metrics); $j++) {\n $values = $metrics[$j]->getValues();\n for ($k = 0; $k < count($values); $k++) {\n $entry = $metricHeaders[$k];\n // print($entry->getName() . \": \" . $values[$k] . \"\\n\");\n if ($entry->getName() === \"users\") {\n $returnValue = $values[$k];\n }\n }\n }\n }\n }\n return $returnValue;\n}", "public function analyse(): array\n {\n $results = [];\n\n // Loop through our data rows to look for matching keys this filter can cleanse\n foreach ($this->data as $index => $row) {\n // Set up our results array for this row\n $results[$index] = [\n 'dirty_data' => [],\n 'overall_dirtiness_score' => 0,\n ];\n\n foreach ($row as $key => $value) {\n if (array_key_exists($key, $this->filters)) {\n $filter = new $this->filters[$key]($value);\n\n if (!$filter->isClean()) {\n $results[$index]['overall_dirtiness_score'] += $filter->getDirtinessScore();\n $results[$index]['dirty_data'][$key] = [\n 'value' => $value,\n 'suggestion' => $filter->getSuggestion(),\n 'dirtiness_score' => $filter->getDirtinessScore(),\n ];\n }\n }\n }\n }\n\n return $results;\n }", "public function getQueryCriteria(): array\n {\n return [\n 'created_after' => new DateValidator,\n 'created_before' => new DateValidator,\n 'id_greater_than' => new PositiveIntValidator,\n 'id_less_than' => new PositiveIntValidator,\n 'updated_before' => new DateValidator,\n 'updated_after' => new DateValidator,\n 'only_identified' => new BooleanValidator,\n 'prospect_ids' => new PositiveIntListValidator\n ];\n }", "public function query()\n {\n // Array of strings by table type and year\n $strings = $this->range->totalStrings();\n $array = [];\n // Loop through all years in the range and all tables\n foreach ($this->range->years() as $year) {\n foreach ($this->range->tables() as $type => $metrics) {\n\n // If there is no string for this table type, skip\n if (! isset($strings[$type][$year]) || $strings[$type] == []) {\n continue;\n }\n $rangeString = $strings[$type][$year];\n\n // Bypass empty string\n if ($rangeString == 'SUM() AS total') {\n continue;\n }\n $table = $this->setTable($type, $year);\n $queryString = $this->buildQueryString($table, $rangeString);\n\n $this->setQueryString($queryString, $metrics);\n\n $this->setPrograms($table)\n ->setChannels($table)\n ->setGroups($table)\n ->getResults();\n $array[$year][$type] = $this->query;\n }\n }\n return $array;\n }", "private static function getComplianceData()\n\t\t{\n\t\t\t$query = new Query();\n\t\t\t$centres=\t$query->select(['name','wpLocCode','code','_id'=>false])\n\t\t\t\t\t\t->from ('centres')\n\t\t\t\t\t\t->where(['status'=>Centres::STATUS_ACTIVE])\n\t\t\t\t\t\t->all();\n\n\t\t \tforeach($centres as $centre):\n\t\t\t\t\t$centresCode[] = (int)Arrayhelper::getValue($centre,'wpLocCode');\n\t\t\tendforeach;\n\t\t\t\t\n\t\t\t\n\t\t\t//get all questionnaires for a centre whose For-month date is \n\t\t\t\t//less than the reminder date \n\t\t\t\t//& status is submitted, rework,closed or approved\n\t\t\t\n\t\t\t$startDate = self::getYearStartDate();\n\t\t\t$stDateTS = strtotime($startDate);\n\t\t\t$que = new Query();\n\t\t\t$compliance = $que->select([\n\t\t\t\t\t\t\t\t\t'queId',\n\t\t\t\t\t\t\t\t\t'forDate',\n\t\t\t\t\t\t\t\t\t'forYear',\n\t\t\t\t\t\t\t\t\t'forDateTS',\n\t\t\t\t\t\t\t\t\t'centreID',\n\t\t\t\t\t\t\t\t\t'created_uname'\n\t\t\t\t\t\t\t\t])\n\t\t\t\t\t\t\t\t->from('questionnaire')\n\t\t\t\t\t\t\t\t->where([\n\t\t\t\t\t\t\t\t\t'in','status',\n\t\t\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t\t\tQuestionnaire::STATUS_APPROVED,\n\t\t\t\t\t\t\t\t\t\t\tQuestionnaire::STATUS_CLOSED,\n\t\t\t\t\t\t\t\t\t\t\tQuestionnaire::STATUS_SUBMITTED,\n\t\t\t\t\t\t\t\t\t\t\tQuestionnaire::STATUS_REWORK,\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->andFilterCompare('forDateTS', $stDateTS, '>=')\n\t\t\t\t\t\t\t\t->all();\n\t\t\treturn $compliance; \n\t\t}", "public static function getMeasurementsValuesBy($type = null, $value = null, $column) {\r\n\t\t$measurementRows = MeasurementsDB::getMeasurementRowsBy($type, $value);\r\n\t\t\r\n\t\treturn MeasurementsDB::getMeasurementValues($measurementRows, $column);\r\n\t}", "function getRequirements($where='') {\n $result = array();\n \n $this->db->select('requirements.*,mandals.name as mandal,villages.name as village');\n\t\t$this->db->join('mandals','mandals.id = requirements.mandal_id','left');\n $this->db->join('villages','villages.id = requirements.village_id','left');\n $this->db->from('requirements');\n\t\tif (is_array($where) && count($where) > 0)\n $this->db->where($where);\n $query = $this->db->get();\n\t\t\n if ($query->num_rows()) {\n return $query->result_array();\n } else\n return false;\n }", "public function getMetrics()\n {\n return array();\n }", "protected function getArrayCollection(): array\n {\n return $this->getResults();\n }", "public function getHaving(): array;", "private function getActualResultsArray() : array {\n\t\t$results = [];\n\n\t\tif (isset($this->results['results']['organic'])) {\n\t\t\t$results = $this->results['results']['organic'];\n\t\t}\n\n\t\treturn $results;\n\t}" ]
[ "0.64491725", "0.56492114", "0.5269204", "0.5253056", "0.5198788", "0.51982504", "0.51665276", "0.51549256", "0.51509446", "0.505163", "0.50321674", "0.49984178", "0.4995018", "0.49938443", "0.4983037", "0.4974119", "0.49723324", "0.49713087", "0.4970004", "0.49676764", "0.49488443", "0.49194038", "0.49088985", "0.48885846", "0.4885199", "0.48823836", "0.4879588", "0.48710117", "0.4848932", "0.4845511" ]
0.6024222
1
Returns an array of the rows from the Measurements table whose $type field has value $value. Throws an exception if unsuccessful.
public static function getMeasurementRowsBy($type = null, $value = null) { $allowedTypes = ['measurement_id', 'sensor_id']; $measurementRows = array(); try { $db = Database::getDB(); $query = "SELECT measurement_id, measurement_index, measurement_value, measurement_timestamp, sensor_id FROM Measurements"; if (!is_null($type)) { if (!in_array($type, $allowedTypes)) throw new PDOException("$type not an allowed search criterion for Measurements"); $query = $query . " WHERE ($type = :$type)"; $statement = $db->prepare($query); $statement->bindParam(":$type", $value); } else { $query = $query . " ORDER BY measurement_index ASC"; $statement = $db->prepare($query); } $statement->execute(); $measurementRows = $statement->fetchAll(PDO::FETCH_ASSOC); $statement->closeCursor(); } catch (Exception $e) { echo "<p>Error getting measurement rows by $type: ".$e->getMessage()."</p>"; } return $measurementRows; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getMeasurementsBy($type = null, $value = null) {\r\n\t\t$measurementRows = MeasurementsDB::getMeasurementRowsBy($type, $value);\r\n\t\t\r\n\t\treturn MeasurementsDB::getMeasurementsArray($measurementRows);\r\n\t}", "public static function getMeasurementsValuesBy($type = null, $value = null, $column) {\r\n\t\t$measurementRows = MeasurementsDB::getMeasurementRowsBy($type, $value);\r\n\t\t\r\n\t\treturn MeasurementsDB::getMeasurementValues($measurementRows, $column);\r\n\t}", "public static function getMoviesRowSetsBy($type = null, $value = null) {\r\n\t\t$allowedTypes = [\"movieId\", \"movieTitle\", \"releaseDate\", \"returnBy\", \"copyAvailable\"];\r\n\t\t$moviesRowSets = array();\r\n\t\ttry {\r\n\t\t\t$db = Database::getDB ();\r\n\t\t\t$query = \"SELECT movieId, movieTitle, releaseDate, returnBy, copyAvailable FROM Movies\";\r\n\t\t\tif (!is_null($type)) {\r\n\t\t\t\tif (!in_array($type, $allowedTypes))\r\n\t\t\t\t\tthrow new PDOException(\"$type not an allowed search criterion for Movies\");\r\n\t\t\t\t$query = $query. \" WHERE ($type = :$type)\";\r\n\t\t\t\t$statement = $db->prepare($query);\r\n\t\t\t\t$statement->bindParam(\":$type\", $value);\r\n\t\t\t} else\r\n\t\t\t\t$statement = $db->prepare($query);\r\n\t\t\t$statement->execute ();\r\n\t\t\t$moviesRowSets = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\t$statement->closeCursor ();\r\n\t\t} catch (Exception $e) { // Not permanent error handling\r\n\t\t\techo \"<p>Error getting user rows by $type: \" . $e->getMessage () . \"</p>\";\r\n\t\t}\r\n\t\treturn $moviesRowSets;\r\n\t}", "public static function getGameRowSetsBy($type = null, $value = null) {\r\n\t\t$allowedTypes = [\"id\", \"pending\", \"server\"];\r\n\t\t$gameRowSets = array();\r\n\t\ttry {\r\n\t\t\t$db = Database::getDB ();\r\n\t\t\t$query = \"SELECT * FROM games\";\r\n\t\t\tif (!is_null($type)) {\r\n\t\t\t\tif (!in_array($type, $allowedTypes))\r\n\t\t\t\t\tthrow new PDOException(\"$type not an allowed search criterion for Games\");\r\n\t\t\t\t$query = $query. \" WHERE ($type = :$type)\";\r\n\t\t\t\t$statement = $db->prepare($query);\r\n\t\t\t\t$statement->bindParam(\":$type\", $value);\r\n\t\t\t} else\r\n\t\t\t\t$statement = $db->prepare($query);\r\n\t\t\t$statement->execute ();\r\n\t\t\t$gameRowSets = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\t$statement->closeCursor ();\r\n\t\t} catch (Exception $e) { // Not permanent error handling\r\n\t\t\techo \"<p>Error getting game rows by $type: \" . $e->getMessage () . \"</p>\";\r\n\t\t}\r\n\t\treturn $gameRowSets;\r\n\t}", "public static function getPolicyRowSetsBy($type = null, $value = null)\n {\n $allowedTypes = [\"policyId\", \"policyNumber\"];\n $careTakersRowSets = array();\n try {\n $db = Database::getDB();\n $query = \"SELECT policyId, totalAmount, policyNumber, startDate, endDate, active, paymentOption FROM Policies\";\n if (!is_null($type)) {\n if (!in_array($type, $allowedTypes))\n throw new PDOException(\"$type not an allowed search criterion for Policies\");\n $query = $query . \" WHERE ($type = :$type)\";\n $statement = $db->prepare($query);\n $statement->bindParam(\":$type\", $value);\n } else\n $statement = $db->prepare($query);\n $statement->execute();\n $careTakersRowSets = $statement->fetchAll(PDO::FETCH_ASSOC);\n $statement->closeCursor();\n } catch (Exception $e) { // Not permanent error handling\n echo \"<p>Error getting user rows by $type: \" . $e->getMessage() . \"</p>\";\n }\n return $careTakersRowSets;\n }", "public function getFieldTableValue(string $valueType): ?array;", "protected function getBy($value, $type) {\n $where = \"\";\n if ($type == \"id\") {\n $where = \"id=\".$this->db->escape($value);\n } else if ($type == \"name\") {\n $where = \"name='\".$this->db->escape($value).\"'\";\n } else {\n throw new Exception(\"Undefined type of the getBy\");\n }\n\n $params = array();\n array_push($params, $pakiti);\n\n $type = $this->db->queryToSingleValue(\"select `type` from VdsSubSource where $where\");\n\n return $this->db->queryObject(\"select id as _id, name as _name from VdsSubSource\n where $where\", $type, $params);\n }", "public function get($type_id)\n {\n return Measure::where('type_id', $type_id)\n ->orderBy('date', 'DESC')\n ->get();\n }", "static function retrieveByType($value) {\n\t\treturn static::retrieveByColumn('type', $value);\n\t}", "public static function getGameValuesBy($column, $type=null, $value=null) {\r\n\t\t$gameRows = GameDB::getGameRowSetsBy($type, $value);\r\n\t\treturn GameDB::getGameValues($gameRows, $column);\r\n\t}", "public static function getPolicyValuesBy($column, $type = null, $value = null)\n {\n $policyRows = PolicyDB::getPolicyRowSetsBy($type, $value);\n return PolicyDB::getPolicyValues($policyRows, $column);\n }", "public function getAll(string $type){\n // Retrieve all from db\n $this->db->query(\"SELECT * FROM $type\");\n $results = $this->db->resultSet();\n if($this->db->rowCount() > 0) {\n return $results;\n }\n return [];\n }", "public function query($type)\n\t{\n\t\treturn $this->pixie->db->query_driver('Mysql', $this, $type);\n\t}", "public static function getReviewValuesBy($column, $type=null, $value=null) {\r\n\t\t$reviewRows = ReviewsDB::getReviewRowSetsBy($type, $value);\r\n\t\treturn ReviewsDB::getReviewValues($reviewRows, $column);\r\n\t}", "public static function getMoviesBy($type=null, $value=null) {\r\n\t\t$movieRows = MoviesDB::getMoviesRowSetsBy($type, $value);\r\n\t\treturn MoviesDB::getMoviesArray($movieRows);\r\n\t}", "function getResultArray($type=MYSQLI_ASSOC){\n \n $fetchArray = array();\n $result = $this->mysqli->query($this->query);\n \n if ($result) {\n $start = microtime();\n $count = 0;\n \n $fetchArray['result'] = NULL;\n while($row = $result->fetch_array($type)){\n $fetchArray['result'][] = $row;\n $count++;\n }\n\t\t\t\n\t\t\tif(!empty($this->curTable))\n\t\t\t{\n\t\t\t\t$request = $this->mysqli->query(\"SHOW COLUMNS FROM \".$this->curTable);\n\t\t\t\tif($request)\n\t\t\t\t{\n\t\t\t\t\t$i = 0;\n\t\t\t\t\twhile($r = $request->fetch_array($type)){\n\t\t\t\t\t\tif(strpos($r['Type'], 'int') !== false)\t\t\t\t\t\t\t///\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t///\n\t\t\t\t\t\t\t$fetchTableColumns[] = 'number';\t\t\t\t\t\t\t/// MAPPING OF DATA TYPES KENDOUI\n\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t///\n\t\t\t\t\t\telse if(strpos($r['Type'], 'varchar') !== false){\t\t\t\t///\n\t\t\t\t\t\t\t$fetchTableColumns[] = 'string';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(strpos($r['Type'], 'date') !== false){\n\t\t\t\t\t\t\t$fetchTableColumns[] = 'date';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$fetchTableColumns = 'FAILED MYSQLI->QUERY';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$fetchTableColumns = 'Empty table name';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$fetchArray['data_type'] = $fetchTableColumns;\n $fetchArray['time'] = round(microtime() - $start, 4);\n $fetchArray['count'] = $count;\n\n return $fetchArray;\n \n }else {\n self::disconnect();\n throw new Exception($this->mysqli->error.\" ::: Query -> \".$this->query);\n }\n }", "public function getTableColumns($type = false) {\n switch(strtolower($this->engine)):\n case 'mysql': $query = $this->pdo->prepare('CALL tablesColumnsData(?)'); break;\n case 'sqlsrv': $query = $this->pdo->prepare('EXEC tablesColumnsData ?'); break;\n endswitch;\n\n $query->bindParam(1, $this->db, PDO::PARAM_STR);\n\n try {\n $query->execute();\n return self::getArray($query->fetchAll(), $type);\n } catch(Exception $e) {}\n }", "public static function getGamesBy($type=null, $value=null) {\r\n\t\t$gameRows = GameDB::getGameRowSetsBy($type, $value);\r\n\t\treturn GameDB::getGamesArray($gameRows);\r\n\t}", "protected function getValues($type) {\n return array_unique($this->rule[$type]);\n }", "protected function whereDateManipulations(string $column, string $value, string $type = 'date')\n {\n $type = sprintf('where%s', ucfirst($type));\n $this->query->{$type}($column, $value);\n }", "public static function get_by_type($type)\n {\n if(!self::is_type_valid($type))\n {\n return null;\n }\n\n return self::instance()->where('type', $type)->get_all();\n }", "function de_get_by_type($dbconn, $type){\n\t\t$query_by_type = 'SELECT * FROM materiales WHERE tipo = \"'.$type.'\" ';\n\n\t\tif(!$result = mysqli_query($dbconn, $query_by_type) ){\n\t\t\tdie(mysqli_error($dbconn));\n\t\t}else{\n\t\t\t$result = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\t\t\treturn $result;\n\t\t}\n\t}", "public function clean_by_element($value, $type) {\n\t\t$success = false;\n\t\t$error = null;\n\t\t$found = false; // If have found a matching element\n\t\t$limits = array(); // Array of filtering rules\n\n\t\t$limits = $this->getParams($type);\n\t\tlist($success, $value, $error) = $this->__clean_type((string)$value, $type, $limits);\n\n\t\treturn array(\n\t\t\t'clean' => (int)$success,\n\t\t\t'value' => $value,\n\t\t\t'error' => $error\n\t\t);\n\t}", "public static function fetchAllByType(PDO $db, string $type) : ?array {\n $query = 'SELECT * FROM TimelineEntry WHERE type = :type';\n $params = ['type' => $type];\n return self::fetchAll($db, $query, $params);\n }", "public function where($key, $value, $type) {\n\n\t}", "public function getRowValues()\n {\n $row = [];\n\n foreach ($this->types as $type)\n $row[static::normalizeFieldIndex($type->getName())] = $type->getValue();\n\n return $row;\n }", "public static function getFromExtTableType($type=0) {\n\t\t$listeObjet = array();\n\t\t// Lancement de la requete\n\t\t$requete = 'SELECT * FROM `equipement_joueur` ';\n\t\tif ($type == 0) {\n\t\t\t$requete .= 'WHERE type > 0 ORDER BY id ASC';\n\t\t} else {\n\t\t\t$requete .= 'WHERE type = :type ORDER BY id ASC';\n\t\t\t//Il faut que le parametre soit dans un array pour le BIND\n\t\t\t$type = array(':type' => $type);\n\t\t}\n\t\tdatabase::getInstance() -> prepareRequete($requete);\n\t\tif (is_array($type) || $type > 0) {\n\t\t\tdatabase::getInstance() -> bind($type);\n\t\t}\n\t\tif (! database::getInstance() -> executeRequete()) {\n\t\t\tthrow new Exception(__CLASS__.'::'.__FUNCTION__.'(): Impossible de lire la table equipement_joueur');\n\t\t}\n\t\t// Recuperation des donnees\n\t\t$datas = database::getInstance() -> getTableauResultat();\n\t\t// Traitement des donnees\n\t\tforeach ($datas AS $data) {\n\t\t\t$listeObjet[] = new Equipement_joueur($data['id'],$data['membre'],$data['unite_joueur'],$data['nom'],$data['description'],$data['categorie'],$data['cp'],$data['lp'],$data['mtcp'],$data['mtlp'],$data['dommage'],$data['msvg'],$data['gabarit'],$data['type'],$data['fo'],$data['sauvegarde'],$data['mmvt'],$data['encombrement'],$data['deux_mains'],$data['cout'],$data['date_creation'],$data['used'],$data['chemin'],$data['tile'],$data['usure'],$data['demontable'],$data['date_fin_reparation'],$data['ingame']);\n\t\t}\n\t\tif (sizeof($listeObjet) == 1) {\n\t\t\t$listeObjet = $listeObjet[0];\n\t\t}\n\t\treturn $listeObjet;\n\t}", "public function type(string $type)\n {\n return $this->where('type', $type)->values();\n }", "private function fromDatabaseFormatValue(string $type, $value)\n {\n if ($value === null) {\n return $value;\n }\n\n switch ($type) {\n case self::FIELD_TYPE_INT:\n return intval($value);\n case self::FIELD_TYPE_BOOL:\n return boolval($value);\n case self::FIELD_TYPE_DATETIME:\n if (!is_string($value)) {\n throw new Exception('Invalid datetime value');\n }\n\n return \\DateTimeImmutable::createFromFormat(\n self::DATETIME_FORMAT,\n $value,\n new \\DateTimeZone('UTC')\n );\n case self::FIELD_TYPE_DATE:\n if (!is_string($value)) {\n throw new Exception('Invalid date value');\n }\n\n return \\DateTimeImmutable::createFromFormat(\n self::DATE_FORMAT,\n $value,\n new \\DateTimeZone('UTC')\n );\n case self::FIELD_TYPE_JSON:\n if (!is_string($value)) {\n throw new Exception('Invalid json value');\n }\n\n return json_decode($value, true);\n default:\n return $value;\n }\n }", "public function getArray($table, $row, $value){\r\n\t\tif(isset($table)){\r\n\t\t\tif(mysql_query('SELECT * FROM `'.$table.'`')){ # Checks if table exists\r\n\t\t\t\t$array = func_get_args();\r\n\t\t\t\t$count = (count($array)-1) / 2 -1;\r\n\t\t\t\t$query = \"SELECT * FROM `\".$table.\"` WHERE\";\r\n\t\t\t\tfor($i=0;$i<=$count;$i++){\r\n\t\t\t\t\t$row = $array[$i*2+1];\r\n\t\t\t\t\t$value = $array[$i*2+2];\r\n\t\t\t\t\tif($i==0){\r\n\t\t\t\t\t\tif(gettype($value)==\"string\"){ # Checks the type for different querys\r\n\t\t\t\t\t\t\t$query .= \" `\".$row.\"` = '\".$value.\"'\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telseif(gettype($value)==\"integer\" || gettype($value)==\"double\"){\r\n\t\t\t\t\t\t\t$query .= \" `\".$row.\"` = \".$value.\"\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telseif($i>=1){\r\n\t\t\t\t\t\tif(gettype($value)==\"string\"){ # Checks the type for different querys\r\n\t\t\t\t\t\t\t$query .= \" AND `\".$row.\"` = '\".$value.\"'\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telseif(gettype($value)==\"integer\" || gettype($value)==\"double\"){\r\n\t\t\t\t\t\t\t$query .= \" AND `\".$row.\"` = \".$value.\"\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse throw new Exception('Query failed!');\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t$result = $this->query($query);\r\n\t\t\t\tif(!$result) return false;\r\n\t\t\t\telse {\r\n\t\t\t\t\t$array = mysql_fetch_array($result);\r\n\t\t\t\t\treturn $array;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse throw new Exception('Table not found!');\r\n\t\t}\r\n\t\telse throw new Exception('You need to give all parameter!');\r\n\t}" ]
[ "0.77559745", "0.7149547", "0.62621415", "0.62499607", "0.62404895", "0.59232897", "0.5774615", "0.57181627", "0.56940633", "0.56258786", "0.5600819", "0.54528373", "0.54485", "0.53783536", "0.53061295", "0.528872", "0.528457", "0.5268881", "0.5247564", "0.5245754", "0.5243655", "0.52140045", "0.51954764", "0.5186334", "0.5171708", "0.5141608", "0.51193744", "0.51049364", "0.5083067", "0.5067796" ]
0.8304916
0
Returns an array of Measurement objects extracted from $rows
public static function getMeasurementsArray($rows) { $measurements = array(); if (!empty($rows)) { // Convert the array of arrays into an array of Measurements // and set the id field foreach ($rows as $measurementRow) { $measurement = new Measurement($measurementRow); $measurementId = $measurementRow['measurement_id']; $measurement->setMeasurementId($measurementId); array_push($measurements, $measurement); } } return $measurements; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getMeasurementValues($rows, $column) {\r\n\t\t$measurementValues = array();\r\n\t\t\r\n\t\tforeach ($row as $measurementRow) {\r\n\t\t\t$measurementValue = $measurementRow[$column];\r\n\t\t\tarray_push($measurementValues, $measurementValue);\r\n\t\t}\r\n\t\t\r\n\t\treturn $measurementValues;\r\n\t}", "public function listMeasurements(): array;", "public function parseResults($rows)\n\t{\n\t\t$results = array();\n\n\t\t//convert the resulting set into arrays\n\t\tforeach ($rows as $item)\n\t\t{\n\t\t\t//iterate over the included and related columns\n\t\t\t$arr = array();\n\n\t\t\t$this->parseOnTableColumns($item, $arr);\n\n\t\t\t//then grab the computed, unsortable columns\n\t\t\t$this->parseComputedColumns($item, $arr);\n\n\t\t\t$results[] = $arr;\n\t\t}\n\n\t\treturn $results;\n\t}", "public function getValues()\n {\n $rows = [];\n foreach ($this->rows as $rowData) {\n $rows[] = $this->getRowValues($rowData);\n }\n return $rows;\n }", "public static function getUnits()\n {\n $conn = &PDOData::connect();\n $stmt = $conn->prepare(\"SELECT * FROM units\");\n $stmt->execute();\n\n $result = array();\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $result[] = $row;\n }\n\n PDOData::disconnect();\n return $result;\n }", "public static function getMeasurementRowsBy($type = null, $value = null) {\r\n\t\t$allowedTypes = ['measurement_id', 'sensor_id'];\r\n\t\t$measurementRows = array();\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$db = Database::getDB();\r\n\t\t\t$query = \"SELECT measurement_id, measurement_index, measurement_value,\r\n\t\t\t\t\tmeasurement_timestamp, sensor_id FROM Measurements\";\r\n\t\t\t\r\n\t\t\tif (!is_null($type)) {\r\n\t\t\t\tif (!in_array($type, $allowedTypes))\r\n\t\t\t\t\tthrow new PDOException(\"$type not an allowed search criterion for Measurements\");\r\n\t\t\t\t\r\n\t\t\t\t$query = $query . \" WHERE ($type = :$type)\";\r\n\t\t\t\t$statement = $db->prepare($query);\r\n\t\t\t\t$statement->bindParam(\":$type\", $value);\r\n\t\t\t} else {\r\n\t\t\t\t$query = $query . \" ORDER BY measurement_index ASC\";\r\n\t\t\t\t$statement = $db->prepare($query);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$statement->execute();\r\n\t\t\t$measurementRows = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\t$statement->closeCursor();\r\n\t\t} catch (Exception $e) {\r\n\t\t\techo \"<p>Error getting measurement rows by $type: \".$e->getMessage().\"</p>\";\r\n\t\t}\r\n\t\t\r\n\t\treturn $measurementRows;\r\n\t}", "public function selectAll() {\n $aRows = $this->db->select('*')->get(self::TABLE_NAME)->result_array();\n $aResults = [];\n foreach ($aRows as $aRow) {\n $o = new SummaryStats();\n $o->constructFromArray($aRow);\n array_push($aResults, $o);\n }\n return $aResults;\n }", "public static function getMeasurementsBy($type = null, $value = null) {\r\n\t\t$measurementRows = MeasurementsDB::getMeasurementRowsBy($type, $value);\r\n\t\t\r\n\t\treturn MeasurementsDB::getMeasurementsArray($measurementRows);\r\n\t}", "public function getRows() {}", "private function getAll() {\n //Returns a DataSet\n $result = array();\n if($this->numRows >0) {\n while($row = mysql_fetch_assoc($this->queryID)){\n $result[] = $row;\n }\n mysql_data_seek($this->queryID,0);\n }\n return $result;\n }", "public function _getDataObjects(array $rows) {\n // Set the database objects\n $dataObjects = array();\n foreach($rows as $row){\n $dataObjects[] = $this->_getDataObjectFromDbRow($row);\n }\n\n return $dataObjects;\n }", "public function getRows ()\n\t{\n\t\t$this->run();\n\t\t$fields = $this->data->fetch_fields();\n\t\t$dbRows = $this->data->fetch_all();\n\n\t\t$rows = array_map(function ($dbRow) use ($fields) {\n\t\t\t$row = [];\n\t\t\tforeach ($dbRow as $column => $value) {\n\t\t\t\t$row[ $fields[$column]->name ] = $value;\n\t\t\t}\n\t\t\treturn $row;\n\t\t}, $dbRows, array_keys($dbRows));\n\n\t\treturn $rows;\n\t}", "function getObjectList(){\n $values=array();\n if($this->DATASET)\n while($row=mysql_fetch_object($this->DATASET)){\n array_push($values, $row);\n }\n return $values;\n }", "public function getAllRows()\n {\n $rows = [];\n foreach ($this as $row) {\n $rows[] = $row;\n }\n return $rows;\n }", "function getForunits()\n\t{\n\t\t$st = $this->_getBoundStmt();\n\t\t\n\t\t$r = array();\n\t\twhile( $row = $st->fetch( PDO::FETCH_BOUND ) ) {\n\t\t\tif( !isset( $r[ $this->_d['unit'] ] ) ) {\n\t\t\t\t$r[ $this->_d['unit'] ] = array();\n\t\t\t}\n\t\t\t\n\t\t\t$r[ $this->_d['unit'] ][ $this->_d['id'] ] = array(\n\t\t\t\t'id'=>$this->_d['id'],\n\t\t\t\t'x'=>$this->_d['point']['x'],\n\t\t\t\t'y'=>$this->_d['point']['y'],\n\t\t\t\t't'=>$this->_d['time']\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn $r;\n\t}", "public function measurements()\n {\n return $this->hasMany(Measurement::class, 'physical_quantity_id');\n }", "private function consolidate_existing_records($rows) //for basal_values only\n {\n foreach($rows as $row) {\n $m = new \\eol_schema\\MeasurementOrFact_specific(); //NOTE: used a new class MeasurementOrFact_specific() for non-standard fields like 'm->label'\n $m->measurementType = 'https://eol.org/schema/terms/exemplary';\n $m->measurementValue = $row[3];\n $m->parentMeasurementEolPk = $row[1]; //http://eol.org/schema/parentMeasurementEolPk\n $m->measurementID = Functions::generate_measurementID($m, $this->resource_id, 'measurement_specific');\n $this->archive_builder_consolid8->write_object_to_file($m);\n }\n // 2 https://eol.org/schema/terms/exemplary https://eol.org/schema/terms/representative R210-PK102217809\n // 3 https://eol.org/schema/terms/exemplary https://eol.org/schema/terms/primary R226-PK102877920\n }", "public function getRows()\n {\n return [];\n }", "function getDataSet(){\r\n\t\t\t$dataSet=array();\r\n\t\t\t$i=0;\r\n\t\t\twhile($r=mysql_fetch_row($this->result)){\r\n\t\t\t\t$field=0;\r\n\t\t\t\tfor($field=0;$field<mysql_num_fields($this->result);$field++){\r\n\t\t\t\t\t$dataSet[$i][$field]=$r[$field];\r\n\t\t\t\t}\r\n\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t\treturn $dataSet;\r\n\t\t}", "private static function _buildObjectsFromRows(array $rows) {\r\n $santes = array();\r\n foreach ($rows as $row) {\r\n $santes[] = self::_buildObjectFromRow($row);\r\n }\r\n return $santes;\r\n }", "public function getRows()\n {\n $this->rows = $this->connection->executeQuery($this->query)->fetchAll();\n\n // Return the values\n return $this->rows;\n }", "public function get_results_from_query() {\n $this->open_connection();\n $result = $this->conn->query($this->query);\n while ($this->rows[] = $result->fetchArray(\\PDO::FETCH_OBJ));\n $result->finalize();\n $this->close_connection();\n array_pop($this->rows);\n }", "public function toArray()\n {\n /** @var \\Cube\\Db\\Table\\Row\\AbstractRow $row */\n foreach ($this->_rows as $i => $row) {\n $this->_data[$i] = $row->toArray();\n }\n\n return $this->_data;\n }", "public function getData()\n\t{\n\t\t$data = parent::getData();\n\t\t$items = array();\n\t\t$cm = $this->getColumnModel();\n\t\t$i = 0;\n\t\tforeach ($data->items as $row) {\n\t\t\t$item = new stdClass();\n\t\t\t$item->__META = $this->getRowMeta($row);\n\t\t\tif ($this->getPrimaryKey() != NULL) {\n\t\t\t\t$item->__ID = $row->{$this->getPrimaryKey()};\n\t\t\t} else {\n\t\t\t\t$item->__ID = $i + ($this->getPage() - 1) * $this->limit;\n\t\t\t}\n\t\t\tforeach ($cm as $column) {\n\t\t\t\t$column->setRow($row);\n\t\t\t\t$item->{$column->name} = (string) $column->render();\n\t\t\t}\n\t\t\t$items[] = $item;\n\t\t\t$i++;\n\t\t}\n\t\t$data->items = $items;\n\t\treturn $data;\n\t}", "public function getAllSampleRecords(){\n return $result = parent::getInformation($this->_tableName);\n }", "public function getArray(){\n $row = array();\n foreach($this->cells as $cell){\n $row[] = $cell->getValue();\n }\n return $row;\n }", "private function unMapBDDResults($rows) {\n\t\t$newRows = array();\n\t\tforeach ($rows as $pos => $row) {\n\t\t\t$newRow = array();\n\t\t\tforeach ($row as $fieldName => $fieldValue) {\n\t\t\t\t$newRow[$this->mapBDDToAPI($fieldName)] = $fieldValue;\n\t\t\t}\t\t\t\n\t\t\t$newRows[$pos] = $newRow;\n\t\t}\n\t\treturn $newRows;\n\t}", "public function rows()\n {\n $sql = \"SELECT * FROM workhours WHERE deleted IS NULL AND file_id={$this->id}\";\n\n return QueryBuilder::query($sql)->fetchAll(PDO::FETCH_CLASS);\n }", "public function getSpectralProperties() {\n\t\t$this->connect();\n\t\t\n\t\t$sql = <<<DOQ\n\t\t\tSELECT spectral_id, spectral_name, \n\t\t\t spectral_min, spectral_mean, spectral_max, spectral_std\n\t\t\tFROM $this->tablename\n\t\t\tORDER BY spectral_id\nDOQ;\n\n\t\t$stmt = mysqli_prepare($this->connection, $sql);\t\t\n\t\t$this->throwExceptionOnError();\n\t\t\n\t\tmysqli_stmt_execute($stmt);\n\t\t$this->throwExceptionOnError();\n\t\t\n\t\t$rows = array();\n\t\t\n\t\tmysqli_stmt_bind_result($stmt, $row->spectral_id,\n\t\t\t\t\t\t\t\t$row->spectral_name, $row->spectral_min,\n\t\t\t\t\t\t\t\t$row->spectral_mean, $row->spectral_max,\n\t\t\t\t\t\t\t\t$row->spectral_std);\n\t\t\n\t while (mysqli_stmt_fetch($stmt)) {\n\t $rows[] = $row;\n\t $row = new stdClass();\n\t\t\t\tmysqli_stmt_bind_result($stmt, $row->spectral_id,\n\t\t\t\t\t\t\t\t$row->spectral_name, $row->spectral_min,\n\t\t\t\t\t\t\t\t$row->spectral_mean, $row->spectral_max,\n\t\t\t\t\t\t\t\t$row->spectral_std);\n\t\t}\n\t\t\n\t\tmysqli_stmt_free_result($stmt);\n\t mysqli_close($this->connection);\n\t return $rows;\n\t}", "public function getUnits()\n {\n $query = \" SELECT unitName FROM $this->unitTable\";\n $exist = $this->conn->prepare($query);\n $exist->execute();\n while($row = $exist->fetch(PDO::FETCH_ASSOC)){\n $data[]=$row[\"unitName\"];\n }\n return $data;\n }" ]
[ "0.69938475", "0.62191427", "0.603462", "0.59471816", "0.5928963", "0.58264977", "0.57447344", "0.57380617", "0.5715669", "0.5694218", "0.5691185", "0.5690983", "0.56884724", "0.56780684", "0.5671984", "0.5612214", "0.55909616", "0.55788416", "0.55452794", "0.5535467", "0.5533918", "0.5510252", "0.5490585", "0.54791254", "0.54775125", "0.5465278", "0.5445603", "0.54436415", "0.5442818", "0.5426632" ]
0.7752988
0
Returns the $column of Measurements whose $type maches $value
public static function getMeasurementsValuesBy($type = null, $value = null, $column) { $measurementRows = MeasurementsDB::getMeasurementRowsBy($type, $value); return MeasurementsDB::getMeasurementValues($measurementRows, $column); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getMeasurementsBy($type = null, $value = null) {\r\n\t\t$measurementRows = MeasurementsDB::getMeasurementRowsBy($type, $value);\r\n\t\t\r\n\t\treturn MeasurementsDB::getMeasurementsArray($measurementRows);\r\n\t}", "public static function getMeasurementRowsBy($type = null, $value = null) {\r\n\t\t$allowedTypes = ['measurement_id', 'sensor_id'];\r\n\t\t$measurementRows = array();\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$db = Database::getDB();\r\n\t\t\t$query = \"SELECT measurement_id, measurement_index, measurement_value,\r\n\t\t\t\t\tmeasurement_timestamp, sensor_id FROM Measurements\";\r\n\t\t\t\r\n\t\t\tif (!is_null($type)) {\r\n\t\t\t\tif (!in_array($type, $allowedTypes))\r\n\t\t\t\t\tthrow new PDOException(\"$type not an allowed search criterion for Measurements\");\r\n\t\t\t\t\r\n\t\t\t\t$query = $query . \" WHERE ($type = :$type)\";\r\n\t\t\t\t$statement = $db->prepare($query);\r\n\t\t\t\t$statement->bindParam(\":$type\", $value);\r\n\t\t\t} else {\r\n\t\t\t\t$query = $query . \" ORDER BY measurement_index ASC\";\r\n\t\t\t\t$statement = $db->prepare($query);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$statement->execute();\r\n\t\t\t$measurementRows = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\t$statement->closeCursor();\r\n\t\t} catch (Exception $e) {\r\n\t\t\techo \"<p>Error getting measurement rows by $type: \".$e->getMessage().\"</p>\";\r\n\t\t}\r\n\t\t\r\n\t\treturn $measurementRows;\r\n\t}", "protected function whereDateManipulations(string $column, string $value, string $type = 'date')\n {\n $type = sprintf('where%s', ucfirst($type));\n $this->query->{$type}($column, $value);\n }", "public function where($key, $value, $type) {\n\n\t}", "public function get($type_id)\n {\n return Measure::where('type_id', $type_id)\n ->orderBy('date', 'DESC')\n ->get();\n }", "public static function getGameValuesBy($column, $type=null, $value=null) {\r\n\t\t$gameRows = GameDB::getGameRowSetsBy($type, $value);\r\n\t\treturn GameDB::getGameValues($gameRows, $column);\r\n\t}", "public static function getReviewValuesBy($column, $type=null, $value=null) {\r\n\t\t$reviewRows = ReviewsDB::getReviewRowSetsBy($type, $value);\r\n\t\treturn ReviewsDB::getReviewValues($reviewRows, $column);\r\n\t}", "public function gt(string $column, mixed $value, string $type = Condition::AND): CriteriaInterface;", "public function type(string $type): Column\n {\n $this->type = $type;\n return $this;\n }", "public function updateColumnProperty($column, $type)\n {\n return $this->_lovdDatabaseConnection->createCommand(\n\t \"UPDATE `\" . $this->tableColumnProperty . \"` SET mysql_type = '\" . $type . \"' WHERE id = '\" . $column . \"'\");\n }", "public function scopeElementType($query, $type)\n {\n if($type instanceof \\Closure)\n return $query->$type();\n\n if($type instanceof Model)\n return $query->where('categoryable_type', get_class($type));\n\n return $query->where('categoryable_type', $type);\n }", "public function eq(string $column, mixed $value, string $type = Condition::AND): CriteriaInterface;", "public static function getPolicyValuesBy($column, $type = null, $value = null)\n {\n $policyRows = PolicyDB::getPolicyRowSetsBy($type, $value);\n return PolicyDB::getPolicyValues($policyRows, $column);\n }", "function process_value($table, $value, $type) {\n switch($type) {\n case \"string\":\n $formatted_value=\"'$value'\";\n break;\n case \"int\":\n $formatted_value = $value;\n break;\n default: \n $formatted_value = $value;\n break;\n }\n return $formatted_value;\n }", "public function query($type)\n\t{\n\t\treturn $this->pixie->db->query_driver('Mysql', $this, $type);\n\t}", "public function where($attribute, $type, $value) {\n\t\t$this->model = $this->model->where($attribute, $type, $value);\n\t\treturn $this;\n\t}", "static function retrieveByType($value) {\n\t\treturn static::retrieveByColumn('type', $value);\n\t}", "public function getRateByTypeAndRange($type=NULL, $value=NULL)\n {\n $value = floatval($value);\n $this->db->where(array('type'=>strtolower($type), 'range_min <'=> $value, 'range_max >='=>$value))->order_by('key', 'ASC');\n $res = $this->db->get($this->tablename)->row(0, 'CalcRate');\n if(!$res) return 1.0;\n return floatval($res->rate);\n \n }", "protected function getBy($value, $type) {\n $where = \"\";\n if ($type == \"id\") {\n $where = \"id=\".$this->db->escape($value);\n } else if ($type == \"name\") {\n $where = \"name='\".$this->db->escape($value).\"'\";\n } else {\n throw new Exception(\"Undefined type of the getBy\");\n }\n\n $params = array();\n array_push($params, $pakiti);\n\n $type = $this->db->queryToSingleValue(\"select `type` from VdsSubSource where $where\");\n\n return $this->db->queryObject(\"select id as _id, name as _name from VdsSubSource\n where $where\", $type, $params);\n }", "public function scopeOfType($query, $type)\r\n {\r\n return $query->where('type', $type);\r\n }", "public function type(string $type)\n {\n return $this->where('type', $type)->values();\n }", "private function convertDataTypeByValue($data_type, $value) {\n\t\tif($data_type[Unbxd_Recommendation_Model_Field::datatype] == self::DECIMAL) {\n\t\t\treturn $this->getFloatValues($value);\n\t\t} else if ($data_type[Unbxd_Recommendation_Model_Field::datatype] == self::NUMBER) {\n\t\t\treturn $this->getNumberValues($value);\n\t\t} else if ($data_type[Unbxd_Recommendation_Model_Field::datatype] == self::DATE) {\n\t\t\treturn $this->getDateValues($value);\n\t\t}\n\t\treturn $value;\n\t}", "protected function table($type) {\n\t return $type;\n\t}", "public function gte(string $column, mixed $value, string $type = Condition::AND): CriteriaInterface;", "function prepare_for_query($value, $type)\n {\n if (empty($value) && (string)$value != \"0\") {\n return \"NULL\";\n } else {\n return match ($type) {\n DBWorker::DB_NUMBER => $this->number_or_null($value),\n DBWorker::DB_DATETIME => $this->format_datetime($value),\n DBWorker::DB_DATE => $this->format_date($value),\n default => $this->quotes_or_null($value)\n };\n }\n }", "public function columnType(string $table, string $column);", "protected function _add_simple_condition( $type, $column_name, $separator, $value ) {\n\t\t$multiple = \\is_array( $column_name ) ? $column_name : [ $column_name => $value ];\n\t\t$result = $this;\n\t\tforeach ( $multiple as $key => $val ) {\n\t\t\t// Add the table name in case of ambiguous columns\n\t\t\tif ( \\count( $result->_join_sources ) > 0 && \\strpos( $key, '.' ) === false ) {\n\t\t\t\t$table = $result->_table_name;\n\t\t\t\tif ( ! \\is_null( $result->_table_alias ) ) {\n\t\t\t\t\t$table = $result->_table_alias;\n\t\t\t\t}\n\t\t\t\t$key = \"{$table}.{$key}\";\n\t\t\t}\n\t\t\t$key = $result->_quote_identifier( $key );\n\t\t\t$placeholder = ( $val === null ) ? 'NULL' : '%s';\n\t\t\t$result = $result->_add_condition( $type, \"{$key} {$separator} {$placeholder}\", $val );\n\t\t}\n\n\t\treturn $result;\n\t}", "private function getRulesByType(&$column)\n {\n $rules = collect();\n\n $mainType = explode(' ', $column->Type)[0];\n if (Str::startsWith($mainType, ['tinyint', 'smallint', 'int', 'bigint'])) {\n if ($mainType === 'tinyint') {\n $field = Str::studly($column->Field);\n $rules->add(\"enum_value:' . $field::class . ',false\");\n // $rules->add(\"enum_key:' . $field::class\");\n } else\n $rules->add('integer');\n } elseif (Str::startsWith($mainType, 'tinyint(1)'))\n $rules->add('in:true,false');\n elseif (Str::startsWith($mainType, 'json'))\n $rules->add('json');\n elseif (Str::startsWith($mainType, 'enum')) {\n $rules->add('in:' . str_replace('\\'', '', substr($mainType, strpos($mainType, '(') + 1, -1)));\n } elseif (Str::startsWith($mainType, 'varchar')) {\n $rules->add('string');\n $rules->add('max:' . substr($mainType, strpos($mainType, '(') + 1, -1));\n } elseif (Str::startsWith($mainType, 'timestamp')) {\n $rules->add('date');\n }\n\n return $rules;\n }", "protected function _print_attribute_column( $value, $type ) {\n $output = '';\n\n if( $type == 'colorpicker' ) {\n $output = '<span class=\"yith-wccl-color\" style=\"background-color:'. $value .'\"></span>';\n } elseif( $type == 'label' ) {\n $output = '<span class=\"yith-wccl-label\">'. $value .'</span>';\n } elseif( $type == 'image' ) {\n $output = '<img class=\"yith-wccl-image\" src=\"'. $value .'\" alt=\"\" />';\n }\n\n return $output;\n }", "function _get_value($value_type, $update_id) {\n if (is_numeric($update_id)) {\n if ($value_type == 'size') {\n $this->load->module('store_item_sizes');\n $query = $this->store_item_sizes->get_where($update_id);\n foreach ($query->result() as $row) {\n $item_size = $row->size;\n }\n if (!isset($item_size)) {\n $item_size = '';\n }\n $value = $item_size;\n } else if ($value_type == 'color') {\n $this->load->module('store_item_colors');\n $query = $this->store_item_colors->get_where($update_id);\n foreach ($query->result() as $row) {\n $item_color = $row->color;\n }\n if (!isset($item_color)) {\n $item_color = '';\n }\n $value = $item_color;\n }\n } else {\n $value = '';\n }\n return $value;\n }" ]
[ "0.67480683", "0.672993", "0.61896724", "0.5732134", "0.5731905", "0.56602895", "0.5492789", "0.5341165", "0.5318593", "0.53045994", "0.52848303", "0.519054", "0.5190491", "0.5160283", "0.51403946", "0.5109625", "0.5074906", "0.5067717", "0.50288284", "0.50261444", "0.49920303", "0.49869987", "0.4982871", "0.49804217", "0.49768457", "0.49758524", "0.49678707", "0.4946171", "0.49410757", "0.4940303" ]
0.7358292
0
Returns an array of values from the $column extracted from $rows
public static function getMeasurementValues($rows, $column) { $measurementValues = array(); foreach ($row as $measurementRow) { $measurementValue = $measurementRow[$column]; array_push($measurementValues, $measurementValue); } return $measurementValues; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getColumn(int $column): array\n {\n $this->checkExistParsedValue();\n $result = [];\n foreach ($this->parsedValues as $value) {\n if (!isset($value[$column])) {\n throw new \\Exception('Have not column');\n }\n $result[] = $value[$column];\n }\n return $result;\n }", "function get_column() {\r\n $rs = $this->query(func_get_args());\r\n\r\n $data = array();\r\n\r\n if (!$rs) return $data;\r\n\r\n while($row = mysql_fetch_row($rs) ) {\r\n $data[] = $row[0];\r\n }\r\n $this->free();\r\n return $data;\r\n }", "public function fetchColumn()\n\t{\n\t\t$this->exec();\n\t\t$resX = $this->stmt->fetchAll(\\PDO::FETCH_NUM);\n\t\t$this->cleanup();\n\t\t$return = array();\n\t\tforeach ($resX as $row) {\n\t\t\t$return[] = $row[0];\n\t\t}\n\t\treturn $return;\n\t}", "public function column($col)\n {\n if (!is_string($col) && !is_int($col)) {\n throw new Exception('`$col must be a string or an integer');\n }\n $rows = [];\n foreach ($this->rows as $row) {\n if (!$this->assoc) {\n $rows[] = isset($row->{$col}) ? $row->{$col} : null;\n } else {\n if (is_int($col)) {\n $row = array_values($row);\n }\n $rows[] = isset($row[$col]) ? $row[$col] : null;\n }\n }\n return $rows;\n }", "public static function getGameValues($rowSets, $column) {\r\n\t\t$gameValues = array();\r\n\t\tforeach ($rowSets as $gameRow ) {\r\n\t\t\t$gameValue = $gameRow[$column];\r\n\t\t\tarray_push ($gameValues, $gameValue);\r\n\t\t}\r\n\t\treturn $gameValues;\r\n\t}", "public function getValue($column)\n {\n return $this->data[$column];\n }", "function getAllValuesInColumn($column){\n $res = $this->conn->query(\n \"SELECT DISTINCT \" . $column . \" FROM bostader\"\n );\n //returns all results from $res object\n return $res -> fetchAll();\n\n }", "public function getArray(){\n $row = array();\n foreach($this->cells as $cell){\n $row[] = $cell->getValue();\n }\n return $row;\n }", "public function getCol() {\n\t\t$ret = array ();\n\t\t$query = $this->prepareQuery(func_get_args());\n\t\tif ($res = $this->rawQuery($query)) {\n\t\t\twhile ( $row = $this->fetch($res) ) {\n\t\t\t\t$ret[] = reset($row);\n\t\t\t}\n\t\t\t$this->free($res);\n\t\t}\n\t\treturn $ret;\n\t}", "public function getColVals($col)\n {\n $list = array();\n foreach ($this as $key => $record) {\n $list[$key] = $record->$col;\n }\n return $list;\n }", "public function get($column);", "function get_col($query=null,$x=0)\n\t\t{\n\n\t\t\t$new_array = array();\n\n\t\t\t// If there is a query then perform it if not then use cached results..\n\t\t\tif ( $query )\n\t\t\t{\n\t\t\t\t$this->query($query);\n\t\t\t}\n\n\t\t\t// Extract the column values\n\t\t\tfor ( $i=0; $i < count($this->last_result); $i++ )\n\t\t\t{\n\t\t\t\t$new_array[$i] = $this->get_var(null,$x,$i);\n\t\t\t}\n\n\t\t\treturn $new_array;\n\t\t}", "public function get_col( $query = NULL , $x = 0) {\r\n\t\tif ( NULL != $query )\r\n\t\t\t$this->query( $query );\r\n\r\n\t\t$new_array = array();\r\n\t\t\r\n\t\t// Extract the column values\r\n\t\tfor ( $i = 0; $i < count( $this->last_result ); $i++ ) {\r\n\t\t\t$new_array[$i] = $this->get_var( NULL, $x, $i );\r\n\t\t}\r\n\t\t\r\n\t\treturn $new_array;\r\n\t}", "public function column($column)\n {\n $columnArray = [];\n\n foreach ($this->array as $values) {\n if (is_array($values)) {\n foreach ($values as $key => $value) {\n if ($key == $column) {\n $columnArray[] = $value;\n }\n }\n }\n }\n\n return $this->setArray($columnArray)\n ->setArray($this->getValues());\n }", "function getTemplateVarsFromRowColumn(&$row, &$column) {\n\t\treturn array('status' => $this->getCellState($row, $column));\n\t}", "public static function getReviewValues($rowSets, $column) {\r\n\t\t$reviewValues = array();\r\n\t\tforeach ($rowSets as $reviewRow ) {\r\n\t\t\t$reviewValue = $reviewRow[$column];\r\n\t\t\tarray_push ($reviewValues, $reviewValue);\r\n\t\t}\r\n\t\treturn $reviewValues;\r\n\t}", "function getTemplateVarsFromRowColumn(&$row, &$column) {\n\t\t$element =& $row->getData();\n\t\t$columnId = $column->getId();\n\t\tassert(is_a($element, 'MonographFile') && !empty($columnId));\n\n\t\t// all other columns\n\t\tswitch ($columnId) {\n\t\t\tcase 'select':\n\t\t\t\treturn array('rowId' => $element->getFileId());\n\t\t\tcase 'files':\n\t\t\t\treturn array('label' => $element->getOriginalFileName());\n\t\t}\n\t}", "public function fetchAllFromColumn($result, int $column = 0) : array;", "public static function select_column($query)\n {\n $column = array();\n $rs = self::query($query);\n while (true)\n {\n $values = Db::fetch_row($rs);\n if ($values === false)\n break;\n array_push($column, $values[0]);\n }\n Db::free_result($rs);\n return $column;\n }", "static public function column( $query )\n\t{\n\t\tif( func_num_args() > 1 )\n\t\t\t$query = self::prepare( func_get_args() );\n\n\t\t$res = self::query( $query );\n\t\tif( !$res ) return false;\n\n\t\t$rows = array();\n\t\twhile( $row = $res->fetch_row() )\n\t\t{\n\t\t\tlist($tmp) = $row;\n\t\t\t$rows[] = $tmp;\n\t\t}\n\n\t\t$res->free();\n\t\treturn $rows;\n\t}", "public function customValue($column, array $row)\n {\n return $row[$column];\n }", "public function getValues()\n {\n $rows = [];\n foreach ($this->rows as $rowData) {\n $rows[] = $this->getRowValues($rowData);\n }\n return $rows;\n }", "public function getAllCols($row){\n $item = array();\n $item[self::COL1] = $row ->get(self::COL1);\n $item[self::COL2] = $row ->get(self::COL2);\n $item[self::COL3] = $row->get(self::COL3);\n $item[self::COL4] = $row ->get(self::COL4);\n $item[self::COL5] = $row->get(self::COL5);\n $item[self::COL6] = $row -> get(self::COL6);\n $item[self::COL7] = $row->get(self::COL7);\n return $item;\n }", "public function fetchCol(): array\n {\n return $this->statement->fetchAll(PDO::FETCH_COLUMN);\n }", "private function getRowValues(&$row)\n {\n foreach ($row as $k => $v) {\n $row[$k] = \"'\" . SQLite3::escapeString($v) . \"'\";\n }\n $values = implode(\",\", $row);\n return $values;\n }", "function get_col($query=null,$x=0)\n\t\t{\n\n\t\t\t// If there is a query then perform it if not then use cached results..\n\t\t\tif ( $query )\n\t\t\t{\n\t\t\t\t$this->query($query);\n\t\t\t}\n\n\t\t\t// Extract the column values\n\t\t\tfor ( $i=0; $i < count($this->last_result); $i++ )\n\t\t\t{\n\t\t\t\t$new_array[$i] = $this->get_var(null,$x,$i);\n\t\t\t}\n\n\t\t\treturn $new_array;\n\t\t}", "public static function getPolicyValues($rowSets, $column)\n {\n $policyValues = array();\n foreach ($rowSets as $policyRow) {\n $policyValue = $policyRow[$column];\n array_push($policyValues, $policyValue);\n }\n return $policyValues;\n }", "protected function getRowValues($rowData)\n {\n $row = [];\n foreach ($this->columns as $column) {\n $row[$column->getId()] = $column->getValues($rowData);\n }\n return $row;\n }", "public function getValuesByColumnName($columnName) {\n\t\treturn $this->getGoogleProject()->getValueByColumnName($columnName);\n\t}", "public function pluck($column)\n\t{\n\t\t$result = (array) $this->first(array($column));\n\t\treturn count($result) > 0 ? $result[$column] : null;\n\t}" ]
[ "0.69598985", "0.68829346", "0.68253094", "0.6824306", "0.67981553", "0.6771498", "0.6750012", "0.6692674", "0.6687895", "0.66352487", "0.6618749", "0.6595883", "0.6595717", "0.6560952", "0.655076", "0.6544722", "0.6509244", "0.6466388", "0.64516914", "0.64387596", "0.6416443", "0.6409502", "0.64054084", "0.6367951", "0.63513404", "0.634609", "0.6324399", "0.6269719", "0.62194407", "0.6208636" ]
0.7588283
0
Updates a Measurement entry in the Measurements table
public static function updateMeasurement($measurement) { try { $db = Database::getDB(); if (is_null($measurement) || $measurement->getErrorCount() > 0) return $measurement; $checkMeasurement = MeasurementsDB::getMeasurementsBy('measurement_id', $measurement->getMeasurementId()); if (empty($checkMeasurement)) { $measurement->setError('measurement_id', 'MEASUREMENT_DOES_NOT_EXIST'); return $measurement; } if ($measurement->getErrorCount() > 0) return $measurement; $query = "UPDATE Measurements SET measurement_index = :measurement_index, measurement_value = :measurement_value, measurement_timestamp = :measurement_timestamp, sensor_id = :sensor_id WHERE measurement_id = :measurement_id"; $statement = $db->prepare($query); $statement->bindValue(':measurement_index', $measurement->getMeasurementIndex()); $statement->bindValue(':measurement_value', $measurement->getMeasurementValue()); $statement->bindValue(':measurement_timestamp', $measurement->getMeasurementTimestamp()); $statement->bindValue(':sensor_id', $measurement->getSensorId()); $statement->bindValue(':measurement_id', $measurement->getMeasurementId()); $statement->execute(); $statement->closeCursor(); } catch (Exception $e) { $measurement->setError('measurement_id', 'MEASUREMENT_COULD_NOT_BE_UPDATED'); //echo $e->getMessage(); //echo 'file: '.$e->getFile().' line: '.$e->getLine(); } return $measurement; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(MeasurementUpdateRequest $request, Measurement $measurement) {\n $response = $this->repository->update($request->all(), $measurement);\n\n return response()->json($response);\n }", "public function updated(EventMeasure $eventMeasure)\n {\n //\n }", "public function update()\n {\n\t\t$measurementArray = array();\n\t\t$getData = array();\n\t\t$funcName = array();\n\t\t$measurementArray = func_get_arg(0);\n\t\tfor($data=0;$data<count($measurementArray);$data++)\n\t\t{\n\t\t\t$funcName[$data] = $measurementArray[$data][0]->getName();\n\t\t\t$getData[$data] = $measurementArray[$data][0]->$funcName[$data]();\n\t\t\t$keyName[$data] = $measurementArray[$data][0]->getkey();\n\t\t}\n\t\t$measurementId = $measurementArray[0][0]->getMeasurementUnitId();\n\t\t// data pass to the model object for update\n\t\t$measurementModel = new MeasurementModel();\n\t\t$status = $measurementModel->updateData($getData,$keyName,$measurementId);\n\t\treturn $status;\t\n\t}", "public function update(Request $request, Measure $measure)\n {\n $measure->name = $request['measure']['name'];\n $measure->description = $request['measure']['description'];\n $measure->link = $request['measure']['link'];\n $measure->code = 'code';\n $measure->save();\n\n $measure->answeroptions()->detach();\n\n foreach ($request['measure']['answeroptions'] as $answeroption) {\n $answeroption = Answeroption::find($answeroption['id']);\n $answeroption->measures()->save($measure);\n }\n return $measure;\n }", "public function edit(Measure $measure)\n {\n //\n }", "public function registerMeasurement(string $measurement): void;", "function setMeasureID($measID) \n {\n $this->setValueByFieldName('meas_id',$measID);\n }", "public function updateMeasurementValue($id)\n {\n $input = Request::onlyLegacy('value', 'attribute_id');\n $measurement = $this->service->getMeasurementById($id);\n $validator = Validator::make($input, [\n 'value' => 'required',\n 'attribute_id' => 'required'\n ]);\n\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n\n $attribute = $this->service->getAtributeById($input['attribute_id']);\n\t\t$measurementValue = MeasurementValue::firstOrNew([\n\t\t\t'attribute_id' => $attribute->id,\n\t\t\t'measurement_id' => $id,\n\t\t]);\n\t\t$measurementValue->trade_id = $attribute->trade_id;\n\t\t$measurementValue->value = $input['value'];\n $measurementValue->save();\n\n return ApiResponse::success([\n 'message' => trans('response.success.updated', ['attribute' => $attribute->name]),\n ]);\n }", "public static function addMeasurement($measurement) {\r\n\t\t$query = \"INSERT INTO Measurements (measurement_index, measurement_value,\r\n\t\t\t\tmeasurement_timestamp, sensor_id) VALUES (:measurement_index,\r\n\t\t\t\t:measurement_value, :measurement_timestamp, :sensor_id)\";\r\n\t\t\r\n\t\ttry {\r\n\t\t\tif (is_null($measurement) || $measurement->getErrorCount() > 0)\r\n\t\t\t\treturn $measurement;\r\n\t\t\t\r\n\t\t\t$db = Database::getDB();\r\n\t\t\t$statement = $db->prepare($query);\r\n\t\t\t$statement->bindValue(\":measurement_index\", $measurement->getMeasurementIndex());\r\n\t\t\t$statement->bindValue(\":measurement_value\", $measurement->getMeasurementValue());\r\n\t\t\t$statement->bindValue(\":measurement_timestamp\", $measurement->getMeasurementTimestamp());\r\n\t\t\t$statement->bindValue(\":sensor_id\", $measurement->getSensorId());\r\n\t\t\t$statement->execute();\r\n\t\t\t$statement->closeCursor();\r\n\t\t\t\r\n\t\t\t$newMeasurementId = $db->lastInsertId('measurement_id');\r\n\t\t\t$measurement->setMeasurementId($newMeasurementId);\r\n\t\t} catch (Exception $e) {\r\n\t\t\t$measurement->setError('measurement_id', 'MEASUREMENT_INVALID');\r\n\t\t}\r\n\t\t\r\n\t\treturn $measurement;\r\n\t}", "static public function update(UnitOfMeasure $obj){\n\t\tself::$_mName = $obj->getName();\n\t}", "public function edit(Measurement $measurement) {\n $categoryList = $this->repository->listCategoryData()->toArray();\n\n $response['success'] = true;\n $response['form'] = view('admin::measurement.edit', compact('measurement', 'categoryList'))->render();\n\n return response()->json($response);\n }", "public function Update_unit($id)\n {\n// $updatedBy = $_SESSION['user'][0]->id;\n\n $this->db->set('name', $_POST['unit']);\n// $this->db->set('UpdatedBy', $updatedBy);\n// $this->db->set('UpdatedOn', $updatedOn);\n $this->db->where('id',$id);\n $this->db->update('unit_of_measure');\n if($this->db->affected_rows()>0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function update(UOMRequest $request, UnitOfMeasure $unitOfMeasure)\n {\n $data = $request->all();\n $data['is_active'] = $request->has('is_active');\n\n $unitOfMeasure->update($data);\n\n flash('Successfully updated unit of measure.', 'success');\n\n return redirect()->route('unitOfMeasure.index');\n }", "public function updateHoverMeasurement()\n {\n try {\n $measurementId = Request::get('measurement_id');\n $filePath = config('jp.BASE_PATH').'hover_reports/1549358486_1763812421_reports.pdf';\n $measurement = $this->service->getMeasurementById($measurementId);\n $data = $this->service->updateHoverMeasurement($measurement, $filePath);\n return ApiResponse::success([\n 'message' => trans('response.success.updated',['attribute' => 'Measurement'])\n ]);\n } catch (\\Exception $e) {\n throw $e;\n }\n }", "public function registerMeasurements(array $measurements): void;", "public function update($medium)\n {\n $query=\"UPDATE medium \".\n\t \"SET \".\n \"id= \".$medium->id.\" ,\".\n \"release= \".$medium->release.\" ,\".\n \"position= \".$medium->position.\" ,\".\n \"format= \".$medium->format.\" ,\".\n \"name='\".$this->sqlSafe($medium->name).\"',\".\n \"edits_pending= \".$medium->edits_pending.\" ,\".\n \"last_updated='\".$this->sqlSafe($medium->last_updated).\"',\".\n \"track_count= \".$medium->track_count.\" \". \n\t \"WHERE id=\".$medium->id;\n\n $this->executeQuery($query);\n }", "public static function update(Unit $unit)\n {\n $conn = &PDOData::connect();\n $stmt = $conn->prepare(\"UPDATE units SET name = :name, exchange_rate = :exchange_rate WHERE id = :id \");\n\n $stmt->bindParam(':name', $unit->getName(),PDO::PARAM_STR);\n $stmt->bindParam(':exchange_rate', $unit->getExchangeRate());\n $stmt->bindParam(':id', $event->getId());\n $stmt->execute();\n\n PDOData::disconnect();\n\n echo \"SUCCESS\";\n }", "public function update(Request $request, QtnRadiatorMeasurementLocation $qtnRadiatorMeasurementLocation)\n {\n //\n }", "public function update ($table_quotef, $where_quotef, $sets_quotef_etc);", "public function update(MonthlyMeterUnit $meter_unit, UpdateMonthlyMeterUnitRequest $request)\n {\n $this->meter_unit->update($meter_unit,\n [\n 'data' => $request->except('_token','_method'),\n ]);\n\n return redirect()->route('admin.meter_units.index')->withFlashSuccess(trans('alerts.backend.meter_unit.updated'));\n }", "function updateMedFrequency($participant_id,$medication,$newFrequency) {\r\n //database object\r\n $dbh = connect();\r\n\r\n $sql = \"UPDATE medications SET frequency_taken = :frequency WHERE :participant_id = :participant_id AND \r\n medication_name = :medication\";\r\n\r\n $statement = $dbh->prepare($sql);\r\n\r\n $statement->bindParam(':participant_id',$participant_id, PDO::PARAM_INT);\r\n $statement->bindParam(':medication',$medication, PDO::PARAM_STR);\r\n $statement->bindParam(':frequency',$newFrequency, PDO::PARAM_STR);\r\n\r\n\r\n\r\n // Execute the statement\r\n $success = $statement->execute();\r\n\r\n //return true if successful false if not\r\n return $success;\r\n}", "public function testUpdate()\n\t{\n\t\t$this->withoutMiddleware();\n\t\t$this->call('POST', '/drug', $this->drugData);\n\t\t// Update the Drug\n\t\t$drugStored = Drug::orderBy('id','desc')->first();\n\n\t\t$this->withoutMiddleware();\n\t\t$this->call('PUT', '/drug/1', $this->drugUpdate);\n\n\t\t// $drugUpdated = Drug::find($drugStored->id);\n\t\t$drugUpdated = Drug::find('1');\n\t\t$this->assertEquals($drugUpdated->name , $this->drugUpdate['name']);\n\t\t$this->assertEquals($drugUpdated->description ,$this->drugUpdate['description']);\n\t}", "function setMeasurementUnits($units)\n {\n $this->__measurement_units = $units ;\n }", "function getMeasureID()\n { \n return $this->getValueByFieldName('meas_id');\n }", "public function testUpdateValidStatistic(){\n\t\t//count the number of rows and save\n\t\t$numRows = $this->getConnection()->getRowCount(\"statistic\");\n\t\t//create a new Statistic and insert into mySQL\n\t\t$statistic = new Statistic(null, $this->VALID_STATISTICNAME);\n\t\t$statistic->insert($this->getPDO());\n\n\t\t//edit statistic and update in mySQL\n\t\t$statistic->setStatisticName($this->VALID_STATISTICNAME2);\n\t\t$statistic->update($this->getPDO());\n\n\t\t//grab the data from mySQL and enforce the fields match expectations\n\t\t$pdoStatistic = Statistic::getStatisticByStatisticId($this->getPDO(), $statistic->getStatisticId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowcount(\"statistic\"));\n\t\t$this->assertEquals($pdoStatistic->getStatisticName(), $this->VALID_STATISTICNAME2);\n\t}", "function updateMedTimeTaken($participant_id,$medication,$newTime) {\r\n //database object\r\n $dbh = connect();\r\n\r\n $sql = \"UPDATE medications SET time_taken = :newTime WHERE :participant_id = :participant_id AND \r\n medication_name = :medication\";\r\n\r\n $statement = $dbh->prepare($sql);\r\n\r\n $statement->bindParam(':participant_id',$participant_id, PDO::PARAM_INT);\r\n $statement->bindParam(':medication',$medication, PDO::PARAM_STR);\r\n $statement->bindParam(':newTime',$newTime, PDO::PARAM_STR);\r\n\r\n\r\n\r\n // Execute the statement\r\n $success = $statement->execute();\r\n\r\n //return true if successful false if not\r\n return $success;\r\n}", "function updateStopSize($query, $size){\n if (SQLhelper::request()) {\n $sql = \"UPDATE `stops` SET `size`=`size`*0.75+$size*0.25 WHERE `query`='$query'\";\n $query = mysql_query($sql);\n SQLhelper::release();\n }\n }", "function update($melding)\n {\n $this->db->where('id', $melding->id);\n $this->db->update('melding', $melding);\n }", "public function update_kitchen_assigned_product($kitchen_id,$product_sku,$estimated_units)\n {\n $this->db->set('estimated_units',$estimated_units);\n $this->db->where('product_sku',$product_sku);\n $this->db->update(\"insert_kitchen_assign_product_\".$kitchen_id);\n return $affected_rows = $this->db->affected_rows();\n }", "public function update(Request $request, $clientId)\n {\n \n client()->measurement()->update($request->all());\n\n return back()->withSuccess('Measurement updated');\n }" ]
[ "0.67727476", "0.64732486", "0.6362019", "0.62106246", "0.60004467", "0.59930414", "0.59644943", "0.5941777", "0.58925223", "0.5597653", "0.552909", "0.54658896", "0.5457351", "0.539201", "0.5370559", "0.53489137", "0.53453827", "0.5332015", "0.5327533", "0.5279434", "0.527322", "0.52515167", "0.52204925", "0.51724786", "0.5144469", "0.509845", "0.5080771", "0.50566083", "0.50217247", "0.49705815" ]
0.729184
0
Fetch all gallery images by wallpaper id
public function fetchAll($wallpaperId);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getImages($id) {\n $mydb = $this->db;\n// needs 2 queries \n\n $qi = $mydb->query(\n \"select i.*, g.path, a.visible from image i, gallery g, img_gallery a\"\n . \" where a.galleryid = :gid\"\n . \" and i.id = a.imageid\"\n . \" and g.id = i.galleryid\", array('gid' => $id)\n );\n $qi->setFetchMode(\\Phalcon\\Db::FETCH_OBJ);\n $results = $qi->fetchAll();\n return $results;\n }", "function recupererPhotos($id_annonce) {\r\n $res = $this->db->query(\"SELECT url FROM Photos WHERE annonce=$id_annonce\");\r\n $photos = $res->fetchAll();\r\n return $photos;\r\n }", "public function img_gallery($id) {\n\t\t$r = $this->db->prepare(\"SELECT * FROM images WHERE owner_id = ?\");\n\t\t$r->execute([$id]);\n\t\tif ($r->rowCount() >= 1) {\n\t\t\treturn $r;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\n\t}", "public function img_gallery($id)\n\t{\n\t\t$r = $this->db->prepare(\"SELECT * FROM images WHERE owner_id = ?\");\n\t\t$r->execute([$id]);\n\t\tif ($r->rowCount() >= 1)\n\t\t{\n\t\t\treturn $r;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t}", "function loadImagesFrontend($id){\n\n\tglobal $wpdb;\n\n\n\t$images = [];\n\n\t$bilder = $wpdb->get_results('SELECT fewo.posts_id FROM '.$wpdb->base_prefix.'fewo_bilder AS fewo LEFT JOIN '.$wpdb->base_prefix.'posts AS wp ON fewo.posts_id = wp.id WHERE fewo.fewo_id = '.$id);\n\n\tforeach($bilder as $key => $item){\n\t\t$images[$key][\"img_thumb\"] = wp_get_attachment_image_src($item->posts_id,\"fewo-small\");\n\t\t$images[$key][\"img_big\"] = wp_get_attachment_image_src($item->posts_id,\"fewo-big\");\n\t\t$images[$key][\"id\"] = $bilder[$key]->posts_id;\n\t}\n\n\treturn $images;\n\n}", "public function getGalleryItems();", "public function getAllPhotosByListingId($listing_id) {\n $sql = \"SELECT * FROM property_photos WHERE listing_id = ?\";\n $stmt = $this->connect()->prepare($sql);\n $stmt->execute([$listing_id]);\n\n $results = $stmt->fetchAll();\n return $results;\n }", "function get_gallery($gallery_id=0){\n\tglobal $mysqli;\n\n\t\t$query=\"SELECT images.*,gallery.* FROM kpias_gallery gallery, kpias_galleryimg images WHERE gallery.gallery_id=images.gallery_id\";\n\t\tif($gallery_id != 0)\n\t\t{\n\t\t\t$query.=\" AND gallery.gallery_id=\".$gallery_id;\n\t\t}\n\t\t$result=$mysqli->query($query);\n\t\tif (!$result) {\n\t\t\t# code...\n\t\t\tdie($mysqli->error);\n\t\t}\n\t\twhile($row=$result->fetch_assoc())\n\t\t{\n\t\t\t$response[]=$row;\n\t\t}\n\t\theader('Content-Type: application/json');\n\t\techo json_encode($response, JSON_UNESCAPED_SLASHES);\n}", "function get_gallery_data($id = null) {\n\n global $wpdb, $siteUrl;\n $gallery_result = [];\n\n $result = $wpdb->get_results('SELECT t1.pid as total,t1.filename,t2.path,t2.title,t2.galdesc,t2.pageid FROM ' . $wpdb->prefix . 'ngg_pictures t1 INNER JOIN ' . $wpdb->prefix . 'ngg_gallery t2 ON t1.galleryid = t2.gid WHERE t1.galleryid = ' . $id, ARRAY_A);\n\n $gallery_result['pageId'] = $result[0]['pageid'];\n $gallery_result['imgUrl'] = $siteUrl . '/' . $result[0]['path'] . '/' . $result[0]['filename'];\n $gallery_result['title'] = $result[0]['title'];\n $gallery_result['description'] = $result[0]['galdesc'];\n $gallery_result['count'] = count($result);\n\n return $gallery_result;\n}", "public function getPhotoById($id) {\n $sql = \"SELECT * FROM property_photos WHERE photo_id = ?\";\n $stmt = $this->connect()->prepare($sql);\n $stmt->execute([$id]);\n\n $results = $stmt->fetchAll();\n return $results;\n }", "public function get_images_by_gallery($id, $options = array())\n\t{\n\t\t// Find new images on files\n\t\t$this->set_new_image_files($id);\n\n\t\t// Clear old files on images\n\t\t$this->unset_old_image_files($id);\n\n\t\tif (isset($options['offset']))\n\t\t{\n\t\t\t$this->db->limit($options['offset']);\n\t\t}\n\n\t\tif (isset($options['limit']))\n\t\t{\n\t\t\t$this->db->limit($options['limit']);\n\t\t}\n\n\t\t// Grand finale, do what you gotta do!!\n\t\t$images = $this->db\n\t\t\t\t// Select fields on gallery images table\n\t\t\t\t->select('gi.*, f.name, f.filename, f.extension, f.description, f.name as title, g.folder_id, g.slug as gallery_slug, g.title as gallery_title')\n\t\t\t\t// Set my gallery by id\n\t\t\t\t->where('g.id', $id)\n\t\t\t\t// Filter images from my gallery\n\t\t\t\t->join('galleries g', 'g.id = gi.gallery_id', 'left')\n\t\t\t\t// Filter files from my images\n\t\t\t\t->join('files f', 'f.id = gi.file_id', 'left')\n\t\t\t\t// Filter files type image\n\t\t\t\t->where('f.type', 'i')\n\t\t\t\t// Order by user order\n\t\t\t\t->order_by('`gi`.`order`', 'asc')\n\t\t\t\t// Get all!\n\t\t\t\t->get('gallery_images gi')\n\t\t\t\t->result();\n\n\t\treturn $images;\n\t}", "public function get_images_by_gallery($id, $options = array())\n {\n // Find new images on files\n $this->set_new_image_files($id);\n\n // Clear old files on images\n $this->unset_old_image_files($id);\n\n if (isset($options['offset']))\n {\n $this->db->offset($options['offset']);\n }\n\n if (isset($options['limit']))\n {\n $this->db->limit($options['limit']);\n }\n\n // Grand finale, do what you gotta do!!\n $images = $this->db\n // Select fields on gallery images table\n ->select('gallery_images.*, files.id as thumbnail_id, files.name, files.filename, files.extension, files.description, files.name as title, galleries.folder_id, galleries.slug as gallery_slug, galleries.title as gallery_title')\n // Set my gallery by id\n ->where('galleries.id', $id)\n // Filter images from my gallery\n ->join('galleries', 'galleries.id = gallery_images.gallery_id', 'left')\n // Filter from my images\n ->join('files', 'files.id = gallery_images.file_id', 'left')\n // Filter files type image\n ->where('files.type', 'i')\n // Order by user order\n ->order_by('`order`', 'asc')\n // Get all!\n ->get('gallery_images')\n ->result();\n\n return $images;\n }", "public function getImages($id)\r\n\t{\r\n\t\t$attachments = array();\r\n\r\n\t\t$thumb_id = get_post_thumbnail_id( $id );\r\n\t\t$res = array();\r\n\t\t$attachments = get_field('images', $id);\r\n\t\tif ( $attachments )\r\n\t\t{\r\n\t\t\tforeach ( $attachments as &$attachment )\r\n\t\t\t{\r\n\t\t\t\t$tmp = wp_get_attachment_image_src($attachment['image'], 'thumbnail');\r\n\t\t\t\t$tmp_full = wp_get_attachment_image_src($attachment['image'], 'full');\r\n\r\n\t\t\t\tif(!$tmp[0]) continue;\r\n\t\t\t\t\r\n\t\t\t\t$attachment['image_thumb'] = $tmp[0];\r\n\t\t\t\t$attachment['image_full'] = $tmp_full[0];\r\n\t\t\t\tarray_push($res, $attachment);\t\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$thumb = get_post( $thumb_id );\r\n\t\t\r\n\t\tif($thumb !== null)\r\n\t\t{\r\n\t\t\t$tmp = wp_get_attachment_image_src($thumb->ID, 'thumbnail');\r\n\t\t\t$tmp_full = wp_get_attachment_image_src($thumb->ID, 'full');\r\n\r\n\t\t\t$new_thumb['image_thumb'] = $tmp[0];\r\n\t\t\t$new_thumb['image_full'] = $tmp_full[0];\r\n\t\t\t$new_thumb['title'] = $thumb->post_title;\r\n\t\t\t$new_thumb['image'] = $thumb->ID;\r\n\t\t\tarray_unshift($res, $new_thumb);\r\n\t\t}\r\n\r\n\t\treturn $res;\r\n\t}", "public function all_gallery_photo_for_admin(){\r\n $query = \"SELECT * FROM tbl_gallery_photo ORDER BY gallery_photo_id DESC \";\r\n if(mysqli_query($this->db_connect, $query)){\r\n $query_result = mysqli_query($this->db_connect, $query);\r\n return $query_result;\r\n }else{\r\n die(\"Query Problem! \".mysqli_error($this->db_connect));\r\n }\r\n }", "public function selectPopularImages($id) {\n $sql = \"SELECT * FROM `images` WHERE `id` = :id LIMIT 9\";\n $stmt = $this->pdo->prepare($sql); \n $stmt->bindValue('id', $id); \n $stmt->execute(); \n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getData($id) {\n $qry = new DbQuery($this->db);\n$sql = <<<ESQL\nSELECT M.id, G.id as galleryid, CONCAT( '/', G.path , '/') as im_path,\n M.name as im_file, M.width as im_width, \n M.description as im_caption, M.thumb_ext\n FROM image M join gallery G on G.id = M.galleryid\n WHERE M.id = :id limit 1\nESQL;\n $result = $qry->objectSet($sql, [':id'=>$id] );\n if (!empty($result)) {\n $img = $result[0];\n $fname = pathinfo( $img->im_file, PATHINFO_FILENAME);\n $img->thumb = empty($img->thumb_ext) ? $img->im_file : $fname . '.' . $img->thumb_ext;\n $img->thumb = \"thumbs/\" . $img->thumb;\n return $img;\n }\n return null;\n }", "public function get_images_for_article( $id )\n {\n\n $table_name = 'media';\n $filter = $this->_primary_filter;\n $id = $filter($id);\n $this->db->where( 'article_id', $id );\n $method = 'result';\n\n return $this->db->get($table_name)->$method();\n }", "public function get_photos()\r\n {\r\n $this->db->select('*');\r\n $this->db->from('gallery');\r\n $query = $this->db->get();\r\n return $result = $query->result();\r\n }", "public function getHomepageImagesById($id){\n $sql = \"SELECT t1.*\n\t\t\t\tFROM homepage_images t1\n\t\t\t\tWHERE t1.homepage_id = :id AND t1.is_active = 1\n\t\t\t\tORDER BY t1.sort ASC\";\n\t\treturn $this->_db->select($sql, array(':id' => $id));\n\n }", "public function galleryAction()\n {\n $request = $this->getRequest();\n\n $galleryId = $request->getParam('group');\n\n\t $model = new Media_Model_Talentmedia2dance();\n\n\t $model->useDependents(false);\n\n\t $pictures = $model->fetchAll('talentnum = ? AND gallery = ?', null, null, null, null, [$this->userid, $galleryId]);\n\n\t $this->view->allimages = Application_Model_Functions::toArray($pictures);\n }", "public function get_media_galleries($id, $language_id = Fotolia_Api::LANGUAGE_ID_EN_US, $thumbnail_size = 110)\n {\n return $this->_api->getMediaGalleries($id, $language_id, $thumbnail_size);\n }", "private function getGalleryImages($params) {\n\t\t$image_ids = array();\n\t\t$images = array();\n\t\t$i = 0;\n\n\t\tif ($params['images'] !== '') {\n\t\t\t$image_ids = explode(',', $params['images']);\n\t\t}\n\n\t\tforeach ($image_ids as $id) {\n\n\t\t\t$image['image_id'] = $id;\n\t\t\t$image_original = wp_get_attachment_image_src($id, 'full');\n\t\t\t$image['url'] = $image_original[0];\n\t\t\t$image['title'] = get_the_title($id);\n\t\t\t$image['alt'] = get_post_meta( $id, '_wp_attachment_image_alt', true);\n\n\t\t\t$images[$i] = $image;\n\t\t\t$i++;\n\t\t}\n\n\t\treturn $images;\n\t}", "public function getListingWithImages( $id )\n {\n return $this->make(\n \"listings/$id?includes=Images\",\n 'get'\n );\n }", "public static function getImages($id)\n {\n return (array) FrontendModel::getContainer()->get('database')->getRecords(\n 'SELECT i.*\n FROM slideshow_images AS i\n WHERE i.gallery_id = ? AND hidden = ? AND i.language = ?\n ORDER BY i.sequence',\n array((int) $id, 'N', FRONTEND_LANGUAGE)\n );\n }", "public function getThumbnails()\n {\n return DB::findBy('attachment_thumbnail', ['attachment_id' => $this->id]);\n }", "public function get($id)\n {\n $query = $this->db\n ->select('gallery_images.*, files.name, files.filename, files.extension, files.description, files.name as title, galleries.folder_id, galleries.slug as gallery_slug')\n ->join('galleries', 'gallery_images.gallery_id = galleries.id', 'left')\n ->join('files', 'files.id = gallery_images.file_id', 'left')\n ->where('gallery_images.id', $id)\n ->get('gallery_images');\n \n if ( $query->num_rows() > 0 )\n {\n return $query->row();\n }\n else\n {\n return FALSE;\n }\n }", "public function getGallery() {\n $this->db->order_by('serialid', 'asc');\n $query = $this->db->get('gallery');\n return $query->result();\n }", "function alterna_get_gallery_list($post_id, $thumbs_size, $fancybox_name = 'fancybox-thumb'){\n\t$gallery_images = penguin_get_post_meta_key('gallery-images', $post_id);\n\t$img_list = alterna_get_post_gallery_ids($gallery_images);\n\t$out_html = '';\n\tif(count($img_list) > 0){\n\t\tforeach($img_list as $item_id){\n\t\t\t$attachment_image = wp_get_attachment_image_src($item_id, $thumbs_size); \n\t\t\t$full_image = wp_get_attachment_image_src($item_id, 'full'); \n\t\t\t$out_html .= '<li><a href=\"'.esc_url($full_image[0]).'\" class=\"fancybox-thumb\" rel=\"'.$fancybox_name.'['.$post_id.']\"><img src=\"'.esc_url($attachment_image[0]).'\" alt=\"\"></a></li>';\n\t\t}\n\t}\n\t\n\treturn $out_html;\n}", "public function getImage($id)\n {\n //$directory = public_path('images/1');\n $files = array();\n $images = glob(Config::get('settings.THUMBNAIL_BOOKSET_IMG_PATH').$id.\"/*\");\n for ($i=0; $i<count($images); $i++) { \n $file = array();\n $image = $images[$i];\n $info = pathinfo($image);\n $file_name = basename($image,'.'.$info['extension']);\n $file['name'] = basename($image);\n $file['uuid'] = $file_name;\n $file['thumbnailUrl'] = url(Config::get('settings.THUMBNAIL_BOOKSET_IMG_PATH').$id.'/' . $file['name']);\n $files[] = $file;\n }\n return response()->json($files);\n }", "public function getGallery($id)\n {\n $q = Doctrine_Query::create()\n ->from('Summers_Model_Gallery g')\n ->where('g.galleryid = ?', $id);\n return $q->fetchArray();\n }" ]
[ "0.7277664", "0.686655", "0.68264407", "0.67926997", "0.6619261", "0.6606578", "0.6552265", "0.65482897", "0.6497672", "0.6480983", "0.64720917", "0.6468356", "0.6447701", "0.6436009", "0.6432159", "0.6396491", "0.6390694", "0.6390377", "0.6381452", "0.6365202", "0.6355411", "0.6319158", "0.63176143", "0.6291886", "0.62845385", "0.6283916", "0.6257217", "0.6251452", "0.6251393", "0.62348986" ]
0.7738156
0
Whether this transformer can transform data
public function canTransform($data): bool { return UnionTypes::is($data, 'array', 'object'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function supportsTransformation($data, string $to, array $context = []): bool\n {\n // if it's an event we transformed the data already\n if ($data instanceof Event) {\n return false;\n }\n\n return Event::class === $to && null !== ($context['input']['class'] ?? null);\n }", "public function hasApplyLabelTransformer(){\n return $this->_has(19);\n }", "public function supports($data): bool;", "public function supportsTransformation($data, string $to, array $context = []): bool\n {\n if ($data instanceof IndexationInputDTO) {\n return false;\n }\n\n return Indexation::class === $to;\n }", "public static function isTransformationAllowedInOptions()\n\t{\n\t\treturn Configuration::allowDocumentTransformation();\n\t}", "public function supportsTransformation($data, string $to, array $context = []): bool\n {\n return AuthorOutput::class === $to && $data instanceof Author;\n }", "public function isTranslatable()\n {\n return ($this->stream->isTranslatable());\n }", "public function valid() {\n return is_array($this->data) ? key($this->data) !== null : false;\n }", "public function canApply(): bool\n {\n if (is_null($this->subject)) {\n return false;\n }\n $parent = $this->findParentNode($this->subject);\n $nodeType = $this->getNodeType();\n\n return !is_null($parent) && !is_null($nodeType)\n && $this->isNodeTypeAllowedAsChildNode($parent, $nodeType);\n }", "protected function isValidData(): bool\n {\n return true;\n }", "protected function isValidData(): bool\n {\n return true;\n }", "public function supports($data);", "public function valid()\n {\n return !is_null($this->content) ? true : false;\n }", "public function canMakeTransform($transform) {\n $sentence = $this->getSentenceFromTransform($transform);\n return $this->ptClient->canMakeTransform($sentence, $transform);\n }", "public function hasValidData(){\n return ($this->hasEmergencyCase() && $this->hasDistraction() && $this->hasMaxim()); \n }", "public function dataProviderCanConvert()\n {\n return [\n 'null' => [null, true],\n 'falsey int' => ['0', true],\n 'falsey string' => ['false', false],\n 'falsey string abbr' => ['f', false],\n 'truthy int' => ['1', true],\n 'truthy string' => ['true', false],\n 'truthy string abbr' => ['t', false],\n 'non bool string' => ['asdf', false],\n 'obj' => [new \\stdClass(), false],\n 'array' => [[], false],\n 'int truthy' => [1, true],\n 'int falsey' => [0, true]\n ];\n }", "private function hasTranslatableAttributes()\n\t{\n\t\treturn property_exists($this, 'translatable') && is_array($this->translatable);\n\t}", "public function isDocumentTranslatable(object $document): bool;", "public function isContentValid(): bool\n {\n return !$this->isComposite() || $this->fa->isValid();\n }", "public function canView()\n\t{\n\t\treturn $this->source->canView();\n\t}", "public function valid()\n {\n if (!parent::valid()) {\n return false;\n }\n\n if ($this->container['x_resolution'] === null) {\n return false;\n }\n if ($this->container['y_resolution'] === null) {\n return false;\n }\n return true;\n }", "public function supportsNormalization($data, $format = null)\n {\n return $data instanceof Travel;\n }", "public function canHydrate()\n {\n return $this->getCommand()->canHydrate();\n }", "public function isValidTransformer($transformer): bool\n {\n if ($transformer instanceof TransformerInterface) {\n return true;\n }\n\n if (\\is_callable($transformer)) {\n return true;\n }\n\n return false;\n }", "public function hasData()\n {\n return $this->data !== null;\n }", "public function valid()\n {\n return is_object($this->pointed);\n }", "public function isTranslatable(): bool\n {\n return $this->isTranslatable;\n }", "protected function checkTaskData() {\n if (!$this->checkType()) {\n return false;\n }\n\n if (empty($this->time_exec)) {\n return false;\n }\n\n if (empty($this->task)) {\n return false;\n }\n\n return true;\n }", "public function valid()\n {\n if (strlen($this->container['content']) > 5000) {\n return false;\n }\n if (strlen($this->container['content']) < 1) {\n return false;\n }\n if (strlen($this->container['destination_number']) > 15) {\n return false;\n }\n if (strlen($this->container['destination_number']) < 1) {\n return false;\n }\n $allowed_values = array(\"SMS\", \"TTS\");\n if (!in_array($this->container['format'], $allowed_values)) {\n return false;\n }\n $allowed_values = array(\"INTERNATIONAL\", \"ALPHANUMERIC\", \"SHORTCODE\");\n if (!in_array($this->container['source_number_type'], $allowed_values)) {\n return false;\n }\n return true;\n }", "public function valid() : bool {\n\t\treturn key($this->data) !== null;\n\t}" ]
[ "0.6322755", "0.63129544", "0.62275267", "0.61946565", "0.61416805", "0.6123152", "0.60177964", "0.5941686", "0.59134305", "0.591279", "0.591279", "0.58814204", "0.58585894", "0.58162946", "0.58074397", "0.5761083", "0.57604474", "0.5756359", "0.5735138", "0.57175106", "0.5693012", "0.5691277", "0.56214243", "0.56160593", "0.5614661", "0.56074744", "0.55913615", "0.5590526", "0.5589354", "0.55511993" ]
0.7152487
0
/ function download config dari server 1. ambil data ssh server, config file di server, dan nama config di local 2. konek ke server via ssh, selanjutnya download config via scp 3. save config, terus cek lagi deh, kalo ada filenya return true
function cfgDownload($cfgid, $dbconnection){ $sql = $dbconnection->prepare("SELECT configrecord.txtlocalcfg, configrecord.txtdircfg, configrecord.txtnmcfg, configrecord.txtipsvr, configrecord.txtloginsvr, configrecord.txtpswdsvr, configrecord.txtportsvr FROM configrecord WHERE configrecord.txtidcfg = ?"); $sql->bind_param('i', $cfgid); $sql->execute(); $sql->store_result(); $sql->bind_result($cfgfile, $cfgdirsvr, $cfgfilesvr, $svrhost, $svrlogin, $svrpasswd, $svrport); $sql->fetch(); $localfile = $cfgfile; $remotefile = $cfgdirsvr.$cfgfilesvr; $ssh = new SSH2($svrhost, $svrport); $sshconnection = $ssh->login($svrlogin, $svrpasswd); if (!$sshconnection) { return false; } else { $scp = new SCP($ssh); $scp->get($remotefile, $localfile, SCP_LOCAL_FILE); if(cfgLocalExist($cfgid, $dbconnection) == false) { return false; }else{ return true; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cfgUpload($cfgid, $dbconnection){\n\t$sql = $dbconnection->prepare(\"SELECT\n\tconfigrecord.txtlocalcfg,\n\tconfigrecord.txtdircfg,\n\tconfigrecord.txtnmcfg,\n\tconfigrecord.txtipsvr,\n\tconfigrecord.txtloginsvr,\n\tconfigrecord.txtpswdsvr,\n\tconfigrecord.txtportsvr\n\tFROM\n\t\tconfigrecord\n\tWHERE\n\t\tconfigrecord.txtidcfg = ?\");\n\t$sql->bind_param('i', $cfgid);\n $sql->execute();\n $sql->store_result();\n $sql->bind_result($cfgfile, $cfgdirsvr, $cfgfilesvr, $svrhost, $svrlogin, $svrpasswd, $svrport);\n $sql->fetch();\n\n $localfile = $cfgfile;\n $remotefile = $cfgdirsvr.$cfgfilesvr;\n\n $ssh = new SSH2($svrhost, $svrport);\n $sshconnection = $ssh->login($svrlogin, $svrpasswd);\n if (!$sshconnection) {\n return false; \n } else {\n \t$scp = new SCP($ssh);\n \t$scp->put($remotefile, $localfile, SCP_LOCAL_FILE);\n\n \tif(cfgLocalExist($cfgid, $dbconnection) == false) {\n \t\treturn false;\n \t}else{\n \t\treturn true;\n \t}\n }\n\n}", "function mergeConfig($env)\n{\n $user = $env['user'];\n $pass = $env['pass'];\n $host = $env['host'];\n $ssh = \"ssh -A -tt $user@$host\";\n\n $baseFolder = $env['path'];\n\n $config = [\n 'remote' => 'sftp://' . $host . $baseFolder,\n 'user' => $user,\n 'password' => $pass,\n 'local' => '../',\n 'test' => false,\n 'color' => true,\n 'ignore' => '\n\t\t\t/deployment.*\n\t\t\t/log\n\t\t\ttemp/*\n\t\t\t!temp/.htaccess\n\t\t\t*/tests\n\t\t\t.env\n\t\t\t/vendor/\n\t\t\t/storage/logs/\n\t\t\t/storage/framework/\n\t\t\t/storage/framework/\n\t\t\tREADME.md\n\t\t\t/docs/\n\t\t\t/deploy/\n\t\t',\n 'allowDelete' => true,\n 'after' => [\n function (Deployment\\Server $server, Deployment\\Logger $logger, Deployment\\Deployer $deployer) use ($baseFolder, $ssh) {\n $logger->log('>> After');\n\n // Composer\n $logger->log(' Running composer install...');\n $command = \"$ssh 'cd {$baseFolder} && php composer.phar install'\";\n echo shell_exec($command);\n $logger->log(' ');\n\n // Migration\n $logger->log(' Running artisan migrate and dumping autoload...');\n $command = \"$ssh 'cd {$baseFolder} && php artisan migrate && php composer.phar dump-autoload'\";\n echo shell_exec($command);\n $logger->log(' ');\n }\n ]\n ];\n\n return $config;\n}", "public function saveRemoteConfig()\n {\n $path = $this->getConfigPath();\n\n \t$result = Mage::getModel('tiramizoo/api', array('api_token' => $this->_apiToken))\n \t->getRemoteConfiguration();\n\n if ($result['http_status'] != 200) {\n throw new Exception(\"Can't connect to Tiramizoo API\", 1);\n }\n\n if (isset($result['response'])) {\n Mage::getModel('core/config')->saveConfig($path, json_encode($result['response']));\n $this->_config = json_encode($result['response']);\n }\n\n return $this;\n }", "function install_create_config($web_path,$username,$password,$hostname,$database,$download) {\n\n\t$config_file = Config::get('prefix') . '/config/ampache.cfg.php';\n\n $data['database_username'] = $username;\n $data['database_password'] = $password;\n $data['database_hostname'] = $hostname;\n $data['database_name'] = $database;\n\t$data['web_path']\t = $web_path;\n\n Config::set_by_array($data, true);\n\n /* Attempt to make DB connection */\n $dbh = Dba::dbh();\n\n\t/*\n\t First Test The Variables they've given us to make\n\t sure that they actually work!\n\t*/\n\t// Connect to the DB\n\tif(!Dba::check_database()) {\n\t\tError::add('general', T_(\"Database Connection Failed Check Hostname, Username and Password\"));\n\t\treturn false;\n\t}\n\tif (!Dba::check_database_exists()) {\n\t\tError::add('general', sprintf(T_('Database selection failed. Check existence of %s'), $database));\n\t\treturn false;\n\t}\n\n\t$final = generate_config($data);\n\n\t// Make sure the directory is writable OR the empty config file is\n\tif (!$download) {\n\t\tif (!check_config_writable()) {\n\t\t\tError::add('general', T_(\"Config file is not writable\"));\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\t// Given that $final is > 0, we can ignore lazy comparison problems\n\t\t\tif (!file_put_contents($config_file,$final)) {\n\t\t\t\tError::add('general', T_(\"Error Writing config file\"));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\t$browser = new Horde_Browser();\n\t\t$browser->downloadHeaders('ampache.cfg.php', 'text/plain', false, strlen($final));\n\t\techo $final;\n\t\texit();\n\t}\n\n\treturn true;\n\n}", "public function copyConfigFiles()\n {\n $cfg = Storage::disk('projects')->get($this->project->path . '/cfg/yolo.cfg');\n $data = Storage::disk('projects')->get($this->project->path . '/data/obj.data');\n $names = Storage::disk('projects')->get($this->project->path . '/data/obj.names');\n\n Storage::put($this->jobPath . '/cfg/yolo.cfg', $cfg);\n Storage::put($this->jobPath . '/data/obj.data', $data);\n Storage::put($this->jobPath . '/data/obj.names', $names);\n }", "public function sync()\n {\n // Check writable\n if(!is_writable($this->configCachePath))\n {\n return false;\n }\n \n // Rewrite config file\n // Truncate to 0b first\n $handle = fopen($this->configCachePath, 'w');\n \n // Is the file handle OK?\n if(!$handle)\n {\n return false;\n }\n \n // Read all config data\n $this->db->select('*', 'bf_config')\n ->order('name', 'asc')\n ->execute();\n \n // Write intro\n fwrite($handle, '; b2bFront configuration cache file' . \"\\n\");\n fwrite($handle, '; Last configuration cache commit: ' . Tools::longDate() . \"\\n\\n\");\n \n // Begin write\n while($configItem = $this->db->next())\n {\n fwrite($handle, $configItem->name . ' = \"' . $configItem->value . '\"' . \"\\n\");\n }\n \n // Done, close the file\n fclose($handle);\n \n // Now load the values back into memory\n $this->load();\n \n return true;\n }", "private function save()\n {\n $string = \"<?php \\n return array (\";\n $string .= $this->reformatArray($this->config, \"\\t\");\n $string .= \"\\n);\";\n if (file_put_contents(BASE_DIR . \"admin/config/config.php\", $string) > 0)\n return true;\n return false;\n }", "function _checkConfig(){\n $this->bConfigExists = file_exists(DIR_PLUGINS.\"{$this->sName}/config.php\");\n if(!$this->bConfigExists){\n $this->bConfigWritable = false;\n }else if(is_writable(DIR_PLUGINS.\"{$this->sName}/config.php\")){\n $this->bConfigWritable = true;\n }else{\n @chmod(DIR_PLUGINS.\"{$this->sName}/config.php\",0644);\n if(is_writable(DIR_PLUGINS.\"{$this->sName}/config.php\")){\n $this->bConfigWritable = true;\n }else{\n $this->bConfigWritable = false;\n }\n }\n }", "function ssh_copy_from($remotepath, $localpath, &$out)\n {\n \tglobal $debug_sexec;\n\n \tif ($debug_sexec) echo \"SExec::ssh_copy_from($remotepath, $localpath)\\n\";\n\n/*\tThis would be great if SCP could hijack the shared connection (sic)\n\tumask(0077);\n\t$tmpfname = tempnam($this->workdir, \"copy-from-\");\n\tchmod($tmpfname, 0700);\n\tputenv(\"DISPLAY=none:0.\");\n\tputenv(\"SSH_ASKPASS=$tmpfname\");\n\t$fp = fopen($tmpfname, \"w\");\n\tfputs($fp, \"#!/bin/sh\\necho $this->password\\n\");\n\tif (! $debug_sexec) \n\t fputs($fp, \"/bin/touch $tmpfname.called\\n\");\n\telse\n\t fputs($fp, \"/bin/rm $tmpfname\\n\");\n\tfclose($fp);\n\tif ($debug_sexec) echo \"$this->scp -pqrC $this->remote:$remotepath $localpath\\n\";\n\t$out = \"\";\n\texec(\"$this->scp -pqrC $this->remote:$remotepath $localpath\", $out, $status);\n\tif ($status == 0)\n\t return TRUE;\n\telse {\n\t if ($debug_sexec) echo $out . \"\\n\";\n\t return FALSE;\n\t}\n*/ \t\n \tif ((file_exists(\"$localpath/.\")) && (is_dir(\"$localpath/.\"))) {\n\t // Local is a directory. Copy remote into it.\n\t if ($debug_sexec) echo \"--> $localpath/. is a dir\\n\";\n \t if ($debug_sexec) echo \"--> Executing\\n\" .\n\t \"$this->ssh -x -T -C -S $this->mplex_socket $this->remote \" .\n\t \t \"\\\"/bin/tar -C \" .dirname($remotepath). \n\t \t\t\" -cf - \". basename($remotepath) .\"\\\" | \".\n\t \t\t\"/bin/tar -C $localpath -xf -\\n\";\n \t exec(\"($this->ssh -x -T -C -S $this->mplex_socket $this->remote \" .\n\t \t \"\\\"/usr/local/bin/tar -C \" .dirname($remotepath). \n\t \t\t\" -cf - \". basename($remotepath) .\"\\\" | \".\n\t \t\t\"/bin/tar -C $localpath -xf -) 2>&1\",\n\t\t $out, $res);\n \t}\n\telse {\n\t // either the local side does not exist or is not a directory\n\t // if remote is a directory\n\t //\t make local equivalent and copy contents (make will\n\t //\t fail if local exists as a non-dir)\n\t if ($debug_sexec) echo \"--> $localpath is NOT a dir\\n\";\n\t $res = $this->ssh_exec(\"test -d $remotepath 2>&1\", $out);\n\t if ($res == 0) {\n\t \texec(\"/bin/mkdir -p $localpath 2>&1\", $out, $res);\n\t\tif ($res != 0) {\n\t\t // can't create the dir, either it is a regular file\n\t\t // or we don't have privileges\n\t\t if ($debug_sexec) print_r($out);\n\t\t return FALSE;\n\t\t}\n\t\t// copy in the remote contents\n\t\tif ($debug_sexec) echo \"-->Executing\\n\" .\n\t\t \"($this->ssh -x -T -C -S $this->mplex_socket $this->remote \" .\n\t\t \"\\\"/bin/tar -C $remotepath -cf - .\\\" | \" .\n\t\t \"/bin/tar -C $localpath -xf -)2>&1\\n\";\n\t\texec(\"($this->ssh -x -T -C -S $this->mplex_socket $this->remote \" .\n\t\t \"\\\"/bin/tar -C $remotepath -cf - .\\\" | \" .\n\t\t \"/bin/tar -C $localpath -xf -)2>&1\",\n\t\t $out, $res);\n\t\t\n\t } else {\n\t \t// remote is a non-dir: cat over local\n\t\tif ($debug_sexec) echo \"-->Executing\\n\" .\n\t\t \"($this->ssh -x -T -C -S $this->mplex_socket $this->remote \" .\n\t\t \"\\\"cat $remotepath\\\" | \".\n\t\t \" cat > $localpath) 2>&1\\n\";\n\t \texec(\"($this->ssh -x -T -C -S $this->mplex_socket $this->remote \" .\n\t\t \"\\\"cat $remotepath\\\" | \".\n\t\t \" cat > $localpath) 2>&1\", $out, $res);\n \t }\n \t}\n\tif ($res == 0) \n\t return TRUE;\n\telse {\n\t if ($debug_sexec) print_r($out);\n\t return FALSE;\n\t}\n }", "function download(){\n\t\t//where to download the files\n\t\t$remote_file = $this->GetParameterValue('remote_filename'); \n\t\t$local_file = $this->GetParameterValue('outdir').$remote_file;\n\n\t\t$connection = ftp_connect($this->GetParameterValue('download_url'));\n\t\t$login_result = ftp_login($connection,\"\",\"\");\n\n\t\tif(ftp_get($connection,$local_file,$remote_file)) {\n\t\t\techo \"successfully downloaded file to $local_file\\n\";\n\t\t} else {\n\t\t\techo \"There was a problem downloading the chembl mysql database file. \\n\";\n\t\t}\n\n\t\tftp_close($connection);\n\t}", "private function createConfig()\n\t{\n\t\t$configFilename = __DIR__ . '/app/config/config.local.neon';\n\n\t\tcopy(__DIR__ . '/app/config/config.local.example.neon', $configFilename);\n\n\t\t$lines = file($configFilename);\n\n\t\tforeach ($lines as $key => $line)\n\t\t{\n\t\t\tforeach (array('username', 'password', 'database') as $subject)\n\t\t\t{\n\t\t\t\tif (strpos($line, \"\\t\" . $subject))\n\t\t\t\t{\n\t\t\t\t\t$lines[$key] = $this->deleteNewline($line, \"\\n\") . ' ' . $this->config['db'][$subject] . \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (file_put_contents($configFilename, $lines))\n\t\t{\n\t\t\t$this->success('Local config file created ...');\n\t\t}\n\t}", "public function storeConfig() {\n\n\t\t$config[] \t= $this->getLine('dbname', \t\t$this->dbname);\n\t\t$config[] \t= $this->getLine('dbhost', \t\t$this->dbhost);\n\t\t$config[] \t= $this->getLine('dbuser', \t\t$this->dbuser);\n\t\t$config[] \t= $this->getLine('dbpass', \t\t$this->dbpass);\n\t\t$config[] \t= $this->getLine('log', \t\t$this->log);\n\t\t$config[] \t= $this->getLine('attempts', \t$this->attempts);\n\t\t$config[] \t= $this->getLine('delay', \t\t$this->delay);\n\t\t$config[] \t= $this->getLine('alarm', \t\t$this->alarm);\n\n\t\ttry {\n\t\t\tfile_put_contents(SendQueueDefs::CONFIGFILE, $config);\n\t\t\treturn true;\n\t\t}\n\t\tcatch (Exception $exception) {\n\t\t\tthrow new Exception(SendQueueDefs::ERROR_CONFIGFILE);\n\t\t}\n\n\t}", "function ssh_copy_to($localpath, $remotepath, &$out)\n {\n \tglobal $debug_sexec;\n\n \tif ($debug_sexec) echo \"\\nSExec::ssh_copy_to($localpath, $remotepath)\\n\";\n\n/*\tThis would be great if SCP could hijack the shared connection (sic)\n\tumask(0077);\n\t$tmpfname = tempnam($this->workdir, \"copy-to-\");\n\tchmod($tmpfname, 0700);\n\tputenv(\"DISPLAY=none:0.\");\n\tputenv(\"SSH_ASKPASS=$tmpfname\");\n\t$fp = fopen($tmpfname, \"w\");\n\tfputs($fp, \"#!/bin/sh\\necho $this->password\\n\");\n\tif (! $debug_sexec) \n\t fputs($fp, \"/bin/touch $tmpfname.called\\n\");\n\telse\n\t fputs($fp, \"/bin/rm $tmpfname\\n\");\n\tfclose($fp);\n\tif ($debug_sexec) echo \"$this->scp -pqrC $localpath $this->remote:$remotepath\\n\";\n\t$out = \"\";\n\texec(\"$this->scp -pqrC $localpath $this->remote:$remotepath\", $out, $status);\n\tif ($status == 0)\n\t return TRUE;\n\telse {\n\t if ($debug_sexec) echo $out . \"\\n\";\n\t return FALSE;\n\t}\n*/\n\t// NOTE THAT WE NEED GNU TAR !!!\n\t$retval = $this->ssh_exec(\"test -d $remotepath 2>&1\", $out);\n\tif ($retval == 0) {\n\t // destination is a directory, copy $local inside it\n\t if ($debug_sexec) echo \"--> Remote is a directory\\n\";\n\t $fn = basename($localpath);\n\t $dn = dirname($localpath);\n\t if ($debug_sexec) echo \"--> Executing\\n\" .\n\t \t\"/bin/tar -C $dn -cf - $fn | \" .\n\t\t\"ssh -x -T -C -S $this->mplex_socket $this->remote \" .\n\t\t\"\\\"/bin/tar -C $remotepath -xf -\\\"\\n\";\n\t exec(\"(/bin/tar -C $dn -cf - $fn | \" .\n\t \t \"ssh -x -T -C -S $this->mplex_socket $this->remote \" .\n\t\t \"\\\"/bin/tar -C $remotepath -xf -\\\")2>&1\", \n\t \t$out, $retval);\n\t} else {\n\t // destination is not a directory, copy _to_ it\n\t if ($debug_sexec) \n\t \techo \"--> remote is not a directory or does not exist\\n\";\n\t if ((file_exists(\"$localpath/.\")) && (is_dir(\"$localpath/.\"))) {\n\t \t// if local is a dir, try to create it remotely with new name\n\t \t$retval = $this->ssh_exec(\"/bin/mkdir -p $remotepath \", $out);\n\t\tif ($retval != 0) {\n\t\t // we can't create it, either it already exists as a\n\t\t // regular file or we don't have permissions, anyhow,\n\t\t // we can't do the copy\n\t \t if ($debug_sexec) print_r($out);\n\t\t return FALSE;\n\t\t}\n\t\t// now cd lo local and copy over to remote\n\t\tif ($debug_sexec) echo \"--> Executing \\n\" .\n\t\t\t\" /bin/tar -C $localpath -cf - . | \\n\" .\n\t\t\t\" $this->ssh -x -T -C -S $this->mplex_socket $this->remote \\n\" .\n\t \t\t\" /bin/tar -C $remotepath -xf -\\n\";\n\t\texec(\"(/bin/tar -C $localpath -cf - . | \" .\n\t \t \"$this->ssh -x -T -C -S $this->mplex_socket $this->remote \" .\n\t \t \"/bin/tar -C $remotepath -xf -)2>&1\", \n\t\t $out, $retval);\n\t }\n\t else {\n\t \t// non-dir: file, block-special, char-special, pipe, socket...\n\t\tif ($debug_sexec) echo \"--> Executing \\n\" .\n\t\t \" cat $localpath | \\n\" .\n\t\t \" $this->ssh -x -T -C -S $this->mplex_socket $this->remote \\n\" .\n\t\t \" \\\"cat > $remotepath\\\"\\n\";\n\t \texec(\"(cat $localpath | \" .\n\t \t \"$this->ssh -x -T -C -S $this->mplex_socket $this->remote \" .\n\t\t \"\\\"cat > $remotepath\\\") 2>&1\", $out, $retval);\n\t }\n\t}\n\tif ($retval != 0) {\n\t if ($debug_sexec) print_r($out);\n \t return FALSE;\n\t}\n\telse\n\t return TRUE;\n }", "function config_install($conffile) {\n\tglobal $g,$config;\n\n\tif(!file_exists($conffile)):\n\t\treturn 1;\n\tendif;\n\tconfig_lock();\n\tconf_mount_rw();\n\t$result = copy($conffile,\"{$g['conf_path']}/config.xml\");\n\tconf_mount_ro();\n\tconfig_unlock();\n\tif(true === $result):\n\t\twrite_loader_config();\n\t\treturn 0;\n\tendif;\n\treturn 1;\n}", "public function test_get_config_api() {\n\t\t//Expected Result:: the api returns the current configuration of the storage_server\n\t\tdiskmapper_setup::reset_diskmapper_storage_servers();\n\t\tdiskmapper_api::zstore_put(DUMMY_FILE_1, \"game-test-slave-1\");\n\t\tsleep(10);\n\t\t$PriMapping = diskmapper_functions::get_primary_partition_mapping(\"game-test-slave-1\");\n\t\t$PriSS=$PriMapping['storage_server'];\n\t\t$Pridisk=$PriMapping['disk'];\n\t\t$map = storage_server_api::get_config_api($PriSS);\n\t\t$host_name = $map[$Pridisk][\"primary\"];\n\t\t$this->assertEquals($host_name, \"game-test-slave-1\", \"host names does not match\");\n\t}", "function flo_config_permission()\n {\n $configFileName = \"wp-config.php\";\n $config_file_name = 'wp-config.php';\n\t\tif ( file_exists( ABSPATH . $configFileName) ) {\n\t\t\t$config = ABSPATH . $configFileName;\n\t\t} else {\n\t\t\t$config = dirname(ABSPATH) . '/'.$configFileName;\n\t\t}\n $result = array();\n\n //check if file exists\n if ( file_exists($config) ) {\n\n //check if writable\n $configWrite = is_writable($config);\n //result return\n if($configWrite == false){\n $result[\"response\"] = false;\n $result[\"message\"] = \"The wp-config.php file is not writable. Please make the file writable in order to be able to proceed further.\";\n } else {\n $result[\"response\"] = true;\n $result[\"message\"] = \"Writable.\";\n }\n\n } else {\n $result[\"response\"] = false;\n $result[\"message\"] = \"The config file was not found.\";\n }\n\n $initActions = new FLO_LAUNCH_ACTIONS();\n $initActions->logMessage('Clone Status :: ' . json_encode($result));\n echo json_encode($result);\n\n die();\n }", "private function saveExportConfigCommon(&$service = NULL) {\n\t\t$service = new DeployService($this->db, $this->post, $this->validator, $this->helper);\n\t\tif( $service->hasAction() ) {\n\t\t\t$service->updateExportConfig();\t\n\t\t\treturn TRUE;\t\t\t\t\t\t\t\t\n\t\t}\n\t\treturn FALSE;\n\t}", "function install_create_config($web_path,$username,$password,$hostname,$database) { \n\n $data['database_username'] = $username;\n $data['database_password'] = $password;\n $data['database_hostname'] = $hostname;\n $data['database_name'] = $database;\n\t$data['web_path']\t = $web_path; \n\n Config::set_by_array($data,'1');\n\n /* Attempt to make DB connection */\n $dbh = Dba::dbh();\n\n\t/* \n\t First Test The Variables they've given us to make\n\t sure that they actually work!\n\t*/\n\t// Connect to the DB\n\tif(!is_resource($dbh)) { \n\t\tError::add('general',\"Database Connection Failed Check Hostname, Username and Password\");\n\t\treturn false;\n\t}\n\tif (!$db_selected = @mysql_select_db($database, $dbh)) { \n\t\tError::add('general',\"Database Selection Failure Check Existance of $database\");\n\t\treturn false;\n\t}\n\n\t$final = generate_config($data); \n\n\t$browser = new Browser(); \n\t$browser->downloadHeaders('ampache.cfg.php','text/plain',false,filesize('config/ampache.cfg.php.dist')); \n\techo $final; \n\texit();\n\n\treturn true;\n\n}", "private static function _updateConfigFiles($vars) {\n\n $values = self::_buildParams($GLOBALS['_SERVER']);\n\n $path = $vars['argv'][0];\n\n $paths = array(\n 'tempPath' => str_replace('/scripts/configure', '/htdocs/setup/', $path),\n 'installationPath' => strip_tags($vars['WEB__contenido_DIR']) . '/'\n );\n\n // old http_path\n $fePath = file_get_contents($paths['installationPath'] . 'http_path.txt');\n\n // update config.php\n self::_updateConfig($fePath, $paths, $values, $vars);\n\n // update config.clients.php\n self::_updateClientConfig($fePath, $paths, $values);\n\n // update http_path.txt this file is used to identify the last value => needed for replacing\n // in config files\n self::_updateHttpPath($paths, $values);\n\n // update admin data => run cronjob\n self::_runAdminUpdateJob($vars, $values);\n }", "function tripal_remote_job_check_configuration($connection_details)\n{\n // Generate the command to test the connection.\n $rwd = $connection_details['remote_working_directory'];\n $cmd = 'ssh -p '.$connection_details['ssh_port'].' -i '.$connection_details['ssh_key_location'].' '.$connection_details['username'].'@'.$connection_details['hostname'].' \\' if [ -e '.$rwd.' ]; then if [ -w '.$rwd.' ]; then echo \"directory_exists_is_writable\"; else echo \"directory_exists_not_writable\"; fi else mkdir -p '.$rwd.'; if [ $? -eq 0 ]; then echo \"directory_created\"; else echo \"directory_failed\"; fi fi \\'';\n \n //drupal_set_message($cmd);\n exec($cmd, $results, $return_var);\n //dpm($results[0]);\n //dpm($return_var);\n \n $status_code = 5;\n // $return_var will be non-zero if there was an error with the connection\n if ($return_var)\n {\n $status_code = 4;\n }\n // Otherwise, see how the server configuration went after connecting\n else\n {\n switch ($results[0])\n {\n case \"directory_exists_is_writable\":\n $status_code = 0;\n break;\n case \"directory_exists_not_writable\":\n $status_code = 1;\n break;\n case \"directory_created\":\n $status_code = 2;\n break;\n case \"directory_failed\":\n $status_code = 3;\n break; \n }\n }\n \n return $status_code;\n}", "function write_config () {\n\t\t$config = file( $this->config_path );\n\t\tforeach ( $this->entries as $entry )\n\t\t\t$config = $entry->change_config( $config );\n\t\t$file = fopen( $this->config_path, \"wb\" );\n\t\t$written = fwrite( $file, implode( \"\", $config ) );\n\t\tfclose( $file );\n\t\tif ( $written == 0 ) return FALSE;\n\t\tforeach ( $this->entries as $entry )\n\t\t\t$entry->parse_config( $config );\n\t\treturn TRUE;\n\t}", "function putConfigfile($file)\n {\n if (!radius_config($this->res, $file)) {\n return false;\n }\n return true;\n }", "public function save() {\n\t\tif (is_file($this->conffile) == True) {\n\t\t\t$file = fopen($this->conffile, \"r\");\n\t\t\t$file_array = array();\n\t\t\t// read config file\n\t\t\twhile (!feof($file)) {\n\t\t\t\tarray_push($file_array, fgets($file, 1024));\n\t\t\t}\n\t\t\tfclose($file);\n\t\t\t// generate new configuration file\n\t\t\t$saved = array();\n\t\t\tfor ($i = 0; $i < sizeof($file_array); $i++) {\n\t\t\t\t$line = trim($file_array[$i]);\n\t\t\t\tif (($line == \"\")||($line[0] == \"#\")) continue; // ignore comments and empty lines\n\t\t\t\t// search keywords\n\t\t\t\tfor ($k = 0; $k < sizeof($this->settings); $k++) {\n\t\t\t\t\t$keyword = $this->settings[$k];\n\t\t\t\t\t$keylen = strlen($keyword);\n\t\t\t\t\tif (strtolower(substr($line, 0, $keylen + 1)) == strtolower($keyword . \":\")) {\n\t\t\t\t\t\t$file_array[$i] = $keyword . \": \" . $this->$keyword . \"\\n\";\n\t\t\t\t\t\t$saved[] = $keyword;\t// mark keyword as saved\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\t// check if we have to add new entries (e.g. if user upgraded LAM and has an old config file)\n\t\tif (!in_array(\"password\", $saved)) array_push($file_array, \"\\n\\n# password to add/delete/rename configuration profiles\\n\" . \"password: \" . $this->password);\n\t\tif (!in_array(\"default\", $saved)) array_push($file_array, \"\\n\\n# default profile, without \\\".conf\\\"\\n\" . \"default: \" . $this->default);\n\t\tif (!in_array(\"sessionTimeout\", $saved)) array_push($file_array, \"\\n\\n# session timeout in minutes\\n\" . \"sessionTimeout: \" . $this->sessionTimeout);\n\t\tif (!in_array(\"logLevel\", $saved)) array_push($file_array, \"\\n\\n# log level\\n\" . \"logLevel: \" . $this->logLevel);\n\t\tif (!in_array(\"logDestination\", $saved)) array_push($file_array, \"\\n\\n# log destination\\n\" . \"logDestination: \" . $this->logDestination);\n\t\tif (!in_array(\"allowedHosts\", $saved)) array_push($file_array, \"\\n\\n# list of hosts which may access LAM\\n\" . \"allowedHosts: \" . $this->allowedHosts);\n\t\tif (!in_array(\"passwordMinLength\", $saved)) array_push($file_array, \"\\n\\n# Password: minimum password length\\n\" . \"passwordMinLength: \" . $this->passwordMinLength);\n\t\tif (!in_array(\"passwordMinUpper\", $saved)) array_push($file_array, \"\\n\\n# Password: minimum uppercase characters\\n\" . \"passwordMinUpper: \" . $this->passwordMinUpper);\n\t\tif (!in_array(\"passwordMinLower\", $saved)) array_push($file_array, \"\\n\\n# Password: minimum lowercase characters\\n\" . \"passwordMinLower: \" . $this->passwordMinLower);\n\t\tif (!in_array(\"passwordMinNumeric\", $saved)) array_push($file_array, \"\\n\\n# Password: minimum numeric characters\\n\" . \"passwordMinNumeric: \" . $this->passwordMinNumeric);\n\t\tif (!in_array(\"passwordMinSymbol\", $saved)) array_push($file_array, \"\\n\\n# Password: minimum symbolic characters\\n\" . \"passwordMinSymbol: \" . $this->passwordMinSymbol);\n\t\tif (!in_array(\"passwordMinClasses\", $saved)) array_push($file_array, \"\\n\\n# Password: minimum character classes (0-4)\\n\" . \"passwordMinClasses: \" . $this->passwordMinClasses);\n\t\t$file = @fopen($this->conffile, \"w\");\n\t\tif ($file) {\n\t\t\tfor ($i = 0; $i < sizeof($file_array); $i++) fputs($file, $file_array[$i]);\n\t\t\tfclose($file);\n\t\t}\n\t\telse {\n\t\t\tStatusMessage(\"ERROR\", \"\", _(\"Cannot open config file!\") . \" (\" . $this->conffile . \")\");\n\t\t}\n\t}", "private function updateConfiguration()\r\n {\r\n $yaml = $this->loader->dump($this->config,2);\r\n file_put_contents(__DIR__.self::CONFIG_PATH.'.bkp', $yaml);\r\n \r\n //Update new config\r\n $newConfig = array_replace_recursive($this->config,$this->skConfig);\r\n $yaml = $this->loader->dump($newConfig,3);\r\n file_put_contents(__DIR__.self::CONFIG_PATH, $yaml);\r\n \r\n //Backing up old routing\r\n $this->routing = $this->loader->parse(__DIR__.self::ROUTING_PATH);\r\n $yaml = $this->loader->dump($this->routing,2);\r\n file_put_contents(__DIR__.self::ROUTING_PATH.'.bkp', $yaml);\r\n \r\n //Update new config\r\n $newRouting = array_replace_recursive($this->routing,$this->skRouting);\r\n $yaml = $this->loader->dump($newRouting,3);\r\n file_put_contents(__DIR__.self::ROUTING_PATH, $yaml);\r\n }", "function update_config_installed()\r\r\n{\r\r\n $CI =& get_instance();\r\r\n $config_path = APPPATH . 'config/config.php';\r\r\n $CI->load->helper('file');\r\r\n @chmod($config_path, FILE_WRITE_MODE);\r\r\n $config_file = read_file($config_path);\r\r\n $config_file = trim($config_file);\r\r\n $prefix = \"http://\";\r\r\n if (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {\r\r\n $prefix = 'https://';\r\r\n }\r\r\n $base_url = $prefix . $_SERVER['HTTP_HOST'];\r\r\n $base_url .= preg_replace('@/+$@', '', dirname($_SERVER['SCRIPT_NAME'])) . '/';\r\r\n $config_file = str_replace(\"\\$config['installed'] = false;\", \"\\$config['installed'] = true;\", $config_file);\r\r\n $config_file = str_replace(\"\\$config['base_url'] = '';\", \"\\$config['base_url'] = '\" . $base_url . \"';\", $config_file);\r\r\n if (!$fp = fopen($config_path, FOPEN_WRITE_CREATE_DESTRUCTIVE)) {\r\r\n return FALSE;\r\r\n }\r\r\n flock($fp, LOCK_EX);\r\r\n fwrite($fp, $config_file, strlen($config_file));\r\r\n flock($fp, LOCK_UN);\r\r\n fclose($fp);\r\r\n @chmod($config_path, FILE_READ_MODE);\r\r\n return TRUE;\r\r\n}", "private function fetchFileSsh(KalturaBatchJob $job, KalturaSshImportJobData $data)\r\n\t{\r\n\t\tKalturaLog::debug(\"fetchFile($job->id)\");\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$sourceUrl = $data->srcFileUrl;\r\n\t\t\tKalturaLog::debug(\"sourceUrl [$sourceUrl]\");\r\n\t\t\t\r\n // extract information from URL and job data\r\n\t\t\t$parsedUrl = parse_url($sourceUrl);\r\n\t\t\t\r\n\t\t\t$host = isset($parsedUrl['host']) ? $parsedUrl['host'] : null;\r\n\t\t\t$remotePath = isset($parsedUrl['path']) ? $parsedUrl['path'] : null;\r\n\t\t\t$username = isset($parsedUrl['user']) ? $parsedUrl['user'] : null;\r\n\t\t\t$password = isset($parsedUrl['pass']) ? $parsedUrl['pass'] : null;\r\n\t\t\t$port = isset($parsedUrl['port']) ? $parsedUrl['port'] : null;\r\n\t\t\t\r\n\t\t\t$privateKey = isset($data->privateKey) ? $data->privateKey : null;\r\n\t\t\t$publicKey = isset($data->publicKey) ? $data->publicKey : null;\r\n\t\t\t$passPhrase = isset($data->passPhrase) ? $data->passPhrase : null;\r\n\t\t\t\r\n\t\t\tKalturaLog::debug(\"host [$host] remotePath [$remotePath] username [$username] password [$password] port [$port]\");\r\n\t\t\tif ($privateKey || $publicKey) {\r\n\t\t\t KalturaLog::debug(\"Private Key: $privateKey\");\r\n\t\t\t KalturaLog::debug(\"Public Key: $publicKey\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (!$host) {\r\n\t\t\t $this->closeJob($job, KalturaBatchJobErrorTypes::APP, KalturaBatchJobAppErrors::MISSING_PARAMETERS, 'Error: missing host', KalturaBatchJobStatus::FAILED);\r\n\t\t\t return $job;\r\n\t\t\t}\r\n\t\t\tif (!$remotePath) {\r\n\t\t\t $this->closeJob($job, KalturaBatchJobErrorTypes::APP, KalturaBatchJobAppErrors::MISSING_PARAMETERS, 'Error: missing path', KalturaBatchJobStatus::FAILED);\r\n\t\t\t return $job;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// create suitable file transfer manager object\r\n\t\t\t$subType = $job->jobSubType;\r\n\t\t\t$engineOptions = isset($this->taskConfig->engineOptions) ? $this->taskConfig->engineOptions->toArray() : array();\r\n\t\t\t$fileTransferMgr = kFileTransferMgr::getInstance($subType, $engineOptions);\r\n\t\t\t\r\n\t\t\tif (!$fileTransferMgr) {\r\n\t\t\t $this->closeJob($job, KalturaBatchJobErrorTypes::APP, KalturaBatchJobAppErrors::ENGINE_NOT_FOUND, \"Error: file transfer manager not found for type [$subType]\", KalturaBatchJobStatus::FAILED);\r\n\t\t\t return $job;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// login to server\r\n\t\t\tif (!$privateKey || !$publicKey) {\r\n\t\t\t $fileTransferMgr->login($host, $username, $password, $port);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t $privateKeyFile = $this->getFileLocationForSshKey($privateKey, 'privateKey');\r\n\t\t\t $publicKeyFile = $this->getFileLocationForSshKey($publicKey, 'publicKey');\r\n\t\t\t $fileTransferMgr->loginPubKey($host, $username, $publicKeyFile, $privateKeyFile, $passPhrase);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// check if file exists\r\n\t\t\t$fileExists = $fileTransferMgr->fileExists($remotePath);\r\n\t\t\tif (!$fileExists) {\r\n\t\t\t $this->closeJob($job, KalturaBatchJobErrorTypes::APP, KalturaBatchJobAppErrors::MISSING_PARAMETERS, \"Error: remote file [$remotePath] does not exist\", KalturaBatchJobStatus::FAILED);\r\n\t\t\t return $job;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// get file size\r\n\t\t\t$fileSize = $fileTransferMgr->fileSize($remotePath);\r\n\t\t\t\r\n // create a temp file path \t\t\t\t\r\n\t\t\t$destFile = $this->getTempFilePath($remotePath);\t\t\t\t\r\n\t\t\t$data->destFileLocalPath = $destFile;\r\n\t\t\t$data->fileSize = is_null($fileSize) ? -1 : $fileSize;\r\n\t\t\tKalturaLog::debug(\"destFile [$destFile]\");\r\n\t\t\t\r\n\t\t\t// download file - overwrite local if exists\r\n\t\t\t$this->updateJob($job, \"Downloading file, size: $fileSize\", KalturaBatchJobStatus::PROCESSING, $data);\r\n\t\t\tKalturaLog::debug(\"Downloading remote file [$remotePath] to local path [$destFile]\");\r\n\t\t\t$res = $fileTransferMgr->getFile($remotePath, $destFile);\r\n\t\t\t\r\n\t\t\tif(!file_exists($data->destFileLocalPath))\r\n\t\t\t{\r\n\t\t\t\t$this->closeJob($job, KalturaBatchJobErrorTypes::APP, KalturaBatchJobAppErrors::OUTPUT_FILE_DOESNT_EXIST, \"Error: output file doesn't exist\", KalturaBatchJobStatus::RETRY);\r\n\t\t\t\treturn $job;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t// check the file size only if its first or second retry\r\n\t\t\t// in case it failed few times, taks the file as is\r\n\t\t\tif($fileSize)\r\n\t\t\t{\r\n\t\t\t\tclearstatcache();\r\n\t\t\t\t$actualFileSize = kFile::fileSize($data->destFileLocalPath);\r\n\t\t\t\tif($actualFileSize < $fileSize)\r\n\t\t\t\t{\r\n\t\t\t\t\t$percent = floor($actualFileSize * 100 / $fileSize);\r\n\t\t\t\t\t$job = $this->updateJob($job, \"Downloaded size: $actualFileSize($percent%)\", KalturaBatchJobStatus::PROCESSING, $data);\r\n\t\t\t\t\t$this->kClient->batch->resetJobExecutionAttempts($job->id, $this->getExclusiveLockKey(), $job->jobType);\r\n\t\t\t\t\treturn $job;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->updateJob($job, 'File imported, copy to shared folder', KalturaBatchJobStatus::PROCESSED);\r\n\t\t\t\r\n\t\t\t$job = $this->moveFile($job, $data->destFileLocalPath, $fileSize);\r\n\t\t}\r\n\t\tcatch(Exception $ex)\r\n\t\t{\r\n\t\t\t$this->closeJob($job, KalturaBatchJobErrorTypes::RUNTIME, $ex->getCode(), \"Error: \" . $ex->getMessage(), KalturaBatchJobStatus::FAILED);\r\n\t\t}\r\n\t\treturn $job;\r\n\t}", "public function doCopy()\n {\n if (!is_dir($this->outFilePath.\"/\".$this->currentTimestamp)) {\n mkdir($this->outFilePath.\"/\".$this->currentTimestamp);\n }\n\n\n\n if (!ssh2_scp_recv($this->sshConnection, \n $this->inFilePath.\"/\".$this->inFileName,\n $this->outFilePath.\"/\".$this->currentTimestamp.\"/\".$this->inFileName)) {\n return null;\n }\n\n copy($this->outFilePath.\"/\".$this->currentTimestamp.\"/\".$this->inFileName,\n $this->outFilePath.\"/\".$this->currentTimestamp.\"/\".$this->inFileName.\".diff\");\n \n //registering copy operation into db...\n $sshEntry = new Application_Model_DbTable_Ssh();\n\n $insertData = array(\n \"host\"=>$this->host,\n \"username\"=>$this->username,\n \"port\"=>$this->port,\n \"origin\"=>$this->inFilePath.\"/\".$this->inFileName,\n \"destination\"=>$this->outFilePath.$this->currentTimestamp.\"/\".$this->inFileName.\".diff\"\n );\n $sshEntry->addRemoteCollectorEntry($insertData);\n\n\n return true;\n\n }", "private function _write_config_file($config)\n\t{\n\t\t$this->load->helper('file');\n\t\t$this->load->helper('string');\n\t\t\n\t\t// Open the template file\n\t\t$template = read_file(ROOTPATH.'setup/sample_data/config.php');\n\t\t\n\t\t$replace = array(\n\t\t\t'__ENCRYPTION__' \t=> random_string('alnum', 16),\n\t\t\t'__URL__'\t\t\t=> $config['url']\n\t\t);\n\t\t\n\t\t// Replace the __ variables with the data specified by the user\n\t\t$new_file \t= str_replace(array_keys($replace), $replace, $template);\n\t\t$config_file = APPPATH.'config/config.php';\n\t\tif ( ! write_file($config_file, $new_file, 'w+'))\n\t\t{\n\t\t\t// This shouldn't happen. But just to be safe.\n\t\t\tshow_error('Unable to write to the config file');\n\t\t}\n\t\t\n\t\t@chmod($config_file, FILE_READ_MODE);\n\t\t\n\t\treturn TRUE;\n\t}", "public function get_site_config() {\n $config_path = $this->site_path().\"/config.json\";\n $raw_config = file_get_contents($config_path); // check for existance first\n $this->_config = json_decode($raw_config, true);\n $this->_dist_config = $this->_config;\n }", "public function setConfigfile();" ]
[ "0.6157233", "0.58599675", "0.5702737", "0.5671138", "0.56674945", "0.5497926", "0.54449445", "0.5440572", "0.54048663", "0.537596", "0.53751963", "0.53668743", "0.5360979", "0.53432584", "0.5334735", "0.5323985", "0.52919114", "0.52451944", "0.5244901", "0.52400446", "0.52100885", "0.52065235", "0.52052087", "0.5189303", "0.5185711", "0.5162941", "0.5162434", "0.51585615", "0.5157412", "0.5139242" ]
0.69685507
0
/ function upload config dari local ke server 1. ambil data ssh server, config file di server, dan nama config di local 2. konek ke server via ssh, selanjutnya download config via scp 3. save config, terus cek lagi deh, kalo ada filenya return true
function cfgUpload($cfgid, $dbconnection){ $sql = $dbconnection->prepare("SELECT configrecord.txtlocalcfg, configrecord.txtdircfg, configrecord.txtnmcfg, configrecord.txtipsvr, configrecord.txtloginsvr, configrecord.txtpswdsvr, configrecord.txtportsvr FROM configrecord WHERE configrecord.txtidcfg = ?"); $sql->bind_param('i', $cfgid); $sql->execute(); $sql->store_result(); $sql->bind_result($cfgfile, $cfgdirsvr, $cfgfilesvr, $svrhost, $svrlogin, $svrpasswd, $svrport); $sql->fetch(); $localfile = $cfgfile; $remotefile = $cfgdirsvr.$cfgfilesvr; $ssh = new SSH2($svrhost, $svrport); $sshconnection = $ssh->login($svrlogin, $svrpasswd); if (!$sshconnection) { return false; } else { $scp = new SCP($ssh); $scp->put($remotefile, $localfile, SCP_LOCAL_FILE); if(cfgLocalExist($cfgid, $dbconnection) == false) { return false; }else{ return true; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function storeConfig() {\n\n\t\t$config[] \t= $this->getLine('dbname', \t\t$this->dbname);\n\t\t$config[] \t= $this->getLine('dbhost', \t\t$this->dbhost);\n\t\t$config[] \t= $this->getLine('dbuser', \t\t$this->dbuser);\n\t\t$config[] \t= $this->getLine('dbpass', \t\t$this->dbpass);\n\t\t$config[] \t= $this->getLine('log', \t\t$this->log);\n\t\t$config[] \t= $this->getLine('attempts', \t$this->attempts);\n\t\t$config[] \t= $this->getLine('delay', \t\t$this->delay);\n\t\t$config[] \t= $this->getLine('alarm', \t\t$this->alarm);\n\n\t\ttry {\n\t\t\tfile_put_contents(SendQueueDefs::CONFIGFILE, $config);\n\t\t\treturn true;\n\t\t}\n\t\tcatch (Exception $exception) {\n\t\t\tthrow new Exception(SendQueueDefs::ERROR_CONFIGFILE);\n\t\t}\n\n\t}", "function putConfigfile($file)\n {\n if (!radius_config($this->res, $file)) {\n return false;\n }\n return true;\n }", "function cfgDownload($cfgid, $dbconnection){\n\t$sql = $dbconnection->prepare(\"SELECT\n\tconfigrecord.txtlocalcfg,\n\tconfigrecord.txtdircfg,\n\tconfigrecord.txtnmcfg,\n\tconfigrecord.txtipsvr,\n\tconfigrecord.txtloginsvr,\n\tconfigrecord.txtpswdsvr,\n\tconfigrecord.txtportsvr\n\tFROM\n\t\tconfigrecord\n\tWHERE\n\t\tconfigrecord.txtidcfg = ?\");\n\t$sql->bind_param('i', $cfgid);\n $sql->execute();\n $sql->store_result();\n $sql->bind_result($cfgfile, $cfgdirsvr, $cfgfilesvr, $svrhost, $svrlogin, $svrpasswd, $svrport);\n $sql->fetch();\n\n $localfile = $cfgfile;\n $remotefile = $cfgdirsvr.$cfgfilesvr;\n\n $ssh = new SSH2($svrhost, $svrport);\n $sshconnection = $ssh->login($svrlogin, $svrpasswd);\n if (!$sshconnection) {\n return false; \n } else {\n \t$scp = new SCP($ssh);\n \t$scp->get($remotefile, $localfile, SCP_LOCAL_FILE);\n\n \tif(cfgLocalExist($cfgid, $dbconnection) == false) {\n \t\treturn false;\n \t}else{\n \t\treturn true;\n \t}\n }\n \n}", "function process_config($config)\n {\n if ($data = data_submitted() and confirm_sesskey()) {\n\n if (admin_write_settings($data)) {\n $statusmsg = get_string('changessaved');\n }\n }\n return true;\n // set to defaults if undefined\n if (!isset($config->hostname)) {\n $config->hostname = 'http://';\n } else {\n // remove trailing slash\n $config->hostname = rtrim($config->hostname, '/');\n }\n if (!isset($config->endpoint)) {\n $config->endpoint = '';\n } else {\n if ((substr($config->endpoint, 0, 1) != '/')) {\n //no preceding slash! Add one!\n $config->endpoint = '/' . $config->endpoint;\n }\n // remove trailing slash\n $config->endpoint = rtrim($config->endpoint, '/');\n }\n if (!isset($config->remote_user)) {\n $config->remote_user = '';\n }\n if (!isset($config->remote_pw)) {\n $config->remote_pw = '';\n }\n if (!isset($config->removeuser)) {\n $config->removeuser = AUTH_REMOVEUSER_KEEP;\n }\n if (!isset($config->cohorts)) {\n $config->cohorts = 0;\n }\n if (!isset($config->cohort_view)) {\n $config->cohort_view = '';\n }\n // Lock the idnumber as this is the drupal uid number\n // NOT WORKING!\n $config->field_lock_idnumber = 'locked';\n // save settings\n set_config('hostname', $config->hostname, 'auth_drupalservices');\n set_config('cookiedomain', $config->cookiedomain, 'auth_drupalservices');\n set_config('endpoint', $config->endpoint, 'auth_drupalservices');\n set_config('remote_user', $config->remote_user, 'auth_drupalservices');\n set_config('remote_pw', $config->remote_pw, 'auth_drupalservices');\n set_config('cohorts', $config->cohorts, 'auth_drupalservices');\n set_config('cohort_view', $config->cohort_view, 'auth_drupalservices');\n set_config('removeuser', $config->removeuser, 'auth_drupalservices');\n set_config('field_lock_idnumber', $config->field_lock_idnumber, 'auth_drupalservices');\n return true;\n }", "function mergeConfig($env)\n{\n $user = $env['user'];\n $pass = $env['pass'];\n $host = $env['host'];\n $ssh = \"ssh -A -tt $user@$host\";\n\n $baseFolder = $env['path'];\n\n $config = [\n 'remote' => 'sftp://' . $host . $baseFolder,\n 'user' => $user,\n 'password' => $pass,\n 'local' => '../',\n 'test' => false,\n 'color' => true,\n 'ignore' => '\n\t\t\t/deployment.*\n\t\t\t/log\n\t\t\ttemp/*\n\t\t\t!temp/.htaccess\n\t\t\t*/tests\n\t\t\t.env\n\t\t\t/vendor/\n\t\t\t/storage/logs/\n\t\t\t/storage/framework/\n\t\t\t/storage/framework/\n\t\t\tREADME.md\n\t\t\t/docs/\n\t\t\t/deploy/\n\t\t',\n 'allowDelete' => true,\n 'after' => [\n function (Deployment\\Server $server, Deployment\\Logger $logger, Deployment\\Deployer $deployer) use ($baseFolder, $ssh) {\n $logger->log('>> After');\n\n // Composer\n $logger->log(' Running composer install...');\n $command = \"$ssh 'cd {$baseFolder} && php composer.phar install'\";\n echo shell_exec($command);\n $logger->log(' ');\n\n // Migration\n $logger->log(' Running artisan migrate and dumping autoload...');\n $command = \"$ssh 'cd {$baseFolder} && php artisan migrate && php composer.phar dump-autoload'\";\n echo shell_exec($command);\n $logger->log(' ');\n }\n ]\n ];\n\n return $config;\n}", "private function save()\n {\n $string = \"<?php \\n return array (\";\n $string .= $this->reformatArray($this->config, \"\\t\");\n $string .= \"\\n);\";\n if (file_put_contents(BASE_DIR . \"admin/config/config.php\", $string) > 0)\n return true;\n return false;\n }", "public function copyConfigFiles()\n {\n $cfg = Storage::disk('projects')->get($this->project->path . '/cfg/yolo.cfg');\n $data = Storage::disk('projects')->get($this->project->path . '/data/obj.data');\n $names = Storage::disk('projects')->get($this->project->path . '/data/obj.names');\n\n Storage::put($this->jobPath . '/cfg/yolo.cfg', $cfg);\n Storage::put($this->jobPath . '/data/obj.data', $data);\n Storage::put($this->jobPath . '/data/obj.names', $names);\n }", "function _checkConfig(){\n $this->bConfigExists = file_exists(DIR_PLUGINS.\"{$this->sName}/config.php\");\n if(!$this->bConfigExists){\n $this->bConfigWritable = false;\n }else if(is_writable(DIR_PLUGINS.\"{$this->sName}/config.php\")){\n $this->bConfigWritable = true;\n }else{\n @chmod(DIR_PLUGINS.\"{$this->sName}/config.php\",0644);\n if(is_writable(DIR_PLUGINS.\"{$this->sName}/config.php\")){\n $this->bConfigWritable = true;\n }else{\n $this->bConfigWritable = false;\n }\n }\n }", "private function createConfig()\n\t{\n\t\t$configFilename = __DIR__ . '/app/config/config.local.neon';\n\n\t\tcopy(__DIR__ . '/app/config/config.local.example.neon', $configFilename);\n\n\t\t$lines = file($configFilename);\n\n\t\tforeach ($lines as $key => $line)\n\t\t{\n\t\t\tforeach (array('username', 'password', 'database') as $subject)\n\t\t\t{\n\t\t\t\tif (strpos($line, \"\\t\" . $subject))\n\t\t\t\t{\n\t\t\t\t\t$lines[$key] = $this->deleteNewline($line, \"\\n\") . ' ' . $this->config['db'][$subject] . \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (file_put_contents($configFilename, $lines))\n\t\t{\n\t\t\t$this->success('Local config file created ...');\n\t\t}\n\t}", "function config_install($conffile) {\n\tglobal $g,$config;\n\n\tif(!file_exists($conffile)):\n\t\treturn 1;\n\tendif;\n\tconfig_lock();\n\tconf_mount_rw();\n\t$result = copy($conffile,\"{$g['conf_path']}/config.xml\");\n\tconf_mount_ro();\n\tconfig_unlock();\n\tif(true === $result):\n\t\twrite_loader_config();\n\t\treturn 0;\n\tendif;\n\treturn 1;\n}", "public function upload(){\r\n\t\t$config = $this->ftpConf[$this->location];\r\n\r\n\t\t// If we don't need to FTP, quit.\r\n\t\tif(empty($config) || empty($config['hostname'])){\r\n\t\t\t$this->out(\"We don't have FTP details for location '{$this->location}', so I'm quitting.\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif(!function_exists('ftp_connect')){\r\n\t\t\t$this->out(\"ERROR: The ftp_connect() function is not installed on location '{$this->location}', so I'm quitting.\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$ftp = ftp_connect($config['hostname']);\r\n\t\tftp_login($ftp, $config['username'], $config['password']);\r\n\r\n\t\t$ftp_path = $config['directory'] . $this->merchantId . '_nmerchandis' . date('Ymd') . '.txt';\r\n\t\t$local_file = $this->filePath;\r\n\r\n\t\t$upload = ftp_put($ftp, $ftp_path, $local_file, FTP_ASCII);\r\n\r\n\t\tftp_close($ftp);\r\n\r\n\t\t$this->out('Uploaded products file via FTP.');\r\n\t}", "function ftpput($localfile=NULL, $remotefile=NULL) {\n\t\t\tif($localfile != NULL && $remotefile != NULL && ftp_put(fra_ftp, fra_var[\"ftp_path\"].\"\".$remotefile, fra_var[\"files_path\"].\"\".$localfile, FTP_BINARY)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "protected function _uploadFile(){\r\n\t\t$ftp_server\t\t=\t$this->_checkField($this->_merchantWebsites[$this->_currentMerchantId]['ftp']['server'], 'ftp_server');\r\n\t\t$ftp_user_name\t=\t$this->_checkField($this->_merchantWebsites[$this->_currentMerchantId]['ftp']['username'],\t'ftp_username');\r\n\t\t$ftp_user_pass\t=\t$this->_checkField($this->_merchantWebsites[$this->_currentMerchantId]['ftp']['password'],\t'ftp_password');\r\n\t\t\r\n\t\tif($this->hasFatalError()){\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\t\r\n\t\t$connection = ssh2_connect($ftp_server, 22) or die('could not connect');\r\n\t\tssh2_auth_password($connection, $ftp_user_name, $ftp_user_pass);\r\n\t\t$sftp\t\t=\tssh2_sftp($connection);\r\n\t\t$stream \t=\t@fopen(\"ssh2.sftp://$sftp\".$this->getRemoteFilePath(), 'w');\r\n\t\t\r\n\t\tif (!$stream){\r\n\t\t\t$this->logFatalError(\"Could not open file: \".$this->getRemoteFilePath());\r\n\t\t\t@fclose($stream);\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\t$dataToSend\t=\t@file_get_contents($this->getCsvFilePath());\r\n\t\tif ($dataToSend === false){\r\n\t\t\t$this->logFatalError(\"Could not open local file: \".$this->getCsvFilePath());\r\n\t\t\t@fclose($stream);\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\r\n\t\tif (@fwrite($stream, $dataToSend) === false){\r\n\t\t\t$this->logFatalError(\"Could not send data from file: \".$this->getCsvFilePath());\r\n\t\t\t@fclose($stream);\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\t\r\n\t\t@fclose($stream);\r\n\t\t\r\n\t\t$stream \t=\t@fopen(\"ssh2.sftp://$sftp\".$this->getRemoteFilePath(), 'r');\r\n\t\tif(!$stream){\r\n\t\t\t$this->logFatalError(\"Unable to upload file to remote server: \".$this->getRemoteFilePath());\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\treturn TRUE;\r\n\t}", "function process_config($config) {\n if (!isset ($config->db)) {\n $config->db = '';\n }\n if (!isset ($config->url)) {\n $config->url = '';\n }\n if (!isset ($config->password)) {\n $config->password = '';\n }\n if (!isset ($config->user)) {\n $config->password = '';\n }\n\n // save settings \n set_config('db', $config->db, 'auth/odoo');\n set_config('url', $config->url, 'auth/odoo');\n set_config('password', $config->password, 'auth/odoo');\n set_config('user', $config->user, 'auth/odoo');\n\n return true;\n }", "public function setConfigfile();", "function SavePageSlidesConfig() {\n global $langmessage, $dataDir;\n\n $s = trim($_POST['path']);\n if ($s == '') {\n $s = '/';\n }\n if ($s[0] != '/') {\n $s = '/' . $s;\n }\n if ($s[strlen($s) - 1] == '/') {\n $s = substr($s, 0, -1);\n }\n\n //check the directory\n $data_real = realpath($dataDir);\n $dir = realpath($dataDir . '/data/_uploaded/' . trim($s, '/\\\\'));\n\n if (!is_dir($dir)) {\n msg('Image directory is not a folder');\n return false;\n }\n\n if (strpos($dir, $data_real) !== 0) {\n msg('Invalid image directory');\n return false;\n }\n\n\n $this->config['path'] = array($s);\n if (gpFiles::SaveArray($this->config_file, 'config', $this->config)) {\n msg($langmessage['SAVED']);\n }\n }", "function com_ftp_push($ops)\n{\n $temp = tmpfile();\n fwrite($temp, $ops['datos']);\n fseek($temp, 0);\n \n // set up basic connection\n $conn_id = ftp_connect($ops['servidor']['host']);\n \n // login with username and password\n $login_result = ftp_login($conn_id, $ops['servidor']['usuario'], $ops['servidor']['clave']);\n \n // upload a file\n if ( ! ftp_fput($conn_id, $ops['destino'], $temp, FTP_ASCII)) {\n \n guardar_error(\"Problema al cargar al host\".$ops['servidor']['host'],'FTP','critico');\n }\n \n // close the connection\n ftp_close($conn_id);\n fclose($temp);\n}", "private function _write_config_file($config)\n\t{\n\t\t$this->load->helper('file');\n\t\t$this->load->helper('string');\n\t\t\n\t\t// Open the template file\n\t\t$template = read_file(ROOTPATH.'setup/sample_data/config.php');\n\t\t\n\t\t$replace = array(\n\t\t\t'__ENCRYPTION__' \t=> random_string('alnum', 16),\n\t\t\t'__URL__'\t\t\t=> $config['url']\n\t\t);\n\t\t\n\t\t// Replace the __ variables with the data specified by the user\n\t\t$new_file \t= str_replace(array_keys($replace), $replace, $template);\n\t\t$config_file = APPPATH.'config/config.php';\n\t\tif ( ! write_file($config_file, $new_file, 'w+'))\n\t\t{\n\t\t\t// This shouldn't happen. But just to be safe.\n\t\t\tshow_error('Unable to write to the config file');\n\t\t}\n\t\t\n\t\t@chmod($config_file, FILE_READ_MODE);\n\t\t\n\t\treturn TRUE;\n\t}", "public function sync()\n {\n // Check writable\n if(!is_writable($this->configCachePath))\n {\n return false;\n }\n \n // Rewrite config file\n // Truncate to 0b first\n $handle = fopen($this->configCachePath, 'w');\n \n // Is the file handle OK?\n if(!$handle)\n {\n return false;\n }\n \n // Read all config data\n $this->db->select('*', 'bf_config')\n ->order('name', 'asc')\n ->execute();\n \n // Write intro\n fwrite($handle, '; b2bFront configuration cache file' . \"\\n\");\n fwrite($handle, '; Last configuration cache commit: ' . Tools::longDate() . \"\\n\\n\");\n \n // Begin write\n while($configItem = $this->db->next())\n {\n fwrite($handle, $configItem->name . ' = \"' . $configItem->value . '\"' . \"\\n\");\n }\n \n // Done, close the file\n fclose($handle);\n \n // Now load the values back into memory\n $this->load();\n \n return true;\n }", "private function upload($node = NULL, $user = NULL, $file = NULL, $remote_path = NULL, $chmod = 755){\n if(!$node || !$user || !$file || !$remote_path){\n return(NULL);\n }\n \n $local_md5 = trim(rtrim(`md5sum $file`));\n\n $remote_md5 = trim(rtrim($this->ssh(\"md5sum $file\", 'postgres')));\n\n if($local_md5 != $remote_md5){\n `scp $file $user@{$this->get_node_host($node)}:$remote_path`;\n }\n\n $remote_md5 = trim(rtrim($this->ssh(\"md5sum $file\", 'postgres')));\n \n $this->ssh(\"chmod $chmod $remote_path\", 'postgres');\n\n return($local_md5 == $remote_md5);\n }", "public function savefeconfigAction()\n {\n $arguments = $this->getRequest()->getPost();\n $all_ok = true;\n $pool = \\Krexx::$pool;\n $filepath = $pool->krexxDir . 'config/Krexx.ini';\n\n // Whitelist of the vales we are accepting.\n $allowed_values = array('full', 'display', 'none');\n\n // Get the old values . . .\n $old_values = parse_ini_file($filepath, true);\n // . . . and remove our part.\n unset($old_values['feEditing']);\n\n // We need to correct the allowed settings, since we do not allow anything.\n unset($this->allowedSettingsNames['destination']);\n unset($this->allowedSettingsNames['maxfiles']);\n unset($this->allowedSettingsNames['debugMethods']);\n\n // Iterating through the form.\n foreach ($arguments as $key => $data) {\n if (is_array($data)) {\n foreach ($data as $setting_name => $value) {\n if (in_array($value, $allowed_values) && in_array($setting_name, $this->allowedSettingsNames)) {\n // Whitelisted values are ok.\n $old_values['feEditing'][$setting_name] = $value;\n } else {\n // Validation failed!\n $all_ok = false;\n $pool->messages->addMessage(htmlentities($value) . ' is not an allowed value!');\n }\n }\n }\n }\n\n // Now we must create the ini file.\n $ini = '';\n foreach ($old_values as $key => $setting) {\n $ini .= '[' . $key . ']' . PHP_EOL;\n foreach ($setting as $setting_name => $value) {\n $ini .= $setting_name . ' = \"' . $value . '\"' . PHP_EOL;\n }\n }\n\n // Now we should write the file!\n if ($all_ok) {\n $file = new Varien_Io_File();\n if ($file->write($filepath, $ini) === false) {\n $all_ok = false;\n $pool->messages->addMessage('Configuration file ' . $filepath . ' is not writeable!');\n }\n }\n\n // Something went wrong, we need to tell the user.\n if (!$all_ok) {\n Mage::getSingleton('core/session')->addError(\n strip_tags($pool->messages->outputMessages()),\n \"The settings were NOT saved.\"\n );\n } else {\n Mage::getSingleton('core/session')->addSuccess(\n \"The settings were saved to: <br /> \" . $filepath,\n \"The data was saved.\"\n );\n }\n\n $this->_redirect('*/*/feconfig');\n }", "public function saveconfigAction()\n {\n $arguments = $this->getRequest()->getPost();\n $all_ok = true;\n $pool = \\Krexx::$pool;\n\n $filepath = $pool->krexxDir . 'config/Krexx.ini';\n // We must preserve the section 'feEditing'.\n // Everything else will be overwritten.\n $old_values = parse_ini_file($filepath, true);\n $old_values = array('feEditing' => $old_values['feEditing']);\n\n // Iterating through the form.\n foreach ($arguments as $section => $data) {\n if (is_array($data) && in_array($section, $this->allowedSections)) {\n // We've got a section key.\n foreach ($data as $setting_name => $value) {\n if (in_array($setting_name, $this->allowedSettingsNames)) {\n // We escape the value, just in case, since we can not whitelist it.\n $value = htmlspecialchars(preg_replace('/\\s+/', '', $value));\n // Evaluate the setting!\n if ($pool->config->security->evaluateSetting($section, $setting_name, $value)) {\n $old_values[$section][$setting_name] = $value;\n } else {\n // Validation failed! kreXX will generate a message, which we will\n // display at the buttom.\n $all_ok = false;\n }\n }\n }\n }\n }\n\n // Now we must create the ini file.\n $ini = '';\n foreach ($old_values as $key => $setting) {\n $ini .= '[' . $key . ']' . PHP_EOL;\n foreach ($setting as $setting_name => $value) {\n $ini .= $setting_name . ' = \"' . $value . '\"' . PHP_EOL;\n }\n }\n\n // Now we should write the file!\n if ($all_ok) {\n $file = new Varien_Io_File();\n if ($file->write($filepath, $ini) === false) {\n $all_ok = false;\n $pool->messages->addMessage('Configuration file ' . $filepath . ' is not writeable!');\n }\n }\n\n // Something went wrong, we need to tell the user.\n if (!$all_ok) {\n Mage::getSingleton('core/session')->addError(\n strip_tags($pool->messages->outputMessages()),\n \"The settings were NOT saved.\"\n );\n } else {\n Mage::getSingleton('core/session')->addSuccess(\n \"The settings were saved to: <br /> \" . $filepath,\n \"The data was saved.\"\n );\n }\n\n $this->_redirect('*/*/config');\n\n }", "private static function _updateConfigFiles($vars) {\n\n $values = self::_buildParams($GLOBALS['_SERVER']);\n\n $path = $vars['argv'][0];\n\n $paths = array(\n 'tempPath' => str_replace('/scripts/configure', '/htdocs/setup/', $path),\n 'installationPath' => strip_tags($vars['WEB__contenido_DIR']) . '/'\n );\n\n // old http_path\n $fePath = file_get_contents($paths['installationPath'] . 'http_path.txt');\n\n // update config.php\n self::_updateConfig($fePath, $paths, $values, $vars);\n\n // update config.clients.php\n self::_updateClientConfig($fePath, $paths, $values);\n\n // update http_path.txt this file is used to identify the last value => needed for replacing\n // in config files\n self::_updateHttpPath($paths, $values);\n\n // update admin data => run cronjob\n self::_runAdminUpdateJob($vars, $values);\n }", "public function saveRemoteConfig()\n {\n $path = $this->getConfigPath();\n\n \t$result = Mage::getModel('tiramizoo/api', array('api_token' => $this->_apiToken))\n \t->getRemoteConfiguration();\n\n if ($result['http_status'] != 200) {\n throw new Exception(\"Can't connect to Tiramizoo API\", 1);\n }\n\n if (isset($result['response'])) {\n Mage::getModel('core/config')->saveConfig($path, json_encode($result['response']));\n $this->_config = json_encode($result['response']);\n }\n\n return $this;\n }", "function ssh_copy_from($remotepath, $localpath, &$out)\n {\n \tglobal $debug_sexec;\n\n \tif ($debug_sexec) echo \"SExec::ssh_copy_from($remotepath, $localpath)\\n\";\n\n/*\tThis would be great if SCP could hijack the shared connection (sic)\n\tumask(0077);\n\t$tmpfname = tempnam($this->workdir, \"copy-from-\");\n\tchmod($tmpfname, 0700);\n\tputenv(\"DISPLAY=none:0.\");\n\tputenv(\"SSH_ASKPASS=$tmpfname\");\n\t$fp = fopen($tmpfname, \"w\");\n\tfputs($fp, \"#!/bin/sh\\necho $this->password\\n\");\n\tif (! $debug_sexec) \n\t fputs($fp, \"/bin/touch $tmpfname.called\\n\");\n\telse\n\t fputs($fp, \"/bin/rm $tmpfname\\n\");\n\tfclose($fp);\n\tif ($debug_sexec) echo \"$this->scp -pqrC $this->remote:$remotepath $localpath\\n\";\n\t$out = \"\";\n\texec(\"$this->scp -pqrC $this->remote:$remotepath $localpath\", $out, $status);\n\tif ($status == 0)\n\t return TRUE;\n\telse {\n\t if ($debug_sexec) echo $out . \"\\n\";\n\t return FALSE;\n\t}\n*/ \t\n \tif ((file_exists(\"$localpath/.\")) && (is_dir(\"$localpath/.\"))) {\n\t // Local is a directory. Copy remote into it.\n\t if ($debug_sexec) echo \"--> $localpath/. is a dir\\n\";\n \t if ($debug_sexec) echo \"--> Executing\\n\" .\n\t \"$this->ssh -x -T -C -S $this->mplex_socket $this->remote \" .\n\t \t \"\\\"/bin/tar -C \" .dirname($remotepath). \n\t \t\t\" -cf - \". basename($remotepath) .\"\\\" | \".\n\t \t\t\"/bin/tar -C $localpath -xf -\\n\";\n \t exec(\"($this->ssh -x -T -C -S $this->mplex_socket $this->remote \" .\n\t \t \"\\\"/usr/local/bin/tar -C \" .dirname($remotepath). \n\t \t\t\" -cf - \". basename($remotepath) .\"\\\" | \".\n\t \t\t\"/bin/tar -C $localpath -xf -) 2>&1\",\n\t\t $out, $res);\n \t}\n\telse {\n\t // either the local side does not exist or is not a directory\n\t // if remote is a directory\n\t //\t make local equivalent and copy contents (make will\n\t //\t fail if local exists as a non-dir)\n\t if ($debug_sexec) echo \"--> $localpath is NOT a dir\\n\";\n\t $res = $this->ssh_exec(\"test -d $remotepath 2>&1\", $out);\n\t if ($res == 0) {\n\t \texec(\"/bin/mkdir -p $localpath 2>&1\", $out, $res);\n\t\tif ($res != 0) {\n\t\t // can't create the dir, either it is a regular file\n\t\t // or we don't have privileges\n\t\t if ($debug_sexec) print_r($out);\n\t\t return FALSE;\n\t\t}\n\t\t// copy in the remote contents\n\t\tif ($debug_sexec) echo \"-->Executing\\n\" .\n\t\t \"($this->ssh -x -T -C -S $this->mplex_socket $this->remote \" .\n\t\t \"\\\"/bin/tar -C $remotepath -cf - .\\\" | \" .\n\t\t \"/bin/tar -C $localpath -xf -)2>&1\\n\";\n\t\texec(\"($this->ssh -x -T -C -S $this->mplex_socket $this->remote \" .\n\t\t \"\\\"/bin/tar -C $remotepath -cf - .\\\" | \" .\n\t\t \"/bin/tar -C $localpath -xf -)2>&1\",\n\t\t $out, $res);\n\t\t\n\t } else {\n\t \t// remote is a non-dir: cat over local\n\t\tif ($debug_sexec) echo \"-->Executing\\n\" .\n\t\t \"($this->ssh -x -T -C -S $this->mplex_socket $this->remote \" .\n\t\t \"\\\"cat $remotepath\\\" | \".\n\t\t \" cat > $localpath) 2>&1\\n\";\n\t \texec(\"($this->ssh -x -T -C -S $this->mplex_socket $this->remote \" .\n\t\t \"\\\"cat $remotepath\\\" | \".\n\t\t \" cat > $localpath) 2>&1\", $out, $res);\n \t }\n \t}\n\tif ($res == 0) \n\t return TRUE;\n\telse {\n\t if ($debug_sexec) print_r($out);\n\t return FALSE;\n\t}\n }", "private function updateConfiguration()\r\n {\r\n $yaml = $this->loader->dump($this->config,2);\r\n file_put_contents(__DIR__.self::CONFIG_PATH.'.bkp', $yaml);\r\n \r\n //Update new config\r\n $newConfig = array_replace_recursive($this->config,$this->skConfig);\r\n $yaml = $this->loader->dump($newConfig,3);\r\n file_put_contents(__DIR__.self::CONFIG_PATH, $yaml);\r\n \r\n //Backing up old routing\r\n $this->routing = $this->loader->parse(__DIR__.self::ROUTING_PATH);\r\n $yaml = $this->loader->dump($this->routing,2);\r\n file_put_contents(__DIR__.self::ROUTING_PATH.'.bkp', $yaml);\r\n \r\n //Update new config\r\n $newRouting = array_replace_recursive($this->routing,$this->skRouting);\r\n $yaml = $this->loader->dump($newRouting,3);\r\n file_put_contents(__DIR__.self::ROUTING_PATH, $yaml);\r\n }", "public function transferDataToStorage($storageHost, $backupDestDirectory, $srcHostBackupDirectory) {\n \n //print_r($storageHost);\n $storageHostIp = $storageHost->hostSpec->getIp();\n $storageFtpUser = $storageHost->storageCredential->getUser();\n $storageFtpPassword = $storageHost->storageCredential->getPassword();\n\n //$backupDestDirectory = $storageHost->hostSpec->getBackup_dst_dir();\n $cmdsListFileName = \"FtpUploadCmds.list\";\n $this->backupDataRef->ftpTransferCmdsListFileName = $cmdsListFileName;\n $appName = $this->backupDataRef->backupAppName;\n $dateTime = $this->date->getCurrentTime();\n \n $backupDestSubDir = \"$appName-$dateTime\";\n //echo \"\\n--------------$appName , $dateTime , $backupDestSubDir\\n\";\n $summryFileName = $this->backupDataRef->summryFileName;\n\n if ($this->enableMirror == false) {\n // common\n //$zipFileName = $this->backupDataRef->transferFileName;\n $tarFileName = $this->backupDataRef->dataFileName;\n $this->cmds['createFtpCmdsFile'] = \"echo 'user $storageFtpUser $storageFtpPassword\\nbinary\\ncd $backupDestDirectory\\nmkdir $backupDestSubDir\\ncd $backupDestSubDir\\nprompt\\nmput $tarFileName $summryFileName\\n' > $cmdsListFileName\";\n $this->cmds['transferData'] = \"ftp -nv $storageHostIp < $cmdsListFileName\";\n \n try {\n echo \"\\n\\nDoing: Create Ftp protocol cmds File...\\n\";\n $this->ssh2_host->exec($this->cmds['createFtpCmdsFile']);\n echo \"fileName: \" . $cmdsListFileName . \"\\n\";\n echo Utils::green(\"OK!\\n\");\n echo \"\\n\\nDoing: upload begin...\\n\";\n $this->ssh2_host->exec($this->cmds['transferData']);\n echo Utils::green(\"OK!\\n\");\n return true;\n } catch(Exception $e) {\n echo $e->getMessage();\n return false;\n }\n } else {\n // mirror\n $backupDir = \"$appName-$dateTime\";\n $summryFileName = $this->backupDataRef->summryFileName;\n $this->cmds['createFtpCmdsFile'] = \"echo 'lftp $storageHostIp\\nuser $storageFtpUser $storageFtpPassword\\ncd $backupDestDirectory\\nmkdir $backupDir\\ncd $backupDir\\nput $summryFileName\\nmirror -R $srcHostBackupDirectory\\nexit' > $cmdsListFileName\";\n $this->cmds['transferData'] = \"lftp -f $cmdsListFileName\";\n try{\n echo \"\\nDoing: create ftp cmds list file...\\n\";\n $this->ssh2_host->exec($this->cmds['createFtpCmdsFile']);\n echo Utils::green(\"OK!\\n\");\n echo \"\\nUpload backup datas...\\n\";\n $this->ssh2_host->exec($this->cmds['transferData']);\n echo Utils::green(\"OK!\\n\");\n return true;\n } catch(Exception $e) {\n echo $e->getMessage();\n return false;\n }\n }\n }", "function write_config () {\n\t\t$config = file( $this->config_path );\n\t\tforeach ( $this->entries as $entry )\n\t\t\t$config = $entry->change_config( $config );\n\t\t$file = fopen( $this->config_path, \"wb\" );\n\t\t$written = fwrite( $file, implode( \"\", $config ) );\n\t\tfclose( $file );\n\t\tif ( $written == 0 ) return FALSE;\n\t\tforeach ( $this->entries as $entry )\n\t\t\t$entry->parse_config( $config );\n\t\treturn TRUE;\n\t}", "public function save() {\n\t\tif (is_file($this->conffile) == True) {\n\t\t\t$file = fopen($this->conffile, \"r\");\n\t\t\t$file_array = array();\n\t\t\t// read config file\n\t\t\twhile (!feof($file)) {\n\t\t\t\tarray_push($file_array, fgets($file, 1024));\n\t\t\t}\n\t\t\tfclose($file);\n\t\t\t// generate new configuration file\n\t\t\t$saved = array();\n\t\t\tfor ($i = 0; $i < sizeof($file_array); $i++) {\n\t\t\t\t$line = trim($file_array[$i]);\n\t\t\t\tif (($line == \"\")||($line[0] == \"#\")) continue; // ignore comments and empty lines\n\t\t\t\t// search keywords\n\t\t\t\tfor ($k = 0; $k < sizeof($this->settings); $k++) {\n\t\t\t\t\t$keyword = $this->settings[$k];\n\t\t\t\t\t$keylen = strlen($keyword);\n\t\t\t\t\tif (strtolower(substr($line, 0, $keylen + 1)) == strtolower($keyword . \":\")) {\n\t\t\t\t\t\t$file_array[$i] = $keyword . \": \" . $this->$keyword . \"\\n\";\n\t\t\t\t\t\t$saved[] = $keyword;\t// mark keyword as saved\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\t// check if we have to add new entries (e.g. if user upgraded LAM and has an old config file)\n\t\tif (!in_array(\"password\", $saved)) array_push($file_array, \"\\n\\n# password to add/delete/rename configuration profiles\\n\" . \"password: \" . $this->password);\n\t\tif (!in_array(\"default\", $saved)) array_push($file_array, \"\\n\\n# default profile, without \\\".conf\\\"\\n\" . \"default: \" . $this->default);\n\t\tif (!in_array(\"sessionTimeout\", $saved)) array_push($file_array, \"\\n\\n# session timeout in minutes\\n\" . \"sessionTimeout: \" . $this->sessionTimeout);\n\t\tif (!in_array(\"logLevel\", $saved)) array_push($file_array, \"\\n\\n# log level\\n\" . \"logLevel: \" . $this->logLevel);\n\t\tif (!in_array(\"logDestination\", $saved)) array_push($file_array, \"\\n\\n# log destination\\n\" . \"logDestination: \" . $this->logDestination);\n\t\tif (!in_array(\"allowedHosts\", $saved)) array_push($file_array, \"\\n\\n# list of hosts which may access LAM\\n\" . \"allowedHosts: \" . $this->allowedHosts);\n\t\tif (!in_array(\"passwordMinLength\", $saved)) array_push($file_array, \"\\n\\n# Password: minimum password length\\n\" . \"passwordMinLength: \" . $this->passwordMinLength);\n\t\tif (!in_array(\"passwordMinUpper\", $saved)) array_push($file_array, \"\\n\\n# Password: minimum uppercase characters\\n\" . \"passwordMinUpper: \" . $this->passwordMinUpper);\n\t\tif (!in_array(\"passwordMinLower\", $saved)) array_push($file_array, \"\\n\\n# Password: minimum lowercase characters\\n\" . \"passwordMinLower: \" . $this->passwordMinLower);\n\t\tif (!in_array(\"passwordMinNumeric\", $saved)) array_push($file_array, \"\\n\\n# Password: minimum numeric characters\\n\" . \"passwordMinNumeric: \" . $this->passwordMinNumeric);\n\t\tif (!in_array(\"passwordMinSymbol\", $saved)) array_push($file_array, \"\\n\\n# Password: minimum symbolic characters\\n\" . \"passwordMinSymbol: \" . $this->passwordMinSymbol);\n\t\tif (!in_array(\"passwordMinClasses\", $saved)) array_push($file_array, \"\\n\\n# Password: minimum character classes (0-4)\\n\" . \"passwordMinClasses: \" . $this->passwordMinClasses);\n\t\t$file = @fopen($this->conffile, \"w\");\n\t\tif ($file) {\n\t\t\tfor ($i = 0; $i < sizeof($file_array); $i++) fputs($file, $file_array[$i]);\n\t\t\tfclose($file);\n\t\t}\n\t\telse {\n\t\t\tStatusMessage(\"ERROR\", \"\", _(\"Cannot open config file!\") . \" (\" . $this->conffile . \")\");\n\t\t}\n\t}", "function write_config($data) {\n\n\t\t// Config path\n\t\t$template_path \t= 'config/database.php';\n\t\t$output_path \t= '../application/config/database.php';\n\n\t\t// Open the file\n\t\t$database_file = file_get_contents($template_path);\n\n\t\t$new = str_replace(\"%HOSTNAME%\",$data['hostname'],$database_file);\n\t\t$new = str_replace(\"%USERNAME%\",$data['username'],$new);\n\t\t$new = str_replace(\"%PASSWORD%\",$data['password'],$new);\n\t\t$new = str_replace(\"%DATABASE%\",$data['database'],$new);\n\n\t\t// Write the new database.php file\n\t\t$handle = fopen($output_path,'w+');\n\n\t\t// Chmod the file, in case the user forgot\n\t\t@chmod($output_path,0777);\n\n\t\t// Verify file permissions\n\t\tif(is_writable($output_path)) {\n\n\t\t\t// Write the file\n\t\t\tif(fwrite($handle,$new)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}" ]
[ "0.6125533", "0.590833", "0.5887849", "0.5863555", "0.585147", "0.58171034", "0.5797538", "0.57559586", "0.5747527", "0.5740056", "0.5732193", "0.57038313", "0.5668514", "0.5657313", "0.5656009", "0.5632943", "0.5621241", "0.5598532", "0.55945784", "0.557626", "0.5538845", "0.54745394", "0.5471308", "0.54620606", "0.54585594", "0.5447972", "0.5437617", "0.53745025", "0.5370389", "0.5356706" ]
0.7385675
0
/ function display file config yng ada di local 1. ambil nama file di database 2. return nama filenya
function cfgDisplay($cfgid, $dbconnection){ $sql = $dbconnection->prepare("SELECT configrecord.txtlocalcfg FROM configrecord WHERE configrecord.txtidcfg = ?"); $sql->bind_param('i', $cfgid); $sql->execute(); $sql->store_result(); $sql->bind_result($cfgfile); $sql->fetch(); return $cfgfile; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getConfigFile();", "function Admin_Config_Display($form=false)\n\t\t{\n\t\t$config=Config::Get_Instance();\n\t\t$result=$config->Get_Config(true);\n\t\t$yes_no_radio=array('show_error','full_error_info','log','advertisment');\n\t\t$db_type_radio=array('dbtype');\n\t\t$dir_radio=array('lang','template');\n\t\t$non_required_text=array('subdir','dbpath');\n\t\tforeach($result as $tab=>$group)\n\t\t\t{\n\t\t\tforeach($group as $param=>$value)\n\t\t\t\t{\n\t\t\t\tif(isset($form[$param]))\n\t\t\t\t\t{\n\t\t\t\t\t$value=$form[$param];\n\t\t\t\t\t}\n\t\t\t\tif(in_array($param,$yes_no_radio))\n\t\t\t\t\t{\n\t\t\t\t\t$options=array(array(\"sign\"=>YES,\"value\"=>\"1\"),array(\"sign\"=>NO,\"value\"=>\"0\"));\n\t\t\t\t\t$result[$tab][$param]=$this->Config_Input_Construct('radio',$param,$value,$options);\n\t\t\t\t\t}\n\t\t\t\telseif(in_array($param,$db_type_radio))\n\t\t\t\t\t{\n\t\t\t\t\t$options=array(array(\"sign\"=>\"mysql\",\"value\"=>\"mysql\"),array(\"sign\"=>\"sqlite\",\"value\"=>\"sqlite\"));\n\t\t\t\t\t$result[$tab][$param]=$this->Config_Input_Construct('radio',$param,$value,$options);\n\t\t\t\t\t}\n\t\t\t\telseif(in_array($param,$dir_radio))\n\t\t\t\t\t{\n\t\t\t\t\tif($handle=opendir(ROOT_DIR.DS.$param))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t$options=array();\n\t\t\t\t\t\twhile(false !== ($entry = readdir($handle)))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($entry != \".\" && $entry != \"..\")\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(is_dir(ROOT_DIR.DS.$param.DS.$entry))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$options[]=array(\"sign\"=>$entry,\"value\"=>$entry);\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}\n\t\t\t\t\t\tclosedir($handle);\n\t\t\t\t\t\t}\n\t\t\t\t\t$result[$tab][$param]=$this->Config_Input_Construct('radio',$param,$value,$options);\n\t\t\t\t\t}\n\t\t\t\telseif(in_array($param,$non_required_text))\n\t\t\t\t\t{\n\t\t\t\t\t$result[$tab][$param]=$this->Config_Input_Construct('text',$param,$value);\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t$result[$tab][$param]=$this->Config_Input_Construct('text',$param,$value,1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tif($form)\n\t\t\t{\n\t\t\t$result['error']=$this->Admin_Config_Save($form);\n\t\t\t}\n\t\treturn $result;\t\n\t\t}", "protected function showConfig()\n {\n // Get config\n $config = $this->ci->config;\n\n // Display database info\n $this->io->section(\"Database config\");\n $this->io->writeln([\n \"DRIVER : \" . $config['db.default.driver'],\n \"HOST : \" . $config['db.default.host'],\n \"PORT : \" . $config['db.default.port'],\n \"DATABASE : \" . $config['db.default.database'],\n \"USERNAME : \" . $config['db.default.username'],\n \"PASSWORD : \" . ($config['db.default.password'] ? \"*********\" : \"\")\n ]);\n }", "function showconfig($option){\n\t$database = database::getInstance();\n\n\t$row = new JConfig();\n\t$row->bindGlobals();\n\n\t// compile list of the languages\n\t$langs = array();\n\t$lists = array();\n\n\t// PRE-PROCESS SOME LISTS\n\n\t// -- Языки --\n\tif($handle = opendir(_LPATH_ROOT . '/language/')){\n\t\twhile(false !== ($file = readdir($handle))){\n\t\t\tif(!strcasecmp(substr($file, -4), \".xml\") && $file != \".\" && $file != \"..\"){\n\t\t\t\t$langs[] = LHtml::makeOption(substr($file, 0, -4));\n\t\t\t}\n\t\t}\n\t}\n\n\t// сортировка списка языков\n\tsort($langs);\n\treset($langs);\n\n\t// -- Редакторы --\n\t$query = \"SELECT element AS value, name AS text\"\n\t\t. \"\\n FROM #__plugins\"\n\t\t. \"\\n WHERE folder = 'editors'\"\n\t\t. \"\\n AND published = 1\"\n\t\t. \"\\n ORDER BY ordering, name\";\n\t$database->setQuery($query);\n\t$edits = $database->loadObjectList();\n\n\tif(!$row->config_editor){\n\t\t$row->config_editor = '';\n\t}\n\t// build the html select list\n\t$lists['editor'] = LHtml::selectList($edits, 'config_editor', 'class=\"inputbox\" size=\"1\"', 'value', 'text', $row->config_editor);\n\n\n\t// НАСТРОЙКИ САЙТА\n\t$lists['offline'] = LHtml::yesnoRadioList('config_offline', 'class=\"inputbox\"', $row->config_offline);\n\n\n\t$listLimit = array(\n\t\tLHtml::makeOption(5, 5),\n\t\tLHtml::makeOption(10, 10),\n\t\tLHtml::makeOption(15, 15),\n\t\tLHtml::makeOption(20, 20),\n\t\tLHtml::makeOption(25, 25),\n\t\tLHtml::makeOption(30, 30),\n\t\tLHtml::makeOption(50, 50),\n\t\tLHtml::makeOption(100, 100),\n\t\tLHtml::makeOption(150, 150),\n\t);\n\n\t$lists['list_limit'] = LHtml::selectList($listLimit, 'config_list_limit', 'class=\"inputbox\" size=\"1\"', 'value', 'text', ($row->config_list_limit ? $row->config_list_limit : 50));\n\n\t$lists['frontend_login'] = LHtml::yesnoRadioList('config_frontend_login', 'class=\"inputbox\"', $row->config_frontend_login);\n\n\t// отключение ведения сессий подсчета числа пользователей на сайте\n\t$lists['session_front'] = LHtml::yesnoRadioList('config_no_session_front', 'class=\"inputbox\"', $row->config_no_session_front);\n\t// отключение syndicate\n\t$lists['syndicate_off'] = LHtml::yesnoRadioList('config_syndicate_off', 'class=\"inputbox\"', $row->config_syndicate_off);\n\t// отключение тега Generator\n\t$lists['generator_off'] = LHtml::yesnoRadioList('config_generator_off', 'class=\"inputbox\"', $row->config_generator_off);\n\t// отключение плагинов группы system\n\t$lists['mmb_system_off'] = LHtml::yesnoRadioList('config_mmb_system_off', 'class=\"inputbox\"', $row->config_mmb_system_off);\n\t// получаем список шаблонов. Код получен из модуля выбора шаблона\n\t$titlelength = 20;\n\t$template_path = _LPATH_ROOT . DS . 'templates';\n\t$templatefolder = @dir($template_path);\n\t$darray = array();\n\t$darray[] = LHtml::makeOption('...', _O_OTHER); // параметр по умолчанию - позволяет использовать стандартный способ определения шаблона\n\tif($templatefolder){\n\t\twhile($templatefile = $templatefolder->read()){\n\t\t\tif($templatefile != 'system' && $templatefile != \".\" && $templatefile != \"..\" && $templatefile != \".svn\" && $templatefile != \"css\" && is_dir(\"$template_path/$templatefile\")){\n\t\t\t\tif(strlen($templatefile) > $titlelength){\n\t\t\t\t\t$templatename = substr($templatefile, 0, $titlelength - 3);\n\t\t\t\t\t$templatename .= \"...\";\n\t\t\t\t} else{\n\t\t\t\t\t$templatename = $templatefile;\n\t\t\t\t}\n\t\t\t\t$darray[] = LHtml::makeOption($templatefile, $templatename);\n\t\t\t}\n\t\t}\n\t\t$templatefolder->close();\n\t}\n\tsort($darray);\n\t$lists['one_template'] = LHtml::selectList($darray, 'config_one_template', \"class=\\\"inputbox\\\" \", 'value', 'text', $row->config_one_template);\n\t// время генерации страницы\n\t$lists['config_time_generate'] = LHtml::yesnoRadioList('config_time_generate', 'class=\"inputbox\"', $row->config_time_generate);\n\t//индексация страницы печати\n\t$lists['index_print'] = LHtml::yesnoRadioList('config_index_print', 'class=\"inputbox\"', $row->config_index_print);\n\t// расширенные теги индексации\n\t$lists['index_tag'] = LHtml::yesnoRadioList('config_index_tag', 'class=\"inputbox\"', $row->config_index_tag);\n\t// ежесуточная оптимизация таблиц бд\n\t$lists['optimizetables'] = LHtml::yesnoRadioList('config_optimizetables', 'class=\"inputbox\"', $row->config_optimizetables);\n\t// отключение плагинов группы content\n\t$lists['mmb_content_off'] = LHtml::yesnoRadioList('config_mmb_content_off', 'class=\"inputbox\"', $row->config_mmb_content_off);\n\t// кеширование меню панели управления\n\t$lists['adm_menu_cache'] = LHtml::yesnoRadioList('config_adm_menu_cache', 'class=\"inputbox\"', $row->config_adm_menu_cache);\n\t// управление captcha\n\t$lists['captcha'] = LHtml::yesnoRadioList('config_captcha', 'class=\"inputbox\"', $row->config_captcha);\n\t// управление captcha\n\t$lists['com_frontpage_clear'] = LHtml::yesnoRadioList('config_com_frontpage_clear', 'class=\"inputbox\"', $row->config_com_frontpage_clear);\n\t// корень файлового менеджера\n\n $row->config_dir_edit = $row->config_dir_edit;\n\n\t// автоматическая установка чекбокса \"Публиковать на главной\"\n\t$lists['auto_frontpage'] = LHtml::yesnoRadioList('config_auto_frontpage', 'class=\"inputbox\"', $row->config_auto_frontpage);\n\t// уникальные идентификаторы новостей\n\t$lists['config_uid_news'] = LHtml::yesnoRadioList('config_uid_news', 'class=\"inputbox\"', $row->config_uid_news);\n\t// подсчет прочтений содержимого\n\t$lists['config_content_hits'] = LHtml::yesnoRadioList('config_content_hits', 'class=\"inputbox\"', $row->config_content_hits);\n\t// формат времени\n\t$date_help = array(\n\t\tLHtml::makeOption('%d.%m.%Y ' . _COM_CONFIG_YEAR . ' %H:%M', strftime('%d.%m.%Y ' . _COM_CONFIG_YEAR . ' %H:%M')),\n\t\tLHtml::makeOption('%d:%m:%Y ' . _COM_CONFIG_YEAR . ' %H:%M', strftime('%d:%m:%Y ' . _COM_CONFIG_YEAR . ' %H:%M')),\n\t\tLHtml::makeOption('%d-%m-%Y ' . _COM_CONFIG_YEAR . ' %H-%M', strftime('%d-%m-%Y ' . _COM_CONFIG_YEAR . ' %H-%M')),\n\t\tLHtml::makeOption('%d/%m/%Y ' . _COM_CONFIG_YEAR . ' %H/%M', strftime('%d/%m/%Y ' . _COM_CONFIG_YEAR . ' %H/%M')),\n\t\tLHtml::makeOption('%d/%m/%Y %H/%M', strftime('%d/%m/%Y %H/%M')),\n\t\tLHtml::makeOption('%d/%m/%Y', strftime('%d/%m/%Y')),\n\t\tLHtml::makeOption('%d:%m:%Y', strftime('%d:%m:%Y')),\n\t\tLHtml::makeOption('%d.%m.%Y', strftime('%d.%m.%Y')),\n\t\tLHtml::makeOption('%d/%m/%Y ' . _COM_CONFIG_YEAR, strftime('%d/%m/%Y ' . _COM_CONFIG_YEAR)),\n\t\tLHtml::makeOption('%d:%m:%Y ' . _COM_CONFIG_YEAR, strftime('%d:%m:%Y ' . _COM_CONFIG_YEAR)),\n\t\tLHtml::makeOption('%d.%m.%Y ' . _COM_CONFIG_YEAR, strftime('%d.%m.%Y ' . _COM_CONFIG_YEAR)),\n\t\tLHtml::makeOption('%H/%M', strftime('%H/%M')),\n\t\tLHtml::makeOption('%H:%M', strftime('%H:%M')),\n\t\tLHtml::makeOption('%H ' . _COM_CONFIG_HOURS . '%M ' . _COM_CONFIG_MONTH, strftime('%H ' . _COM_CONFIG_HOURS . ' %M ' . _COM_CONFIG_MONTH)),\n\t\tLHtml::makeOption('%A %d/%m/%Y ' . _COM_CONFIG_YEAR . ' %H/%M', Jstring::to_utf8(strftime('%A %d/%m/%Y ' . _COM_CONFIG_YEAR . ' %H/%M'))),\n\t\tLHtml::makeOption('%d %B %Y', Jstring::to_utf8(strftime('%d %B %Y')))\n\t);\n\t$lists['form_date_help'] = LHtml::selectList($date_help, 'config_form_date_h', 'class=\"inputbox\" size=\"1\" onchange=\"adminForm.config_form_date.value=this.value;\"', 'value', 'text', $row->config_form_date);\n\t// полный формат даты и времени\n\t$lists['form_date_full_help'] = LHtml::selectList($date_help, 'config_form_date_full_h', 'class=\"inputbox\" size=\"1\" onchange=\"adminForm.config_form_date_full.value=this.value;\"', 'value', 'text', $row->config_form_date_full);\n\t// поддержка работы на младших версиях MySQL\n\t$lists['config_pathway_clean'] = LHtml::yesnoRadioList('config_pathway_clean', 'class=\"inputbox\"', $row->config_pathway_clean);\n\t// отключение удаления сессий в панели управления\n\t$lists['config_admin_autologout'] = LHtml::yesnoRadioList('config_admin_autologout', 'class=\"inputbox\"', $row->config_admin_autologout);\n\t// отключение кнопки \"Помощь\"\n\t$lists['config_disable_button_help'] = LHtml::yesnoRadioList('config_disable_button_help', 'class=\"inputbox\"', $row->config_disable_button_help);\n\t// отключение блокировок объектов\n\t$lists['config_disable_checked_out'] = LHtml::yesnoRadioList('config_disable_checked_out', 'class=\"inputbox\"', $row->config_disable_checked_out);\n\t// отключение favicon\n\t$lists['config_disable_favicon'] = LHtml::yesnoRadioList('config_disable_favicon', 'class=\"inputbox\"', $row->config_disable_favicon);\n\t// использование расширенного отладчика на фронте\n\t$lists['config_front_debug'] = LHtml::yesnoRadioList('config_front_debug', 'class=\"inputbox\"', $row->config_front_debug);\n\t// использование плагинов группы mainbody\n\t$lists['config_mmb_mainbody_off'] = LHtml::yesnoRadioList('config_mmb_mainbody_off', 'class=\"inputbox\"', $row->config_mmb_mainbody_off);\n\t// автоматическая авторизация после подтверждения регистрации\n\t$lists['config_auto_activ_login'] = LHtml::yesnoRadioList('config_auto_activ_login', 'class=\"inputbox\"', $row->config_auto_activ_login);\n\t// отключение вкладки 'Изображения'\n\t$lists['config_disable_image_tab'] = LHtml::yesnoRadioList('config_disable_image_tab', 'class=\"inputbox\"', $row->config_disable_image_tab);\n\t// отключить проверки публикаций по датам\n\t$lists['config_disable_date_state'] = LHtml::yesnoRadioList('config_disable_date_state', 'class=\"inputbox\"', $row->config_disable_date_state);\n\t// отключить проверку доступа к содержимому\n\t$lists['config_disable_access_control'] = LHtml::yesnoRadioList('config_disable_access_control', 'class=\"inputbox\"', $row->config_disable_access_control);\n\t// оптимизация функции кеширования\n\t$lists['config_cache_opt'] = LHtml::yesnoRadioList('config_cache_opt', 'class=\"inputbox\"', $row->config_cache_opt);\n\t// включение сжатия css и js файлов\n\t$lists['config_gz_js_css'] = LHtml::yesnoRadioList('config_gz_js_css', 'class=\"inputbox\"', $row->config_gz_js_css);\n\t// captcha для регистрации\n\t$lists['config_captcha_reg'] = LHtml::yesnoRadioList('config_captcha_reg', 'class=\"inputbox\"', $row->config_captcha_reg);\n\t// captcha для формы контактов\n\t$lists['config_captcha_cont'] = LHtml::yesnoRadioList('config_captcha_cont', 'class=\"inputbox\"', $row->config_captcha_cont);\n\t// визуальный редактор для html и css - codepress\n\t$lists['config_codepress'] = LHtml::yesnoRadioList('config_codepress', 'class=\"inputbox\"', $row->config_codepress);\n\n\t// DEBUG - ОТЛАДКА\n\t$lists['debug'] = LHtml::yesnoRadioList('config_debug', 'class=\"inputbox\"', $row->config_debug);\n\n\t// НАСТРОЙКИ СЕРВЕРА\n\t$lists['gzip'] = LHtml::yesnoRadioList('config_gzip', 'class=\"inputbox\"', $row->config_gzip);\n\n\t$session = array(\n\t\tLHtml::makeOption(0, _SECURITY_LEVEL3),\n\t\tLHtml::makeOption(1, _SECURITY_LEVEL2),\n\t\tLHtml::makeOption(2, _SECURITY_LEVEL1)\n\t);\n\t$lists['session_type'] = LHtml::selectList($session, 'config_session_type', 'class=\"inputbox\" size=\"1\"', 'value', 'text', $row->config_session_type);\n\n\t$errors = array(\n\t\tLHtml::makeOption(E_ALL, _COM_CONFIG_ERROR_ALL),\n\t\tLHtml::makeOption(-1, _COM_CONFIG_ERROR_SYSTEM),\n\t\tLHtml::makeOption(0, _COM_CONFIG_ERROR_HIDE),\n\t\tLHtml::makeOption(E_ERROR | E_WARNING | E_PARSE, _COM_CONFIG_ERROR_TINY),\n\t\tLHtml::makeOption(E_ALL & ~E_NOTICE, _COM_CONFIG_ERROR_PARANOIDAL),\n\t);\n\n\t$lists['error_reporting'] = LHtml::selectList($errors, 'config_error_reporting', 'class=\"inputbox\" size=\"1\"', 'value', 'text', $row->config_error_reporting);\n\n\t$lists['admin_expired'] = LHtml::yesnoRadioList('config_admin_expired', 'class=\"inputbox\"', $row->config_admin_expired);\n\n\t// НАСТРОЙКИ ЛОКАЛИ СТРАНЫ\n\t$lists['lang'] = LHtml::selectList($langs, 'config_lang', 'class=\"inputbox\" size=\"1\"', 'value', 'text', $row->config_lang);\n\n\t$timeoffset = array(\n\t\tLHtml::makeOption(-12, _TIME_OFFSET_M_12),\n\t\tLHtml::makeOption(-11, _TIME_OFFSET_M_11),\n\t\tLHtml::makeOption(-10, _TIME_OFFSET_M_10),\n\t\tLHtml::makeOption(-9.5, _TIME_OFFSET_M_9_5),\n\t\tLHtml::makeOption(-9, _TIME_OFFSET_M_9),\n\t\tLHtml::makeOption(-8, _TIME_OFFSET_M_8),\n\t\tLHtml::makeOption(-7, _TIME_OFFSET_M_7),\n\t\tLHtml::makeOption(-6, _TIME_OFFSET_M_6),\n\t\tLHtml::makeOption(-5, _TIME_OFFSET_M_5),\n\t\tLHtml::makeOption(-4, _TIME_OFFSET_M_4),\n\t\tLHtml::makeOption(-3.5, _TIME_OFFSET_M_3_5),\n\t\tLHtml::makeOption(-3, _TIME_OFFSET_M_3),\n\t\tLHtml::makeOption(-2, _TIME_OFFSET_M_2),\n\t\tLHtml::makeOption(-1, _TIME_OFFSET_M_1),\n\t\tLHtml::makeOption(0, _TIME_OFFSET_M_0),\n\t\tLHtml::makeOption(1, _TIME_OFFSET_P_1),\n\t\tLHtml::makeOption(2, _TIME_OFFSET_P_2),\n\t\tLHtml::makeOption(3, _TIME_OFFSET_P_3),\n\t\tLHtml::makeOption(3.5, _TIME_OFFSET_P_3_5),\n\t\tLHtml::makeOption(4, _TIME_OFFSET_P_4),\n\t\tLHtml::makeOption(4.5, _TIME_OFFSET_P_4_5),\n\t\tLHtml::makeOption(5, _TIME_OFFSET_P_5),\n\t\tLHtml::makeOption(5.5, _TIME_OFFSET_P_5_5),\n\t\tLHtml::makeOption(5.75, _TIME_OFFSET_P_5_75),\n\t\tLHtml::makeOption(6, _TIME_OFFSET_P_6),\n\t\tLHtml::makeOption(6.30, _TIME_OFFSET_P_6_5),\n\t\tLHtml::makeOption(7, _TIME_OFFSET_P_7),\n\t\tLHtml::makeOption(8, _TIME_OFFSET_P_8),\n\t\tLHtml::makeOption(8.75, _TIME_OFFSET_P_8_75),\n\t\tLHtml::makeOption(9, _TIME_OFFSET_P_9),\n\t\tLHtml::makeOption(9.5, _TIME_OFFSET_P_9_5),\n\t\tLHtml::makeOption(10, _TIME_OFFSET_P_10),\n\t\tLHtml::makeOption(10.5, _TIME_OFFSET_P_10_5),\n\t\tLHtml::makeOption(11, _TIME_OFFSET_P_11),\n\t\tLHtml::makeOption(11.30, _TIME_OFFSET_P_11_5),\n\t\tLHtml::makeOption(12, _TIME_OFFSET_P_12),\n\t\tLHtml::makeOption(12.75, _TIME_OFFSET_P_12_75),\n\t\tLHtml::makeOption(13, _TIME_OFFSET_P_13),\n\t\tLHtml::makeOption(14, _TIME_OFFSET_P_14),);\n\n\t$lists['offset'] = LHtml::selectList($timeoffset, 'config_offset_user', 'class=\"inputbox\" size=\"1\"', 'value', 'text', $row->config_offset_user);\n\n\t$feed_timeoffset = array(\n\t\tLHtml::makeOption('-12:00', _TIME_OFFSET_M_12),\n\t\tLHtml::makeOption('-11:00', _TIME_OFFSET_M_11),\n\t\tLHtml::makeOption('-10:00', _TIME_OFFSET_M_10),\n\t\tLHtml::makeOption('-09:30', _TIME_OFFSET_M_9_5),\n\t\tLHtml::makeOption('-09:00', _TIME_OFFSET_M_9),\n\t\tLHtml::makeOption('-08:00', _TIME_OFFSET_M_8),\n\t\tLHtml::makeOption('-07:00', _TIME_OFFSET_M_7),\n\t\tLHtml::makeOption('-06:00', _TIME_OFFSET_M_6),\n\t\tLHtml::makeOption('-05:00', _TIME_OFFSET_M_5),\n\t\tLHtml::makeOption('-04:00', _TIME_OFFSET_M_4),\n\t\tLHtml::makeOption('-03:30', _TIME_OFFSET_M_3_5),\n\t\tLHtml::makeOption('-03:00', _TIME_OFFSET_M_3),\n\t\tLHtml::makeOption('-02:00', _TIME_OFFSET_M_2),\n\t\tLHtml::makeOption('-01:00', _TIME_OFFSET_M_1),\n\t\tLHtml::makeOption('00:00', _TIME_OFFSET_M_0),\n\t\tLHtml::makeOption('+01:00', _TIME_OFFSET_P_1),\n\t\tLHtml::makeOption('+02:00', _TIME_OFFSET_P_2),\n\t\tLHtml::makeOption('+03:00', _TIME_OFFSET_P_3),\n\t\tLHtml::makeOption('+03:30', _TIME_OFFSET_P_3_5),\n\t\tLHtml::makeOption('+04:00', _TIME_OFFSET_P_4),\n\t\tLHtml::makeOption('+04:30', _TIME_OFFSET_P_4_5),\n\t\tLHtml::makeOption('+05:00', _TIME_OFFSET_P_5),\n\t\tLHtml::makeOption('+05:30', _TIME_OFFSET_P_5_5),\n\t\tLHtml::makeOption('+05:45', _TIME_OFFSET_P_5_75),\n\t\tLHtml::makeOption('+06:00', _TIME_OFFSET_P_6),\n\t\tLHtml::makeOption('+06:30', _TIME_OFFSET_P_6_5),\n\t\tLHtml::makeOption('+07:00', _TIME_OFFSET_P_7),\n\t\tLHtml::makeOption('+08:00', _TIME_OFFSET_P_8),\n\t\tLHtml::makeOption('+08:45', _TIME_OFFSET_P_8_75),\n\t\tLHtml::makeOption('+09:00', _TIME_OFFSET_P_9),\n\t\tLHtml::makeOption('+09:30', _TIME_OFFSET_P_9_5),\n\t\tLHtml::makeOption('+10:00', _TIME_OFFSET_P_10),\n\t\tLHtml::makeOption('+10:30', _TIME_OFFSET_P_10_5),\n\t\tLHtml::makeOption('+11:00', _TIME_OFFSET_P_11),\n\t\tLHtml::makeOption('+11:30', _TIME_OFFSET_P_11_5),\n\t\tLHtml::makeOption('+12:00', _TIME_OFFSET_P_12),\n\t\tLHtml::makeOption('+12:45', _TIME_OFFSET_P_12_75),\n\t\tLHtml::makeOption('+13:00', _TIME_OFFSET_P_13),\n\t\tLHtml::makeOption('+14:00', _TIME_OFFSET_P_14)\n\t);\n\t$lists['feed_timeoffset'] = LHtml::selectList($feed_timeoffset, 'config_feed_timeoffset', 'class=\"inputbox\" size=\"1\"', 'value', 'text', $row->config_feed_timeoffset);\n\n// НАСТРОЙКИ ПОЧТЫ\n\t$mailer = array(\n\t\tLHtml::makeOption('mail', _PHP_MAIL_FUNCTION),\n\t\tLHtml::makeOption('sendmail', 'Sendmail'),\n\t\tLHtml::makeOption('smtp', _SMTP_SERVER)\n\t);\n\t$lists['mailer'] = LHtml::selectList($mailer, 'config_mailer', 'class=\"inputbox\" size=\"1\"', 'value', 'text', $row->config_mailer);\n\t$lists['smtpauth'] = LHtml::yesnoRadioList('config_smtpauth', 'class=\"inputbox\"', $row->config_smtpauth);\n\n\n\t// НАСТРОЙКИ КЕША\n\t$lists['caching'] = LHtml::yesnoRadioList('config_caching', 'class=\"inputbox\"', $row->config_caching);\n\n// НАСТРОЙКИ ПОЛЬЗОВАТЕЛЕЙ\n\n\t$lists['useractivation'] = LHtml::yesnoRadioList('config_useractivation', 'class=\"inputbox\"', $row->config_useractivation);\n\t$lists['uniquemail'] = LHtml::yesnoRadioList('config_uniquemail', 'class=\"inputbox\"', $row->config_uniquemail);\n\t$lists['frontend_userparams'] = LHtml::yesnoRadioList('config_frontend_userparams', 'class=\"inputbox\"', $row->config_frontend_userparams);\n\t$lists['allowUserRegistration'] = LHtml::yesnoRadioList('config_allowUserRegistration', 'class=\"inputbox\"', $row->config_allowUserRegistration);\n\n// НАСТРОЙКИ META-ДАННЫХ\n\t$lists['MetaAuthor'] = LHtml::yesnoRadioList('config_MetaAuthor', 'class=\"inputbox\"', $row->config_MetaAuthor);\n\t$lists['MetaTitle'] = LHtml::yesnoRadioList('config_MetaTitle', 'class=\"inputbox\"', $row->config_MetaTitle);\n\n// НАСТРОЙКИ СТАТИСТИКИ\n\t$lists['log_searches'] = LHtml::yesnoRadioList('config_enable_log_searches', 'class=\"inputbox\"', $row->config_enable_log_searches);\n\t$lists['enable_stats'] = LHtml::yesnoRadioList('config_enable_stats', 'class=\"inputbox\"', $row->config_enable_stats);\n\t$lists['log_items'] = LHtml::yesnoRadioList('config_enable_log_items', 'class=\"inputbox\"', $row->config_enable_log_items);\n\n// НАСТРОЙКИ SEO\n\t$lists['sef'] = LHtml::yesnoRadioList('config_sef', 'class=\"inputbox\" onclick=\"javascript: if (document.adminForm.config_sef[1].checked) { alert(\\'' . _C_CONFIG_HTACCESS_RENAME . '\\') }\"', $row->config_sef);\n\t$lists['pagetitles'] = LHtml::yesnoRadioList('config_pagetitles', 'class=\"inputbox\"', $row->config_pagetitles);\n\n\t$pagetitles_first = array(\n\t\tLHtml::makeOption(0, _COM_CONFIG_SEO_TYPE_1),\n\t\tLHtml::makeOption(1, _COM_CONFIG_SEO_TYPE_2),\n\t\tLHtml::makeOption(2, _COM_CONFIG_SEO_TYPE_3),\n\t\tLHtml::makeOption(3, _COM_CONFIG_SEO_TYPE_4),\n\t);\n\t$lists['pagetitles_first'] = LHtml::selectList($pagetitles_first, 'config_pagetitles_first', 'class=\"inputbox\" size=\"1\"', 'value', 'text', $row->config_pagetitles_first);\n\n// НАСТРОЙКИ СОДЕРЖИМОГО\n\t$author_name_type = array(\n\t\tLHtml::makeOption(1, _COM_CONFIG_CC_NAME_TEXT),\n\t\tLHtml::makeOption(2, _COM_CONFIG_CC_LOGIN_TEXT),\n\t\tLHtml::makeOption(3, _COM_CONFIG_CC_NAME_LINK),\n\t\tLHtml::makeOption(4, _COM_CONFIG_CC_LIGIN_LINK),\n\t);\n\t$lists['authorName'] = LHtml::selectList($author_name_type, 'config_author_name', 'class=\"inputbox\" size=\"1\"', 'value', 'text', $row->config_author_name);\n\n\t$lists['link_titles'] = LHtml::yesnoRadioList('config_link_titles', 'class=\"inputbox\"', $row->config_link_titles);\n\t$lists['readmore'] = LHtml::yesnoRadioList('config_readmore', 'class=\"inputbox\"', $row->config_readmore);\n\t$lists['vote'] = LHtml::yesnoRadioList('config_vote', 'class=\"inputbox\"', $row->config_vote);\n\t$lists['showAuthor'] = LHtml::yesnoRadioList('config_showAuthor', 'class=\"inputbox\"', $row->config_showAuthor);\n\t$lists['showCreateDate'] = LHtml::yesnoRadioList('config_showCreateDate', 'class=\"inputbox\"', $row->config_showCreateDate);\n\t$lists['showModifyDate'] = LHtml::yesnoRadioList('config_showModifyDate', 'class=\"inputbox\"', $row->config_showModifyDate);\n\t$lists['hits'] = LHtml::yesnoRadioList('config_hits', 'class=\"inputbox\"', $row->config_hits);\n\t$lists['tags'] = LHtml::yesnoRadioList('config_tags', 'class=\"inputbox\"', $row->config_tags);\n\t$lists['back_button'] = LHtml::yesnoRadioList('config_back_button', 'class=\"inputbox\"', $row->config_back_button);\n\t$lists['item_navigation'] = LHtml::yesnoRadioList('config_item_navigation', 'class=\"inputbox\"', $row->config_item_navigation);\n\t$lists['multipage_toc'] = LHtml::yesnoRadioList('config_multipage_toc', 'class=\"inputbox\"', $row->config_multipage_toc);\n\t$lists['showPrint'] = LHtml::yesnoRadioList('config_showPrint', 'class=\"inputbox\"', $row->config_showPrint);\n\t$lists['showEmail'] = LHtml::yesnoRadioList('config_showEmail', 'class=\"inputbox\"', $row->config_showEmail);\n\t$lists['icons'] = LHtml::yesnoRadioList('config_icons', 'class=\"inputbox\"', $row->config_icons);\n\t$lists['mtage_base'] = LHtml::yesnoRadioList('config_mtage_base', 'class=\"inputbox\"', $row->config_mtage_base);\n\t$lists['config_custom_print'] = LHtml::yesnoRadioList('config_custom_print', 'class=\"inputbox\"', $row->config_custom_print);\n\t$global_templates = array(\n\t\tLHtml::makeOption(0, _GLOBAL_TEMPLATES_SYSTEMDIR),\n\t\tLHtml::makeOption(1, _GLOBAL_TEMPLATES_CURTEMPLATE),\n\t);\n\t$lists['global_templates'] = LHtml::selectList($global_templates, 'config_global_templates', 'class=\"inputbox\" size=\"1\"', 'value', 'text', $row->config_global_templates);\n\n\t$lists['tpreview'] = LHtml::yesnoRadioList('config_disable_tpreview', 'class=\"inputbox\"', $row->config_disable_tpreview);\n\n $lists['mainbody'] = LHtml::yesnoRadioList('config_mainbody', 'class=\"inputbox\"', $row->config_mainbody);\n\n\t$locales = array(\n\t\tLHtml::makeOption('ru_RU.utf8', 'ru_RU.utf8'),\n\t\tLHtml::makeOption('russian', 'russian (windows)'),\n\t\tLHtml::makeOption('english', 'english (for windows)'),\n\t\tLHtml::makeOption('az_AZ.utf8', 'az_AZ.utf8'),\n\t\tLHtml::makeOption('ar_EG.utf8', 'ar_EG.utf8'),\n\t\tLHtml::makeOption('ar_LB.utf8', 'ar_LB.utf8'),\n\t\tLHtml::makeOption('eu_ES.utf8', 'eu_ES.utf8'),\n\t\tLHtml::makeOption('bg_BG.utf8', 'bg_BG.utf8'),\n\t\tLHtml::makeOption('ca_ES.utf8', 'ca_ES.utf8'),\n\t\tLHtml::makeOption('zh_CN.utf8', 'zh_CN.utf8'),\n\t\tLHtml::makeOption('zh_TW.utf8', 'zh_TW.utf8'),\n\t\tLHtml::makeOption('hr_HR.utf8', 'hr_HR.utf8'),\n\t\tLHtml::makeOption('cs_CZ.utf8', 'cs_CZ.utf8'),\n\t\tLHtml::makeOption('da_DK.utf8', 'da_DK.utf8'),\n\t\tLHtml::makeOption('nl_NL.utf8', 'nl_NL.utf8'),\n\t\tLHtml::makeOption('et_EE.utf8', 'et_EE.utf8'),\n\t\tLHtml::makeOption('en_GB.utf8', 'en_GB.utf8'),\n\t\tLHtml::makeOption('en_US.utf8', 'en_US.utf8'),\n\t\tLHtml::makeOption('en_AU.utf8', 'en_AU.utf8'),\n\t\tLHtml::makeOption('en_IE.utf8', 'en_IE.utf8'),\n\t\tLHtml::makeOption('fa_IR.utf8', 'fa_IR.utf8'),\n\t\tLHtml::makeOption('fi_FI.utf8', 'fi_FI.utf8'),\n\t\tLHtml::makeOption('fr_FR.utf8', 'fr_FR.utf8'),\n\t\tLHtml::makeOption('gl_ES.utf8', 'gl_ES.utf8'),\n\t\tLHtml::makeOption('de_DE.utf8', 'de_DE.utf8'),\n\t\tLHtml::makeOption('el_GR.utf8', 'el_GR.utf8'),\n\t\tLHtml::makeOption('he_IL.utf8', 'he_IL.utf8'),\n\t\tLHtml::makeOption('hu_HU.utf8', 'hu_HU.utf8'),\n\t\tLHtml::makeOption('is_IS.utf8', 'is_IS.utf8'),\n\t\tLHtml::makeOption('ga_IE.utf8', 'ga_IE.utf8'),\n\t\tLHtml::makeOption('it_IT.utf8', 'it_IT.utf8'),\n\t\tLHtml::makeOption('ja_JP.utf8', 'ja_JP.utf8'),\n\t\tLHtml::makeOption('ko_KR.utf8', 'ko_KR.utf8'),\n\t\tLHtml::makeOption('lv_LV.utf8', 'lv_LV.utf8'),\n\t\tLHtml::makeOption('lt_LT.utf8', 'lt_LT.utf8'),\n\t\tLHtml::makeOption('mk_MK.utf8', 'mk_MK.utf8'),\n\t\tLHtml::makeOption('ms_MY.utf8', 'ms_MY.utf8'),\n\t\tLHtml::makeOption('no_NO.utf8', 'no_NO.utf8'),\n\t\tLHtml::makeOption('nn_NO.utf8', 'nn_NO.utf8'),\n\t\tLHtml::makeOption('pl_PL.utf8', 'pl_PL.utf8'),\n\t\tLHtml::makeOption('pt_PT.utf8', 'pt_PT.utf8'),\n\t\tLHtml::makeOption('pt_BR.utf8', 'pt_BR.utf8'),\n\t\tLHtml::makeOption('ro_RO.utf8', 'ro_RO.utf8'),\n\t\tLHtml::makeOption('sk_SK.utf8', 'sk_SK.utf8'),\n\t\tLHtml::makeOption('sl_SI.utf8', 'sl_SI.utf8'),\n\t\tLHtml::makeOption('sr_CS.utf8', 'sr_CS.utf8'),\n\t\tLHtml::makeOption('rs_SR.utf8', 'rs_SR.utf8'),\n\t\tLHtml::makeOption('es_ES.utf8', 'es_ES.utf8'),\n\t\tLHtml::makeOption('es_MX.utf8', 'es_MX.utf8'),\n\t\tLHtml::makeOption('sv_SE.utf8', 'sv_SE.utf8'),\n\t\tLHtml::makeOption('sv_FI.utf8', 'sv_FI.utf8'),\n\t\tLHtml::makeOption('ta_IN.utf8', 'ta_IN.utf8'),\n\t\tLHtml::makeOption('tr_TR.utf8', 'tr_TR.utf8'),\n\t\tLHtml::makeOption('uk_UA.utf8', 'uk_UA.utf8'),\n\t\tLHtml::makeOption('vi_VN.utf8', 'vi_VN.utf8'),\n\t\tLHtml::makeOption('wa_BE.utf8', 'wa_BE.utf8')\n\t);\n\t$lists['locale'] = LHtml::selectList($locales, 'config_locale', 'class=\"selectbox\" size=\"1\" dir=\"ltr\"', 'value', 'text', $row->config_locale);\n\n\t// включение кода безопасности для доступа к панели управления\n\t$lists['config_enable_admin_secure_code'] = LHtml::yesnoRadioList('config_enable_admin_secure_code', 'class=\"inputbox\"', $row->config_enable_admin_secure_code);\n\n\t// режим редиректа при включенном коде безопасноти\n\t$redirect_r = array(\n\t\tLHtml::makeOption(0, 'index.php'),\n\t\tLHtml::makeOption(1, _ADMIN_REDIRECT_PAGE)\n\t);\n\t$lists['config_admin_redirect_options'] = LHtml::RadioList($redirect_r, 'config_admin_redirect_options', 'class=\"inputbox\"', $row->config_admin_redirect_options, 'value', 'text');\n\n\t// обработчики кеширования\n\t$cache_handler = array();\n\t$cache_handler[] = LHtml::makeOption('file', 'file');\n\tif(function_exists('eaccelerator_get')) $cache_handler[] = LHtml::makeOption('eaccelerator', 'eAccelerator');\n\tif(extension_loaded('apc')) $cache_handler[] = LHtml::makeOption('apc', 'APC');\n\tif(class_exists('Memcache')) $cache_handler[] = LHtml::makeOption('memcache', 'Memcache');\n\tif(function_exists('xcache_set')) $cache_handler[] = LHtml::makeOption('xcache', 'Xcache');\n\n\t?>\n<script>\n\tfunction showHideMemCacheSettings() {\n\t\tif (document.getElementById(\"config_cache_handler\").value != \"memcache\") {\n\t\t\tdocument.getElementById(\"memcache_persist\").style.display = \"none\";\n\t\t\tdocument.getElementById(\"memcache_compress\").style.display = \"none\";\n\t\t\tdocument.getElementById(\"memcache_server\").style.display = \"none\";\n\t\t}\n\t\telse {\n\t\t\tdocument.getElementById(\"memcache_persist\").style.display = \"\";\n\t\t\tdocument.getElementById(\"memcache_compress\").style.display = \"\";\n\t\t\tdocument.getElementById(\"memcache_server\").style.display = \"\";\n\t\t}\n\t}\n</script>\n\n<?php\n\t// оработчик кеширования\n\t$lists['cache_handler'] = LHtml::selectList($cache_handler, 'config_cache_handler', 'class=\"inputbox\" id=\"config_cache_handler\" onchange=\"showHideMemCacheSettings();\" ', 'value', 'text', $row->config_cache_handler);\n\n\tif(!empty($row->config_memcache_settings) && !is_array($row->config_memcache_settings)){\n\t\t$row->config_memcache_settings = unserialize(stripslashes($row->config_memcache_settings));\n\t}\n\t$lists['memcache_persist'] = LHtml::yesnoRadioList('config_memcache_persistent', 'class=\"inputbox\"', $row->config_memcache_persistent);\n\t$lists['memcache_compress'] = LHtml::yesnoRadioList('config_memcache_compression', 'class=\"inputbox\"', $row->config_memcache_compression);\n\n\t// использование неопубликованных плагинов\n\t$lists['config_use_unpublished_plugins'] = LHtml::yesnoRadioList('config_use_unpublished_plugins', 'class=\"inputbox\"', $row->config_use_unpublished_plugins);\n\n\t// отключение syndicate\n\t$lists['syndicate_off'] = LHtml::yesnoRadioList('config_syndicate_off', 'class=\"inputbox\"', $row->config_syndicate_off);\n\n\t// список шаблонов панели управления\n\t$titlelength = 20;\n\t$admin_template_path = _LPATH_ROOT . DS . 'administrator' . DS . 'templates';\n\t$templatefolder = @dir($admin_template_path);\n\n\t$admin_templates = array();\n\t$admin_templates[] = LHtml::makeOption('...', _O_OTHER); // параметр по умолчанию - позволяет использовать стандартный способ определения шаблона\n\tif($templatefolder){\n\t\twhile($templatefile = $templatefolder->read()){\n\t\t\tif($templatefile != \".\" && $templatefile != \"..\" && $templatefile != \".svn\" && is_dir($admin_template_path . DS . $templatefile)){\n\t\t\t\tif(strlen($templatefile) > $titlelength){\n\t\t\t\t\t$templatename = substr($templatefile, 0, $titlelength - 3);\n\t\t\t\t\t$templatename .= \"...\";\n\t\t\t\t} else{\n\t\t\t\t\t$templatename = $templatefile;\n\t\t\t\t}\n\t\t\t\t$admin_templates[] = LHtml::makeOption($templatefile, $templatename);\n\t\t\t}\n\t\t}\n\t\t$templatefolder->close();\n\t}\n\tsort($admin_templates);\n\t$lists['config_admin_template'] = LHtml::selectList($admin_templates, 'config_admin_template', 'class=\"inputbox\" ', 'value', 'text', $row->config_admin_template);\n\n\t// режим сортировки содержимого в панели управления\n\t$order_list = array(\n\t\tLHtml::makeOption(0, _ORDER_BY_NAME),\n\t\tLHtml::makeOption(1, _ORDER_BY_HEADERS),\n\t\tLHtml::makeOption(2, _ORDER_BY_DATE_CR),\n\t\tLHtml::makeOption(3, _ORDER_BY_DATE_MOD),\n\t\tLHtml::makeOption(4, _ORDER_BY_ID),\n\t\tLHtml::makeOption(5, _ORDER_BY_HITS)\n\t);\n\t$lists['admin_content_order_by'] = LHtml::selectList($order_list, 'config_admin_content_order_by', 'class=\"inputbox\" size=\"1\"', 'value', 'text', $row->config_admin_content_order_by);\n\n\t$order_sort_list = array(\n\t\tLHtml::makeOption(1, _SORT_ASC),\n\t\tLHtml::makeOption(0, _SORT_DESC)\n\t);\n\t$lists['admin_content_order_sort'] = LHtml::selectList($order_sort_list, 'config_admin_content_order_sort', 'class=\"inputbox\" size=\"1\"', 'value', 'text', $row->config_admin_content_order_sort);\n\n\t// блокировка компонентов\n\t$lists['components_access'] = LHtml::yesnoRadioList('config_components_access', 'class=\"inputbox\"', $row->config_components_access);\n\n\t// использование плагинов удаления содержимого\n\t$lists['config_use_content_delete_plugins'] = LHtml::yesnoRadioList('config_use_content_delete_plugins', 'class=\"inputbox\"', $row->config_use_content_delete_plugins);\n\t// использование редактирования смодержимого\n\t$lists['config_use_content_edit_plugins'] = LHtml::yesnoRadioList('config_use_content_edit_plugins', 'class=\"inputbox\"', $row->config_use_content_edit_plugins);\n\t// использование плагинов сохранения содержимого\n\t$lists['config_use_content_save_plugins'] = LHtml::yesnoRadioList('config_use_content_save_plugins', 'class=\"inputbox\"', $row->config_use_content_save_plugins);\n\n\tHTML_config::showconfig($row, $lists, $option);\n}", "function getConfFile($p_sPagina) {\n $l_sFileInfo = pathinfo($p_sPagina);\n $l_sFile = $l_sFileInfo['filename'] . '.php';\n if (strlen($l_sFile) > 4) {\n $this->procVars->set('ConfFile', $l_sFile);\n return $l_sFile;\n }\n }", "function getConfigList(){\n $fileName = \"template/backend/config.txt\";\n if (file_exists($fileName)) {\n $f = fopen($fileName, \"r\");\n $content = fread($f,filesize($fileName));\n \n if (!is_int($content) && !is_float($content)) {\n $configTemp = json_decode($content,true);\n\n if($configTemp){\n foreach($configTemp as $item){\n $this->_template['config_website'][$item['key']] = $item['value'];\n }\n }\n }\n fclose($f);\n }\n\n\n\n // $list = $this->My_model->getlist('config');\n // if($list!=null){\n // foreach($list as $item){\n // $this->_template['config_website'][$item['key']] = $item['value'];\n // }\n // }\n }", "public function getConfigFilePath(): string;", "private function _getDataConfig()\n\t\t{\n\t\t\t\t$this->_db->setQuery($this->_db->getQuery(true)->select('*')->from(\"#__jsn_uniform_config\")->where(\"name='folder_upload'\"));\n\t\t\t\treturn $this->_db->loadObject();\n\t\t}", "function display_dir() {\n\techo \"<table width=\\\"100%\\\" border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"1\\\">\\n\";\n\techo \"<tr class=\\\"header\\\"><td class=\\\"file\\\" style=\\\"padding: 2px\\\">File</td><td width=\\\"90\\\" class=\\\"file-property\\\">Dimensioni</td><td width=\\\"78\\\" class=\\\"file-property\\\">Modifica</td><td width=\\\"84\\\" class=\\\"file-options\\\" style=\\\"border: 0px\\\">Opzioni</td></tr>\\n\";\n\t// Show parent directory link, if applicable\n\tif ($this->use_dir != \"\") echo \"<tr height=\\\"24\\\"><td colspan=\\\"3\\\" class=\\\"file\\\" align=\\\"center\\\"><a href=\\\"\" .$_SERVER['PHP_SELF'] . $this->parent_dir . \"\\\"><span class=\\\"dir-view\\\">^</span></a> <span class=\\\"error_msg\\\">\" . $this->use_dir . \"</span></td><td class=\\\"file-options\\\">&nbsp;</td></tr>\"; \n\t// Show error message\n\t$this->show_msg();\n\t// Begin directory read loop\n\twhile (($file = readdir($this->dir)) != FALSE) {\n\t$filename = $file; // $filename will be unedited, while $file will have $use_dir tacked onto the front of it\n\t$file = $this->use_dir . $file;\n\tif ($filename == \".\" || $filename == \"..\") continue; // Ignore self and parent directory links (first two entries in each directory)\n\tif ( $this->settings['protected_files_show'] == 0 && $this->is_protected($file) ) continue; // Don't show protected files\n\t$fsize = $this->file_property(\"size\", $file);\n\t$fmtime = $this->file_property(\"modified\", $file);\n\t// Check if it's a directory or not\n\tif (is_dir($file)) {\n\t$dir_files[$filename] = \"<tr><td class=\\\"file\\\"><a href=\\\"\" . $_SERVER['PHP_SELF'] . \"?dir=\" . $file . \"/\\\"><span class=\\\"dir-view\\\" title=\\\"Naviga la cartella\\\">></span></a> <a href=\\\"\" . $file . \"\\\"><span class=\\\"directory\\\">\" . $filename . \"/</span></a></td><td class=\\\"file\\\">&nbsp;</td><td class=\\\"file\\\">&nbsp;</td><td class=\\\"file-options\\\" height=\\\"18\\\">\" . $this->show_options($file) . \"</td></tr>\\n\";\n\t// Check if it's a php file\t\t\t\n\t} elseif (($this->settings['php_source_view'] == 1) && ( (substr($file, -4, 4) == \".php\") || (substr($file, -5, 5) == \".php3\") ) ) { \n\tif ($this->use_dir != \"\") {\n\t$non_dir_files[$filename] = \"<tr><td class=\\\"file\\\"><a href=\\\"\" . $_SERVER['PHP_SELF'] . \"?phpfile=\" . $file . \"&dir=\" . $this->use_dir . \"\\\"><span class=\\\"php\\\">\" . $filename . \"</span></a></td><td class=\\\"file-property\\\">\" . $fsize . \"</td><td class=\\\"file-property\\\">\" . $fmtime . \"</td><td class=\\\"file-options\\\" height=\\\"18\\\">\" . $this->show_options($file) . \"</td></tr>\\n\";\n\t} else {\n\t$non_dir_files[$filename] = \"<tr><td class=\\\"file\\\"><a href=\\\"\" . $_SERVER['PHP_SELF'] . \"?phpfile=\" . $file . \"\\\"><span class=\\\"php\\\">\" . $filename . \"</span></a></td><td class=\\\"file-property\\\">\" . $fsize . \"</td><td class=\\\"file-property\\\">\" . $fmtime . \"</td><td class=\\\"file-options\\\">\" . $this->show_options($file) . \"</td></tr>\\n\";\n\t}\n\t// If not a directory or php file, parse the filename for filetype color-coding\n\t} else {\n\t$file_lower = strtolower($file);\n\tforeach ($this->filetypes as $key => $value) { // Loops thru entire $filetypes array \n\t$keylen = strlen($key);\n\tif (substr($file_lower, -$keylen, $keylen) == $key) {\n\t$non_dir_files[$filename] = \"<tr><td class=\\\"file\\\"><a href=\\\"\" . $file . \"\\\"><span class=\\\"\" . $value . \"\\\">\" . $filename . \"</span></a></td><td class=\\\"file-property\\\">\" . $fsize . \"</td><td class=\\\"file-property\\\">\" . $fmtime . \"</td><td class=\\\"file-options\\\">\" . $this->show_options($file) . \"</td></tr>\\n\";\n\tcontinue 2;\n\t}\n\t}\n\t$non_dir_files[$filename] = \"<tr style=\\\"border-top: 1px solid #000000\\\"><td class=\\\"file\\\"><a href=\\\"\" . $file . \"\\\">\" . $filename . \"</a></td><td class=\\\"file-property\\\">\" . $fsize . \"</td><td class=\\\"file-property\\\">\" . $fmtime . \"</td><td class=\\\"file-options\\\">\" . $this->show_options($file) . \"</td></tr>\\n\";\n\t}\n\t}\n\t// Sort the arrays alphabetically and output them\n\tif (isset($dir_files)) {\n\tksort($dir_files);\n\tforeach ($dir_files as $value) echo $value;\n\t}\n\tif (isset($non_dir_files)) {\n\tksort($non_dir_files);\n\tforeach ($non_dir_files as $value) echo $value;\n\t}\n\techo \"</table>\\n\";\n\tclosedir($this->dir);\n\t}", "private static function __getDbConfig() {\n return include Sys::getCfgDir() . 'db.php';\n }", "public function setConfigfile();", "function show_options($file) {\n\t$prot = 0;\n\tif ($this->is_protected($file)) $prot = 1;\n\t\n\t// Delete option\n\tif ($prot == 0 && $this->settings['delete_on'] == 1) {\n\t$ret = \"<a href=\\\"\" . $_SERVER['PHP_SELF'] . \"?del=\" . $file . \"\\\" title=\\\"Cancela \" . $file . \"\\\"\";\n\tif ($this->settings['delete_confirm'] == 1) \n\t$ret .= \"onClick=\\\"javascript: return confirm('Cancella file \" . $file . \"?')\\\"\";\n\t$ret .= \">C</a> : \";\n\t} else {\n\t$ret = \"<span class=\\\"greyed-out\\\" title=\\\"Cancellazione file non consentita \" . $file . \"\\\">C</span>: \";\n\t}\n\t\n\t// Rename option\n\tif ($prot == 0 && $this->settings['rename_on'] == 1) {\n\t$ret .= \"<a href=\\\"\" . $_SERVER['PHP_SELF'] . \"?ren=\" . $file . \"\\\" title=\\\"Rinomina \" . $file . \"\\\">R</a> : \";\n\t} else {\n\t$ret .= \"<span class=\\\"greyed-out\\\" title=\\\"Impossibile rinominare il file \" . $file . \"\\\">R</span>: \";\n\t}\n\t\n\t// Edit option\n\tif (!is_dir($file)) {\n\tif ($prot == 0 && $this->settings['edit_on'] == 1) {\n\t$ret .= \"<a href=\\\"\" . $_SERVER['PHP_SELF'] . \"?edit=\" . $file;\n\tif ($this->use_dir != \"\") \n\t$ret .= \"&dir=\" . $this->use_dir;\n\t$ret .= \"\\\" title=\\\"Edita \" . $file . \"\\\">E</a> : \";\n\t} else {\n\t$ret .= \"<span class=\\\"greyed-out\\\" title=\\\"Impossibile eitare il file \" . $file . \"\\\">E</span>: \";\n\t}\n\t}\n\t\n\t// View option\n\t$ret .= \"<a href=\\\"\" . $file . \"\\\" title=\\\"Vedi \" . $file . \"\\\">V</a>\";\n\treturn $ret;\n\t}", "public static function getConfigView($f3){\n\t\t\t\n\t\treturn('app/views/configprompt.php');\n\t}", "function configuration() {\n\tglobal $framework;\n\t$sql = \"SELECT * FROM \".TABLE_CONFIG; \n return $framework->dbProcessor($sql, 1)[0];\n}", "public function loadConfig(){\n\t\t$kat=opendir($this->configpath);\n\t\twhile($nazwa= readdir($kat)){\n \t\tif(substr($nazwa,-3)=='cfg'){\n \t\t$plik=file($this->configpath.$nazwa); \n \t\t$ile=count($plik);\n \n \t\tfor($i=0;$i<$ile;$i++){\n \t\t \t$tab=explode(\"=\",$plik[$i]);\n \t\t \tif($tab[0]!='')\n \t\t\t$this->config[trim($tab[0])]= strtoupper(trim($tab[1]));\n\n \t\t }\n \t}\n \t}\n\t\tclosedir($kat);\n\t}", "public function getFileDescription();", "function get_content() {\n $info= explode(\"\\n\", file_get_contents(\"/home/hayddqta/softeng05_config/db_config.txt\"));\n $res = array(\n \"name\" => $info[0],\n \"password\" => $info[1],\n \"database\" => $info[2],\n \"address\" => $info[3]\n );\n\n return $res;\n}", "function forena_data_settings() {\n $repos = Frx::RepoMan()->repositories;\n $r_list = array();\n $headers = array(t('Name'), t('Description'), t('Path'), t('Operation'));\n foreach ($repos as $name => $r) {\n $r_list[] = array(\n $name,\n $r['title'],\n $r['path'],\n l(t('configure'), 'admin/config/content/forena/data/configure/' . $name)\n );\n\n }\n\n $output = '<ul class=\"action-links\"><li>' . l(t('Add data source'), 'admin/config/content/forena/data/add') . '</li></ul>';\n $output .= theme_table(array('header' => $headers, 'rows' => $r_list, 'attributes' => array(), 'caption' => '', 'sticky' => TRUE, 'colgroups' => array(), 'empty' => ''));\n return $output;\n}", "public static function getConfigFile(){\n return self::getRootPath().'/config.ini';\n }", "function load_config(){\n\t\tif(!$this->exist($this->file_name)){\n\t\t\t$converted=file_get_contents($this->file_path);\n\t\t\t$func=$this->demons[$this->format][\"decode\"];\n\t\t\t$this->data[$this->file_name]= $func($converted);\n\t\t}\n\t\treturn $this->data[$this->file_name];\n\t}", "function display_config_misc() {\n global $ext, $g_message, $title, $s_dirurl, $s_maxopts, $s_blength, \n $s_iplog, $s_refer, $s_polllist, $s_resultnums, $s_showtotal, $s_cookielog,\n $s_lang, $symphome, $s_lang_dir;\n\n if(!verify_access(0)) {\n $g_message = \"error: you are not the super user!\";\n return;\n }\n\n /* get the available language packs */\n $ind = 0;\n $larr = array();\n $addc = 0;\n if($dp = opendir(\"$symphome/$s_lang_dir/\")) {\n while($fp = readdir($dp)){\n /* this next line does: file_name --> language_name */\n $ln = substr($fp, 0, strrpos($fp, '.'));\n if($ln == $s_lang && strtolower($ln) == \"custom\") {\n $c = $ln;\n $addc = 2;\n } else if(strtolower($ln) == \"custom\") {\n $c = $ln;\n $addc = 1;\n } else if($ln == $s_lang) {\n $larr[$ind++] = \"<option value=\\\"$ln\\\" selected=\\\"selected\\\">\".ucfirst(strtolower($ln)).\"</option>\";\n } else if(\"$ln.$ext\" == \"$fp\") {\n $larr[$ind++] = \"<option value=\\\"$ln\\\">\".ucfirst(strtolower($ln)).\"</option>\";\n }\n }\n closedir($dp);\n sort($larr);\n if($addc == 1) {\n $larr[$ind++] = \"<option value=\\\"$c\\\">&lt;custom&gt;</option>\";\n } else if($addc == 2) {\n $larr[$ind++] = \"<option selected=\\\"selected\\\" value=\\\"$c\\\">&lt;custom&gt;</option>\";\n }\n }\n\n $odirurl = htmlspecialchars($s_dirurl);\n $omaxopts = htmlspecialchars($s_maxopts);\n $oblen = htmlspecialchars($s_blength);\n\n $title = \"configure miscellany\";\n spit_header(); ?>\n\n <form action=\"index.<?php echo $ext; ?>\" method=\"post\">\n <input type=\"hidden\" name=\"action\" value=\"config_p_misc\" />\n <table border=\"0\" cellspacing=\"0\" align=\"center\" width=\"95%\">\n <tr><td><font size=\"2\" face=\"Verdana, Geneva\">\n\n Full URL to Sympoll directory:<br />&nbsp;&nbsp;\n <input type=\"text\" maxlength=\"80\" size=\"40\" name=\"ndirurl\" value=\"<?php echo $odirurl; ?>\" />\n <br />Max options allowed in a poll:<br />&nbsp;&nbsp;\n <input type=\"text\" maxlength=\"2\" size=\"10\" name=\"nmaxopts\" value=\"<?php echo $omaxopts; ?>\" />\n <br />Multiple votes blocked for: \n <font size=\"1\">(affects cookies <b>and</b> ip logging)</font><br />&nbsp;&nbsp;\n <input type=\"text\" maxlength=\"4\" size=\"10\" name=\"nblen\" value=\"<?php echo $oblen; ?>\" />days\n\n <br />Language File:<br />&nbsp;&nbsp;\n <select name=\"nlang\">\n <?php while(list($k,$v) = each($larr)) {\n echo \"${v}\\n\";\n } ?>\n </select>\n\n <br />Log IP address to block multiple votes?<br />&nbsp;&nbsp;\n <select name=\"niplog\">\n <?php if($s_iplog == \"0\") { ?>\n <option selected=\"selected\" value=\"0\">No</option>\n <option value=\"1\">Yes</option>\n <?php } else { ?>\n <option value=\"0\">No</option>\n <option selected=\"selected\" value=\"1\">Yes</option>\n <?php } ?>\n </select>\n\n <br />Set cookie to block multiple votes?<br />&nbsp;&nbsp;\n <select name=\"ncookielog\">\n <?php if($s_cookielog == \"0\") { ?>\n <option selected=\"selected\" value=\"0\">No</option>\n <option value=\"1\">Yes</option>\n <?php } else { ?>\n <option value=\"0\">No</option>\n <option selected=\"selected\" value=\"1\">Yes</option>\n <?php } ?>\n </select>\n\n <br />Display referral link in poll list?<br />&nbsp;&nbsp;\n <select name=\"nrefer\">\n <?php if($s_refer == \"\" || $s_refer == \"0\") { ?>\n <option selected=\"selected\" value=\"0\">No</option>\n <option value=\"1\">Yes</option>\n <?php } else { ?>\n <option value=\"0\">No</option>\n <option selected=\"selected\" value=\"1\">Yes</option>\n <?php } ?>\n </select>\n\n <br />Display 'More Polls' link in booth?<br />&nbsp;&nbsp;\n <select name=\"nplist\">\n <?php if($s_polllist == \"0\") { ?>\n <option selected=\"selected\" value=\"0\">No</option>\n <option value=\"1\">Yes</option>\n <?php } else { ?>\n <option value=\"0\">No</option>\n <option selected=\"selected\" value=\"1\">Yes</option>\n <?php } ?>\n </select>\n\n <br />Display total vote count in results?<br />&nbsp;&nbsp;\n <select name=\"nstotal\">\n <?php if($s_showtotal == \"0\") { ?>\n <option selected=\"selected\" value=\"0\">No</option>\n <option value=\"1\">Yes</option>\n <?php } else { ?>\n <option value=\"0\">No</option>\n <option selected=\"selected\" value=\"1\">Yes</option>\n <?php } ?>\n </select>\n\n <br />Display Results As:<br />&nbsp;&nbsp;\n <select name=\"nrnums\">\n <?php if($s_resultnums == \"0\") { ?>\n <option selected=\"selected\" value=\"0\">Percentages</option>\n <option value=\"1\">Vote Count</option>\n <?php } else { ?>\n <option value=\"0\">Percentages</option>\n <option selected=\"selected\" value=\"1\">Vote Count</option>\n <?php } ?>\n </select>\n \n <br /><br /><br /><input type=\"submit\" value=\"Process Changes\" /> &nbsp;\n <input type=\"reset\" value=\"Undo Changes\" /></font></td></tr></table></form>\n <?php spit_footer();\n}", "public function databaseConfig()\n {\n return [\n ADMINLTETEMPLATE_PATH.'/config/database.php' => config_path('database.php'),\n ];\n }", "function gatherModuleConfigurationFiles($MySQL, $MAC)\n{\n\t$ConfigTable = \"tbl_mconfig\";\n\t\n\t$Query = \"\tSELECT type, file, content \n\t\t\t\tFROM $ConfigTable \n\t\t\t\tWHERE MAC='$MAC';\";\n\t$result = $MySQL->query($Query);\n\t\n\tif ($result->num_rows > 0) \n\t{\n\t\twhile($row = $result->fetch_assoc()) \n\t\t{\n\t\t\t$Configs[] = $row;\n\t\t}\n\t\t\n\t\treturn $Configs;\n\t}\n\telse \n\t{\n\t\techo $MySQL->error;\n\t}\n}", "function fileData($file) \n{\n\tglobal $smf_important, $txt, $settings, $scripturl;\n\n\t$fullpath = realpath($file);\n\n\t$data = array(\n\t\t'data' => pathinfo($fullpath),\n\t\t'lastmodified' => timeformat(filemtime($fullpath)),\n\t\t'filesize' => bytesHR(filesize($fullpath)),\n\t\t'filepermissions' => substr(sprintf('%o', fileperms($fullpath)), -3),\t\t\n\t\t'remove' => !in_array(basename($fullpath),$smf_important) ? '<a href=\"' . $scripturl . '?action=admin;area=filemanager;do=remove;file=' . urlEncode($fullpath) . '\" title=\"' . $txt['fm_remove'] . '\"><img src=\"' . $settings['default_images_url'] . '/filemanager/remove.png\" alt=\"' . $txt['fm_remove'] . '\" /></a>' : '',\n\t\t'edit' => '<a href=\"' . $scripturl . '?action=admin;area=filemanager;do=editfile;file=' . urlEncode($fullpath) . '\" title=\"' . $txt['fm_edit'] . '\"><img src=\"' . $settings['default_images_url'] . '/filemanager/edit.png\" alt=\"' . $txt['fm_edit'] . '\" /></a>',\t\t\n\t\t'rename' => !in_array(basename($fullpath),$smf_important) ? '<a href=\"' . $scripturl . '?action=admin;area=filemanager;do=rename;file=' . urlEncode($fullpath) . '\" title=\"' . $txt['fm_rename'] . '\"><img src=\"' . $settings['default_images_url'] . '/filemanager/rename.png\" alt=\"' . $txt['fm_rename'] . '\" /></a>' : '',\n\t\t'view' => '<a href=\"' . $scripturl . '?action=admin;area=filemanager;do=viewfile;file=' . urlEncode($fullpath) . '\" title=\"' . $txt['fm_view'] . '\"><img src=\"' . $settings['default_images_url'] . '/filemanager/view.png\" alt=\"' . $txt['fm_view'] . '\" /></a>',\t\n\t\t'chmod' => '<a href=\"' . $scripturl . '?action=admin;area=filemanager;do=chmod;file=' . urlEncode($fullpath) . '\" title=\"' . $txt['fm_chmod'] . '\"><img src=\"' . $settings['default_images_url'] . '/filemanager/chmod.png\" alt=\"' . $txt['fm_chmod'] . '\" /></a>',\t\t\t\t\t\t\n\t\t'download' => '<a href=\"' . $scripturl . '?action=admin;area=filemanager;do=download;file=' . urlEncode($fullpath) . '\" title=\"' . $txt['fm_download'] . '\"><img src=\"' . $settings['default_images_url'] . '/filemanager/download.png\" alt=\"' . $txt['fm_download'] . '\" /></a>',\n\t\t);\n\n\treturn $data;\n}", "function display_block_options($file, $is_dummy_displayed = 0)\n{\n\t$results = parse_ini_file($file);\n\t$is_first = true;\n\n\t//echo \"<table>\";\n\tif ($is_dummy_displayed) {\n\t\t\t$is_first = false;\n\t\t\t//echo \"<option value=\\\"\\\" selected=\\\"selected\\\">None</option>\";\n\t\t\techo \"<option selected disabled hidden value=''></option>\";\n\t}\n\n\tforeach ($results as $row => $val) {\n\t\techo \"\\n\";\n\t\tif ($is_first) {\n\t\t\techo \"<option value=\\\"\".$val.\"\\\" selected=\\\"selected\\\">\".$row.\"</option>\";\n\t\t\t$is_first = false;\n\t\t} else {\n\t\t\techo \"<option value=\\\"\".$val.\"\\\">\".$row.\"</option>\";\n\t\t}\n\t}\n\t//echo \"</table>\";\n}", "function pageConfig ($VAR, $db) { \n\t$sql_file_config = \"SELECT * FROM mod_page_config WHERE mod_page_config_Var='$VAR'\";\n $result_file_config = $db->sql_query($sql_file_config);\n $row_file_config_num = $db->sql_numrows($result_file_config); \n if ($row_file_config_num != 0) {\n $row_file_config = $db->sql_fetchrow($result_file_config);\n return $row_file_config['mod_page_config_Val']; \n } else {\n return false;\n }\n}", "public function getConfigurationFilename();", "function projectDesc() {\n\tinclude \"config.inc.php\";\n\n\tif (isset($conf['desc']) && $conf['desc'] != \"\") {\n\t\t$return = $conf['desc'];\n\t}\n\telse {\n\t\t$return = \"Share files for a limited time.\";\n\t}\n\treturn $return;\n}", "public function getConfFile()\n {\n return $this->config_file;\n }", "private function _getFormConfig(){\t\t\n\t\t$html = '';\n\t\t \n\t $formats = ImageType::getImagesTypes( 'products' );\n\t $themes=$this->getFolderList( dirname(__FILE__).\"/tmpl/\" );\n $groups=$this->getFolderList( dirname(__FILE__).\"/libs/groups/\" );\n\n\t ob_start();\n\t include_once dirname(__FILE__).'/config/lofnewproduct.php'; \n\t $html .= ob_get_contents();\n\t ob_end_clean(); \n\t\treturn $html;\n\t}" ]
[ "0.61844116", "0.61623055", "0.61227506", "0.61079746", "0.60321844", "0.6020187", "0.598629", "0.59143573", "0.58597726", "0.57570916", "0.57438713", "0.5710877", "0.5644704", "0.5627158", "0.5622096", "0.5622085", "0.56013435", "0.5600666", "0.5596735", "0.5572418", "0.55697966", "0.55251366", "0.5514594", "0.55142623", "0.5509458", "0.54864264", "0.5466548", "0.54579806", "0.54558325", "0.545495" ]
0.6715383
0
Indicates if the ETL should skip this row.
public function shouldSkip(): bool;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function skip(): bool\n {\n return false === $this->check;\n }", "protected function skip()\n {\n if (!$this->hasSetting('skip')) {\n return false;\n }\n\n if (in_array($this->file->getFileName(), $this->getSetting('skip'))) {\n return true;\n }\n\n return false;\n }", "public function skipped():Bool {\n\n\t\treturn $this->numTests === $this->numSkipped;\n\n\t}", "public function getSkip()\n {\n return $this->skip;\n }", "public function canSkip();", "protected function skip() {\n return file_exists($this->file);\n }", "private function skip() {\n\t\treturn !$this->extensionLoaded;\n\t}", "public function getSkip()\n {\n return $this->get(self::SKIP);\n }", "public function getSkip(): int { return $this->skip; }", "public function getSkip();", "public function getSkip();", "public function skip()\n\t{\n\t\treturn call_user_func_array([$this, 'markTestSkipped'], func_get_args());\n\t}", "public function getIsSkippable()\n {\n return isset($this->is_skippable) ? $this->is_skippable : false;\n }", "public function runSkip()\n {\n /*\n * Save the temporary source code (from --SKIPIF-- section)\n * to a local file.\n */\n if (isset($this->parsedTestFile->fileSection['SKIPIF']) && !empty($this->parsedTestFile->fileSection['SKIPIF'])) {\n $isSaved = $this->saveTestFile($this->tempTestFiles['test_skipif'],\n $this->parsedTestFile->fileSection['SKIPIF'],\n $this->tempTestFiles['temp_skipif']);\n if ($isSaved) {\n $commands = $this->getCommand($this->tempTestFiles['test_skipif']);\n $actualOutput = $this->executeTest($commands);\n\n if (preg_match('/skip/i', $actualOutput)) {\n return true;\n }\n }\n }\n return false;\n }", "public function getSkipped(): int\n {\n return $this->skipped;\n }", "public function skip($value)\n {\n return $this->skip = $value;\n }", "public function skip(): void;", "public function skip($skip);", "public function getSkip()\n\t{\n\t return $this->numberToSkip;\n\t}", "public function setSkip($value)\n {\n return $this->set(self::SKIP, $value);\n }", "public function getSkipCount()\n {\n return $this->countSkip;\n }", "protected function isSkippableScreen()\n {\n // $isSkippableMenu = $this->ussdEvent->getInstantUssd()\n // ->getSkippableUssdMenuMapper()\n // ->isSkippable(['col_1' => $col1Val,\n // 'col_2' => $col2Val, 'col_n' => $colNVal], $tableToCheck);\n // if ($isSkippableMenu === true) {\n // $this->setAlternativeScreen($alternativeScreenName, $isResetToPreviousPosition);\n // return $isSkippableMenu;\n // }\n // return false;\n return (bool)$this->ussdEvent->getParam('is_skippable', false);\n }", "public function isSkipTldCheck(): bool\n {\n return $this->skipTldCheck;\n }", "protected function shouldSkipCart() {\n return isset($this->entity->purchased_entity->entity->product_id->entity->type->entity)\n ? $this->entity->purchased_entity->entity->product_id->entity->type->entity->getThirdPartySetting('apigee_m10n_add_credit', 'apigee_m10n_enable_skip_cart', FALSE)\n : FALSE;\n }", "public function getSkips()\n {\n return $this->skips;\n }", "private function shouldBeSkipped(Node $node): bool\n {\n if ($node instanceof NameNode && $node->attributes['name'] !== 'context') {\n return false;\n }\n foreach ($node->nodes as $childNode) {\n if (!$this->shouldBeSkipped($childNode)) {\n return false;\n }\n }\n\n return true;\n }", "public function excluded()\n {\n return $this->_type === 'exclude';\n }", "public function Skip($skip)\n {\n }", "public function canSkipOrderReviewStep()\n {\n return false;\n }", "public function testSkipCheck() {\n foreach ($this->checks as $check) {\n $check->skip();\n\n $is_skipped = $check->isSkipped();\n $skipped_by = $check->skippedBy();\n\n $this->assertTrue($is_skipped, $check->getTitle() . ' skipped.');\n $this->assertEqual($this->user->id(), $skipped_by->id(), 'Skipped by ' . $skipped_by->label());\n }\n }" ]
[ "0.7229448", "0.69388074", "0.67948055", "0.6678758", "0.66333", "0.66052413", "0.6601119", "0.653777", "0.6507278", "0.6505293", "0.6505293", "0.6451505", "0.6228875", "0.61835027", "0.60437334", "0.59021777", "0.5897036", "0.58809745", "0.58500016", "0.5827677", "0.5813246", "0.58045816", "0.5777402", "0.5776567", "0.57532454", "0.5735437", "0.57298285", "0.565428", "0.5646538", "0.561945" ]
0.704617
1
Indicates if the ETL should flush.
public function shouldFlush(): bool;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function flush()\n\t{\n\t\treturn false;\n\t}", "protected function preFlush(): bool\n {\n return true;\n }", "public function flush(): bool;", "public function flushOnComplete()\n {\n return false;\n }", "public function isFlush(): Bool\n {\n return count(reset($this->suitHistogram)) >= 5;\n }", "abstract public function flush(): bool;", "public static function flush(): bool {\n return (bool) self::$current->flush();\n }", "public static function isAutoFlush(){\n return self::$AutoFlush;\n }", "protected function doFlush()\n\t{\n\t\t$this->store()->flush();\n\n\t\treturn true;\n\t}", "public function flush(): bool {\n return $this->_memcached->flush();\n }", "protected function clearEntityManagerOnFlush(): bool\n {\n return true;\n }", "public function isWriteDone()\n {\n return $this->writeDone;\n }", "public function dataSyncShouldBeLogged() {\n return !property_exists($this, 'dataSyncLoggingDisabled') || $this->dataSyncLoggingDisabled === false;\n }", "public function getForceFlush()\n {\n return $this->_forceFlush;\n }", "public function flush()\n\t{\n\t\tif (!empty($this->buffer))\n\t\t{\n\t\t\t$this->db->sql_multi_insert($this->table_name, $this->buffer);\n\t\t\t$this->buffer = array();\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public static function manualFlush(){\n self::$AutoFlush = false;\n }", "public function write()\n {\n return false;\n }", "function flush () {}", "public function isFlushInProgress(EntityManager $em): bool\n {\n $hash = $this->getHash($em);\n\n return $this->flushInProgressByHash[$hash] ?? false;\n }", "public function writable() {\n return $this->orders->getSize() != 0;\n }", "public function shouldDoFullBake()\r\n {\r\n return $this->shouldDoFullBake;\r\n }", "public abstract function flush();", "public function send(): bool\n {\n // Is the Agent enabled ?\n if ($this->config->get('active') === false) {\n return false;\n }\n\n $connector = new Connector($this->config);\n $status = true;\n\n // Commit the Errors\n if ($this->errorsStore->isEmpty() === false) {\n $status = $status && $connector->sendErrors($this->errorsStore);\n }\n\n // Commit the Transactions\n if ($this->transactionsStore->isEmpty() === false) {\n $status = $status && $connector->sendTransactions($this->transactionsStore);\n }\n\n return $status;\n }", "function isCommitted()\r\n\t{\r\n\t\treturn $this->committed;\r\n\t}", "public function stream_flush()\n {\n try {\n $this->writeRemote();\n } catch (\\OpenStack\\Common\\Exception $e) {\n syslog(LOG_WARNING, $e);\n trigger_error('Error while flushing: ' . $e->getMessage(), E_USER_NOTICE);\n\n return false;\n }\n }", "abstract public function flush();", "abstract public function flush();", "public function flush(){}", "public function isRoyalFlush(): Bool\n {\n if ($this->isFlush()) {\n $flushCardValues = array_map(fn($card) => (int) $card->getValueRank(), reset($this->suitHistogram));\n $fiveCards = array_slice($flushCardValues, 0, 5);\n return $fiveCards === [14, 13, 12, 11, 10];\n }\n\n return false;\n }", "public function flush()\n\t{\n\t\treturn $this->_isConnected ? $this->_memcache->flush() : false;\n\t}" ]
[ "0.7091612", "0.6995946", "0.68249625", "0.6746979", "0.6663268", "0.66073287", "0.6521029", "0.6501362", "0.64021194", "0.61883146", "0.61756074", "0.6060598", "0.5970227", "0.59625435", "0.5899814", "0.58364624", "0.576355", "0.57624817", "0.5698883", "0.5653817", "0.563872", "0.5632279", "0.562877", "0.56135774", "0.56096435", "0.55860615", "0.55860615", "0.556511", "0.55622005", "0.5560418" ]
0.77511346
0
Register a navigation element based on a string identifier
function registerNavItem($id,$item){ $this->nav_items[$id] = $item; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function register_nav_menu_primary_zxc(){\n\n $location='header-primary-home';\n $description='Primary menu the Secand one';\n register_nav_menu( $location, $description );\n\n}", "function register_my_menu(){\n\tregister_nav_menu('navigation', __('Huvudnavigation'));\n}", "function register_nav_menu_zxc(){\n\n $location='header';\n $description='Primary menu En';\n register_nav_menu( $location, $description );\n\n}", "function register_navigation_menu() {\n\tregister_nav_menu('heading-menu', __('Heading Menu'));\n}", "public function register_element( $id ) {\n\t\t$this->registered_elements[] = $id;\n\t}", "public function registerNavigation()\n {\n $configuration = $this->getConfigurationFromYaml();\n if (array_key_exists('navigation', $configuration)) {\n $navigation = $configuration['navigation'];\n\n if (is_array($navigation)) {\n array_walk_recursive($navigation, function (&$item, $key) {\n if ($key === 'url') {\n $item = Backend::url($item);\n }\n });\n }\n\n return $navigation;\n }\n }", "function register_nav_menu_zxc(){\n\n $location='header-top-home';\n $description='Top menu';\n register_nav_menu( $location, $description );\n\n}", "function register_my_menu() {\n register_nav_menu('primarynav-menu',__( 'Primary Navigation Menu' ));\n}", "function register_my_menu() {\r\n register_nav_menu( 'header', 'Header Menu' );\r\n}", "function register_my_menu() {\n register_nav_menu('nav-menu', __( 'Navigation Menu' ));\n}", "function sunset_register_nav_menu()\n{\n register_nav_menu('primary', 'Header Navigation Menu');\n}", "function register_my_menu() {\n register_nav_menu('header-menu',__( 'Header Menu' ));\n}", "function registerNavItems($items){\n foreach($items as $var => $val) $this->nav_items[$var] = $val;\n }", "function register_my_menu() {\n register_nav_menu('header-menu',__( 'Header Menu' ));\n}", "function register_my_menu() {\n register_nav_menu('header-menu',__( 'Header Menu' ));\n}", "function register_my_menu() {\n\tregister_nav_menu('new-menu',__( 'New Menu' ));\n }", "function register_my_menu() {\nregister_nav_menu('header-menu',__( 'Header Menu' ));\n}", "public function addRegisterElement($element) {\n $this->registerElements[] = $element;\n }", "function school_register_nav_menu()\n{\n register_nav_menu('main', 'Main Top Menu');\n}", "public static function add(string $identification, string $routing);", "public function setNav ($name, $href);", "function sunset_register_nav_menu()\n{\n register_nav_menu( 'primary', 'Header Navigation Menu' );\n register_nav_menu( 'footer', 'Footer Navigation Menu' );\n}", "function jansen_register_nav_menu(){\n\tregister_nav_menu( 'primary' , 'Header Navigation Menu' );\n\tregister_nav_menu( 'footer-menu', 'Footer Menu' );\n}", "function register_custom_menu() { register_nav_menu('navigation', __('Navigation', 'minimal-wp')); }", "function customify_change_nav_menu_item_id( $string_id, $item, $args ) {\n\tif ( 'menu-1' == $args->theme_location || 'menu-2' == $args->theme_location ) {\n\t\t$string_id = 'menu-item--__id__-__device__-' . $item->ID;\n\t}\n\n\treturn $string_id;\n}", "function register_rnf_nav_menu() {\n\tregister_nav_menu(\"rnf-navigation-menu\", __(\"RNF Navigation Menu\"));\n}", "function register_my_menu() {\n register_nav_menu('header-menu',__( 'Header Menu' ));\n register_nav_menu('footer-menu',__( 'Footer Menu' ));\n\n}", "function register_my_menu() {\n register_nav_menu('custom-menu',__( 'Custom Menu' ));\n}", "public function register_menu()\r\n {\r\n global $wiloke;\r\n\r\n add_theme_page( $wiloke->aConfigs['themeoptions']['menu_name'], $wiloke->aConfigs['themeoptions']['menu_name'], 'edit_theme_options', $wiloke->aConfigs['themeoptions']['menu_slug'], array($this, 'render') );\r\n }", "function followandrew_menus(){\n $locations = array(\n 'primary' => \"Desktop Primary Left Sidebar\",\n 'footer' => \"Footer Menu Items\"\n );\n\n register_nav_menus($locations);\n\n}" ]
[ "0.57598436", "0.5571055", "0.5535992", "0.5526072", "0.55157167", "0.5492671", "0.5443714", "0.5374045", "0.53622854", "0.5361061", "0.531708", "0.52984506", "0.52972066", "0.52971625", "0.52971625", "0.5241709", "0.5188768", "0.5186141", "0.5160198", "0.51433897", "0.5128462", "0.5110033", "0.51053977", "0.51003456", "0.50990057", "0.5065304", "0.50620514", "0.5036493", "0.50332415", "0.5013585" ]
0.6400089
0
Register an array of navigation items to the layout
function registerNavItems($items){ foreach($items as $var => $val) $this->nav_items[$var] = $val; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function navigationItems()\n {\n $config = $this->app['config']->get('motor-backend-navigation', []);\n $this->app['config']->set('motor-backend-navigation', array_replace_recursive(require __DIR__.'/../../config/motor-backend-navigation.php', $config));\n }", "public function registerNavigation()\n {\n return [\n 'parallax' => [\n 'label' => 'Parallax',\n 'url' => Backend::url('freestream/parallax/parallaxes'),\n 'icon' => 'icon-th-large',\n 'permissions' => ['freestream.parallax.*'],\n 'sideMenu' => [\n 'parallax' => [\n 'label' => 'Parallax',\n 'icon' => 'icon-th-large',\n 'url' => Backend::url('freestream/parallax/parallaxes'),\n ],\n ]\n ]\n ];\n }", "public function registerNavigation()\n {\n // return []; // Remove this line to activate\n\n return [\n 'service' => [\n 'label' => 'Услуги',\n 'url' => Backend::url('icefox/service/items'),\n 'icon' => 'icon-leaf',\n 'permissions' => ['icefox.service.*'],\n 'order' => 500,\n 'sideMenu' => [\n 'items' => [\n 'label' => 'Услуги',\n 'url' => Backend::url('icefox/service/items'),\n 'icon' => 'icon-leaf',\n 'permissions' => ['icefox.service.*'],\n 'order' => 500,\n ],\n 'categories' => [\n 'label' => 'Категории',\n 'url' => Backend::url('icefox/service/categories'),\n 'icon' => 'icon-leaf',\n 'permissions' => ['icefox.service.*'],\n 'order' => 500,\n ],\n ]\n ],\n ];\n }", "public function registerNavigation()\n {\n return [\n 'paypal' => [\n 'label' => 'PayPal',\n 'url' => Backend::url('creations/paypal/payments'),\n 'icon' => 'icon-paypal',\n 'permissions' => ['creations.paypal.*'],\n 'order' => 500,\n 'sideMenu' => [\n 'payments' => [\n 'label' => 'Payments',\n 'icon' => 'icon-credit-card',\n 'url' => Backend::url('creations/paypal/payments'),\n 'permissions' => ['creations.paypal.*'],\n ],\n 'plans' => [\n 'label' => 'Plans',\n 'icon' => 'icon-file-text',\n 'url' => Backend::url('creations/paypal/plans'),\n 'permissions' => ['creations.paypal.*'],\n ],\n ],\n ],\n ];\n }", "public function registerNavigation() {\n #return []; // Remove this line to activate\n\n return [\n 'system' => [\n 'label' => 'Wealth-On',\n 'url' => Backend::url('wealthon/system/package'),\n 'icon' => 'icon-briefcase',\n 'permissions' => ['wealthon.system.*'],\n 'order' => 500,\n 'sideMenu' => [\n 'package' => [\n 'label' => 'Packages',\n 'icon' => 'icon-shopping-bag',\n 'url' => Backend::url('wealthon/system/package'),\n 'permissions' => ['wealthon.system.*']\n ],\n 'commission_plan' => [\n 'label' => 'Plans',\n 'icon' => 'icon-percent',\n 'url' => Backend::url('wealthon/system/commissionplan'),\n 'permissions' => ['wealthon.system.*']\n ],\n 'generation' => [\n 'label' => 'Generations',\n 'icon' => 'icon-sitemap',\n 'url' => Backend::url('wealthon/system/generation'),\n 'permissions' => ['wealthon.system.*']\n ],\n 'store_type' => [\n 'label' => 'Store Types',\n 'icon' => 'icon-cart-plus',\n 'url' => Backend::url('wealthon/system/storetype'),\n 'permissions' => ['wealthon.system.*']\n ],\n 'commission_type' => [\n 'label' => 'Commission Types',\n 'icon' => 'icon-briefcase',\n 'url' => Backend::url('wealthon/system/commissiontype'),\n 'permissions' => ['wealthon.system.*']\n ],\n ]\n ]\n ];\n }", "public function registerNavigation()\n {\n return []; // Remove this line to activate\n\n return [\n 'menu' => [\n 'label' => 'Menu',\n 'url' => Backend::url('salvoterra/menu/mycontroller'),\n 'icon' => 'icon-leaf',\n 'permissions' => ['salvoterra.menu.*'],\n 'order' => 500,\n ],\n ];\n }", "public function registerNavigation()\n {\n return [\n 'users' => [\n 'label' => 'keerill.users::lang.users.label',\n 'url' => Backend::url('keerill/users/users'),\n 'icon' => 'icon-user',\n 'permissions' => ['keerill.users.*'],\n 'order' => 234,\n 'sideMenu' => [\n 'users' => [\n 'label' => 'keerill.users::lang.users.sideMenu',\n 'icon' => 'icon-user',\n 'url' => Backend::url('keerill/users/users'),\n 'permissions' => ['keerill.users.access_users']\n ],\n 'groups' => [\n 'label' => 'keerill.users::lang.groups.sideMenu',\n 'icon' => 'icon-users',\n 'url' => Backend::url('keerill/users/groups'),\n 'permissions' => ['keerill.users.access_groups']\n ]\n ] \n ]\n ];\n }", "public function registerNavigation()\n {\n return []; // Remove this line to activate\n\n return [\n 'pagebuilder' => [\n 'label' => 'PageBuilder',\n 'url' => Backend::url('mercator/pagebuilder/mycontroller'),\n 'icon' => 'icon-leaf',\n 'permissions' => ['mercator.pagebuilder.*'],\n 'order' => 500,\n ],\n ];\n }", "public function registerNavigation()\n {\n return [\n 'jssor' => [\n 'label' => 'jssor',\n 'url' => Backend::url('zoomyboy/jssor/jssor'),\n 'icon' => 'icon-file-image-o',\n 'permissions' => ['zoomyboy.jssor.*'],\n 'order' => 500,\n ],\n ];\n }", "public function registerNavigation()\n {\n return [\n 'smartjob' => [\n 'label' => 'adil.smartjob::lang.plugin.name',\n 'url' => Backend::url('adil/smartjob/jobs'),\n 'icon' => 'icon-briefcase',\n 'permissions' => ['adil.smartjob.*'],\n 'order' => 500,\n 'sideMenu' => [\n\n 'jobs' => [\n 'label' => 'Vacancies',\n 'icon' => 'icon-briefcase',\n 'url' => Backend::url('adil/smartjob/jobs'),\n 'permissions' => ['adil.smartjob.access_jobs']\n ],\n 'rosterroles' =>[\n 'label' => 'adil.smartjob::lang.roster_roles.roles',\n 'icon' => 'icon-list-ul',\n 'url' => Backend::url('adil/smartjob/rosterroles'),\n // 'permissions' => ['adil.smartjob.access_roles']\n ],\n 'departments' => [\n 'label' => 'Departments',\n 'icon' => 'icon-list-ol',\n 'url' => Backend::url('adil/smartjob/departments'),\n 'permissions' => ['adil.smartjob.access_departments']\n ],\n ], \n ],\n \n ];\n }", "public function registerNavigation()\n {\n return [\n 'futuremail' => [\n 'label' => 'Email Templates',\n 'url' => Backend::url('nilborodulya/futuremail/emailtemplates'),\n 'icon' => 'icon-leaf',\n 'permissions' => ['nilborodulya.futuremail.*'],\n 'order' => 500,\n ],\n ];\n }", "public function registerNavigation()\n {\n return [\n 'statefull' => [\n 'label' => 'Statefull Website',\n 'url' => \\Backend::url('ebussola/statefull/urldynamics'),\n 'icon' => 'icon-rocket',\n 'permissions' => ['ebussola.statefull.*'],\n 'order' => 500,\n\n 'sideMenu' => [\n 'urldynamics' => [\n 'label' => 'Dynamics URL',\n 'icon' => 'icon-code',\n 'url' => \\Backend::url('ebussola/statefull/urldynamics'),\n 'permissions' => ['ebussola.statefull.*']\n ],\n 'urlblacklist' => [\n 'label' => 'URL Blacklist',\n 'icon' => 'icon-minus-circle',\n 'url' => \\Backend::url('ebussola/statefull/urlblacklist'),\n 'permissions' => ['ebussola.statefull.*']\n ],\n 'getparamblacklist' => [\n 'label' => 'Get Param Blacklist',\n 'icon' => 'icon-minus-circle',\n 'url' => \\Backend::url('ebussola/statefull/getparamblacklist'),\n 'permissions' => ['ebussola.statefull.*']\n ],\n 'urlpurge' => [\n 'label' => 'URL Purge',\n 'icon' => 'icon-trash',\n 'url' => \\Backend::url('ebussola/statefull/urldynamics/purge'),\n 'permissions' => ['ebussola.statefull.*']\n ]\n ]\n ]\n ];\n }", "public function registerNavigation()\n {\n return [\n 'gallery' => [\n 'label' => 'Gallery',\n 'url' => Backend::url('increative/gallery/galleries'),\n 'icon' => 'icon-picture-o',\n 'permissions' => ['increative.gallery.manage'],\n 'order' => 500,\n ],\n ];\n }", "public function registerNavigation(): array\n {\n return [\n 'sentmails' => [\n 'label' => __('gromit.sentmails::lang.menu_label'),\n 'url' => Backend::url('gromit/sentmails/mails'),\n 'icon' => 'icon-envelope-open',\n 'permissions' => ['gromit.sentmails.*'],\n 'order' => 500,\n ],\n ];\n }", "public function registerNavigation()\n {\n return []; // Remove this line to activate\n\n return [\n 'vuetranslator' => [\n 'label' => 'VueTranslator',\n 'url' => Backend::url('defr/vuetranslator/mycontroller'),\n 'icon' => 'icon-leaf',\n 'permissions' => ['defr.vuetranslator.*'],\n 'order' => 500,\n ],\n ];\n }", "private static function navMenus(){\n register_nav_menus([\n 'main-nav' => 'Main Navigation Menu',\n 'policy-menu' => 'Footer Policy Menu',\n 'footer-nav' => 'Footer Nav Menu'\n ]);\n }", "public function registerNavigation()\n {\n return [\n 'faq' => [\n 'label' => 'istheweb.faq::lang.plugin.name',\n 'url' => Backend::url('istheweb/faq/questions'),\n 'icon' => 'icon-comments',\n 'permissions' => ['istheweb.faq.*'],\n\n 'sideMenu' => [\n 'questions' => [\n 'label' => 'istheweb.faq::lang.questions.menu_label',\n 'icon' => 'icon-question-circle',\n 'url' => Backend::url('istheweb/faq/questions'),\n 'permissions' => ['istheweb.faq.*']\n\n ],\n 'categories' => [\n 'label' => 'istheweb.faq::lang.categories.menu_label',\n 'icon' => 'icon-list-ul',\n 'url' => Backend::url('istheweb/faq/categories'),\n 'permissions' => ['istheweb.faq.*']\n ]\n ]\n ]\n ];\n }", "public function registerNavigation()\n {\n return [\n 'forms' => [\n 'label' => 'Формы',\n 'url' => Backend::url('intertech/forms/callbacks'),\n 'icon' => 'icon-pencil-square-o',\n 'permissions' => ['intertech.forms.*'],\n 'order' => 400,\n 'sideMenu' => [\n // 'callbacks' => [\n // 'label' => 'Обратный звонок',\n // 'url' => Backend::url('intertech/forms/callbacks'),\n // 'icon' => 'icon-phone',\n // 'permissions' => ['intertech.forms.*'],\n // 'order' => 100,\n // ],\n 'feedbacks' => [\n 'label' => 'Обратная связь',\n 'url' => Backend::url('intertech/forms/feedbacks'),\n 'icon' => 'icon-comments-o',\n 'permissions' => ['intertech.forms.*'],\n 'order' => 200,\n ],\n 'programfeedbacks' => [\n 'label' => 'Обратная связь программы',\n 'url' => Backend::url('intertech/forms/programfeedbacks'),\n 'icon' => 'icon-pencil',\n 'permissions' => ['intertech.forms.*'],\n 'order' => 300,\n ],\n 'teams' => [\n 'label' => 'Хочу в команду',\n 'url' => Backend::url('intertech/forms/teams'),\n 'icon' => 'icon-users',\n 'permissions' => ['intertech.forms.*'],\n 'order' => 400,\n ],\n 'askquestions' => [\n 'label' => 'Задать вопрос',\n 'url' => Backend::url('intertech/forms/askquestions'),\n 'icon' => 'icon-question-circle',\n 'permissions' => ['intertech.forms.*'],\n 'order' => 500,\n ],\n ],\n ],\n ];\n }", "public static function registerWtMenuForExtraLinks()\n {\n foreach (\\WTThemePlugin::$menu_items_to_be_registered as $menu_item) {\n register_nav_menu($menu_item['location'], __($menu_item['description'][0], $menu_item['description'][1]));\n }\n }", "public function registerNavigation()\n {\n return [\n 'contact' => [\n 'label' => 'Contact',\n 'url' => Backend::url('bedard/contact/messages'),\n 'icon' => 'icon-envelope-o',\n 'permissions' => ['bedard.contact.*'],\n 'order' => 600,\n 'sideMenu' => [\n 'messages' => [\n 'label' => 'bedard.contact::lang.messages.controller',\n 'icon' => 'icon-envelope-o',\n 'url' => Backend::url('bedard/contact/messages'),\n 'permissions' => ['bedard.contact.messages'],\n ],\n 'subjects' => [\n 'label' => 'bedard.contact::lang.subjects.controller',\n 'icon' => 'icon-folder-o',\n 'url' => Backend::url('bedard/contact/subjects'),\n 'permissions' => ['bedard.contact.subjects'],\n ],\n 'settings' => [\n 'label' => 'bedard.contact::lang.settings.controller',\n 'icon' => 'icon-cog',\n 'url' => Backend::url('system/settings/update/bedard/contact/settings'),\n 'permissions' => ['bedard.contact.settings'],\n ],\n ],\n ],\n ];\n }", "public function registerNavigation()\n\n {\n\n return []; // Remove this line to activate\n\n\n\n /*return [\n\n 'mail' => [\n\n 'label' => 'Mail',\n\n 'url' => Backend::url('wwrf/mail/mycontroller'),\n\n 'icon' => 'icon-envelope',\n\n 'permissions' => ['wwrf.mail.*'],\n\n 'order' => 500,\n\n ],\n\n ];*/\n\n }", "public function registerNavigation()\n {\n return [\n 'youtubegallery' => [\n 'label' => 'taema.youtubegallery::lang.plugin.navigation.label',\n 'url' => Backend::url('taema/youtubegallery/videos'),\n 'icon' => 'icon-youtube-play',\n 'permissions' => ['taema.youtubegallery.tab'],\n 'order' => 500,\n 'sideMenu' => [\n 'videos' => [\n 'label' => 'taema.youtubegallery::lang.plugin.navigation.sidemenu.videos.label',\n 'icon' => 'icon-video-camera',\n 'url' => Backend::url('taema/youtubegallery/videos'),\n 'permissions' => ['taema.youtubegallery.access_videos']\n ],\n 'playlists' => [\n 'label' => 'taema.youtubegallery::lang.plugin.navigation.sidemenu.playlists.label',\n 'icon' => 'icon-list',\n 'url' => Backend::url('taema/youtubegallery/playlists'),\n 'permissions' => ['taema.youtubegallery.access_playlists']\n ]\n ]\n ],\n ];\n }", "public function registerNavigation()\n {\n return [\n 'photography' => [\n 'label' => 'Photography',\n 'url' => Backend::url('bedard/photography/galleries'),\n 'icon' => 'icon-camera-retro',\n 'permissions' => ['bedard.photography.*'],\n 'order' => 500,\n 'sideMenu' => [\n 'orders' => [\n 'label' => 'bedard.photography::lang.orders.controller',\n 'icon' => 'icon-shopping-cart',\n 'url' => Backend::url('bedard/photography/orders'),\n 'permissions' => ['bedard.photography.access_orders'],\n ],\n 'galleries' => [\n 'label' => 'bedard.photography::lang.galleries.controller',\n 'icon' => 'icon-camera-retro',\n 'url' => Backend::url('bedard/photography/galleries'),\n 'permissions' => ['bedard.photography.access_galleries'],\n ],\n 'categories' => [\n 'label' => 'bedard.photography::lang.categories.controller',\n 'icon' => 'icon-folder-o',\n 'url' => Backend::url('bedard/photography/categories'),\n 'permissions' => ['bedard.photography.access_categories'],\n ],\n 'rates' => [\n 'label' => 'bedard.photography::lang.rates.controller',\n 'icon' => 'icon-dollar',\n 'url' => Backend::url('bedard/photography/rates'),\n 'permissions' => ['bedard.photography.access_rates'],\n ],\n 'watermarks' => [\n 'label' => 'bedard.photography::lang.watermarks.controller',\n 'icon' => 'icon-paint-brush',\n 'url' => Backend::url('bedard/photography/watermarks'),\n 'permissions' => ['bedard.photography.access_watermarks'],\n ],\n 'settings' => [\n 'label' => 'bedard.photography::lang.settings.controller',\n 'icon' => 'icon-cog',\n 'url' => Backend::url('system/settings/update/bedard/photography/settings'),\n 'permissions' => ['bedard.photography.settings'],\n ],\n ],\n ],\n ];\n }", "public function registerNavigation()\n {\n return []; // Remove this line to activate\n\n return [\n 'admin' => [\n 'label' => 'Admin',\n 'url' => Backend::url('web/admin/mycontroller'),\n 'icon' => 'icon-leaf',\n 'permissions' => ['web.admin.*'],\n 'order' => 500,\n ],\n ];\n }", "public function registerNavigation()\n {\n $configuration = $this->getConfigurationFromYaml();\n if (array_key_exists('navigation', $configuration)) {\n $navigation = $configuration['navigation'];\n\n if (is_array($navigation)) {\n array_walk_recursive($navigation, function (&$item, $key) {\n if ($key === 'url') {\n $item = Backend::url($item);\n }\n });\n }\n\n return $navigation;\n }\n }", "private function populate_navbar()\n\t{\n\t\t$this->navbar[] = array('href' => '/', 'title' => 'Accueil',\n\t\t\t\t\t\t\t\t\t\t \t\t\t'icon' => 'home');\n\n\t\t$this->navbar[] = array('href' => '#', 'title' => 'Compte client',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'icon' => 'user');\n\n\t\t$this->navbar[] = array('href' => '/colis', 'title' => 'Gestion colis',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'icon' => 'folder-close');\n\n\t\t$this->navbar[] = array('href' => '/stock', 'title' => 'Suivi du stock',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'icon' => 'folder-open');\n\n\t\t$this->navbar[] = array('href' => '#', 'title' => 'Facturation',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'icon' => 'euro');\n\n\t}", "protected function get_nav_items() {\n }", "public function registerNavigation()\n {\n return []; // Remove this line to activate\n\n return [\n 'profile' => [\n 'label' => 'Profile',\n 'url' => Backend::url('wang/profile/mycontroller'),\n 'icon' => 'icon-leaf',\n 'permissions' => ['wang.profile.*'],\n 'order' => 500,\n ],\n ];\n }", "public function registerNavigation()\n {\n \n \n return [\n 'erp' => [\n 'label' => 'Erp',\n 'url' => Backend::url('prestasafe/erp/invoice'),\n 'icon' => 'icon-cloud-upload',\n 'permissions' => ['prestasafe.erp.*'],\n 'order' => 500,\n 'sideMenu' => [\n // 'dashboard' => [\n // 'label' => 'Dashboard',\n // 'icon' => 'icon-tachometer',\n // 'url' => Backend::url('prestasafe/erp/Erp'),\n // 'permissions' => ['prestasafe.erp.*']\n // ],\n 'invoice' => [\n 'label' => trans('prestasafe.erp::lang.common.invoices'),\n 'icon' => 'icon-usd',\n 'url' => Backend::url('prestasafe/erp/invoice'),\n 'permissions' => ['prestasafe.erp.*']\n ],\n 'quotes' => [\n 'label' => trans('prestasafe.erp::lang.common.quotes'),\n 'icon' => 'icon-usd',\n 'url' => Backend::url('prestasafe/erp/quotes'),\n 'permissions' => ['prestasafe.erp.*']\n ],\n 'customers' => [\n 'label' => trans('prestasafe.erp::lang.common.customers'),\n 'icon' => 'icon-user',\n 'url' => Backend::url('prestasafe/erp/customers'),\n 'permissions' => ['prestasafe.erp.*']\n ],\n 'tax' => [\n 'label' => trans('prestasafe.erp::lang.common.taxes'),\n 'icon' => 'icon-usd',\n 'url' => Backend::url('prestasafe/erp/taxes'),\n 'permissions' => ['prestasafe.erp.*']\n ],\n 'currency' => [\n 'label' => trans('prestasafe.erp::lang.common.currencies'),\n 'icon' => 'icon-eur',\n 'url' => Backend::url('prestasafe/erp/currency'),\n 'permissions' => ['prestasafe.erp.*']\n ],\n 'paymenttype' =>[\n 'label' => trans('prestasafe.erp::lang.common.payment_type'),\n 'icon' => 'icon-eur',\n 'url' => Backend::url('prestasafe/erp/paymenttype'),\n 'permissions' => ['prestasafe.erp.*']\n ], \n 'settings' => [\n 'label' => trans('prestasafe.erp::lang.common.settings'),\n 'icon' => 'icon-gear',\n 'url' => Backend::url('system/settings/update/prestasafe/erp/settings'),\n 'permissions' => ['prestasafe.erp.*']\n ],\n 'invoicepayments' =>[\n 'label' => trans('prestasafe.erp::lang.common.invoicepayments'),\n 'icon' => 'icon-eur',\n 'url' => Backend::url('prestasafe/erp/invoicepayments'),\n 'permissions' => ['prestasafe.erp.*']\n ], \n \n ]\n ],\n ];\n }", "function followandrew_menus(){\n $locations = array(\n 'primary' => \"Desktop Primary Left Sidebar\",\n 'footer' => \"Footer Menu Items\"\n );\n\n register_nav_menus($locations);\n\n}" ]
[ "0.7441141", "0.6970658", "0.6891147", "0.6873943", "0.6868182", "0.68495727", "0.6841549", "0.68183887", "0.68127066", "0.6806725", "0.6796157", "0.6792196", "0.6789931", "0.67804384", "0.6717876", "0.6704848", "0.6687542", "0.6658994", "0.6624621", "0.6622882", "0.6619991", "0.6607725", "0.65705925", "0.655434", "0.654569", "0.6544751", "0.6542022", "0.65162504", "0.64619243", "0.64462674" ]
0.76819664
0
Get an array of the currently registered navigation elements
function getNavItems(){ return $this->nav_items; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function navigationArray()\n {\n return filterclass::$navigationArray;\n }", "public function navigate() : array\n {\n /*return [\n [\n 'uri' => '#',\n 'name' => 'Parent',\n 'trigger' => [ 'row' ],\n 'namespace' => 'Content\\Tool\\Navigate\\Row'\n ],\n [\n 'uri' => '#',\n 'name' => 'Row',\n 'trigger' => [ 'column' ],\n 'namespace' => 'Content\\Tool\\Navigate\\Column'\n ],\n [\n 'uri' => '#',\n 'name' => 'Column [prev]',\n 'trigger' => [ 'column' ],\n 'namespace' => 'Content\\Tool\\Navigate\\ColumnPrev'\n ],\n [\n 'uri' => '#',\n 'name' => 'Column [next]',\n 'trigger' => [ 'column' ],\n 'namespace' => 'Content\\Tool\\Navigate\\ColumnNext'\n ],\n [\n 'uri' => '#',\n 'name' => 'Content [prev]',\n 'trigger' => [ 'content' ],\n 'namespace' => 'Content\\Tool\\Navigate\\ContentPrev'\n ],\n [\n 'uri' => '#',\n 'name' => 'Content [next]',\n 'trigger' => [ 'content' ],\n 'namespace' => 'Content\\Tool\\Navigate\\ContentNext'\n ]\n ];*/\n\n return []; // deal with these tools later.\n }", "public function getNavContexts();", "public function getHTMLNavigations();", "public function registerNavigation(): array\n {\n return [\n 'sentmails' => [\n 'label' => __('gromit.sentmails::lang.menu_label'),\n 'url' => Backend::url('gromit/sentmails/mails'),\n 'icon' => 'icon-envelope-open',\n 'permissions' => ['gromit.sentmails.*'],\n 'order' => 500,\n ],\n ];\n }", "protected function get_nav_items() {\n }", "public function navigableIn();", "public function forumNavList(): array {\n return $this->info()['NavItems'];\n }", "public function registerNavigation()\n {\n return [\n 'users' => [\n 'label' => 'keerill.users::lang.users.label',\n 'url' => Backend::url('keerill/users/users'),\n 'icon' => 'icon-user',\n 'permissions' => ['keerill.users.*'],\n 'order' => 234,\n 'sideMenu' => [\n 'users' => [\n 'label' => 'keerill.users::lang.users.sideMenu',\n 'icon' => 'icon-user',\n 'url' => Backend::url('keerill/users/users'),\n 'permissions' => ['keerill.users.access_users']\n ],\n 'groups' => [\n 'label' => 'keerill.users::lang.groups.sideMenu',\n 'icon' => 'icon-users',\n 'url' => Backend::url('keerill/users/groups'),\n 'permissions' => ['keerill.users.access_groups']\n ]\n ] \n ]\n ];\n }", "protected function getNav()\n {\n \\Debugbar::startMeasure('NavigationService->getNav()');\n // get config\n $nav = Config::get('navigation');\n $lists = NULL;\n if(isset($nav['lists'][$this->active['section']])){\n $lists = $nav['lists'][$this->active['section']];\n }\n elseif(isset($nav['lists']['dashboard'])){\n $lists = $nav['lists']['dashboard'];\n }\n \\Debugbar::startMeasure('NavigationService->getHeader()');\n $header = $this->getHeader($nav['header']);\n \\Debugbar::stopMeasure('NavigationService->getHeader()');\n \\Debugbar::startMeasure('NavigationService->getList()');\n $lists = $this->getLists($lists);\n \\Debugbar::stopMeasure('NavigationService->getList()');\n // return array\n \\Debugbar::stopMeasure('NavigationService->getNav()');\n return [\n 'header' => $header,\n 'lists' => $lists,\n ];\n }", "public function getNavigation()\n {\n return $this->_navigation;\n }", "public function elements()\r\n\t{\r\n\t\treturn $this->page_elements;\r\n\t}", "public function toArray()\n\t{\n\t\tif(!$this->_container instanceof Zend_Navigation_Container)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\tif(!$active = $this->findActive($this->_container))\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$active = $active['page'];\n\t\t}\n\n\t\t$result = array();\n\t\t$result[] = $this->_createRow($active, 'current');\n\n\t\twhile($parent = $active->getParent())\n\t\t{\n\t\t\tif($parent instanceof Zend_Navigation_Page)\n\t\t\t{\n\t\t\t\t$result[] = $this->_createRow($parent, 'default');\n\t\t\t}\n\t\t\tif($parent === $this->_container)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$active = $parent;\n\t\t}\n\t\treturn array_reverse($result);\n\t}", "public function registerNavigation()\n {\n // return []; // Remove this line to activate\n\n return [\n 'service' => [\n 'label' => 'Услуги',\n 'url' => Backend::url('icefox/service/items'),\n 'icon' => 'icon-leaf',\n 'permissions' => ['icefox.service.*'],\n 'order' => 500,\n 'sideMenu' => [\n 'items' => [\n 'label' => 'Услуги',\n 'url' => Backend::url('icefox/service/items'),\n 'icon' => 'icon-leaf',\n 'permissions' => ['icefox.service.*'],\n 'order' => 500,\n ],\n 'categories' => [\n 'label' => 'Категории',\n 'url' => Backend::url('icefox/service/categories'),\n 'icon' => 'icon-leaf',\n 'permissions' => ['icefox.service.*'],\n 'order' => 500,\n ],\n ]\n ],\n ];\n }", "public function navigableParams(): array;", "public function registerNavigation()\n {\n return []; // Remove this line to activate\n\n return [\n 'pagebuilder' => [\n 'label' => 'PageBuilder',\n 'url' => Backend::url('mercator/pagebuilder/mycontroller'),\n 'icon' => 'icon-leaf',\n 'permissions' => ['mercator.pagebuilder.*'],\n 'order' => 500,\n ],\n ];\n }", "public function registerNavigation()\n {\n return []; // Remove this line to activate\n\n return [\n 'menu' => [\n 'label' => 'Menu',\n 'url' => Backend::url('salvoterra/menu/mycontroller'),\n 'icon' => 'icon-leaf',\n 'permissions' => ['salvoterra.menu.*'],\n 'order' => 500,\n ],\n ];\n }", "public function getNavigation() {\n\t\treturn false;\n\t}", "public function getNavLinks() {\n return [\"../index2/2\", \"../index2/3\", \"../index2/4\", \"../index2/5\"];\n }", "public function registerNavigation()\n {\n return []; // Remove this line to activate\n\n return [\n 'profile' => [\n 'label' => 'Profile',\n 'url' => Backend::url('wang/profile/mycontroller'),\n 'icon' => 'icon-leaf',\n 'permissions' => ['wang.profile.*'],\n 'order' => 500,\n ],\n ];\n }", "public function registerNavigation() {\n #return []; // Remove this line to activate\n\n return [\n 'system' => [\n 'label' => 'Wealth-On',\n 'url' => Backend::url('wealthon/system/package'),\n 'icon' => 'icon-briefcase',\n 'permissions' => ['wealthon.system.*'],\n 'order' => 500,\n 'sideMenu' => [\n 'package' => [\n 'label' => 'Packages',\n 'icon' => 'icon-shopping-bag',\n 'url' => Backend::url('wealthon/system/package'),\n 'permissions' => ['wealthon.system.*']\n ],\n 'commission_plan' => [\n 'label' => 'Plans',\n 'icon' => 'icon-percent',\n 'url' => Backend::url('wealthon/system/commissionplan'),\n 'permissions' => ['wealthon.system.*']\n ],\n 'generation' => [\n 'label' => 'Generations',\n 'icon' => 'icon-sitemap',\n 'url' => Backend::url('wealthon/system/generation'),\n 'permissions' => ['wealthon.system.*']\n ],\n 'store_type' => [\n 'label' => 'Store Types',\n 'icon' => 'icon-cart-plus',\n 'url' => Backend::url('wealthon/system/storetype'),\n 'permissions' => ['wealthon.system.*']\n ],\n 'commission_type' => [\n 'label' => 'Commission Types',\n 'icon' => 'icon-briefcase',\n 'url' => Backend::url('wealthon/system/commissiontype'),\n 'permissions' => ['wealthon.system.*']\n ],\n ]\n ]\n ];\n }", "public function registerNavigation()\n {\n return [\n 'smartjob' => [\n 'label' => 'adil.smartjob::lang.plugin.name',\n 'url' => Backend::url('adil/smartjob/jobs'),\n 'icon' => 'icon-briefcase',\n 'permissions' => ['adil.smartjob.*'],\n 'order' => 500,\n 'sideMenu' => [\n\n 'jobs' => [\n 'label' => 'Vacancies',\n 'icon' => 'icon-briefcase',\n 'url' => Backend::url('adil/smartjob/jobs'),\n 'permissions' => ['adil.smartjob.access_jobs']\n ],\n 'rosterroles' =>[\n 'label' => 'adil.smartjob::lang.roster_roles.roles',\n 'icon' => 'icon-list-ul',\n 'url' => Backend::url('adil/smartjob/rosterroles'),\n // 'permissions' => ['adil.smartjob.access_roles']\n ],\n 'departments' => [\n 'label' => 'Departments',\n 'icon' => 'icon-list-ol',\n 'url' => Backend::url('adil/smartjob/departments'),\n 'permissions' => ['adil.smartjob.access_departments']\n ],\n ], \n ],\n \n ];\n }", "public function registerNavigation()\n {\n return [\n 'paypal' => [\n 'label' => 'PayPal',\n 'url' => Backend::url('creations/paypal/payments'),\n 'icon' => 'icon-paypal',\n 'permissions' => ['creations.paypal.*'],\n 'order' => 500,\n 'sideMenu' => [\n 'payments' => [\n 'label' => 'Payments',\n 'icon' => 'icon-credit-card',\n 'url' => Backend::url('creations/paypal/payments'),\n 'permissions' => ['creations.paypal.*'],\n ],\n 'plans' => [\n 'label' => 'Plans',\n 'icon' => 'icon-file-text',\n 'url' => Backend::url('creations/paypal/plans'),\n 'permissions' => ['creations.paypal.*'],\n ],\n ],\n ],\n ];\n }", "public function registerNavigation()\n {\n return []; // Remove this line to activate\n\n return [\n 'vuetranslator' => [\n 'label' => 'VueTranslator',\n 'url' => Backend::url('defr/vuetranslator/mycontroller'),\n 'icon' => 'icon-leaf',\n 'permissions' => ['defr.vuetranslator.*'],\n 'order' => 500,\n ],\n ];\n }", "function as_navigation() {\t\n\t\t$as_nav_items = array();\t\t\t\t\t\n\t\t$myaccount = isset( $_SESSION['kmdnwdems_account'] ) ? $_SESSION['kmdnwdems_account'] : null;\n\t\t\n\t\t/*$as_nav_items['home']=array(\n\t\t\t'label' => 'Home',\n\t\t\t'url' => '.',\n\t\t);\n\t\t*/\n\t\tif ($myaccount){ \n\t\t\t$as_nav_items['item_all']=array(\n\t\t\t\t'label' => 'Clients',\n\t\t\t\t'url' => 'index.php?action=item_all',\n\t\t\t);\n\t\t\t$as_nav_items['record_all']=array(\n\t\t\t\t'label' => 'records',\n\t\t\t\t'url' => 'index.php?action=record_all',\n\t\t\t);\n\t\t\t$as_nav_items['user_all']=array(\n\t\t\t\t'label' => 'Users',\n\t\t\t\t'url' => 'index.php?action=user_all',\n\t\t\t);\n\t\t\t$as_nav_items['options']=array(\n\t\t\t\t'label' => 'Site Options',\n\t\t\t\t'url' => 'index.php?action=options',\n\t\t\t);\n\t\t\t$as_nav_items['logout']=array(\n\t\t\t\t'label' => 'Logout?',\n\t\t\t\t'url' => 'index.php?action=logout',\n\t\t\t);\n\t\t\n\t\t} else {\n\t\t\t$as_nav_items['register']=array(\n\t\t\t\t'label' => 'Register',\n\t\t\t\t'url' => 'index.php?action=register',\n\t\t\t);\n\t\t\t$as_nav_items['forgot_password']=array(\n\t\t\t\t'label' => 'Forgot Password',\n\t\t\t\t'url' => 'index.php?action=forgot_password',\n\t\t\t);\n\t\t\t$as_nav_items['forgot_username']=array(\n\t\t\t\t'label' => 'Forgot Username',\n\t\t\t\t'url' => 'index.php?action=forgot_username',\n\t\t\t);\n\t\t}\n\t\treturn $as_nav_items;\n\t}", "public function registerNavigation()\n {\n return [\n 'statefull' => [\n 'label' => 'Statefull Website',\n 'url' => \\Backend::url('ebussola/statefull/urldynamics'),\n 'icon' => 'icon-rocket',\n 'permissions' => ['ebussola.statefull.*'],\n 'order' => 500,\n\n 'sideMenu' => [\n 'urldynamics' => [\n 'label' => 'Dynamics URL',\n 'icon' => 'icon-code',\n 'url' => \\Backend::url('ebussola/statefull/urldynamics'),\n 'permissions' => ['ebussola.statefull.*']\n ],\n 'urlblacklist' => [\n 'label' => 'URL Blacklist',\n 'icon' => 'icon-minus-circle',\n 'url' => \\Backend::url('ebussola/statefull/urlblacklist'),\n 'permissions' => ['ebussola.statefull.*']\n ],\n 'getparamblacklist' => [\n 'label' => 'Get Param Blacklist',\n 'icon' => 'icon-minus-circle',\n 'url' => \\Backend::url('ebussola/statefull/getparamblacklist'),\n 'permissions' => ['ebussola.statefull.*']\n ],\n 'urlpurge' => [\n 'label' => 'URL Purge',\n 'icon' => 'icon-trash',\n 'url' => \\Backend::url('ebussola/statefull/urldynamics/purge'),\n 'permissions' => ['ebussola.statefull.*']\n ]\n ]\n ]\n ];\n }", "public function getPagesLinks()\n\t{\n\t\t$app = JFactory::getApplication();\n\n\t\t// Build the page navigation list.\n\t\t$data = $this->_buildDataObject();\n\n\t\t$list = array();\n\t\t$list['prefix'] = $this->prefix;\n\n\t\tif ($data->start->base !== null)\n\t\t{\n\t\t\t$list['start']['active'] = true;\n\t\t\t$list['start']['data'] = $this->item_active($data->start);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$list['start']['active'] = false;\n\t\t\t$list['start']['data'] = $this->item_inactive($data->start);\n\t\t}\n\n\t\tif ($data->previous->base !== null)\n\t\t{\n\t\t\t$list['previous']['active'] = true;\n\t\t\t$list['previous']['data'] = $this->item_active($data->previous);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$list['previous']['active'] = false;\n\t\t\t$list['previous']['data'] = $this->item_inactive($data->previous);\n\t\t}\n\n\t\t$list['pages'] = array();\n\n\t\tforeach ($data->pages as $i => $page)\n\t\t{\n\t\t\tif ($page->base !== null)\n\t\t\t{\n\t\t\t\t$list['pages'][$i]['active'] = true;\n\t\t\t\t$list['pages'][$i]['data'] = $this->item_active($page);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$list['pages'][$i]['active'] = false;\n\t\t\t\t$list['pages'][$i]['data'] = $this->item_inactive($page);\n\t\t\t}\n\t\t}\n\n\t\tif ($data->next->base !== null)\n\t\t{\n\t\t\t$list['next']['active'] = true;\n\t\t\t$list['next']['data'] = $this->item_active($data->next);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$list['next']['active'] = false;\n\t\t\t$list['next']['data'] = $this->item_inactive($data->next);\n\t\t}\n\n\t\tif ($data->end->base !== null)\n\t\t{\n\t\t\t$list['end']['active'] = true;\n\t\t\t$list['end']['data'] = $this->item_active($data->end);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$list['end']['active'] = false;\n\t\t\t$list['end']['data'] = $this->item_inactive($data->end);\n\t\t}\n\n\t\tif ($this->total > $this->limit)\n\t\t{\n\t\t\treturn $this->_list_render($list);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t}", "public function registerNavigation()\n {\n return [\n 'faq' => [\n 'label' => 'istheweb.faq::lang.plugin.name',\n 'url' => Backend::url('istheweb/faq/questions'),\n 'icon' => 'icon-comments',\n 'permissions' => ['istheweb.faq.*'],\n\n 'sideMenu' => [\n 'questions' => [\n 'label' => 'istheweb.faq::lang.questions.menu_label',\n 'icon' => 'icon-question-circle',\n 'url' => Backend::url('istheweb/faq/questions'),\n 'permissions' => ['istheweb.faq.*']\n\n ],\n 'categories' => [\n 'label' => 'istheweb.faq::lang.categories.menu_label',\n 'icon' => 'icon-list-ul',\n 'url' => Backend::url('istheweb/faq/categories'),\n 'permissions' => ['istheweb.faq.*']\n ]\n ]\n ]\n ];\n }", "private function navbar() : array\n {\n return [\n [ 'uri' => '/', 'name' => 'Dlayer vNext'],\n [ 'uri' => '/content', 'name' => 'Content Manager', 'active' => true ],\n [ 'uri' => '/helpers', 'name' => 'View helpers']\n ];\n }", "public function registerNavigation()\n {\n return [\n 'youtubegallery' => [\n 'label' => 'taema.youtubegallery::lang.plugin.navigation.label',\n 'url' => Backend::url('taema/youtubegallery/videos'),\n 'icon' => 'icon-youtube-play',\n 'permissions' => ['taema.youtubegallery.tab'],\n 'order' => 500,\n 'sideMenu' => [\n 'videos' => [\n 'label' => 'taema.youtubegallery::lang.plugin.navigation.sidemenu.videos.label',\n 'icon' => 'icon-video-camera',\n 'url' => Backend::url('taema/youtubegallery/videos'),\n 'permissions' => ['taema.youtubegallery.access_videos']\n ],\n 'playlists' => [\n 'label' => 'taema.youtubegallery::lang.plugin.navigation.sidemenu.playlists.label',\n 'icon' => 'icon-list',\n 'url' => Backend::url('taema/youtubegallery/playlists'),\n 'permissions' => ['taema.youtubegallery.access_playlists']\n ]\n ]\n ],\n ];\n }" ]
[ "0.7451077", "0.6867319", "0.6778279", "0.6713482", "0.66180134", "0.6611434", "0.6527949", "0.6525464", "0.6517796", "0.648189", "0.6467193", "0.6437248", "0.6370203", "0.63650924", "0.6355837", "0.63557214", "0.6341646", "0.63090783", "0.6294831", "0.6286009", "0.6282524", "0.62557983", "0.62230587", "0.6220266", "0.6148651", "0.6133371", "0.6128974", "0.61135596", "0.6110853", "0.61105096" ]
0.6993173
1
Returns the layout navigation template item
function navigation(){ if(! $this->nav_template){ foreach($this->nav_items as $tag => $item){ // Clean links before rendering $this->nav_items[$tag] = array_merge(array('text' => '','url' => '/','class' => '','container_class' => '','children' => false,'extra' => ''),$this->nav_items[$tag]); } $this->nav_template = new toeprint_Template(TOEPRINT_LAYOUT_PATH.'/'.$this->name.'/widgets/navigation/navigation.phtml',array('items' => $this->nav_items)); } return $this->nav_template; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function activeTemplate ()\n\t{\n\t\t$settings = $this->configuration;\n\t\t$navigation = $this->navigation;\n\t\tif (! empty($navigation->navigation[$this->configuration['m']]['template_folder'])) {\n\t\t\treturn $navigation->navigation[$this->configuration['m']]['template_folder'];\n\t\t} else {\n\t\t\treturn $settings['default_template'];\n\t\t}\n\t}", "public function getTemplate()\n {\n return $this->parent;\n }", "public function getTemplate()\n {\n return $this->parent;\n }", "private function _item()\n {\n list($system, $item) = explode('.', Route::currentRouteName());\n\n return $item;\n }", "protected function getItemTemplate() {\n // Creates the template configuration manager\n $this->templateConfigurationManager = GeneralUtility::makeInstance('SAV\\\\SavLibraryPlus\\\\Managers\\\\TemplateConfigurationManager');\n $this->templateConfigurationManager->injectTemplateConfiguration($this->getLibraryConfigurationManager()->getSpecialViewTemplateConfiguration());\n\n // Retuns the item template\n return $this->templateConfigurationManager->getItemTemplate(); \n }", "private function getSingleTemplate()\n {\n if (count($this->views) === 1) {\n return current(array_slice($this->views, -1));\n }\n }", "public function getTemplateAttribute() {\n if( !empty( $this->attributes[ 'template' ] ) && View::exists( 'template.' . $this->attributes[ 'template' ] ) ) {\n return $this->attributes[ 'template' ];\n }\n return 'page';\n }", "public static function get_nav_id() {\n\n\t\t\t// Template\n\t\t\t$id = oceanwp_custom_nav_template();\n\n\t\t\t// If template is selected\n\t\t\tif ( ! empty( $id ) ) {\n\n\t\t\t\t// Get Polylang Translation of template\n\t\t\t\tif ( function_exists( 'pll_get_post' )) {\n\t\t\t\t\t$id_polylang = pll_get_post( $id, pll_current_language() );\n\t\t\t\t\tif ( ! empty( $id_polylang ) ) {\n\t\t\t\t\t\t$id = $id_polylang;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $id;\n\t\t\t}\n\n\t\t\t// Return\n\t\t\treturn false;\n\t\t\t\n\t\t}", "public static function template() { return self::$templates[0]; }", "protected function getCurrentNavigation()\n {\n if (get_option('page_for_' . get_post_type() . '_navigation')) {\n return get_post(get_option('page_for_' . get_post_type() . '_navigation'));\n }\n return;\n }", "public function current()\n {\n // get the name and url of the nav item\n $name = parent::key();\n $url = parent::current();\n \n // determine if we're on the last element\n if ($this->hasNext()) {\n return '<li><a href=\"' . $url . '\">' . $name . '</a></li>';\n } else {\n return '<li class=\"last\"><a href=\"' . $url . '\">' . $name . '</a></li>';\n }\n }", "public function getLayoutTemplate()\n\t{\n\t\tif(empty($this->layoutTemplate))\n\t\t{\n\t\t\t$this->layoutTemplate = Core::getConfig()->maintemplate;\n\t\t}\n\t\treturn $this->layoutTemplate;\n\t}", "public function getViewId()\n {\n return 'dyn_menu';\n }", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate()\n {\n $layout = $this->getViewModel();\n\n return $layout->getTemplate();\n }", "public function getLayout();", "public function getLayout();", "function bbp_get_single_view_template()\n{\n}", "function forTemplate() {\n\t\treturn $this->Tag();\n\t}", "function get_template($template){\n $login_arr = $this->action_parser($this->action,'template') ;\n $pos = array_search($template, $login_arr['template']['name']); \n return $login_arr['template']['path'][$pos];\n }", "public function forTemplate() {\n\t\treturn $this->getTag();\n\t}", "public function getTemplate()\n {\n return $this->getRelationValue($this->getTemplateRelationName());\n }", "public function current()\n {\n return $this->layout[$this->position];\n }", "public function current()\n {\n return current($this->templates);\n }", "function gogreen_get_nav_layout(){\n return gogreen_get_option('nav_layout') ? gogreen_get_option('nav_layout') : 'classic';\n}", "function get_template($template){\n\t\t\t$login_arr = $this->action_parser($this->action,'template') ;\n\t\t\t$pos = array_search($template, $login_arr['template']['name']); \n\t\t\treturn $login_arr['template']['path'][$pos];\n\t\t}", "function get_template($template){\n\t\t\t$login_arr = $this->action_parser($this->action,'template') ;\n\t\t\t$pos = array_search($template, $login_arr['template']['name']); \n\t\t\treturn $login_arr['template']['path'][$pos];\n\t\t}" ]
[ "0.67161095", "0.6192272", "0.6192272", "0.6092765", "0.606603", "0.5980317", "0.586464", "0.5848547", "0.58436894", "0.58311284", "0.5812952", "0.57967716", "0.5778606", "0.5759868", "0.5759868", "0.5759868", "0.5759868", "0.5752298", "0.5748505", "0.5748505", "0.5727515", "0.570672", "0.5681974", "0.56777674", "0.56691545", "0.5654886", "0.56542367", "0.5641586", "0.5636208", "0.5636208" ]
0.6363518
1
Set the active layout template
public function setTemplate($template){ $this->active_template = $template; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _apply_template()\n\t{\n\t\tif(!$this->param('id'))\n\t\t{\n\t\t\t$this->param('id', $this->param('form_id'));\n\t\t}\n\n\t\t$layout = $this->param('layout');\n\n\t\tif (empty($layout))\n\t\t{\n\t\t\t$this->param('layout', Kohana::$config->load('bform.views.defaults.form_layouts.' . $this->param('template')));\n\t\t}\n\t\t$this->param('buttons_manager')->layout(Kohana::$config->load('bform.drivers.bform_driver_button.views.'.$this->param('template').'.layout'));\n\t}", "public function activeTemplate ()\n\t{\n\t\t$settings = $this->configuration;\n\t\t$navigation = $this->navigation;\n\t\tif (! empty($navigation->navigation[$this->configuration['m']]['template_folder'])) {\n\t\t\treturn $navigation->navigation[$this->configuration['m']]['template_folder'];\n\t\t} else {\n\t\t\treturn $settings['default_template'];\n\t\t}\n\t}", "public function setLayout()\n {\n if($this->template != false && isset($this->template['layout_id']) && $this->template['layout_id'] != 0)\n {\n $record = NotificationDAO::getLayout($this->template['layout_id'], $this->language);\n if($record != false)\n {\n $this->layout = $record['content'];\n }\n }\n }", "protected function setTemplate()\n {\n $this->template = 'user/day.tpl';\n }", "public function setTemplate()\n {\n $eApplication = Factory::getApplication();\n $Template = Factory::getTemplate();\n $ContentType = $eApplication->get('ContentType');\n $XHRequest = $eApplication->get('XHRequest');\n\n if ($ContentType == 'text/html' && !$XHRequest) {\n foreach ($Template->getPositions() as $p) {\n $this->setPosition($p);\n }\n\n foreach ($Template->getJavaScripts() as $v) {\n $this->setJavaScript($v);\n }\n\n foreach ($Template->getStyleSheets() as $v) {\n $this->setStyleSheet($v);\n }\n } else {\n $this->setPosition('XHRequest');\n }\n }", "public static function getActiveLayout();", "abstract protected function renderTemplateWithLayout();", "private function set_default_template()\n {\n $excluded_pages = array('delete', 'update', 'destroy', 'noaccess', 'logout','language');\n if ( ! in_array( Request::current()->action(), $excluded_pages ) )\n {\n if (Request::current()->directory() )\n {\n return View::factory(Request::current()->directory().'/'.Request::current()->controller().'/'.Request::current()->action());\n }\n elseif (in_array(Request::current()->controller(), array('Pages','Account')) )\n {\n return View::factory(Request::current()->controller().'/'.Request::current()->action());\n } \n }\n // else\n return false; \n }", "public function set_template_view() {\n\n\t\t// bail it if in singular template and template part\n\t\tif ( is_singular( array( 'tf_template', 'tf_template_part' ) ) ) \n\t\t\treturn;\n\n\t\tglobal $TF_Layout, $TF;\n\n\t\t$found_template = false;\n\t\t$meta_value = 'archive';\n\t\tif ( is_archive() ) {\n\t\t\t$meta_value = 'archive';\n\t\t} else if ( is_page() || is_404() || ( ! is_home() && is_front_page() ) ) {\n\t\t\t$meta_value = 'page';\n\t\t} else if ( is_single() ) {\n\t\t\t$meta_value = 'single';\n\t\t}\n\n\t\t$templates = get_transient( 'tf_cached_template_assignment_' . $meta_value );\n\n\t\tif ( false === $templates ) {\n\t\t\t$args = array(\n\t\t\t\t'post_type' => 'tf_template',\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t'order' => 'DESC',\n\t\t\t\t'orderby' => 'menu_order date',\n\t\t\t\t'meta_query' => array(\n\t\t\t\t\t'relation' => 'AND',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key' => 'tf_template_type',\n\t\t\t\t\t\t'value' => $meta_value,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'key' => 'associated_theme',\n\t\t\t\t\t\t'value' => $TF->active_theme->slug,\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\t$query = new WP_Query( $args );\n\t\t\t$templates = $query->get_posts();\n\n\t\t\t// Cached meta data info as well\n\t\t\tif ( $templates ) {\n\t\t\t\t$metadatas = array(\n\t\t\t\t\t'tf_template_assign', 'tf_template_header_option', 'tf_template_sidebar_option',\n\t\t\t\t\t'tf_template_footer_option', 'tf_template_type'\n\t\t\t\t);\n\t\t\t\tforeach( $templates as $key => $template ) {\n\t\t\t\t\tforeach ( $metadatas as $meta ) {\n\t\t\t\t\t\t$templates[ $key ]->{$meta} = get_post_meta( $template->ID, $meta, true );\t\n\t\t\t\t\t}\n\t\t\t\t\t$templates[ $key ]->tf_template_region_header = get_post_meta( $template->ID, 'tf_template_region_header', true );\n\t\t\t\t\t$templates[ $key ]->tf_template_region_sidebar = get_post_meta( $template->ID, 'tf_template_region_sidebar', true );\n\t\t\t\t\t$templates[ $key ]->tf_template_region_footer = get_post_meta( $template->ID, 'tf_template_region_footer', true );\n\t\t\t\t}\n\t\t\t}\n\t\t\tset_transient( 'tf_cached_template_assignment_' . $meta_value, $templates, 0 ); // no expired\n\t\t}\n\n\t\tif ( $templates ) {\n\t\t\t// Cached the taxonomy lists\n\t\t\t$taxonomies = get_taxonomies( array( 'public' => true ) );\n\t\t\t$exclude_tax = array( 'post_format', 'product_shipping_class' );\n\n\t\t\t// Exclude unnecessary taxonomies\n\t\t\tforeach( $exclude_tax as $tax ) {\n\t\t\t\tif ( isset( $taxonomies[ $tax ] ) ) \n\t\t\t\t\tunset( $taxonomies[ $tax ] );\t\n\t\t\t}\n\t\t\t$this->taxonomies = $taxonomies;\n\n\t\t\t// First check has template assignment as top priority\n\t\t\tforeach( $templates as $key => $template ) {\n\t\t\t\t$views = $template->tf_template_assign;\n\t\t\t\tif ( $views && isset( $views[ $meta_value ] ) ) {\n\t\t\t\t\tif ( $this->is_current_view( $meta_value, $views ) ) {\n\t\t\t\t\t\t$TF_Layout->setup_layout( $template );\n\t\t\t\t\t\t$this->render_template = true;\n\t\t\t\t\t\t$found_template = true;\n\t\t\t\t\t\tunset( $templates[ $key ] );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tunset( $templates[ $key ] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! $found_template && count( $templates ) > 0 ) {\n\t\t\t\t$templates = array_values( $templates );\n\t\t\t\t$TF_Layout->setup_layout( $templates[0] );\n\t\t\t\t$this->render_template = true;\n\t\t\t}\n\t\t}\n\t}", "protected function setLayout () {\n\t\tif ($this->_getParam('catalog')) {\n\t\t\t$config = Zend_Registry::getInstance()->config;\n\t\t\tif (count($config->catalog->layouts)) {\n\t\t\t\t$catalogId = $this->_helper->osidId->fromString($this->_getParam('catalog'));\n\t\t\t\tforeach ($config->catalog->layouts as $layoutConfig) {\n\t\t\t\t\tif ($catalogId->isEqual(new phpkit_id_URNInetId($layoutConfig->catalog_id))) {\n\t\t\t\t\t\t$this->_helper->layout()->setLayout($layoutConfig->layout);\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}", "public function getLayoutTemplate()\n\t{\n\t\tif(empty($this->layoutTemplate))\n\t\t{\n\t\t\t$this->layoutTemplate = Core::getConfig()->maintemplate;\n\t\t}\n\t\treturn $this->layoutTemplate;\n\t}", "public function setTemplate($mode)\n\t{\n\t}", "protected function setTemplate($arrParam){\n\t\t$this->oTpl = Smarty::getInstance();\n\t\t$this->oTpl->setLayout(\"blank\");\n\n $this->oTpl->assign(\"MAIN_DOMAIN\", GET_CONFIG(\"site\", \"domain\"));\n\n if(SESSION()){\n $this->oTpl->assign(\"PEOPLE_ID\", SESSION(\"auth_people_id\"));\n $this->oTpl->assign(\"FULL_NAME\", SESSION(\"auth_fullname\"));\n }else{\n $this->oTpl->assign(\"PEOPLE_ID\", \"\");\n $this->oTpl->assign(\"FULL_NAME\", \"\");\n }\n\n\t\t$this->oTpl->assign(\"JS\", JS_URL);\n\t\t$this->oTpl->assign(\"CSS\", CSS_URL);\n\t\t$this->oTpl->assign(\"IMG\", IMG_URL);\n\t\t$this->oTpl->assign(\"FILES\", FILE_DIR);\n\t\t$this->oTpl->assign(\"FILE_ICON\", FILE_ICON_URL);\n\t\t\n\t\t$this->mArrParam = $arrParam;\n\t\t$this->oTpl->assign(\"CONTROLLER\", $arrParam[\"controller\"]);\n\t\t$this->oTpl->assign(\"ACTION\", $arrParam[\"action\"]);\n\t\tif(array_key_exists(\"param\", $arrParam)){\n\t\t\t$this->oTpl->assign(\"PARAM\", $arrParam[\"param\"]);\n\t\t}else{\n\t\t\t$this->oTpl->assign(\"PARAM\", \"\");\n\t\t}\n\t\t\n\t\t// add the javascript and the style sheet\n\t\t$this->oTpl->assign(\"STYLE\", \"\");\n\t\t$this->oTpl->assign(\"JAVASCRIPT\", \"\");\n\t}", "public function setTemplate($template);", "public function setTemplate($template);", "public function setLayoutTemplate($template = null)\n\t{\n\t\t$this->layoutTemplate = $template;\n\t\treturn $this;\n\t}", "abstract public function setTemplate($template);", "protected function setTemplate($template)\n {\n }", "function make_new_template()\n\t{\n\t\tIfNotSetNull($this->checked->layoutname);\n\n\t\t$this->checked->layoutname=basename($this->checked->layoutname);\n\t\t$this->checked->layoutname=trim($this->checked->layoutname);\n\t\tpreg_replace(\"/[^A-Za-z0-9]/\",\" \", $this->checked->layoutname);\n\t\t$this->checked->layoutname=$this->replace_uml($this->checked->layoutname);\n\t\t$this->checked->layoutname=str_ireplace(\"%\",\"\",$this->checked->layoutname);\n\n\t\tswitch ($this->checked->layout) {\n\t\tcase 1 :\n\t\t\t//Test auf Start setzen\n\t\t\t$this->layout_schritt1();\n\t\t\tbreak;\n\n\t\tcase 2 :\n\t\t\t//Test auf Start setzen\n\t\t\t$this->layout_schritt2();\n\t\t\tbreak;\n\n\t\tcase 3 :\n\t\t\t//Test auf Start setzen\n\t\t\t$this->layout_schritt3();\n\t\t\tbreak;\n\n\t\tcase 4 :\n\t\t\t//Test auf Start setzen\n\t\t\t$this->layout_schritt4();\n\t\t\tbreak;\n\n\t\tcase 5 :\n\t\t\t//Test auf Start setzen\n\t\t\t$this->layout_schritt5();\n\t\t\t$_SESSION['dbp']=array();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\t$this->content->template['contentnew_layout']=\"ok\";\n\t\t\t$this->content->template['self']=\"./template.php?menuid=86\";\n\t\t\t//Verzeichnisrechte checken\n\t\t\t$this->content->template['dir_perm']=$this->check_verzeichnis_rechte();\n\t\t\tbreak;\n\t\t}\n\t}", "function setTemplate( $template ){\n\n\t\tif(!empty($template) && $template!='default'){\n\t\t\tif (is_dir(RPATH_THEMES.DS.$template)) {\n\t\t\t\t//$this->addTemplatePath(RPATH_THEMES.DS.$template);\n\t\t\t\t$mainframe = JFactory::getApplication('site');\n\t\t\t\t$mainframe->set('setTemplate', $template);\n\t\t\t} else{\n\t\t\t\tJError::raiseWarning(412,'The choosen template couldnt found on the filemain: '.$template);\n\t\t\t}\n\t\t} else{\n\t\t\t\t//JError::raiseWarning('No template set : '.$template);\n\t\t}\n\t}", "public function __setCurrentTemplateName($name) {\n\t\t$this->current_template_name = $name;\n\t}", "protected function setLayout()\r\n\t{\r\n\t\t$request\t= $this->event->getRequest();\r\n\t\t$session\t= $this->getSession();\r\n\t\t\r\n\t\t// Sets layout\r\n\t\tif ($request->server->has('HTTP_USER_AGENT') && preg_match('/(iphone|ipad|android)/i', $request->server->get('HTTP_USER_AGENT'))) {\r\n\t\t\tif($session->has('wurfl-screen'))\t$WurflScreen = $session->get('wurfl-screen'); else\t$WurflScreen = 'layout-medium';\r\n\t\t\t$request->setRequestFormat('mobile');\r\n\t\t\t\r\n\t\t\t// \twe calculate the layout to be applied.\r\n\t\t\tif( $this->security->isGranted('ROLE_CONTENT_MANAGER') || $this->security->isGranted('ROLE_ADMIN') || $this->security->isGranted('ROLE_SUPER_ADMIN') )\r\n\t\t\t\t$layout\t= 'PiAppTemplateBundle::Template\\\\Layout\\\\Mobile\\\\Admin\\\\'. $WurflScreen . '.html.twig';\r\n\t\t\telseif( $this->security->isGranted('ROLE_USER') )\r\n\t\t\t\t$layout\t= 'PiAppTemplateBundle::Template\\\\Layout\\\\Mobile\\\\User\\\\'. $WurflScreen . '.html.twig';\r\n\t\t\telse\r\n\t\t\t\t$layout\t= 'PiAppTemplateBundle::Template\\\\Layout\\\\Mobile\\\\Default\\\\'. $WurflScreen . '.html.twig';\r\n\t\t}else{\r\n\t\t\t// \twe calculate the layout to be applied.\r\n\t\t\tif(!empty($this->template))\r\n\t\t\t\t$layout\t= 'PiAppTemplateBundle::Template\\\\Layout\\\\Pc\\\\'.$this->template;\r\n\t\t\telseif( $this->security->isGranted('ROLE_CONTENT_MANAGER') || $this->security->isGranted('ROLE_ADMIN') || $this->security->isGranted('ROLE_SUPER_ADMIN') )\n\t\t\t\t$layout\t= 'PiAppTemplateBundle::Template\\\\Layout\\\\Pc\\\\'.$this->template_admin;\n\t\t\telseif( $this->security->isGranted('ROLE_USER') )\n\t\t\t\t$layout\t= 'PiAppTemplateBundle::Template\\\\Layout\\\\Pc\\\\'.$this->template_user;\n\t\t\telse\n\t\t\t\t$layout\t= 'PiAppTemplateBundle::Template\\\\Layout\\\\Pc\\\\'.$this->template_subscriber;\n\t\t}\r\n\t\t\r\n\t\t// Record the layout variable in session.\t\r\n\t\t$session->set('wurfl-layout', $layout);\r\n\t}", "public function setTemplate($template) {\n\t\t$this->template($template, 'default');\n\t}", "protected function template()\n\t{\n\t\t$template = SPRequest::cmd( 'sptpl', $this->_task );\n\t\tif( strstr( $template, '.' ) ) {\n\t\t\t$template = explode( '.', $template );\n\t\t\t$this->templateType = $template[ 0 ];\n\t\t\t$this->template = $template[ 1 ];\n\t\t}\n\t\telse {\n\t\t\t$this->templateType = $this->_type;\n\t\t\t$this->template = $template ? $template : $this->_task;\n\t\t}\n\t}", "protected function setupLayout()\n {\n View::composer('layouts.master', function($view){\n $view->with('status', Session::get('status'));\n });\n\n\t\tif ( ! is_null($this->layout))\n\t\t{\n $this->layout = View::make($this->layout)\n ->with('status', Session::get('status'));\n\t\t}\n\t}", "public function init() {\n $this->view->mainactive = 'active';\n }", "public function setTemplate($value)\n\t{\n\t\t$this->_localTemplate=$value;\n\t}", "function set_template($template_view){\n\t\t$this->set_mode(self::OUTPUT_MODE_TEMPLATE);\n\t\t$template_view = str_replace(\".php\", \"\", $template_view);\n\t\t$this->_template = self::TEMPLATE_ROOT . $template_view;\n\t}", "public function setTemplate( $name );", "public function layout()\n {\n //$this->template['header'] = $this->load->view('templates/header', $this->data, true);\n //$this->template['footer'] = $this->load->view('templates/footer', $this->data, true);\n $this->template['page'] = $this->load->view($this->page, $this->data, true);\n $this->load->view('templates/main', $this->template);\n }" ]
[ "0.6503161", "0.65020716", "0.64684325", "0.6395558", "0.6276142", "0.62734276", "0.6212242", "0.61432385", "0.6108664", "0.61043555", "0.6093925", "0.6091356", "0.6090276", "0.6072711", "0.6072711", "0.6068174", "0.6039697", "0.6020366", "0.598872", "0.5984375", "0.5965699", "0.5909293", "0.58935404", "0.5854506", "0.5849547", "0.58240455", "0.579245", "0.57880336", "0.57843137", "0.57808226" ]
0.6804077
0
GoogleMapsWidget widget edit form HTML
function form($instance) { $options = GMW::get_options(); $instance = $this->upgrade_wiget_instance($instance); extract($instance, EXTR_SKIP); $thumb_map_types = array(array('val' => 'hybrid', 'label' => __('Hybrid', 'google-maps-widget')), array('val' => 'roadmap', 'label' => __('Road (default)', 'google-maps-widget')), array('val' => 'satellite', 'label' => __('Satellite', 'google-maps-widget')), array('val' => 'terrain', 'label' => __('Terrain', 'google-maps-widget')), array('val' => '-1', 'label' => __('Custom Static Image (save money on API calls)', 'google-maps-widget'))); $lightbox_map_types = array(array('val' => 'roadmap', 'label' => __('Road (default)', 'google-maps-widget')), array('val' => 'satellite', 'label' => __('Satellite', 'google-maps-widget'))); $lightbox_modes = array(array('val' => 'place', 'label' => __('Place (default)', 'google-maps-widget')), array('val' => '-1', 'label' => __('Directions', 'google-maps-widget')), array('val' => '-1', 'label' => __('Search', 'google-maps-widget')), array('val' => '-1', 'label' => __('Street View', 'google-maps-widget')), array('val' => '-1', 'label' => __('View (clean map, no markers)', 'google-maps-widget'))); $thumb_pin_sizes = array(array('val' => 'tiny', 'label' => __('Tiny', 'google-maps-widget')), array('val' => 'small', 'label' => __('Small', 'google-maps-widget')), array('val' => 'mid', 'label' => __('Medium', 'google-maps-widget')), array('val' => 'default', 'label' => __('Large (default)', 'google-maps-widget'))); $thumb_pin_colors = array(array('val' => '#000000', 'label' => __('Black', 'google-maps-widget')), array('val' => '#0000ff', 'label' => __('Blue', 'google-maps-widget')), array('val' => '#a52a2a', 'label' => __('Brown', 'google-maps-widget')), array('val' => '#808080', 'label' => __('Gray', 'google-maps-widget')), array('val' => '#00ff00', 'label' => __('Green', 'google-maps-widget')), array('val' => '#ffa500', 'label' => __('Orange', 'google-maps-widget')), array('val' => '#800080', 'label' => __('Purple', 'google-maps-widget')), array('val' => '#ff0000', 'label' => __('Red (default)', 'google-maps-widget')), array('val' => '#ffffff', 'label' => __('White', 'google-maps-widget')), array('val' => '#ffff00', 'label' => __('Yellow', 'google-maps-widget')), array('val' => '-1', 'label' => __('PRO offers unlimited color choices', 'google-maps-widget'))); $pin_labels = array(array('val' => 'A', 'label' => __('A (default)', 'google-maps-widget')), array('val' => '-1', 'label' => __('Choose a custom label by going PRO', 'google-maps-widget'))); $zoom_levels_thumb = array(array('val' => '0', 'label' => __('0 - entire world', 'google-maps-widget'))); for ($tmp = 1; $tmp <= 21; $tmp++) { if ($tmp == 13) { $zoom_levels_thumb[] = array('val' => $tmp, 'label' => $tmp . ' (default)'); } else { $zoom_levels_thumb[] = array('val' => $tmp, 'label' => $tmp); } } $zoom_levels_lightbox = $zoom_levels_thumb; $lightbox_sizes = array(array('val' => '0', 'label' => __('Custom size (default)', 'google-maps-widget')), array('val' => '-1', 'label' => __('Fullscreen', 'google-maps-widget'))); $lightbox_skins = array(array('val' => 'dark', 'label' => __('Dark', 'google-maps-widget')), array('val' => 'light', 'label' => __('Light (default)', 'google-maps-widget')), array('val' => '-1', 'label' => __('Blue', 'google-maps-widget')), array('val' => '-1', 'label' => __('Cartoonish', 'google-maps-widget')), array('val' => '-1', 'label' => __('Dark rim', 'google-maps-widget')), array('val' => '-1', 'label' => __('Fancy', 'google-maps-widget')), array('val' => '-1', 'label' => __('Gears', 'google-maps-widget')), array('val' => '-1', 'label' => __('Gray squared', 'google-maps-widget')), array('val' => '-1', 'label' => __('Minimalistic', 'google-maps-widget')), array('val' => '-1', 'label' => __('Minimalistic #2', 'google-maps-widget')), array('val' => '-1', 'label' => __('Painting', 'google-maps-widget')), array('val' => '-1', 'label' => __('Polaroid', 'google-maps-widget')), array('val' => '-1', 'label' => __('Rounded', 'google-maps-widget')), array('val' => '-1', 'label' => __('Rounded white', 'google-maps-widget')), array('val' => '-1', 'label' => __('Shadow', 'google-maps-widget')), array('val' => '-1', 'label' => __('Simple', 'google-maps-widget')), array('val' => '-1', 'label' => __('Squared black', 'google-maps-widget')), array('val' => '-1', 'label' => __('Squared white', 'google-maps-widget')), array('val' => '-1', 'label' => __('Tablet', 'google-maps-widget')), array('val' => '-1', 'label' => __('Vintage', 'google-maps-widget')), array('val' => '-1', 'label' => __('Wood', 'google-maps-widget'))); $thumb_pin_types = array(array('val' => 'predefined', 'label' => __('Predefined by Google (default)', 'google-maps-widget')), array('val' => 'custom', 'label' => __('Custom image', 'google-maps-widget')), array('val' => '-1', 'label' => __('GMW pins library (1500+ pins)', 'google-maps-widget'))); $thumb_link_types = array(array('val' => 'lightbox', 'label' => __('Interactive map in lightbox (default)', 'google-maps-widget')), array('val' => '-1', 'label' => __('Replace thumb map with an interactive map', 'google-maps-widget')), array('val' => '-1', 'label' => __('Interactive map in a new window', 'google-maps-widget')), array('val' => '-1', 'label' => __('Skip thumbnail map, immediately show interactive one', 'google-maps-widget')), array('val' => 'custom', 'label' => __('Custom URL', 'google-maps-widget')), array('val' => '-1', 'label' => __('Custom URL in a new window', 'google-maps-widget')), array('val' => 'nolink', 'label' => __('Disable link', 'google-maps-widget'))); $thumb_color_schemes = array(array('val' => 'default', 'label' => __('Default', 'google-maps-widget')), array('val' => 'new', 'label' => __('Refreshed by Google', 'google-maps-widget')), array('val' => '-1', 'label' => __('Apple', 'google-maps-widget')), array('val' => 'blue', 'label' => __('Blue', 'google-maps-widget')), array('val' => 'bright', 'label' => __('Bright', 'google-maps-widget')), array('val' => 'gowalla', 'label' => __('Gowalla', 'google-maps-widget')), array('val' => 'gray', 'label' => __('Gray', 'google-maps-widget')), array('val' => 'gray2', 'label' => __('Gray #2', 'google-maps-widget')), array('val' => '-1', 'label' => __('Light', 'google-maps-widget')), array('val' => 'mapbox', 'label' => __('Mapbox', 'google-maps-widget')), array('val' => 'midnight', 'label' => __('Midnight', 'google-maps-widget')), array('val' => 'neon', 'label' => __('Neon', 'google-maps-widget')), array('val' => '-1', 'label' => __('Pale', 'google-maps-widget')), array('val' => 'paper', 'label' => __('Paper', 'google-maps-widget')), array('val' => 'ultra_light', 'label' => __('Ultra Light', 'google-maps-widget')), array('val' => '-1', 'label' => __('Custom scheme to match your site', 'google-maps-widget'))); $thumb_formats = array(array('val' => 'png', 'label' => __('PNG 8-bit (default)', 'google-maps-widget')), array('val' => '-1', 'label' => __('Add 4 more image formats', 'google-maps-widget'))); $thumb_langs = array(array('val' => 'en', 'label' => 'English'), array('val' => '-1', 'label' => __('Add auto-detection and 50 more languages', 'google-maps-widget'))); $thumb_powered_bys = array(array('val' => '0', 'label' => __('No, I do not want to do that', 'google-maps-widget')), array('val' => '1', 'label' => __('Please, let us show a tiny link below the map so that others can learn about GMW too', 'google-maps-widget'))); $hide_titles = array(array('val' => '0', 'label' => __('No, show the widget title (default)', 'google-maps-widget')), array('val' => '1', 'label' => __('Yes, hide the widget title', 'google-maps-widget'))); $lightbox_langs = array(array('val' => 'en', 'label' => 'English'), array('val' => '-1', 'label' => __('Add auto-detection and 50 more languages', 'google-maps-widget'))); $lightbox_features = array(array('val' => 'title', 'label' => __('Show map title', 'google-maps-widget')), array('val' => 'overlay_close', 'label' => __('Close on overlay click', 'google-maps-widget')), array('val' => '-1', 'disabled' => true, 'label' => __('Show close button (upgrade to PRO)', 'google-maps-widget')), array('val' => '-1', 'disabled' => true, 'label' => __('Close on Esc key (upgrade to PRO)', 'google-maps-widget'))); $lightbox_units = array(array('val' => 'auto', 'label' => __('Detect automatically', 'google-maps-widget')), array('val' => 'imperial', 'label' => __('Imperial', 'google-maps-widget')), array('val' => 'metric', 'label' => __('Metric', 'google-maps-widget'))); $lightbox_clustering_options = array(array('val' => '0', 'label' => __('Disabled (default)', 'google-maps-widget')), array('val' => '-1', 'label' => __('Small cluster radius', 'google-maps-widget')), array('val' => '-1', 'label' => __('Medium cluster radius', 'google-maps-widget')), array('val' => '-1', 'label' => __('Large cluster radius', 'google-maps-widget'))); $lightbox_filtering_options = array(array('val' => '0', 'label' => __('Disabled (default)', 'google-maps-widget')), array('val' => '-1', 'label' => __('Enabled', 'google-maps-widget'))); // force update if activated if (GMW::is_activated()) { $plugin = plugin_basename(GMW_PLUGIN_DIR . GMW_BASE_FILE); $update_url = wp_nonce_url(admin_url('update.php?action=upgrade-plugin&amp;plugin=' . urlencode($plugin)), 'upgrade-plugin_' . $plugin ); echo '<p>Google Maps Widget <b class="gmw-pro-red">PRO</b> has been activated! Please <b>click the button below</b> to update plugin files to PRO version. Widget data is not lost and it will not get lost by updating.</p>'; echo '<p><a href="' . esc_url($update_url) . '" class="button button-primary">Update Google Maps Widget</a></p>'; echo '<style type="text/css"> #widget-' . $this->id . '-savewidget { display: none; } </style>'; echo '<input id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="hidden" value="' . esc_attr($title) . '">'; return true; } // is_activated // upgrade ad if plugin used > 45 days if (!GMW::is_activated() && ((current_time('timestamp') - $options['first_install']) > (DAY_IN_SECONDS * 35))) { echo '<p class="gmw-upgrade-notice-widget">A <a class="open_promo_dialog" href="#">special offer</a> for users like <b>you</b> who\'ve been using GMW for some time: a <b>one time payment</b>, lifetime license for <b>only $29</b>! No nonsense! <a class="open_promo_dialog" href="#">Upgrade now</a> to <span class="gmw-pro-red">PRO</span> &amp; get more than 50 extra options &amp; features.</p>'; } // api key warning if (!GMW::get_api_key('test')) { echo '<p class="gmw-api-key-error"><b>Important!</b> '; echo 'Please go to <a href="' . admin_url('options-general.php?page=gmw_options') . '" title="Google Maps Widget settings">settings</a> &amp; follow simple instructions to get a <b>free Google Maps API key</b>. It only takes a minute. Without a key your <b>maps will NOT work</b>. This rule is enforced by Google. Sorry for the inconvenience.</p>'; } // widget options markup // title & address echo '<p><label for="' . $this->get_field_id('title') . '">' . __('Title', 'google-maps-widget') . ':</label>'; echo '<input data-tooltip="Widget title styled as defined in the active theme. HTML tags and shortcodes are not supported. Title is optional." class="widefat" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" placeholder="' . __('Optional Map title', 'google-maps-widget') . '" type="text" value="' . esc_attr($title) . '">'; echo '</p>'; echo '<label for="' . $this->get_field_id('address') . '">' . __('Address', 'google-maps-widget') . ':</label>'; echo '<div class="input-address-group">'; echo '<input name="' . $this->get_field_name('address') . '" type="text" value="' . esc_attr($address) . '" required="required" class="widefat" id="' . $this->get_field_id('address') . '" placeholder="' . __('Address / location to show', 'google-maps-widget') . '" data-tooltip="' . htmlspecialchars('Address or location shown on both maps. Coordinates can be used as well. Write them in a numerical fashion, not in degrees, ie: 40.70823, -74.01052.') . '">'; echo '<a data-target="address" href="#" class="button-secondary gmw-pick-address"><span class="dashicons dashicons-location"></span></a>'; echo '</div>'; // end - title & address // tabs echo '<div class="gmw-tabs" id="tab-' . $this->id . '"><ul>'; echo '<li><a href="#gmw-thumb">' . __('Thumbnail Map', 'google-maps-widget') . '</a></li>'; echo '<li><a href="#gmw-lightbox">' . __('Interactive Map', 'google-maps-widget') . '</a></li>'; echo '<li><a href="#gmw-pins">' . __('Pins', 'google-maps-widget') . '</a></li>'; echo '<li><a href="#gmw-shortcode">' . __('Shortcode', 'google-maps-widget') . '</a></li>'; echo '<li><a href="#gmw-info">' . __('Info &amp; Support', 'google-maps-widget') . '</a></li>'; echo '</ul>'; // thumb tab echo '<div id="gmw-thumb">'; echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_width') . '">' . __('Map Size', 'google-maps-widget') . ':</label>'; echo '<input data-title="Map Width" data-tooltip="Map width in pixels; from 50 to 640. The size limit is imposed by Google. Image may be resized by the theme if the sidebar is narrower." min="50" max="640" step="1" class="small-text" id="' . $this->get_field_id('thumb_width') . '" name="' . $this->get_field_name('thumb_width') . '" type="number" value="' . esc_attr($thumb_width) . '" required="required"> x '; echo '<input data-title="Map Height" data-tooltip="Map height in pixels; from 50 to 640. The size limit is imposed by Google." min="50" max="640" step="1" class="small-text" id="' . $this->get_field_id('thumb_height') . '" name="' . $this->get_field_name('thumb_height') . '" type="number" value="' . esc_attr($thumb_height) . '" required="required">'; echo ' px</p>'; echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_type') . '">' . __('Map Type', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="Controls the map layers shown. Roadmap is the most popular, hybrid combines road and satellite while terrain shows physical relief map image, displaying terrain and vegetation.<br>Custom Static Image displays an image of your choosing in order to <b>save money</b> on Google Maps API calls. When clicked it opens the lightbox map." id="' . $this->get_field_id('thumb_type') . '" name="' . $this->get_field_name('thumb_type') . '">'; GMW::create_select_options($thumb_map_types, $thumb_type); echo '</select></p>'; echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_color_scheme') . '">' . __('Color Scheme', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="Changes the overall appearance of the map. Please note that most visitors are acustomed to the Refreshed color scheme." class="gmw_thumb_color_scheme" id="' . $this->get_field_id('thumb_color_scheme') . '" name="' . $this->get_field_name('thumb_color_scheme') . '">'; GMW::create_select_options($thumb_color_schemes, $thumb_color_scheme); echo '</select></p>'; echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_zoom') . '">' . __('Zoom Level', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="Zoom varies from the lowest level, in which the entire world can be seen, to highest, which shows streets and individual buildings. Building outlines, where available, appear on the map around zoom level 17. This value differs from area to area." class="gmw_thumb_zoom" id="' . $this->get_field_id('thumb_zoom') . '" name="' . $this->get_field_name('thumb_zoom') . '">'; GMW::create_select_options($zoom_levels_thumb, $thumb_zoom); echo '</select></p>'; echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_pin_type') . '">' . __('Pin Type', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="Predefined pin can be adjusted in terms of color, size and one letter label. Custom pin can be any custom image stored on a publically available server (HTTPS is not supported)." class="gmw_thumb_pin_type" id="' . $this->get_field_id('thumb_pin_type') . '" name="' . $this->get_field_name('thumb_pin_type') . '">'; GMW::create_select_options($thumb_pin_types, $thumb_pin_type); echo '</select></p>'; echo '<p class="gmw_thumb_pin_type_predefined"><label class="gmw-label" for="' . $this->get_field_id('thumb_pin_color') . '">' . __('Pin Color', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="Choose one of the predefined pin colors, or upgrade to <b class=\'gmw-pro-red\'>PRO</b> to have an unlimited choice of colors." id="' . $this->get_field_id('thumb_pin_color') . '" name="' . $this->get_field_name('thumb_pin_color') . '">'; GMW::create_select_options($thumb_pin_colors, $thumb_pin_color); echo '</select>'; echo '</p>'; echo '<p class="gmw_thumb_pin_type_predefined"><label class="gmw-label" for="' . $this->get_field_id('thumb_pin_size') . '">' . __('Pin Size', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="All sizes besides the large one are quite small." id="' . $this->get_field_id('thumb_pin_size') . '" name="' . $this->get_field_name('thumb_pin_size') . '">'; GMW::create_select_options($thumb_pin_sizes, $thumb_pin_size); echo '</select></p>'; echo '<p class="gmw_thumb_pin_type_predefined"><label class="gmw-label" for="' . $this->get_field_id('thumb_pin_label') . '">' . __('Pin Label', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="Due to pin\'s size, only single-letter labels are available." id="' . $this->get_field_id('thumb_pin_label') . '" name="' . $this->get_field_name('thumb_pin_label') . '">'; GMW::create_select_options($pin_labels, $thumb_pin_label); echo '</select></p>'; echo '<p class="gmw_thumb_pin_type_custom"><label class="gmw-label" for="' . $this->get_field_id('thumb_pin_img') . '">' . __('Pin Image URL', 'google-maps-widget') . ':</label>'; echo '<input data-tooltip="Enter the full URL to the image, starting with http://. Image has to be publicly accessible and with size up to 64x64px. Https and localhosts are *not* supported." placeholder="http://" type="url" class="regular-text" id="' . $this->get_field_id('thumb_pin_img') . '" name="' . $this->get_field_name('thumb_pin_img') . '" value="' . esc_attr($thumb_pin_img) . '">'; echo '</p>'; echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_link_type') . '">' . __('Link To', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="Choose what happens when the map is clicked. Clicks are tracked in Google Analytics if that option is enabled in settings (PRO only). Please configure interactive map\'s settings in its tab." class="gmw_thumb_link_type" id="' . $this->get_field_id('thumb_link_type') . '" name="' . $this->get_field_name('thumb_link_type') . '">'; GMW::create_select_options($thumb_link_types, $thumb_link_type); echo '</select></p>'; echo '<p class="gmw_thumb_link_section"><label class="gmw-label" for="' . $this->get_field_id('thumb_link') . '">' . __('Custom URL', 'google-maps-widget') . ':</label>'; echo '<input data-tooltip="Make sure the URL starts with http:// if it leads to a different site." placeholder="http://" class="regular-text" id="' . $this->get_field_id('thumb_link') . '" name="' . $this->get_field_name('thumb_link') . '" type="url" value="' . esc_attr($thumb_link) . '">'; echo '</p>'; echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_format') . '">' . __('Image Format', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="Jpg and jpg-baseline typically provide the smallest image size, though they do so through _lossy_ compression which may degrade the image. Gif, png8 and png32 provide lossless compression." id="' . $this->get_field_id('thumb_format') . '" name="' . $this->get_field_name('thumb_format') . '">'; GMW::create_select_options($thumb_formats, $thumb_format); echo '</select></p>'; echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_lang') . '">' . __('Map Language', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="Not all map labels and texts have translations. Everything is controlled by Google at their discretion. If you choose the auto-detect mode language will be detected from the users browser settings." id="' . $this->get_field_id('thumb_lang') . '" name="' . $this->get_field_name('thumb_lang') . '">'; GMW::create_select_options($thumb_langs, $thumb_lang); echo '</select></p>'; echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_hide_title') . '">' . __('Hide Widget Title', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="You can define a title for easier widgets management in admin but hide it with this option when the widget is displayed on site." id="' . $this->get_field_id('thumb_hide_title') . '" name="' . $this->get_field_name('thumb_hide_title') . '">'; GMW::create_select_options($hide_titles, $thumb_hide_title); echo '</select></p>'; echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_powered_by') . '">' . __('Show Appreciation', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="Please help others learn about GMW by placing a tiny link below the map. Thank you very much!" id="' . $this->get_field_id('thumb_powered_by') . '" name="' . $this->get_field_name('thumb_powered_by') . '">'; GMW::create_select_options($thumb_powered_bys, $thumb_powered_by); echo '</select></p>'; echo '<p><label for="' . $this->get_field_id('thumb_header') . '">' . __('Text Above Map', 'google-maps-widget') . ':</label>'; echo '<textarea placeholder="Any text; HTML and shortcodes are fully supported." data-tooltip="Text that appears above the map. HTML tags and shortcodes are fully supported. If you choose to have the thumb replaced by an interactive map (PRO only) this text will be replaced by the interactive header text. Use the _{address}_ variable to display the map\'s address." class="widefat" rows="1" cols="20" id="' . $this->get_field_id('thumb_header') . '" name="' . $this->get_field_name('thumb_header') . '">'. esc_textarea($thumb_header) . '</textarea></p>'; echo '<p><label for="' . $this->get_field_id('thumb_footer') . '">' . __('Text Below Map', 'google-maps-widget') . ':</label>'; echo '<textarea placeholder="Any text; HTML and shortcodes are fully supported." data-tooltip="Text that appears below the map. HTML tags and shortcodes are fully supported. If you choose to have the thumb replaced by an interactive map (PRO only) this text will be replaced by the interactive footer text. Use the _{address}_ variable to display the map\'s address." class="widefat" rows="1" cols="20" id="' . $this->get_field_id('thumb_footer') . '" name="' . $this->get_field_name('thumb_footer') . '">'. esc_textarea($thumb_footer) . '</textarea></p>'; echo '</div>'; // end - thumbnail tab // lightbox tab echo '<div id="gmw-lightbox">'; echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_fullscreen') . '">' . __('Lightbox Size', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="Choose from a custom size or the fullscreen, border-to-border option for the lightbox map." class="gmw_lightbox_fullscreen" id="' . $this->get_field_id('lightbox_fullscreen') . '" name="' . $this->get_field_name('lightbox_fullscreen') . '">'; GMW::create_select_options($lightbox_sizes, $lightbox_fullscreen); echo '</select>'; echo '<span class="gmw_lightbox_fullscreen_custom_section"><span class="gmw-label label-holder">&nbsp;</span>'; echo '<input data-title="Map Width" data-tooltip="Interactive map width in pixels; from 50 to 2000. If needed, map will be resized to accomodate for smaller screens." class="small-text fullscreen_fix" min="50" max="2000" step="1" id="' . $this->get_field_id('lightbox_width') . '" type="number" name="' . $this->get_field_name('lightbox_width') . '" value="' . esc_attr($lightbox_width) . '" required="required"> x '; echo '<input data-title="Map Height" data-tooltip="Interactive map height in pixels; from 50 to 2000. If needed, map will be resized to accomodate for smaller screens." class="small-text" id="' . $this->get_field_id('lightbox_height') . '" name="' . $this->get_field_name('lightbox_height') . '" type="number" step="1" min="50" max="2000" value="' . esc_attr($lightbox_height) . '" required="required"> px</span></p>'; echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_mode') . '">' . __('Map Mode', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="Place mode displays a map pin at a defined place or address. Directions mode displays the path between a start address defined below, and destination defined in the map\'s address. Search mode displays results for a search across the area around the map\'s address. View mode returns a map with no markers or directions; it produces a very clean map. Street View provides panoramic views on the designated location. Please note that it\'s not available on all locations." class="gmw_lightbox_mode" id="' . $this->get_field_id('lightbox_mode') . '" name="' . $this->get_field_name('lightbox_mode') . '">'; GMW::create_select_options($lightbox_modes, $lightbox_mode); echo '</select></p>'; echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_map_type') . '">' . __('Map Type', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="Controls the map layers shown." id="' . $this->get_field_id('lightbox_map_type') . '" name="' . $this->get_field_name('lightbox_map_type') . '">'; GMW::create_select_options($lightbox_map_types, $lightbox_map_type); echo '</select></p>'; echo '<p class="gmw_multiple_pins_feature"><label class="gmw-label" for="' . $this->get_field_id('lightbox_clustering') . '">' . __('Pins Clustering', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="Clustering enables pins grouping depending on their distances on the current view. It declutters the map when multiple pins are displayed. See it on <a href=\'https://www.gmapswidget.com/#examples\' target=\'_blank\'>Starbucks locations example</a>." id="' . $this->get_field_id('lightbox_clustering') . '" name="' . $this->get_field_name('lightbox_clustering') . '">'; GMW::create_select_options($lightbox_clustering_options, $lightbox_clustering); echo '</select></p>'; echo '<p class="gmw_multiple_pins_feature"><label class="gmw-label" for="' . $this->get_field_id('lightbox_filtering') . '">' . __('Pins Filtering', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="Filtering gives users the ability to show/hide pins based on group name(s) set for each pin. Additional GUI is displayed in the upper right corner of the map. See it in action on <a href=\'https://www.gmapswidget.com/#examples\' target=\'_blank\'>Restaurants in Manhattan</a>." id="' . $this->get_field_id('lightbox_filtering') . '" name="' . $this->get_field_name('lightbox_filtering') . '">'; GMW::create_select_options($lightbox_filtering_options, $lightbox_filtering); echo '</select></p>'; echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_zoom') . '">' . __('Zoom Level', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="Zoom varies from the lowest level, in which the entire world can be seen, to highest, which shows streets and individual buildings. Building outlines, where available, appear on the map around zoom level 17. This value differs from area to area." id="' . $this->get_field_id('lightbox_zoom') . '" name="' . $this->get_field_name('lightbox_zoom') . '">'; GMW::create_select_options($zoom_levels_lightbox, $lightbox_zoom); echo '</select></p>'; echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_skin') . '">' . __('Lightbox Skin', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="Controls the overall appearance of the lightbox, not the map itself. Adjust according to your site\'s design." class="gmw_lightbox_skin" id="' . $this->get_field_id('lightbox_skin') . '" name="' . $this->get_field_name('lightbox_skin') . '">'; GMW::create_select_options($lightbox_skins, $lightbox_skin); echo '</select></p>'; echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_feature') . '">' . __('Lightbox Features', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="Title is taken from the widget title field. Not all skins have a title, and the ones that do have it in different places, so please test your maps. Other 3 options control the way users close the lightbox. Enable at least one of them." class="gmw-select2" data-placeholder="' . __('Click to choose features', 'google-maps-widget') . '" multiple="multiple" id="' . $this->get_field_id('lightbox_feature') . '" name="' . $this->get_field_name('lightbox_feature') . '[]">'; GMW::create_select_options($lightbox_features, $lightbox_feature); echo '</select></p>'; echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_lang') . '">' . __('Map Language', 'google-maps-widget') . ':</label>'; echo '<select data-tooltip="Not all map labels and texts have translations. Everything is controlled by Google at their discretion. If you choose the auto-detect mode language will be detected from the users browser settings." id="' . $this->get_field_id('lightbox_lang') . '" name="' . $this->get_field_name('lightbox_lang') . '">'; GMW::create_select_options($lightbox_langs, $lightbox_lang); echo '</select></p>'; echo '<p><label for="' . $this->get_field_id('lightbox_header') . '">' . __('Text Above Map', 'google-maps-widget') . ':</label>'; echo '<textarea placeholder="Any text; HTML and shortcodes are fully supported." data-tooltip="Text that appears above the interactive map. HTML tags and shortcodes are fully supported. Use the _{address}_ variable to display the map\'s address." class="widefat" rows="1" cols="20" id="' . $this->get_field_id('lightbox_header') . '" name="' . $this->get_field_name('lightbox_header') . '">'. esc_textarea($lightbox_header) . '</textarea></p>'; echo '<p><label for="' . $this->get_field_id('lightbox_footer') . '">' . __('Text Below Map', 'google-maps-widget') . ':</label>'; echo '<textarea placeholder="Any text; HTML and shortcodes are fully supported." data-tooltip="Text that appears below the interactive map. HTML tags and shortcodes are fully supported. Use the _{address}_ variable to display the map\'s address." class="widefat" rows="1" cols="20" id="' . $this->get_field_id('lightbox_footer') . '" name="' . $this->get_field_name('lightbox_footer') . '">'. esc_textarea($lightbox_footer) . '</textarea></p>'; echo '</div>'; // end - lightbox tab // pins tab echo '<div id="gmw-pins">'; echo '<p>Multiple pins support is a <span class="gmw-pro-red">PRO</span> feature. It includes everything you need to display as many pins as needed on one map;</p>'; echo '<ul class="normal">'; echo '<li>per-pin control for all settings</li>'; echo '<li>library of 1500+ pins &amp; support for custom pins</li>'; echo '<li>pins clustering for decluttering maps</li>'; echo '<li>pins grouping with front-end filtering control</li>'; echo '<li>unlimited pins import</li>'; echo '<li>numerous "on pin click" actions including custom HTML info boxes</li>'; echo '</ul>'; echo '<p>If one location per map is all you need, please enter the address in the address field above.</p>'; echo '<p><br><a class="button open_promo_dialog" href="#">Activate <span class="gmw-pro-red">PRO</span> features NOW</a></p>'; echo '</div>'; // end - pins tab // shortcode tab echo '<div id="gmw-shortcode">'; echo '<p>Shortcode support is a <span class="gmw-pro-red">PRO</span> feature. It enables you to place maps anywhere in content; including pages, posts and custom post types. Besides the shortcode feature you will get 50 extra options and features.</p><p><br><a class="button open_promo_dialog" href="#">Activate <span class="gmw-pro-red">PRO</span> features NOW</a></p>'; echo '</div>'; // end - shortcode tab // info tab echo '<div id="gmw-info">'; echo '<h4>' . __('Support', 'google-maps-widget') . '</h4>'; echo '<p>If you have any problems, questions or would like a new feature added post it on the <a href="https://wordpress.org/support/plugin/google-maps-widget" target="_blank">official support forum</a>. It\'s the only place to get support. Since it\'s free and community powered please be patient.<br>'; echo 'If you <a href="#" class="open_promo_dialog">upgrade</a> to <span class="gmw-pro-red">PRO</span> you will get instant access to premium, prioritised support via email.</p>'; echo '<h4>' . __('Activate <span class="gmw-pro-red">PRO</span> features', 'google-maps-widget') . '</h4>'; echo '<p><span class="gmw-pro-red">PRO</span> features give you access to priority support and more than 50 extra options &amp; features including shortcode support, additional map types, more map skins and a host of other additional features.'; echo ' <a class="open_promo_dialog" href="#">Activate PRO features NOW</a>'; echo '</p>'; echo '<h4>' . __('Rate the plugin &amp; spread the word', 'google-maps-widget') . '</h4>'; echo '<p>It won\'t take you more than a minute, but it will help us immensely. So please - <a href="https://wordpress.org/support/view/plugin-reviews/google-maps-widget" target="_blank">rate the plugin</a>. Or spread the word by <a href="https://twitter.com/intent/tweet?via=WebFactoryLtd&amp;text=' . urlencode('I\'m using the #free Google Maps Widget for #wordpress. You can grab it too at http://goo.gl/2qcbbf') . '" target="_blank">tweeting about it</a>. Thank you!</p>'; echo '</div>'; // end - info tab echo '</div><p></p>'; // tabs echo '<p class="widget_footer_info">' . __('Upgrade to Google Maps Widget <span class="gmw-pro-red">PRO</span> to get more than 50 extra options &amp; features available immeditely. <a class="open_promo_dialog" href="#">Upgrade now</a>.', 'google-maps-widget') . '</p>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function webpinas_google_location_form() {\r\n webpinas_location_form_html();\r\n}", "function wpcf_fields_google_map_editor_callback( $field, $settings ) {\n ob_start();\n\n ?>\n <label><input type=\"text\" name=\"width\" value=\"<?php echo isset( $settings['width'] ) ? $settings['width'] : '425'; ?>\" />&nbsp;<?php _e( 'Width', 'wpcf' ); ?></label>\n <br />\n <label><input type=\"text\" name=\"height\" value=\"<?php echo isset( $settings['height'] ) ? $settings['height'] : '350'; ?>\" />&nbsp;<?php _e( 'Height', 'wpcf' ); ?></label>\n <?php\n $form = ob_get_contents();\n ob_get_clean();\n return array(\n 'tabs' => array(\n 'display' => array(\n 'menu_title' => __( 'Display', 'wpcf' ),\n 'title' => __( 'Display', 'wpcf' ),\n 'content' => $form,\n )\n )\n );\n}", "function rsmaps_render_form() {\n ?>\n <div class=\"wrap\">\n\n <!-- Beginning of the Responsive Styled Gooogle Maps helper form -->\n <form method=\"post\" action=\"\">\n\n <script type=\"text/javascript\">\n // At page load, initialize the color picker and also update the mnap preview.\n var pluginurl = \"<?php echo plugins_url(); ?>\";\n jQuery(document).ready(function($) {\n initColorPicker();\n updateMap(pluginurl);\n });\n \n </script>\n \n <!-- Table Structure Containing shorcode parameters -->\n <table border=\"0\" style=\"table-layout: fixed;\" cellpadding=\"5\">\n <!-- Logo and plugin title -->\n <tr>\n <td scope=\"row\">\n <a href=\"http://codecanyon.net/user/greenline\" target=\"_blank\">\n <img src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/img/logo.png\" id=\"logo\" width=\"40\" height=\"40\">\n </a>\n </td>\n <td width=\"300px\" valign=\"top\">\n <h2>Responsive Styled Google Maps - Helper</h2>\n </td>\n </tr>\n \n <!-- Address, the map and the shortcode -->\n <tr>\n <td scope=\"row\" width=\"170px\" align=\"left\" valign=\"top\">Address or addresses</td>\n <td width=\"300px\" valign=\"top\">\n <textarea name=\"address\" id=\"address\" rows=\"3\" cols=\"90\" type='textarea' onblur=\"updateMap(pluginurl)\">Yeronga QLD 4104, Australia</textarea><br>\n <span class=\"info\">For multiple markers use: address1 | address2 | address3 OR lat1, long1 | lat2, long2 | lat3, long3</span>\n </td>\n <td rowspan=\"15\" valign=\"top\" valign=\"top\" width=\"500px\">\n <div id=\"responsive_map\" class=\"responsive-map\" style=\"height:500px;width:500px;\"></div>\n <span class=\"info\">Note: In this preview, width and height remain unchanged.</span>\n <br><br><div class=\"preheader\">COPY IN YOUR POST / PAGE /WIDGET THE SHORTCODE GENERATED :</div>\n <pre id=\"shortcode\" onClick=\"selectText('shortcode')\"></pre>\n <!-- Update map button -->\n <a href=\"javascript: updateMap(pluginurl);\" class=\"glbutton\">UPDATE MAP</a>\n </td>\n </tr>\n\n <!-- Marker Description -->\n <tr>\n <td scope=\"row\" align=\"left\" valign=\"top\">Marker(s) description(s)</td>\n <td valign=\"top\">\n <textarea name=\"pdescription\" id=\"pdescription\" rows=\"3\" cols=\"90\" type='textarea' onblur=\"updateMap(pluginurl)\"><img src=\"http://yava.ro/images/company.png\"> {br} Yeronga QLD 4104, Australia {br} Phone: 0040 752 235 756</textarea><br>\n <span class=\"info\">For multiple markers use: description1 | description2 | description3 and {br} for a new line</span><br>\n </td>\n </tr>\n\n <!-- Directions text -->\n <tr>\n <td scope=\"row\" align=\"left\" valign=\"top\">Directions text</td>\n <td>\n <input type=\"text\" size=\"93\" name=\"directions\" id=\"directions\" value=\"(directions to our address)\" onblur=\"updateMap(pluginurl)\" />\n <span class=\"info\">No HTML code, just text.</span><br>\n </td>\n\n </tr>\n\n <!-- Marker icon color -->\n <tr>\n <td scope=\"row\" align=\"left\" valign=\"top\">Marker(s) icon</td>\n <td valign=\"bottom\">\n <label><input name=\"color\" id=\"color\" type=\"radio\" value=\"black\" onclick=\"updateMap(pluginurl)\" /> <img src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/icons/black.png\"> </label>\n <label><input name=\"color\" id=\"color\" type=\"radio\" value=\"blue\" onclick=\"updateMap(pluginurl)\" /> <img src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/icons/blue.png\"> </label>\n <label><input name=\"color\" id=\"color\" type=\"radio\" value=\"gray\" onclick=\"updateMap(pluginurl)\" /> <img src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/icons/gray.png\"> </label>\n <label><input name=\"color\" id=\"color\" type=\"radio\" value=\"green\" onclick=\"updateMap(pluginurl)\" checked/> <img src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/icons/green.png\"> </label>\n <label><input name=\"color\" id=\"color\" type=\"radio\" value=\"magenta\" onclick=\"updateMap(pluginurl)\" /> <img src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/icons/magenta.png\"> </label>\n <label><input name=\"color\" id=\"color\" type=\"radio\" value=\"orange\" onclick=\"updateMap(pluginurl)\" /> <img src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/icons/orange.png\"> </label>\n <label><input name=\"color\" id=\"color\" type=\"radio\" value=\"purple\" onclick=\"updateMap(pluginurl)\" /> <img src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/icons/purple.png\"> </label>\n <label><input name=\"color\" id=\"color\" type=\"radio\" value=\"red\" onclick=\"updateMap(pluginurl)\" /> <img src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/icons/red.png\"> </label>\n <label><input name=\"color\" id=\"color\" type=\"radio\" value=\"white\" onclick=\"updateMap(pluginurl)\" /> <img src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/icons/white.png\"> </label>\n <label><input name=\"color\" id=\"color\" type=\"radio\" value=\"yellow\" onclick=\"updateMap(pluginurl)\" /> <img src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/icons/yellow.png\"> </label>\n </td>\n </tr>\n <!-- Marker icon url -->\n <tr>\n <tr>\n <td scope=\"row\" align=\"left\" valign=\"top\">Or custom icon(s)</td>\n <td>\n <textarea name=\"iconurl\" id=\"iconurl\" rows=\"3\" cols=\"90\" type='textarea' onblur=\"updateMap(pluginurl)\">http://yava.ro/icons/car.png</textarea><br>\n <span class=\"info\">For multiple icons, separate the links with | (pipe) symbol like this: <br>http://yava.ro/icons/car.png | http://yava.ro/icons/sailboat.png</span>\n </td>\n </tr>\n </tr>\n\n <!-- Map color -->\n <tr>\n <td scope=\"row\" align=\"left\" valign=\"middle\">Map color</td>\n <td valign=\"top\">\n <label><input name=\"colorType\" id=\"colorType\" type=\"radio\" value=\"bw\" onclick=\"updateMap(pluginurl)\" checked /> black & white </label>\n <label><input name=\"colorType\" id=\"colorType\" type=\"radio\" value=\"classic\" onclick=\"updateMap(pluginurl)\" /> classic </label> \n <label><input name=\"colorType\" id=\"colorType\" type=\"radio\" value=\"colored\" style=\"background-color: #efe725 !important;\" onclick=\"updateMap(pluginurl)\" /> colored </label>\n <input id=\"mapColor\" name=\"mapColor\" type=\"text\" size=\"23\" value=\"#efe725\" onblur=\"updateMap(pluginurl);\" onClick=\"javascript: jQuery('input:radio[id=colorType]')[2].checked = true;updateMap(pluginurl);\" />\n <div id=\"color-picker\" rel=\"mapColor\"></div>\n </td>\n </tr>\n\n <!-- Controls -->\n <tr>\n <td scope=\"row\" align=\"left\">Controls</td>\n <td>\n Pan control \n <select name='panControl' id='panControl' onchange=\"updateMap(pluginurl)\">>\n <option value='' selected>no</option>\n <option value='true'>yes</option>\n </select>\n Scale control\n <select name='scaleControl' id='scaleControl' onchange=\"updateMap(pluginurl)\">>\n <option value='' selected>no</option>\n <option value='true'>yes</option>\n </select>\n Type control\n <select name='typeControl' id='typeControl' onchange=\"updateMap(pluginurl)\">>\n <option value='' selected>no</option>\n <option value='true'>yes</option>\n </select>\n Street control\n <select name='streetControl' id='streetControl' onchange=\"updateMap(pluginurl)\">>\n <option value='' selected>no</option>\n <option value='true'>yes</option>\n </select>\n </td>\n </tr>\n\n <!-- Zoom -->\n <tr>\n <td scope=\"row\" align=\"left\">Zoom</td>\n <td>\n Zoom level &nbsp;\n <select name=\"zoom\" id=\"zoom\" onchange=\"updateMap(pluginurl)\">\n <option value='1'>1</option>\n <option value='2'>2</option>\n <option value='3'>3</option>\n <option value='4'>4</option>\n <option value='5'>5</option>\n <option value='6'>6</option>\n <option value='7'>7</option>\n <option value='8'>8</option>\n <option value='9'>9</option>\n <option value='10'>10</option>\n <option value='11'>11</option>\n <option value='12'>12</option>\n <option value='13'>13</option>\n <option value='14' selected>14</option>\n <option value='15'>15</option>\n <option value='16'>16</option>\n <option value='17'>17</option>\n <option value='18'>18</option>\n <option value='19'>19</option>\n </select>\n Zoom control\n <select name='zoomControl' id='zoomControl' onchange=\"updateMap(pluginurl)\">>\n <option value='' selected>no</option>\n <option value='true'>yes</option>\n </select>\n Draggable\n <select name='draggable' id='draggable' onchange=\"updateMap(pluginurl)\">>\n <option value=''>no</option>\n <option value='true' selected>yes</option>\n </select>\n Scrollwheel\n <select name='scrollwheel' id='scrollwheel' onchange=\"updateMap(pluginurl)\">>\n <option value='' selected>no</option>\n <option value='true'>yes</option>\n </select>\n </td>\n </tr>\n\n <!-- Width -->\n <tr>\n <td scope=\"row\" align=\"left\">Map width</td>\n <td>\n <input type=\"text\" size=\"6\" name=\"width\" id=\"width\" value=\"100\" onblur=\"updateMap(pluginurl)\"/>\n <select name='widthm' id='widthm' onchange=\"updateMap(pluginurl)\">\n <option value='%' selected>%</option>\n <option value='px'>px</option>\n </select>\n <span class=\"info\">Set to 100% to make the map responsive.</span>\n </td>\n </tr>\n\n <!-- Height -->\n <tr>\n <td scope=\"row\" align=\"left\">Map height</td>\n <td>\n <input type=\"text\" size=\"6\" name=\"height\" id=\"height\" value=\"500\" onblur=\"updateMap(pluginurl)\"/>\n <select name='heightm' id='heightm' onchange=\"updateMap(pluginurl)\">\n <option value='%'>%</option>\n <option value='px' selected>px</option>\n </select>\n <span class=\"info\">(in px or %) It's best to give width in % and height in px.</span>\n </td>\n </tr>\n\n <!-- Map Type -->\n <tr>\n <td scope=\"row\" align=\"left\">Map type</td>\n <td>\n <select name='type' id=\"type\" style=\"width:113px;\" onchange=\"updateMap(pluginurl)\">\n <option value='roadmap' selected>roadmap</option>\n <option value='satellite'>satellite</option>\n <option value='terrain'>terrain</option>\n <option value='hybrid'>hybrid</option>\n </select>\n <span class=\"info\">Possible values: roadmap, satellite, terrain or hybrid</span>\n </td>\n </tr>\n\n <!-- Popup -->\n <tr>\n <td scope=\"row\" align=\"left\">Popup window</td>\n <td>\n <select name='popup' id=\"popup\" style=\"width:113px;\" onchange=\"updateMap(pluginurl)\">\n <option value=''>hidden</option>\n <option value='true' selected>visible</option>\n </select>\n <span class=\"info\">The popup window which appears when a marker is clicked.</span>\n </td>\n </tr>\n\n <!-- Map center -->\n <tr>\n <td scope=\"row\" width=\"200px\" align=\"left\">Center map to</td>\n <td width=\"300px\">\n <input type=\"text\" size=\"40\" name=\"center\" id=\"center\" value=\"\" onblur=\"updateMap(pluginurl);\"/>\n <span class=\"info\">latitude, longitude i.e. 38.980288, 22.145996 </span>\n </td>\n </tr>\n \n <!-- Map refresh (when window is scaled) -->\n <tr>\n <td scope=\"row\" width=\"200px\" align=\"left\">Refresh map</td>\n <td width=\"300px\">\n <select name='refresh' id='refresh' onchange=\"updateMap(pluginurl)\">>\n <option value='' selected>no</option>\n <option value='true'>yes</option>\n </select>\n <span class=\"info\"> select \"yes\" if the map should be refreshed (re-centered) when the window is scaled </span>\n </td>\n </tr>\n \n \n\n </table>\n </form>\n </div>\n\n <style type=\"text/css\">\n pre {\n white-space: pre-wrap; /* css-3 */\n white-space: -moz-pre-wrap; /* Mozilla, since 1999 */\n white-space: -pre-wrap; /* Opera 4-6 */\n white-space: -o-pre-wrap; /* Opera 7 */\n word-wrap: break-word; /* Internet Explorer 5.5+ */\n background-color: #2F343A;\n color: #eeeeee;\n margin-top: 1px;\n margin-bottom: 1px;\n padding: 10px;\n cursor: text;\n }\n .preheader {\n background-color: #2BB4A0;\n color: #ffffff;\n padding: 10px;\n font-family: arial;\n font-weight: bold;\n border-bottom: 1px solid #CCCCCC;\n }\n select#style {\n background-color: #eeeeee;\n border: 1px solid #DD7127;\n font-weight: bold;\n }\n .info {\n font-style: italic;\n color: #555555;\n font-size: 11px;\n }\n img#logo {\n padding: 1px;\n }\n /* Button */\n .glbutton:link {\n -moz-box-shadow: inset 0px 1px 0px 0px #ffffff;\n -webkit-box-shadow: inset 0px 1px 0px 0px #ffffff;\n box-shadow: inset 0px 1px 0px 0px #ffffff;\n background-color: #2bb49f;\n -moz-border-radius: 6px;\n -webkit-border-radius: 6px;\n border-radius: 6px;\n border: 1px solid #dcdcdc;\n display: inline-block;\n color: #ffffff;\n font-family: arial;\n font-size: 16px;\n font-weight: bold;\n padding: 6px 10px 4px 10px;\n margin: 10px 6px 7px 0;\n text-decoration: none;\n }\n .glbutton:hover {\n background-color: #77b0a8;\n color: #ffffff !important;\n }\n .glbutton:active, .glbutton:visited {\n position:relative;\n top:1px;\n color: #ffffff !important;\n }\n /* Marker settings */\n .gm-style-iw {\n overflow-y: hidden !important;\n overflow-x: hidden !important;\n }\n .gm-style a:link, \n .gm-style a:visited, \n .gm-style a:hover, \n .gm-style a:active {\n text-decoration: underline !important;\n color: #000000 !important;\n }\n .gm-style img {\n border: 0;\n max-width: none !important;\n -webkit-box-shadow: none !important;\n -moz-box-shadow: none !important;\n box-shadow: none !important;\n }\n </style>\n<?php\n}", "function geolocation_editor() {\n parent::WP_Widget(false, $name = 'Geo-Location Editor');\t\n }", "function edit()\n\t{\n\t\tJRequest::setVar( 'view', 'map' );\n\t\tJRequest::setVar( 'layout', 'form' );\n\t\tJRequest::setVar('hidemainmenu', 1);\n\n\t\tparent::display();\n\t}", "function gmapper_render_widget_gmap($matches){\n\treturn gmapper_render_single_gmap($matches,false);\n}", "function wpcf_fields_google_map_insert_form() {\n $form['additional'] = array(\n '#type' => 'textfield',\n '#description' => 'Add some comment',\n '#name' => 'comment',\n );\n return $form;\n}", "function wpcf_fields_google_map_editor_submit( $data, $field ) {\n $add = '';\n\n // Add parameters\n if ( !empty( $data['width'] ) ) {\n $add .= ' width=\"' . strval( $data['width'] ) . '\"';\n }\n if ( !empty( $data['height'] ) ) {\n $add .= ' height=\"' . strval( $data['height'] ) . '\"';\n }\n\n // Generate and return shortcode\n return wpcf_fields_get_shortcode( $field, $add );\n}", "function wpcf_fields_google_map_meta_box_form( $data ) {\n $form['name'] = array(\n '#name' => 'wpcf[' . $data['slug'] . ']', // Set this to override default output\n '#type' => 'textfield',\n '#title' => __( 'Add Google Map coordinates', 'wpcf' ),\n '#description' => __( 'Your input should look something like \"41.934146,12.455821\"', 'wpcf' )\n );\n return $form;\n}", "function wpcf_fields_google_map_view( $data ) {\n $data['width'] = !empty( $data['width'] ) ? $data['width'] : 425;\n $data['height'] = !empty( $data['height'] ) ? $data['height'] : 350;\n return '<iframe width=\"' . $data['width'] . '\" height=\"' . $data['height']\n . '\" frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\" src=\"http://maps.google.com/maps?q='\n . $data['field_value']\n . '&amp;num=1&amp;vpsrc=0&amp;hl=en&amp;ie=UTF8&amp;t=m&amp;z=14&amp;ll='\n . $data['field_value']\n . '&amp;output=embed\"></iframe><br /><small><a href=\"http://maps.google.com/maps?q='\n . $data['field_value']\n . '&amp;num=1&amp;vpsrc=0&amp;hl=en&amp;ie=UTF8&amp;t=m&amp;z=14&amp;ll='\n . $data['field_value']\n . '&amp;source=embed\" style=\"color:#0000FF;text-align:left\">'\n . __( 'View Larger Map', 'wpcf' )\n . '</a></small><br />';\n}", "function action_add_gravity_forms_map_field_setting(){\n ?>\n <script type='text/javascript'>\n //adding setting to fields of type \"text\"\n fieldSettings[\"text\"] += \", .field_map_setting\";\n fieldSettings[\"email\"] += \", .field_map_setting\";\n fieldSettings[\"textarea\"] += \", .field_map_setting\";\n\n //binding to the load field settings event to initialize the checkbox\n jQuery(document).bind(\"gform_load_field_settings\", function(event, field, form){\n\n jQuery(\"#field_field_map_value\").val(field[\"field_mapField\"]);\n });\n </script>\n <?php\n }", "static public function render_location_map_input( $row_id, $default_coords, $args ) {?>\n\n <div id=\"wpp_feps_map_<?php echo $row_id; ?>\" class=\"wpp_feps_map\" style=\"width: 100%; height: <?php echo $args['map_height']; ?>px;\"><?php _e('There is a JavaScript error on this page preventing it from displaying the dynamic map.', ud_get_wpp_feps()->domain); ?></div>\n\n <?php ob_start(); ?>\n <script type=\"text/javascript\">\n\n function empty( mixed_var ) {\n return ( mixed_var === \"\" || mixed_var === 0 || mixed_var === \"0\" || mixed_var === null || mixed_var === false );\n }\n\n jQuery(document).ready(function() {\n\n /* Check if Google Maps is loaded */\n if(typeof google == 'undefined' || typeof google.maps == 'undefined' || typeof qq == 'undefined') {\n return;\n }\n\n jQuery('#wpp_feps_map_<?php echo $row_id; ?>').gmap({'zoom':10, 'center': new google.maps.LatLng(<?php echo $default_coords['latitude'] ?>,<?php echo $default_coords['longitude'] ?>)});\n jQuery(\"<?php echo \"#wpp_{$row_id}_input\"; ?>\").change(function() {\n var location_string = jQuery.trim( jQuery(this).val() );\n jQuery('div.location_result_<?php echo $row_id; ?>').hide();\n if ( !empty(location_string) ) {\n jQuery('#wpp_feps_map_<?php echo $row_id; ?>').gmap('search', { 'address': location_string }, function(isFound,results) {\n if (isFound){\n jQuery('#wpp_feps_map_<?php echo $row_id; ?>').gmap('getMap').panTo(results[0].geometry.location);\n jQuery('#wpp_feps_map_<?php echo $row_id; ?>').gmap({'zoom':14});\n jQuery('#wpp_feps_map_<?php echo $row_id; ?>').gmap('clearMarkers');\n jQuery('#wpp_feps_map_<?php echo $row_id; ?>').gmap('addMarker', {'title':results[0].formatted_address, 'position': new google.maps.LatLng(results[0].geometry.location.lat(), results[0].geometry.location.lng()) } );\n jQuery(\"#wpp_feps_map_<?php echo $row_id; ?>\").show();\n jQuery('div.location_result_<?php echo $row_id; ?>').text(\"<?php _e('Your location has been successfully found by Google Maps.', ud_get_wpp_feps()->domain); ?>\").addClass('wpp_feps_loc_found').removeClass('wpp_feps_loc_not_found').show();\n } else {\n jQuery(\"<?php echo \"#wpp_{$row_id}_input\"; ?>\").val('');\n jQuery('div.location_result_<?php echo $row_id; ?>').text(\"<?php _e('Your address could not be found, please try again.', ud_get_wpp_feps()->domain); ?>\").addClass('wpp_feps_loc_not_found').removeClass('wpp_feps_loc_found').show();\n }\n });\n }\n }).change();\n });\n </script>\n <?php $output_js = ob_get_contents(); ob_end_clean(); echo $output_js; ?>\n <div class=\"location_result_<?php echo $row_id; ?>\"></div>\n <?php\n }", "function get_widget_form() {\n\t\t\treturn apply_filters('trx_addons_sow_map', array_merge(\n\t\t\t\tarray(\n\t\t\t\t\t'type' => array(\n\t\t\t\t\t\t'label' => __('Layout', 'trx_addons'),\n\t\t\t\t\t\t\"description\" => wp_kses_data( __(\"Select shortcodes's type\", 'trx_addons') ),\n\t\t\t\t\t\t'default' => 'default',\n\t\t\t\t\t\t'options' => apply_filters('trx_addons_sc_type', array(\n\t\t\t\t\t\t\t'default' => esc_html__('Default', 'trx_addons')\n\t\t\t\t\t\t), $this->get_sc_name()),\n\t\t\t\t\t\t'type' => 'select'\n\t\t\t\t\t),\n\t\t\t\t\t\"height\" => array(\n\t\t\t\t\t\t\"label\" => esc_html__(\"Height of the block\", 'trx_addons'),\n\t\t\t\t\t\t\"description\" => wp_kses_data( __(\"Specify height of this block. If empty - use default height\", 'trx_addons') ),\n\t\t\t\t\t\t\"type\" => \"measurement\"\n\t\t\t\t\t),\n\t\t\t\t\t\"align\" => array(\n\t\t\t\t\t\t\"label\" => esc_html__(\"Content alignment\", 'trx_addons'),\n\t\t\t\t\t\t\"description\" => wp_kses_data( __(\"Select alignment of the inner content in this block\", 'trx_addons') ),\n\t\t\t\t\t\t\"options\" => trx_addons_get_list_sc_aligns(true, false),\n\t\t\t\t\t\t\"default\" => \"inherit\",\n\t\t\t\t\t\t\"type\" => \"select\"\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\ttrx_addons_sow_add_hide_param(false, true),\n\t\t\t\ttrx_addons_sow_add_id_param()\n\t\t\t), $this->get_sc_name());\n\t\t}", "function __construct() {\r\n $title = __('Google Maps Widget', 'google-maps-widget');\r\n\r\n $widget_ops = array('classname' => 'google-maps-widget', 'description' => __('Displays a map image thumbnail with a larger map available in a lightbox.', 'google-maps-widget'), 'customize_selective_refresh' => true);\r\n $control_ops = array('width' => 450, 'height' => 350);\r\n parent::__construct('GoogleMapsWidget', $title, $widget_ops, $control_ops);\r\n\r\n self::$defaults['title'] = __('Map', 'google-maps-widget');\r\n self::$defaults['address'] = __('New York, USA', 'google-maps-widget');\r\n }", "function careerfy_vc_google_map_shortcode()\n{\n\n global $jobsearch_plugin_options;\n $location_map_type = isset($jobsearch_plugin_options['location_map_type']) ? $jobsearch_plugin_options['location_map_type'] : '';\n\n if ($location_map_type == 'mapbox') {\n $map_style_desc = __(\"Set map style URL here.\", \"careerfy-frame\");\n } else {\n $map_style_desc = __(\"Set map styles. You can get predefined styles from <a href=\\\"https://snazzymaps.com/\\\" target=\\\"_blank\\\">snazzymaps.com</a>\", \"careerfy-frame\");\n }\n\n $shortcode_params = array();\n $shortcode_params[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Box Address\", \"careerfy-frame\"),\n 'param_name' => 'map_box_address',\n 'value' => '',\n 'description' => esc_html__(\"Set infobox Address for map.\", \"careerfy-frame\"),\n );\n $shortcode_params[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Latitude\", \"careerfy-frame\"),\n 'param_name' => 'map_latitude',\n 'value' => '',\n 'description' => esc_html__(\"Set Latitude of map.\", \"careerfy-frame\"),\n );\n $shortcode_params[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Longitude\", \"careerfy-frame\"),\n 'param_name' => 'map_longitude',\n 'value' => '',\n 'description' => esc_html__(\"Set Longitude of map.\", \"careerfy-frame\"),\n );\n $shortcode_params[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Zoom\", \"careerfy-frame\"),\n 'param_name' => 'map_zoom',\n 'value' => '',\n 'description' => esc_html__(\"Set Zoom for map.\", \"careerfy-frame\"),\n );\n $shortcode_params[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Height\", \"careerfy-frame\"),\n 'param_name' => 'map_height',\n 'value' => '350',\n 'description' => esc_html__(\"Set Height for map.\", \"careerfy-frame\"),\n );\n if ($location_map_type != 'mapbox') {\n $shortcode_params[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Street View\", \"careerfy-frame\"),\n 'param_name' => 'map_street_view',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => '',\n 'group' => __('Map Settings', 'careerfy-frame'),\n );\n }\n\n $shortcode_params[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Scroll Wheel control\", \"careerfy-frame\"),\n 'param_name' => 'map_scrollwheel',\n 'value' => array(\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n ),\n 'description' => '',\n 'group' => __('Map Settings', 'careerfy-frame'),\n );\n if ($location_map_type != 'mapbox') {\n $shortcode_params[] = array(\n 'type' => 'dropdown',\n 'heading' => esc_html__(\"Disable Map Type\", \"careerfy-frame\"),\n 'param_name' => 'map_default_ui',\n 'value' => array(\n esc_html__(\"No\", \"careerfy-frame\") => 'no',\n esc_html__(\"Yes\", \"careerfy-frame\") => 'yes',\n ),\n 'group' => __('Map Settings', 'careerfy-frame'),\n 'description' => ''\n );\n }\n $shortcode_params[] = array(\n 'type' => 'careerfy_browse_img',\n 'heading' => esc_html__(\"Marker Icon\", \"careerfy-frame\"),\n 'param_name' => 'map_marker',\n 'value' => '',\n 'description' => esc_html__(\"Put custom marker icon for map.\", \"careerfy-frame\"),\n );\n\n $shortcode_params[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Box Title\", \"careerfy-frame\"),\n 'param_name' => 'map_box_title',\n 'value' => '',\n 'description' => esc_html__(\"Set infobox title for map.\", \"careerfy-frame\"),\n );\n\n\n $shortcode_params[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Box Telephone\", \"careerfy-frame\"),\n 'param_name' => 'map_box_phone',\n 'value' => '',\n 'description' => esc_html__(\"Set infobox Telephone for map.\", \"careerfy-frame\"),\n );\n\n $shortcode_params[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Box Email\", \"careerfy-frame\"),\n 'param_name' => 'map_box_email',\n 'value' => '',\n 'description' => esc_html__(\"Set infobox Email for map.\", \"careerfy-frame\"),\n );\n\n $shortcode_params[] = array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Box Website\", \"careerfy-frame\"),\n 'param_name' => 'map_box_website',\n 'value' => '',\n 'description' => esc_html__(\"Set infobox Website for map.\", \"careerfy-frame\"),\n );\n\n $shortcode_params[] = array(\n 'type' => ($location_map_type == 'mapbox' ? 'textfield' : 'textarea'),\n 'heading' => ($location_map_type == 'mapbox' ? esc_html__(\"Style URL\", \"careerfy-frame\") : esc_html__(\"Styles\", \"careerfy-frame\")),\n 'param_name' => 'map_styles',\n 'value' => '',\n 'description' => $map_style_desc,\n 'group' => __('Map Settings', 'careerfy-frame'),\n );\n\n $attributes = array(\n \"name\" => esc_html__(\"Careerfy Map\", \"careerfy-frame\"),\n \"base\" => \"careerfy_google_map_shortcode\",\n \"category\" => esc_html__(\"Careerfy Theme\", \"careerfy-frame\"),\n \"as_parent\" => array('only' => 'careerfy_map_item'),\n \"content_element\" => true,\n \"show_settings_on_create\" => false,\n \"is_container\" => true,\n \"params\" => $shortcode_params,\n \"js_view\" => 'VcColumnView'\n );\n\n if (function_exists('vc_map')) {\n vc_map($attributes);\n }\n\n $attributes = array(\n \"name\" => esc_html__(\"Map Marker\", \"careerfy-frame\"),\n \"base\" => \"careerfy_map_item\",\n \"content_element\" => true,\n \"as_child\" => array('only' => 'careerfy_google_map_shortcode'),\n \"show_settings_on_create\" => true,\n \"params\" => array(\n // add params same as with any other content element\n array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Box Title\", \"careerfy-frame\"),\n 'param_name' => 'map_box_title',\n 'value' => '',\n 'description' => esc_html__(\"Set info box title for map.\", \"careerfy-frame\"),\n ),\n array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Latitude\", \"careerfy-frame\"),\n 'param_name' => 'map_latitude',\n 'value' => '',\n 'description' => esc_html__(\"Set Latitude.\", \"careerfy-frame\"),\n ),\n array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Longitude\", \"careerfy-frame\"),\n 'param_name' => 'map_longitude',\n 'value' => '',\n 'description' => esc_html__(\"Set Longitude.\", \"careerfy-frame\"),\n ),\n array(\n 'type' => 'careerfy_browse_img',\n 'heading' => esc_html__(\"Marker Icon\", \"careerfy-frame\"),\n 'param_name' => 'map_marker',\n 'value' => '',\n 'description' => esc_html__(\"Put custom marker icon for map.\", \"careerfy-frame\"),\n ),\n array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Box Address\", \"careerfy-frame\"),\n 'param_name' => 'map_box_address',\n 'value' => '',\n 'description' => esc_html__(\"Set infobox Address for map.\", \"careerfy-frame\"),\n ),\n array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Box Telephone\", \"careerfy-frame\"),\n 'param_name' => 'map_box_phone',\n 'value' => '',\n 'description' => esc_html__(\"Set infobox Telephone for map.\", \"careerfy-frame\"),\n ),\n array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Box Email\", \"careerfy-frame\"),\n 'param_name' => 'map_box_email',\n 'value' => '',\n 'description' => esc_html__(\"Set infobox Email for map.\", \"careerfy-frame\"),\n ),\n array(\n 'type' => 'textfield',\n 'heading' => esc_html__(\"Box Website\", \"careerfy-frame\"),\n 'param_name' => 'map_box_website',\n 'value' => '',\n 'description' => esc_html__(\"Set infobox Website for map.\", \"careerfy-frame\"),\n ),\n ),\n );\n if (function_exists('vc_map')) {\n vc_map($attributes);\n }\n\n if (class_exists('WPBakeryShortCodesContainer')) {\n\n class WPBakeryShortCode_Careerfy_Google_Map_Shortcode extends WPBakeryShortCodesContainer\n {\n\n }\n\n }\n if (class_exists('WPBakeryShortCode')) {\n\n class WPBakeryShortCode_Careerfy_Map_Item extends WPBakeryShortCode\n {\n\n }\n\n }\n}", "function adace_register_places_widget() {\n\tregister_widget( 'Adace_Places_Widget' );\n}", "public function widget( $args, $instance ) {\n\t\techo \"Hello ITAS Map Widget!\";\t\n\n?>\n\n<script>\n\n var map;\n var myMarkers = [];\n\n function initMap() {\n var nanaimo = {lat: 49.159700, lng: -123.907750};\n map = new google.maps.Map(document.getElementById('itasmap'), {\n zoom: 13,\n center: nanaimo\n });\n\n\t<?php\n\n\t\t$post_list = get_posts( array(\n \t\t \t'orderby' => 'menu_order',\n \t\t'sort_order' => 'asc'\n\t\t) );\n \n\t\t$posts = array();\n \n\t\tforeach ( $post_list as $post ) {\n\n\t\t\t$print = \"ID: \" . $post->ID . \" Title: \" . $post->post_title;\n\n\t\t\t// we have to retrieve the custom field as 'meta' data\n\t\t\n\n\t\t\t$lat = get_post_meta($post->ID, 'lat', true);\n $long = get_post_meta($post->ID, 'long', true);\n\n $print .= \" Lat: [\" . $lat . \"] Long: [\" . $long . \"]\";\n\n echo \"\\nvar myLatlng = new google.maps.LatLng($lat, $long);\";\n echo \"\\nvar marker = new google.maps.Marker({\tposition: myLatlng, title:'Test House'});\";\n\t\t\techo \"\\nmarker.setMap(map);\";\n\t\t\n\t\t\techo \"\\nconsole.log('Post info: $print')\";\n\t\n\t\t}\n\t\t?>\n\t}\n</script>\n\n<div id=\"itasmap\" style=\"width: 800px; height: 600px\"></div>\n<a href=\"#\" id=\"get-data\">Attack! (one round)</a>\n<br>\n<a href=\"#\" id=\"reset\">Reset</a>\n\n<div id=\"show-data\"></div>\n\n<!-- NOTE this google map is using an ITAS Google Map key! Do not use for any of your private applications hosted live anywhere-->\n<script async defer\n src=\"https://maps.googleapis.com/maps/api/js?key=YOURKEY&callback=initMap\">\n</script>\n\n\n\t<?php\n\n\n\t\n\t}", "function gmapper_add_map ($content, $widget=false) {\n $callback = $widget ? 'gmapper_render_widget_gmap' : 'gmapper_render_single_gmap';\n $content = preg_replace_callback('/\\[gmap\\s+map:(\\d+)\\]/', $callback, $content);\n return $content;\n}", "function rsmaps_admin() {\n ?>\n <div class=\"wrap\">\n\n <!-- Beginning of the Responsive Styled Gooogle Maps helper form -->\n <form method=\"post\" action=\"\">\n\n <script type=\"text/javascript\">\n // On page load, initialize the map preview and the color picker.\n var pluginurl = \"<?php echo plugins_url(); ?>\";\n jQuery(document).ready(function($) {\n updateMap(pluginurl);\n jQuery('#mapcolor').colorPicker( { onColorChange : function(id, newValue) { \n jQuery('#newcolor').val(newValue);\n updateMap(pluginurl);\n } } );\n showHideColorPicker();\n });\n </script>\n \n <!-- Table structure containing shortcode parameters -->\n <table border=\"0\" cellpadding=\"5\" id=\"rsmaps\">\n <!-- Plugin title -->\n <tr>\n <td scope=\"row\" valign=\"top\">\n </td>\n <td valign=\"top\">\n <h2><?php echo __('Responsive Styled Google Maps - Helper ', 'res_map') ?></h2>\n </td>\n </tr>\n \n <!-- Address, the map and the shortcode -->\n <tr>\n <td align=\"left\" valign=\"top\"><?php echo __('Address') ?></td>\n <td valign=\"top\">\n <textarea name=\"address\" id=\"address\" rows=\"3\" cols=\"70\" type='textarea' onblur=\"updateMap(pluginurl)\">Yeronga QLD 4104, Australia</textarea><br>\n <span class=\"info\"><?php echo __('For multiple markers use: address1 | address2 | address3 OR lat1,long1 | lat2,long2 | lat3,long3') ?></span>\n </td>\n <td rowspan=\"15\" valign=\"top\" valign=\"top\" width=\"600px\">\n <div id=\"responsive_map\" class=\"responsive-map\" style=\"height:500px;width:600px;\"></div><br>\n <!-- Update map button -->\n <a href=\"javascript: updateMap(pluginurl);\" class=\"button button-primary\"><?php echo __('REFRESH THE MAP') ?></a>\n <a href=\"https://www.google.com/maps\" class=\"button button-primary\" target=\"_blank\"><?php echo __('GOOGLE MAPS HOMEPAGE') ?></a>\n <a href=\"http://yava.ro/mapgenerator\" class=\"button button-primary\" target=\"_blank\"><?php echo __('LATITUDE / LONGITUDE FINDER TOOL') ?> </a>\n <br><div class=\"preheader\"><?php echo __('COPY-PASTE IN YOUR POST / PAGE /WIDGET THIS SHORTCODE:') ?></div>\n <pre id=\"shortcode\" onClick=\"selectText('shortcode')\"></pre>\n <hr>\n </td>\n </tr>\n\n <!-- Marker Description -->\n <tr>\n <td align=\"left\" valign=\"top\"><?php echo __('Description') ?></td>\n <td valign=\"top\">\n <textarea name=\"pdescription\" id=\"pdescription\" rows=\"3\" cols=\"70\" type='textarea' onblur=\"updateMap(pluginurl)\"><img src='<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/img/company.png'> {br} Yeronga QLD 4104, Australia {br} Phone: 0040 752 235 756</textarea><br>\n <span class=\"info\"><?php echo __('For multiple markers use: description1 | description2 | description3 and {br} for a new line') ?></span>\n </td>\n </tr>\n \n <!-- Marker icon color -->\n <tr>\n <td scope=\"row\" align=\"left\" valign=\"bottom\"><?php echo __('Icon') ?></td>\n <td valign=\"bottom\">\n <label><input name=\"color\" type=\"radio\" value=\"black\" onclick=\"updateMap(pluginurl)\" /> <img width=\"27\" height=\"38\" src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/icons/black.png\"> </label>\n <label><input name=\"color\" type=\"radio\" value=\"blue\" onclick=\"updateMap(pluginurl)\" checked /> <img width=\"27\" height=\"38\" src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/icons/blue.png\"> </label>\n <label><input name=\"color\" type=\"radio\" value=\"gray\" onclick=\"updateMap(pluginurl)\" /> <img width=\"27\" height=\"38\" src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/icons/gray.png\"> </label>\n <label><input name=\"color\" type=\"radio\" value=\"green\" onclick=\"updateMap(pluginurl)\" /> <img width=\"27\" height=\"38\" src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/icons/green.png\"> </label>\n <label><input name=\"color\" type=\"radio\" value=\"magenta\" onclick=\"updateMap(pluginurl)\" /> <img width=\"27\" height=\"38\" src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/icons/magenta.png\"> </label>\n <label><input name=\"color\" type=\"radio\" value=\"orange\" onclick=\"updateMap(pluginurl)\" /> <img width=\"27\" height=\"38\" src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/icons/orange.png\"> </label>\n <label><input name=\"color\" type=\"radio\" value=\"purple\" onclick=\"updateMap(pluginurl)\" /> <img width=\"27\" height=\"38\" src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/icons/purple.png\"> </label>\n <label><input name=\"color\" type=\"radio\" value=\"red\" onclick=\"updateMap(pluginurl)\" /> <img width=\"27\" height=\"38\" src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/icons/red.png\"> </label>\n <label><input name=\"color\" type=\"radio\" value=\"white\" onclick=\"updateMap(pluginurl)\" /> <img width=\"27\" height=\"38\" src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/icons/white.png\"> </label>\n <label><input name=\"color\" type=\"radio\" value=\"yellow\" onclick=\"updateMap(pluginurl)\" /> <img width=\"27\" height=\"38\" src=\"<?php echo plugins_url(); ?>/responsive-maps-plugin/includes/icons/yellow.png\"> </label>\n </td>\n </tr>\n \n <!-- Marker icon url -->\n <tr>\n <tr>\n <td scope=\"row\" align=\"left\" valign=\"top\"></td>\n <td valign=\"top\">\n <label><input name=\"color\" type=\"radio\" value=\"custom\" onclick=\"updateMap(pluginurl)\" /></label>\n <textarea name=\"iconurl\" id=\"iconurl\" rows=\"2\" cols=\"66\" type='textarea' onblur=\"\">http://yava.ro/icons/car.png</textarea><br>\n <span class=\"info\"><?php echo __('For multiple markers use: http://yava.ro/icons/car.png | http://yava.ro/icons/sailboat.png') ?></span>\n </td>\n </tr>\n \n <!-- Directions text -->\n <tr>\n <td align=\"left\"><?php echo __('Directions text') ?></td>\n <td>\n <input type=\"text\" size=\"28\" name=\"directions\" id=\"directions\" value=\"(directions to our address)\" onblur=\"updateMap(pluginurl)\" />\n <span class=\"info\"><?php echo __('Optional, the text to put as directions text in the popup.') ?> </span>\n </td>\n </tr> \n \n <!-- Map center -->\n <tr>\n <td align=\"left\"><?php echo __('Center map to') ?></td>\n <td>\n <input type=\"text\" size=\"28\" name=\"center\" id=\"center\" value=\"\" onblur=\"updateMap(pluginurl);\"/>\n <span class=\"info\"><?php echo __('Optional: latitude, longitude i.e. 38.980288, 22.145996') ?></span>\n </td>\n </tr>\n \n <!-- Controls -->\n <tr>\n <td align=\"left\"><?php echo __('Controls') ?></td>\n <td>\n <?php echo __('Pan control') ?>\n <select name='panControl' id='panControl' onchange=\"updateMap(pluginurl)\">\n <option value='' selected><?php echo __('no') ?></option>\n <option value='true'><?php echo __('yes') ?></option>\n </select>\n Scale control\n <select name='scaleControl' id='scaleControl' onchange=\"updateMap(pluginurl)\">\n <option value='' selected><?php echo __('no') ?></option>\n <option value='true'><?php echo __('yes') ?></option>\n </select>\n Type control\n <select name='typeControl' id='typeControl' onchange=\"updateMap(pluginurl)\">\n <option value='' selected><?php echo __('no') ?></option>\n <option value='true'><?php echo __('yes') ?></option>\n </select>\n Street control\n <select name='streetControl' id='streetControl' onchange=\"updateMap(pluginurl)\">\n <option value='' selected><?php echo __('no') ?></option>\n <option value='true'><?php echo __('yes') ?></option>\n </select>\n </td>\n </tr>\n\n <!-- Second line with map controls -->\n <tr>\n <td align=\"left\"></td>\n <td>\n <?php echo __('Zoom level') ?> &nbsp;\n <select name=\"zoom\" id=\"zoom\" onchange=\"updateMap(pluginurl)\">\n <option value='1'>1</option>\n <option value='2'>2</option>\n <option value='3'>3</option>\n <option value='4'>4</option>\n <option value='5'>5</option>\n <option value='6'>6</option>\n <option value='7'>7</option>\n <option value='8'>8</option>\n <option value='9'>9</option>\n <option value='10'>10</option>\n <option value='11'>11</option>\n <option value='12'>12</option>\n <option value='13' selected>13</option>\n <option value='14'>14</option>\n <option value='15'>15</option>\n <option value='16'>16</option>\n <option value='17'>17</option>\n <option value='18'>18</option>\n <option value='19'>19</option>\n </select>\n <?php echo __('Zoom control') ?>\n <select name='zoomControl' id='zoomControl' onchange=\"updateMap(pluginurl)\">>\n <option value='' selected>no</option>\n <option value='true'>yes</option>\n </select>\n <?php echo __('Scroll wheel') ?>\n <select name='scrollwheel' id='scrollwheel' onchange=\"updateMap(pluginurl)\">>\n <option value='' selected>no</option>\n <option value='true'>yes</option>\n </select>\n <?php echo __('Draggable map') ?>\n <select name='draggable' id='draggable' onchange=\"updateMap(pluginurl)\">>\n <option value=''>no</option>\n <option value='true' selected>yes</option>\n </select>\n </td>\n </tr>\n \n <!-- Style -->\n <tr>\n <td align=\"left\"><strong><?php echo __('Map style') ?></strong></td>\n <td>\n <select name='style' id=\"style\" onchange=\"showHideColorPicker();updateMap(pluginurl)\">\n <option value='0'><?php echo __('select color') ?></option>\n <option value='1'>style 1</option>\n <option value='2' selected>style 2</option>\n <option value='3'>style 3</option>\n <option value='4'>style 4</option>\n <option value='5'>style 5</option>\n <option value='6'>style 6</option>\n <option value='7'>style 7</option>\n <option value='8'>style 8</option>\n <option value='9'>style 9</option>\n <option value='10'>style 10</option>\n <option value='11'>style 11</option>\n <option value='12'>style 12</option>\n <option value='13'>style 13</option>\n <option value='14'>style 14</option>\n <option value='15'>style 15</option>\n <option value='16'>style 16</option>\n <option value='17'>style 17</option>\n <option value='18'>style 18</option>\n <option value='19'>style 19</option>\n <option value='20'>style 20</option>\n <option value='21'>style 21</option>\n <option value='22'>style 22</option>\n <option value='23'>style 23</option>\n <option value='24'>style 24</option>\n <option value='25'>style 25</option>\n <option value='26'>style 26</option>\n <option value='27'>style 27</option>\n <option value='28'>style 28</option>\n <option value='29'>style 29</option>\n <option value='30'>style 30</option>\n <option value='31'>style 31</option>\n <option value='32'>style 32</option>\n <option value='33'>style 33</option>\n <option value='34'>style 34</option>\n <option value='35'>style 35</option>\n <option value='36'>style 36</option>\n <option value='37'>style 37</option>\n <option value='38'>style 38</option>\n <option value='39'>style 39</option>\n <option value='40'>style 40</option>\n </select>\n <!-- Color picker -->\n <input type=\"text\" id=\"mapcolor\" name=\"mapcolor\" value=\"#2EA2CC\" data-text=\"select the color...\"/>\n <span class=\"info\" id=\"colorinfo\"><?php echo __('Choose from 40 custom styles or a specific color.') ?></span>\n <input type=\"hidden\" name =\"newcolor\" id=\"newcolor\" value=\"#2EA2CC\"/>\n </td>\n </tr>\n\n <!-- Width -->\n <tr>\n <td align=\"left\"><?php echo __('Map width') ?></td>\n <td>\n <input type=\"text\" size=\"6\" name=\"width\" id=\"width\" value=\"100\" onblur=\"updateMap(pluginurl)\"/>\n <select name='widthm' id='widthm' onchange=\"updateMap(pluginurl)\">\n <option value='%' selected>%</option>\n <option value='px'>px</option>\n </select>\n <span class=\"info\"><?php echo __('100% for a responsive map (the map preview has fixed width and height).') ?></span>\n </td>\n </tr>\n\n <!-- Height -->\n <tr>\n <td align=\"left\"><?php echo __('Map height') ?></td>\n <td>\n <input type=\"text\" size=\"6\" name=\"height\" id=\"height\" value=\"500\" onblur=\"updateMap(pluginurl)\"/>\n <select name='heightm' id='heightm' onchange=\"updateMap(pluginurl)\">\n <option value='%'>%</option>\n <option value='px' selected>px</option>\n </select>\n <span class=\"info\"><?php echo __('In px or % (the map preview has fixed width and height).') ?></span>\n </td>\n </tr>\n \n <!-- Map Type -->\n <tr>\n <td align=\"left\"><?php echo __('Map type') ?></td>\n <td>\n <select name='type' id=\"type\" onchange=\"updateMap(pluginurl)\">\n <option value='roadmap' selected><?php echo __('roadmap') ?></option>\n <option value='satellite'><?php echo __('satellite') ?></option>\n <option value='terrain'><?php echo __('terrain') ?></option>\n <option value='hybrid'><?php echo __('hybrid') ?></option>\n </select>\n <span class=\"info\"><?php echo __('Possible values: roadmap, satellite, terrain or hybrid') ?></span>\n </td>\n </tr>\n\n <!-- Popup -->\n <tr>\n <td align=\"left\"><?php echo __('Popup') ?></td>\n <td>\n <select name='popup' id=\"popup\" onchange=\"updateMap(pluginurl)\">\n <option value=''><?php echo __('hidden') ?></option>\n <option value='true' selected><?php echo __('visible') ?></option>\n </select>\n <span class=\"info\"><?php echo __('The popup window which appears when a marker is clicked.') ?></span>\n </td>\n </tr>\n \n <!-- Map refresh (when window is scaled) -->\n <tr>\n <td align=\"left\"><?php echo __('Refresh map') ?></td>\n <td>\n <select name='refresh' id='refresh' onchange=\"updateMap(pluginurl)\">>\n <option value='' selected><?php echo __('no') ?></option>\n <option value='true'><?php echo __('yes') ?></option>\n </select>\n <span class=\"info\"> <?php echo __('Select \"yes\" if the map should be refreshed (re-centered) when the window is scaled. ') ?></span>\n </td>\n </tr>\n \n <!-- Adsense publisher id -->\n <tr>\n <td align=\"left\"><?php echo __('Adsense publisher id') ?></td>\n <td width=\"300px\">\n <input type=\"text\" size=\"40\" name=\"pubid\" id=\"pubid\" value=\"\" onblur=\"updateMap(pluginurl);\"/>\n <span class=\"info\"><a href=\"https://support.google.com/adsense/answer/105516?hl=en\" target=\"_blank\"><?php echo __('Optional, a Google Adsense publisher id.') ?></a></span>\n </td>\n \n </tr>\n\t\t\t\t\n <!-- Adsense background color -->\n <tr>\n <td align=\"left\" valign=\"top\"><?php echo __('Adsense ad background color') ?></td>\n <td valign=\"top\">\n <input id=\"adbg\" name=\"adbg\" type=\"text\" size=\"40\" value=\"#ffffff\" onblur=\"updateMap(pluginurl);\"/>\n <span class=\"info\"><?php echo __('Optional, a hex color code for ad background.') ?></span>\n </td>\n </tr>\n \n </table>\n </form>\n </div>\n<?php\n}", "public function meta_box_organisation_map() {\n\t\tglobal $post;\n\t\t$location_address = 'Peterborough';\n\t\t$location_lat = '52.5833';\n\t\t$location_lng = '0.2500';\n\t\t$location_zoom = '13';\n\t\t\n\t\t\t\n\t\t$meta_deets = get_post_custom($post->ID);\n\t\t?>\n\t\t<div class=\"form-group\">\n <?php \n $location_opts = get_post_meta($post->ID, 'location_event', true);\n if($location_opts) {\n\t $location_address = esc_attr($location_opts['address']);\n\t $location_lat = esc_attr($location_opts['lat']);\n\t $location_lng = esc_attr($location_opts['lng']);\n\t $location_zoom = esc_attr($location_opts['zoom']);\n }\n // print_r($location_opts);\n ?>\n </div>\n <div style=\"height:300px;\" id=\"map-canvas_event\"></div>\n <div id=\"panel\">\n\t <label>organisation Location</label>\n <input id=\"address\" type=\"text\" name=\"organisation_location[address]\" value=\"<?php echo $location_address;?>\" class=\"form-control\" onkeyup=\"codeAddress();\">\n \n <?php // Add Latitude and Longitide Form Fields. These will be saved to the $location array. ?>\n <input id=\"address_lat\" type=\"hidden\" name=\"organisation_location[lat]\" value=\"<?php echo $location_lat; ?>\">\n <input id=\"address_lng\" type=\"hidden\" name=\"organisation_location[lng]\" value=\"<?php echo $location_lng; ?>\">\n <input id=\"address_zoom\" type=\"hidden\" name=\"organisation_location[zoom]\" value=\"<?php echo $location_zoom; ?>\">\n <!-- <input type=\"button\" value=\"Geocode\" onclick=\"codeAddress()\" class=\"button-primary\">-->\n </div>\n <input type=\"submit\" name=\"submit\" id=\"submit\" class=\"button button-primary save-button\" value=\"Save Changes\" />\n \n \n \n <script src=\"https://maps.googleapis.com/maps/api/js?key=AIzaSyCJAIpWnvPjgzs40B2MoZc5dTDYtQi9cuM&callback\"></script>\n<script>\nvar geocoder;\nvar map;\nfunction initialize() {\n geocoder = new google.maps.Geocoder();\n var latlng = new google.maps.LatLng(<?php echo $location_lat.', '. $location_lng; ?>);\n var mapOptions = {\n zoom: <?php echo $location_zoom; ?>,\n center: latlng,\n styles: [{\"featureType\":\"landscape\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"poi\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"water\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"road\",\"elementType\":\"labels.icon\",\"stylers\":[{\"visibility\":\"off\"}]},{\"stylers\":[{\"hue\":\"#00aaff\"},{\"saturation\":-100},{\"gamma\":2.15},{\"lightness\":12}]},{\"featureType\":\"road\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"visibility\":\"on\"},{\"lightness\":24}]},{\"featureType\":\"road\",\"elementType\":\"geometry\",\"stylers\":[{\"lightness\":57}]}]\n }\n map = new google.maps.Map(document.getElementById('map-canvas_event'), mapOptions);\n \n <?php if($location_lng){ ?>\n \t\tvar image = '<?php bloginfo( 'stylesheet_directory' ); ?>/images/map-marker.png';\n \t\t<?php\n echo 'var marker = new google.maps.Marker({\n map: map,\n position: latlng,\n icon: image\n });'; \n }?>\n \n google.maps.event.addListener(map, 'zoom_changed', function(){\n \n document.getElementById(\"address_zoom\").value = map.getZoom();\n \n});\n\n}\n\nfunction codeAddress() {\n var address = document.getElementById('address').value;\n geocoder.geocode( { 'address': address}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n map.setCenter(results[0].geometry.location);\n \n <?php // Get the value of Lat and Lng for the form fields. ?> \n document.getElementById(\"address_zoom\").value = map.getZoom();\n document.getElementById(\"address_lat\").value = results[0].geometry.location.lat();\n document.getElementById(\"address_lng\").value = results[0].geometry.location.lng();\n \n var image = '<?php bloginfo( 'stylesheet_directory' ); ?>/images/map-marker.png';\n var marker = new google.maps.Marker({\n map: map,\n icon: image,\n position: results[0].geometry.location\n \n });\n } else {\n console.log('Geocode was not successful for the following reason: ' + status);\n }\n });\n}\n\n\ngoogle.maps.event.addDomListener(window, 'load', initialize);\n</script>\n<?php\n\t}", "function widget($args, $instance) {\n extract($args); // permet de convertir les clés d'un tableau en variables\n echo $before_widget; // balises avant le contenu, H1 par exemple\n\n if ($instance['title'] != '') {\n echo $before_title.$instance['title'].$after_title;\n }\n\n if ($instance['carteExistante'] != '0') {\n $idCarte = $instance['carteExistante'];\n $carteChoisie = Cefii_Map::getmap($idCarte);\n $titre = $carteChoisie[0]->titre;\n $latitude = $carteChoisie[0]->latitude;\n $longitude = $carteChoisie[0]->longitude;\n\n if ($instance['afficheTitre'] == \"oui\") {\n echo \"<h2>\".$titre.\"</h2>\";\n } \n\n ?>\n <div id=\"widgetmap-<?php echo $this->id; ?>\" style=\"width:100%; height:200px; \"></div>\n <script type=\"text/javascript\">\n var coord = new google.maps.LatLng(<?php echo $latitude; ?>, <?php echo $longitude; ?>);\n var options = {\n center: coord, \n zoom: 10,\n mapTypeId: google.maps.MapTypeId.ROADMAP \n };\n var map = new google.maps.Map(document.getElementById(\"widgetmap-<?php echo $this->id; ?>\"), options);\n </script>\n <?php\n }\n\n echo $after_widget; // balises après le contenu, <h1> par exemple\n }", "function templateMap($location){\n global $DOPBSP;\n?>\n <div class=\"dopbsp-inputs-header dopbsp-hide\">\n <h3><?php echo $DOPBSP->text('LOCATIONS_LOCATION_MAP'); ?></h3>\n <a href=\"javascript:DOPBSPBackEnd.toggleInputs('location-map')\" id=\"DOPBSP-inputs-button-location-map\" class=\"dopbsp-button\"></a>\n </div>\n <div id=\"DOPBSP-inputs-location-map\" class=\"dopbsp-inputs-wrapper\">\n <!--\n Location\n -->\n <div class=\"dopbsp-input-wrapper\">\n <label for=\"DOPBSP-location-address\"><?php echo $DOPBSP->text('LOCATIONS_LOCATION_ADDRESS'); ?></label>\n <input type=\"text\" name=\"DOPBSP-location-address\" id=\"DOPBSP-location-address\" value=\"<?php echo $location->address; ?>\" onkeyup=\"if ((event.keyCode||event.which) !== 9){DOPBSPBackEndLocation.edit('<?php echo $location->id; ?>', 'text', 'address', this.value); DOPBSPBackEndLocationMapHints.display();}\" onpaste=\"DOPBSPBackEndLocation.edit('<?php echo $location->id; ?>', 'text', 'address', this.value); DOPBSPBackEndLocationMapHints.display();\" onblur=\"DOPBSPBackEndLocation.edit('<?php echo $location->id; ?>', 'text', 'address', this.value, true); setTimeout(function(){DOPBSPBackEndLocationMapHints.clear();}, 300);\" />\n <a href=\"<?php echo DOPBSP_CONFIG_HELP_DOCUMENTATION_URL; ?>\" target=\"_blank\" class=\"dopbsp-button dopbsp-help\"><span class=\"dopbsp-info dopbsp-help\"><?php echo $DOPBSP->text('LOCATIONS_LOCATION_ADDRESS_HELP'); ?><br /><br /><?php echo $DOPBSP->text('HELP_VIEW_DOCUMENTATION'); ?></span></a>\n </div>\n \n <!--\n Hints\n -->\n <ul id=\"DOPBSP-location-address-hints\">\n <li></li>\n </ul>\n \n <!--\n Coordinates\n -->\n <input type=\"hidden\" name=\"DOPBSP-location-coordinates\" id=\"DOPBSP-location-coordinates\" value=\"<?php echo $location->coordinates; ?>\" />\n\n <!--\n Map\n -->\n <div id=\"DOPBSP-location-address-map\"></div>\n<?php\n \n /*\n * Address Alt\n */ \n $this->displayTextInput(array('id' => 'address_alt',\n 'label' => $DOPBSP->text('LOCATIONS_LOCATION_ALT_ADDRESS'),\n 'value' => $location->address_alt,\n 'location_id' => $location->id,\n 'help' => $DOPBSP->text('LOCATIONS_LOCATION_ALT_ADDRESS_HELP'),\n 'container_class' => 'dopbsp-last')); \n \n?>\n </div>\n<?php \n }", "function gymfitness_leaflet_location(){\n $location = get_field(\"location\");\n ?>\n <div id=\"location\">\n <p><?php get_field(\"location->'lng'\") ?></p>\n <input type=\"hidden\" id=\"lat\" value=\"<?php echo $location['lat'] ?>\" >\n <input type=\"hidden\" id=\"lng\" value=\"<?php echo $location['lng'] ?>\" >\n <input type=\"hidden\" id=\"zoom\" value=\"<?php echo $location['zoom'] ?>\" >\n <input type=\"hidden\" id=\"address\" value=\"<?php echo $location['address'] ?>\" >\n </div>\n <div id=\"map\"></div>\n<?php\n}", "function update_store_location_data(){global $wpdb;$drawMap = 'false';\n\t\n\t$data = json_decode(stripslashes($_POST['param']), true);// echo $current_user->ID.'-=-'.$data['mention'];\n\t$html = $location = '';\n\t$png = network_site_url().'wp-content/plugins/wpOfficePride/include/template/assests/img/single-pin.png';\n\t\n\t$op_widget = new Widget_location();\n\tif($data['lat'] == 'onload'){\n\t\t$sql = $wpdb->get_results(\"SELECT * FROM op_knack_db\"); \n\t}\n\telseif($data['lat'] != '' and $data['lng'] != '' and $data['lat'] != 'onload'){\n\t\t$sql = $op_widget->return_closes_data(array($data['lat'], $data['lng']));\n\t\t}\n\tif(!empty($sql)){\n\t\n\t\n\t$i = 1;\n\tforeach($sql as $data){$drawMap = 'true';\n\t\t$address = $data->address;\n\t\t$location .= '[\"'.$data->website_title.'\",\"'.$data->website_url.'\",\"'.$address.'\",\"'.$data->phone.'\",\"'.$data->lat.','.$data->lng.'\",\"'.$png.'\",\"'.$data->city.'\",\"'.$data->zip.'\",\"'.$data->st.'\"],';\n\t\t\n\t\tif($i == 1){$nearzip = $data->zip; $phone = $data->phone;}\n\t\t\n\t\t$address = $data->address.' '.$data->city.', '.$data->st.' '.$data->zip;\n\n\t\t$html .= '<div class=\"flocoffice__item\"><a class=\"flocoffice__item-place-link\" href=\"'.$data->website_url.'\"></a>\n\t\t\t\t<a class=\"flocoffice__place\" href=\"'.$data->website_url.'\"><img class=\"flocoffice__place-icon\" src=\"'.site_url().'/wp-content/themes/officepride/img/icons/marker-green.svg\" alt=\"\" width=\"14\" height=\"18\">\n\n\t\t\t \t<div class=\"flocoffice__place-text\">'.$data->website_title.'</div>\n\n\t\t\t </a>\n\t\t\t \n\t\t\t <div class=\"flocoffice__item-inner\">\n\n\t\t\t\t<div class=\"flocoffice__distance\"><span>'.number_format($data->distance,1).'</span><span>&nbsp;Miles</span></div>\n\n\t\t\t\t<a class=\"flocoffice__call\" href=\"'.$data->phone.'\"><img class=\"flocoffice__call-icon\" src=\"'.site_url().'/wp-content/themes/officepride/img/icons/call-square.svg\" alt=\"\" width=\"16\" height=\"16\">\n\n\t\t\t\t<div class=\"flocoffice__call-text\">'.$data->phone.'</div>\n\n\t\t\t\t</a>\n\n\t\t\t\t<div class=\"flocoffice__address\">'.$data->address.' <br>\n\n\t\t\t\t '.$data->city.', '.$data->st.' '.$data->zip.'</div>\n\n\t\t\t </div></div>';\n\n\t\t$i++; \n\t\t\n\t\t}\n\t\t$location = '['.substr($location, 0, -1).']';\n\t}\n\t\n\telse{$html = '<h4 style=\"text-align:center\" class=\"error_location\">Record not found near your location.</h4>';}\n\t// echo $html; exit;\n\techo json_encode(array('html' => $html, 'zipcode' => $nearzip, 'locations' => $location, 'phone' => $phone, 'drawMap' => $drawMap));exit;\n\t}", "public function widgetAction()\r\n {\r\n $mod = $this->_getParam('mod');\r\n $name = $this->_getParam('name');\r\n if( null === $name ) {\r\n throw new Exception('no widget found with name: ' . $name);\r\n }\r\n if( null !== $mod ) {\r\n $name = $mod . '.' . $name;\r\n }\r\n\r\n $contentInfoRaw = $this->getContentAreas();\r\n $contentInfo = array();\r\n foreach( $contentInfoRaw as $info ) {\r\n $contentInfo[$info['name']] = $info;\r\n }\r\n\r\n // It has a form specified in content manifest\r\n if( !empty($contentInfo[$name]['adminForm']) ) {\r\n\r\n if( is_string($contentInfo[$name]['adminForm']) ) {\r\n $formClass = $contentInfo[$name]['adminForm'];\r\n Engine_Loader::loadClass($formClass);\r\n $this->view->form = $form = new $formClass();\r\n } else if( is_array($contentInfo[$name]['adminForm']) ) {\r\n $this->view->form = $form = new Engine_Form($contentInfo[$name]['adminForm']);\r\n } else {\r\n throw new Core_Model_Exception('Unable to load admin form class');\r\n }\r\n\r\n // Try to set title if missing\r\n if( !$form->getTitle() ) {\r\n $form->setTitle('Editing: ' . $contentInfo[$name]['title']);\r\n }\r\n\r\n // Try to set description if missing\r\n if( !$form->getDescription() ) {\r\n $form->setDescription('placeholder');\r\n }\r\n\r\n $form->setAttrib('class', 'global_form_popup' . $form->getAttrib('class'));\r\n\r\n // Add title element\r\n if( !$form->getElement('title') ) {\r\n $form->addElement('Text', 'title', array(\r\n 'label' => 'Title',\r\n 'order' => -100,\r\n ));\r\n }\r\n\r\n // Add mobile element?\r\n if( !$form->getElement('nomobile') ) {\r\n $form->addElement('Select', 'nomobile', array(\r\n 'label' => 'Hide on mobile site?',\r\n 'order' => 100000 - 5,\r\n 'multiOptions' => array(\r\n '1' => 'Yes, do not display on mobile site.',\r\n '0' => 'No, display on mobile site.',\r\n ),\r\n 'value' => '0',\r\n ));\r\n }\r\n\r\n if( !empty($contentInfo[$name]['isPaginated']) && !$form->getElement('itemCountPerPage') ) {\r\n $form->addElement('Text', 'itemCountPerPage', array(\r\n 'label' => 'Count',\r\n 'description' => '(number of items to show)',\r\n 'validators' => array(\r\n array('Int', true),\r\n array('GreaterThan', true, array(0)),\r\n ),\r\n 'order' => 1000000 - 1,\r\n ));\r\n }\r\n\r\n // Add submit button\r\n if( !$form->getElement('submit') && !$form->getElement('execute') ) {\r\n $form->addElement('Button', 'execute', array(\r\n 'label' => 'Save Changes',\r\n 'type' => 'submit',\r\n 'ignore' => true,\r\n 'decorators' => array(\r\n 'ViewHelper',\r\n ),\r\n 'order' => 1000000,\r\n ));\r\n }\r\n\r\n // Add name\r\n $form->addElement('Hidden', 'name', array(\r\n 'value' => $name,\r\n 'order' => 1000010,\r\n ));\r\n\r\n if( !$form->getElement('cancel') ) {\r\n $form->addElement('Cancel', 'cancel', array(\r\n 'label' => 'cancel',\r\n 'link' => true,\r\n 'prependText' => ' or ',\r\n 'onclick' => 'parent.Smoothbox.close();',\r\n 'ignore' => true,\r\n 'decorators' => array(\r\n 'ViewHelper',\r\n ),\r\n 'order' => 1000001,\r\n ));\r\n }\r\n\r\n if( !$form->getDisplayGroup('buttons') ) {\r\n $submitName = ( $form->getElement('execute') ? 'execute' : 'submit' );\r\n $form->addDisplayGroup(array(\r\n $submitName,\r\n 'cancel',\r\n ), 'buttons', array(\r\n 'order' => 1000002,\r\n ));\r\n }\r\n\r\n // Force method and action\r\n $form->setMethod('post')\r\n ->setAction($this->view->url(array()));\r\n\r\n if( $this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost()) ) {\r\n $this->view->values = $form->getValues();\r\n $this->view->form = null;\r\n }\r\n\r\n return;\r\n }\r\n\r\n // Try to render admin page\r\n if( !empty($contentInfo[$name]) ) {\r\n try {\r\n $structure = array(\r\n 'type' => 'widget',\r\n 'name' => $name,\r\n 'request' => $this->getRequest(),\r\n 'action' => 'widget',\r\n 'throwExceptions' => true,\r\n );\r\n\r\n // Create element (with structure)\r\n $element = new Engine_Content_Element_Container(array(\r\n 'elements' => array($structure),\r\n 'decorators' => array(\r\n 'Children'\r\n )\r\n ));\r\n\r\n $content = $element->render();\r\n\r\n $this->getResponse()->setBody($content);\r\n\r\n $this->_helper->viewRenderer->setNoRender(true);\r\n return;\r\n } catch( Exception $e ) {\r\n\r\n }\r\n }\r\n\r\n // Just render default editing form\r\n $this->view->form = $form = new Engine_Form(array(\r\n 'title' => $contentInfo[$name]['title'],\r\n 'description' => 'placeholder',\r\n 'method' => 'post',\r\n 'action' => $this->view->url(array()),\r\n 'class' => 'global_form_popup',\r\n 'elements' => array(\r\n array(\r\n 'Text',\r\n 'title',\r\n array(\r\n 'label' => 'Title',\r\n )\r\n ),\r\n array(\r\n 'Button',\r\n 'submit',\r\n array(\r\n 'label' => 'Save',\r\n 'type' => 'submit',\r\n 'decorators' => array('ViewHelper'),\r\n 'ignore' => true,\r\n 'order' => 1501,\r\n )\r\n ),\r\n array(\r\n 'Hidden',\r\n 'name',\r\n array(\r\n 'value' => $name,\r\n )\r\n ),\r\n array(\r\n 'Cancel',\r\n 'cancel',\r\n array(\r\n 'label' => 'cancel',\r\n 'link' => true,\r\n 'prependText' => ' or ',\r\n 'onclick' => 'parent.Smoothbox.close();',\r\n 'ignore' => true,\r\n 'decorators' => array('ViewHelper'),\r\n 'order' => 1502,\r\n )\r\n )\r\n ),\r\n 'displaygroups' => array(\r\n 'buttons' => array(\r\n 'name' => 'buttons',\r\n 'elements' => array(\r\n 'submit',\r\n 'cancel',\r\n ),\r\n 'options' => array(\r\n 'order' => 1500,\r\n )\r\n )\r\n )\r\n ));\r\n\r\n if( !empty($contentInfo[$name]['isPaginated']) ) {\r\n $form->addElement('Text', 'itemCountPerPage', array(\r\n 'label' => 'Count',\r\n 'description' => '(number of items to show)',\r\n 'validators' => array(\r\n array('Int', true),\r\n array('GreaterThan', true, array(0)),\r\n )\r\n ));\r\n }\r\n\r\n if( $this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost()) ) {\r\n $this->view->values = $form->getValues();\r\n $this->view->form = null;\r\n } else {\r\n $form->populate($this->_getAllParams());\r\n }\r\n }", "function cr_event_map_meta_box_callback( $post ) { \n\twp_enqueue_script( 'gmap3' ); ?>\n\t<div><div id=\"maps\" class=\"gmap3\"></div></div>\n<? }", "public function widgetAction() {\n $name = $this->_getParam('name');\n $mod = $this->_getParam('mod');\n if (null === $name) {\n throw new Exception('no widget found with name: ' . $name);\n }\n if (null !== $mod) {\n $name = $mod . '.' . $name;\n }\n\n $contentInfoRaw = $this->getContentAreas();\n $contentInfo = array();\n foreach ($contentInfoRaw as $info) {\n $contentInfo[$info['name']] = $info;\n }\n\n //IT HAS A FORM SPECIFIED IN CONTENT MANIFEST\n if (!empty($contentInfo[$name]['adminForm'])) {\n if (is_string($contentInfo[$name]['adminForm'])) {\n $formClass = $contentInfo[$name]['adminForm'];\n Engine_Loader::loadClass($formClass);\n $this->view->form = $form = new $formClass();\n } else if (is_array($contentInfo[$name]['adminForm'])) {\n $this->view->form = $form = new Engine_Form($contentInfo[$name]['adminForm']);\n } else {\n throw new Core_Model_Exception('Unable to load admin form class');\n }\n\n //TRY TO SET TITLE IF MISSING\n if (!$form->getTitle()) {\n $form->setTitle('Editing: ' . $contentInfo[$name]['title']);\n }\n\n //TRY TO SET DESCRIPTION IF MISSING\n if (!$form->getDescription()) {\n $form->setDescription('placeholder');\n }\n\n $form->setAttrib('class', 'global_form_popup ' . $form->getAttrib('class'));\n\n //ADD TITLE ELEMENT\n if (!$form->getElement('title')) {\n $form->addElement('Text', 'title', array(\n 'label' => 'Title',\n 'order' => -100,\n ));\n }\n\n if (!empty($contentInfo[$name]['isPaginated']) && !$form->getElement('itemCountPerPage')) {\n $form->addElement('Text', 'itemCountPerPage', array(\n 'label' => 'Count',\n 'description' => '(number of items to show)',\n 'validators' => array(\n array('Int', true),\n array('GreaterThan', true, array(0)),\n ),\n 'order' => 1000000 - 1,\n ));\n }\n\n //ADD SUBMIT BUTTON\n if (!$form->getElement('submit') && !$form->getElement('execute')) {\n $form->addElement('Button', 'execute', array(\n 'label' => 'Save Changes',\n 'type' => 'submit',\n 'ignore' => true,\n 'decorators' => array(\n 'ViewHelper',\n ),\n 'order' => 1000000,\n ));\n }\n\n //ADD NAME\n $form->addElement('Hidden', 'name', array(\n 'value' => $name,\n 'order' => 1000010,\n ));\n\n if (!$form->getElement('cancel')) {\n $form->addElement('Cancel', 'cancel', array(\n 'label' => 'cancel',\n 'link' => true,\n 'prependText' => ' or ',\n 'onclick' => 'parent.Smoothbox.close();',\n 'ignore' => true,\n 'decorators' => array(\n 'ViewHelper',\n ),\n 'order' => 1000001,\n ));\n }\n\n if (!$form->getDisplayGroup('buttons')) {\n $submitName = ( $form->getElement('execute') ? 'execute' : 'submit' );\n $form->addDisplayGroup(array(\n $submitName,\n 'cancel',\n ), 'buttons', array(\n 'order' => 1000002,\n ));\n }\n\n //FORCE METHOD AND ACTION\n $form->setMethod('post')\n ->setAction($_SERVER['REQUEST_URI']);\n\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n\n\t\t\t$session = new Zend_Session_Namespace();\n if (isset($session->edittitles))\n unset($session->edittitles);\n $session->edittitles[] = $name;\n $this->view->values = $form->getValues();\n $this->view->form = null;\n\n }\n\n return;\n }\n\n //TRY TO RENDER ADMIN PAGE\n if (!empty($contentInfo[$name])) {\n try {\n $structure = array(\n 'type' => 'widget',\n 'name' => $name,\n 'request' => $this->getRequest(),\n 'action' => 'admin',\n 'throwExceptions' => true,\n );\n\n //CREATE ELEMENT (WITH STRUCTURE)\n $element = new Engine_Content_Element_Container(array(\n 'elements' => array($structure),\n 'decorators' => array(\n 'Children'\n )\n ));\n\n $content = $element->render();\n $this->getResponse()->setBody($content);\n $this->_helper->viewRenderer->setNoRender(true);\n return;\n } catch (Exception $e) {\n \n }\n }\n\n //JUST RENDER DEFAULT EDITING FORM\n $this->view->form = $form = new Engine_Form(array(\n 'title' => $contentInfo[$name]['title'],\n 'description' => 'placeholder',\n 'method' => 'post',\n 'action' => $_SERVER['REQUEST_URI'],\n 'class' => 'global_form_popup',\n 'elements' => array(\n array(\n 'Text',\n 'title',\n array(\n 'label' => 'Title',\n )\n ),\n array(\n 'Button',\n 'submit',\n array(\n 'label' => 'Save',\n 'type' => 'submit',\n 'decorators' => array('ViewHelper'),\n 'ignore' => true,\n 'order' => 1501,\n )\n ),\n array(\n 'Hidden',\n 'name',\n array(\n 'value' => $name,\n )\n ),\n array(\n 'Cancel',\n 'cancel',\n array(\n 'label' => 'cancel',\n 'link' => true,\n 'prependText' => ' or ',\n 'onclick' => 'parent.Smoothbox.close();',\n 'ignore' => true,\n 'decorators' => array('ViewHelper'),\n 'order' => 1502,\n )\n )\n ),\n 'displaygroups' => array(\n 'buttons' => array(\n 'name' => 'buttons',\n 'elements' => array(\n 'submit',\n 'cancel',\n ),\n 'options' => array(\n 'order' => 1500,\n )\n )\n )\n ));\n\n if (!empty($contentInfo[$name]['isPaginated'])) {\n $form->addElement('Text', 'itemCountPerPage', array(\n 'label' => 'Count',\n 'description' => '(number of items to show)',\n 'validators' => array(\n array('Int', true),\n array('GreaterThan', true, array(0)),\n )\n ));\n }\n\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n $session = new Zend_Session_Namespace();\n if (isset($session->edittitles))\n unset($session->edittitles);\n $session->edittitles[] = $name;\n $this->view->values = $form->getValues();\n $this->view->form = null;\n } else {\n $form->populate($this->_getAllParams());\n }\n }", "public function simple_map_options_page() {\n\n\t\t?>\n\t\t<form action='options.php' method='post'>\n\n\t\t<?php\n\t\t\tsettings_fields( 'simplemappage' );\n\t\t\tdo_settings_sections( 'simplemappage' );\n\n\t\t\tsubmit_button();\n\n\t\t\t/*\n\t\t\t * API key obtaining method.\n\t\t\t */\n\t\t\t$maps_api_for_web_link = sprintf(\n\t\t\t\t'%1$s<a href=\"https://developers.google.com/maps/web/\">%2$s</a>',\n\t\t\t\tesc_html__( 'Go to ', 'simple-map' ),\n\t\t\t\tesc_html__( 'Google Maps APIs for Web page.' )\n\t\t\t);\n\n\t\t\t$get_key_text = esc_html__( 'Click \"GET A KEY\" button', 'simple-map' );\n\t\t\t$continue_text = esc_html__( 'Click \"CONTINUE\" button', 'simple-map' );\n\t\t\t$set_domain_text = esc_html__( 'Add your domain.', 'simple-map' );\n\n\t\t\t$html = '';\n\t\t\t$html .= '<h2>' . esc_html__( 'How to get API key?', 'simple-map' ) . '</h2>';\n\t\t\t$html .= '<ol>';\n\t\t\t$html .= '<li>' . $maps_api_for_web_link . '</li>';\n\t\t\t$html .= '<li>' . $get_key_text . '<p><img style=\"width: 80%;\" src=\"' . plugin_dir_url( __FILE__ ) . 'images/001.png\"></p></li>';\n\t\t\t$html .= '<li>' . $continue_text . '<p><img style=\"width: 80%;\" src=\"' . plugin_dir_url( __FILE__ ) . 'images/002.png\"></p></li>';\n\t\t\t$html .= '<li>' . $continue_text . '<p><img style=\"width: 80%;\" src=\"' . plugin_dir_url( __FILE__ ) . 'images/003.png\"></p></li>';\n\t\t\t$html .= '<li>' . $set_domain_text . '<p><img style=\"width: 80%;\" src=\"' . plugin_dir_url( __FILE__ ) . 'images/004.png\"></p></li>';\n\t\t\t$html .= '</ol>';\n\n\t\t\techo $html;\n\n\t\t?>\n\n\t\t</form>\n\t\t<?php\n\n\t}", "function __construct() {\n\t\t\t$block_options = array(\n\t\t\t\t'pb_block_icon' => 'simpleicon-pointer',\n\t\t\t\t'pb_block_icon_color' => '#FF6961',\n\t\t\t\t'name' => __('Google Map','mthemelocal'),\n\t\t\t\t'size' => 'span6',\n\t\t\t\t'tab' => __('Elements','mthemelocal'),\n\t\t\t\t'desc' => __('Add a Google Map','mthemelocal')\n\t\t\t);\n\n\t\t\t/*-----------------------------------------------------------------------------------*/\n\t\t\t/*\tGoogle Maps\n\t\t\t/*-----------------------------------------------------------------------------------*/\n\t\t\t$mtheme_shortcodes['map'] = array(\n\t\t\t\t'no_preview' => true,\n\t\t\t\t'shortcode_desc' => __('Add Google Maps', 'mthemelocal'),\n\t\t\t\t'params' => array(\n\t\t\t\t\t'map_type' => array(\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'label' => __('Map Type', 'mthemelocal'),\n\t\t\t\t\t\t'desc' => __('Map Type', 'mthemelocal'),\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'ROADMAP' => __('roadmap','mthemelocal'),\n\t\t\t\t\t\t\t'SATELLITE' => __('satellite','mthemelocal'),\n\t\t\t\t\t\t\t'HYBRID' => __('hybrid','mthemelocal'),\n\t\t\t\t\t\t\t'TERRAIN' => __('terrain','mthemelocal'),\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t'map_style' => array(\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'label' => __('Map Style', 'mthemelocal'),\n\t\t\t\t\t\t'desc' => __('Map Style', 'mthemelocal'),\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'desaturated' => __('Desaturated','mthemelocal'),\n\t\t\t\t\t\t\t'lightdream' => __('Light Dream','mthemelocal'),\n\t\t\t\t\t\t\t'shadesofgrey' => __('Shades of Grey','mthemelocal'),\n\t\t\t\t\t\t\t'applemaps' => __('Apple Maps','mthemelocal'),\n\t\t\t\t\t\t\t'lightmonochrome' => __('Light Monochrome','mthemelocal'),\n\t\t\t\t\t\t\t'mapbox' => __('Map Box','mthemelocal'),\n\t\t\t\t\t\t\t'gowalla' => __('Gowalla','mthemelocal'),\n\t\t\t\t\t\t\t'cleancut' => __('Clean Cut','mthemelocal')\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t 'map_address' => array(\n\t\t\t 'std' => '',\n\t\t\t 'type' => 'text',\n\t\t\t 'label' => __('Map Address', 'mthemelocal'),\n\t\t\t 'desc' => __('Map Address', 'mthemelocal'),\n\t\t\t ),\n\t\t\t 'map_height' => array(\n\t\t\t 'std' => '400',\n\t\t\t 'type' => 'text',\n\t\t\t 'label' => __('Map Height', 'mthemelocal'),\n\t\t\t 'desc' => __('Map Height', 'mthemelocal'),\n\t\t\t ),\n\t\t\t 'map_latitude' => array(\n\t\t\t 'std' => '',\n\t\t\t 'type' => 'text',\n\t\t\t 'label' => __('Map Latitude', 'mthemelocal'),\n\t\t\t 'desc' => __('Set 0 if you want to don\\'t want to use the field. Map Latitude', 'mthemelocal'),\n\t\t\t ),\n\t\t\t 'map_longitude' => array(\n\t\t\t 'std' => '',\n\t\t\t 'type' => 'text',\n\t\t\t 'label' => __('Map Longitude', 'mthemelocal'),\n\t\t\t 'desc' => __('Set 0 if you want to don\\'t want to use the field. Map Longitude', 'mthemelocal'),\n\t\t\t ),\n\t\t\t\t\t'map_marker' => array(\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'label' => __('Map Marker', 'mthemelocal'),\n\t\t\t\t\t\t'desc' => __('Map Marker', 'mthemelocal'),\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'yes' => __('Yes','mthemelocal'),\n\t\t\t\t\t\t\t'no' => __('No','mthemelocal')\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t 'map_zoom' => array(\n\t\t\t 'std' => '18',\n\t\t\t 'type' => 'text',\n\t\t\t 'label' => __('Map Zoom (1 to 20)', 'mthemelocal'),\n\t\t\t 'desc' => __('Map Height', 'mthemelocal'),\n\t\t\t ),\n\t\t\t\t\t'map_scroll' => array(\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'label' => __('Mouse Scroll', 'mthemelocal'),\n\t\t\t\t\t\t'desc' => __('Mouse Scroll', 'mthemelocal'),\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'true' => __('True','mthemelocal'),\n\t\t\t\t\t\t\t'false' => __('False','mthemelocal')\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t'map_control' => array(\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'label' => __('Map Controls', 'mthemelocal'),\n\t\t\t\t\t\t'desc' => __('Map Controls', 'mthemelocal'),\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'true' => __('True','mthemelocal'),\n\t\t\t\t\t\t\t'false' => __('False','mthemelocal')\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t 'map_marker_image' => array(\n\t\t\t 'std' => '',\n\t\t\t 'type' => 'uploader',\n\t\t\t 'label' => __('Image as marker', 'mthemelocal'),\n\t\t\t 'desc' => __('Image as marker', 'mthemelocal'),\n\t\t\t ),\n\t\t\t 'map_marker_text' => array(\n\t\t\t 'std' => __('Marker Text','mthemelocal'),\n\t\t\t 'type' => 'text',\n\t\t\t 'label' => __('Marker text', 'mthemelocal'),\n\t\t\t 'desc' => __('Marker text', 'mthemelocal'),\n\t\t\t )\n\t\t\t\t),\n\t\t\t\t'shortcode' => '[map maptype=\"{{map_type}}\" mapstyle=\"{{map_style}}\" scrollwheel=\"{{map_scroll}}\" markerimage=\"{{map_marker_image}}\" infowindow=\"{{map_marker_text}}\" lat=\"{{map_latitude}}\" lon=\"{{map_longitude}}\" hidecontrols=\"{{map_control}}\" marker=\"{{map_marker}}\" z=\"{{map_zoom}}\" h=\"{{map_height}}\" w=\"{{map_width}}\" address=\"{{map_address}}\"]',\n\t\t\t\t'popup_title' => __('Add Google Maps', 'mthemelocal')\n\t\t\t);\n\n\t\t\t$this->the_options = $mtheme_shortcodes['map'];\n\n\t\t\t//create the block\n\t\t\tparent::__construct('em_googlemap', $block_options);\n\t\t\t// Any script registers need to uncomment following line\n\t\t\t//add_action('mtheme_aq-page-builder-admin-enqueue', array($this, 'admin_enqueue_scripts'));\n\t\t}", "function wp_scgcge_Input($type = 'text', $name, $value = '', $readonly = '', $required = '', $placeholder = '', $class = '', $id = '', $fv = '', $gfaa = '')\n{\n $gfaa_tag = $gfaa != '' ? ' maps = \"' . $gfaa . '\" ' : '';\n $readonly = $readonly != '' ? 'readonly' : '';\n $required = $required != '' ? 'required' : '';\n $fv = $fv != '' ? 'fv=\"' . $fv . '\"' : '';\n return '<input type=\"' . $type . '\" value=\"' . $value . '\" ' . $required . ' name=\"' . $name . '\" class=\"form-control ' . $class . '\" id=\"' . $name . ' ' . $id . '\" aria-describedby=\"' . $name . 'Help\" placeholder=\"' . __($placeholder, 'scgcge') . '\" ' . $readonly . ' ' . $fv . ' ' . $gfaa_tag . ' >';\n}" ]
[ "0.70038074", "0.67223233", "0.6596999", "0.6592339", "0.6567544", "0.652279", "0.6456889", "0.6407378", "0.63188815", "0.6309728", "0.6169927", "0.61639434", "0.6106769", "0.6105936", "0.60676044", "0.6046717", "0.6044575", "0.60393304", "0.60380554", "0.600839", "0.59854424", "0.59763724", "0.5931819", "0.5849056", "0.5800184", "0.57799166", "0.5761358", "0.5750826", "0.57438976", "0.5742688" ]
0.67456955
1
Updates the user role to the given role. This saves the changes on the database.
public function updateRole($role);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updated(Role $role)\n {\n //\n }", "public function updated( Role $role )\n {\n //\n }", "public function update(RoleUpdateRequest $request, Role $role)\n {\n abort_unless(Gate::allows('role-edit'), 403);\n\n try {\n $role->update($request->all());\n $role->permissions()->sync($request->input('permissions'));\n\n Alert::toast(\n __('gennix.model_role.alert_messages.update_success'),\n 'success'\n )->timerProgressBar();\n } catch (Throwable $t) {\n Alert::error(\n __('gennix.opps'),\n __('gennix.model_role.alert_messages.update_error')\n )->autoClose(2000)->timerProgressBar();\n\n Auth::user()->saveActivity(\n __('gennix.model_role.alert_messages.update_error') . ' ID ' . $request->id,\n [\n 'message' => $t->getMessage(),\n 'code_error' => $t->getCode(),\n 'line' => $t->getLine(),\n 'file' => $t->getFile(),\n ],\n 'error'\n );\n }\n\n return redirect()->route('role.index');\n }", "public function update($customer, $roleId, Google_Service_Directory_Role $postBody, $optParams = array())\n {\n $params = array('customer' => $customer, 'roleId' => $roleId, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('update', array($params), \"Google_Service_Directory_Role\");\n }", "public function update(RoleRequest $request, Role $role)\n {\n $this->roles->createOrUpdate($request, $role->id);\n\n return message(\"The role has been updated\");\n }", "public function update(Role $role, Request $request)\n {\n $role->update($request->all());\n\n if ($request->input('permissions')) {\n $role->perms()->sync($request->input('permissions'));\n } else {\n $role->perms()->sync([]);\n }\n\n flash('The role has been updated.', 'success');\n\n return redirect('/roles');\n }", "public function update(UserRole $role, Request $request)\n {\n $role->update($request->only('title', 'permissions'));\n\n return redirect()->route('roles.index')->with('alert-success', 'Role successfully updated');\n }", "public function update(Request $request, Role $role)\n {\n $role->update($request->all());\n $role->syncPermissions($request->permissions);\n\n activity()->useLog('Rol')->log('Editado')->subject();\n $lastActivity = Activity::all()->last();\n $lastActivity->subject_id = Role::all()->last()->id;\n $lastActivity->save();\n\n return redirect()->route('roles.index')->with('info', 'El rol se actualizó con exito');\n }", "public function update(Request $request, Role $role)\n {\n $role->update($request->all());\n $role->privileges()->sync($request->privilege_id);\n Session::flash('success', Lang::get('messages.saved'));\n return redirect()->back();\n }", "public function update_user_role()\n {\n $id = $this->input->post('role_id');\n $user_role = $this->input->post('user_type');\n $permissions = $this->input->post('permissions');\n $permissions = implode(',', $permissions);\n $data = array(\n 'user_role' => $user_role,\n 'user_permissions' => $permissions\n );\n $this->User_model->update_user_role($id, $data);\n $this->session->set_flashdata('SUCCESSMSG', 'Update Successfully');\n redirect('userrights/userrights_edit/' . $id);\n }", "public function update(RoleRequest $request, Role $role)\n {\n $role->update($request->all());\n $role->syncPermissions($request->input('permissions'));\n\n flash(trans('roles.messages.updated'));\n\n return redirect()->route('dashboard.roles.show', $role);\n }", "public static function profile_update_role( $user_id = 0 ) {\n if ( empty( $user_id ) )\n return;\n\n // Bail if no role\n if ( ! isset( $_POST['erp-hr-role'] ) )\n return;\n\n // HR role we want the user to have\n $new_role = sanitize_text_field( $_POST['erp-hr-role'] );\n $hr_role = erp_hr_get_user_role( $user_id );\n\n // Bail if no role change\n if ( $new_role === $hr_role ) {\n return;\n }\n\n // Bail if current user cannot promote the passing user\n if ( ! current_user_can( 'promote_user', $user_id ) ) {\n return;\n }\n\n // Set the new HR role\n $user = get_user_by( 'id', $user_id );\n\n // Remove the old role\n if ( ! empty( $role ) ) {\n $user->remove_role( $hr_role );\n }\n\n // Add the new role\n if ( !empty( $new_role ) ) {\n $user->add_role( $new_role );\n }\n }", "public function update(Role $role, Request $request)\n {\n\n try{\n $request->replace(['guard_name' => $request->guard_name, 'role_name'=> $request->role_name]);\n $role->update($request->all());\n\n }\n catch (RoleAlreadyExists $exception){\n return redirect()->back()->with('error', $exception->getMessage());\n }\n\n }", "public function changeRoleAction($id, $role) {\n\t\tif ($this->getUser()->getId() == $id)\n\t\t\treturn $this->redirect($this->generateUrl('_acsiladmins'));\n\t\t\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$superAdmin = json_encode(array('ROLE_SUPER_ADMIN'));\n\t\t$admin = json_encode(array('ROLE_ADMIN'));\n\t\tif ($role == 'admin')\n\t\t\t$setRole = $superAdmin;\n\t\telse if ($role == 'user')\n\t\t\t$setRole = $admin;\n\t\t$userToUpdate = $em\n\t\t\t->getRepository('AcsilServerAppBundle:User')\n\t\t\t->findOneBy(array('id' => $id));\n\t\t\n\t\tif ($userToUpdate) {\n\t\t\t$userToUpdate->setRoles($setRole);\n\t\t\t$em->flush();\n\t\t}\n\t\t\n\t\treturn $this->redirect($this->generateUrl('_acsiladmins'));\n\t}", "public function update(Request $request, Role $role)\n {\n //Actualice role\n\n $role->update($request->all());\n\n //Actualizar permisos\n\n $role->permissions()->sync($request->get('permissions'));\n\n return redirect()->route('roles.index')\n ->with('info', 'Role actualizado con exito');\n }", "public function update(Request $request, Role $role)\n {\n $validator = Validator::make(\n $request->all(),\n [\n \"name\" => \"required|string|max:100|unique:roles,name,\" . $role->id,\n \"permissions\" => \"required\",\n ],\n [],\n $this->attributes(),\n );\n\n if ($validator->fails()) {\n return redirect()->back()->withInput($request->all())->withErrors($validator);\n }\n\n if ($request->permissions == $role->permissions->pluck('name')->toArray()) {\n Alert::toast(trans('roles.alert.update.message.warning'), 'warning');\n\n return redirect()->route('roles.index');\n }\n\n // UPDATE DATA\n DB::beginTransaction();\n try {\n\n $role->name = $request->name;\n $role->syncPermissions($request->permissions);\n $role->update();\n Alert::toast(trans('roles.alert.update.message.success', ['name' => $request->name]), 'success');\n\n return redirect()->route('roles.index');\n } catch (\\Throwable $th) {\n DB::rollBack();\n\n Alert::error(\n trans('roles.alert.update.title.error'),\n trans('roles.alert.update.message.error', ['error' => $th->getMessage()])\n );\n\n return redirect()->back()->withInput($request->all());\n } finally {\n DB::commit();\n }\n }", "public function update(Request $request, Role $role)\n {\n $attributes = $request->validate([\n 'name' => ['required','unique:roles,name,' . $role->id],\n 'type' => ['required','integer'],\n 'department_id' => ['sometimes'],\n 'division_id' => ['sometimes']\n ]);\n\n $role->update($attributes);\n $role\n ->permissions()\n ->sync($request->permissions);\n $role\n ->types()\n ->sync($request->types);\n\n Cache::forget(\"roles\");\n\n return Redirect::route(\"roles.index\")\n ->with([\n 'msg.type' => 'success',\n 'msg.text' => \"Role '{$request->name}' was edited successfully!\"\n ]);\n }", "public function Admin_UserRole_Change(User $user, $role) {\n if(!($role != NULL || $role <= 4 || $role >= 0))\n throw new RuntimeException('Role out of range!');\n\n $user->role = $role;\n return $user->save();\n }", "public function update(UpdateRequest $request, Role $role)\n {\n $role->fill($request->input())->save();\n flash(trans('cms::cms.updated'))->important()->success();\n return redirect()->back();\n }", "public function updated(Role $role)\n {\n $action = \"Cập nhật vai trò\";\n parent::saveHistory($role,'Update',$action);\n }", "public function assignRole($user, $role);", "public function updateRole($role, Array $attributes = [])\n\t{\n\t\t// get the id of the role we're updating\n\t\t$id = $this->findId($role);\n\n\t\t// update the role data\n\t\t$attributes['id'] = $id;\n\t\tif ( ! isset($attributes['name']))\n\t\t{\n\t\t\t$attributes['name'] = $this->data[$id]['name'];\n\t\t}\n\t\t$this->data[$id] = $attributes;\n\n\t\t// write the data\n\t\t$this->store();\n\n\t\treturn $id;\n\t}", "public function update(Request $request, Role $role)\n {\n $this->updateValidator($request->all(), $role);\n $role->update($request->all());\n return redirect()\n ->route(\"admin.roles.show\", compact(\"role\"))\n ->with(\"success\", \"Успешно обновлено\");\n }", "public function update(Request $request, Role $role)\n {\n // Fields Validation\n $request->validate([\n 'name' => 'required',\n // 'guard' => 'required',\n 'description' => 'required',\n ]);\n // dd($request->input());\n\n $role->update($request->except('permissionsAvailable','permissionsAssigned','qpermit'));\n //\n // Sync the Permissions\n //\n $this->syncRoles($role, $request->input('permissionsAssigned'));\n\n return redirect()->route('roles.index')->with('success', __('Role updated successfully') );\n }", "public function update(Request $request, Role $role)\n {\n $this->validator($request->all())->validate();\n $role->update([\n 'name' => $request->name,\n 'description' => $request->description\n ]);\n $role->permissions()->delete();\n $role->permissions()\n ->createMany(ArrayChunkWithKey::create('route', $request->routes));\n\n return redirect()->route('admin.roles.show', ['role' => $role])\n ->with('alert-success', 'Role updated successfully!');\n }", "public function update(Request $request, Role $role)\n {\n request()->validate(Role::$rules);\n\n $role->update($request->all());\n\n return redirect()->route('roles.index')\n ->with('success', 'Role updated successfully');\n }", "public function update(Request $request, Role $role)\n {\n $this->validate($request, [\n 'name' => [\n 'required',\n Rule::unique('roles')->where(function($query) use ($request) {\n return $query->where('name', $request->name)\n ->where('team_id', active_team()->id);\n })->ignore($role->id)\n ],\n ]);\n\n $role->update([\n 'name' => $request->name,\n 'description' => $request->description,\n 'team_id' => active_team()->id\n ]);\n \n\n if ( $request->abilities ) {\n $abilities = array_fill_keys($request->abilities, ['team_id' => active_team()->id]);\n $role->abilities()\n ->wherePivot('team_id', active_team()->id)\n ->sync($abilities);\n }\n\n return redirect()->back();\n }", "public function postEdit($role)\r\n\t{\r\n\t\t// Declare the rules for the form validation\r\n\t\t$rules = array(\r\n\t\t\t'name' => 'required'\r\n\t\t);\r\n\r\n\t\t// Validate the inputs\r\n\t\t$validator = Validator::make(Input::all(), $rules);\r\n\r\n\t\t// Check if the form validates with success\r\n\t\tif ($validator->passes())\r\n\t\t{\r\n\t\t\t// Update the role data\r\n\t\t\t$role->name = Input::get('name');\r\n\r\n\t\t\t// Update permissions\r\n\t\t\t$permissionIds = Input::get('permissions');\r\n\r\n\t\t\tif (is_array($permissionIds))\r\n\t\t\t{\r\n\t\t\t\t$permissionIds = array_keys($permissionIds);\r\n\t\t\t}\r\n\r\n\t\t\t$role->savePermissions($permissionIds);\r\n\r\n\t\t\t// Was the role updated?\r\n\t\t\tif ($role->save())\r\n\t\t\t{\r\n\t\t\t\t// Redirect to the role page\r\n\t\t\t\treturn Redirect::to('admin/roles/' . $role->id . '/edit')->with('success', Lang::get('form.edit.success', array('resource' => Lang::get('role.resource.singular.lowercase'))));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Redirect to the role page\r\n\t\t\t\treturn Redirect::to('admin/roles/' . $role->id . '/edit')->with('error', Lang::get('form.edit.error', array('resource' => Lang::get('role.resource.singular.lowercase'))));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Form validation failed\r\n\t\treturn Redirect::to('admin/roles/' . $role->id . '/edit')->withInput()->withErrors($validator);\r\n\t}", "public function update($id)\n\t{\n\t\t$user = User::find($id);\n\t\t$role = Role::find(Input::get('role'));\n\t\t$user->name = Input::get('name');\n\t\t$user->email = Input::get('email');\n\t\t$user->password = bcrypt(Input::get('password'));\n\t\t$user->roles()->detach();\n\t\t$user->roles()->attach($role);\n\t\t$user->save();\n\t\tSession::flash('success', 'User was successful updated!');\n\t\treturn redirect('admin/users');\n\t}", "public function updateRole(Request $request) {\n\t\tRole::where('id', $request->input('id'))->update(['role' => $request->input('role')]);\n\t\treturn redirect()->to('first');\n\n\t}" ]
[ "0.7820975", "0.7702045", "0.7415672", "0.7342273", "0.7330538", "0.7256123", "0.72432333", "0.72130203", "0.7211791", "0.717553", "0.71375465", "0.706933", "0.7032845", "0.70316213", "0.70286465", "0.70239383", "0.70168924", "0.7016148", "0.6992391", "0.6953894", "0.6940799", "0.6931815", "0.6918602", "0.69151324", "0.6914502", "0.69117737", "0.68954843", "0.6884545", "0.68607867", "0.6846924" ]
0.83674127
0
Return Vfreebusy object instance
public function newVfreebusy( ? string $attendee = null, null|string|DateTimeInterface $dtstart = null, null|string|DateTimeInterface $dtend = null, ) : Vfreebusy { $ix = $this->getNextComponentIndex(); $this->components[$ix] = Vfreebusy::factory( $this->getConfig(), $attendee, $dtstart, $dtend ); return $this->components[$ix]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _handle_vfreebusy() {\n\t\t$this->_new_block('VFREEBUSY');\n\t}", "public function newVavailability(\n ? string $busyType = null,\n null|string|DateTimeInterface $dtstart = null,\n null|string|DateTimeInterface $dtend = null,\n null|string|DateInterval $duration = null\n ) : Vavailability\n {\n $ix = $this->getNextComponentIndex();\n $this->components[$ix] = Vavailability::factory(\n $this->getConfig(),\n $busyType,\n $dtstart,\n $dtend,\n $duration\n );\n return $this->components[$ix];\n }", "function freebusy($user,$end=null,$utc=true, $charset='UTF-8', $start=null, $method='PUBLISH', array $extra=null)\n\t{\n\t\tif (!$start) $start = time();\t// default now\n\t\tif (!$end) $end = time() + 100*DAY_s;\t// default next 100 days\n\n\t\t$vcal = new Horde_Icalendar;\n\t\t$vcal->setAttribute('PRODID','-//EGroupware//NONSGML EGroupware Calendar '.$GLOBALS['egw_info']['apps']['calendar']['version'].'//'.\n\t\t\tstrtoupper($GLOBALS['egw_info']['user']['preferences']['common']['lang']));\n\t\t$vcal->setAttribute('VERSION','2.0');\n\t\t$vcal->setAttribute('METHOD',$method);\n\n\t\t$vfreebusy = Horde_Icalendar::newComponent('VFREEBUSY',$vcal);\n\n\t\t$attributes = array(\n\t\t\t'DTSTAMP' => time(),\n\t\t\t'DTSTART' => $this->date2ts($start,true),\t// true = server-time\n\t\t\t'DTEND' => $this->date2ts($end,true),\t// true = server-time\n\t\t);\n\t\tif (!$utc)\n\t\t{\n\t\t\tforeach ($attributes as $attr => $value)\n\t\t\t{\n\t\t\t\t$attributes[$attr] = date('Ymd\\THis', $value);\n\t\t\t}\n\t\t}\n\t\tif (is_null($extra)) $extra = array(\n\t\t\t'URL' => $this->freebusy_url($user),\n\t\t\t'ORGANIZER' => 'mailto:'.$GLOBALS['egw']->accounts->id2name($user,'account_email'),\n\t\t);\n\t\tforeach($attributes+$extra as $attr => $value)\n\t\t{\n\t\t\t$vfreebusy->setAttribute($attr, $value);\n\t\t}\n\t\t$fbdata = parent::search(array(\n\t\t\t'start' => $start,\n\t\t\t'end' => $end,\n\t\t\t'users' => $user,\n\t\t\t'date_format' => 'server',\n\t\t\t'show_rejected' => false,\n\t\t));\n\t\tif (is_array($fbdata))\n\t\t{\n\t\t\tforeach ($fbdata as $event)\n\t\t\t{\n\t\t\t\tif ($event['non_blocking']) continue;\n\t\t\t\tif ($event['uid'] === $extra['X-CALENDARSERVER-MASK-UID']) continue;\n\t\t\t\tif ($event['participants'][$user] == 'R') continue;\n\n\t\t\t\t$fbtype = $event['participants'][$user] == 'T' ? 'BUSY-TENTATIVE' : 'BUSY';\n\n\t\t\t\tif ($utc)\n\t\t\t\t{\n\t\t\t\t\t$vfreebusy->setAttribute('FREEBUSY',array(array(\n\t\t\t\t\t\t'start' => $event['start'],\n\t\t\t\t\t\t'end' => $event['end'],\n\t\t\t\t\t)), array('FBTYPE' => $fbtype));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$vfreebusy->setAttribute('FREEBUSY',array(array(\n\t\t\t\t\t\t'start' => date('Ymd\\THis',$event['start']),\n\t\t\t\t\t\t'end' => date('Ymd\\THis',$event['end']),\n\t\t\t\t\t)), array('FBTYPE' => $fbtype));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$vcal->addComponent($vfreebusy);\n\n\t\treturn $vcal->exportvCalendar($charset);\n\t}", "public function instance();", "public static function instance();", "public static function instance();", "public static function forClass(XPClass $class) {\n $bc= new self();\n $bc->instancePool= new Vector();\n $bc->poolClass= $class;\n return $bc;\n }", "public function getFreeBusy(Request $request)\n {\n $service = new Google_Service_Calendar($this->client);\n $this->client->setAccessToken(Auth::user()->gcalendar_credentials);\n $userId = Auth::id();\n $calendarId = Calendar::where('user_id', $userId)->first()->calendar_id;\n\n $date_from = Carbon::now()->toRfc3339String();\n $date_to = Carbon::now()->addDays(7)->toRfc3339String();\n\n $freebusy_req = new Google_Service_Calendar_FreeBusyRequest();\n $freebusy_req->setTimeMin($date_from);\n $freebusy_req->setTimeMax($date_to);\n $freebusy_req->setTimeZone(env('APP_TIMEZONE'));\n\n //dd($freebusy_req);\n\n $item = new Google_Service_Calendar_FreeBusyRequestItem();\n $item->setId($calendarId);\n\n $freebusy_req->setItems(array($item));\n\n $query = $service->freebusy->query($freebusy_req);\n\n $response_calendar = $query->getCalendars();\n\n //$busy = $response_calendar->$calendarId;\n\n $response_calendar = $service->freebusy->query($freebusy_req)->getCalendars();\n\n $busy = $response_calendar[$calendarId]->getBusy();\n //dd($busy);\n\n $freeTime = array();\n $freeTimeStart = array();\n\n $busyStart = Carbon::parse($busy[0]->getStart());\n $queryStart = Carbon::parse($date_from);\n\n if ($busyStart > $queryStart) {\n $ft = $busyStart->diffInMinutes($queryStart);\n array_push($freeTime,$ft);\n array_push($freeTimeStart,$queryStart);\n }\n\n for ($i=1; $i < count($busy) ; $i++) { \n $end = Carbon::parse($busy[$i]->getStart());\n $start = Carbon::parse($busy[$i-1]->getEnd());\n $ft = $end->diffInMinutes($start);\n array_push($freeTime,$ft);\n array_push($freeTimeStart,$start);\n }\n\n \n\n for ($i=0; $i < count($freeTime); $i++) { \n\n $collection = $this->plan($freeTime[$i]);\n $timeSpent = 0;\n foreach ($collection as $todo) {\n $title = $todo->title;\n $desc = $todo->description;\n $start = Carbon::parse($freeTimeStart[$i])->addMinutes($timeSpent);\n //$duration = $todo->duration;\n $end = Carbon::parse($start)->addMinutes($todo->duration);\n //dd($start,$end);\n $calendar = $calendarId;\n\n $this->store($title,$desc,$start,$end,$calendar);\n $timeSpent+=$todo->duration;\n \n }\n }\n\n return response()->json();\n }", "abstract protected function get_free_plan_for_api();", "public static function FAST()\n {\n return new BAdapt(self::FAST);\n }", "static function getBusy(){\n\t\t$dc = we_base_request::_(we_base_request::BOOL, \"dc\");\n\n\t\t$WE_PB = new we_progressBar(0, true);\n\t\t$WE_PB->setStudLen($dc ? 490 : 200);\n\t\t$WE_PB->addText(\"\", 0, \"pb1\");\n\t\t$pb = $WE_PB->getHTML();\n\t\t$js = $WE_PB->getJSCode() .\n\t\t\t\twe_html_element::jsScript(JS_DIR . 'nextButtons.js');\n\n\t\t$cancelButton = we_html_button::create_button(we_html_button::CANCEL, \"javascript:top.close();\");\n\t\t$refreshButton = we_html_button::create_button(we_html_button::REFRESH, \"javascript:parent.wizcmd.location.reload();\", true, 0, 0, \"\", \"\", false, false);\n\n\t\t$nextbutdisabled = !(permissionhandler::hasPerm(\"REBUILD_ALL\") ||\n\t\t\t\tpermissionhandler::hasPerm(\"REBUILD_FILTERD\") ||\n\t\t\t\tpermissionhandler::hasPerm(\"REBUILD_OBJECTS\") ||\n\t\t\t\tpermissionhandler::hasPerm(\"REBUILD_INDEX\") ||\n\t\t\t\tpermissionhandler::hasPerm(\"REBUILD_THUMBS\") ||\n\t\t\t\tpermissionhandler::hasPerm(\"REBUILD_META\"));\n\n\t\tif($dc){\n\t\t\t$buttons = $refreshButton . $cancelButton;\n\t\t\t$pb = we_html_tools::htmlDialogLayout($pb, g_l('rebuild', '[rebuild]'), $buttons);\n\t\t} else {\n\t\t\t$prevButton = we_html_button::create_button(we_html_button::BACK, \"javascript:parent.wizbody.handle_event('previous');\", true, 0, 0, \"\", \"\", true, false);\n\t\t\t$nextButton = we_html_button::create_button(we_html_button::NEXT, \"javascript:parent.wizbody.handle_event('next');\", true, 0, 0, \"\", \"\", $nextbutdisabled, false);\n\n\t\t\t$content2 = we_html_element::htmlSpan(array(\"id\" => \"prev\", \"style\" => \"padding-left:10px;text-align:right\"), $prevButton) .\n\t\t\t\t\twe_html_element::htmlSpan(array(\"id\" => \"next\", \"style\" => \"padding-left:10px;text-align:right\"), $nextButton) .\n\t\t\t\t\twe_html_element::htmlSpan(array(\"id\" => \"refresh\", \"style\" => \"display:none; padding-left:10px;text-align:right\"), $refreshButton) .\n\t\t\t\t\twe_html_element::htmlSpan(array(\"id\" => \"cancel\", \"style\" => \"padding-left:10px;text-align:right\"), $cancelButton);\n\n\t\t\t$content = new we_html_table(array('class' => 'default', \"width\" => \"100%\"), 1, 2);\n\t\t\t$content->setCol(0, 0, array(\"id\" => \"progr\", \"style\" => \"display:none;text-align:left\"), $pb);\n\t\t\t$content->setCol(0, 1, array(\"style\" => \"text-align:right\"), $content2);\n\t\t}\n\n\t\treturn we_html_tools::getHtmlTop('', '', '', STYLESHEET . $js, we_html_element::htmlBody(\n\t\t\t\t\t\t\t\tarray(\"class\" => ($dc ? \"weDialogBody\" : \"weDialogButtonsBody\"), \n\t\t\t\t\t\t\t\t), ($dc ? $pb : $content->getHtml()))\n\t\t);\n\t}", "public static function FULL()\n {\n return new BAdapt(self::FULL);\n }", "public function get_instance()\n {\n if (self::$instance === null)\n self::$instance = new ub_unibox_shared;\n return self::$instance;\n }", "static function instance();", "public static function &createFrame() \n { \n $ptr = count(self::$_new_frames);\n self::$_new_frames[] = new VUIFrame;\n return self::$_new_frames[$ptr]; \n }", "public function get_instance() {\n\n $data = $this->do_api_get('/v2/instance');\n\n $instance = new \\stdClass;\n $instance->instanceId = clean_param($data->instanceId, PARAM_TEXT);\n $instance->displayName = clean_param($data->displayName, PARAM_TEXT);\n $instance->gradingMode = clean_param($data->gradingMode, PARAM_TEXT);\n $instance->lmsEnabled = clean_param($data->lmsEnabled, PARAM_BOOL);\n\n return $instance;\n }", "public function __construct () {\n\n\t\t$ls = Livestatus::instance();\n\t\t$set = StatusPool_Model::all();\n\n\t\t$it = $set->it(false, array(), 1, 0);\n\t\t$status = $it->current();\n\n\t\t$this->program = $status;\n\t\t$this->service = $ls->getServicePerformance($status->get_program_start());\n\t\t$this->host = $ls->getHostPerformance($status->get_program_start());\n\n\t}", "private function _getBox()\n {\n $dpApp = new DropboxApp(\n DROPBOX_APP_KEY, DROPBOX_APP_SECRET, $this->_token\n );\n\n return new DropBox($dpApp);\n }", "public static function instance() {\n\n //Get global\n global $globalBladeEngineInstance; \n\n //Check if a instance has been created\n if(!is_a($globalBladeEngineInstance, 'BC\\Blade\\Blade')) {\n\n //Require view paths\n if(empty(self::getViewPaths())) {\n throw new \\Exception(\"Error: View paths must be defined before running init.\");\n }\n\n //Clear cache on local instance\n self::maybeClearCache(); \n\n //Create cache path\n self::createComponentCachePath(); \n\n //Create new blade instance\n $globalBladeEngineInstance = new BladeInstance(\n (array) self::getViewPaths(),\n (string) sys_get_temp_dir() . '/global-blade-engine-cache'\n );\n\n //Check for newly created instance\n if(!is_a($globalBladeEngineInstance, 'BC\\Blade\\Blade')) {\n //Error if something went wrong\n throw new \\Exception(\"Error: Could not create new instance of blade compiler class.\");\n }\n }\n\n return $globalBladeEngineInstance; \n }", "public static function get() {\n if(self::$instance === null) {\n self::$instance = new NGGVideo();\n }\n return self::$instance;\n }", "public function getVideoObject() {\n if (!is_object($this->_pageVideoObject)) {\n include_once (PAPAYA_INCLUDE_PATH.'modules/free/Youtube/Video.php');\n $this->_pageVideoObject = new PapayaModuleYoutubeVideo();\n }\n return $this->_pageVideoObject;\n }", "public static function obtain() {\n new self();\n }", "public static function get_instance() {\r\n\t\tif ( self::$_instance == null ) {\r\n\t\t\tself::$_instance = new GF_HubSpot();\r\n\t\t}\r\n\r\n\t\treturn self::$_instance;\r\n\t}", "public function __construct() {\n \t\t$widget_ops = array(\n \t\t\t'classname' => 'vam_widget_fleet',\n \t\t\t'description' => 'VAM Fleet',\n \t\t);\n \t\tparent::__construct( 'vam_widget_fleet', 'VAM Fleet', $widget_ops );\n \t\t$this->vam = new VAMWP_VAM();\n\n \t\t$this->icao = (isset($_GET[\"plane_icao\"])) ? $_GET[\"plane_icao\"] : \"\";\n \t\t$this->location = (isset($_GET[\"plane_location\"])) ? $_GET[\"plane_location\"] : \"\";\n \t\t$this->fleet_data = $this->get_fleet($this->icao,$this->location);\n \t}", "private function _getVcsInstance()\n {\n if ($this->_vcs === null) {\n $vcsConfig = $this->_config->getParam('vcs');\n $this->_vcs = Msd_Vcs::factory($vcsConfig['adapter'], $vcsConfig['options']);\n }\n\n return $this->_vcs;\n }", "public function get_instance()\n {\n if (self::$instance === null)\n self::$instance = new ub_unibox_backend;\n return self::$instance;\n }", "public function getInstance();", "public function getInstance();", "public function getInstance();", "public function getInstance();" ]
[ "0.6775714", "0.66528577", "0.5798647", "0.5286901", "0.51099515", "0.51099515", "0.5058549", "0.49578282", "0.4939246", "0.49338502", "0.4888384", "0.4861663", "0.48406672", "0.47603902", "0.47195032", "0.47127232", "0.47108024", "0.47065866", "0.46911237", "0.46737933", "0.46663126", "0.46652138", "0.46640313", "0.46607152", "0.4640657", "0.46227157", "0.46195745", "0.46195745", "0.46195745", "0.46195745" ]
0.7236222
0
Return Vavailability object instance
public function newVavailability( ? string $busyType = null, null|string|DateTimeInterface $dtstart = null, null|string|DateTimeInterface $dtend = null, null|string|DateInterval $duration = null ) : Vavailability { $ix = $this->getNextComponentIndex(); $this->components[$ix] = Vavailability::factory( $this->getConfig(), $busyType, $dtstart, $dtend, $duration ); return $this->components[$ix]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAvailability();", "private function getAvailability ()\n {\n $this->getPreviousAvailability();\n $this->getNextAvailability();\n }", "public function getAvailability()\n {\n if (array_key_exists(\"availability\", $this->_propDict)) {\n return $this->_propDict[\"availability\"];\n } else {\n return null;\n }\n }", "public function setAvailability($val)\n {\n $this->_propDict[\"availability\"] = $val;\n return $this;\n }", "public function getType()\n {\n return self::INVENTORY_AVAILABILITY;\n }", "public function getavailabilityType()\n {\n return $this->_fields['availabilityType']['FieldValue'];\n }", "public static function init(SearchAvailabilityQuery $query): self\n {\n return new self(new SearchAvailabilityRequest($query));\n }", "public static function neutral() : AvailabilityResult {\n return new static(TRUE);\n }", "private __construct() { }\n\n // getInstance method\n public static function can_vote($v_num) {\n\n mysql_query(\"\");//query to check if v_num is in table\n\n }", "public function withavailabilityType($value)\n {\n $this->setavailabilityType($value);\n return $this;\n }", "function RadWebHosting_CheckAvailability($params)\n{\n $postfields =\n [\n \"searchTerm\" => $params[\"searchTerm\"],\n \"punyCodeSearchTerm\" => $params[\"punyCodeSearchTerm\"],\n \"tldsToInclude\" => $params[\"tldsToInclude\"],\n \"isIdnDomain\" => $params['isIdnDomain'],\n \"premiumEnabled\" => $params['premiumEnabled'],\n \"isWhmcs\" => 1\n ];\n\n $call = new Calls\\CheckAvailability(Configuration::create($params), $postfields);\n $result = $call->process();\n\n return unserialize($result);\n}", "public function is_available();", "public function setAvailability(?string $availability) : self\n {\n $this->availability = $availability;\n return $this;\n }", "public function is_available(): bool;", "private function makeAvailability ()\n {\n if ( $this->previousAvailability && $this->nextAvailability ) {\n $this->mergeBothAvailability();\n }\n\n if ( $this->previousAvailability && !$this->nextAvailability ) {\n $this->appendPreviousAvailability();\n }\n\n if ( !$this->previousAvailability && $this->nextAvailability ) {\n $this->appendNextAvailability();\n }\n\n if ( !$this->previousAvailability && !$this->nextAvailability ) {\n $this->createAvailability($this->startTime, $this->endTime, $this->address->id);\n }\n }", "public function checkAvailabilityAsOfNow($travellers, $reference) {\n $startTime = new DateTime($this->getStartdateatomAttribute());\n $capacity = $this->getAvailableCovid($travellers, $reference);\n\n switch ($this->type) {\n case 'PAELLA':\n switch ($this->getRegisteredAttribute()) {\n case 0: // no bookings yet\n switch ($travellers) {\n case '1':\n $cutOff = $startTime->sub(new DateInterval(\"PT24H\")); // 24 hours\n break;\n \n default:\n $cutOff = $startTime->sub(new DateInterval(\"PT12H\")); // 12 hours\n break;\n }\n \n break; \n default: // some bookings already\n $cutOff = $startTime->sub(new DateInterval(\"PT1H\")); // 1 hour\n break;\n }\n break;\n\n case 'TAPAS':\n switch ($this->getRegisteredAttribute()) {\n case 0: // sin reservas\n switch ($travellers) {\n case '1':\n $cutOff = $startTime->sub(new DateInterval(\"PT24H\")); // 24 hours\n break;\n \n default:\n $cutOff = $startTime->sub(new DateInterval(\"PT6H\")); // 6 hours\n break;\n }\n \n break; \n default: // con reservas\n $cutOff = $startTime->sub(new DateInterval(\"PT90M\")); // 1.5 hours\n break;\n }\n break;\n\n default:\n $cutOff = $startTime->sub(new DateInterval(\"PT24H\")); // 24 hours\n break;\n }\n\n if ($cutOff < new DateTime()) {\n $status = 'UNAVAILABLE';\n $reason = 'PAST_CUTOFF_DATE';\n } else if (!$capacity) {\n $status = 'UNAVAILABLE';\n $reason = 'SOLD_OUT';\n } else if ($capacity == -1) {\n $status = 'UNAVAILABLE';\n $reason = 'TRAVELLER_MISMATCH';\n $capacity = $this->getAvailableCovid(0);\n } else if ($travellers > $capacity) {\n $status = 'UNAVAILABLE';\n $reason = 'TRAVELLER_MISMATCH';\n } else { // there is room and before cutoff\n $status = 'AVAILABLE';\n $reason = '';\n }\n return array($cutOff->format(DATE_ATOM), $capacity , $status, $reason);\n }", "public function getAvailabilityData(): Collection\n {\n return new Collection();\n }", "public function getEligibleTransactionVolume();", "function getAvailability($user_id)\n\t{\n\t\t$query = 'SELECT available FROM match_squad '.\n\t\t\t\t\t'WHERE match_id = '.$this->match_id.' '.\n\t\t\t\t\t'AND squad_id = '.$this->squad_id.' '.\n\t\t\t\t\t'AND user_id = '.$user_id;\n\t\t$res = mysql_query($query)\n\t\t\tor die(mysql_error());\n\t\t$row = mysql_fetch_array($res);\n\t\t$this->availability = $row['available'];\n\t\treturn $this->availability;\n\t}", "public static function unavailable($reason = NULL) : AvailabilityResult {\n return new static(FALSE, $reason);\n }", "public function availability($availability, $IdItem) {\r\n\t\t$this->relateEntityWithConcept ( $availability, $IdItem, 'pangea:hasAvailability', 'skosxl:prefLabel', 'pangea:Availability' );\r\n\t}", "protected function ensureAndGetInstanceStatus()\n {\n switch ($this->instance->getStatus()) {\n case InstanceStatus::CREATED:\n $status = MasterFactory::getMasterForInstance($this->instance)->getStatus();\n if (is_array($status) && array_key_exists('deactivated', $status) && !$status['deactivated']) {\n $this->instance->setStatus(InstanceStatus::READY);\n $this->persistInstance();\n\n return $this->getStatusAction();\n }\n\n return $status;\n break;\n case InstanceStatus::READY:\n $status = OrchestratorFactory::getOrchestratorForInstance($this->instance)->inspect();\n if (is_array($status) && count($status) > 0) {\n $status = $status[0];\n }\n if (is_array($status) && array_key_exists('Status', $status) && array_key_exists('State', $status['Status']) && 'ready' === $status['Status']['State']) {\n $this->instance->setStatus(InstanceStatus::RUNNING);\n $this->persistInstance();\n\n return $this->getStatusAction();\n }\n\n return $status;\n break;\n case InstanceStatus::RUNNING:\n $status = OrchestratorFactory::getOrchestratorForInstance($this->instance)->inspect();\n if (is_array($status) && count($status) > 0) {\n $status = $status[0];\n }\n if (is_array($status) && array_key_exists('Status', $status) && array_key_exists('State', $status['Status']) && 'down' === $status['Status']['State']) {\n $this->instance->setStatus(InstanceStatus::READY);\n $this->persistInstance();\n\n return $this->getStatusAction();\n }\n\n return $status;\n break;\n default:\n return 'not ready yet';\n break;\n }\n }", "abstract public function isAvailable();", "public function setavailabilityType($value)\n {\n $this->_fields['availabilityType']['FieldValue'] = $value;\n return $this;\n }", "public function isAvailable();", "public function get_availability($dateStart = null, $dateEnd = null)\n {\n // Process parameters\n $dateStart = $this->ingestDate($dateStart);\n $dateEnd = $this->ingestDate($dateEnd, $dateStart);\n\n //Generate data metric\n $metric = new Metric_ComcastVipercDVR();\n $data = $metric->availabilitySuper8($dateStart, $dateEnd);\n\n // Set response data\n $this->setResponse('data', $data);\n $this->setResponse('start', $dateStart);\n $this->setResponse('end', $dateEnd);\n\n // Forge and return response\n return $this->forgeResponse();\n }", "public function create( &$availability ) {\n\t\tglobal $wpdb;\n\n\t\t$availability->apply_changes();\n\n\t\t$data = array(\n\t\t\t'gcal_event_id' => $availability->get_gcal_event_id( 'edit' ),\n\t\t\t'title' => $availability->get_title( 'edit' ),\n\t\t\t'range_type' => $availability->get_range_type( 'edit' ),\n\t\t\t'from_date' => $availability->get_from_date( 'edit' ),\n\t\t\t'to_date' => $availability->get_to_date( 'edit' ),\n\t\t\t'from_range' => $availability->get_from_range( 'edit' ),\n\t\t\t'to_range' => $availability->get_to_range( 'edit' ),\n\t\t\t'bookable' => $availability->get_bookable( 'edit' ),\n\t\t\t'priority' => $availability->get_priority( 'edit' ),\n\t\t\t'ordering' => $availability->get_ordering( 'edit' ),\n\t\t\t'rrule' => $availability->get_rrule( 'edit' ),\n\t\t\t'date_created' => current_time( 'mysql' ),\n\t\t\t'date_modified' => current_time( 'mysql' ),\n\t\t);\n\n\t\t$wpdb->insert( $wpdb->prefix . self::TABLE_NAME, $data );\n\t\t$availability->set_id( $wpdb->insert_id );\n\t\t$availability->save_meta_data();\n\t\tWC_Cache_Helper::incr_cache_prefix( self::CACHE_GROUP );\n\t\tWC_Bookings_Cache::delete_booking_slots_transient();\n\t}", "public function testGetCheckAvailability()\n {\n $this->json('GET', '/booking/check-availability')\n ->seeJsonEquals([\n 'created' => true,\n ]);\n }", "public function get_instance() {\n\n $data = $this->do_api_get('/v2/instance');\n\n $instance = new \\stdClass;\n $instance->instanceId = clean_param($data->instanceId, PARAM_TEXT);\n $instance->displayName = clean_param($data->displayName, PARAM_TEXT);\n $instance->gradingMode = clean_param($data->gradingMode, PARAM_TEXT);\n $instance->lmsEnabled = clean_param($data->lmsEnabled, PARAM_BOOL);\n\n return $instance;\n }", "public function getAvailabilityString()\n {\n return isset($this->AvailabilityString) ? $this->AvailabilityString : null;\n }" ]
[ "0.68289226", "0.6239898", "0.61642754", "0.6157984", "0.58632207", "0.57872003", "0.554743", "0.5516133", "0.54764736", "0.54605305", "0.54474515", "0.5413246", "0.5358324", "0.5302312", "0.5277218", "0.5250768", "0.524684", "0.5226699", "0.5215128", "0.52073693", "0.52052724", "0.51906174", "0.51896226", "0.5174229", "0.51546514", "0.5117202", "0.5111776", "0.5104999", "0.50592655", "0.50535834" ]
0.68457067
0
Return selected components from calendar on date or selectOption basis DTSTART MUST be set for every component. No date check.
public function selectComponents( null|int|array|DateTimeInterface $startY = null, null|int|DateTimeInterface $startM = null, ? int $startD = null, ? int $endY = null, ? int $endM = null, ? int $endD = null, null|string|array $cType = null, ? bool $flat = null, ? bool $any = null, ? bool $split = null ) : bool | array { return SelectFactory::selectComponents( $this, $startY, $startM, $startD, $endY, $endM, $endD, $cType, $flat, $any, $split ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function select_date(){\r\n\t\t$post_params = $this->input->post();\r\n\r\n\t\t$selected_date = trim($post_params['selected_date']);\r\n\t\t//echo $selected_date;exit;\r\n\t\t//debug($get_params);\r\n\t\tif(!empty($selected_date)){\r\n\t\t\t\r\n\t\t\t$product_get_booking_date = json_decode(base64_decode($post_params['available_date']),true);\r\n\t\t\tif(valid_array($product_get_booking_date)){\r\n\r\n\t\t\t\t$selected_date_details = $product_get_booking_date;\r\n\t\t\t\t//debug($selected_date_details);exit;\r\n\t\t\t\t$options = '';\r\n\r\n\t\t\t\t//debug($selected_date_details[$selected_date]);exit;\r\n\t\t\t\tforeach ($selected_date_details[$selected_date] as $key => $value) {\r\n\t\t\t\t\t$selected = '';\r\n\t\t\t\t\tif(isset($post_params['s_date'])){\r\n\r\n\t\t\t\t\t\tif($value==$post_params['s_date']){\r\n\t\t\t\t\t\t\t$selected =' selected';\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$options .='<option value='.$value.' '.$selected.' >'.($value).'</option>';\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\techo $options;\r\n\t\t\t\texit;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function getPeriodSelectors($dates, $defaultDate = null, $switchToSelect = 4)\n {\n $elements = array();\n if (is_array($dates) && (1 === count($dates))) {\n $fromLabel = reset($dates);\n $dates = key($dates);\n } else {\n $fromLabel = $this->_('From');\n }\n if (is_string($dates)) {\n $element = $this->form->createElement('hidden', 'dateused');\n $element->setValue($dates);\n } else {\n if (count($dates) >= $switchToSelect) {\n $element = $this->form->createElement('select', 'dateused', array('label' => $this->_('For date'), 'multiOptions' => $dates));\n $fromLabel = '';\n } else {\n $element = $this->form->createElement('radio', 'dateused', array('label' => $this->_('For date'), 'multiOptions' => $dates));\n $element->setSeparator(' ');\n $fromLabel = html_entity_decode(' &raquo; ', ENT_QUOTES, 'UTF-8');\n }\n $fromLabel .= $this->_('from');\n\n if ((null === $defaultDate) || (! isset($dates[$defaultDate]))) {\n // Set value to first key\n reset($dates);\n $defaultDate = key($dates);\n }\n $element->setValue($defaultDate);\n }\n $elements['dateused'] = $element;\n\n $type = 'date';\n if ($this->dateFormat) {\n $options['dateFormat'] = $this->dateFormat;\n list($dateFormat, $separator, $timeFormat) = \\MUtil_Date_Format::splitDateTimeFormat($options['dateFormat']);\n\n if ($timeFormat) {\n if ($dateFormat) {\n $type = 'datetime';\n } else {\n $type = 'time';\n }\n }\n }\n $options['label'] = $fromLabel;\n \\MUtil_Model_Bridge_FormBridge::applyFixedOptions($type, $options);\n\n $elements['datefrom'] = new \\Gems_JQuery_Form_Element_DatePicker('datefrom', $options);\n\n $options['label'] = ' ' . $this->_('until');\n $elements['dateuntil'] = new \\Gems_JQuery_Form_Element_DatePicker('dateuntil', $options);\n\n return $elements;\n }", "function tep_draw_date_selector($prefix, $date='') {\r\n $month_array = array();\r\n $month_array[1] =_JANUARY;\r\n $month_array[2] =_FEBRUARY;\r\n $month_array[3] =_MARCH;\r\n $month_array[4] =_APRIL;\r\n $month_array[5] =_MAY;\r\n $month_array[6] =_JUNE;\r\n $month_array[7] =_JULY;\r\n $month_array[8] =_AUGUST;\r\n $month_array[9] =_SEPTEMBER;\r\n $month_array[10] =_OCTOBER;\r\n $month_array[11] =_NOVEMBER;\r\n $month_array[12] =_DECEMBER;\r\n $usedate = getdate($date);\r\n $day = $usedate['mday'];\r\n $month = $usedate['mon'];\r\n $year = $usedate['year'];\t\t\r\n $date_selector = '<select name=\"'. $prefix .'_day\">';\r\n for ($i=1;$i<32;$i++){\r\n $date_selector .= '<option value=\"' . $i . '\"';\r\n if ($i==$day) $date_selector .= 'selected';\r\n $date_selector .= '>' . $i . '</option>';\r\n }\r\n $date_selector .= '</select>';\r\n $date_selector .= '<select name=\"'. $prefix .'_month\">';\r\n for ($i=1;$i<13;$i++){\r\n $date_selector .= '<option value=\"' . $i . '\"';\r\n if ($i==$month) $date_selector .= 'selected'; \r\n $date_selector .= '>' . $month_array[$i] . '</option>';\r\n }\r\n $date_selector .= '</select>';\r\n $date_selector .= '<select name=\"'. $prefix .'_year\">';\r\n for ($i=2001;$i<2019;$i++){\r\n $date_selector .= '<option value=\"' . $i . '\"';\r\n if ($i==$year) $date_selector .= 'selected';\r\n $date_selector .= '>' . $i . '</option>';\r\n }\r\n $date_selector .= '</select>';\r\n return $date_selector;\r\n }", "function DateSelector($inName, $useDate='') \r\n { \r\n $monthName = array(1=> \"January\", \"February\", \"March\", \r\n \"April\", \"May\", \"June\", \"July\", \"August\", \r\n \"September\", \"October\", \"November\", \"December\"); \r\n \r\n /* if date invalid or not supplied, use current time */ \r\n \r\n\t if($useDate == '') \r\n { \r\n $useDate = time(); \r\n } else {\r\n\t\t \t$useDate = convert_datetime($useDate);\r\n\t\t}\r\n \t\t\r\n /* make month selector */ \r\n $string .= \"<td><select name=\" . $inName . \"_month style='font-size:11px;'>\\n\"; \r\n for($currentMonth = 1; $currentMonth <= 12; $currentMonth++) \r\n { \r\n $string .= \"<OPTION VALUE=\\\"\"; \r\n\t\t\t if (strlen($currentMonth) <2)\r\n\t\t\t \t$string .= '0'.intval($currentMonth); \r\n else \r\n\t\t\t $string .= intval($currentMonth); \r\n $string .= \"\\\"\"; \r\n if(intval(date( \"m\", $useDate))==$currentMonth) \r\n { \r\n $string .= \" SELECTED\"; \r\n } \r\n $string .= \">\" . $monthName[$currentMonth] . \"\\n\"; \r\n } \r\n $string .= \"</SELECT></td>\"; \r\n \r\n /* make day selector */ \r\n $string .= \"<td><SELECT NAME=\" . $inName . \"_day style='font-size:11px;'>\\n\"; \r\n for($currentDay=1; $currentDay <= 31; $currentDay++) \r\n { \r\n $string .= \"<OPTION VALUE=\\\"\";\r\n\t\t\t \r\n\t\t\t if (strlen($currentDay) <2)\r\n\t\t\t \t$string .= '0'.intval($currentDay); \r\n else \r\n\t\t\t $string .= intval($currentDay); \r\n\t\t\t \r\n\t\t\t \r\n\t\t\t $string .=\"\\\"\"; \r\n if(intval(date( \"d\", $useDate))==$currentDay) \r\n { \r\n $string .= \" SELECTED\"; \r\n } \r\n $string .= \">$currentDay\\n\"; \r\n } \r\n $string .= \"</SELECT></td>\"; \r\n \r\n /* make year selector */ \r\n $string .= \"<td><SELECT NAME=\" . $inName . \"_year style='font-size:11px;'>\\n\"; \r\n $startYear = date( \"Y\", $useDate); \r\n for($currentYear = $startYear; $currentYear <= $startYear+5;$currentYear++) \r\n { \r\n $string .= \"<OPTION VALUE=\\\"$currentYear\\\"\"; \r\n if(date( \"Y\", $useDate)==$currentYear) \r\n { \r\n $string .= \" SELECTED\"; \r\n } \r\n $string .= \">$currentYear\\n\"; \r\n } \r\n $string .= \"</SELECT></td>\"; \r\n return $string;\r\n}", "function getDatesFromRange($start, $end,$format,$uname) {\r\n\r\n $array = array();\r\n $interval = new DateInterval('P1D');\r\n\r\n $realEnd = new DateTime($end);\r\n $realEnd->add($interval);\r\n\r\n $period = new DatePeriod(new DateTime($start), $interval, $realEnd);\r\n\r\n foreach($period as $date) { \r\n $array[] = $date->format($format); \r\n }\r\n\r\n $no=count($array);\r\n for($i=0;$i<$no; $i++){\r\n\r\n echo \"<tr><td><button><i class=\\\"far fa-calendar\\\"></i></button></td><td><input class='content' name='date[]' type='date' style='border: none;' value='\".$array[$i].\"' readonly></td><td><select class='content' name='project[]'><option>---</option>\";\r\n createProject($uname);\r\n echo \"</select></td>\";\r\n\r\n echo \"<td><select class='content' name='task[]'><option>---</option>\";\r\n\r\n createTask($uname);\r\n echo \"</select><td><input class='content' name='hours[]' type='number'></td><td><input class='content' name='desc[]' type='text'></td></tr> \";\r\n \r\n }\r\n}", "function smarty_func_html_select_date()\r\n{\r\n /* Default values. */\r\n $prefix = \"Date_\";\r\n $time = time();\r\n $start_year = strftime(\"%Y\");\r\n $end_year = $start_year;\r\n $display_days = true;\r\n $display_months = true;\r\n $display_years = true;\r\n $month_format = \"%B\";\r\n $day_format = \"%02d\";\r\n $year_as_text = false;\r\n /* Display years in reverse order? Ie. 2000,1999,.... */\r\n $reverse_years = false;\r\n /* Should the select boxes be part of an array when returned from PHP?\r\n e.g. setting it to \"birthday\", would create \"birthday[Day]\",\r\n \"birthday[Month]\" & \"birthday[Year]\". Can be combined with prefix */\r\n $field_array = null;\r\n /* <select size>'s of the different <select> tags.\r\n If not set, uses default dropdown. */\r\n $day_size = null;\r\n $month_size = null;\r\n $year_size = null;\r\n /* Unparsed attributes common to *ALL* the <select>/<input> tags.\r\n An example might be in the template: all_extra ='class =\"foo\"'. */\r\n $all_extra = null;\r\n /* Separate attributes for the tags. */\r\n $day_extra = null;\r\n $month_extra = null;\r\n $year_extra = null;\r\n /* Order in which to display the fields.\r\n \"D\" -> day, \"M\" -> month, \"Y\" -> year. */\r\n $field_order = 'MDY';\r\n /* String printed between the different fields. */\r\n $field_separator = \"\\n\";\r\n\r\n extract(func_get_arg(0));\r\n\r\n $time = smarty_make_timestamp($time);\r\n $field_order = strtoupper($field_order);\r\n\r\n $html_result = $month_result = $day_result = $year_result = \"\";\r\n\r\n if ($display_months) {\r\n $month_names = array();\r\n\r\n for ($i = 1; $i <= 12; $i++)\r\n $month_names[] = strftime($month_format, mktime(0, 0, 0, $i, 1, 2000));\r\n\r\n $month_result .= '<select name=';\r\n if (null !== $field_array){\r\n $month_result .= '\"' . $field_array . '[' . $prefix . 'Month]\"';\r\n } else {\r\n $month_result .= '\"' . $prefix . 'Month\"';\r\n }\r\n if (null !== $month_size){\r\n $month_result .= ' size=\"' . $month_size . '\"';\r\n }\r\n if (null !== $month_extra){\r\n $month_result .= ' ' . $month_extra;\r\n }\r\n if (null !== $all_extra){\r\n $month_result .= ' ' . $all_extra;\r\n }\r\n $month_result .= '>'.\"\\n\";\r\n $month_result .= smarty_func_html_options(array('output' => $month_names,\r\n 'values' => range(1, 12),\r\n 'selected' => strftime(\"%m\", $time),\r\n 'print_result' => false));\r\n $month_result .= '</select>';\r\n }\r\n\r\n if ($display_days) {\r\n $days = range(1, 31);\r\n for ($i = 0; $i < count($days); $i++)\r\n $days[$i] = sprintf($day_format, $days[$i]);\r\n\r\n $day_result .= '<select name=';\r\n if (null !== $field_array){\r\n $day_result .= '\"' . $field_array . '[' . $prefix . 'Day]\"';\r\n } else {\r\n $day_result .= '\"' . $prefix . 'Day\"';\r\n }\r\n if (null !== $day_size){\r\n $day_result .= ' size=\"' . $day_size . '\"';\r\n }\r\n if (null !== $all_extra){\r\n $day_result .= ' ' . $all_extra;\r\n }\r\n if (null !== $day_extra){\r\n $day_result .= ' ' . $day_extra;\r\n }\r\n $day_result .= '>'.\"\\n\";\r\n $day_result .= smarty_func_html_options(array('output' => $days,\r\n 'values' => range(1, 31),\r\n 'selected' => strftime(\"%d\", $time),\r\n 'print_result' => false));\r\n $day_result .= '</select>';\r\n }\r\n\r\n if ($display_years) {\r\n if (null !== $field_array){\r\n $year_name = $field_array . '[' . $prefix . 'Year]';\r\n } else {\r\n $year_name = $prefix . 'Year';\r\n }\r\n if ($year_as_text) {\r\n $year_result .= '<input type=\"text\" name=\"' . $year_name . '\" value=\"'.strftime('%Y', $time).'\" size=\"4\" maxlength=\"4\"';\r\n if (null !== $all_extra){\r\n $year_result .= ' ' . $all_extra;\r\n }\r\n if (null !== $year_extra){\r\n $year_result .= ' ' . $year_extra;\r\n }\r\n $year_result .= '>';\r\n } else {\r\n $years = range((int)$start_year, (int)$end_year);\r\n if ($reverse_years) {\r\n rsort($years, SORT_NUMERIC);\r\n }\r\n\r\n $year_result .= '<select name=\"' . $year_name . '\"';\r\n if (null !== $year_size){\r\n $year_result .= ' size=\"' . $year_size . '\"';\r\n }\r\n if (null !== $all_extra){\r\n $year_result .= ' ' . $all_extra;\r\n }\r\n if (null !== $year_extra){\r\n $year_result .= ' ' . $year_extra;\r\n }\r\n $year_result .= '>'.\"\\n\";\r\n $year_result .= smarty_func_html_options(array('output' => $years,\r\n 'values' => $years,\r\n 'selected' => strftime(\"%Y\", $time),\r\n 'print_result' => false));\r\n $year_result .= '</select>';\r\n }\r\n }\r\n\r\n // Loop thru the field_order field\r\n for ($i = 0; $i <= 2; $i++){\r\n $c = substr($field_order, $i, 1);\r\n switch ($c){\r\n case 'D':\r\n $html_result .= $day_result;\r\n break;\r\n\r\n case 'M':\r\n $html_result .= $month_result;\r\n break;\r\n\r\n case 'Y':\r\n $html_result .= $year_result;\r\n break;\r\n }\r\n // Add the field seperator\r\n $html_result .= $field_separator;\r\n }\r\n\r\n print $html_result;\r\n}", "public function events_select(): void\n {\n $response = $this->check_request('Get selections');\n if (!$response) {\n $group = input_request('group');\n $exclude = \"true\" === input_request('exclude');\n $active = $this->get_flag(input_request('active'));\n $response = $this->get_response(false, 'Get selection');\n $response['select'] = $this->select_search(\n $group, $exclude, $active);\n }\n exit(json_encode($response));\n }", "public function setControlMenu() {\n /*\n * If the application didn't provide $month / $year data\n * Set the default values to the current month and year\n * We only set this once here and it'll be used and implied\n * for the drawCalendar function. Since this function is called\n * first through the init() function\n */\n if (($this->month == NULL) || ($this->year == NULL)) {\n // Month in numbers with the leading 0\n $this->month = date(\"m\");\n $this->year = date(\"Y\");\n }\n\n /* select month control */\n $this->selectMonth = '<select class=\"' . $this->style . '-control-select\" name=\"month\" id=\"month\">';\n for ($x = 1; $x <= 12; $x++) {\n $this->selectMonth.= '<option value=\"' . $x . '\"' .\n ($x != $this->month ? '' : ' selected=\"selected\"') . '>' . date('F', mktime(0, 0, 0, $x, 1, $this->year)) . '</option>';\n }\n $this->selectMonth.= '</select>';\n\n /* select year control */\n // Alter this year_range number to change how many years difference are selectable.\n $year_range = 7;\n $this->selectYear = '<select class=\"' . $this->style . '-control-select\" name=\"year\" id=\"year\">';\n for ($x = ($this->year - floor($year_range / 2)); $x <= ($this->year + floor($year_range / 2)); $x++) {\n $this->selectYear.= '<option value=\"' . $x . '\"' . ($x != $this->year ? '' : ' selected=\"selected\"') . '>' . $x . '</option>';\n }\n $this->selectYear.= '</select>';\n\n // For Yii Framework\n $this->nextMonth = ($this->month != 12 ? $this->month + 1 : 1);\n $this->yearNextMonth = ($this->month != 12 ? $this->year : $this->year + 1);\n $this->previousMonth = ($this->month != 1 ? $this->month - 1 : 12);\n $this->yearPreviousMonth = ($this->month != 1 ? $this->year : $this->year - 1);\n\n /* Bring all the controls together in a menu */\n // BUGFIX -Ensure the route \"r=controller/action\" is properly set by calling CHtml::beginForm()\n // without this the <form> simply sends the GET data back to the \"default\" controller's default action (ie.. site/index)-TLDJR\n $routeString = \"\" . Yii::app()->controller->id . \"/\" . Yii::app()->controller->action->id;\n $this->startForm = '<table cellpadding=\"0\" cellspacing=\"0\" class=\"' . $this->style . '-control\"><tr><td>' . CHtml::beginForm(Yii::app()->createAbsoluteUrl($routeString), 'get', array('id' => 'calForm'));\n $this->displayControls = $this->selectMonth . $this->selectYear .\n ' <input type=\"submit\" name=\"submit\" value=\"Go\" />';\n\n $this->closeForm = '</form></td></tr>\n\t\t</table>';\n }", "public function getSelect();", "public static function getOptionsForSelect(): array {\n return self::$selection;\n }", "public function component_select_options()\n {\n return Component::select_options($this->id);\n }", "public function SelectValues()\n\t{\n\t\tGLOBAL $Db;\n\t\t$sql=\"SELECT id, SUBSTRING({$this->dateFieldName}, 9, 2) as day\n\t\tFROM {$this->table}\n\t\tWHERE SUBSTRING({$this->dateFieldName}, 1, 7)='{$this->year}-{$this->month}' {$this->cond}\";\n\t\t$rows=$Db->Query($sql);\n\t\tif (Utils::IsArray($rows))\n\t\t{\n\t\t\tforeach ($rows as $row)\n\t\t\t{\n\t\t\t\t$this->actions[] = (integer) $row['day'];\n\t\t\t}\n\t\t}\n\t}", "function dev_draw_date_select($name = 'date', $label = 'Date', $value = '', $readonly = false) {\n\tif ($value == '') {\n\t\t$value = date(\"Y-m-d\");\n\t}\n\t$disabled = ($readonly === false) ? '' : 'readonly';\n \n $date_day = dev_split_date($value, 'day');\n $date_month = dev_split_date($value, 'month');\n $date_year = dev_split_date($value, 'year');\n \n $output = '';\n if ($label != '') $label .= ': <br />';\n\t$output .= $label . '\n <select name=\"' . $name . '_month\" ' . $disabled . '>';\n for ($count=1; $count<=12; $count++) {\n\t\t$output .= '<option value=\"' . $count . '\"';\n\t\tif ($date_month == $count) $output .= ' selected=\"selected\"';\n\t\t$output .= '>' . $count . '</option>';\n }\n $output .= '</select> /\t\n <select name=\"' . $name . '_day\" ' . $disabled . '>';\n for ($count=1; $count<=31; $count++) {\n\t\t$output .= '<option value=\"' . $count . '\"';\n\t\tif ($date_day == $count) $output .= ' selected=\"selected\"';\n\t\t$output .= '>' . $count . '</option>';\n }\n $output .= '</select> /\n <select name=\"' . $name . '_year\" ' . $disabled . '>';\n for ($count=1983; $count<=2016; $count++) {\n\t\t$output .= '<option value=\"' . $count . '\"';\n\t\tif ($date_year == $count) $output .= ' selected=\"selected\"';\n\t\t$output .= '>' . $count . '</option>';\n }\n $output .= '</select><br />';\n\n return $output;\n}", "protected function handleSelected(): array\n {\n return [\n 'year' => $this->yearFilter->getSelected(),\n 'month' => $this->monthFilter->getSelected(),\n 'day' => $this->dayFilter->getSelected()\n ];\n }", "function ft_wp_date_range_search_dropdown($params)\r\n{\r\n global $LANG;\r\n\r\n $default_value = (isset($params[\"default\"])) ? $params[\"default\"] : \"\";\r\n $onchange = (isset($params[\"onchange\"])) ? $params[\"onchange\"] : \"\";\r\n $style = (isset($params[\"style\"])) ? $params[\"style\"] : \"\";\r\n $form_id = $params[\"form_id\"];\r\n $view_id = $params[\"view_id\"];\r\n\r\n $attributes = array(\r\n \"id\" => $params[\"name_id\"],\r\n \"name\" => $params[\"name_id\"],\r\n \"onchange\" => $onchange,\r\n \"style\" => $style\r\n );\r\n\r\n $attribute_str = \"\";\r\n while (list($key, $value) = each($attributes))\r\n {\r\n if (!empty($value))\r\n $attribute_str .= \" $key=\\\"$value\\\"\";\r\n }\r\n\r\n $rows = array();\r\n $rows[] = \"<option value=\\\"\\\">{$LANG[\"phrase_select_date_range\"]}</option>\";\r\n $rows[] = \"<option value=\\\"1\\\" \" . (($default_value == \"1\") ? \"selected\" : \"\") . \">{$LANG[\"phrase_last_day\"]}</option>\";\r\n $rows[] = \"<option value=\\\"2\\\" \" . (($default_value == \"2\") ? \"selected\" : \"\") . \">{$LANG[\"phrase_last_2_days\"]}</option>\";\r\n $rows[] = \"<option value=\\\"3\\\" \" . (($default_value == \"3\") ? \"selected\" : \"\") . \">{$LANG[\"phrase_last_3_days\"]}</option>\";\r\n $rows[] = \"<option value=\\\"5\\\" \" . (($default_value == \"5\") ? \"selected\" : \"\") . \">{$LANG[\"phrase_last_5_days\"]}</option>\";\r\n $rows[] = \"<option value=\\\"7\\\" \" . (($default_value == \"7\") ? \"selected\" : \"\") . \">{$LANG[\"phrase_last_week\"]}</option>\";\r\n $rows[] = \"<option value=\\\"30\\\" \" . (($default_value == \"30\") ? \"selected\" : \"\") . \">{$LANG[\"phrase_last_month\"]}</option>\";\r\n $rows[] = \"<option value=\\\"365\\\" \" . (($default_value == \"365\") ? \"selected\" : \"\") . \">{$LANG[\"phrase_last_year\"]}</option>\";\r\n $rows[] = \"</optgroup>\";\r\n\r\n $dd = \"<select $attribute_str>\" . join(\"\\n\", $rows) . \"</select>\";\r\n\r\n return $dd;\r\n}", "function build() {\n\t\t$t=getdate();\n \t\t$myear=$t[year]+1;\n\n\t\t$this->day = new view_element(\"select\");\n\t\t\n\n\t\t$this->day->options = array(\"1\"=>\"1\", \"5\"=>\"5\", \"10\"=>\"10\", \"15\"=>\"15\", \"20\"=>\"20\", \"25\"=>\"25\", \"30\"=>\"30\");\n\t\t\n\t\t\t\t\t\t\t\t \n\t\tparent::build();\n\t}", "protected function getCommandList()\r\n\t\t{\r\n\t\t\treturn array(\r\n\t\t\t\t'Select date' => 'setDate'\r\n\t\t\t\t);\r\n\t\t}", "function selectCalDay($calid = NULL){\n\t\t$data = array();\n\t\t$query = \"SELECT * FROM calendar c JOIN day d ON c.day_id = d.day_id\";\n\n\t\tif($calid != NULL) $query .= \" WHERE c.calendar_id = \".$calid;\n\t\t$rs = $this->registry->db->Execute($query);\n\t\tif($rs){\n\t\t\tif($rs->RecordCount() > 0){\n\t\t\t\twhile($row = $rs->FetchNextObject()){\n\t\t\t\t\t$data[] = $row;\n\t\t\t\t}\n\t\t\t}\n\t\t}else throw new Exception('gagal mengambil data');\n\t\t\n\t\treturn $data;\n\t}", "public function getGDSDates()\n {\n $gds = $this->createEntity('GDSVagter');\n $select = $gds->getSelect();\n $select->setField('DISTINCT DATE(start)',false)->\n setOrder('start','asc');\n $results = $this->db->query($select);\n $result = array();\n foreach ($results as $row)\n {\n $result[] = $row[0];\n }\n return $result;\n }", "public function getCombo()\n {\n $this->view->assunto = $this->getService('Assunto')->comboAssunto();\n $this->view->grauAcesso = $this->getService('GrauAcesso')->listItensGrauAcesso();\n $this->view->tipoPessoa = $this->getService('TipoPessoa')->comboTipoPessoa();\n $this->view->tipoArtefato = $this->getService('TipoArtefato')->listItems();\n $this->view->tipoDocumento = $this->getService('TipoDoc')->listItems();\n $this->view->tipoPrioridade = $this->getService('Prioridade')->listItems();\n\n # carrega cargos para o cadastro de documento no padrão array('no_cargo'=>'no_cargo')\n $this->view->cargo = $this->getService('VwCargo')->comboCargoCadastroDocumento();\n # carrega funções para o cadastro de documento no padrão array('no_funcao'=>'no_funcao')\n $this->view->funcao = $this->getService('Funcao')->comboFuncaoCadastroDocumento();\n }", "function getBasicSalaryRangeStartDate($db, $varname, $default = \"\", $extra = \"\", $criteria = \"\", $action = \"\")\n{\n $strResult = \"\";\n $strHidden = \"\";\n if (!$listonly) {\n $strResult .= \"<select name=\\\"$varname\\\" $action>\\n\";\n }\n $strResult .= $extra;\n $strSQL = \"SELECT DISTINCT start_date FROM hrd_basic_salary_range \";\n $strSQL .= \"ORDER BY start_date DESC \";\n $resDb = $db->execute($strSQL);\n while ($rowDb = $db->fetchrow($resDb)) {\n ($rowDb['start_date'] == $default) ? $strSelect = \"selected\" : $strSelect = \"\";\n $strResult .= \"<option value=\\\"\" . $rowDb['start_date'] . \"\\\" $strSelect>\" . $rowDb['start_date'] . \"</option>\\n\";\n }\n $strResult .= \"</select>\\n\";\n return $strResult;\n}", "public function getDataSectionIdOptions ()\n {\n //echo \"I am in Pages Service's getDataSectionOption<br/>\";\n $options = array();\n //inject default datasection as Not Assigned\n $options[0] = 'Not Assigned';\n $datasections = $this->getDefaultEntityManager()->getRepository('SiteMaps\\Entity\\SiteMapSection')->findAll();\n\n foreach ($datasections as $keySection => $valSection) {\n $options[$valSection->getId()] = $valSection->getDataSection();\n }\n\n $datasection = new \\Zend\\Form\\Element\\Select('dataSectionId');\n $datasection->setLabel('Data Section');\n $datasection->setLabelAttributes(array('class' => 'blockLabel'));\n $datasection->setAttribute('class', 'stdTextInput');\n $datasection->setValueOptions($options);\n \n\t\t\n return $options;\n }", "public function getalldatebydropdown($datedropdown){\n \tif (isset($datedropdown) && $datedropdown==1) {\n \t\t$start_date = date(\"Y-m-d\");\n \t\t$end_date = date(\"Y-m-d\");\n \t} else if (isset($datedropdown) && $datedropdown==2) {\n \t\t$yesterday = strtotime(\"-1 day\");\n \t\t$start_date = date('Y-m-d', $yesterday);\n \t\t$end_date = date(\"Y-m-d\");\n \t} else if (isset($datedropdown) && $datedropdown==3) {\n \t\t$week = strtotime(\"-7 day\");\n \t\t$start_date = date('Y-m-d', $week);\n \t\t$end_date = date(\"Y-m-d\");\n \t} else if (isset($datedropdown) && $datedropdown==4) {\n \t\t$month = strtotime(\"-1 month\");\n \t\t$start_date = date('Y-m-d', $month);\n \t\t$end_date = date(\"Y-m-d\");\n \t} else if (isset($datedropdown) && $datedropdown==5) {\n \t\t$year = strtotime(\"-1 year\");\n \t\t$start_date = date('Y-m-d', $year);\n \t\t$end_date = date(\"Y-m-d\");\n \t} else {\n \t\t$start_date = $_REQUEST['start_date'];\n \t\t$end_date = $_REQUEST['end_date'];\n \t}\n \t$data['start_date'] = $start_date;\n \t$data['end_date'] = $end_date;\n \treturn $data;\n }", "protected function selectOptionsFromValue(): void\n {\n if (empty($this->options)) {\n return;\n }\n\n // there is no current value known. So, just stop.\n if ($this->value === null) {\n return;\n }\n\n // walk all options\n foreach ($this->options as $option) {\n if ($option instanceof Option) {\n if (is_array($this->value)) {\n $option->setSelected(in_array($option->getValue(), $this->value));\n } else {\n $option->setSelected($option->getValue() == $this->value);\n }\n } elseif ($option instanceof Optgroup) {\n $options = $option->getOptions();\n foreach ($options as $option2) {\n if (is_array($this->value)) {\n $option2->setSelected(in_array($option2->getValue(), $this->value));\n } else {\n $option2->setSelected($option2->getValue() == $this->value);\n }\n }\n }\n }\n }", "function getSessionStartDates () {\n\t\t\t\n\t\t$query = \"\n\t\t\t\tSELECT\n\t\t\t\t\tDISTINCT \n\t\t\t\t\tdate_format(start_date, '%M %e') AS date_label,\n\t\t\t\t\tdate(start_date) AS start_date\n\t\t\t\tFROM \n\t\t\t\t\tsailing_session\n\t\t\t\tORDER BY\n\t\t\t\t\tdate(start_date)\"\n\t\t;\n\n\t\t$db = new db;\n\t\t\n\t\t$resultSet = $db->select($query);\n\n\t\treturn $resultSet;\n\t\t\n\t}", "public function customSelectPart()\r\n\t{\r\n\t\t$this->customSelectPart \t= $this->settingVars->dateperiod.\" AS DATE\";\r\n\t\t$this->customGroupByPart\t= \"GROUP BY DATE ORDER BY DATE DESC\";\r\n\t\t$this->getVar\t\t\t\t= \"DATE\";\r\n\t}", "static public function ctrCargarSelectEstado(){\r\n\r\n\t\t$tabla = \"tbl_periodoacademico\";\r\n\r\n\t\t$respuesta = ModeloPeriodoAcm::mdlCargarSelect($tabla);\r\n\r\n\t\treturn $respuesta;\r\n\r\n\t}", "public function search_by_date( ) {\r\n\r\n $this->duration_range_select = array(\r\n\r\n 'this_month' => __( 'This Month' , 'woocommerce-ac' ),\r\n 'last_month' => __( 'Last Month' , 'woocommerce-ac' ),\r\n 'this_quarter' => __( 'This Quarter' , 'woocommerce-ac' ),\r\n 'last_quarter' => __( 'Last Quarter' , 'woocommerce-ac' ),\r\n 'this_year' => __( 'This Year' , 'woocommerce-ac' ),\r\n 'last_year' => __( 'Last Year' , 'woocommerce-ac' ),\r\n 'other' => __( 'Custom' , 'woocommerce-ac' ),\r\n );\r\n if ( isset( $_GET['duration_select'] ) ) {\r\n $duration_range = $_GET['duration_select'];\r\n }else{\r\n $duration_range = \"this_month\";\r\n }\r\n ?>\r\n <div class = \"main_start_end_date\" id = \"main_start_end_date\" >\r\n <div class = \"filter_date_drop_down\" id = \"filter_date_drop_down\" >\r\n <label class=\"date_time_filter_label\" for=\"date_time_filter_label\" >\r\n <strong>\r\n <?php _e( \"Select date range:\", \"woocommerce-ac\"); ?>\r\n </strong>\r\n </label>\r\n\r\n <select id=duration_select name=\"duration_select\" >\r\n <?php\r\n foreach ( $this->duration_range_select as $key => $value ) {\r\n $sel = \"\";\r\n if ( $key == $duration_range ) {\r\n $sel = __( \"selected \", \"woocommerce-ac\" );\r\n }\r\n echo\"<option value='\" . $key . \"' $sel> \" . __( $value,'woocommerce-ac' ) . \" </option>\";\r\n }\r\n ?>\r\n </select>\r\n <?php\r\n\r\n $start_date_range = \"\";\r\n if ( isset( $_GET['wcap_start_date'] ) ) {\r\n $start_date_range = $_GET['wcap_start_date'];\r\n }\r\n\r\n $end_date_range = \"\";\r\n if ( isset( $_GET['wcap_end_date'] ) ){\r\n $end_date_range = $_GET['wcap_end_date'];\r\n }\r\n $start_end_date_div_show = 'block';\r\n if ( !isset($_GET['duration_select']) || $_GET['duration_select'] != 'other' ) {\r\n $start_end_date_div_show = 'none';\r\n }\r\n ?>\r\n\r\n <div class = \"wcap_start_end_date_div\" id = \"wcap_start_end_date_div\" style=\"display: <?php echo $start_end_date_div_show; ?>;\" >\r\n <input type=\"text\" id=\"wcap_start_date\" name=\"wcap_start_date\" readonly=\"readonly\" value=\"<?php echo $start_date_range; ?>\" placeholder=\"yyyy-mm-dd\"/>\r\n <input type=\"text\" id=\"wcap_end_date\" name=\"wcap_end_date\" readonly=\"readonly\" value=\"<?php echo $end_date_range; ?>\" placeholder=\"yyyy-mm-dd\"/>\r\n </div>\r\n <div id=\"wcap_submit_button\" class=\"wcap_submit_button\">\r\n <?php submit_button( __( 'Go', 'woocommerce-ac' ), 'button', false, false, array('ID' => 'wcap-search-by-date-submit' ) ); ?>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <?php\r\n }", "public function getProductOptionsList($productID,$date=null) {\n if (is_null($date)) {\n $date = date(\"Y-m-d\");\n }\n $productOptions = array();\n $select = $this->select();\n $select->where(\"productID = ?\", $productID)\n ->where(\"optionStartDate <= ?\", $date)\n ->where(\"optionEndDate >=? or optionEndDate='0000-00-00'\", $date);\n $row = $this->fetchAll($select);\n foreach ($row as $data) {\n $prodOpt = new Model_Core_Product_ProductOptions();\n $prodOpt->populate($data);\n $productOptions[] = $prodOpt;\n }\n return $productOptions;\n }", "protected function getInputSelectionCriteria()\n\t{\n\t\treturn array();\n\t}" ]
[ "0.5622902", "0.5365839", "0.53635263", "0.53424907", "0.53411305", "0.5314604", "0.52788615", "0.5274077", "0.52693367", "0.5214323", "0.5096958", "0.5076931", "0.50486684", "0.50475526", "0.50268656", "0.502176", "0.5016011", "0.4996872", "0.49803227", "0.4970429", "0.49678388", "0.4940856", "0.4936905", "0.49211374", "0.48651356", "0.48285246", "0.48183852", "0.48115644", "0.47902498", "0.47878155" ]
0.5893331
0
Return bool true if prop is a iCal component select/sort property
public static function isSelectSortProp( string $propName ) : bool { static $SELSORTPROPS = [ self::ATTENDEE, self::CATEGORIES, self::CONTACT, self::LOCATION, self::ORGANIZER, self::PRIORITY, self::RELATED_TO, self::RESOURCES, self::STATUS, self::SUMMARY, self::UID, self::URL, ]; return in_array( $propName, $SELSORTPROPS, true ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is($prop){\r\n \treturn $this->get_property($prop)==1?true:false;\r\n }", "function isProperty($alias=false,$prop=false) {\n\tif (!$this->isSearchObject($alias)) { return false; }\n\tif (!is_string($prop) or $prop == '') { return false; }\n\tif (!array_key_exists($alias,$this->_properties)) { return false; }\n\tif (!is_array($this->_properties[$alias])) { return false; }\n\tif (!array_key_exists($prop,$this->_properties[$alias])) { return false; }\n\tif (!is_array($this->_propertyKeys)) { return false; }\n\tforeach($this->_propertyKeys as $key) {\n\t\tif (!array_key_exists($key,$this->_properties[$alias][$prop])) {\n\t\t\treturn false;\n\t\t\t}\n\t\t}\n\treturn true;\n\t}", "function getPropertyIsDate($alias,$prop) {\n\tif (!$this->isProperty($alias,$prop)) { return 'not a property'; }\n\treturn $this->_propertyKeyGet($alias,$prop,'isDate');\n\t}", "public function is($prop, $compare = null);", "public function isPropertyComparison(): bool\n {\n return $this->comparisonProperty !== null;\n }", "public function isSelectable() {\n\t\treturn $this->isAssociated() || $this->hasOptionsCallable() || !empty($this->_options) || $this->isTags() || $this->isType(self::FIELD_TYPE_SELECT);\n\t}", "final public function isPropertySet($property)\n {\n return isset($this->$property);\n }", "public function isProperty(): bool\n {\n return $this->isProperty;\n }", "public function getProperty( string $propName ) : bool | array\n {\n static $PROPS = [\n self::ATTENDEE,\n self::CATEGORIES,\n self::CONTACT,\n self::DTSTART,\n self::GEOLOCATION,\n self::LOCATION,\n self::ORGANIZER,\n self::PRIORITY,\n self::RESOURCES,\n self::STATUS,\n self::SUMMARY,\n 'RECURRENCE-ID-UID',\n self::RELATED_TO,\n 'R-UID',\n self::UID,\n self::URL\n ];\n $propName = strtoupper( $propName );\n if( ! in_array( $propName, $PROPS, true )) {\n return false;\n }\n $output = [];\n $content = null;\n foreach( array_keys( $this->components ) as $cix ) {\n switch( true ) {\n case ( ! self::isVcalendarVcomp( $this->components[$cix]->getCompType() )) :\n continue 2;\n case ( ! property_exists( $this->components[$cix], StringFactory::getInternalPropName( $propName ))) :\n continue 2;\n case self::isMultiProp1( $propName ) :\n $this->components[$cix]->getProperties( $propName, $output );\n continue 2;\n case (( 3 < strlen( $propName )) &&\n ( self::UID === substr( $propName, -3 ))) :\n if( false !== ( $content = $this->components[$cix]->getRecurrenceid())) {\n $content = $this->components[$cix]->getUid();\n }\n break;\n case (( self::GEOLOCATION === $propName ) &&\n ( ! property_exists( $this->components[$cix], strtolower( self::GEO )) ||\n ( false === ( $content = $this->components[$cix]->getGeoLocation())))) :\n continue 2;\n default :\n $method = StringFactory::getGetMethodName( $propName );\n if( ! method_exists( $this->components[$cix], $method ) ||\n ( false === ( $content = $this->components[$cix]->{$method}()))) {\n continue 2;\n }\n } // end switch\n if( empty( $content )) {\n continue;\n }\n switch( true ) {\n case ( $content instanceof DateTime ) :\n $key = $content->format( DateTimeFactory::$Ymd );\n if( ! isset( $output[$key] )) {\n $output[$key] = 1;\n }\n else {\n ++$output[$key];\n }\n break;\n case ( is_array( $content )) :\n foreach( $content as $partKey => $partValue ) {\n if( ! isset( $output[$partKey] )) {\n $output[$partKey] = $partValue;\n }\n else {\n $output[$partKey] += $partValue;\n }\n } // end foreach\n break;\n case ( ! isset( $output[$content] )) :\n $output[$content] = 1;\n break;\n default :\n ++$output[$content];\n break;\n } // end switch\n } // end foreach( $this->components as $cix => $component)\n if( ! empty( $output )) {\n ksort( $output );\n }\n return $output;\n }", "public function get_prop( $prop ) {\n\t\treturn isset( $this->props[ $prop ] ) ? $this->props[ $prop ] : false;\n\t}", "private function isValid( $prop )\n\t{\n\t\treturn ($prop !== 'false');\n\t}", "public function isAvailableInCurrentType($property) {\n \t\n \t$typeValue = $this->getTypeValue(false);\n \tif (empty($typeValue)) { // no types are used, field is always available\n \t\treturn true;\n \t}\n \t\n \t// following fields are available in all types (even if not configured excplicitely)\n \tif (t3lib_div::inList(self::versioningFields . ',' . self::standardFields, $property)) {\n \t\t\treturn true; \t\t\n \t}\n \tif (in_array($property, $this->_specialFields) || in_array($property, $this->_enableColumns)) {\n \t\treturn true;\n \t}\n \t\n \t$fields = tx_tcaobjects_div::getFieldsForTypeValue($typeValue, $this->_table);\n \t\n \treturn in_array($property, $fields);\n }", "public function isPropertyBindingType($prop) {\n return array_key_exists('binding', $this->_properties[$prop]['data']);\n }", "protected function isProperty($key)\n {\n return in_array($key, static::$properties);\n }", "public function has_prop( $prop ) {\n\t\treturn ! empty( $this->props[ $prop ] );\n\t}", "public function isSelectable()\n\t{\n\t\treturn $this->oImapFolder->IsSelectable() && $this->exists();\n\t}", "public function __isset( $prop ) {\n return isset( $this->{$prop} ) || isset( $this->container[ $prop ] );\n }", "public function prop_exists( $prop ) {\n\t\treturn ! empty( $this->props[ $prop ] );\n\t}", "function is_valid_property_type($property_type_id = '')\n{\n\t$is_valid = false;\n\t$property_types = Application::Get('property_types');\n\tforeach($property_types as $key => $val){\n\t\tif($property_type_id == $val['id']){\n\t\t\t$is_valid = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\treturn $is_valid;\n}", "public function hasProperty(){\n return $this->_has(1);\n }", "public function __isset($property)\r\n\t{\r\n\t\treturn array_key_exists($property, $this->options);\r\n\t}", "public function __isset($property)\n\t{\n\t\treturn array_key_exists($property, $this->options);\n\t}", "protected function isPropertyNeedProcess($property) {\n $method = $this->getPropertyFunction($property);\n\n return method_exists($this, $method);\n }", "public function hasPropertyKey($key)\n {\n /** @var \\yii\\db\\ActiveRecord|\\DevGroup\\DataStructure\\traits\\PropertiesTrait $owner */\n $owner = $this->owner;\n $owner->ensurePropertiesAttributes();\n return in_array($key, $owner->propertiesAttributes);\n }", "public function isAccessible(string $property): bool;", "public function getIsTheOnlyProductTypeProperty()\n {\n return ProductType::count() == 1;\n }", "public function hasAvaliacaoSelecionada() {\n return $this->oAvaliacaoSelecionada instanceof Avaliacao;\n }", "public function isComputed(): bool\n {\n return $this instanceof ComputedProperty ||\n $this->hasAnnotation(new Computed, Boolean::true()) ||\n $this->hasAnnotation(new ComputedDefaultValue, Boolean::true());\n }", "function setPropertySelect($alias,$prop,$method) {\n\tif (!$this->isProperty($alias,$prop)) { return false; }\n\tif (!is_string($method) or strlen($method) < 1) { return false; }\n\treturn $this->propertyKeySet($alias,$prop,'select_method',$method);\n\t}", "public function hasGrupoAvaliacaoSelecionada() {\n return $this->oGrupoAvaliacao instanceof AvaliacaoGrupo;\n }" ]
[ "0.6991931", "0.6287614", "0.6063174", "0.59901327", "0.58999515", "0.5880427", "0.5772196", "0.57521737", "0.5747157", "0.5635342", "0.55982476", "0.5556791", "0.5514792", "0.5484715", "0.5464162", "0.5447319", "0.5400092", "0.5399846", "0.53654605", "0.53535926", "0.5332278", "0.52828807", "0.5281446", "0.5278624", "0.5275893", "0.5264696", "0.52509433", "0.5247086", "0.52422446", "0.5221554" ]
0.7363659
0
return self with (replaced) populated Vtimezone component
public function vtimezonePopulate( ? string $timezone = null, ? array $xProp = [], null|int|DateTimeInterface $start = null, null|int|DateTimeInterface $end = null ) : self { return VtimezonePopulateFactory::process( $this, $timezone, $xProp, $start, $end ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _handle_vtimezone() {\n\t\t$this->_new_block('VTIMEZONE');\n\t}", "public function __construct()\n {\n date_default_timezone_set(get_company_option('timezone', get_option('timezone','Asia/tehran')));\n\n }", "public function newVtimezone( ? string $tzid = null ) : Vtimezone\n {\n $vTimezones = $others = [];\n foreach( array_keys( $this->components ) as $cix ) {\n if( self::VTIMEZONE === $this->components[$cix]->getCompType()) {\n $vTimezones[] = clone $this->components[$cix];\n continue;\n }\n $others[] = clone $this->components[$cix];\n } // end foreach\n $vtix = count( $vTimezones );\n $vTimezone = Vtimezone::factory( $this->getConfig(), $tzid );\n $vTimezones[$vtix] = $vTimezone;\n $this->components = [];\n foreach( array_keys( $vTimezones ) as $cix ) {\n $this->components[] = $vTimezones[$cix];\n }\n foreach( array_keys( $others ) as $cix ) {\n $this->components[] = $others[$cix];\n }\n return $vTimezone;\n }", "public function __construct() {\n date_default_timezone_set(get_option('timezone', 'Asia/Dhaka'));\n }", "public function setTimezone($timezone): self;", "public function setTimeZone($vCurrentTime = null)\n {\n\t\tif ( is_string($vCurrentTime) && 'now' !== $vCurrentTime && in_array($vCurrentTime,\\DateTimeZone::listIdentifiers())) {\n\t\t\t$this->sTimeZone = $vCurrentTime;\n\t\t} else {\n\t\t\t$this->sTimeZone = $vCurrentTime instanceof \\DateTimeInterface ? $vCurrentTime->getTimeZone()->getName() : date_default_timezone_get();\n\t\t}\n\t\treturn $this;\n }", "protected function revertOriginalTimeZone(): self\n\t{\n\t\tif ($this->originalTimeZone !== null) {\n\t\t\t$this->dateTime->setTimezone($this->originalTimeZone);\n\t\t\t$this->originalTimeZone = null;\n\t\t}\n\n\t\treturn $this;\n\t}", "final public function timezone($value): self\n {\n if (!$value instanceof \\DateTimeZone) {\n $value = new \\DateTimeZone($value);\n }\n\n $this->timezone = $value;\n\n return $this;\n }", "public function setTimezoneFromCity()\r\n {\r\n $tzname = $this->getCity()->getTimeZone();\r\n if ( null === $tzname) {\r\n $this->setTimezone( 'Europe/London');\r\n } else {\r\n $this->setTimezone( $tzname);\r\n }\r\n return $this;\r\n }", "public function setTimezone($value);", "protected function setTimezone()\n {\n $setter = new TimezoneSetter();\n $setter->register();\n }", "function __construct() {\n date_default_timezone_set('Europe/Warsaw');\n }", "function __construct() {\n date_default_timezone_set('Europe/Warsaw');\n }", "public function __construct() {\n\t\tparent::__construct();\n\t\tdate_default_timezone_set(\"Europe/Moscow\");\n\t}", "public function __construct() {\n\t\tparent::__construct();\n\t\tdate_default_timezone_set(\"Europe/Moscow\");\n\t}", "public function __construct()\n {\n date_default_timezone_set('UTC');\n parent::__construct();\n }", "public function _timeZones()\n {\n $timeZones=array(\n 'Kwajalein' => 'GMT -12.00 Kwajalein',\n 'Pacific/Midway' => 'GMT -11.00 Pacific/Midway',\n 'Pacific/Honolulu' => 'GMT -10.00 Pacific/Honolulu',\n 'America/Anchorage' => 'GMT -9.00 America/Anchorage',\n 'America/Los_Angeles' => 'GMT -8.00 America/Los_Angeles',\n 'America/Denver' => 'GMT -7.00 America/Denver',\n 'America/Chicago' => 'GMT -6.00 America/Chicago',\n 'America/New_York' => 'GMT -5.00 America/New_York',\n 'America/Caracas' => 'GMT -4.30 America/Caracas',\n 'America/Halifax' => 'GMT -4.00 America/Halifax',\n 'America/St_Johns' => 'GMT -3.30 America/St_Johns',\n 'America/Argentina/Buenos_Aires'=> 'GMT +-3.00 America/Argentina/Buenos_Aires',\n 'America/Sao_Paulo' =>' GMT -3.00 America/Sao_Paulo',\n 'Atlantic/South_Georgia' => 'GMT +-2.00 Atlantic/South_Georgia',\n 'Atlantic/Azores' => 'GMT -1.00 Atlantic/Azores',\n 'Europe/Dublin' => 'GMT Europe/Dublin',\n 'Europe/Belgrade' => 'GMT +1.00 Europe/Belgrade',\n 'Europe/Minsk' => 'GMT +2.00 Europe/Minsk',\n 'Asia/Kuwait' => 'GMT +3.00 Asia/Kuwait',\n 'Asia/Tehran' => 'GMT +3.30 Asia/Tehran',\n 'Asia/Muscat' => 'GMT +4.00 Asia/Muscat',\n 'Asia/Yekaterinburg' => 'GMT +5.00 Asia/Yekaterinburg',\n 'Asia/Kolkata' => 'GMT +5.30 Asia/Kolkata',\n 'Asia/Katmandu' => 'GMT +5.45 Asia/Katmandu',\n 'Asia/Dhaka' => 'GMT +6.00 Asia/Dhaka',\n 'Asia/Rangoon' => 'GMT +6.30 Asia/Rangoon',\n 'Asia/Krasnoyarsk' => 'GMT +7.00 Asia/Krasnoyarsk',\n 'Asia/Brunei' => 'GMT +8.00 Asia/Brunei',\n 'Asia/Seoul' => 'GMT +9.00 Asia/Seoul',\n 'Australia/Darwin' => 'GMT +9.30 Australia/Darwin',\n 'Australia/Canberra' => 'GMT +10.00 Australia/Canberra',\n 'Asia/Magadan' => 'GMT +11.00 Asia/Magadan',\n 'Pacific/Fiji' => 'GMT +12.00 Pacific/Fiji',\n 'Pacific/Tongatapu' => 'GMT +13.00 Pacific/Tongatapu'\n );\n return $timeZones;\n }", "public function setTimezoneToLocal() : \\DateTime /*self invariant*/\n {\n if ($this->frozen) {\n throw new \\RuntimeException(get_class($this) . ' is read-only, frozen.');\n }\n if (!$this->timezoneIsLocal) {\n parent::setTimezone(static::$timezoneLocal);\n $this->timezoneName = static::$timezoneLocalName;\n $this->timezoneIsLocal = true;\n }\n return $this;\n }", "public function __construct() {\n\t\tdate_default_timezone_set(date_default_timezone_get());\n\t}", "public function __construct()\n {\n parent::__construct();\n date_default_timezone_set(SYSTEM_TIMEZONE);\n }", "public static function add_vtimezone(Horde_Icalendar $vcal, $tzid)\n\t{\n\t\t// check if we have vtimezone component data for $tzid\n\t\tif (!($vtimezone = calendar_timezones::tz2id($tzid, 'component')))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t// $vtimezone is a string with a single VTIMEZONE component, afaik Horde_Icalendar can not add it directly\n\t\t// --> we have to parse it and let Horde_Icalendar add it again\n\t\t$horde_vtimezone = Horde_Icalendar::newComponent('VTIMEZONE',$container=false);\n\t\t$horde_vtimezone->parsevCalendar($vtimezone,'VTIMEZONE');\n\t\t// DTSTART is in UTC time, Horde_Icalendar parses it in server timezone, which we need to set again for printing\n\t\t$standard = $horde_vtimezone->findComponent('STANDARD');\n\t\tif (is_a($standard, 'Horde_Icalendar'))\n\t\t{\n\t\t\t$time = $standard->getAttribute('DTSTART');\n\t\t\t$dtstart = new egw_time($time, egw_time::$server_timezone);\n\t\t\t$dtstart->setTimezone(egw_time::$server_timezone);\n\t\t\t$standard->setAttribute('DTSTART', $dtstart->format('Ymd\\THis'), array(), false);\n\t\t}\n\t\t$daylight = $horde_vtimezone->findComponent('DAYLIGHT');\n\t\tif (is_a($daylight, 'Horde_Icalendar'))\n\t\t{\n\t\t\t$time = $daylight->getAttribute('DTSTART');\n\t\t\t$dtstart = new egw_time($time, egw_time::$server_timezone);\n\t\t\t$dtstart->setTimezone(egw_time::$server_timezone);\n\t\t\t$daylight->setAttribute('DTSTART', $dtstart->format('Ymd\\THis'), array(), false);\n\t\t}\n\t\t//error_log($vtimezone); error_log($horde_vtimezone->_exportvData('VTIMEZONE'));\n\t\t$vcal->addComponent($horde_vtimezone);\n\n\t\treturn true;\n\t}", "public function vlocationNames2Location() : self\n {\n foreach( array_keys( $this->components ) as $cix ) {\n if( in_array( $this->components[$cix]->getCompType(), [ self::VEVENT, self::VTODO ] , true )) {\n $this->components[$cix]->vlocationNames2Location();\n }\n }\n return $this;\n }", "protected function getForm_Type_TimezoneService()\n {\n @trigger_error('The \"form.type.timezone\" service is deprecated since Symfony 3.1 and will be removed in 4.0.', E_USER_DEPRECATED);\n\n return $this->services['form.type.timezone'] = new \\Symfony\\Component\\Form\\Extension\\Core\\Type\\TimezoneType();\n }", "public function getTimezone(){\n\t\treturn parent::getSingleValue('2');\n\t}", "function myTime($zone=\"Europe/London\") {\n\t\tdate_default_timezone_set($zone);\n\t\treturn $this->__construct();\n\t}", "protected function _construct()\n {\n $this->setTemplate('customer/sales/order/create/address/form/renderer/vat.phtml');\n }", "function __construct() {\n parent::__construct();\n date_default_timezone_set(\"America/Sao_Paulo\");\n }", "protected function setJavascriptData() {\n // Define parameters that are being used more then once\n $userTimezoneOffset = $this->getUserTimezoneOffset();\n\n // Make array of parameters to pass to javascript\n $javascriptOptions = array(\n 'widgetId' => $this->getId(),\n 'label' => $this->label,\n 'utcTimezoneOffset' => $this->getUTCTimezoneOffset(),\n 'userTimezoneOffset' => $userTimezoneOffset,\n 'useUserTimezone' => $this->useUserTimezone,\n 'timezoneEmptyText' => $this->timezoneEmptyText,\n 'showTimezoneEmptyText' => ($userTimezoneOffset === false)\n );\n // Encode php array to Javascript friendly object/array\n $javascriptEncodedOptions = CJavaScript::encode($javascriptOptions);\n\n // Set javascript variable\n Yii::app()->clientScript->registerScript('set_options' . $this->getId(), \"\n var {$this->jsObjectVar} = new siteDateTime( {$javascriptEncodedOptions} );\n \", CClientScript::POS_READY);\n }", "public function setTimezone($timezone) {\r\n\t\t$this->timezone = $timezone;\r\n\t\treturn $this;\r\n\t}", "private function initViewData()\n {\n $this->dataForViews = [\n \"language_id\" => 0,\n \"language_name\" => \"en\",\n \"site_id\" => 1,\n \"site\" => [],\n \"current_content_id\" => 0,\n \"translations\" => [],\n \"currentPage\" => []\n ];\n\n return $this;\n }" ]
[ "0.65587056", "0.618771", "0.6178226", "0.5958805", "0.58343524", "0.5798219", "0.5780822", "0.5775796", "0.5647516", "0.5645155", "0.56443876", "0.55969846", "0.55969846", "0.5592371", "0.5592371", "0.55505943", "0.5524323", "0.5517799", "0.5513801", "0.5502309", "0.54849666", "0.5478306", "0.5416546", "0.53629184", "0.534348", "0.5342219", "0.53093356", "0.5273339", "0.52709615", "0.52676" ]
0.6374769
1
Set Vevent/Vtodo subComponent Vlocation names as Locations, skip if set Vlocation UID set as Location Xparam xvlocationid All Vlocation name parameters are set if not exist. Vlocation LOCATION_TYPE set as Location Xparam xlocationtype
public function vlocationNames2Location() : self { foreach( array_keys( $this->components ) as $cix ) { if( in_array( $this->components[$cix]->getCompType(), [ self::VEVENT, self::VTODO ] , true )) { $this->components[$cix]->vlocationNames2Location(); } } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setLocationData()\n\t{\n\t\t$location = Locations::where('id', '=', $this->location_id)->first();\n\t\t$this->location = $location;\n\t}", "function vendorsWithLocation() {\n $this->layout = false;\n $this->autoRender = false;\n $listingVendors = $this->listingVendors();\n $vendorWithLoc = array();\n foreach ($listingVendors as $key => $vendor) {\n\n $vendorArr = $this->Vendor->find('first', array('conditions' => array('id' => $key)));\n $locationAddress = '';\n $locationName = '';\n if (!empty($vendorArr)) {\n $mapLoc = '';\n //if branch name is not empty\n if (!empty($vendorArr['Vendor']['vendor_name'])) {\n $mapLoc.='<b>' . $vendorArr['Vendor']['vendor_name'] . '</b><br/>';\n }\n\n //get lat lng\n //province\n $province = !empty($vendorArr['Vendor']['state_id']) ? $this->_getProvinceName($vendorArr['Vendor']['state_id']) : '';\n //country\n $country = !empty($vendorArr['Vendor']['country_id']) ? $this->_getCountryName($vendorArr['Vendor']['country_id']) : '';\n\n if (!empty($vendorArr['Vendor']['mail_address'])) {\n $locationAddress = $vendorArr['Vendor']['mail_address'];\n } elseif (!empty($vendorArr['Vendor']['mail_address2'])) {\n $locationAddress = $vendorArr['Vendor']['mail_address2'];\n }\n if (!empty($locationAddress)) {\n $mapLoc.=$locationAddress . '<br/>';\n }\n //if city is not empty\n if (!empty($vendorArr['Vendor']['city'])) {\n $locationAddress = !empty($locationAddress) ? $locationAddress . ',' . $vendorArr['Vendor']['city'] : $vendorArr['Vendor']['city'];\n $mapLoc = !empty($mapLoc) ? $mapLoc . ' ' . $vendorArr['Vendor']['city'] : $vendorArr['Vendor']['city'];\n }\n\n $locationAddress = !empty($province) ? $locationAddress . ',' . $province : $locationAddress;\n $locationAddress = !empty($country) ? $locationAddress . ',' . $country : $locationAddress;\n $mapLoc = !empty($mapLoc) ? $mapLoc . ', ' . $province : $province;\n $mapLoc = !empty($mapLoc) ? $mapLoc . ', ' . $country : $country;\n\n //if postal code is not empty\n if (!empty($vendorArr['Vendor']['postal_code'])) {\n $locationAddress = !empty($locationAddress) ? $locationAddress . ',' . $vendorArr['Vendor']['postal_code'] : $vendorArr['Vendor']['postal_code'];\n $mapLoc = !empty($mapLoc) ? $mapLoc . ', ' . $vendorArr['Vendor']['postal_code'] : $vendorArr['Vendor']['postal_code'];\n }\n //if phone is not empty\n if (!empty($vendorArr['Vendor']['contact_phoneno'])) {\n\n $mapLoc = !empty($mapLoc) ? $mapLoc . '<br/>' . $vendorArr['Vendor']['contact_phoneno'] : $vendorArr['Vendor']['contact_phoneno'];\n }\n $mapLoc = !empty($mapLoc) ? $mapLoc . '<br/>' . 'Vendor' : 'Vendor';\n $latitude = $longitude = '';\n if (!empty($locationAddress)) {\n // We get the JSON results from this request\n $geo = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address=' . urlencode($locationAddress) . '&sensor=false');\n // We convert the JSON to an array\n $geo = json_decode($geo, true);\n // If everything is cool\n if ($geo['status'] = 'OK' && !empty($geo['results'])) {\n\n // We set our values\n $latitude = @$geo['results'][0]['geometry']['location']['lat'];\n $longitude = @$geo['results'][0]['geometry']['location']['lng'];\n }\n }\n if (!empty($latitude) && !empty($longitude)) {\n $dataArr['Lat'] = $latitude;\n $dataArr['Lng'] = $longitude;\n $dataArr['city'] = $mapLoc;\n $vendorWithLoc[] = $dataArr;\n }\n }\n }\n echo json_encode($vendorWithLoc);\n }", "public function installLocationData() {\n // Create the default settings.\n $this->setLocationSettings();\n\n update_option('gssi_location_version', GSSI_LOCATION_VERSION_NUM);\n }", "private function updateVisitInfoWithLocation(&$visitorInfo, $location)\n {\n static $logVisitToLowerLocationMapping = array(\n 'location_country' => LocationProvider::COUNTRY_CODE_KEY,\n );\n\n static $logVisitToLocationMapping = array(\n 'location_region' => LocationProvider::REGION_CODE_KEY,\n 'location_city' => LocationProvider::CITY_NAME_KEY,\n 'location_latitude' => LocationProvider::LATITUDE_KEY,\n 'location_longitude' => LocationProvider::LONGITUDE_KEY,\n );\n\n foreach ($logVisitToLowerLocationMapping as $column => $locationKey) {\n if (!empty($location[$locationKey])) {\n $visitorInfo[$column] = strtolower($location[$locationKey]);\n }\n }\n\n foreach ($logVisitToLocationMapping as $column => $locationKey) {\n if (!empty($location[$locationKey])) {\n $visitorInfo[$column] = $location[$locationKey];\n }\n }\n\n // if the location has provider/organization info, set it\n if (!empty($location[LocationProvider::ISP_KEY])) {\n $providerValue = $location[LocationProvider::ISP_KEY];\n\n // if the org is set and not the same as the isp, add it to the provider value\n if (!empty($location[LocationProvider::ORG_KEY])\n && $location[LocationProvider::ORG_KEY] != $providerValue\n ) {\n $providerValue .= ' - ' . $location[LocationProvider::ORG_KEY];\n }\n } else if (!empty($location[LocationProvider::ORG_KEY])) {\n $providerValue = $location[LocationProvider::ORG_KEY];\n }\n\n if (isset($providerValue)\n && Manager::getInstance()->isPluginInstalled('Provider')) {\n $visitorInfo['location_provider'] = $providerValue;\n }\n }", "public function prepare_location($p_location_id)\n {\n\n if (!isset(self::$m_cached_locations[$p_location_id]))\n {\n $l_dao = isys_cmdb_dao_jdisc::instance($this->m_db);\n $l_data = $l_dao->get_object_by_id($p_location_id)\n ->get_row();\n self::$m_cached_locations[$p_location_id] = new SplFixedArray(5);\n self::$m_cached_locations[$p_location_id][0] = $l_data['isys_obj__id'];\n self::$m_cached_locations[$p_location_id][1] = $l_data['isys_obj__title'];\n self::$m_cached_locations[$p_location_id][2] = $l_data['isys_obj_type__const'];\n self::$m_cached_locations[$p_location_id][3] = $l_data['isys_obj_type__title'];\n self::$m_cached_locations[$p_location_id][4] = $l_data['isys_obj__sysid'];\n } // if\n\n return [\n C__DATA__TITLE => _L('LC__CMDB__CATG__LOCATION'),\n 'const' => 'C__CATG__LOCATION',\n 'category_type' => C__CMDB__CATEGORY__TYPE_GLOBAL,\n 'category_entities' => [\n [\n 'data_id' => null,\n 'properties' => [\n 'parent' => [\n 'tag' => 'parent',\n 'value' => self::$m_cached_locations[$p_location_id][0],\n 'id' => self::$m_cached_locations[$p_location_id][0],\n 'type' => self::$m_cached_locations[$p_location_id][2],\n 'sysid' => self::$m_cached_locations[$p_location_id][4],\n 'lc_title' => self::$m_cached_locations[$p_location_id][3],\n 'title' => self::$m_cached_locations[$p_location_id][1],\n ]\n ]\n ]\n ]\n ];\n }", "function fun_getLocationListOptions($locID='', $region_id='', $pregion_id=''){\t\t\n\t\t$selected = \"\";\n\t\t$where = array();\n\n\t\t$sql = \"SELECT * FROM \" . TABLE_LOCATION . \" \";\n\t\tif($region_id !=\"\"){\n\t\t\tarray_push($where, \"region_id='\".(int)fun_db_input($region_id).\"' \");\n\t\t}\n\n\t\tif($pregion_id != \"\" && $region_id == \"\") {\n\t\t\t$subregion_ids \t= \"\";\n\t\t\t$sqlSubRegion \t= \"SELECT region_id FROM \" . TABLE_REGION . \" WHERE pregion_id ='\".$region_id.\"'\";\n\t\t\t$rsSubRegion \t= $this->dbObj->createRecordset($sqlSubRegion);\n\t\t\tif($this->dbObj->getRecordCount($rsSubRegion)) {\n\t\t\t\t$arr = $this->dbObj->fetchAssoc($rsSubRegion);\n\t\t\t\tfor($i = 0; $i < count($arr); $i++) {\n\t\t\t\t\t$subregion_ids .= $arr[$i]['region_id'].\",\";\n\t\t\t\t}\n\t\t\t\t$subregion_ids = (substr($subregion_ids, strlen($subregion_ids)-1, strlen($subregion_ids)) == \",\")?substr($subregion_ids, 0, strlen($subregion_ids)-1):$subregion_ids;\n\t\t\t\tarray_push($where, \"region_id IN (\".$subregion_ids.\") \");\n\t\t\t}\n\t\t}\n\n\t\tif(sizeof($where) > 0){\n\t\t\t$sql .= \" WHERE \".join($where, \" AND \");\n\t\t}\n\t\t$sql .= \" ORDER BY location_name\";\n\n\t\t$result = $this->dbObj->fun_db_query($sql);\n\t\twhile($rowsCon = $this->dbObj->fun_db_fetch_rs_object($result)){\n\t\t\tif($rowsCon->location_id == $locID && $locID!=''){\n\t\t\t\t$selected = \"selected\";\n\t\t\t}else{\n\t\t\t\t$selected = \"\";\n\t\t\t}\n\t\t\techo \"<option value=\\\"\".fun_db_output($rowsCon->location_id).\"\\\" \" .$selected. \">\";\n\t\t\techo fun_db_output(ucwords($rowsCon->location_name));\n\t\t\techo \"</option>\\n\";\n\t\t}\t\t\n\t\t$this->dbObj->fun_db_free_resultset($result);\n\t}", "function vu_imports_unit_locations_special_callback($source, $item_key, $element_key, &$field, $settings) {\n $values = $source->current_item['locations'];\n $haystack = array_flip($values);\n\n // Build a new array of field values.\n $found = [];\n if (isset($haystack['VU Sydney'])) {\n $found[] = 'VU Sydney';\n }\n if (isset($haystack['Industry'])) {\n $found[] = 'Industry';\n }\n if (isset($haystack['Other'])) {\n $found[] = 'Other';\n }\n\n // Return the subset of special locations found in the array.\n $field = $found;\n}", "public function testUpdateInventoryLocation()\n {\n }", "public function setRemoteLocations(ContextInterface $ctx, SetRemoteLocationsRequest $request): void;", "public function init() {\n // $result = $location_type->getAdjusmentTypes();\n // foreach ($result as $trans) {\n // $this->_list[\"location_type\"][''] = 'Select';\n // }\n\n foreach ($this->_fields as $col => $name) {\n switch ($col) {\n case \"location_name_add\":\n case \"location_name_update\":\n case \"ccm_location_id\":\n case \"ccm_location_id_update\":\n $this->addElement(\"text\", $col, array(\n \"attribs\" => array(\"class\" => \"form-control\"),\n \"allowEmpty\" => false,\n \"filters\" => array(\"StringTrim\", \"StripTags\"),\n \"validators\" => array()\n ));\n $this->getElement($col)->removeDecorator(\"Label\")->removeDecorator(\"HtmlTag\");\n break;\n default:\n break;\n }\n if (in_array($col, array_keys($this->_list))) {\n $this->addElement(\"select\", $col, array(\n \"attribs\" => array(\"class\" => \"form-control\"),\n \"filters\" => array(\"StringTrim\", \"StripTags\"),\n \"allowEmpty\" => true,\n \"required\" => false,\n \"registerInArrayValidator\" => false,\n \"multiOptions\" => $this->_list[$col]\n ));\n $this->getElement($col)->removeDecorator(\"Label\")->removeDecorator(\"HtmlTag\");\n }\n if (in_array($col, array_keys($this->_checkbox))) {\n $this->addElement(\"multiCheckbox\", $col, array(\n \"attribs\" => array(),\n \"allowEmpty\" => true,\n 'separator' => '',\n \"filters\" => array(\"StringTrim\", \"StripTags\"),\n \"validators\" => array(),\n \"multiOptions\" => $this->_checkbox[$col]\n ));\n $this->getElement($col)->removeDecorator(\"Label\")->removeDecorator(\"HtmlTag\")->removeDecorator(\"<br>\");\n }\n }\n\n foreach ($this->_hidden as $col => $name) {\n switch ($col) {\n\n\n case \"location_id\":\n case \"location_type\":\n case \"province_id\":\n case \"district_id\":\n case \"parent_id\":\n case \"province_id_edit\":\n case \"district_id_edit\":\n case \"parent_id_edit\":\n case \"location_type_id_update_hidden\":\n $this->addElement(\"hidden\", $col);\n $this->getElement($col)->removeDecorator(\"Label\")->removeDecorator(\"HtmlTag\");\n break;\n default:\n break;\n }\n }\n }", "public function setLocationIdAttribute($input)\n {\n $this->attributes['location_id'] = $input ? $input : null;\n }", "public function setLocation($location) {\r\n\t$this->location = $location;\r\n }", "public function __construct(\\WorkdayWsdl\\\\StructType\\LocationObjectType $location_Reference = null, \\WorkdayWsdl\\\\StructType\\Location_iDataType $location_Data = null, $add_Only = null, $version = null)\n {\n $this\n ->setLocation_Reference($location_Reference)\n ->setLocation_Data($location_Data)\n ->setAdd_Only($add_Only)\n ->setVersion($version);\n }", "function setLocation($name,array $point = array(),$url = ''){\r\n \r\n $location_map = array('name' => $name, 'point' => $point, 'url' => $url);\r\n return $this->setField('location',$location_map);\r\n \r\n }", "public function location_property_pos_import($p_value)\n {\n if (is_array($p_value) && is_numeric($p_value[C__DATA__VALUE]))\n {\n // Parent already in array so check in_array\n if (in_array($this->m_property_data['parent'][C__DATA__VALUE], $this->m_object_ids))\n {\n\n // Check parent location\n $l_dao_loc = isys_cmdb_dao_category_g_location::instance($this->m_database);\n $l_res = $l_dao_loc->get_data(null, $this->m_property_data['parent'][C__DATA__VALUE]);\n\n if ($l_res->num_rows() > 0)\n {\n\n $l_dao_ff = isys_cmdb_dao_category_g_formfactor::instance($this->m_database);\n\n $l_ff_res = $l_dao_ff->get_data(null, $this->m_object_ids[$p_value['obj_id']]);\n if ($l_ff_res->num_rows() > 0)\n {\n $l_ff_data = $l_ff_res->get_row();\n $l_base = $l_ff_data['isys_catg_formfactor_list__rackunits'];\n }\n else\n {\n $l_base = 1;\n }\n\n $l_ff_res = $l_dao_ff->get_data(null, $this->m_property_data['parent'][C__DATA__VALUE]);\n\n $l_position_already_set = false;\n\n if ($l_ff_res->num_rows() > 0)\n {\n $l_ff_data = $l_ff_res->get_row();\n if ($l_ff_data['isys_catg_formfactor_list__rackunits'] < ($p_value[C__DATA__VALUE] + $l_base))\n {\n $l_data = [\n 'id' => $l_ff_data['isys_catg_formfactor_list__id'],\n 'formfactor' => $l_ff_data['isys_catg_formfactor_list__isys_catg_formfactor_type__id'],\n 'rackunits' => ((int) ($p_value[C__DATA__VALUE] + $l_base)),\n 'unit' => $l_ff_data['isys_catg_formfactor_list__isys_depth_unit__id'],\n 'width' => $l_ff_data['isys_catg_formfactor_list__installation_width'],\n 'height' => $l_ff_data['isys_catg_formfactor_list__installation_height'],\n 'depth' => $l_ff_data['isys_catg_formfactor_list__installation_depth'],\n 'weight' => $l_ff_data['isys_catg_formfactor_list__installation_weight'],\n 'weight_unit' => $l_ff_data['isys_catg_formfactor_list__isys_weight_unit__id'],\n 'description' => $l_ff_data['isys_catg_formfactor_list__description']\n ];\n\n if (method_exists($l_dao_ff, 'save')) $l_dao_ff->save($l_ff_data['isys_catg_formfactor_list__id'], $l_data);\n }\n $l_loc_info = $l_dao_loc->get_positions_in_rack($this->m_property_data['parent'][C__DATA__VALUE]);\n\n $l_insertion = $this->m_property_data['insertion'][C__DATA__VALUE];\n\n $l_used_pos_front = $l_used_pos_back = [];\n if (is_array($l_loc_info['assigned_units']))\n {\n foreach ($l_loc_info['assigned_units'] AS $l_assigned_obj)\n {\n for ($i = $l_assigned_obj['pos'];$i < ($l_assigned_obj['height'] + $l_assigned_obj['pos']);$i++)\n {\n if ($l_assigned_obj['obj_id'] != $this->m_object_ids[$p_value['obj_id']])\n {\n switch ($l_assigned_obj['insertion'])\n {\n case C__RACK_INSERTION__BACK:\n $l_used_pos_back[] = $i;\n break;\n case C__RACK_INSERTION__BOTH:\n $l_used_pos_front[] = $i;\n $l_used_pos_back[] = $i;\n break;\n case C__RACK_INSERTION__FRONT:\n default:\n $l_used_pos_front[] = $i;\n break;\n }\n }\n }\n }\n }\n\n switch ($l_insertion)\n {\n case C__RACK_INSERTION__BACK:\n $l_used_pos = $l_used_pos_back;\n break;\n case C__RACK_INSERTION__BOTH:\n $l_used_pos = array_merge($l_used_pos_front, $l_used_pos_back);\n break;\n case C__RACK_INSERTION__FRONT:\n default:\n $l_used_pos = $l_used_pos_front;\n break;\n }\n\n if (count($l_used_pos) > 0)\n {\n for ($i = $p_value[C__DATA__VALUE];$i < ($p_value[C__DATA__VALUE] + $l_base);$i++)\n {\n if (in_array($i, $l_used_pos))\n {\n $l_position_already_set = true;\n break;\n }\n }\n }\n\n }\n else\n {\n $l_arr = [\n 'isys_obj__id' => $this->m_property_data['parent'][C__DATA__VALUE],\n 'rackunits' => ($p_value[C__DATA__VALUE] + $l_base)\n ];\n $l_dao_ff->create_data($l_arr);\n }\n if (!$l_position_already_set)\n {\n return $p_value[C__DATA__VALUE];\n }\n }\n }\n }\n\n return 0;\n }", "public function testCreateInventoryLocation()\n {\n }", "public function set_location($value)\n {\n $this->set_default_property(self::PROPERTY_LOCATION, $value);\n }", "public function add_product_location_field() {\n\t\t$args = array(\n\t\t\t'id' => '_product_location',\n\t\t\t'label' => __( 'Product Location', 'wc-product-location' ),\n\t\t\t'class' => 'select short',\n\t\t\t'desc_tip' => true,\n\t\t\t'description' => __( 'Select the Location where this product is available', 'wc-product-location' ),\n\t\t\t// 'options' => array(\n\t\t\t// \t'FL' => __( 'Florida', 'wc-product-location' ),\n\t\t\t// \t'LA' => __( 'Louisiana', 'wc-product-location' ),\n\t\t\t// ),\n\t\t\t// 'options' => WC()->countries->get_countries(),\n\t\t\t'options' => WC()->countries->get_states( 'US' ),\n\t\t);\n\n\t\twoocommerce_wp_select( $args );\n\t}", "public function setLocation($location){\n\t\t$this->location = $location;\n\t}", "public function setLocation($location){\n\t\t$this->location = $location;\n\t}", "public function setLocation($args) {}", "public function setLocations($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->locations = $arr;\n\n return $this;\n }", "function __construct()\r\n\t\t{\r\n\t\t$MiniComponents =jomres_getSingleton('mcHandler');\r\n\t\tif ($MiniComponents->template_touch)\r\n\t\t\t{\r\n\t\t\t$this->template_touchable=true; return;\r\n\t\t\t}\r\n\t\t$ePointFilePath = get_showtime('ePointFilepath');\r\n\t\t\r\n\t\t$country = jomresGetParam( $_POST, 'location_country','' );\r\n\t\t$region = jomresGetParam( $_POST, 'location_region','' );\r\n\t\t$town = jomresGetParam( $_POST, 'location_town','' );\r\n\t\t$location_information = jomresGetParam( $_POST, 'location_information','' );\r\n\t\t\r\n\t\tif (trim($location_information) == '') {\r\n\t\t\t$query = \"DELETE FROM #__jomres_location_data WHERE `country` = '\".$country.\"' AND `region` = '\".$region.\"' AND `town` = '\".$town.\"'\";\r\n\t\t\t$result = doInsertSql($query);\r\n\t\t} else {\r\n\t\t\t$query = \"SELECT location_information FROM #__jomres_location_data WHERE `country` = '\".$country.\"' AND `region` = '\".$region.\"' AND `town` = '\".$town.\"'\";\r\n\t\t\t$result = doSelectSql($query);\r\n\t\t\tif (empty($result))\r\n\t\t\t\t$query = \"INSERT INTO #__jomres_location_data (`country`,`region`,`town`,`location_information`) VALUES ('\".$country.\"','\".$region.\"','\".$town.\"','\".$location_information.\"')\";\r\n\t\t\telse\r\n\t\t\t\t$query = \"UPDATE #__jomres_location_data SET `location_information` = '\".$location_information.\"' WHERE `country` = '\".$country.\"' AND `region` = '\".$region.\"' AND `town` = '\".$town.\"'\";\r\n\r\n\t\t\t$result = doInsertSql($query);\r\n\t\t}\r\n\t\t\r\n\t\tjomresRedirect( jomresURL(JOMRES_SITEPAGE_URL_ADMIN.\"&task=location_station\"), \"\" );\r\n\t\t}", "public function setLocation($location=null) {\n\t\tif($location == null) return;\n\t\tif(!($location instanceOf Intra_Object_Gis_Point)) {\n\t\t\t$location = Intra_Object_Gis::fromWKB($location);\n\t\t}\n\t\t$this->_set('c_location', $location);\n\t}", "public function set_location($location)\n {\n $this->location = $location;\n }", "private function cleanupLocations() {\n // delete unused locations\n $loc_nids = array_keys($this->location_mapping);\n node_delete_multiple($loc_nids);\n\n // rename HBS Rapperswil -> HBSKMZ Rapperswil\n $node = node_load(6687);\n $node->title = 'HBSKMZ Rapperswil';\n node_save($node);\n }", "public function createFromLocationV2Event(Request $request)\n {\n $req = $request->all();\n $eventParams = $req['event']['ereignis'];\n $locParams = $req['event']['unternehmen'];\n $result = $req['result'] && $req['result'] !== 0 ? $req['result'] : null;\n\n $newLoc = new Location([\n 'company_register_id' => $locParams['id'],\n 'company_register_event_id' => $eventParams['id'],\n 'result' => $result,\n 'title' => $locParams['name'],\n 'street' => $locParams['strasse'],\n 'zip' => $locParams['plz'],\n 'country' => $locParams['land'] ? $locParams['land'] : 'Deutschland',\n 'phoneNumber' => $locParams['telefon'],\n 'email' => $locParams['email'],\n 'homepage' => $locParams['domain'],\n 'city' => $locParams['ort'],\n 'werbeaktion' => $locParams['werbeaktion'],\n 'canLogin' => 0, // to avoid default true\n 'said_whatsapp' => 0 // to avoid null values\n ]);\n\n if ($newLoc->saveOrFail()) {\n $createdLoc = Location::where('id', $newLoc->id)->first();\n return response()->json($createdLoc, 201);\n }\n }", "public function setLocationAttribute(array|string $location): void\n {\n if (is_array($location)) {\n $this->attributes['lat'] = $location['lat'];\n $this->attributes['lng'] = $location['lng'];\n }\n }", "public static function initLocation($str_location_id) {\n self::$str_location_id = $str_location_id;\n }", "public function core_geoFields_getDefaultLocations($vars)\n {\n //These are the 2 vars that are passed in, to allow only adding, or not\n //adding locations based on whether at the category or group specific fields or not.\n $categoryId = $vars['categoryId'];\n $groupId = $vars['groupId'];\n\n //expected to return using following format:\n $return = array (\n 'index' => 'Example Pages',\n //you can add as many locations as you want.\n );\n //That just added a new location, labeled Example Pages in the fields to use admin\n return $return;\n\n //Below is a snippet of code that might be used to get and use this location we just added\n\n $fields = geoFields::getInstance($groupId, $categoryId);//group ID for current user logged in..\n\n $displayIndexIn = $fields->getDisplayLocationFields('index', 'example');\n\n if ($displayIndexIn['title']) {\n //display the title in this location\n //...\n }\n if ($displayIndexIn['description']) {\n //display description in this location\n //...\n }\n if ($displayIndexIn['addon_example_widget']) {\n //display addon example widget field in this location\n //...\n }\n }" ]
[ "0.51610804", "0.5050842", "0.49136466", "0.48900807", "0.48552626", "0.48461598", "0.48077276", "0.48045745", "0.47623032", "0.46850672", "0.46731347", "0.46509725", "0.46502036", "0.46275055", "0.46161422", "0.46061805", "0.4603809", "0.46024555", "0.45784056", "0.45784056", "0.45579872", "0.4544566", "0.45228052", "0.45122942", "0.45096183", "0.45021972", "0.44966418", "0.44947892", "0.44921774", "0.4491735" ]
0.6524962
0
Set Vevent/Vtodo subComponent Vresource names as Resource, skip if set Vresource UID set as Resurce Xparam xparticipantid Other Vresource name parameters are set if ot exist. Vresource RESOURCE_TYPE set as Location Xparam xresourcetype
public function vresourceNames2Resources() : self { foreach( array_keys( $this->components ) as $cix ) { if( in_array( $this->components[$cix]->getCompType(), [ self::VEVENT, self::VTODO ] , true )) { $this->components[$cix]->vresourceNames2Resources(); } } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_components($resName, $resSpec)\n{\n global $_schemas;\n\n $labelResObj = \"{$resName}ResourceObject\";\n $labelResIdfObj = \"{$resName}ResourceIdentifierObject\";\n $labelNewResObj = \"{$resName}NewResourceObject\";\n\n if(!isset($components[$labelResObj])) {\n\n // create resourceIndicatorObject component\n if(isset($resSpec[\"relations\"]) && count($resSpec[\"relations\"]))\n $_schemas[$labelResIdfObj] = [\n \"type\"=>\"object\",\n \"properties\"=>[\n \"id\"=>[\n \"type\"=>\"string\"\n ],\n \"type\"=>[\n \"type\"=>\"string\",\n \"enum\"=>[$resName]\n ]\n ],\n \"required\"=>[\"id\",\"type\"]\n ];\n\n // extract attributes\n $attrs = [];\n $reqAttrs = [];\n foreach ($resSpec[\"fields\"] as $fldName=>$fldSpec) {\n if(!isset($fldSpec[\"type\"])) {\n// echo $resName;\n// print_r($resSpec);\n// die();\n continue;\n }\n $attrs[$fldName] = typeMap($fldSpec[\"type\"]);\n if($fldSpec[\"required\"])\n $reqAttrs[] = $fldName;\n }\n\n // extract relationships\n $rels = [];\n if(isset($resSpec[\"relations\"])) {\n foreach ($resSpec[\"relations\"] as $relName=>$relSpec) {\n // defaults to outbound relation\n\n\n if($relSpec[\"type\"]==\"inbound\")\n $rel = [\n \"type\"=>\"array\",\n \"items\"=>[\n \"\\$ref\"=>\"#/components/schemas/\".$relSpec[\"table\"].\"ResourceIdentifierObject\"\n ],\n \"required\"=>[\"id\",\"type\"]\n ];\n else\n $rel = [\n \"\\$ref\"=>\"#/components/schemas/\".$relSpec[\"table\"].\"ResourceIdentifierObject\"\n ];\n\n\n $rels[$relName] = $rel;\n }\n }\n\n\n // create basic resourceObject\n $resObj = [\n \"type\" => \"object\",\n \"properties\"=>[\n \"id\"=>[\n \"type\"=>\"string\"\n ],\n \"type\"=>[\n \"type\"=>\"string\",\n \"enum\"=>[$resName]\n ],\n \"links\"=>[\n \"type\"=>\"object\"\n ]\n ],\n \"required\"=>[\"id\",\"type\"]\n ];\n\n // add relationships of resourceObject\n if(count($rels)) {\n $resObj[\"properties\"][\"relationships\"] = [\n \"type\"=>\"object\",\n \"properties\"=>$rels\n ];\n }\n\n // set attributes of resourceObject\n if(count($attrs)) {\n $resObj[\"properties\"][\"attributes\"] = [\n \"type\" => \"object\",\n \"properties\" => $attrs\n ];\n }\n\n // duplicate resourceObject to newResourceObject\n $newResObj = $resObj;\n\n if(count($reqAttrs))\n $newResObj[\"properties\"][\"attributes\"][\"required\"] = $reqAttrs;\n\n $newResObj[\"required\"] = [\"type\",\"attributes\"];\n\n $_schemas[$labelNewResObj] = $newResObj;\n $_schemas[$labelResObj] = $resObj;\n }\n}", "public function set_resources(){\n $resource['res_master_student'] = $this->lang->line('ui_master_student');\n $resource['res_data'] = $this->lang->line('ui_data');\n $resource['res_add'] = $this->lang->line('ui_add');\n $resource['res_name'] =$this->lang->line('ui_name');\n $resource['res_description'] = $this->lang->line('ui_description');\n $resource['res_edit'] = $this->lang->line('ui_edit');\n $resource['res_delete'] =$this->lang->line('ui_delete');\n $resource['res_search'] = $this->lang->line('ui_search');\n $resource['res_save'] = $this->lang->line('ui_save');\n $resource['res_add_data'] = $this->lang->line('ui_add_data');\n $resource['res_edit_data'] = $this->lang->line('ui_edit_data');\n $resource['res_role'] = $this->lang->line('ui_role');\n $resource['res_read'] = $this->lang->line('ui_read');\n $resource['res_write'] = $this->lang->line('ui_write');\n $resource['res_print'] = $this->lang->line('ui_print');\n $resource['res_module'] = $this->lang->line('ui_module');\n $resource['res_nis'] = $this->lang->line('ui_nis');\n $resource['res_dateofbirth'] = $this->lang->line('ui_dateofbirth');\n $resource['res_placeofbirth'] = $this->lang->line('ui_placeofbirth');\n $resource['res_address'] = $this->lang->line('ui_address');\n $resource['res_mothername'] = $this->lang->line('ui_mothername');\n $resource['res_fathername'] = $this->lang->line('ui_fathername');\n $resource['res_yearofstudy'] = $this->lang->line('ui_yearofstudy');\n\n $resource['res_err_nis_exist'] = $this->lang->line('err_msg_nis_exist');\n $resource['res_msg_nis_can_not_null'] = $this->lang->line('err_msg_nis_can_not_null');\n $resource['res_msg_name_can_not_null'] = $this->lang->line('err_msg_name_can_not_null');\n return $resource;\n }", "public function setResourceId($resource_id);", "public function setResourceID($resource_id) {\n $this->resource_id = $resource_id;\n }", "public function __construct()\n {\n $this->resourceId = self::__name;\n }", "public function setResourceName($name);", "public function setResource($resource);", "public function setResource($resource);", "public function addRessource($sender,$param){\r\n $rIndecies = $this->ttidtm_ressource->SelectedIndices;\r\n foreach($rIndecies as $index)\r\n {\r\n $myRecord = new AufgabeRessourceRecord();\r\n $myRecord->idtm_aufgabe = $this->Tedidtm_aufgaben->Text;\r\n $myRecord->idtm_ressource = $this->ttidtm_ressource->Items[$index]->Value;\r\n $myRecord->auf_res_dauer = $this->ttauf_res_dauer->Text;\r\n $myRecord->save();\r\n }\r\n $this->bindListRessource();\r\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"DspaId\",$param) and $param[\"DspaId\"] !== null) {\n $this->DspaId = $param[\"DspaId\"];\n }\n\n if (array_key_exists(\"MetaType\",$param) and $param[\"MetaType\"] !== null) {\n $this->MetaType = $param[\"MetaType\"];\n }\n\n if (array_key_exists(\"ResourceRegion\",$param) and $param[\"ResourceRegion\"] !== null) {\n $this->ResourceRegion = $param[\"ResourceRegion\"];\n }\n\n if (array_key_exists(\"ResourceId\",$param) and $param[\"ResourceId\"] !== null) {\n $this->ResourceId = $param[\"ResourceId\"];\n }\n\n if (array_key_exists(\"ResourceVip\",$param) and $param[\"ResourceVip\"] !== null) {\n $this->ResourceVip = $param[\"ResourceVip\"];\n }\n\n if (array_key_exists(\"ResourceVPort\",$param) and $param[\"ResourceVPort\"] !== null) {\n $this->ResourceVPort = $param[\"ResourceVPort\"];\n }\n\n if (array_key_exists(\"ResourceUniqueVpcId\",$param) and $param[\"ResourceUniqueVpcId\"] !== null) {\n $this->ResourceUniqueVpcId = $param[\"ResourceUniqueVpcId\"];\n }\n\n if (array_key_exists(\"ResourceUniqueSubnetId\",$param) and $param[\"ResourceUniqueSubnetId\"] !== null) {\n $this->ResourceUniqueSubnetId = $param[\"ResourceUniqueSubnetId\"];\n }\n\n if (array_key_exists(\"ResourceAccessType\",$param) and $param[\"ResourceAccessType\"] !== null) {\n $this->ResourceAccessType = $param[\"ResourceAccessType\"];\n }\n\n if (array_key_exists(\"UserName\",$param) and $param[\"UserName\"] !== null) {\n $this->UserName = $param[\"UserName\"];\n }\n\n if (array_key_exists(\"Password\",$param) and $param[\"Password\"] !== null) {\n $this->Password = $param[\"Password\"];\n }\n\n if (array_key_exists(\"ResourceName\",$param) and $param[\"ResourceName\"] !== null) {\n $this->ResourceName = $param[\"ResourceName\"];\n }\n }", "function set_resource($name)\n\t{\n\t\t$this->resource = $name;\n\t}", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"ResourceNames\",$param) and $param[\"ResourceNames\"] !== null) {\n $this->ResourceNames = $param[\"ResourceNames\"];\n }\n }", "public function &setResource( $name = null )\r\n\t{\r\n\t\tglobal $MySmartBB;\r\n\t\t\r\n\t\tif ( isset( $name ) )\r\n\t\t{\r\n\t\t\t$MySmartBB->_CONF[ 'template' ][ 'res' ][ $name ] = '';\r\n\t\t\r\n\t\t\t$MySmartBB->rec->result = &$MySmartBB->_CONF[ 'template' ][ 'res' ][ $name ];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$resource = '';\r\n\r\n\t\t\t$MySmartBB->rec->result = &$resource;\r\n\t\t\r\n\t\t\treturn $resource;\r\n\t\t}\r\n\t}", "protected function _initResource(){\r\n\t\t$this->_resource\t=\tMage::getSingleton('core/resource');\r\n\t}", "public function removeRessource($sender,$param) {\r\n //#todo, hier muss noch eine Pruefung hin, ob der mitarbeiter bereits inkludiert ist\r\n $deleteRecord = TerminRessourceRecord::finder();\r\n $deleteRecord->deleteByPk($param->Item->lstpart_idtm_termin_ressource->Text);\r\n $this->RessourcebindList();\r\n }", "private static function initAPIResources(){\n\t\t\n\t}", "public function beforeSet()\n {\n if($this->getProperty('resource_id')){\n\n $validate = array(\n 'name',\n //'domain_id',\n 'key',\n 'value'\n );\n\n foreach ($validate as $val){\n if(empty($this->getProperty($val))){\n $this->modx->error->addField($val, $this->modx->lexicon('changedomain_item_err_key'));\n }elseif($this->modx->getCount($this->classKey, array(\n 'name' => $this->getProperty('name'),\n 'resource_id' => $this->getProperty('resource_id'),\n 'domain_id' => $this->getProperty('domain_id')))){\n $this->modx->error->addField('name', $this->modx->lexicon('changedomain_item_err_ae'));\n }\n }\n }elseif($this->getProperty('domain_id') && !$this->getProperty('resource_id')){\n $name = trim($this->getProperty('name'));\n if (empty($name)) {\n $this->modx->error->addField('name', $this->modx->lexicon('changedomain_item_err_name'));\n } elseif ($this->modx->getCount($this->classKey, array('name' => $name, 'domain_id' => $this->getProperty('domain_id')))) {\n $this->modx->error->addField('name', $this->modx->lexicon('changedomain_item_err_ae'));\n }\n }\n return parent::beforeSet();\n }", "protected function _loadResource()\n {\n if ((!isset($this->_request->r)) && (!$this->_owApp->selectedResource)) {\n OntoWiki::getInstance()->selectedResource = new OntoWiki_Resource($this->_modelUri, $this->_model);\n }\n $this->_resource = $this->_owApp->selectedResource;\n $this->_resourceUri = (string) $this->_owApp->selectedResource;\n }", "public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"InstanceId\",$param) and $param[\"InstanceId\"] !== null) {\n $this->InstanceId = $param[\"InstanceId\"];\n }\n\n if (array_key_exists(\"UsedResource\",$param) and $param[\"UsedResource\"] !== null) {\n $this->UsedResource = new ResourceInfo();\n $this->UsedResource->deserialize($param[\"UsedResource\"]);\n }\n\n if (array_key_exists(\"TotalResource\",$param) and $param[\"TotalResource\"] !== null) {\n $this->TotalResource = new ResourceInfo();\n $this->TotalResource->deserialize($param[\"TotalResource\"]);\n }\n\n if (array_key_exists(\"InstanceStatus\",$param) and $param[\"InstanceStatus\"] !== null) {\n $this->InstanceStatus = $param[\"InstanceStatus\"];\n }\n\n if (array_key_exists(\"SubUin\",$param) and $param[\"SubUin\"] !== null) {\n $this->SubUin = $param[\"SubUin\"];\n }\n\n if (array_key_exists(\"CreateTime\",$param) and $param[\"CreateTime\"] !== null) {\n $this->CreateTime = $param[\"CreateTime\"];\n }\n\n if (array_key_exists(\"ExpireTime\",$param) and $param[\"ExpireTime\"] !== null) {\n $this->ExpireTime = $param[\"ExpireTime\"];\n }\n\n if (array_key_exists(\"AutoRenewFlag\",$param) and $param[\"AutoRenewFlag\"] !== null) {\n $this->AutoRenewFlag = $param[\"AutoRenewFlag\"];\n }\n\n if (array_key_exists(\"SpecId\",$param) and $param[\"SpecId\"] !== null) {\n $this->SpecId = $param[\"SpecId\"];\n }\n\n if (array_key_exists(\"SpecAlias\",$param) and $param[\"SpecAlias\"] !== null) {\n $this->SpecAlias = $param[\"SpecAlias\"];\n }\n }", "protected function setSuperResources()\n {\n $resources = array();\n\n $fields = get_class_vars($this->classname);\n foreach($fields as $field => $value) {\n $id = $this->obj->{$field};\n $last_underscore = strrpos($field, '_') + 1;\n $suffix = ($last_underscore !== false) ? substr($field, $last_underscore) : $field;\n unset($fields[$field]);\n $fields[w2p_pluralize($suffix)] = $id;\n }\n//TODO: figure out what to do with _parents\n $modules = $this->resources;\n foreach($fields as $field => $value) {\n if(isset($modules[$field]) && $value) {\n $resources[$field] = array('name' => $modules[$field], 'href' => \"/$field/\".$value);\n }\n }\n\n return $resources;\n }", "private function createResources()\n {\n // If there is routeIdentifierName, it is REST service and we need to\n // handle both collection and entities\n if ($this->service->getRouteIdentifierName()) {\n $this->resources[] = new Resource(\n $this->service,\n $this->service->getOperations(),\n $this->getCollectionUri(),\n Resource::RESOURCE_TYPE_COLLECTION\n );\n $this->resources[] = new Resource(\n $this->service,\n $this->service->getEntityOperations(),\n $this->getEntityUri(),\n Resource::RESOURCE_TYPE_ENTITY\n );\n return;\n }\n\n $this->resources[] = new Resource(\n $this->service,\n $this->service->getOperations(),\n $this->getEntityUri(),\n Resource::RESOURCE_TYPE_RPC\n );\n }", "public function setResourceId($resourceId) {\n $this->resourceId = $resourceId;\n }", "public function setResourceId($resourceId) {\n $this->resourceId = $resourceId;\n }", "protected function initialize() {\n\t\t$this->resource = \"videos\";\n\t}", "public function tagResourcesWithOptions($request, $runtime)\n {\n Utils::validateModel($request);\n $query = [];\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->regionId)) {\n $query['RegionId'] = $request->regionId;\n }\n if (!Utils::isUnset($request->resourceId)) {\n $query['ResourceId'] = $request->resourceId;\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->resourceType)) {\n $query['ResourceType'] = $request->resourceType;\n }\n if (!Utils::isUnset($request->tag)) {\n $query['Tag'] = $request->tag;\n }\n $req = new OpenApiRequest([\n 'query' => OpenApiUtilClient::query($query),\n ]);\n $params = new Params([\n 'action' => 'TagResources',\n 'version' => '2016-04-28',\n 'protocol' => 'HTTPS',\n 'pathname' => '/',\n 'method' => 'POST',\n 'authType' => 'AK',\n 'style' => 'RPC',\n 'reqBodyType' => 'formData',\n 'bodyType' => 'json',\n ]);\n\n return TagResourcesResponse::fromMap($this->callApi($params, $req, $runtime));\n }", "public function setResourceType($resourceType);", "public function setId($resourceId);", "public function setResourceName($var)\n {\n GPBUtil::checkString($var, True);\n $this->writeOneof(2, $var);\n\n return $this;\n }", "function assignObjectPid(string $resourceId, TaskParam $param);", "public function &reset_resource() {\n\t\treturn parent::reset_resource ()->addResource ( 'persons' );\n\t}" ]
[ "0.53607607", "0.5232735", "0.5187226", "0.48846504", "0.48321816", "0.47992176", "0.47711998", "0.47711998", "0.47659266", "0.476028", "0.4744277", "0.47282815", "0.47205997", "0.47060233", "0.46708977", "0.46567485", "0.4654205", "0.46530798", "0.46414715", "0.4636265", "0.45918706", "0.458021", "0.458021", "0.45135015", "0.45036626", "0.44969732", "0.4480506", "0.4475254", "0.44703218", "0.44682735" ]
0.56372255
0
Return formatted output for calendar object instance
public function createCalendar() : string { return Formatter::format( $this ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function printCalendar() {\n return $this->calendar;\n }", "public function __toString()\r\n {\r\n return \"$this->day $this->month $this->year\";\r\n }", "public function __toString()\n {\n return $this->formatter->format($this->date);\n }", "public function output()\r\n\t{\r\n\t\t//Putting together the table\r\n\t\t$output = '<table summary=\"Calender Table\">';\r\n\t\t$output .= \\generateTableHead(['Mon', 'Tues', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']);\r\n\t\t//Defining the start day of the calendar\r\n\t\t$offset = ($this->getWeekday($this->firstOfMonth) * Calendar::$oneDayInSec) % (7 * Calendar::$oneDayInSec);\r\n\t\t$startday = $this->firstOfMonth - $offset;\r\n\t\t//Peparing for loop!\r\n\t\t$moreRows = true;\r\n\t\tfor ($rowNum = 0; $moreRows && $rowNum < 100; $rowNum++) {\r\n\t\t\t$output .= $this->outputRow($startday, $rowNum, $moreRows);\r\n\t\t}\r\n\t\t$output .= '</table>';\r\n\t\treturn $output;\r\n\t}", "public function __toString()\r\n\t{\r\n\t\treturn parent::format(static::$format);\r\n\t}", "protected function writeEvent()\n\t{\n\t\t$entry = new ilCalendarEntry();\n\t\t\n\t\t// Search for summary\n\t\tforeach($this->getContainer()->getItemsByName('SUMMARY',false) as $item)\n\t\t{\n\t\t\tif(is_a($item,'ilICalProperty'))\n\t\t\t{\n\t\t\t\t$entry->setTitle($this->purgeString($item->getValue()));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Search description\n\t\tforeach($this->getContainer()->getItemsByName('DESCRIPTION',false) as $item)\n\t\t{\n\t\t\tif(is_a($item,'ilICalProperty'))\n\t\t\t{\n\t\t\t\t$entry->setDescription($this->purgeString($item->getValue()));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Search location\n\t\tforeach($this->getContainer()->getItemsByName('LOCATION',false) as $item)\n\t\t{\n\t\t\tif(is_a($item,'ilICalProperty'))\n\t\t\t{\n\t\t\t\t$entry->setLocation($this->purgeString($item->getValue()));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach($this->getContainer()->getItemsByName('DTSTART') as $start)\n\t\t{\n\t\t\t$fullday = false;\n\t\t\tforeach($start->getItemsByName('VALUE') as $type)\n\t\t\t{\n\t\t\t\tif($type->getValue() == 'DATE')\n\t\t\t\t{\n\t\t\t\t\t$fullday = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$start_tz = $this->default_timezone;\n\t\t\tforeach($start->getItemsByName('TZID') as $param)\n\t\t\t{\n\t\t\t\t$start_tz = $this->getTZ($param->getValue());\n\t\t\t}\n\t\t\tif($fullday)\n\t\t\t{\n\t\t\t\t$start = new ilDate($start->getValue(),\n\t\t\t\t\tIL_CAL_DATE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$start = new ilDateTime($start->getValue(),\n\t\t\t\t\tIL_CAL_DATETIME,\n\t\t\t\t\t$start_tz->getIdentifier());\n\t\t\t}\n\t\t\t$entry->setStart($start);\n\t\t\t$entry->setFullday($fullday);\n\t\t}\n\t\t\n\t\tforeach($this->getContainer()->getItemsByName('DTEND') as $end)\n\t\t{\n\t\t\t$fullday = false;\n\t\t\tforeach($end->getItemsByName('VALUE') as $type)\n\t\t\t{\n\t\t\t\tif($type->getValue() == 'DATE')\n\t\t\t\t{\n\t\t\t\t\t$fullday = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$end_tz = $this->default_timezone;\n\t\t\tforeach($end->getItemsByName('TZID') as $param)\n\t\t\t{\n\t\t\t\t$end_tz = $this->getTZ($param->getValue());\n\t\t\t}\n\t\t\tif($fullday)\n\t\t\t{\n\t\t\t\t$end = new ilDate($end->getValue(),\n\t\t\t\t\tIL_CAL_DATE);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$end = new ilDateTime($end->getValue(),\n\t\t\t\t\tIL_CAL_DATETIME,\n\t\t\t\t\t$end_tz->getIdentifier());\n\t\t\t}\n\t\t\t$entry->setEnd($end);\n\t\t\t$entry->setFullday($fullday);\n\t\t}\n\t\t// save calendar event\n\t\t$entry->save();\n\t\t\n\t\tinclude_once('./Services/Calendar/classes/class.ilCalendarCategoryAssignments.php');\n\t\t$ass = new ilCalendarCategoryAssignments($entry->getEntryId());\n\t\t$ass->addAssignment($this->category->getCategoryID());\n\t\t\n\t\t\n\t\t// Recurrences\n\t\tforeach($this->getContainer()->getItemsByName('RRULE') as $recurrence)\n\t\t{\n\t\t\t#var_dump(\"<pre>\",$recurrence,\"</pre>\");\n\t\t\t\n\t\t\t\n\t\t\tinclude_once('./Services/Calendar/classes/class.ilCalendarRecurrence.php');\n\t\t\t$rec = new ilCalendarRecurrence();\n\t\t\t$rec->setEntryId($entry->getEntryId());\n\t\t\t\n\t\t\tforeach($recurrence->getItemsByName('FREQ') as $freq)\n\t\t\t{\n\t\t\t\tswitch($freq->getValue())\n\t\t\t\t{\n\t\t\t\t\tcase 'DAILY':\n\t\t\t\t\tcase 'WEEKLY':\n\t\t\t\t\tcase 'MONTHLY':\n\t\t\t\t\tcase 'YEARLY':\n\t\t\t\t\t\t$rec->setFrequenceType($freq->getValue());\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$this->log->write(__METHOD__.': Cannot handle recurring event of type: '.$freq->getValue());\n\t\t\t\t\t\tbreak 3;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tforeach($recurrence->getItemsByName('COUNT') as $value)\n\t\t\t{\n\t\t\t\t$rec->setFrequenceUntilCount($value->getValue());\n\t\t\t\tbreak;\t\t\t\t\t\t\n\t\t\t}\n\t\t\tforeach($recurrence->getItemsByName('UNTIL') as $until)\n\t\t\t{\n\t\t\t\t$rec->setFrequenceUntilDate(new ilDate($until->getValue(),IL_CAL_DATE));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tforeach($recurrence->getItemsByName('INTERVAL') as $value)\n\t\t\t{\n\t\t\t\t$rec->setInterval($value->getValue());\n\t\t\t\tbreak;\t\t\t\t\t\t\n\t\t\t}\n\t\t\tforeach($recurrence->getItemsByName('BYDAY') as $value)\n\t\t\t{\n\t\t\t\t$rec->setBYDAY($value->getValue());\n\t\t\t\tbreak;\t\t\t\t\t\t\n\t\t\t}\n\t\t\tforeach($recurrence->getItemsByName('BYWEEKNO') as $value)\n\t\t\t{\n\t\t\t\t$rec->setBYWEEKNO($value->getValue());\n\t\t\t\tbreak;\t\t\t\t\t\t\n\t\t\t}\n\t\t\tforeach($recurrence->getItemsByName('BYMONTH') as $value)\n\t\t\t{\n\t\t\t\t$rec->setBYMONTH($value->getValue());\n\t\t\t\tbreak;\t\t\t\t\t\t\n\t\t\t}\n\t\t\tforeach($recurrence->getItemsByName('BYMONTHDAY') as $value)\n\t\t\t{\n\t\t\t\t$rec->setBYMONTHDAY($value->getValue());\n\t\t\t\tbreak;\t\t\t\t\t\t\n\t\t\t}\n\t\t\tforeach($recurrence->getItemsByName('BYYEARDAY') as $value)\n\t\t\t{\n\t\t\t\t$rec->setBYYEARDAY($value->getValue());\n\t\t\t\tbreak;\t\t\t\t\t\t\n\t\t\t}\n\t\t\tforeach($recurrence->getItemsByName('BYSETPOS') as $value)\n\t\t\t{\n\t\t\t\t$rec->setBYSETPOS($value->getValue());\n\t\t\t\tbreak;\t\t\t\t\t\t\n\t\t\t}\n\t\t\tforeach($recurrence->getItemsByName('WKST') as $value)\n\t\t\t{\n\t\t\t\t$rec->setWeekstart($value->getValue());\n\t\t\t\tbreak;\t\t\t\t\t\t\n\t\t\t}\n\t\t\t$rec->save();\n\t\t}\n\t}", "public abstract function format();", "public function __toString()\n {\n return $this->format(self::$_defaultFormat);\n }", "public function getCalendarDescription ()\n {\n\n return $this->calendar_description;\n }", "public function __toString(): string\n {\n return\n \"BEGIN:VEVENT\" . PHP_EOL .\n $this->dateLimit(\"START\", $this->start) . PHP_EOL .\n $this->dateLimit(\"END\", $this->end) . PHP_EOL .\n \"SUMMARY:\" . Formatter::text($this->title) . PHP_EOL .\n \"LOCATION:\" . Formatter::text($this->location) . PHP_EOL .\n \"DESCRIPTION:\" . Formatter::text($this->description) . PHP_EOL .\n \"END:VEVENT\" . PHP_EOL;\n }", "public function render() {\n\t\tif (count($this->events) == 0) {\n\t\t\treturn '';\n\t\t}\n\t\tif (!isset($this->opts['conflicts'])) {\n\t\t\t$this->opts['conflicts'] = false;\n\t\t}\n\t\t$this->cleanEventList();\n\t\t$this->getTimeIntervals();\n\t\t$this->getSimultaneous();\n\t\t$this->getMaxSimultaneous();\n\t\t$s = '';\n\t\tif ($this->summary) {\n\t\t\t$s = 'summary=\"'.htmlspecialchars($this->summary).'\" ';\n\t\t}\n\t\t$out = '<table '.$s.'cellspacing=\"0\" class=\"px-calendar\">'.\"\\n\";\n\t\t$out .= $this->getHead();\n\t\t$out .= $this->getBody();\n\t\t$out .= '</table>'.\"\\n\";\n\t\treturn Gatuf_Template_SafeString::markSafe($out);\n\t}", "protected function _format(){\n\n\t\t\t// define classes\n\t\t\t$class = ''; \n\t\t\tif($this->_useClasses && ( $this->_highlighted || $this->_multiple\t)){\n\t\t\t\t$class .= $this->_highlighted?\" \".$this->_params['classHighlight']:NULL;\n\t\t\t\t$class .= $this->_multiple?\" \".$this->_params['classMultiple']:NULL;\n\t\t\t} else {\n\t\t\t\t$class = $this->_params['classDefault']; \n\t\t\t}\n\t\t\t\n\t\t\t// reset the values of the title\n\t\t\t$this->_formatted = NULL;\n\t\t\t\n\t\t\t// defines beginning of stamp\n\t\t\t$this->_formatted .= \"<span class='$class'>\".$this->_title.\"</span>\";\n\t\t\t\n\t\t}", "public function __toString()\n {\n return $this->toString($this->defaultFormat);\n }", "public function __toString()\n {\n return $this->formatAsString();\n }", "public function __toString() {\n\t\treturn get_class($this) . '[' . $this->_date->toString('d.M.y') . '] (' . $this->_countAdded . '/' . $this->_countFound . ')';\n\t}", "public function toFormattedDateString();", "public function __toString()\n {\n return $this->formattedString();\n }", "public function render()\n {\n $date = $this->arguments['date'];\n $format = $this->arguments['format'];\n $language = $this->arguments['language'];\n $respectlocale = $this->arguments['respectlocale'];\n $length = $this->arguments['length'];\n $tz = $this->arguments['tz'];\n if (is_object($date)) {\n $dateTime = $date;\n } elseif (is_numeric($date)) {\n $dateTime = new \\DateTime();\n $dateTime->setTimestamp($date);\n } else {\n $dateTime = new \\DateTime($date);\n }\n $dateTime->setTimezone(new \\DateTimeZone($tz));\n if ($format == 'SOLR' || $format == 'XML') {\n $dateTime->setTimezone(new \\DateTimeZone('Europe/London'));\n return $dateTime->format('Y-m-d\\TH:i:s\\Z');\n }\n if (defined('\\DateTime::'.$format)) {\n $format = constant('\\DateTime::'.$format);\n return $dateTime->format($format);\n }\n if ($respectlocale && class_exists('IntlDateFormatter')) {\n return $this->handleLocale($dateTime, $format, $length, $tz);\n }\n\n $new = $dateTime->format($format);\n if ($language !== 'en') {\n $new = str_replace($this->monthMapping['en'], $this->monthMapping['de'], $new);\n $new = str_replace($this->dayMapping['en'], $this->dayMapping['de'], $new);\n }\n return $new;\n //IntlDateFormatter()\n }", "public function __toString()\n {\n return $this->format(static::$toStringFormat);\n }", "public function __toString(): string\n {\n return $this->months[$this->month - 1] . ' ' . $this->year;\n }", "function __toString( )\n\t{\n\t\t$str = '';\n\t\t// Repeated Events\n\t\tif($this->type != self::NONE)\n\t\t{\n\t\t\tlist($str) = explode(' (',lang(self::$types[$this->type]));\t// remove (by day/date) from Monthly\n\n\t\t\t$str_extra = array();\n\t\t\tswitch ($this->type)\n\t\t\t{\n\t\t\t\tcase self::MONTHLY_MDAY:\n\t\t\t\t\t$str_extra[] = ($this->monthly_bymonthday == -1 ? lang('last') : $this->monthly_bymonthday.'.').' '.lang('day');\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::WEEKLY:\n\t\t\t\tcase self::MONTHLY_WDAY:\n\t\t\t\t\t$repeat_days = array();\n\t\t\t\t\tif ($this->weekdays == self::ALLDAYS)\n\t\t\t\t\t{\n\t\t\t\t\t\t$repeat_days[] = $this->type == self::WEEKLY ? lang('all') : lang('day');\n\t\t\t\t\t}\n\t\t\t\t\telseif($this->weekdays == self::WORKDAYS)\n\t\t\t\t\t{\n\t\t\t\t\t\t$repeat_days[] = $this->type == self::WEEKLY ? lang('workdays') : lang('workday');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach (self::$days as $mask => $label)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($this->weekdays & $mask)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$repeat_days[] = lang($label);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($this->type == self::WEEKLY && count($repeat_days))\n\t\t\t\t\t{\n\t\t\t\t\t\t$str_extra[] = lang('days repeated').': '.implode(', ',$repeat_days);\n\t\t\t\t\t}\n\t\t\t\t\telseif($this->type == self::MONTHLY_WDAY)\n\t\t\t\t\t{\n\t\t\t\t\t\t$str_extra[] = ($this->monthly_byday_num == -1 ? lang('last') : $this->monthly_byday_num.'.').' '.implode(', ',$repeat_days);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\t\t\tif($this->interval > 1)\n\t\t\t{\n\t\t\t\t$str_extra[] = lang('Interval').': '.$this->interval;\n\t\t\t}\n\t\t\tif ($this->enddate)\n\t\t\t{\n\t\t\t\tif ($this->enddate->getTimezone()->getName() != egw_time::$user_timezone->getName())\n\t\t\t\t{\n\t\t\t\t\t$this->enddate->setTimezone(egw_time::$user_timezone);\n\t\t\t\t}\n\t\t\t\t$str_extra[] = lang('ends').': '.lang($this->enddate->format('l')).', '.$this->enddate->format(egw_time::$user_dateformat);\n\t\t\t}\n\t\t\tif ($this->time->getTimezone()->getName() != egw_time::$user_timezone->getName())\n\t\t\t{\n\t\t\t\t$str_extra[] = $this->time->getTimezone()->getName();\n\t\t\t}\n\t\t\tif(count($str_extra))\n\t\t\t{\n\t\t\t\t$str .= ' ('.implode(', ',$str_extra).')';\n\t\t\t}\n\t\t}\n\t\treturn $str;\n\t}", "public function __toString()\n\t{\n\t return $this->format('l, F jS, Y');\n\t}", "public function __toString()\n {\n return $this->getEdd()->format('Y-m-d');\n }", "function get_calendar( $initial = true, $echo = true ) {\n\t\t\t\n\t\t\t$calendar_output = WPEvents_Test_Functions::get_calendar( $initial, $echo );\n\t\t\t\n\t\t\tif ( $echo ) {\n\t\t\t\techo $calendar_output;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\treturn $calendar_output;\n\t\t\t\n\t\t}", "public function __toString(): string\n {\n return \"Current events list:<br />{$this->currentEventsList}<br/>Future events list:<br />{$this->futureEventsList}<br />\";\n }", "public function format(): string\n {\n return $this->formatter()->format($this);\n }", "public function __toString() {\n\t\treturn $this->aDate['string'];\n\t}", "public function __toString()\n {\n return $this->format(static::$stringFormat);\n }", "public function __toString()\n\t{\n\t\treturn $this->getDateTime();\n\t}", "public function __toString()\n {\n return ucfirst($this->months['fr'][$this->month - 1]) . ' - ' . $this->year;\n }" ]
[ "0.77121645", "0.66937685", "0.6598259", "0.65760005", "0.6464902", "0.6420171", "0.6416474", "0.63995796", "0.6345338", "0.6322068", "0.6289091", "0.62694335", "0.62343305", "0.61162007", "0.61035955", "0.60423094", "0.60339844", "0.6013934", "0.6010419", "0.5992859", "0.59512776", "0.5939624", "0.59391713", "0.591294", "0.5893868", "0.5880251", "0.58673096", "0.58369917", "0.5836815", "0.5831823" ]
0.80429435
0
/ Carga los posts con mas visitas. Aparecen en el lateral derecho
function cargarTopPosts(){ try{ $procedimiento = 'SELECT id_post, titulo,imagen_post, visitas FROM posts HAVING(visitas>2) ORDER by visitas DESC LIMIT 5'; $llamadaProc = conexion()->query($procedimiento); $llamadaProc->setFetchMode(PDO::FETCH_ASSOC); }catch(PDOException $pe){ die("Error occurred:" . $pe->getMessage()); } $llamadaProc->execute(); $result = $llamadaProc->fetchAll(); foreach($result as $p => $fila){ ?> <div class="datosDB"> <a id="postLateral" href="paginaPost.php?tipo=visita&idPost=<?php echo $fila['id_post']; ?>"> <h2><?php echo $fila['titulo'] ?> </h2> </a> <p>Visitas: <?php echo $fila['visitas']; ?> </p> </div> <?php } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getPosts() {\n $count = $this->property('postsCount');\n\n // use rand from different db drivers\n if (DB::connection()->getDriverName() == 'mysql') {\n $posts = Post::orderBy(DB::raw('RAND()'));\n } else if (DB::connection()->getDriverName() == 'sqlite') {\n $posts = Post::orderBy(DB::raw('RANDOM()'));\n } else {\n $posts = Post::orderBy('id');\n }\n $posts = $posts->isPublished()->take($count)->get();\n\n foreach ($posts as $post) {\n $post->url = $post->setUrl($this->property('postPage'), $this->controller);\n }\n\n $this->cachePosts($posts);\n\n return $posts;\n }", "public function postsParser()\r\n {\r\n $html1 = file_get_contents('https://habr.com/ru/all/');\r\n \r\n \\phpQuery::newDocument($html1);\r\n \r\n $parselinks = pq('.tm-article-snippet__title-link');\r\n $links = [];\r\n $index = 0;\r\n foreach ($parselinks as $link) {\r\n if ($index < 5) {\r\n $link = pq($link);\r\n \r\n $links[] = 'https://habr.com' . $link->attr(\"href\");\r\n $index++;\r\n } else {\r\n break;\r\n }\r\n }\r\n \r\n $data = [];\r\n foreach ($links as $value) {\r\n $html = file_get_contents($value);\r\n \r\n \\phpQuery::newDocument($html);\r\n\r\n $posts = pq('.tm-misprint-area__wrapper');\r\n\r\n foreach ($posts as $key => $post) {\r\n $post = pq($post);\r\n \r\n $data[] = '(\"' . htmlspecialchars(trim($post->find('h1')->text())) . '\",\"' . htmlspecialchars(mb_strimwidth(trim($post->find('#post-content-body')->text()), 0, 250, \"\")) . '\",\"'. htmlspecialchars(trim($post->find('#post-content-body')->html())) . '\",\"' . htmlspecialchars($value) . '\")';\r\n \r\n }\r\n }\r\n \r\n \\phpQuery::unloadDocuments();\r\n Post::set($data); \r\n }", "public function posts()\n {\n $posts = get_posts([\n 'post_type' => 'Post',\n 'posts_per_page'=> get_option( 'posts_per_page' )\n ]);\n\n return array_map(function ($post) {\n $post->excerpt = get_the_excerpt($post->ID);\n $post->thumbnail = get_the_post_thumbnail($post->ID, 'wide_s');\n $post->link = get_the_permalink($post->ID);\n $post->category = get_the_terms($post->ID, 'category')[0];\n $post->date = get_the_date(null, $post->ID);\n\n $post->author = get_userdata($post->post_author);\n $post->author_image = wp_get_attachment_image( get_field('image', 'user_' . $post->post_author), 'thumbnail');\n\n return $post;\n }, $posts);\n\n }", "function cargarPosts($posts){\n \n foreach($posts as $posicion =>$columna){\n\n //si hay un usuario logeado, almacenamos el tipo de usuario que es\n //no será de mucha utilidad\n if(isset($_SESSION[\"usuarioLogeado\"])){\n $tipoUser = $_SESSION[\"tipo\"];\n }else{\n $tipoUser = 'normal';\n }\n $propietario = $columna['nickname'];\n ?>\n <div id=\"tarjetaPost\">\n <!--<img src=\"//<//?//php echo $columna['imagen_post'] ?>\">-->\n <a href=\"paginaPost.php?tipo=visita&idPost=<?php echo $columna['id_post']; ?>\"> <h2 class=\"tituloPost\"><?php echo $columna['titulo']; ?> </h2> </a>\n <?php\n //Comprobamos que tipo de usuario se ha logeado, para habilitar o no el boton para eliminar un post\n if($tipoUser=='admin'){\n ?>\n <a href=\"index.php?tipo=borrarPost&idPost=<?php echo $columna['id_post']; ?>\" class=\"btnEliminar\"><span class=\"icon-trash\"></span></a>\n <?php\n \n }elseif($tipoUser=='normal'){\n ?>\n <style type=\"text/css\">\n .btnEliminar{display: none;} \n </style>\n <?php\n \n }elseif($tipoUser=='mod'){\n ?>\n <style type=\"text/css\">\n .btnEliminar{display: none;} \n </style>\n <?php\n }\n //Si nadie está logeado, que no se muestre el boton para eliminar \n if(!isset($_SESSION[\"usuarioLogeado\"])){\n ?>\n <style type=\"text/css\">\n .btnEliminar{display: none;} \n </style> \n <?php\n }\n ?>\n <p class=\"contenido\"><?php $resultado = substr($columna['contenido'], 0, 400).\"...\"; echo $resultado?> </p>\n <p class=\"autor\">Autor: <?php echo $columna['nickname'] ?> </p>\n <p class=\"visualizaciones\"><span class=\"icon-eye\"></span><?php echo (\" \".$columna['visitas']) ?></p>\n <span class=\"fecha\"><?php echo (\" \".$columna['fecha'] )?></span>\n </div>\n <?php\n echo (\"<script type='text/javascript' src='JSCRIPT/usuario.js'></script>\");\n }\n}", "public function getPosts()\n {\n $req = $this->queryDB('SELECT posts.id_post,posts.title, posts.short_content, posts.create_date, posts.modification_date, users.pseudo FROM posts INNER JOIN users ON user_id = id_user ORDER BY posts.modification_date DESC');\n $posts= [];\n foreach ($req as $data) {\n $postId = $data['id_post'];\n $posts[$postId] = $this->postObject($data);\n }\n return $posts;\n }", "public function readAllPosts(){\n $db = $this->dbConnect();\n $req = $db->query('SELECT id, title, content, DATE_FORMAT(creation_date, \\'%d/%m/%Y à %Hh%imin%ss\\') AS creation_date_fr FROM posts ORDER BY creation_date DESC');\n\n // creer un tableau de posts vide qui sera remplie dans la boucle, ce tableau contiendra des objets post.\n $posts=[];\n $result = $req->fetchAll();\n foreach ($result as $row) { // je parcours toutes mes lignes de ma base de données.\n // $row['id'] contient un id.\n\n $post = new Post(); // j'instancie post, je crée un objet de ma class post.\n\n $post->create($row['id'], $row['title'], $row['content'], $row['creation_date_fr']);\n\n $posts[] = $post; // je stock mon objet dans mon tableau d'objet\n }\n\n return $posts; // retourne le tableau.\n }", "public function getPosts();", "public function posts() {\n $posts = [];\n if ($this->property('cacheLifetime')) {\n $posts = Cache::get('blogarchive_random_posts');\n }\n\n if (empty($posts)) {\n $posts = $this->getPosts();\n }\n return $posts;\n }", "public function getAllPosts(){\n try{\n //Get and paginate all post saved in the database from the User object persistence\n $blogManager = new BlogManager();\n return $blogManager->getPaginatedPosts(3);\n return $posts;\n }catch(Exception $e){\n throw $e;\n }\n }", "static function get_all_posts() {\n\n // Cache the cache call!\n $cache = Cache::init();\n\n $posts = $cache->get('posts');\n\n if( is_null($posts) ) {\n $posts = array_merge(Post::get_static_posts(), Post::get_db_posts());\n\n $cache->set('posts', $posts, 300);\n }\n\n else if( $posts !== array_merge(Post::get_static_posts(), Post::get_db_posts()) ) {\n $posts = array_merge(Post::get_static_posts(), Post::get_db_posts());\n \n $cache->set('posts', $posts, 300);\n }\n\n if( !empty( $posts ) ) {\n\n $dates = array();\n\n // $dates will be used later on to sort posts by ascending or descending order\n foreach( $posts as $post ) {\n $dates[] = $post['date'];\n }\n\n $sort = ( strtoupper( BlogPad::get_setting('post_sort_type', 'DESC') ) === 'DESC' ) ? SORT_DESC: SORT_ASC; \n\n // Sort by date now.\n array_multisort($dates, $sort, $posts);\n\n return ( !empty($posts) ) ? $posts: null;\n }\n\n else {\n return null;\n }\n }", "public static function getAllPosts(){\n $bdd = new DatabaseConnector('root','root.mysql.db', 'root','password');\n\n // Preparation de la requete\n $req = $bdd->getDb()->prepare(\"\n\t\t\tSELECT posts.id as idPost, posts.title, posts.content, posts.writer, posts.image, posts.date_post, posts.posted,\n\t\t\t\t admins.id as idAdmin, admins.name, admins.email, admins.password, admins.code_user, admins.role\n\t\t\tFROM posts\n\t\t\tJOIN admins\n\t\t\tON posts.writer = admins.email\n\t\t\tORDER BY date_post DESC\n\t\t\");\n\n // Execution de la requête\n $req->execute();\n $databaseReuslt = $req->fetchAll(PDO::FETCH_ASSOC);\n\n // Préparation du résultat\n $finalResult = [];\n foreach ($databaseReuslt as $val){\n $adminTemp = new Admins($val['idAdmin'], $val['name'], $val['email'], $val['password'], $val['code_user'], $val['role']);\n $postTemp = new Posts($val['idPost'], $val['title'], $val['content'],$adminTemp, $val['image'], $val['date_post'], $val['posted']);\n $finalResult[] = $postTemp;\n }\n return $finalResult;\n }", "function getPosts(){\n }", "function obtenerPosts($conexion){\n $sentencia = $conexion->prepare(\"\n SELECT * \n FROM posts as p\n INNER JOIN users as u\n ON user_id = u.id \n ORDER BY p.created_date DESC\n ;\");\n $sentencia->execute();\n return $sentencia->fetchAll();\n}", "public function getPosts(){\n\t\t\t$json = file_get_contents($this->assetpath . 'json/feed.json');\n\n\t\t\t// Get the initial array\n\t\t\t$json_arr = json_decode($json, true);\n\n\t\t\t// Cut out the excess information\n\t\t\t$this->post_array = $json_arr['data'];\n\n\t\t}", "public function getPosts()\n {\n $sql = ' SELECT posts.ID,\n posts.post_date_gmt,\n posts.post_content,\n posts.post_title,\n posts.post_excerpt,\n posts.post_status,\n posts.post_modified_gmt,\n posts.guid,\n posts.comment_count,\n users.user_nicename,\n users.user_url,\n users.user_registered\n FROM wp_posts posts\n INNER JOIN wp_users users\n ON posts.post_author = users.ID\n WHERE posts.post_status = \"publish\"\n AND posts.post_type = \"post\"\n ORDER BY posts.post_date DESC\n LIMIT 16';\n\n $definition = [\n 'entry' => $this->provider->newCollection($sql, [], [\n 'id' => new Field\\Callback('ID', function($id){\n return Uuid::nameBased($id);\n }),\n 'content' => 'post_content',\n 'title' => 'post_title',\n 'excerpt' => 'post_excerpt',\n 'status' => 'post_status',\n 'href' => 'guid',\n 'createdAt' => new Field\\DateTime('post_date_gmt'),\n 'updatedAt' => new Field\\DateTime('post_modified_gmt'),\n 'commentCount' => 'comment_count',\n 'author' => [\n 'displayName' => 'user_nicename',\n 'url' => 'user_url',\n 'createdAt' => new Field\\DateTime('user_registered'),\n ],\n ])\n ];\n\n return $this->builder->build($definition);\n }", "function GetPosts($page = -1, $condicion=\"\"){\n\t\t\t$this->CalcRegs($page);\n\t\t\treturn $this->entidad->GetListaFiltrada($this->iniReg-1, $this->pageLen, $condicion);\n\t\t}", "public function getPosts()\n {\n }", "private function get_posts() {\n\t\t// No need to proceed if we're not in the migration page.\n\t\tif ( ! $_GET || ! isset( $_GET[ self::$slug ] ) || '1' !== $_GET[ self::$slug ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$args = [\n\t\t\t'suppress_filters' => 1,\n\t\t\t'posts_per_page' => $this->get_posts_per_page(),\n\t\t\t'offset' => $this->from_offset,\n\t\t\t'orderby' => 'date',\n\t\t\t'order' => 'DESC',\n\t\t\t'post_type' => $this->current_post_type,\n\t\t\t'post_status' => 'any',\n\t\t];\n\n\t\t$this->posts = fusion_cached_get_posts( $args );\n\t}", "public function posts(Post $post, $id){ \t \t\n \t$relationship = Relationship::where('user_id_one', $id) \t\t \t\t\t\t\t\t\t\t\n \t\t\t\t\t\t\t\t->where('status', 1)\n \t\t\t\t\t\t\t\t->get();\n\t$data = array(); \t\t\t\t\t\n\tforeach($relationship as $relation){\t\t\t\t\n\t\t$tagsData = array();\t\t\t\t\t\t\t\n\t\t$posts = Post::where('user_id', $relation->user_id_two)->get();\t\t\t\n\t foreach($posts as $post){\n\t \t$name = Post::find($post->id)->user->name; \n\t \t$username = Post::find($post->id)->user->username;\n\t \t$post_tags = DB::table('post_tags')->where('post_id', $post->id)->get();\n\t \t$tagsData = [];\n\t \tforeach($post_tags as $tag){\n\t \t\t$tags = Tags::find($tag->tags_id);\n\t \t\t$tagsData[] = $tags->tags;\n\t\t\t}\n\n\t\t\t$date = date('d/m/Y h:i:s', strtotime($post->created_at));\t\t \n\t\t\t$data[] = [\n\t \t\t'id' => $post->id,\n\t \t\t'user_id' => $post->user_id,\n\t \t\t'name' => $name,\n\t \t\t'username' => $username,\n\t \t\t'description' => $post->description,\n\t \t\t'image' => $post->image,\n\t \t\t'tags' => $tagsData,\n\t \t\t'created_at' => $date,\n\t \t];\n\t } \n\t}\t\n\n\t$myPosts = Post::where('user_id', $id)->get();\n\tforeach($myPosts as $post){\n\t\t$name = Post::find($post->id)->user->name; \n \t$username = Post::find($post->id)->user->username;\n \t$post_tags = DB::table('post_tags')->where('post_id', $post->id)->get();\n \t$tagsData = [];\n \tforeach($post_tags as $tag){\n \t\t$tags = Tags::find($tag->tags_id);\n \t\t$tagsData[] = $tags->tags;\n\t\t}\n\n\t\t$date = date('d/m/Y h:i:s', strtotime($post->created_at));\t\t \n\t\t$data[] = [\n \t\t'id' => $post->id,\n \t\t'user_id' => $post->user_id,\n \t\t'name' => $name,\n \t\t'username' => $username,\n \t\t'description' => $post->description,\n \t\t'image' => $post->image,\n \t\t'tags' => $tagsData,\n \t\t'created_at' => $date,\n \t];\n\t}\n\n return response()->json($data);\n }", "public function showAllPosts()\n {\n $sql = <<<EOD\nSELECT\n *,\n DATE_FORMAT(COALESCE(updated, published), '%Y-%m-%dT%TZ') AS published_iso8601,\n DATE_FORMAT(COALESCE(updated, published), '%Y-%m-%d') AS published\nFROM content\nWHERE type=?\nORDER BY published DESC\n;\nEOD;\n $resultset = $this->db->executeFetchAll($sql, [\"post\"]);\n foreach ($resultset as $row) {\n if ($row->filter) {\n $arrayFilter = explode(\",\", $row->filter);\n array_unshift($arrayFilter, \"strip\");\n try {\n $row->data = $this->textFilter->parse($row->data, $arrayFilter);\n } catch (\\Bjos\\TextFilter\\MyTextFilterException $e) {\n $row->error = $e->getMessage();\n }\n }\n }\n return $resultset;\n }", "public function posts();", "function getPosts(){\r\n\tglobal $PAGE_ID;\r\n\r\n\t// access token is required to read a feed\r\n\t// email or text me to get my access code, I removed it when I published the source\r\n\t// the access token is generated using getAccessToken(), and will remain\r\n\t// valid until either the client_id or the app_secret changes\r\n\t$access_token = ;\r\n\r\n\t// http get url, we are requesting the edge /posts of node $user_id,\r\n\t// we are requesting just the fields id, status_type, created_time, and link\r\n\t$url = \"https://graph.facebook.com/\".$PAGE_ID.\"/posts?fields=id,status_type\".\r\n\t\t\",message,created_time,link&access_token=\".$access_token;\r\n\r\n\t// execute http get\r\n\t$reply = file_get_contents($url);\r\n\t// parse the json\r\n\treturn json_decode($reply, true);\r\n}", "public function getPublicPosts()\n {\n $posts = $this->model->where('status', PostStatus::PUBLISHED)->paginate(25);\n /*$posts->getCollection()->map(function ($post) {\n $post->tags = $this->tagRepo->getTagsForPost($post->id);\n });*/\n return $posts;\n }", "private function getPosts()\n\t{\n\t\t$this->all_posts = $this->listing_query->getPosts($this->post_type, $this->h_taxonomies, $this->f_taxonomies);\n\t\t$this->listPostLevel();\n\t\treturn;\n\t}", "public function posts()\n {\n // Check if _posts is something\n if (!count($this->_posts)) {\n // Get all rows with the thread id\n $postRows = DB::table('posts')\n ->where('topic_id', $this->id)\n ->get(['post_id']);\n\n // Create a storage array\n $posts = [];\n\n // Create new post objects for each post\n foreach ($postRows as $post) {\n $posts[$post->post_id] = new Post($post->post_id);\n }\n\n $this->_posts = $posts;\n } else {\n $posts = $this->_posts;\n }\n\n // Return the post objects\n return $posts;\n }", "public function fetchAllPosts()\n {\n return $this->db->Select(\"SELECT * FROM `posts` WHERE `visible`='1' ORDER BY `ts` DESC\");\n }", "function get_page_posts(){\n\t\t\t$endpoint = '/'.$this->page_id.'/posts/';\n\t\t\t$url = self::$host.$endpoint.'?access_token='.self::$fb_app_token;\n\t\t\t// $params = \"&fields=comments\";\n\t\t\t$formed_url = $url.$params;\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL,$formed_url);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\t$retrievedhtml = curl_exec ($ch);\n\t\t\tcurl_close($ch);\t\t\t\n\t\t\treturn $retrievedhtml;\n\t\t}", "public function loadAllPosts()\n {\n array_push($this->posts,);\n\n //open a file\n //jason decode it\n // json_decode ( string $json [, bool $assoc = NULL [, int $depth = 512 [, int $options = 0 ]]] ) : mixed\n //encode string and covert to array\n //loop over the data from the file\n //assign each entry to a post class ????\n //todo $data = json_encode(value: ' ');\n // foreach ($data AS $post) {\n //this->posts [] = new Post($post[\"title\"]);\n }", "protected function getPosts() {\n\n if (empty(self::$postCache)) {\n global $wpdb;\n $results = $wpdb->get_results(\n $wpdb->prepare(\"\n SELECT ID, post_title, post_type\n FROM $wpdb->posts\n WHERE post_status = %s\n LIMIT 10000\n \", 'publish'));\n\n foreach ($results as $key => $post) {\n self::$postCache[(int) $post->ID] = array(\n 'text' => $post->post_title,\n 'attributes' => array(\n 'data-post-type' => $post->post_type,\n ),\n );\n }\n }\n\n return self::$postCache;\n }", "function busca() {\r\n $this->Post->recursive = 1;\r\n $this->paginate['Post']['order'] = 'Post.created DESC';\r\n $this->paginate['Post']['recursive'] = -1;\r\n $this->paginate['Post']['conditions']['or']['texto like '] = '%' . $this->data['Post']['busca'] . '%';\r\n $this->paginate['Post']['conditions']['or']['titulo like '] = '%' . $this->data['Post']['busca'] . '%';\r\n $this->paginate['Post']['conditions']['tipo not'] = 'NULL';\r\n $this->paginate['Post']['limit'] = 25;\r\n $this->set('dados', $this->paginate('Post'));\r\n }" ]
[ "0.6668447", "0.65677255", "0.6542037", "0.64882356", "0.6423261", "0.64093494", "0.6377295", "0.6345556", "0.63157606", "0.6287336", "0.62643445", "0.6243622", "0.62407535", "0.61518514", "0.6132272", "0.6100378", "0.60970616", "0.60685223", "0.6037591", "0.602387", "0.5979491", "0.5978782", "0.5956083", "0.593546", "0.5910657", "0.59102964", "0.5896079", "0.58846337", "0.58832824", "0.58776283" ]
0.68780977
0
Funcion para cargar los post de un usuario especifico para que su propietario pueda editarlos > editarPost.php
function postUsuario(){ $usuario = $_GET['usuario']; try{ $consulta3 = "SELECT * FROM posts WHERE nickname=:nickname"; $sentencia3 = conexion()->prepare($consulta3); $sentencia3->setFetchMode(PDO::FETCH_ASSOC); }catch(PDOException $pe){ die("Error occurred:" . $pe->getMessage()); } $sentencia3->execute( array( 'nickname' => $usuario) ); $resultado3 = $sentencia3->fetchAll(); foreach($resultado3 as $pos3 => $fila3){ ?> <div> <h4> <?php echo $fila3['titulo'] ?></h4> <form class="formEdicion" action="PHP/codEditarPost.php" method="post"> <input type="text" name="texto" id="campo" value="<?php echo $fila3['contenido']?>" > <input type="text" hidden name="idP" value="<?php echo $fila3['id_post']?>" rows="4" cols="50"> </br> <input type="submit" class="boton" value="EDITAR"> <a href='index.php?idPost=<?php echo $fila3['id_post'] ?>&tipo=borrarPost'><span class="icon-trash"><span> </a> </form> </div> <?php } echo ("<script type='text/javascript' src='JSCRIPT/usuario.js'></script>"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cargarPosts($posts){\n \n foreach($posts as $posicion =>$columna){\n\n //si hay un usuario logeado, almacenamos el tipo de usuario que es\n //no será de mucha utilidad\n if(isset($_SESSION[\"usuarioLogeado\"])){\n $tipoUser = $_SESSION[\"tipo\"];\n }else{\n $tipoUser = 'normal';\n }\n $propietario = $columna['nickname'];\n ?>\n <div id=\"tarjetaPost\">\n <!--<img src=\"//<//?//php echo $columna['imagen_post'] ?>\">-->\n <a href=\"paginaPost.php?tipo=visita&idPost=<?php echo $columna['id_post']; ?>\"> <h2 class=\"tituloPost\"><?php echo $columna['titulo']; ?> </h2> </a>\n <?php\n //Comprobamos que tipo de usuario se ha logeado, para habilitar o no el boton para eliminar un post\n if($tipoUser=='admin'){\n ?>\n <a href=\"index.php?tipo=borrarPost&idPost=<?php echo $columna['id_post']; ?>\" class=\"btnEliminar\"><span class=\"icon-trash\"></span></a>\n <?php\n \n }elseif($tipoUser=='normal'){\n ?>\n <style type=\"text/css\">\n .btnEliminar{display: none;} \n </style>\n <?php\n \n }elseif($tipoUser=='mod'){\n ?>\n <style type=\"text/css\">\n .btnEliminar{display: none;} \n </style>\n <?php\n }\n //Si nadie está logeado, que no se muestre el boton para eliminar \n if(!isset($_SESSION[\"usuarioLogeado\"])){\n ?>\n <style type=\"text/css\">\n .btnEliminar{display: none;} \n </style> \n <?php\n }\n ?>\n <p class=\"contenido\"><?php $resultado = substr($columna['contenido'], 0, 400).\"...\"; echo $resultado?> </p>\n <p class=\"autor\">Autor: <?php echo $columna['nickname'] ?> </p>\n <p class=\"visualizaciones\"><span class=\"icon-eye\"></span><?php echo (\" \".$columna['visitas']) ?></p>\n <span class=\"fecha\"><?php echo (\" \".$columna['fecha'] )?></span>\n </div>\n <?php\n echo (\"<script type='text/javascript' src='JSCRIPT/usuario.js'></script>\");\n }\n}", "function cargarComentariosBlog(){\n echo (\"<script type='text/javascript' src='JSCRIPT/usuario.js'></script>\");\n $idP=$_GET[\"idPost\"];\n try{\n $comentarios = \"SELECT id_comentario,nickname,comentario,fecha FROM comentarios WHERE id_post=$idP\";\n $sentenciaC =conexion()->query($comentarios);\n $sentenciaC->setFetchMode(PDO::FETCH_ASSOC);\n }catch(PDOException $pe){\n die(\"Error occurred:\" . $pe->getMessage());\n }\n $sentenciaC->execute();\n $resultadoC = $sentenciaC->fetchAll();\n foreach($resultadoC as $posicionC => $filaC){\n ?>\n <div>\n <p class=\"usuario\"> <?php echo $filaC['nickname']?></p>\n <p class=\"contenido\"><?php echo $filaC['comentario']?></p>\n <p class=\"fechaComentario\"> <?php echo $filaC['fecha']?></p>\n <?php\n $user = $filaC['nickname'];\n //Un usuario solo puede eliminar sus comentarios en cambio el moderador podra eliminar todos\n if(isset($_SESSION[\"usuarioLogeado\"])){\n if($_SESSION[\"usuarioLogeado\"]==$user || $_SESSION[\"tipo\"]=='mod'){\n\n ?>\n <a class=\"btnElimCom\" href=\"paginaPost.php?idPost=<?php echo $_GET['idPost'];?>&idC=<?php echo $filaC['id_comentario'] ?>&tipo=eliminarComentario\"><span class=\"icon-trash\"></span></a>\n <?php\n }\n }\n ?>\n </div> \n <?php\n }\n}", "function user_posts()\n\t\t{\n\t\t\tglobal $con;\n\t\t\t\n\t\t\tif(isset($_GET['u_id']))\n\t\t\t{\n\t\t\t\t$u_id = $_GET['u_id'];\n\t\t\t\t\n\t\t\t}\n\t\t\t$get_posts = \"select * from posts where user_id='$u_id' ORDER by 1 DESC\";\n\t\t\t\n\t\t\t\n\t\t\t$run_posts = mysqli_query($con,$get_posts);\n\t\t\t\n\t\t\twhile ($row_posts = mysqli_fetch_array($run_posts)){\n\t\t\t\t$post_id = $row_posts['post_id'];\n\t\t\t\t$user_id = $row_posts['user_id'];\n\t\t\t\t$post_title = $row_posts['post_title'];\n\t\t\t\t$content = $row_posts['post_content'];\n\t\t\t\t$post_date = $row_posts['post_date'];\n\t\t\t\t\n\t\t\t\t//getting the users who has posted the posts\n\t\t\t\t\n\t\t\t\t$user = \"select * from users where user_id = '$user_id' AND posts='yes'\";\n\t\t\t\t$run_user = mysqli_query($con,$user);\n\t\t\t\t$row_user = mysqli_fetch_array($run_user);\n\t\t\t\t$user_name = $row_user['user_name'];\n\t\t\t\t$user_image = $row_user['user_image'];\n\t\t\t\t\n\t\t\t\t//displaying all at once\n\t\t\t\techo \" <div id='posts'>\n\t\t\t\t\t\t<p><img src ='user/user_image/$user_image' width='50'height='50'></img></p>\n\t\t\t\t\t\t<h3><a href='user_profile.php?user_id=$user_id'>$user_name</a></h3>\n\t\t\t\t\t\t<h3>$post_title</h3>\n\t\t\t\t\t\t<p>$post_date</p>\n\t\t\t\t\t\t<p>$content</p>\t\n\t\t\t\t\t\t<a href='single.php?post_id=$post_id' style='float:right'><button>View</button></a>\n\t\t\t\t\t\t<a href='functions/delete_post.php?post_id=$post_id' style='float:right'><button>Delete</button></a>\n\t\t\t\t\t\t<a href='edit_posts.php?post_id=$post_id' style='float:right'><button>Edit</button></a>\n\n\t\t\t\t\t\t</div><br/>\n\t\t\t\t\t \";\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t}", "function MostraPost() {\n \n include 'connect.php';\n\n if(isset($_GET['Id'])){\n $Id = mysqli_real_escape_string($mysqli, $_GET['Id']);\n \n //seleziona i post relativi all'argomento con id = $Id\n $query = \" SELECT \n P.Id, P.Contenuto, P.Data\n FROM \n post P INNER JOIN argomento A ON P.IdArgomento=A.Id\n WHERE\n A.Id='$Id';\";\n\n $result = mysqli_query($mysqli, $query);\n\n if(!$result) {\n echo '<div class=\"Center\"><h2>Errore argomento, riprova piu tardi.<h2></div>' . mysql_error();\n\t\t\t\texit();\n } \n\n echo '<div class=\"Center\"><h2>Posts :</h2></div>';\n\n if(mysqli_num_rows($result) == 0) {\n echo '<div class=\"Center\"><h4>Non ci sono post relativi a questo argomento.</h4></div>';\n return;\n } \n //preparo la tabella\n echo '<div class=\"Tabella\">\n <table>\n <tr> \n <th>Post</th>\n <th>Data</th>\n <th>MiPiace</th>\n </tr>'; \n\n while($row = $result->fetch_assoc()) { \n InserisciPostNellaTabella($row, $Id);\n }\n echo '</table></div>';\n \n } else {\n header(\"Location: Forum.php?Argomento=error\");\n exit();\n }\n }", "public function post_edit(){\n\t\ttry {\n\t\t\t$postInfo = CA_Social::getPost($this->input->post('post_id'), 0, FALSE, $this->self['id']);\n\t\t\tif($postInfo['user_id']==$this->self['id']){\n\t\t\t\tCA_Social::updatePost($this->input->post('post_id'), $this->input->post('message'));\n\t\t\t}else{\n\t\t\t\tthrow new Exception('You must be the owner of the post to delete.');\n\t\t\t}\n\t\t\t$this->ajaxResponse(array(\n\t\t\t\t'status' => TRUE,\n\t\t\t));\n\t\t}catch(Exception $e){\n\t\t\t$this->ajaxResponse(array(\n\t\t\t\t'status' => FALSE,\n\t\t\t\t'message' => $e->getMessage(),\n\t\t\t));\n\t\t}\n\t}", "public function userclippingpost()\n\t\t{\n\t\t\t$logger = Logger::getLogger(__CLASS__);\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$posterid = $_POST[\"posterid\"];\n\t\t\t\t$pageIndex = $_POST[\"txtPageIndex\"];\n\t\t\t\t$logger->debug(\"PosterID::\" . $posterid);\n\t\t\t\t$appUserBO = new AppUserBO($this->_UserInfo);\n\t\t\t\t$postBO = new PostBO($this->_UserInfo);\n\t\t\t\t$appUser = $appUserBO->SelectByAppUserID($posterid);\n\t\t\t\t$logger->debug(\"User email is::\" . $appUser->getEmail());\n\t\t\t\t$appUserID = 0;\n\t\t\t\tif (isset($_COOKIE[\"ropaziuser\"])){\n\t\t\t\t\t$logger->debug(\"Got user cookie\");\n\t\t\t\t\t$logger->debug($_COOKIE[\"ropaziuser\"]);\n\t\t\t\t\t$appUserID = CommonUtils::verifyUserCookie();\n\t\t\t\t}\n\t\t\n\t\t\t\t$submodels = array();\n\t\t\t\t$submodels[] = $appUser;\n\t\t\n\t\t\t\t$paginatedlist = $postBO->SelectByAppUserIDAndPosterAppUserID($appUserID, $posterid,\"Title\", \"ASC\", 20, $pageIndex);\n\t\t\t\t$this->model = $paginatedlist;\n\t\t\t\t$posts = $this->model->getList();\n\t\t\t\tob_start();\n\t\t\t\tinclude('views/post/_postlistcontrol.php');\n\t\t\t\t$output = ob_get_contents();\n\t\t\t\tob_end_clean();\n\t\t\t\t$logger->debug($output);\n\t\t\t\treturn $this->view->outputJson(Constants::$OK, $output, \"\");\n\t\t\t}\n\t\t\tcatch (Exception $ex)\n\t\t\t{\n\t\t\t\t$logger->error($ex->getMessage());\n\t\t\t}\n\t\t}", "public function editar(Post $post)\n {\n //\n }", "function edit_post($forum) {\n\t$sql = \"select * from posts where post_id = \" . $_GET['postid'];\n\t$result = mysqli_query($forum, $sql);\n\tif ($result == true) {\n\t\twhile ($rows = $result->fetch_assoc()){\n\t\t\techo \"<form action='' method='POST'>\n\t\t\t<div class='main'><h3>Edit your comment: <br><textarea name='edit_post' rows='10' cols='120' >\" . $rows['post_content'] . \"</textarea></h3><br><input type='submit' value='Edit' /></div>\";\n\n\t\t\tif ($_GET['uid'] == $_SESSION['signed_id'] and isset($_POST['edit_post'])) {\n\t\t\t\t$update = \"update posts set post_content = '\" . mysqli_escape_string($forum, $_POST['edit_post']) . \"' where post_id = \" . $_GET['postid'];\n\t\t\t\t$result2 = mysqli_query($forum, $update);\n\t\t\t\tif ($result2 == false) {\n\t\t\t\t\tdie(mysqli_error($forum));\n\t\t\t\t}\n\t\t\t\theader(\"Location: index.php?page=posts&id=\" . $_GET['id'] . \"&sub=\" . $_GET['sub'] . \"&uid=\" . $_GET['uid']);\n\t\t\t}\n\t\t}\n\t}\n}", "private function editpost(object $pp1) //private\n {\n $uriq = $pp1->uriq ;\n //$SarchQueryParameter = $this->ctr akc par_ arr['id'] ; //$_ GET[\"id\"] :\n $IdFromURL = $uriq->id ;\n //$dm = $this ; //globals for all sites (eg for CRUD...) !!\n\n $this->Login_Confirm_SesUsrId();\n\n $title = 'Edit Post' ;\n //if form and form processing are in same script, redirect has problem :\n //require $pp1->shares_path . 'hdr.php';\n //require_once(\"navbar_admin.php\");\n require $pp1->module_path . '../post/upd_post_frm.php';\n //require $pp1->shares_path . 'ftr.php';\n }", "public function miseAJour($id_post)\r\n {\r\n if (isset($_SESSION['pseudo'])){\r\n if (isset($id_post) && is_numeric($id_post)) {\r\n $post = new PostDAO();\r\n if ($post->read($id_post)) {\r\n $dataPostRead = $post->read($id_post);\r\n $var_array = array(\"title\" => $dataPostRead[0]->getTitre(),\r\n \"contentPost\" => $dataPostRead[0]->getContenu(),\r\n \"idPost\" => $id_post);\r\n $this->viewTemplate('app/view/admin/updatePostView.php', 'app/view/admin/Template.php', '', $var_array);\r\n } else {\r\n ErreurControler::methodNoExist();\r\n }\r\n }\r\n else {\r\n ErreurControler::methodNoExist();\r\n }\r\n }\r\n else {\r\n header('Location: /app/admin/login');\r\n }\r\n\r\n }", "public function editPostContent($post)\n {\n $objectId = $post->ID;\n \n include UAM_REALPATH.'tpl/postEditForm.php';\n }", "function printPosts($id){\n\t//Opening connection to the database using the function connectToDB().\n\t$conn = connectToDB();\n\t//Creating the SQL-statement for fetching data from the database.\n\t$sql = $conn->prepare(\"SELECT p_id ,username, p_comment FROM post WHERE t_id = ?\");\n\t$sql->bind_param(\"i\", $id);\n\n\t//Executing the SQL-query\n\t$sql->execute();\n\t$result = $sql->get_result();\n\t$row_id = 1;\n\tif ($result->num_rows > 0) {\n\t\t// output data of each row\n\t\techo \"<form action='functions.php' method='post'>\n\t\t\t\t<table class='table'>\";\n\t\twhile($row = $result->fetch_assoc()) {\n\t\t\t//We use the $row_id for creating unique ids for all rows we create.\n\t\t\t$row_id++;\n\t\t\tif(isset($_SESSION[\"userN\"])){\n\t\t\t\t\n\t\t\t\t//If the user has logged in we add an edit option for comments made by them.\n\t\t\t\techoPosts($row, $_SESSION[\"userN\"], $_GET[\"t\"], $row_id);\n\t\t\t\t\n\t\t\t}else if(isset($_COOKIE[\"username\"])){\n\t\t\t\t\n\t\t\t\t//If the user has logged in we add an edit option for comments made by them.\n\t\t\t\techoPosts($row, $_COOKIE[\"username\"], $_GET[\"t\"], $row_id);\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\techo \"<tr>\n\t\t\t\t\t\t<td class='text-right'>\n\t\t\t\t\t\t\t<b>\".$row[\"username\"] .\"</b>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td class='text-center textLines'>\n\t\t\t\t\t\t\t<p>\".$row[\"p_comment\"].\"</p>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\";\n\t\t\t}\n\t\t}\n\t}\n\t//After displaying all comments we add an form that allows logged in users to add new comments to the topics.\n\techo \"<form action='functions.php' method='post'>\n\t\t\t<table class='table'>\";\n\tif(isset($_SESSION['userN']) && isset($_SESSION['userP'])){\n\t\t\n\t\techoPostsForm($_GET['t']);\n\t\t\n\t}else if(isset($_COOKIE['username']) && isset($_COOKIE['password'])){\n\t\t\n\t\techoPostsForm($_GET['t']);\n\t\t\n\t}else{\n\t\techo \"<tr>\n\t\t\t\t<td class='text-center'>\n\t\t\t\t\t<p>Please login to comment.</p>\n\t\t\t\t</td>\n\t\t\t</tr>\";\n\t}\n\techo \"\t</table>\n\t\t</form>\";\n}", "public function getUserPost($post){\n\t \t\t\n\t \t\t$pdo = DatabaseContent::connect();\n\t \t \t$sql = 'SELECT * FROM `post` WHERE `username`= ' . $post['username'] . ' DESC';\n\t \t \t$i = 0;\n\t\t\tforeach($pdo->query($sql) as $row) {\n\t\t\t\t\t\t//Defining by database\n\t\t\t\t\t\t$username = ($row[0]);\n\t\t\t\t\t\t$id = ($row[1]);\n\t\t\t\t\t\t$date = ($row[2]);\n\t\t\t\t\t\t$image = ($row[3]);\n\t\t\t\t\t\t$caption = ($row[4]);\n\t\t\t\t\t\t$b = ($i === 1) ? \",\" : \"\";\n\t\t\t\t\t\t$JSONparse = $JSONparse . $b . '\"' . $i . '\":{ \"username\": \"' . $username . '\",\"id\": \"' . $id . '\", \"date\": \"' . $date . '\", \"image\": \"' . $caption . '\", \"caption\": \"' . $image . '\"}';\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t$JSONobject = '{' . $JSONparse . '}'; //collects in brackets\n\t\t\techo $JSONobject;\n\t \t DatabaseContent::disconnect();\n\t \t\n\t \t\t\n\t \t}", "public function blogposts_ajax_user_posts()\n {\n ob_start();\n\n $input = new PeepSoInput();\n $owner = $input->int('user_id');\n $page = $input->int('page', 1);\n\n $sort = $input->value('sort', 'desc', array('asc','desc'));\n\n $limit = 10;\n $offset = ($page - 1) * $limit;\n\n if ($page < 1) {\n $page = 1;\n $offset = 0;\n }\n\n $args = array(\n 'author' => $owner,\n 'orderby' => 'post_date',\n 'post_status'\t=> 'publish',\n 'order' => $sort,\n 'posts_per_page'=> $limit,\n 'offset'\t\t=> $offset,\n );\n\n // Count published posts\n $count_posts = wp_count_posts();\n $count_blogposts = $count_posts->publish;\n\n // Get the posts\n $blogposts=get_posts($args);\n\n $force_strip_shortcodes = PeepSo::get_option('blogposts_profile_content_force_strip_shortcodes', 0);\n\n if (count($blogposts)) {\n // Iterate posts\n foreach ($blogposts as $post) {\n\n // Choose between excerpt or post_content\n // @todo is there a more elegant way?\n $post_content = get_the_excerpt($post->ID);\n\n if(!strlen($post_content)) {\n $post_content = $post->post_content;\n }\n\n $post_content = strip_shortcodes($post_content);\n\n if($force_strip_shortcodes) {\n $post_content = preg_replace('/\\[.*?\\]/', '', $post_content);\n }\n\n $limit = intval(PeepSo::get_option('blogposts_profile_content_length',50));\n $post_content = wp_trim_words($post_content, $limit,'&hellip;');\n\n if(0 == $limit) {\n $post_content = FALSE;\n }\n\n PeepSoTemplate::exec_template('blogposts', 'blogpost', array('post_content' => $post_content, 'post' => $post));\n }\n\n $resp['success']\t\t= 1;\n\n $resp['html']\t\t\t= ob_get_clean();\n } else {\n $message = (get_current_user_id() == $owner) ? __('You have no blog posts yet', 'peepso-core') : sprintf(__('%s has no blog posts yet', 'peepso-core'), PeepSoUser::get_instance($owner)->get_firstname());\n $resp['success']\t\t= 0;\n $resp['error'] = PeepSoTemplate::exec_template('profile','no-results-ajax', array('message' => $message), TRUE);\n }\n\n $resp['page']\t\t\t= $page;\n $resp['found_blogposts']= abs($count_blogposts - $page * $limit);\n header('Content-Type: application/json');\n echo json_encode($resp);\n exit(0);\n }", "function single_post()\n\t\t{\n\t\t\tif(isset($_GET['post_id']))\n\t\t\t{\n\t\t\t\tglobal $con;\n\t\t\t\t$get_id = $_GET['post_id'];\n\t\t\t\t\t\n\t\t\t\t$get_posts = \"select * from posts where post_id='$get_id'\";\n\t\t\t\n\t\t\t\t$run_posts = mysqli_query($con,$get_posts);\n\t\t\t\n\t\t\t\t$row_posts = mysqli_fetch_array($run_posts);\n\t\t\t\t\n\t\t\t\t$post_id = $row_posts['post_id'];\n\t\t\t\t$user_id = $row_posts['user_id'];\n\t\t\t\t$post_title = $row_posts['post_title'];\n\t\t\t\t$content = $row_posts['post_content'];\n\t\t\t\t$post_date = $row_posts['post_date'];\n\t\t\t\t\n\t\t\t\t//getting the users who has posted the posts\n\t\t\t\t\n\t\t\t\t$user = \"select * from users where user_id = '$user_id' AND posts='yes'\";\n\t\t\t\t$run_user = mysqli_query($con,$user);\n\t\t\t\t$row_user = mysqli_fetch_array($run_user);\n\t\t\t\t$user_name = $row_user['user_name'];\n\t\t\t\t$user_image = $row_user['user_image'];\n\t\t\t\t\t\n\t\t\t\t\t//getting user session\n\t\t\t\t\t\t\t$user_com = $_SESSION['user_email'];\n\t\t\t\t\t\t\t$get_com = \"select * from users where user_email='$user_com'\";\n\t\t\t\t\t\t\t$run_com = mysqli_query($con,$get_com);\n\t\t\t\t\t\t\t$row_com = mysqli_fetch_array($run_com);\n\t\t\t\t\t\t\t$user_com_id = $row_com['user_id'];\n\t\t\t\t\t\t\t$user_com_name = $row_com['user_name'];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t//displaying all at once\n\t\t\t\techo \" <div id='posts'>\n\t\t\t\t\t\t<p><img src ='user/user_image/$user_image' width='50'height='50'></img></p>\n\t\t\t\t\t\t<h3><a href='user_profile.php?u_id=$user_id'>$user_name</a></h3>\n\t\t\t\t\t\t<h3>$post_title</h3>\n\t\t\t\t\t\t<p>$post_date</p>\n\t\t\t\t\t\t<p>$content</p>\t\n\t\t\t\t </div>\n\t\t\t\t\t \";\n\t\t\t\t\t include(\"comments.php\");\n\t\t\t\t\t echo\"\n\t\t\t\t\t<form action='' method='post' id='reply'>\n\t\t\t\t\t<textarea cols='50' rows='5' name='comment' placeholder='Write your reply'></textarea><br/>\n\t\t\t\t\t<input type='submit' name ='reply'onClick='history.go(0)' value='Reply To This'/>\n\t\t\t\t\t</form>\n`\n\n\t\t\t\t\t\t\";\n\t\t\t\t\t\tif(isset($_POST['reply'])){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$comment = $_POST['comment'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$insert = \"insert into comments (post_id,user_id,comment,comment_author,date)values('$post_id','$user_id','$comment','$user_com_name',NOW())\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$run = mysqli_query($con,$insert);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\techo \"<h2>Your reply was added</h2>\";\n\t\t\t\t\t\t\techo \"<script>window.open('single.php?post_id=$get_id','_self')</script>\";\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t}\n\t\t}", "public function formChangePost()\n {\t\n if(isset($_SESSION['id']) AND isset($_SESSION['login'])){\n $postManager = new PostManager();\n \t$post = $postManager->getPost($_GET['id']);\n if ($post === false){\n throw new Exception('Numéro d\\'identifiant non valide!'); \n } else {\n require('view/backend/formChangePost.php'); // Affiche la vue du formulaire de modification du billet\n }\n } else {\n throw new \\Exception('Vous n\\'êtes pas connecté'); \n }\n }", "function editPost($role_id)\n\t{\n\t\tglobal $conn, $title, $body, $isEditingPost, $post_id;\n\t\t$sql = \"SELECT * FROM news WHERE id=$role_id LIMIT 1\";\n\t\t$result = mysqli_query($conn, $sql);\n\t\t$post = mysqli_fetch_assoc($result);\n\t\t// set form values on the form to be updated\n\t\t$title = $post['title'];\n\t\t$body = $post['body'];\n\t}", "function getPostOfUser($idUser)\n {\n }", "public function edit_post()\n\t\t\t\t{\n\t\t\t\t\t$id=$_REQUEST['id'];\n\t\t\t\t\t$query = $this->db->get_where('post', array('id' => $id));\n\t\t\t\t\treturn $query->result_array();\n\t\t\t\t}", "public function YourPost(){\n\t\t\t$picLogginUser = $this->data->profileImg();\n\n\t\t\t\t//$page = $data['page']; \n\t\t\t$userLoggedIn = $this->data->username();\n/*\n\t\t\t\tif($page == 1) \n\t\t\t\t\t$start = 0;\n\t\t\t\telse \n\t\t\t\t\t$start = ($page - 1) * $limit;\n*/\n\n\t\t\t\t\t$str = '';\n\t\t\t\t//collected all posts and oreder it by id\n\t\t\t\t\t$sql = $this->con->prepare(\"select * from posts where deleted ='no' and add_by = ? or user_to=? order by id desc\");\t\n\t\t\t\t\t$sql->execute(array($userLoggedIn,$userLoggedIn));\t\n\t\t\t\t\t$rows = $sql->fetchAll();\n\t\t\t\t\t$numofrow = $sql->rowCount();\n\n\n\t\t\t\t\tif($numofrow>0)\n\t\t\t\t\t{\n\t\t\t\t$num_iterations = 0; //Number of results checked (not necasserily posted)\n\t\t\t\t$count = 1;\n\t\t\t\t$counter = 1;\n\n\t\t\t\t//show it \n\t\t\t\tforeach ($rows as $row) \n\t\t\t\t{\n\t\t\t\t\t// info about post\n\t\t\t\t\t$id = $row['id'];\n\t\t\t\t\t$body = $row['body'];\n\t\t\t\t\t$added_by = $row['add_by'];\n\t\t\t\t\t$date_added = $row['date_added'];\n\n\n\t\t\t\t\t$user_info = new users($this->con,$userLoggedIn);\n\t\t\t\t\t//info about user login\n\t\t\t\t\t$fullname = $user_info->full_name();\n\t\t\t\t\t$img_to = $user_info->profileImg();\n\t\t\t\t\t$user_to = \"to <a href='\" . $row['user_to'] .\"'>\" . $fullname . \"</a>\";\n\n\n// date\n\t\t\t\t\t$time_now = date('Y-m-d H:i:s');\n\t\t\t\t\t$start_date = new datetime($date_added); // Time of Post\n\t\t\t\t\t$end_date = new datetime($time_now); ////rime now\n\t\t\t\t\t$interval = $start_date->diff($end_date); // diffrence between them\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\tif($interval->y >= 1) {\n\t\t\t\t\t\tif($interval == 1)\n\t\t\t\t\t\t\t$time_message = $interval->y . ' year ago'; //1 year ago\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\t$time_message = $interval->y . ' years ago'; //1+ year ago\n\t\t\t\t\t}\n\t\t\t\t\telse if ($interval-> m >= 1) {\n\t\t\t\t\t\tif($interval->d == 0) {\n\t\t\t\t\t\t\t$days = ' ago';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if($interval->d == 1) {\n\t\t\t\t\t\t\t$days = $interval->d . ' day ago';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$days = $interval->d . ' days ago';\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\tif($interval->m == 1) {\n\t\t\t\t\t\t\t$time_message = $interval->m . ' month'. $days;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$time_message = $interval->m . ' months'. $days;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\telse if($interval->d >= 1) {\n\t\t\t\t\t\tif($interval->d == 1) {\n\t\t\t\t\t\t\t$time_message = 'Yesterday';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$time_message = $interval->d . ' days ago';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if($interval->h >= 1) {\n\t\t\t\t\t\tif($interval->h == 1) {\n\t\t\t\t\t\t\t$time_message = $interval->h . ' hour ago';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$time_message = $interval->h . ' hours ago';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if($interval->i >= 1) {\n\t\t\t\t\t\tif($interval->i == 1) {\n\t\t\t\t\t\t\t$time_message = $interval->i . ' minute ago';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$time_message = $interval->i . ' minutes ago';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif($interval->s < 30) {\n\t\t\t\t\t\t\t$time_message = 'Just now';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$time_message = $interval->s . ' seconds ago';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\n\n\t\t\t\t\t<script>\n\n\t\t\t\t\t\t$(function(){\n\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\turl:\"loadComment.php\",\n\t\t\t\t\t\t\t\tdata:\"post_id=<?php echo $row['id']; ?>\",\n\t\t\t\t\t\t\t\ttype:\"POST\",\n\t\t\t\t\t\t\t\tsuccess:function(data){\n\t\t\t\t\t\t\t\t\t$(\".callAjax<?php echo $count ?>\").prepend(data);\n\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\turl:\"likes.php\",\n\t\t\t\t\t\t\t\tdata:\"post_id=<?php echo $row['id']; ?>\",\n\t\t\t\t\t\t\t\ttype:\"POST\",\n\t\t\t\t\t\t\t\tsuccess:function(data){\n\t\t\t\t\t\t\t\t\t$(\".callAjaxLike<?php echo $count ?>\").prepend(data);\n\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\n\t\t\t\t\t</script>\n\n\n\n\t\t\t\t\t<?php\n\t\t\t\t\t$sql = $this->con->prepare(\"select * from comments where post_id= ? \");\n\t\t\t\t\t$sql->execute(array($row['id']));\n\t\t\t\t\t$rows = $sql->fetchAll();\n\t\t\t\t\t$countsOfComment = $sql->rowCount();\n\t\t\t\t\t$post_img= \"\";\n\n\t\t\t\t\t$sqlPost = $this->con->prepare('select * from posts where id = ?');\n\t\t\t\t\t$sqlPost->execute(array($id));\n\t\t\t\t\t$dataa = $sqlPost->fetch();\n\t\t\t\t\tif($dataa['post_img'] != \"none\")\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$post_img = \"<img style = 'border-radius: 6px;\n\t\t\t\t\t\tbox-shadow: 4px 7px 9px 2px #eaeaeaea;' src= $dataa[post_img] >\";\n\t\t\t\t\t}\n\t\t\t//check if user_to to every post have value diffrenet about none then show it\n\t\t\t\t\t$tags = \"\";\n\t\t\t\t\t$with = '';\n\t\t\t\t\tif($dataa['user_to'] == $this->data->username())\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t$userTages = new users($this->con,$dataa['add_by']);\n\t\t\t\t\t\t$fullnameTages=$userTages->full_name();\n\t\t\t\t\t\t$imgTages=$userTages->profileImg();\n\t\t\t\t\t\t$tags= $fullnameTages;\n\t\t\t\t\t\t$with = 'with';\n\t\t\t\t\t}\n\n\n\t\t\t\t\t// count of comments\n\n\t\t\t\t\t$str.= \"<div class='central-meta item'>\n\t\t\t\t\t<div class='user-post'>\n\t\t\t\t\t<div class='friend-info'>\n\t\t\t\t\t<figure>\n\t\t\t\t\t<img class='img-sm-45 img-md-60' src=' $picLogginUser' alt=''>\n\t\t\t\t\t</figure>\n\t\t\t\t\t<div class='friend-name'>\n\t\t\t\t\t\n\t\t\t\t\t<ins><a class='post_owner' href='' title=''>$tags</a><span id = 'with'> $with</span> <a class = 'post_owner' href=''> $fullname</a></ins>\n\t\t\t\t\t<span>published: $time_message</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class='description'>\n\n\t\t\t\t\t<p>\n\t\t\t\t\t$body\n\n\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class='post-meta'>\n\n\n\n\t\t\t\t\t$post_img\n\n\n\n\n\t\t\t\t\t<div class='we-video-info'>\n\t\t\t\t\t<ul class='callAjaxLike$count'>\n\n\t\t\t\t\t<li>\n\t\t\t\t\t<button style='width: 61px;background: #fff;\n\t\t\t\t\tcolor: #777;' type='submit' class='btn btn-lg'>\n\t\t\t\t\t<span> $countsOfComment</span>\n\t\t\t\t\t\n\t\t\t\t\t<img src='assetWebsite/images/chat.svg'>\n\t\t\t\t\t</button>\n\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\n\n\t\t\t\t\t</ul>\n\n\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\n\t\t\t\t\t<div class='coment-area'>\n\t\t\t\t\t<ul class='we-comet'>\n\t\t\t\t\t<li class='callAjax$count' >\n\n\n\n\t\t\t\t\t<ul>\n\t\t\t\t\t<li class='post-comment'>\n\t\t\t\t\t<div class='comet-avatar'>\n\t\t\t\t\t<img class='img-md-45 img-sm-35' src='$picLogginUser' alt=''>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class='post-comt-box'>\n\t\t\t\t\t<form method='post' action='uploadComment.php' class = 'add_comment'>\n\t\t\t\t\t<textarea name = 'Comment-Body' placeholder='Post your comment'></textarea>\n\n\t\t\t\t\t<input type='hidden' value = '$id' name='post_id'>\n\t\t\t\t\t<input class='btn btn-primary btn-sm' type='submit' name='submit' value='comment'>\n\t\t\t\t\t</form> \n\t\t\t\t\t</div>\n\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t</div>\";\n\n\t\t\t\t\t$count ++;\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t//end loop\n\n\t\t\t/*\tif($count > $limit) \n\t\t\t$str .= \"<input type='hidden' class='nextPage' value='\" . ($page + 1) . \"'>\n\t\t\t<input type='hidden' class='noMorePosts' value='false'>\";\n\t\t\telse \n\t\t\t$str .= \"<input type='hidden' class='noMorePosts' value='true'><p style='text-align: centre;'> No more posts to show! </p>\";\n\t\t\t*/\n\t\t\techo $str ;\n\t\t}", "public function posts($id=null, $del_post_id=null) {\n if (empty($id)) {\n\n header(\"Location: \" . URLROOT . \"/errors/page_not_found\");\n \n // if id isn't empty load\n } else {\n\n // get all categories for data\n $categories = $this->catModel->getCats();\n // get all posts by user\n $posts = $this->postModel->getPostsbyUser($id, false);\n // search user\n $user = $this->userModel->searchUser('user_id', $id);\n\n // if user doesn't exist redirect\n if (empty($user)) {\n header(\"Location: \" . URLROOT . \"/errors/page_not_found\");\n }\n\n // data array\n $data = [\n 'h4_1' => 'This user has no posts yet...',\n 'user' => $user,\n 'posts' => $posts,\n 'post_count' => count($posts),\n 'categories' => $categories\n ];\n\n // post delete\n if ($del_post_id !== null) {\n\n // get post\n $post = $this->postModel->searchPostByPostId($del_post_id);\n \n // if post exists and user is author\n if (!empty($post) && $_SESSION['user_id'] === $post->post_user_id) {\n\n // save post image paths to variables\n $post_image = \"img/posts/\".$post->post_image;\n $post_image_thumb = \"img/posts/thumb_\".$post->post_image;\n\n // if deletion was successful\n if ($this->postModel->deletePost($del_post_id)) {\n\n // remove post image from server\n unlink($post_image);\n unlink($post_image_thumb);\n // invoke session helper flash function\n flash('posts_alert', 'The post has been successfully deleted.');\n // if successfull load posts/add\n header(\"Location: \" . URLROOT . \"/users/posts/\" . $id);\n\n // redirect display error\n } else {\n // invoke session helper flash function\n flash('posts_alert', 'Something went wrong. Please try again.', 'alert alert-danger');\n // if successfull load posts/add\n header(\"Location: \" . URLROOT . \"/users/posts/\" . $id);\n }\n\n // load init view\n } else {\n $this->view('users/posts', $data);\n }\n\n // load init view\n } else {\n $this->view('users/posts', $data);\n }\n }\n }", "public function edit($post){\n $data['name'] = $post['name_nm'];\n $data['username'] = $post['username_nm'];\n // jika tidak kosong post password\n if(!empty($post['password_nm'])){\n $data['password'] = sha1($post['password_nm']);\n }\n // $data['id_number'] = $post['idnumber_nm'] != \"\" ? $post['idnumber_nm'] : null;\n $data['id_number'] = $post['idnumber_nm'];\n $data['level'] = $post['level_nm'];\n \n\n $this->db->where('id_user', $post['iduser_nm']);\n $this->db->update('users', $data);\n }", "function getPosts()\n{\n global $connect;\n $per_page = 10;\n \n if(isset($_GET['page'])){\n $page = $_GET['page'];\n \n }\n else{\n $page = 1;\n \n }\n $start_from = ($page - 1) * $per_page; \n \n $get_posts =\"select * from posts ORDER by 1 DESC LIMIT $start_from, $per_page\";\n $run_posts = mysqli_query($connect, $get_posts);\n \n \n \n \n while ($row_posts = mysqli_fetch_array($run_posts)) {\n \n \n $post_id = $row_posts['post_id'];\n $user_id = $row_posts['user_id'];\n $post_title = $row_posts['post_title'];\n $content = $row_posts['post_content'];\n $post_date = $row_posts['post_date'];\n $likes = $row_posts['likes'];\n \n \n //getting the user that posted it\n \n $user = \"select * from users where user_id = '$user_id'\";\n $run_user = mysqli_query($connect, $user);\n $row_user = mysqli_fetch_array($run_user);\n $user_name = $row_user['name'];\n $user_image =$row_user['user_image'];\n \n //displaying all posts\n \n echo \"<div class='row' style='margin-top:36px; margin-left:5px;'>\n <div class='col-xs-5'><img class='rounded-circle' height='50' width='50' src='assets/img/$user_image' style='margin-left:15px; margin-bottom:18px;'></div>\n <div class='col-xs-5' style='margin-left:15px;margin-top:8px;'>\n <h5 class='text-left' style='font-size:16px; text-transform: capitalize;'><a href='user_profile.php?user_id=$user_id'>$user_name</a></h5>\n <p class='text-left' style='color:#b2b2b2;margin-top:-5px; margin-left:-1px;'><i class='fa fa-clock-o' style='font-size:15px;'></i> $post_date</p>\n </div>\n <div class='col-lg-12' style='margin-top:-13px;'>\n <div style='background-color:#ffffff;'>\n <h4 style = 'color:black; font-size:16px;text-transform: capitalize; padding:3px; '> $post_title</h4>\n <p class = 'text-left' style ='font-size:14px; margin-left:30px; padding-bottom:20px; margin-bottom:10px;padding-right:10px; margin-right:5px;' > $content </p>\n </div> \n <div class='btn-group float-right' role='group' style='height:37px;margin-top:-2px;'>\n <a class='btn btn-dark btn-sm' href='single.php?post_id=$post_id'>Comment<i class='fa fa-comments-o' style='margin-left:5px;margin-top:3px;'></i></a>\n </div>\n </div>\n </div> \"; \n }\n include 'pagination.php';\n \n }", "public function editBliziSeFunction($user){\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\n if(isset($_POST[\"POST_type\"])){\n if( $_POST[\"POST_type\"] == \"editBliziSe\" ){\n $year = substr($_POST[\"id\"], 1, 4);\n $template = $_POST['template'];\n $path = \"./user/pages/databaze/\". $year .\"/\". $template .\"/\". $_POST[\"id\"] . \"/\".$template.\".cs.md\";\n $parsed_file = $this->parse_file($path); //rozparsuje existujici soubor\n\n if(isset($_POST[\"regenerate\"])){\n if($_POST[\"regenerate\"]){\n $parsed_file[\"Content\"] = $this->generate_content($parsed_file);\n } \n }\n else{\n $parsed_file[\"Content\"] = $_POST[\"content\"];\n }\n\n $this->array_to_file($parsed_file, $template, $path);\n Cache::clearCache('all');\n //echo\"<script type='text/javascript'>window.location.replace(location.href);</script>\";\n }\n }\n }\n }", "function get_Post(){\n $postAdmin=new ced\\stream\\model\\PostAdminManager;\n /* get post */\n $post = $postAdmin->getPosts($_GET['id']);\n /* rules */\n if ($post == false) {\n throw new Exception('Ce n\\'est pas la bonne page');\n }\n else {\n require('view/frontend/modifpost.php');\n } \n }", "public function editPost()\n {\n $session = new PHPSession();\n\t\tif ($session->get('admin') == NULL || !$session->get('admin')) {\n return $this->redirect(parent::ERROR_403_PATH);\n }\n $postManager = new PostManager('Post');\n $post = $postManager->getBySlug($_GET['slug']);\n\n $handlerPicture = new HandlerPicture();\n $picture = $handlerPicture->searchPicture($post->getDatePublication());\n\n $uuid = Uuid::uuid4();\n $uuid = $uuid->toString();\n $session->set('token', $uuid);\n\n return $this->render('admin/editPost.html.twig', [\n 'post' => $post,\n 'picture' => $picture\n ]);\n }", "public function posts_user_get() {\n if (!$this->get(\"id\")) {\n $this->response(NULL, 400);\n }\n $this->load->model(\"api_model\");\n $posts = $this->api_model->posts($this->get(\"id\"));\n if ($posts) {\n $this->response($posts, 200);\n } else {\n $this->response(NULL, 400);\n }\n }", "function get_posts()\n\t\t{\n\t\t\tglobal $con;\n\t\t\t\n\t\t\t$per_page=5;\n\t\t\tif(isset($_GET['page']))\n\t\t\t{\n\t\t\t\t$page = $_GET['page'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$page=1;\n\t\t\t}\n\t\t\t$start_from = ($page-1) * $per_page;\n\t\t\t\n\t\t\t$get_posts = \"select * from posts ORDER by 1 DESC LIMIT $start_from , $per_page\";\n\t\t\t\n\t\t\t$run_posts = mysqli_query($con,$get_posts);\n\t\t\t\n\t\t\twhile ($row_posts = mysqli_fetch_array($run_posts)){\n\t\t\t\t$post_id = $row_posts['post_id'];\n\t\t\t\t$user_id = $row_posts['user_id'];\n\t\t\t\t$post_title = $row_posts['post_title'];\n\t\t\t\t$content = $row_posts['post_content'];\n\t\t\t\t$post_date = $row_posts['post_date'];\n\t\t\t\t\n\t\t\t\t//getting the users who has posted the posts\n\t\t\t\t\n\t\t\t\t$user = \"select * from users where user_id = '$user_id' AND posts='yes'\";\n\t\t\t\t$run_user = mysqli_query($con,$user);\n\t\t\t\t$row_user = mysqli_fetch_array($run_user);\n\t\t\t\t$user_name = $row_user['user_name'];\n\t\t\t\t$user_image = $row_user['user_image'];\n\t\t\t\t\n\t\t\t\t//displaying all at once\n\t\t\t\techo \" <div id='posts'>\n\t\t\t\t\t\t<p><img src ='user/user_image/$user_image' width='50'height='50'></img></p>\n\t\t\t\t\t\t<h3><a href='user_profile.php?u_id=$user_id' style='text-decoration:none;'>$user_name</a></h3>\n\t\t\t\t\t\t<h3>$post_title</h3>\n\t\t\t\t\t\t<p>$post_date</p>\n\t\t\t\t\t\t<p>$content</p>\t\n\t\t\t\t\t\t<a href='single.php?post_id=$post_id' style='float:right'><button>See Replies or Reply to this</button></a>\n\t\t\t\t </div><br/>\n\t\t\t\t\t \";\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\tinclude(\"pagination.php\");\n\t\t}", "function edit($post_id) {\n\t\t$this->set('post', $post = $this->getPost($post_id));\n\t\tif (empty($post)) {\n\t\t\t$this->set('message', \"That post doesn't exist to edit.\");\n\t\t\treturn;\n\t\t}\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\t\t\tforeach (array('title', 'body') as $field) {\n\t\t\t\tif (empty($_POST[$field])) {\n\t\t\t\t\t$this->set('message', \"You need to fill in the {$field} field!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($this->admin_pw != $_POST['password']) {\n\t\t\t\t$this->set('message', \"That's definitely not the right password.\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$this->redis->set(\"post:{$post_id}:title\", trim($_POST['title']));\n\t\t\t$this->redis->set(\"post:{$post_id}:body\", trim($_POST['body']));\n\t\t\theader(\"Location: index.php?/post/{$post_id}\");\n\t\t}\n\t}", "function edit_perfil_form($id) {\n\t\t\tglobal $tabla_usuarios;\n\t\t\t$id_usuario = get_cookie_id_user();\n\t\t\t$usuario = run_select_query(\"SELECT * FROM $tabla_usuarios WHERE id = '$id_usuario'\");\n\t\t\t//echo \"SELECT * FROM $tabla_usuarios WHERE id = '$id'\";\n\t\t//\techo \"SELECT * FROM usuarios WHERE id = '$id'\";\n\t\t\t$nombre = $usuario[0]['nombre'];\n\t\t\t$iniciales = $usuario[0]['iniciales'];\n\t\t\t$correo = $usuario[0]['correo'];\n\t\t\t$foto = $usuario[0]['foto'];\n\t\t\t$password = $usuario[0]['password'];\n\t\t\t$nivel = $usuario[0]['nivel'];\n\t\t\t$oficina = $usuario[0]['oficina'];\n\t\t\t$extension = $usuario[0]['extension'];\n\t\t\t$telefono = $usuario[0]['telefono'];\n\t\t\t$celular = $usuario[0]['celular'];\n\t\t\t$direccion = $usuario[0]['direccion'];\n\t\t\t$cumple = $usuario[0]['cumple'];\n\t\t\t$correo = $usuario[0]['correo'];\n\t\t\t$id_funcionario = $usuario[0]['id_funcionario'];\n\t\t\t\n\t\t\t$query_nombre = run_select_query(\"SELECT nombre FROM usuarios WHERE id = '$id_usuario'\");\n\t\t\t$nombre_titular = $query_nombre [0]['nombre'];\n\t\t\t$resultado_titular = \"<option value = '$id_usuario' selected='selected'>$nombre_titular</option>\";\n\t\t\t\n\t\t\t\n\t\t\t$query_titulares = run_select_query(\"SELECT id, nombre FROM usuarios WHERE id_padre = 0\");\n\t\t\tforeach ($query_titulares as $key=> $value) {\n\t\t\t\t\n\t\t\t\t$id = $query_titulares[$key]['id'];\n\t\t\t\t$nombres =$query_titulares[$key]['nombre'];\n\t\t\t\t$select_usuarios.=\"<option value = '$id'>$nombres</option>\";\n\t\t\t\t} \n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t?>\n\t\n\t\t\t\n\t<fieldset class=\"adminform\">\n\t\t\t\n\t\t\t<legend>Editar perfil<a href='index.php?mi_perfil&busca=&page=<?php echo $page ?>' title='Back'><img src=\"images/j_arrow_left.png\" border=\"0\" /></a></legend>\n\t \n\t\t\t\t\t\n\t\t\t<form action=\"index.php\" name=\"form_edit_perfil\" method=\"post\" enctype=\"multipart/form-data\">\n\t\t\t<table class=\"adminform\">\n\t\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<th width=\"108\" class='title'>\n\t\t\t\t\t\tNombre: </th>\n\t\t\t\t\t<td width=\"263\">\t\n\t\t\t\t\t\t<input type=\"text\" name=\"nombre\" value=\"<?php echo $nombre ?>\" id=\"nombre\" />\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<th class='title'>\n\t\t\t\t\t\tIniciales: </th>\n\t\t\t\t\t<td>\t\n\t\t\t\t\t\t<input type=\"text\" name=\"iniciales\" value=\"<?php echo $iniciales?>\" id=\"iniciales\" />\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<th class='title'>Correo: </th>\n\t\t\t\t\t<td>\t\n\t\t\t\t\t\t<input type=\"text\" name=\"correo\" value=\"<?php echo $correo?>\" id=\"correo\" />\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<th class='title'>Foto: </th>\n\t\t\t\t\t<td><input type=\"file\" name=\"archivo\" value=\"\" id=\"archivo\" /><?php echo $foto?></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<th class='title'>Contraseña: </th>\n\t\t\t\t\t<td><input type=\"text\" name=\"password\" value=\"\" id=\"password\" /></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<th class='title'>Oficina: </th>\n\t\t\t\t\t<td><input type=\"text\" name=\"oficina\" value=\"<?php echo $oficina?>\" id=\"oficina\" /></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<th class='title'>Extensión: </th>\n\t\t\t\t\t<td><input type=\"text\" name=\"extension\" value=\"<?php echo $extension?>\" id=\"extension\" /></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<th class='title'>Teléfono: </th>\n\t\t\t\t\t<td><input type=\"text\" name=\"telefono\" value=\"<?php echo $telefono?>\" id=\"telefono\" /></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<th class='title'>Celular: </th>\n\t\t\t\t\t<td><input type=\"text\" name=\"celular\" value=\"<?php echo $celular?>\" id=\"celular\" /></td>\n\t\t\t\t</tr>\n\t\t\t\t <tr>\n\t\t\t\t\t<th class='title'>Dirección:</th>\n\t\t\t\t\t<td><textarea name=\"direccion\"><?php echo $direccion?></textarea></td>\n\t\t\t\t</tr>\n\t\t\t\t <tr>\n\t\t\t\t\t<th class='title'>Cumpleaños:</th>\n\t\t\t\t\t<td>\n <input type=\"text\" name=\"cumple\" value=\"<?php echo $cumple?>\" id=\"cumple\" />\t\t\t\t <script language=\"JavaScript\">\n\tnew tcal ({\n\t\t// form name\n\t\t'formname': 'form_edit_perfil',\n\t\t// input name\n\t\t'controlname': 'cumple'\n\t});\n\t</script>\n \t</tr> \n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan='2' class='center'>\n\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"<?php echo $id_usuario; ?>\" id=\"id\" />\n\t\t\t\t\t\t<input class=\"button\" type=\"submit\" name=\"do_edit_perfil\" value=\"Editar\" id=\"btn_edit_usuario\" />\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t</form>\n\t</fieldset>\n\t\t\n<?php\n\t\t}" ]
[ "0.7238764", "0.7047872", "0.6611277", "0.6462847", "0.63003457", "0.626627", "0.6252542", "0.62404585", "0.62365615", "0.62167966", "0.61957747", "0.6164793", "0.6141639", "0.6116285", "0.6087994", "0.60244024", "0.5973939", "0.59674907", "0.5962655", "0.59037215", "0.58693844", "0.58548695", "0.58436775", "0.5842994", "0.5814968", "0.5769997", "0.57638675", "0.5760831", "0.57496446", "0.57449794" ]
0.7266818
0
Esta funcion carga los comentarios del Blog
function cargarComentariosBlog(){ echo ("<script type='text/javascript' src='JSCRIPT/usuario.js'></script>"); $idP=$_GET["idPost"]; try{ $comentarios = "SELECT id_comentario,nickname,comentario,fecha FROM comentarios WHERE id_post=$idP"; $sentenciaC =conexion()->query($comentarios); $sentenciaC->setFetchMode(PDO::FETCH_ASSOC); }catch(PDOException $pe){ die("Error occurred:" . $pe->getMessage()); } $sentenciaC->execute(); $resultadoC = $sentenciaC->fetchAll(); foreach($resultadoC as $posicionC => $filaC){ ?> <div> <p class="usuario"> <?php echo $filaC['nickname']?></p> <p class="contenido"><?php echo $filaC['comentario']?></p> <p class="fechaComentario"> <?php echo $filaC['fecha']?></p> <?php $user = $filaC['nickname']; //Un usuario solo puede eliminar sus comentarios en cambio el moderador podra eliminar todos if(isset($_SESSION["usuarioLogeado"])){ if($_SESSION["usuarioLogeado"]==$user || $_SESSION["tipo"]=='mod'){ ?> <a class="btnElimCom" href="paginaPost.php?idPost=<?php echo $_GET['idPost'];?>&idC=<?php echo $filaC['id_comentario'] ?>&tipo=eliminarComentario"><span class="icon-trash"></span></a> <?php } } ?> </div> <?php } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function GetProdutos(){\n $query = \"SELECT * FROM {$this->prefix}produtos p \n INNER JOIN {$this->prefix}categorias c ON p.pro_categoria = c.cate_id\";\n \n $query .= \" ORDER BY pro_id DESC\";\n \n $query .= $this->PaginacaoLinks(\"pro_id\", $this->prefix.\"produtos\");\n\n\n\n $this->ExecuteSQL($query);\n \n $this->GetLista();\n \n }", "public function listarcomunidades() {\n\n // Carga Modelos\n $this->load->model('Comunidad_model');\n\n // Ejecucion funciones modelos\n $data['posts'] = $this->Comunidad_model->get_comunidades();\n\n // Vista\n $this->load->view('posts/listarposts', $data);\n }", "public static function listaPortadaBlog(){\r\n $conecta=self::conectar();\r\n $consulta = \"SELECT * FROM blogs ORDER BY fecha DESC , hora DESC\";\r\n $resultado = $conecta->prepare($consulta);\r\n try{\r\n $resultado ->execute();\r\n $registros = $resultado->fetchAll();\r\n $jsonstring = json_encode($registros);\r\n return $registros;\r\n }catch (Exception $e){ // Capturamos el error si se produce\r\n $mensaje = $e->getMessage();\r\n die(\"No se ha podido encontrar Entradas: \" . $e->getMessage()); \r\n }\r\n\r\n}", "function GetProdutos(){\n \t\n\t\t $query = \"SELECT * FROM {$this->prefix}produtos p INNER JOIN {$this->prefix}categorias c ON p.pro_categoria = c.cate_id\";\n\n\t\n\t\t $query .= \" ORDER BY pro_id DESC\";\n \n\t\t $query .= $this->PaginacaoLinks(\"pro_id\", $this->prefix.\"produtos\");\n \n\t\t \n\t\t $this->ExecuteSQL($query);\n \n\t\t $this->GetLista();\n\t\t \n\t }", "function GetProdutos(){\n\t\t$query = \"SELECT * FROM {$this->prefix}produtos p INNER JOIN {$this->prefix}categorias c ON p.pro_categoria = c.cate_id\";\n\n\t\n\t\t$query .= \" ORDER BY pro_id DESC\";\n\n\t\t$query .= $this->PaginacaoLinks(\"pro_id\", $this->prefix.\"produtos\");\n\n\t\t\n\t\t$this->ExecuteSQL($query);\n\n\t\t$this->GetLista();\n\t\t\n\t}", "public function ListarComentarios(){\n try{ \n $commd = $this->DB->prepare(\"SELECT * FROM comentarios\");\n $commd->execute();\n return $commd->fetchAll(PDO::FETCH_OBJ);\n }catch(Throwable $t){\n die($t->getMessage());\n }\n }", "function getAllConteudo() {\r\n /* /// Status do Conteudo\r\n * 0 - pendente\r\n * 1 - publicado\r\n * 2 - rascunho\r\n * 3 - backup\r\n */\r\n\r\n $this->defaultDB->where('status', '1');\r\n $this->defaultDB->order_by(\"titulo ASC\");\r\n return $this->defaultDB->get(self::TABLE);\r\n }", "protected function dbGetComentario($datos = null){\n\t\t\t$condicion = \"estado = 1\";\n\t\t\t$orden = 'fecha';\n\t\t\t$disp = 'ASC';\n\n\t\t\tif( is_array($datos) ){\n\t\t\t\tif( isset($datos['filtro']) ){\n\t\t\t\t\t$condicion .= \" AND {$datos['filtro']}\";\n\t\t\t\t}\n\t\t\t\t\t//Definimos si se busca el articulo por id\n\t\t\t\tif( isset( $datos['id'] ) ){\n\t\t\t\t\t$datos['id'] = (INT) $datos['id'];\n\t\t\t\t\t$condicion .= \" AND id = '{$datos['id']}'\";\n\t\t\t\t\t//Definimos si se busca el articulo por entrada\n\t\t\t\t}else if( isset( $datos['destino'] ) ){\n\t\t\t\t\t$datos['destino'] = dbConnector::escape( $datos['destino'] );\n\t\t\t\t\t$condicion .= \" AND destino = '{$datos['destino']}'\";\n\t\t\t\t}\n\n\t\t\t\t//Definimos las opciones para la clausula ORDER\n\t\t\t\tif( isset($datos['orden']) ){\n\t\t\t\t\t$orden = dbConnector::escape( $datos['orden'] );\n\t\t\t\t\tif( isset($datos['disp']) )\n\t\t\t\t\t\t$disp = dbConnector::escape( $datos['disp'] );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//Definimos los campos solicitados\n\t\t\tif( !isset($datos['columnas']) ) $datos['columnas'] = array();\n\n\t\t\t$opciones = array(\n\t\t\t\t'tabla' => $this->t_comentarios,\n\t\t\t\t'columnas' => $datos['columnas'],\n\t\t\t\t'filtro' => $condicion,\n\t\t\t\t'orden' => $orden,\n\t\t\t\t'disp' => $disp,\n\t\t\t);\n\n\t\t\t//Establecemos la configuracion para limit\n\t\t\tif( isset($datos['limit']) ){\n\t\t\t\t$opciones['limit'] = (INT) $datos['limit'];\n\t\t\t\tif( isset($datos['offset']) )\n\t\t\t\t\t$opciones['offset'] = (INT) $datos['offset'];\n\t\t\t}\n\n\t\t\t//Establecemos la configuracion para la funcion SQL_CALC_FOUND_ROWS\n\t\t\tif( isset($datos['calcular_filas']) ){\n\t\t\t\tif( is_bool( $datos['calcular_filas'] ) )\n\t\t\t\t\t$opciones['calcular_filas'] = $datos['calcular_filas'];\n\t\t\t}\n\n\t\t\treturn dbConsultas::select($opciones);\n\t\t}", "public function listarcomunidad($id_comunidad) {\n\n // Carga Modelos\n $this->load->model('Comunidad_model');\n\n // Ejecucion funciones modelos\n $data['posts'] = $this->Comunidad_model->get_comunidad();\n\n // Vista\n $this->load->view('posts/listarposts', $data);\n }", "public function getBlog(){\n $sql=\"SELECT * FROM blog\";\n $select=parent::connect_db()->prepare($sql);\n $select->execute();\n if($select->rowCount() > 0):\n return $select->fetchAll(\\PDO::FETCH_ASSOC);\n //return $results;\n else:\n return [];\n endif;\n }", "public function ListComentario($post_id)\n {\n //$comments = Comment::where('post_id', '=', $id)->paginate(10);\n $qry = Comentario::where('post_id', '=' , $post_id)\n ->orderBy('id' ,'desc')\n ->get();\n return $qry;\n\n }", "public function BuscarPagos() {\r\n\r\n $condicion = \"\";\r\n if ($this->TxtNroDocumento->Text != \"\" && is_numeric($this->TxtNroDocumento->Text)) {\r\n $condicion = \" AND NrObligacion = \" . $this->TxtNroDocumento->Text;\r\n }\r\n\r\n if ($this->TxtIdTercero->Text != \"\" && is_numeric($this->TxtIdTercero->Text)) {\r\n $strSql = \"SELECT DATE_FORMAT(FhPago,'%M') AS FhPago, DATE_FORMAT(FhPago,'%m') AS IdRecibo, SUM(TotalPagado) as TotalPagado\r\n FROM recibos\r\n WHERE IdTercero = \" . $this->TxtIdTercero->Text . \" $condicion AND FhPago > '2012-01-01' \r\n GROUP BY DATE_FORMAT(FhPago,_latin1'%M') ORDER BY IdRecibo ASC\";\r\n $this->DGPagos->DataSource = RecibosRecord::finder()->findAllBySql($strSql);\r\n $this->DGPagos->dataBind();\r\n } else {\r\n $this->DGPagos->DataSource = \"\";\r\n $this->DGPagos->dataBind();\r\n }\r\n }", "public function gestionarBlog(){\n //Obtiene la funcion listaPublicaciones del modelo Administrador \n $blog = new Blog();\n $publicaciones = $blog->listaPublicaciones();\n require_once 'vistas/administrador/gestionarBlog.php';\n }", "public function obterTodasCompras(){\n $compra = new CompraDAO();\n return $compra->getAll();\n }", "function busca() {\r\n $this->Post->recursive = 1;\r\n $this->paginate['Post']['order'] = 'Post.created DESC';\r\n $this->paginate['Post']['recursive'] = -1;\r\n $this->paginate['Post']['conditions']['or']['texto like '] = '%' . $this->data['Post']['busca'] . '%';\r\n $this->paginate['Post']['conditions']['or']['titulo like '] = '%' . $this->data['Post']['busca'] . '%';\r\n $this->paginate['Post']['conditions']['tipo not'] = 'NULL';\r\n $this->paginate['Post']['limit'] = 25;\r\n $this->set('dados', $this->paginate('Post'));\r\n }", "function listarPagos($objCon, $pss_id, $bol_id){\n\t\t$sql=\"SELECT\n\t\t\tpagos.cue_id,\n\t\t\tpagos.pss_id,\n\t\t\tboleta.bol_fecha,\n\t\t\tboleta.bol_id,\n\t\t\tboleta.bol_tipo,\n\t\t\tboleta.bol_hora,\n\t\t\tboleta.usu_nombre,\n\t\t\tCONCAT(persona.per_nombre,' ',persona.per_apellidoPaterno,' ',persona.per_apellidoMaterno) AS nombre\n\t\t\tFROM\n\t\t\tboleta\n\t\t\tINNER JOIN pagos ON pagos.pag_id = boleta.pag_id\n\t\t\tINNER JOIN usuario ON usuario.usu_nombre = boleta.usu_nombre\n\t\t\tINNER JOIN persona ON usuario.per_id = persona.per_id\";\n\t\t\tif(empty($bol_id)==false){\n\t\t\t\t$sql.=\" WHERE boleta.bol_id = '$bol_id'\";\n\t\t\t}else{\n\t\t\t\tif(empty($pss_id)==false){\n\t\t\t\t\t$sql.=\" WHERE boleta.pss_id = '$pss_id'\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t//echo $sql;\n\t\t\t$datos = array();\n\t\t\t$i=0;\n\t\t\tforeach ($objCon->consultaSQL($sql, 'ERROR listarPagosPSS') as $v) {\n\t\t\t\t$datos[$i][cue_id]=$v['cue_id'];\n\t\t\t\t$datos[$i][pss_id]=$v['pss_id'];\n\t\t\t\t$datos[$i][bol_fecha]=$v['bol_fecha'];\n\t\t\t\t$datos[$i][bol_id]=$v['bol_id'];\n\t\t\t\t$datos[$i][bol_hora]=$v['bol_hora'];\n\t\t\t\t$datos[$i][bol_tipo]=$v['bol_tipo'];\n\t\t\t\t$datos[$i][usu_nombre]=$v['usu_nombre'];\n\t\t\t\t$datos[$i][nombre]=$v['nombre'];\n\t\t\t\t$i++;\n\t\t }\n\t\treturn $datos;\n\t}", "function carrega_feeds_usuario(){\n\n// globals\nglobal $idioma;\n\n// tabelas\n$tabela[0] = TABELA_SEGUIDORES;\n$tabela[1] = TABELA_PRODUTO;\n\n// campos de tabela\n$campos_tabela[1] = TABELA_SEGUIDORES.\".idusuario\";\n$campos_tabela[2] = TABELA_PRODUTO.\".idusuario\";\n$campos_tabela[3] = TABELA_PRODUTO.\".id\";\n$campos_tabela[4] = TABELA_SEGUIDORES.\".idamigo\";\n\n// idusuario logado\n$idusuario = retorne_idusuario_logado();\n\n// limite de query\n$limite_query = limit_query();\n\n// query\n$query = \"select distinct *from $tabela[1] inner join $tabela[0] on $campos_tabela[2]=$campos_tabela[1] and $campos_tabela[4]='$idusuario' order by $campos_tabela[3] desc $limite_query;\";\n\n// comando\n$comando = comando_executa($query);\n\n// contador\n$contador = 0;\n\n// numero de linhas\n$numero_linhas = retorne_numero_linhas_comando($comando);\n\n// constroe produtos\nfor($contador == $contador; $contador <= $numero_linhas; $contador++){\n\n// dados\n$dados = mysql_fetch_array($comando, MYSQL_ASSOC);\n\n// codigo html\n$codigo_html .= constroe_produto($dados);\n\n};\n\n// retorno\nreturn $codigo_html;\n\n}", "function obtener_cursos($idCarrera){\n\t$client = new Client();\n\t\n\t$URL_CURSOS = \"http://www1.bedelias.edu.uy/ingenieria/muestra_prev.obt_carrcic?car=$idCarrera\";\n \n\t//Formulario con las materias\n\t$crawler = $client->request('GET', \"$URL_CURSOS\");\n\n\t//Obtengo todas las opciones del campo select y almaceno en la bd codigo y nombre\n\n\t$opciones = $crawler->filter('option')->each(function ($node, $index) use($idCarrera) {\n\t\t\n\t\tif($index == 0)\n\t\t\treturn;\n\t\t\n\t\t$datos_curso = explode(\" - \",$node->html());\n\t\t$id_curso = trim($datos_curso[0]);\n\t\t$nombre_curso = trim($datos_curso[1]);\n\t\t\t\n\t\t$nombre_curso_utf8 = utf8_decode ( $nombre_curso );\n\t\t\t\n\t\t//Almaceno el curso en la base de datos\n\t\ttry {\n\t\t\tguardar_curso($idCarrera, $id_curso, $nombre_curso_utf8 );\n\t\t}catch (Exception $e){\n\t\t\techo $e->getMessage();\n\t\t}\n\t});\n\n}", "function getAll()\r\n {\r\n $query=\"SELECT o.*,r.re_dominio FROM meoa o JOIN merepo r ON (o.re_id = r.re_id) ORDER BY oa_fec DESC\";\r\n \r\n $result = $this->strSql($query);\r\n $indice=0;\r\n $this->arregloOARepo=array();\r\n while (!$this->esUltimo($result))\r\n {\t\t\r\n $this->arregloOARepo[$indice]=$this->setArregloOARepo($result);\r\n $result->MoveNext();\r\n $indice++;\r\n }\r\n }", "public function blog() {\n $blog = new Blog();\n $publicaciones = $blog->listaPublicaciones2();\n $seccion = $blog->listaPublicaciones();\n require_once 'vistas/blog/index.php';\n }", "public function obtenerCargos() {\n\t\n\t\t$q = Doctrine_Query::create()\n\t \t\t->select(\"tc.descripcion as descripcion, tc.idtipocargo as idtipocargo, ac.idtipoarea\")\n\t \t\t->from(\"AreasCargos ac\")\n\t \t\t->innerjoin(\"ac.TiposCargos tc ON ac.idtipocargo=tc.idtipocargo\")\n\t \t->where(\"ac.idtipoarea =\".$this->getIdtipoarea())\n\t \t->orderBy(\"tc.descripcion ASC\");\n\t \t\n\t\treturn $q->execute();\n }", "function listarCobro(){\n\t\t$this->procedimiento='cobra.f_tcb_cobro_sel';\n\t\t$this->transaccion='CB_COBRO_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_cobro','int4');\n\t\t$this->captura('id_cajero','int4');\n\t\t$this->captura('id_cliente','int4');\n\t\t$this->captura('cant_facturas','int4');\n\t\t$this->captura('importe_cobro','numeric');\n\t\t$this->captura('importe_recibido','numeric');\n\t\t$this->captura('importe_cambio','numeric');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function listarComisionistas(){\n\t\t$this->procedimiento='conta.ft_comisionistas_sel';\n\t\t$this->transaccion='CONTA_CMS_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\n $this->capturaCount('total_monto_total','numeric');\n $this->capturaCount('total_monto_total_comision','numeric');\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_comisionista','int4');\n\t\t$this->captura('nit_comisionista','varchar');\n\t\t$this->captura('nro_contrato','varchar');\n\t\t$this->captura('codigo_producto','varchar');\n\t\t$this->captura('descripcion_producto','varchar');\n $this->captura('cantidad_total_entregado','numeric');\n $this->captura('cantidad_total_vendido','numeric');\n $this->captura('precio_unitario','numeric');\n $this->captura('monto_total','numeric');\n $this->captura('monto_total_comision','numeric');\n $this->captura('revisado','varchar');\n $this->captura('id_periodo','int4');\n $this->captura('id_depto_conta','int4');\n $this->captura('registro','varchar');\n $this->captura('tipo_comisionista','varchar');\n $this->captura('lista_negra','varchar');\n $this->captura('gestion','int4');\n $this->captura('usr_reg','varchar');\n $this->captura('usr_mod','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('nombre_agencia','varchar');\n\t\t$this->captura('nro_boleto','varchar');\n\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 listarBoletaPagos($objCon, $pss_id, $bol_id, $pag_id){\n\t\t$sql=\"SELECT \";\n\t\t\t\n\t\t\t$datos = array();\n\t\t\t$i=0;\n\t\t\tforeach ($objCon->consultaSQL($sql, 'ERROR listarBoletaPagos') as $v) {\n\t\t\t\t$datos[$i][cue_id]=$v['cue_id'];\n\t\t\t\t$i++;\n\t\t }\n\t\treturn $datos;\n\t}", "function recibirPosts(){\n try{\n $consulta = 'SELECT * FROM posts,usuarios where posts.nickname=usuarios.nickname';\n $texto = null;\n if(isset($_GET['palabra'])){\n //Si hay una busqueda, cambiamos la consulta\n $texto = $_GET['palabra'];\n $consulta = 'SELECT * FROM posts WHERE titulo LIKE :titulo or contenido LIKE :contenido or nickname LIKE :nickname';\n } \n //Preparamos la sentencia e indicar que vamos a usar un cursor\n $sentencia = conexion()->prepare($consulta);\n $sentencia->setFetchMode(PDO::FETCH_ASSOC);\n }catch(PDOException $pe){\n die(\"Error occurred:\" . $pe->getMessage());\n }\n $sentencia->execute(\n array(\n ':titulo' => \"%$texto%\",\n ':contenido' => \"%$texto%\",\n ':nickname' => \"%$texto%\"\n )\n );\n //Imprimo los resultados\n $resultado = $sentencia->fetchAll();\n return $resultado;\n}", "function getBlogComments($blogid=0, $isOwner=false, $pageid=1, $list_num=5){\n\t\t$arrResult\t=\tarray();\n\t\t//$StoreID\t=\t$_REQUEST['StoreID'] ? $_REQUEST['StoreID'] : ($_SESSION['StoreID'] ? $_SESSION['StoreID']:'');\n\n\t\t$table = $this->table . \"blog_comment\" ;\n\t\tif ($_SESSION['level'] == 1 and $isOwner){\n\t\t\t$query\t=\t\"select * from $table where blog_id = $blogid order by post_date DESC limit \" . ($pageid-1)*$list_num . \", $list_num\";\n\t\t}else{\n\t\t\t$query\t=\t\"select * from $table where blog_id = $blogid and approved = 1 order by post_date DESC limit \" . ($pageid-1)*$list_num . \", $list_num\";\n\t\t}\n\n\t\t$this -> dbcon -> execute_query($query);\n\t\t$arrTemp = $this -> dbcon -> fetch_records(true);\n\n\t\tif(is_array($arrTemp)){\n\t\t\t$curr_num = 0;\n\t\t\tforeach ($arrTemp as $blogitem){\n\t\t\t\t$content = stripcslashes($blogitem['content']);\n\t\t\t\t$content = str_replace(\"\\n\", '<br />', $content);\n\t\t\t\t$blogitem['content'] = html_entity_decode($content);\n\t\t\t\t$blogitem['post_date'] = date('m-d-Y H:i:s', $blogitem['post_date']).' (ET)';\n\t\t\t\t$blogitem['reply_date'] = date('m-d-Y H:i:s', $blogitem['reply_date']).' (ET)';\n\n\t\t\t\t$reply = stripcslashes($blogitem['reply']);\n\t\t\t\t$reply = str_replace(\"\\n\", '<br />', $reply);\n\t\t\t\t$blogitem['reply'] = html_entity_decode($reply);\n\n\t\t\t\t$StoreID = $blogitem['StoreID'] ? $blogitem['StoreID']:'';\n\t\t\t\t$query\t=\t\"select bu_nickname, bu_name, bu_suburb from \".$this->table.\"bu_detail where StoreID = $StoreID limit 1\";\n\t\t\t\t$this -> dbcon -> execute_query($query);\n\t\t\t\t$arrTemp1 = $this -> dbcon -> fetch_records(true);\n\t\t\t\t//print_r($arrTemp1);\n\n\t\t\t\tif(is_array($arrTemp1)){\n\t\t\t\t\t$UserName\t=\t$arrTemp1[0]['bu_nickname'] ? $arrTemp1[0]['bu_nickname'] : ($arrTemp1[0]['bu_name'] ? $arrTemp1[0]['bu_name']:'');\n\t\t\t\t\t$location \t=\t$arrTemp1[0]['bu_suburb'] ? $arrTemp1[0]['bu_suburb']:'';\n\t\t\t\t}\n\n\t\t\t\t$blogitem['username'] = $UserName;\n\t\t\t\t$blogitem['location'] = $location;\n\t\t\t\t$arrResult[] = $blogitem;\n\t\t\t\t$curr_num++;\n\t\t\t\tif ($list_num>0 && $list_num <= $curr_num){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $arrResult;\n\t}", "public function recontabilizar_documentos_compras()\n {\n $fecha_desde = Input::get('fecha_desde');//'2019-10-28';\n $fecha_hasta = Input::get('fecha_hasta');//'2019-10-28';\n\n if ( is_null( $fecha_desde ) || is_null( $fecha_hasta) )\n {\n echo 'Se deben enviar las fechas como parámetros en la url. <br> Ejemplo: <br> recontabilizar_documentos_compras?fecha_desde=2019-10-28&fecha_hasta=2019-10-28';\n dd('Operación cancelada.');\n }\n\n // Obtener TODOS los documentos entre las fechas indicadas\n $documentos = ComprasDocEncabezado::where('estado','<>','Anulado')\n ->whereIn('core_tipo_transaccion_id', [25, 29] ) // Factura y Doc. Equivalente\n ->whereBetween( 'fecha', [ $fecha_desde, $fecha_hasta] )\n ->get();\n\n $i = 1;\n foreach ($documentos as $un_documento)\n {\n ProcesoController::recontabilizar_documento( $un_documento->id );\n echo $i.' ';\n $i++; \n }\n\n echo '<br>Se Recontabilizaron '.($i-1).' documentos de compras con sus repectivas entradas de almacén.';\n }", "function listBlog($blog) {\t\t\n\t\t$this->opendb();\n\t\t$sql = 'SELECT BLOG_ID AS ID,TITLE,SEGMENT,PUBLISH_DTTM,STATUS,CONTENT_PATH FROM BLOG WHERE STATUS!=\"R\" AND CONTENT_TYPE=:CONTENT_TYPE ORDER BY DATETIME(PUBLISH_DTTM) DESC';\n\t\t$stmt = $this->prepare($sql);\n\t\t$stmt->bindValue(':CONTENT_TYPE', $blog['CONTENT_TYPE'], SQLITE3_TEXT);\n\t\t$result = $stmt->execute();\t\t\n\n\t\t$arr = array();\n\t\twhile($row = $result->fetchArray(SQLITE3_ASSOC) ) {\n\t\t\tarray_push($arr, $row);\n\t\t}\n\t\treturn $arr;\n\t}", "public function readAllPosts(){\n $db = $this->dbConnect();\n $req = $db->query('SELECT id, title, content, DATE_FORMAT(creation_date, \\'%d/%m/%Y à %Hh%imin%ss\\') AS creation_date_fr FROM posts ORDER BY creation_date DESC');\n\n // creer un tableau de posts vide qui sera remplie dans la boucle, ce tableau contiendra des objets post.\n $posts=[];\n $result = $req->fetchAll();\n foreach ($result as $row) { // je parcours toutes mes lignes de ma base de données.\n // $row['id'] contient un id.\n\n $post = new Post(); // j'instancie post, je crée un objet de ma class post.\n\n $post->create($row['id'], $row['title'], $row['content'], $row['creation_date_fr']);\n\n $posts[] = $post; // je stock mon objet dans mon tableau d'objet\n }\n\n return $posts; // retourne le tableau.\n }", "public function getContactos(){\n\t\t$cont = $this->_db->query(\"SELECT distinct c.id, c.nombre, c.telefono, c.encuesta, c.rut, c.comuna, c.region, c.codigo, c.dato1, c.dato2, c.dato3, c.dato4, c.dato5, c.dato6, c.dato7, c.dato8, c.dato9, c.dato10, c.dato11, c.fecha1, c.fecha2, c.fecha3, c.telefono2, c.telefono3, c.telefono4, c.telefono5, c.telefono6, c.telefono7, c.telefono8, c.telefono9, c.telefono10, c.created_at as creado, c.num_carga, c.estado_contacto, ec.nombre as e_contacto, c.estado_llamada, c.modified_at as modificado, ell.nombre as llamada, e.nombre as nom_encuesta, car.usuario_id, u.nombre as usuario FROM contactos c INNER JOIN estado_llamadas ell ON c.estado_llamada = ell.id INNER JOIN encuestas e ON c.encuesta = e.id LEFT JOIN cargas car ON c.num_carga = car.id INNER JOIN usuarios u ON car.usuario_id = u.id INNER JOIN estado_contactos ec ON c.estado_contacto = ec.id\");\n\n\t\treturn $cont->fetchall();\n\t}" ]
[ "0.6332935", "0.6259112", "0.6252567", "0.624179", "0.62218326", "0.61966175", "0.6136591", "0.6092177", "0.6030664", "0.6007877", "0.59563506", "0.5951077", "0.59408337", "0.5940632", "0.58936405", "0.58761966", "0.58363783", "0.5827194", "0.58251166", "0.58203477", "0.5760228", "0.57564676", "0.574655", "0.5740583", "0.5722739", "0.5716006", "0.5713699", "0.57110476", "0.56999135", "0.567892" ]
0.6578552
0
to get product details by assoc_id
public function getProductDetails($assoc_id='',$sku=''){ $categoryFactory = $this->_categoryFactory->create(); // $assoc_id = 2267; if($assoc_id!=0){ $key = $this->config->getValue('service_config/general/naylor_jwt_key'); if($key == ''){ $key = "DontAsk"; } $jwt=$this->jwt; $exp = strtotime('+1 year'); $payload = array("sub"=>"magentoAPI","auth"=>"ROLE_USER","iat"=>time(),"exp"=>$exp); $token = $jwt->encode($payload, $key, $algo = 'HS256'); $url = $this->config->getValue('service_config/general/naylor_url'); if($url == ''){ $url="http://test.tvmbgigtzm.us-east-1.elasticbeanstalk.com/api/products?association.assocId/".$assoc_id; } else { // api/associations/active-feature-codes/${association_id} $url = $url."/api/products?status=ACTIVE&association.assocId=".$assoc_id; } $authorization = "Authorization: Bearer $token"; $ch = curl_init(); $request_headers = array(); $request_headers[] = $authorization; $request_headers[] = 'Content-Type: application/json'; curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_HTTPHEADER, $request_headers); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);// curl_setopt($ch, CURLOPT_POSTFIELDS,$post); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $result = curl_exec($ch); curl_close($ch); $data = json_decode($result); //print_r($data); //die(); $dtt['cc'] = 0; $dtt['am'] = 0; foreach($data as $dt){ if($dt->productType == 'CAREERS'){ $dtt['cc'] = 1; } if($dt->productType == 'AMS'){ $dtt['am'] = 1; } } return $dtt; } else { $dtt['cc'] = 0; $dtt['am'] = 0; return $dtt; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProductInfoDetail($id){\n \t$db=$this->getAdapter();\n \t$sql = \"SELECT p.pro_id,p.cate_id,p.stock_type,p.item_name,p.item_code,p.price_per_qty,p.brand_id,\n \tp.photo,p.is_avaliable,p.remark,c.Name,b.Name As branch_name\n \tFROM tb_product AS p\n \tINNER JOIN tb_category AS c ON c.CategoryID=p.cate_id\n \tINNER JOIN tb_branch AS b ON b.branch_id=p.brand_id\n \tWHERE p.pro_id=\".$id.\" LIMIT 1\";\n \t$rows = $db->fetchRow($sql);\n \treturn ($rows);\n }", "public function getDetails( ) {\n\t\t\n\t\treturn $this->db->get_row( \n\t\t\t$this->db->prepare( \"SELECT * FROM `{$this->products}` WHERE `productId` = '%d'\", $this->id ) \n\t\t);\n\t}", "public function getProductInfo($id){\n \t$db=$this->getAdapter();\n \t$sql = \"SELECT \n\t\t\t\t\t p.pro_id,\n\t\t\t\t\t p.cate_id,\n\t\t\t\t\t p.brand_id,\n\t\t\t\t\t p.stock_type,\n\t\t\t\t\t p.item_name,\n\t\t\t\t\t p.item_code,\n\t\t\t\t\t p.item_size,\n\t\t\t\t\t p.purchase_tax,\n\t\t\t\t\t p.sale_tax,\n\t\t\t\t\t measure_id,\n\t\t\t\t\t label,\n\t\t\t\t\t qty_perunit,\n\t\t\t\t\t p.unit_sale_price,\n\t\t\t\t\t qty_onhand,\n\t\t\t\t\t p.photo,\n\t\t\t\t\t p.is_avaliable,\n\t\t\t\t\t p.remark \n\t\t\t\t\tFROM\n\t\t\t\t\t tb_product AS p \n\t\t\t\t\tWHERE p.pro_id =\".$db->quote($id).\" LIMIT 1\";\n \t$rows = $db->fetchRow($sql);\n \treturn ($rows);\n }", "function getProductInfo($invId){\r\n $db = acmeConnect();\r\n $sql = 'SELECT * FROM inventory WHERE invId = :invId';\r\n $stmt = $db->prepare($sql);\r\n $stmt->bindValue(':invId', $invId, PDO::PARAM_INT);\r\n $stmt->execute();\r\n $prodInfo = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n $stmt->closeCursor();\r\n return $prodInfo;\r\n }", "function getProductInfo($invId)\n{\n $db = acmeConnect();\n $sql = 'SELECT * FROM inventory WHERE invId = :invId';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':invId', $invId, PDO::PARAM_INT);\n $stmt->execute();\n $prodInfo = $stmt->fetch(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n return $prodInfo;\n}", "function getDetails($product_id){\n global $con;\n $query=\"select * from products where product_id= :product_id\";\n $stmt=$con->prepare($query);\n $stmt->bindValue(':product_id',$product_id,PDO::PARAM_INT);\n $stmt->execute();\n $product=$stmt->fetch(PDO::FETCH_ASSOC);\n var_dump($product);\n return $product;\n \n}", "function show($id) {\n $connect = $this->connect();\n $result = $connect->query(\"select * from products where id = $id\");\n $product = mysqli_fetch_assoc($result);\n return $product;\n }", "public static function getProductDetailsById($productId)\n {\n// pr(Product::loadById($productId));die;\n// pr(Product::loadProductsDetailsById($productId));die;\n return Product::loadProductsDetailsById($productId);\n }", "public function getProductDetails($product_id)\n\t{\n\t\t$product = new products();\n\t\t$product->select();\n\t\treturn $product;\n\t}", "public function get_prod_byId($id){\n \n return $this->db->get_where(\"produit\",array(\"id_prod\" => $id));\n }", "public function get_product_info($id= Null)\n\t{\t\n\t\t\n\t\t$result = $this->db->where('id',$id)->get('products')->row();\n\t\tif($result){\n\t\t\treturn $result;\n\t\t}else{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function GetInfoByDetailID($detail_id)\n{\n\tglobal $conn;\n\t$detail_id = intval($detail_id);\n\t$sql = \"SELECT * FROM `shop_goods_detail` WHERE `detail_id` = $detail_id\";\n\t$result = $conn->get_one($sql);\n\treturn $result;\n}", "function get_lead_product_details_view_detail($id)\n\t\t{\n\t\t\t$sql=\"SELECT \n\t\t\t\t\t\t(select description from view_tempitemmaster j WHERE j.id = lp.productid) as description\n\t\t\t\t\t\t,(select n_value FROM vw_leads_getdispatch j WHERE j.n_value_id = lp.product_type_id ) as n_value\n\t\t\t\t\t\t,( SELECT quantity from leadproducts j WHERE j.leadid = lp.leadid and lp .productid = j.productid ) as quantity\n\t\t\t\t\t\t, potential \n\t\t\t\tFROM\n\t\t\t\t\tlead_prod_potential_types lp\n\n\t\t\t\tWHERE lp.leadid=\".$id;\n\n\t\t\t\t\t\t\n\n\n\t //echo $sql; die;\n\t\t\t\t$result = $this->db->query($sql);\n\t\t\t\t$productdetails = $result->result_array();\n\n\t\t\t/*\t$this->db->select('*');\n\t\t\t\t$this->db->from ('leadproducts');\n\t\t\t\t$this->db->where('leadid',$id);\n\t\t $result = $this->db->get();\n\t\t\t\t$productdetails = $result->result_array();*/\n\t\t\t return $productdetails;\n\t\t}", "Public static function Producten($id){\n\t\treturn OrderDetail::where('member_id', $id)->where('order_status', 1)->where('deleted', 0)->select('id')->first();\n\t}", "public function SellerDataProduct_get($id=0)\n { \n $data = $this->input->request_headers();\n\n $dbkeys=$this->ProductCategoryModel->getSelectData(\"key\",\"keys\",null);\n foreach ($dbkeys as $key => $value) {\n $keyValue = $value->key;\n }\n\n if($keyValue == $data['admin'])\n { \n $data = $this->ProductModel->SellerDataProduct($id);\n \n $this->response($data, REST_Controller::HTTP_OK);\n }\n else\n {\n $this->response(\"Wrong Credentials\", REST_Controller::HTTP_OK);\n }\n }", "public function action_get_product_relate()\n {\n $product_id = (int) Arr::get($_GET, 'product_id', 0);\n if($product_id)\n {\n $product_relate = DB::select('relate')\n ->from('ga_product_relate')\n ->where('product_id', '=', $product_id)\n ->where('relate_count', '>', 28)\n ->execute()->get('relate');\n echo $product_relate;\n }\n exit;\n }", "public function showProduct($id) {\n\t\ttry {\n\t\t\t$this->show_product = $this->_connect->prepare(\"SELECT * FROM product WHERE product_id =\" . $id);\n\t\t\t$this->show_product->execute();\n\t\t\treturn $this->show_product->fetch();\n\t\t} catch(Exception $e) {\n\t\t\techo $e->getMessage();\n\t\t\tdie();\n\t\t}\n\t}", "public function getDetailsById($id)\n\t{\n\t\t$pdo = $this->getPdo();\n\t\t$sql = 'SELECT * FROM `products` WHERE `product_id` = ?';\n\t\ttry {\n\t\t\t$stmt = $pdo->prepare($sql);\n\t\t\t$stmt->execute(array($id));\n\t\t\t$result = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t} catch (PDOException $e) {\n\t\t\terror_log($e->getMessage, 0);\n\t\t\t$_SESSION['error'] = 'Database error';\n\t\t\theader('Location: ' . HOME_URL . '?page=error');\n\t\t\texit;\n\t\t}\n\t\treturn $result;\n\t}", "function get_info($product_id)\n\t{\n\t\t$this->db->from('product');\n\t\t$this->db->where('prod_id',$product_id);\n\n\t\t$query = $this->db->get();\n\n\t\tif($query->num_rows() == 1)\n\t\t{\n\t\t\treturn $query->row();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//Get empty base parent object, as $item_id is NOT an item\n\t\t\t$item_obj = new stdClass();\n\n\t\t\t//Get all the fields from items table\n\t\t\t$fields = $this->db->list_fields('product');\n\n\t\t\tforeach ($fields as $field)\n\t\t\t{\n\t\t\t\t$product_obj->$field = '';\n\t\t\t}\n\n\t\t\treturn $product_obj;\n\t\t}\n\t}", "function peoplebought_details($prod_id) {\n $query = $this->xml_select->productdetails->selectpeoplebought;\n $values = $prod_id;\n $squery = $query . $values . \" \" . \"limit 0,2\";\n //print_r($squery);\n\n\n $result = $this->mysqli->query($squery);\n if ($result->num_rows > 0) {\n while ($rows = $result->fetch_assoc()) {\n $prod_cat[] = $rows;\n }\n return $prod_cat;\n $result->close();\n }\n return 0;\n }", "function vcp_get_related_items (){\n\nif(isset($_GET)){$product_id = $_GET['product_id'];}\n\nif(!$product_id){$product_id = 1;}\n \n$product_data = array('attribute_name' => $product_id);\necho vcp_related_shortcode_func($product_data);\n\nreturn;\n}", "public static function getProductDetailsById($product_id)\n {\n $products = Doctrine::getTable('GcrProducts')\n ->createQuery('p')\n ->where('p.status = ?', 1)\n\t\t\t\t->andWhere('p.id = ?', $product_id)\n\t\t\t\t->orderBy('p.id ASC')\n ->execute();\n if (count($products) > 0)\n {\n\t\t\treturn $products;\n }\t\t\t\t\n return false;\n }", "public function orderProductDetails($id)\n {\n \n \t$repo = $this->em->getRepository('App\\Entity\\Commerce\\OrderProduct');\n \t$orderRepo = $this->em->getRepository('App\\Entity\\Commerce\\Order');\n \t$results = $repo->getCustomOrder(array('op_id'=> $id));\n \tif(isset($results[0])){\n \t\t$order = $orderRepo->getOrderById($results[0]['orderId']);\n \n \t\treturn view('pages.orders.order-product')->with('data', array('order' => $order, 'orderP'=> $results[0]));\n \t}\n \treturn view('pages.error.not-found');\n \t\n }", "public function getSingleProduct($id){\n\n\n $query = \"SELECT tbl_product.*, tbl_category.catName, tbl_brand.brandName FROM tbl_product INNER JOIN tbl_category ON tbl_product.catId = tbl_category.catId INNER JOIN tbl_brand ON tbl_product.brandId=tbl_brand.brandId WHERE tbl_product.productId='$id'\";\n $result = $this->db->select($query);\n if ($result) {\n return $result;\n }else {\n return false;\n }\n }", "public function getProductById($id){\n $this->db->query('SELECT * FROM new_inventory WHERE product_id = :id');\n $this->db->bind(':id', $id);\n $row = $this->db->single();\n return $row;\n }", "function getDetailAssociatedProducts($module, $focus) {\n\tglobal $log, $adb, $theme, $app_strings;\n\t$log->debug('> getDetailAssociatedProducts ' . $module . ',' . get_class($focus));\n\n\tif (strpos(GlobalVariable::getVariable('Inventory_DoNotUseLines', '', $module), $module)!==false) {\n\t\treturn '';\n\t}\n\tif (vtlib_isModuleActive('Products')) {\n\t\t$hide_stock = 'no';\n\t} else {\n\t\t$hide_stock = 'yes';\n\t}\n\tif ($module != 'PurchaseOrder') {\n\t\tif (GlobalVariable::getVariable('Application_B2B', '1')=='1') {\n\t\t\t$acvid = (isset($focus->column_fields['account_id']) ? $focus->column_fields['account_id'] : (isset($focus->column_fields['accid']) ? $focus->column_fields['accid'] : 0));\n\t\t} else {\n\t\t\t$acvid = (isset($focus->column_fields['contact_id']) ? $focus->column_fields['contact_id'] : (isset($focus->column_fields['ctoid']) ? $focus->column_fields['ctoid'] : 0));\n\t\t}\n\t} else {\n\t\t$acvid = $focus->column_fields['vendor_id'];\n\t}\n\n\t$cbMap = cbMap::getMapByName($module.'InventoryDetails', 'MasterDetailLayout');\n\t$MDMapFound = ($cbMap!=null && isPermitted('InventoryDetails', 'index')=='yes');\n\tif ($MDMapFound) {\n\t\t$cbMapFields = $cbMap->MasterDetailLayout();\n\t}\n\n\t//Get the taxtype of this entity\n\t$taxtype = getInventoryTaxType($module, $focus->id);\n\t$currencytype = getInventoryCurrencyInfo($module, $focus->id);\n\n\t$output = '';\n\t//Header Rows\n\t$output .= '\n\t<table width=\"100%\" border=\"0\" align=\"center\" cellpadding=\"5\" cellspacing=\"0\" class=\"crmTable detailview_inventory_table\" id=\"proTab\">\n\t<tr valign=\"top\" class=\"detailview_inventory_header\">\n\t\t<td colspan=\"2\" class=\"dvInnerHeader\"><b>' . $app_strings['LBL_ITEM_DETAILS'] . '</b></td>\n\t\t<td class=\"dvInnerHeader\" align=\"center\" colspan=\"2\"><b>' .\n\t\t\t$app_strings['LBL_CURRENCY'] . ' : </b>' . getTranslatedCurrencyString($currencytype['currency_name']) . ' (' . $currencytype['currency_symbol'] . ')\n\t\t</td>\n\t\t<td class=\"dvInnerHeader\" align=\"center\" colspan=\"2\"><b>' .\n\t\t\t$app_strings['LBL_TAX_MODE'] . ' : </b>' . $app_strings[$taxtype] . '\n\t\t</td>\n\t</tr>\n\t<tr valign=\"top\" class=\"detailview_inventory_subheader\">\n\t\t<td width=40% class=\"lvtCol\"><font color=\"red\">*</font>\n\t\t\t<b>' . $app_strings['LBL_ITEM_NAME'] . '</b>\n\t\t</td>';\n\n\t//Additional information column\n\t$output .= '<td width=20% class=\"lvtCol\"><b>' . $app_strings['LBL_INFORMATION'] . '</b></td>';\n\n\t$price_label = $_REQUEST['module'] == 'PurchaseOrder' ? $app_strings['LBL_PURCHASE_PRICE'] : $app_strings['LBL_LIST_PRICE'];\n\t$output .= '\n\t\t<td width=10% class=\"lvtCol\"><b>' . $app_strings['LBL_QTY'] . '</b></td>\n\t\t<td width=10% class=\"lvtCol\" align=\"right\"><b>' . $price_label . '</b></td>\n\t\t<td width=10% nowrap class=\"lvtCol\" align=\"right\"><b>' . $app_strings['LBL_TOTAL'] . '</b></td>\n\t\t<td width=10% valign=\"top\" class=\"lvtCol\" align=\"right\"><b>' . $app_strings['LBL_NET_PRICE'] . '</b></td>\n\t</tr>';\n\n\tif (in_array($module, getInventoryModules())) {\n\t\t$query = \"select case when vtiger_products.productid != '' then vtiger_products.productname else vtiger_service.servicename end as productname,\" .\n\t\t\t\" case when vtiger_products.productid != '' then 'Products' else 'Services' end as entitytype,\" .\n\t\t\t\" case when vtiger_products.productid != '' then vtiger_products.unit_price else vtiger_service.unit_price end as unit_price,\" .\n\t\t\t\" case when vtiger_products.productid != '' then vtiger_products.qtyinstock else 'NA' end as qtyinstock, vtiger_inventoryproductrel.* \" .\n\t\t\t\" from vtiger_inventoryproductrel\" .\n\t\t\t\" left join vtiger_products on vtiger_products.productid=vtiger_inventoryproductrel.productid \" .\n\t\t\t\" left join vtiger_service on vtiger_service.serviceid=vtiger_inventoryproductrel.productid \" .\n\t\t\t\" where id=? ORDER BY sequence_no\";\n\t}\n\n\t$result = $adb->pquery($query, array($focus->id));\n\t$num_rows = $adb->num_rows($result);\n\t$netTotal = '0.00';\n\tfor ($i = 1; $i <= $num_rows; $i++) {\n\t\t$sub_prod_query = $adb->pquery('SELECT productid from vtiger_inventorysubproductrel WHERE id=? AND sequence_no=?', array($focus->id, $i));\n\t\t$subprodname_str = '';\n\t\tif ($adb->num_rows($sub_prod_query) > 0) {\n\t\t\tfor ($j = 0; $j < $adb->num_rows($sub_prod_query); $j++) {\n\t\t\t\t$sprod_id = $adb->query_result($sub_prod_query, $j, 'productid');\n\t\t\t\t$sprod_name = getProductName($sprod_id);\n\t\t\t\t$str_sep = '';\n\t\t\t\tif ($j > 0) {\n\t\t\t\t\t$str_sep = ':';\n\t\t\t\t}\n\t\t\t\t$subprodname_str .= $str_sep . ' - ' . $sprod_name;\n\t\t\t}\n\t\t}\n\t\t$subprodname_str = str_replace(':', '<br>', $subprodname_str);\n\n\t\t$productid = $adb->query_result($result, $i - 1, 'productid');\n\t\t$entitytype = $adb->query_result($result, $i - 1, 'entitytype');\n\t\t$productname = $adb->query_result($result, $i - 1, 'productname');\n\t\t$productname = '<a href=\"index.php?action=DetailView&record='.$productid.'&module='.$entitytype.'\">'.$productname.'</a>';\n\t\t$productname.= \"<span type='vtlib_metainfo' vtrecordid='{$productid}' vtfieldname='\".($entitytype=='Products' ? 'productname' : 'servicename').\"' vtmodule='$entitytype' style='display:none;'></span>\";\n\t\tif ($subprodname_str != '') {\n\t\t\t$productname .= \"<br/><span style='color:#C0C0C0;font-style:italic;'>\" . $subprodname_str . \"</span>\";\n\t\t}\n\t\t$comment = $adb->query_result($result, $i - 1, 'comment');\n\t\t$qtyinstock = $adb->query_result($result, $i - 1, 'qtyinstock');\n\t\t$qtyinstockshow = CurrencyField::convertToUserFormat($qtyinstock, null, true);\n\t\t$qty = $adb->query_result($result, $i - 1, 'quantity');\n\t\t$qtyshow = CurrencyField::convertToUserFormat($qty, null, true);\n\t\t$listprice = $adb->query_result($result, $i - 1, 'listprice');\n\t\t$total = $qty * $listprice;\n\n\t\t//Product wise Discount calculation - starts\n\t\t$discount_percent = $adb->query_result($result, $i - 1, 'discount_percent');\n\t\t$discount_amount = $adb->query_result($result, $i - 1, 'discount_amount');\n\t\t$totalAfterDiscount = $total;\n\n\t\t$productDiscount = '0.00';\n\t\tif ($discount_percent != 'NULL' && $discount_percent != '') {\n\t\t\t$productDiscount = $total * $discount_percent / 100;\n\t\t\t$totalAfterDiscount = $total - $productDiscount;\n\t\t\t//if discount is percent then show the percentage\n\t\t\t$discount_info_message = \"$discount_percent % \" . $app_strings['LBL_LIST_OF'] . ' '.\n\t\t\t\t\t\t\t\t\t\tCurrencyField::convertToUserFormat($total, null, true).\" = \".\n\t\t\t\t\t\t\t\t\t\tCurrencyField::convertToUserFormat($productDiscount, null, true);\n\t\t} elseif ($discount_amount != 'NULL' && $discount_amount != '') {\n\t\t\t$productDiscount = $discount_amount;\n\t\t\t$totalAfterDiscount = $total - $productDiscount;\n\t\t\t$discount_info_message = $app_strings['LBL_DIRECT_AMOUNT_DISCOUNT'] . \" = \". CurrencyField::convertToUserFormat($productDiscount, null, true);\n\t\t} else {\n\t\t\t$discount_info_message = $app_strings['LBL_NO_DISCOUNT_FOR_THIS_LINE_ITEM'];\n\t\t}\n\t\t//Product wise Discount calculation - ends\n\n\t\t$netprice = $totalAfterDiscount;\n\t\t//Calculate the individual tax if taxtype is individual\n\t\tif ($taxtype == 'individual') {\n\t\t\t$taxtotal = '0.00';\n\t\t\t$tax_info_message = $app_strings['LBL_TOTAL_AFTER_DISCOUNT'] . \" = \".CurrencyField::convertToUserFormat($totalAfterDiscount, null, true).\" \\\\n\";\n\t\t\tforeach (getTaxDetailsForProduct($productid, 'all', $acvid) as $taxItem) {\n\t\t\t\t$tax_name = $taxItem['taxname'];\n\t\t\t\t$tax_label = $taxItem['taxlabel'];\n\t\t\t\t$tax_value = getInventoryProductTaxValue($focus->id, $productid, $tax_name);\n\t\t\t\t$individual_taxamount = $totalAfterDiscount * $tax_value / 100;\n\t\t\t\t$taxtotal = $taxtotal + $individual_taxamount;\n\t\t\t\t$tax_info_message .= \"$tax_label : $tax_value % = \".CurrencyField::convertToUserFormat($individual_taxamount, null, true).\" \\\\n\";\n\t\t\t}\n\t\t\t$tax_info_message .= \"\\\\n \" . $app_strings['LBL_TOTAL_TAX_AMOUNT'] . \" = \". CurrencyField::convertToUserFormat($taxtotal, null, true);\n\t\t\t$netprice = $netprice + $taxtotal;\n\t\t}\n\n\t\t$sc_image_tag = '';\n\t\tif ($module == 'Invoice') {\n\t\t\tswitch ($entitytype) {\n\t\t\t\tcase 'Services':\n\t\t\t\t\tif (vtlib_isModuleActive('ServiceContracts')) {\n\t\t\t\t\t\t$sc_image_tag = '<a href=\"index.php?module=ServiceContracts&action=EditView&service_id=' . $productid . '&sc_related_to='\n\t\t\t\t\t\t\t. $focus->column_fields['account_id'] . '&start_date=' . DateTimeField::convertToUserFormat($focus->column_fields['invoicedate'])\n\t\t\t\t\t\t\t. '&return_module=' . $module . '&return_id=' . $focus->id . '\"><img border=\"0\" src=\"' . vtiger_imageurl('handshake.gif', $theme)\n\t\t\t\t\t\t\t. '\" title=\"' . getTranslatedString('LBL_ADD_NEW', $module).\" \".getTranslatedString('ServiceContracts', 'ServiceContracts')\n\t\t\t\t\t\t\t. '\" style=\"cursor: pointer;\" align=\"absmiddle\" /></a>';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Products':\n\t\t\t\t\tif (vtlib_isModuleActive('Assets')) {\n\t\t\t\t\t\t$sc_image_tag = '<a onclick=\"return window.open(\\'index.php?module=Assets&return_module=Invoice&action=Popup&popuptype=detailview&select=enable'\n\t\t\t\t\t\t\t. '&form=EditView&form_submit=false&return_action=DetailView&productid='.$productid.'&invoiceid='.$focus->id.'&return_id=' . $focus->id\n\t\t\t\t\t\t\t. '&recordid='.$focus->id.'\\', \\'test\\', cbPopupWindowSettings)\"'\n\t\t\t\t\t\t\t. ' onmouseout=\"vtlib_listview.trigger(\\'invoiceasset.onmouseout\\', this)\" onmouseover=\"vtlib_listview.trigger(\\'cell.onmouseover\\', this)\">'\n\t\t\t\t\t\t\t. '<img border=\"0\" src=\"' . vtiger_imageurl('barcode.png', $theme) . '\" title=\"' . getTranslatedString('LBL_ADD_NEW', $module)\n\t\t\t\t\t\t\t. ' '.getTranslatedString('Assets', 'Assets'). '\" style=\"cursor: pointer;\" align=\"absmiddle\" /><span style=\"display:none;\" '\n\t\t\t\t\t\t\t. 'vtmodule=\"Assets\" vtfieldname=\"invoice_product\" vtrecordid=\"'.$focus->id.'::'.$productid.'::'.$i.'\" type=\"vtlib_metainfo\"></span></a>';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$sc_image_tag = '';\n\t\t\t}\n\t\t}\n\n\t\t//For Product Name\n\t\t$output .= '\n\t\t\t<tr valign=\"top\" class=\"detailview_inventory_row\">\n\t\t\t\t<td class=\"crmTableRow small lineOnTop detailview_inventory_namecell\" '\n\t\t\t\t\t.'onmouseover=\"vtlib_listview.trigger(\\'cell.onmouseover\\', this);\" onmouseout=\"vtlib_listview.trigger(\\'cell.onmouseout\\', this);\">'\n\t\t\t\t\t. $productname . '&nbsp;' . $sc_image_tag . '<br>' . $comment\n\t\t\t\t\t. '</td>';\n\t\t//Upto this added to display the Product name and comment\n\n\t\t$output .= '<td class=\"crmTableRow small lineOnTop detailview_inventory_stockcell\">';\n\t\tif ($module != 'PurchaseOrder' && $hide_stock == 'no') {\n\t\t\t$output .= '<b>'.$app_strings['LBL_QTY_IN_STOCK'].':</b>&nbsp;'.$qtyinstockshow;\n\t\t}\n\t\tif ($MDMapFound) {\n\t\t\t$invdTabid = getTabid('InventoryDetails');\n\t\t\tforeach ($cbMapFields['detailview']['fields'] as $mdfield) {\n\t\t\t\tif ($mdfield['fieldinfo']['name']=='id') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$output .= '<br>';\n\t\t\t\t$output .= '<b>'.$mdfield['fieldinfo']['label'].'</b>:&nbsp;';\n\t\t\t\t$crmEntityTable = CRMEntity::getcrmEntityTableAlias('InventoryDetails');\n\t\t\t\t$mdrs = $adb->pquery(\n\t\t\t\t\t'select '.$mdfield['fieldinfo']['name'].',vtiger_inventorydetails.inventorydetailsid from vtiger_inventorydetails\n\t\t\t\t\t\tinner join '.$crmEntityTable.' on vtiger_crmentity.crmid=vtiger_inventorydetails.inventorydetailsid\n\t\t\t\t\t\tinner join vtiger_inventorydetailscf on vtiger_inventorydetailscf.inventorydetailsid=vtiger_inventorydetails.inventorydetailsid\n\t\t\t\t\t\twhere vtiger_crmentity.deleted=0 and related_to=? and lineitem_id=?',\n\t\t\t\t\tarray($focus->id,$adb->query_result($result, $i - 1, 'lineitem_id'))\n\t\t\t\t);\n\t\t\t\tif ($mdrs) {\n\t\t\t\t\t$col_fields = array();\n\t\t\t\t\t$col_fields[$mdfield['fieldinfo']['name']] = $adb->query_result($mdrs, 0, $mdfield['fieldinfo']['name']);\n\t\t\t\t\t$col_fields['record_id'] = $adb->query_result($mdrs, 0, 'inventorydetailsid');\n\t\t\t\t\t$foutput = getDetailViewOutputHtml($mdfield['fieldinfo']['uitype'], $mdfield['fieldinfo']['name'], $mdfield['fieldinfo']['label'], $col_fields, 0, $invdTabid, $module);\n\t\t\t\t\tif ($foutput[2]==69) { // image\n\t\t\t\t\t\t$foutput = str_replace('style=\"max-width: 500px;\"', 'style=\"max-width: 100px;\"', $foutput[1]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$foutput = $foutput[1];\n\t\t\t\t\t}\n\t\t\t\t\t$output .= $foutput;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$output .= '</td>';\n\t\t$output .= '<td class=\"crmTableRow small lineOnTop detailview_inventory_qtycell\">' . $qtyshow . '</td>';\n\t\t$output .= '\n\t\t\t<td class=\"crmTableRow small lineOnTop detailview_inventory_lpricecell\" align=\"right\">\n\t\t\t\t<table width=\"100%\" border=\"0\" cellpadding=\"5\" cellspacing=\"0\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td align=\"right\">' . CurrencyField::convertToUserFormat($listprice, null, true) . '</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td align=\"right\">\n\t\t\t\t\t\t\t(-)&nbsp;<b><a href=\"javascript:;\" onclick=\"alert(\\'' . $discount_info_message . '\\'); \">' . $app_strings['LBL_DISCOUNT'] . ' : </a></b>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td align=\"right\" nowrap>' . $app_strings['LBL_TOTAL_AFTER_DISCOUNT'] . ' : </td>\n\t\t\t\t\t</tr>';\n\t\tif ($taxtype == 'individual') {\n\t\t\t$output .= '\n\t\t\t\t<tr>\n\t\t\t\t\t<td align=\"right\" nowrap>\n\t\t\t\t\t\t(+)&nbsp;<b><a href=\"javascript:;\" onclick=\"alert(\\'' . $tax_info_message . '\\');\">' . $app_strings['LBL_TAX'] . ' : </a></b>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>';\n\t\t}\n\t\t$output .= '\n\t\t\t\t</table>\n\t\t\t</td>';\n\n\t\t$output .= '\n\t\t\t<td class=\"crmTableRow small lineOnTop detailview_inventory_totalscell\" align=\"right\">\n\t\t\t\t<table width=\"100%\" border=\"0\" cellpadding=\"5\" cellspacing=\"0\">\n\t\t\t\t\t<tr><td align=\"right\">' . CurrencyField::convertToUserFormat($total, null, true) . '</td></tr>\n\t\t\t\t\t<tr><td align=\"right\">' . CurrencyField::convertToUserFormat($productDiscount, null, true) . '</td></tr>\n\t\t\t\t\t<tr><td align=\"right\" nowrap>' . CurrencyField::convertToUserFormat($totalAfterDiscount, null, true) . '</td></tr>';\n\n\t\tif ($taxtype == 'individual') {\n\t\t\t$output .= '<tr><td align=\"right\" nowrap>' . CurrencyField::convertToUserFormat($taxtotal, null, true) . '</td></tr>';\n\t\t}\n\n\t\t$output .= '\n\t\t\t\t</table>\n\t\t\t</td>';\n\t\t$output .= '<td class=\"crmTableRow small lineOnTop detailview_inventory_npricecell\" valign=\"bottom\" align=\"right\">';\n\t\t$output .= CurrencyField::convertToUserFormat($netprice, null, true) . '</td>';\n\t\t$output .= '</tr>';\n\t\tlist($v1, $v2, $v3, $v4, $output) = cbEventHandler::do_filter('corebos.filter.inventory.itemrow.detail', array($module, $focus, $result, $i, $output));\n\t\t$netTotal = $netTotal + $netprice;\n\t}\n\n\t$output .= '</table>';\n\n\t//$netTotal should be equal to $focus->column_fields['hdnSubTotal']\n\t$netTotal = empty($focus->column_fields['hdnSubTotal']) ? $focus->column_fields['hdnsubtotal'] : $focus->column_fields['hdnSubTotal'];\n\n\t//Display the total, adjustment, S&H details\n\t$output .= '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\" class=\"crmTable detailview_inventory_totals\">';\n\t$output .= '<tr id=\"detailview_inventory_subtotalrow\">';\n\t$output .= '<td width=\"88%\" class=\"crmTableRow small\" align=\"right\"><b>' . $app_strings['LBL_NET_TOTAL'] . '</td>';\n\t$output .= '<td width=\"12%\" class=\"crmTableRow small\" align=\"right\"><b>' . CurrencyField::convertToUserFormat($netTotal, null, true) . '</b></td>';\n\t$output .= '</tr>';\n\n\t//Decide discount\n\t$finalDiscount = '0.00';\n\t$final_discount_info = '0';\n\t$hdnDiscountPercent = empty($focus->column_fields['hdnDiscountPercent']) ? $focus->column_fields['hdndiscountpercent'] : $focus->column_fields['hdnDiscountPercent'];\n\t$hdnDiscountAmount = empty($focus->column_fields['hdnDiscountAmount']) ? $focus->column_fields['hdndiscountamount'] : $focus->column_fields['hdnDiscountAmount'];\n\tif ($hdnDiscountPercent != '0') {\n\t\t$finalDiscount = ($netTotal * $hdnDiscountPercent / 100);\n\t\t$final_discount_info = $hdnDiscountPercent . ' % ' . $app_strings['LBL_LIST_OF'] . ' '\n\t\t\t.CurrencyField::convertToUserFormat($netTotal, null, true) . ' = '. CurrencyField::convertToUserFormat($finalDiscount, null, true);\n\t} elseif ($hdnDiscountAmount != '0') {\n\t\t$finalDiscount = $hdnDiscountAmount;\n\t\t$final_discount_info = CurrencyField::convertToUserFormat($finalDiscount, null, true);\n\t}\n\n\t//Alert the Final Discount amount even it is zero\n\t$final_discount_info = $app_strings['LBL_FINAL_DISCOUNT_AMOUNT'] . \" = $final_discount_info\";\n\t$final_discount_info = 'onclick=\"alert(\\'' . $final_discount_info . '\\');\"';\n\n\t$output .= '<tr id=\"detailview_inventory_totaldiscrow\">';\n\t$output .= '<td align=\"right\" class=\"crmTableRow small lineOnTop\">';\n\t$output .= '(-)&nbsp;<b><a href=\"javascript:;\" ' . $final_discount_info . '>' . $app_strings['LBL_DISCOUNT'] . '</a></b></td>';\n\t$output .= '<td align=\"right\" class=\"crmTableRow small lineOnTop\">' . CurrencyField::convertToUserFormat($finalDiscount, null, true) . '</td>';\n\t$output .= '</tr>';\n\n\tif ($taxtype == 'group') {\n\t\t$taxtotal = '0.00';\n\t\t$final_totalAfterDiscount = $netTotal - $finalDiscount;\n\t\t$tax_info_message = $app_strings['LBL_TOTAL_AFTER_DISCOUNT'] . \" = \". CurrencyField::convertToUserFormat($final_totalAfterDiscount, null, true).\" \\\\n\";\n\t\t//First we should get all available taxes and then retrieve the corresponding tax values\n\t\t$ipr_cols = $adb->getColumnNames('vtiger_inventoryproductrel');\n\t\t//if taxtype is group then the tax should be same for all products in vtiger_inventoryproductrel table\n\t\tforeach (getAllTaxes('available', '', 'edit', $focus->id) as $taxItem) {\n\t\t\t$tax_name = $taxItem['taxname'];\n\t\t\t$tax_label = $taxItem['taxlabel'];\n\t\t\tif (in_array($tax_name, $ipr_cols)) {\n\t\t\t\t$tax_value = $adb->query_result($result, 0, $tax_name);\n\t\t\t} else {\n\t\t\t\t$tax_value = $taxItem['percentage'];\n\t\t\t}\n\t\t\tif ($tax_value == '' || $tax_value == 'NULL') {\n\t\t\t\t$tax_value = '0.00';\n\t\t\t}\n\n\t\t\t$taxamount = ($netTotal - $finalDiscount) * $tax_value / 100;\n\t\t\t$taxtotal = $taxtotal + $taxamount;\n\t\t\t$tax_info_message .= \"$tax_label : $tax_value % = \". CurrencyField::convertToUserFormat($taxamount, null, true) .\" \\\\n\";\n\t\t}\n\t\t$tax_info_message .= \"\\\\n \" . $app_strings['LBL_TOTAL_TAX_AMOUNT'] . \" = \". CurrencyField::convertToUserFormat($taxtotal, null, true);\n\n\t\t$output .= '<tr id=\"detailview_inventory_taxtotalrow\">';\n\t\t$output .= '<td align=\"right\" class=\"crmTableRow small\">';\n\t\t$output .= '(+)&nbsp;<b><a href=\"javascript:;\" onclick=\"alert(\\'' . $tax_info_message . '\\');\">' . $app_strings['LBL_TAX'] . '</a></b></td>';\n\t\t$output .= '<td align=\"right\" class=\"crmTableRow small\">' . CurrencyField::convertToUserFormat($taxtotal, null, true) . '</td>';\n\t\t$output .= '</tr>';\n\t}\n\n\t$hdnS_H_Amount = empty($focus->column_fields['hdnS_H_Amount']) ? $focus->column_fields['hdns_h_amount'] : $focus->column_fields['hdnS_H_Amount'];\n\t$shAmount = ($hdnS_H_Amount != '') ? $hdnS_H_Amount : '0.00';\n\tif (GlobalVariable::getVariable('Inventory_Show_ShippingHandlingCharges', 1, $module)) {\n\t\t$output .= '<tr id=\"detailview_inventory_shippingrow\">';\n\t\t$output .= '<td align=\"right\" class=\"crmTableRow small\">(+)&nbsp;<b>' . $app_strings['LBL_SHIPPING_AND_HANDLING_CHARGES'] . '</b></td>';\n\t\t$output .= '<td align=\"right\" class=\"crmTableRow small\">' . CurrencyField::convertToUserFormat($shAmount, null, true) . '</td>';\n\t\t$output .= '</tr>';\n\t}\n\n\t//calculate S&H tax\n\t$shtaxtotal = '0.00';\n\t//First we should get all available taxes and then retrieve the corresponding tax values\n\t//if taxtype is group then the tax should be same for all products in vtiger_inventoryproductrel table\n\t$shtax_info_message = $app_strings['LBL_SHIPPING_AND_HANDLING_CHARGE'] . \" = \". CurrencyField::convertToUserFormat($shAmount, null, true) .\"\\\\n\";\n\t$shtaxexist = false;\n\tforeach (getAllTaxes('available', 'sh', 'edit', $focus->id) as $taxItem) {\n\t\t$shtaxexist = true;\n\t\t$shtax_name = $taxItem['taxname'];\n\t\t$shtax_label = $taxItem['taxlabel'];\n\t\t$shtax_percent = getInventorySHTaxPercent($focus->id, $shtax_name);\n\t\t$shtaxamount = $shAmount * $shtax_percent / 100;\n\t\t$shtaxtotal = $shtaxtotal + $shtaxamount;\n\t\t$shtax_info_message .= \"$shtax_label : $shtax_percent % = \". CurrencyField::convertToUserFormat($shtaxamount, null, true) .\" \\\\n\";\n\t}\n\t$shtax_info_message .= \"\\\\n \" . $app_strings['LBL_TOTAL_TAX_AMOUNT'] . \" = \". CurrencyField::convertToUserFormat($shtaxtotal, null, true);\n\n\tif ($shtaxexist) {\n\t\t$output .= '<tr id=\"detailview_inventory_shiptaxrow\">';\n\t\t$output .= '<td align=\"right\" class=\"crmTableRow small\">(+)&nbsp;<b><a href=\"javascript:;\" onclick=\"alert(\\'' . $shtax_info_message . '\\')\">';\n\t\t$output .= $app_strings['LBL_TAX_FOR_SHIPPING_AND_HANDLING'] . '</a></b></td>';\n\t\t$output .= '<td align=\"right\" class=\"crmTableRow small\">' . CurrencyField::convertToUserFormat($shtaxtotal, null, true) . '</td>';\n\t\t$output .= '</tr>';\n\t}\n\n\t$txtAdjustment = empty($focus->column_fields['txtAdjustment']) ? $focus->column_fields['txtadjustment'] : $focus->column_fields['txtAdjustment'];\n\t$adjustment = ($txtAdjustment != '') ? $txtAdjustment : '0.00';\n\t$output .= '<tr id=\"detailview_inventory_adjustrow\">';\n\t$output .= '<td align=\"right\" class=\"crmTableRow small\">&nbsp;<b>' . $app_strings['LBL_ADJUSTMENT'] . '</b></td>';\n\t$output .= '<td align=\"right\" class=\"crmTableRow small\">' . CurrencyField::convertToUserFormat($adjustment, null, true) . '</td>';\n\t$output .= '</tr>';\n\n\t$hdnGrandTotal = empty($focus->column_fields['hdnGrandTotal']) ? $focus->column_fields['hdngrandtotal'] : $focus->column_fields['hdnGrandTotal'];\n\t$grandTotal = ($hdnGrandTotal != '') ? $hdnGrandTotal : '0.00';\n\t$output .= '<tr id=\"detailview_inventory_grandtotrow\">';\n\t$output .= '<td align=\"right\" class=\"crmTableRow small lineOnTop\"><b>' . $app_strings['LBL_GRAND_TOTAL'] . '</b></td>';\n\t$output .= '<td align=\"right\" class=\"crmTableRow small lineOnTop\" data-qagrandtotal=\"'.$grandTotal.'\">'.CurrencyField::convertToUserFormat($grandTotal, null, true).'</td>';\n\t$output .= '</tr>';\n\t$output .= '</table>';\n\n\t$log->debug('< getDetailAssociatedProducts');\n\treturn $output;\n}", "function px_get_product_info($id, $CTY = PX_CTY_DEFAULT, $CID = 0, $lid = '')\r\n{\r\n return px_api_call('buyat.affiliate.content.products.productinfo', PX_API_KEY, array('item_id' => $id, 'CTY' => $CTY, 'CID' => $CID, 'version' => PX_VERSION, 'lid' => $lid));\r\n}", "function getProduct($id){\n\t\t\t$sql=\"\n\t\t\t\tSELECT *\n\t\t\t\tFROM products P\n\t\t\t\tWHERE P.id=:id\"\n\t\t\t;\n\t\t\treturn $this->db->select($sql, array('id'=>$id));\n\t\t}", "public function getProductById($IdProduct);", "function getProduct($db, $productId)\r\n{\r\n$sql = 'Select p.name, p.description, p.price, c.name as category from products as p ';\r\n$sql .= 'Inner Join categories c on p.category_id = c.id ';\r\n$sql .= 'Where p.id = :id'; \r\n$stmt = $db->prepare ($sql);\r\n$id = (int) $productId;\r\n$stmt->bindParam(':id', $id, PDO::PARAM_INT);\r\n$stmt->execute();\r\nreturn $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n}" ]
[ "0.6953924", "0.6906407", "0.68483764", "0.6719636", "0.6665181", "0.66573936", "0.6609495", "0.65472764", "0.6508805", "0.650758", "0.6506574", "0.6483423", "0.64169985", "0.6415599", "0.6388552", "0.6363029", "0.63604486", "0.6354864", "0.63289565", "0.6328806", "0.631433", "0.6301847", "0.6281766", "0.6267632", "0.6265139", "0.6260944", "0.6259369", "0.6252958", "0.6240143", "0.62389135" ]
0.70419043
0
to get loggedin users association_id
public function getLoggedinUsers(){ $customerSession = $this->loggedinsession->create(); if($customerSession->isLoggedIn()){ $data=$customerSession->getCustomer()->getData(); if(isset($data['association_id'])){ return $data['association_id']; } else { return 0; } } else { return 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getUserIdCurent(){\n \treturn Auth::user()->id;\n }", "public function getAcountIdUserAuth(){\n $user = auth()->user();\n $cuenta=Cuenta::where('users_id',$user->id)->firstOrFail();\n return $cuenta->idcuenta_usuario;\n }", "public function getId()\n {\n return $this->user->id;\n }", "public function getIdUserSesion()\r\n {\r\n \t$id = $this->getContainerSession()->offsetGet('id');\r\n\r\n \treturn $id;\r\n }", "function _usersId(){\n $admin = false;\n if($this->Auth->user())\n return $this->Auth->user('nhanvien_id');\n }", "function get_login_user_id(){}", "private function id()\n {\n return $this->user->id ?? null;\n }", "protected function getLoggedInUserId()\n\t {\n\t try {\n\t if (Auth::guard('user')->check()) {\n\t return Auth::guard('user')->user()->getAuthIdentifier();\n\t }\n\n\t else if (Auth::guard('admin')->check()) {\n\t return Auth::guard('admin')->user()->getAuthIdentifier();\n\t }\n\t } catch (\\Exception $e) {\n\t return;\n\t }\n\t }", "public function id(){\n return $this->user()->id ?? null;\n }", "public function getId()\n {\n return $this->user_id;\n }", "private function getUserId()\n {\n return (is_null(Auth::user()) ? null : Auth::user()->id);\n }", "protected function determine_user_id() {\n\t\treturn $this->coauthor_user_id;\n\t}", "public function id(){\n $user = $this->user();\n return $user == null? null : $user->id;\n }", "public function getOppoUserid()\r\n {\r\n return $this->get(self::_OPPO_USERID);\r\n }", "public function getOppoUserid()\r\n {\r\n return $this->get(self::_OPPO_USERID);\r\n }", "public function getOppoUserid()\r\n {\r\n return $this->get(self::_OPPO_USERID);\r\n }", "public function getOppoUserid()\r\n {\r\n return $this->get(self::_OPPO_USERID);\r\n }", "public function getOppoUserid()\r\n {\r\n return $this->get(self::_OPPO_USERID);\r\n }", "public function getOppoUserid()\r\n {\r\n return $this->get(self::_OPPO_USERID);\r\n }", "private function getuserid() {\n\n\n $em = $this->getDoctrine()->getManager();\n $user_security = $this->container->get('security.context');\n // authenticated REMEMBERED, FULLY will imply REMEMBERED (NON anonymous)\n if ($user_security->isGranted('IS_AUTHENTICATED_FULLY')) {\n $user = $this->get('security.context')->getToken()->getUser();\n $user_id = $user->getId();\n /*$group = $user->getIdgroup();*/\n /*if (isset($group)) {\n $group_id = $group->getId();\n } else {\n $group_id = 0;\n }*/\n } else {\n $user_id = 0;\n // $group_id = 0;\n }\n return $user_id;\n }", "function get_user_id()\n {\n return $this->get_default_property(self::PROPERTY_USER_ID);\n }", "public function getIduser()\n {\n return $this->iduser;\n }", "function getID($user){}", "public function getUserId()\r\r\n {\r\r\n return $this->get('user_id');\r\r\n }", "public function getUserId() {\n return Auth::user()->id;\n }", "public function getId()\n {\n return Arr::get($this->user, 'sub');\n }", "function user_id(){\n\t\treturn $_SESSION['user']['id'];\n\t}", "public function getIduser()\r\n {\r\n return $this->iduser;\r\n }", "function getUserId();", "protected static function getUserID()\n {\n\t\treturn (\\Yii::$app->user->identity !== null) ? \\Yii::$app->user->identity->id : 0;\n\t}" ]
[ "0.6633617", "0.6559022", "0.6553778", "0.6491156", "0.6490964", "0.6481773", "0.64661175", "0.64575684", "0.6433526", "0.6403468", "0.6395737", "0.6355449", "0.6350015", "0.6348829", "0.6348829", "0.6348829", "0.6348829", "0.6348829", "0.6348829", "0.6346254", "0.63398266", "0.63217753", "0.63170373", "0.6313427", "0.63108486", "0.6305175", "0.63031334", "0.6297146", "0.6290567", "0.62712026" ]
0.70157176
0
Format the given package name.
protected function format($package) { return str_replace(app()->basePath('vendor').'/', '', $package); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function format($package)\n {\n return str_replace($this->vendorPath.'/', '', $package);\n }", "protected function _formatModuleName($name) {\n\t\t\n\t\t$bootstrap \t= $this->getBootstrap();\n \t$ns \t\t= $bootstrap->getOption('appnamespace');\n \t\n\t\tif ($name != 'default') {\n\n\t\t\t$lowerCaseNs \t= substr($name, 0, strpos($name, '-'));\n\t\t\t$moduleName \t= substr($name, strpos($name, '-') + 1);\n\t\t\t\n\t\t\t$formattedModuleName \t= parent :: _formatModuleName($moduleName);\n\t\t\t\n\t\t\tif (isset(self :: $namespaces[strtolower($lowerCaseNs)])) {\n\t\t\t\t$namespace = self :: $namespaces[$lowerCaseNs];\n\t\t\t\treturn \"${namespace}_${formattedModuleName}\";\n\t\t\t} else {\n\t\t\t\treturn \"${ns}_${formattedModuleName}\";\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n return \"${ns}_\" . parent :: _formatModuleName($name);\n \n }", "protected function getPackageName()\n {\n $name = $this->option('name');\n\n if (empty($name)) {\n $name = $this->getPackageBaseName();\n $name = strtolower($this->getVendorName($name) . '/' . $name);\n }\n\n $name = $this->ask('Package name (<vendor>/<name>)', $name);\n\n // vendor/name\n if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}D', $name)) {\n throw new \\InvalidArgumentException(\n 'The package name '.$name.' is invalid, it should be lowercase and have a vendor name, a forward slash, and a package name, matching: [a-z0-9_.-]+/[a-z0-9_.-]+'\n );\n }\n\n return $name;\n }", "public static function format(string $name): string\n {\n // strip out common symbols that don't meet the Discourse critera\n // sorry brits/europeans, I don't have a GBP/Euro symbol on my keyboard so just don't do that\n $fmtName = studly_case(preg_replace('/(\\!|\\@|\\#|\\$|\\%|\\^|\\&|\\*|\\(|\\)|\\+|\\=|\\{|\\}|\\[|\\]|\\/)+/', ' ', $name));\n\n // Discourse also doesn't allow the last symbol of a group name to be anything than a letter or number\n // lob anything else off\n // this has the potential to delete the whole string but if you make a group name consisting of all underscores you had it coming\n while(preg_match('/a-zA-Z0-9/', substr($fmtName, strlen($fmtName) - 1)) === 1){\n $fmtName = substr($fmtName, 0, strlen($fmtName) - 1);\n }\n\n return $fmtName;\n }", "public function get_package_name()\n {\n return $this->_package_name;\n }", "protected function _parsePackageString($package) {\n\t\t$bits = explode('.', $package);\n\t\treturn $this->slug(end($bits));\n\t}", "private function updatePackageArgument($package)\n {\n $result = preg_split('/[ :=]/', $package, 2);\n if ($result === false) {\n return $package;\n }\n $name = array_shift($result);\n\n if (! $this->isZendPackage($name)) {\n return $package;\n }\n\n $replacementName = $this->transformPackageName($name);\n $version = count($result) ? array_shift($result) : null;\n\n if ($version === null) {\n return $replacementName;\n }\n\n return sprintf('%s:%s', $replacementName, $version);\n }", "public function formatName($name, $file) {\r\n\t\treturn $name;\r\n\t}", "public function package($name)\n\t{\n\t\t$output = '';\n\n\t\t$sources = $this->preparePackageSources($name);\n\n\t\tforeach($sources as $source){\n\t\t\tlist($src, $ext) = $source;\n\t\t\t$output .= $this->$ext($src);\n\t\t}\n\n\t\treturn $output;\n\t}", "public function package($format);", "public static function Package() \n\t{ \n\t\treturn (string)self::tag('package'); \n\t}", "public function name(): string\n {\n return $this->vendor . '/' . $this->package;\n }", "private function formatClassName($namespace, $name)\n {\n return sprintf('%s\\\\%s',\n $namespace,\n ucfirst($name)\n );\n }", "public function name()\n {\n return $this->vendor() . '/' . $this->package();\n }", "private function formatName($name)\n {\n // ChargeLogController.php charge-log\n $nameArr = preg_split('/(?=[A-Z])/', $name, 0, PREG_SPLIT_NO_EMPTY);\n return strtolower(implode('-', $nameArr));\n }", "protected function getPackageBaseName()\n {\n $name = basename(getcwd() . '/' . $this->getDirectoryInput());\n $name = preg_replace('{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}', '\\\\1\\\\3-\\\\2\\\\4', $name);\n return strtolower($name);\n }", "public static function formatPackage(PackageInterface $package, $packageName, array $packageValue)\n {\n $packageValue['name'] = $packageName;\n\n if (!isset($packageValue['version'])) {\n $extra = $package->getExtra();\n $version = $package->getPrettyVersion();\n\n if (0 === strpos($version, 'dev-') && isset($extra['branch-alias'][$version])) {\n $version = $extra['branch-alias'][$version];\n }\n\n $packageValue['version'] = self::formatVersion(str_replace('-dev', '', $version));\n }\n\n return $packageValue;\n }", "public static function getPackageName () {}", "public function formattedName($format)\n {\n if (!is_null($this->name)) {\n return $this->name;\n }\n\n $name = '';\n $columns = explode(';', $this->columns);\n\n foreach ($columns as $col) {\n if ($name != '') {\n $name .= '_';\n }\n\n $name .= $col;\n }\n\n return ($this->name = (preg_replace('/{{index}}/', $name, preg_replace('/{{table}}/', $this->table, $format)) ?: 'Invalid_Name!'));\n }", "public function getPackageName();", "public function getPackageName()\n {\n return t('Starter Package');\n }", "public function getPackageName()\n {\n return $this->package_name;\n }", "public function getPackageName()\n {\n return $this->package_name;\n }", "public function formattedName($format)\n {\n if (!is_null($this->name)) {\n return $this->name;\n }\n\n return ($this->name = preg_replace('/{{ref_table}}/', $this->refTable, preg_replace('/{{table}}/', $this->table, $format)));\n }", "private function providerNameFromPackageName( $vendor_package )\n\t{\n\t\t\n\t\t$parts = explode( '/', $vendor_package );\n\t\t\n\t\t$vendor = file_exists( base_path() . '/vendor/' . $vendor_package );\n\t\t$workbench = file_exists( base_path() . '/workbench/' . $vendor_package );\n\n\t\tif (( $workbench ) or ( $vendor ))\n\t\t{\n\t\t\tif ( $vendor )\n\t\t\t\t$root = base_path() . '/vendor/' . $vendor_package . '/src/'; \n\t\t\telse\n\t\t\t\t$root = base_path() . '/workbench/' . $vendor_package . '/src/'; \n\n\n\t\t\t$dir = scandir( $root );\n\t\t\t$low = array_map('strtolower', $dir);\n\t\t\tif ( !in_array( $parts[0], $low ) ) return '';\n\n\t\t\t$vendor = $dir[ array_search( $parts[0], $low )];\n\t\t\t$root .= $vendor . '/';\n\n\t\t\t$dir = scandir( $root );\n\t\t\t$low = array_map('strtolower', $dir);\n\t\t\tif ( !in_array( $parts[1], $low ) ) return '';\n\n\t\t\t$package = $dir[ array_search( $parts[1], $low )];\n\t\t\t$root .= $package . '/';\n\t\t\t\n\t\t\t$dir = scandir( $root );\n\t\t\t$low = array_map('strtolower', $dir);\n\t\t\t$service = $parts[1] . 'serviceprovider.php';\n\t\t\tif ( !in_array( $service, $low ) ) return '';\n\n\t\t\t$provider = substr( $dir[ array_search( $service, $low )], 0, -4 );\n\n\t\t\treturn [\n\t\t\t\t'vendor_package' => $vendor_package,\n\t\t\t\t'path' => $vendor . '/' . $package . '/',\n\t\t\t\t'name' => $provider,\n\t\t\t\t'service' => $root . '/' . $provider . '.php',\n\t\t\t\t'mkdir' => $root . 'Facade' . '/',\n\t\t\t\t'facade_name' => $root . 'Facade' . '/' . $package,\n\t\t\t\t'facade_php' => $root . 'Facade' . '/' . $package . '.php',\n\t\t\t\t'class_php' => $root . $package . '.php',\n\t\t\t\t'namespace' => $vendor . '\\\\' . $package . '\\\\' . 'Facades',\n\t\t\t\t'shortname' => strtolower( $package ),\n\t\t\t\t'facadepath' => $vendor . '\\\\' . $package . '\\\\' . 'Facades' . '\\\\' . $package,\n\t\t\t\t'classname' => $package,\n\n\t\t\t];\n\n\t\t}\n\t\t\n\t\treturn '';\t\t\n\n\t}", "private function _format_filename($name, $cap = FALSE)\n\t{\n\t\tif(substr($name, -4) === '.php')\n\t\t{\n\t\t\t$str = str_replace('.', '_', substr($name, 0, -4));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$str = 'wgt_' . $name;\n\t\t}\n\n\t\treturn $cap ? ucfirst($str) : $str;\n\t}", "protected function getNamespaceFromPackageName($packageName)\n {\n $packageName = preg_replace('/[^\\/A-Za-z0-9_-]/', '', $packageName);\n $packageName = str_replace(' ', '', ucwords(str_replace(['-', '_'], ' ', $packageName)));\n return str_replace(' ', '\\\\', ucwords(str_replace('/', ' ', $packageName)));\n }", "public function format(string $format): string;", "public function setPackageName($var)\n {\n GPBUtil::checkString($var, True);\n $this->package_name = $var;\n\n return $this;\n }", "function get_package_name($SRPMS) {\n $pos1 = strrpos($SRPMS, \"-\");\n $str1 = substr($SRPMS, 0, $pos1);\n $pos2 = strrpos($str1, \"-\");\n $package_name = substr($str1, 0, $pos2);\n return $package_name;\n}" ]
[ "0.7169953", "0.67471874", "0.65690887", "0.64862823", "0.6264362", "0.6255679", "0.6243428", "0.6147979", "0.60609674", "0.6058324", "0.6055874", "0.6051952", "0.595594", "0.5902845", "0.5826464", "0.57848084", "0.57776815", "0.5771612", "0.57633007", "0.5743328", "0.57419604", "0.5685848", "0.5685848", "0.568124", "0.56549793", "0.5645528", "0.5634168", "0.56187886", "0.5580833", "0.55760074" ]
0.72510815
0
Set the PSETransacttionRequest's tax amount.
public function setTaxAmountAttribute($value) { $this->attributes['taxAmount'] = (float) $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setTaxAmount($taxAmount);", "public function setShippingInclTax($amount);", "public function setTax($tax)\n {\n $this->tax = $tax;\n }", "public function setBaseShippingInclTax($amount);", "function setTaxRate($rate=0.0){\r\n\t\t$this->taxRate = $rate;\r\n\t}", "public function setShippingTaxAmount($amount);", "function setTaxRate($taxRate) {\n\t\t// Ensures that percent values are changed to decimal\n\t\tif ($taxRate > 1)\n\t\t\t$taxRate = $taxRate / 100;\n\n\t\t$this->taxRate = $taxRate;\n\t\t$this->calcTotal();\n\t}", "public function setBaseShippingTaxAmount($amount);", "public function setTaxAmount(?float $taxAmount): self\n {\n $this->initialized['taxAmount'] = true;\n $this->taxAmount = $taxAmount;\n\n return $this;\n }", "public function setBillingTaxAttribute($value)\n {\n $this->attributes['billing_tax'] = $value*100;\n }", "public function setTax(?float $tax): self\n {\n $this->initialized['tax'] = true;\n $this->tax = $tax;\n\n return $this;\n }", "public function setTax(?float $tax): self\n {\n $this->initialized['tax'] = true;\n $this->tax = $tax;\n\n return $this;\n }", "public function setAmountTax($amountTax) {\r\n $this->amountTax = $amountTax;\r\n }", "public function setItemTax($value)\n {\n $this->_fields['ItemTax']['FieldValue'] = $value;\n return $this;\n }", "public function setTaxMoney(?Money $taxMoney): void\n {\n $this->taxMoney = $taxMoney;\n }", "public function setTaxIncluded ($taxIncluded)\n {\n $this->taxIncluded = $taxIncluded;\n }", "public function setTaxCode($rate)\n {\n $this->taxCode = number_format($rate * 100, 2);\n }", "public function setShippingTax($value)\n {\n $this->_fields['ShippingTax']['FieldValue'] = $value;\n return $this;\n }", "public function setTaxMode(string $taxMode): void\n {\n $this->taxMode = $taxMode;\n }", "public function setTransactionAmount($value) \n {\n $this->_fields['TransactionAmount']['FieldValue'] = $value;\n return;\n }", "public function setShippingDiscountTaxCompensationAmount($amount);", "public function setTaxRateOverride( float $taxRateOverride )\n {\n $this->taxRateOverride = $taxRateOverride;\n\n return $this;\n }", "protected function setTax_id($value)\n\t{\n\t\tif (isInt($value) || is_null($value)) { $this->tax_id = $value; }\n\t}", "public function withItemTax($value)\n {\n $this->setItemTax($value);\n return $this;\n }", "public function setTaxes(?array $taxes): void\n {\n $this->taxes['value'] = $taxes;\n }", "public function setTaxRate($taxRate)\n {\n if (empty($taxRate) || ! is_numeric($taxRate)) {\n throw new \\InvalidArgumentException('Please supply a valid tax rate.');\n }\n\n $this->taxRate = $taxRate;\n \n return $this;\n }", "public function setAmount($amount)\n {\n $this->amount = $amount;\n }", "public function setAmount($amount)\n {\n $this->amount = $amount;\n }", "public function taxPercentage() {\n return 20;\n }", "public function setTaxRate(float $taxRate): self\n {\n $this->taxRate = $taxRate;\n\n return $this;\n }" ]
[ "0.73567", "0.6927831", "0.6808148", "0.6781379", "0.6721028", "0.6714678", "0.66940063", "0.6588327", "0.6437531", "0.6420219", "0.6362956", "0.6362956", "0.63554823", "0.63345176", "0.63104486", "0.6215281", "0.60173833", "0.5956965", "0.5868906", "0.5746273", "0.57050157", "0.5689508", "0.5662457", "0.56319886", "0.5611914", "0.5585265", "0.5522176", "0.5522176", "0.55069536", "0.5494913" ]
0.6945538
1
Set the PSETransacttion request's devolution base.
public function setDevolutionBaseAttribute($value) { $this->attributes['devolutionBase'] = (float) $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setRequestParameters() {\n $amount = $this->parameters['amount'] ;\n\n $this->clearParameters() ;\n $this->setParameter('transaction_identifier', $this->identifier) ;\n $this->setParameter('amount', $amount) ;\n $this->setParameter('signature', $this->generateSignature($this->parameters)) ;\n $this->setParameter('vendor_token', $this->getLydiaVendorToken()) ;\n }", "public function getIdetapedebase()\n {\n return $this->idetapedebase;\n }", "function setDataBase($dtBaseCalculo) {\n $this->oObjCalculo->setDataBase($dtBaseCalculo);\n }", "public function set_request($request)\n\t{\n\t\t$this->request = $this->complete_request = trim($request);\n\t}", "public function setEstudiante( $estudiante ){\n\t\t$this->estudiante = $estudiante;\n\t}", "private function decomposeSetChargeRequest() {\n\t\t// retrieve XML data\n\t\tif ($this->xmlRequest->otokou->body) {\n\t\t\tif ($this->xmlRequest->otokou->body->username) {\n\t\t\t\t$this->requestUsername = trim($this->xmlRequest->otokou->body->username);\n\t\t\t\tif ($this->xmlRequest->otokou->body->apikey) {\n\t\t\t\t\t$this->requestApiKey = trim($this->xmlRequest->otokou->body->apikey);\n\t\t\t\t\tif ($this->xmlRequest->otokou->body->vehicle_id) {\n\t\t\t\t\t\t$this->requestVehicle = trim($this->xmlRequest->otokou->body->vehicle_id);\n\t\t\t\t\t\tif ($this->xmlRequest->otokou->body->category_id) {\n\t\t\t\t\t\t\t$this->requestCategory = trim($this->xmlRequest->otokou->body->category_id);\n\t\t\t\t\t\t\tif ($this->xmlRequest->otokou->body->date) {\n\t\t\t\t\t\t\t\t$this->requestDate = trim($this->xmlRequest->otokou->body->date);\n\t\t\t\t\t\t\t\tif ($this->xmlRequest->otokou->body->kilometers) {\n\t\t\t\t\t\t\t\t\t$this->requestKilometers = trim($this->xmlRequest->otokou->body->kilometers);\n\t\t\t\t\t\t\t\t\tif ($this->xmlRequest->otokou->body->amount) {\n\t\t\t\t\t\t\t\t\t\t$this->requestAmount = trim($this->xmlRequest->otokou->body->amount);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif ($this->xmlRequest->otokou->body->comment) $this->requestComment = trim($this->xmlRequest->otokou->body->comment);\n\t\t\t\t\t\t\t\t\t\telse $this->requestComment = \"\";\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif ($this->xmlRequest->otokou->body->quantity) $this->requestQuantity = trim($this->xmlRequest->otokou->body->quantity);\n\t\t\t\t\t\t\t\t\t\telse $this->requestQuantity = \"\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse $this->setError(167);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse $this->setError(166);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse $this->setError(165);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse $this->setError(164);\n\t\t\t\t\t}\n\t\t\t\t\telse $this->setError(163);\n\t\t\t\t}\n\t\t\t\telse $this->setError(162);\n\t\t\t}\n\t\t\telse $this->setError(161);\n\t\t}\n\t\telse $this->setError(160);\n\t\t\n\t\t// check values\n\t\tif (!$this->isError) $this->checkSetChargeValues();\n\t}", "public function __construct(Sede $sede) {\n $this->sede = $sede;\n }", "public function setRequest($request)\n {\n $this->_request = $request;\n }", "public function setTxSalDecote($txSalDecote) {\n $this->txSalDecote = $txSalDecote;\n return $this;\n }", "final public function setRequest(\\sb\\Request $request)\n {\n\n $this->request = $request;\n\n $request->setInputArgsDelimiter($this->input_args_delimiter);\n }", "public function setIdetapedebase($idetapedebase)\n {\n $this->idetapedebase = $idetapedebase;\n\n return $this;\n }", "function setRequest(&$request)\r\n\t{\r\n\t\t$this->request =& $request;\r\n\t}", "function setSofortDauerauftrag() {\n\t\t$this->paymentMethods[] = 'sa';\n\t\tif(!array_key_exists('sa', $this->parameters) || !is_array($this->parameters['sa'])) {\n\t\t\t$this->parameters['sa'] = array();\n\t\t}\n\t\treturn $this;\n\t}", "private function setBaseUrl($transactionUuid = null) {\n\t\tif ($transactionUuid === null) {\n\t\t\t$this->resourceHelper->requestOptions['baseUrl'] = $this->resourceHelper->getScope()->getBaseUrl() .\n\t\t\t 'payment';\n\t\t} else {\n\t\t\t$this->resourceHelper->requestOptions['baseUrl'] = $this->resourceHelper->getScope()->getBaseUrl() .\n\t\t\t 'transaction/' . $transactionUuid . '/payment';\n\t\t}\n\t}", "public function setRequest($request);", "public function setRequest($request);", "public function setBaseRequest(\\BaseRequest $value=null)\n {\n return $this->set(self::BASEREQUEST, $value);\n }", "public function setDataBase( $dataBaseAStr )\n {\n $this->dataBaseCObj = $this->connectionCObj->$dataBaseAStr;\n }", "public function setRequest(\\phpbb\\request\\request $request);", "public function setEndPoint($endPoint) \n {\n $this->endPoint = $endPoint;\n }", "function get_decidir_endpoint(){\n return $this->decidir_endpoint;\n }", "public function setValorBase($nValorBase) {\n $this->nValorBase = $nValorBase;\n }", "public function setRequest($request)\r\n {\r\n $this->request = $request;\r\n }", "public function setBaseURL($baseURL){\n\t\t$this->baseURL = $baseURL;\n\t}", "public function setTransactionId($transaction_id)\r\n{\r\n$this->post_data['transactionId'] = $transaction_id;\r\n}", "private function setBase(): self\n {\n $this->base = empty($_SERVER['BASE']) ? '' : $_SERVER['BASE'];\n\n return $this;\n }", "private function setEndDate() {\r\n if (array_key_exists('end', $this->requestParameters)) {\r\n $end = $this->requestParameters['end'];\r\n } else {\r\n $end = self::runEventsEdgeQuery('DESC', TRUE);\r\n }\r\n\r\n $e = new DateTime($end);\r\n $this->end = $e->format('Y-m-d H:i:s');\r\n }", "function processPostVars()\n {\n $this->relation = $_POST['se_rel'];\n }", "public function getPasSousTotSBase() {\n return $this->pasSousTotSBase;\n }", "public function setEdad($edad){\n parent::setEdad(\"$edad años\"); //tenemos que heredar ya que edad es private\n }" ]
[ "0.49172878", "0.46936843", "0.4656636", "0.4494632", "0.44893634", "0.448832", "0.44839558", "0.44758996", "0.44698426", "0.44612765", "0.4391851", "0.43907028", "0.43840197", "0.43662506", "0.43646622", "0.43646622", "0.43467638", "0.4346574", "0.43414596", "0.43343562", "0.43102142", "0.4310083", "0.4305172", "0.42854154", "0.42804456", "0.4280068", "0.42731547", "0.42593557", "0.4258349", "0.42431426" ]
0.59663075
0
Set the PSETransacttionRequest's tip amount.
public function setTipAmountAttribute($value) { $this->attributes['tipAmount'] = (float) $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAmountTip($amountTip) {\r\n $this->amountTip = $amountTip;\r\n }", "public function setTipMoney(?Money $tipMoney): void\n {\n $this->tipMoney = $tipMoney;\n }", "public function TipAdjustment($params = null)\r\n {\r\n return $this->GetCURLResponse('Transaction/TipAdjustment',\r\n $this->ArrayToParamString($params), \r\n $this->GetEncryptedCheckSum( $this->ArrayToEncryptableString($params)));\r\n }", "public function increment_tip() {\n\n\n\t\tif (!$this->Session->check(\"Order.Order.tip\")) {\n\t\t\tthrow new Exception(__('Order Tip does not exists for incrementation'));\n\t\t}\n\n\t\t// Increment items current quantity\n\t\t$tip = $this->Session->read(\"Order.Order.tip\");\n\t\t$this->Session->write(\"Order.Order.tip\", $tip + 1);\n\n\t\t// Update order\n\t\t$this->checkout();\n\t}", "public function setTotalTipMoney(?Money $totalTipMoney): void\n {\n $this->totalTipMoney = $totalTipMoney;\n }", "public function setShippingInclTax($amount);", "public function __construct($tip)\n {\n $this->tip = $tip;\n }", "public function tipMoney(?Money $value): self\n {\n $this->instance->setTipMoney($value);\n return $this;\n }", "public function setnPerTelTipNew($nPerTelTipNew_ = 1 ){ $this->nPerTelTipNew=$nPerTelTipNew_;}", "public function decrement_tip() {\n\n\t\tif (!$this->Session->check(\"Order.Order.tip\")) {\n\t\t\tthrow new Exception(__('Order Tip does not exists for decrementation'));\n\t\t}\n\n\t\t// Decrement items current quantity\n\t\t$tip = $this->Session->read(\"Order.Order.tip\");\n\t\t$tip -= 1;\n\t\tif ($tip < 1) {\n\t\t\t$this->Session->write(\"Order.Order.tip\", '0'); // Remove item if quantity is 0\n\t\t} else {\n\t\t\t$this->Session->write(\"Order.Order.tip\", $tip); // set item quantity to Decremented value\n\t\t}\n\n\t\t// Update order\n\t\t$this->checkout();\n\t}", "public function testSetTotpOffset() {\n $this->assertInstanceOf('Otp\\Otp', $this->Otp->setTotpOffset(100));\n }", "public function testSetTotpOffsetWithInvalid() {\n $this->Otp->setTotpOffset(0.1);\n }", "public function setBaseShippingInclTax($amount);", "public function setTaxAmountAttribute($value)\n {\n $this->attributes['taxAmount'] = (float) $value;\n }", "public function setTransactionAmount($value) \n {\n $this->_fields['TransactionAmount']['FieldValue'] = $value;\n return;\n }", "public function setTier($value)\n {\n $this->setProperty(\"Tier\", $value, true);\n }", "function calculateTip($mealCost, $tip = 20)\n {\n return $mealCost * (1 + ($tip/100));\n }", "public function setAmount($amount){\n // if($amount <= floatval(0)){\n // throw new \\PWall\\Exception\\InvalidArgumentException('Order amount must be more than 0');\n // }\n $this->amount = strval($amount * 100);\n }", "function setAmount($amount);", "public function setNip($nip);", "public function setPeso( $peso ) {\n $this->request->peso = $peso;\n }", "public function setShippingTaxAmount($amount);", "function setUtentePrenotazione ( $utentePrenotazione)\n\t{\n $this->utentePrenotazione = $utentePrenotazione;\n }", "public function setAmount($Amount)\n {\n $this->__set(\"amount\", $Amount);\n }", "private function setScaExemptionData($request)\n {\n /** @var \\Genesis\\API\\Request\\WPF\\Create $request */\n\n $wpf_amount = (float)$request->getAmount();\n if ($wpf_amount <= $this->getSetting('SCA_EXEMPTION_AMOUNT')) {\n $request->setScaExemption($this->getSetting('SCA_EXEMPTION'));\n }\n }", "public function setZusatztippAction() {\n\n $spiel = $this->spielService->findModusSpiele(5);\n\n if ($spiel[0]['status'] == 0) {\n\n $this->flashMessenger()->addErrorMessage('Zusatztipp Ergebnis eintragen nicht moeglich. Finale noch nicht abgeschlossen!');\n\n return $this->redirect()->toRoute('zfcadmin');\n }\n\n $request = $this->getRequest();\n\n if ($request->isPost()) {\n\n $this->zusatztippForm->setData($request->getPost());\n\n if ($this->zusatztippForm->isValid()) {\n\n try {\n\n $i = 0;\n $stati = $this->tippService->isActive();\n $status = array();\n\n foreach ($stati as $s) {\n $status[++$i] = $s['status'];\n }\n\n // if-Abfragen zum überprüfen, ob Zusatztipp aktiv\n if ($status[1]) {\n $this->tippService->setZusatztipp('1', $this->zusatztippForm->get('platz1')->getValue());\n $this->tippService->zusatzPunkteBerechnen(1);\n }\n if ($status[2]) {\n $this->tippService->setZusatztipp('2', $this->zusatztippForm->get('platz2')->getValue());\n $this->tippService->zusatzPunkteBerechnen(2);\n }\n if ($status[3]) {\n $this->tippService->setZusatztipp('3', $this->zusatztippForm->get('platz3')->getValue());\n $this->tippService->zusatzPunkteBerechnen(3);\n }\n if ($status[4]) {\n $this->tippService->setZusatztipp('4', $this->zusatztippForm->get('fair')->getValue());\n $this->tippService->zusatzPunkteBerechnen(4);\n }\n if ($status[5]) {\n $this->tippService->setZusatztipp('5', $this->zusatztippForm->get('unfair')->getValue());\n $this->tippService->zusatzPunkteBerechnen(5);\n }\n if ($status[6]) {\n $this->tippService->setZusatztipp('6', $this->zusatztippForm->get('tore')->getValue());\n $this->tippService->zusatzPunkteBerechnen(6);\n }\n\n return $this->redirect()->toRoute('zfcadmin');\n\n } catch (\\Exception $e) {\n die($e->getMessage());\n //Some DB Error happened, log it and let the user know\n }\n }\n }\n\n $form = $this->zusatztippForm;\n\n return array(\n 'form' => $form\n );\n }", "public function setTaxAmount($taxAmount);", "public function settxfee($amount) {\n\n $args = $this->args;\n $args[ \"method\" ] = __FUNCTION__;\n $args[ \"params\" ] = [ $amount ];\n\n $res = $this->call($args);\n if ($res)\n return $res[ \"result\" ];\n }", "public function setQty($qty) {\n $this->qty = $qty;\n }", "public function set_tip_or_fees($code, $amount = 0)\n {\n $amount = floatval($amount);\n if ($code == parent::FEE_INDICATOR_TIP)\n {\n $this->tip_or_convenience_fee_indicator = $code;\n } else if ($code == parent::FEE_INDICATOR_CONVENIENCE_FEE_FIXED)\n {\n $this->tip_or_convenience_fee_indicator = $code;\n if (0.00 < $amount && $amount <= 9999999999.99)\n {\n $this->convenience_fee_fixed = number_format($amount, 2, '.', '');\n } else\n {\n return $this->return_status(FALSE, self::STATUS_INVALID_VALUE, parent::ID_VALUE_OF_FEE_FIXED);\n }\n } else if ($code == parent::FEE_INDICATOR_CONVENIENCE_FEE_PERCENTAGE)\n {\n $this->tip_or_convenience_fee_indicator = $code;\n if (0.00 < $amount && $amount < 100.00)\n {\n $this->convenience_fee_percentage = number_format($amount, 2, '.', '');\n } else\n {\n return $this->return_status(FALSE, self::STATUS_INVALID_VALUE, parent::ID_VALUE_OF_FEE_PERCENTAGE);\n }\n } else\n {\n return $this->return_status(FALSE, self::STATUS_INVALID_VALUE, parent::ID_TIP_OR_CONVENIENCE_FEE_INDICATOR);\n }\n return $this->return_status(TRUE);\n }" ]
[ "0.7043907", "0.61017984", "0.5637491", "0.5486345", "0.5245482", "0.5173697", "0.5126225", "0.5089313", "0.5042299", "0.49349812", "0.4931054", "0.48961306", "0.48326302", "0.48269078", "0.4822008", "0.4788332", "0.475485", "0.46625945", "0.45771614", "0.4571394", "0.45573235", "0.45434657", "0.451165", "0.44854495", "0.4458822", "0.4440866", "0.44064653", "0.44056275", "0.44014105", "0.4388279" ]
0.68058133
1
Provides operations to call the removeMembersById method.
public function microsoftGraphWindowsUpdatesRemoveMembersById(): MicrosoftGraphWindowsUpdatesRemoveMembersByIdRequestBuilder { return new MicrosoftGraphWindowsUpdatesRemoveMembersByIdRequestBuilder($this->pathParameters, $this->requestAdapter); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeMember($name, $cmp_id) {\n $mysqli = $this->connect();\n\n $query = \"DELETE FROM members USING members, sheets WHERE members.sheet=sheets.id AND sheets.name=? AND members.campaign=?\";\n $query = $mysqli->real_escape_string($query);\n\n $stmt = $mysqli->stmt_init();\n\n if(!$stmt->prepare($query)) {\n\tprintf(\"Failed to prepare statement!\");\n } else {\n\t$stmt->bind_param('si', $name, $cmp_id);\n\t$stmt->execute();\n }\n\n $stmt->close();\n $mysqli->close();\n }", "public function remove($id);", "public function remove($id);", "public function remove($id);", "public function remove($id);", "public function remove($id);", "public function remove($id);", "public function remove($id);", "public function remove($id);", "public function actionRemove()\n {\n $requestBody = Yii::$app->request->get();\n $id = $requestBody['id'];\n $user = $requestBody['user'];\n $secret = $requestBody['secret'];\n\n if (empty($id) || empty($user) || empty($secret)) {\n return $this->throwError('missing parameter');\n }\n\n if ($secret != $this->verifySecret($id, $user)) {\n return $this->throwError('access denied');\n }\n\n $settings = $this->getSettings();\n $url = 'https://api.twitter.com/1.1/lists/members/destroy.json';\n $requestMethod = 'POST';\n $postfields = array(\n 'screen_name' => $user\n );\n $twitter = new \\TwitterAPIExchange($settings);\n if ($twitter) {\n $twitter->buildOauth($url, $requestMethod)\n ->setPostfields($postfields)\n ->performRequest();\n } else {\n return $this->throwError('internal error');\n }\n\n }", "public function destroy($id)\n {\n $member = Member::find($id);\n $member->delete();\n }", "function removeMember($id) {\r\n global $DB, $Controller, $USER;\r\n\r\n if(is_numeric($id)) {\r\n $obj = $Controller->get($id);\r\n }\r\n elseif(is_a($id, 'Base')) {\r\n $obj = $id;\r\n $id = $obj->ID;\r\n }\r\n else {\r\n return false;\r\n }\r\n\r\n if((in_array($this->GroupType, array('vol', 'volpre')) && $id == $USER->ID)\r\n || $this->mayI(EDIT)) {\r\n $this->loadMembers();\r\n if(in_array($id, $this->_MEMBERS) XOR $this->GroupType == 'volpre') {\r\n /*\r\n * Prevent deletion of the last administrator\r\n */\r\n if($this->ID === ADMIN_GROUP && count($this->_MEMBERS) == 1) return false;\r\n\r\n if($this->GroupType == 'volpre') {\r\n $DB->group_members->insert(array('user' => $id, 'group' => $this->ID), false, true, true);\r\n } else {\r\n $DB->group_members->delete(array('user' => $id, 'group' => $this->ID));\r\n }\r\n $this->_MEMBERS = arrayRemove($this->_MEMBERS, $id, true);\r\n Log::write('Removed member \\'' . $obj->Name . '\\' (id=' . $id . ') from group \\'' . $this->Name . '\\' (id=' . $this->ID . ')', 10);\r\n\r\n return true;\r\n } else return false;\r\n } else\r\n return false;\r\n }", "public function remove($id)\n {\n }", "function delete_Member_delete($id) {\n \n $result = $this->wm->delete_Member($id);\n if ($result === FALSE) {\n $this->response(array('status' => 'failed'));\n } else {\n $this->response(array('status' => 'success'));\n }\n }", "public function remove($id, $memberId)\n {\n return $this->delete($this->getPath($id).'/'.$memberId);\n }", "public function delete($id){\n if($id){\n // Delete member\n $delete = $this->member->delete($id);\n \n if($delete){\n $this->session->set_userdata('success_msg', 'Member has been removed successfully.');\n }else{\n $this->session->set_userdata('error_msg', 'Some problems occured, please try again.');\n }\n }\n \n // Redirect to the list page\n redirect('members');\n }", "public function delete($id){\n if($id){\n // Delete member\n $delete = $this->member->delete($id);\n \n if($delete){\n $this->session->set_userdata('success_msg', 'Member has been removed successfully.');\n }else{\n $this->session->set_userdata('error_msg', 'Some problems occured, please try again.');\n }\n }\n \n // Redirect to the list page\n redirect('members');\n }", "public function remove(string $id): void;", "public function delete_member($id)\n {\n $this->admin_model->delete_member_by_id($id);\n echo json_encode(array('status' => TRUE));\n }", "function remove($id){\n\t}", "function portal_delete_member($member_id) {\n\t\n\t$query = 'DELETE FROM portal_members WHERE member_id = ?';\n\t$params = array($member_id);\n\t$status = mystery_delete_query($query, $params, 'portal_dbh');\n\t\n\t$query = 'DELETE FROM portal_class_students WHERE member_id = ?';\n\t$params = array($member_id);\n\t$status = mystery_delete_query($query, $params, 'portal_dbh');\n\n}", "function delete($id){\n $data = Member::find($id);\n $data->delete();\n return redirect('remove');\n }", "public function deleteMember($id)\n {\n if ($id != null) {\n $this->firebase->delete('/users' . '/' . $id);\n }\n }", "public function removeMember(Request $request)\n {\n //Validate request is right format input.\n $validator = Validator::make(\n $request->all(),\n [\n 'UserId' => 'required|numeric',\n 'key' => 'required|string',\n 'token' => 'required|string',\n ]\n );\n if ($validator->fails()) {\n return response()->json(\n [$validator->errors()],\n 422\n );\n }\n //Select USerID from token\n $User_id = Users::where('token', '=', $request->token)->select('id')->first();\n //Select ProjectId from key\n $Project_id = Projects::where('key', '=', $request->key)->select('id')->first();\n //Check User is Project owner \n $Project_Member_check = Projects_Users::where('idUser', '=', $User_id->id)\n ->where('idProject', '=', $Project_id->id)\n ->select('Type')\n ->first();\n //Remove member list id User is Project Owner\n if ($Project_Member_check != null) {\n $User_remove = Projects_Users::where('idUser', '=', $request->UserId)->first();\n //If User exist from Project-> remove User from Project\n if ($User_remove != null) {\n $User_remove->delete();\n }\n //If User does exist -> return error string.\n else {\n return response()->json(\n \"User have id=\" . $request->UserId . \" does not exist in Project.\",\n 204\n );\n }\n\n return \"Successful.\";\n } else {\n return response()->json(\n \"You must be a member of Project if you want to remove Member from Project\",\n 405\n );\n }\n }", "function command_member_membership_delete () {\n global $esc_post;\n \n // Verify permissions\n if (!user_access('member_membership_edit')) {\n error_register('Permission denied: member_membership_edit');\n return 'index.php?q=members';\n }\n\n // Delete membership\n $sql = \"DELETE FROM `membership` WHERE `sid`='$esc_post[sid]'\";\n $res = mysql_query($sql);\n if (!$res) die(mysql_error());\n\n return 'index.php?q=members';\n}", "public function remove (){\n extract( $this->kernel->params );\n\n if( $id and preg_match('|^[\\d,]+$|', $id ) )\n $this->kernel->db->query(\"DELETE FROM {$this->table} WHERE id IN ($id)\");\n\n }", "public function removeAction(int $id);", "public function destroy($id)\n {\n User::labMembers()->findOrFail($id)->delete();\n\n flash('Lab member successfully removed.');\n\n return redirect(route('members.index'));\n }", "function remove_member_post(){\n $user_id = '';\n $board_id = '';\n $data['ResponseCode'] = 500;\n $message = \"Invalid request.\"; \n $this->form_validation->set_rules('user_id', 'User Id', 'trim|required');\n $this->form_validation->set_rules('board_id', 'Board Id', 'trim|required');\n $this->form_validation->set_rules('member_id', 'Member Id', 'trim|required');\n if($this->form_validation->run() == TRUE){ \n $userId = $this->post('user_id');\n $boardId = $this->post('board_id');\n $member_id = $this->post('member_id');\n $boardInfo = $this->api_model->get_row('boards',array('id' =>$boardId, 'user_owner_id' =>$userId));\n $members ='';\n if(!empty($boardInfo))\n {\n \n if(!empty($member_id)){\n if($boardInfo->boards_users){\n $users = explode(\",\", $boardInfo->boards_users);\n $member_id = array(\"#\".$member_id.\"#\");\n $usersNews = array_diff($users, $member_id);\n if(!empty($usersNews)){\n $members = implode(',', $usersNews);\n }\n }\n }\n $update = $this->api_model->update('boards',array('boards_users' =>$members),array('id'=>$boardId)); \n $data['ResponseCode'] = 200;\n $data['message'] = \"Member removed successfully\";\n \n }else{\n $data['message'] = \"Please check board id and user id\";\n } \n \n } \n if($this->form_validation->error_array()) \n $data['error'] = $this->form_validation->error_array() ; \n $this->response($data);\n }", "function remove() {\n\t\t$this->_remove();\n\t\t$userGroupsCache = &UserGroup::getUserGroupsCache();\n\t\t$userGroupsCache = array_remove($userGroupsCache, $this->id);\n\t\tUser::buildUsersCache();\n\t}" ]
[ "0.6427812", "0.635649", "0.635649", "0.635649", "0.635649", "0.635649", "0.635649", "0.635649", "0.635649", "0.63249433", "0.63143015", "0.62939954", "0.6288392", "0.6263457", "0.6228634", "0.6186251", "0.6186251", "0.61577666", "0.61082524", "0.6061696", "0.60581374", "0.6049541", "0.6010084", "0.6001758", "0.59919614", "0.59831035", "0.59493715", "0.5897712", "0.58763164", "0.5818899" ]
0.63879156
1
Checks if all keys of key_arr are present in assoc_array.
protected function assoc_array_keys_exist($assoc_array, $key_arr) { foreach ($key_arr as $key) { if (!isset($assoc_array[$key])) return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function is_assoc(array $arr){\r\n\t\t$key = array_keys($arr);\r\n\t\treturn $key !== array_keys($key);\r\n\t}", "function emptyakey(&$arr)\n{\n\tif ( empty($arr) )\n\t\treturn true;\n\tif ( !is_array($arr) || $func_num_args() < 2 )\n\t\treturn false;\n\treturn !array_key_exists($key, $arr);\n}", "public static function isAssociative(array $arr) {\n if (array() === $arr) return false;\n return array_keys($arr) !== range(0, sizeof($arr) - 1);\n }", "function array_keys_exist($keyArray, $array) {\n\t\t\tforeach($keyArray as $key) {\n\t\t\t\tif(!array_key_exists($key, $array))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "function is_assoc(array $arr)\n {\n return count(array_filter(array_keys($arr), 'is_string')) > 0;\n }", "public static function isAssoc($arr)\n {\n return (bool) count(array_filter(array_keys($arr), 'is_string'));\n }", "public static function isAssoc(array $arr)\n {\n return (is_array($arr) && (!count($arr) || count(array_filter(array_keys($arr),'is_string')) == count($arr)));\n }", "private function isAssociative(array $arr)\n {\n return array_keys($arr) !== range(0, count($arr) - 1);\n }", "static function is_assoc($arr)\n\t{\n\t if (!is_array( $arr ) || array() === $arr) {\n\t \treturn false;\n\t }\n\t return array_keys($arr) !== range(0, count($arr) - 1);\n }", "public function isAssoc($arr)\n {\n return array_keys($arr) !== range(0, count($arr) - 1);\n }", "private function isAssoc(array $arr)\n {\n if (array() === $arr) {\n return true;\n }\n return array_keys($arr) !== range(0, count($arr) - 1);\n }", "function array_keys_exist( array $array, $keys ) {\n $count = 0;\n if ( ! is_array( $keys ) ) {\n $keys = func_get_args();\n array_shift( $keys );\n }\n foreach ( $keys as $key ) {\n if ( array_key_exists( $key, $array ) ) {\n $count ++;\n }\n }\n \n return count( $keys ) === $count;\n}", "public function isAssoc( $arr )\n\t{\n\t\treturn array_keys($arr) !== range(0, count($arr) - 1);\n\t}", "private static function is_associative(array $arr) {\n foreach ($arr as $key => $value) {\n if (is_string($key)) return true;\n }\n return false;\n }", "public static function isAssocArray($array)\n {\n $array = array_keys($array);\n return ($array !== array_keys($array));\n\n }", "function is_assoc($ar){\n // Keys of the array\n $keys = array_keys($ar);\n\n // If the array keys of the keys match the keys, then the array must\n // not be associative (e.g. the keys array looked like {0:0, 1:1...}).\n return array_keys($keys) !== $keys;\n }", "function array_keys_exists(array $keys, array $arr)\n{\n return !array_diff_key(array_flip($keys), $arr);\n}", "function isAssoc($arr)\n {\n if ([] === $arr) {\n return false;\n }\n return array_keys($arr) !== range(0, count($arr) - 1);\n }", "public static function is_assoc($array) {\n $keys = array_keys($array);\n return array_keys($keys) !== $keys;\n }", "public static function isAssoc($array) {\n return (is_array($array) && 0 !== count(array_diff_key($array, array_keys(array_keys($array)))));\n }", "function multiKeyExists(array $arr, $key) { if (array_key_exists($key, $arr)) {\n return true;\n }\n\n // check arrays contained in this array\n foreach ($arr as $element) {\n if (is_array($element)) {\n if (multiKeyExists($element, $key)) {\n return true;\n }\n }\n\n }\n\n return false;\n}", "public static function isAssoc($arr)\n\t{\n\t\tforeach ($arr as $key => $unused)\n\t\t{\n\t\t\tif ( ! is_int($key))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public static function is_assoc( array $array ){\n\t\t$keys = array_keys( $array );\n\t\treturn array_keys( $keys) !== $keys;\n\t}", "private static function isAssoc($array){\n\t\treturn count(array_filter(array_keys($array), 'is_string')) > 0;\n\t}", "public static function isKeyIn($keys, $array, $all = false)\n\t{\n\t\tif (!$array) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$keys = (array)$keys;\n\n\t\tforeach ($keys as $k) {\n\t\t\tif (isset($array[$k])) {\n\t\t\t\tif (!$all) return true;\n\t\t\t} else {\n\t\t\t\tif ($all) return false;\n\t\t\t}\n\t\t}\n\n\t\tif ($all) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function hasAll(array $key): bool;", "protected static function _keyExists(array $arr, $key)\n {\n if (array_key_exists($key, $arr)) {\n return true;\n }\n\n foreach (explode('.', $key) as $keySeg) {\n if (!is_array($arr) || !array_key_exists($keySeg, $arr)) {\n return false;\n }\n\n $arr = $arr[$keySeg];\n }\n\n return true;\n }", "private static function isAssoc( $array ) {\n return (is_array($array) && 0 !== count(array_diff_key($array, array_keys(array_keys($array)))));\n }", "public function array_keys_exists( $array, $keys )\n {\n foreach ( $keys as $k ) {\n if ( !isset( $array[$k] ) ) {\n return false;\n }\n }\n return true;\n }", "function exists($array,$keys){\n $check=0;\n for($i=0;$i<count($keys);$i++){\n if(array_key_exists($keys[$i],$array)){\n $check++;\n }\n }\n if($check == count($keys)){\n return true;\n }else{\n return false;\n }\n }" ]
[ "0.75574434", "0.7504653", "0.7492618", "0.7489046", "0.7399669", "0.7391114", "0.7338989", "0.73131114", "0.7302296", "0.7212676", "0.72085243", "0.7155086", "0.71178794", "0.7114908", "0.7106488", "0.70973074", "0.7094653", "0.7090479", "0.70892036", "0.7087777", "0.7047543", "0.70411414", "0.7022395", "0.7009105", "0.6992192", "0.6985852", "0.6957361", "0.6931233", "0.69225615", "0.69076765" ]
0.8391926
0
Checks if the array contains only numeric values.
protected function array_values_are_numeric($array) { foreach ($array as $value) { if (!is_numeric($value)) return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function array_is_numeric($array){\r\n\t\t$results = array();\r\n\t\tif(is_array($array)){\r\n\t\t\tforeach($array as $key => $item){\r\n\t\t\t\t$results[] = (is_numeric($item)&&is_numeric($key));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ( !in_array(false, $results) && count($results) > 0 );\r\n\t}", "private static function isNumericArray($arr){\n foreach ( $arr as $key => $value ) {\n if ( !is_numeric( $key ) ) {\n return false;\n }\n }\n return true;\n }", "function isNumeric($array)\n {\n $keys = array_keys($array);\n foreach ($keys as $key) {\n if (!is_numeric($key)) {\n return false;\n }\n }\n return true;\n }", "function is_numeric_array($array)\n {\n foreach ($array as $element) {\n if (!is_numeric($element)) {\n return false;\n }\n }\n\n return true;\n }", "public static function isNumericArray(array $data)\n {\n return count($data) > 0 && count(\n array_filter(array_keys($data), 'is_numeric')\n ) === count($data);\n }", "public static function isNumeric(array $array): bool\n {\n return self::check($array, 'is_numeric');\n }", "protected function _numeric ($array = array()) {\n $isNumeric = true;\n \n \tif (empty($array)) {\n \t\treturn null;\n \t}\n \t$keys = array_keys($array);\n\tforeach ($keys as $key) {\n\t if (!is_numeric($key)) {\n\t \treturn !$isNumeric;\n\t }\n\t}\n\treturn $isNumeric;\n }", "private function isNumericArray(array $array)\n {\n return is_array($array) && (array_keys($array) === range(0, count($array) - 1));\n }", "public static function isNumeric()\n {\n return true;\n }", "public static function isNumericKeys(array $array)\n {\n foreach (array_keys($array) as $key) {\n if (!is_numeric($key)) {\n return false;\n }\n }\n\n return true;\n }", "public function isNumeric()\n {\n return is_numeric($this->storedValue);\n }", "protected function _numeric ($array = array()) {\n\t\tif (empty($array)) {\n\t\t\treturn null;\n\t\t}\n\t\t$keys = array_keys($array);\n\t\tforeach ($keys as $key) {\n\t\t\tif (!is_numeric($key)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function CheckNumeric ($var) {\r\n\r\n $isNumeric = false;\r\n if (is_array($var)) {\r\n if (empty($var)) {\r\n $isNumeric = false;\r\n } else {\r\n $isNumeric = true;\r\n foreach ($var as $val)\r\n if (!is_numeric($val))\r\n $isNumeric = false;\r\n }\r\n\r\n }\r\n\r\n if (is_numeric($var))\r\n $isNumeric = true;\r\n\r\n if ($isNumeric)\r\n return true;\r\n\r\n IERR('Variable that was supposed to be numeric was not.');\r\n return false;\r\n}", "public function isNumeric() {\n\t\tstatic $columns = array(\n\t\t\t'TINYINT', 'SMALLINT', 'MEDIUMINT', 'INT', 'BIGINT', 'REAL', 'DOUBLE', 'FLOAT', 'DECIMAL', 'NUMERIC'\n\t\t);\n\n\t\treturn in_array($this->type, $columns);\n\t}", "function is_numeric ($var) {}", "public function isNumeric(): bool\n {\n return ctype_digit($this->string);\n }", "function checkIfNumber($val){\n\treturn is_numeric($val);\n}", "public function isNumericArray($nodeXpath)\n {\n foreach ($this->numericArrays as $pathPattern) {\n if ($this->nodePathMatcher->match($pathPattern, $nodeXpath)) {\n return true;\n }\n }\n return false;\n }", "public static function isNumeric($pValue)\n {\n return is_numeric($pValue);\n }", "public function isNumber($value) {\n\t\treturn is_numeric($value);\n\t}", "public function isNumber(): bool\n {\n return false;\n }", "function v_is_numeric($var) {\n return is_numeric($var);\n}", "public function isNumber()\n {\n return $this->is(FieldTypeCollection::TYPE_NUMBER);\n }", "private function existNotNumeric(...$numbers): bool\n {\n foreach ($numbers as $number) {\n if (is_numeric($number) === false) {\n return true;\n }\n }\n\n return false;\n }", "public static function numeric( $num )\n {\n return is_numeric( $num );\n }", "public function testAssertIsNotNumeric() {\n\t\tself::assertIsNotNumeric( false );\n\t}", "public static function numeric($check)\n\t{\n\t\treturn is_numeric($check);\n\t}", "public function getIsNumeric()\n {\n return $this->isNumeric;\n }", "function wponion_is_numeric( $value ) {\n\t\treturn ( ! is_numeric( $value ) ) ? __( 'Please Enter A Valid Numeric Value', 'wponion' ) : true;\n\t}", "public function isNumber($value)\n {\n// return is_numeric($value);\n// if(!is_numeric($value)){\n// throw new \\Exception(\"The given value is not a number\");\n// }\n// return true;\n\n// option 2 :use gettype to check type of value;\n if(gettype($value) === 'integer' || gettype($value) === 'double'){\n return true;\n }else {\n throw new \\Exception(\"The given value is not a number\");\n }\n }" ]
[ "0.79732364", "0.789596", "0.7841224", "0.783434", "0.7799171", "0.7602675", "0.7503348", "0.74049044", "0.7381052", "0.7188535", "0.71688324", "0.71461755", "0.6858151", "0.67471105", "0.6688009", "0.65968394", "0.6561184", "0.6520846", "0.6461605", "0.64576095", "0.6438809", "0.6434239", "0.6357517", "0.6332488", "0.6318295", "0.6294121", "0.6291045", "0.62721956", "0.6225425", "0.6206653" ]
0.8058139
0
Checks if the assoc_array has the correct format. format is a associative array, if assoc_array should contain: attr1 as numeric value attr2 as numeric array attr3 as associative array with keys attr3_1 (numeric) and attr3_2 (numeric array) format looks like: [attr1=>false, attr2=>true, attr3=>[[attr3_1=>false, attr3_2=>true]]]
protected function check_correct_format($assoc_array, $format) { static $i = 0; $i++; if (!$this->assoc_array_keys_exist($assoc_array, array_keys($format))) return false; foreach ($format as $key => $value) { if (is_array($value) && $this->array_values_are_numeric(array_keys($value))) { foreach ($assoc_array[$key] as $val) { if (!$this->check_correct_format($val, $value[0])) { return false; } } } else if (is_array($value) && !$this->check_correct_format($assoc_array[$key], $value)) { return false; } else if ($value === false && !is_numeric($assoc_array[$key])) { return false; } else if ($value === true && !$this->array_values_are_numeric($assoc_array[$key])) { return false; } else if ($value === null && !is_string($assoc_array[$key])) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function array_is_associative(array $array): bool {\n if (empty($array)) {\n return false;\n }\n return !is_numeric(implode('', array_keys($array)));\n}", "private static function is_associative(array $arr) {\n foreach ($arr as $key => $value) {\n if (is_string($key)) return true;\n }\n return false;\n }", "private static function _is_assoc(array $array) \n {\n return (bool)count(array_filter(array_keys($array), 'is_string'));\n }", "protected function isAssociativeArray($array)\n {\n return (array_values($array) !== $array);\n }", "private function isAssociative(array $array) : bool\n {\n return array_values($array) !== $array;\n }", "function is_associative(array $array)\n {\n $keys = array_keys($array);\n\n return (boolean) array_filter($keys, 'is_string');\n }", "function is_assoc_array($array, $strict_seq=false) {\n # Local variables\n $i = 0;\n\n # First check if our array is actually an array. Return null otherwise.\n if (is_array($array)) {\n # Loop through each array value and check it's key\n foreach ($array as $key => $value) {\n # Check if key is numeric\n if (!is_numeric($key) or ($strict_seq and $i !== intval($key))) {\n return true;\n }\n $i++;\n }\n } else {\n return null;\n }\n\n return false;\n}", "public static function isAssociative($array) {\n return array_keys($array) !== range(0, count($array) - 1);\n }", "public static function is_assoc( array $array ){\n\t\t$keys = array_keys( $array );\n\t\treturn array_keys( $keys) !== $keys;\n\t}", "function is_associative_array($var) \n\t{\n\t\treturn is_array($var) && !is_numeric(implode('', array_keys($var)));\n }", "public static function is_assoc($array) {\n\t\treturn (array_keys($array) !== range(0, count($array) - 1));\n\t}", "public static function is_assoc($array) {\n $keys = array_keys($array);\n return array_keys($keys) !== $keys;\n }", "private static function isAssoc($array){\n\t\treturn count(array_filter(array_keys($array), 'is_string')) > 0;\n\t}", "public function testArrayIsAssoc(){\n\t\t$array1 = [\n\t\t\t'foo' => 'bar',\n\t\t\t'faa' => 'bor'\n\t\t];\n\t\t$array2 = [\n\t\t\t0 => 'bar',\n\t\t\t1 => 'bor'\n\t\t];\n\t\t$array3 = [\n\t\t\t'foo' => 'bar',\n\t\t\t999 => 'bor'\n\t\t];\n\n\t\t$this->assertEquals(array_is_assoc($array1), true);\n\t\t$this->assertEquals(array_is_assoc($array2), false);\n\t\t$this->assertEquals(array_is_assoc($array3), true);\n\t}", "function is_assoc($arr) {\r\n return (is_array($arr) && count(array_filter(array_keys($arr),'is_string')) == count($arr));\r\n}", "private static function isAssoc( $array ) {\n return (is_array($array) && 0 !== count(array_diff_key($array, array_keys(array_keys($array)))));\n }", "function is_assoc_array($array) : bool\n {\n return array_keys($array) !== range(0, count($array) - 1);\n }", "private function isAssocArray(array $array) {\n\t\treturn array_values($array) !== $array;\n\t}", "function is_associative($array)\n{\n return $array !== array_values($array);\n}", "protected function is_assoc(array $array)\n {\n return (bool)count(array_filter(array_keys($array), 'is_string'));\n }", "function array_is_assoc(array $array)\n{\n $keys = array_keys($array);\n\n return array_keys($keys) !== $keys;\n}", "function is_array_assoc(array $array) {\n if ([] === $array) return false;\n return array_keys($array) !== range(0, count($array) - 1);\n }", "private function is_assoc (array $array) {\n\t\tforeach (array_keys($array) as $k => $v) {\n\t\t\tif ($k !== $v) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function is_array_assoc( $arr ) {\n\tglobal $tratus;\n\tif ( ! is_array($arr) ) return false;\n\treturn ! $tratus->is_array_num($arr);\n}", "public static function isAssociative(array $arr) {\n if (array() === $arr) return false;\n return array_keys($arr) !== range(0, sizeof($arr) - 1);\n }", "function is_associative_array( $var ) {\n return is_array( $var ) && !is_numeric( implode( '', array_keys( $var ) ) );\n }", "public static function isAssocArray($array)\n {\n $array = array_keys($array);\n return ($array !== array_keys($array));\n\n }", "public static function is_assoc(array $array)\n {\n // Keys of the array\n $keys = array_keys($array);\n\n // If the array keys of the keys match the keys, then the array must\n // not be associative (e.g. the keys array looked like {0:0, 1:1...}).\n return array_keys($keys) !== $keys;\n }", "private function isAssociative(array $arr)\n {\n return array_keys($arr) !== range(0, count($arr) - 1);\n }", "public static function IsAssocArray($array) {\n return array_keys($array) != range(0, count($array) - 1);\n }" ]
[ "0.67773515", "0.6699771", "0.6688776", "0.6638693", "0.662502", "0.6582038", "0.65573925", "0.6548486", "0.65301245", "0.6524973", "0.6508951", "0.6492388", "0.6478756", "0.64772266", "0.6451801", "0.6436418", "0.64332396", "0.64079", "0.6403452", "0.6390831", "0.63790154", "0.6345179", "0.6343212", "0.6341221", "0.6338717", "0.632805", "0.6310869", "0.6310829", "0.62844175", "0.62810194" ]
0.7625921
0
Get html code for grid filter checkbox
public function getHtml() { return '<input type="checkbox" onclick="subscriberController.checkCheckboxes(this)"/>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getElementHtml()\n {\n $this->setData('style', 'position:absolute; clip:rect(0,0,0,0); overflow:hidden');\n $this->addClass('admin__actions-switch-checkbox');\n\n return parent::getElementHtml();\n }", "function getFeatureHtmlCheckboxlistOR($featureId, $Filter) {\n\t\t++$this->template->searchNameCounter;\n\t\t$content = '<div>';\n\t\tfor ($i = 0; $i < count($Filter[\"Values\"]); $i++) {\n\t\t\tif (!empty($Filter[\"Values\"][$i])) {\n\t\t\t\t$content .=\n\t\t\t\t\t\t'<label><input type=\"checkbox\" value=\"' . $Filter[\"Values\"][$i] . '\" name=\"checkboxor|' . $featureId . '|' . $Filter[\"Values\"][$i] . '\">' .\n\t\t\t\t\t\t'<span>' . $Filter[\"HTMLs\"][$i] . '</span></label><br />';\n\t\t\t}\n\t\t}\n\t\t$content .= '</div>';\n\t\treturn $content;\n\t}", "function getFeatureHtmlCheckboxlistAND($featureId, $Filter) {\n\t\t++$this->template->searchNameCounter;\n\t\t$content = '<div>';\n\t\tfor ($i = 0; $i < count($Filter[\"Values\"]); $i++) {\n\t\t\tif (!empty($Filter[\"Values\"][$i])) {\n\t\t\t\t$content .=\n\t\t\t\t\t\t'<label><input type=\"checkbox\" value=\"' . $Filter[\"Values\"][$i] . '\" name=\"checkboxand|' . $featureId . '|' . $Filter[\"Values\"][$i] . '\">' .\n\t\t\t\t\t\t'<span>' . $Filter[\"HTMLs\"][$i] . '</span></label><br />';\n\t\t\t}\n\t\t}\n\t\t$content .= '</div>';\n\t\treturn $content;\n\t}", "public function getBrewMarkup()\n {\n $value = $this->getValue();\n $class = !empty($this->inputClass) ? ' class=\"' . htmlspecialchars($this->inputClass) . '\"' : '';\n $html = '<div class=\"toggleset\">';\n $options = $this->formatOptions($this->getOptions());\n foreach ($options as $option) {\n $checked = (is_array($value) && in_array($option['value'], $value)) || (is_string($value) && $option['value'] == $value) ? ' checked' : '';\n $html .= '<label><input type=\"checkbox\" name=\"' . $this->inputName . '[]\" value=\"' . $option['value'] . '\"' . $checked . $class . '> ' . $option['title'] . '</label>';\n }\n $html .= '</div>';\n return $html;\n }", "public function getToggleSaveCriteria()\n {\n return '<input id=\"toggle_save_criteria\" type=\"checkbox\" class=\"atkcheckbox\" onclick=\"$(save_criteria)[0].disabled = !$(save_criteria)[0].disabled\">';\n }", "function HtmlGetCheckBox($inputName,$isChecked,$labelText,$isDisabled=false,$outerHTML='',$helpText='',$innerHTML='') {\n\t\t\treturn '<li><label for=\"' . $inputName . '\"><input type=\"checkbox\" id=\"' . $inputName . '\" name=\"' . $inputName . '\" ' . ($isChecked?'checked=\"checked\"':'') . ' ' . ($isDisabled?'disabled=\"disabled\"':'') . ' ' . $innerHTML . ' /> ' . $labelText . (!empty($helpText)?' <abbr onclick=\"alert(this.title);\" title=\"' . $helpText . '\">[?]</abbr>':'') . '</label>' . $outerHTML . '</li>';\t\t\t\n\t\t}", "function getTableFilterHTML()\r\n\t{\r\n\t\t$html = $this->render();\r\n\t\treturn $html;\r\n\t}", "public function getCheckboxCheckCallback() {\n if ($this->getUseMassaction()) {\n return \"function (grid, element) {\n $(grid.containerId).fire('product:changed', {element: element}); \n }\";\n }\n }", "protected function renderFilterCellContent()\r\n {\r\n if(is_string($this->filter))\r\n echo $this->filter;\r\n else if($this->filter!==false && $this->grid->filter!==null && $this->name!==null && strpos($this->name,'.')===false)\r\n {\r\n if(is_array($this->filter))\r\n echo CHtml::activeDropDownList($this->grid->filter, $this->name, $this->filter, array('id'=>false,'prompt'=>''));\r\n else if($this->filter===null)\r\n echo CHtml::activeTextField($this->grid->filter, $this->name, array('id'=>false));\r\n }\r\n else\r\n parent::renderFilterCellContent();\r\n }", "function column_cb($item){\n\t\treturn \"<input type='checkbox' value='{$item['id']}'>\";\n\t}", "public function getCustomFilterLabel(): string\n {\n return $this->filterCustomLabel ?? '';\n }", "function get_checkbox ()\n\t\t{\n\t\t\t$category = $this->input->get ( \"category\" );\n\t\t\t$value = $this->input->get ( \"value\" );\n\t\t\t$field = $this->input->get ( \"field\" );\n\t\t\t$categories = $this->variable->get_pairs ( $category, array (\n\t\t\t\t\t\"field\" => \"value\",\n\t\t\t\t\t\"direction\" => \"ASC\" \n\t\t\t) );\n\t\t\t$pairs = get_keyed_pairs ( $categories, array (\n\t\t\t\t\t\"name\",\n\t\t\t\t\t\"value\" \n\t\t\t) );\n\t\t\t\n\t\t\t$output = array ();\n\t\t\tfor($i = 0; $i < count ( $categories ); $i ++) {\n\t\t\t\t$checked = \"\";\n\t\t\t\t$item = $categories [$i];\n\t\t\t\tif ($item->value == $value) {\n\t\t\t\t\t$checked = \"checked\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$output [] = sprintf ( \"<label for='%s'>%s</label><input type='checkbox' name='%s[$i]' id='%s' value='%s' %s/>\", $item->value, $item->value, $field, $field, $item->value, $checked );\n\t\t\t}\n\t\t\t$buttons = implode ( \" \", $output );\n\t\t\techo $buttons . sprintf ( \"<span class='button save-checkbox' target='%s'>Save</span>\", $field );\n\t\t}", "public function getUikitMarkup()\n {\n $value = $this->getValue();\n $class = !empty($this->inputClass) ? ' class=\"' . htmlspecialchars($this->inputClass) . '\"' : '';\n $html = '<div class=\"fw-compact-form\">';\n $options = $this->formatOptions($this->getOptions());\n foreach ($options as $option) {\n $checked = (is_array($value) && in_array($option['value'], $value)) || (is_string($value) && $option['value'] == $value) ? ' checked' : '';\n $html .= '<div>';\n $id = Format::slugify($this->inputName . '-' . $option['value']);\n $html .= '<input id=\"' . $id . '\" type=\"checkbox\" name=\"' . $this->inputName . '[]\" value=\"' . $option['value'] . '\"' . $checked . $class . '><label for=\"' . $id . '\"> ' . $option['title'] . '</label>';\n $html .= '</div>';\n }\n $html .= '</div>';\n return $html;\n }", "function toString() {\n\n\t\t\t\t$checkboxName = $this->name . '_activate';\n\n\t\t\t\tpreg_match('/#([0-9]+)/', $this->description, $match);\n\t\t\t\t$checkbox = '<input id=\"' . $checkboxName . '\" type=\"checkbox\" name=\"' . $checkboxName . '\" value=\"1\" ' . (get_option($checkboxName) ? 'checked' : '') . ' /> ';\n\t\t\t\t$inputField = '<input type=\"text\" size=\"' . $match[1] . '\" name=\"' . $this->name . '\" value=\"' . get_option($this->name) . '\" /> ';\n\n\t\t\t\treturn $checkbox . '<label for=\"' . $checkboxName . '\">' . preg_replace('/#[0-9]+/', '</label>' . $inputField, $this->description);\n\n\t\t\t}", "public function render()\n {\n $id = htmlentities($this->id, ENT_QUOTES);\n $attributes = $this->attributes->render();\n $checked = '';\n \n if ($this->defaultValue)\n {\n $checked = ' checked=\"checked\"';\n }\n \n return \"<input type=\\\"checkbox\\\" name=\\\"{$id}\\\" id=\\\"{$id}\\\"{$checked}{$attributes} />\";\n }", "function writeCheckBox($parameters){\r\n $rtn = '<label class=\"l-wrap mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect\" for=\"'.$parameters['id'].'\">';\r\n $rtn.= ' <input type=\"checkbox\" class=\"fCheckbox mdl-checkbox__input\"';\r\n if(array_key_exists('dataid', $parameters)){$rtn.=' data-id=\"'.$parameters['dataid'].'\"';}\r\n $rtn.= ' id=\"'.$parameters['id'].'\"';\r\n if(array_key_exists('datafieldname', $parameters)){$rtn.=' data-fieldname=\"'.$parameters['datafieldname'].'\"';}\r\n if(array_key_exists('value', $parameters)){\r\n if($parameters['value']==\"Y\"||$parameters['value']==\"checked\"){$rtn.=' checked';}\r\n }\r\n $rtn.= '>';\r\n $rtn.= '<span class=\"mdl-checkbox__label\">'.$parameters['label'].'</span>';\r\n $rtn.= '</label>';\r\n return $rtn;\r\n}", "function getFeatureHtmlRadio($featureId, $Filter) {\n\t\t++$this->template->searchNameCounter;\n\t\t$content = '<div>';\n\t\tfor ($i = 0; $i < count($Filter[\"Values\"]); $i++) {\n\t\t\tif (!empty($Filter[\"Values\"][$i])) {\n\t\t\t\t$content .=\n\t\t\t\t\t\t'<label><input type=\"radio\" name=\"radio|' . $featureId . '|equals\" value=\"' . $Filter[\"Values\"][$i] . '\">' .\n\t\t\t\t\t\t'<span>' . $Filter[\"HTMLs\"][$i] . '</span></label><br />';\n\t\t\t}\n\t\t}\n\t\t/* foreach ($valueArray as $key => $value)\n\t\t */\n\t\t$content .= '</div>';\n\t\treturn $content;\n\t}", "function column_cb($item) {\n\t\treturn sprintf('<input type=\"checkbox\" name=\"aDBc_elements_to_process[]\" value=\"%s\" />', $item['site_id'].\"|\".$item['transient_id']);\n\t}", "public function generate_vue_template() {\n\t\t$v = new HTMLView(\"src/views/uitypes/async-checkbox.php\",\"waboot-woo-product-filters\");\n\t\t$output = $v->get([\n\t\t\t\"input_name\" => $this->input_name\n\t\t]);\n\t\treturn $output;\n\t}", "public static function checkboxList()\n {\n $l_arr = [];\n $learning_goals = static::all();\n foreach( $learning_goals as $lg ){\n $l_arr[] = '<input type=\"checkbox\" name=\"lg[]\" value=\"'.$lg->goal_id.'\" /> '.$lg->goal;\n }\n\n return implode( \"<br />\" , $l_arr );\n }", "function RenderCheckBox($in_name,$in_id,$in_value=null,$in_class=null,$in_show=null, $in_event=null)\n {\n\t if(!$in_name) return '<font color=\"red\">Missing Name</font>';\n\t if(!$in_id) return '<font color=\"red\">Missing Id</font>';\n\n $strInput = '<input name=\"'.$in_name.'\" id=\"'.$in_id.'\" type=\"checkbox\" value=\"'.$in_value.'\" ';\n if($in_class) $strInput .= ' class=\"'.$in_class.'\" ';\n if($in_show==\"checked\" || $in_show==\"disabled\") $strInput .= ' '.$in_show;\n if($in_event) $strInput .= ' '.$in_event;\n $strInput.= ' onKeyDown=\"return tabOnEnter(this, event);\">'.\"\\n\";\n \n return $strInput;\n }", "function emp_zfg_draw_toggle($value, $key)\n{\n $name = ((tep_not_null($key)) ? 'configuration[' . $key . ']' : 'configuration_value');\n ob_start();\n ?>\n <div class=\"form-group toggle-container\">\n <input type=\"hidden\" name=\"<?php echo $name;?>\" value=\"<?php echo $value;?>\"/>\n <input type=\"checkbox\" class=\"bootstrap-checkbox\"\n <?php if (strtolower($value) == 'true') { ?>\n checked=\"checked\"\n <?php } ?>\n />\n </div>\n <?php\n $content = ob_get_contents();\n ob_end_clean();\n return $content;\n}", "private function generateFilters() {\n $html = '\n <script type=\"application/javascript\">\n $( document ).ready(function() {\n // Documentation; https://www.dynatable.com/\n var dynatable = $(\"#listOfNotes\").dynatable();\n });\n </script>';\n\n return $html;\n }", "function wpb_enable_clean_login_page_checkbox_render()\n{\n ?>\n <table class=\"wpb-module-settings\">\n <tr>\n <td>\n <p class=\"wpb-module-description\">\n Cleans up the wp-login page for a nicer finish.\n </p>\n <button class=\"wpb-module-more-info\">More Info</button>\n <ul class=\"wpb-module-more-info-details wpb-list\">\n <li>Removes Links</li>\n <li>Removes Branding</li>\n <li>Sets Background White</li>\n </ul>\n </td>\n <td class=\"wpb-module-fields-container\">\n <?php\n $checked_status = (get_option('wpb-enable-clean-login-page-enable-field') === \"on\" ? \"checked=\\\"checked\\\"\" : \"\");\n ?>\n <input type=\"checkbox\" name=\"wpb-enable-clean-login-page-enable-field\" <?php echo $checked_status ?>>\n </td>\n </tr>\n </table>\n <hr>\n <?php\n}", "function column_cb($item) {\n return sprintf(\n '<input type=\"checkbox\" name=\"id[]\" value=\"%s\" />', $item['id']);\n }", "public static function getBackendFilters() {\n $pseudoFilters = '';\n\n $pseudoFilters .= self::getAdminOrgFilter();\n\n //Filter dates\n $pseudoFilters .= '<hr class=\"hr-condensed\">';\n $pseudoFilters .= JHTML::_('select.genericlist', self::getDateFilterList(), 'filter-date', ' onchange=\"dateFiltersChanged();\"');\n //$pseudoFilters .= '<hr class=\"hr-condensed\">';\n //Get custom date filters\n $pseudoFilters .= '<div class=\"sdi-dashboard-custom-dates\" style=\"display:none\">';\n\n $pseudoFilters .= self::getCustomDateFilterFrom();\n $pseudoFilters .= '<br/>';\n\n $pseudoFilters .= self::getCustomDateFilterTo();\n $pseudoFilters .= '</div>';\n\n //Change calendar electric feature to false\n $document = JFactory::getDocument();\n $document->addScriptDeclaration('\n jQuery(document).ready(function(){\n jQuery(\"#sdi-dashboard-custom-from_img\").click(function() {\n calendar.params.electric = false;\n });\n jQuery(\"#sdi-dashboard-custom-to_img\").click(function() {\n calendar.params.electric = false;\n });\n });');\n\n\n return(\n '<hr>\n <div class=\"filter-select hidden-phone\">\n\t\t\t<h4 class=\"page-header\">' . JText::_('JSEARCH_FILTER_LABEL') . '</h4>' .\n $pseudoFilters\n . '</div>'\n );\n }", "public function html_filter_select() {\n $output = '';\n $pre = '<select class=\"button\" name=\"filter\" size=\"5\">'.\"\\n\";\n $post = '</select>'.\"\\n\";\n\n foreach ($this->filterset as $name => $filter) {\n $search = $filter['SEARCH'];\n $action = $filter['ACTION'];\n $output .= \"\\t<option value=\\\"$name\\\">$name : &lt;$search -> $action&gt; </option>\\n\";\n }\n\n if ($output) {\n return $pre.$output.$post;\n }\n else {\n return '';\n }\n }", "function cs_terms_and_conditions_checkbox_text() {\n\t$text = cs_get_terms_and_conditions_checkbox_text();\n\n\tif ( ! $text ) {\n\t\treturn;\n\t}\n\n\techo wp_kses_post( cs_replace_policy_page_link_placeholders( $text ) );\n}", "protected function getLnAllFiltersComment()\n {\n $string = '<b>[filter_all]</b> - ' . __('inserts all chosen attributes of LN on the category page.');\n $string .= \"<br>&nbsp;&nbsp;&nbsp;&nbsp;\" . __('Example:') . \" <b>\" . '[category][ – parameters: {filter_all}]' . \"</b>\";\n $string .= \" - \" . __('If \"color\", \"occasion\", and \"shoe size\" attributes are chosen, on the frontend you will see:');\n $string .= \"<br>&nbsp;&nbsp;&nbsp;&nbsp;\" . __('\"Shoes – parameters: Color Red, Occasion Casual, Shoe Size 6.5\"');\n $string .= \" - \" . __('If no attributes are chosen, you will see: \"Shoes\".');\n\n return $string;\n }", "function column_cb( $item ) {\n\t\treturn sprintf( '<input type=\"checkbox\" name=\"bulk-read[]\" value=\"%s\" />', $item['ID'] );\n\t}" ]
[ "0.6463817", "0.6421491", "0.6324418", "0.610841", "0.6047508", "0.6026443", "0.60070336", "0.6004231", "0.5953711", "0.59366554", "0.5812792", "0.5763813", "0.5757847", "0.5727635", "0.56868947", "0.56421065", "0.56256485", "0.5590156", "0.5524561", "0.5510247", "0.5492228", "0.5476337", "0.5467194", "0.54651284", "0.54541945", "0.5447843", "0.5447663", "0.5444887", "0.54276574", "0.5420486" ]
0.6651875
0
Tests JTableCorecontent::check with an empty dataset
public function testCheckFailsWithAnEmptyDataSet() { $this->assertFalse($this->object->check()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testLoadDataWithoutData()\n {\n $data = array();\n\n $table = $this->getConcreteTableBuilder();\n\n $table->loadData($data);\n\n $this->assertEquals(array(), $table->getRows());\n $this->assertFalse($table->hasRows());\n\n $this->assertEquals(0, $table->getTotal());\n }", "protected abstract function setUpEmptyDataSet();", "private function checkData()\n {\n $this->checkTable();\n }", "private function checkEmpty() {\n\t\t\t\tif ($this->rows\t> 0) $this->empty = FALSE;\n\t\t\t\telse $this->empty = TRUE;\n\t\t\t}", "public function testDataWipedBeforeTest() {\n $this->assertEquals(0, $this->countTestRows());\n }", "public function testIsEmpty()\n {\n $this->assertTrue($this->uut->isEmpty());\n $this->assertFalse($this->uut->setData(self::SOME_DATA)->isEmpty());\n }", "public function getColumnThrowsExceptionWhenDataSetEmpty()\n {\n $this->emptyDataSet->getColumn(0);\n }", "public function testEnteredDataIsEmpty($data)\n {\n foreach($data as $key)\n {\n $this->assertEmpty($key);\n }\n }", "public function testEnteredDataIsEmpty($data)\n {\n foreach($data as $key)\n {\n $this->assertEmpty($key);\n }\n }", "public function checkData();", "public function getDataForNoDataSetReturnsEmptyArray() {\n\t\t$this->assertSame(\n\t\t\tarray(),\n\t\t\t$this->subject->getData()\n\t\t);\n\t}", "public function getValueCountThrowsExceptionWhenDataSetEmpty()\n {\n $this->emptyDataSet->getValueCount(0, 'value');\n }", "function testNoRows() {\n\t\t// return a proper false response\n\t\t$good = $this->loader->init('users', $this->userColumns);\n\t\t$this->assertTrue($good);\n\t\t\n\t\t$numberAdded = $this->loader->commit($this->pdo());\n\t\t$this->assertEquals(-1, $numberAdded);\n\t}", "public function testEmptyData()\n {\n $this->browse(function (Browser $browser){\n $browser->visit('/admin')\n ->clickLink('Home Page')\n ->assertSee('Categories')\n ->assertSee('Places')\n ->assertSee('News')\n ->assertSee('Booking Rooms')\n ->assertSee('Hotels')\n ->assertSee('Users')\n ->assertSeeIn('.small-box .inner h3', '0');\n });\n }", "private static function isTableEmpty(){\n\t\t// Get the global config\n\t\tglobal $CrawlerConfig;\n\t\t\n\t\t// Get the PDO object\n\t\t$db = self::pdo();\n\t\t\n\t\t// Return boolean\n\t\t$ret = true;\n\t\t\n\t\t$q = $db->query(\"SELECT count(id) as cnt FROM {$CrawlerConfig['CRAWLER_TABLE']}\");\n\t\tif($q !== false){\n\t\t\t$res = $q->fetch(PDO::FETCH_ASSOC);\n\t\t\tif($res !== false) $ret = !($res['cnt'] > 0);\n\t\t}\n\t\treturn $ret;\n\t}", "protected function assertNoData(): void\n {\n if (\\array_key_exists(self::DATA, $this->result)) {\n throw new \\InvalidArgumentException('A primary data already exist.');\n }\n }", "public function testTableWithBlankValue()\n {\n $this->expectException(InvalidArgumentException::class);\n $this->createField()->setTable('');\n }", "public function testGetNumberOfRowsInvalidQuery()\n {\n $this->assertEquals(0, $this->fixture->getNumberOfRows('SHOW TABLES of x'));\n }", "public function seeEmptyResult()\n {\n \\PHPUnit_Framework_Assert::assertEmpty($this->last_result);\n }", "public function testItShouldReturnFalseIfWritingEmptyRow()\r\n {\r\n $this->mockOutXML->open(false, 'test', 'data');\r\n $this->assertFalse(\r\n $this->mockOutXML->writeDataRow([])\r\n );\r\n }", "public function isThereDataToDisplay($dataTable, $view)\n {\n return $this->getCurrentData($dataTable)->getRowsCount() != 0;\n }", "public function testEnteredArrayIsNotEmpty($data)\n {\n foreach($data as $key)\n {\n $this->assertNotEmpty($key);\n }\n }", "public function testEnteredArrayIsNotEmpty($data)\n {\n foreach($data as $key)\n {\n $this->assertNotEmpty($key);\n }\n }", "function chkempty() {\n $query = $this->db->query('SELECT COUNT(*) FROM course');\n if ($query->result()) {\n return TRUE;\n } else {\n return FALSE;\n }\n }", "function requiresTableData() {\n\t\treturn false;\n\t}", "public function testCheckColumns()\n {\n $transaction = new Transaction;\n $columns = [\n 'account_id',\n 'operation_type_id',\n 'value'\n ];\n $data = array_diff($columns, $transaction->getFillable());\n\n $this->assertEquals(0, count($data));\n }", "public function testLoadDataWithDataRows()\n {\n $data = array(\n array('foo' => 'bar'),\n array('foo' => 'bar')\n );\n\n $table = $this->getConcreteTableBuilder();\n\n $table->loadData($data);\n\n $this->assertEquals($data, $table->getRows());\n $this->assertTrue($table->hasRows());\n\n $this->assertEquals(2, $table->getTotal());\n }", "public function testEmptyLine0()\n{\n\n $actual = $this->wP_Text_Diff_Renderer_Table->emptyLine();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testCheckDataIsEmpty()\n {\n $_arrayValue = [];\n $user = User::find(10);\n $request = $this->actingAs($user);\n\n $respone = $request->call('POST', \"api/block-manager/edit-name-folder/\" . $this->_id, $_arrayValue);\n \n //$request->assertEquals(422, $respone->getStatusCode());\n\n $request->seeJson([\n 'status' => 0,\n ]);\n }", "function emptyData() {\n\t\t$this->rowList = array();\n\t}" ]
[ "0.6745734", "0.6646633", "0.6544921", "0.6456916", "0.6368793", "0.63468665", "0.6316014", "0.62979066", "0.62979066", "0.6263666", "0.62347484", "0.6169941", "0.61450803", "0.61192375", "0.5985514", "0.5963234", "0.5952846", "0.5950307", "0.59384036", "0.58993465", "0.58510345", "0.5823134", "0.5823134", "0.58038104", "0.5802885", "0.58005404", "0.57997274", "0.5737835", "0.57351273", "0.56960595" ]
0.75023067
0
A project is valid if it has a root composer.json
public function isValid() { return $this->directory && realpath($this->directory . '/composer.json'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testComposerJsonExists() {\n $this->assertFileExists($this->getProjectDirectory() . '/composer.json');\n }", "private function isOwnProject(): bool\n {\n return $this->getComposer()->getPackage()->getPrettyName() === 'flying/wordpress-composer';\n }", "public function testComposerLockExists() {\n $this->assertFileExists($this->getProjectDirectory() . '/composer.lock');\n }", "public function makeProject(){\n\n $disk = Storage::disk('clients');\n \n #Comprueba inexistencia del proyecto\n if(!$disk->exists($this->project->directory.'/composer.json'))\n {\n \n $commands = [\n 'cd '.OctoSettings::get('projects_path').'/'.$this->project->directory,\n 'composer create-project october/october tmp-project dev-master',\n 'mv tmp-project/* .',\n 'mv tmp-project/.[^.]* .',\n 'rm -rf tmp-project',\n 'php artisan key:generate',\n 'chown -hR www-data:www-data .',\n 'chmod -R 777 storage'\n ];\n SSH::run($commands); \n return true;\n\n }else Flash::error('Project Exists, delete before install again');\n }", "public function isCompleteProject()\n {\n return ($this->isProject()\n && FileStorage::isUsefulDirectory($this->directory . \"/composed/\") # does have \"composed\" folder?\n );\n }", "public function isProject()\n {\n return ($this->isInitted()\n && FileStorage::isUsefulDirectory($this->directory . \"/pages/\") # does have \"pages\" folder\n );\n }", "public function testCreateProjectWithMandatoryFields()\n {\n $data = [\n 'project_name' => \"New Product\",\n 'project_price' => \"This is a product\",\n 'start_date' => true,\n ];\n\n $response = $this->json('POST', '/api/products', $data);\n $response->assertStatus(401);\n $response->assertJson(['message' => \"Unauthenticated.\"]);\n }", "public function testEmptyComposerJson(): void\n {\n $report = self::checkFile(\n $this->stubsPath . 'FooFailed.php.inc',\n ['composerJsonPath' => $this->stubsPath . 'composer-empty.json']\n );\n\n self::assertSniffError(\n $report,\n 4,\n PSR4Sniff::CODE_NO_COMPOSER_AUTOLOAD_DEFINED,\n \\sprintf('No autoload entries found in %s.', $this->stubsPath . 'composer-empty.json')\n );\n\n self::assertSame(1, $report->getErrorCount());\n }", "private function isBookStackDir()\n {\n $dir = getcwd();\n $composer = $dir . '/composer.json';\n $versionFile = $dir . '/version';\n\n if (!file_exists($composer) || !file_exists($versionFile)) return false;\n\n $composerData = json_decode(file_get_contents($composer));\n if (!isset($composerData->name)) return false;\n if (strpos(strtolower(explode('/', $composerData->name)[1]), 'bookstack') === false) return false;\n\n return true;\n }", "public function testSimpleProject()\n {\n // Create the project directory to work with\n $testProjectDir = $this->createTestProject('simple-project');\n\n // Run 'composer update' to build the scenario directories\n list($output, $status) = $this->composer('update', $testProjectDir);\n $this->assertNotContains('Your requirements could not be resolved to an installable set of packages.', $output);\n $this->assertEquals(0, $status);\n\n // Test scenario 'semver30'\n\n $scenarioDir = \\ComposerTestScenarios\\Handler::scenarioLockDir($testProjectDir, 'semver30');\n $this->assertTrue(is_dir($scenarioDir));\n\n // The scenario directory should be different than the base directory\n $this->assertNotEquals($testProjectDir, $scenarioDir);\n\n // A lock file should be created\n $this->assertFileExists($scenarioDir . '/composer.lock');\n\n list($output, $status) = $this->composer('scenario', $testProjectDir, ['semver30']);\n $this->assertEquals(0, $status);\n\n list($output, $status) = $this->composer('info', $testProjectDir);\n $this->assertEquals(0, $status);\n $this->assertRegExp('#^composer/semver *3.0.1#', $output);\n\n // Return to the 'default' scenario\n\n $scenarioDir = \\ComposerTestScenarios\\Handler::scenarioLockDir($testProjectDir, 'default');\n $this->assertTrue(is_dir($scenarioDir));\n\n list($output, $status) = $this->composer('scenario', $testProjectDir, ['default']);\n $this->assertEquals(0, $status);\n\n list($output, $status) = $this->composer('info', $testProjectDir);\n $this->assertEquals(0, $status);\n $this->assertRegExp('#^composer/semver *3\\.2\\.#', $output);\n\n // Try to load a scenario that does not exist\n\n list($output, $status) = $this->composer('scenario', $testProjectDir, ['no-such-scenario']);\n $this->assertEquals(1, $status);\n }", "public function validateProjectCreation( $projectStructure ) {\n //override Revise Improved qa Model\n $qa_mode_file = realpath( self::getPluginBasePath() . \"/../qa_model.json\" );\n ReviewExtended::loadAndValidateModelFromJsonFile( $projectStructure, $qa_mode_file );\n }", "private function configureComposer(): void\n {\n try {\n $io = $this->getIO();\n $composerJson = new JsonFile($this->getProjectRoot() . '/composer.json');\n if (!$composerJson->exists()) {\n $io->write('<comment>composer.json is not found, skipping its configuration, you need to create it later</comment>');\n\n return;\n }\n try {\n /** @var array $config */\n $config = $composerJson->read();\n } catch (RuntimeException $e) {\n $io->write('<error>composer.json is not valid, skipping its configuration, you need to create it later</error>');\n\n return;\n }\n $config['name'] = '';\n $config['description'] = '';\n $config['authors'] = [];\n unset(\n $config['version'],\n $config['type'],\n $config['keywords'],\n $config['homepage'],\n $config['time'],\n $config['license'],\n $config['support'],\n $config['require-dev']\n );\n if ($io->isInteractive()) {\n $io->write('<info>composer.json will be modified now to match your project settings</info>');\n // Get package name\n $git = $this->getGitConfig();\n $name = basename($this->getProjectRoot());\n /** @noinspection RegExpUnnecessaryNonCapturingGroup */\n $name = strtolower(preg_replace('{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}', '\\\\1\\\\3-\\\\2\\\\4', $name));\n if (array_key_exists('github.user', $git)) {\n $name = $git['github.user'] . '/' . $name;\n } elseif (!empty($_SERVER['USERNAME'])) {\n $name = $_SERVER['USERNAME'] . '/' . $name;\n } elseif (get_current_user()) {\n $name = get_current_user() . '/' . $name;\n } else {\n // package names must be in the format foo/bar\n $name .= '/' . $name;\n }\n $name = strtolower($name);\n $name = $io->askAndValidate(\n 'Package name (<vendor>/<name>) [<comment>' . $name . '</comment>]: ',\n static function ($value) use ($name) {\n if (null === $value) {\n return $name;\n }\n\n if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}', $value)) {\n throw new InvalidArgumentException(\n 'The package name ' . $value . ' is invalid, it should be lowercase and have a vendor name, a forward slash, and a package name, matching: [a-z0-9_.-]+/[a-z0-9_.-]+'\n );\n }\n\n return $value;\n },\n null,\n $name\n );\n $config['name'] = $name;\n $this->variables['package-name'] = [\n 'type' => 'string',\n 'value' => $name,\n ];\n\n // Get package description\n $description = '';\n $description = $io->ask('Description [<comment>' . $description . '</comment>]: ', $description);\n $config['description'] = $description;\n $this->variables['package-description'] = [\n 'type' => 'string',\n 'value' => $description,\n ];\n\n // Get package author\n $author = '';\n $parseAuthor = static function ($author) {\n /** @noinspection RegExpRedundantEscape */\n if (preg_match('/^(?P<name>[- \\.,\\p{L}\\p{N}\\'’]+) <(?P<email>.+?)>$/u', $author, $match) && filter_var($match['email'],\n FILTER_VALIDATE_EMAIL) !== false) {\n return [\n 'name' => trim($match['name']),\n 'email' => $match['email'],\n ];\n }\n\n return null;\n };\n $formatAuthor = static function ($name, $email) {\n return sprintf('%s <%s>', $name, $email);\n };\n if (array_key_exists('user.name', $git) && array_key_exists('user.email', $git)) {\n $author = $formatAuthor($git['user.name'], $git['user.email']);\n if (!$parseAuthor($author)) {\n $author = '';\n }\n }\n $author = $io->askAndValidate('Author [<comment>' . $author . '</comment>, n to skip]: ',\n static function ($value) use ($parseAuthor, $formatAuthor, $author) {\n if ($value === 'n' || $value === 'no') {\n return null;\n }\n $value = $value ?: $author;\n $author = $parseAuthor($value);\n if (!is_array($author)) {\n throw new InvalidArgumentException(\n 'Invalid author string. Must be in the format: ' .\n 'John Smith <[email protected]>'\n );\n }\n\n return $formatAuthor($author['name'], $author['email']);\n }, null, $author);\n if ($author) {\n $config['authors'][] = $parseAuthor($author);\n }\n } else {\n $io->write('<comment>composer.json is cleaned up, but not configured because installation is running in non-interactive mode. You need to configure it by yourself</comment>');\n }\n\n // Setup WPackagist repository\n if (!array_key_exists('repositories', $config)) {\n $config['repositories'] = [];\n }\n $wpackagist = [\n 'type' => 'composer',\n 'url' => 'https://wpackagist.org',\n ];\n foreach ($config['repositories'] as $repository) {\n if (array_key_exists('url', $repository) &&\n array_key_exists('type', $repository) &&\n $repository['type'] === $wpackagist['type'] &&\n $repository['url'] === $wpackagist['url']\n ) {\n $wpackagist = null;\n break;\n }\n }\n if ($wpackagist !== null) {\n $config['repositories'][] = $wpackagist;\n }\n\n // Setup WordPress directories and WordPress installers paths\n if (!array_key_exists('extra', $config)) {\n $config['extra'] = [];\n }\n $extra = $this->getComposer()->getPackage()->getExtra();\n $gitIgnore = [\n '# WordPress itself and related files and directories',\n ];\n $gitIgnore[] = '/' . self::$configurationFiles['local']['file'];\n $directories = [];\n foreach (self::$wordpressDirectories as $type => $directory) {\n $key = $directory['key'];\n $dir = $directory['path'];\n if (array_key_exists($key, $extra)) {\n $dir = $extra[$key];\n }\n $directories[$type] = $dir;\n $config['extra'][$key] = $dir;\n $this->variables[$key] = [\n 'type' => 'string',\n 'value' => $dir,\n ];\n if ($type !== 'content') {\n $gitIgnore[] = '/' . $dir;\n }\n }\n // Ignore vendor and bin directories that are controlled by Composer\n $composerCfg = $this->getComposer()->getConfig();\n $vendorDir = $composerCfg->get('vendor-dir', Config::RELATIVE_PATHS);\n $gitIgnore[] = '/' . $vendorDir;\n $binDir = $composerCfg->get('bin-dir', Config::RELATIVE_PATHS);\n if ($binDir !== 'vendor/bin') {\n if (!array_key_exists('config', $config)) {\n $config['config'] = [];\n }\n $config['config']['bin-dir'] = $binDir;\n }\n if (!in_array($binDir, ['', '.'], true) && !str_starts_with($binDir, $vendorDir . '/')) {\n $gitIgnore[] = '/' . $binDir;\n }\n $gitIgnore[] = '';\n $gitIgnore[] = '# Directories for WordPress plugins and themes controlled by Composer';\n $config['extra']['installer-paths'] = [];\n foreach (self::$installerPaths as $type => $dir) {\n $path = sprintf('%s/%s/{$name}', $directories['content'], $dir);\n $config['extra']['installer-paths'][$path] = [$type];\n $gitIgnore[] = sprintf('/%s/%s', $directories['content'], $dir);\n }\n $root = $this->getProjectRoot();\n foreach (self::$wordpressModules as $type => $info) {\n $gitIgnore[] = '/' . ltrim(str_replace($root, '', $this->getWordpressModulesDirectory($type, 'project')), '/');\n }\n\n $composerJson->write($config);\n $io->write('<info>composer.json is successfully updated</info>');\n $this->configuredComponents['composer'] = $config;\n\n // Create .gitignore\n file_put_contents($this->getProjectRoot() . '/.gitignore', implode(\"\\n\", $gitIgnore));\n $this->configuredComponents['gitignore'] = $gitIgnore;\n } catch (Throwable $e) {\n $this->getIO()->writeError('composer.json configuration failed due to exception: ' . $e->getMessage());\n }\n }", "private static function isExistingJiaoyuProject($path) {\n\t\t\t// Does this path even exist?\n\t\t\tif (!file_exists($path)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Make sure this is a path to a directory (and not a file)\n\t\t\tif (!is_dir($path)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (preg_match(\"/.+\\/$/\", $path)) {\n\t\t\t\tif (file_exists($path . self::CORE_CONFIG_FILE)) {\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} else {\n\t\t\t\tif (file_exists($path . \"/\" . self::CORE_CONFIG_FILE)) {\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}\n\n\t\t\treturn false;\n\t\t}", "private function tryReadComposerJson(&$decodedJsonObject) : bool\n {\n $path = $this->getComposerPath() . DIRECTORY_SEPARATOR . 'composer.json';\n\n // phpcs:disable\n if (!file_exists($path)) {\n return false;\n }\n\n $contents = file_get_contents($path);\n\n // phpcs:enable\n $decodedJsonObject = json_decode($contents, true);\n\n return true;\n }", "public function packagesExists(): bool\n {\n return file_exists($this->rootPath . '/package.json') ? true : false;\n }", "private function ensureComposerFileExists(): void\n {\n $namespaceComposerFile = Factory::getComposerFile();\n\n if (file_exists($namespaceComposerFile)) {\n return;\n }\n\n file_put_contents($namespaceComposerFile, '{}');\n\n $this->logger->logDebug(\n sprintf(\n 'Created the file <comment>%s</comment>.',\n $namespaceComposerFile\n )\n );\n }", "protected function requireRepoToken()\n {\n return $this->serviceName === 'travis-pro'\n && $this->repoToken !== null;\n }", "public function testBuildFakeSymfony()\n {\n $this->assertBuildSucceeds('tests/data/apps/fake-symfony');\n }", "protected function checkSettings()\n {\n $io = $this->event->getIO();\n\n if ($this->disabled) {\n $io->write('<info>[C33sConstructionKitBundle] C33sConstructionKit is disabled</info>');\n\n return false;\n }\n\n if (!is_dir($this->appDir)) {\n $currentDir = getcwd();\n $io->write(\"<warning>[C33sConstructionKitBundle] The symfony-app-dir {$this->appDir} specified in composer.json was not found in {$currentDir}. Cannot generate building blocks file.</warning>\");\n\n return false;\n }\n\n return true;\n }", "public function validateTemplateSource()\n {\n /// check repo exists\n /// check git credentials\n /// check /source has read-write\n }", "protected function isStockComposer()\n {\n // Load lock file into memory.\n $this->loadLock();\n\n $actualHash = $this->getActualHash($this->jsonFile);\n if (!$actualHash) {\n $this->log(\"Cannot calculate hash of {$this->jsonFile}\");\n return false;\n }\n\n // Fetch checksum of the stock composer.json\n $stockHash = $this->getStockHash(self::COMPOSER_JSON);\n if (!$stockHash) {\n $this->log(\"Cannot find stock hash of \" . self::COMPOSER_JSON);\n return false;\n }\n\n if ($actualHash !== $stockHash) {\n $this->log(\"Actual hash of \" . self::COMPOSER_JSON\n . \" ($actualHash) does not match stock hash ($stockHash)\");\n return false;\n }\n\n return true;\n }", "public function isValid()\n {\n return empty($this->moduleName) == false;\n }", "public function checkIfNewProject()\n {\n $newProject = false;\n if (!isset($this->currentStatus, $this->currentStatus->workingBranch)\n || !is_dir($this->gitTasks->getWorkingDir())\n ) {\n $this->deleteFromDisk();\n $this->removeWorkingDir();\n $newProject = true;\n \n $this->currentStatus->workingBranch = $this->gitTasks->config->workingBranch;\n }\n \n return $newProject;\n }", "public function canUseComposer()\n\t{\n\t\tinclude 'composer.php';\n\t\t$composer = new Composer;\n\n\t\tif (!$composer->hasPhp532()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$composer->hasCurl()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($composer->hasApc()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($composer->hasSuhosin()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$composer->hasAllowUrlFopen()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($this->filePermissions) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "private function tryGetVersionNumberFromComposerJson(&$version) : bool\n {\n $composer = null;\n\n if (!$this->tryReadComposerJson($composer)) {\n return false;\n }\n\n if (isset($composer['version'])) {\n $version = $composer['version'];\n\n if ($version !== null && !empty($version)) {\n return true;\n }\n }\n\n return false;\n }", "public function makeInstall(){\n\n $disk = Storage::disk('clients');\n \n if($disk->exists($this->project->directory.'/composer.json'))\n {\n $commands = [\n 'cd '.OctoSettings::get('projects_path').'/'.$this->project->directory,\n 'php artisan october:up',\n 'chown -hR www-data:www-data .',\n 'chmod -R 777 storage'\n ];\n\n SSH::run($commands);\n\n $project = Project::find($this->Project->id);\n if($project){\n $project->is_installed = 1;\n $project->save();\n\n return true;\n\n }else Flash::error(\"The project does not exist in the db, or is not accessible\");\n\n }else Flash::error('Project Does not exists for make install');\n }", "public function testVersion() {\n $this->assertEquals(s\\Client::VERSION, '1.0.11');\n $this->assertEquals(json_decode(file_get_contents('composer.json'))->version, \\SendGrid\\Client::VERSION);\n }", "public function validateLicenseFilePresence()\n {\n return $this->shouldHaveLicenseFile === true;\n }", "private function isCreatingProject(): bool\n {\n return $this->isCreatingProject ??= (static function () {\n $isCreatingProject = false;\n foreach (debug_backtrace() as $item) {\n if (!array_key_exists('object', $item)) {\n continue;\n }\n if ($item['object'] instanceof CreateProjectCommand) {\n $isCreatingProject = true;\n break;\n }\n }\n return $isCreatingProject;\n })();\n }", "public function isUnderGitVersionControl(): bool\n {\n return File::exists(base_path('.git'));\n }" ]
[ "0.6682536", "0.61124146", "0.6072014", "0.59192765", "0.5909139", "0.578326", "0.5765554", "0.5701789", "0.5700105", "0.5645169", "0.5459599", "0.5399586", "0.5397007", "0.5381781", "0.5378238", "0.5267474", "0.52533984", "0.52306026", "0.5229096", "0.5205983", "0.52026397", "0.520142", "0.51998436", "0.51886076", "0.5142984", "0.5131646", "0.5127641", "0.51200616", "0.5092668", "0.5053942" ]
0.6989296
0
Check if the given directory contains a library
public static function isLibraryPath($path) { return is_file("$path/composer.json"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function test_library() {\n ut_autoloader::library(helper_fs::prefix_root('tmp'));\n\n $this->assertTrue(class_exists('d1_util_A') === true, 'depth1 file not loaded');\n $this->assertTrue(class_exists('d1_util_B') === true, 'depth1 file not loaded');\n $this->assertTrue(class_exists('d1_d2_file') === true, 'depth2 file not loaded');\n $this->assertTrue(class_exists('d1_d2_d3_final') === false, 'loaded more classes than settings allow!');\n $this->assertTrue(class_exists('d1_invalid') === false, 'convention is not respected!');\n }", "function exists($path) {\n\t\t$path = JPath::clean($path, false);\n\t\treturn is_dir($path);\n\t}", "public function exists($lib_id) {\n return file_exists($this->id_to_path($lib_id));\n }", "public function isPatchedLibrary($library)\n {\n $existingLibraries = $this->libraryRepository->getPatchedLibrary(\n $library['machineName'],\n $library['majorVersion'],\n $library['minorVersion'],\n $library['patchVersion']\n );\n\n return count($existingLibraries) > 0;\n }", "public function dirExists($dirPath);", "public function isDir();", "public function testBundleFileExists () {\n\t\t$this->assertFileExists (__DIR__ . '/../GorgLdapOrmBundle.php');\n\t}", "public function isLibrary() {\n\t\treturn $this->libraryType == self::TYPE_LIBRARY;\n\t}", "function dir_exists($path)\n {\n @clearstatcache();\n return (file_exists($path) && is_dir($path));\n }", "function checkDir($Dir){\n if(file_exists($Dir) && is_dir($Dir)):\n return true;\n else:\n return false;\n endif;\n}", "function file_exists_folder($path)\r\n{\r\n return (@file_exists($path) && @is_dir($path));\r\n}", "protected function _pathIsSafe($path)\n {\n if ($path && strpos($path, LIBRARY) === 0 && is_readable($path)) {\n return true;\n }\n\n return false;\n }", "function is_dir ($filename) {}", "public function isLibraryInstalled() {\n return class_exists('Mandrill');\n }", "public function isDirectory(): bool;", "public static function loadLibrary($library)\n {\n if (is_array($library) && count($library) > 0) {\n \n $results = false;\n \n foreach ($library as $item)\n $results = static::loadLibrary($item);\n \n return $results;\n }\n\n if( !is_string($library) )\n return false;\n\n if( is_array(static::$libraries) && in_array($library, static::$libraries) )\n return true;\n\n if( !file_exists(SYSPATH. '/libraries/' .$library .'.php') )\n return false;\n\n require_once(SYSPATH. '/libraries/' .$library .'.php');\n\n if (!isset(static::$libraries))\n static::$libraries = array();\n\n static::$libraries[] = $library;\n\n // auto instanciate\n $class_lib = ucfirst($library);\n\n App::$log->debug('Loaded Library: '.$library);\n\n if (!class_exists($class_lib))\n return false;\n\n return new $class_lib();\n\n }", "public function isDir($path);", "function libLoader($s_lib)\n{\n $s_filename = strtolower($s_lib) . '.lib.php';\n $s_file = LIBRARY_PATH.'/'.$s_filename;\n if (!file_exists($s_file))\n {\n return false;\n }\n include_once $s_file;\n}", "static public function checkDir($fullpath)\r\n\t{\r\n\t\t$fullpath = (string) $fullpath;\r\n\t\t\r\n\t\tif ( file_exists($fullpath) )\r\n\t\t{\r\n\t\t\tif ( is_dir($fullpath) && is_writable($fullpath) )\r\n\t\t\t{\r\n\t\t\t\treturn TRUE;\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\tif ( !@mkdir($fullpath, 0777) )\r\n\t\t\t{\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn TRUE;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function checkLibraryAvailable()\n\t{\n\t\t$check = new LibrariesAvailable('gd');\n\t}", "private function isBookStackDir()\n {\n $dir = getcwd();\n $composer = $dir . '/composer.json';\n $versionFile = $dir . '/version';\n\n if (!file_exists($composer) || !file_exists($versionFile)) return false;\n\n $composerData = json_decode(file_get_contents($composer));\n if (!isset($composerData->name)) return false;\n if (strpos(strtolower(explode('/', $composerData->name)[1]), 'bookstack') === false) return false;\n\n return true;\n }", "public function directoryExists(): bool\n {\n return File::exists($this->directory);\n }", "function checkDirForClasses($class)\n{\n\n\tif (!preg_match('/classes\\/(.+)/', $class, $matches))\n\t\treturn false;\n\n\treturn true;\n\n}", "protected static function testPath($path) {\n\t\treturn is_dir($path);\n\t}", "public function packagesExists(): bool\n {\n return file_exists($this->rootPath . '/package.json') ? true : false;\n }", "public static function embedded()\n {\n return strpos( self::mainFile(), DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'addons' . DIRECTORY_SEPARATOR ) > 0;\n }", "function file_check_directory(&$directory) {\n $directory = rtrim($directory, '/\\\\');\n return is_dir($directory) && is_writable($directory);\n}", "function _wetkit_wetboew_libraries_variant_exists($library, $variant_name, $required_file) {\n return file_exists($library['library path'] . '/' . $required_file);\n}", "public function hasDirectory()\n {\n return ! empty($this->directories);\n }", "public function exists(): bool\n {\n return is_dir($this->root()) === true;\n }" ]
[ "0.64257306", "0.61601835", "0.61447793", "0.61312383", "0.60930836", "0.60058373", "0.5977951", "0.59353215", "0.59081423", "0.58955085", "0.5894053", "0.5879016", "0.58757454", "0.5847664", "0.58228034", "0.5808852", "0.57631254", "0.57353467", "0.57291937", "0.5669113", "0.56213367", "0.56200165", "0.560865", "0.55987465", "0.5591589", "0.55797046", "0.5578818", "0.55756915", "0.55675393", "0.55613697" ]
0.71486545
0
Get github slug. E.g. silverstripe/silverstripeframework, or null if not on github
public function getGithubSlug() { $data = $this->getCowData(); if (isset($data['github-slug'])) { return $data['github-slug']; } // Guess from git remote $remotes = $this->getRemotes(); foreach ($remotes as $remote) { if (preg_match('#github.com(/|:)(?<slug>[^\\s/\\.]+/[^\\s/\\.]+)#', $remote, $matches)) { return $matches['slug']; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_slug(): string {\n\t\treturn $this->project->slug;\n\t}", "public function getSlug(): ?string\n {\n return $this->slug;\n }", "function bbp_maybe_get_root_slug()\n{\n}", "function getURL()\n {\n if (!empty($this->url)) {\n return $this->url;\n }\n\n if (!empty($this->canonical)) {\n return $this->canonical;\n }\n\n if (!$this->getSlug() && ($this->getID())) {\n return \\Idno\\Core\\site()->config()->url . 'github/' . $this->getID() . '/' . $this->getPrettyURLTitle();\n } else {\n return parent::getURL();\n }\n\n }", "protected function get_slug(): string {\n\t\t$year = gmdate( 'Y', strtotime( $this->plato_project->get_start_date() ) );\n\t\t$code = $this->plato_project->get_code();\n\t\t$country = $this->country->get_name();\n\t\t$work = $this->work_types[0]->get_name();\n\t\tif ( count( $this->work_types ) > 1 ) {\n\t\t\t$work .= ' en ' . $this->work_types[1]->get_name();\n\t\t}\n\t\treturn sanitize_title( sprintf( '%s-%s-%s-%s', $year, $code, $country, $work ) );\n\t}", "public function getSlug() : string;", "public function getSlug();", "public function getSlug();", "function trimGitHub($github) {\r\n\r\n global $githubArray;\r\n $github = strtolower($github);\r\n $github = trim($github);\r\n\r\n foreach($githubArray as $val)\r\n {\r\n if (stripos($github, $val) !== FALSE)\r\n {\r\n $github = str_replace($val, \"\", $github);\r\n }\r\n }\r\n\r\n $github = \"https://www.github.com/\" . $github;\r\n return $github;\r\n }", "public function get_slug();", "public function getSlug(): string\n {\n return $this->slug;\n }", "public function get_repository_ssh_url(): ?string {\n\t\t$url = gp_get_meta( 'project', $this->project->id, static::REPOSITORY_SSH_URL_KEY );\n\n\t\treturn $url ?: null;\n\t}", "public function getSlug()\n {\n if ($slug = array_get($this->data, 'slug')) {\n return $slug;\n }\n\n $slug = $this->slug;\n\n // Remove any hidden/draft indicators\n return ltrim($slug, '__');\n }", "public function getSlug(){\n if( $slug = $this->slug ){\n return $slug;\n }\n // fall back to runtime handle\n return $this->getHandle();\n }", "function tuu_get_the_slug() {\n return basename(get_permalink());\n}", "private function getUrlSlug(): string\n {\n if (static::URL_SLUG !== null) {\n return static::URL_SLUG;\n }\n\n return str_replace(['_', '-'], '', lcfirst(ucwords(static::SLUG, '_-')));\n }", "public function get_slug() {\n\t\t\treturn apply_filters( 'pue_get_slug', $this->slug );\n\t\t}", "public function get_repository_url(): ?string {\n\t\t$url = gp_get_meta( 'project', $this->project->id, static::REPOSITORY_URL_KEY );\n\n\t\treturn $url ?: null;\n\t}", "public function slug(): string\n {\n return $this->get('slug');\n }", "function get_the_slug() {\n\tglobal $post;\n\tif ( is_single() || is_page() ) {\n\t\treturn $post->post_name;\n\t} else {\n\t\treturn \"\";\n\t}\n}", "function the_slug(){\n\tglobal $blog;\n\treturn $blog->the_slug();\n}", "public function getGitUrl();", "public function slug()\n {\n $slug = mb_substr(str_replace(' ', '-', $this->project_name), 0, 50);\n if (!$slug) {\n return $this->id;\n }\n\n return $slug;\n }", "function get_slug_from_path( string $root, string $path ) : string {\n\tif ( substr( $path, 0, strlen( $root ) ) !== $root ) {\n\t\t// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\ttrigger_error( sprintf( 'Relative path %s is not within root %s', $path, $root ), E_USER_WARNING );\n\n\t\treturn $path;\n\t}\n\n\t$out_path = substr( $path, strlen( $root ) );\n\n\treturn trim( preg_replace( '/README\\.md/i', '', $out_path ), '/' );\n}", "abstract protected function get_slug();", "abstract protected function get_slug();", "public function get_repository_name(): ?string {\n\t\t$name = gp_get_meta( 'project', $this->project->id, static::REPOSITORY_NAME_KEY );\n\n\t\treturn $name ?: null;\n\t}", "function tuu_the_slug() {\n echo tuu_get_the_slug();\n}", "public function getSlug()\n {\n return $this->slug;\n }", "public function getSlug() { return (string)$this->slug; }" ]
[ "0.6627997", "0.6531987", "0.65200984", "0.6466923", "0.6458401", "0.6376743", "0.6354066", "0.6354066", "0.6345098", "0.6312228", "0.62008774", "0.6165842", "0.6149395", "0.6147261", "0.6145484", "0.6125695", "0.61106586", "0.6054586", "0.6014973", "0.60142136", "0.5989892", "0.5982863", "0.59698445", "0.59533757", "0.593444", "0.593444", "0.59223515", "0.5897026", "0.58706564", "0.5866884" ]
0.8720466
0